Remove workaround method and align on gallery resource arrea

This commit is contained in:
Ismayil Ismayilov 2024-09-04 02:12:07 +04:00
Родитель 9a5fa98a1a
Коммит 3afdc1c86f
9 изменённых файлов: 10 добавлений и 16 удалений

Просмотреть файл

@ -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>;

2
package-lock.json сгенерированный
Просмотреть файл

@ -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",