wrangler 4.33.1 → 4.33.2
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/package.json +9 -9
- package/wrangler-dist/cli.js +448 -431
- 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 assert43 = 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
|
+
assert43(!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
|
+
assert43(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
|
+
assert43(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
|
+
assert43(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
|
+
assert43(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 assert43 = 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
|
+
assert43(!this.aborted);
|
3744
|
+
assert43(!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
|
+
assert43(!this.aborted);
|
3757
|
+
assert43(!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
|
+
assert43(!this.aborted);
|
3769
|
+
assert43(!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
|
+
assert43(!this.aborted);
|
3782
|
+
assert43(!this.completed);
|
3783
3783
|
return this[kHandler].onUpgrade(statusCode, headers, socket);
|
3784
3784
|
}
|
3785
3785
|
onComplete(trailers) {
|
3786
3786
|
this.onFinally();
|
3787
|
-
|
3788
|
-
|
3787
|
+
assert43(!this.aborted);
|
3788
|
+
assert43(!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 assert43 = require("assert");
|
4259
4259
|
var util3 = 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 || util3.getServerName(host) || null;
|
4306
4306
|
const sessionKey = servername || hostname2;
|
4307
|
-
|
4307
|
+
assert43(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
|
+
assert43(!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 assert43 = 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
|
+
assert43(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
|
+
assert43(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
|
+
assert43(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
|
+
assert43(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 assert43 = 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
|
+
assert43(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
|
+
assert43(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
|
+
assert43(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
|
+
assert43(!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
|
+
assert43("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
|
+
assert43("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
|
+
assert43(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 assert43 = 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
|
+
assert43(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
|
+
assert43(webidl.is.USVString(name2));
|
7357
|
+
assert43(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
|
+
assert43(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 assert43 = 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
|
+
assert43(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
|
+
assert43(!util3.isDisturbed(object), "The body has already been consumed.");
|
7717
|
+
assert43(!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 assert43 = require("assert");
|
7864
7864
|
var util3 = 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
|
+
assert43(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
|
+
assert43(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
|
+
assert43(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
|
+
assert43(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
|
+
assert43(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
|
+
assert43(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
|
+
assert43(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
|
+
assert43(this.ptr != null);
|
8083
|
+
assert43(currentParser === null);
|
8084
8084
|
this.llhttp.llhttp_resume(this.ptr);
|
8085
|
-
|
8085
|
+
assert43(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
|
+
assert43(currentParser === null);
|
8109
|
+
assert43(this.ptr != null);
|
8110
|
+
assert43(!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
|
+
assert43(currentParser === null);
|
8155
|
+
assert43(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
|
+
assert43(upgrade);
|
8242
|
+
assert43(client[kSocket] === socket);
|
8243
|
+
assert43(!socket.destroyed);
|
8244
|
+
assert43(!this.paused);
|
8245
|
+
assert43((headers.length & 1) === 0);
|
8246
8246
|
const request4 = client[kQueue][client[kRunningIdx]];
|
8247
|
-
|
8248
|
-
|
8247
|
+
assert43(request4);
|
8248
|
+
assert43(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
|
+
assert43(!this.upgrade);
|
8287
|
+
assert43(this.statusCode < 200);
|
8288
8288
|
if (statusCode === 100) {
|
8289
8289
|
util3.destroy(socket, new SocketError("bad response", util3.getSocketInfo(socket)));
|
8290
8290
|
return -1;
|
@@ -8293,7 +8293,7 @@ var require_client_h1 = __commonJS({
|
|
8293
8293
|
util3.destroy(socket, new SocketError("bad upgrade", util3.getSocketInfo(socket)));
|
8294
8294
|
return -1;
|
8295
8295
|
}
|
8296
|
-
|
8296
|
+
assert43(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
|
+
assert43(client[kRunning] === 1);
|
8310
8310
|
this.upgrade = true;
|
8311
8311
|
return 2;
|
8312
8312
|
}
|
8313
8313
|
if (upgrade) {
|
8314
|
-
|
8314
|
+
assert43(client[kRunning] === 1);
|
8315
8315
|
this.upgrade = true;
|
8316
8316
|
return 2;
|
8317
8317
|
}
|
8318
|
-
|
8318
|
+
assert43((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
|
+
assert43(request4);
|
8366
|
+
assert43(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
|
+
assert43(statusCode >= 200);
|
8373
8373
|
if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
|
8374
8374
|
util3.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
|
+
assert43(statusCode >= 100);
|
8395
|
+
assert43((this.headers.length & 1) === 0);
|
8396
8396
|
const request4 = client[kQueue][client[kRunningIdx]];
|
8397
|
-
|
8397
|
+
assert43(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
|
+
assert43(client[kRunning] === 0);
|
8417
8417
|
util3.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
|
+
assert43(!paused, "cannot be paused while waiting for headers");
|
8438
8438
|
util3.destroy(socket, new HeadersTimeoutError());
|
8439
8439
|
}
|
8440
8440
|
} else if (timeoutType === TIMEOUT_BODY) {
|
@@ -8442,7 +8442,7 @@ var require_client_h1 = __commonJS({
|
|
8442
8442
|
util3.destroy(socket, new BodyTimeoutError());
|
8443
8443
|
}
|
8444
8444
|
} else if (timeoutType === TIMEOUT_KEEP_ALIVE) {
|
8445
|
-
|
8445
|
+
assert43(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]);
|
8446
8446
|
util3.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
|
+
assert43(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
|
+
assert43(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
|
util3.errorRequest(client, request4, err);
|
8576
8576
|
}
|
8577
8577
|
client[kPendingIdx] = client[kRunningIdx];
|
8578
|
-
|
8578
|
+
assert43(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 (util3.isIterable(body)) {
|
8732
8732
|
writeIterable(abort, body, client, request4, socket, contentLength, header, expectsPayload);
|
8733
8733
|
} else {
|
8734
|
-
|
8734
|
+
assert43(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
|
+
assert43(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
|
+
assert43(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
|
+
assert43(contentLength === null, "no body must not have content length");
|
8818
8818
|
socket.write(`${header}\r
|
8819
8819
|
`, "latin1");
|
8820
8820
|
}
|
8821
8821
|
} else if (util3.isBuffer(body)) {
|
8822
|
-
|
8822
|
+
assert43(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
|
+
assert43(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
|
+
assert43(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
|
+
assert43(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
|
+
assert43(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 assert43 = require("assert");
|
9045
9045
|
var { pipeline } = require("stream");
|
9046
9046
|
var util3 = 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
|
+
assert43(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
|
util3.errorRequest(client, request4, err);
|
9205
9205
|
client[kPendingIdx] = client[kRunningIdx];
|
9206
9206
|
}
|
9207
|
-
|
9207
|
+
assert43(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
|
+
assert43(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
|
+
assert43(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
|
+
assert43(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
|
+
assert43(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
|
+
assert43(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 && util3.isBuffer(body)) {
|
9537
|
-
|
9537
|
+
assert43(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
|
+
assert43(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
|
+
assert43(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
|
+
assert43(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
|
+
assert43(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 assert43 = require("assert");
|
9656
9656
|
var net2 = require("net");
|
9657
9657
|
var http5 = require("http");
|
9658
9658
|
var util3 = 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
|
+
assert43(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
|
util3.errorRequest(client, request4, err);
|
9950
9950
|
}
|
9951
|
-
|
9951
|
+
assert43(client[kSize] === 0);
|
9952
9952
|
}
|
9953
9953
|
}
|
9954
9954
|
__name(onError, "onError");
|
9955
9955
|
async function connect(client) {
|
9956
|
-
|
9957
|
-
|
9956
|
+
assert43(!client[kConnecting]);
|
9957
|
+
assert43(!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
|
+
assert43(idx !== -1);
|
9962
9962
|
const ip = hostname2.substring(1, idx);
|
9963
|
-
|
9963
|
+
assert43(net2.isIPv6(ip));
|
9964
9964
|
hostname2 = ip;
|
9965
9965
|
}
|
9966
9966
|
client[kConnecting] = true;
|
@@ -9999,7 +9999,7 @@ var require_client = __commonJS({
|
|
9999
9999
|
util3.destroy(socket.on("error", noop), new ClientDestroyedError());
|
10000
10000
|
return;
|
10001
10001
|
}
|
10002
|
-
|
10002
|
+
assert43(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
|
+
assert43(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
|
util3.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
|
+
assert43(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 assert43 = 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
|
+
assert43(this.start === start, "content-range mismatch");
|
11334
|
+
assert43(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
|
+
assert43(
|
11352
11352
|
start != null && Number.isFinite(start),
|
11353
11353
|
"content-range mismatch"
|
11354
11354
|
);
|
11355
|
-
|
11355
|
+
assert43(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
|
+
assert43(Number.isFinite(this.start));
|
11364
|
+
assert43(
|
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 assert43 = require("assert");
|
11601
11601
|
var { Readable: Readable8 } = require("stream");
|
11602
11602
|
var { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError: AbortError2 } = require_errors();
|
11603
11603
|
var util3 = 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
|
+
assert43(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
|
+
assert43(!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 assert43 = 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
|
+
assert43(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 assert43 = 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
|
+
assert43(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 assert43 = 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
|
+
assert43(!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 assert43 = require("assert");
|
12629
12629
|
var util3 = 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
|
+
assert43(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
|
+
assert43(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 assert43 = require("assert");
|
12725
12725
|
var { AsyncResource } = require("async_hooks");
|
12726
12726
|
var { InvalidArgumentError, SocketError } = require_errors();
|
12727
12727
|
var util3 = require_util();
|
@@ -12753,7 +12753,7 @@ var require_api_connect = __commonJS({
|
|
12753
12753
|
abort(this.reason);
|
12754
12754
|
return;
|
12755
12755
|
}
|
12756
|
-
|
12756
|
+
assert43(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 assert43 = 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
|
+
assert43(!this.#onCompleteCalled);
|
14054
|
+
assert43(!this.#onErrorCalled);
|
14055
14055
|
return this.#handler.onRequestUpgrade?.(...args);
|
14056
14056
|
}
|
14057
14057
|
onResponseStart(...args) {
|
14058
|
-
|
14059
|
-
|
14060
|
-
|
14058
|
+
assert43(!this.#onCompleteCalled);
|
14059
|
+
assert43(!this.#onErrorCalled);
|
14060
|
+
assert43(!this.#onResponseStartCalled);
|
14061
14061
|
this.#onResponseStartCalled = true;
|
14062
14062
|
return this.#handler.onResponseStart?.(...args);
|
14063
14063
|
}
|
14064
14064
|
onResponseData(...args) {
|
14065
|
-
|
14066
|
-
|
14065
|
+
assert43(!this.#onCompleteCalled);
|
14066
|
+
assert43(!this.#onErrorCalled);
|
14067
14067
|
return this.#handler.onResponseData?.(...args);
|
14068
14068
|
}
|
14069
14069
|
onResponseEnd(...args) {
|
14070
|
-
|
14071
|
-
|
14070
|
+
assert43(!this.#onCompleteCalled);
|
14071
|
+
assert43(!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 util3 = require_util();
|
14094
14094
|
var { kBodyUsed } = require_symbols();
|
14095
|
-
var
|
14095
|
+
var assert43 = 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
|
+
assert43(!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 (util3.isStream(this.opts.body)) {
|
14138
14138
|
if (util3.bodyLength(this.opts.body) === 0) {
|
14139
14139
|
this.opts.body.on("data", function() {
|
14140
|
-
|
14140
|
+
assert43(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
|
+
assert43(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 assert43 = 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
|
+
assert43(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 assert43 = require("assert");
|
15859
15859
|
var { Readable: Readable8 } = require("stream");
|
15860
15860
|
var util3 = 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 = util3.isStream(result.body) ? result.body : Readable8.from(result.body ?? []);
|
15923
|
-
|
15924
|
-
|
15923
|
+
assert43(!stream2.destroyed, "stream should not be destroyed");
|
15924
|
+
assert43(!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 assert43 = require("assert");
|
16484
16484
|
var util3 = 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
|
+
assert43(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
|
+
assert43(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
|
+
assert43(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 assert43 = require("assert");
|
16971
16971
|
var { types: types3 } = 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
|
+
assert43(!(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
|
+
assert43(false);
|
17267
17267
|
}
|
17268
17268
|
}
|
17269
17269
|
__name(filterResponse, "filterResponse");
|
17270
17270
|
function makeAppropriateNetworkError(fetchParams, err = null) {
|
17271
|
-
|
17271
|
+
assert43(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 assert43 = 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
|
+
assert43(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 assert43 = 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
|
+
assert43(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
|
+
assert43(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
|
+
assert43(!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
|
+
assert43(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
|
+
assert43(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
|
+
assert43(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
|
+
assert43(!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 assert43 = 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
|
+
assert43(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 assert43 = 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
|
+
assert43(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
|
+
assert43(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
|
+
assert43(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 assert43 = 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
|
+
assert43(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 assert43 = 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
|
+
assert43(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 assert43 = 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
|
+
assert43(data.length !== 1);
|
21520
21520
|
let code;
|
21521
21521
|
if (data.length >= 2) {
|
21522
21522
|
code = data.readUInt16BE(0);
|
@@ -33027,7 +33027,7 @@ var require_signal_exit = __commonJS({
|
|
33027
33027
|
};
|
33028
33028
|
};
|
33029
33029
|
} else {
|
33030
|
-
|
33030
|
+
assert43 = require("assert");
|
33031
33031
|
signals = require_signals();
|
33032
33032
|
isWin = /^win/i.test(process11.platform);
|
33033
33033
|
EE = require("events");
|
@@ -33050,7 +33050,7 @@ var require_signal_exit = __commonJS({
|
|
33050
33050
|
return function() {
|
33051
33051
|
};
|
33052
33052
|
}
|
33053
|
-
|
33053
|
+
assert43.equal(typeof cb2, "function", "a callback must be provided for exit handler");
|
33054
33054
|
if (loaded === false) {
|
33055
33055
|
load();
|
33056
33056
|
}
|
@@ -33156,7 +33156,7 @@ var require_signal_exit = __commonJS({
|
|
33156
33156
|
}
|
33157
33157
|
}, "processEmit");
|
33158
33158
|
}
|
33159
|
-
var
|
33159
|
+
var assert43;
|
33160
33160
|
var signals;
|
33161
33161
|
var isWin;
|
33162
33162
|
var EE;
|
@@ -33841,7 +33841,7 @@ var name, version;
|
|
33841
33841
|
var init_package = __esm({
|
33842
33842
|
"package.json"() {
|
33843
33843
|
name = "wrangler";
|
33844
|
-
version = "4.33.
|
33844
|
+
version = "4.33.2";
|
33845
33845
|
}
|
33846
33846
|
});
|
33847
33847
|
|
@@ -49401,12 +49401,15 @@ function listScopes(message = "\u{1F481} Available scopes:") {
|
|
49401
49401
|
logger.log(message);
|
49402
49402
|
printScopes(DefaultScopeKeys);
|
49403
49403
|
}
|
49404
|
-
async function getAccountId(
|
49404
|
+
async function getAccountId(config) {
|
49405
|
+
if (config.account_id) {
|
49406
|
+
return config.account_id;
|
49407
|
+
}
|
49405
49408
|
const cachedAccount2 = getAccountFromCache();
|
49406
49409
|
if (cachedAccount2 && !getCloudflareAccountIdFromEnv()) {
|
49407
49410
|
return cachedAccount2.id;
|
49408
49411
|
}
|
49409
|
-
const accounts = await getAccountChoices(
|
49412
|
+
const accounts = await getAccountChoices(config);
|
49410
49413
|
if (accounts.length === 1) {
|
49411
49414
|
saveAccountToCache({ id: accounts[0].id, name: accounts[0].name });
|
49412
49415
|
return accounts[0].id;
|
@@ -49446,7 +49449,7 @@ async function requireAuth(config) {
|
|
49446
49449
|
throw new UserError("Did not login, quitting...");
|
49447
49450
|
}
|
49448
49451
|
}
|
49449
|
-
const accountId =
|
49452
|
+
const accountId = await getAccountId(config);
|
49450
49453
|
if (!accountId) {
|
49451
49454
|
throw new UserError("No account id found, quitting...");
|
49452
49455
|
}
|
@@ -67353,7 +67356,7 @@ async function buildCommand(args) {
|
|
67353
67356
|
async function pushCommand(args, config) {
|
67354
67357
|
try {
|
67355
67358
|
await dockerLoginManagedRegistry(args.pathToDocker);
|
67356
|
-
const accountId =
|
67359
|
+
const accountId = await getAccountId(config);
|
67357
67360
|
const newTag = getCloudflareRegistryWithAccountNamespace(
|
67358
67361
|
accountId,
|
67359
67362
|
args.TAG
|
@@ -68483,7 +68486,7 @@ async function handleDeleteImageCommand(args, config) {
|
|
68483
68486
|
}
|
68484
68487
|
const digest = await promiseSpinner(
|
68485
68488
|
getCreds().then(async (creds) => {
|
68486
|
-
const accountId =
|
68489
|
+
const accountId = await getAccountId(config);
|
68487
68490
|
const url4 = new URL(`https://${getCloudflareContainerRegistry()}`);
|
68488
68491
|
const baseUrl = `${url4.protocol}//${url4.host}`;
|
68489
68492
|
const [image, tag] = args.image.split(":");
|
@@ -68512,7 +68515,7 @@ async function handleListImagesCommand(args, config) {
|
|
68512
68515
|
getCreds().then(async (creds) => {
|
68513
68516
|
const repos = await listReposWithTags(creds);
|
68514
68517
|
const processed = [];
|
68515
|
-
const accountId =
|
68518
|
+
const accountId = await getAccountId(config);
|
68516
68519
|
const accountIdPrefix = new RegExp(`^${accountId}/`);
|
68517
68520
|
const filter = new RegExp(args.filter ?? "");
|
68518
68521
|
for (const [repo, tags] of Object.entries(repos)) {
|
@@ -69081,13 +69084,76 @@ var init_diff = __esm({
|
|
69081
69084
|
editLength++;
|
69082
69085
|
}
|
69083
69086
|
}
|
69087
|
+
/**
|
69088
|
+
* Results but refined to be printed/stringified.
|
69089
|
+
*
|
69090
|
+
* In particular the results returned here are ordered to try to avoid cases
|
69091
|
+
* in which an addition/removal is incorrectly split.
|
69092
|
+
*
|
69093
|
+
* For example, the standard results can produce something like:
|
69094
|
+
* ```
|
69095
|
+
* ...
|
69096
|
+
* - "vars": {
|
69097
|
+
* + "vars": {},
|
69098
|
+
* - "MY_VAR": "variable set in the dash"
|
69099
|
+
* - },
|
69100
|
+
* ...
|
69101
|
+
* ```
|
69102
|
+
* (notice how the first removal is separated from the last two,
|
69103
|
+
* making the diff much less readable).
|
69104
|
+
* Such change in the refined results will instead look like:
|
69105
|
+
* ```
|
69106
|
+
* ...
|
69107
|
+
* + "vars": {},
|
69108
|
+
* - "vars": {
|
69109
|
+
* - "MY_VAR": "variable set in the dash"
|
69110
|
+
* - },
|
69111
|
+
* ...
|
69112
|
+
* ```
|
69113
|
+
*/
|
69114
|
+
get #resultsForPrint() {
|
69115
|
+
const results = [
|
69116
|
+
...this.#results.filter((r7) => !!r7.value && r7.value !== "\n")
|
69117
|
+
];
|
69118
|
+
const swapLines = /* @__PURE__ */ __name((i5, j6) => {
|
69119
|
+
const tmp = results[i5];
|
69120
|
+
results[i5] = results[j6];
|
69121
|
+
results[j6] = tmp;
|
69122
|
+
}, "swapLines");
|
69123
|
+
const numOfLines = /* @__PURE__ */ __name((str) => str.split("\n").length, "numOfLines");
|
69124
|
+
const isLoneResult = /* @__PURE__ */ __name((index, target) => {
|
69125
|
+
const currentIdx = index;
|
69126
|
+
const adjacentIdx = currentIdx + target;
|
69127
|
+
const nextIdx = currentIdx + target + target;
|
69128
|
+
if (!results[adjacentIdx] || !results[nextIdx] || !results[nextIdx]) {
|
69129
|
+
return false;
|
69130
|
+
}
|
69131
|
+
const previousIdx = index - target;
|
69132
|
+
const isAlternation = /* @__PURE__ */ __name((type) => results[currentIdx][type] === true && results[previousIdx]?.[type] !== results[currentIdx][type] && results[adjacentIdx][type === "added" ? "removed" : "added"] === true && results[nextIdx][type] === true, "isAlternation");
|
69133
|
+
if (!isAlternation("added") && !isAlternation("removed")) {
|
69134
|
+
return false;
|
69135
|
+
}
|
69136
|
+
return numOfLines(results[currentIdx].value ?? "") === 1 && numOfLines(results[adjacentIdx].value ?? "") === 1 && numOfLines(results[nextIdx].value ?? "") > 1;
|
69137
|
+
}, "isLoneResult");
|
69138
|
+
for (let i5 = 0; i5 < results.length; i5++) {
|
69139
|
+
if (isLoneResult(i5, 1)) {
|
69140
|
+
swapLines(i5, i5 + 1);
|
69141
|
+
continue;
|
69142
|
+
}
|
69143
|
+
if (isLoneResult(i5, -1)) {
|
69144
|
+
swapLines(i5, i5 - 1);
|
69145
|
+
continue;
|
69146
|
+
}
|
69147
|
+
}
|
69148
|
+
return results;
|
69149
|
+
}
|
69084
69150
|
toString(options = {
|
69085
69151
|
contextLines: 3
|
69086
69152
|
}) {
|
69087
69153
|
let output = "";
|
69088
69154
|
let state2 = "init";
|
69089
69155
|
const context2 = [];
|
69090
|
-
for (const result of this.#
|
69156
|
+
for (const result of this.#resultsForPrint) {
|
69091
69157
|
if (result.value === void 0) {
|
69092
69158
|
continue;
|
69093
69159
|
}
|
@@ -69461,6 +69527,8 @@ function formatError(err) {
|
|
69461
69527
|
const maybeError = JSON.parse(err.body.error);
|
69462
69528
|
if (maybeError.error !== void 0 && maybeError.details !== void 0 && typeof maybeError.details === "object") {
|
69463
69529
|
let message = "";
|
69530
|
+
message += `${maybeError.error}
|
69531
|
+
`;
|
69464
69532
|
for (const key in maybeError.details) {
|
69465
69533
|
message += `${brandColor(key)} ${maybeError.details[key]}
|
69466
69534
|
`;
|
@@ -69925,11 +69993,10 @@ var init_config3 = __esm({
|
|
69925
69993
|
image_vars: container.image_vars
|
69926
69994
|
});
|
69927
69995
|
} else {
|
69928
|
-
const accountId = await getAccountId(config);
|
69929
69996
|
normalizedContainers.push({
|
69930
69997
|
...shared,
|
69931
69998
|
...instanceTypeOrLimits,
|
69932
|
-
image_uri: resolveImageName(
|
69999
|
+
image_uri: args.dryRun ? container.image : resolveImageName(await getAccountId(config), container.image)
|
69933
70000
|
// if it is not a dockerfile, it must be an image uri or have thrown an error
|
69934
70001
|
});
|
69935
70002
|
}
|
@@ -73963,6 +74030,10 @@ var init_zones = __esm({
|
|
73963
74030
|
});
|
73964
74031
|
|
73965
74032
|
// src/triggers/deploy.ts
|
74033
|
+
function getResolvedWorkersDev(configWorkersDev, routes) {
|
74034
|
+
const resolvedWorkersDev = configWorkersDev ?? routes.length === 0;
|
74035
|
+
return resolvedWorkersDev;
|
74036
|
+
}
|
73966
74037
|
async function triggersDeploy(props) {
|
73967
74038
|
const { config, accountId, name: scriptName } = props;
|
73968
74039
|
const schedules = props.triggers || config.triggers?.crons;
|
@@ -73977,7 +74048,7 @@ async function triggersDeploy(props) {
|
|
73977
74048
|
routesOnly.push(route);
|
73978
74049
|
}
|
73979
74050
|
}
|
73980
|
-
const deployToWorkersDev = config.workers_dev
|
74051
|
+
const deployToWorkersDev = getResolvedWorkersDev(config.workers_dev, routes);
|
73981
74052
|
if (!scriptName) {
|
73982
74053
|
throw new UserError(
|
73983
74054
|
'You need to provide a name when uploading a Worker Version. Either pass it as a cli arg with `--name <name>` or in your config file as `name = "<name>"`',
|
@@ -74195,6 +74266,7 @@ var init_deploy3 = __esm({
|
|
74195
74266
|
init_routes();
|
74196
74267
|
init_retry();
|
74197
74268
|
init_zones();
|
74269
|
+
__name(getResolvedWorkersDev, "getResolvedWorkersDev");
|
74198
74270
|
__name(triggersDeploy, "triggersDeploy");
|
74199
74271
|
}
|
74200
74272
|
});
|
@@ -82096,7 +82168,7 @@ async function apply2(args, config) {
|
|
82096
82168
|
appConfigNoDefaults.configuration.image = appConfigNoDefaults.image;
|
82097
82169
|
const application = applicationByNames[appConfigNoDefaults.name ?? // we should never actually reach this point, but just in case
|
82098
82170
|
`${config.name}-${appConfigNoDefaults.class_name}`];
|
82099
|
-
const accountId =
|
82171
|
+
const accountId = await getAccountId(config);
|
82100
82172
|
const appConfig = containerAppToCreateApplication(
|
82101
82173
|
accountId,
|
82102
82174
|
appConfigNoDefaults,
|
@@ -137305,7 +137377,7 @@ var init_commands7 = __esm({
|
|
137305
137377
|
let store;
|
137306
137378
|
logger.log(`\u{1F510} Creating store... (Name: ${args.name})`);
|
137307
137379
|
if (args.remote) {
|
137308
|
-
const accountId =
|
137380
|
+
const accountId = await getAccountId(config);
|
137309
137381
|
store = await createStore(config, accountId, { name: args.name });
|
137310
137382
|
} else {
|
137311
137383
|
throw new UserError(
|
@@ -137339,7 +137411,7 @@ var init_commands7 = __esm({
|
|
137339
137411
|
async handler(args, { config }) {
|
137340
137412
|
logger.log(`\u{1F510} Deleting store... (Name: ${args.storeId})`);
|
137341
137413
|
if (args.remote) {
|
137342
|
-
const accountId =
|
137414
|
+
const accountId = await getAccountId(config);
|
137343
137415
|
await deleteStore(config, accountId, args.storeId);
|
137344
137416
|
} else {
|
137345
137417
|
throw new UserError(
|
@@ -137380,7 +137452,7 @@ var init_commands7 = __esm({
|
|
137380
137452
|
logger.log(`\u{1F510} Listing stores...`);
|
137381
137453
|
let stores;
|
137382
137454
|
if (args.remote) {
|
137383
|
-
const accountId =
|
137455
|
+
const accountId = await getAccountId(config);
|
137384
137456
|
stores = await listStores(config, accountId, urlParams);
|
137385
137457
|
} else {
|
137386
137458
|
throw new UserError(
|
@@ -137447,7 +137519,7 @@ var init_commands7 = __esm({
|
|
137447
137519
|
);
|
137448
137520
|
let secrets;
|
137449
137521
|
if (args.remote) {
|
137450
|
-
const accountId =
|
137522
|
+
const accountId = await getAccountId(config);
|
137451
137523
|
secrets = await listSecrets(config, accountId, args.storeId, urlParams);
|
137452
137524
|
} else {
|
137453
137525
|
secrets = (await usingLocalSecretsStoreSecretAPI(
|
@@ -137520,7 +137592,7 @@ var init_commands7 = __esm({
|
|
137520
137592
|
logger.log(`\u{1F510} Getting secret... (ID: ${args.secretId})`);
|
137521
137593
|
let secret;
|
137522
137594
|
if (args.remote) {
|
137523
|
-
const accountId =
|
137595
|
+
const accountId = await getAccountId(config);
|
137524
137596
|
secret = await getSecret(config, accountId, args.storeId, args.secretId);
|
137525
137597
|
} else {
|
137526
137598
|
const name2 = await usingLocalSecretsStoreSecretAPI(
|
@@ -137619,7 +137691,7 @@ var init_commands7 = __esm({
|
|
137619
137691
|
);
|
137620
137692
|
let secrets;
|
137621
137693
|
if (args.remote) {
|
137622
|
-
const accountId =
|
137694
|
+
const accountId = await getAccountId(config);
|
137623
137695
|
secrets = await createSecret(config, accountId, args.storeId, {
|
137624
137696
|
name: args.name,
|
137625
137697
|
value: secretValue,
|
@@ -137734,7 +137806,7 @@ var init_commands7 = __esm({
|
|
137734
137806
|
logger.log(`\u{1F510} Updating secret... (ID: ${args.secretId})`);
|
137735
137807
|
let secret;
|
137736
137808
|
if (args.remote) {
|
137737
|
-
const accountId =
|
137809
|
+
const accountId = await getAccountId(config);
|
137738
137810
|
secret = await updateSecret(
|
137739
137811
|
config,
|
137740
137812
|
accountId,
|
@@ -137814,7 +137886,7 @@ var init_commands7 = __esm({
|
|
137814
137886
|
async handler(args, { config }) {
|
137815
137887
|
logger.log(`\u{1F510} Deleting secret... (ID: ${args.secretId})`);
|
137816
137888
|
if (args.remote) {
|
137817
|
-
const accountId =
|
137889
|
+
const accountId = await getAccountId(config);
|
137818
137890
|
await deleteSecret(config, accountId, args.storeId, args.secretId);
|
137819
137891
|
} else {
|
137820
137892
|
await usingLocalSecretsStoreSecretAPI(
|
@@ -137878,7 +137950,7 @@ var init_commands7 = __esm({
|
|
137878
137950
|
logger.log(`\u{1F510} Duplicating secret... (ID: ${args.secretId})`);
|
137879
137951
|
let duplicatedSecret;
|
137880
137952
|
if (args.remote) {
|
137881
|
-
const accountId =
|
137953
|
+
const accountId = await getAccountId(config);
|
137882
137954
|
duplicatedSecret = await duplicateSecret(
|
137883
137955
|
config,
|
137884
137956
|
accountId,
|
@@ -159317,14 +159389,15 @@ var init_friendly_validator_errors = __esm({
|
|
159317
159389
|
});
|
159318
159390
|
|
159319
159391
|
// src/deploy/config-diffs.ts
|
159320
|
-
function getRemoteConfigDiff(remoteConfig,
|
159392
|
+
function getRemoteConfigDiff(remoteConfig, localResolvedConfig) {
|
159393
|
+
const normalizedLocalConfig = normalizeLocalResolvedConfigAsRemote(localResolvedConfig);
|
159394
|
+
const normalizedRemoteConfig = normalizeRemoteConfigAsResolvedLocal(
|
159395
|
+
remoteConfig,
|
159396
|
+
localResolvedConfig
|
159397
|
+
);
|
159321
159398
|
const diff = new Diff(
|
159322
|
-
JSON.stringify(
|
159323
|
-
|
159324
|
-
null,
|
159325
|
-
2
|
159326
|
-
),
|
159327
|
-
JSON.stringify(localConfig, null, 2)
|
159399
|
+
JSON.stringify(normalizedRemoteConfig, null, 2),
|
159400
|
+
JSON.stringify(normalizedLocalConfig, null, 2)
|
159328
159401
|
);
|
159329
159402
|
return {
|
159330
159403
|
diff,
|
@@ -159333,97 +159406,95 @@ function getRemoteConfigDiff(remoteConfig, localConfig) {
|
|
159333
159406
|
}
|
159334
159407
|
function configDiffOnlyHasAdditionsIfAny(diff) {
|
159335
159408
|
const diffLines = diff.toString().split("\n");
|
159336
|
-
|
159337
|
-
|
159338
|
-
|
159339
|
-
|
159340
|
-
|
159409
|
+
const removalLines = diffLines.filter((line) => {
|
159410
|
+
const withoutLeadingSpaces = line.replace(/^\s*/, "");
|
159411
|
+
return withoutLeadingSpaces.startsWith(red("-"));
|
159412
|
+
});
|
159413
|
+
const diffLinesSet = new Set(diffLines);
|
159414
|
+
return removalLines.every((line) => {
|
159415
|
+
if (line.endsWith(",")) {
|
159416
|
+
const removalButAsAdditionAndWithCommaRemoved = `${line.slice(0, -1).replace(red("-"), green("+"))}`;
|
159417
|
+
return diffLinesSet.has(removalButAsAdditionAndWithCommaRemoved);
|
159418
|
+
}
|
159419
|
+
const removalButAsAdditionAndWithComma = `${line.replace(red("-"), green("+"))},`;
|
159420
|
+
return diffLinesSet.has(removalButAsAdditionAndWithComma);
|
159421
|
+
});
|
159422
|
+
}
|
159423
|
+
function normalizeLocalResolvedConfigAsRemote(localResolvedConfig) {
|
159424
|
+
const normalizedConfig = {
|
159425
|
+
...localResolvedConfig,
|
159426
|
+
observability: normalizeObservability(localResolvedConfig.observability),
|
159427
|
+
workers_dev: getResolvedWorkersDev(
|
159428
|
+
localResolvedConfig.workers_dev,
|
159429
|
+
localResolvedConfig.routes ?? []
|
159430
|
+
)
|
159431
|
+
};
|
159432
|
+
return normalizedConfig;
|
159433
|
+
}
|
159434
|
+
function normalizeObservability(obs) {
|
159435
|
+
const normalized = structuredClone(obs);
|
159436
|
+
const fullObservabilityDefaults = {
|
159437
|
+
enabled: false,
|
159438
|
+
head_sampling_rate: 1,
|
159439
|
+
logs: { enabled: false, head_sampling_rate: 1, invocation_logs: true }
|
159440
|
+
};
|
159441
|
+
if (!normalized) {
|
159442
|
+
return fullObservabilityDefaults;
|
159443
|
+
}
|
159444
|
+
const fillUndefinedFields = /* @__PURE__ */ __name((target, defaults) => {
|
159445
|
+
Object.entries(defaults).forEach(([key, value]) => {
|
159446
|
+
if (target[key] === void 0) {
|
159447
|
+
target[key] = value;
|
159448
|
+
return;
|
159449
|
+
}
|
159450
|
+
if (typeof value === "object" && value !== null && typeof target[key] === "object" && target[key] !== null) {
|
159451
|
+
fillUndefinedFields(
|
159452
|
+
target[key],
|
159453
|
+
value
|
159454
|
+
);
|
159341
159455
|
}
|
159342
|
-
const withoutLeadingSpaces = line.replace(/^\s*/, "");
|
159343
|
-
return withoutLeadingSpaces.startsWith(red("-"));
|
159344
159456
|
});
|
159345
|
-
|
159346
|
-
|
159347
|
-
|
159348
|
-
|
159349
|
-
|
159350
|
-
|
159351
|
-
const lineAtIdxButAdditionAndWithComma = `${lineAtIdx.replace(red("-"), green("+"))},`;
|
159352
|
-
const onlyACommaWasAdded = nextLine === lineAtIdxButAdditionAndWithComma;
|
159353
|
-
if (!onlyACommaWasAdded) {
|
159354
|
-
return false;
|
159355
|
-
}
|
159356
|
-
currentRemovalIdx++;
|
159357
|
-
}
|
159358
|
-
return true;
|
159457
|
+
}, "fillUndefinedFields");
|
159458
|
+
fillUndefinedFields(
|
159459
|
+
normalized,
|
159460
|
+
fullObservabilityDefaults
|
159461
|
+
);
|
159462
|
+
return normalized;
|
159359
159463
|
}
|
159360
|
-
function
|
159361
|
-
let normalizedRemote =
|
159362
|
-
Object.entries(
|
159363
|
-
if (
|
159364
|
-
// it changing does not really constitute a relevant config change
|
159365
|
-
key === "main") {
|
159464
|
+
function normalizeRemoteConfigAsResolvedLocal(remoteConfig, localResolvedConfig) {
|
159465
|
+
let normalizedRemote = {};
|
159466
|
+
Object.entries(localResolvedConfig).forEach(([key, value]) => {
|
159467
|
+
if (key !== "observability") {
|
159366
159468
|
normalizedRemote[key] = value;
|
159367
159469
|
}
|
159368
159470
|
});
|
159369
|
-
|
159370
|
-
|
159371
|
-
|
159372
|
-
field: "observability",
|
159373
|
-
remoteDefaultValue: {
|
159374
|
-
enabled: true,
|
159375
|
-
head_sampling_rate: 1
|
159471
|
+
Object.entries(remoteConfig).forEach(([key, value]) => {
|
159472
|
+
if (key !== "main" && value !== void 0) {
|
159473
|
+
normalizedRemote[key] = value;
|
159376
159474
|
}
|
159377
159475
|
});
|
159378
|
-
if (normalizedRemote.observability
|
159379
|
-
|
159380
|
-
|
159381
|
-
|
159382
|
-
|
159383
|
-
|
159384
|
-
|
159385
|
-
|
159386
|
-
|
159387
|
-
|
159388
|
-
|
159389
|
-
|
159390
|
-
|
159391
|
-
|
159392
|
-
|
159393
|
-
|
159394
|
-
localObj: localConfig.observability.logs,
|
159395
|
-
field: "enabled",
|
159396
|
-
remoteDefaultValue: true
|
159397
|
-
});
|
159398
|
-
}
|
159399
|
-
}
|
159400
|
-
cleanupRemoteDefault({
|
159401
|
-
remoteObj: normalizedRemote,
|
159402
|
-
localObj: localConfig,
|
159403
|
-
field: "workers_dev",
|
159404
|
-
remoteDefaultValue: true
|
159405
|
-
});
|
159476
|
+
if (normalizedRemote.observability) {
|
159477
|
+
if (normalizedRemote.observability.head_sampling_rate === 1 && localResolvedConfig.observability?.head_sampling_rate === void 0) {
|
159478
|
+
delete normalizedRemote.observability.head_sampling_rate;
|
159479
|
+
}
|
159480
|
+
if (normalizedRemote.observability.logs) {
|
159481
|
+
if (normalizedRemote.observability.logs.head_sampling_rate === 1 && localResolvedConfig.observability?.logs?.head_sampling_rate === void 0) {
|
159482
|
+
delete normalizedRemote.observability.logs.head_sampling_rate;
|
159483
|
+
}
|
159484
|
+
if (normalizedRemote.observability.logs.invocation_logs === true && localResolvedConfig.observability?.logs?.invocation_logs === void 0) {
|
159485
|
+
delete normalizedRemote.observability.logs.invocation_logs;
|
159486
|
+
}
|
159487
|
+
}
|
159488
|
+
}
|
159489
|
+
normalizedRemote.observability = normalizeObservability(
|
159490
|
+
normalizedRemote.observability
|
159491
|
+
);
|
159406
159492
|
normalizedRemote = orderObjectFields(
|
159407
159493
|
normalizedRemote,
|
159408
|
-
|
159494
|
+
localResolvedConfig
|
159409
159495
|
);
|
159410
159496
|
return normalizedRemote;
|
159411
159497
|
}
|
159412
|
-
function cleanupRemoteDefault({
|
159413
|
-
field,
|
159414
|
-
localObj,
|
159415
|
-
remoteObj,
|
159416
|
-
remoteDefaultValue
|
159417
|
-
}) {
|
159418
|
-
if (deepStrictEqual(remoteObj[field], remoteDefaultValue)) {
|
159419
|
-
if (!(field in localObj)) {
|
159420
|
-
delete remoteObj[field];
|
159421
|
-
}
|
159422
|
-
if (localObj[field] === void 0) {
|
159423
|
-
remoteObj[field] = void 0;
|
159424
|
-
}
|
159425
|
-
}
|
159426
|
-
}
|
159427
159498
|
function orderObjectFields(source, target) {
|
159428
159499
|
const targetKeysIndexesMap = Object.fromEntries(
|
159429
159500
|
Object.keys(target).map((key, i5) => [key, i5])
|
@@ -159452,67 +159523,18 @@ function orderObjectFields(source, target) {
|
|
159452
159523
|
}
|
159453
159524
|
return orderedSource;
|
159454
159525
|
}
|
159455
|
-
function deepStrictEqual(source, target) {
|
159456
|
-
try {
|
159457
|
-
import_node_assert24.default.deepStrictEqual(source, target);
|
159458
|
-
return true;
|
159459
|
-
} catch {
|
159460
|
-
return false;
|
159461
|
-
}
|
159462
|
-
}
|
159463
|
-
var import_node_assert24, remoteConfigKeys;
|
159464
159526
|
var init_config_diffs = __esm({
|
159465
159527
|
"src/deploy/config-diffs.ts"() {
|
159466
159528
|
init_import_meta_url();
|
159467
|
-
import_node_assert24 = __toESM(require("assert"));
|
159468
159529
|
init_colors();
|
159469
159530
|
init_diff();
|
159531
|
+
init_deploy3();
|
159470
159532
|
__name(getRemoteConfigDiff, "getRemoteConfigDiff");
|
159471
159533
|
__name(configDiffOnlyHasAdditionsIfAny, "configDiffOnlyHasAdditionsIfAny");
|
159472
|
-
__name(
|
159473
|
-
__name(
|
159534
|
+
__name(normalizeLocalResolvedConfigAsRemote, "normalizeLocalResolvedConfigAsRemote");
|
159535
|
+
__name(normalizeObservability, "normalizeObservability");
|
159536
|
+
__name(normalizeRemoteConfigAsResolvedLocal, "normalizeRemoteConfigAsResolvedLocal");
|
159474
159537
|
__name(orderObjectFields, "orderObjectFields");
|
159475
|
-
remoteConfigKeys = /* @__PURE__ */ new Set([
|
159476
|
-
"name",
|
159477
|
-
"main",
|
159478
|
-
"workers_dev",
|
159479
|
-
"compatibility_date",
|
159480
|
-
"compatibility_flags",
|
159481
|
-
"routes",
|
159482
|
-
"placement",
|
159483
|
-
"limits",
|
159484
|
-
"migrations",
|
159485
|
-
"triggers",
|
159486
|
-
"tail_consumers",
|
159487
|
-
"observability",
|
159488
|
-
"vars",
|
159489
|
-
"kv_namespaces",
|
159490
|
-
"durable_objects",
|
159491
|
-
"d1_databases",
|
159492
|
-
"browser",
|
159493
|
-
"ai",
|
159494
|
-
"images",
|
159495
|
-
"r2_buckets",
|
159496
|
-
"secrets_store_secrets",
|
159497
|
-
"unsafe_hello_world",
|
159498
|
-
"services",
|
159499
|
-
"analytics_engine_datasets",
|
159500
|
-
"dispatch_namespaces",
|
159501
|
-
"logfwdr",
|
159502
|
-
"wasm_modules",
|
159503
|
-
"text_blobs",
|
159504
|
-
"data_blobs",
|
159505
|
-
"version_metadata",
|
159506
|
-
"send_email",
|
159507
|
-
"queues",
|
159508
|
-
"vectorize",
|
159509
|
-
"hyperdrive",
|
159510
|
-
"mtls_certificates",
|
159511
|
-
"pipelines",
|
159512
|
-
"unsafe",
|
159513
|
-
"workflows"
|
159514
|
-
]);
|
159515
|
-
__name(deepStrictEqual, "deepStrictEqual");
|
159516
159538
|
}
|
159517
159539
|
});
|
159518
159540
|
|
@@ -159621,6 +159643,12 @@ async function deploy(props) {
|
|
159621
159643
|
let workerTag = null;
|
159622
159644
|
let versionId = null;
|
159623
159645
|
let workerExists = true;
|
159646
|
+
const domainRoutes = (props.domains || []).map((domain2) => ({
|
159647
|
+
pattern: domain2,
|
159648
|
+
custom_domain: true
|
159649
|
+
}));
|
159650
|
+
const routes = props.routes ?? config.routes ?? (config.route ? [config.route] : []) ?? [];
|
159651
|
+
const allDeploymentRoutes = [...routes, ...domainRoutes];
|
159624
159652
|
if (!props.dispatchNamespace && accountId) {
|
159625
159653
|
try {
|
159626
159654
|
const serviceMetaData = await fetchResult(config, `/accounts/${accountId}/workers/services/${name2}`);
|
@@ -159637,21 +159665,16 @@ async function deploy(props) {
|
|
159637
159665
|
entry.file,
|
159638
159666
|
serviceMetaData.default_environment.environment
|
159639
159667
|
);
|
159640
|
-
|
159641
|
-
|
159642
|
-
|
159643
|
-
|
159644
|
-
|
159645
|
-
}
|
159646
|
-
if (rawConfig) {
|
159647
|
-
configDiff = getRemoteConfigDiff(remoteWorkerConfig, rawConfig);
|
159648
|
-
}
|
159649
|
-
}
|
159668
|
+
configDiff = getRemoteConfigDiff(remoteWorkerConfig, {
|
159669
|
+
...config,
|
159670
|
+
// We also want to include all the routes used for deployment
|
159671
|
+
routes: allDeploymentRoutes
|
159672
|
+
});
|
159650
159673
|
}
|
159651
159674
|
if (configDiff) {
|
159652
159675
|
if (!configDiff.nonDestructive) {
|
159653
159676
|
logger.warn(
|
159654
|
-
`
|
159677
|
+
`The local configuration being used (generated from your local configuration file) differs from the remote configuration of your Worker set via the Cloudflare Dashboard:
|
159655
159678
|
${configDiff.diff}
|
159656
159679
|
|
159657
159680
|
Deploying the Worker will override the remote configuration with your local one.`
|
@@ -159700,13 +159723,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
159700
159723
|
{ telemetryMessage: "missing compatibility date when deploying" }
|
159701
159724
|
);
|
159702
159725
|
}
|
159703
|
-
|
159704
|
-
pattern: domain2,
|
159705
|
-
custom_domain: true
|
159706
|
-
}));
|
159707
|
-
const routes = props.routes ?? config.routes ?? (config.route ? [config.route] : []);
|
159708
|
-
const allRoutes = [...routes, ...domainRoutes];
|
159709
|
-
validateRoutes3(allRoutes, props.assetsOptions);
|
159726
|
+
validateRoutes3(allDeploymentRoutes, props.assetsOptions);
|
159710
159727
|
const jsxFactory = props.jsxFactory || config.jsx_factory;
|
159711
159728
|
const jsxFragment = props.jsxFragment || config.jsx_fragment;
|
159712
159729
|
const keepVars = props.keepVars || config.keep_vars;
|
@@ -159724,7 +159741,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
159724
159741
|
);
|
159725
159742
|
}
|
159726
159743
|
const scriptName = props.name;
|
159727
|
-
(0,
|
159744
|
+
(0, import_node_assert24.default)(
|
159728
159745
|
!config.site || config.site.bucket,
|
159729
159746
|
"A [site] definition requires a `bucket` field with a path to the site's assets directory."
|
159730
159747
|
);
|
@@ -159996,7 +160013,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
159996
160013
|
{ warnIfNoBindings: true }
|
159997
160014
|
);
|
159998
160015
|
} else {
|
159999
|
-
(0,
|
160016
|
+
(0, import_node_assert24.default)(accountId, "Missing accountId");
|
160000
160017
|
if (getFlag("RESOURCES_PROVISION")) {
|
160001
160018
|
await provisionBindings(
|
160002
160019
|
bindings,
|
@@ -160168,7 +160185,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
160168
160185
|
return { versionId, workerTag };
|
160169
160186
|
}
|
160170
160187
|
if (normalisedContainerConfig.length) {
|
160171
|
-
(0,
|
160188
|
+
(0, import_node_assert24.default)(versionId && accountId);
|
160172
160189
|
await deployContainers(config, normalisedContainerConfig, {
|
160173
160190
|
versionId,
|
160174
160191
|
accountId,
|
@@ -160178,7 +160195,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
160178
160195
|
}
|
160179
160196
|
const targets = await triggersDeploy({
|
160180
160197
|
...props,
|
160181
|
-
routes:
|
160198
|
+
routes: allDeploymentRoutes
|
160182
160199
|
});
|
160183
160200
|
logger.log("Current Version ID:", versionId);
|
160184
160201
|
return {
|
@@ -160402,11 +160419,11 @@ async function updateQueueConsumers(scriptName, config) {
|
|
160402
160419
|
}
|
160403
160420
|
return updateConsumers;
|
160404
160421
|
}
|
160405
|
-
var
|
160422
|
+
var import_node_assert24, import_node_fs33, import_node_path58, import_node_url9, import_undici21, validateRoutes3;
|
160406
160423
|
var init_deploy8 = __esm({
|
160407
160424
|
"src/deploy/deploy.ts"() {
|
160408
160425
|
init_import_meta_url();
|
160409
|
-
|
160426
|
+
import_node_assert24 = __toESM(require("assert"));
|
160410
160427
|
import_node_fs33 = require("fs");
|
160411
160428
|
import_node_path58 = __toESM(require("path"));
|
160412
160429
|
import_node_url9 = require("url");
|
@@ -160655,11 +160672,11 @@ function errorOnLegacyPagesWorkerJSAsset(file, hasAssetsIgnoreFile) {
|
|
160655
160672
|
}
|
160656
160673
|
}
|
160657
160674
|
}
|
160658
|
-
var
|
160675
|
+
var import_node_assert25, import_node_fs34, import_promises35, path61, import_undici22, BULK_UPLOAD_CONCURRENCY2, MAX_UPLOAD_ATTEMPTS2, MAX_UPLOAD_GATEWAY_ERRORS2, MAX_DIFF_LINES2, syncAssets, buildAssetManifest, NonExistentAssetsDirError, WORKER_JS_FILENAME;
|
160659
160676
|
var init_assets = __esm({
|
160660
160677
|
"src/assets.ts"() {
|
160661
160678
|
init_import_meta_url();
|
160662
|
-
|
160679
|
+
import_node_assert25 = __toESM(require("assert"));
|
160663
160680
|
import_node_fs34 = require("fs");
|
160664
160681
|
import_promises35 = require("fs/promises");
|
160665
160682
|
path61 = __toESM(require("path"));
|
@@ -160684,7 +160701,7 @@ var init_assets = __esm({
|
|
160684
160701
|
MAX_UPLOAD_GATEWAY_ERRORS2 = 5;
|
160685
160702
|
MAX_DIFF_LINES2 = 100;
|
160686
160703
|
syncAssets = /* @__PURE__ */ __name(async (complianceConfig, accountId, assetDirectory, scriptName, dispatchNamespace) => {
|
160687
|
-
(0,
|
160704
|
+
(0, import_node_assert25.default)(accountId, "Missing accountId");
|
160688
160705
|
logger.info("\u{1F300} Building list of assets...");
|
160689
160706
|
const manifest = await buildAssetManifest(assetDirectory);
|
160690
160707
|
const url4 = dispatchNamespace ? `/accounts/${accountId}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}/assets-upload-session` : `/accounts/${accountId}/workers/scripts/${scriptName}/assets-upload-session`;
|
@@ -161036,7 +161053,7 @@ async function resolveDevConfig(config, input) {
|
|
161036
161053
|
);
|
161037
161054
|
if (input.dev?.remote) {
|
161038
161055
|
const { accountId } = await auth();
|
161039
|
-
(0,
|
161056
|
+
(0, import_node_assert26.default)(accountId, "Account ID must be provided for remote dev");
|
161040
161057
|
await getZoneIdForPreview(config, { host, routes, accountId });
|
161041
161058
|
}
|
161042
161059
|
const initialIp = input.dev?.server?.hostname ?? config.dev.ip;
|
@@ -161293,11 +161310,11 @@ If you are trying to develop Pages and Workers together, please use \`wrangler p
|
|
161293
161310
|
}
|
161294
161311
|
return { config: resolved, printCurrentBindings };
|
161295
161312
|
}
|
161296
|
-
var
|
161313
|
+
var import_node_assert26, import_node_path59, import_miniflare22, getInspectorPort, getLocalPort, ConfigController;
|
161297
161314
|
var init_ConfigController = __esm({
|
161298
161315
|
"src/api/startDevWorker/ConfigController.ts"() {
|
161299
161316
|
init_import_meta_url();
|
161300
|
-
|
161317
|
+
import_node_assert26 = __toESM(require("assert"));
|
161301
161318
|
import_node_path59 = __toESM(require("path"));
|
161302
161319
|
init_containers_shared();
|
161303
161320
|
init_esm4();
|
@@ -161351,7 +161368,7 @@ var init_ConfigController = __esm({
|
|
161351
161368
|
ignoreInitial: true
|
161352
161369
|
}).on("change", async (_event) => {
|
161353
161370
|
logger.debug(`${import_node_path59.default.basename(configPath)} changed...`);
|
161354
|
-
(0,
|
161371
|
+
(0, import_node_assert26.default)(
|
161355
161372
|
this.latestInput,
|
161356
161373
|
"Cannot be watching config without having first set an input"
|
161357
161374
|
);
|
@@ -161366,7 +161383,7 @@ var init_ConfigController = __esm({
|
|
161366
161383
|
);
|
161367
161384
|
}
|
161368
161385
|
patch(input) {
|
161369
|
-
(0,
|
161386
|
+
(0, import_node_assert26.default)(
|
161370
161387
|
this.latestInput,
|
161371
161388
|
"Cannot call updateConfig without previously calling setConfig"
|
161372
161389
|
);
|
@@ -161521,7 +161538,7 @@ function maybeGetSourceMappingURL(sourcePath) {
|
|
161521
161538
|
return;
|
161522
161539
|
}
|
161523
161540
|
const sourceMappingURLMatch = source.substring(sourceMappingURLIndex).match(/^\/\/# sourceMappingURL=(.+)/);
|
161524
|
-
(0,
|
161541
|
+
(0, import_node_assert27.default)(sourceMappingURLMatch !== null);
|
161525
161542
|
const sourceMappingURLSpecifier = sourceMappingURLMatch[1];
|
161526
161543
|
const sourceURL = (0, import_node_url10.pathToFileURL)(sourcePath);
|
161527
161544
|
try {
|
@@ -161533,11 +161550,11 @@ function maybeGetSourceMappingURL(sourcePath) {
|
|
161533
161550
|
} catch {
|
161534
161551
|
}
|
161535
161552
|
}
|
161536
|
-
var
|
161553
|
+
var import_node_assert27, import_node_fs35, import_node_path62, import_node_url10, bundleReferencedPathsCache;
|
161537
161554
|
var init_bundle_allowed_paths = __esm({
|
161538
161555
|
"src/api/startDevWorker/bundle-allowed-paths.ts"() {
|
161539
161556
|
init_import_meta_url();
|
161540
|
-
|
161557
|
+
import_node_assert27 = __toESM(require("assert"));
|
161541
161558
|
import_node_fs35 = __toESM(require("fs"));
|
161542
161559
|
import_node_path62 = __toESM(require("path"));
|
161543
161560
|
import_node_url10 = require("url");
|
@@ -180091,11 +180108,11 @@ function didMiniflareOptionsChange(prev, next) {
|
|
180091
180108
|
}
|
180092
180109
|
return !deepEquality(prev, next);
|
180093
180110
|
}
|
180094
|
-
var
|
180111
|
+
var import_node_assert28, import_node_crypto13, import_node_events4, import_node_path63, import_miniflare24, ProxyController, ProxyControllerLogger;
|
180095
180112
|
var init_ProxyController = __esm({
|
180096
180113
|
"src/api/startDevWorker/ProxyController.ts"() {
|
180097
180114
|
init_import_meta_url();
|
180098
|
-
|
180115
|
+
import_node_assert28 = __toESM(require("assert"));
|
180099
180116
|
import_node_crypto13 = require("crypto");
|
180100
180117
|
import_node_events4 = __toESM(require("events"));
|
180101
180118
|
import_node_path63 = __toESM(require("path"));
|
@@ -180128,7 +180145,7 @@ var init_ProxyController = __esm({
|
|
180128
180145
|
if (this._torndown) {
|
180129
180146
|
return;
|
180130
180147
|
}
|
180131
|
-
(0,
|
180148
|
+
(0, import_node_assert28.default)(this.latestConfig !== void 0);
|
180132
180149
|
const inVscodeJsDebugTerminal = !!process.env.VSCODE_INSPECTOR_OPTIONS;
|
180133
180150
|
const cert = this.latestConfig.dev?.server?.secure || this.latestConfig.dev.inspector !== false && this.latestConfig.dev?.inspector?.secure ? getHttpsOptions(
|
180134
180151
|
this.latestConfig.dev.server?.httpsKeyPath,
|
@@ -180252,7 +180269,7 @@ var init_ProxyController = __esm({
|
|
180252
180269
|
inspectorUrl
|
180253
180270
|
]);
|
180254
180271
|
}).then(([url4, inspectorUrl]) => {
|
180255
|
-
(0,
|
180272
|
+
(0, import_node_assert28.default)(url4);
|
180256
180273
|
this.emitReadyEvent(proxyWorker, url4, inspectorUrl);
|
180257
180274
|
}).catch((error2) => {
|
180258
180275
|
if (this._torndown) {
|
@@ -180269,7 +180286,7 @@ var init_ProxyController = __esm({
|
|
180269
180286
|
if (this._torndown) {
|
180270
180287
|
return;
|
180271
180288
|
}
|
180272
|
-
(0,
|
180289
|
+
(0, import_node_assert28.default)(
|
180273
180290
|
this.latestConfig?.dev.inspector !== false,
|
180274
180291
|
"Trying to reconnect with inspector proxy worker when inspector is disabled"
|
180275
180292
|
);
|
@@ -180280,7 +180297,7 @@ var init_ProxyController = __esm({
|
|
180280
180297
|
this.inspectorProxyWorkerWebSocket = createDeferred();
|
180281
180298
|
let webSocket = null;
|
180282
180299
|
try {
|
180283
|
-
(0,
|
180300
|
+
(0, import_node_assert28.default)(this.proxyWorker);
|
180284
180301
|
const inspectorProxyWorkerUrl = await this.proxyWorker.unsafeGetDirectURL(
|
180285
180302
|
"InspectorProxyWorker"
|
180286
180303
|
);
|
@@ -180299,12 +180316,12 @@ var init_ProxyController = __esm({
|
|
180299
180316
|
this.emitErrorEvent("Could not connect to InspectorProxyWorker", error2);
|
180300
180317
|
return;
|
180301
180318
|
}
|
180302
|
-
(0,
|
180319
|
+
(0, import_node_assert28.default)(
|
180303
180320
|
webSocket,
|
180304
180321
|
"Expected webSocket on response from inspectorProxyWorker"
|
180305
180322
|
);
|
180306
180323
|
webSocket.addEventListener("message", (event) => {
|
180307
|
-
(0,
|
180324
|
+
(0, import_node_assert28.default)(typeof event.data === "string");
|
180308
180325
|
this.onInspectorProxyWorkerMessage(JSON.parse(event.data));
|
180309
180326
|
});
|
180310
180327
|
webSocket.addEventListener("close", () => {
|
@@ -180359,13 +180376,13 @@ var init_ProxyController = __esm({
|
|
180359
180376
|
if (this._torndown) {
|
180360
180377
|
return;
|
180361
180378
|
}
|
180362
|
-
(0,
|
180379
|
+
(0, import_node_assert28.default)(
|
180363
180380
|
this.latestConfig?.dev.inspector !== false,
|
180364
180381
|
"Trying to send message to inspector proxy worker when inspector is disabled"
|
180365
180382
|
);
|
180366
180383
|
try {
|
180367
180384
|
const websocket = await this.reconnectInspectorProxyWorker();
|
180368
|
-
(0,
|
180385
|
+
(0, import_node_assert28.default)(websocket);
|
180369
180386
|
websocket.send(JSON.stringify(message));
|
180370
180387
|
} catch (cause) {
|
180371
180388
|
if (this._torndown) {
|
@@ -180433,7 +180450,7 @@ var init_ProxyController = __esm({
|
|
180433
180450
|
}
|
180434
180451
|
}
|
180435
180452
|
onInspectorProxyWorkerMessage(message) {
|
180436
|
-
(0,
|
180453
|
+
(0, import_node_assert28.default)(
|
180437
180454
|
this.latestConfig?.dev.inspector !== false,
|
180438
180455
|
"Trying to handle inspector message when inspector is disabled"
|
180439
180456
|
);
|
@@ -180459,7 +180476,7 @@ var init_ProxyController = __esm({
|
|
180459
180476
|
}
|
180460
180477
|
}
|
180461
180478
|
async onInspectorProxyWorkerRequest(message) {
|
180462
|
-
(0,
|
180479
|
+
(0, import_node_assert28.default)(
|
180463
180480
|
this.latestConfig?.dev.inspector !== false,
|
180464
180481
|
"Trying to handle inspector request when inspector is disabled"
|
180465
180482
|
);
|
@@ -180480,8 +180497,8 @@ var init_ProxyController = __esm({
|
|
180480
180497
|
logger.debug("[InspectorProxyWorker]", ...message.args);
|
180481
180498
|
break;
|
180482
180499
|
case "load-network-resource": {
|
180483
|
-
(0,
|
180484
|
-
(0,
|
180500
|
+
(0, import_node_assert28.default)(this.latestConfig !== void 0);
|
180501
|
+
(0, import_node_assert28.default)(this.latestBundle !== void 0);
|
180485
180502
|
let maybeContents;
|
180486
180503
|
if (message.url.startsWith("wrangler-file:")) {
|
180487
180504
|
maybeContents = maybeHandleNetworkLoadResource(
|
@@ -180746,7 +180763,7 @@ var init_create_worker_preview = __esm({
|
|
180746
180763
|
|
180747
180764
|
// src/dev/remote.ts
|
180748
180765
|
function handlePreviewSessionUploadError(err, accountId) {
|
180749
|
-
(0,
|
180766
|
+
(0, import_node_assert29.default)(err && typeof err === "object");
|
180750
180767
|
if (isAbortError(err)) {
|
180751
180768
|
if ("code" in err && err.code === 10049) {
|
180752
180769
|
logger.log("Preview token expired, fetching a new one");
|
@@ -180758,7 +180775,7 @@ function handlePreviewSessionUploadError(err, accountId) {
|
|
180758
180775
|
return false;
|
180759
180776
|
}
|
180760
180777
|
function handlePreviewSessionCreationError(err, accountId) {
|
180761
|
-
(0,
|
180778
|
+
(0, import_node_assert29.default)(err && typeof err === "object");
|
180762
180779
|
if ("code" in err && err.code === 10063) {
|
180763
180780
|
const errorMessage = "Error: You need to register a workers.dev subdomain before running the dev command in remote mode";
|
180764
180781
|
const solutionMessage = "You can either enable local mode by pressing l, or register a workers.dev subdomain here:";
|
@@ -180917,11 +180934,11 @@ ${onboardingLink}`);
|
|
180917
180934
|
}
|
180918
180935
|
}
|
180919
180936
|
}
|
180920
|
-
var
|
180937
|
+
var import_node_assert29, import_node_path64;
|
180921
180938
|
var init_remote = __esm({
|
180922
180939
|
"src/dev/remote.ts"() {
|
180923
180940
|
init_import_meta_url();
|
180924
|
-
|
180941
|
+
import_node_assert29 = __toESM(require("assert"));
|
180925
180942
|
import_node_path64 = __toESM(require("path"));
|
180926
180943
|
init_assets();
|
180927
180944
|
init_bundle_reporter();
|
@@ -181246,7 +181263,7 @@ function createWorkerObject(devEnv) {
|
|
181246
181263
|
return devEnv.proxy.ready.promise.then((ev) => ev.inspectorUrl);
|
181247
181264
|
},
|
181248
181265
|
get config() {
|
181249
|
-
(0,
|
181266
|
+
(0, import_node_assert30.default)(devEnv.config.latestConfig);
|
181250
181267
|
return devEnv.config.latestConfig;
|
181251
181268
|
},
|
181252
181269
|
async setConfig(config, throwErrors) {
|
@@ -181261,7 +181278,7 @@ function createWorkerObject(devEnv) {
|
|
181261
181278
|
return proxyWorker.dispatchFetch(...args);
|
181262
181279
|
},
|
181263
181280
|
async queue(...args) {
|
181264
|
-
(0,
|
181281
|
+
(0, import_node_assert30.default)(
|
181265
181282
|
this.config.name,
|
181266
181283
|
"Worker name must be defined to use `Worker.queue()`"
|
181267
181284
|
);
|
@@ -181270,7 +181287,7 @@ function createWorkerObject(devEnv) {
|
|
181270
181287
|
return w6.queue(...args);
|
181271
181288
|
},
|
181272
181289
|
async scheduled(...args) {
|
181273
|
-
(0,
|
181290
|
+
(0, import_node_assert30.default)(
|
181274
181291
|
this.config.name,
|
181275
181292
|
"Worker name must be defined to use `Worker.scheduled()`"
|
181276
181293
|
);
|
@@ -181284,11 +181301,11 @@ function createWorkerObject(devEnv) {
|
|
181284
181301
|
raw: devEnv
|
181285
181302
|
};
|
181286
181303
|
}
|
181287
|
-
var
|
181304
|
+
var import_node_assert30, import_node_events5, DevEnv;
|
181288
181305
|
var init_DevEnv = __esm({
|
181289
181306
|
"src/api/startDevWorker/DevEnv.ts"() {
|
181290
181307
|
init_import_meta_url();
|
181291
|
-
|
181308
|
+
import_node_assert30 = __toESM(require("assert"));
|
181292
181309
|
import_node_events5 = require("events");
|
181293
181310
|
init_logger();
|
181294
181311
|
init_parse();
|
@@ -181502,7 +181519,7 @@ async function maybeStartOrUpdateRemoteProxySession(wranglerOrWorkerConfigObject
|
|
181502
181519
|
config: wranglerConfigObject.path,
|
181503
181520
|
env: wranglerConfigObject.environment
|
181504
181521
|
});
|
181505
|
-
(0,
|
181522
|
+
(0, import_node_assert31.default)(config.name);
|
181506
181523
|
wranglerOrWorkerConfigObject = {
|
181507
181524
|
name: config.name,
|
181508
181525
|
complianceRegion: getCloudflareComplianceRegion(config),
|
@@ -181511,7 +181528,7 @@ async function maybeStartOrUpdateRemoteProxySession(wranglerOrWorkerConfigObject
|
|
181511
181528
|
}
|
181512
181529
|
const workerConfigObject = wranglerOrWorkerConfigObject;
|
181513
181530
|
const remoteBindings = pickRemoteBindings(workerConfigObject.bindings);
|
181514
|
-
const authSameAsBefore =
|
181531
|
+
const authSameAsBefore = deepStrictEqual(
|
181515
181532
|
auth,
|
181516
181533
|
preExistingRemoteProxySessionData?.auth
|
181517
181534
|
);
|
@@ -181526,7 +181543,7 @@ async function maybeStartOrUpdateRemoteProxySession(wranglerOrWorkerConfigObject
|
|
181526
181543
|
auth: getAuthHook(auth, config)
|
181527
181544
|
});
|
181528
181545
|
} else {
|
181529
|
-
const remoteBindingsAreSameAsBefore =
|
181546
|
+
const remoteBindingsAreSameAsBefore = deepStrictEqual(
|
181530
181547
|
remoteBindings,
|
181531
181548
|
preExistingRemoteProxySessionData?.remoteBindings
|
181532
181549
|
);
|
@@ -181567,19 +181584,19 @@ function getAuthHook(auth, config) {
|
|
181567
181584
|
}
|
181568
181585
|
return void 0;
|
181569
181586
|
}
|
181570
|
-
function
|
181587
|
+
function deepStrictEqual(source, target) {
|
181571
181588
|
try {
|
181572
|
-
|
181589
|
+
import_node_assert31.default.deepStrictEqual(source, target);
|
181573
181590
|
return true;
|
181574
181591
|
} catch {
|
181575
181592
|
return false;
|
181576
181593
|
}
|
181577
181594
|
}
|
181578
|
-
var
|
181595
|
+
var import_node_assert31, import_node_path65;
|
181579
181596
|
var init_remoteBindings = __esm({
|
181580
181597
|
"src/api/remoteBindings/index.ts"() {
|
181581
181598
|
init_import_meta_url();
|
181582
|
-
|
181599
|
+
import_node_assert31 = __toESM(require("assert"));
|
181583
181600
|
import_node_path65 = __toESM(require("path"));
|
181584
181601
|
init_get_port();
|
181585
181602
|
init_ProxyServerWorker();
|
@@ -181592,7 +181609,7 @@ var init_remoteBindings = __esm({
|
|
181592
181609
|
__name(pickRemoteBindings, "pickRemoteBindings");
|
181593
181610
|
__name(maybeStartOrUpdateRemoteProxySession, "maybeStartOrUpdateRemoteProxySession");
|
181594
181611
|
__name(getAuthHook, "getAuthHook");
|
181595
|
-
__name(
|
181612
|
+
__name(deepStrictEqual, "deepStrictEqual");
|
181596
181613
|
}
|
181597
181614
|
});
|
181598
181615
|
|
@@ -181733,11 +181750,11 @@ async function getContainerDevOptions(containersConfig, containerBuildId) {
|
|
181733
181750
|
}
|
181734
181751
|
return containers2;
|
181735
181752
|
}
|
181736
|
-
var
|
181753
|
+
var import_node_assert32, import_node_crypto15, import_promises36, import_miniflare27, LocalRuntimeController;
|
181737
181754
|
var init_LocalRuntimeController = __esm({
|
181738
181755
|
"src/api/startDevWorker/LocalRuntimeController.ts"() {
|
181739
181756
|
init_import_meta_url();
|
181740
|
-
|
181757
|
+
import_node_assert32 = __toESM(require("assert"));
|
181741
181758
|
import_node_crypto15 = require("crypto");
|
181742
181759
|
import_promises36 = require("fs/promises");
|
181743
181760
|
init_containers_shared();
|
@@ -181813,7 +181830,7 @@ var init_LocalRuntimeController = __esm({
|
|
181813
181830
|
}
|
181814
181831
|
if (data.config.containers?.length && data.config.dev.enableContainers && this.#currentContainerBuildId !== data.config.dev.containerBuildId) {
|
181815
181832
|
this.dockerPath = data.config.dev?.dockerPath ?? getDockerPath();
|
181816
|
-
(0,
|
181833
|
+
(0, import_node_assert32.default)(
|
181817
181834
|
data.config.dev.containerBuildId,
|
181818
181835
|
"Build ID should be set if containers are enabled and defined"
|
181819
181836
|
);
|
@@ -181943,7 +181960,7 @@ var init_LocalRuntimeController = __esm({
|
|
181943
181960
|
if (!this.containerImageTagsSeen.size) {
|
181944
181961
|
return;
|
181945
181962
|
}
|
181946
|
-
(0,
|
181963
|
+
(0, import_node_assert32.default)(
|
181947
181964
|
this.dockerPath,
|
181948
181965
|
"Docker path should have been set if containers are enabled"
|
181949
181966
|
);
|
@@ -182006,11 +182023,11 @@ function ensureMatchingSql(options) {
|
|
182006
182023
|
}
|
182007
182024
|
return options;
|
182008
182025
|
}
|
182009
|
-
var
|
182026
|
+
var import_node_assert33, import_node_crypto16, import_miniflare28, MultiworkerRuntimeController;
|
182010
182027
|
var init_MultiworkerRuntimeController = __esm({
|
182011
182028
|
"src/api/startDevWorker/MultiworkerRuntimeController.ts"() {
|
182012
182029
|
init_import_meta_url();
|
182013
|
-
|
182030
|
+
import_node_assert33 = __toESM(require("assert"));
|
182014
182031
|
import_node_crypto16 = require("crypto");
|
182015
182032
|
init_containers_shared();
|
182016
182033
|
init_source();
|
@@ -182054,7 +182071,7 @@ var init_MultiworkerRuntimeController = __esm({
|
|
182054
182071
|
}
|
182055
182072
|
#mergedMfOptions() {
|
182056
182073
|
const primary = [...this.#options.values()].find((o5) => o5.primary);
|
182057
|
-
(0,
|
182074
|
+
(0, import_node_assert33.default)(primary !== void 0);
|
182058
182075
|
const secondary = [...this.#options.values()].filter((o5) => !o5.primary);
|
182059
182076
|
return {
|
182060
182077
|
...primary.options,
|
@@ -182090,7 +182107,7 @@ var init_MultiworkerRuntimeController = __esm({
|
|
182090
182107
|
}
|
182091
182108
|
if (data.config.containers?.length && this.#currentContainerBuildId !== data.config.dev.containerBuildId) {
|
182092
182109
|
logger.log(source_default.dim("\u2394 Preparing container image(s)..."));
|
182093
|
-
(0,
|
182110
|
+
(0, import_node_assert33.default)(
|
182094
182111
|
data.config.dev.containerBuildId,
|
182095
182112
|
"Build ID should be set if containers are enabled and defined"
|
182096
182113
|
);
|
@@ -184712,11 +184729,11 @@ async function generateAssetsFetch(directory, log2) {
|
|
184712
184729
|
return await generateResponse(request4);
|
184713
184730
|
};
|
184714
184731
|
}
|
184715
|
-
var
|
184732
|
+
var import_node_assert34, import_node_fs36, import_node_path67, import_mime3, import_miniflare30, import_undici24, ProxyDispatcher, invalidAssetsFetch;
|
184716
184733
|
var init_assets2 = __esm({
|
184717
184734
|
"src/miniflare-cli/assets.ts"() {
|
184718
184735
|
init_import_meta_url();
|
184719
|
-
|
184736
|
+
import_node_assert34 = __toESM(require("assert"));
|
184720
184737
|
import_node_fs36 = require("fs");
|
184721
184738
|
import_node_path67 = require("path");
|
184722
184739
|
init_createMetadataObject();
|
@@ -184754,12 +184771,12 @@ var init_assets2 = __esm({
|
|
184754
184771
|
* by the `fetch()` function before calling `dispatcher.dispatch()`.
|
184755
184772
|
*/
|
184756
184773
|
static reinstateHostHeader(headers, host) {
|
184757
|
-
(0,
|
184758
|
-
(0,
|
184774
|
+
(0, import_node_assert34.default)(headers, "Expected all proxy requests to contain headers.");
|
184775
|
+
(0, import_node_assert34.default)(
|
184759
184776
|
!Array.isArray(headers),
|
184760
184777
|
"Expected proxy request headers to be a hash object"
|
184761
184778
|
);
|
184762
|
-
(0,
|
184779
|
+
(0, import_node_assert34.default)(
|
184763
184780
|
Object.keys(headers).every((h6) => h6.toLowerCase() !== "host"),
|
184764
184781
|
"Expected Host header to have been deleted."
|
184765
184782
|
);
|
@@ -184923,7 +184940,7 @@ async function startDev(args) {
|
|
184923
184940
|
unregisterHotKeys?.();
|
184924
184941
|
accountId = await requireAuth(config);
|
184925
184942
|
if (hotkeysDisplayed) {
|
184926
|
-
(0,
|
184943
|
+
(0, import_node_assert35.default)(devEnv !== void 0);
|
184927
184944
|
unregisterHotKeys = registerDevHotKeys(
|
184928
184945
|
Array.isArray(devEnv) ? devEnv : [devEnv],
|
184929
184946
|
args
|
@@ -185011,7 +185028,7 @@ async function startDev(args) {
|
|
185011
185028
|
...Array.isArray(devEnv) ? devEnv.map((d6) => d6.teardown()) : [devEnv?.teardown()],
|
185012
185029
|
(async () => {
|
185013
185030
|
if (teardownRegistryPromise) {
|
185014
|
-
(0,
|
185031
|
+
(0, import_node_assert35.default)(devEnv === void 0 || !Array.isArray(devEnv));
|
185015
185032
|
const teardownRegistry = await teardownRegistryPromise;
|
185016
185033
|
await teardownRegistry(devEnv?.config.latestConfig?.name);
|
185017
185034
|
}
|
@@ -185259,11 +185276,11 @@ function getAssetChangeMessage(eventName, assetPath) {
|
|
185259
185276
|
}
|
185260
185277
|
return message;
|
185261
185278
|
}
|
185262
|
-
var
|
185279
|
+
var import_node_assert35, import_node_events6, import_node_path68, import_env2, dev;
|
185263
185280
|
var init_dev2 = __esm({
|
185264
185281
|
"src/dev.ts"() {
|
185265
185282
|
init_import_meta_url();
|
185266
|
-
|
185283
|
+
import_node_assert35 = __toESM(require("assert"));
|
185267
185284
|
import_node_events6 = __toESM(require("events"));
|
185268
185285
|
import_node_path68 = __toESM(require("path"));
|
185269
185286
|
init_colors();
|
@@ -185543,7 +185560,7 @@ var init_dev2 = __esm({
|
|
185543
185560
|
},
|
185544
185561
|
async handler(args) {
|
185545
185562
|
const devInstance = await startDev(args);
|
185546
|
-
(0,
|
185563
|
+
(0, import_node_assert35.default)(devInstance.devEnv !== void 0);
|
185547
185564
|
await import_node_events6.default.once(devInstance.devEnv, "teardown");
|
185548
185565
|
await Promise.all(devInstance.secondary.map((d6) => d6.teardown()));
|
185549
185566
|
if (devInstance.teardownRegistryPromise) {
|