@vscode/vsce 2.25.1-1 → 2.25.1-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/main.js +1 -1
- package/out/store.js +4 -13
- package/package.json +1 -1
package/out/main.js
CHANGED
|
@@ -224,7 +224,7 @@ module.exports = function (argv) {
|
|
|
224
224
|
.command('verify-pat [publisher]')
|
|
225
225
|
.description('Verifies if the Personal Access Token has publish rights for the publisher')
|
|
226
226
|
.option('-p, --pat <token>', 'Personal Access Token (defaults to VSCE_PAT environment variable)', process.env['VSCE_PAT'])
|
|
227
|
-
.action((
|
|
227
|
+
.action((publisherName, { pat }) => main((0, store_1.verifyPat)({ publisherName, pat })));
|
|
228
228
|
commander_1.default
|
|
229
229
|
.command('show <extensionid>')
|
|
230
230
|
.description(`Shows an extension's metadata`)
|
package/out/store.js
CHANGED
|
@@ -111,18 +111,9 @@ class KeytarStore {
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
exports.KeytarStore = KeytarStore;
|
|
114
|
-
async function verifyPat(
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
if (!publisherName) {
|
|
119
|
-
try {
|
|
120
|
-
publisherName = (await (0, package_1.readManifest)()).publisher;
|
|
121
|
-
}
|
|
122
|
-
catch (error) {
|
|
123
|
-
throw new Error(`Can not read the publisher's name. Either supply it as an argument or run vsce from the extension folder. Additional information:\n\n${error}`);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
114
|
+
async function verifyPat(options) {
|
|
115
|
+
const publisherName = options.publisherName ?? (await (0, package_1.readManifest)()).publisher;
|
|
116
|
+
const pat = options.pat ?? (await getPublisher(publisherName)).pat;
|
|
126
117
|
try {
|
|
127
118
|
// If the caller of the `getRoleAssignments` API has any of the roles
|
|
128
119
|
// (Creator, Owner, Contributor, Reader) on the publisher, we get a 200,
|
|
@@ -139,7 +130,7 @@ exports.verifyPat = verifyPat;
|
|
|
139
130
|
async function requestPAT(publisherName) {
|
|
140
131
|
console.log(`${(0, util_1.getMarketplaceUrl)()}/manage/publishers/`);
|
|
141
132
|
const pat = await (0, util_1.read)(`Personal Access Token for publisher '${publisherName}':`, { silent: true, replace: '*' });
|
|
142
|
-
await verifyPat(
|
|
133
|
+
await verifyPat({ publisherName, pat });
|
|
143
134
|
return pat;
|
|
144
135
|
}
|
|
145
136
|
async function openDefaultStore() {
|