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/README.md
CHANGED
|
@@ -10,6 +10,8 @@ npm install --global ovsx
|
|
|
10
10
|
|
|
11
11
|
`ovsx` uses open-vsx.org as default instance for publishing and downloading extensions. If you are using a different instance, specify it via the `--registryUrl` (or `-r`) argument or an environment variable named `OVSX_REGISTRY_URL`.
|
|
12
12
|
|
|
13
|
+
If your registry sits behind a reverse proxy that requires its own HTTP Basic auth (separate from your Open VSX personal access token), set `OVSX_USERNAME` and `OVSX_PASSWORD`.
|
|
14
|
+
|
|
13
15
|
Requests give up if they stop making progress for 30 seconds, so a registry that accepts a connection and then goes quiet does not leave the command hanging. `OVSX_TIMEOUT` changes that, in milliseconds; `OVSX_TIMEOUT=0` disables it. It measures inactivity rather than total time, so a large extension downloading slowly is not cut off, and it covers the ID token request made for trusted publishing as well as the registry's own.
|
|
14
16
|
|
|
15
17
|
### Publish Extensions
|
|
@@ -62,10 +64,14 @@ jobs:
|
|
|
62
64
|
Options:
|
|
63
65
|
* `--trusted-publishing` requires trusted publishing and fails if no ID token can be obtained. Without it, trusted publishing is used whenever an ID token is available and no access token was given; a `--pat` (or `OVSX_PAT`) always takes precedence.
|
|
64
66
|
* `--idToken <token>` passes the ID token explicitly. Use this on CI systems that expose the token as a variable, for example with GitLab CI's [`id_tokens`](https://docs.gitlab.com/ci/yaml/#id_tokens) keyword. The environment variable `OVSX_ID_TOKEN` does the same.
|
|
65
|
-
* `--oidcAudience <audience>` sets the audience requested for the ID token
|
|
67
|
+
* `--oidcAudience <audience>` sets the audience requested for the ID token. By default the CLI asks the registry, which expects the audience of `ovsx.trusted-publishing.audience` - the web UI URL by default, not necessarily the API URL the CLI talks to - and falls back to the registry URL when the registry reports nothing. The environment variable `OVSX_OIDC_AUDIENCE` does the same.
|
|
68
|
+
|
|
69
|
+
* `--registrationCode <code>` completes the registration of a trusted publisher for a private repository. The registry cannot look such a repository up, so it shows a single-use code when the publisher is registered, valid for 7 days. Pass it on the first `publish` from the repository's workflow, for example as a secret in `OVSX_REGISTRATION_CODE`; the registry then takes the repository IDs from the verified ID token. Later publishes do not need it.
|
|
66
70
|
|
|
67
71
|
The issued token is valid for a few minutes only and is never written to the token store, but it does carry publishing rights, so treat CI logs accordingly.
|
|
68
72
|
|
|
73
|
+
The ID token is only sent to a registry reached over https, so a plain `http://` registry URL is refused (a loopback address such as `localhost` is exempt). Publish with an access token there instead.
|
|
74
|
+
|
|
69
75
|
### Delete Extensions
|
|
70
76
|
|
|
71
77
|
You can delete extensions you published with `ovsx unpublish`, the counterpart of `vsce unpublish`. This requires an access token as described above, and the token's user must be a member of the extension's namespace: namespace owners may delete any version, other members only the versions they published themselves. This requires a registry running version 1.2.0 or later.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-license.d.ts","sourceRoot":"","sources":["../src/check-license.ts"],"names":[],"mappings":"AAAA;;;;;;;;kFAQkF;
|
|
1
|
+
{"version":3,"file":"check-license.d.ts","sourceRoot":"","sources":["../src/check-license.ts"],"names":[],"mappings":"AAAA;;;;;;;;kFAQkF;AAMlF,OAAO,EAC0B,QAAQ,EACxC,MAAM,QAAQ,CAAC;AAsChB,wBAAsB,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CAiB5F;AAED,wBAAsB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKrE"}
|
package/lib/check-license.js
CHANGED
|
@@ -12,7 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.isLicenseOk = isLicenseOk;
|
|
13
13
|
exports.checkLicense = checkLicense;
|
|
14
14
|
const fs = require("fs");
|
|
15
|
-
const
|
|
15
|
+
const path = require("path");
|
|
16
|
+
const ci_info_1 = require("ci-info");
|
|
16
17
|
const prompts_1 = require("@inquirer/prompts");
|
|
17
18
|
const util_1 = require("./util");
|
|
18
19
|
async function addLicense(packagePath, manifest) {
|
|
@@ -67,7 +68,7 @@ async function isLicenseOk(packagePath, manifest) {
|
|
|
67
68
|
}
|
|
68
69
|
async function checkLicense(packagePath) {
|
|
69
70
|
const manifest = await (0, util_1.readManifest)(packagePath);
|
|
70
|
-
if (!await isLicenseOk(packagePath, manifest) && !isCI) {
|
|
71
|
+
if (!await isLicenseOk(packagePath, manifest) && !ci_info_1.isCI) {
|
|
71
72
|
await addLicense(packagePath, manifest);
|
|
72
73
|
}
|
|
73
74
|
}
|
|
@@ -81,12 +82,12 @@ async function useMITLicense(manifest, packagePath) {
|
|
|
81
82
|
manifest.license = 'MIT';
|
|
82
83
|
await (0, util_1.writeManifest)(manifest, packagePath);
|
|
83
84
|
const license = MIT_LICENSE_TEXT.replace('<YEAR> <COPYRIGHT HOLDER>', copyright);
|
|
84
|
-
await (
|
|
85
|
+
await fs.promises.writeFile(path.join(packagePath ?? process.cwd(), 'LICENSE'), license, 'utf-8');
|
|
85
86
|
console.log('LICENSE file has been written. Please commit it to the source repository.');
|
|
86
87
|
}
|
|
87
88
|
const LICENSE_FILE_NAMES = ['license.md', 'license', 'license.txt', 'licence.md', 'licence', 'licence.txt'];
|
|
88
89
|
async function hasLicenseFile(packagePath) {
|
|
89
|
-
const fileNames = await
|
|
90
|
+
const fileNames = await fs.promises.readdir(packagePath ?? '.');
|
|
90
91
|
for (const fileName of fileNames) {
|
|
91
92
|
for (const licFileName of LICENSE_FILE_NAMES) {
|
|
92
93
|
if (fileName.toLowerCase() === licFileName) {
|
package/lib/check-license.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-license.js","sourceRoot":"","sources":["../src/check-license.ts"],"names":[],"mappings":";AAAA;;;;;;;;kFAQkF;;
|
|
1
|
+
{"version":3,"file":"check-license.js","sourceRoot":"","sources":["../src/check-license.ts"],"names":[],"mappings":";AAAA;;;;;;;;kFAQkF;;AA8ClF,kCAiBC;AAED,oCAKC;AApED,yBAAyB;AACzB,6BAA6B;AAC7B,qCAA+B;AAC/B,+CAAkD;AAClD,iCAEgB;AAEhB,KAAK,UAAU,UAAU,CAAC,WAAmB,EAAE,QAAkB;IAC7D,OAAO,CAAC,GAAG,CAAC,YAAY,GAAG,QAAQ,CAAC,SAAS,GAAG,GAAG,GAAG,QAAQ,CAAC,IAAI,GAAG,gCAAgC;UAChG,8FAA8F;UAC9F,4FAA4F;UAC5F,gGAAgG;UAChG,uDAAuD,CAAC,CAAC;IAC/D,IAAI,MAA6B,CAAC;IAClC,GAAG,CAAC;QACA,MAAM,GAAG,MAAM,IAAA,gBAAM,EAAC;YAClB,OAAO,EAAE,2CAA2C;kBAC9C,QAAQ,CAAC,SAAS,GAAG,GAAG,GAAG,QAAQ,CAAC,IAAI;kBACxC,yBAAyB;YAC/B,OAAO,EAAE;gBACL,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;gBAC7B,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;gBAC/B,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE;aAC9B;YACD,OAAO,EAAE,IAAI;SAChB,C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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-namespace.d.ts","sourceRoot":"","sources":["../src/create-namespace.ts"],"names":[],"mappings":"AAAA;;;;;;;;kFAQkF;AAElF,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAKpE;;GAEG;AACH,wBAAsB,eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"create-namespace.d.ts","sourceRoot":"","sources":["../src/create-namespace.ts"],"names":[],"mappings":"AAAA;;;;;;;;kFAQkF;AAElF,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAKpE;;GAEG;AACH,wBAAsB,eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBzF"}
|
package/lib/create-namespace.js
CHANGED
|
@@ -21,12 +21,14 @@ async function createNamespace(options = {}) {
|
|
|
21
21
|
if (!options.name) {
|
|
22
22
|
throw new Error('The namespace name is mandatory.');
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
const { pat, save } = await (0, pat_1.getPAT)(options.name, options, false);
|
|
25
|
+
options.pat = pat;
|
|
25
26
|
const registry = new registry_1.Registry(options);
|
|
26
27
|
const result = await registry.createNamespace(options.name, options.pat);
|
|
27
28
|
if (result.error) {
|
|
28
29
|
throw new Error(result.error);
|
|
29
30
|
}
|
|
31
|
+
await save();
|
|
30
32
|
console.log(`\ud83d\ude80 Created namespace ${options.name}`);
|
|
31
33
|
}
|
|
32
34
|
//# sourceMappingURL=create-namespace.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-namespace.js","sourceRoot":"","sources":["../src/create-namespace.ts"],"names":[],"mappings":";AAAA;;;;;;;;kFAQkF;;AAUlF,
|
|
1
|
+
{"version":3,"file":"create-namespace.js","sourceRoot":"","sources":["../src/create-namespace.ts"],"names":[],"mappings":";AAAA;;;;;;;;kFAQkF;;AAUlF,0CAgBC;AAvBD,+BAA+B;AAC/B,yCAAsC;AACtC,iCAAuC;AAEvC;;GAEG;AACI,KAAK,UAAU,eAAe,CAAC,UAAkC,EAAE;IACtE,IAAA,oBAAa,EAAC,OAAO,CAAC,CAAC;IACvB,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACxD,CAAC;IAED,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,YAAM,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IACjE,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC;IAElB,MAAM,QAAQ,GAAG,IAAI,mBAAQ,CAAC,OAAO,CAAC,CAAC;IACvC,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IACzE,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IACD,MAAM,IAAI,EAAE,CAAC;IACb,OAAO,CAAC,GAAG,CAAC,mCAAmC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;AACnE,CAAC"}
|
package/lib/get.js
CHANGED
|
@@ -66,7 +66,7 @@ async function printMetadata(registry, extension, output) {
|
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
68
|
let filePath;
|
|
69
|
-
const stats =
|
|
69
|
+
const stats = fs.statSync(output, { throwIfNoEntry: false });
|
|
70
70
|
if (stats?.isDirectory() || !stats && output.endsWith(path.sep)) {
|
|
71
71
|
const fileName = `${extension.namespace}.${extension.name}-${extension.version}.json`;
|
|
72
72
|
filePath = path.resolve(process.cwd(), output, fileName);
|
|
@@ -74,8 +74,8 @@ async function printMetadata(registry, extension, output) {
|
|
|
74
74
|
else {
|
|
75
75
|
filePath = path.resolve(process.cwd(), output);
|
|
76
76
|
}
|
|
77
|
-
await
|
|
78
|
-
await
|
|
77
|
+
await fs.promises.mkdir(path.dirname(filePath), { recursive: true });
|
|
78
|
+
await fs.promises.writeFile(filePath, metadata);
|
|
79
79
|
}
|
|
80
80
|
async function download(registry, extension, output) {
|
|
81
81
|
const downloadUrl = extension.files.download;
|
|
@@ -86,7 +86,7 @@ async function download(registry, extension, output) {
|
|
|
86
86
|
const fileName = decodeURIComponent(downloadUrl.substring(fileNameIndex + 1));
|
|
87
87
|
let filePath;
|
|
88
88
|
if (output) {
|
|
89
|
-
const stats =
|
|
89
|
+
const stats = fs.statSync(output, { throwIfNoEntry: false });
|
|
90
90
|
if (stats?.isDirectory() || !stats && output.endsWith(path.sep)) {
|
|
91
91
|
filePath = path.resolve(process.cwd(), output, fileName);
|
|
92
92
|
}
|
|
@@ -97,7 +97,7 @@ async function download(registry, extension, output) {
|
|
|
97
97
|
else {
|
|
98
98
|
filePath = path.resolve(process.cwd(), fileName);
|
|
99
99
|
}
|
|
100
|
-
await
|
|
100
|
+
await fs.promises.mkdir(path.dirname(filePath), { recursive: true });
|
|
101
101
|
const target = extension.targetPlatform !== 'universal' ? '@' + extension.targetPlatform : '';
|
|
102
102
|
console.log(`Downloading ${extension.namespace}.${extension.name}-${extension.version}${target} to ${filePath}`);
|
|
103
103
|
await registry.download(filePath, new URL(downloadUrl));
|
package/lib/get.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.js","sourceRoot":"","sources":["../src/get.ts"],"names":[],"mappings":";AAAA;;;;;;;;kFAQkF;;AAYlF,oCAuBC;AAjCD,yBAAyB;AACzB,6BAA6B;AAC7B,iCAAiC;AACjC,yCAAiD;AACjD,
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../src/get.ts"],"names":[],"mappings":";AAAA;;;;;;;;kFAQkF;;AAYlF,oCAuBC;AAjCD,yBAAyB;AACzB,6BAA6B;AAC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AAE,cAAc,EAAE,KAAK,EAAE,CAAC,CAAC;QAC7D,IAAI,KAAK,EAAE,WAAW,EAAE,IAAI,CAAC,KAAK,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YAC9D,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;QAC7D,CAAC;aAAM,CAAC;YACJ,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,CAAC;QACnD,CAAC;IACL,CAAC;SAAM,CAAC;QACJ,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC,CAAC;IACrD,CAAC;IACD,MAAM,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACrE,MAAM,MAAM,GAAG,SAAS,CAAC,cAAc,KAAK,WAAW,CAAC,CAAC,CAAC,GAAG,GAAG,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9F,OAAO,CAAC,GAAG,CAAC,eAAe,SAAS,CAAC,SAAS,IAAI,SAAS,CAAC,IAAI,IAAI,SAAS,CAAC,OAAO,GAAG,MAAM,OAAO,QAAQ,EAAE,CAAC,CAAC;IACjH,MAAM,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;AAC5D,CAAC"}
|
package/lib/http.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/******************************************************************************
|
|
2
|
+
* Copyright (c) 2026 Contributors to the Eclipse Foundation.
|
|
3
|
+
*
|
|
4
|
+
* See the NOTICE file(s) distributed with this work for additional
|
|
5
|
+
* information regarding copyright ownership.
|
|
6
|
+
*
|
|
7
|
+
* This program and the accompanying materials are made available under the
|
|
8
|
+
* terms of the Eclipse Public License 2.0 which is available at
|
|
9
|
+
* https://www.eclipse.org/legal/epl-2.0.
|
|
10
|
+
*
|
|
11
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
12
|
+
*****************************************************************************/
|
|
13
|
+
import * as http from 'http';
|
|
14
|
+
import * as fs from 'fs';
|
|
15
|
+
export type RequestBody = () => string | Buffer | Uint8Array | fs.ReadStream;
|
|
16
|
+
/**
|
|
17
|
+
* Sends a request and follows redirects to `onResponse`'s final response, reporting any failure
|
|
18
|
+
* to `fail`. A GET follows every redirect; a request with a body follows only 307/308, sending
|
|
19
|
+
* the body again, because 301/302/303 turn it into a GET without one. Credentials are dropped
|
|
20
|
+
* once a redirect leaves the origin. Only the headers in `options` are sent, so a caller that
|
|
21
|
+
* passes none carries no credentials.
|
|
22
|
+
*/
|
|
23
|
+
export declare function send(url: URL, options: http.RequestOptions, body: RequestBody | undefined, onResponse: (response: http.IncomingMessage) => void, fail: (err: Error) => void, hops?: number): void;
|
|
24
|
+
/** Sends a GET with only the given headers and resolves with the parsed JSON response. */
|
|
25
|
+
export declare function getJson<T>(url: URL, headers: http.OutgoingHttpHeaders, timeout: number): Promise<T>;
|
|
26
|
+
/**
|
|
27
|
+
* Reads a response as JSON. A non-2xx status rejects with the `message` or `error` of a JSON
|
|
28
|
+
* error body when there is one, and with the status otherwise. An HTML page rejects with an
|
|
29
|
+
* Error rather than its markup, since it usually means the URL points at a website, not an API.
|
|
30
|
+
*/
|
|
31
|
+
export declare function jsonResponse<T>(resolve: (value: T) => void, reject: (reason: any) => void): (res: http.IncomingMessage) => void;
|
|
32
|
+
//# sourceMappingURL=http.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;+EAW+E;AAE/E,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AASzB,MAAM,MAAM,WAAW,GAAG,MAAM,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,EAAE,CAAC,UAAU,CAAC;AAE7E;;;;;;GAMG;AACH,wBAAgB,IAAI,CAChB,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,IAAI,CAAC,cAAc,EAC5B,IAAI,EAAE,WAAW,GAAG,SAAS,EAC7B,UAAU,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,eAAe,KAAK,IAAI,EACpD,IAAI,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,EAC1B,IAAI,SAAI,GACT,IAAI,CAqDN;AAED,0FAA0F;AAC1F,wBAAgB,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,mBAAmB,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAInG;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,eAAe,KAAK,IAAI,CAsC/H"}
|
package/lib/http.js
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/******************************************************************************
|
|
3
|
+
* Copyright (c) 2026 Contributors to the Eclipse Foundation.
|
|
4
|
+
*
|
|
5
|
+
* See the NOTICE file(s) distributed with this work for additional
|
|
6
|
+
* information regarding copyright ownership.
|
|
7
|
+
*
|
|
8
|
+
* This program and the accompanying materials are made available under the
|
|
9
|
+
* terms of the Eclipse Public License 2.0 which is available at
|
|
10
|
+
* https://www.eclipse.org/legal/epl-2.0.
|
|
11
|
+
*
|
|
12
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
13
|
+
*****************************************************************************/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.send = send;
|
|
16
|
+
exports.getJson = getJson;
|
|
17
|
+
exports.jsonResponse = jsonResponse;
|
|
18
|
+
const http = require("http");
|
|
19
|
+
const https = require("https");
|
|
20
|
+
const fs = require("fs");
|
|
21
|
+
const util_1 = require("./util");
|
|
22
|
+
// Hop limit the fetch standard uses.
|
|
23
|
+
const MAX_REDIRECTS = 20;
|
|
24
|
+
// Dropped on a redirect to another origin; X-OpenVSX-Token carries the PAT just like Authorization.
|
|
25
|
+
const CREDENTIAL_HEADERS = /^(?:authorization|cookie|proxy-authorization|x-openvsx-token)$/i;
|
|
26
|
+
/**
|
|
27
|
+
* Sends a request and follows redirects to `onResponse`'s final response, reporting any failure
|
|
28
|
+
* to `fail`. A GET follows every redirect; a request with a body follows only 307/308, sending
|
|
29
|
+
* the body again, because 301/302/303 turn it into a GET without one. Credentials are dropped
|
|
30
|
+
* once a redirect leaves the origin. Only the headers in `options` are sent, so a caller that
|
|
31
|
+
* passes none carries no credentials.
|
|
32
|
+
*/
|
|
33
|
+
function send(url, options, body, onResponse, fail, hops = 0) {
|
|
34
|
+
const protocol = url.protocol === 'https:' ? https : http;
|
|
35
|
+
const request = protocol.request(url, options, response => {
|
|
36
|
+
const status = response.statusCode ?? 0;
|
|
37
|
+
const location = response.headers.location;
|
|
38
|
+
if (status < 300 || status > 399 || !location) {
|
|
39
|
+
onResponse(response);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
response.resume();
|
|
43
|
+
let next;
|
|
44
|
+
try {
|
|
45
|
+
next = new URL(location, url);
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
fail(err);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (hops >= MAX_REDIRECTS) {
|
|
52
|
+
fail(new Error(`The request to ${(0, util_1.redactUrl)(url)} was redirected more than ${MAX_REDIRECTS} times.`));
|
|
53
|
+
}
|
|
54
|
+
else if (next.protocol !== 'https:' && next.protocol !== 'http:') {
|
|
55
|
+
fail(new Error(`The request to ${(0, util_1.redactUrl)(url)} was redirected to unsupported URL ${(0, util_1.redactUrl)(next)}.`));
|
|
56
|
+
}
|
|
57
|
+
else if (body && status !== 307 && status !== 308) {
|
|
58
|
+
fail((0, util_1.withStatus)(new Error(`The ${options.method} request to ${(0, util_1.redactUrl)(url)} was redirected to ${(0, util_1.redactUrl)(next)} `
|
|
59
|
+
+ `with status ${status}, which drops the request body. Use the redirect target as the registry URL.`), status));
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
// The server may answer before reading the body: abandon this hop so its stream
|
|
63
|
+
// releases the file and a late reset on its socket can't fail the next hop.
|
|
64
|
+
request.removeListener('error', fail);
|
|
65
|
+
request.on('error', () => { });
|
|
66
|
+
if (content instanceof fs.ReadStream) {
|
|
67
|
+
content.unpipe(request);
|
|
68
|
+
content.destroy();
|
|
69
|
+
}
|
|
70
|
+
request.destroy();
|
|
71
|
+
const headers = next.origin === url.origin ? options.headers : withoutCredentials(options.headers);
|
|
72
|
+
send(next, { ...options, headers }, body, onResponse, fail, hops + 1);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
request.on('error', fail);
|
|
76
|
+
failOnTimeout(request, url, options.timeout, fail);
|
|
77
|
+
const content = body?.();
|
|
78
|
+
if (content instanceof fs.ReadStream) {
|
|
79
|
+
content.on('error', (err) => {
|
|
80
|
+
request.destroy();
|
|
81
|
+
fail(err);
|
|
82
|
+
});
|
|
83
|
+
request.on('error', () => content.close());
|
|
84
|
+
content.on('open', () => content.pipe(request));
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
request.end(content);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/** Sends a GET with only the given headers and resolves with the parsed JSON response. */
|
|
91
|
+
function getJson(url, headers, timeout) {
|
|
92
|
+
return new Promise((resolve, reject) => {
|
|
93
|
+
send(url, { method: 'GET', headers, timeout }, undefined, jsonResponse(resolve, reject), reject);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Reads a response as JSON. A non-2xx status rejects with the `message` or `error` of a JSON
|
|
98
|
+
* error body when there is one, and with the status otherwise. An HTML page rejects with an
|
|
99
|
+
* Error rather than its markup, since it usually means the URL points at a website, not an API.
|
|
100
|
+
*/
|
|
101
|
+
function jsonResponse(resolve, reject) {
|
|
102
|
+
return response => {
|
|
103
|
+
response.setEncoding('utf-8');
|
|
104
|
+
let json = '';
|
|
105
|
+
// A connection lost after the headers have arrived ends the response without 'end' ever
|
|
106
|
+
// firing, so without this the promise is never settled and the command waits on a body
|
|
107
|
+
// that is not coming. The configured timeout would eventually rescue it, but rejecting
|
|
108
|
+
// here reports what actually happened instead of thirty seconds of silence.
|
|
109
|
+
response.on('error', reject);
|
|
110
|
+
response.on('data', chunk => json += chunk);
|
|
111
|
+
response.on('end', () => {
|
|
112
|
+
if (response.statusCode !== undefined && (response.statusCode < 200 || response.statusCode > 299)) {
|
|
113
|
+
if (json.trimStart().startsWith('{')) {
|
|
114
|
+
try {
|
|
115
|
+
const parsed = JSON.parse(json);
|
|
116
|
+
const message = parsed.message || parsed.error;
|
|
117
|
+
if (message) {
|
|
118
|
+
// keep the status: the message alone cannot say whether retrying is worth it
|
|
119
|
+
reject((0, util_1.withStatus)(new Error(message), response.statusCode));
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
catch (err) {
|
|
124
|
+
// Ignore the error and reject with response status
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
reject((0, util_1.statusError)(response));
|
|
128
|
+
}
|
|
129
|
+
else if (isHtml(response, json)) {
|
|
130
|
+
reject((0, util_1.withStatus)(new Error(`The server responded with status ${response.statusCode} and an HTML page instead of JSON.`), response.statusCode));
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
try {
|
|
134
|
+
resolve(JSON.parse(json));
|
|
135
|
+
}
|
|
136
|
+
catch (err) {
|
|
137
|
+
reject(err);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Node's `timeout` option only raises an event - the request stays open, which is why a server
|
|
145
|
+
* that accepts a connection and then says nothing used to hold a command open indefinitely.
|
|
146
|
+
* Destroying the request with an error routes through the error handling each caller already
|
|
147
|
+
* has, so a stalled request rejects the way any other failure does. With a timeout of zero the
|
|
148
|
+
* event never fires and this does nothing.
|
|
149
|
+
*/
|
|
150
|
+
function failOnTimeout(request, url, timeout, fail) {
|
|
151
|
+
request.on('timeout', () => {
|
|
152
|
+
// Reported before the request is torn down, rather than by destroying it with the error.
|
|
153
|
+
// Destroying raises errors of its own - ECONNRESET on the response, a premature close
|
|
154
|
+
// from pipeline - and node guarantees no order between those and the request's own. In
|
|
155
|
+
// practice the request's arrives first, so this is belt and braces rather than the thing
|
|
156
|
+
// that stops the wrong error being reported; that is the caller claiming the failure
|
|
157
|
+
// before it does any asynchronous cleanup.
|
|
158
|
+
fail(new Error(`No response from ${(0, util_1.redactUrl)(url)} for ${timeout} ms.`));
|
|
159
|
+
request.destroy();
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
// The body check covers servers that send HTML without a text/html Content-Type.
|
|
163
|
+
function isHtml(response, body) {
|
|
164
|
+
const contentType = response.headers['content-type']?.split(';')[0].trim().toLowerCase();
|
|
165
|
+
return contentType === 'text/html' || /^\s*<(?:!doctype\s+html|html)[\s>]/i.test(body);
|
|
166
|
+
}
|
|
167
|
+
function withoutCredentials(headers = {}) {
|
|
168
|
+
return Object.fromEntries(Object.entries(headers).filter(([name]) => !CREDENTIAL_HEADERS.test(name)));
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=http.js.map
|
package/lib/http.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.js","sourceRoot":"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AAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC1G,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -11,9 +11,6 @@ export * from './create-namespace';
|
|
|
11
11
|
export * from './create-namespace-options';
|
|
12
12
|
export * from './get';
|
|
13
13
|
export * from './get-options';
|
|
14
|
-
export * from './login';
|
|
15
|
-
export * from './login-options';
|
|
16
|
-
export * from './logout';
|
|
17
14
|
export * from './publish';
|
|
18
15
|
export * from './publish-options';
|
|
19
16
|
export * from './registry';
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;kFAQkF;AAElF,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,OAAO,CAAC;AACtB,cAAc,eAAe,CAAC;AAC9B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;kFAQkF;AAElF,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,OAAO,CAAC;AACtB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -28,9 +28,6 @@ __exportStar(require("./create-namespace"), exports);
|
|
|
28
28
|
__exportStar(require("./create-namespace-options"), exports);
|
|
29
29
|
__exportStar(require("./get"), exports);
|
|
30
30
|
__exportStar(require("./get-options"), exports);
|
|
31
|
-
__exportStar(require("./login"), exports);
|
|
32
|
-
__exportStar(require("./login-options"), exports);
|
|
33
|
-
__exportStar(require("./logout"), exports);
|
|
34
31
|
__exportStar(require("./publish"), exports);
|
|
35
32
|
__exportStar(require("./publish-options"), exports);
|
|
36
33
|
__exportStar(require("./registry"), exports);
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;kFAQkF;;;;;;;;;;;;;;;;;AAElF,qDAAmC;AACnC,6DAA2C;AAC3C,wCAAsB;AACtB,gDAA8B;AAC9B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;kFAQkF;;;;;;;;;;;;;;;;;AAElF,qDAAmC;AACnC,6DAA2C;AAC3C,wCAAsB;AACtB,gDAA8B;AAC9B,4CAA0B;AAC1B,oDAAkC;AAClC,6CAA2B;AAC3B,qDAAmC;AACnC,uDAAqC;AACrC,+DAA6C;AAC7C,8CAA4B;AAC5B,sDAAoC;AACpC,+CAA6B;AAC7B,uDAAqC;AACrC,iDAA8C;AAArC,4GAAA,WAAW,OAAA;AACpB,+BAAwD;AAA/C,wGAAA,gBAAgB,OAAA;AAAE,oGAAA,YAAY,OAAA"}
|