зеркало из https://github.com/microsoft/tfs-cli.git
Remove workaround method and align on gallery resource arrea
This commit is contained in:
Родитель
9a5fa98a1a
Коммит
3afdc1c86f
|
@ -318,16 +318,10 @@ export class ExtensionBase<T> extends TfCommand<ExtensionArguments, T> {
|
|||
return this.getHelp(cmd);
|
||||
}
|
||||
|
||||
/**** TEMPORARY until Marketplace fixes getResourceArea ****/
|
||||
protected async getGalleryApi() {
|
||||
const handler = await this.getCredentials(this.webApi.serverUrl, false);
|
||||
return new GalleryApi(this.webApi.serverUrl, [handler]); // await this.webApi.getGalleryApi(this.webApi.serverUrl);
|
||||
}
|
||||
/**** TEMPORARY until Marketplace fixes getResourceArea ****/
|
||||
|
||||
public static async getMarketplaceUrl(): Promise<string[]> {
|
||||
const RESOURCE_AREA_ID = "69D21C00-F135-441B-B5CE-3626378E0819"
|
||||
trace.debug("getMarketplaceUrl");
|
||||
const url = "https://app.vssps.visualstudio.com/_apis/resourceareas/69D21C00-F135-441B-B5CE-3626378E0819";
|
||||
const url = `https://app.vssps.visualstudio.com/_apis/resourceareas/${RESOURCE_AREA_ID}`;
|
||||
const response = await new Promise<string>((resolve, reject) => {
|
||||
https
|
||||
.get(url, resp => {
|
||||
|
|
|
@ -38,7 +38,7 @@ export class ExtensionIsValid extends extBase.ExtensionBase<galleryContracts.Pub
|
|||
}
|
||||
|
||||
public async exec(): Promise<string> {
|
||||
const galleryApi = await this.getGalleryApi();
|
||||
const galleryApi = await this.webApi.getGalleryApi(this.webApi.serverUrl);
|
||||
|
||||
const extInfo = await this.identifyExtension();
|
||||
const version = await this.commandArgs.version.val();
|
||||
|
|
|
@ -69,7 +69,7 @@ export class ExtensionPublish extends extBase.ExtensionBase<ExtensionPublishResu
|
|||
}
|
||||
|
||||
public async exec(): Promise<ExtensionPublishResult> {
|
||||
const galleryApi = await this.getGalleryApi();
|
||||
const galleryApi = await this.webApi.getGalleryApi(this.webApi.serverUrl)
|
||||
let result = <ExtensionPublishResult>{};
|
||||
|
||||
const publishSettings = await this.getPublishSettings();
|
||||
|
|
|
@ -37,7 +37,7 @@ export class ExtensionShare extends extBase.ExtensionBase<string[]> {
|
|||
}
|
||||
|
||||
public async exec(): Promise<string[]> {
|
||||
const galleryApi = await this.getGalleryApi();
|
||||
const galleryApi = await this.webApi.getGalleryApi(this.webApi.serverUrl);
|
||||
|
||||
return this.commandArgs.vsix.val(true).then(vsixPath => {
|
||||
let extInfoPromise: Promise<extInfo.CoreExtInfo>;
|
||||
|
|
|
@ -27,7 +27,7 @@ export class ExtensionShow extends extBase.ExtensionBase<galleryContracts.Publis
|
|||
}
|
||||
|
||||
public async exec(): Promise<galleryContracts.PublishedExtension> {
|
||||
const galleryApi = await this.getGalleryApi();
|
||||
const galleryApi = await this.webApi.getGalleryApi(this.webApi.serverUrl);
|
||||
|
||||
return this.identifyExtension().then(extInfo => {
|
||||
let sharingMgr = new publishUtils.SharingManager({}, galleryApi, extInfo);
|
||||
|
|
|
@ -27,7 +27,7 @@ export class ExtensionUnpublish extends extBase.ExtensionBase<galleryContracts.P
|
|||
}
|
||||
|
||||
public async exec(): Promise<boolean> {
|
||||
const galleryApi = await this.getGalleryApi();
|
||||
const galleryApi = await this.webApi.getGalleryApi(this.webApi.serverUrl);
|
||||
|
||||
const extInfo = await this.identifyExtension();
|
||||
await galleryApi.deleteExtension(extInfo.publisher, extInfo.id);
|
||||
|
|
|
@ -38,7 +38,7 @@ export class ExtensionShare extends extBase.ExtensionBase<string[]> {
|
|||
}
|
||||
|
||||
public async exec(): Promise<string[]> {
|
||||
const galleryApi = await this.getGalleryApi();
|
||||
const galleryApi = await this.webApi.getGalleryApi(this.webApi.serverUrl);
|
||||
|
||||
return this.commandArgs.vsix.val(true).then(vsixPath => {
|
||||
let extInfoPromise: Promise<extInfo.CoreExtInfo>;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "tfx-cli",
|
||||
"version": "0.17.0",
|
||||
"version": "0.18.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "tfx-cli",
|
||||
"version": "0.17.0",
|
||||
"version": "0.18.0",
|
||||
"description": "CLI for Azure DevOps Services and Team Foundation Server",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
Загрузка…
Ссылка в новой задаче