Feature/issue 214 add show command#215
Feature/issue 214 add show command#215joaomoreno merged 13 commits intomicrosoft:masterfrom raix:feature/issue-214-add-show-command
Conversation
It will grab an available `pat` and query extensio gallary (ro)
Initial version of show command Usage: ```bash $ vsce show gitlens.eamodio # or as json $ vsce show gitlens.eamodio --json ```
| .description('Remove a publisher from the known publishers list') | ||
| .action(name => main(logoutPublisher(name))); | ||
|
|
||
| program |
There was a problem hiding this comment.
Let's use extensionid, just like unpublish.
src/show.ts
Outdated
| ExtensionQueryFlags.IncludeMetadata | | ||
| ExtensionQueryFlags.IncludeStatistics | | ||
| ExtensionQueryFlags.IncludeVersions; | ||
| return getExtension(extensionPublisher, extensionName, undefined, flags) |
There was a problem hiding this comment.
yeah - also taking into account that it doesn't work for you, would be nice to have more debugging.
There was a problem hiding this comment.
@joaomoreno I'm wondering why it errors Invalid Resource could you do npm list vso-node-api to see what version of the api you are on?
(I'm at [email protected])
src/show.ts
Outdated
| export type ViewTable = ViewTableRow[]; | ||
|
|
||
| export function show(extensionUniqIdentifier: string, json: boolean = false): Promise<any> { | ||
| const [extensionPublisher, extensionName] = extensionUniqIdentifier.split(/\.(.+)?/, 2); |
There was a problem hiding this comment.
Kind of a strange regex here. You just need .split('.').
There was a problem hiding this comment.
I assumed that name could contain dots, found https://github.com/Microsoft/vscode-vsce/blob/master/src/publish.ts#L185 :)
There was a problem hiding this comment.
After second thought, extensionName could have dots - but it would not be valid. eg.: vsce show mortenhenriksen.perl-debug.foo would return the package perl-debug. I've made the extensionId "parsing" more readable so it throws on invalid extension names.
There was a problem hiding this comment.
Publishers and extension names can't have dots. 👍 The Marketplace doesn't support it.
* naming consistency "extensionUniqIdentifier" -> "extensionid" * Make extensionid parser more readable
This can happen if access token is invalid/has expired. The solution added in this commit: * Try each available token until success or all failed. Not ideal but we require a PAT since we access `_apis/gallery` and not `_apis/public/gallery/extensionquery`
|
@raix Got the same |
|
@joaomoreno I've added error handler for the "Invalid Resource" error with the current constraints, would be nice if the public api was available in |
|
Yup, that was it! I had an old access token. Interesting, I wonder if we can get this to work without depending on login. Love those unicode stars! ★ ★ ★ ★ ★ |
|
We could just make a post call directly to the public api v3.preview |
* add minimal `PublicGalleryAPI` * no PAT requirements
It will deprecate in the future + not that useful
|
@joaomoreno I've added (one could ague that it belongs in vso-node-api) |
also break on more than space
|
Great stuff. Thanks! 🍻 |
|
@modigrv Is there any way we can use the |
|
( Currently using the public /_apis/public the /gallery/extensionquery - similar to whats done in vs code) |


This pr. contains the initial proposal for a “show” extension metadata command
Usage: