wrangler 4.29.1 → 4.30.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/config-schema.json +5 -0
- package/package.json +6 -6
- package/wrangler-dist/cli.d.ts +6 -0
- package/wrangler-dist/cli.js +531 -374
- package/wrangler-dist/metafile-cjs.json +1 -1
package/wrangler-dist/cli.js
CHANGED
@@ -2723,7 +2723,7 @@ var require_util = __commonJS({
|
|
2723
2723
|
"../../node_modules/.pnpm/undici@7.11.0/node_modules/undici/lib/core/util.js"(exports2, module3) {
|
2724
2724
|
"use strict";
|
2725
2725
|
init_import_meta_url();
|
2726
|
-
var
|
2726
|
+
var assert44 = require("assert");
|
2727
2727
|
var { kDestroyed, kBodyUsed, kListeners, kBody } = require_symbols();
|
2728
2728
|
var { IncomingMessage } = require("http");
|
2729
2729
|
var stream2 = require("stream");
|
@@ -2745,7 +2745,7 @@ var require_util = __commonJS({
|
|
2745
2745
|
this[kBodyUsed] = false;
|
2746
2746
|
}
|
2747
2747
|
async *[Symbol.asyncIterator]() {
|
2748
|
-
|
2748
|
+
assert44(!this[kBodyUsed], "disturbed");
|
2749
2749
|
this[kBodyUsed] = true;
|
2750
2750
|
yield* this[kBody];
|
2751
2751
|
}
|
@@ -2757,7 +2757,7 @@ var require_util = __commonJS({
|
|
2757
2757
|
if (isStream2(body)) {
|
2758
2758
|
if (bodyLength(body) === 0) {
|
2759
2759
|
body.on("data", function() {
|
2760
|
-
|
2760
|
+
assert44(false);
|
2761
2761
|
});
|
2762
2762
|
}
|
2763
2763
|
if (typeof body.readableDidRead !== "boolean") {
|
@@ -2871,7 +2871,7 @@ var require_util = __commonJS({
|
|
2871
2871
|
function getHostname(host) {
|
2872
2872
|
if (host[0] === "[") {
|
2873
2873
|
const idx2 = host.indexOf("]");
|
2874
|
-
|
2874
|
+
assert44(idx2 !== -1);
|
2875
2875
|
return host.substring(1, idx2);
|
2876
2876
|
}
|
2877
2877
|
const idx = host.indexOf(":");
|
@@ -2883,7 +2883,7 @@ var require_util = __commonJS({
|
|
2883
2883
|
if (!host) {
|
2884
2884
|
return null;
|
2885
2885
|
}
|
2886
|
-
|
2886
|
+
assert44(typeof host === "string");
|
2887
2887
|
const servername = getHostname(host);
|
2888
2888
|
if (net2.isIP(servername)) {
|
2889
2889
|
return "";
|
@@ -3190,7 +3190,7 @@ var require_util = __commonJS({
|
|
3190
3190
|
function errorRequest(client, request4, err) {
|
3191
3191
|
try {
|
3192
3192
|
request4.onError(err);
|
3193
|
-
|
3193
|
+
assert44(request4.aborted);
|
3194
3194
|
} catch (err2) {
|
3195
3195
|
client.emit("error", err2);
|
3196
3196
|
}
|
@@ -3566,7 +3566,7 @@ var require_request = __commonJS({
|
|
3566
3566
|
InvalidArgumentError,
|
3567
3567
|
NotSupportedError
|
3568
3568
|
} = require_errors();
|
3569
|
-
var
|
3569
|
+
var assert44 = require("assert");
|
3570
3570
|
var {
|
3571
3571
|
isValidHTTPToken,
|
3572
3572
|
isValidHeaderValue,
|
@@ -3740,8 +3740,8 @@ var require_request = __commonJS({
|
|
3740
3740
|
}
|
3741
3741
|
}
|
3742
3742
|
onConnect(abort) {
|
3743
|
-
|
3744
|
-
|
3743
|
+
assert44(!this.aborted);
|
3744
|
+
assert44(!this.completed);
|
3745
3745
|
if (this.error) {
|
3746
3746
|
abort(this.error);
|
3747
3747
|
} else {
|
@@ -3753,8 +3753,8 @@ var require_request = __commonJS({
|
|
3753
3753
|
return this[kHandler].onResponseStarted?.();
|
3754
3754
|
}
|
3755
3755
|
onHeaders(statusCode, headers, resume, statusText) {
|
3756
|
-
|
3757
|
-
|
3756
|
+
assert44(!this.aborted);
|
3757
|
+
assert44(!this.completed);
|
3758
3758
|
if (channels.headers.hasSubscribers) {
|
3759
3759
|
channels.headers.publish({ request: this, response: { statusCode, headers, statusText } });
|
3760
3760
|
}
|
@@ -3765,8 +3765,8 @@ var require_request = __commonJS({
|
|
3765
3765
|
}
|
3766
3766
|
}
|
3767
3767
|
onData(chunk) {
|
3768
|
-
|
3769
|
-
|
3768
|
+
assert44(!this.aborted);
|
3769
|
+
assert44(!this.completed);
|
3770
3770
|
if (channels.bodyChunkReceived.hasSubscribers) {
|
3771
3771
|
channels.bodyChunkReceived.publish({ request: this, chunk });
|
3772
3772
|
}
|
@@ -3778,14 +3778,14 @@ var require_request = __commonJS({
|
|
3778
3778
|
}
|
3779
3779
|
}
|
3780
3780
|
onUpgrade(statusCode, headers, socket) {
|
3781
|
-
|
3782
|
-
|
3781
|
+
assert44(!this.aborted);
|
3782
|
+
assert44(!this.completed);
|
3783
3783
|
return this[kHandler].onUpgrade(statusCode, headers, socket);
|
3784
3784
|
}
|
3785
3785
|
onComplete(trailers) {
|
3786
3786
|
this.onFinally();
|
3787
|
-
|
3788
|
-
|
3787
|
+
assert44(!this.aborted);
|
3788
|
+
assert44(!this.completed);
|
3789
3789
|
this.completed = true;
|
3790
3790
|
if (channels.trailers.hasSubscribers) {
|
3791
3791
|
channels.trailers.publish({ request: this, trailers });
|
@@ -4255,7 +4255,7 @@ var require_connect = __commonJS({
|
|
4255
4255
|
"use strict";
|
4256
4256
|
init_import_meta_url();
|
4257
4257
|
var net2 = require("net");
|
4258
|
-
var
|
4258
|
+
var assert44 = require("assert");
|
4259
4259
|
var util5 = require_util();
|
4260
4260
|
var { InvalidArgumentError } = require_errors();
|
4261
4261
|
var tls;
|
@@ -4304,7 +4304,7 @@ var require_connect = __commonJS({
|
|
4304
4304
|
}
|
4305
4305
|
servername = servername || options.servername || util5.getServerName(host) || null;
|
4306
4306
|
const sessionKey = servername || hostname2;
|
4307
|
-
|
4307
|
+
assert44(sessionKey);
|
4308
4308
|
const session = customSession || sessionCache.get(sessionKey) || null;
|
4309
4309
|
port = port || 443;
|
4310
4310
|
socket = tls.connect({
|
@@ -4324,7 +4324,7 @@ var require_connect = __commonJS({
|
|
4324
4324
|
sessionCache.set(sessionKey, session2);
|
4325
4325
|
});
|
4326
4326
|
} else {
|
4327
|
-
|
4327
|
+
assert44(!httpSocket, "httpSocket can only be sent on TLS update");
|
4328
4328
|
port = port || 80;
|
4329
4329
|
socket = net2.connect({
|
4330
4330
|
highWaterMark: 64 * 1024,
|
@@ -5274,14 +5274,14 @@ var require_data_url = __commonJS({
|
|
5274
5274
|
"../../node_modules/.pnpm/undici@7.11.0/node_modules/undici/lib/web/fetch/data-url.js"(exports2, module3) {
|
5275
5275
|
"use strict";
|
5276
5276
|
init_import_meta_url();
|
5277
|
-
var
|
5277
|
+
var assert44 = require("assert");
|
5278
5278
|
var encoder = new TextEncoder();
|
5279
5279
|
var HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/;
|
5280
5280
|
var HTTP_WHITESPACE_REGEX = /[\u000A\u000D\u0009\u0020]/;
|
5281
5281
|
var ASCII_WHITESPACE_REPLACE_REGEX = /[\u0009\u000A\u000C\u000D\u0020]/g;
|
5282
5282
|
var HTTP_QUOTED_STRING_TOKENS = /^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;
|
5283
5283
|
function dataURLProcessor(dataURL) {
|
5284
|
-
|
5284
|
+
assert44(dataURL.protocol === "data:");
|
5285
5285
|
let input = URLSerializer(dataURL, true);
|
5286
5286
|
input = input.slice(5);
|
5287
5287
|
const position = { position: 0 };
|
@@ -5492,7 +5492,7 @@ var require_data_url = __commonJS({
|
|
5492
5492
|
function collectAnHTTPQuotedString(input, position, extractValue = false) {
|
5493
5493
|
const positionStart = position.position;
|
5494
5494
|
let value = "";
|
5495
|
-
|
5495
|
+
assert44(input[position.position] === '"');
|
5496
5496
|
position.position++;
|
5497
5497
|
while (true) {
|
5498
5498
|
value += collectASequenceOfCodePoints(
|
@@ -5513,7 +5513,7 @@ var require_data_url = __commonJS({
|
|
5513
5513
|
value += input[position.position];
|
5514
5514
|
position.position++;
|
5515
5515
|
} else {
|
5516
|
-
|
5516
|
+
assert44(quoteOrBackslash === '"');
|
5517
5517
|
break;
|
5518
5518
|
}
|
5519
5519
|
}
|
@@ -5524,7 +5524,7 @@ var require_data_url = __commonJS({
|
|
5524
5524
|
}
|
5525
5525
|
__name(collectAnHTTPQuotedString, "collectAnHTTPQuotedString");
|
5526
5526
|
function serializeAMimeType(mimeType) {
|
5527
|
-
|
5527
|
+
assert44(mimeType !== "failure");
|
5528
5528
|
const { parameters, essence } = mimeType;
|
5529
5529
|
let serialization = essence;
|
5530
5530
|
for (let [name2, value] of parameters.entries()) {
|
@@ -6128,7 +6128,7 @@ var require_util2 = __commonJS({
|
|
6128
6128
|
var { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require_data_url();
|
6129
6129
|
var { performance: performance2 } = require("perf_hooks");
|
6130
6130
|
var { ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require_util();
|
6131
|
-
var
|
6131
|
+
var assert44 = require("assert");
|
6132
6132
|
var { isUint8Array } = require("util/types");
|
6133
6133
|
var { webidl } = require_webidl();
|
6134
6134
|
var supportedHashes = [];
|
@@ -6339,7 +6339,7 @@ var require_util2 = __commonJS({
|
|
6339
6339
|
__name(clonePolicyContainer, "clonePolicyContainer");
|
6340
6340
|
function determineRequestsReferrer(request4) {
|
6341
6341
|
const policy = request4.referrerPolicy;
|
6342
|
-
|
6342
|
+
assert44(policy);
|
6343
6343
|
let referrerSource = null;
|
6344
6344
|
if (request4.referrer === "client") {
|
6345
6345
|
const globalOrigin = getGlobalOrigin();
|
@@ -6403,7 +6403,7 @@ var require_util2 = __commonJS({
|
|
6403
6403
|
}
|
6404
6404
|
__name(determineRequestsReferrer, "determineRequestsReferrer");
|
6405
6405
|
function stripURLForReferrer(url4, originOnly = false) {
|
6406
|
-
|
6406
|
+
assert44(webidl.is.URL(url4));
|
6407
6407
|
url4 = new URL(url4);
|
6408
6408
|
if (urlIsLocal(url4)) {
|
6409
6409
|
return "no-referrer";
|
@@ -6605,7 +6605,7 @@ var require_util2 = __commonJS({
|
|
6605
6605
|
if (result === void 0) {
|
6606
6606
|
throw new TypeError("Value is not JSON serializable");
|
6607
6607
|
}
|
6608
|
-
|
6608
|
+
assert44(typeof result === "string");
|
6609
6609
|
return result;
|
6610
6610
|
}
|
6611
6611
|
__name(serializeJavascriptValueToJSONString, "serializeJavascriptValueToJSONString");
|
@@ -6767,7 +6767,7 @@ var require_util2 = __commonJS({
|
|
6767
6767
|
__name(readableStreamClose, "readableStreamClose");
|
6768
6768
|
var invalidIsomorphicEncodeValueRegex = /[^\x00-\xFF]/;
|
6769
6769
|
function isomorphicEncode(input) {
|
6770
|
-
|
6770
|
+
assert44(!invalidIsomorphicEncodeValueRegex.test(input));
|
6771
6771
|
return input;
|
6772
6772
|
}
|
6773
6773
|
__name(isomorphicEncode, "isomorphicEncode");
|
@@ -6794,7 +6794,7 @@ var require_util2 = __commonJS({
|
|
6794
6794
|
}
|
6795
6795
|
__name(readAllBytes, "readAllBytes");
|
6796
6796
|
function urlIsLocal(url4) {
|
6797
|
-
|
6797
|
+
assert44("protocol" in url4);
|
6798
6798
|
const protocol = url4.protocol;
|
6799
6799
|
return protocol === "about:" || protocol === "blob:" || protocol === "data:";
|
6800
6800
|
}
|
@@ -6804,7 +6804,7 @@ var require_util2 = __commonJS({
|
|
6804
6804
|
}
|
6805
6805
|
__name(urlHasHttpsScheme, "urlHasHttpsScheme");
|
6806
6806
|
function urlIsHttpHttpsScheme(url4) {
|
6807
|
-
|
6807
|
+
assert44("protocol" in url4);
|
6808
6808
|
const protocol = url4.protocol;
|
6809
6809
|
return protocol === "http:" || protocol === "https:";
|
6810
6810
|
}
|
@@ -6977,7 +6977,7 @@ var require_util2 = __commonJS({
|
|
6977
6977
|
continue;
|
6978
6978
|
}
|
6979
6979
|
} else {
|
6980
|
-
|
6980
|
+
assert44(input.charCodeAt(position.position) === 44);
|
6981
6981
|
position.position++;
|
6982
6982
|
}
|
6983
6983
|
}
|
@@ -7261,7 +7261,7 @@ var require_formdata_parser = __commonJS({
|
|
7261
7261
|
var { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = require_data_url();
|
7262
7262
|
var { makeEntry } = require_formdata();
|
7263
7263
|
var { webidl } = require_webidl();
|
7264
|
-
var
|
7264
|
+
var assert44 = require("assert");
|
7265
7265
|
var { File: NodeFile } = require("buffer");
|
7266
7266
|
var File2 = globalThis.File ?? NodeFile;
|
7267
7267
|
var formDataNameBuffer = Buffer.from('form-data; name="');
|
@@ -7292,7 +7292,7 @@ var require_formdata_parser = __commonJS({
|
|
7292
7292
|
}
|
7293
7293
|
__name(validateBoundary, "validateBoundary");
|
7294
7294
|
function multipartFormDataParser(input, mimeType) {
|
7295
|
-
|
7295
|
+
assert44(mimeType !== "failure" && mimeType.essence === "multipart/form-data");
|
7296
7296
|
const boundaryString = mimeType.parameters.get("boundary");
|
7297
7297
|
if (boundaryString === void 0) {
|
7298
7298
|
throw parsingError("missing boundary in content-type header");
|
@@ -7353,8 +7353,8 @@ var require_formdata_parser = __commonJS({
|
|
7353
7353
|
} else {
|
7354
7354
|
value = utf8DecodeBytes(Buffer.from(body));
|
7355
7355
|
}
|
7356
|
-
|
7357
|
-
|
7356
|
+
assert44(webidl.is.USVString(name2));
|
7357
|
+
assert44(typeof value === "string" && webidl.is.USVString(value) || webidl.is.File(value));
|
7358
7358
|
entryList.push(makeEntry(name2, value, filename));
|
7359
7359
|
}
|
7360
7360
|
}
|
@@ -7473,7 +7473,7 @@ var require_formdata_parser = __commonJS({
|
|
7473
7473
|
}
|
7474
7474
|
__name(parseMultipartFormDataHeaders, "parseMultipartFormDataHeaders");
|
7475
7475
|
function parseMultipartFormDataName(input, position) {
|
7476
|
-
|
7476
|
+
assert44(input[position.position - 1] === 34);
|
7477
7477
|
let name2 = collectASequenceOfBytes(
|
7478
7478
|
(char) => char !== 10 && char !== 13 && char !== 34,
|
7479
7479
|
input,
|
@@ -7548,7 +7548,7 @@ var require_body = __commonJS({
|
|
7548
7548
|
var { FormData: FormData11, setFormDataState } = require_formdata();
|
7549
7549
|
var { webidl } = require_webidl();
|
7550
7550
|
var { Blob: Blob6 } = require("buffer");
|
7551
|
-
var
|
7551
|
+
var assert44 = require("assert");
|
7552
7552
|
var { isErrored, isDisturbed } = require("stream");
|
7553
7553
|
var { isArrayBuffer: isArrayBuffer3 } = require("util/types");
|
7554
7554
|
var { serializeAMimeType } = require_data_url();
|
@@ -7594,7 +7594,7 @@ var require_body = __commonJS({
|
|
7594
7594
|
type: "bytes"
|
7595
7595
|
});
|
7596
7596
|
}
|
7597
|
-
|
7597
|
+
assert44(webidl.is.ReadableStream(stream2));
|
7598
7598
|
let action = null;
|
7599
7599
|
let source = null;
|
7600
7600
|
let length = null;
|
@@ -7713,8 +7713,8 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
7713
7713
|
__name(extractBody, "extractBody");
|
7714
7714
|
function safelyExtractBody(object, keepalive = false) {
|
7715
7715
|
if (webidl.is.ReadableStream(object)) {
|
7716
|
-
|
7717
|
-
|
7716
|
+
assert44(!util5.isDisturbed(object), "The body has already been consumed.");
|
7717
|
+
assert44(!object.locked, "The stream is locked.");
|
7718
7718
|
}
|
7719
7719
|
return extractBody(object, keepalive);
|
7720
7720
|
}
|
@@ -7860,7 +7860,7 @@ var require_client_h1 = __commonJS({
|
|
7860
7860
|
"../../node_modules/.pnpm/undici@7.11.0/node_modules/undici/lib/dispatcher/client-h1.js"(exports2, module3) {
|
7861
7861
|
"use strict";
|
7862
7862
|
init_import_meta_url();
|
7863
|
-
var
|
7863
|
+
var assert44 = require("assert");
|
7864
7864
|
var util5 = require_util();
|
7865
7865
|
var { channels } = require_diagnostics();
|
7866
7866
|
var timers = require_timers();
|
@@ -7941,7 +7941,7 @@ var require_client_h1 = __commonJS({
|
|
7941
7941
|
* @returns {number}
|
7942
7942
|
*/
|
7943
7943
|
wasm_on_status: /* @__PURE__ */ __name((p6, at2, len) => {
|
7944
|
-
|
7944
|
+
assert44(currentParser.ptr === p6);
|
7945
7945
|
const start = at2 - currentBufferPtr + currentBufferRef.byteOffset;
|
7946
7946
|
return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len));
|
7947
7947
|
}, "wasm_on_status"),
|
@@ -7950,7 +7950,7 @@ var require_client_h1 = __commonJS({
|
|
7950
7950
|
* @returns {number}
|
7951
7951
|
*/
|
7952
7952
|
wasm_on_message_begin: /* @__PURE__ */ __name((p6) => {
|
7953
|
-
|
7953
|
+
assert44(currentParser.ptr === p6);
|
7954
7954
|
return currentParser.onMessageBegin();
|
7955
7955
|
}, "wasm_on_message_begin"),
|
7956
7956
|
/**
|
@@ -7960,7 +7960,7 @@ var require_client_h1 = __commonJS({
|
|
7960
7960
|
* @returns {number}
|
7961
7961
|
*/
|
7962
7962
|
wasm_on_header_field: /* @__PURE__ */ __name((p6, at2, len) => {
|
7963
|
-
|
7963
|
+
assert44(currentParser.ptr === p6);
|
7964
7964
|
const start = at2 - currentBufferPtr + currentBufferRef.byteOffset;
|
7965
7965
|
return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len));
|
7966
7966
|
}, "wasm_on_header_field"),
|
@@ -7971,7 +7971,7 @@ var require_client_h1 = __commonJS({
|
|
7971
7971
|
* @returns {number}
|
7972
7972
|
*/
|
7973
7973
|
wasm_on_header_value: /* @__PURE__ */ __name((p6, at2, len) => {
|
7974
|
-
|
7974
|
+
assert44(currentParser.ptr === p6);
|
7975
7975
|
const start = at2 - currentBufferPtr + currentBufferRef.byteOffset;
|
7976
7976
|
return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len));
|
7977
7977
|
}, "wasm_on_header_value"),
|
@@ -7983,7 +7983,7 @@ var require_client_h1 = __commonJS({
|
|
7983
7983
|
* @returns {number}
|
7984
7984
|
*/
|
7985
7985
|
wasm_on_headers_complete: /* @__PURE__ */ __name((p6, statusCode, upgrade, shouldKeepAlive) => {
|
7986
|
-
|
7986
|
+
assert44(currentParser.ptr === p6);
|
7987
7987
|
return currentParser.onHeadersComplete(statusCode, upgrade === 1, shouldKeepAlive === 1);
|
7988
7988
|
}, "wasm_on_headers_complete"),
|
7989
7989
|
/**
|
@@ -7993,7 +7993,7 @@ var require_client_h1 = __commonJS({
|
|
7993
7993
|
* @returns {number}
|
7994
7994
|
*/
|
7995
7995
|
wasm_on_body: /* @__PURE__ */ __name((p6, at2, len) => {
|
7996
|
-
|
7996
|
+
assert44(currentParser.ptr === p6);
|
7997
7997
|
const start = at2 - currentBufferPtr + currentBufferRef.byteOffset;
|
7998
7998
|
return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len));
|
7999
7999
|
}, "wasm_on_body"),
|
@@ -8002,7 +8002,7 @@ var require_client_h1 = __commonJS({
|
|
8002
8002
|
* @returns {number}
|
8003
8003
|
*/
|
8004
8004
|
wasm_on_message_complete: /* @__PURE__ */ __name((p6) => {
|
8005
|
-
|
8005
|
+
assert44(currentParser.ptr === p6);
|
8006
8006
|
return currentParser.onMessageComplete();
|
8007
8007
|
}, "wasm_on_message_complete")
|
8008
8008
|
}
|
@@ -8079,10 +8079,10 @@ var require_client_h1 = __commonJS({
|
|
8079
8079
|
if (this.socket.destroyed || !this.paused) {
|
8080
8080
|
return;
|
8081
8081
|
}
|
8082
|
-
|
8083
|
-
|
8082
|
+
assert44(this.ptr != null);
|
8083
|
+
assert44(currentParser === null);
|
8084
8084
|
this.llhttp.llhttp_resume(this.ptr);
|
8085
|
-
|
8085
|
+
assert44(this.timeoutType === TIMEOUT_BODY);
|
8086
8086
|
if (this.timeout) {
|
8087
8087
|
if (this.timeout.refresh) {
|
8088
8088
|
this.timeout.refresh();
|
@@ -8105,9 +8105,9 @@ var require_client_h1 = __commonJS({
|
|
8105
8105
|
* @param {Buffer} chunk
|
8106
8106
|
*/
|
8107
8107
|
execute(chunk) {
|
8108
|
-
|
8109
|
-
|
8110
|
-
|
8108
|
+
assert44(currentParser === null);
|
8109
|
+
assert44(this.ptr != null);
|
8110
|
+
assert44(!this.paused);
|
8111
8111
|
const { socket, llhttp } = this;
|
8112
8112
|
if (chunk.length > currentBufferSize) {
|
8113
8113
|
if (currentBufferPtr) {
|
@@ -8151,8 +8151,8 @@ var require_client_h1 = __commonJS({
|
|
8151
8151
|
}
|
8152
8152
|
}
|
8153
8153
|
destroy() {
|
8154
|
-
|
8155
|
-
|
8154
|
+
assert44(currentParser === null);
|
8155
|
+
assert44(this.ptr != null);
|
8156
8156
|
this.llhttp.llhttp_free(this.ptr);
|
8157
8157
|
this.ptr = null;
|
8158
8158
|
this.timeout && timers.clearTimeout(this.timeout);
|
@@ -8238,14 +8238,14 @@ var require_client_h1 = __commonJS({
|
|
8238
8238
|
*/
|
8239
8239
|
onUpgrade(head) {
|
8240
8240
|
const { upgrade, client, socket, headers, statusCode } = this;
|
8241
|
-
|
8242
|
-
|
8243
|
-
|
8244
|
-
|
8245
|
-
|
8241
|
+
assert44(upgrade);
|
8242
|
+
assert44(client[kSocket] === socket);
|
8243
|
+
assert44(!socket.destroyed);
|
8244
|
+
assert44(!this.paused);
|
8245
|
+
assert44((headers.length & 1) === 0);
|
8246
8246
|
const request4 = client[kQueue][client[kRunningIdx]];
|
8247
|
-
|
8248
|
-
|
8247
|
+
assert44(request4);
|
8248
|
+
assert44(request4.upgrade || request4.method === "CONNECT");
|
8249
8249
|
this.statusCode = 0;
|
8250
8250
|
this.statusText = "";
|
8251
8251
|
this.shouldKeepAlive = false;
|
@@ -8283,8 +8283,8 @@ var require_client_h1 = __commonJS({
|
|
8283
8283
|
if (!request4) {
|
8284
8284
|
return -1;
|
8285
8285
|
}
|
8286
|
-
|
8287
|
-
|
8286
|
+
assert44(!this.upgrade);
|
8287
|
+
assert44(this.statusCode < 200);
|
8288
8288
|
if (statusCode === 100) {
|
8289
8289
|
util5.destroy(socket, new SocketError("bad response", util5.getSocketInfo(socket)));
|
8290
8290
|
return -1;
|
@@ -8293,7 +8293,7 @@ var require_client_h1 = __commonJS({
|
|
8293
8293
|
util5.destroy(socket, new SocketError("bad upgrade", util5.getSocketInfo(socket)));
|
8294
8294
|
return -1;
|
8295
8295
|
}
|
8296
|
-
|
8296
|
+
assert44(this.timeoutType === TIMEOUT_HEADERS);
|
8297
8297
|
this.statusCode = statusCode;
|
8298
8298
|
this.shouldKeepAlive = shouldKeepAlive || // Override llhttp value which does not allow keepAlive for HEAD.
|
8299
8299
|
request4.method === "HEAD" && !socket[kReset2] && this.connection.toLowerCase() === "keep-alive";
|
@@ -8306,16 +8306,16 @@ var require_client_h1 = __commonJS({
|
|
8306
8306
|
}
|
8307
8307
|
}
|
8308
8308
|
if (request4.method === "CONNECT") {
|
8309
|
-
|
8309
|
+
assert44(client[kRunning] === 1);
|
8310
8310
|
this.upgrade = true;
|
8311
8311
|
return 2;
|
8312
8312
|
}
|
8313
8313
|
if (upgrade) {
|
8314
|
-
|
8314
|
+
assert44(client[kRunning] === 1);
|
8315
8315
|
this.upgrade = true;
|
8316
8316
|
return 2;
|
8317
8317
|
}
|
8318
|
-
|
8318
|
+
assert44((this.headers.length & 1) === 0);
|
8319
8319
|
this.headers = [];
|
8320
8320
|
this.headersSize = 0;
|
8321
8321
|
if (this.shouldKeepAlive && client[kPipelining]) {
|
@@ -8362,14 +8362,14 @@ var require_client_h1 = __commonJS({
|
|
8362
8362
|
return -1;
|
8363
8363
|
}
|
8364
8364
|
const request4 = client[kQueue][client[kRunningIdx]];
|
8365
|
-
|
8366
|
-
|
8365
|
+
assert44(request4);
|
8366
|
+
assert44(this.timeoutType === TIMEOUT_BODY);
|
8367
8367
|
if (this.timeout) {
|
8368
8368
|
if (this.timeout.refresh) {
|
8369
8369
|
this.timeout.refresh();
|
8370
8370
|
}
|
8371
8371
|
}
|
8372
|
-
|
8372
|
+
assert44(statusCode >= 200);
|
8373
8373
|
if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
|
8374
8374
|
util5.destroy(socket, new ResponseExceededMaxSizeError());
|
8375
8375
|
return -1;
|
@@ -8391,10 +8391,10 @@ var require_client_h1 = __commonJS({
|
|
8391
8391
|
if (upgrade) {
|
8392
8392
|
return 0;
|
8393
8393
|
}
|
8394
|
-
|
8395
|
-
|
8394
|
+
assert44(statusCode >= 100);
|
8395
|
+
assert44((this.headers.length & 1) === 0);
|
8396
8396
|
const request4 = client[kQueue][client[kRunningIdx]];
|
8397
|
-
|
8397
|
+
assert44(request4);
|
8398
8398
|
this.statusCode = 0;
|
8399
8399
|
this.statusText = "";
|
8400
8400
|
this.bytesRead = 0;
|
@@ -8413,7 +8413,7 @@ var require_client_h1 = __commonJS({
|
|
8413
8413
|
request4.onComplete(headers);
|
8414
8414
|
client[kQueue][client[kRunningIdx]++] = null;
|
8415
8415
|
if (socket[kWriting]) {
|
8416
|
-
|
8416
|
+
assert44(client[kRunning] === 0);
|
8417
8417
|
util5.destroy(socket, new InformationalError("reset"));
|
8418
8418
|
return constants4.ERROR.PAUSED;
|
8419
8419
|
} else if (!shouldKeepAlive) {
|
@@ -8434,7 +8434,7 @@ var require_client_h1 = __commonJS({
|
|
8434
8434
|
const { socket, timeoutType, client, paused } = parser2.deref();
|
8435
8435
|
if (timeoutType === TIMEOUT_HEADERS) {
|
8436
8436
|
if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
|
8437
|
-
|
8437
|
+
assert44(!paused, "cannot be paused while waiting for headers");
|
8438
8438
|
util5.destroy(socket, new HeadersTimeoutError());
|
8439
8439
|
}
|
8440
8440
|
} else if (timeoutType === TIMEOUT_BODY) {
|
@@ -8442,7 +8442,7 @@ var require_client_h1 = __commonJS({
|
|
8442
8442
|
util5.destroy(socket, new BodyTimeoutError());
|
8443
8443
|
}
|
8444
8444
|
} else if (timeoutType === TIMEOUT_KEEP_ALIVE) {
|
8445
|
-
|
8445
|
+
assert44(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]);
|
8446
8446
|
util5.destroy(socket, new InformationalError("socket idle timeout"));
|
8447
8447
|
}
|
8448
8448
|
}
|
@@ -8526,7 +8526,7 @@ var require_client_h1 = __commonJS({
|
|
8526
8526
|
}
|
8527
8527
|
__name(connectH1, "connectH1");
|
8528
8528
|
function onHttpSocketError(err) {
|
8529
|
-
|
8529
|
+
assert44(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
|
8530
8530
|
const parser2 = this[kParser];
|
8531
8531
|
if (err.code === "ECONNRESET" && parser2.statusCode && !parser2.shouldKeepAlive) {
|
8532
8532
|
parser2.onMessageComplete();
|
@@ -8563,7 +8563,7 @@ var require_client_h1 = __commonJS({
|
|
8563
8563
|
client[kSocket] = null;
|
8564
8564
|
client[kHTTPContext] = null;
|
8565
8565
|
if (client.destroyed) {
|
8566
|
-
|
8566
|
+
assert44(client[kPending] === 0);
|
8567
8567
|
const requests = client[kQueue].splice(client[kRunningIdx]);
|
8568
8568
|
for (let i5 = 0; i5 < requests.length; i5++) {
|
8569
8569
|
const request4 = requests[i5];
|
@@ -8575,7 +8575,7 @@ var require_client_h1 = __commonJS({
|
|
8575
8575
|
util5.errorRequest(client, request4, err);
|
8576
8576
|
}
|
8577
8577
|
client[kPendingIdx] = client[kRunningIdx];
|
8578
|
-
|
8578
|
+
assert44(client[kRunning] === 0);
|
8579
8579
|
client.emit("disconnect", client[kUrl], [client], err);
|
8580
8580
|
client[kResume]();
|
8581
8581
|
}
|
@@ -8731,13 +8731,13 @@ upgrade: ${upgrade}\r
|
|
8731
8731
|
} else if (util5.isIterable(body)) {
|
8732
8732
|
writeIterable(abort, body, client, request4, socket, contentLength, header, expectsPayload);
|
8733
8733
|
} else {
|
8734
|
-
|
8734
|
+
assert44(false);
|
8735
8735
|
}
|
8736
8736
|
return true;
|
8737
8737
|
}
|
8738
8738
|
__name(writeH1, "writeH1");
|
8739
8739
|
function writeStream(abort, body, client, request4, socket, contentLength, header, expectsPayload) {
|
8740
|
-
|
8740
|
+
assert44(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
|
8741
8741
|
let finished = false;
|
8742
8742
|
const writer = new AsyncWriter({ abort, socket, request: request4, contentLength, client, expectsPayload, header });
|
8743
8743
|
const onData = /* @__PURE__ */ __name(function(chunk) {
|
@@ -8774,7 +8774,7 @@ upgrade: ${upgrade}\r
|
|
8774
8774
|
return;
|
8775
8775
|
}
|
8776
8776
|
finished = true;
|
8777
|
-
|
8777
|
+
assert44(socket.destroyed || socket[kWriting] && client[kRunning] <= 1);
|
8778
8778
|
socket.off("drain", onDrain).off("error", onFinished);
|
8779
8779
|
body.removeListener("data", onData).removeListener("end", onFinished).removeListener("close", onClose);
|
8780
8780
|
if (!err) {
|
@@ -8814,12 +8814,12 @@ upgrade: ${upgrade}\r
|
|
8814
8814
|
\r
|
8815
8815
|
`, "latin1");
|
8816
8816
|
} else {
|
8817
|
-
|
8817
|
+
assert44(contentLength === null, "no body must not have content length");
|
8818
8818
|
socket.write(`${header}\r
|
8819
8819
|
`, "latin1");
|
8820
8820
|
}
|
8821
8821
|
} else if (util5.isBuffer(body)) {
|
8822
|
-
|
8822
|
+
assert44(contentLength === body.byteLength, "buffer body must have content length");
|
8823
8823
|
socket.cork();
|
8824
8824
|
socket.write(`${header}content-length: ${contentLength}\r
|
8825
8825
|
\r
|
@@ -8839,7 +8839,7 @@ upgrade: ${upgrade}\r
|
|
8839
8839
|
}
|
8840
8840
|
__name(writeBuffer, "writeBuffer");
|
8841
8841
|
async function writeBlob(abort, body, client, request4, socket, contentLength, header, expectsPayload) {
|
8842
|
-
|
8842
|
+
assert44(contentLength === body.size, "blob body must have content length");
|
8843
8843
|
try {
|
8844
8844
|
if (contentLength != null && contentLength !== body.size) {
|
8845
8845
|
throw new RequestContentLengthMismatchError();
|
@@ -8863,7 +8863,7 @@ upgrade: ${upgrade}\r
|
|
8863
8863
|
}
|
8864
8864
|
__name(writeBlob, "writeBlob");
|
8865
8865
|
async function writeIterable(abort, body, client, request4, socket, contentLength, header, expectsPayload) {
|
8866
|
-
|
8866
|
+
assert44(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
|
8867
8867
|
let callback = null;
|
8868
8868
|
function onDrain() {
|
8869
8869
|
if (callback) {
|
@@ -8874,7 +8874,7 @@ upgrade: ${upgrade}\r
|
|
8874
8874
|
}
|
8875
8875
|
__name(onDrain, "onDrain");
|
8876
8876
|
const waitForDrain = /* @__PURE__ */ __name(() => new Promise((resolve25, reject) => {
|
8877
|
-
|
8877
|
+
assert44(callback === null);
|
8878
8878
|
if (socket[kError]) {
|
8879
8879
|
reject(socket[kError]);
|
8880
8880
|
} else {
|
@@ -9027,7 +9027,7 @@ ${len.toString(16)}\r
|
|
9027
9027
|
const { socket, client, abort } = this;
|
9028
9028
|
socket[kWriting] = false;
|
9029
9029
|
if (err) {
|
9030
|
-
|
9030
|
+
assert44(client[kRunning] <= 1, "pipeline should only contain this request");
|
9031
9031
|
abort(err);
|
9032
9032
|
}
|
9033
9033
|
}
|
@@ -9041,7 +9041,7 @@ var require_client_h2 = __commonJS({
|
|
9041
9041
|
"../../node_modules/.pnpm/undici@7.11.0/node_modules/undici/lib/dispatcher/client-h2.js"(exports2, module3) {
|
9042
9042
|
"use strict";
|
9043
9043
|
init_import_meta_url();
|
9044
|
-
var
|
9044
|
+
var assert44 = require("assert");
|
9045
9045
|
var { pipeline } = require("stream");
|
9046
9046
|
var util5 = require_util();
|
9047
9047
|
var {
|
@@ -9171,7 +9171,7 @@ var require_client_h2 = __commonJS({
|
|
9171
9171
|
}
|
9172
9172
|
__name(resumeH2, "resumeH2");
|
9173
9173
|
function onHttp2SessionError(err) {
|
9174
|
-
|
9174
|
+
assert44(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
|
9175
9175
|
this[kSocket][kError] = err;
|
9176
9176
|
this[kClient][kOnError](err);
|
9177
9177
|
}
|
@@ -9204,7 +9204,7 @@ var require_client_h2 = __commonJS({
|
|
9204
9204
|
util5.errorRequest(client, request4, err);
|
9205
9205
|
client[kPendingIdx] = client[kRunningIdx];
|
9206
9206
|
}
|
9207
|
-
|
9207
|
+
assert44(client[kRunning] === 0);
|
9208
9208
|
client.emit("disconnect", client[kUrl], [client], err);
|
9209
9209
|
client.emit("connectionError", client[kUrl], [client], err);
|
9210
9210
|
client[kResume]();
|
@@ -9217,7 +9217,7 @@ var require_client_h2 = __commonJS({
|
|
9217
9217
|
client[kSocket] = null;
|
9218
9218
|
client[kHTTPContext] = null;
|
9219
9219
|
if (client.destroyed) {
|
9220
|
-
|
9220
|
+
assert44(client[kPending] === 0);
|
9221
9221
|
const requests = client[kQueue].splice(client[kRunningIdx]);
|
9222
9222
|
for (let i5 = 0; i5 < requests.length; i5++) {
|
9223
9223
|
const request4 = requests[i5];
|
@@ -9235,13 +9235,13 @@ var require_client_h2 = __commonJS({
|
|
9235
9235
|
this[kHTTP2Session].destroy(err);
|
9236
9236
|
}
|
9237
9237
|
client[kPendingIdx] = client[kRunningIdx];
|
9238
|
-
|
9238
|
+
assert44(client[kRunning] === 0);
|
9239
9239
|
client.emit("disconnect", client[kUrl], [client], err);
|
9240
9240
|
client[kResume]();
|
9241
9241
|
}
|
9242
9242
|
__name(onHttp2SocketClose, "onHttp2SocketClose");
|
9243
9243
|
function onHttp2SocketError(err) {
|
9244
|
-
|
9244
|
+
assert44(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
|
9245
9245
|
this[kError] = err;
|
9246
9246
|
this[kClient][kOnError](err);
|
9247
9247
|
}
|
@@ -9360,7 +9360,7 @@ var require_client_h2 = __commonJS({
|
|
9360
9360
|
process.emitWarning(new RequestContentLengthMismatchError());
|
9361
9361
|
}
|
9362
9362
|
if (contentLength != null) {
|
9363
|
-
|
9363
|
+
assert44(body, "no body must not have content length");
|
9364
9364
|
headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`;
|
9365
9365
|
}
|
9366
9366
|
session.ref();
|
@@ -9525,7 +9525,7 @@ var require_client_h2 = __commonJS({
|
|
9525
9525
|
expectsPayload
|
9526
9526
|
);
|
9527
9527
|
} else {
|
9528
|
-
|
9528
|
+
assert44(false);
|
9529
9529
|
}
|
9530
9530
|
}
|
9531
9531
|
__name(writeBodyH2, "writeBodyH2");
|
@@ -9534,7 +9534,7 @@ var require_client_h2 = __commonJS({
|
|
9534
9534
|
function writeBuffer(abort, h2stream, body, client, request4, socket, contentLength, expectsPayload) {
|
9535
9535
|
try {
|
9536
9536
|
if (body != null && util5.isBuffer(body)) {
|
9537
|
-
|
9537
|
+
assert44(contentLength === body.byteLength, "buffer body must have content length");
|
9538
9538
|
h2stream.cork();
|
9539
9539
|
h2stream.write(body);
|
9540
9540
|
h2stream.uncork();
|
@@ -9552,7 +9552,7 @@ var require_client_h2 = __commonJS({
|
|
9552
9552
|
}
|
9553
9553
|
__name(writeBuffer, "writeBuffer");
|
9554
9554
|
function writeStream(abort, socket, expectsPayload, h2stream, body, client, request4, contentLength) {
|
9555
|
-
|
9555
|
+
assert44(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
|
9556
9556
|
const pipe = pipeline(
|
9557
9557
|
body,
|
9558
9558
|
h2stream,
|
@@ -9578,7 +9578,7 @@ var require_client_h2 = __commonJS({
|
|
9578
9578
|
}
|
9579
9579
|
__name(writeStream, "writeStream");
|
9580
9580
|
async function writeBlob(abort, h2stream, body, client, request4, socket, contentLength, expectsPayload) {
|
9581
|
-
|
9581
|
+
assert44(contentLength === body.size, "blob body must have content length");
|
9582
9582
|
try {
|
9583
9583
|
if (contentLength != null && contentLength !== body.size) {
|
9584
9584
|
throw new RequestContentLengthMismatchError();
|
@@ -9600,7 +9600,7 @@ var require_client_h2 = __commonJS({
|
|
9600
9600
|
}
|
9601
9601
|
__name(writeBlob, "writeBlob");
|
9602
9602
|
async function writeIterable(abort, h2stream, body, client, request4, socket, contentLength, expectsPayload) {
|
9603
|
-
|
9603
|
+
assert44(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
|
9604
9604
|
let callback = null;
|
9605
9605
|
function onDrain() {
|
9606
9606
|
if (callback) {
|
@@ -9611,7 +9611,7 @@ var require_client_h2 = __commonJS({
|
|
9611
9611
|
}
|
9612
9612
|
__name(onDrain, "onDrain");
|
9613
9613
|
const waitForDrain = /* @__PURE__ */ __name(() => new Promise((resolve25, reject) => {
|
9614
|
-
|
9614
|
+
assert44(callback === null);
|
9615
9615
|
if (socket[kError]) {
|
9616
9616
|
reject(socket[kError]);
|
9617
9617
|
} else {
|
@@ -9652,7 +9652,7 @@ var require_client = __commonJS({
|
|
9652
9652
|
"../../node_modules/.pnpm/undici@7.11.0/node_modules/undici/lib/dispatcher/client.js"(exports2, module3) {
|
9653
9653
|
"use strict";
|
9654
9654
|
init_import_meta_url();
|
9655
|
-
var
|
9655
|
+
var assert44 = require("assert");
|
9656
9656
|
var net2 = require("net");
|
9657
9657
|
var http5 = require("http");
|
9658
9658
|
var util5 = require_util();
|
@@ -9942,25 +9942,25 @@ var require_client = __commonJS({
|
|
9942
9942
|
};
|
9943
9943
|
function onError(client, err) {
|
9944
9944
|
if (client[kRunning] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") {
|
9945
|
-
|
9945
|
+
assert44(client[kPendingIdx] === client[kRunningIdx]);
|
9946
9946
|
const requests = client[kQueue].splice(client[kRunningIdx]);
|
9947
9947
|
for (let i5 = 0; i5 < requests.length; i5++) {
|
9948
9948
|
const request4 = requests[i5];
|
9949
9949
|
util5.errorRequest(client, request4, err);
|
9950
9950
|
}
|
9951
|
-
|
9951
|
+
assert44(client[kSize] === 0);
|
9952
9952
|
}
|
9953
9953
|
}
|
9954
9954
|
__name(onError, "onError");
|
9955
9955
|
async function connect(client) {
|
9956
|
-
|
9957
|
-
|
9956
|
+
assert44(!client[kConnecting]);
|
9957
|
+
assert44(!client[kHTTPContext]);
|
9958
9958
|
let { host, hostname: hostname2, protocol, port } = client[kUrl];
|
9959
9959
|
if (hostname2[0] === "[") {
|
9960
9960
|
const idx = hostname2.indexOf("]");
|
9961
|
-
|
9961
|
+
assert44(idx !== -1);
|
9962
9962
|
const ip = hostname2.substring(1, idx);
|
9963
|
-
|
9963
|
+
assert44(net2.isIPv6(ip));
|
9964
9964
|
hostname2 = ip;
|
9965
9965
|
}
|
9966
9966
|
client[kConnecting] = true;
|
@@ -9999,7 +9999,7 @@ var require_client = __commonJS({
|
|
9999
9999
|
util5.destroy(socket.on("error", noop), new ClientDestroyedError());
|
10000
10000
|
return;
|
10001
10001
|
}
|
10002
|
-
|
10002
|
+
assert44(socket);
|
10003
10003
|
try {
|
10004
10004
|
client[kHTTPContext] = socket.alpnProtocol === "h2" ? await connectH2(client, socket) : await connectH1(client, socket);
|
10005
10005
|
} catch (err) {
|
@@ -10048,7 +10048,7 @@ var require_client = __commonJS({
|
|
10048
10048
|
});
|
10049
10049
|
}
|
10050
10050
|
if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") {
|
10051
|
-
|
10051
|
+
assert44(client[kRunning] === 0);
|
10052
10052
|
while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
|
10053
10053
|
const request4 = client[kQueue][client[kPendingIdx]++];
|
10054
10054
|
util5.errorRequest(client, request4, err);
|
@@ -10083,7 +10083,7 @@ var require_client = __commonJS({
|
|
10083
10083
|
function _resume(client, sync) {
|
10084
10084
|
while (true) {
|
10085
10085
|
if (client.destroyed) {
|
10086
|
-
|
10086
|
+
assert44(client[kPending] === 0);
|
10087
10087
|
return;
|
10088
10088
|
}
|
10089
10089
|
if (client[kClosedResolve] && !client[kSize]) {
|
@@ -11142,7 +11142,7 @@ var require_retry_handler = __commonJS({
|
|
11142
11142
|
"../../node_modules/.pnpm/undici@7.11.0/node_modules/undici/lib/handler/retry-handler.js"(exports2, module3) {
|
11143
11143
|
"use strict";
|
11144
11144
|
init_import_meta_url();
|
11145
|
-
var
|
11145
|
+
var assert44 = require("assert");
|
11146
11146
|
var { kRetryHandlerDefaultRetry } = require_symbols();
|
11147
11147
|
var { RequestRetryError } = require_errors();
|
11148
11148
|
var WrapHandler = require_wrap_handler();
|
@@ -11330,8 +11330,8 @@ var require_retry_handler = __commonJS({
|
|
11330
11330
|
});
|
11331
11331
|
}
|
11332
11332
|
const { start, size, end = size ? size - 1 : null } = contentRange;
|
11333
|
-
|
11334
|
-
|
11333
|
+
assert44(this.start === start, "content-range mismatch");
|
11334
|
+
assert44(this.end == null || this.end === end, "content-range mismatch");
|
11335
11335
|
return;
|
11336
11336
|
}
|
11337
11337
|
if (this.end == null) {
|
@@ -11348,11 +11348,11 @@ var require_retry_handler = __commonJS({
|
|
11348
11348
|
return;
|
11349
11349
|
}
|
11350
11350
|
const { start, size, end = size ? size - 1 : null } = range;
|
11351
|
-
|
11351
|
+
assert44(
|
11352
11352
|
start != null && Number.isFinite(start),
|
11353
11353
|
"content-range mismatch"
|
11354
11354
|
);
|
11355
|
-
|
11355
|
+
assert44(end != null && Number.isFinite(end), "invalid content-length");
|
11356
11356
|
this.start = start;
|
11357
11357
|
this.end = end;
|
11358
11358
|
}
|
@@ -11360,8 +11360,8 @@ var require_retry_handler = __commonJS({
|
|
11360
11360
|
const contentLength = headers["content-length"];
|
11361
11361
|
this.end = contentLength != null ? Number(contentLength) - 1 : null;
|
11362
11362
|
}
|
11363
|
-
|
11364
|
-
|
11363
|
+
assert44(Number.isFinite(this.start));
|
11364
|
+
assert44(
|
11365
11365
|
this.end == null || Number.isFinite(this.end),
|
11366
11366
|
"invalid content-length"
|
11367
11367
|
);
|
@@ -11597,7 +11597,7 @@ var require_readable = __commonJS({
|
|
11597
11597
|
"../../node_modules/.pnpm/undici@7.11.0/node_modules/undici/lib/api/readable.js"(exports2, module3) {
|
11598
11598
|
"use strict";
|
11599
11599
|
init_import_meta_url();
|
11600
|
-
var
|
11600
|
+
var assert44 = require("assert");
|
11601
11601
|
var { Readable: Readable8 } = require("stream");
|
11602
11602
|
var { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError: AbortError2 } = require_errors();
|
11603
11603
|
var util5 = require_util();
|
@@ -11794,7 +11794,7 @@ var require_readable = __commonJS({
|
|
11794
11794
|
this[kBody] = ReadableStreamFrom(this);
|
11795
11795
|
if (this[kConsume]) {
|
11796
11796
|
this[kBody].getReader();
|
11797
|
-
|
11797
|
+
assert44(this[kBody].locked);
|
11798
11798
|
}
|
11799
11799
|
}
|
11800
11800
|
return this[kBody];
|
@@ -11863,7 +11863,7 @@ var require_readable = __commonJS({
|
|
11863
11863
|
}
|
11864
11864
|
__name(isUnusable, "isUnusable");
|
11865
11865
|
function consume(stream2, type) {
|
11866
|
-
|
11866
|
+
assert44(!stream2[kConsume]);
|
11867
11867
|
return new Promise((resolve25, reject) => {
|
11868
11868
|
if (isUnusable(stream2)) {
|
11869
11869
|
const rState = stream2._readableState;
|
@@ -12012,7 +12012,7 @@ var require_api_request = __commonJS({
|
|
12012
12012
|
"../../node_modules/.pnpm/undici@7.11.0/node_modules/undici/lib/api/api-request.js"(exports2, module3) {
|
12013
12013
|
"use strict";
|
12014
12014
|
init_import_meta_url();
|
12015
|
-
var
|
12015
|
+
var assert44 = require("assert");
|
12016
12016
|
var { AsyncResource } = require("async_hooks");
|
12017
12017
|
var { Readable: Readable8 } = require_readable();
|
12018
12018
|
var { InvalidArgumentError, RequestAbortedError } = require_errors();
|
@@ -12083,7 +12083,7 @@ var require_api_request = __commonJS({
|
|
12083
12083
|
abort(this.reason);
|
12084
12084
|
return;
|
12085
12085
|
}
|
12086
|
-
|
12086
|
+
assert44(this.callback);
|
12087
12087
|
this.abort = abort;
|
12088
12088
|
this.context = context2;
|
12089
12089
|
}
|
@@ -12243,7 +12243,7 @@ var require_api_stream = __commonJS({
|
|
12243
12243
|
"../../node_modules/.pnpm/undici@7.11.0/node_modules/undici/lib/api/api-stream.js"(exports2, module3) {
|
12244
12244
|
"use strict";
|
12245
12245
|
init_import_meta_url();
|
12246
|
-
var
|
12246
|
+
var assert44 = require("assert");
|
12247
12247
|
var { finished } = require("stream");
|
12248
12248
|
var { AsyncResource } = require("async_hooks");
|
12249
12249
|
var { InvalidArgumentError, InvalidReturnValueError } = require_errors();
|
@@ -12306,7 +12306,7 @@ var require_api_stream = __commonJS({
|
|
12306
12306
|
abort(this.reason);
|
12307
12307
|
return;
|
12308
12308
|
}
|
12309
|
-
|
12309
|
+
assert44(this.callback);
|
12310
12310
|
this.abort = abort;
|
12311
12311
|
this.context = context2;
|
12312
12312
|
}
|
@@ -12415,7 +12415,7 @@ var require_api_pipeline = __commonJS({
|
|
12415
12415
|
Duplex: Duplex2,
|
12416
12416
|
PassThrough: PassThrough3
|
12417
12417
|
} = require("stream");
|
12418
|
-
var
|
12418
|
+
var assert44 = require("assert");
|
12419
12419
|
var { AsyncResource } = require("async_hooks");
|
12420
12420
|
var {
|
12421
12421
|
InvalidArgumentError,
|
@@ -12539,7 +12539,7 @@ var require_api_pipeline = __commonJS({
|
|
12539
12539
|
abort(this.reason);
|
12540
12540
|
return;
|
12541
12541
|
}
|
12542
|
-
|
12542
|
+
assert44(!res, "pipeline cannot be retried");
|
12543
12543
|
this.abort = abort;
|
12544
12544
|
this.context = context2;
|
12545
12545
|
}
|
@@ -12625,7 +12625,7 @@ var require_api_upgrade = __commonJS({
|
|
12625
12625
|
init_import_meta_url();
|
12626
12626
|
var { InvalidArgumentError, SocketError } = require_errors();
|
12627
12627
|
var { AsyncResource } = require("async_hooks");
|
12628
|
-
var
|
12628
|
+
var assert44 = require("assert");
|
12629
12629
|
var util5 = require_util();
|
12630
12630
|
var { addSignal, removeSignal } = require_abort_signal();
|
12631
12631
|
var UpgradeHandler = class extends AsyncResource {
|
@@ -12656,7 +12656,7 @@ var require_api_upgrade = __commonJS({
|
|
12656
12656
|
abort(this.reason);
|
12657
12657
|
return;
|
12658
12658
|
}
|
12659
|
-
|
12659
|
+
assert44(this.callback);
|
12660
12660
|
this.abort = abort;
|
12661
12661
|
this.context = null;
|
12662
12662
|
}
|
@@ -12664,7 +12664,7 @@ var require_api_upgrade = __commonJS({
|
|
12664
12664
|
throw new SocketError("bad upgrade", null);
|
12665
12665
|
}
|
12666
12666
|
onUpgrade(statusCode, rawHeaders, socket) {
|
12667
|
-
|
12667
|
+
assert44(statusCode === 101);
|
12668
12668
|
const { callback, opaque, context: context2 } = this;
|
12669
12669
|
removeSignal(this);
|
12670
12670
|
this.callback = null;
|
@@ -12721,7 +12721,7 @@ var require_api_connect = __commonJS({
|
|
12721
12721
|
"../../node_modules/.pnpm/undici@7.11.0/node_modules/undici/lib/api/api-connect.js"(exports2, module3) {
|
12722
12722
|
"use strict";
|
12723
12723
|
init_import_meta_url();
|
12724
|
-
var
|
12724
|
+
var assert44 = require("assert");
|
12725
12725
|
var { AsyncResource } = require("async_hooks");
|
12726
12726
|
var { InvalidArgumentError, SocketError } = require_errors();
|
12727
12727
|
var util5 = require_util();
|
@@ -12753,7 +12753,7 @@ var require_api_connect = __commonJS({
|
|
12753
12753
|
abort(this.reason);
|
12754
12754
|
return;
|
12755
12755
|
}
|
12756
|
-
|
12756
|
+
assert44(this.callback);
|
12757
12757
|
this.abort = abort;
|
12758
12758
|
this.context = context2;
|
12759
12759
|
}
|
@@ -14030,7 +14030,7 @@ var require_decorator_handler = __commonJS({
|
|
14030
14030
|
"../../node_modules/.pnpm/undici@7.11.0/node_modules/undici/lib/handler/decorator-handler.js"(exports2, module3) {
|
14031
14031
|
"use strict";
|
14032
14032
|
init_import_meta_url();
|
14033
|
-
var
|
14033
|
+
var assert44 = require("assert");
|
14034
14034
|
var WrapHandler = require_wrap_handler();
|
14035
14035
|
module3.exports = class DecoratorHandler {
|
14036
14036
|
static {
|
@@ -14050,25 +14050,25 @@ var require_decorator_handler = __commonJS({
|
|
14050
14050
|
this.#handler.onRequestStart?.(...args);
|
14051
14051
|
}
|
14052
14052
|
onRequestUpgrade(...args) {
|
14053
|
-
|
14054
|
-
|
14053
|
+
assert44(!this.#onCompleteCalled);
|
14054
|
+
assert44(!this.#onErrorCalled);
|
14055
14055
|
return this.#handler.onRequestUpgrade?.(...args);
|
14056
14056
|
}
|
14057
14057
|
onResponseStart(...args) {
|
14058
|
-
|
14059
|
-
|
14060
|
-
|
14058
|
+
assert44(!this.#onCompleteCalled);
|
14059
|
+
assert44(!this.#onErrorCalled);
|
14060
|
+
assert44(!this.#onResponseStartCalled);
|
14061
14061
|
this.#onResponseStartCalled = true;
|
14062
14062
|
return this.#handler.onResponseStart?.(...args);
|
14063
14063
|
}
|
14064
14064
|
onResponseData(...args) {
|
14065
|
-
|
14066
|
-
|
14065
|
+
assert44(!this.#onCompleteCalled);
|
14066
|
+
assert44(!this.#onErrorCalled);
|
14067
14067
|
return this.#handler.onResponseData?.(...args);
|
14068
14068
|
}
|
14069
14069
|
onResponseEnd(...args) {
|
14070
|
-
|
14071
|
-
|
14070
|
+
assert44(!this.#onCompleteCalled);
|
14071
|
+
assert44(!this.#onErrorCalled);
|
14072
14072
|
this.#onCompleteCalled = true;
|
14073
14073
|
return this.#handler.onResponseEnd?.(...args);
|
14074
14074
|
}
|
@@ -14092,7 +14092,7 @@ var require_redirect_handler = __commonJS({
|
|
14092
14092
|
init_import_meta_url();
|
14093
14093
|
var util5 = require_util();
|
14094
14094
|
var { kBodyUsed } = require_symbols();
|
14095
|
-
var
|
14095
|
+
var assert44 = require("assert");
|
14096
14096
|
var { InvalidArgumentError } = require_errors();
|
14097
14097
|
var EE = require("events");
|
14098
14098
|
var redirectableStatusCodes = [300, 301, 302, 303, 307, 308];
|
@@ -14108,7 +14108,7 @@ var require_redirect_handler = __commonJS({
|
|
14108
14108
|
this[kBodyUsed] = false;
|
14109
14109
|
}
|
14110
14110
|
async *[Symbol.asyncIterator]() {
|
14111
|
-
|
14111
|
+
assert44(!this[kBodyUsed], "disturbed");
|
14112
14112
|
this[kBodyUsed] = true;
|
14113
14113
|
yield* this[kBody];
|
14114
14114
|
}
|
@@ -14137,7 +14137,7 @@ var require_redirect_handler = __commonJS({
|
|
14137
14137
|
if (util5.isStream(this.opts.body)) {
|
14138
14138
|
if (util5.bodyLength(this.opts.body) === 0) {
|
14139
14139
|
this.opts.body.on("data", function() {
|
14140
|
-
|
14140
|
+
assert44(false);
|
14141
14141
|
});
|
14142
14142
|
}
|
14143
14143
|
if (typeof this.opts.body.readableDidRead !== "boolean") {
|
@@ -14239,7 +14239,7 @@ var require_redirect_handler = __commonJS({
|
|
14239
14239
|
}
|
14240
14240
|
}
|
14241
14241
|
} else {
|
14242
|
-
|
14242
|
+
assert44(headers == null, "headers must be an object or an array");
|
14243
14243
|
}
|
14244
14244
|
return ret;
|
14245
14245
|
}
|
@@ -15764,7 +15764,7 @@ var require_cache_revalidation_handler = __commonJS({
|
|
15764
15764
|
"../../node_modules/.pnpm/undici@7.11.0/node_modules/undici/lib/handler/cache-revalidation-handler.js"(exports2, module3) {
|
15765
15765
|
"use strict";
|
15766
15766
|
init_import_meta_url();
|
15767
|
-
var
|
15767
|
+
var assert44 = require("assert");
|
15768
15768
|
var CacheRevalidationHandler = class {
|
15769
15769
|
static {
|
15770
15770
|
__name(this, "CacheRevalidationHandler");
|
@@ -15804,7 +15804,7 @@ var require_cache_revalidation_handler = __commonJS({
|
|
15804
15804
|
this.#handler.onRequestUpgrade?.(controller, statusCode, headers, socket);
|
15805
15805
|
}
|
15806
15806
|
onResponseStart(controller, statusCode, headers, statusMessage) {
|
15807
|
-
|
15807
|
+
assert44(this.#callback != null);
|
15808
15808
|
this.#successful = statusCode === 304 || this.#allowErrorStatusCodes && statusCode >= 500 && statusCode <= 504;
|
15809
15809
|
this.#callback(this.#successful, this.#context);
|
15810
15810
|
this.#callback = null;
|
@@ -15855,7 +15855,7 @@ var require_cache2 = __commonJS({
|
|
15855
15855
|
"../../node_modules/.pnpm/undici@7.11.0/node_modules/undici/lib/interceptor/cache.js"(exports2, module3) {
|
15856
15856
|
"use strict";
|
15857
15857
|
init_import_meta_url();
|
15858
|
-
var
|
15858
|
+
var assert44 = require("assert");
|
15859
15859
|
var { Readable: Readable8 } = require("stream");
|
15860
15860
|
var util5 = require_util();
|
15861
15861
|
var CacheHandler = require_cache_handler();
|
@@ -15920,8 +15920,8 @@ var require_cache2 = __commonJS({
|
|
15920
15920
|
__name(handleUncachedResponse, "handleUncachedResponse");
|
15921
15921
|
function sendCachedValue(handler, opts, result, age, context2, isStale) {
|
15922
15922
|
const stream2 = util5.isStream(result.body) ? result.body : Readable8.from(result.body ?? []);
|
15923
|
-
|
15924
|
-
|
15923
|
+
assert44(!stream2.destroyed, "stream should not be destroyed");
|
15924
|
+
assert44(!stream2.readableDidRead, "stream should not be readableDidRead");
|
15925
15925
|
const controller = {
|
15926
15926
|
resume() {
|
15927
15927
|
stream2.resume();
|
@@ -16480,7 +16480,7 @@ var require_headers = __commonJS({
|
|
16480
16480
|
isValidHeaderValue
|
16481
16481
|
} = require_util2();
|
16482
16482
|
var { webidl } = require_webidl();
|
16483
|
-
var
|
16483
|
+
var assert44 = require("assert");
|
16484
16484
|
var util5 = require("util");
|
16485
16485
|
function isHTTPWhiteSpaceCharCode(code) {
|
16486
16486
|
return code === 10 || code === 13 || code === 9 || code === 32;
|
@@ -16705,11 +16705,11 @@ var require_headers = __commonJS({
|
|
16705
16705
|
const iterator = this.headersMap[Symbol.iterator]();
|
16706
16706
|
const firstValue = iterator.next().value;
|
16707
16707
|
array[0] = [firstValue[0], firstValue[1].value];
|
16708
|
-
|
16708
|
+
assert44(firstValue[1].value !== null);
|
16709
16709
|
for (let i5 = 1, j6 = 0, right2 = 0, left2 = 0, pivot = 0, x6, value; i5 < size; ++i5) {
|
16710
16710
|
value = iterator.next().value;
|
16711
16711
|
x6 = array[i5] = [value[0], value[1].value];
|
16712
|
-
|
16712
|
+
assert44(x6[1] !== null);
|
16713
16713
|
left2 = 0;
|
16714
16714
|
right2 = i5;
|
16715
16715
|
while (left2 < right2) {
|
@@ -16736,7 +16736,7 @@ var require_headers = __commonJS({
|
|
16736
16736
|
let i5 = 0;
|
16737
16737
|
for (const { 0: name2, 1: { value } } of this.headersMap) {
|
16738
16738
|
array[i5++] = [name2, value];
|
16739
|
-
|
16739
|
+
assert44(value !== null);
|
16740
16740
|
}
|
16741
16741
|
return array.sort(compareHeaderName);
|
16742
16742
|
}
|
@@ -16967,7 +16967,7 @@ var require_response = __commonJS({
|
|
16967
16967
|
var { webidl } = require_webidl();
|
16968
16968
|
var { URLSerializer } = require_data_url();
|
16969
16969
|
var { kConstruct } = require_symbols();
|
16970
|
-
var
|
16970
|
+
var assert44 = require("assert");
|
16971
16971
|
var { types } = require("util");
|
16972
16972
|
var textEncoder = new TextEncoder("utf-8");
|
16973
16973
|
var Response12 = class _Response {
|
@@ -17228,7 +17228,7 @@ var require_response = __commonJS({
|
|
17228
17228
|
return p6 in state2 ? state2[p6] : target[p6];
|
17229
17229
|
},
|
17230
17230
|
set(target, p6, value) {
|
17231
|
-
|
17231
|
+
assert44(!(p6 in state2));
|
17232
17232
|
target[p6] = value;
|
17233
17233
|
return true;
|
17234
17234
|
}
|
@@ -17263,12 +17263,12 @@ var require_response = __commonJS({
|
|
17263
17263
|
body: null
|
17264
17264
|
});
|
17265
17265
|
} else {
|
17266
|
-
|
17266
|
+
assert44(false);
|
17267
17267
|
}
|
17268
17268
|
}
|
17269
17269
|
__name(filterResponse, "filterResponse");
|
17270
17270
|
function makeAppropriateNetworkError(fetchParams, err = null) {
|
17271
|
-
|
17271
|
+
assert44(isCancelled(fetchParams));
|
17272
17272
|
return isAborted2(fetchParams) ? makeNetworkError(Object.assign(new DOMException("The operation was aborted.", "AbortError"), { cause: err })) : makeNetworkError(Object.assign(new DOMException("Request was cancelled."), { cause: err }));
|
17273
17273
|
}
|
17274
17274
|
__name(makeAppropriateNetworkError, "makeAppropriateNetworkError");
|
@@ -17415,7 +17415,7 @@ var require_request2 = __commonJS({
|
|
17415
17415
|
var { webidl } = require_webidl();
|
17416
17416
|
var { URLSerializer } = require_data_url();
|
17417
17417
|
var { kConstruct } = require_symbols();
|
17418
|
-
var
|
17418
|
+
var assert44 = require("assert");
|
17419
17419
|
var { getMaxListeners, setMaxListeners, defaultMaxListeners } = require("events");
|
17420
17420
|
var kAbortController = Symbol("abortController");
|
17421
17421
|
var requestFinalizer = new FinalizationRegistry2(({ signal, abort }) => {
|
@@ -17496,7 +17496,7 @@ var require_request2 = __commonJS({
|
|
17496
17496
|
request4 = makeRequest({ urlList: [parsedURL] });
|
17497
17497
|
fallbackMode = "cors";
|
17498
17498
|
} else {
|
17499
|
-
|
17499
|
+
assert44(webidl.is.Request(input));
|
17500
17500
|
request4 = input.#state;
|
17501
17501
|
signal = input.#signal;
|
17502
17502
|
this.#dispatcher = init3.dispatcher || input.#dispatcher;
|
@@ -18194,7 +18194,7 @@ var require_fetch = __commonJS({
|
|
18194
18194
|
createInflate,
|
18195
18195
|
extractMimeType
|
18196
18196
|
} = require_util2();
|
18197
|
-
var
|
18197
|
+
var assert44 = require("assert");
|
18198
18198
|
var { safelyExtractBody, extractBody } = require_body();
|
18199
18199
|
var {
|
18200
18200
|
redirectStatusSet,
|
@@ -18276,7 +18276,7 @@ var require_fetch = __commonJS({
|
|
18276
18276
|
requestObject.signal,
|
18277
18277
|
() => {
|
18278
18278
|
locallyAborted = true;
|
18279
|
-
|
18279
|
+
assert44(controller != null);
|
18280
18280
|
controller.abort(requestObject.signal.reason);
|
18281
18281
|
const realResponse = responseObject?.deref();
|
18282
18282
|
abortFetch(p6, request4, realResponse, requestObject.signal.reason);
|
@@ -18382,7 +18382,7 @@ var require_fetch = __commonJS({
|
|
18382
18382
|
dispatcher = getGlobalDispatcher2()
|
18383
18383
|
// undici
|
18384
18384
|
}) {
|
18385
|
-
|
18385
|
+
assert44(dispatcher);
|
18386
18386
|
let taskDestination = null;
|
18387
18387
|
let crossOriginIsolatedCapability = false;
|
18388
18388
|
if (request4.client != null) {
|
@@ -18405,7 +18405,7 @@ var require_fetch = __commonJS({
|
|
18405
18405
|
taskDestination,
|
18406
18406
|
crossOriginIsolatedCapability
|
18407
18407
|
};
|
18408
|
-
|
18408
|
+
assert44(!request4.body || request4.body.stream);
|
18409
18409
|
if (request4.window === "client") {
|
18410
18410
|
request4.window = request4.client?.globalObject?.constructor?.name === "Window" ? request4.client : "no-window";
|
18411
18411
|
}
|
@@ -18496,7 +18496,7 @@ var require_fetch = __commonJS({
|
|
18496
18496
|
} else if (request4.responseTainting === "opaque") {
|
18497
18497
|
response = filterResponse(response, "opaque");
|
18498
18498
|
} else {
|
18499
|
-
|
18499
|
+
assert44(false);
|
18500
18500
|
}
|
18501
18501
|
}
|
18502
18502
|
let internalResponse = response.status === 0 ? response : response.internalResponse;
|
@@ -18727,7 +18727,7 @@ var require_fetch = __commonJS({
|
|
18727
18727
|
} else if (request4.redirect === "follow") {
|
18728
18728
|
response = await httpRedirectFetch(fetchParams, response);
|
18729
18729
|
} else {
|
18730
|
-
|
18730
|
+
assert44(false);
|
18731
18731
|
}
|
18732
18732
|
}
|
18733
18733
|
response.timingInfo = timingInfo;
|
@@ -18781,7 +18781,7 @@ var require_fetch = __commonJS({
|
|
18781
18781
|
request4.headersList.delete("host", true);
|
18782
18782
|
}
|
18783
18783
|
if (request4.body != null) {
|
18784
|
-
|
18784
|
+
assert44(request4.body.source != null);
|
18785
18785
|
request4.body = safelyExtractBody(request4.body.source)[0];
|
18786
18786
|
}
|
18787
18787
|
const timingInfo = fetchParams.timingInfo;
|
@@ -18916,7 +18916,7 @@ var require_fetch = __commonJS({
|
|
18916
18916
|
}
|
18917
18917
|
__name(httpNetworkOrCacheFetch, "httpNetworkOrCacheFetch");
|
18918
18918
|
async function httpNetworkFetch(fetchParams, includeCredentials = false, forceNewConnection = false) {
|
18919
|
-
|
18919
|
+
assert44(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed);
|
18920
18920
|
fetchParams.controller.connection = {
|
18921
18921
|
abort: null,
|
18922
18922
|
destroyed: false,
|
@@ -19235,7 +19235,7 @@ var require_util3 = __commonJS({
|
|
19235
19235
|
"../../node_modules/.pnpm/undici@7.11.0/node_modules/undici/lib/web/cache/util.js"(exports2, module3) {
|
19236
19236
|
"use strict";
|
19237
19237
|
init_import_meta_url();
|
19238
|
-
var
|
19238
|
+
var assert44 = require("assert");
|
19239
19239
|
var { URLSerializer } = require_data_url();
|
19240
19240
|
var { isValidHeaderName } = require_util2();
|
19241
19241
|
function urlEquals(A3, B3, excludeFragment = false) {
|
@@ -19245,7 +19245,7 @@ var require_util3 = __commonJS({
|
|
19245
19245
|
}
|
19246
19246
|
__name(urlEquals, "urlEquals");
|
19247
19247
|
function getFieldValues(header) {
|
19248
|
-
|
19248
|
+
assert44(header !== null);
|
19249
19249
|
const values = [];
|
19250
19250
|
for (let value of header.split(",")) {
|
19251
19251
|
value = value.trim();
|
@@ -19276,7 +19276,7 @@ var require_cache3 = __commonJS({
|
|
19276
19276
|
var { Request: Request4, fromInnerRequest, getRequestState } = require_request2();
|
19277
19277
|
var { fetching } = require_fetch();
|
19278
19278
|
var { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = require_util2();
|
19279
|
-
var
|
19279
|
+
var assert44 = require("assert");
|
19280
19280
|
var Cache2 = class _Cache {
|
19281
19281
|
static {
|
19282
19282
|
__name(this, "Cache");
|
@@ -19520,7 +19520,7 @@ var require_cache3 = __commonJS({
|
|
19520
19520
|
return false;
|
19521
19521
|
}
|
19522
19522
|
} else {
|
19523
|
-
|
19523
|
+
assert44(typeof request4 === "string");
|
19524
19524
|
r7 = getRequestState(new Request4(request4));
|
19525
19525
|
}
|
19526
19526
|
const operations = [];
|
@@ -19631,7 +19631,7 @@ var require_cache3 = __commonJS({
|
|
19631
19631
|
}
|
19632
19632
|
for (const requestResponse of requestResponses) {
|
19633
19633
|
const idx = cache6.indexOf(requestResponse);
|
19634
|
-
|
19634
|
+
assert44(idx !== -1);
|
19635
19635
|
cache6.splice(idx, 1);
|
19636
19636
|
}
|
19637
19637
|
} else if (operation.type === "put") {
|
@@ -19663,7 +19663,7 @@ var require_cache3 = __commonJS({
|
|
19663
19663
|
requestResponses = this.#queryCache(operation.request);
|
19664
19664
|
for (const requestResponse of requestResponses) {
|
19665
19665
|
const idx = cache6.indexOf(requestResponse);
|
19666
|
-
|
19666
|
+
assert44(idx !== -1);
|
19667
19667
|
cache6.splice(idx, 1);
|
19668
19668
|
}
|
19669
19669
|
cache6.push([operation.request, operation.response]);
|
@@ -20130,7 +20130,7 @@ var require_parse = __commonJS({
|
|
20130
20130
|
var { maxNameValuePairSize, maxAttributeValueSize } = require_constants4();
|
20131
20131
|
var { isCTLExcludingHtab } = require_util4();
|
20132
20132
|
var { collectASequenceOfCodePointsFast } = require_data_url();
|
20133
|
-
var
|
20133
|
+
var assert44 = require("assert");
|
20134
20134
|
var { unescape: unescape2 } = require("querystring");
|
20135
20135
|
function parseSetCookie(header) {
|
20136
20136
|
if (isCTLExcludingHtab(header)) {
|
@@ -20174,7 +20174,7 @@ var require_parse = __commonJS({
|
|
20174
20174
|
if (unparsedAttributes.length === 0) {
|
20175
20175
|
return cookieAttributeList;
|
20176
20176
|
}
|
20177
|
-
|
20177
|
+
assert44(unparsedAttributes[0] === ";");
|
20178
20178
|
unparsedAttributes = unparsedAttributes.slice(1);
|
20179
20179
|
let cookieAv = "";
|
20180
20180
|
if (unparsedAttributes.includes(";")) {
|
@@ -21062,7 +21062,7 @@ var require_connection = __commonJS({
|
|
21062
21062
|
var { Headers: Headers5, getHeadersList } = require_headers();
|
21063
21063
|
var { getDecodeSplit } = require_util2();
|
21064
21064
|
var { WebsocketFrameSend } = require_frame();
|
21065
|
-
var
|
21065
|
+
var assert44 = require("assert");
|
21066
21066
|
var crypto8;
|
21067
21067
|
try {
|
21068
21068
|
crypto8 = require("crypto");
|
@@ -21170,7 +21170,7 @@ var require_connection = __commonJS({
|
|
21170
21170
|
if (reason.length !== 0 && code === null) {
|
21171
21171
|
code = 1e3;
|
21172
21172
|
}
|
21173
|
-
|
21173
|
+
assert44(code === null || Number.isInteger(code));
|
21174
21174
|
if (code === null && reason.length === 0) {
|
21175
21175
|
frame.frameData = emptyBuffer;
|
21176
21176
|
} else if (code !== null && reason === null) {
|
@@ -21275,7 +21275,7 @@ var require_receiver = __commonJS({
|
|
21275
21275
|
"use strict";
|
21276
21276
|
init_import_meta_url();
|
21277
21277
|
var { Writable: Writable5 } = require("stream");
|
21278
|
-
var
|
21278
|
+
var assert44 = require("assert");
|
21279
21279
|
var { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = require_constants5();
|
21280
21280
|
var { channels } = require_diagnostics();
|
21281
21281
|
var {
|
@@ -21516,7 +21516,7 @@ var require_receiver = __commonJS({
|
|
21516
21516
|
return output;
|
21517
21517
|
}
|
21518
21518
|
parseCloseBody(data) {
|
21519
|
-
|
21519
|
+
assert44(data.length !== 1);
|
21520
21520
|
let code;
|
21521
21521
|
if (data.length >= 2) {
|
21522
21522
|
code = data.readUInt16BE(0);
|
@@ -26252,6 +26252,29 @@ function resolveDockerHost(dockerPath) {
|
|
26252
26252
|
}
|
26253
26253
|
return process.platform === "win32" ? "//./pipe/docker_engine" : "unix:///var/run/docker.sock";
|
26254
26254
|
}
|
26255
|
+
async function getImageRepoTags(dockerPath, imageTag) {
|
26256
|
+
try {
|
26257
|
+
const output = await dockerImageInspect(dockerPath, {
|
26258
|
+
imageTag,
|
26259
|
+
formatString: "{{ range .RepoTags }}{{ . }}\n{{ end }}"
|
26260
|
+
});
|
26261
|
+
return output.split("\n").filter((tag) => tag.trim() !== "");
|
26262
|
+
} catch {
|
26263
|
+
return [];
|
26264
|
+
}
|
26265
|
+
}
|
26266
|
+
async function cleanupDuplicateImageTags(dockerPath, imageTag) {
|
26267
|
+
try {
|
26268
|
+
const repoTags = await getImageRepoTags(dockerPath, imageTag);
|
26269
|
+
const tagsToRemove = repoTags.filter(
|
26270
|
+
(tag) => tag !== imageTag && tag.startsWith("cloudflare-dev")
|
26271
|
+
);
|
26272
|
+
if (tagsToRemove.length > 0) {
|
26273
|
+
runDockerCmdWithOutput(dockerPath, ["rmi", ...tagsToRemove]);
|
26274
|
+
}
|
26275
|
+
} catch {
|
26276
|
+
}
|
26277
|
+
}
|
26255
26278
|
var import_child_process3, import_crypto, import_fs6, import_path5, runDockerCmd, runDockerCmdWithOutput, verifyDockerInstalled, isDockerfile, cleanupContainers, getContainerIdsFromImage;
|
26256
26279
|
var init_utils = __esm({
|
26257
26280
|
"../containers-shared/src/utils.ts"() {
|
@@ -26386,6 +26409,8 @@ Other container tooling that is compatible with the Docker CLI and engine may wo
|
|
26386
26409
|
__name(generateContainerBuildId, "generateContainerBuildId");
|
26387
26410
|
__name(getDockerSocketFromContext, "getDockerSocketFromContext");
|
26388
26411
|
__name(resolveDockerHost, "resolveDockerHost");
|
26412
|
+
__name(getImageRepoTags, "getImageRepoTags");
|
26413
|
+
__name(cleanupDuplicateImageTags, "cleanupDuplicateImageTags");
|
26389
26414
|
}
|
26390
26415
|
});
|
26391
26416
|
|
@@ -26471,6 +26496,7 @@ To use an existing image from another repository, see https://developers.cloudfl
|
|
26471
26496
|
});
|
26472
26497
|
}
|
26473
26498
|
if (!aborted) {
|
26499
|
+
await cleanupDuplicateImageTags(dockerPath, options.image_tag);
|
26474
26500
|
await checkExposedPorts(dockerPath, options);
|
26475
26501
|
}
|
26476
26502
|
}
|
@@ -33001,7 +33027,7 @@ var require_signal_exit = __commonJS({
|
|
33001
33027
|
};
|
33002
33028
|
};
|
33003
33029
|
} else {
|
33004
|
-
|
33030
|
+
assert44 = require("assert");
|
33005
33031
|
signals = require_signals();
|
33006
33032
|
isWin = /^win/i.test(process11.platform);
|
33007
33033
|
EE = require("events");
|
@@ -33024,7 +33050,7 @@ var require_signal_exit = __commonJS({
|
|
33024
33050
|
return function() {
|
33025
33051
|
};
|
33026
33052
|
}
|
33027
|
-
|
33053
|
+
assert44.equal(typeof cb2, "function", "a callback must be provided for exit handler");
|
33028
33054
|
if (loaded === false) {
|
33029
33055
|
load();
|
33030
33056
|
}
|
@@ -33130,7 +33156,7 @@ var require_signal_exit = __commonJS({
|
|
33130
33156
|
}
|
33131
33157
|
}, "processEmit");
|
33132
33158
|
}
|
33133
|
-
var
|
33159
|
+
var assert44;
|
33134
33160
|
var signals;
|
33135
33161
|
var isWin;
|
33136
33162
|
var EE;
|
@@ -33815,7 +33841,7 @@ var name, version;
|
|
33815
33841
|
var init_package = __esm({
|
33816
33842
|
"package.json"() {
|
33817
33843
|
name = "wrangler";
|
33818
|
-
version = "4.
|
33844
|
+
version = "4.30.0";
|
33819
33845
|
}
|
33820
33846
|
});
|
33821
33847
|
|
@@ -37798,9 +37824,9 @@ function validateContainerApp(envName, topLevelName, configPath) {
|
|
37798
37824
|
containerAppOptional,
|
37799
37825
|
"rollout_step_percentage",
|
37800
37826
|
"number"
|
37801
|
-
)
|
37827
|
+
) || containerAppOptional.rollout_step_percentage > 100 || containerAppOptional.rollout_step_percentage < 25) {
|
37802
37828
|
diagnostics.errors.push(
|
37803
|
-
`"containers.rollout_step_percentage" field should be a number between 25 and 100, but got ${containerAppOptional.rollout_step_percentage}`
|
37829
|
+
`"containers.rollout_step_percentage" field should be a number between 25 and 100, but got "${containerAppOptional.rollout_step_percentage}"`
|
37804
37830
|
);
|
37805
37831
|
}
|
37806
37832
|
validateOptionalProperty(
|
@@ -37811,6 +37837,15 @@ function validateContainerApp(envName, topLevelName, configPath) {
|
|
37811
37837
|
"string",
|
37812
37838
|
["full_auto", "full_manual", "none"]
|
37813
37839
|
);
|
37840
|
+
if (!isOptionalProperty(
|
37841
|
+
containerAppOptional,
|
37842
|
+
"rollout_active_grace_period",
|
37843
|
+
"number"
|
37844
|
+
) || containerAppOptional.rollout_active_grace_period < 0) {
|
37845
|
+
diagnostics.errors.push(
|
37846
|
+
`"containers.rollout_active_grace_period" field should be a positive number but got "${containerAppOptional.rollout_active_grace_period}"`
|
37847
|
+
);
|
37848
|
+
}
|
37814
37849
|
validateOptionalProperty(
|
37815
37850
|
diagnostics,
|
37816
37851
|
field,
|
@@ -37866,7 +37901,8 @@ function validateContainerApp(envName, topLevelName, configPath) {
|
|
37866
37901
|
"constraints",
|
37867
37902
|
"rollout_step_percentage",
|
37868
37903
|
"rollout_kind",
|
37869
|
-
"durable_objects"
|
37904
|
+
"durable_objects",
|
37905
|
+
"rollout_active_grace_period"
|
37870
37906
|
]
|
37871
37907
|
);
|
37872
37908
|
if ("configuration" in containerAppOptional) {
|
@@ -66052,7 +66088,6 @@ async function buildAndMaybePush(args, pathToDocker, push, containerConfig) {
|
|
66052
66088
|
buildCmd,
|
66053
66089
|
dockerfile
|
66054
66090
|
}).ready;
|
66055
|
-
let pushed = false;
|
66056
66091
|
if (push) {
|
66057
66092
|
const imageInfo = await dockerImageInspect(pathToDocker, {
|
66058
66093
|
imageTag,
|
@@ -66111,7 +66146,7 @@ async function buildAndMaybePush(args, pathToDocker, push, containerConfig) {
|
|
66111
66146
|
`Untagging built image: ${args.tag} since there was no change.`
|
66112
66147
|
);
|
66113
66148
|
await runDockerCmd(pathToDocker, ["image", "rm", imageTag]);
|
66114
|
-
return {
|
66149
|
+
return { remoteDigest };
|
66115
66150
|
}
|
66116
66151
|
} catch (error2) {
|
66117
66152
|
if (error2 instanceof Error) {
|
@@ -66130,9 +66165,8 @@ async function buildAndMaybePush(args, pathToDocker, push, containerConfig) {
|
|
66130
66165
|
await runDockerCmd(pathToDocker, ["tag", imageTag, namespacedImageTag]);
|
66131
66166
|
await runDockerCmd(pathToDocker, ["push", namespacedImageTag]);
|
66132
66167
|
await runDockerCmd(pathToDocker, ["image", "rm", namespacedImageTag]);
|
66133
|
-
pushed = true;
|
66134
66168
|
}
|
66135
|
-
return {
|
66169
|
+
return { newTag: imageTag };
|
66136
66170
|
} catch (error2) {
|
66137
66171
|
if (error2 instanceof Error) {
|
66138
66172
|
throw new UserError(error2.message, { cause: error2 });
|
@@ -68103,7 +68137,8 @@ function createApplicationToModifyApplication(req) {
|
|
68103
68137
|
max_instances: req.max_instances,
|
68104
68138
|
constraints: req.constraints,
|
68105
68139
|
affinities: req.affinities,
|
68106
|
-
scheduling_policy: req.scheduling_policy
|
68140
|
+
scheduling_policy: req.scheduling_policy,
|
68141
|
+
rollout_active_grace_period: req.rollout_active_grace_period
|
68107
68142
|
};
|
68108
68143
|
}
|
68109
68144
|
function cleanupObservability(observability) {
|
@@ -68148,7 +68183,8 @@ function containerConfigToCreateRequest(accountId, containerApp, imageRef, durab
|
|
68148
68183
|
constraints: containerApp.constraints,
|
68149
68184
|
durable_objects: {
|
68150
68185
|
namespace_id: durableObjectNamespaceId
|
68151
|
-
}
|
68186
|
+
},
|
68187
|
+
rollout_active_grace_period: containerApp.rollout_active_grace_period
|
68152
68188
|
};
|
68153
68189
|
}
|
68154
68190
|
async function apply(args, containerConfig, config) {
|
@@ -68169,10 +68205,9 @@ async function apply(args, containerConfig, config) {
|
|
68169
68205
|
const prevApp = existingApplications.find(
|
68170
68206
|
(app) => app.name === containerConfig.name
|
68171
68207
|
);
|
68208
|
+
const imageRef = "remoteDigest" in args.imageRef ? prevApp?.configuration.image ?? args.imageRef.remoteDigest : args.imageRef.newTag;
|
68172
68209
|
log(dim("Container application changes\n"));
|
68173
68210
|
const accountId = config.account_id || await getAccountId(config);
|
68174
|
-
const imageRef = args.newImageLink ?? prevApp?.configuration.image;
|
68175
|
-
(0, import_node_assert12.default)(imageRef, "No changes detected but no previous image found");
|
68176
68211
|
const appConfig = containerConfigToCreateRequest(
|
68177
68212
|
accountId,
|
68178
68213
|
containerConfig,
|
@@ -68255,16 +68290,17 @@ async function apply(args, containerConfig, config) {
|
|
68255
68290
|
endSection("Applied changes");
|
68256
68291
|
}
|
68257
68292
|
function formatError(err) {
|
68258
|
-
|
68259
|
-
|
68260
|
-
|
68261
|
-
message
|
68293
|
+
try {
|
68294
|
+
const maybeError = JSON.parse(err.body.error);
|
68295
|
+
if (maybeError.error !== void 0 && maybeError.details !== void 0 && typeof maybeError.details === "object") {
|
68296
|
+
let message = "";
|
68297
|
+
for (const key in maybeError.details) {
|
68298
|
+
message += `${brandColor(key)} ${maybeError.details[key]}
|
68262
68299
|
`;
|
68300
|
+
}
|
68301
|
+
return message;
|
68263
68302
|
}
|
68264
|
-
|
68265
|
-
}
|
68266
|
-
if (err.body.error !== void 0) {
|
68267
|
-
return ` ${err.body.error}`;
|
68303
|
+
} catch {
|
68268
68304
|
}
|
68269
68305
|
return JSON.stringify(err.body);
|
68270
68306
|
}
|
@@ -68278,7 +68314,8 @@ function cleanApplicationFromAPI(prev, currentConfig, accountId) {
|
|
68278
68314
|
max_instances: prev.max_instances,
|
68279
68315
|
name: prev.name,
|
68280
68316
|
scheduling_policy: prev.scheduling_policy,
|
68281
|
-
affinities: prev.affinities
|
68317
|
+
affinities: prev.affinities,
|
68318
|
+
rollout_active_grace_period: prev.rollout_active_grace_period
|
68282
68319
|
};
|
68283
68320
|
if ("instance_type" in currentConfig) {
|
68284
68321
|
const instance_type = inferInstanceType(cleanedPreviousApp.configuration);
|
@@ -68293,11 +68330,10 @@ function cleanApplicationFromAPI(prev, currentConfig, accountId) {
|
|
68293
68330
|
}
|
68294
68331
|
return cleanedPreviousApp;
|
68295
68332
|
}
|
68296
|
-
var
|
68333
|
+
var doAction;
|
68297
68334
|
var init_deploy = __esm({
|
68298
68335
|
"src/containers/deploy.ts"() {
|
68299
68336
|
init_import_meta_url();
|
68300
|
-
import_node_assert12 = __toESM(require("assert"));
|
68301
68337
|
init_cli();
|
68302
68338
|
init_colors();
|
68303
68339
|
init_containers_shared();
|
@@ -68322,27 +68358,25 @@ var init_deploy = __esm({
|
|
68322
68358
|
try {
|
68323
68359
|
application = await promiseSpinner(
|
68324
68360
|
ApplicationsService.createApplication(action.application),
|
68325
|
-
{ message: `Creating ${action.application.name}` }
|
68361
|
+
{ message: `Creating "${action.application.name}"` }
|
68326
68362
|
);
|
68327
68363
|
} catch (err) {
|
68328
68364
|
if (!(err instanceof Error)) {
|
68329
68365
|
throw err;
|
68330
68366
|
}
|
68331
68367
|
if (!(err instanceof ApiError)) {
|
68332
|
-
throw new
|
68368
|
+
throw new FatalError(
|
68333
68369
|
`Unexpected error creating application: ${err.message}`
|
68334
68370
|
);
|
68335
68371
|
}
|
68336
68372
|
if (err.status === 400) {
|
68337
68373
|
throw new UserError(
|
68338
|
-
`Error creating application due to a misconfiguration
|
68374
|
+
`Error creating application due to a misconfiguration:
|
68339
68375
|
${formatError(err)}`
|
68340
68376
|
);
|
68341
68377
|
}
|
68342
|
-
throw new UserError(
|
68343
|
-
|
68344
|
-
${formatError(err)}`
|
68345
|
-
);
|
68378
|
+
throw new UserError(`Error creating application:
|
68379
|
+
${formatError(err)}`);
|
68346
68380
|
}
|
68347
68381
|
success(
|
68348
68382
|
`Created application ${brandColor(action.application.name)} (Application ID: ${application.id})`,
|
@@ -68363,18 +68397,18 @@ ${formatError(err)}`
|
|
68363
68397
|
}
|
68364
68398
|
if (!(err instanceof ApiError)) {
|
68365
68399
|
throw new UserError(
|
68366
|
-
`Unexpected error modifying application ${action.name}: ${err.message}`
|
68400
|
+
`Unexpected error modifying application "${action.name}": ${err.message}`
|
68367
68401
|
);
|
68368
68402
|
}
|
68369
68403
|
if (err.status === 400) {
|
68370
68404
|
throw new UserError(
|
68371
|
-
`Error modifying application ${action.name} due to a misconfiguration:
|
68405
|
+
`Error modifying application "${action.name}" due to a misconfiguration:
|
68372
68406
|
|
68373
68407
|
${formatError(err)}`
|
68374
68408
|
);
|
68375
68409
|
}
|
68376
68410
|
throw new UserError(
|
68377
|
-
`Error modifying application ${action.name}
|
68411
|
+
`Error modifying application "${action.name}":
|
68378
68412
|
${formatError(err)}`
|
68379
68413
|
);
|
68380
68414
|
}
|
@@ -68398,19 +68432,20 @@ ${formatError(err)}`
|
|
68398
68432
|
}
|
68399
68433
|
if (!(err instanceof ApiError)) {
|
68400
68434
|
throw new UserError(
|
68401
|
-
`Unexpected error rolling out application ${action.name}:
|
68435
|
+
`Unexpected error rolling out application "${action.name}":
|
68402
68436
|
${err.message}`
|
68403
68437
|
);
|
68404
68438
|
}
|
68405
68439
|
if (err.status === 400) {
|
68406
68440
|
throw new UserError(
|
68407
|
-
`Error rolling out application ${action.name} due to a misconfiguration:
|
68441
|
+
`Error rolling out application "${action.name}" due to a misconfiguration:
|
68408
68442
|
|
68409
68443
|
${formatError(err)}`
|
68410
68444
|
);
|
68411
68445
|
}
|
68412
68446
|
throw new UserError(
|
68413
|
-
`Error rolling out application ${action.name}
|
68447
|
+
`Error rolling out application "${action.name}":
|
68448
|
+
${formatError(err)}`
|
68414
68449
|
);
|
68415
68450
|
}
|
68416
68451
|
}
|
@@ -68540,18 +68575,10 @@ var init_api = __esm({
|
|
68540
68575
|
});
|
68541
68576
|
|
68542
68577
|
// src/cloudchamber/deploy.ts
|
68543
|
-
async function
|
68544
|
-
if ("image_uri" in containerConfig) {
|
68545
|
-
return {
|
68546
|
-
// We don't know at this point whether the image has changed
|
68547
|
-
// but we need to make sure API checks so
|
68548
|
-
// we always set this to the registry link.
|
68549
|
-
newImageLink: containerConfig.image_uri
|
68550
|
-
};
|
68551
|
-
}
|
68578
|
+
async function buildContainer(containerConfig, imageTag, dryRun, pathToDocker) {
|
68552
68579
|
const imageFullName = containerConfig.name + ":" + imageTag.split("-")[0];
|
68553
68580
|
logger.log("Building image", imageFullName);
|
68554
|
-
|
68581
|
+
return await buildAndMaybePush(
|
68555
68582
|
{
|
68556
68583
|
tag: imageFullName,
|
68557
68584
|
pathToDockerfile: containerConfig.dockerfile,
|
@@ -68562,22 +68589,23 @@ async function maybeBuildContainer(containerConfig, imageTag, dryRun, pathToDock
|
|
68562
68589
|
!dryRun,
|
68563
68590
|
containerConfig
|
68564
68591
|
);
|
68565
|
-
if (buildResult.pushed) {
|
68566
|
-
return { newImageLink: buildResult.image };
|
68567
|
-
}
|
68568
|
-
return { newImageLink: void 0 };
|
68569
68592
|
}
|
68570
68593
|
async function deployContainers(config, normalisedContainerConfig, { versionId, accountId, scriptName }) {
|
68571
68594
|
await fillOpenAPIConfiguration(config, containersScope);
|
68572
68595
|
const pathToDocker = getDockerPath();
|
68573
68596
|
const version5 = await fetchVersion(config, accountId, scriptName, versionId);
|
68597
|
+
let imageRef;
|
68574
68598
|
for (const container of normalisedContainerConfig) {
|
68575
|
-
|
68576
|
-
|
68577
|
-
|
68578
|
-
|
68579
|
-
|
68580
|
-
|
68599
|
+
if ("dockerfile" in container) {
|
68600
|
+
imageRef = await buildContainer(
|
68601
|
+
container,
|
68602
|
+
versionId,
|
68603
|
+
false,
|
68604
|
+
pathToDocker
|
68605
|
+
);
|
68606
|
+
} else {
|
68607
|
+
imageRef = { newTag: container.image_uri };
|
68608
|
+
}
|
68581
68609
|
const targetDurableObject = version5.resources.bindings.find(
|
68582
68610
|
(durableObject) => durableObject.type === "durable_object_namespace" && durableObject.class_name === container.class_name && // DO cannot be defined in a different script to the container
|
68583
68611
|
durableObject.script_name === void 0 && durableObject.namespace_id !== void 0
|
@@ -68592,7 +68620,7 @@ async function deployContainers(config, normalisedContainerConfig, { versionId,
|
|
68592
68620
|
);
|
68593
68621
|
await apply(
|
68594
68622
|
{
|
68595
|
-
|
68623
|
+
imageRef,
|
68596
68624
|
durable_object_namespace_id: targetDurableObject.namespace_id
|
68597
68625
|
},
|
68598
68626
|
container,
|
@@ -68613,17 +68641,17 @@ var init_deploy2 = __esm({
|
|
68613
68641
|
init_api();
|
68614
68642
|
init_build2();
|
68615
68643
|
init_common();
|
68616
|
-
__name(
|
68644
|
+
__name(buildContainer, "buildContainer");
|
68617
68645
|
__name(deployContainers, "deployContainers");
|
68618
68646
|
}
|
68619
68647
|
});
|
68620
68648
|
|
68621
68649
|
// src/containers/config.ts
|
68622
|
-
var
|
68650
|
+
var import_node_assert12, import_node_path22, getNormalizedContainerOptions;
|
68623
68651
|
var init_config3 = __esm({
|
68624
68652
|
"src/containers/config.ts"() {
|
68625
68653
|
init_import_meta_url();
|
68626
|
-
|
68654
|
+
import_node_assert12 = __toESM(require("assert"));
|
68627
68655
|
import_node_path22 = __toESM(require("path"));
|
68628
68656
|
init_containers_shared();
|
68629
68657
|
init_errors();
|
@@ -68634,7 +68662,7 @@ var init_config3 = __esm({
|
|
68634
68662
|
}
|
68635
68663
|
const normalizedContainers = [];
|
68636
68664
|
for (const container of config.containers) {
|
68637
|
-
(0,
|
68665
|
+
(0, import_node_assert12.default)(container.name, "container name should have been set by validation");
|
68638
68666
|
const targetDurableObject = config.durable_objects.bindings.find(
|
68639
68667
|
(durableObject) => durableObject.class_name === container.class_name
|
68640
68668
|
);
|
@@ -68671,6 +68699,7 @@ var init_config3 = __esm({
|
|
68671
68699
|
},
|
68672
68700
|
rollout_step_percentage: container.rollout_step_percentage ?? 25,
|
68673
68701
|
rollout_kind: container.rollout_kind ?? "full_auto",
|
68702
|
+
rollout_active_grace_period: container.rollout_active_grace_period,
|
68674
68703
|
observability: {
|
68675
68704
|
logs_enabled: config.observability?.logs?.enabled ?? config.observability?.enabled === true
|
68676
68705
|
}
|
@@ -68697,12 +68726,12 @@ var init_config3 = __esm({
|
|
68697
68726
|
}
|
68698
68727
|
const maybeDockerfile = isDockerfile(container.image, config.configPath);
|
68699
68728
|
if (maybeDockerfile) {
|
68700
|
-
(0,
|
68729
|
+
(0, import_node_assert12.default)(
|
68701
68730
|
import_node_path22.default.isAbsolute(container.image),
|
68702
68731
|
"Dockerfile path should be absolute"
|
68703
68732
|
);
|
68704
68733
|
const imageBuildContext = container.image_build_context ?? (0, import_node_path22.dirname)(container.image);
|
68705
|
-
(0,
|
68734
|
+
(0, import_node_assert12.default)(
|
68706
68735
|
import_node_path22.default.isAbsolute(imageBuildContext),
|
68707
68736
|
"resolved image_build_context should be defined"
|
68708
68737
|
);
|
@@ -70027,11 +70056,11 @@ async function runProvisioningFlow(item, preExisting, friendlyBindingName, scrip
|
|
70027
70056
|
logger.log(`\u2728 ${item.binding} provisioned \u{1F389}`);
|
70028
70057
|
printDivider();
|
70029
70058
|
}
|
70030
|
-
var
|
70059
|
+
var import_node_assert13, INHERIT_SYMBOL, ProvisionResourceHandler, R2Handler, KVHandler, D1Handler, HANDLERS, LOADERS;
|
70031
70060
|
var init_bindings = __esm({
|
70032
70061
|
"src/deployment-bundle/bindings.ts"() {
|
70033
70062
|
init_import_meta_url();
|
70034
|
-
|
70063
|
+
import_node_assert13 = __toESM(require("assert"));
|
70035
70064
|
init_cfetch();
|
70036
70065
|
init_create();
|
70037
70066
|
init_list();
|
@@ -70124,7 +70153,7 @@ var init_bindings = __esm({
|
|
70124
70153
|
);
|
70125
70154
|
}
|
70126
70155
|
async isConnectedToExistingResource() {
|
70127
|
-
(0,
|
70156
|
+
(0, import_node_assert13.default)(typeof this.binding.bucket_name !== "symbol");
|
70128
70157
|
if (!this.binding.bucket_name) {
|
70129
70158
|
return false;
|
70130
70159
|
}
|
@@ -70204,7 +70233,7 @@ var init_bindings = __esm({
|
|
70204
70233
|
return false;
|
70205
70234
|
}
|
70206
70235
|
async isConnectedToExistingResource() {
|
70207
|
-
(0,
|
70236
|
+
(0, import_node_assert13.default)(typeof this.binding.database_name !== "symbol");
|
70208
70237
|
if (!this.binding.database_name) {
|
70209
70238
|
return false;
|
70210
70239
|
}
|
@@ -70482,12 +70511,14 @@ function handleUnsafeCapnp(capnp) {
|
|
70482
70511
|
);
|
70483
70512
|
}
|
70484
70513
|
const srcPrefix = (0, import_node_path24.resolve)(base_path ?? ".");
|
70485
|
-
const capnpProcess = (0, import_node_child_process3.spawnSync)(
|
70486
|
-
"
|
70487
|
-
"-o-",
|
70488
|
-
|
70489
|
-
|
70490
|
-
|
70514
|
+
const capnpProcess = (0, import_node_child_process3.spawnSync)(
|
70515
|
+
"capnp",
|
70516
|
+
["compile", "-o-", `--src-prefix=${srcPrefix}`, ...capnpSchemas],
|
70517
|
+
// This number was chosen arbitrarily. If you get ENOBUFS because your compiled schema is still
|
70518
|
+
// too large, then we may need to bump this again or figure out another approach.
|
70519
|
+
// https://github.com/cloudflare/workers-sdk/pull/10217
|
70520
|
+
{ maxBuffer: 3 * 1024 * 1024 }
|
70521
|
+
);
|
70491
70522
|
if (capnpProcess.error) {
|
70492
70523
|
throw capnpProcess.error;
|
70493
70524
|
}
|
@@ -70859,7 +70890,7 @@ function createWorkerUploadForm(worker) {
|
|
70859
70890
|
const manifestModuleName = "__STATIC_CONTENT_MANIFEST";
|
70860
70891
|
const hasManifest = modules?.some(({ name: name2 }) => name2 === manifestModuleName);
|
70861
70892
|
if (hasManifest && main2.type === "esm") {
|
70862
|
-
(0,
|
70893
|
+
(0, import_node_assert14.default)(modules !== void 0);
|
70863
70894
|
const subDirs = new Set(
|
70864
70895
|
modules.map((module3) => import_node_path25.default.posix.dirname(module3.name))
|
70865
70896
|
);
|
@@ -70985,11 +71016,11 @@ function createWorkerUploadForm(worker) {
|
|
70985
71016
|
}
|
70986
71017
|
return formData;
|
70987
71018
|
}
|
70988
|
-
var
|
71019
|
+
var import_node_assert14, import_node_fs15, import_node_path25, import_undici6, moduleTypeMimeType;
|
70989
71020
|
var init_create_worker_upload_form = __esm({
|
70990
71021
|
"src/deployment-bundle/create-worker-upload-form.ts"() {
|
70991
71022
|
init_import_meta_url();
|
70992
|
-
|
71023
|
+
import_node_assert14 = __toESM(require("assert"));
|
70993
71024
|
import_node_fs15 = require("fs");
|
70994
71025
|
import_node_path25 = __toESM(require("path"));
|
70995
71026
|
import_undici6 = __toESM(require_undici());
|
@@ -71052,7 +71083,7 @@ var init_node_compat = __esm({
|
|
71052
71083
|
// src/durable.ts
|
71053
71084
|
async function getMigrationsToUpload(scriptName, props) {
|
71054
71085
|
const { config, accountId } = props;
|
71055
|
-
(0,
|
71086
|
+
(0, import_node_assert15.default)(accountId, "Missing accountId");
|
71056
71087
|
let migrations;
|
71057
71088
|
if (config.migrations.length > 0) {
|
71058
71089
|
let script;
|
@@ -71122,11 +71153,11 @@ async function getMigrationsToUpload(scriptName, props) {
|
|
71122
71153
|
}
|
71123
71154
|
return migrations;
|
71124
71155
|
}
|
71125
|
-
var
|
71156
|
+
var import_node_assert15, suppressNotFoundError;
|
71126
71157
|
var init_durable = __esm({
|
71127
71158
|
"src/durable.ts"() {
|
71128
71159
|
init_import_meta_url();
|
71129
|
-
|
71160
|
+
import_node_assert15 = __toESM(require("assert"));
|
71130
71161
|
init_cfetch();
|
71131
71162
|
init_config2();
|
71132
71163
|
init_logger();
|
@@ -71260,7 +71291,7 @@ async function syncWorkersSite(complianceConfig, accountId, scriptName, siteAsse
|
|
71260
71291
|
logger.log("(Note: doing a dry run, not uploading or deleting anything.)");
|
71261
71292
|
return { manifest: void 0, namespace: void 0 };
|
71262
71293
|
}
|
71263
|
-
(0,
|
71294
|
+
(0, import_node_assert16.default)(accountId, "Missing accountId");
|
71264
71295
|
const title = `__${scriptName}-workers_sites_assets${preview ? "_preview" : ""}`;
|
71265
71296
|
const { id: namespace } = await createKVNamespaceIfNotAlreadyExisting(
|
71266
71297
|
complianceConfig,
|
@@ -71478,11 +71509,11 @@ function getSiteAssetPaths(config, assetDirectory, includePatterns = config.site
|
|
71478
71509
|
return void 0;
|
71479
71510
|
}
|
71480
71511
|
}
|
71481
|
-
var
|
71512
|
+
var import_node_assert16, import_promises9, path28, ALWAYS_IGNORE, HIDDEN_FILES_TO_INCLUDE, MAX_DIFF_LINES, MAX_BUCKET_SIZE2, MAX_BUCKET_KEYS, MAX_BATCH_OPERATIONS;
|
71482
71513
|
var init_sites = __esm({
|
71483
71514
|
"src/sites.ts"() {
|
71484
71515
|
init_import_meta_url();
|
71485
|
-
|
71516
|
+
import_node_assert16 = __toESM(require("assert"));
|
71486
71517
|
import_promises9 = require("fs/promises");
|
71487
71518
|
path28 = __toESM(require("path"));
|
71488
71519
|
init_workers_shared();
|
@@ -83459,7 +83490,7 @@ async function executeLocally({
|
|
83459
83490
|
} finally {
|
83460
83491
|
await mf.dispose();
|
83461
83492
|
}
|
83462
|
-
(0,
|
83493
|
+
(0, import_node_assert17.default)(Array.isArray(results));
|
83463
83494
|
const allResults = results.map((result) => ({
|
83464
83495
|
results: (result.results ?? []).map(
|
83465
83496
|
(row) => Object.fromEntries(
|
@@ -83714,12 +83745,12 @@ async function checkForSQLiteBinary(filename) {
|
|
83714
83745
|
);
|
83715
83746
|
}
|
83716
83747
|
}
|
83717
|
-
var import_fs15,
|
83748
|
+
var import_fs15, import_node_assert17, import_node_path26, import_md5_file, import_miniflare12, import_undici8, d1ExecuteCommand;
|
83718
83749
|
var init_execute = __esm({
|
83719
83750
|
"src/d1/execute.ts"() {
|
83720
83751
|
init_import_meta_url();
|
83721
83752
|
import_fs15 = require("fs");
|
83722
|
-
|
83753
|
+
import_node_assert17 = __toESM(require("assert"));
|
83723
83754
|
import_node_path26 = __toESM(require("path"));
|
83724
83755
|
init_interactive();
|
83725
83756
|
init_source();
|
@@ -85909,11 +85940,11 @@ ${jsonString}
|
|
85909
85940
|
logger.log("\nProceeding with deployment...\n");
|
85910
85941
|
return args;
|
85911
85942
|
}
|
85912
|
-
var
|
85943
|
+
var import_node_assert18, import_node_fs20, import_node_path31, deployCommand;
|
85913
85944
|
var init_deploy4 = __esm({
|
85914
85945
|
"src/deploy/index.ts"() {
|
85915
85946
|
init_import_meta_url();
|
85916
|
-
|
85947
|
+
import_node_assert18 = __toESM(require("assert"));
|
85917
85948
|
import_node_fs20 = require("fs");
|
85918
85949
|
import_node_path31 = __toESM(require("path"));
|
85919
85950
|
init_source();
|
@@ -86208,7 +86239,7 @@ var init_deploy4 = __esm({
|
|
86208
86239
|
);
|
86209
86240
|
}
|
86210
86241
|
if (!args.dryRun) {
|
86211
|
-
(0,
|
86242
|
+
(0, import_node_assert18.default)(accountId, "Missing account ID");
|
86212
86243
|
await verifyWorkerMatchesCITag(
|
86213
86244
|
config,
|
86214
86245
|
accountId,
|
@@ -86485,8 +86516,8 @@ async function runSearch(searchTerm) {
|
|
86485
86516
|
hitsPerPage: "1",
|
86486
86517
|
getRankingInfo: "0"
|
86487
86518
|
});
|
86488
|
-
(0,
|
86489
|
-
(0,
|
86519
|
+
(0, import_node_assert19.default)(id, "Missing Algolia App ID");
|
86520
|
+
(0, import_node_assert19.default)(key, "Missing Algolia Key");
|
86490
86521
|
const searchResp = await (0, import_undici10.fetch)(
|
86491
86522
|
`https://${id}-dsn.algolia.net/1/indexes/${index}/query`,
|
86492
86523
|
{
|
@@ -86515,11 +86546,11 @@ async function runSearch(searchTerm) {
|
|
86515
86546
|
return;
|
86516
86547
|
}
|
86517
86548
|
}
|
86518
|
-
var
|
86549
|
+
var import_node_assert19, import_undici10;
|
86519
86550
|
var init_helpers7 = __esm({
|
86520
86551
|
"src/docs/helpers.ts"() {
|
86521
86552
|
init_import_meta_url();
|
86522
|
-
|
86553
|
+
import_node_assert19 = __toESM(require("assert"));
|
86523
86554
|
import_undici10 = __toESM(require_undici());
|
86524
86555
|
init_logger();
|
86525
86556
|
__name(runSearch, "runSearch");
|
@@ -86576,27 +86607,27 @@ var init_docs = __esm({
|
|
86576
86607
|
});
|
86577
86608
|
|
86578
86609
|
// src/event-subscriptions/products.ts
|
86579
|
-
var
|
86610
|
+
var import_node_assert20, products;
|
86580
86611
|
var init_products = __esm({
|
86581
86612
|
"src/event-subscriptions/products.ts"() {
|
86582
86613
|
init_import_meta_url();
|
86583
|
-
|
86614
|
+
import_node_assert20 = __toESM(require("assert"));
|
86584
86615
|
init_errors();
|
86585
86616
|
products = /* @__PURE__ */ __name((_accountTag) => ({
|
86586
86617
|
superSlurper: {
|
86587
86618
|
validate: /* @__PURE__ */ __name((source) => {
|
86588
|
-
(0,
|
86619
|
+
(0, import_node_assert20.default)(source === "superSlurper");
|
86589
86620
|
return { service: "superSlurper" };
|
86590
86621
|
}, "validate"),
|
86591
86622
|
format: /* @__PURE__ */ __name(({ service }) => {
|
86592
|
-
(0,
|
86623
|
+
(0, import_node_assert20.default)(service === "superSlurper");
|
86593
86624
|
return service;
|
86594
86625
|
}, "format")
|
86595
86626
|
},
|
86596
86627
|
workersAI: {
|
86597
86628
|
validate: /* @__PURE__ */ __name((source) => {
|
86598
86629
|
const [service, model] = source.split(".");
|
86599
|
-
(0,
|
86630
|
+
(0, import_node_assert20.default)(service === "workersAI");
|
86600
86631
|
if (!model) {
|
86601
86632
|
throw new CommandLineArgsError(
|
86602
86633
|
`Invalid source. Must be formatted as workersAI.<model>`
|
@@ -86605,14 +86636,14 @@ var init_products = __esm({
|
|
86605
86636
|
return { service, model };
|
86606
86637
|
}, "validate"),
|
86607
86638
|
format: /* @__PURE__ */ __name((source) => {
|
86608
|
-
(0,
|
86639
|
+
(0, import_node_assert20.default)(source.service === "workersAI");
|
86609
86640
|
return `workersAI.${source.model}`;
|
86610
86641
|
}, "format")
|
86611
86642
|
},
|
86612
86643
|
workersBuilds: {
|
86613
86644
|
validate: /* @__PURE__ */ __name((source) => {
|
86614
86645
|
const [service, script] = source.split(".");
|
86615
|
-
(0,
|
86646
|
+
(0, import_node_assert20.default)(service === "workersBuilds");
|
86616
86647
|
if (!script) {
|
86617
86648
|
throw new CommandLineArgsError(
|
86618
86649
|
`Invalid source. Must be formatted as workersBuilds.<script_name>`
|
@@ -86621,14 +86652,14 @@ var init_products = __esm({
|
|
86621
86652
|
return { service, script };
|
86622
86653
|
}, "validate"),
|
86623
86654
|
format: /* @__PURE__ */ __name((source) => {
|
86624
|
-
(0,
|
86655
|
+
(0, import_node_assert20.default)(source.service === "workersBuilds");
|
86625
86656
|
return `workersBuilds.${source.script}`;
|
86626
86657
|
}, "format")
|
86627
86658
|
},
|
86628
86659
|
workflows: {
|
86629
86660
|
validate: /* @__PURE__ */ __name((source) => {
|
86630
86661
|
const [service, workflowName] = source.split(".");
|
86631
|
-
(0,
|
86662
|
+
(0, import_node_assert20.default)(service === "workflows");
|
86632
86663
|
if (!workflowName) {
|
86633
86664
|
throw new CommandLineArgsError(
|
86634
86665
|
`Invalid source. Must be formatted as workflows.<workflow_id>`
|
@@ -86637,7 +86668,7 @@ var init_products = __esm({
|
|
86637
86668
|
return { service, workflow_name: workflowName };
|
86638
86669
|
}, "validate"),
|
86639
86670
|
format: /* @__PURE__ */ __name((source) => {
|
86640
|
-
(0,
|
86671
|
+
(0, import_node_assert20.default)(source.service === "workflows");
|
86641
86672
|
return `workflows.${source.workflow_name}`;
|
86642
86673
|
}, "format")
|
86643
86674
|
}
|
@@ -88485,11 +88516,11 @@ var init_getValidBindingName = __esm({
|
|
88485
88516
|
});
|
88486
88517
|
|
88487
88518
|
// src/kv/index.ts
|
88488
|
-
var
|
88519
|
+
var import_node_assert21, import_node_buffer4, import_consumers, import_node_string_decoder, kvNamespace, kvNamespaceNamespace, kvKeyNamespace, kvBulkNamespace, kvNamespaceCreateCommand, kvNamespaceListCommand, kvNamespaceDeleteCommand, kvNamespaceRenameCommand, kvKeyPutCommand, kvKeyListCommand, kvKeyGetCommand, kvKeyDeleteCommand, kvBulkGetCommand, kvBulkPutCommand, kvBulkDeleteCommand;
|
88489
88520
|
var init_kv = __esm({
|
88490
88521
|
"src/kv/index.ts"() {
|
88491
88522
|
init_import_meta_url();
|
88492
|
-
|
88523
|
+
import_node_assert21 = require("assert");
|
88493
88524
|
import_node_buffer4 = require("buffer");
|
88494
88525
|
import_consumers = require("stream/consumers");
|
88495
88526
|
import_node_string_decoder = require("string_decoder");
|
@@ -88702,7 +88733,7 @@ var init_kv = __esm({
|
|
88702
88733
|
}
|
88703
88734
|
namespaceId = namespace.id;
|
88704
88735
|
}
|
88705
|
-
(0,
|
88736
|
+
(0, import_node_assert21.strict)(namespaceId, "namespaceId should be defined");
|
88706
88737
|
logger.log(`Renaming KV namespace ${namespaceId} to "${args.newName}".`);
|
88707
88738
|
const updatedNamespace = await updateKVNamespace(
|
88708
88739
|
config,
|
@@ -130566,7 +130597,7 @@ async function generateR2ServiceToken(accountId, bucketName, pipelineName) {
|
|
130566
130597
|
const timeoutPromise = (0, import_promises26.setTimeout)(12e4, "timeout", { signal });
|
130567
130598
|
const serverPromise = new Promise((resolve25, reject) => {
|
130568
130599
|
const server = import_node_http2.default.createServer(async (request4, response) => {
|
130569
|
-
(0,
|
130600
|
+
(0, import_node_assert22.default)(request4.url, "This request doesn't have a URL");
|
130570
130601
|
if (request4.method !== "GET") {
|
130571
130602
|
response.writeHead(405);
|
130572
130603
|
response.end("Method not allowed.");
|
@@ -130668,11 +130699,11 @@ async function deletePipeline(complianceConfig, accountId, name2) {
|
|
130668
130699
|
}
|
130669
130700
|
);
|
130670
130701
|
}
|
130671
|
-
var
|
130702
|
+
var import_node_assert22, import_node_crypto10, import_node_http2, import_promises26, API_HEADERS;
|
130672
130703
|
var init_client7 = __esm({
|
130673
130704
|
"src/pipelines/client.ts"() {
|
130674
130705
|
init_import_meta_url();
|
130675
|
-
|
130706
|
+
import_node_assert22 = __toESM(require("assert"));
|
130676
130707
|
import_node_crypto10 = require("crypto");
|
130677
130708
|
import_node_http2 = __toESM(require("http"));
|
130678
130709
|
import_promises26 = require("timers/promises");
|
@@ -148639,6 +148670,21 @@ async function deleteMetadataIndex(config, indexName, payload) {
|
|
148639
148670
|
}
|
148640
148671
|
);
|
148641
148672
|
}
|
148673
|
+
async function listVectors(config, indexName, options) {
|
148674
|
+
const accountId = await requireAuth(config);
|
148675
|
+
const searchParams = new URLSearchParams();
|
148676
|
+
if (options?.count !== void 0) {
|
148677
|
+
searchParams.set("count", options.count.toString());
|
148678
|
+
}
|
148679
|
+
if (options?.cursor !== void 0) {
|
148680
|
+
searchParams.set("cursor", options.cursor);
|
148681
|
+
}
|
148682
|
+
const queryString = searchParams.toString();
|
148683
|
+
const url4 = `/accounts/${accountId}/vectorize/v2/indexes/${indexName}/list${queryString ? `?${queryString}` : ""}`;
|
148684
|
+
return await fetchResult(config, url4, {
|
148685
|
+
method: "GET"
|
148686
|
+
});
|
148687
|
+
}
|
148642
148688
|
var jsonContentType;
|
148643
148689
|
var init_client10 = __esm({
|
148644
148690
|
"src/vectorize/client.ts"() {
|
@@ -148661,6 +148707,7 @@ var init_client10 = __esm({
|
|
148661
148707
|
__name(createMetadataIndex, "createMetadataIndex");
|
148662
148708
|
__name(listMetadataIndex, "listMetadataIndex");
|
148663
148709
|
__name(deleteMetadataIndex, "deleteMetadataIndex");
|
148710
|
+
__name(listVectors, "listVectors");
|
148664
148711
|
}
|
148665
148712
|
});
|
148666
148713
|
|
@@ -149435,6 +149482,98 @@ https://developers.cloudflare.com/vectorize/ to get started.
|
|
149435
149482
|
}
|
149436
149483
|
});
|
149437
149484
|
|
149485
|
+
// src/vectorize/listVectors.ts
|
149486
|
+
var vectorizeListVectorsCommand;
|
149487
|
+
var init_listVectors = __esm({
|
149488
|
+
"src/vectorize/listVectors.ts"() {
|
149489
|
+
init_import_meta_url();
|
149490
|
+
init_create_command();
|
149491
|
+
init_logger();
|
149492
|
+
init_client10();
|
149493
|
+
vectorizeListVectorsCommand = createCommand({
|
149494
|
+
metadata: {
|
149495
|
+
description: "List vector identifiers in a Vectorize index",
|
149496
|
+
status: "stable",
|
149497
|
+
owner: "Product: Vectorize",
|
149498
|
+
examples: [
|
149499
|
+
{
|
149500
|
+
command: "wrangler vectorize list-vectors my-index",
|
149501
|
+
description: "List vector identifiers in the index 'my-index'"
|
149502
|
+
},
|
149503
|
+
{
|
149504
|
+
command: "wrangler vectorize list-vectors my-index --count 50",
|
149505
|
+
description: "List up to 50 vector identifiers"
|
149506
|
+
},
|
149507
|
+
{
|
149508
|
+
command: "wrangler vectorize list-vectors my-index --cursor abc123",
|
149509
|
+
description: "Continue listing from a specific cursor position"
|
149510
|
+
}
|
149511
|
+
]
|
149512
|
+
},
|
149513
|
+
behaviour: {
|
149514
|
+
printBanner: /* @__PURE__ */ __name((args) => !args.json, "printBanner")
|
149515
|
+
},
|
149516
|
+
args: {
|
149517
|
+
name: {
|
149518
|
+
type: "string",
|
149519
|
+
demandOption: true,
|
149520
|
+
description: "The name of the Vectorize index"
|
149521
|
+
},
|
149522
|
+
count: {
|
149523
|
+
type: "number",
|
149524
|
+
description: "Maximum number of vectors to return (1-1000)"
|
149525
|
+
},
|
149526
|
+
cursor: {
|
149527
|
+
type: "string",
|
149528
|
+
description: "Cursor for pagination to get the next page of results"
|
149529
|
+
},
|
149530
|
+
json: {
|
149531
|
+
type: "boolean",
|
149532
|
+
default: false,
|
149533
|
+
description: "Return output as clean JSON"
|
149534
|
+
}
|
149535
|
+
},
|
149536
|
+
positionalArgs: ["name"],
|
149537
|
+
async handler(args, { config }) {
|
149538
|
+
logger.log(`\u{1F4CB} Listing vectors in index '${args.name}'...`);
|
149539
|
+
const options = {};
|
149540
|
+
if (args.count !== void 0) {
|
149541
|
+
options.count = args.count;
|
149542
|
+
}
|
149543
|
+
if (args.cursor) {
|
149544
|
+
options.cursor = args.cursor;
|
149545
|
+
}
|
149546
|
+
const result = await listVectors(config, args.name, options);
|
149547
|
+
if (result.vectors.length === 0) {
|
149548
|
+
logger.warn("No vectors found in this index.");
|
149549
|
+
return;
|
149550
|
+
}
|
149551
|
+
if (args.json) {
|
149552
|
+
logger.log(JSON.stringify(result, null, 2));
|
149553
|
+
return;
|
149554
|
+
}
|
149555
|
+
logger.table(
|
149556
|
+
result.vectors.map((vector, index) => ({
|
149557
|
+
"#": (index + 1).toString(),
|
149558
|
+
"Vector ID": vector.id
|
149559
|
+
}))
|
149560
|
+
);
|
149561
|
+
logger.log(
|
149562
|
+
`
|
149563
|
+
Showing ${result.count} of ${result.totalCount} total vectors`
|
149564
|
+
);
|
149565
|
+
if (result.isTruncated && result.nextCursor) {
|
149566
|
+
logger.log(`
|
149567
|
+
\u{1F4A1} To get the next page, run:`);
|
149568
|
+
logger.log(
|
149569
|
+
` wrangler vectorize list-vectors ${args.name} --cursor ${result.nextCursor}`
|
149570
|
+
);
|
149571
|
+
}
|
149572
|
+
}
|
149573
|
+
});
|
149574
|
+
}
|
149575
|
+
});
|
149576
|
+
|
149438
149577
|
// src/vectorize/query.ts
|
149439
149578
|
function validateQueryFilterInnerValue(innerValue) {
|
149440
149579
|
return ["string", "number", "boolean"].includes(typeof innerValue);
|
@@ -151697,7 +151836,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
151697
151836
|
workerBundle = createWorkerUploadForm(worker);
|
151698
151837
|
printBindings({ ...bindings, vars: maskedVars }, config.tail_consumers);
|
151699
151838
|
} else {
|
151700
|
-
(0,
|
151839
|
+
(0, import_node_assert23.default)(accountId, "Missing accountId");
|
151701
151840
|
if (getFlag("RESOURCES_PROVISION")) {
|
151702
151841
|
await provisionBindings(
|
151703
151842
|
bindings,
|
@@ -151868,11 +152007,11 @@ function generatePreviewAlias(scriptName) {
|
|
151868
152007
|
);
|
151869
152008
|
return truncatedAlias || warnAndExit();
|
151870
152009
|
}
|
151871
|
-
var
|
152010
|
+
var import_node_assert23, import_node_child_process7, import_node_crypto12, import_node_fs32, import_node_path54, import_undici19, versionsUploadCommand, MAX_DNS_LABEL_LENGTH, HASH_LENGTH, ALIAS_VALIDATION_REGEX;
|
151872
152011
|
var init_upload2 = __esm({
|
151873
152012
|
"src/versions/upload.ts"() {
|
151874
152013
|
init_import_meta_url();
|
151875
|
-
|
152014
|
+
import_node_assert23 = __toESM(require("assert"));
|
151876
152015
|
import_node_child_process7 = require("child_process");
|
151877
152016
|
import_node_crypto12 = require("crypto");
|
151878
152017
|
import_node_fs32 = require("fs");
|
@@ -152142,7 +152281,7 @@ var init_upload2 = __esm({
|
|
152142
152281
|
}
|
152143
152282
|
const previewAlias = args.previewAlias ?? (getCIGeneratePreviewAlias() === "true" ? generatePreviewAlias(name2) : void 0);
|
152144
152283
|
if (!args.dryRun) {
|
152145
|
-
(0,
|
152284
|
+
(0, import_node_assert23.default)(accountId, "Missing account ID");
|
152146
152285
|
await verifyWorkerMatchesCITag(
|
152147
152286
|
config,
|
152148
152287
|
accountId,
|
@@ -152198,7 +152337,7 @@ var init_upload2 = __esm({
|
|
152198
152337
|
__name(formatTime3, "formatTime");
|
152199
152338
|
MAX_DNS_LABEL_LENGTH = 63;
|
152200
152339
|
HASH_LENGTH = 4;
|
152201
|
-
ALIAS_VALIDATION_REGEX = /^[a-z](?:[a-z0-9-]
|
152340
|
+
ALIAS_VALIDATION_REGEX = /^[a-z](?:[a-z0-9-]*[a-z0-9])?$/i;
|
152202
152341
|
__name(sanitizeBranchName, "sanitizeBranchName");
|
152203
152342
|
__name(getBranchName, "getBranchName");
|
152204
152343
|
__name(createTruncatedAlias, "createTruncatedAlias");
|
@@ -156658,6 +156797,10 @@ function createCLIParser(argv) {
|
|
156658
156797
|
},
|
156659
156798
|
{ command: "wrangler vectorize get", definition: vectorizeGetCommand },
|
156660
156799
|
{ command: "wrangler vectorize list", definition: vectorizeListCommand },
|
156800
|
+
{
|
156801
|
+
command: "wrangler vectorize list-vectors",
|
156802
|
+
definition: vectorizeListVectorsCommand
|
156803
|
+
},
|
156661
156804
|
{ command: "wrangler vectorize query", definition: vectorizeQueryCommand },
|
156662
156805
|
{
|
156663
156806
|
command: "wrangler vectorize insert",
|
@@ -157153,7 +157296,7 @@ async function main(argv) {
|
|
157153
157296
|
if (e7.cause instanceof ApiError) {
|
157154
157297
|
logger.error(e7.cause);
|
157155
157298
|
} else {
|
157156
|
-
(0,
|
157299
|
+
(0, import_node_assert24.default)(isAuthenticationError(e7));
|
157157
157300
|
logger.log(formatMessage(e7));
|
157158
157301
|
}
|
157159
157302
|
const envAuth = getAuthFromEnv();
|
@@ -157258,11 +157401,11 @@ ${tryRunningItIn}${oneOfThese}`
|
|
157258
157401
|
}
|
157259
157402
|
}
|
157260
157403
|
}
|
157261
|
-
var
|
157404
|
+
var import_node_assert24, import_node_os8, import_node_path55, import_promises31, import_undici20;
|
157262
157405
|
var init_src = __esm({
|
157263
157406
|
"src/index.ts"() {
|
157264
157407
|
init_import_meta_url();
|
157265
|
-
|
157408
|
+
import_node_assert24 = __toESM(require("assert"));
|
157266
157409
|
import_node_os8 = __toESM(require("os"));
|
157267
157410
|
import_node_path55 = require("path");
|
157268
157411
|
import_promises31 = require("timers/promises");
|
@@ -157397,6 +157540,7 @@ var init_src = __esm({
|
|
157397
157540
|
init_insert();
|
157398
157541
|
init_list7();
|
157399
157542
|
init_listMetadataIndex();
|
157543
|
+
init_listVectors();
|
157400
157544
|
init_query();
|
157401
157545
|
init_upsert();
|
157402
157546
|
init_versions();
|
@@ -157509,7 +157653,9 @@ function getModuleType(entry) {
|
|
157509
157653
|
}
|
157510
157654
|
async function convertWorkerBundleToModules(workerBundle) {
|
157511
157655
|
return await Promise.all(
|
157512
|
-
[...workerBundle.entries()].
|
157656
|
+
[...workerBundle.entries()].filter(
|
157657
|
+
(m6) => m6[1] instanceof Blob && m6[1].type !== "application/source-map"
|
157658
|
+
).map(
|
157513
157659
|
async (m6) => ({
|
157514
157660
|
type: getModuleType(m6[1]),
|
157515
157661
|
path: m6[0],
|
@@ -157954,7 +158100,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
157954
158100
|
);
|
157955
158101
|
}
|
157956
158102
|
const scriptName = props.name;
|
157957
|
-
(0,
|
158103
|
+
(0, import_node_assert25.default)(
|
157958
158104
|
!config.site || config.site.bucket,
|
157959
158105
|
"A [site] definition requires a `bucket` field with a path to the site's assets directory."
|
157960
158106
|
);
|
@@ -158206,12 +158352,14 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
158206
158352
|
if (props.dryRun) {
|
158207
158353
|
if (normalisedContainerConfig.length) {
|
158208
158354
|
for (const container of normalisedContainerConfig) {
|
158209
|
-
|
158210
|
-
|
158211
|
-
|
158212
|
-
|
158213
|
-
|
158214
|
-
|
158355
|
+
if ("dockerfile" in container) {
|
158356
|
+
await buildContainer(
|
158357
|
+
container,
|
158358
|
+
workerTag ?? "worker-tag",
|
158359
|
+
props.dryRun,
|
158360
|
+
dockerPath
|
158361
|
+
);
|
158362
|
+
}
|
158215
158363
|
}
|
158216
158364
|
}
|
158217
158365
|
workerBundle = createWorkerUploadForm(worker);
|
@@ -158221,7 +158369,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
158221
158369
|
{ warnIfNoBindings: true }
|
158222
158370
|
);
|
158223
158371
|
} else {
|
158224
|
-
(0,
|
158372
|
+
(0, import_node_assert25.default)(accountId, "Missing accountId");
|
158225
158373
|
if (getFlag("RESOURCES_PROVISION")) {
|
158226
158374
|
await provisionBindings(
|
158227
158375
|
bindings,
|
@@ -158393,7 +158541,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
158393
158541
|
return { versionId, workerTag };
|
158394
158542
|
}
|
158395
158543
|
if (normalisedContainerConfig.length) {
|
158396
|
-
(0,
|
158544
|
+
(0, import_node_assert25.default)(versionId && accountId);
|
158397
158545
|
await deployContainers(config, normalisedContainerConfig, {
|
158398
158546
|
versionId,
|
158399
158547
|
accountId,
|
@@ -158627,11 +158775,11 @@ async function updateQueueConsumers(scriptName, config) {
|
|
158627
158775
|
}
|
158628
158776
|
return updateConsumers;
|
158629
158777
|
}
|
158630
|
-
var
|
158778
|
+
var import_node_assert25, import_node_fs33, import_node_path57, import_node_url9, import_undici21, validateRoutes3;
|
158631
158779
|
var init_deploy8 = __esm({
|
158632
158780
|
"src/deploy/deploy.ts"() {
|
158633
158781
|
init_import_meta_url();
|
158634
|
-
|
158782
|
+
import_node_assert25 = __toESM(require("assert"));
|
158635
158783
|
import_node_fs33 = require("fs");
|
158636
158784
|
import_node_path57 = __toESM(require("path"));
|
158637
158785
|
import_node_url9 = require("url");
|
@@ -158878,11 +159026,11 @@ function errorOnLegacyPagesWorkerJSAsset(file, hasAssetsIgnoreFile) {
|
|
158878
159026
|
}
|
158879
159027
|
}
|
158880
159028
|
}
|
158881
|
-
var
|
159029
|
+
var import_node_assert26, import_node_fs34, import_promises35, path60, import_undici22, BULK_UPLOAD_CONCURRENCY2, MAX_UPLOAD_ATTEMPTS2, MAX_UPLOAD_GATEWAY_ERRORS2, MAX_DIFF_LINES2, syncAssets, buildAssetManifest, NonExistentAssetsDirError, WORKER_JS_FILENAME;
|
158882
159030
|
var init_assets = __esm({
|
158883
159031
|
"src/assets.ts"() {
|
158884
159032
|
init_import_meta_url();
|
158885
|
-
|
159033
|
+
import_node_assert26 = __toESM(require("assert"));
|
158886
159034
|
import_node_fs34 = require("fs");
|
158887
159035
|
import_promises35 = require("fs/promises");
|
158888
159036
|
path60 = __toESM(require("path"));
|
@@ -158907,7 +159055,7 @@ var init_assets = __esm({
|
|
158907
159055
|
MAX_UPLOAD_GATEWAY_ERRORS2 = 5;
|
158908
159056
|
MAX_DIFF_LINES2 = 100;
|
158909
159057
|
syncAssets = /* @__PURE__ */ __name(async (complianceConfig, accountId, assetDirectory, scriptName, dispatchNamespace) => {
|
158910
|
-
(0,
|
159058
|
+
(0, import_node_assert26.default)(accountId, "Missing accountId");
|
158911
159059
|
logger.info("\u{1F300} Building list of assets...");
|
158912
159060
|
const manifest = await buildAssetManifest(assetDirectory);
|
158913
159061
|
const url4 = dispatchNamespace ? `/accounts/${accountId}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}/assets-upload-session` : `/accounts/${accountId}/workers/scripts/${scriptName}/assets-upload-session`;
|
@@ -159259,7 +159407,7 @@ async function resolveDevConfig(config, input) {
|
|
159259
159407
|
);
|
159260
159408
|
if (input.dev?.remote) {
|
159261
159409
|
const { accountId } = await auth();
|
159262
|
-
(0,
|
159410
|
+
(0, import_node_assert27.default)(accountId, "Account ID must be provided for remote dev");
|
159263
159411
|
await getZoneIdForPreview(config, { host, routes, accountId });
|
159264
159412
|
}
|
159265
159413
|
const initialIp = input.dev?.server?.hostname ?? config.dev.ip;
|
@@ -159507,11 +159655,11 @@ If you are trying to develop Pages and Workers together, please use \`wrangler p
|
|
159507
159655
|
}
|
159508
159656
|
return resolved;
|
159509
159657
|
}
|
159510
|
-
var
|
159658
|
+
var import_node_assert27, import_node_path58, getInspectorPort, getLocalPort, ConfigController;
|
159511
159659
|
var init_ConfigController = __esm({
|
159512
159660
|
"src/api/startDevWorker/ConfigController.ts"() {
|
159513
159661
|
init_import_meta_url();
|
159514
|
-
|
159662
|
+
import_node_assert27 = __toESM(require("assert"));
|
159515
159663
|
import_node_path58 = __toESM(require("path"));
|
159516
159664
|
init_containers_shared();
|
159517
159665
|
init_esm4();
|
@@ -159563,7 +159711,7 @@ var init_ConfigController = __esm({
|
|
159563
159711
|
ignoreInitial: true
|
159564
159712
|
}).on("change", async (_event) => {
|
159565
159713
|
logger.debug(`${import_node_path58.default.basename(configPath)} changed...`);
|
159566
|
-
(0,
|
159714
|
+
(0, import_node_assert27.default)(
|
159567
159715
|
this.latestInput,
|
159568
159716
|
"Cannot be watching config without having first set an input"
|
159569
159717
|
);
|
@@ -159578,7 +159726,7 @@ var init_ConfigController = __esm({
|
|
159578
159726
|
);
|
159579
159727
|
}
|
159580
159728
|
patch(input) {
|
159581
|
-
(0,
|
159729
|
+
(0, import_node_assert27.default)(
|
159582
159730
|
this.latestInput,
|
159583
159731
|
"Cannot call updateConfig without previously calling setConfig"
|
159584
159732
|
);
|
@@ -159729,7 +159877,7 @@ function maybeGetSourceMappingURL(sourcePath) {
|
|
159729
159877
|
return;
|
159730
159878
|
}
|
159731
159879
|
const sourceMappingURLMatch = source.substring(sourceMappingURLIndex).match(/^\/\/# sourceMappingURL=(.+)/);
|
159732
|
-
(0,
|
159880
|
+
(0, import_node_assert28.default)(sourceMappingURLMatch !== null);
|
159733
159881
|
const sourceMappingURLSpecifier = sourceMappingURLMatch[1];
|
159734
159882
|
const sourceURL = (0, import_node_url10.pathToFileURL)(sourcePath);
|
159735
159883
|
try {
|
@@ -159741,11 +159889,11 @@ function maybeGetSourceMappingURL(sourcePath) {
|
|
159741
159889
|
} catch {
|
159742
159890
|
}
|
159743
159891
|
}
|
159744
|
-
var
|
159892
|
+
var import_node_assert28, import_node_fs35, import_node_path61, import_node_url10, bundleReferencedPathsCache;
|
159745
159893
|
var init_bundle_allowed_paths = __esm({
|
159746
159894
|
"src/api/startDevWorker/bundle-allowed-paths.ts"() {
|
159747
159895
|
init_import_meta_url();
|
159748
|
-
|
159896
|
+
import_node_assert28 = __toESM(require("assert"));
|
159749
159897
|
import_node_fs35 = __toESM(require("fs"));
|
159750
159898
|
import_node_path61 = __toESM(require("path"));
|
159751
159899
|
import_node_url10 = require("url");
|
@@ -178299,11 +178447,11 @@ function didMiniflareOptionsChange(prev, next) {
|
|
178299
178447
|
}
|
178300
178448
|
return !deepEquality(prev, next);
|
178301
178449
|
}
|
178302
|
-
var
|
178450
|
+
var import_node_assert29, import_node_crypto13, import_node_events4, import_node_path62, import_miniflare23, ProxyController, ProxyControllerLogger;
|
178303
178451
|
var init_ProxyController = __esm({
|
178304
178452
|
"src/api/startDevWorker/ProxyController.ts"() {
|
178305
178453
|
init_import_meta_url();
|
178306
|
-
|
178454
|
+
import_node_assert29 = __toESM(require("assert"));
|
178307
178455
|
import_node_crypto13 = require("crypto");
|
178308
178456
|
import_node_events4 = __toESM(require("events"));
|
178309
178457
|
import_node_path62 = __toESM(require("path"));
|
@@ -178336,7 +178484,7 @@ var init_ProxyController = __esm({
|
|
178336
178484
|
if (this._torndown) {
|
178337
178485
|
return;
|
178338
178486
|
}
|
178339
|
-
(0,
|
178487
|
+
(0, import_node_assert29.default)(this.latestConfig !== void 0);
|
178340
178488
|
const inVscodeJsDebugTerminal = !!process.env.VSCODE_INSPECTOR_OPTIONS;
|
178341
178489
|
const cert = this.latestConfig.dev?.server?.secure || this.latestConfig.dev.inspector !== false && this.latestConfig.dev?.inspector?.secure ? getHttpsOptions(
|
178342
178490
|
this.latestConfig.dev.server?.httpsKeyPath,
|
@@ -178460,7 +178608,7 @@ var init_ProxyController = __esm({
|
|
178460
178608
|
inspectorUrl
|
178461
178609
|
]);
|
178462
178610
|
}).then(([url4, inspectorUrl]) => {
|
178463
|
-
(0,
|
178611
|
+
(0, import_node_assert29.default)(url4);
|
178464
178612
|
this.emitReadyEvent(proxyWorker, url4, inspectorUrl);
|
178465
178613
|
}).catch((error2) => {
|
178466
178614
|
if (this._torndown) {
|
@@ -178477,7 +178625,7 @@ var init_ProxyController = __esm({
|
|
178477
178625
|
if (this._torndown) {
|
178478
178626
|
return;
|
178479
178627
|
}
|
178480
|
-
(0,
|
178628
|
+
(0, import_node_assert29.default)(
|
178481
178629
|
this.latestConfig?.dev.inspector !== false,
|
178482
178630
|
"Trying to reconnect with inspector proxy worker when inspector is disabled"
|
178483
178631
|
);
|
@@ -178488,7 +178636,7 @@ var init_ProxyController = __esm({
|
|
178488
178636
|
this.inspectorProxyWorkerWebSocket = createDeferred();
|
178489
178637
|
let webSocket = null;
|
178490
178638
|
try {
|
178491
|
-
(0,
|
178639
|
+
(0, import_node_assert29.default)(this.proxyWorker);
|
178492
178640
|
const inspectorProxyWorkerUrl = await this.proxyWorker.unsafeGetDirectURL(
|
178493
178641
|
"InspectorProxyWorker"
|
178494
178642
|
);
|
@@ -178507,12 +178655,12 @@ var init_ProxyController = __esm({
|
|
178507
178655
|
this.emitErrorEvent("Could not connect to InspectorProxyWorker", error2);
|
178508
178656
|
return;
|
178509
178657
|
}
|
178510
|
-
(0,
|
178658
|
+
(0, import_node_assert29.default)(
|
178511
178659
|
webSocket,
|
178512
178660
|
"Expected webSocket on response from inspectorProxyWorker"
|
178513
178661
|
);
|
178514
178662
|
webSocket.addEventListener("message", (event) => {
|
178515
|
-
(0,
|
178663
|
+
(0, import_node_assert29.default)(typeof event.data === "string");
|
178516
178664
|
this.onInspectorProxyWorkerMessage(JSON.parse(event.data));
|
178517
178665
|
});
|
178518
178666
|
webSocket.addEventListener("close", () => {
|
@@ -178567,13 +178715,13 @@ var init_ProxyController = __esm({
|
|
178567
178715
|
if (this._torndown) {
|
178568
178716
|
return;
|
178569
178717
|
}
|
178570
|
-
(0,
|
178718
|
+
(0, import_node_assert29.default)(
|
178571
178719
|
this.latestConfig?.dev.inspector !== false,
|
178572
178720
|
"Trying to send message to inspector proxy worker when inspector is disabled"
|
178573
178721
|
);
|
178574
178722
|
try {
|
178575
178723
|
const websocket = await this.reconnectInspectorProxyWorker();
|
178576
|
-
(0,
|
178724
|
+
(0, import_node_assert29.default)(websocket);
|
178577
178725
|
websocket.send(JSON.stringify(message));
|
178578
178726
|
} catch (cause) {
|
178579
178727
|
if (this._torndown) {
|
@@ -178641,7 +178789,7 @@ var init_ProxyController = __esm({
|
|
178641
178789
|
}
|
178642
178790
|
}
|
178643
178791
|
onInspectorProxyWorkerMessage(message) {
|
178644
|
-
(0,
|
178792
|
+
(0, import_node_assert29.default)(
|
178645
178793
|
this.latestConfig?.dev.inspector !== false,
|
178646
178794
|
"Trying to handle inspector message when inspector is disabled"
|
178647
178795
|
);
|
@@ -178667,7 +178815,7 @@ var init_ProxyController = __esm({
|
|
178667
178815
|
}
|
178668
178816
|
}
|
178669
178817
|
async onInspectorProxyWorkerRequest(message) {
|
178670
|
-
(0,
|
178818
|
+
(0, import_node_assert29.default)(
|
178671
178819
|
this.latestConfig?.dev.inspector !== false,
|
178672
178820
|
"Trying to handle inspector request when inspector is disabled"
|
178673
178821
|
);
|
@@ -178688,8 +178836,8 @@ var init_ProxyController = __esm({
|
|
178688
178836
|
logger.debug("[InspectorProxyWorker]", ...message.args);
|
178689
178837
|
break;
|
178690
178838
|
case "load-network-resource": {
|
178691
|
-
(0,
|
178692
|
-
(0,
|
178839
|
+
(0, import_node_assert29.default)(this.latestConfig !== void 0);
|
178840
|
+
(0, import_node_assert29.default)(this.latestBundle !== void 0);
|
178693
178841
|
let maybeContents;
|
178694
178842
|
if (message.url.startsWith("wrangler-file:")) {
|
178695
178843
|
maybeContents = maybeHandleNetworkLoadResource(
|
@@ -178954,7 +179102,7 @@ var init_create_worker_preview = __esm({
|
|
178954
179102
|
|
178955
179103
|
// src/dev/remote.ts
|
178956
179104
|
function handlePreviewSessionUploadError(err, accountId) {
|
178957
|
-
(0,
|
179105
|
+
(0, import_node_assert30.default)(err && typeof err === "object");
|
178958
179106
|
if (isAbortError(err)) {
|
178959
179107
|
if ("code" in err && err.code === 10049) {
|
178960
179108
|
logger.log("Preview token expired, fetching a new one");
|
@@ -178966,7 +179114,7 @@ function handlePreviewSessionUploadError(err, accountId) {
|
|
178966
179114
|
return false;
|
178967
179115
|
}
|
178968
179116
|
function handlePreviewSessionCreationError(err, accountId) {
|
178969
|
-
(0,
|
179117
|
+
(0, import_node_assert30.default)(err && typeof err === "object");
|
178970
179118
|
if ("code" in err && err.code === 10063) {
|
178971
179119
|
const errorMessage = "Error: You need to register a workers.dev subdomain before running the dev command in remote mode";
|
178972
179120
|
const solutionMessage = "You can either enable local mode by pressing l, or register a workers.dev subdomain here:";
|
@@ -179125,11 +179273,11 @@ ${onboardingLink}`);
|
|
179125
179273
|
}
|
179126
179274
|
}
|
179127
179275
|
}
|
179128
|
-
var
|
179276
|
+
var import_node_assert30, import_node_path63;
|
179129
179277
|
var init_remote = __esm({
|
179130
179278
|
"src/dev/remote.ts"() {
|
179131
179279
|
init_import_meta_url();
|
179132
|
-
|
179280
|
+
import_node_assert30 = __toESM(require("assert"));
|
179133
179281
|
import_node_path63 = __toESM(require("path"));
|
179134
179282
|
init_assets();
|
179135
179283
|
init_bundle_reporter();
|
@@ -179456,7 +179604,7 @@ function createWorkerObject(devEnv) {
|
|
179456
179604
|
return devEnv.proxy.ready.promise.then((ev) => ev.inspectorUrl);
|
179457
179605
|
},
|
179458
179606
|
get config() {
|
179459
|
-
(0,
|
179607
|
+
(0, import_node_assert31.default)(devEnv.config.latestConfig);
|
179460
179608
|
return devEnv.config.latestConfig;
|
179461
179609
|
},
|
179462
179610
|
async setConfig(config, throwErrors) {
|
@@ -179471,7 +179619,7 @@ function createWorkerObject(devEnv) {
|
|
179471
179619
|
return proxyWorker.dispatchFetch(...args);
|
179472
179620
|
},
|
179473
179621
|
async queue(...args) {
|
179474
|
-
(0,
|
179622
|
+
(0, import_node_assert31.default)(
|
179475
179623
|
this.config.name,
|
179476
179624
|
"Worker name must be defined to use `Worker.queue()`"
|
179477
179625
|
);
|
@@ -179480,7 +179628,7 @@ function createWorkerObject(devEnv) {
|
|
179480
179628
|
return w6.queue(...args);
|
179481
179629
|
},
|
179482
179630
|
async scheduled(...args) {
|
179483
|
-
(0,
|
179631
|
+
(0, import_node_assert31.default)(
|
179484
179632
|
this.config.name,
|
179485
179633
|
"Worker name must be defined to use `Worker.scheduled()`"
|
179486
179634
|
);
|
@@ -179494,11 +179642,11 @@ function createWorkerObject(devEnv) {
|
|
179494
179642
|
raw: devEnv
|
179495
179643
|
};
|
179496
179644
|
}
|
179497
|
-
var
|
179645
|
+
var import_node_assert31, import_node_events5, DevEnv;
|
179498
179646
|
var init_DevEnv = __esm({
|
179499
179647
|
"src/api/startDevWorker/DevEnv.ts"() {
|
179500
179648
|
init_import_meta_url();
|
179501
|
-
|
179649
|
+
import_node_assert31 = __toESM(require("assert"));
|
179502
179650
|
import_node_events5 = require("events");
|
179503
179651
|
init_logger();
|
179504
179652
|
init_parse();
|
@@ -179707,7 +179855,7 @@ async function maybeStartOrUpdateRemoteProxySession(wranglerOrWorkerConfigObject
|
|
179707
179855
|
config: wranglerConfigObject.path,
|
179708
179856
|
env: wranglerConfigObject.environment
|
179709
179857
|
});
|
179710
|
-
(0,
|
179858
|
+
(0, import_node_assert32.default)(config.name);
|
179711
179859
|
wranglerOrWorkerConfigObject = {
|
179712
179860
|
name: config.name,
|
179713
179861
|
complianceRegion: getCloudflareComplianceRegion(config),
|
@@ -179774,17 +179922,17 @@ function getAuthHook(auth, config) {
|
|
179774
179922
|
}
|
179775
179923
|
function deepStrictEqual(source, target) {
|
179776
179924
|
try {
|
179777
|
-
|
179925
|
+
import_node_assert32.default.deepStrictEqual(source, target);
|
179778
179926
|
return true;
|
179779
179927
|
} catch {
|
179780
179928
|
return false;
|
179781
179929
|
}
|
179782
179930
|
}
|
179783
|
-
var
|
179931
|
+
var import_node_assert32, import_node_path64;
|
179784
179932
|
var init_remoteBindings = __esm({
|
179785
179933
|
"src/api/remoteBindings/index.ts"() {
|
179786
179934
|
init_import_meta_url();
|
179787
|
-
|
179935
|
+
import_node_assert32 = __toESM(require("assert"));
|
179788
179936
|
import_node_path64 = __toESM(require("path"));
|
179789
179937
|
init_get_port();
|
179790
179938
|
init_config2();
|
@@ -179937,11 +180085,11 @@ async function getContainerDevOptions(containersConfig, containerBuildId) {
|
|
179937
180085
|
}
|
179938
180086
|
return containers2;
|
179939
180087
|
}
|
179940
|
-
var
|
180088
|
+
var import_node_assert33, import_node_crypto15, import_promises36, import_miniflare26, LocalRuntimeController;
|
179941
180089
|
var init_LocalRuntimeController = __esm({
|
179942
180090
|
"src/api/startDevWorker/LocalRuntimeController.ts"() {
|
179943
180091
|
init_import_meta_url();
|
179944
|
-
|
180092
|
+
import_node_assert33 = __toESM(require("assert"));
|
179945
180093
|
import_node_crypto15 = require("crypto");
|
179946
180094
|
import_promises36 = require("fs/promises");
|
179947
180095
|
init_containers_shared();
|
@@ -180017,7 +180165,7 @@ var init_LocalRuntimeController = __esm({
|
|
180017
180165
|
}
|
180018
180166
|
if (data.config.containers?.length && data.config.dev.enableContainers && this.#currentContainerBuildId !== data.config.dev.containerBuildId) {
|
180019
180167
|
this.dockerPath = data.config.dev?.dockerPath ?? getDockerPath();
|
180020
|
-
(0,
|
180168
|
+
(0, import_node_assert33.default)(
|
180021
180169
|
data.config.dev.containerBuildId,
|
180022
180170
|
"Build ID should be set if containers are enabled and defined"
|
180023
180171
|
);
|
@@ -180026,6 +180174,15 @@ var init_LocalRuntimeController = __esm({
|
|
180026
180174
|
data.config.dev.containerBuildId
|
180027
180175
|
);
|
180028
180176
|
for (const container of containerDevOptions) {
|
180177
|
+
if (this.#currentContainerBuildId !== void 0) {
|
180178
|
+
runDockerCmdWithOutput(this.dockerPath, [
|
180179
|
+
"rmi",
|
180180
|
+
getDevContainerImageName(
|
180181
|
+
container.class_name,
|
180182
|
+
this.#currentContainerBuildId
|
180183
|
+
)
|
180184
|
+
]);
|
180185
|
+
}
|
180029
180186
|
this.containerImageTagsSeen.add(container.image_tag);
|
180030
180187
|
}
|
180031
180188
|
logger.log(source_default.dim("\u2394 Preparing container image(s)..."));
|
@@ -180139,7 +180296,7 @@ var init_LocalRuntimeController = __esm({
|
|
180139
180296
|
if (!this.containerImageTagsSeen.size) {
|
180140
180297
|
return;
|
180141
180298
|
}
|
180142
|
-
(0,
|
180299
|
+
(0, import_node_assert33.default)(
|
180143
180300
|
this.dockerPath,
|
180144
180301
|
"Docker path should have been set if containers are enabled"
|
180145
180302
|
);
|
@@ -180199,11 +180356,11 @@ function ensureMatchingSql(options) {
|
|
180199
180356
|
}
|
180200
180357
|
return options;
|
180201
180358
|
}
|
180202
|
-
var
|
180359
|
+
var import_node_assert34, import_node_crypto16, import_miniflare27, MultiworkerRuntimeController;
|
180203
180360
|
var init_MultiworkerRuntimeController = __esm({
|
180204
180361
|
"src/api/startDevWorker/MultiworkerRuntimeController.ts"() {
|
180205
180362
|
init_import_meta_url();
|
180206
|
-
|
180363
|
+
import_node_assert34 = __toESM(require("assert"));
|
180207
180364
|
import_node_crypto16 = require("crypto");
|
180208
180365
|
init_containers_shared();
|
180209
180366
|
init_source();
|
@@ -180247,7 +180404,7 @@ var init_MultiworkerRuntimeController = __esm({
|
|
180247
180404
|
}
|
180248
180405
|
#mergedMfOptions() {
|
180249
180406
|
const primary = [...this.#options.values()].find((o5) => o5.primary);
|
180250
|
-
(0,
|
180407
|
+
(0, import_node_assert34.default)(primary !== void 0);
|
180251
180408
|
const secondary = [...this.#options.values()].filter((o5) => !o5.primary);
|
180252
180409
|
return {
|
180253
180410
|
...primary.options,
|
@@ -180283,7 +180440,7 @@ var init_MultiworkerRuntimeController = __esm({
|
|
180283
180440
|
}
|
180284
180441
|
if (data.config.containers?.length && this.#currentContainerBuildId !== data.config.dev.containerBuildId) {
|
180285
180442
|
logger.log(source_default.dim("\u2394 Preparing container image(s)..."));
|
180286
|
-
(0,
|
180443
|
+
(0, import_node_assert34.default)(
|
180287
180444
|
data.config.dev.containerBuildId,
|
180288
180445
|
"Build ID should be set if containers are enabled and defined"
|
180289
180446
|
);
|
@@ -183128,11 +183285,11 @@ async function generateAssetsFetch(directory, log2) {
|
|
183128
183285
|
return await generateResponse(request4);
|
183129
183286
|
};
|
183130
183287
|
}
|
183131
|
-
var
|
183288
|
+
var import_node_assert35, import_node_fs37, import_node_path67, import_mime3, import_miniflare29, import_undici24, ProxyDispatcher, invalidAssetsFetch;
|
183132
183289
|
var init_assets2 = __esm({
|
183133
183290
|
"src/miniflare-cli/assets.ts"() {
|
183134
183291
|
init_import_meta_url();
|
183135
|
-
|
183292
|
+
import_node_assert35 = __toESM(require("assert"));
|
183136
183293
|
import_node_fs37 = require("fs");
|
183137
183294
|
import_node_path67 = require("path");
|
183138
183295
|
init_createMetadataObject();
|
@@ -183170,12 +183327,12 @@ var init_assets2 = __esm({
|
|
183170
183327
|
* by the `fetch()` function before calling `dispatcher.dispatch()`.
|
183171
183328
|
*/
|
183172
183329
|
static reinstateHostHeader(headers, host) {
|
183173
|
-
(0,
|
183174
|
-
(0,
|
183330
|
+
(0, import_node_assert35.default)(headers, "Expected all proxy requests to contain headers.");
|
183331
|
+
(0, import_node_assert35.default)(
|
183175
183332
|
!Array.isArray(headers),
|
183176
183333
|
"Expected proxy request headers to be a hash object"
|
183177
183334
|
);
|
183178
|
-
(0,
|
183335
|
+
(0, import_node_assert35.default)(
|
183179
183336
|
Object.keys(headers).every((h6) => h6.toLowerCase() !== "host"),
|
183180
183337
|
"Expected Host header to have been deleted."
|
183181
183338
|
);
|
@@ -183376,7 +183533,7 @@ async function startDev(args) {
|
|
183376
183533
|
unregisterHotKeys?.();
|
183377
183534
|
accountId = await requireAuth(config);
|
183378
183535
|
if (hotkeysDisplayed) {
|
183379
|
-
(0,
|
183536
|
+
(0, import_node_assert36.default)(devEnv !== void 0);
|
183380
183537
|
unregisterHotKeys = registerDevHotKeys(
|
183381
183538
|
Array.isArray(devEnv) ? devEnv : [devEnv],
|
183382
183539
|
args
|
@@ -183448,7 +183605,7 @@ async function startDev(args) {
|
|
183448
183605
|
});
|
183449
183606
|
if (!args.disableDevRegistry) {
|
183450
183607
|
teardownRegistryPromise = devRegistry2((registry) => {
|
183451
|
-
(0,
|
183608
|
+
(0, import_node_assert36.default)(devEnv !== void 0 && !Array.isArray(devEnv));
|
183452
183609
|
void updateDevEnvRegistry(devEnv, registry);
|
183453
183610
|
});
|
183454
183611
|
devEnv.runtimes.forEach((runtime) => {
|
@@ -183456,7 +183613,7 @@ async function startDev(args) {
|
|
183456
183613
|
"reloadComplete",
|
183457
183614
|
async (reloadEvent) => {
|
183458
183615
|
if (!reloadEvent.config.dev?.remote) {
|
183459
|
-
(0,
|
183616
|
+
(0, import_node_assert36.default)(devEnv !== void 0 && !Array.isArray(devEnv));
|
183460
183617
|
const { url: url4 } = await devEnv.proxy.ready.promise;
|
183461
183618
|
await maybeRegisterLocalWorker(
|
183462
183619
|
url4,
|
@@ -183487,7 +183644,7 @@ async function startDev(args) {
|
|
183487
183644
|
...Array.isArray(devEnv) ? devEnv.map((d6) => d6.teardown()) : [devEnv?.teardown()],
|
183488
183645
|
(async () => {
|
183489
183646
|
if (teardownRegistryPromise) {
|
183490
|
-
(0,
|
183647
|
+
(0, import_node_assert36.default)(devEnv === void 0 || !Array.isArray(devEnv));
|
183491
183648
|
const teardownRegistry = await teardownRegistryPromise;
|
183492
183649
|
await teardownRegistry(devEnv?.config.latestConfig?.name);
|
183493
183650
|
}
|
@@ -183735,11 +183892,11 @@ function getAssetChangeMessage(eventName, assetPath) {
|
|
183735
183892
|
}
|
183736
183893
|
return message;
|
183737
183894
|
}
|
183738
|
-
var
|
183895
|
+
var import_node_assert36, import_node_events6, import_node_path68, import_node_util3, import_env2, dev;
|
183739
183896
|
var init_dev2 = __esm({
|
183740
183897
|
"src/dev.ts"() {
|
183741
183898
|
init_import_meta_url();
|
183742
|
-
|
183899
|
+
import_node_assert36 = __toESM(require("assert"));
|
183743
183900
|
import_node_events6 = __toESM(require("events"));
|
183744
183901
|
import_node_path68 = __toESM(require("path"));
|
183745
183902
|
import_node_util3 = __toESM(require("util"));
|
@@ -184020,7 +184177,7 @@ var init_dev2 = __esm({
|
|
184020
184177
|
},
|
184021
184178
|
async handler(args) {
|
184022
184179
|
const devInstance = await startDev(args);
|
184023
|
-
(0,
|
184180
|
+
(0, import_node_assert36.default)(devInstance.devEnv !== void 0);
|
184024
184181
|
await import_node_events6.default.once(devInstance.devEnv, "teardown");
|
184025
184182
|
await Promise.all(devInstance.secondary.map((d6) => d6.teardown()));
|
184026
184183
|
if (devInstance.teardownRegistryPromise) {
|