@vltpkg/cli-js 1.3.3 → 1.3.4
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-KMBBQIIT.js → access-AY2CIGVN.js} +4 -4
- package/{bugs-CABZX76X.js → bugs-6PTC6V7S.js} +12 -12
- package/{build-WNHKYA4E.js → build-R6OJNJDU.js} +6 -6
- package/{cache-KKT4GIYD.js → cache-NVLCCVWQ.js} +6 -6
- package/{chunk-3IDIPSH7.js → chunk-4XTUCYBW.js} +1 -1
- package/{chunk-MC6CESRA.js → chunk-AFUXQ3P4.js} +1 -1
- package/{chunk-GZWJAGBL.js → chunk-B5AKQ5TS.js} +3 -3
- package/{chunk-CU752KW7.js → chunk-BCANUHR3.js} +1 -1
- package/{chunk-LY5FNWRY.js → chunk-BFR3XHEM.js} +3 -3
- package/{chunk-ROCFQPP2.js → chunk-CYN4ADWK.js} +2 -2
- package/{chunk-QBXGMTDE.js → chunk-D4KNFORN.js} +1 -1
- package/{chunk-GA4LA6B2.js → chunk-DK6HGJCF.js} +4 -4
- package/chunk-DM2XRLCS.js +75 -0
- package/{chunk-SH24EMXO.js → chunk-GCLZEI3R.js} +150 -40
- package/{chunk-BUKZHMMK.js → chunk-INEKXXUQ.js} +1 -0
- package/{chunk-I6QGYSB4.js → chunk-LHIDMYN2.js} +1 -1
- package/{chunk-DCFLXO2M.js → chunk-MVD5AUNS.js} +1 -1
- package/{chunk-HCMAX6Q5.js → chunk-MWAWPY3P.js} +3 -3
- package/chunk-OFHNSAQ5.js +2155 -0
- package/{chunk-TJBBYDUN.js → chunk-QEWKCTQY.js} +4 -4
- package/{chunk-ZRRNOLEG.js → chunk-QGFDMXDH.js} +196 -96
- package/{chunk-ZBJRZXSU.js → chunk-QZIC3WVP.js} +3 -3
- package/{chunk-ZWKI5OSF.js → chunk-SRWDPPLX.js} +0 -1377
- package/{chunk-MOL2DUEQ.js → chunk-TL5SYXSC.js} +279 -35
- package/{chunk-CSZTT7QN.js → chunk-TOKUDCSW.js} +2 -2
- package/{chunk-YU2W5UPG.js → chunk-WXRS5PRL.js} +1 -1
- package/{chunk-ENSGPOLR.js → chunk-XU5WNX4S.js} +3 -1
- package/{ci-BGVGC5RF.js → ci-FEZ6B33S.js} +7 -7
- package/cli-package.json +1 -1
- package/{config-AWX2VEKL.js → config-EV5S74AA.js} +5 -5
- package/{config-FIKZ4VWG.js → config-VVPVV36W.js} +6 -6
- package/{create-CHTG7KO3.js → create-VGCARZLU.js} +13 -13
- package/{deprecate-W7KQ62HF.js → deprecate-3E27QREJ.js} +7 -7
- package/{dist-tag-66CC6HT7.js → dist-tag-ZIDIGEIM.js} +4 -4
- package/{docs-HW4U5TGD.js → docs-GESU73FF.js} +12 -12
- package/{exec-BVVNAGFI.js → exec-3SE4PRXY.js} +13 -13
- package/{exec-cache-L3ONPM5C.js → exec-cache-7QOIKCYP.js} +11 -11
- package/{exec-local-NR3RYQDQ.js → exec-local-EVAI6IYM.js} +10 -10
- package/{help-5YL6SUAN.js → help-H54DUW2F.js} +4 -4
- package/{init-RI2WVCGL.js → init-JOAMKEKV.js} +7 -7
- package/{install-OWAI4EOW.js → install-WHOVSLKH.js} +12 -12
- package/{list-4ZFX7ANG.js → list-7X2RIDA4.js} +12 -12
- package/{login-6TL3EE6Q.js → login-P5NRTQDS.js} +8 -8
- package/{logout-VQWHVHBE.js → logout-5PCTGCJZ.js} +4 -4
- package/{pack-Q5IRRAMU.js → pack-MLOVKXJZ.js} +9 -9
- package/package.json +1 -1
- package/{ping-2WV3V7GB.js → ping-6D6EEICV.js} +4 -4
- package/{pkg-RXB6BRS5.js → pkg-HC6N3DDH.js} +8 -8
- package/{profile-GNGWS5H2.js → profile-C3MNVMAE.js} +4 -4
- package/{publish-PI74W4GH.js → publish-3KUMQXKT.js} +12 -12
- package/{query-NESDWXGE.js → query-HNBW2ZGX.js} +12 -12
- package/{registry-MXAA4HVJ.js → registry-PY2L5ZWC.js} +2 -2
- package/registry-client-src-revalidate.js +150 -40
- package/{repo-PPBN3SKP.js → repo-VWEPCUXK.js} +12 -12
- package/{reporter-XBHCUW7W.js → reporter-UUDMEN4E.js} +6 -6
- package/{run-7GTWIFMV.js → run-OFW4MPAV.js} +10 -10
- package/{run-exec-VLSH5SOB.js → run-exec-ACGX23HX.js} +10 -10
- package/security-archive-src-update-expired.js +1 -1
- package/{setup-6O7RFGU2.js → setup-5C56O3S3.js} +10 -10
- package/{src-EJSVFFXB.js → src-3MEJQYBG.js} +21 -7
- package/{src-U4MCZFJT.js → src-LH2HZ6FT.js} +2 -2
- package/{src-6E7KCC7J.js → src-SI5YMOJI.js} +9 -9
- package/{token-NZ4HODXE.js → token-RPQP6BV5.js} +4 -4
- package/{uninstall-KBZ6PJBG.js → uninstall-HDUNLNAD.js} +8 -8
- package/{unpublish-JBWSIBRX.js → unpublish-SB647KPY.js} +4 -4
- package/{update-X4EC6MPP.js → update-PAIZPQPH.js} +11 -11
- package/{version-QEHPAFAE.js → version-5O2P2ROI.js} +7 -7
- package/{view-WGGZTYAT.js → view-3YVL4M7Z.js} +7 -7
- 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-RYNXOULV.js → whoami-KFXNKZOX.js} +4 -4
- package/chunk-7JK53T6G.js +0 -75
- package/chunk-KH3ERNCA.js +0 -783
|
@@ -12,19 +12,19 @@ var require = _vlt_createRequire(import.meta.filename);
|
|
|
12
12
|
import {
|
|
13
13
|
MermaidImageView,
|
|
14
14
|
createGetAuthHeader
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-DK6HGJCF.js";
|
|
16
16
|
import {
|
|
17
17
|
createDiffFilesProvider
|
|
18
18
|
} from "./chunk-RIYFGX27.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-AFUXQ3P4.js";
|
|
20
20
|
import {
|
|
21
21
|
assertVltInstalled,
|
|
22
22
|
createHostContextsMap
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-BFR3XHEM.js";
|
|
24
24
|
import {
|
|
25
25
|
stdout
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import "./chunk-
|
|
26
|
+
} from "./chunk-TOKUDCSW.js";
|
|
27
|
+
import "./chunk-BCANUHR3.js";
|
|
28
28
|
import "./chunk-G2YT2GWF.js";
|
|
29
29
|
import "./chunk-CRGWLUGC.js";
|
|
30
30
|
import "./chunk-WGDTG44V.js";
|
|
@@ -37,23 +37,23 @@ import {
|
|
|
37
37
|
humanReadableOutput,
|
|
38
38
|
jsonOutput,
|
|
39
39
|
mermaidOutput
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-QGFDMXDH.js";
|
|
41
41
|
import {
|
|
42
42
|
SecurityArchive
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-MVD5AUNS.js";
|
|
44
44
|
import {
|
|
45
45
|
commandUsage
|
|
46
|
-
} from "./chunk-
|
|
47
|
-
import "./chunk-
|
|
46
|
+
} from "./chunk-LHIDMYN2.js";
|
|
47
|
+
import "./chunk-INEKXXUQ.js";
|
|
48
48
|
import "./chunk-4KCU2KZL.js";
|
|
49
49
|
import "./chunk-JIQBZ2UT.js";
|
|
50
50
|
import "./chunk-64VFL4WI.js";
|
|
51
|
-
import "./chunk-
|
|
51
|
+
import "./chunk-XU5WNX4S.js";
|
|
52
52
|
import "./chunk-HTOTG4TS.js";
|
|
53
|
-
import "./chunk-
|
|
53
|
+
import "./chunk-GCLZEI3R.js";
|
|
54
54
|
import "./chunk-APMYKJI2.js";
|
|
55
55
|
import "./chunk-PBBULTAG.js";
|
|
56
|
-
import "./chunk-
|
|
56
|
+
import "./chunk-WXRS5PRL.js";
|
|
57
57
|
import "./chunk-U7TEQCBN.js";
|
|
58
58
|
import "./chunk-XNLSTHDK.js";
|
|
59
59
|
import "./chunk-PDWPFR5T.js";
|
|
@@ -14,11 +14,11 @@ import {
|
|
|
14
14
|
} from "./chunk-J4NHRZX6.js";
|
|
15
15
|
import {
|
|
16
16
|
commandUsage
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-LHIDMYN2.js";
|
|
18
18
|
import "./chunk-64VFL4WI.js";
|
|
19
19
|
import {
|
|
20
20
|
getCommand
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-XU5WNX4S.js";
|
|
22
22
|
import "./chunk-XNLSTHDK.js";
|
|
23
23
|
import "./chunk-BP3PQ67D.js";
|
|
24
24
|
import {
|
|
@@ -7852,7 +7852,7 @@ var require_client_h2 = __commonJS({
|
|
|
7852
7852
|
"../../node_modules/.vlt/~npm~undici@7.29.0/node_modules/undici/lib/dispatcher/client-h2.js"(exports, module3) {
|
|
7853
7853
|
"use strict";
|
|
7854
7854
|
var assert = __require("node:assert");
|
|
7855
|
-
var { pipeline } = __require("node:stream");
|
|
7855
|
+
var { pipeline: pipeline2 } = __require("node:stream");
|
|
7856
7856
|
var util = require_util();
|
|
7857
7857
|
var {
|
|
7858
7858
|
RequestContentLengthMismatchError,
|
|
@@ -8485,7 +8485,7 @@ var require_client_h2 = __commonJS({
|
|
|
8485
8485
|
}
|
|
8486
8486
|
function writeStream(abort, socket, expectsPayload, h2stream, body, client, request2, contentLength) {
|
|
8487
8487
|
assert(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
|
|
8488
|
-
const pipe =
|
|
8488
|
+
const pipe = pipeline2(
|
|
8489
8489
|
body,
|
|
8490
8490
|
h2stream,
|
|
8491
8491
|
(err) => {
|
|
@@ -12312,7 +12312,7 @@ var require_api_pipeline = __commonJS({
|
|
|
12312
12312
|
util.destroy(ret, err);
|
|
12313
12313
|
}
|
|
12314
12314
|
};
|
|
12315
|
-
function
|
|
12315
|
+
function pipeline2(opts, handler) {
|
|
12316
12316
|
try {
|
|
12317
12317
|
const pipelineHandler = new PipelineHandler(opts, handler);
|
|
12318
12318
|
this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler);
|
|
@@ -12321,7 +12321,7 @@ var require_api_pipeline = __commonJS({
|
|
|
12321
12321
|
return new PassThrough().destroy(err);
|
|
12322
12322
|
}
|
|
12323
12323
|
}
|
|
12324
|
-
module3.exports =
|
|
12324
|
+
module3.exports = pipeline2;
|
|
12325
12325
|
}
|
|
12326
12326
|
});
|
|
12327
12327
|
|
|
@@ -17553,13 +17553,13 @@ var require_cache2 = __commonJS({
|
|
|
17553
17553
|
var require_decompress = __commonJS({
|
|
17554
17554
|
"../../node_modules/.vlt/~npm~undici@7.29.0/node_modules/undici/lib/interceptor/decompress.js"(exports, module3) {
|
|
17555
17555
|
"use strict";
|
|
17556
|
-
var { createInflate, createGunzip, createBrotliDecompress, createZstdDecompress } = __require("node:zlib");
|
|
17557
|
-
var { pipeline } = __require("node:stream");
|
|
17556
|
+
var { createInflate, createGunzip: createGunzip2, createBrotliDecompress, createZstdDecompress } = __require("node:zlib");
|
|
17557
|
+
var { pipeline: pipeline2 } = __require("node:stream");
|
|
17558
17558
|
var DecoratorHandler = require_decorator_handler();
|
|
17559
17559
|
var { runtimeFeatures } = require_runtime_features();
|
|
17560
17560
|
var supportedEncodings = {
|
|
17561
|
-
gzip:
|
|
17562
|
-
"x-gzip":
|
|
17561
|
+
gzip: createGunzip2,
|
|
17562
|
+
"x-gzip": createGunzip2,
|
|
17563
17563
|
br: createBrotliDecompress,
|
|
17564
17564
|
deflate: createInflate,
|
|
17565
17565
|
compress: createInflate,
|
|
@@ -17663,7 +17663,7 @@ var require_decompress = __commonJS({
|
|
|
17663
17663
|
#setupMultipleDecompressors(controller) {
|
|
17664
17664
|
const lastDecompressor = this.#decompressors[this.#decompressors.length - 1];
|
|
17665
17665
|
this.#setupDecompressorEvents(lastDecompressor, controller);
|
|
17666
|
-
|
|
17666
|
+
pipeline2(this.#decompressors, (err) => {
|
|
17667
17667
|
if (err) {
|
|
17668
17668
|
super.onResponseError(controller, err);
|
|
17669
17669
|
return;
|
|
@@ -20408,7 +20408,7 @@ var require_fetch = __commonJS({
|
|
|
20408
20408
|
subresourceSet
|
|
20409
20409
|
} = require_constants3();
|
|
20410
20410
|
var EE = __require("node:events");
|
|
20411
|
-
var { Readable, pipeline, finished, isErrored, isReadable } = __require("node:stream");
|
|
20411
|
+
var { Readable, pipeline: pipeline2, finished, isErrored, isReadable } = __require("node:stream");
|
|
20412
20412
|
var { addAbortListener, bufferToLowerCasedHeaderName } = require_util();
|
|
20413
20413
|
var { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require_data_url();
|
|
20414
20414
|
var { getGlobalDispatcher } = require_global2();
|
|
@@ -21399,7 +21399,7 @@ var require_fetch = __commonJS({
|
|
|
21399
21399
|
status,
|
|
21400
21400
|
statusText: statusText2,
|
|
21401
21401
|
headersList,
|
|
21402
|
-
body: decoders.length ?
|
|
21402
|
+
body: decoders.length ? pipeline2(this.body, ...decoders, (err) => {
|
|
21403
21403
|
if (err) {
|
|
21404
21404
|
this.onError(err);
|
|
21405
21405
|
}
|
|
@@ -25100,7 +25100,7 @@ ${value}`;
|
|
|
25100
25100
|
var require_eventsource = __commonJS({
|
|
25101
25101
|
"../../node_modules/.vlt/~npm~undici@7.29.0/node_modules/undici/lib/web/eventsource/eventsource.js"(exports, module3) {
|
|
25102
25102
|
"use strict";
|
|
25103
|
-
var { pipeline } = __require("node:stream");
|
|
25103
|
+
var { pipeline: pipeline2 } = __require("node:stream");
|
|
25104
25104
|
var { fetching } = require_fetch();
|
|
25105
25105
|
var { makeRequest } = require_request2();
|
|
25106
25106
|
var { webidl } = require_webidl();
|
|
@@ -25258,7 +25258,7 @@ var require_eventsource = __commonJS({
|
|
|
25258
25258
|
));
|
|
25259
25259
|
}
|
|
25260
25260
|
});
|
|
25261
|
-
|
|
25261
|
+
pipeline2(
|
|
25262
25262
|
response.body.stream,
|
|
25263
25263
|
eventSourceStream,
|
|
25264
25264
|
(error2) => {
|
|
@@ -32460,13 +32460,15 @@ import { randomUUID } from "node:crypto";
|
|
|
32460
32460
|
import { closeSync, openSync, readFileSync as readFileSync2, readSync } from "node:fs";
|
|
32461
32461
|
import { availableParallelism } from "node:os";
|
|
32462
32462
|
import { dirname as dirname3, resolve as resolve10 } from "node:path";
|
|
32463
|
+
import { pipeline } from "node:stream";
|
|
32463
32464
|
import { setTimeout as setTimeout3 } from "node:timers/promises";
|
|
32465
|
+
import { createGunzip } from "node:zlib";
|
|
32464
32466
|
|
|
32465
32467
|
// ../../src/user-agent/package.json
|
|
32466
32468
|
var package_default = {
|
|
32467
32469
|
name: "@vltpkg/user-agent",
|
|
32468
32470
|
description: "The User-Agent string that vlt sends with every outbound request",
|
|
32469
|
-
version: "1.3.
|
|
32471
|
+
version: "1.3.4",
|
|
32470
32472
|
repository: {
|
|
32471
32473
|
type: "git",
|
|
32472
32474
|
url: "git+https://github.com/vltpkg/vltpkg.git",
|
|
@@ -33021,7 +33023,9 @@ var CacheEntry = class _CacheEntry {
|
|
|
33021
33023
|
* Note that this will *usually* not be true if the value is coming out of
|
|
33022
33024
|
* the cache, because cache entries not exploded into the global store are
|
|
33023
33025
|
* un-gzipped in place. It should _only_ be called for artifacts that come
|
|
33024
|
-
* from an actual http response
|
|
33026
|
+
* from an actual http response, whatever its encoding: an identity body
|
|
33027
|
+
* is hashed as it came, a gzipped one before anything un-gzips it in
|
|
33028
|
+
* memory.
|
|
33025
33029
|
*
|
|
33026
33030
|
* Returns true if anything was actually verified.
|
|
33027
33031
|
*/
|
|
@@ -33061,11 +33065,26 @@ var CacheEntry = class _CacheEntry {
|
|
|
33061
33065
|
}
|
|
33062
33066
|
return computed;
|
|
33063
33067
|
}
|
|
33068
|
+
#hash(body = this._body) {
|
|
33069
|
+
const hash2 = createHash2("sha512");
|
|
33070
|
+
hash2.update(body);
|
|
33071
|
+
return `sha512-${hash2.digest("base64")}`;
|
|
33072
|
+
}
|
|
33073
|
+
/**
|
|
33074
|
+
* The hash of the body un-gzipped, or of the body itself if it is not
|
|
33075
|
+
* gzipped, without un-gzipping the entry. Bounded like {@link unzip},
|
|
33076
|
+
* and throws like it on a body that will not un-gzip.
|
|
33077
|
+
*
|
|
33078
|
+
* Never the hash to record for an artifact, which is the hash of its
|
|
33079
|
+
* bytes as served. It pins the same content, though, and is what a
|
|
33080
|
+
* body hashed after something un-gzipped it was pinned with.
|
|
33081
|
+
*/
|
|
33082
|
+
unzippedIntegrity() {
|
|
33083
|
+
return this.#hash(this.isGzip ? this.#gunzip() : this._body);
|
|
33084
|
+
}
|
|
33064
33085
|
get integrityActual() {
|
|
33065
33086
|
if (this.#integrityActual) return this.#integrityActual;
|
|
33066
|
-
const
|
|
33067
|
-
hash2.update(this._body);
|
|
33068
|
-
const i2 = `sha512-${hash2.digest("base64")}`;
|
|
33087
|
+
const i2 = this.#hash();
|
|
33069
33088
|
this.integrityActual = i2;
|
|
33070
33089
|
return i2;
|
|
33071
33090
|
}
|
|
@@ -33153,13 +33172,40 @@ var CacheEntry = class _CacheEntry {
|
|
|
33153
33172
|
const ct2 = this.getHeaderString("content-type");
|
|
33154
33173
|
if (ct2) return this.#isJSON = /\bjson\b/.test(ct2);
|
|
33155
33174
|
if (!this._body.length) return false;
|
|
33175
|
+
const wire = !this.#fromCache && !this.#integrityActual && this.isGzip ? this.#hash() : void 0;
|
|
33156
33176
|
this.unzip();
|
|
33157
33177
|
const buf = this._body;
|
|
33158
33178
|
if (!buf.length) return false;
|
|
33159
33179
|
this.#isJSON = buf[0] === 123;
|
|
33160
33180
|
if (this.#isJSON) this.setHeader("content-type", "text/json");
|
|
33181
|
+
else if (wire) this.integrityActual = wire;
|
|
33161
33182
|
return this.#isJSON;
|
|
33162
33183
|
}
|
|
33184
|
+
/**
|
|
33185
|
+
* Label a 200 network body that is not json and came with no
|
|
33186
|
+
* content-type `application/octet-stream`, the way the json sniff
|
|
33187
|
+
* labels json `text/json`.
|
|
33188
|
+
*
|
|
33189
|
+
* The label says the hash the entry is stored under is the hash of
|
|
33190
|
+
* its bytes as served, checked or recorded by
|
|
33191
|
+
* `RegistryClient.request()`. So it is applied only where that is
|
|
33192
|
+
* known, right before such an entry is stored, and never by the
|
|
33193
|
+
* sniff: an entry with no content-type read back from the cache is
|
|
33194
|
+
* not known to be one.
|
|
33195
|
+
*
|
|
33196
|
+
* A decoded entry, an error body, an empty body, json, and a body
|
|
33197
|
+
* served with a content-type are left as they are. Not an error body
|
|
33198
|
+
* or an empty one: a content-type that is not json makes an entry
|
|
33199
|
+
* immutable (see {@link valid}), which neither was when served with
|
|
33200
|
+
* none, and no artifact is empty. The length is checked after the
|
|
33201
|
+
* sniff, which un-gzips a body with no content-type.
|
|
33202
|
+
*/
|
|
33203
|
+
labelArtifact() {
|
|
33204
|
+
if (this.#fromCache || this.#statusCode !== 200 || this.isJSON || this.getHeaderString("content-type") || !this.#bodyLength) {
|
|
33205
|
+
return;
|
|
33206
|
+
}
|
|
33207
|
+
this.setHeader("content-type", "application/octet-stream");
|
|
33208
|
+
}
|
|
33163
33209
|
#isGzip;
|
|
33164
33210
|
get isGzip() {
|
|
33165
33211
|
if (this.#isGzip !== void 0) return this.#isGzip;
|
|
@@ -33176,6 +33222,24 @@ var CacheEntry = class _CacheEntry {
|
|
|
33176
33222
|
}
|
|
33177
33223
|
return this.#isGzip;
|
|
33178
33224
|
}
|
|
33225
|
+
// the body un-gzipped, for a body known to be gzipped
|
|
33226
|
+
#gunzip() {
|
|
33227
|
+
if (this._body.length === 0)
|
|
33228
|
+
throw error("Invalid buffer, cant unzip");
|
|
33229
|
+
const max = Math.min(
|
|
33230
|
+
maxUnpackedBytes,
|
|
33231
|
+
this._body.length * MAX_DECOMPRESSION_RATIO
|
|
33232
|
+
);
|
|
33233
|
+
try {
|
|
33234
|
+
return gunzipSync(this._body, { maxOutputLength: max });
|
|
33235
|
+
} catch (er) {
|
|
33236
|
+
throw er.code === "ERR_BUFFER_TOO_LARGE" ? error("cache entry exceeds maximum unpacked size", {
|
|
33237
|
+
found: this._body.length,
|
|
33238
|
+
max,
|
|
33239
|
+
cause: er
|
|
33240
|
+
}) : er;
|
|
33241
|
+
}
|
|
33242
|
+
}
|
|
33179
33243
|
/**
|
|
33180
33244
|
* Un-gzip encode the body.
|
|
33181
33245
|
* Returns true if it was previously gzip (so something was done), otherwise
|
|
@@ -33183,22 +33247,7 @@ var CacheEntry = class _CacheEntry {
|
|
|
33183
33247
|
*/
|
|
33184
33248
|
unzip() {
|
|
33185
33249
|
if (this.isGzip) {
|
|
33186
|
-
|
|
33187
|
-
throw error("Invalid buffer, cant unzip");
|
|
33188
|
-
const max = Math.min(
|
|
33189
|
-
maxUnpackedBytes,
|
|
33190
|
-
this._body.length * MAX_DECOMPRESSION_RATIO
|
|
33191
|
-
);
|
|
33192
|
-
let b;
|
|
33193
|
-
try {
|
|
33194
|
-
b = gunzipSync(this._body, { maxOutputLength: max });
|
|
33195
|
-
} catch (er) {
|
|
33196
|
-
throw er.code === "ERR_BUFFER_TOO_LARGE" ? error("cache entry exceeds maximum unpacked size", {
|
|
33197
|
-
found: this._body.length,
|
|
33198
|
-
max,
|
|
33199
|
-
cause: er
|
|
33200
|
-
}) : er;
|
|
33201
|
-
}
|
|
33250
|
+
const b = this.#gunzip();
|
|
33202
33251
|
this.setHeader("content-encoding", "identity");
|
|
33203
33252
|
const u8 = new Uint8Array(b.buffer, b.byteOffset, b.byteLength);
|
|
33204
33253
|
this.#body = u8;
|
|
@@ -34208,6 +34257,65 @@ var RegistryClient = class {
|
|
|
34208
34257
|
integrity
|
|
34209
34258
|
);
|
|
34210
34259
|
}
|
|
34260
|
+
/**
|
|
34261
|
+
* Make a request and hand back the response body as it arrives, instead of
|
|
34262
|
+
* buffering it into a {@link CacheEntry}. For a body a caller acts on line
|
|
34263
|
+
* by line — the NDJSON the batch endpoints stream — waiting for the last
|
|
34264
|
+
* byte is the difference between using the first record now and using it
|
|
34265
|
+
* once the server has finished computing the last one.
|
|
34266
|
+
*
|
|
34267
|
+
* The body is gunzipped here when the registry compressed it, so a caller
|
|
34268
|
+
* always reads what the server serialized. Nothing is cached and nothing is
|
|
34269
|
+
* retried: a caller that loses the stream falls back to the requests it was
|
|
34270
|
+
* avoiding.
|
|
34271
|
+
*/
|
|
34272
|
+
async requestStream(url, options = {}) {
|
|
34273
|
+
const u2 = typeof url === "string" ? new URL(url) : url;
|
|
34274
|
+
const o = {
|
|
34275
|
+
...options,
|
|
34276
|
+
method: options.method ?? "GET",
|
|
34277
|
+
path: u2.pathname.replace(/\/+$/, "") + u2.search,
|
|
34278
|
+
origin: u2.origin,
|
|
34279
|
+
headers: addHeader(
|
|
34280
|
+
addHeader(
|
|
34281
|
+
addHeader(
|
|
34282
|
+
options.headers,
|
|
34283
|
+
"accept-encoding",
|
|
34284
|
+
"gzip;q=1.0, identity;q=0.5"
|
|
34285
|
+
),
|
|
34286
|
+
"user-agent",
|
|
34287
|
+
userAgent
|
|
34288
|
+
),
|
|
34289
|
+
"npm-session",
|
|
34290
|
+
this.#session
|
|
34291
|
+
)
|
|
34292
|
+
};
|
|
34293
|
+
o.headers = addHeader(
|
|
34294
|
+
o.headers,
|
|
34295
|
+
"authorization",
|
|
34296
|
+
await getTokenByURL(String(u2), this.identity)
|
|
34297
|
+
);
|
|
34298
|
+
logRequest(url, "start", { method: o.method });
|
|
34299
|
+
const requestStart = Date.now();
|
|
34300
|
+
const response = await this.agent.request(
|
|
34301
|
+
o
|
|
34302
|
+
);
|
|
34303
|
+
logRequest(url, "complete", {
|
|
34304
|
+
method: o.method,
|
|
34305
|
+
statusCode: response.statusCode,
|
|
34306
|
+
durationMs: Date.now() - requestStart
|
|
34307
|
+
});
|
|
34308
|
+
const encoding = response.headers["content-encoding"];
|
|
34309
|
+
const gzipped = typeof encoding === "string" && /\bgzip\b/.test(encoding);
|
|
34310
|
+
let body = response.body;
|
|
34311
|
+
if (gzipped) {
|
|
34312
|
+
const gunzip = createGunzip();
|
|
34313
|
+
pipeline(response.body, gunzip, () => {
|
|
34314
|
+
});
|
|
34315
|
+
body = gunzip;
|
|
34316
|
+
}
|
|
34317
|
+
return { statusCode: response.statusCode, body };
|
|
34318
|
+
}
|
|
34211
34319
|
async request(url, options = {}) {
|
|
34212
34320
|
const u2 = typeof url === "string" ? new URL(url) : url;
|
|
34213
34321
|
const {
|
|
@@ -34221,10 +34329,10 @@ var RegistryClient = class {
|
|
|
34221
34329
|
} = options;
|
|
34222
34330
|
const { trustIntegrity, verifyDigest } = options;
|
|
34223
34331
|
const m2 = isCacheableMethod(method) ? method : void 0;
|
|
34224
|
-
const { useCache = !!m2 } = options;
|
|
34332
|
+
const { useCache = !!m2, readCache = true } = options;
|
|
34225
34333
|
signal?.throwIfAborted();
|
|
34226
34334
|
const key = cacheKey(method, u2);
|
|
34227
|
-
const buffer = useCache ? await this.cache.fetch(key, { context: { integrity } }) : void 0;
|
|
34335
|
+
const buffer = useCache && readCache ? await this.cache.fetch(key, { context: { integrity } }) : void 0;
|
|
34228
34336
|
const entry = buffer ? this.#decodeCached(buffer) : void 0;
|
|
34229
34337
|
if (entry?.valid && forceRevalidate !== true) {
|
|
34230
34338
|
if (forceRevalidate === "background" && m2) {
|
|
@@ -34319,16 +34427,17 @@ var RegistryClient = class {
|
|
|
34319
34427
|
durationMs: Date.now() - requestStart
|
|
34320
34428
|
}
|
|
34321
34429
|
);
|
|
34322
|
-
if (!trustIntegrity && !result.fromCache) {
|
|
34323
|
-
result.
|
|
34324
|
-
if (result.statusCode === 200) result.checkIntegrity({ url });
|
|
34430
|
+
if (!trustIntegrity && !result.fromCache && result.statusCode === 200) {
|
|
34431
|
+
result.checkIntegrity({ url });
|
|
34325
34432
|
}
|
|
34326
34433
|
if (verifyDigest && !integrity && !result.fromCache && result.statusCode === 200) {
|
|
34327
34434
|
result.checkDigest(verifyDigest === "required", { url });
|
|
34328
34435
|
}
|
|
34329
34436
|
const clobbersCachedEntry = forceRevalidate && !!entry && result.statusCode !== 200;
|
|
34330
34437
|
if (useCache && !clobbersCachedEntry) {
|
|
34331
|
-
const
|
|
34438
|
+
const artifact = !result.fromCache && result.statusCode === 200 && !result.isJSON;
|
|
34439
|
+
const integrity2 = result.integrity ?? (artifact ? result.integrityActual : void 0);
|
|
34440
|
+
if (artifact) result.labelArtifact();
|
|
34332
34441
|
const encoded = result.encode();
|
|
34333
34442
|
const stored = Buffer.from(
|
|
34334
34443
|
encoded.buffer,
|
|
@@ -34370,6 +34479,7 @@ var RegistryClient = class {
|
|
|
34370
34479
|
contentLength
|
|
34371
34480
|
}
|
|
34372
34481
|
);
|
|
34482
|
+
if (!trustIntegrity) result.deleteHeader("integrity");
|
|
34373
34483
|
if (isRedirect(result)) {
|
|
34374
34484
|
response.body.resume();
|
|
34375
34485
|
const [nextURL, nextOptions] = redirect(options, result, url);
|
|
@@ -14,41 +14,41 @@ import {
|
|
|
14
14
|
} from "./chunk-CLVRCGOZ.js";
|
|
15
15
|
import {
|
|
16
16
|
openUrl
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-AFUXQ3P4.js";
|
|
18
18
|
import {
|
|
19
19
|
createHostContextsMap
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-BFR3XHEM.js";
|
|
21
|
+
import "./chunk-TOKUDCSW.js";
|
|
22
|
+
import "./chunk-BCANUHR3.js";
|
|
23
23
|
import "./chunk-G2YT2GWF.js";
|
|
24
24
|
import "./chunk-CRGWLUGC.js";
|
|
25
25
|
import {
|
|
26
26
|
PackageInfoClient
|
|
27
|
-
} from "./chunk-
|
|
28
|
-
import "./chunk-
|
|
27
|
+
} from "./chunk-TL5SYXSC.js";
|
|
28
|
+
import "./chunk-SRWDPPLX.js";
|
|
29
29
|
import "./chunk-WGDTG44V.js";
|
|
30
30
|
import "./chunk-J4NHRZX6.js";
|
|
31
31
|
import {
|
|
32
32
|
Query,
|
|
33
33
|
actual
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-QGFDMXDH.js";
|
|
35
35
|
import {
|
|
36
36
|
SecurityArchive
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-MVD5AUNS.js";
|
|
38
38
|
import {
|
|
39
39
|
commandUsage
|
|
40
|
-
} from "./chunk-
|
|
41
|
-
import "./chunk-
|
|
40
|
+
} from "./chunk-LHIDMYN2.js";
|
|
41
|
+
import "./chunk-INEKXXUQ.js";
|
|
42
42
|
import "./chunk-4KCU2KZL.js";
|
|
43
43
|
import "./chunk-JIQBZ2UT.js";
|
|
44
44
|
import {
|
|
45
45
|
Spec
|
|
46
46
|
} from "./chunk-64VFL4WI.js";
|
|
47
|
-
import "./chunk-
|
|
47
|
+
import "./chunk-XU5WNX4S.js";
|
|
48
48
|
import "./chunk-HTOTG4TS.js";
|
|
49
49
|
import "./chunk-APMYKJI2.js";
|
|
50
50
|
import "./chunk-PBBULTAG.js";
|
|
51
|
-
import "./chunk-
|
|
51
|
+
import "./chunk-WXRS5PRL.js";
|
|
52
52
|
import "./chunk-U7TEQCBN.js";
|
|
53
53
|
import "./chunk-XNLSTHDK.js";
|
|
54
54
|
import "./chunk-PDWPFR5T.js";
|
|
@@ -11,24 +11,24 @@ import {createRequire as _vlt_createRequire} from "node:module";
|
|
|
11
11
|
var require = _vlt_createRequire(import.meta.filename);
|
|
12
12
|
import {
|
|
13
13
|
persistedEntries
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-CYN4ADWK.js";
|
|
15
15
|
import {
|
|
16
16
|
require_emoji_regex
|
|
17
17
|
} from "./chunk-VTEFO2FT.js";
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-B5AKQ5TS.js";
|
|
19
|
+
import "./chunk-TL5SYXSC.js";
|
|
20
|
+
import "./chunk-SRWDPPLX.js";
|
|
21
21
|
import {
|
|
22
22
|
source_default
|
|
23
23
|
} from "./chunk-WGDTG44V.js";
|
|
24
24
|
import "./chunk-J4NHRZX6.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-INEKXXUQ.js";
|
|
26
26
|
import {
|
|
27
27
|
ViewClass
|
|
28
28
|
} from "./chunk-4KCU2KZL.js";
|
|
29
29
|
import "./chunk-JIQBZ2UT.js";
|
|
30
30
|
import "./chunk-64VFL4WI.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-XU5WNX4S.js";
|
|
32
32
|
import "./chunk-HTOTG4TS.js";
|
|
33
33
|
import "./chunk-PBBULTAG.js";
|
|
34
34
|
import {
|
|
@@ -12,11 +12,11 @@ var require = _vlt_createRequire(import.meta.filename);
|
|
|
12
12
|
import {
|
|
13
13
|
ExecCommand,
|
|
14
14
|
views
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-QEWKCTQY.js";
|
|
16
16
|
import "./chunk-RIYFGX27.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-BFR3XHEM.js";
|
|
18
|
+
import "./chunk-TOKUDCSW.js";
|
|
19
|
+
import "./chunk-BCANUHR3.js";
|
|
20
20
|
import "./chunk-G2YT2GWF.js";
|
|
21
21
|
import "./chunk-CRGWLUGC.js";
|
|
22
22
|
import "./chunk-VTEFO2FT.js";
|
|
@@ -25,18 +25,18 @@ import "./chunk-J4NHRZX6.js";
|
|
|
25
25
|
import {
|
|
26
26
|
run,
|
|
27
27
|
runFG
|
|
28
|
-
} from "./chunk-
|
|
29
|
-
import "./chunk-
|
|
28
|
+
} from "./chunk-QGFDMXDH.js";
|
|
29
|
+
import "./chunk-MVD5AUNS.js";
|
|
30
30
|
import {
|
|
31
31
|
commandUsage
|
|
32
|
-
} from "./chunk-
|
|
33
|
-
import "./chunk-
|
|
32
|
+
} from "./chunk-LHIDMYN2.js";
|
|
33
|
+
import "./chunk-INEKXXUQ.js";
|
|
34
34
|
import "./chunk-4KCU2KZL.js";
|
|
35
35
|
import "./chunk-JIQBZ2UT.js";
|
|
36
36
|
import "./chunk-64VFL4WI.js";
|
|
37
|
-
import "./chunk-
|
|
37
|
+
import "./chunk-XU5WNX4S.js";
|
|
38
38
|
import "./chunk-HTOTG4TS.js";
|
|
39
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-WXRS5PRL.js";
|
|
40
40
|
import "./chunk-U7TEQCBN.js";
|
|
41
41
|
import "./chunk-XNLSTHDK.js";
|
|
42
42
|
import "./chunk-PDWPFR5T.js";
|
|
@@ -12,11 +12,11 @@ var require = _vlt_createRequire(import.meta.filename);
|
|
|
12
12
|
import {
|
|
13
13
|
ExecCommand,
|
|
14
14
|
views
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-QEWKCTQY.js";
|
|
16
16
|
import "./chunk-RIYFGX27.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-BFR3XHEM.js";
|
|
18
|
+
import "./chunk-TOKUDCSW.js";
|
|
19
|
+
import "./chunk-BCANUHR3.js";
|
|
20
20
|
import "./chunk-G2YT2GWF.js";
|
|
21
21
|
import "./chunk-CRGWLUGC.js";
|
|
22
22
|
import "./chunk-VTEFO2FT.js";
|
|
@@ -25,18 +25,18 @@ import "./chunk-J4NHRZX6.js";
|
|
|
25
25
|
import {
|
|
26
26
|
runExec,
|
|
27
27
|
runExecFG
|
|
28
|
-
} from "./chunk-
|
|
29
|
-
import "./chunk-
|
|
28
|
+
} from "./chunk-QGFDMXDH.js";
|
|
29
|
+
import "./chunk-MVD5AUNS.js";
|
|
30
30
|
import {
|
|
31
31
|
commandUsage
|
|
32
|
-
} from "./chunk-
|
|
33
|
-
import "./chunk-
|
|
32
|
+
} from "./chunk-LHIDMYN2.js";
|
|
33
|
+
import "./chunk-INEKXXUQ.js";
|
|
34
34
|
import "./chunk-4KCU2KZL.js";
|
|
35
35
|
import "./chunk-JIQBZ2UT.js";
|
|
36
36
|
import "./chunk-64VFL4WI.js";
|
|
37
|
-
import "./chunk-
|
|
37
|
+
import "./chunk-XU5WNX4S.js";
|
|
38
38
|
import "./chunk-HTOTG4TS.js";
|
|
39
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-WXRS5PRL.js";
|
|
40
40
|
import "./chunk-U7TEQCBN.js";
|
|
41
41
|
import "./chunk-XNLSTHDK.js";
|
|
42
42
|
import "./chunk-PDWPFR5T.js";
|
|
@@ -2146,7 +2146,7 @@ var baseDepID = (id) => {
|
|
|
2146
2146
|
var package_default = {
|
|
2147
2147
|
name: "@vltpkg/user-agent",
|
|
2148
2148
|
description: "The User-Agent string that vlt sends with every outbound request",
|
|
2149
|
-
version: "1.3.
|
|
2149
|
+
version: "1.3.4",
|
|
2150
2150
|
repository: {
|
|
2151
2151
|
type: "git",
|
|
2152
2152
|
url: "git+https://github.com/vltpkg/vltpkg.git",
|
|
@@ -11,37 +11,37 @@ import {createRequire as _vlt_createRequire} from "node:module";
|
|
|
11
11
|
var require = _vlt_createRequire(import.meta.filename);
|
|
12
12
|
import {
|
|
13
13
|
stdout
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-TOKUDCSW.js";
|
|
15
|
+
import "./chunk-BCANUHR3.js";
|
|
16
16
|
import "./chunk-G2YT2GWF.js";
|
|
17
17
|
import "./chunk-CRGWLUGC.js";
|
|
18
18
|
import {
|
|
19
19
|
configWriteTarget,
|
|
20
20
|
registrySelectionFields
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
21
|
+
} from "./chunk-B5AKQ5TS.js";
|
|
22
|
+
import "./chunk-TL5SYXSC.js";
|
|
23
|
+
import "./chunk-SRWDPPLX.js";
|
|
24
24
|
import "./chunk-WGDTG44V.js";
|
|
25
25
|
import {
|
|
26
26
|
normalizeRegistryURL
|
|
27
27
|
} from "./chunk-J4NHRZX6.js";
|
|
28
28
|
import {
|
|
29
29
|
commandUsage
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import "./chunk-
|
|
30
|
+
} from "./chunk-LHIDMYN2.js";
|
|
31
|
+
import "./chunk-INEKXXUQ.js";
|
|
32
32
|
import "./chunk-4KCU2KZL.js";
|
|
33
33
|
import "./chunk-JIQBZ2UT.js";
|
|
34
34
|
import "./chunk-64VFL4WI.js";
|
|
35
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-XU5WNX4S.js";
|
|
36
36
|
import "./chunk-HTOTG4TS.js";
|
|
37
37
|
import {
|
|
38
38
|
RegistryClient,
|
|
39
39
|
getKC,
|
|
40
40
|
normalizeRegistryKey
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-GCLZEI3R.js";
|
|
42
42
|
import "./chunk-APMYKJI2.js";
|
|
43
43
|
import "./chunk-PBBULTAG.js";
|
|
44
|
-
import "./chunk-
|
|
44
|
+
import "./chunk-WXRS5PRL.js";
|
|
45
45
|
import "./chunk-U7TEQCBN.js";
|
|
46
46
|
import "./chunk-XNLSTHDK.js";
|
|
47
47
|
import "./chunk-PDWPFR5T.js";
|