@vltpkg/cli-js 1.0.10 → 1.1.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/{access-4RPC3X5N.js → access-GLWBGQLN.js} +41 -10
- package/{bugs-K6QLQLL4.js → bugs-OCQYFWFE.js} +18 -18
- package/{build-VD4L5IED.js → build-CPWGNTCM.js} +7 -8
- package/{cache-Q6FUUEQF.js → cache-SL7DQMY2.js} +20 -14
- package/chunk-2IMBYPYC.js +190 -0
- package/{chunk-5JFRXIK2.js → chunk-2PWSMJD7.js} +20 -1
- package/{chunk-FUCQ7ARR.js → chunk-47M7IZ5P.js} +26 -22
- package/{chunk-WAYVHANF.js → chunk-6LEMBT22.js} +30 -5
- package/chunk-A75UYRJC.js +75 -0
- package/{chunk-HAYXR3MW.js → chunk-APMYKJI2.js} +1 -1
- package/{chunk-B5IILBX7.js → chunk-BUXPKRYB.js} +4 -4
- package/{chunk-5HPGL5WS.js → chunk-CBASIDQH.js} +1 -1
- package/{chunk-MNK55XSE.js → chunk-CEHPRPGQ.js} +21 -0
- package/{chunk-BSPUKIWY.js → chunk-CF5EGH4W.js} +12 -2
- package/{chunk-P5S2TFCF.js → chunk-CTQSUNNE.js} +14 -10
- package/{chunk-NWLS3VOQ.js → chunk-GJGQTRAT.js} +154 -26
- package/{chunk-5HBKYSTX.js → chunk-HYCYL4RX.js} +1 -1
- package/{chunk-NA732FNL.js → chunk-J2XWQVDK.js} +98 -6
- package/{chunk-DAS7TVRN.js → chunk-JSQUYHU7.js} +5 -5
- package/{chunk-XUP35M5Q.js → chunk-S6Y57MUS.js} +4 -4
- package/chunk-SNOBGFNM.js +129 -0
- package/{chunk-VL7RJVNN.js → chunk-TNEMFBP5.js} +20 -11
- package/{chunk-3564IL5W.js → chunk-TUXWDPCQ.js} +1 -1
- package/{chunk-ZNCVQQDT.js → chunk-TXTK2PKN.js} +2 -2
- package/{chunk-LPIBYUMT.js → chunk-U7TEQCBN.js} +27 -1
- package/{chunk-XFI4THXZ.js → chunk-WE2TQN32.js} +1 -1
- package/{chunk-USTJECVS.js → chunk-X2AWQGYG.js} +1 -1
- package/{chunk-TYRKIWGF.js → chunk-YKCGWKUE.js} +3 -3
- package/{chunk-2YJ5MESP.js → chunk-ZDQJWRCU.js} +1 -1
- package/{ci-G4PJWJQE.js → ci-O2RSLTBX.js} +9 -10
- package/cli-package.json +1 -1
- package/{config-WTIWWXRD.js → config-ZBIF32GS.js} +11 -11
- package/{config-66ARNESN.js → config-ZPH7V77F.js} +8 -6
- package/{create-DF6RQTHC.js → create-2JX4RV5U.js} +17 -17
- package/{deprecate-2KTC2HKH.js → deprecate-XJLP2TUW.js} +21 -18
- package/{dist-tag-QKJQIOGN.js → dist-tag-F6ZFWGQU.js} +23 -25
- package/{docs-YSWJTGYX.js → docs-IJCZZ4V6.js} +18 -18
- package/{exec-5XIMPSBI.js → exec-IWSS2LUA.js} +17 -17
- package/{exec-cache-OGX7WR5P.js → exec-cache-AG77OOEE.js} +15 -15
- package/{exec-local-SB7EPYED.js → exec-local-QXPWC4QG.js} +13 -14
- package/{help-GMCQHGVN.js → help-TGNDNWLP.js} +4 -4
- package/{init-KXIIWHBA.js → init-WU7BRPKR.js} +7 -8
- package/{install-ODTEMAMS.js → install-74XKB5N7.js} +37 -14
- package/{list-QS4FLJSU.js → list-TOEC6Q3A.js} +41 -29
- package/{login-6TGYRY43.js → login-WJYMAFSL.js} +11 -11
- package/{logout-GOAB7KHJ.js → logout-MTRQWI3L.js} +7 -7
- package/{pack-PJDH6PKP.js → pack-FFWGLSNC.js} +11 -12
- package/package.json +1 -1
- package/{ping-ANBW2IRW.js → ping-DWUVTCJB.js} +7 -7
- package/{pkg-GZWUXU65.js → pkg-KNZW5FIA.js} +10 -11
- package/{profile-BLY74CMB.js → profile-6W2ABNXL.js} +20 -7
- package/{publish-W2KOTNMB.js → publish-HGNUONU3.js} +33 -75
- package/{query-3PUMU5ON.js → query-FSCYPETX.js} +35 -23
- package/{registry-ONSDWNPV.js → registry-YTJZ3AQD.js} +3 -3
- package/registry-client-package.json +6 -1
- package/registry-client-src-revalidate.js +230 -39
- package/{repo-LZ6STH4C.js → repo-OVIKYYWA.js} +18 -18
- package/{reporter-SDMDYYMJ.js → reporter-ZW7OMRZT.js} +23 -1
- package/{run-JMIBADHE.js → run-UPV3RPQJ.js} +13 -14
- package/{run-exec-JEKM2O53.js → run-exec-YJSMWMMP.js} +13 -14
- package/{setup-BTBU3NAI.js → setup-7DPMAPUY.js} +20 -19
- package/{src-23VBKASP.js → src-BNCFK4FH.js} +15 -15
- package/{src-J4BAYOBO.js → src-XJT4IJSV.js} +11 -4
- package/{token-PUJ7QN6D.js → token-GA73ER5V.js} +8 -8
- package/{uninstall-OTISP2T7.js → uninstall-E3VKSC3B.js} +11 -11
- package/{unpublish-X75EEQAN.js → unpublish-Q6MQHBPQ.js} +43 -40
- package/{update-CKXX5POE.js → update-4CC44TR5.js} +34 -12
- package/{version-24B2X7M7.js → version-CRZBXNDG.js} +9 -10
- package/{view-Q7MAQ6R3.js → view-ILUULGSO.js} +9 -9
- package/vlr.js +1 -1
- package/vlrx.js +1 -1
- package/vlt.js +1 -1
- package/vlx.js +1 -1
- package/vlxl.js +1 -1
- package/{whoami-S6CQZFE3.js → whoami-Z4TSLYTR.js} +28 -12
- package/chunk-UBLFPJHV.js +0 -40
- package/chunk-Y3QEV76Q.js +0 -75
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vltpkg/registry-client",
|
|
3
3
|
"description": "Fetch package artifacts and metadata from registries",
|
|
4
|
-
"version": "1.0
|
|
4
|
+
"version": "1.1.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/vltpkg/vltpkg.git",
|
|
@@ -63,6 +63,11 @@
|
|
|
63
63
|
"import": {
|
|
64
64
|
"default": "./src/cache-entry.ts"
|
|
65
65
|
}
|
|
66
|
+
},
|
|
67
|
+
"./registry-error": {
|
|
68
|
+
"import": {
|
|
69
|
+
"default": "./src/registry-error.ts"
|
|
70
|
+
}
|
|
66
71
|
}
|
|
67
72
|
},
|
|
68
73
|
"files": [
|
|
@@ -1076,7 +1076,7 @@ var require_util = __commonJS({
|
|
|
1076
1076
|
return new BodyAsyncIterable(body);
|
|
1077
1077
|
} else if (body && isFormDataLike(body)) {
|
|
1078
1078
|
return body;
|
|
1079
|
-
} else if (body && typeof body !== "string" && !ArrayBuffer.isView(body) &&
|
|
1079
|
+
} else if (body && typeof body !== "string" && !ArrayBuffer.isView(body) && isIterable3(body)) {
|
|
1080
1080
|
return new BodyAsyncIterable(body);
|
|
1081
1081
|
} else {
|
|
1082
1082
|
return body;
|
|
@@ -1197,7 +1197,7 @@ var require_util = __commonJS({
|
|
|
1197
1197
|
function isAsyncIterable(obj) {
|
|
1198
1198
|
return !!(obj != null && typeof obj[Symbol.asyncIterator] === "function");
|
|
1199
1199
|
}
|
|
1200
|
-
function
|
|
1200
|
+
function isIterable3(obj) {
|
|
1201
1201
|
return !!(obj != null && (typeof obj[Symbol.iterator] === "function" || typeof obj[Symbol.asyncIterator] === "function"));
|
|
1202
1202
|
}
|
|
1203
1203
|
function hasSafeIterator(obj) {
|
|
@@ -1808,7 +1808,7 @@ var require_util = __commonJS({
|
|
|
1808
1808
|
parseURL,
|
|
1809
1809
|
getServerName,
|
|
1810
1810
|
isStream,
|
|
1811
|
-
isIterable:
|
|
1811
|
+
isIterable: isIterable3,
|
|
1812
1812
|
hasSafeIterator,
|
|
1813
1813
|
isAsyncIterable,
|
|
1814
1814
|
isDestroyed,
|
|
@@ -2117,7 +2117,7 @@ var require_request = __commonJS({
|
|
|
2117
2117
|
destroy,
|
|
2118
2118
|
isBuffer,
|
|
2119
2119
|
isFormDataLike,
|
|
2120
|
-
isIterable:
|
|
2120
|
+
isIterable: isIterable3,
|
|
2121
2121
|
hasSafeIterator,
|
|
2122
2122
|
isBlobLike,
|
|
2123
2123
|
serializePathWithQuery,
|
|
@@ -2232,7 +2232,7 @@ var require_request = __commonJS({
|
|
|
2232
2232
|
this.body = body.byteLength ? Buffer.from(body) : null;
|
|
2233
2233
|
} else if (typeof body === "string") {
|
|
2234
2234
|
this.body = body.length ? Buffer.from(body) : null;
|
|
2235
|
-
} else if (isFormDataLike(body) ||
|
|
2235
|
+
} else if (isFormDataLike(body) || isIterable3(body) || isBlobLike(body)) {
|
|
2236
2236
|
this.body = body;
|
|
2237
2237
|
} else {
|
|
2238
2238
|
throw new InvalidArgumentError("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable");
|
|
@@ -12599,7 +12599,7 @@ var require_mock_utils = __commonJS({
|
|
|
12599
12599
|
kTotalDispatchCount
|
|
12600
12600
|
} = require_mock_symbols();
|
|
12601
12601
|
var { serializePathWithQuery } = require_util();
|
|
12602
|
-
var { STATUS_CODES:
|
|
12602
|
+
var { STATUS_CODES: STATUS_CODES3 } = __require("node:http");
|
|
12603
12603
|
var {
|
|
12604
12604
|
types: {
|
|
12605
12605
|
isPromise
|
|
@@ -12807,7 +12807,7 @@ var require_mock_utils = __commonJS({
|
|
|
12807
12807
|
return result;
|
|
12808
12808
|
}
|
|
12809
12809
|
function getStatusText(statusCode) {
|
|
12810
|
-
return
|
|
12810
|
+
return STATUS_CODES3[statusCode] || "unknown";
|
|
12811
12811
|
}
|
|
12812
12812
|
async function getResponse(body) {
|
|
12813
12813
|
const buffers = [];
|
|
@@ -20413,7 +20413,7 @@ var require_fetch = __commonJS({
|
|
|
20413
20413
|
var { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require_data_url();
|
|
20414
20414
|
var { getGlobalDispatcher } = require_global2();
|
|
20415
20415
|
var { webidl } = require_webidl();
|
|
20416
|
-
var { STATUS_CODES:
|
|
20416
|
+
var { STATUS_CODES: STATUS_CODES3 } = __require("node:http");
|
|
20417
20417
|
var { bytesMatch } = require_subresource_integrity();
|
|
20418
20418
|
var { createDeferredPromise } = require_promise();
|
|
20419
20419
|
var { isomorphicEncode } = require_infra();
|
|
@@ -21450,7 +21450,7 @@ var require_fetch = __commonJS({
|
|
|
21450
21450
|
}
|
|
21451
21451
|
resolve11({
|
|
21452
21452
|
status,
|
|
21453
|
-
statusText:
|
|
21453
|
+
statusText: STATUS_CODES3[status],
|
|
21454
21454
|
headersList,
|
|
21455
21455
|
socket
|
|
21456
21456
|
});
|
|
@@ -21474,7 +21474,7 @@ var require_fetch = __commonJS({
|
|
|
21474
21474
|
}
|
|
21475
21475
|
resolve11({
|
|
21476
21476
|
status,
|
|
21477
|
-
statusText:
|
|
21477
|
+
statusText: STATUS_CODES3[status],
|
|
21478
21478
|
headersList,
|
|
21479
21479
|
socket
|
|
21480
21480
|
});
|
|
@@ -32442,7 +32442,7 @@ var XDG = class {
|
|
|
32442
32442
|
// ../../src/registry-client/src/index.ts
|
|
32443
32443
|
import { randomUUID } from "node:crypto";
|
|
32444
32444
|
import { readFileSync as readFileSync3 } from "node:fs";
|
|
32445
|
-
import { STATUS_CODES } from "node:http";
|
|
32445
|
+
import { STATUS_CODES as STATUS_CODES2 } from "node:http";
|
|
32446
32446
|
import { availableParallelism } from "node:os";
|
|
32447
32447
|
import { dirname as dirname4, resolve as resolve10 } from "node:path";
|
|
32448
32448
|
import { setTimeout as setTimeout3 } from "node:timers/promises";
|
|
@@ -32941,6 +32941,19 @@ var CacheEntry = class _CacheEntry {
|
|
|
32941
32941
|
get statusCode() {
|
|
32942
32942
|
return this.#statusCode;
|
|
32943
32943
|
}
|
|
32944
|
+
/**
|
|
32945
|
+
* True when the registry answered with a 2xx.
|
|
32946
|
+
*
|
|
32947
|
+
* `RegistryClient.request()` resolves for every status, so this is how
|
|
32948
|
+
* code holding a real CacheEntry asks "did it work?".
|
|
32949
|
+
*
|
|
32950
|
+
* Note this is the strict form. Use it only where a genuine CacheEntry
|
|
32951
|
+
* is guaranteed; `assertOk` uses the loose range check because it is
|
|
32952
|
+
* also handed duck-typed responses.
|
|
32953
|
+
*/
|
|
32954
|
+
get ok() {
|
|
32955
|
+
return this.#statusCode >= 200 && this.#statusCode < 300;
|
|
32956
|
+
}
|
|
32944
32957
|
get headers() {
|
|
32945
32958
|
return this.#headers;
|
|
32946
32959
|
}
|
|
@@ -33287,9 +33300,9 @@ import module2 from "node:module";
|
|
|
33287
33300
|
var isDeno2 = globalThis.Deno != void 0;
|
|
33288
33301
|
var didProcessBeforeExitHook2 = false;
|
|
33289
33302
|
var registered2 = /* @__PURE__ */ new Map();
|
|
33290
|
-
var register2 = (path2, method, url) => {
|
|
33303
|
+
var register2 = (path2, method, url, accept) => {
|
|
33291
33304
|
const r = registered2.get(path2) ?? /* @__PURE__ */ new Set();
|
|
33292
|
-
const key = `${method} ${url}`;
|
|
33305
|
+
const key = `${method} ${url}${accept ? ` ${String(accept)}` : ""}`;
|
|
33293
33306
|
r.add(key);
|
|
33294
33307
|
registered2.set(path2, r);
|
|
33295
33308
|
if (!didProcessBeforeExitHook2) {
|
|
@@ -33339,6 +33352,33 @@ var bun = isBun ? proc.versions.bun : void 0;
|
|
|
33339
33352
|
var deno = isDeno3 ? proc.versions.deno : void 0;
|
|
33340
33353
|
var node = isNode ? proc.versions.node : void 0;
|
|
33341
33354
|
|
|
33355
|
+
// ../../src/registry-client/src/get-header.ts
|
|
33356
|
+
var isIterable2 = (o) => !!o && typeof o === "object" && Symbol.iterator in o;
|
|
33357
|
+
var getHeader = (headers, key) => {
|
|
33358
|
+
if (!headers) return void 0;
|
|
33359
|
+
key = key.toLowerCase();
|
|
33360
|
+
if (Array.isArray(headers)) {
|
|
33361
|
+
if (!headers.length) return void 0;
|
|
33362
|
+
if (Array.isArray(headers[0])) {
|
|
33363
|
+
for (const [k4, v3] of headers) {
|
|
33364
|
+
if (k4.toLowerCase() === key) return v3;
|
|
33365
|
+
}
|
|
33366
|
+
} else if (headers.length % 2 === 0) {
|
|
33367
|
+
for (let i2 = 0; i2 < headers.length; i2 += 2) {
|
|
33368
|
+
if (headers[i2]?.toLowerCase() === key) return headers[i2 + 1];
|
|
33369
|
+
}
|
|
33370
|
+
}
|
|
33371
|
+
} else if (isIterable2(headers)) {
|
|
33372
|
+
for (const [k4, v3] of headers) {
|
|
33373
|
+
if (k4.toLowerCase() === key) return v3;
|
|
33374
|
+
}
|
|
33375
|
+
} else {
|
|
33376
|
+
for (const [k4, v3] of Object.entries(headers)) {
|
|
33377
|
+
if (k4.toLowerCase() === key) return v3;
|
|
33378
|
+
}
|
|
33379
|
+
}
|
|
33380
|
+
};
|
|
33381
|
+
|
|
33342
33382
|
// ../../src/registry-client/src/handle-304-response.ts
|
|
33343
33383
|
var handleCacheHitResponse = (resp, entry) => {
|
|
33344
33384
|
if (resp.statusCode !== 304 && resp.statusCode !== 412 || !entry)
|
|
@@ -33387,6 +33427,9 @@ var otplease = async (client, options, response) => {
|
|
|
33387
33427
|
);
|
|
33388
33428
|
if (wwwAuth.has("ipaddress")) {
|
|
33389
33429
|
throw error("Authorization is not allowed from your ip address", {
|
|
33430
|
+
code: "ENEEDAUTH",
|
|
33431
|
+
status: response.statusCode,
|
|
33432
|
+
method: options.method,
|
|
33390
33433
|
response
|
|
33391
33434
|
});
|
|
33392
33435
|
}
|
|
@@ -33419,17 +33462,30 @@ var otplease = async (client, options, response) => {
|
|
|
33419
33462
|
}
|
|
33420
33463
|
}
|
|
33421
33464
|
throw error("Unrecognized OTP authentication challenge", {
|
|
33465
|
+
code: "ENEEDAUTH",
|
|
33466
|
+
status: response.statusCode,
|
|
33467
|
+
method: options.method,
|
|
33422
33468
|
response
|
|
33423
33469
|
});
|
|
33424
33470
|
}
|
|
33425
33471
|
if (wwwAuth.has("bearer")) {
|
|
33426
33472
|
throw error(
|
|
33427
33473
|
"Missing or invalid authentication token. Run `vlt login` or `vlt token add` to authenticate.",
|
|
33428
|
-
{
|
|
33474
|
+
{
|
|
33475
|
+
code: "ENEEDAUTH",
|
|
33476
|
+
status: response.statusCode,
|
|
33477
|
+
method: options.method,
|
|
33478
|
+
response
|
|
33479
|
+
}
|
|
33429
33480
|
);
|
|
33430
33481
|
}
|
|
33431
33482
|
if (wwwAuth.size) {
|
|
33432
|
-
throw error("Unknown authentication challenge", {
|
|
33483
|
+
throw error("Unknown authentication challenge", {
|
|
33484
|
+
code: "ENEEDAUTH",
|
|
33485
|
+
status: response.statusCode,
|
|
33486
|
+
method: options.method,
|
|
33487
|
+
response
|
|
33488
|
+
});
|
|
33433
33489
|
}
|
|
33434
33490
|
const text = await responseBodyText(response).catch(() => "");
|
|
33435
33491
|
if (text.toLowerCase().includes("one-time pass")) {
|
|
@@ -33494,6 +33550,68 @@ var redirect = (options, response, from) => {
|
|
|
33494
33550
|
}
|
|
33495
33551
|
};
|
|
33496
33552
|
|
|
33553
|
+
// ../../src/registry-client/src/registry-error.ts
|
|
33554
|
+
import { STATUS_CODES } from "node:http";
|
|
33555
|
+
var MAX_DETAIL_LENGTH = 512;
|
|
33556
|
+
var truncate = (s) => s.length <= MAX_DETAIL_LENGTH ? s : `${s.slice(0, MAX_DETAIL_LENGTH - 1)}\u2026`;
|
|
33557
|
+
var isHTML = (s) => /^\s*(<!doctype\s+html|<html\b)/i.test(s);
|
|
33558
|
+
var stripTags = (s) => s.replace(/<(script|style)\b[^>]*>[\s\S]*?<\/\1>/gi, " ").replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
|
|
33559
|
+
var detailFromJSON = (text) => {
|
|
33560
|
+
let body;
|
|
33561
|
+
try {
|
|
33562
|
+
body = JSON.parse(text);
|
|
33563
|
+
} catch {
|
|
33564
|
+
return void 0;
|
|
33565
|
+
}
|
|
33566
|
+
if (!body || typeof body !== "object") return void 0;
|
|
33567
|
+
const rec = body;
|
|
33568
|
+
const nested = rec.error;
|
|
33569
|
+
for (const v3 of [rec.error, rec.message, nested?.message]) {
|
|
33570
|
+
if (typeof v3 === "string" && v3.trim()) return v3.trim();
|
|
33571
|
+
}
|
|
33572
|
+
return void 0;
|
|
33573
|
+
};
|
|
33574
|
+
var registryErrorMessage = (response) => {
|
|
33575
|
+
const statusMessage = STATUS_CODES[response.statusCode];
|
|
33576
|
+
const status = `${response.statusCode}${statusMessage ? ` ${statusMessage}` : ""}`;
|
|
33577
|
+
let text;
|
|
33578
|
+
try {
|
|
33579
|
+
text = response.text?.().trim() ?? "";
|
|
33580
|
+
} catch {
|
|
33581
|
+
return status;
|
|
33582
|
+
}
|
|
33583
|
+
if (!text) return status;
|
|
33584
|
+
const detail = detailFromJSON(text) ?? (isHTML(text) ? stripTags(text) : text);
|
|
33585
|
+
return detail ? `${status} \u2014 ${truncate(detail)}` : status;
|
|
33586
|
+
};
|
|
33587
|
+
var registryError = (response, { message, url, method = "GET", advice }, from, cause) => {
|
|
33588
|
+
const { statusCode } = response;
|
|
33589
|
+
const denied = statusCode === 401 || statusCode === 403;
|
|
33590
|
+
const extra = advice?.(statusCode);
|
|
33591
|
+
const tips = (Array.isArray(extra) ? extra : [extra]).filter(
|
|
33592
|
+
(t) => !!t
|
|
33593
|
+
);
|
|
33594
|
+
const warn = tips.map((t) => `
|
|
33595
|
+
\u26A0\uFE0F ${t}`).join("");
|
|
33596
|
+
return error(
|
|
33597
|
+
`${message}: ${registryErrorMessage(response)}${warn}`,
|
|
33598
|
+
{
|
|
33599
|
+
code: denied ? "ENEEDAUTH" : "EREQUEST",
|
|
33600
|
+
url,
|
|
33601
|
+
method,
|
|
33602
|
+
status: statusCode,
|
|
33603
|
+
response,
|
|
33604
|
+
...cause === void 0 ? {} : { cause: asError(cause) }
|
|
33605
|
+
},
|
|
33606
|
+
from
|
|
33607
|
+
);
|
|
33608
|
+
};
|
|
33609
|
+
var assertOk = (response, options) => {
|
|
33610
|
+
const { statusCode } = response;
|
|
33611
|
+
if (!(statusCode < 200 || statusCode >= 300)) return;
|
|
33612
|
+
throw registryError(response, options, assertOk);
|
|
33613
|
+
};
|
|
33614
|
+
|
|
33497
33615
|
// ../../src/registry-client/src/set-cache-headers.ts
|
|
33498
33616
|
var setCacheHeaders = (options, entry) => {
|
|
33499
33617
|
if (!entry) return;
|
|
@@ -33635,7 +33753,40 @@ var RegistryClient = class {
|
|
|
33635
33753
|
*/
|
|
33636
33754
|
async scroll(url, options = {}, seek) {
|
|
33637
33755
|
const resp = await this.request(url, options);
|
|
33638
|
-
const {
|
|
33756
|
+
const { statusCode } = resp;
|
|
33757
|
+
if (statusCode < 200 || statusCode >= 300) {
|
|
33758
|
+
let detail;
|
|
33759
|
+
try {
|
|
33760
|
+
const body2 = resp.json();
|
|
33761
|
+
if (body2 && typeof body2 === "object" && "error" in body2) {
|
|
33762
|
+
detail = body2.error;
|
|
33763
|
+
}
|
|
33764
|
+
} catch {
|
|
33765
|
+
}
|
|
33766
|
+
const status = STATUS_CODES2[statusCode];
|
|
33767
|
+
throw error(
|
|
33768
|
+
`Failed to fetch paginated results: ${statusCode}${status ? ` ${status}` : ""}${typeof detail === "string" && detail ? `: ${detail}` : ""}`,
|
|
33769
|
+
{ code: "EREQUEST", status: statusCode, url: String(url) }
|
|
33770
|
+
);
|
|
33771
|
+
}
|
|
33772
|
+
let body;
|
|
33773
|
+
try {
|
|
33774
|
+
body = resp.json();
|
|
33775
|
+
} catch (cause) {
|
|
33776
|
+
throw error("Invalid JSON in paginated registry response", {
|
|
33777
|
+
code: "EREQUEST",
|
|
33778
|
+
url: String(url),
|
|
33779
|
+
cause
|
|
33780
|
+
});
|
|
33781
|
+
}
|
|
33782
|
+
if (!body || typeof body !== "object" || !("objects" in body) || !Array.isArray(body.objects) || !("urls" in body) || !body.urls || typeof body.urls !== "object" || Array.isArray(body.urls) || "next" in body.urls && body.urls.next !== null && body.urls.next !== void 0 && typeof body.urls.next !== "string") {
|
|
33783
|
+
throw error("Invalid pagination in registry response", {
|
|
33784
|
+
code: "EREQUEST",
|
|
33785
|
+
url: String(url)
|
|
33786
|
+
});
|
|
33787
|
+
}
|
|
33788
|
+
const objects = body.objects;
|
|
33789
|
+
const urls = body.urls;
|
|
33639
33790
|
return urls.next && !(seek && objects.some(seek)) ? objects.concat(await this.scroll(urls.next, options, seek)) : objects;
|
|
33640
33791
|
}
|
|
33641
33792
|
/**
|
|
@@ -33654,17 +33805,41 @@ var RegistryClient = class {
|
|
|
33654
33805
|
const s = tok.replace(/^(Bearer|Basic) /i, "");
|
|
33655
33806
|
const base = registryBase(registry);
|
|
33656
33807
|
const tokensUrl = new URL("-/npm/v1/tokens", base);
|
|
33657
|
-
const
|
|
33658
|
-
|
|
33659
|
-
|
|
33660
|
-
|
|
33661
|
-
|
|
33662
|
-
|
|
33663
|
-
|
|
33664
|
-
|
|
33665
|
-
|
|
33808
|
+
const stillLive = `Removing the local credential anyway; revoke the token in the registry UI if it is still live.`;
|
|
33809
|
+
try {
|
|
33810
|
+
let record;
|
|
33811
|
+
try {
|
|
33812
|
+
record = await this.seek(tokensUrl, ({ token }) => s.startsWith(token), {
|
|
33813
|
+
useCache: false
|
|
33814
|
+
});
|
|
33815
|
+
} catch (er) {
|
|
33816
|
+
log3(
|
|
33817
|
+
`Could not list tokens at ${tokensUrl}: ${asError(er).message}
|
|
33818
|
+
` + stillLive
|
|
33819
|
+
);
|
|
33820
|
+
}
|
|
33821
|
+
if (record) {
|
|
33822
|
+
const deleteUrl = new URL(
|
|
33823
|
+
`-/npm/v1/tokens/token/${record.key}`,
|
|
33824
|
+
base
|
|
33825
|
+
);
|
|
33826
|
+
const failed = (detail) => log3(
|
|
33827
|
+
`Failed to revoke the token on the registry: ${detail}
|
|
33828
|
+
` + stillLive
|
|
33829
|
+
);
|
|
33830
|
+
try {
|
|
33831
|
+
const response = await this.request(deleteUrl, {
|
|
33832
|
+
useCache: false,
|
|
33833
|
+
method: "DELETE"
|
|
33834
|
+
});
|
|
33835
|
+
if (!response.ok) failed(registryErrorMessage(response));
|
|
33836
|
+
} catch (er) {
|
|
33837
|
+
failed(asError(er).message);
|
|
33838
|
+
}
|
|
33839
|
+
}
|
|
33840
|
+
} finally {
|
|
33841
|
+
await deleteToken(registry, this.identity);
|
|
33666
33842
|
}
|
|
33667
|
-
await deleteToken(registry, this.identity);
|
|
33668
33843
|
}
|
|
33669
33844
|
/**
|
|
33670
33845
|
* Log into the registry specified.
|
|
@@ -33705,7 +33880,7 @@ var RegistryClient = class {
|
|
|
33705
33880
|
}
|
|
33706
33881
|
}
|
|
33707
33882
|
const { statusCode } = response;
|
|
33708
|
-
const status =
|
|
33883
|
+
const status = STATUS_CODES2[statusCode];
|
|
33709
33884
|
throw error(
|
|
33710
33885
|
`Failed to perform web login: ${statusCode}${status ? ` ${status}` : ""}`,
|
|
33711
33886
|
{
|
|
@@ -33768,11 +33943,19 @@ var RegistryClient = class {
|
|
|
33768
33943
|
}
|
|
33769
33944
|
return await this.#checkLogin(url, options);
|
|
33770
33945
|
}
|
|
33946
|
+
assertOk(response, {
|
|
33947
|
+
message: "Web login failed",
|
|
33948
|
+
url,
|
|
33949
|
+
advice: (statusCode) => statusCode === 404 ? "This registry does not implement the web login endpoint." : void 0
|
|
33950
|
+
});
|
|
33771
33951
|
if (response.statusCode === 200) {
|
|
33772
33952
|
const token = getTokenResponse(response.json());
|
|
33773
33953
|
if (token) return token;
|
|
33774
33954
|
}
|
|
33775
33955
|
throw error("Invalid response from web login endpoint", {
|
|
33956
|
+
code: "EREQUEST",
|
|
33957
|
+
url,
|
|
33958
|
+
status: response.statusCode,
|
|
33776
33959
|
response
|
|
33777
33960
|
});
|
|
33778
33961
|
}
|
|
@@ -33846,7 +34029,12 @@ var RegistryClient = class {
|
|
|
33846
34029
|
}
|
|
33847
34030
|
const forcedFallback = forceRevalidate && entry?.staleWhileRevalidate ? entry : void 0;
|
|
33848
34031
|
if (!forceRevalidate && staleWhileRevalidate && entry?.staleWhileRevalidate && m2) {
|
|
33849
|
-
register2(
|
|
34032
|
+
register2(
|
|
34033
|
+
dirname4(this.cache.path()),
|
|
34034
|
+
m2,
|
|
34035
|
+
url,
|
|
34036
|
+
getHeader(options.headers, "accept")
|
|
34037
|
+
);
|
|
33850
34038
|
logRequest(url, "stale", { method });
|
|
33851
34039
|
return entry;
|
|
33852
34040
|
}
|
|
@@ -34017,7 +34205,7 @@ var readHead = async (fh) => {
|
|
|
34017
34205
|
const entry = CacheEntry.decodeHead(headBuf);
|
|
34018
34206
|
return entry.statusCode ? entry : void 0;
|
|
34019
34207
|
};
|
|
34020
|
-
var revalidateEntry = async (rc, method, url) => {
|
|
34208
|
+
var revalidateEntry = async (rc, method, url, accept) => {
|
|
34021
34209
|
try {
|
|
34022
34210
|
const u2 = typeof url === "string" ? new URL(url) : url;
|
|
34023
34211
|
const key = cacheKey(method, u2);
|
|
@@ -34046,6 +34234,9 @@ var revalidateEntry = async (rc, method, url) => {
|
|
|
34046
34234
|
"npm-session",
|
|
34047
34235
|
randomUUID2()
|
|
34048
34236
|
);
|
|
34237
|
+
if (accept) {
|
|
34238
|
+
options.headers = addHeader(options.headers, "accept", accept);
|
|
34239
|
+
}
|
|
34049
34240
|
setCacheHeaders(options, entry);
|
|
34050
34241
|
options.headers = addHeader(
|
|
34051
34242
|
options.headers,
|
|
@@ -34109,6 +34300,13 @@ var revalidateConcurrency = (raw) => {
|
|
|
34109
34300
|
const n7 = Number(raw);
|
|
34110
34301
|
return Number.isFinite(n7) && n7 >= 1 ? Math.min(32, Math.floor(n7)) : defaultConcurrency;
|
|
34111
34302
|
};
|
|
34303
|
+
var parseReq = (line) => {
|
|
34304
|
+
const method = line.startsWith("GET ") ? "GET" : line.startsWith("HEAD ") ? "HEAD" : void 0;
|
|
34305
|
+
if (!method) return void 0;
|
|
34306
|
+
const rest = line.substring(method.length + 1);
|
|
34307
|
+
const sp = rest.indexOf(" ");
|
|
34308
|
+
return sp === -1 ? [method, new URL(rest), void 0] : [method, new URL(rest.substring(0, sp)), rest.substring(sp + 1)];
|
|
34309
|
+
};
|
|
34112
34310
|
var runPool = async (reqs, concurrency, fn) => {
|
|
34113
34311
|
let next = 0;
|
|
34114
34312
|
const n7 = Math.min(concurrency, reqs.length);
|
|
@@ -34119,7 +34317,7 @@ var runPool = async (reqs, concurrency, fn) => {
|
|
|
34119
34317
|
if (i2 >= reqs.length) return;
|
|
34120
34318
|
const req = reqs[i2];
|
|
34121
34319
|
if (req === void 0) return;
|
|
34122
|
-
await fn(req
|
|
34320
|
+
await fn(...req);
|
|
34123
34321
|
}
|
|
34124
34322
|
})
|
|
34125
34323
|
);
|
|
@@ -34136,14 +34334,7 @@ var main = async (cache, input = process.stdin) => {
|
|
|
34136
34334
|
chunkLen += chunk.length;
|
|
34137
34335
|
});
|
|
34138
34336
|
input.on("end", () => {
|
|
34139
|
-
const reqs2 = Buffer.concat(
|
|
34140
|
-
chunks,
|
|
34141
|
-
chunkLen
|
|
34142
|
-
).toString().split("\0").filter(
|
|
34143
|
-
(i2) => !!i2 && (i2.startsWith("GET ") || i2.startsWith("HEAD "))
|
|
34144
|
-
).map(
|
|
34145
|
-
(i2) => i2.startsWith("GET ") ? ["GET", new URL(i2.substring("GET ".length))] : ["HEAD", new URL(i2.substring("HEAD ".length))]
|
|
34146
|
-
);
|
|
34337
|
+
const reqs2 = Buffer.concat(chunks, chunkLen).toString().split("\0").map(parseReq).filter((req) => req !== void 0);
|
|
34147
34338
|
res(reqs2);
|
|
34148
34339
|
});
|
|
34149
34340
|
});
|
|
@@ -34154,7 +34345,7 @@ var main = async (cache, input = process.stdin) => {
|
|
|
34154
34345
|
await runPool(
|
|
34155
34346
|
reqs,
|
|
34156
34347
|
revalidateConcurrency(process.env.VLT_REVALIDATE_CONCURRENCY),
|
|
34157
|
-
(method, url) => revalidateEntry(rc, method, url)
|
|
34348
|
+
(method, url, accept) => revalidateEntry(rc, method, url, accept)
|
|
34158
34349
|
);
|
|
34159
34350
|
return true;
|
|
34160
34351
|
};
|
|
@@ -14,42 +14,42 @@ import {
|
|
|
14
14
|
} from "./chunk-CLVRCGOZ.js";
|
|
15
15
|
import {
|
|
16
16
|
openUrl
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-TXTK2PKN.js";
|
|
18
18
|
import {
|
|
19
19
|
createHostContextsMap
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-6LEMBT22.js";
|
|
21
|
+
import "./chunk-TNEMFBP5.js";
|
|
22
|
+
import "./chunk-HYCYL4RX.js";
|
|
23
|
+
import "./chunk-G2YT2GWF.js";
|
|
24
|
+
import "./chunk-GDJ7JT2R.js";
|
|
21
25
|
import {
|
|
22
26
|
PackageInfoClient
|
|
23
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-CTQSUNNE.js";
|
|
24
28
|
import "./chunk-ZWKI5OSF.js";
|
|
25
|
-
import "./chunk-VL7RJVNN.js";
|
|
26
|
-
import "./chunk-5HBKYSTX.js";
|
|
27
|
-
import "./chunk-G2YT2GWF.js";
|
|
28
|
-
import "./chunk-GDJ7JT2R.js";
|
|
29
|
-
import "./chunk-5JFRXIK2.js";
|
|
30
29
|
import "./chunk-WGDTG44V.js";
|
|
30
|
+
import "./chunk-2PWSMJD7.js";
|
|
31
31
|
import {
|
|
32
32
|
Query,
|
|
33
33
|
actual
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-47M7IZ5P.js";
|
|
35
35
|
import {
|
|
36
36
|
SecurityArchive
|
|
37
|
-
} from "./chunk-
|
|
38
|
-
import "./chunk-USTJECVS.js";
|
|
39
|
-
import "./chunk-YOE3VZFX.js";
|
|
37
|
+
} from "./chunk-ZDQJWRCU.js";
|
|
40
38
|
import {
|
|
41
39
|
commandUsage
|
|
42
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-CBASIDQH.js";
|
|
41
|
+
import "./chunk-X2AWQGYG.js";
|
|
42
|
+
import "./chunk-4KCU2KZL.js";
|
|
43
|
+
import "./chunk-YOE3VZFX.js";
|
|
43
44
|
import {
|
|
44
45
|
Spec
|
|
45
46
|
} from "./chunk-XKVU23NC.js";
|
|
46
|
-
import "./chunk-
|
|
47
|
-
import "./chunk-4KCU2KZL.js";
|
|
47
|
+
import "./chunk-CEHPRPGQ.js";
|
|
48
48
|
import "./chunk-HTOTG4TS.js";
|
|
49
|
-
import "./chunk-
|
|
49
|
+
import "./chunk-APMYKJI2.js";
|
|
50
|
+
import "./chunk-SNOBGFNM.js";
|
|
50
51
|
import "./chunk-E74WGW5C.js";
|
|
51
|
-
import "./chunk-
|
|
52
|
-
import "./chunk-UBLFPJHV.js";
|
|
52
|
+
import "./chunk-U7TEQCBN.js";
|
|
53
53
|
import "./chunk-VFBCWAOC.js";
|
|
54
54
|
import "./chunk-XNLSTHDK.js";
|
|
55
55
|
import "./chunk-BHJT53TP.js";
|
|
@@ -9,21 +9,36 @@ globalThis.setInterval = _vlt_setInterval;
|
|
|
9
9
|
globalThis.clearInterval = _vlt_clearInterval;
|
|
10
10
|
import {createRequire as _vlt_createRequire} from "node:module";
|
|
11
11
|
var require = _vlt_createRequire(import.meta.filename);
|
|
12
|
+
import {
|
|
13
|
+
persistedEntries
|
|
14
|
+
} from "./chunk-2IMBYPYC.js";
|
|
12
15
|
import {
|
|
13
16
|
require_emoji_regex
|
|
14
17
|
} from "./chunk-VTEFO2FT.js";
|
|
18
|
+
import "./chunk-J2XWQVDK.js";
|
|
19
|
+
import "./chunk-CTQSUNNE.js";
|
|
20
|
+
import "./chunk-ZWKI5OSF.js";
|
|
15
21
|
import {
|
|
16
22
|
source_default
|
|
17
23
|
} from "./chunk-WGDTG44V.js";
|
|
24
|
+
import "./chunk-2PWSMJD7.js";
|
|
25
|
+
import "./chunk-X2AWQGYG.js";
|
|
18
26
|
import {
|
|
19
27
|
ViewClass
|
|
20
28
|
} from "./chunk-4KCU2KZL.js";
|
|
29
|
+
import "./chunk-YOE3VZFX.js";
|
|
30
|
+
import "./chunk-XKVU23NC.js";
|
|
31
|
+
import "./chunk-CEHPRPGQ.js";
|
|
32
|
+
import "./chunk-HTOTG4TS.js";
|
|
33
|
+
import "./chunk-SNOBGFNM.js";
|
|
21
34
|
import {
|
|
22
35
|
emitter
|
|
23
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-U7TEQCBN.js";
|
|
24
37
|
import {
|
|
25
38
|
asError
|
|
26
39
|
} from "./chunk-VFBCWAOC.js";
|
|
40
|
+
import "./chunk-XNLSTHDK.js";
|
|
41
|
+
import "./chunk-VE6CCH33.js";
|
|
27
42
|
import "./chunk-WZWDS3W4.js";
|
|
28
43
|
import {
|
|
29
44
|
__commonJS,
|
|
@@ -18617,6 +18632,13 @@ var InstallReporter = class extends ViewClass {
|
|
|
18617
18632
|
out += "\u{1F50E} Run `vlt query :scripts` to list them\n";
|
|
18618
18633
|
out += "\u{1F528} Run `vlt build` to run all required scripts to build installed packages.\n";
|
|
18619
18634
|
}
|
|
18635
|
+
const saved = _result.persistedConfig;
|
|
18636
|
+
if (saved) {
|
|
18637
|
+
for (const e of persistedEntries(saved.values)) {
|
|
18638
|
+
out += `
|
|
18639
|
+
Saved ${e} to ${saved.which} vlt.json`;
|
|
18640
|
+
}
|
|
18641
|
+
}
|
|
18620
18642
|
this.#instance?.rerender((0, import_react30.createElement)(App2, { trailer: out }));
|
|
18621
18643
|
return void 0;
|
|
18622
18644
|
}
|
|
@@ -12,33 +12,32 @@ var require = _vlt_createRequire(import.meta.filename);
|
|
|
12
12
|
import {
|
|
13
13
|
ExecCommand,
|
|
14
14
|
views
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-BUXPKRYB.js";
|
|
16
16
|
import "./chunk-RIYFGX27.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-6LEMBT22.js";
|
|
18
|
+
import "./chunk-TNEMFBP5.js";
|
|
19
|
+
import "./chunk-HYCYL4RX.js";
|
|
20
20
|
import "./chunk-G2YT2GWF.js";
|
|
21
21
|
import "./chunk-GDJ7JT2R.js";
|
|
22
|
-
import "./chunk-5JFRXIK2.js";
|
|
23
22
|
import "./chunk-VTEFO2FT.js";
|
|
24
23
|
import "./chunk-WGDTG44V.js";
|
|
24
|
+
import "./chunk-2PWSMJD7.js";
|
|
25
25
|
import {
|
|
26
26
|
run,
|
|
27
27
|
runFG
|
|
28
|
-
} from "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-USTJECVS.js";
|
|
31
|
-
import "./chunk-YOE3VZFX.js";
|
|
28
|
+
} from "./chunk-47M7IZ5P.js";
|
|
29
|
+
import "./chunk-ZDQJWRCU.js";
|
|
32
30
|
import {
|
|
33
31
|
commandUsage
|
|
34
|
-
} from "./chunk-
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-MNK55XSE.js";
|
|
32
|
+
} from "./chunk-CBASIDQH.js";
|
|
33
|
+
import "./chunk-X2AWQGYG.js";
|
|
37
34
|
import "./chunk-4KCU2KZL.js";
|
|
35
|
+
import "./chunk-YOE3VZFX.js";
|
|
36
|
+
import "./chunk-XKVU23NC.js";
|
|
37
|
+
import "./chunk-CEHPRPGQ.js";
|
|
38
38
|
import "./chunk-HTOTG4TS.js";
|
|
39
39
|
import "./chunk-E74WGW5C.js";
|
|
40
|
-
import "./chunk-
|
|
41
|
-
import "./chunk-UBLFPJHV.js";
|
|
40
|
+
import "./chunk-U7TEQCBN.js";
|
|
42
41
|
import "./chunk-VFBCWAOC.js";
|
|
43
42
|
import "./chunk-XNLSTHDK.js";
|
|
44
43
|
import "./chunk-BHJT53TP.js";
|