Skip to content

Remove workaround method and align on gallery resource area #463

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions app/exec/extension/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down
2 changes: 1 addition & 1 deletion app/exec/extension/isvalid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion app/exec/extension/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion app/exec/extension/share.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand Down
2 changes: 1 addition & 1 deletion app/exec/extension/show.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion app/exec/extension/unpublish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion app/exec/extension/unshare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down