ovsx 1.2.0 → 1.4.0
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/README.md +7 -1
- package/lib/check-license.d.ts.map +1 -1
- package/lib/check-license.js +5 -4
- package/lib/check-license.js.map +1 -1
- package/lib/create-namespace.d.ts.map +1 -1
- package/lib/create-namespace.js +3 -1
- package/lib/create-namespace.js.map +1 -1
- package/lib/get.js +5 -5
- package/lib/get.js.map +1 -1
- package/lib/http.d.ts +32 -0
- package/lib/http.d.ts.map +1 -0
- package/lib/http.js +170 -0
- package/lib/http.js.map +1 -0
- package/lib/index.d.ts +0 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +0 -3
- package/lib/index.js.map +1 -1
- package/lib/main.js +50 -61
- package/lib/main.js.map +1 -1
- package/lib/oidc.d.ts.map +1 -1
- package/lib/oidc.js +5 -47
- package/lib/oidc.js.map +1 -1
- package/lib/pat.d.ts +6 -1
- package/lib/pat.d.ts.map +1 -1
- package/lib/pat.js +16 -7
- package/lib/pat.js.map +1 -1
- package/lib/publish.d.ts +6 -0
- package/lib/publish.d.ts.map +1 -1
- package/lib/publish.js +147 -40
- package/lib/publish.js.map +1 -1
- package/lib/registry.d.ts +50 -12
- package/lib/registry.d.ts.map +1 -1
- package/lib/registry.js +131 -126
- package/lib/registry.js.map +1 -1
- package/lib/trusted-publishing-options.d.ts +5 -0
- package/lib/trusted-publishing-options.d.ts.map +1 -1
- package/lib/trusted-publishing.js +28 -4
- package/lib/trusted-publishing.js.map +1 -1
- package/lib/unpublish.d.ts.map +1 -1
- package/lib/unpublish.js +5 -8
- package/lib/unpublish.js.map +1 -1
- package/lib/util.d.ts +19 -15
- package/lib/util.d.ts.map +1 -1
- package/lib/util.js +51 -71
- package/lib/util.js.map +1 -1
- package/lib/verify-pat.d.ts.map +1 -1
- package/lib/verify-pat.js +3 -1
- package/lib/verify-pat.js.map +1 -1
- package/lib/verify.js +2 -2
- package/lib/verify.js.map +1 -1
- package/lib/zip.d.ts.map +1 -1
- package/lib/zip.js +2 -10
- package/lib/zip.js.map +1 -1
- package/package.json +19 -14
- package/src/check-license.ts +5 -4
- package/src/create-namespace.ts +3 -1
- package/src/get.ts +6 -6
- package/src/http.ts +176 -0
- package/src/index.ts +0 -3
- package/src/main.ts +54 -63
- package/src/oidc.ts +5 -47
- package/src/pat.ts +22 -9
- package/src/publish.ts +187 -44
- package/src/registry.ts +153 -126
- package/src/trusted-publishing-options.ts +5 -0
- package/src/trusted-publishing.ts +33 -5
- package/src/unpublish.ts +4 -7
- package/src/util.ts +47 -73
- package/src/verify-pat.ts +3 -1
- package/src/verify.ts +3 -3
- package/src/zip.ts +2 -12
- package/lib/version.d.ts +0 -2
- package/lib/version.d.ts.map +0 -1
- package/lib/version.js +0 -5
- package/lib/version.js.map +0 -1
- package/src/version.ts +0 -1
package/lib/util.d.ts
CHANGED
|
@@ -7,12 +7,9 @@
|
|
|
7
7
|
*
|
|
8
8
|
* SPDX-License-Identifier: EPL-2.0
|
|
9
9
|
********************************************************************************/
|
|
10
|
-
import * as fs from 'fs';
|
|
11
|
-
import * as tmp from 'tmp';
|
|
12
10
|
import * as http from 'http';
|
|
13
11
|
import { RegistryOptions } from './registry-options';
|
|
14
12
|
import { TrustedPublishingOptions } from './trusted-publishing-options';
|
|
15
|
-
export { promisify } from 'util';
|
|
16
13
|
export declare function addEnvOptions(options: RegistryOptions): void;
|
|
17
14
|
export declare function addTrustedPublishingEnvOptions(options: TrustedPublishingOptions): void;
|
|
18
15
|
/** How long a request may make no progress before it is abandoned; see RegistryOptions.timeout. */
|
|
@@ -29,15 +26,22 @@ export declare function configuredTimeout(): number;
|
|
|
29
26
|
*/
|
|
30
27
|
export declare function parseNonNegativeInt(value: string): number;
|
|
31
28
|
export declare function matchExtensionId(id: string): RegExpExecArray | null;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Levenshtein distance between `a` and `b`: the minimum number of single-character insertions,
|
|
31
|
+
* deletions or substitutions needed to turn one into the other. Used to suggest the closest known
|
|
32
|
+
* command for a typo.
|
|
33
|
+
*/
|
|
34
|
+
export declare function levenshtein(a: string, b: string): number;
|
|
35
|
+
/**
|
|
36
|
+
* Returns a random, not-yet-created file path ending in `postfix`, directly in the OS temp directory.
|
|
37
|
+
*/
|
|
38
|
+
export declare function getTempFilePath(postfix?: string): string;
|
|
35
39
|
export declare function rejectError(err: any): Promise<never>;
|
|
36
40
|
export declare function handleError(debug?: boolean, additionalMessage?: string, exit?: boolean): (reason: any) => void;
|
|
37
41
|
/**
|
|
38
|
-
* Formats a byte count for display, e.g. `1536` -> `1
|
|
39
|
-
* `FileUtils.byteCountToDisplaySize` formatting so client- and
|
|
40
|
-
* the same way.
|
|
42
|
+
* Formats a byte count for display, rounding down, e.g. `1536` -> `1 KB` and `1048577` -> `1 MB`.
|
|
43
|
+
* Mirrors the registry's own `FileUtils.byteCountToDisplaySize` formatting so client- and
|
|
44
|
+
* server-side size limit messages read the same way.
|
|
41
45
|
*/
|
|
42
46
|
export declare function formatBytes(bytes: number): string;
|
|
43
47
|
/**
|
|
@@ -51,17 +55,17 @@ export declare function withStatus(error: Error, status?: number): StatusError;
|
|
|
51
55
|
/**
|
|
52
56
|
* A URL in the form it can safely be printed: no user info and no query string.
|
|
53
57
|
*
|
|
54
|
-
*
|
|
55
|
-
* `
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
+
* The personal access token travels in a header now, but `createNamespace`, `verifyPat`, `publish`
|
|
59
|
+
* and `delete` still carry it in the query string too when talking to a registry too old to resolve
|
|
60
|
+
* it from the header (see `Registry.tokenQuery`, #1344). An error message goes straight to stderr
|
|
61
|
+
* and from there into CI logs, and the query carries nothing an error needs - so it stays dropped
|
|
62
|
+
* whole rather than filtered key by key, a filter having to be kept in step with every parameter
|
|
63
|
+
* anyone ever adds.
|
|
58
64
|
*/
|
|
59
65
|
export declare function redactUrl(url: URL | string): string;
|
|
60
66
|
export declare function statusError(response: http.IncomingMessage): StatusError;
|
|
61
|
-
export declare function readFile(name: string, packagePath?: string, encoding?: BufferEncoding): Promise<string>;
|
|
62
67
|
export declare function readManifest(packagePath?: string): Promise<Manifest>;
|
|
63
68
|
export declare function validateManifest(manifest: Manifest): void;
|
|
64
|
-
export declare function writeFile(name: string, content: string, packagePath?: string, encoding?: BufferEncoding): Promise<void>;
|
|
65
69
|
export declare function writeManifest(manifest: Manifest, packagePath?: string): Promise<void>;
|
|
66
70
|
export interface Manifest {
|
|
67
71
|
publisher: string;
|
package/lib/util.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA;;;;;;;;kFAQkF;
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA;;;;;;;;kFAQkF;AAMlF,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAExE,wBAAgB,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAM5D;AAED,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI,CAKtF;AAED,mGAAmG;AACnG,eAAO,MAAM,eAAe,QAAS,CAAC;AAEtC;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAmBD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOzD;AAED,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAEnE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAqBxD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,SAAK,GAAG,MAAM,CAEpD;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,GAAG,kBAGnC;AAED,wBAAgB,WAAW,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,iBAAiB,CAAC,EAAE,MAAM,EAAE,IAAI,GAAE,OAAc,GAAG,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAmBpH;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CASjD;AAED;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,KAAK;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,CAIrE;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,MAAM,CAQnD;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,eAAe,GAAG,WAAW,CAKvE;AAED,wBAAsB,YAAY,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAG1E;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAUzD;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGrF;AAED,MAAM,WAAW,QAAQ;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
package/lib/util.js
CHANGED
|
@@ -9,31 +9,28 @@
|
|
|
9
9
|
* SPDX-License-Identifier: EPL-2.0
|
|
10
10
|
********************************************************************************/
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.DEFAULT_TIMEOUT =
|
|
12
|
+
exports.DEFAULT_TIMEOUT = void 0;
|
|
13
13
|
exports.addEnvOptions = addEnvOptions;
|
|
14
14
|
exports.addTrustedPublishingEnvOptions = addTrustedPublishingEnvOptions;
|
|
15
15
|
exports.configuredTimeout = configuredTimeout;
|
|
16
16
|
exports.parseNonNegativeInt = parseNonNegativeInt;
|
|
17
17
|
exports.matchExtensionId = matchExtensionId;
|
|
18
|
-
exports.
|
|
19
|
-
exports.
|
|
20
|
-
exports.createTempFile = createTempFile;
|
|
18
|
+
exports.levenshtein = levenshtein;
|
|
19
|
+
exports.getTempFilePath = getTempFilePath;
|
|
21
20
|
exports.rejectError = rejectError;
|
|
22
21
|
exports.handleError = handleError;
|
|
23
22
|
exports.formatBytes = formatBytes;
|
|
24
23
|
exports.withStatus = withStatus;
|
|
25
24
|
exports.redactUrl = redactUrl;
|
|
26
25
|
exports.statusError = statusError;
|
|
27
|
-
exports.readFile = readFile;
|
|
28
26
|
exports.readManifest = readManifest;
|
|
29
27
|
exports.validateManifest = validateManifest;
|
|
30
|
-
exports.writeFile = writeFile;
|
|
31
28
|
exports.writeManifest = writeManifest;
|
|
29
|
+
const crypto = require("crypto");
|
|
32
30
|
const fs = require("fs");
|
|
31
|
+
const os = require("os");
|
|
33
32
|
const path = require("path");
|
|
34
|
-
const
|
|
35
|
-
var util_1 = require("util");
|
|
36
|
-
Object.defineProperty(exports, "promisify", { enumerable: true, get: function () { return util_1.promisify; } });
|
|
33
|
+
const commander_1 = require("commander");
|
|
37
34
|
function addEnvOptions(options) {
|
|
38
35
|
options.registryUrl ?? (options.registryUrl = process.env.OVSX_REGISTRY_URL);
|
|
39
36
|
options.pat ?? (options.pat = process.env.OVSX_PAT);
|
|
@@ -45,6 +42,7 @@ function addTrustedPublishingEnvOptions(options) {
|
|
|
45
42
|
options.trustedPublishing ?? (options.trustedPublishing = parseBooleanEnv(process.env.OVSX_TRUSTED_PUBLISHING));
|
|
46
43
|
options.idToken ?? (options.idToken = process.env.OVSX_ID_TOKEN);
|
|
47
44
|
options.oidcAudience ?? (options.oidcAudience = process.env.OVSX_OIDC_AUDIENCE);
|
|
45
|
+
options.registrationCode ?? (options.registrationCode = process.env.OVSX_REGISTRATION_CODE);
|
|
48
46
|
}
|
|
49
47
|
/** How long a request may make no progress before it is abandoned; see RegistryOptions.timeout. */
|
|
50
48
|
exports.DEFAULT_TIMEOUT = 30000;
|
|
@@ -78,42 +76,46 @@ function parseBooleanEnv(value) {
|
|
|
78
76
|
function parseNonNegativeInt(value) {
|
|
79
77
|
const parsed = Number(value);
|
|
80
78
|
if (!Number.isInteger(parsed) || parsed < 0) {
|
|
81
|
-
|
|
79
|
+
// Commander prints only this error type as a usage message; anything else escapes as a stack trace.
|
|
80
|
+
throw new commander_1.InvalidArgumentError(`Expected a non-negative whole number, got '${value}'.`);
|
|
82
81
|
}
|
|
83
82
|
return parsed;
|
|
84
83
|
}
|
|
85
84
|
function matchExtensionId(id) {
|
|
86
85
|
return /^([\w-]+)(?:\.|\/)([\w-]+)$/.exec(id);
|
|
87
86
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
function
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
87
|
+
/**
|
|
88
|
+
* Levenshtein distance between `a` and `b`: the minimum number of single-character insertions,
|
|
89
|
+
* deletions or substitutions needed to turn one into the other. Used to suggest the closest known
|
|
90
|
+
* command for a typo.
|
|
91
|
+
*/
|
|
92
|
+
function levenshtein(a, b) {
|
|
93
|
+
if (a === b) {
|
|
94
|
+
return 0;
|
|
95
|
+
}
|
|
96
|
+
// The distance is symmetric, so keep the shorter string in `b` to bound the row size.
|
|
97
|
+
if (b.length > a.length) {
|
|
98
|
+
[a, b] = [b, a];
|
|
99
|
+
}
|
|
100
|
+
// A single row of the edit distance matrix, seeded with the distance between the empty prefix
|
|
101
|
+
// of `a` and every prefix of `b`.
|
|
102
|
+
const row = Array.from({ length: b.length + 1 }, (_, j) => j);
|
|
103
|
+
for (let i = 1; i <= a.length; i++) {
|
|
104
|
+
let diagonal = row[0];
|
|
105
|
+
row[0] = i;
|
|
106
|
+
for (let j = 1; j <= b.length; j++) {
|
|
107
|
+
const above = row[j];
|
|
108
|
+
row[j] = Math.min(row[j - 1] + 1, above + 1, diagonal + (a[i - 1] === b[j - 1] ? 0 : 1));
|
|
109
|
+
diagonal = above;
|
|
105
110
|
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
resolve(name);
|
|
115
|
-
});
|
|
116
|
-
});
|
|
111
|
+
}
|
|
112
|
+
return row[b.length];
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Returns a random, not-yet-created file path ending in `postfix`, directly in the OS temp directory.
|
|
116
|
+
*/
|
|
117
|
+
function getTempFilePath(postfix = '') {
|
|
118
|
+
return path.join(os.tmpdir(), `ovsx-${crypto.randomUUID()}${postfix}`);
|
|
117
119
|
}
|
|
118
120
|
function rejectError(err) {
|
|
119
121
|
const reason = err instanceof Error ? err : new Error(String(err));
|
|
@@ -142,9 +144,9 @@ function handleError(debug, additionalMessage, exit = true) {
|
|
|
142
144
|
};
|
|
143
145
|
}
|
|
144
146
|
/**
|
|
145
|
-
* Formats a byte count for display, e.g. `1536` -> `1
|
|
146
|
-
* `FileUtils.byteCountToDisplaySize` formatting so client- and
|
|
147
|
-
* the same way.
|
|
147
|
+
* Formats a byte count for display, rounding down, e.g. `1536` -> `1 KB` and `1048577` -> `1 MB`.
|
|
148
|
+
* Mirrors the registry's own `FileUtils.byteCountToDisplaySize` formatting so client- and
|
|
149
|
+
* server-side size limit messages read the same way.
|
|
148
150
|
*/
|
|
149
151
|
function formatBytes(bytes) {
|
|
150
152
|
const units = ['bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'];
|
|
@@ -164,10 +166,12 @@ function withStatus(error, status) {
|
|
|
164
166
|
/**
|
|
165
167
|
* A URL in the form it can safely be printed: no user info and no query string.
|
|
166
168
|
*
|
|
167
|
-
*
|
|
168
|
-
* `
|
|
169
|
-
*
|
|
170
|
-
*
|
|
169
|
+
* The personal access token travels in a header now, but `createNamespace`, `verifyPat`, `publish`
|
|
170
|
+
* and `delete` still carry it in the query string too when talking to a registry too old to resolve
|
|
171
|
+
* it from the header (see `Registry.tokenQuery`, #1344). An error message goes straight to stderr
|
|
172
|
+
* and from there into CI logs, and the query carries nothing an error needs - so it stays dropped
|
|
173
|
+
* whole rather than filtered key by key, a filter having to be kept in step with every parameter
|
|
174
|
+
* anyone ever adds.
|
|
171
175
|
*/
|
|
172
176
|
function redactUrl(url) {
|
|
173
177
|
try {
|
|
@@ -185,20 +189,8 @@ function statusError(response) {
|
|
|
185
189
|
: `The server responded with status ${response.statusCode}.`;
|
|
186
190
|
return withStatus(new Error(message), response.statusCode);
|
|
187
191
|
}
|
|
188
|
-
function readFile(name, packagePath, encoding = 'utf-8') {
|
|
189
|
-
return new Promise((resolve, reject) => {
|
|
190
|
-
fs.readFile(path.join(packagePath ?? process.cwd(), name), { encoding }, (err, content) => {
|
|
191
|
-
if (err) {
|
|
192
|
-
reject(err);
|
|
193
|
-
}
|
|
194
|
-
else {
|
|
195
|
-
resolve(content);
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
192
|
async function readManifest(packagePath) {
|
|
201
|
-
const content = await readFile('package.json',
|
|
193
|
+
const content = await fs.promises.readFile(path.join(packagePath ?? process.cwd(), 'package.json'), 'utf-8');
|
|
202
194
|
return JSON.parse(content);
|
|
203
195
|
}
|
|
204
196
|
function validateManifest(manifest) {
|
|
@@ -212,20 +204,8 @@ function validateManifest(manifest) {
|
|
|
212
204
|
throw new Error("Missing required field 'version'.");
|
|
213
205
|
}
|
|
214
206
|
}
|
|
215
|
-
function writeFile(name, content, packagePath, encoding = 'utf-8') {
|
|
216
|
-
return new Promise((resolve, reject) => {
|
|
217
|
-
fs.writeFile(path.join(packagePath ?? process.cwd(), name), content, { encoding }, (err) => {
|
|
218
|
-
if (err) {
|
|
219
|
-
reject(err);
|
|
220
|
-
}
|
|
221
|
-
else {
|
|
222
|
-
resolve();
|
|
223
|
-
}
|
|
224
|
-
});
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
207
|
function writeManifest(manifest, packagePath) {
|
|
228
208
|
const content = JSON.stringify(manifest, null, 4);
|
|
229
|
-
return writeFile('package.json', content,
|
|
209
|
+
return fs.promises.writeFile(path.join(packagePath ?? process.cwd(), 'package.json'), content, 'utf-8');
|
|
230
210
|
}
|
|
231
211
|
//# sourceMappingURL=util.js.map
|
package/lib/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";AAAA;;;;;;;;kFAQkF;;;AAWlF,sCAMC;AAED,
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";AAAA;;;;;;;;kFAQkF;;;AAWlF,sCAMC;AAED,wEAKC;AAUD,8CAEC;AAuBD,kDAOC;AAED,4CAEC;AAOD,kCAqBC;AAKD,0CAEC;AAED,kCAGC;AAED,kCAmBC;AAOD,kCASC;AAUD,gCAIC;AAYD,8BAQC;AAED,kCAKC;AAED,oCAGC;AAED,4CAUC;AAED,sCAGC;AAhND,iCAAiC;AACjC,yBAAyB;AACzB,yBAAyB;AACzB,6BAA6B;AAE7B,yCAAiD;AAIjD,SAAgB,aAAa,CAAC,OAAwB;IAClD,OAAO,CAAC,WAAW,KAAnB,OAAO,CAAC,WAAW,GAAK,OAAO,CAAC,GA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,EAAE,EAAE,cAAc,CAAC,EAAE,OAAO,CAAC,CAAC;IAC7G,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAC/B,CAAC;AAED,SAAgB,gBAAgB,CAAC,QAAkB;IAC/C,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IAC3D,CAAC;IACD,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACtD,CAAC;IACD,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;IACzD,CAAC;AACL,CAAC;AAED,SAAgB,aAAa,CAAC,QAAkB,EAAE,WAAoB;IAClE,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAClD,OAAO,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAC5G,CAAC"}
|
package/lib/verify-pat.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify-pat.d.ts","sourceRoot":"","sources":["../src/verify-pat.ts"],"names":[],"mappings":"AAAA;;;;;;;;kFAQkF;AAIlF,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD;;GAEG;AACH,wBAAsB,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"verify-pat.d.ts","sourceRoot":"","sources":["../src/verify-pat.ts"],"names":[],"mappings":"AAAA;;;;;;;;kFAQkF;AAIlF,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD;;GAEG;AACH,wBAAsB,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBxE"}
|
package/lib/verify-pat.js
CHANGED
|
@@ -30,7 +30,9 @@ async function verifyPat(options) {
|
|
|
30
30
|
(error ? `\n\n${error}` : ''));
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
const { pat, save } = await (0, pat_1.getPAT)(options.namespace, options, false);
|
|
34
|
+
options.pat = pat;
|
|
34
35
|
await (0, pat_1.doVerifyPat)(options);
|
|
36
|
+
await save();
|
|
35
37
|
}
|
|
36
38
|
//# sourceMappingURL=verify-pat.js.map
|
package/lib/verify-pat.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify-pat.js","sourceRoot":"","sources":["../src/verify-pat.ts"],"names":[],"mappings":";AAAA;;;;;;;;kFAQkF;;AASlF,
|
|
1
|
+
{"version":3,"file":"verify-pat.js","sourceRoot":"","sources":["../src/verify-pat.ts"],"names":[],"mappings":";AAAA;;;;;;;;kFAQkF;;AASlF,8BAsBC;AA7BD,+BAA4C;AAC5C,iCAAqD;AAGrD;;GAEG;AACI,KAAK,UAAU,SAAS,CAAC,OAAyB;IACrD,IAAA,oBAAa,EAAC,OAAO,CAAC,CAAC;IACvB,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;QACrB,IAAI,KAAK,CAAC;QACV,IAAI,CAAC;YACD,OAAO,CAAC,SAAS,GAAG,CAAC,MAAM,IAAA,mBAAY,GAAE,CAAC,CAAC,SAAS,CAAC;QACzD,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACT,KAAK,GAAG,CAAC,CAAC;QACd,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CACX,6GAA6G;gBAC7G,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAChC,CAAC;QACN,CAAC;IACL,CAAC;IAED,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,YAAM,EAAC,OAAO,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IACtE,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC;IAClB,MAAM,IAAA,iBAAW,EAAC,OAAO,CAAC,CAAC;IAC3B,MAAM,IAAI,EAAE,CAAC;AACjB,CAAC"}
|
package/lib/verify.js
CHANGED
|
@@ -70,7 +70,7 @@ async function resolveVersion(registry, extension, version) {
|
|
|
70
70
|
return registry.getJson(new URL(versionUrl));
|
|
71
71
|
}
|
|
72
72
|
async function downloadSignature(registry, url) {
|
|
73
|
-
const sigzipPath =
|
|
73
|
+
const sigzipPath = (0, util_1.getTempFilePath)('.sigzip');
|
|
74
74
|
try {
|
|
75
75
|
await registry.download(sigzipPath, new URL(url));
|
|
76
76
|
const entries = await (0, zip_1.readZip)(sigzipPath, name => name === SIGNATURE_ENTRY);
|
|
@@ -85,7 +85,7 @@ async function downloadSignature(registry, url) {
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
async function downloadPublicKey(registry, url) {
|
|
88
|
-
const publicKeyPath =
|
|
88
|
+
const publicKeyPath = (0, util_1.getTempFilePath)('.pem');
|
|
89
89
|
try {
|
|
90
90
|
await registry.download(publicKeyPath, new URL(url));
|
|
91
91
|
return await fs.promises.readFile(publicKeyPath, 'utf-8');
|
package/lib/verify.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../src/verify.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;+EAW+E;;AAiB/E,wBAsCC;AArDD,iCAAiC;AACjC,yBAAyB;AACzB,yCAAiD;AACjD,
|
|
1
|
+
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../src/verify.ts"],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AE,QAAQ,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"zip.d.ts","sourceRoot":"","sources":["../src/zip.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,wBAAsB,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAgBlH;AAED;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAkBzF;AAED,wBAAsB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAQ5E"}
|
package/lib/zip.js
CHANGED
|
@@ -14,15 +14,8 @@ exports.readVSIXPackage = readVSIXPackage;
|
|
|
14
14
|
********************************************************************************/
|
|
15
15
|
const crypto = require("crypto");
|
|
16
16
|
const yauzl = require("yauzl-promise");
|
|
17
|
+
const consumers_1 = require("stream/consumers");
|
|
17
18
|
const promises_1 = require("stream/promises");
|
|
18
|
-
async function bufferStream(stream) {
|
|
19
|
-
return await new Promise((resolve, reject) => {
|
|
20
|
-
const buffers = [];
|
|
21
|
-
stream.on('data', buffer => buffers.push(buffer));
|
|
22
|
-
stream.once('error', reject);
|
|
23
|
-
stream.once('end', () => resolve(Buffer.concat(buffers)));
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
19
|
async function readZip(packagePath, filter) {
|
|
27
20
|
const result = new Map();
|
|
28
21
|
const zipfile = await yauzl.open(packagePath);
|
|
@@ -31,8 +24,7 @@ async function readZip(packagePath, filter) {
|
|
|
31
24
|
const name = entry.filename.toLowerCase();
|
|
32
25
|
if (filter(name)) {
|
|
33
26
|
const stream = await zipfile.openReadStream(entry);
|
|
34
|
-
|
|
35
|
-
result.set(name, buffer);
|
|
27
|
+
result.set(name, await (0, consumers_1.buffer)(stream));
|
|
36
28
|
}
|
|
37
29
|
}
|
|
38
30
|
}
|
package/lib/zip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zip.js","sourceRoot":"","sources":["../src/zip.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"zip.js","sourceRoot":"","sources":["../src/zip.ts"],"names":[],"mappings":";;AAeA,0BAgBC;AAUD,8CAkBC;AAED,0CAQC;AArED;;;;;;;;kFAQkF;AAClF,iCAAiC;AACjC,uCAAuC;AACvC,gDAA0C;AAC1C,8CAA2C;AAGpC,KAAK,UAAU,OAAO,CAAC,WAAmB,EAAE,MAAiC;IACnF,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC9C,IAAI,CAAC;QACJ,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YACnC,MAAM,IAAI,GAAG,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;YAC1C,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;gBAClB,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;gBACnD,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,IAAA,kBAAM,EAAC,MAAM,CAAC,CAAC,CAAC;YACxC,CAAC;QACF,CAAC;IACF,CAAC;YAAS,CAAC;QACV,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC;AAED;;;;;;;GAOG;AACI,KAAK,UAAU,iBAAiB,CAAC,WAAmB;IAC1D,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,I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|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -21,6 +21,14 @@
|
|
|
21
21
|
"name": "Miro Spönemann",
|
|
22
22
|
"email": "miro.spoenemann@typefox.io",
|
|
23
23
|
"url": "https://www.typefox.io"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "Thomas Neidhart",
|
|
27
|
+
"email": "thomas.neidhart@eclipse-foundation.org"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "Jordi Gómez Hidalgo",
|
|
31
|
+
"email": "jordi.gomez@eclipse-foundation.org"
|
|
24
32
|
}
|
|
25
33
|
],
|
|
26
34
|
"files": [
|
|
@@ -35,25 +43,19 @@
|
|
|
35
43
|
},
|
|
36
44
|
"dependencies": {
|
|
37
45
|
"@inquirer/prompts": "^7.10.1",
|
|
38
|
-
"@vscode/vsce": "^
|
|
39
|
-
"
|
|
46
|
+
"@vscode/vsce": "^4.0.0",
|
|
47
|
+
"ci-info": "^4.4.0",
|
|
48
|
+
"commander": "^14.0.3",
|
|
40
49
|
"cross-keychain": "^1.1.0",
|
|
41
|
-
"follow-redirects": "^1.16.0",
|
|
42
|
-
"is-ci": "^2.0.0",
|
|
43
|
-
"leven": "^3.1.0",
|
|
44
50
|
"semver": "^7.6.0",
|
|
45
|
-
"tmp": "^0.2.3",
|
|
46
51
|
"yauzl-promise": "^4.0.0"
|
|
47
52
|
},
|
|
48
53
|
"devDependencies": {
|
|
49
54
|
"@eslint/eslintrc": "^3.2.0",
|
|
50
55
|
"@eslint/js": "^9.15.0",
|
|
51
56
|
"@stylistic/eslint-plugin": "^2.11.0",
|
|
52
|
-
"@types/follow-redirects": "^1.13.1",
|
|
53
|
-
"@types/is-ci": "^2.0.0",
|
|
54
57
|
"@types/node": "^22.0.0",
|
|
55
58
|
"@types/semver": "^7.5.8",
|
|
56
|
-
"@types/tmp": "^0.2.2",
|
|
57
59
|
"@types/yauzl-promise": "^4",
|
|
58
60
|
"@types/yazl": "^3.3.1",
|
|
59
61
|
"@typescript-eslint/eslint-plugin": "^8.15.0",
|
|
@@ -62,20 +64,23 @@
|
|
|
62
64
|
"limiter": "^2.1.0",
|
|
63
65
|
"rimraf": "^6.0.1",
|
|
64
66
|
"typescript": "^5.6.3",
|
|
65
|
-
"
|
|
67
|
+
"vite": "^8.3.5",
|
|
68
|
+
"vitest": "^5.0.3",
|
|
66
69
|
"yazl": "^3.3.1"
|
|
67
70
|
},
|
|
68
71
|
"scripts": {
|
|
69
72
|
"clean": "rimraf lib",
|
|
70
|
-
"prebuild": "node -p \"'export const LIB_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'\" > src/version.ts",
|
|
71
73
|
"build": "tsc -p ./tsconfig.json && yarn run lint",
|
|
72
74
|
"watch": "tsc -w -p ./tsconfig.json",
|
|
73
75
|
"test": "vitest run",
|
|
74
76
|
"lint": "eslint -c ./configs/eslintrc.mjs src test",
|
|
75
|
-
"prepare": "yarn run clean && yarn run
|
|
77
|
+
"prepare": "yarn run clean && yarn run build",
|
|
76
78
|
"publish:next": "yarn npm publish --tag next",
|
|
77
79
|
"publish:latest": "yarn npm publish --tag latest",
|
|
78
80
|
"load-extensions": "node scripts/load-test-extensions.js"
|
|
79
81
|
},
|
|
80
|
-
"
|
|
82
|
+
"resolutions": {
|
|
83
|
+
"@azure/msal-node": "^7.1.1"
|
|
84
|
+
},
|
|
85
|
+
"packageManager": "yarn@4.18.1"
|
|
81
86
|
}
|
package/src/check-license.ts
CHANGED
|
@@ -9,10 +9,11 @@
|
|
|
9
9
|
********************************************************************************/
|
|
10
10
|
|
|
11
11
|
import * as fs from 'fs';
|
|
12
|
-
import * as
|
|
12
|
+
import * as path from 'path';
|
|
13
|
+
import { isCI } from 'ci-info';
|
|
13
14
|
import { input, select } from '@inquirer/prompts';
|
|
14
15
|
import {
|
|
15
|
-
readManifest, writeManifest, Manifest,
|
|
16
|
+
readManifest, writeManifest, Manifest, validateManifest
|
|
16
17
|
} from './util';
|
|
17
18
|
|
|
18
19
|
async function addLicense(packagePath: string, manifest: Manifest): Promise<void> {
|
|
@@ -87,14 +88,14 @@ async function useMITLicense(manifest: Manifest, packagePath?: string) {
|
|
|
87
88
|
manifest.license = 'MIT';
|
|
88
89
|
await writeManifest(manifest, packagePath);
|
|
89
90
|
const license = MIT_LICENSE_TEXT.replace('<YEAR> <COPYRIGHT HOLDER>', copyright);
|
|
90
|
-
await writeFile('LICENSE', license,
|
|
91
|
+
await fs.promises.writeFile(path.join(packagePath ?? process.cwd(), 'LICENSE'), license, 'utf-8');
|
|
91
92
|
console.log('LICENSE file has been written. Please commit it to the source repository.');
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
const LICENSE_FILE_NAMES = ['license.md', 'license', 'license.txt', 'licence.md', 'licence', 'licence.txt'];
|
|
95
96
|
|
|
96
97
|
async function hasLicenseFile(packagePath?: string): Promise<boolean> {
|
|
97
|
-
const fileNames = await
|
|
98
|
+
const fileNames = await fs.promises.readdir(packagePath ?? '.');
|
|
98
99
|
for (const fileName of fileNames) {
|
|
99
100
|
for (const licFileName of LICENSE_FILE_NAMES) {
|
|
100
101
|
if (fileName.toLowerCase() === licFileName) {
|
package/src/create-namespace.ts
CHANGED
|
@@ -22,12 +22,14 @@ export async function createNamespace(options: CreateNamespaceOptions = {}): Pro
|
|
|
22
22
|
throw new Error('The namespace name is mandatory.');
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
const { pat, save } = await getPAT(options.name, options, false);
|
|
26
|
+
options.pat = pat;
|
|
26
27
|
|
|
27
28
|
const registry = new Registry(options);
|
|
28
29
|
const result = await registry.createNamespace(options.name, options.pat);
|
|
29
30
|
if (result.error) {
|
|
30
31
|
throw new Error(result.error);
|
|
31
32
|
}
|
|
33
|
+
await save();
|
|
32
34
|
console.log(`\ud83d\ude80 Created namespace ${options.name}`);
|
|
33
35
|
}
|
package/src/get.ts
CHANGED
|
@@ -12,7 +12,7 @@ import * as fs from 'fs';
|
|
|
12
12
|
import * as path from 'path';
|
|
13
13
|
import * as semver from 'semver';
|
|
14
14
|
import { Registry, Extension } from "./registry";
|
|
15
|
-
import {
|
|
15
|
+
import { matchExtensionId, addEnvOptions, rejectError } from './util';
|
|
16
16
|
import { GetOptions } from './get-options';
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -70,15 +70,15 @@ async function printMetadata(registry: Registry, extension: Extension, output?:
|
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
72
|
let filePath: string | undefined;
|
|
73
|
-
const stats =
|
|
73
|
+
const stats = fs.statSync(output, { throwIfNoEntry: false });
|
|
74
74
|
if (stats?.isDirectory() || !stats && output.endsWith(path.sep)) {
|
|
75
75
|
const fileName = `${extension.namespace}.${extension.name}-${extension.version}.json`;
|
|
76
76
|
filePath = path.resolve(process.cwd(), output, fileName);
|
|
77
77
|
} else {
|
|
78
78
|
filePath = path.resolve(process.cwd(), output);
|
|
79
79
|
}
|
|
80
|
-
await
|
|
81
|
-
await
|
|
80
|
+
await fs.promises.mkdir(path.dirname(filePath), { recursive: true });
|
|
81
|
+
await fs.promises.writeFile(filePath, metadata);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
async function download(registry: Registry, extension: Extension, output?: string): Promise<void> {
|
|
@@ -90,7 +90,7 @@ async function download(registry: Registry, extension: Extension, output?: strin
|
|
|
90
90
|
const fileName = decodeURIComponent(downloadUrl.substring(fileNameIndex + 1));
|
|
91
91
|
let filePath: string | undefined;
|
|
92
92
|
if (output) {
|
|
93
|
-
const stats =
|
|
93
|
+
const stats = fs.statSync(output, { throwIfNoEntry: false });
|
|
94
94
|
if (stats?.isDirectory() || !stats && output.endsWith(path.sep)) {
|
|
95
95
|
filePath = path.resolve(process.cwd(), output, fileName);
|
|
96
96
|
} else {
|
|
@@ -99,7 +99,7 @@ async function download(registry: Registry, extension: Extension, output?: strin
|
|
|
99
99
|
} else {
|
|
100
100
|
filePath = path.resolve(process.cwd(), fileName);
|
|
101
101
|
}
|
|
102
|
-
await
|
|
102
|
+
await fs.promises.mkdir(path.dirname(filePath), { recursive: true });
|
|
103
103
|
const target = extension.targetPlatform !== 'universal' ? '@' + extension.targetPlatform : '';
|
|
104
104
|
console.log(`Downloading ${extension.namespace}.${extension.name}-${extension.version}${target} to ${filePath}`);
|
|
105
105
|
await registry.download(filePath, new URL(downloadUrl));
|