wrangler 4.42.1 → 4.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +8 -8
- package/wrangler-dist/cli.d.ts +14 -5
- package/wrangler-dist/cli.js +690 -500
- package/wrangler-dist/metafile-cjs.json +1 -1
package/wrangler-dist/cli.js
CHANGED
|
@@ -2787,7 +2787,7 @@ var require_util = __commonJS({
|
|
|
2787
2787
|
"../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/core/util.js"(exports2, module3) {
|
|
2788
2788
|
"use strict";
|
|
2789
2789
|
init_import_meta_url();
|
|
2790
|
-
var
|
|
2790
|
+
var assert45 = require("assert");
|
|
2791
2791
|
var { kDestroyed, kBodyUsed, kListeners, kBody } = require_symbols();
|
|
2792
2792
|
var { IncomingMessage } = require("http");
|
|
2793
2793
|
var stream2 = require("stream");
|
|
@@ -2808,7 +2808,7 @@ var require_util = __commonJS({
|
|
|
2808
2808
|
this[kBodyUsed] = false;
|
|
2809
2809
|
}
|
|
2810
2810
|
async *[Symbol.asyncIterator]() {
|
|
2811
|
-
|
|
2811
|
+
assert45(!this[kBodyUsed], "disturbed");
|
|
2812
2812
|
this[kBodyUsed] = true;
|
|
2813
2813
|
yield* this[kBody];
|
|
2814
2814
|
}
|
|
@@ -2820,7 +2820,7 @@ var require_util = __commonJS({
|
|
|
2820
2820
|
if (isStream2(body)) {
|
|
2821
2821
|
if (bodyLength(body) === 0) {
|
|
2822
2822
|
body.on("data", function() {
|
|
2823
|
-
|
|
2823
|
+
assert45(false);
|
|
2824
2824
|
});
|
|
2825
2825
|
}
|
|
2826
2826
|
if (typeof body.readableDidRead !== "boolean") {
|
|
@@ -2934,7 +2934,7 @@ var require_util = __commonJS({
|
|
|
2934
2934
|
function getHostname(host) {
|
|
2935
2935
|
if (host[0] === "[") {
|
|
2936
2936
|
const idx2 = host.indexOf("]");
|
|
2937
|
-
|
|
2937
|
+
assert45(idx2 !== -1);
|
|
2938
2938
|
return host.substring(1, idx2);
|
|
2939
2939
|
}
|
|
2940
2940
|
const idx = host.indexOf(":");
|
|
@@ -2946,7 +2946,7 @@ var require_util = __commonJS({
|
|
|
2946
2946
|
if (!host) {
|
|
2947
2947
|
return null;
|
|
2948
2948
|
}
|
|
2949
|
-
|
|
2949
|
+
assert45(typeof host === "string");
|
|
2950
2950
|
const servername = getHostname(host);
|
|
2951
2951
|
if (net2.isIP(servername)) {
|
|
2952
2952
|
return "";
|
|
@@ -3253,7 +3253,7 @@ var require_util = __commonJS({
|
|
|
3253
3253
|
function errorRequest(client, request4, err) {
|
|
3254
3254
|
try {
|
|
3255
3255
|
request4.onError(err);
|
|
3256
|
-
|
|
3256
|
+
assert45(request4.aborted);
|
|
3257
3257
|
} catch (err2) {
|
|
3258
3258
|
client.emit("error", err2);
|
|
3259
3259
|
}
|
|
@@ -3629,7 +3629,7 @@ var require_request = __commonJS({
|
|
|
3629
3629
|
InvalidArgumentError,
|
|
3630
3630
|
NotSupportedError
|
|
3631
3631
|
} = require_errors();
|
|
3632
|
-
var
|
|
3632
|
+
var assert45 = require("assert");
|
|
3633
3633
|
var {
|
|
3634
3634
|
isValidHTTPToken,
|
|
3635
3635
|
isValidHeaderValue,
|
|
@@ -3807,8 +3807,8 @@ var require_request = __commonJS({
|
|
|
3807
3807
|
}
|
|
3808
3808
|
}
|
|
3809
3809
|
onConnect(abort) {
|
|
3810
|
-
|
|
3811
|
-
|
|
3810
|
+
assert45(!this.aborted);
|
|
3811
|
+
assert45(!this.completed);
|
|
3812
3812
|
if (this.error) {
|
|
3813
3813
|
abort(this.error);
|
|
3814
3814
|
} else {
|
|
@@ -3820,8 +3820,8 @@ var require_request = __commonJS({
|
|
|
3820
3820
|
return this[kHandler].onResponseStarted?.();
|
|
3821
3821
|
}
|
|
3822
3822
|
onHeaders(statusCode, headers, resume, statusText) {
|
|
3823
|
-
|
|
3824
|
-
|
|
3823
|
+
assert45(!this.aborted);
|
|
3824
|
+
assert45(!this.completed);
|
|
3825
3825
|
if (channels.headers.hasSubscribers) {
|
|
3826
3826
|
channels.headers.publish({ request: this, response: { statusCode, headers, statusText } });
|
|
3827
3827
|
}
|
|
@@ -3832,8 +3832,8 @@ var require_request = __commonJS({
|
|
|
3832
3832
|
}
|
|
3833
3833
|
}
|
|
3834
3834
|
onData(chunk) {
|
|
3835
|
-
|
|
3836
|
-
|
|
3835
|
+
assert45(!this.aborted);
|
|
3836
|
+
assert45(!this.completed);
|
|
3837
3837
|
if (channels.bodyChunkReceived.hasSubscribers) {
|
|
3838
3838
|
channels.bodyChunkReceived.publish({ request: this, chunk });
|
|
3839
3839
|
}
|
|
@@ -3845,14 +3845,14 @@ var require_request = __commonJS({
|
|
|
3845
3845
|
}
|
|
3846
3846
|
}
|
|
3847
3847
|
onUpgrade(statusCode, headers, socket) {
|
|
3848
|
-
|
|
3849
|
-
|
|
3848
|
+
assert45(!this.aborted);
|
|
3849
|
+
assert45(!this.completed);
|
|
3850
3850
|
return this[kHandler].onUpgrade(statusCode, headers, socket);
|
|
3851
3851
|
}
|
|
3852
3852
|
onComplete(trailers) {
|
|
3853
3853
|
this.onFinally();
|
|
3854
|
-
|
|
3855
|
-
|
|
3854
|
+
assert45(!this.aborted);
|
|
3855
|
+
assert45(!this.completed);
|
|
3856
3856
|
this.completed = true;
|
|
3857
3857
|
if (channels.trailers.hasSubscribers) {
|
|
3858
3858
|
channels.trailers.publish({ request: this, trailers });
|
|
@@ -4322,7 +4322,7 @@ var require_connect = __commonJS({
|
|
|
4322
4322
|
"use strict";
|
|
4323
4323
|
init_import_meta_url();
|
|
4324
4324
|
var net2 = require("net");
|
|
4325
|
-
var
|
|
4325
|
+
var assert45 = require("assert");
|
|
4326
4326
|
var util3 = require_util();
|
|
4327
4327
|
var { InvalidArgumentError } = require_errors();
|
|
4328
4328
|
var tls;
|
|
@@ -4371,7 +4371,7 @@ var require_connect = __commonJS({
|
|
|
4371
4371
|
}
|
|
4372
4372
|
servername = servername || options.servername || util3.getServerName(host) || null;
|
|
4373
4373
|
const sessionKey = servername || hostname2;
|
|
4374
|
-
|
|
4374
|
+
assert45(sessionKey);
|
|
4375
4375
|
const session = customSession || sessionCache.get(sessionKey) || null;
|
|
4376
4376
|
port = port || 443;
|
|
4377
4377
|
socket = tls.connect({
|
|
@@ -4391,7 +4391,7 @@ var require_connect = __commonJS({
|
|
|
4391
4391
|
sessionCache.set(sessionKey, session2);
|
|
4392
4392
|
});
|
|
4393
4393
|
} else {
|
|
4394
|
-
|
|
4394
|
+
assert45(!httpSocket, "httpSocket can only be sent on TLS update");
|
|
4395
4395
|
port = port || 80;
|
|
4396
4396
|
socket = net2.connect({
|
|
4397
4397
|
highWaterMark: 64 * 1024,
|
|
@@ -5341,14 +5341,14 @@ var require_data_url = __commonJS({
|
|
|
5341
5341
|
"../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/web/fetch/data-url.js"(exports2, module3) {
|
|
5342
5342
|
"use strict";
|
|
5343
5343
|
init_import_meta_url();
|
|
5344
|
-
var
|
|
5344
|
+
var assert45 = require("assert");
|
|
5345
5345
|
var encoder = new TextEncoder();
|
|
5346
5346
|
var HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/;
|
|
5347
5347
|
var HTTP_WHITESPACE_REGEX = /[\u000A\u000D\u0009\u0020]/;
|
|
5348
5348
|
var ASCII_WHITESPACE_REPLACE_REGEX = /[\u0009\u000A\u000C\u000D\u0020]/g;
|
|
5349
5349
|
var HTTP_QUOTED_STRING_TOKENS = /^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;
|
|
5350
5350
|
function dataURLProcessor(dataURL) {
|
|
5351
|
-
|
|
5351
|
+
assert45(dataURL.protocol === "data:");
|
|
5352
5352
|
let input = URLSerializer(dataURL, true);
|
|
5353
5353
|
input = input.slice(5);
|
|
5354
5354
|
const position = { position: 0 };
|
|
@@ -5559,7 +5559,7 @@ var require_data_url = __commonJS({
|
|
|
5559
5559
|
function collectAnHTTPQuotedString(input, position, extractValue = false) {
|
|
5560
5560
|
const positionStart = position.position;
|
|
5561
5561
|
let value = "";
|
|
5562
|
-
|
|
5562
|
+
assert45(input[position.position] === '"');
|
|
5563
5563
|
position.position++;
|
|
5564
5564
|
while (true) {
|
|
5565
5565
|
value += collectASequenceOfCodePoints(
|
|
@@ -5580,7 +5580,7 @@ var require_data_url = __commonJS({
|
|
|
5580
5580
|
value += input[position.position];
|
|
5581
5581
|
position.position++;
|
|
5582
5582
|
} else {
|
|
5583
|
-
|
|
5583
|
+
assert45(quoteOrBackslash === '"');
|
|
5584
5584
|
break;
|
|
5585
5585
|
}
|
|
5586
5586
|
}
|
|
@@ -5591,7 +5591,7 @@ var require_data_url = __commonJS({
|
|
|
5591
5591
|
}
|
|
5592
5592
|
__name(collectAnHTTPQuotedString, "collectAnHTTPQuotedString");
|
|
5593
5593
|
function serializeAMimeType(mimeType) {
|
|
5594
|
-
|
|
5594
|
+
assert45(mimeType !== "failure");
|
|
5595
5595
|
const { parameters, essence } = mimeType;
|
|
5596
5596
|
let serialization = essence;
|
|
5597
5597
|
for (let [name2, value] of parameters.entries()) {
|
|
@@ -6195,7 +6195,7 @@ var require_util2 = __commonJS({
|
|
|
6195
6195
|
var { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require_data_url();
|
|
6196
6196
|
var { performance: performance2 } = require("perf_hooks");
|
|
6197
6197
|
var { ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require_util();
|
|
6198
|
-
var
|
|
6198
|
+
var assert45 = require("assert");
|
|
6199
6199
|
var { isUint8Array } = require("util/types");
|
|
6200
6200
|
var { webidl } = require_webidl();
|
|
6201
6201
|
var supportedHashes = [];
|
|
@@ -6406,7 +6406,7 @@ var require_util2 = __commonJS({
|
|
|
6406
6406
|
__name(clonePolicyContainer, "clonePolicyContainer");
|
|
6407
6407
|
function determineRequestsReferrer(request4) {
|
|
6408
6408
|
const policy = request4.referrerPolicy;
|
|
6409
|
-
|
|
6409
|
+
assert45(policy);
|
|
6410
6410
|
let referrerSource = null;
|
|
6411
6411
|
if (request4.referrer === "client") {
|
|
6412
6412
|
const globalOrigin = getGlobalOrigin();
|
|
@@ -6470,7 +6470,7 @@ var require_util2 = __commonJS({
|
|
|
6470
6470
|
}
|
|
6471
6471
|
__name(determineRequestsReferrer, "determineRequestsReferrer");
|
|
6472
6472
|
function stripURLForReferrer(url4, originOnly = false) {
|
|
6473
|
-
|
|
6473
|
+
assert45(webidl.is.URL(url4));
|
|
6474
6474
|
url4 = new URL(url4);
|
|
6475
6475
|
if (urlIsLocal(url4)) {
|
|
6476
6476
|
return "no-referrer";
|
|
@@ -6662,7 +6662,7 @@ var require_util2 = __commonJS({
|
|
|
6662
6662
|
if (result === void 0) {
|
|
6663
6663
|
throw new TypeError("Value is not JSON serializable");
|
|
6664
6664
|
}
|
|
6665
|
-
|
|
6665
|
+
assert45(typeof result === "string");
|
|
6666
6666
|
return result;
|
|
6667
6667
|
}
|
|
6668
6668
|
__name(serializeJavascriptValueToJSONString, "serializeJavascriptValueToJSONString");
|
|
@@ -6822,7 +6822,7 @@ var require_util2 = __commonJS({
|
|
|
6822
6822
|
__name(readableStreamClose, "readableStreamClose");
|
|
6823
6823
|
var invalidIsomorphicEncodeValueRegex = /[^\x00-\xFF]/;
|
|
6824
6824
|
function isomorphicEncode(input) {
|
|
6825
|
-
|
|
6825
|
+
assert45(!invalidIsomorphicEncodeValueRegex.test(input));
|
|
6826
6826
|
return input;
|
|
6827
6827
|
}
|
|
6828
6828
|
__name(isomorphicEncode, "isomorphicEncode");
|
|
@@ -6849,7 +6849,7 @@ var require_util2 = __commonJS({
|
|
|
6849
6849
|
}
|
|
6850
6850
|
__name(readAllBytes, "readAllBytes");
|
|
6851
6851
|
function urlIsLocal(url4) {
|
|
6852
|
-
|
|
6852
|
+
assert45("protocol" in url4);
|
|
6853
6853
|
const protocol = url4.protocol;
|
|
6854
6854
|
return protocol === "about:" || protocol === "blob:" || protocol === "data:";
|
|
6855
6855
|
}
|
|
@@ -6859,7 +6859,7 @@ var require_util2 = __commonJS({
|
|
|
6859
6859
|
}
|
|
6860
6860
|
__name(urlHasHttpsScheme, "urlHasHttpsScheme");
|
|
6861
6861
|
function urlIsHttpHttpsScheme(url4) {
|
|
6862
|
-
|
|
6862
|
+
assert45("protocol" in url4);
|
|
6863
6863
|
const protocol = url4.protocol;
|
|
6864
6864
|
return protocol === "http:" || protocol === "https:";
|
|
6865
6865
|
}
|
|
@@ -7032,7 +7032,7 @@ var require_util2 = __commonJS({
|
|
|
7032
7032
|
continue;
|
|
7033
7033
|
}
|
|
7034
7034
|
} else {
|
|
7035
|
-
|
|
7035
|
+
assert45(input.charCodeAt(position.position) === 44);
|
|
7036
7036
|
position.position++;
|
|
7037
7037
|
}
|
|
7038
7038
|
}
|
|
@@ -7313,7 +7313,7 @@ var require_formdata_parser = __commonJS({
|
|
|
7313
7313
|
var { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = require_data_url();
|
|
7314
7314
|
var { makeEntry } = require_formdata();
|
|
7315
7315
|
var { webidl } = require_webidl();
|
|
7316
|
-
var
|
|
7316
|
+
var assert45 = require("assert");
|
|
7317
7317
|
var formDataNameBuffer = Buffer.from('form-data; name="');
|
|
7318
7318
|
var filenameBuffer = Buffer.from("filename");
|
|
7319
7319
|
var dd = Buffer.from("--");
|
|
@@ -7342,7 +7342,7 @@ var require_formdata_parser = __commonJS({
|
|
|
7342
7342
|
}
|
|
7343
7343
|
__name(validateBoundary, "validateBoundary");
|
|
7344
7344
|
function multipartFormDataParser(input, mimeType) {
|
|
7345
|
-
|
|
7345
|
+
assert45(mimeType !== "failure" && mimeType.essence === "multipart/form-data");
|
|
7346
7346
|
const boundaryString = mimeType.parameters.get("boundary");
|
|
7347
7347
|
if (boundaryString === void 0) {
|
|
7348
7348
|
throw parsingError("missing boundary in content-type header");
|
|
@@ -7403,8 +7403,8 @@ var require_formdata_parser = __commonJS({
|
|
|
7403
7403
|
} else {
|
|
7404
7404
|
value = utf8DecodeBytes(Buffer.from(body));
|
|
7405
7405
|
}
|
|
7406
|
-
|
|
7407
|
-
|
|
7406
|
+
assert45(webidl.is.USVString(name2));
|
|
7407
|
+
assert45(typeof value === "string" && webidl.is.USVString(value) || webidl.is.File(value));
|
|
7408
7408
|
entryList.push(makeEntry(name2, value, filename));
|
|
7409
7409
|
}
|
|
7410
7410
|
}
|
|
@@ -7523,7 +7523,7 @@ var require_formdata_parser = __commonJS({
|
|
|
7523
7523
|
}
|
|
7524
7524
|
__name(parseMultipartFormDataHeaders, "parseMultipartFormDataHeaders");
|
|
7525
7525
|
function parseMultipartFormDataName(input, position) {
|
|
7526
|
-
|
|
7526
|
+
assert45(input[position.position - 1] === 34);
|
|
7527
7527
|
let name2 = collectASequenceOfBytes(
|
|
7528
7528
|
(char) => char !== 10 && char !== 13 && char !== 34,
|
|
7529
7529
|
input,
|
|
@@ -7617,7 +7617,7 @@ var require_body = __commonJS({
|
|
|
7617
7617
|
} = require_util2();
|
|
7618
7618
|
var { FormData: FormData13, setFormDataState } = require_formdata();
|
|
7619
7619
|
var { webidl } = require_webidl();
|
|
7620
|
-
var
|
|
7620
|
+
var assert45 = require("assert");
|
|
7621
7621
|
var { isErrored, isDisturbed } = require("stream");
|
|
7622
7622
|
var { isArrayBuffer: isArrayBuffer3 } = require("util/types");
|
|
7623
7623
|
var { serializeAMimeType } = require_data_url();
|
|
@@ -7660,7 +7660,7 @@ var require_body = __commonJS({
|
|
|
7660
7660
|
type: "bytes"
|
|
7661
7661
|
});
|
|
7662
7662
|
}
|
|
7663
|
-
|
|
7663
|
+
assert45(webidl.is.ReadableStream(stream2));
|
|
7664
7664
|
let action = null;
|
|
7665
7665
|
let source = null;
|
|
7666
7666
|
let length = null;
|
|
@@ -7779,8 +7779,8 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
|
7779
7779
|
__name(extractBody, "extractBody");
|
|
7780
7780
|
function safelyExtractBody(object, keepalive = false) {
|
|
7781
7781
|
if (webidl.is.ReadableStream(object)) {
|
|
7782
|
-
|
|
7783
|
-
|
|
7782
|
+
assert45(!util3.isDisturbed(object), "The body has already been consumed.");
|
|
7783
|
+
assert45(!object.locked, "The stream is locked.");
|
|
7784
7784
|
}
|
|
7785
7785
|
return extractBody(object, keepalive);
|
|
7786
7786
|
}
|
|
@@ -7922,7 +7922,7 @@ var require_client_h1 = __commonJS({
|
|
|
7922
7922
|
"../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/dispatcher/client-h1.js"(exports2, module3) {
|
|
7923
7923
|
"use strict";
|
|
7924
7924
|
init_import_meta_url();
|
|
7925
|
-
var
|
|
7925
|
+
var assert45 = require("assert");
|
|
7926
7926
|
var util3 = require_util();
|
|
7927
7927
|
var { channels } = require_diagnostics();
|
|
7928
7928
|
var timers = require_timers();
|
|
@@ -8003,7 +8003,7 @@ var require_client_h1 = __commonJS({
|
|
|
8003
8003
|
* @returns {number}
|
|
8004
8004
|
*/
|
|
8005
8005
|
wasm_on_status: /* @__PURE__ */ __name((p7, at3, len) => {
|
|
8006
|
-
|
|
8006
|
+
assert45(currentParser.ptr === p7);
|
|
8007
8007
|
const start = at3 - currentBufferPtr + currentBufferRef.byteOffset;
|
|
8008
8008
|
return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len));
|
|
8009
8009
|
}, "wasm_on_status"),
|
|
@@ -8012,7 +8012,7 @@ var require_client_h1 = __commonJS({
|
|
|
8012
8012
|
* @returns {number}
|
|
8013
8013
|
*/
|
|
8014
8014
|
wasm_on_message_begin: /* @__PURE__ */ __name((p7) => {
|
|
8015
|
-
|
|
8015
|
+
assert45(currentParser.ptr === p7);
|
|
8016
8016
|
return currentParser.onMessageBegin();
|
|
8017
8017
|
}, "wasm_on_message_begin"),
|
|
8018
8018
|
/**
|
|
@@ -8022,7 +8022,7 @@ var require_client_h1 = __commonJS({
|
|
|
8022
8022
|
* @returns {number}
|
|
8023
8023
|
*/
|
|
8024
8024
|
wasm_on_header_field: /* @__PURE__ */ __name((p7, at3, len) => {
|
|
8025
|
-
|
|
8025
|
+
assert45(currentParser.ptr === p7);
|
|
8026
8026
|
const start = at3 - currentBufferPtr + currentBufferRef.byteOffset;
|
|
8027
8027
|
return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len));
|
|
8028
8028
|
}, "wasm_on_header_field"),
|
|
@@ -8033,7 +8033,7 @@ var require_client_h1 = __commonJS({
|
|
|
8033
8033
|
* @returns {number}
|
|
8034
8034
|
*/
|
|
8035
8035
|
wasm_on_header_value: /* @__PURE__ */ __name((p7, at3, len) => {
|
|
8036
|
-
|
|
8036
|
+
assert45(currentParser.ptr === p7);
|
|
8037
8037
|
const start = at3 - currentBufferPtr + currentBufferRef.byteOffset;
|
|
8038
8038
|
return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len));
|
|
8039
8039
|
}, "wasm_on_header_value"),
|
|
@@ -8045,7 +8045,7 @@ var require_client_h1 = __commonJS({
|
|
|
8045
8045
|
* @returns {number}
|
|
8046
8046
|
*/
|
|
8047
8047
|
wasm_on_headers_complete: /* @__PURE__ */ __name((p7, statusCode, upgrade, shouldKeepAlive) => {
|
|
8048
|
-
|
|
8048
|
+
assert45(currentParser.ptr === p7);
|
|
8049
8049
|
return currentParser.onHeadersComplete(statusCode, upgrade === 1, shouldKeepAlive === 1);
|
|
8050
8050
|
}, "wasm_on_headers_complete"),
|
|
8051
8051
|
/**
|
|
@@ -8055,7 +8055,7 @@ var require_client_h1 = __commonJS({
|
|
|
8055
8055
|
* @returns {number}
|
|
8056
8056
|
*/
|
|
8057
8057
|
wasm_on_body: /* @__PURE__ */ __name((p7, at3, len) => {
|
|
8058
|
-
|
|
8058
|
+
assert45(currentParser.ptr === p7);
|
|
8059
8059
|
const start = at3 - currentBufferPtr + currentBufferRef.byteOffset;
|
|
8060
8060
|
return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len));
|
|
8061
8061
|
}, "wasm_on_body"),
|
|
@@ -8064,7 +8064,7 @@ var require_client_h1 = __commonJS({
|
|
|
8064
8064
|
* @returns {number}
|
|
8065
8065
|
*/
|
|
8066
8066
|
wasm_on_message_complete: /* @__PURE__ */ __name((p7) => {
|
|
8067
|
-
|
|
8067
|
+
assert45(currentParser.ptr === p7);
|
|
8068
8068
|
return currentParser.onMessageComplete();
|
|
8069
8069
|
}, "wasm_on_message_complete")
|
|
8070
8070
|
}
|
|
@@ -8139,10 +8139,10 @@ var require_client_h1 = __commonJS({
|
|
|
8139
8139
|
if (this.socket.destroyed || !this.paused) {
|
|
8140
8140
|
return;
|
|
8141
8141
|
}
|
|
8142
|
-
|
|
8143
|
-
|
|
8142
|
+
assert45(this.ptr != null);
|
|
8143
|
+
assert45(currentParser === null);
|
|
8144
8144
|
this.llhttp.llhttp_resume(this.ptr);
|
|
8145
|
-
|
|
8145
|
+
assert45(this.timeoutType === TIMEOUT_BODY);
|
|
8146
8146
|
if (this.timeout) {
|
|
8147
8147
|
if (this.timeout.refresh) {
|
|
8148
8148
|
this.timeout.refresh();
|
|
@@ -8165,9 +8165,9 @@ var require_client_h1 = __commonJS({
|
|
|
8165
8165
|
* @param {Buffer} chunk
|
|
8166
8166
|
*/
|
|
8167
8167
|
execute(chunk) {
|
|
8168
|
-
|
|
8169
|
-
|
|
8170
|
-
|
|
8168
|
+
assert45(currentParser === null);
|
|
8169
|
+
assert45(this.ptr != null);
|
|
8170
|
+
assert45(!this.paused);
|
|
8171
8171
|
const { socket, llhttp } = this;
|
|
8172
8172
|
if (chunk.length > currentBufferSize) {
|
|
8173
8173
|
if (currentBufferPtr) {
|
|
@@ -8211,8 +8211,8 @@ var require_client_h1 = __commonJS({
|
|
|
8211
8211
|
}
|
|
8212
8212
|
}
|
|
8213
8213
|
destroy() {
|
|
8214
|
-
|
|
8215
|
-
|
|
8214
|
+
assert45(currentParser === null);
|
|
8215
|
+
assert45(this.ptr != null);
|
|
8216
8216
|
this.llhttp.llhttp_free(this.ptr);
|
|
8217
8217
|
this.ptr = null;
|
|
8218
8218
|
this.timeout && timers.clearTimeout(this.timeout);
|
|
@@ -8298,14 +8298,14 @@ var require_client_h1 = __commonJS({
|
|
|
8298
8298
|
*/
|
|
8299
8299
|
onUpgrade(head) {
|
|
8300
8300
|
const { upgrade, client, socket, headers, statusCode } = this;
|
|
8301
|
-
|
|
8302
|
-
|
|
8303
|
-
|
|
8304
|
-
|
|
8305
|
-
|
|
8301
|
+
assert45(upgrade);
|
|
8302
|
+
assert45(client[kSocket] === socket);
|
|
8303
|
+
assert45(!socket.destroyed);
|
|
8304
|
+
assert45(!this.paused);
|
|
8305
|
+
assert45((headers.length & 1) === 0);
|
|
8306
8306
|
const request4 = client[kQueue][client[kRunningIdx]];
|
|
8307
|
-
|
|
8308
|
-
|
|
8307
|
+
assert45(request4);
|
|
8308
|
+
assert45(request4.upgrade || request4.method === "CONNECT");
|
|
8309
8309
|
this.statusCode = 0;
|
|
8310
8310
|
this.statusText = "";
|
|
8311
8311
|
this.shouldKeepAlive = false;
|
|
@@ -8343,8 +8343,8 @@ var require_client_h1 = __commonJS({
|
|
|
8343
8343
|
if (!request4) {
|
|
8344
8344
|
return -1;
|
|
8345
8345
|
}
|
|
8346
|
-
|
|
8347
|
-
|
|
8346
|
+
assert45(!this.upgrade);
|
|
8347
|
+
assert45(this.statusCode < 200);
|
|
8348
8348
|
if (statusCode === 100) {
|
|
8349
8349
|
util3.destroy(socket, new SocketError("bad response", util3.getSocketInfo(socket)));
|
|
8350
8350
|
return -1;
|
|
@@ -8353,7 +8353,7 @@ var require_client_h1 = __commonJS({
|
|
|
8353
8353
|
util3.destroy(socket, new SocketError("bad upgrade", util3.getSocketInfo(socket)));
|
|
8354
8354
|
return -1;
|
|
8355
8355
|
}
|
|
8356
|
-
|
|
8356
|
+
assert45(this.timeoutType === TIMEOUT_HEADERS);
|
|
8357
8357
|
this.statusCode = statusCode;
|
|
8358
8358
|
this.shouldKeepAlive = shouldKeepAlive || // Override llhttp value which does not allow keepAlive for HEAD.
|
|
8359
8359
|
request4.method === "HEAD" && !socket[kReset2] && this.connection.toLowerCase() === "keep-alive";
|
|
@@ -8366,16 +8366,16 @@ var require_client_h1 = __commonJS({
|
|
|
8366
8366
|
}
|
|
8367
8367
|
}
|
|
8368
8368
|
if (request4.method === "CONNECT") {
|
|
8369
|
-
|
|
8369
|
+
assert45(client[kRunning] === 1);
|
|
8370
8370
|
this.upgrade = true;
|
|
8371
8371
|
return 2;
|
|
8372
8372
|
}
|
|
8373
8373
|
if (upgrade) {
|
|
8374
|
-
|
|
8374
|
+
assert45(client[kRunning] === 1);
|
|
8375
8375
|
this.upgrade = true;
|
|
8376
8376
|
return 2;
|
|
8377
8377
|
}
|
|
8378
|
-
|
|
8378
|
+
assert45((this.headers.length & 1) === 0);
|
|
8379
8379
|
this.headers = [];
|
|
8380
8380
|
this.headersSize = 0;
|
|
8381
8381
|
if (this.shouldKeepAlive && client[kPipelining]) {
|
|
@@ -8422,14 +8422,14 @@ var require_client_h1 = __commonJS({
|
|
|
8422
8422
|
return -1;
|
|
8423
8423
|
}
|
|
8424
8424
|
const request4 = client[kQueue][client[kRunningIdx]];
|
|
8425
|
-
|
|
8426
|
-
|
|
8425
|
+
assert45(request4);
|
|
8426
|
+
assert45(this.timeoutType === TIMEOUT_BODY);
|
|
8427
8427
|
if (this.timeout) {
|
|
8428
8428
|
if (this.timeout.refresh) {
|
|
8429
8429
|
this.timeout.refresh();
|
|
8430
8430
|
}
|
|
8431
8431
|
}
|
|
8432
|
-
|
|
8432
|
+
assert45(statusCode >= 200);
|
|
8433
8433
|
if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
|
|
8434
8434
|
util3.destroy(socket, new ResponseExceededMaxSizeError());
|
|
8435
8435
|
return -1;
|
|
@@ -8451,10 +8451,10 @@ var require_client_h1 = __commonJS({
|
|
|
8451
8451
|
if (upgrade) {
|
|
8452
8452
|
return 0;
|
|
8453
8453
|
}
|
|
8454
|
-
|
|
8455
|
-
|
|
8454
|
+
assert45(statusCode >= 100);
|
|
8455
|
+
assert45((this.headers.length & 1) === 0);
|
|
8456
8456
|
const request4 = client[kQueue][client[kRunningIdx]];
|
|
8457
|
-
|
|
8457
|
+
assert45(request4);
|
|
8458
8458
|
this.statusCode = 0;
|
|
8459
8459
|
this.statusText = "";
|
|
8460
8460
|
this.bytesRead = 0;
|
|
@@ -8473,7 +8473,7 @@ var require_client_h1 = __commonJS({
|
|
|
8473
8473
|
request4.onComplete(headers);
|
|
8474
8474
|
client[kQueue][client[kRunningIdx]++] = null;
|
|
8475
8475
|
if (socket[kWriting]) {
|
|
8476
|
-
|
|
8476
|
+
assert45(client[kRunning] === 0);
|
|
8477
8477
|
util3.destroy(socket, new InformationalError("reset"));
|
|
8478
8478
|
return constants4.ERROR.PAUSED;
|
|
8479
8479
|
} else if (!shouldKeepAlive) {
|
|
@@ -8494,7 +8494,7 @@ var require_client_h1 = __commonJS({
|
|
|
8494
8494
|
const { socket, timeoutType, client, paused } = parser2.deref();
|
|
8495
8495
|
if (timeoutType === TIMEOUT_HEADERS) {
|
|
8496
8496
|
if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
|
|
8497
|
-
|
|
8497
|
+
assert45(!paused, "cannot be paused while waiting for headers");
|
|
8498
8498
|
util3.destroy(socket, new HeadersTimeoutError());
|
|
8499
8499
|
}
|
|
8500
8500
|
} else if (timeoutType === TIMEOUT_BODY) {
|
|
@@ -8502,7 +8502,7 @@ var require_client_h1 = __commonJS({
|
|
|
8502
8502
|
util3.destroy(socket, new BodyTimeoutError());
|
|
8503
8503
|
}
|
|
8504
8504
|
} else if (timeoutType === TIMEOUT_KEEP_ALIVE) {
|
|
8505
|
-
|
|
8505
|
+
assert45(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]);
|
|
8506
8506
|
util3.destroy(socket, new InformationalError("socket idle timeout"));
|
|
8507
8507
|
}
|
|
8508
8508
|
}
|
|
@@ -8581,7 +8581,7 @@ var require_client_h1 = __commonJS({
|
|
|
8581
8581
|
}
|
|
8582
8582
|
__name(connectH1, "connectH1");
|
|
8583
8583
|
function onHttpSocketError(err) {
|
|
8584
|
-
|
|
8584
|
+
assert45(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
|
|
8585
8585
|
const parser2 = this[kParser];
|
|
8586
8586
|
if (err.code === "ECONNRESET" && parser2.statusCode && !parser2.shouldKeepAlive) {
|
|
8587
8587
|
parser2.onMessageComplete();
|
|
@@ -8618,7 +8618,7 @@ var require_client_h1 = __commonJS({
|
|
|
8618
8618
|
client[kSocket] = null;
|
|
8619
8619
|
client[kHTTPContext] = null;
|
|
8620
8620
|
if (client.destroyed) {
|
|
8621
|
-
|
|
8621
|
+
assert45(client[kPending] === 0);
|
|
8622
8622
|
const requests = client[kQueue].splice(client[kRunningIdx]);
|
|
8623
8623
|
for (let i6 = 0; i6 < requests.length; i6++) {
|
|
8624
8624
|
const request4 = requests[i6];
|
|
@@ -8630,7 +8630,7 @@ var require_client_h1 = __commonJS({
|
|
|
8630
8630
|
util3.errorRequest(client, request4, err);
|
|
8631
8631
|
}
|
|
8632
8632
|
client[kPendingIdx] = client[kRunningIdx];
|
|
8633
|
-
|
|
8633
|
+
assert45(client[kRunning] === 0);
|
|
8634
8634
|
client.emit("disconnect", client[kUrl], [client], err);
|
|
8635
8635
|
client[kResume]();
|
|
8636
8636
|
}
|
|
@@ -8786,13 +8786,13 @@ upgrade: ${upgrade}\r
|
|
|
8786
8786
|
} else if (util3.isIterable(body)) {
|
|
8787
8787
|
writeIterable(abort, body, client, request4, socket, contentLength, header, expectsPayload);
|
|
8788
8788
|
} else {
|
|
8789
|
-
|
|
8789
|
+
assert45(false);
|
|
8790
8790
|
}
|
|
8791
8791
|
return true;
|
|
8792
8792
|
}
|
|
8793
8793
|
__name(writeH1, "writeH1");
|
|
8794
8794
|
function writeStream(abort, body, client, request4, socket, contentLength, header, expectsPayload) {
|
|
8795
|
-
|
|
8795
|
+
assert45(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
|
|
8796
8796
|
let finished = false;
|
|
8797
8797
|
const writer = new AsyncWriter({ abort, socket, request: request4, contentLength, client, expectsPayload, header });
|
|
8798
8798
|
const onData = /* @__PURE__ */ __name(function(chunk) {
|
|
@@ -8829,7 +8829,7 @@ upgrade: ${upgrade}\r
|
|
|
8829
8829
|
return;
|
|
8830
8830
|
}
|
|
8831
8831
|
finished = true;
|
|
8832
|
-
|
|
8832
|
+
assert45(socket.destroyed || socket[kWriting] && client[kRunning] <= 1);
|
|
8833
8833
|
socket.off("drain", onDrain).off("error", onFinished);
|
|
8834
8834
|
body.removeListener("data", onData).removeListener("end", onFinished).removeListener("close", onClose);
|
|
8835
8835
|
if (!err) {
|
|
@@ -8869,12 +8869,12 @@ upgrade: ${upgrade}\r
|
|
|
8869
8869
|
\r
|
|
8870
8870
|
`, "latin1");
|
|
8871
8871
|
} else {
|
|
8872
|
-
|
|
8872
|
+
assert45(contentLength === null, "no body must not have content length");
|
|
8873
8873
|
socket.write(`${header}\r
|
|
8874
8874
|
`, "latin1");
|
|
8875
8875
|
}
|
|
8876
8876
|
} else if (util3.isBuffer(body)) {
|
|
8877
|
-
|
|
8877
|
+
assert45(contentLength === body.byteLength, "buffer body must have content length");
|
|
8878
8878
|
socket.cork();
|
|
8879
8879
|
socket.write(`${header}content-length: ${contentLength}\r
|
|
8880
8880
|
\r
|
|
@@ -8894,7 +8894,7 @@ upgrade: ${upgrade}\r
|
|
|
8894
8894
|
}
|
|
8895
8895
|
__name(writeBuffer, "writeBuffer");
|
|
8896
8896
|
async function writeBlob(abort, body, client, request4, socket, contentLength, header, expectsPayload) {
|
|
8897
|
-
|
|
8897
|
+
assert45(contentLength === body.size, "blob body must have content length");
|
|
8898
8898
|
try {
|
|
8899
8899
|
if (contentLength != null && contentLength !== body.size) {
|
|
8900
8900
|
throw new RequestContentLengthMismatchError();
|
|
@@ -8918,7 +8918,7 @@ upgrade: ${upgrade}\r
|
|
|
8918
8918
|
}
|
|
8919
8919
|
__name(writeBlob, "writeBlob");
|
|
8920
8920
|
async function writeIterable(abort, body, client, request4, socket, contentLength, header, expectsPayload) {
|
|
8921
|
-
|
|
8921
|
+
assert45(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
|
|
8922
8922
|
let callback = null;
|
|
8923
8923
|
function onDrain() {
|
|
8924
8924
|
if (callback) {
|
|
@@ -8929,7 +8929,7 @@ upgrade: ${upgrade}\r
|
|
|
8929
8929
|
}
|
|
8930
8930
|
__name(onDrain, "onDrain");
|
|
8931
8931
|
const waitForDrain = /* @__PURE__ */ __name(() => new Promise((resolve25, reject) => {
|
|
8932
|
-
|
|
8932
|
+
assert45(callback === null);
|
|
8933
8933
|
if (socket[kError]) {
|
|
8934
8934
|
reject(socket[kError]);
|
|
8935
8935
|
} else {
|
|
@@ -9082,7 +9082,7 @@ ${len.toString(16)}\r
|
|
|
9082
9082
|
const { socket, client, abort } = this;
|
|
9083
9083
|
socket[kWriting] = false;
|
|
9084
9084
|
if (err) {
|
|
9085
|
-
|
|
9085
|
+
assert45(client[kRunning] <= 1, "pipeline should only contain this request");
|
|
9086
9086
|
abort(err);
|
|
9087
9087
|
}
|
|
9088
9088
|
}
|
|
@@ -9096,7 +9096,7 @@ var require_client_h2 = __commonJS({
|
|
|
9096
9096
|
"../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/dispatcher/client-h2.js"(exports2, module3) {
|
|
9097
9097
|
"use strict";
|
|
9098
9098
|
init_import_meta_url();
|
|
9099
|
-
var
|
|
9099
|
+
var assert45 = require("assert");
|
|
9100
9100
|
var { pipeline } = require("stream");
|
|
9101
9101
|
var util3 = require_util();
|
|
9102
9102
|
var {
|
|
@@ -9226,7 +9226,7 @@ var require_client_h2 = __commonJS({
|
|
|
9226
9226
|
}
|
|
9227
9227
|
__name(resumeH2, "resumeH2");
|
|
9228
9228
|
function onHttp2SessionError(err) {
|
|
9229
|
-
|
|
9229
|
+
assert45(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
|
|
9230
9230
|
this[kSocket][kError] = err;
|
|
9231
9231
|
this[kClient][kOnError](err);
|
|
9232
9232
|
}
|
|
@@ -9259,7 +9259,7 @@ var require_client_h2 = __commonJS({
|
|
|
9259
9259
|
util3.errorRequest(client, request4, err);
|
|
9260
9260
|
client[kPendingIdx] = client[kRunningIdx];
|
|
9261
9261
|
}
|
|
9262
|
-
|
|
9262
|
+
assert45(client[kRunning] === 0);
|
|
9263
9263
|
client.emit("disconnect", client[kUrl], [client], err);
|
|
9264
9264
|
client.emit("connectionError", client[kUrl], [client], err);
|
|
9265
9265
|
client[kResume]();
|
|
@@ -9272,7 +9272,7 @@ var require_client_h2 = __commonJS({
|
|
|
9272
9272
|
client[kSocket] = null;
|
|
9273
9273
|
client[kHTTPContext] = null;
|
|
9274
9274
|
if (client.destroyed) {
|
|
9275
|
-
|
|
9275
|
+
assert45(client[kPending] === 0);
|
|
9276
9276
|
const requests = client[kQueue].splice(client[kRunningIdx]);
|
|
9277
9277
|
for (let i6 = 0; i6 < requests.length; i6++) {
|
|
9278
9278
|
const request4 = requests[i6];
|
|
@@ -9290,13 +9290,13 @@ var require_client_h2 = __commonJS({
|
|
|
9290
9290
|
this[kHTTP2Session].destroy(err);
|
|
9291
9291
|
}
|
|
9292
9292
|
client[kPendingIdx] = client[kRunningIdx];
|
|
9293
|
-
|
|
9293
|
+
assert45(client[kRunning] === 0);
|
|
9294
9294
|
client.emit("disconnect", client[kUrl], [client], err);
|
|
9295
9295
|
client[kResume]();
|
|
9296
9296
|
}
|
|
9297
9297
|
__name(onHttp2SocketClose, "onHttp2SocketClose");
|
|
9298
9298
|
function onHttp2SocketError(err) {
|
|
9299
|
-
|
|
9299
|
+
assert45(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
|
|
9300
9300
|
this[kError] = err;
|
|
9301
9301
|
this[kClient][kOnError](err);
|
|
9302
9302
|
}
|
|
@@ -9415,7 +9415,7 @@ var require_client_h2 = __commonJS({
|
|
|
9415
9415
|
process.emitWarning(new RequestContentLengthMismatchError());
|
|
9416
9416
|
}
|
|
9417
9417
|
if (contentLength != null) {
|
|
9418
|
-
|
|
9418
|
+
assert45(body, "no body must not have content length");
|
|
9419
9419
|
headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`;
|
|
9420
9420
|
}
|
|
9421
9421
|
session.ref();
|
|
@@ -9580,7 +9580,7 @@ var require_client_h2 = __commonJS({
|
|
|
9580
9580
|
expectsPayload
|
|
9581
9581
|
);
|
|
9582
9582
|
} else {
|
|
9583
|
-
|
|
9583
|
+
assert45(false);
|
|
9584
9584
|
}
|
|
9585
9585
|
}
|
|
9586
9586
|
__name(writeBodyH2, "writeBodyH2");
|
|
@@ -9589,7 +9589,7 @@ var require_client_h2 = __commonJS({
|
|
|
9589
9589
|
function writeBuffer(abort, h2stream, body, client, request4, socket, contentLength, expectsPayload) {
|
|
9590
9590
|
try {
|
|
9591
9591
|
if (body != null && util3.isBuffer(body)) {
|
|
9592
|
-
|
|
9592
|
+
assert45(contentLength === body.byteLength, "buffer body must have content length");
|
|
9593
9593
|
h2stream.cork();
|
|
9594
9594
|
h2stream.write(body);
|
|
9595
9595
|
h2stream.uncork();
|
|
@@ -9607,7 +9607,7 @@ var require_client_h2 = __commonJS({
|
|
|
9607
9607
|
}
|
|
9608
9608
|
__name(writeBuffer, "writeBuffer");
|
|
9609
9609
|
function writeStream(abort, socket, expectsPayload, h2stream, body, client, request4, contentLength) {
|
|
9610
|
-
|
|
9610
|
+
assert45(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
|
|
9611
9611
|
const pipe = pipeline(
|
|
9612
9612
|
body,
|
|
9613
9613
|
h2stream,
|
|
@@ -9633,7 +9633,7 @@ var require_client_h2 = __commonJS({
|
|
|
9633
9633
|
}
|
|
9634
9634
|
__name(writeStream, "writeStream");
|
|
9635
9635
|
async function writeBlob(abort, h2stream, body, client, request4, socket, contentLength, expectsPayload) {
|
|
9636
|
-
|
|
9636
|
+
assert45(contentLength === body.size, "blob body must have content length");
|
|
9637
9637
|
try {
|
|
9638
9638
|
if (contentLength != null && contentLength !== body.size) {
|
|
9639
9639
|
throw new RequestContentLengthMismatchError();
|
|
@@ -9655,7 +9655,7 @@ var require_client_h2 = __commonJS({
|
|
|
9655
9655
|
}
|
|
9656
9656
|
__name(writeBlob, "writeBlob");
|
|
9657
9657
|
async function writeIterable(abort, h2stream, body, client, request4, socket, contentLength, expectsPayload) {
|
|
9658
|
-
|
|
9658
|
+
assert45(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
|
|
9659
9659
|
let callback = null;
|
|
9660
9660
|
function onDrain() {
|
|
9661
9661
|
if (callback) {
|
|
@@ -9666,7 +9666,7 @@ var require_client_h2 = __commonJS({
|
|
|
9666
9666
|
}
|
|
9667
9667
|
__name(onDrain, "onDrain");
|
|
9668
9668
|
const waitForDrain = /* @__PURE__ */ __name(() => new Promise((resolve25, reject) => {
|
|
9669
|
-
|
|
9669
|
+
assert45(callback === null);
|
|
9670
9670
|
if (socket[kError]) {
|
|
9671
9671
|
reject(socket[kError]);
|
|
9672
9672
|
} else {
|
|
@@ -9707,7 +9707,7 @@ var require_client = __commonJS({
|
|
|
9707
9707
|
"../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/dispatcher/client.js"(exports2, module3) {
|
|
9708
9708
|
"use strict";
|
|
9709
9709
|
init_import_meta_url();
|
|
9710
|
-
var
|
|
9710
|
+
var assert45 = require("assert");
|
|
9711
9711
|
var net2 = require("net");
|
|
9712
9712
|
var http6 = require("http");
|
|
9713
9713
|
var util3 = require_util();
|
|
@@ -9997,25 +9997,25 @@ var require_client = __commonJS({
|
|
|
9997
9997
|
};
|
|
9998
9998
|
function onError(client, err) {
|
|
9999
9999
|
if (client[kRunning] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") {
|
|
10000
|
-
|
|
10000
|
+
assert45(client[kPendingIdx] === client[kRunningIdx]);
|
|
10001
10001
|
const requests = client[kQueue].splice(client[kRunningIdx]);
|
|
10002
10002
|
for (let i6 = 0; i6 < requests.length; i6++) {
|
|
10003
10003
|
const request4 = requests[i6];
|
|
10004
10004
|
util3.errorRequest(client, request4, err);
|
|
10005
10005
|
}
|
|
10006
|
-
|
|
10006
|
+
assert45(client[kSize] === 0);
|
|
10007
10007
|
}
|
|
10008
10008
|
}
|
|
10009
10009
|
__name(onError, "onError");
|
|
10010
10010
|
async function connect(client) {
|
|
10011
|
-
|
|
10012
|
-
|
|
10011
|
+
assert45(!client[kConnecting]);
|
|
10012
|
+
assert45(!client[kHTTPContext]);
|
|
10013
10013
|
let { host, hostname: hostname2, protocol, port } = client[kUrl];
|
|
10014
10014
|
if (hostname2[0] === "[") {
|
|
10015
10015
|
const idx = hostname2.indexOf("]");
|
|
10016
|
-
|
|
10016
|
+
assert45(idx !== -1);
|
|
10017
10017
|
const ip = hostname2.substring(1, idx);
|
|
10018
|
-
|
|
10018
|
+
assert45(net2.isIPv6(ip));
|
|
10019
10019
|
hostname2 = ip;
|
|
10020
10020
|
}
|
|
10021
10021
|
client[kConnecting] = true;
|
|
@@ -10054,7 +10054,7 @@ var require_client = __commonJS({
|
|
|
10054
10054
|
util3.destroy(socket.on("error", noop), new ClientDestroyedError());
|
|
10055
10055
|
return;
|
|
10056
10056
|
}
|
|
10057
|
-
|
|
10057
|
+
assert45(socket);
|
|
10058
10058
|
try {
|
|
10059
10059
|
client[kHTTPContext] = socket.alpnProtocol === "h2" ? await connectH2(client, socket) : await connectH1(client, socket);
|
|
10060
10060
|
} catch (err) {
|
|
@@ -10103,7 +10103,7 @@ var require_client = __commonJS({
|
|
|
10103
10103
|
});
|
|
10104
10104
|
}
|
|
10105
10105
|
if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") {
|
|
10106
|
-
|
|
10106
|
+
assert45(client[kRunning] === 0);
|
|
10107
10107
|
while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
|
|
10108
10108
|
const request4 = client[kQueue][client[kPendingIdx]++];
|
|
10109
10109
|
util3.errorRequest(client, request4, err);
|
|
@@ -10138,7 +10138,7 @@ var require_client = __commonJS({
|
|
|
10138
10138
|
function _resume(client, sync) {
|
|
10139
10139
|
while (true) {
|
|
10140
10140
|
if (client.destroyed) {
|
|
10141
|
-
|
|
10141
|
+
assert45(client[kPending] === 0);
|
|
10142
10142
|
return;
|
|
10143
10143
|
}
|
|
10144
10144
|
if (client[kClosedResolve] && !client[kSize]) {
|
|
@@ -11191,7 +11191,7 @@ var require_retry_handler = __commonJS({
|
|
|
11191
11191
|
"../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/handler/retry-handler.js"(exports2, module3) {
|
|
11192
11192
|
"use strict";
|
|
11193
11193
|
init_import_meta_url();
|
|
11194
|
-
var
|
|
11194
|
+
var assert45 = require("assert");
|
|
11195
11195
|
var { kRetryHandlerDefaultRetry } = require_symbols();
|
|
11196
11196
|
var { RequestRetryError } = require_errors();
|
|
11197
11197
|
var WrapHandler = require_wrap_handler();
|
|
@@ -11379,8 +11379,8 @@ var require_retry_handler = __commonJS({
|
|
|
11379
11379
|
});
|
|
11380
11380
|
}
|
|
11381
11381
|
const { start, size, end = size ? size - 1 : null } = contentRange;
|
|
11382
|
-
|
|
11383
|
-
|
|
11382
|
+
assert45(this.start === start, "content-range mismatch");
|
|
11383
|
+
assert45(this.end == null || this.end === end, "content-range mismatch");
|
|
11384
11384
|
return;
|
|
11385
11385
|
}
|
|
11386
11386
|
if (this.end == null) {
|
|
@@ -11397,11 +11397,11 @@ var require_retry_handler = __commonJS({
|
|
|
11397
11397
|
return;
|
|
11398
11398
|
}
|
|
11399
11399
|
const { start, size, end = size ? size - 1 : null } = range;
|
|
11400
|
-
|
|
11400
|
+
assert45(
|
|
11401
11401
|
start != null && Number.isFinite(start),
|
|
11402
11402
|
"content-range mismatch"
|
|
11403
11403
|
);
|
|
11404
|
-
|
|
11404
|
+
assert45(end != null && Number.isFinite(end), "invalid content-length");
|
|
11405
11405
|
this.start = start;
|
|
11406
11406
|
this.end = end;
|
|
11407
11407
|
}
|
|
@@ -11409,8 +11409,8 @@ var require_retry_handler = __commonJS({
|
|
|
11409
11409
|
const contentLength = headers["content-length"];
|
|
11410
11410
|
this.end = contentLength != null ? Number(contentLength) - 1 : null;
|
|
11411
11411
|
}
|
|
11412
|
-
|
|
11413
|
-
|
|
11412
|
+
assert45(Number.isFinite(this.start));
|
|
11413
|
+
assert45(
|
|
11414
11414
|
this.end == null || Number.isFinite(this.end),
|
|
11415
11415
|
"invalid content-length"
|
|
11416
11416
|
);
|
|
@@ -11646,7 +11646,7 @@ var require_readable = __commonJS({
|
|
|
11646
11646
|
"../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/api/readable.js"(exports2, module3) {
|
|
11647
11647
|
"use strict";
|
|
11648
11648
|
init_import_meta_url();
|
|
11649
|
-
var
|
|
11649
|
+
var assert45 = require("assert");
|
|
11650
11650
|
var { Readable: Readable10 } = require("stream");
|
|
11651
11651
|
var { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError: AbortError3 } = require_errors();
|
|
11652
11652
|
var util3 = require_util();
|
|
@@ -11843,7 +11843,7 @@ var require_readable = __commonJS({
|
|
|
11843
11843
|
this[kBody] = ReadableStreamFrom(this);
|
|
11844
11844
|
if (this[kConsume]) {
|
|
11845
11845
|
this[kBody].getReader();
|
|
11846
|
-
|
|
11846
|
+
assert45(this[kBody].locked);
|
|
11847
11847
|
}
|
|
11848
11848
|
}
|
|
11849
11849
|
return this[kBody];
|
|
@@ -11912,7 +11912,7 @@ var require_readable = __commonJS({
|
|
|
11912
11912
|
}
|
|
11913
11913
|
__name(isUnusable, "isUnusable");
|
|
11914
11914
|
function consume(stream2, type) {
|
|
11915
|
-
|
|
11915
|
+
assert45(!stream2[kConsume]);
|
|
11916
11916
|
return new Promise((resolve25, reject) => {
|
|
11917
11917
|
if (isUnusable(stream2)) {
|
|
11918
11918
|
const rState = stream2._readableState;
|
|
@@ -12059,7 +12059,7 @@ var require_api_request = __commonJS({
|
|
|
12059
12059
|
"../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/api/api-request.js"(exports2, module3) {
|
|
12060
12060
|
"use strict";
|
|
12061
12061
|
init_import_meta_url();
|
|
12062
|
-
var
|
|
12062
|
+
var assert45 = require("assert");
|
|
12063
12063
|
var { AsyncResource } = require("async_hooks");
|
|
12064
12064
|
var { Readable: Readable10 } = require_readable();
|
|
12065
12065
|
var { InvalidArgumentError, RequestAbortedError } = require_errors();
|
|
@@ -12130,7 +12130,7 @@ var require_api_request = __commonJS({
|
|
|
12130
12130
|
abort(this.reason);
|
|
12131
12131
|
return;
|
|
12132
12132
|
}
|
|
12133
|
-
|
|
12133
|
+
assert45(this.callback);
|
|
12134
12134
|
this.abort = abort;
|
|
12135
12135
|
this.context = context2;
|
|
12136
12136
|
}
|
|
@@ -12290,7 +12290,7 @@ var require_api_stream = __commonJS({
|
|
|
12290
12290
|
"../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/api/api-stream.js"(exports2, module3) {
|
|
12291
12291
|
"use strict";
|
|
12292
12292
|
init_import_meta_url();
|
|
12293
|
-
var
|
|
12293
|
+
var assert45 = require("assert");
|
|
12294
12294
|
var { finished } = require("stream");
|
|
12295
12295
|
var { AsyncResource } = require("async_hooks");
|
|
12296
12296
|
var { InvalidArgumentError, InvalidReturnValueError } = require_errors();
|
|
@@ -12353,7 +12353,7 @@ var require_api_stream = __commonJS({
|
|
|
12353
12353
|
abort(this.reason);
|
|
12354
12354
|
return;
|
|
12355
12355
|
}
|
|
12356
|
-
|
|
12356
|
+
assert45(this.callback);
|
|
12357
12357
|
this.abort = abort;
|
|
12358
12358
|
this.context = context2;
|
|
12359
12359
|
}
|
|
@@ -12462,7 +12462,7 @@ var require_api_pipeline = __commonJS({
|
|
|
12462
12462
|
Duplex: Duplex2,
|
|
12463
12463
|
PassThrough: PassThrough4
|
|
12464
12464
|
} = require("stream");
|
|
12465
|
-
var
|
|
12465
|
+
var assert45 = require("assert");
|
|
12466
12466
|
var { AsyncResource } = require("async_hooks");
|
|
12467
12467
|
var {
|
|
12468
12468
|
InvalidArgumentError,
|
|
@@ -12586,7 +12586,7 @@ var require_api_pipeline = __commonJS({
|
|
|
12586
12586
|
abort(this.reason);
|
|
12587
12587
|
return;
|
|
12588
12588
|
}
|
|
12589
|
-
|
|
12589
|
+
assert45(!res, "pipeline cannot be retried");
|
|
12590
12590
|
this.abort = abort;
|
|
12591
12591
|
this.context = context2;
|
|
12592
12592
|
}
|
|
@@ -12672,7 +12672,7 @@ var require_api_upgrade = __commonJS({
|
|
|
12672
12672
|
init_import_meta_url();
|
|
12673
12673
|
var { InvalidArgumentError, SocketError } = require_errors();
|
|
12674
12674
|
var { AsyncResource } = require("async_hooks");
|
|
12675
|
-
var
|
|
12675
|
+
var assert45 = require("assert");
|
|
12676
12676
|
var util3 = require_util();
|
|
12677
12677
|
var { addSignal, removeSignal } = require_abort_signal();
|
|
12678
12678
|
var UpgradeHandler = class extends AsyncResource {
|
|
@@ -12703,7 +12703,7 @@ var require_api_upgrade = __commonJS({
|
|
|
12703
12703
|
abort(this.reason);
|
|
12704
12704
|
return;
|
|
12705
12705
|
}
|
|
12706
|
-
|
|
12706
|
+
assert45(this.callback);
|
|
12707
12707
|
this.abort = abort;
|
|
12708
12708
|
this.context = null;
|
|
12709
12709
|
}
|
|
@@ -12711,7 +12711,7 @@ var require_api_upgrade = __commonJS({
|
|
|
12711
12711
|
throw new SocketError("bad upgrade", null);
|
|
12712
12712
|
}
|
|
12713
12713
|
onUpgrade(statusCode, rawHeaders, socket) {
|
|
12714
|
-
|
|
12714
|
+
assert45(statusCode === 101);
|
|
12715
12715
|
const { callback, opaque, context: context2 } = this;
|
|
12716
12716
|
removeSignal(this);
|
|
12717
12717
|
this.callback = null;
|
|
@@ -12768,7 +12768,7 @@ var require_api_connect = __commonJS({
|
|
|
12768
12768
|
"../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/api/api-connect.js"(exports2, module3) {
|
|
12769
12769
|
"use strict";
|
|
12770
12770
|
init_import_meta_url();
|
|
12771
|
-
var
|
|
12771
|
+
var assert45 = require("assert");
|
|
12772
12772
|
var { AsyncResource } = require("async_hooks");
|
|
12773
12773
|
var { InvalidArgumentError, SocketError } = require_errors();
|
|
12774
12774
|
var util3 = require_util();
|
|
@@ -12800,7 +12800,7 @@ var require_api_connect = __commonJS({
|
|
|
12800
12800
|
abort(this.reason);
|
|
12801
12801
|
return;
|
|
12802
12802
|
}
|
|
12803
|
-
|
|
12803
|
+
assert45(this.callback);
|
|
12804
12804
|
this.abort = abort;
|
|
12805
12805
|
this.context = context2;
|
|
12806
12806
|
}
|
|
@@ -14844,7 +14844,7 @@ var require_decorator_handler = __commonJS({
|
|
|
14844
14844
|
"../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/handler/decorator-handler.js"(exports2, module3) {
|
|
14845
14845
|
"use strict";
|
|
14846
14846
|
init_import_meta_url();
|
|
14847
|
-
var
|
|
14847
|
+
var assert45 = require("assert");
|
|
14848
14848
|
var WrapHandler = require_wrap_handler();
|
|
14849
14849
|
module3.exports = class DecoratorHandler {
|
|
14850
14850
|
static {
|
|
@@ -14864,25 +14864,25 @@ var require_decorator_handler = __commonJS({
|
|
|
14864
14864
|
this.#handler.onRequestStart?.(...args);
|
|
14865
14865
|
}
|
|
14866
14866
|
onRequestUpgrade(...args) {
|
|
14867
|
-
|
|
14868
|
-
|
|
14867
|
+
assert45(!this.#onCompleteCalled);
|
|
14868
|
+
assert45(!this.#onErrorCalled);
|
|
14869
14869
|
return this.#handler.onRequestUpgrade?.(...args);
|
|
14870
14870
|
}
|
|
14871
14871
|
onResponseStart(...args) {
|
|
14872
|
-
|
|
14873
|
-
|
|
14874
|
-
|
|
14872
|
+
assert45(!this.#onCompleteCalled);
|
|
14873
|
+
assert45(!this.#onErrorCalled);
|
|
14874
|
+
assert45(!this.#onResponseStartCalled);
|
|
14875
14875
|
this.#onResponseStartCalled = true;
|
|
14876
14876
|
return this.#handler.onResponseStart?.(...args);
|
|
14877
14877
|
}
|
|
14878
14878
|
onResponseData(...args) {
|
|
14879
|
-
|
|
14880
|
-
|
|
14879
|
+
assert45(!this.#onCompleteCalled);
|
|
14880
|
+
assert45(!this.#onErrorCalled);
|
|
14881
14881
|
return this.#handler.onResponseData?.(...args);
|
|
14882
14882
|
}
|
|
14883
14883
|
onResponseEnd(...args) {
|
|
14884
|
-
|
|
14885
|
-
|
|
14884
|
+
assert45(!this.#onCompleteCalled);
|
|
14885
|
+
assert45(!this.#onErrorCalled);
|
|
14886
14886
|
this.#onCompleteCalled = true;
|
|
14887
14887
|
return this.#handler.onResponseEnd?.(...args);
|
|
14888
14888
|
}
|
|
@@ -14906,7 +14906,7 @@ var require_redirect_handler = __commonJS({
|
|
|
14906
14906
|
init_import_meta_url();
|
|
14907
14907
|
var util3 = require_util();
|
|
14908
14908
|
var { kBodyUsed } = require_symbols();
|
|
14909
|
-
var
|
|
14909
|
+
var assert45 = require("assert");
|
|
14910
14910
|
var { InvalidArgumentError } = require_errors();
|
|
14911
14911
|
var EE = require("events");
|
|
14912
14912
|
var redirectableStatusCodes = [300, 301, 302, 303, 307, 308];
|
|
@@ -14922,7 +14922,7 @@ var require_redirect_handler = __commonJS({
|
|
|
14922
14922
|
this[kBodyUsed] = false;
|
|
14923
14923
|
}
|
|
14924
14924
|
async *[Symbol.asyncIterator]() {
|
|
14925
|
-
|
|
14925
|
+
assert45(!this[kBodyUsed], "disturbed");
|
|
14926
14926
|
this[kBodyUsed] = true;
|
|
14927
14927
|
yield* this[kBody];
|
|
14928
14928
|
}
|
|
@@ -14952,7 +14952,7 @@ var require_redirect_handler = __commonJS({
|
|
|
14952
14952
|
if (util3.isStream(this.opts.body)) {
|
|
14953
14953
|
if (util3.bodyLength(this.opts.body) === 0) {
|
|
14954
14954
|
this.opts.body.on("data", function() {
|
|
14955
|
-
|
|
14955
|
+
assert45(false);
|
|
14956
14956
|
});
|
|
14957
14957
|
}
|
|
14958
14958
|
if (typeof this.opts.body.readableDidRead !== "boolean") {
|
|
@@ -15059,7 +15059,7 @@ var require_redirect_handler = __commonJS({
|
|
|
15059
15059
|
}
|
|
15060
15060
|
}
|
|
15061
15061
|
} else {
|
|
15062
|
-
|
|
15062
|
+
assert45(headers == null, "headers must be an object or an array");
|
|
15063
15063
|
}
|
|
15064
15064
|
return ret;
|
|
15065
15065
|
}
|
|
@@ -16592,7 +16592,7 @@ var require_cache_revalidation_handler = __commonJS({
|
|
|
16592
16592
|
"../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/handler/cache-revalidation-handler.js"(exports2, module3) {
|
|
16593
16593
|
"use strict";
|
|
16594
16594
|
init_import_meta_url();
|
|
16595
|
-
var
|
|
16595
|
+
var assert45 = require("assert");
|
|
16596
16596
|
var CacheRevalidationHandler = class {
|
|
16597
16597
|
static {
|
|
16598
16598
|
__name(this, "CacheRevalidationHandler");
|
|
@@ -16632,7 +16632,7 @@ var require_cache_revalidation_handler = __commonJS({
|
|
|
16632
16632
|
this.#handler.onRequestUpgrade?.(controller, statusCode, headers, socket);
|
|
16633
16633
|
}
|
|
16634
16634
|
onResponseStart(controller, statusCode, headers, statusMessage) {
|
|
16635
|
-
|
|
16635
|
+
assert45(this.#callback != null);
|
|
16636
16636
|
this.#successful = statusCode === 304 || this.#allowErrorStatusCodes && statusCode >= 500 && statusCode <= 504;
|
|
16637
16637
|
this.#callback(this.#successful, this.#context);
|
|
16638
16638
|
this.#callback = null;
|
|
@@ -16683,7 +16683,7 @@ var require_cache2 = __commonJS({
|
|
|
16683
16683
|
"../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/interceptor/cache.js"(exports2, module3) {
|
|
16684
16684
|
"use strict";
|
|
16685
16685
|
init_import_meta_url();
|
|
16686
|
-
var
|
|
16686
|
+
var assert45 = require("assert");
|
|
16687
16687
|
var { Readable: Readable10 } = require("stream");
|
|
16688
16688
|
var util3 = require_util();
|
|
16689
16689
|
var CacheHandler = require_cache_handler();
|
|
@@ -16748,8 +16748,8 @@ var require_cache2 = __commonJS({
|
|
|
16748
16748
|
__name(handleUncachedResponse, "handleUncachedResponse");
|
|
16749
16749
|
function sendCachedValue(handler, opts, result, age, context2, isStale) {
|
|
16750
16750
|
const stream2 = util3.isStream(result.body) ? result.body : Readable10.from(result.body ?? []);
|
|
16751
|
-
|
|
16752
|
-
|
|
16751
|
+
assert45(!stream2.destroyed, "stream should not be destroyed");
|
|
16752
|
+
assert45(!stream2.readableDidRead, "stream should not be readableDidRead");
|
|
16753
16753
|
const controller = {
|
|
16754
16754
|
resume() {
|
|
16755
16755
|
stream2.resume();
|
|
@@ -17308,7 +17308,7 @@ var require_headers = __commonJS({
|
|
|
17308
17308
|
isValidHeaderValue
|
|
17309
17309
|
} = require_util2();
|
|
17310
17310
|
var { webidl } = require_webidl();
|
|
17311
|
-
var
|
|
17311
|
+
var assert45 = require("assert");
|
|
17312
17312
|
var util3 = require("util");
|
|
17313
17313
|
function isHTTPWhiteSpaceCharCode(code) {
|
|
17314
17314
|
return code === 10 || code === 13 || code === 9 || code === 32;
|
|
@@ -17533,11 +17533,11 @@ var require_headers = __commonJS({
|
|
|
17533
17533
|
const iterator = this.headersMap[Symbol.iterator]();
|
|
17534
17534
|
const firstValue = iterator.next().value;
|
|
17535
17535
|
array[0] = [firstValue[0], firstValue[1].value];
|
|
17536
|
-
|
|
17536
|
+
assert45(firstValue[1].value !== null);
|
|
17537
17537
|
for (let i6 = 1, j7 = 0, right2 = 0, left2 = 0, pivot = 0, x7, value; i6 < size; ++i6) {
|
|
17538
17538
|
value = iterator.next().value;
|
|
17539
17539
|
x7 = array[i6] = [value[0], value[1].value];
|
|
17540
|
-
|
|
17540
|
+
assert45(x7[1] !== null);
|
|
17541
17541
|
left2 = 0;
|
|
17542
17542
|
right2 = i6;
|
|
17543
17543
|
while (left2 < right2) {
|
|
@@ -17564,7 +17564,7 @@ var require_headers = __commonJS({
|
|
|
17564
17564
|
let i6 = 0;
|
|
17565
17565
|
for (const { 0: name2, 1: { value } } of this.headersMap) {
|
|
17566
17566
|
array[i6++] = [name2, value];
|
|
17567
|
-
|
|
17567
|
+
assert45(value !== null);
|
|
17568
17568
|
}
|
|
17569
17569
|
return array.sort(compareHeaderName);
|
|
17570
17570
|
}
|
|
@@ -17795,7 +17795,7 @@ var require_response = __commonJS({
|
|
|
17795
17795
|
var { webidl } = require_webidl();
|
|
17796
17796
|
var { URLSerializer } = require_data_url();
|
|
17797
17797
|
var { kConstruct } = require_symbols();
|
|
17798
|
-
var
|
|
17798
|
+
var assert45 = require("assert");
|
|
17799
17799
|
var { isArrayBuffer: isArrayBuffer3 } = nodeUtil.types;
|
|
17800
17800
|
var textEncoder = new TextEncoder("utf-8");
|
|
17801
17801
|
var Response14 = class _Response {
|
|
@@ -18059,7 +18059,7 @@ var require_response = __commonJS({
|
|
|
18059
18059
|
return p7 in state2 ? state2[p7] : target[p7];
|
|
18060
18060
|
},
|
|
18061
18061
|
set(target, p7, value) {
|
|
18062
|
-
|
|
18062
|
+
assert45(!(p7 in state2));
|
|
18063
18063
|
target[p7] = value;
|
|
18064
18064
|
return true;
|
|
18065
18065
|
}
|
|
@@ -18094,12 +18094,12 @@ var require_response = __commonJS({
|
|
|
18094
18094
|
body: null
|
|
18095
18095
|
});
|
|
18096
18096
|
} else {
|
|
18097
|
-
|
|
18097
|
+
assert45(false);
|
|
18098
18098
|
}
|
|
18099
18099
|
}
|
|
18100
18100
|
__name(filterResponse, "filterResponse");
|
|
18101
18101
|
function makeAppropriateNetworkError(fetchParams, err = null) {
|
|
18102
|
-
|
|
18102
|
+
assert45(isCancelled(fetchParams));
|
|
18103
18103
|
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 }));
|
|
18104
18104
|
}
|
|
18105
18105
|
__name(makeAppropriateNetworkError, "makeAppropriateNetworkError");
|
|
@@ -18234,7 +18234,7 @@ var require_request2 = __commonJS({
|
|
|
18234
18234
|
var { webidl } = require_webidl();
|
|
18235
18235
|
var { URLSerializer } = require_data_url();
|
|
18236
18236
|
var { kConstruct } = require_symbols();
|
|
18237
|
-
var
|
|
18237
|
+
var assert45 = require("assert");
|
|
18238
18238
|
var { getMaxListeners, setMaxListeners, defaultMaxListeners } = require("events");
|
|
18239
18239
|
var kAbortController = Symbol("abortController");
|
|
18240
18240
|
var requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {
|
|
@@ -18315,7 +18315,7 @@ var require_request2 = __commonJS({
|
|
|
18315
18315
|
request4 = makeRequest({ urlList: [parsedURL] });
|
|
18316
18316
|
fallbackMode = "cors";
|
|
18317
18317
|
} else {
|
|
18318
|
-
|
|
18318
|
+
assert45(webidl.is.Request(input));
|
|
18319
18319
|
request4 = input.#state;
|
|
18320
18320
|
signal = input.#signal;
|
|
18321
18321
|
this.#dispatcher = init4.dispatcher || input.#dispatcher;
|
|
@@ -19012,7 +19012,7 @@ var require_fetch = __commonJS({
|
|
|
19012
19012
|
createInflate,
|
|
19013
19013
|
extractMimeType
|
|
19014
19014
|
} = require_util2();
|
|
19015
|
-
var
|
|
19015
|
+
var assert45 = require("assert");
|
|
19016
19016
|
var { safelyExtractBody, extractBody } = require_body();
|
|
19017
19017
|
var {
|
|
19018
19018
|
redirectStatusSet,
|
|
@@ -19095,7 +19095,7 @@ var require_fetch = __commonJS({
|
|
|
19095
19095
|
requestObject.signal,
|
|
19096
19096
|
() => {
|
|
19097
19097
|
locallyAborted = true;
|
|
19098
|
-
|
|
19098
|
+
assert45(controller != null);
|
|
19099
19099
|
controller.abort(requestObject.signal.reason);
|
|
19100
19100
|
const realResponse = responseObject?.deref();
|
|
19101
19101
|
abortFetch(p7, request4, realResponse, requestObject.signal.reason);
|
|
@@ -19201,7 +19201,7 @@ var require_fetch = __commonJS({
|
|
|
19201
19201
|
dispatcher = getGlobalDispatcher2()
|
|
19202
19202
|
// undici
|
|
19203
19203
|
}) {
|
|
19204
|
-
|
|
19204
|
+
assert45(dispatcher);
|
|
19205
19205
|
let taskDestination = null;
|
|
19206
19206
|
let crossOriginIsolatedCapability = false;
|
|
19207
19207
|
if (request4.client != null) {
|
|
@@ -19224,7 +19224,7 @@ var require_fetch = __commonJS({
|
|
|
19224
19224
|
taskDestination,
|
|
19225
19225
|
crossOriginIsolatedCapability
|
|
19226
19226
|
};
|
|
19227
|
-
|
|
19227
|
+
assert45(!request4.body || request4.body.stream);
|
|
19228
19228
|
if (request4.window === "client") {
|
|
19229
19229
|
request4.window = request4.client?.globalObject?.constructor?.name === "Window" ? request4.client : "no-window";
|
|
19230
19230
|
}
|
|
@@ -19314,7 +19314,7 @@ var require_fetch = __commonJS({
|
|
|
19314
19314
|
} else if (request4.responseTainting === "opaque") {
|
|
19315
19315
|
response = filterResponse(response, "opaque");
|
|
19316
19316
|
} else {
|
|
19317
|
-
|
|
19317
|
+
assert45(false);
|
|
19318
19318
|
}
|
|
19319
19319
|
}
|
|
19320
19320
|
let internalResponse = response.status === 0 ? response : response.internalResponse;
|
|
@@ -19548,7 +19548,7 @@ var require_fetch = __commonJS({
|
|
|
19548
19548
|
} else if (request4.redirect === "follow") {
|
|
19549
19549
|
response = await httpRedirectFetch(fetchParams, response);
|
|
19550
19550
|
} else {
|
|
19551
|
-
|
|
19551
|
+
assert45(false);
|
|
19552
19552
|
}
|
|
19553
19553
|
}
|
|
19554
19554
|
response.timingInfo = timingInfo;
|
|
@@ -19602,7 +19602,7 @@ var require_fetch = __commonJS({
|
|
|
19602
19602
|
request4.headersList.delete("host", true);
|
|
19603
19603
|
}
|
|
19604
19604
|
if (request4.body != null) {
|
|
19605
|
-
|
|
19605
|
+
assert45(request4.body.source != null);
|
|
19606
19606
|
request4.body = safelyExtractBody(request4.body.source)[0];
|
|
19607
19607
|
}
|
|
19608
19608
|
const timingInfo = fetchParams.timingInfo;
|
|
@@ -19737,7 +19737,7 @@ var require_fetch = __commonJS({
|
|
|
19737
19737
|
}
|
|
19738
19738
|
__name(httpNetworkOrCacheFetch, "httpNetworkOrCacheFetch");
|
|
19739
19739
|
async function httpNetworkFetch(fetchParams, includeCredentials = false, forceNewConnection = false) {
|
|
19740
|
-
|
|
19740
|
+
assert45(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed);
|
|
19741
19741
|
fetchParams.controller.connection = {
|
|
19742
19742
|
abort: null,
|
|
19743
19743
|
destroyed: false,
|
|
@@ -20051,7 +20051,7 @@ var require_util3 = __commonJS({
|
|
|
20051
20051
|
"../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/web/cache/util.js"(exports2, module3) {
|
|
20052
20052
|
"use strict";
|
|
20053
20053
|
init_import_meta_url();
|
|
20054
|
-
var
|
|
20054
|
+
var assert45 = require("assert");
|
|
20055
20055
|
var { URLSerializer } = require_data_url();
|
|
20056
20056
|
var { isValidHeaderName } = require_util2();
|
|
20057
20057
|
function urlEquals(A4, B4, excludeFragment = false) {
|
|
@@ -20061,7 +20061,7 @@ var require_util3 = __commonJS({
|
|
|
20061
20061
|
}
|
|
20062
20062
|
__name(urlEquals, "urlEquals");
|
|
20063
20063
|
function getFieldValues(header) {
|
|
20064
|
-
|
|
20064
|
+
assert45(header !== null);
|
|
20065
20065
|
const values = [];
|
|
20066
20066
|
for (let value of header.split(",")) {
|
|
20067
20067
|
value = value.trim();
|
|
@@ -20084,7 +20084,7 @@ var require_cache3 = __commonJS({
|
|
|
20084
20084
|
"../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/web/cache/cache.js"(exports2, module3) {
|
|
20085
20085
|
"use strict";
|
|
20086
20086
|
init_import_meta_url();
|
|
20087
|
-
var
|
|
20087
|
+
var assert45 = require("assert");
|
|
20088
20088
|
var { kConstruct } = require_symbols();
|
|
20089
20089
|
var { urlEquals, getFieldValues } = require_util3();
|
|
20090
20090
|
var { kEnumerableProperty, isDisturbed } = require_util();
|
|
@@ -20337,7 +20337,7 @@ var require_cache3 = __commonJS({
|
|
|
20337
20337
|
return false;
|
|
20338
20338
|
}
|
|
20339
20339
|
} else {
|
|
20340
|
-
|
|
20340
|
+
assert45(typeof request4 === "string");
|
|
20341
20341
|
r8 = getRequestState(new Request7(request4));
|
|
20342
20342
|
}
|
|
20343
20343
|
const operations = [];
|
|
@@ -20448,7 +20448,7 @@ var require_cache3 = __commonJS({
|
|
|
20448
20448
|
}
|
|
20449
20449
|
for (const requestResponse of requestResponses) {
|
|
20450
20450
|
const idx = cache6.indexOf(requestResponse);
|
|
20451
|
-
|
|
20451
|
+
assert45(idx !== -1);
|
|
20452
20452
|
cache6.splice(idx, 1);
|
|
20453
20453
|
}
|
|
20454
20454
|
} else if (operation.type === "put") {
|
|
@@ -20480,7 +20480,7 @@ var require_cache3 = __commonJS({
|
|
|
20480
20480
|
requestResponses = this.#queryCache(operation.request);
|
|
20481
20481
|
for (const requestResponse of requestResponses) {
|
|
20482
20482
|
const idx = cache6.indexOf(requestResponse);
|
|
20483
|
-
|
|
20483
|
+
assert45(idx !== -1);
|
|
20484
20484
|
cache6.splice(idx, 1);
|
|
20485
20485
|
}
|
|
20486
20486
|
cache6.push([operation.request, operation.response]);
|
|
@@ -20947,7 +20947,7 @@ var require_parse = __commonJS({
|
|
|
20947
20947
|
var { maxNameValuePairSize, maxAttributeValueSize } = require_constants4();
|
|
20948
20948
|
var { isCTLExcludingHtab } = require_util4();
|
|
20949
20949
|
var { collectASequenceOfCodePointsFast } = require_data_url();
|
|
20950
|
-
var
|
|
20950
|
+
var assert45 = require("assert");
|
|
20951
20951
|
var { unescape: unescape2 } = require("querystring");
|
|
20952
20952
|
function parseSetCookie(header) {
|
|
20953
20953
|
if (isCTLExcludingHtab(header)) {
|
|
@@ -20991,7 +20991,7 @@ var require_parse = __commonJS({
|
|
|
20991
20991
|
if (unparsedAttributes.length === 0) {
|
|
20992
20992
|
return cookieAttributeList;
|
|
20993
20993
|
}
|
|
20994
|
-
|
|
20994
|
+
assert45(unparsedAttributes[0] === ";");
|
|
20995
20995
|
unparsedAttributes = unparsedAttributes.slice(1);
|
|
20996
20996
|
let cookieAv = "";
|
|
20997
20997
|
if (unparsedAttributes.includes(";")) {
|
|
@@ -21878,7 +21878,7 @@ var require_connection = __commonJS({
|
|
|
21878
21878
|
var { Headers: Headers7, getHeadersList } = require_headers();
|
|
21879
21879
|
var { getDecodeSplit } = require_util2();
|
|
21880
21880
|
var { WebsocketFrameSend } = require_frame();
|
|
21881
|
-
var
|
|
21881
|
+
var assert45 = require("assert");
|
|
21882
21882
|
var crypto8;
|
|
21883
21883
|
try {
|
|
21884
21884
|
crypto8 = require("crypto");
|
|
@@ -21979,7 +21979,7 @@ var require_connection = __commonJS({
|
|
|
21979
21979
|
if (reason.length !== 0 && code === null) {
|
|
21980
21980
|
code = 1e3;
|
|
21981
21981
|
}
|
|
21982
|
-
|
|
21982
|
+
assert45(code === null || Number.isInteger(code));
|
|
21983
21983
|
if (code === null && reason.length === 0) {
|
|
21984
21984
|
frame.frameData = emptyBuffer;
|
|
21985
21985
|
} else if (code !== null && reason === null) {
|
|
@@ -22084,7 +22084,7 @@ var require_receiver = __commonJS({
|
|
|
22084
22084
|
"use strict";
|
|
22085
22085
|
init_import_meta_url();
|
|
22086
22086
|
var { Writable: Writable5 } = require("stream");
|
|
22087
|
-
var
|
|
22087
|
+
var assert45 = require("assert");
|
|
22088
22088
|
var { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = require_constants5();
|
|
22089
22089
|
var {
|
|
22090
22090
|
isValidStatusCode,
|
|
@@ -22324,7 +22324,7 @@ var require_receiver = __commonJS({
|
|
|
22324
22324
|
return output;
|
|
22325
22325
|
}
|
|
22326
22326
|
parseCloseBody(data) {
|
|
22327
|
-
|
|
22327
|
+
assert45(data.length !== 1);
|
|
22328
22328
|
let code;
|
|
22329
22329
|
if (data.length >= 2) {
|
|
22330
22330
|
code = data.readUInt16BE(0);
|
|
@@ -33817,7 +33817,7 @@ var require_signal_exit = __commonJS({
|
|
|
33817
33817
|
};
|
|
33818
33818
|
};
|
|
33819
33819
|
} else {
|
|
33820
|
-
|
|
33820
|
+
assert45 = require("assert");
|
|
33821
33821
|
signals = require_signals();
|
|
33822
33822
|
isWin = /^win/i.test(process11.platform);
|
|
33823
33823
|
EE = require("events");
|
|
@@ -33840,7 +33840,7 @@ var require_signal_exit = __commonJS({
|
|
|
33840
33840
|
return function() {
|
|
33841
33841
|
};
|
|
33842
33842
|
}
|
|
33843
|
-
|
|
33843
|
+
assert45.equal(typeof cb2, "function", "a callback must be provided for exit handler");
|
|
33844
33844
|
if (loaded === false) {
|
|
33845
33845
|
load();
|
|
33846
33846
|
}
|
|
@@ -33946,7 +33946,7 @@ var require_signal_exit = __commonJS({
|
|
|
33946
33946
|
}
|
|
33947
33947
|
}, "processEmit");
|
|
33948
33948
|
}
|
|
33949
|
-
var
|
|
33949
|
+
var assert45;
|
|
33950
33950
|
var signals;
|
|
33951
33951
|
var isWin;
|
|
33952
33952
|
var EE;
|
|
@@ -93898,7 +93898,7 @@ var name, version;
|
|
|
93898
93898
|
var init_package = __esm({
|
|
93899
93899
|
"package.json"() {
|
|
93900
93900
|
name = "wrangler";
|
|
93901
|
-
version = "4.
|
|
93901
|
+
version = "4.43.0";
|
|
93902
93902
|
}
|
|
93903
93903
|
});
|
|
93904
93904
|
|
|
@@ -103871,6 +103871,44 @@ async function upsertR2DataCatalogCredential(complianceConfig, accountId, bucket
|
|
|
103871
103871
|
}
|
|
103872
103872
|
);
|
|
103873
103873
|
}
|
|
103874
|
+
async function enableR2CatalogTableCompaction(complianceConfig, accountId, bucketName, namespace, tableName, targetSizeMb) {
|
|
103875
|
+
const body = {
|
|
103876
|
+
compaction: {
|
|
103877
|
+
state: "enabled"
|
|
103878
|
+
}
|
|
103879
|
+
};
|
|
103880
|
+
if (targetSizeMb !== void 0) {
|
|
103881
|
+
body.compaction.target_size_mb = targetSizeMb;
|
|
103882
|
+
}
|
|
103883
|
+
return await fetchResult(
|
|
103884
|
+
complianceConfig,
|
|
103885
|
+
`/accounts/${accountId}/r2-catalog/${bucketName}/namespaces/${namespace}/tables/${tableName}/maintenance-configs`,
|
|
103886
|
+
{
|
|
103887
|
+
method: "POST",
|
|
103888
|
+
body: JSON.stringify(body),
|
|
103889
|
+
headers: {
|
|
103890
|
+
"Content-Type": "application/json"
|
|
103891
|
+
}
|
|
103892
|
+
}
|
|
103893
|
+
);
|
|
103894
|
+
}
|
|
103895
|
+
async function disableR2CatalogTableCompaction(complianceConfig, accountId, bucketName, namespace, tableName) {
|
|
103896
|
+
return await fetchResult(
|
|
103897
|
+
complianceConfig,
|
|
103898
|
+
`/accounts/${accountId}/r2-catalog/${bucketName}/namespaces/${namespace}/tables/${tableName}/maintenance-configs`,
|
|
103899
|
+
{
|
|
103900
|
+
method: "POST",
|
|
103901
|
+
body: JSON.stringify({
|
|
103902
|
+
compaction: {
|
|
103903
|
+
state: "disabled"
|
|
103904
|
+
}
|
|
103905
|
+
}),
|
|
103906
|
+
headers: {
|
|
103907
|
+
"Content-Type": "application/json"
|
|
103908
|
+
}
|
|
103909
|
+
}
|
|
103910
|
+
);
|
|
103911
|
+
}
|
|
103874
103912
|
function eventNotificationHeaders(apiCredentials, jurisdiction) {
|
|
103875
103913
|
const headers = {
|
|
103876
103914
|
"Content-Type": "application/json"
|
|
@@ -104408,6 +104446,8 @@ var init_helpers = __esm({
|
|
|
104408
104446
|
__name(enableR2CatalogCompaction, "enableR2CatalogCompaction");
|
|
104409
104447
|
__name(disableR2CatalogCompaction, "disableR2CatalogCompaction");
|
|
104410
104448
|
__name(upsertR2DataCatalogCredential, "upsertR2DataCatalogCredential");
|
|
104449
|
+
__name(enableR2CatalogTableCompaction, "enableR2CatalogTableCompaction");
|
|
104450
|
+
__name(disableR2CatalogTableCompaction, "disableR2CatalogTableCompaction");
|
|
104411
104451
|
actionsForEventCategories = {
|
|
104412
104452
|
"object-create": ["PutObject", "CompleteMultipartUpload", "CopyObject"],
|
|
104413
104453
|
"object-delete": ["DeleteObject", "LifecycleDeletion"]
|
|
@@ -121525,23 +121565,34 @@ async function convertBindingsToCfWorkerInitBindings(inputBindings) {
|
|
|
121525
121565
|
worker_loaders: void 0
|
|
121526
121566
|
};
|
|
121527
121567
|
const fetchers = {};
|
|
121528
|
-
|
|
121568
|
+
const bindingEntries = Array.isArray(inputBindings) ? inputBindings.map((b7) => [b7.name, b7]) : Object.entries(inputBindings ?? {});
|
|
121569
|
+
for (const [name2, binding] of bindingEntries) {
|
|
121529
121570
|
if (binding.type === "plain_text") {
|
|
121530
121571
|
bindings.vars ??= {};
|
|
121531
|
-
bindings.vars[name2] = binding.value;
|
|
121572
|
+
bindings.vars[name2] = "value" in binding ? binding.value : binding.text;
|
|
121532
121573
|
} else if (binding.type === "json") {
|
|
121533
121574
|
bindings.vars ??= {};
|
|
121534
|
-
bindings.vars[name2] = binding.value;
|
|
121575
|
+
bindings.vars[name2] = "value" in binding ? binding.value : binding.json;
|
|
121535
121576
|
} else if (binding.type === "kv_namespace") {
|
|
121536
121577
|
bindings.kv_namespaces ??= [];
|
|
121537
|
-
bindings.kv_namespaces.push({
|
|
121578
|
+
bindings.kv_namespaces.push({
|
|
121579
|
+
...omitType(binding),
|
|
121580
|
+
binding: name2,
|
|
121581
|
+
id: "namespace_id" in binding ? binding.namespace_id : binding.id
|
|
121582
|
+
});
|
|
121538
121583
|
} else if (binding.type === "send_email") {
|
|
121539
121584
|
bindings.send_email ??= [];
|
|
121540
|
-
bindings.send_email.push({ ...binding, name: name2 });
|
|
121585
|
+
bindings.send_email.push({ ...omitType(binding), name: name2 });
|
|
121541
121586
|
} else if (binding.type === "wasm_module") {
|
|
121587
|
+
if (!("source" in binding)) {
|
|
121588
|
+
continue;
|
|
121589
|
+
}
|
|
121542
121590
|
bindings.wasm_modules ??= {};
|
|
121543
121591
|
bindings.wasm_modules[name2] = await getBinaryFileContents(binding.source);
|
|
121544
121592
|
} else if (binding.type === "text_blob") {
|
|
121593
|
+
if (!("source" in binding)) {
|
|
121594
|
+
continue;
|
|
121595
|
+
}
|
|
121545
121596
|
bindings.text_blobs ??= {};
|
|
121546
121597
|
if (typeof binding.source.path === "string") {
|
|
121547
121598
|
bindings.text_blobs[name2] = binding.source.path;
|
|
@@ -121551,72 +121602,97 @@ async function convertBindingsToCfWorkerInitBindings(inputBindings) {
|
|
|
121551
121602
|
);
|
|
121552
121603
|
}
|
|
121553
121604
|
} else if (binding.type === "data_blob") {
|
|
121605
|
+
if (!("source" in binding)) {
|
|
121606
|
+
continue;
|
|
121607
|
+
}
|
|
121554
121608
|
bindings.data_blobs ??= {};
|
|
121555
121609
|
bindings.data_blobs[name2] = await getBinaryFileContents(binding.source);
|
|
121556
121610
|
} else if (binding.type === "browser") {
|
|
121557
|
-
bindings.browser = { ...binding, binding: name2 };
|
|
121611
|
+
bindings.browser = { ...omitType(binding), binding: name2 };
|
|
121558
121612
|
} else if (binding.type === "ai") {
|
|
121559
|
-
bindings.ai = { ...binding, binding: name2 };
|
|
121613
|
+
bindings.ai = { ...omitType(binding), binding: name2 };
|
|
121560
121614
|
} else if (binding.type === "images") {
|
|
121561
|
-
bindings.images = { ...binding, binding: name2 };
|
|
121615
|
+
bindings.images = { ...omitType(binding), binding: name2 };
|
|
121562
121616
|
} else if (binding.type === "version_metadata") {
|
|
121563
121617
|
bindings.version_metadata = { binding: name2 };
|
|
121564
121618
|
} else if (binding.type === "durable_object_namespace") {
|
|
121565
121619
|
bindings.durable_objects ??= { bindings: [] };
|
|
121566
|
-
bindings.durable_objects.bindings.push({
|
|
121620
|
+
bindings.durable_objects.bindings.push({
|
|
121621
|
+
...omitType(binding),
|
|
121622
|
+
name: name2
|
|
121623
|
+
});
|
|
121567
121624
|
} else if (binding.type === "queue") {
|
|
121568
121625
|
bindings.queues ??= [];
|
|
121569
|
-
bindings.queues.push({ ...binding, binding: name2 });
|
|
121626
|
+
bindings.queues.push({ ...omitType(binding), binding: name2 });
|
|
121570
121627
|
} else if (binding.type === "r2_bucket") {
|
|
121571
121628
|
bindings.r2_buckets ??= [];
|
|
121572
|
-
bindings.r2_buckets.push({ ...binding, binding: name2 });
|
|
121629
|
+
bindings.r2_buckets.push({ ...omitType(binding), binding: name2 });
|
|
121573
121630
|
} else if (binding.type === "d1") {
|
|
121574
121631
|
bindings.d1_databases ??= [];
|
|
121575
|
-
bindings.d1_databases.push({
|
|
121632
|
+
bindings.d1_databases.push({
|
|
121633
|
+
...omitType(binding),
|
|
121634
|
+
binding: name2,
|
|
121635
|
+
database_id: "id" in binding ? binding.id : binding.database_id
|
|
121636
|
+
});
|
|
121576
121637
|
} else if (binding.type === "vectorize") {
|
|
121577
121638
|
bindings.vectorize ??= [];
|
|
121578
|
-
bindings.vectorize.push({ ...binding, binding: name2 });
|
|
121639
|
+
bindings.vectorize.push({ ...omitType(binding), binding: name2 });
|
|
121579
121640
|
} else if (binding.type === "hyperdrive") {
|
|
121580
121641
|
bindings.hyperdrive ??= [];
|
|
121581
|
-
bindings.hyperdrive.push({ ...binding, binding: name2 });
|
|
121642
|
+
bindings.hyperdrive.push({ ...omitType(binding), binding: name2 });
|
|
121582
121643
|
} else if (binding.type === "service") {
|
|
121583
121644
|
bindings.services ??= [];
|
|
121584
|
-
bindings.services.push({ ...binding, binding: name2 });
|
|
121645
|
+
bindings.services.push({ ...omitType(binding), binding: name2 });
|
|
121585
121646
|
} else if (binding.type === "fetcher") {
|
|
121586
121647
|
fetchers[name2] = binding.fetcher;
|
|
121587
121648
|
} else if (binding.type === "analytics_engine") {
|
|
121588
121649
|
bindings.analytics_engine_datasets ??= [];
|
|
121589
|
-
bindings.analytics_engine_datasets.push({
|
|
121650
|
+
bindings.analytics_engine_datasets.push({
|
|
121651
|
+
...omitType(binding),
|
|
121652
|
+
binding: name2
|
|
121653
|
+
});
|
|
121590
121654
|
} else if (binding.type === "dispatch_namespace") {
|
|
121591
121655
|
bindings.dispatch_namespaces ??= [];
|
|
121592
|
-
|
|
121656
|
+
const outbound = binding.outbound && "worker" in binding.outbound ? {
|
|
121657
|
+
service: binding.outbound.worker.service,
|
|
121658
|
+
environment: binding.outbound.worker.environment,
|
|
121659
|
+
parameters: binding.outbound.params?.map((p7) => p7.name)
|
|
121660
|
+
} : binding.outbound;
|
|
121661
|
+
bindings.dispatch_namespaces.push({
|
|
121662
|
+
...omitType(binding),
|
|
121663
|
+
binding: name2,
|
|
121664
|
+
outbound
|
|
121665
|
+
});
|
|
121593
121666
|
} else if (binding.type === "mtls_certificate") {
|
|
121594
121667
|
bindings.mtls_certificates ??= [];
|
|
121595
|
-
bindings.mtls_certificates.push({ ...binding, binding: name2 });
|
|
121668
|
+
bindings.mtls_certificates.push({ ...omitType(binding), binding: name2 });
|
|
121596
121669
|
} else if (binding.type === "pipeline") {
|
|
121597
121670
|
bindings.pipelines ??= [];
|
|
121598
|
-
bindings.pipelines.push({ ...binding, binding: name2 });
|
|
121671
|
+
bindings.pipelines.push({ ...omitType(binding), binding: name2 });
|
|
121599
121672
|
} else if (binding.type === "logfwdr") {
|
|
121600
121673
|
bindings.logfwdr ??= { bindings: [] };
|
|
121601
|
-
bindings.logfwdr.bindings.push({ ...binding, name: name2 });
|
|
121674
|
+
bindings.logfwdr.bindings.push({ ...omitType(binding), name: name2 });
|
|
121602
121675
|
} else if (binding.type === "workflow") {
|
|
121603
121676
|
bindings.workflows ??= [];
|
|
121604
|
-
bindings.workflows.push({ ...binding, binding: name2 });
|
|
121677
|
+
bindings.workflows.push({ ...omitType(binding), binding: name2 });
|
|
121605
121678
|
} else if (binding.type === "secrets_store_secret") {
|
|
121606
121679
|
bindings.secrets_store_secrets ??= [];
|
|
121607
|
-
bindings.secrets_store_secrets.push({
|
|
121680
|
+
bindings.secrets_store_secrets.push({
|
|
121681
|
+
...omitType(binding),
|
|
121682
|
+
binding: name2
|
|
121683
|
+
});
|
|
121608
121684
|
} else if (binding.type === "unsafe_hello_world") {
|
|
121609
121685
|
bindings.unsafe_hello_world ??= [];
|
|
121610
|
-
bindings.unsafe_hello_world.push({ ...binding, binding: name2 });
|
|
121686
|
+
bindings.unsafe_hello_world.push({ ...omitType(binding), binding: name2 });
|
|
121611
121687
|
} else if (binding.type === "ratelimit") {
|
|
121612
121688
|
bindings.ratelimits ??= [];
|
|
121613
|
-
bindings.ratelimits.push({ ...binding, name: name2 });
|
|
121689
|
+
bindings.ratelimits.push({ ...omitType(binding), name: name2 });
|
|
121614
121690
|
} else if (binding.type === "worker_loader") {
|
|
121615
121691
|
bindings.worker_loaders ??= [];
|
|
121616
|
-
bindings.worker_loaders.push({ ...binding, binding: name2 });
|
|
121692
|
+
bindings.worker_loaders.push({ ...omitType(binding), binding: name2 });
|
|
121617
121693
|
} else if (binding.type === "vpc_service") {
|
|
121618
121694
|
bindings.vpc_services ??= [];
|
|
121619
|
-
bindings.vpc_services.push({ ...binding, binding: name2 });
|
|
121695
|
+
bindings.vpc_services.push({ ...omitType(binding), binding: name2 });
|
|
121620
121696
|
} else if (isUnsafeBindingType(binding.type)) {
|
|
121621
121697
|
bindings.unsafe ??= {
|
|
121622
121698
|
bindings: [],
|
|
@@ -121636,6 +121712,12 @@ async function convertBindingsToCfWorkerInitBindings(inputBindings) {
|
|
|
121636
121712
|
function isUnsafeBindingType(type) {
|
|
121637
121713
|
return type.startsWith("unsafe_");
|
|
121638
121714
|
}
|
|
121715
|
+
function omitType({
|
|
121716
|
+
type: _5,
|
|
121717
|
+
...value
|
|
121718
|
+
}) {
|
|
121719
|
+
return value;
|
|
121720
|
+
}
|
|
121639
121721
|
function extractBindingsOfType(type, bindings) {
|
|
121640
121722
|
return Object.entries(bindings ?? {}).filter(
|
|
121641
121723
|
(binding) => binding[1].type === type
|
|
@@ -121659,6 +121741,7 @@ var init_utils4 = __esm({
|
|
|
121659
121741
|
__name(convertCfWorkerInitBindingsToBindings, "convertCfWorkerInitBindingsToBindings");
|
|
121660
121742
|
__name(convertBindingsToCfWorkerInitBindings, "convertBindingsToCfWorkerInitBindings");
|
|
121661
121743
|
__name(isUnsafeBindingType, "isUnsafeBindingType");
|
|
121744
|
+
__name(omitType, "omitType");
|
|
121662
121745
|
__name(extractBindingsOfType, "extractBindingsOfType");
|
|
121663
121746
|
}
|
|
121664
121747
|
});
|
|
@@ -127466,7 +127549,7 @@ async function buildAndMaybePush(args, pathToDocker, push2, containerConfig) {
|
|
|
127466
127549
|
if (push2) {
|
|
127467
127550
|
const imageInfo = await dockerImageInspect(pathToDocker, {
|
|
127468
127551
|
imageTag,
|
|
127469
|
-
formatString: "{{ json .RepoDigests }}
|
|
127552
|
+
formatString: "{{ json .RepoDigests }}"
|
|
127470
127553
|
});
|
|
127471
127554
|
logger.debug(`'docker image inspect ${imageTag}':`, imageInfo);
|
|
127472
127555
|
const account = await loadAccount();
|
|
@@ -127478,7 +127561,7 @@ async function buildAndMaybePush(args, pathToDocker, push2, containerConfig) {
|
|
|
127478
127561
|
});
|
|
127479
127562
|
await dockerLoginManagedRegistry(pathToDocker);
|
|
127480
127563
|
try {
|
|
127481
|
-
const [digests
|
|
127564
|
+
const [digests] = imageInfo.split(" ");
|
|
127482
127565
|
const parsedDigests = JSON.parse(digests);
|
|
127483
127566
|
if (!Array.isArray(parsedDigests)) {
|
|
127484
127567
|
throw new Error(
|
|
@@ -127489,13 +127572,17 @@ async function buildAndMaybePush(args, pathToDocker, push2, containerConfig) {
|
|
|
127489
127572
|
account.external_account_id,
|
|
127490
127573
|
imageTag
|
|
127491
127574
|
).split(":")[0];
|
|
127492
|
-
|
|
127575
|
+
logger.debug("respositoryOnly:", repositoryOnly);
|
|
127576
|
+
const digest = parsedDigests.find((d7) => {
|
|
127493
127577
|
const resolved = resolveImageName(account.external_account_id, d7);
|
|
127578
|
+
logger.debug(
|
|
127579
|
+
`Comparing ${resolved.split("@")[0]} to ${repositoryOnly}`
|
|
127580
|
+
);
|
|
127494
127581
|
return typeof d7 === "string" && resolved.split("@")[0] === repositoryOnly;
|
|
127495
127582
|
});
|
|
127496
|
-
if (
|
|
127583
|
+
if (!digest) {
|
|
127497
127584
|
throw new Error(
|
|
127498
|
-
`
|
|
127585
|
+
`Could not find a digest for the image ${repositoryOnly}. Found digests: ${parsedDigests.join(", ")}`
|
|
127499
127586
|
);
|
|
127500
127587
|
}
|
|
127501
127588
|
const [image, hash] = digest.split("@");
|
|
@@ -127504,18 +127591,17 @@ async function buildAndMaybePush(args, pathToDocker, push2, containerConfig) {
|
|
|
127504
127591
|
image
|
|
127505
127592
|
);
|
|
127506
127593
|
const remoteDigest = `${resolvedImage}@${hash}`;
|
|
127594
|
+
logger.debug(
|
|
127595
|
+
`'docker manifest inspect -v ${resolveImageName(account.external_account_id, remoteDigest)}:`
|
|
127596
|
+
);
|
|
127507
127597
|
const remoteManifest = runDockerCmdWithOutput(pathToDocker, [
|
|
127508
127598
|
"manifest",
|
|
127509
127599
|
"inspect",
|
|
127510
127600
|
"-v",
|
|
127511
|
-
remoteDigest
|
|
127601
|
+
resolveImageName(account.external_account_id, remoteDigest)
|
|
127512
127602
|
]);
|
|
127513
|
-
logger.debug(
|
|
127514
|
-
`'docker manifest inspect -v ${remoteDigest}:`,
|
|
127515
|
-
remoteManifest
|
|
127516
|
-
);
|
|
127517
127603
|
const parsedRemoteManifest = JSON.parse(remoteManifest);
|
|
127518
|
-
if (parsedRemoteManifest.Descriptor.digest ===
|
|
127604
|
+
if (parsedRemoteManifest.Descriptor.digest === hash) {
|
|
127519
127605
|
logger.log("Image already exists remotely, skipping push");
|
|
127520
127606
|
logger.debug(
|
|
127521
127607
|
`Untagging built image: ${args.tag} since there was no change.`
|
|
@@ -127539,7 +127625,6 @@ async function buildAndMaybePush(args, pathToDocker, push2, containerConfig) {
|
|
|
127539
127625
|
);
|
|
127540
127626
|
await runDockerCmd(pathToDocker, ["tag", imageTag, namespacedImageTag]);
|
|
127541
127627
|
await runDockerCmd(pathToDocker, ["push", namespacedImageTag]);
|
|
127542
|
-
await runDockerCmd(pathToDocker, ["image", "rm", namespacedImageTag]);
|
|
127543
127628
|
}
|
|
127544
127629
|
return { newTag: imageTag };
|
|
127545
127630
|
} catch (error2) {
|
|
@@ -138228,7 +138313,26 @@ async function deleteKVBulkKeyValue(complianceConfig, accountId, namespaceId, ke
|
|
|
138228
138313
|
logBulkProgress("delete", keys.length, keys.length);
|
|
138229
138314
|
}
|
|
138230
138315
|
}
|
|
138231
|
-
function
|
|
138316
|
+
async function getIdFromSettings(config, binding, isLocal2) {
|
|
138317
|
+
if (isLocal2) {
|
|
138318
|
+
return binding;
|
|
138319
|
+
}
|
|
138320
|
+
const accountId = await requireAuth(config);
|
|
138321
|
+
if (!config.name) {
|
|
138322
|
+
throw new UserError2("No Worker name found in config");
|
|
138323
|
+
}
|
|
138324
|
+
const settings = await getSettings(config, accountId, config.name);
|
|
138325
|
+
const existingKV = settings?.bindings.find(
|
|
138326
|
+
(existing) => existing.type === "kv_namespace" && existing.name === binding
|
|
138327
|
+
);
|
|
138328
|
+
if (!existingKV || !("namespace_id" in existingKV)) {
|
|
138329
|
+
throw new UserError2(
|
|
138330
|
+
`No namespace ID found for binding "${binding}". Add one to your wrangler config file or pass it via \`--namespace-id\`.`
|
|
138331
|
+
);
|
|
138332
|
+
}
|
|
138333
|
+
return existingKV.namespace_id;
|
|
138334
|
+
}
|
|
138335
|
+
async function getKVNamespaceId({ preview, binding, "namespace-id": namespaceId }, config, isLocal2) {
|
|
138232
138336
|
if (namespaceId) {
|
|
138233
138337
|
return namespaceId;
|
|
138234
138338
|
}
|
|
@@ -138264,13 +138368,20 @@ function getKVNamespaceId({ preview, binding, "namespace-id": namespaceId }, con
|
|
|
138264
138368
|
namespaceId = namespace.id;
|
|
138265
138369
|
return namespaceId;
|
|
138266
138370
|
} else if (previewIsDefined) {
|
|
138371
|
+
if (getFlag("RESOURCES_PROVISION")) {
|
|
138372
|
+
(0, import_node_assert12.default)(binding);
|
|
138373
|
+
return getIdFromSettings(config, binding, isLocal2);
|
|
138374
|
+
}
|
|
138267
138375
|
throw new UserError2(
|
|
138268
|
-
`No namespace ID found for ${binding}. Add one to your wrangler config file
|
|
138376
|
+
`No namespace ID found for ${binding}. Add one to your wrangler config file or pass it via \`--namespace-id\`.`
|
|
138269
138377
|
);
|
|
138270
138378
|
}
|
|
138271
138379
|
const bindingHasOnlyOneId = namespace.id && !namespace.preview_id || !namespace.id && namespace.preview_id;
|
|
138272
138380
|
if (bindingHasOnlyOneId) {
|
|
138273
138381
|
namespaceId = namespace.id || namespace.preview_id;
|
|
138382
|
+
} else if (getFlag("RESOURCES_PROVISION") && !namespace.id && !namespace.preview_id) {
|
|
138383
|
+
(0, import_node_assert12.default)(binding);
|
|
138384
|
+
return getIdFromSettings(config, binding, isLocal2);
|
|
138274
138385
|
} else {
|
|
138275
138386
|
throw new UserError2(
|
|
138276
138387
|
`${binding} has both a namespace ID and a preview ID. Specify "--preview" or "--preview false" to avoid writing data to the wrong namespace.`
|
|
@@ -138298,19 +138409,23 @@ async function usingLocalNamespace(persistTo, config, namespaceId, closure) {
|
|
|
138298
138409
|
await mf.dispose();
|
|
138299
138410
|
}
|
|
138300
138411
|
}
|
|
138301
|
-
var import_node_buffer2, import_node_url8, import_miniflare9, import_undici4, API_MAX, BATCH_KEY_MAX, BATCH_MAX_ERRORS_WARNINGS, KeyValueKeys, formatNumber;
|
|
138412
|
+
var import_node_assert12, import_node_buffer2, import_node_url8, import_miniflare9, import_undici4, API_MAX, BATCH_KEY_MAX, BATCH_MAX_ERRORS_WARNINGS, KeyValueKeys, formatNumber;
|
|
138302
138413
|
var init_helpers4 = __esm({
|
|
138303
138414
|
"src/kv/helpers.ts"() {
|
|
138304
138415
|
init_import_meta_url();
|
|
138416
|
+
import_node_assert12 = __toESM(require("assert"));
|
|
138305
138417
|
import_node_buffer2 = require("buffer");
|
|
138306
138418
|
import_node_url8 = require("url");
|
|
138307
138419
|
import_miniflare9 = require("miniflare");
|
|
138308
138420
|
import_undici4 = __toESM(require_undici());
|
|
138309
138421
|
init_cfetch();
|
|
138422
|
+
init_bindings2();
|
|
138310
138423
|
init_get_local_persistence_path();
|
|
138311
138424
|
init_miniflare();
|
|
138312
138425
|
init_errors();
|
|
138426
|
+
init_experimental_flags();
|
|
138313
138427
|
init_logger();
|
|
138428
|
+
init_user3();
|
|
138314
138429
|
API_MAX = 1e4;
|
|
138315
138430
|
BATCH_KEY_MAX = API_MAX / 10;
|
|
138316
138431
|
BATCH_MAX_ERRORS_WARNINGS = 12;
|
|
@@ -138343,6 +138458,7 @@ var init_helpers4 = __esm({
|
|
|
138343
138458
|
__name(getKVBulkKeyValue, "getKVBulkKeyValue");
|
|
138344
138459
|
__name(putKVBulkKeyValue, "putKVBulkKeyValue");
|
|
138345
138460
|
__name(deleteKVBulkKeyValue, "deleteKVBulkKeyValue");
|
|
138461
|
+
__name(getIdFromSettings, "getIdFromSettings");
|
|
138346
138462
|
__name(getKVNamespaceId, "getKVNamespaceId");
|
|
138347
138463
|
__name(usingLocalNamespace, "usingLocalNamespace");
|
|
138348
138464
|
}
|
|
@@ -138872,7 +138988,7 @@ var init_metrics2 = __esm({
|
|
|
138872
138988
|
|
|
138873
138989
|
// src/utils/isLegacyEnv.ts
|
|
138874
138990
|
function isLegacyEnv(config) {
|
|
138875
|
-
return config.legacy_env;
|
|
138991
|
+
return "legacy_env" in config ? config.legacy_env : !config.legacy.enableServiceEnvironments;
|
|
138876
138992
|
}
|
|
138877
138993
|
var init_isLegacyEnv = __esm({
|
|
138878
138994
|
"src/utils/isLegacyEnv.ts"() {
|
|
@@ -138922,7 +139038,7 @@ function getBindings(config, options) {
|
|
|
138922
139038
|
vpc_services: config?.vpc_services
|
|
138923
139039
|
};
|
|
138924
139040
|
}
|
|
138925
|
-
async function collectPendingResources(complianceConfig, accountId, scriptName, bindings) {
|
|
139041
|
+
async function collectPendingResources(complianceConfig, accountId, scriptName, bindings, requireRemote) {
|
|
138926
139042
|
let settings;
|
|
138927
139043
|
try {
|
|
138928
139044
|
settings = await getSettings(complianceConfig, accountId, scriptName);
|
|
@@ -138939,6 +139055,9 @@ async function collectPendingResources(complianceConfig, accountId, scriptName,
|
|
|
138939
139055
|
HANDLERS
|
|
138940
139056
|
)) {
|
|
138941
139057
|
for (const resource of bindings[resourceType] ?? []) {
|
|
139058
|
+
if (requireRemote && !resource.remote) {
|
|
139059
|
+
continue;
|
|
139060
|
+
}
|
|
138942
139061
|
const h7 = new HANDLERS[resourceType].Handler(
|
|
138943
139062
|
resource,
|
|
138944
139063
|
complianceConfig,
|
|
@@ -138957,14 +139076,20 @@ async function collectPendingResources(complianceConfig, accountId, scriptName,
|
|
|
138957
139076
|
(a6, b7) => HANDLERS[a6.resourceType].sort - HANDLERS[b7.resourceType].sort
|
|
138958
139077
|
);
|
|
138959
139078
|
}
|
|
138960
|
-
async function provisionBindings(bindings, accountId, scriptName, autoCreate, config) {
|
|
139079
|
+
async function provisionBindings(bindings, accountId, scriptName, autoCreate, config, requireRemote = false) {
|
|
139080
|
+
const configPath = config.userConfigPath ?? config.configPath;
|
|
138961
139081
|
const pendingResources = await collectPendingResources(
|
|
138962
139082
|
config,
|
|
138963
139083
|
accountId,
|
|
138964
139084
|
scriptName,
|
|
138965
|
-
bindings
|
|
139085
|
+
bindings,
|
|
139086
|
+
requireRemote
|
|
138966
139087
|
);
|
|
138967
139088
|
if (pendingResources.length > 0) {
|
|
139089
|
+
(0, import_node_assert13.default)(
|
|
139090
|
+
configPath,
|
|
139091
|
+
"Provisioning resources is not possible without a config file"
|
|
139092
|
+
);
|
|
138968
139093
|
if (!isLegacyEnv(config)) {
|
|
138969
139094
|
throw new UserError2(
|
|
138970
139095
|
"Provisioning resources is not supported with a service environment"
|
|
@@ -138989,6 +139114,44 @@ async function provisionBindings(bindings, accountId, scriptName, autoCreate, co
|
|
|
138989
139114
|
autoCreate
|
|
138990
139115
|
);
|
|
138991
139116
|
}
|
|
139117
|
+
const patch = {};
|
|
139118
|
+
const allChanges = /* @__PURE__ */ new Map();
|
|
139119
|
+
for (const resource of pendingResources) {
|
|
139120
|
+
allChanges.set(resource.binding, resource.handler.binding);
|
|
139121
|
+
}
|
|
139122
|
+
for (const resourceType of Object.keys(
|
|
139123
|
+
HANDLERS
|
|
139124
|
+
)) {
|
|
139125
|
+
for (const binding of bindings[resourceType] ?? []) {
|
|
139126
|
+
patch[resourceType] ??= [];
|
|
139127
|
+
const bindingToWrite = allChanges.has(binding.binding) ? (
|
|
139128
|
+
// Gated by Map.has()
|
|
139129
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
139130
|
+
allChanges.get(binding.binding)
|
|
139131
|
+
) : binding;
|
|
139132
|
+
patch[resourceType].push(
|
|
139133
|
+
Object.fromEntries(
|
|
139134
|
+
Object.entries(bindingToWrite).filter(
|
|
139135
|
+
// Make sure all the values are JSON serialisable.
|
|
139136
|
+
// Otherwise we end up with "undefined" in the config
|
|
139137
|
+
([_5, value]) => typeof value === "string"
|
|
139138
|
+
)
|
|
139139
|
+
)
|
|
139140
|
+
);
|
|
139141
|
+
}
|
|
139142
|
+
}
|
|
139143
|
+
if (!isNonInteractiveOrCI()) {
|
|
139144
|
+
try {
|
|
139145
|
+
await experimental_patchConfig(configPath, patch, false);
|
|
139146
|
+
logger.log(
|
|
139147
|
+
"Your Worker was deployed with provisioned resources. We've written the IDs of these resources to your config file, which you can choose to save or discard. Either way future deploys will continue to work."
|
|
139148
|
+
);
|
|
139149
|
+
} catch (e8) {
|
|
139150
|
+
if (!(e8 instanceof PatchConfigError)) {
|
|
139151
|
+
throw e8;
|
|
139152
|
+
}
|
|
139153
|
+
}
|
|
139154
|
+
}
|
|
138992
139155
|
const resourceCount = pendingResources.reduce(
|
|
138993
139156
|
(acc, resource) => {
|
|
138994
139157
|
acc[resource.resourceType] ??= 0;
|
|
@@ -139082,17 +139245,19 @@ async function runProvisioningFlow(item, preExisting, friendlyBindingName, scrip
|
|
|
139082
139245
|
logger.log(`\u2728 ${item.binding} provisioned \u{1F389}`);
|
|
139083
139246
|
printDivider();
|
|
139084
139247
|
}
|
|
139085
|
-
var
|
|
139248
|
+
var import_node_assert13, INHERIT_SYMBOL, ProvisionResourceHandler, R2Handler, KVHandler, D1Handler, HANDLERS, LOADERS;
|
|
139086
139249
|
var init_bindings2 = __esm({
|
|
139087
139250
|
"src/deployment-bundle/bindings.ts"() {
|
|
139088
139251
|
init_import_meta_url();
|
|
139089
|
-
|
|
139252
|
+
import_node_assert13 = __toESM(require("assert"));
|
|
139090
139253
|
init_cfetch();
|
|
139254
|
+
init_patch_config();
|
|
139091
139255
|
init_create();
|
|
139092
139256
|
init_list();
|
|
139093
139257
|
init_utils5();
|
|
139094
139258
|
init_dialogs();
|
|
139095
139259
|
init_errors();
|
|
139260
|
+
init_is_interactive();
|
|
139096
139261
|
init_helpers4();
|
|
139097
139262
|
init_logger();
|
|
139098
139263
|
init_metrics2();
|
|
@@ -139173,13 +139338,26 @@ var init_bindings2 = __esm({
|
|
|
139173
139338
|
constructor(binding, complianceConfig, accountId) {
|
|
139174
139339
|
super("r2_bucket", binding, "bucket_name", complianceConfig, accountId);
|
|
139175
139340
|
}
|
|
139341
|
+
/**
|
|
139342
|
+
* Inheriting an R2 binding replaces the id property (bucket_name for R2) with the inheritance symbol.
|
|
139343
|
+
* This works when deploying (and is appropriate for all other binding types), but it means that the
|
|
139344
|
+
* bucket_name for an R2 bucket is not displayed when deploying. As such, only use the inheritance symbol
|
|
139345
|
+
* if the R2 binding has no `bucket_name`.
|
|
139346
|
+
*/
|
|
139347
|
+
inherit() {
|
|
139348
|
+
this.binding.bucket_name ??= INHERIT_SYMBOL;
|
|
139349
|
+
}
|
|
139350
|
+
/**
|
|
139351
|
+
* R2 bindings can be inherited if the binding name and jurisdiction match.
|
|
139352
|
+
* Additionally, if the user has specified a bucket_name in config, make sure that matches
|
|
139353
|
+
*/
|
|
139176
139354
|
canInherit(settings) {
|
|
139177
139355
|
return !!settings?.bindings.find(
|
|
139178
|
-
(existing) => existing.type === this.type && existing.name === this.binding.binding && existing.jurisdiction === this.binding.jurisdiction
|
|
139356
|
+
(existing) => existing.type === this.type && existing.name === this.binding.binding && existing.jurisdiction === this.binding.jurisdiction && (this.binding.bucket_name ? this.binding.bucket_name === existing.bucket_name : true)
|
|
139179
139357
|
);
|
|
139180
139358
|
}
|
|
139181
139359
|
async isConnectedToExistingResource() {
|
|
139182
|
-
(0,
|
|
139360
|
+
(0, import_node_assert13.default)(typeof this.binding.bucket_name !== "symbol");
|
|
139183
139361
|
if (!this.binding.bucket_name) {
|
|
139184
139362
|
return false;
|
|
139185
139363
|
}
|
|
@@ -139259,7 +139437,7 @@ var init_bindings2 = __esm({
|
|
|
139259
139437
|
return false;
|
|
139260
139438
|
}
|
|
139261
139439
|
async isConnectedToExistingResource() {
|
|
139262
|
-
(0,
|
|
139440
|
+
(0, import_node_assert13.default)(typeof this.binding.database_name !== "symbol");
|
|
139263
139441
|
if (!this.binding.database_name) {
|
|
139264
139442
|
return false;
|
|
139265
139443
|
}
|
|
@@ -139583,7 +139761,7 @@ function fromMimeType(mimeType) {
|
|
|
139583
139761
|
}
|
|
139584
139762
|
return moduleType;
|
|
139585
139763
|
}
|
|
139586
|
-
function createWorkerUploadForm(worker) {
|
|
139764
|
+
function createWorkerUploadForm(worker, options) {
|
|
139587
139765
|
const formData = new import_undici6.FormData();
|
|
139588
139766
|
const {
|
|
139589
139767
|
main: main2,
|
|
@@ -139637,6 +139815,9 @@ function createWorkerUploadForm(worker) {
|
|
|
139637
139815
|
}
|
|
139638
139816
|
});
|
|
139639
139817
|
bindings.kv_namespaces?.forEach(({ id, binding, raw }) => {
|
|
139818
|
+
if (options?.dryRun) {
|
|
139819
|
+
id ??= INHERIT_SYMBOL;
|
|
139820
|
+
}
|
|
139640
139821
|
if (id === void 0) {
|
|
139641
139822
|
throw new UserError2(`${binding} bindings must have an "id" field`);
|
|
139642
139823
|
}
|
|
@@ -139700,6 +139881,9 @@ function createWorkerUploadForm(worker) {
|
|
|
139700
139881
|
});
|
|
139701
139882
|
bindings.r2_buckets?.forEach(
|
|
139702
139883
|
({ binding, bucket_name, jurisdiction, raw }) => {
|
|
139884
|
+
if (options?.dryRun) {
|
|
139885
|
+
bucket_name ??= INHERIT_SYMBOL;
|
|
139886
|
+
}
|
|
139703
139887
|
if (bucket_name === void 0) {
|
|
139704
139888
|
throw new UserError2(
|
|
139705
139889
|
`${binding} bindings must have a "bucket_name" field`
|
|
@@ -139723,6 +139907,9 @@ function createWorkerUploadForm(worker) {
|
|
|
139723
139907
|
);
|
|
139724
139908
|
bindings.d1_databases?.forEach(
|
|
139725
139909
|
({ binding, database_id, database_internal_env, raw }) => {
|
|
139910
|
+
if (options?.dryRun) {
|
|
139911
|
+
database_id ??= INHERIT_SYMBOL;
|
|
139912
|
+
}
|
|
139726
139913
|
if (database_id === void 0) {
|
|
139727
139914
|
throw new UserError2(
|
|
139728
139915
|
`${binding} bindings must have a "database_id" field`
|
|
@@ -139939,7 +140126,7 @@ function createWorkerUploadForm(worker) {
|
|
|
139939
140126
|
const manifestModuleName = "__STATIC_CONTENT_MANIFEST";
|
|
139940
140127
|
const hasManifest = modules?.some(({ name: name2 }) => name2 === manifestModuleName);
|
|
139941
140128
|
if (hasManifest && main2.type === "esm") {
|
|
139942
|
-
(0,
|
|
140129
|
+
(0, import_node_assert14.default)(modules !== void 0);
|
|
139943
140130
|
const subDirs = new Set(
|
|
139944
140131
|
modules.map((module3) => import_node_path24.default.posix.dirname(module3.name))
|
|
139945
140132
|
);
|
|
@@ -140065,11 +140252,11 @@ function createWorkerUploadForm(worker) {
|
|
|
140065
140252
|
}
|
|
140066
140253
|
return formData;
|
|
140067
140254
|
}
|
|
140068
|
-
var
|
|
140255
|
+
var import_node_assert14, import_node_fs15, import_node_path24, import_undici6, moduleTypeMimeType;
|
|
140069
140256
|
var init_create_worker_upload_form = __esm({
|
|
140070
140257
|
"src/deployment-bundle/create-worker-upload-form.ts"() {
|
|
140071
140258
|
init_import_meta_url();
|
|
140072
|
-
|
|
140259
|
+
import_node_assert14 = __toESM(require("assert"));
|
|
140073
140260
|
import_node_fs15 = require("fs");
|
|
140074
140261
|
import_node_path24 = __toESM(require("path"));
|
|
140075
140262
|
import_undici6 = __toESM(require_undici());
|
|
@@ -140169,7 +140356,7 @@ var init_node_compat = __esm({
|
|
|
140169
140356
|
// src/durable.ts
|
|
140170
140357
|
async function getMigrationsToUpload(scriptName, props) {
|
|
140171
140358
|
const { config, accountId } = props;
|
|
140172
|
-
(0,
|
|
140359
|
+
(0, import_node_assert15.default)(accountId, "Missing accountId");
|
|
140173
140360
|
let migrations;
|
|
140174
140361
|
if (config.migrations.length > 0) {
|
|
140175
140362
|
let script;
|
|
@@ -140239,11 +140426,11 @@ async function getMigrationsToUpload(scriptName, props) {
|
|
|
140239
140426
|
}
|
|
140240
140427
|
return migrations;
|
|
140241
140428
|
}
|
|
140242
|
-
var
|
|
140429
|
+
var import_node_assert15, suppressNotFoundError;
|
|
140243
140430
|
var init_durable = __esm({
|
|
140244
140431
|
"src/durable.ts"() {
|
|
140245
140432
|
init_import_meta_url();
|
|
140246
|
-
|
|
140433
|
+
import_node_assert15 = __toESM(require("assert"));
|
|
140247
140434
|
init_cfetch();
|
|
140248
140435
|
init_config5();
|
|
140249
140436
|
init_logger();
|
|
@@ -140447,7 +140634,7 @@ async function syncWorkersSite(complianceConfig, accountId, scriptName, siteAsse
|
|
|
140447
140634
|
logger.log("(Note: doing a dry run, not uploading or deleting anything.)");
|
|
140448
140635
|
return { manifest: void 0, namespace: void 0 };
|
|
140449
140636
|
}
|
|
140450
|
-
(0,
|
|
140637
|
+
(0, import_node_assert16.default)(accountId, "Missing accountId");
|
|
140451
140638
|
const title = `__${scriptName}-workers_sites_assets${preview ? "_preview" : ""}`;
|
|
140452
140639
|
const { id: namespace } = await createKVNamespaceIfNotAlreadyExisting(
|
|
140453
140640
|
complianceConfig,
|
|
@@ -140665,11 +140852,11 @@ function getSiteAssetPaths(config, assetDirectory, includePatterns = config.site
|
|
|
140665
140852
|
return void 0;
|
|
140666
140853
|
}
|
|
140667
140854
|
}
|
|
140668
|
-
var
|
|
140855
|
+
var import_node_assert16, import_promises9, path26, ALWAYS_IGNORE, HIDDEN_FILES_TO_INCLUDE, MAX_DIFF_LINES, MAX_BUCKET_SIZE2, MAX_BUCKET_KEYS, MAX_BATCH_OPERATIONS;
|
|
140669
140856
|
var init_sites2 = __esm({
|
|
140670
140857
|
"src/sites.ts"() {
|
|
140671
140858
|
init_import_meta_url();
|
|
140672
|
-
|
|
140859
|
+
import_node_assert16 = __toESM(require("assert"));
|
|
140673
140860
|
import_promises9 = require("fs/promises");
|
|
140674
140861
|
path26 = __toESM(require("path"));
|
|
140675
140862
|
init_workers_shared();
|
|
@@ -152797,7 +152984,8 @@ function createHandler(def, commandName) {
|
|
|
152797
152984
|
MULTIWORKER: false,
|
|
152798
152985
|
RESOURCES_PROVISION: args.experimentalProvision ?? false,
|
|
152799
152986
|
REMOTE_BINDINGS: args.experimentalRemoteBindings ?? false,
|
|
152800
|
-
DEPLOY_REMOTE_DIFF_CHECK: false
|
|
152987
|
+
DEPLOY_REMOTE_DIFF_CHECK: false,
|
|
152988
|
+
AUTOCREATE_RESOURCES: args.experimentalAutoCreate
|
|
152801
152989
|
};
|
|
152802
152990
|
await run(experimentalFlags, () => {
|
|
152803
152991
|
const config = def.behaviour?.provideConfig ?? true ? readConfig(args, {
|
|
@@ -153211,7 +153399,7 @@ async function executeLocally({
|
|
|
153211
153399
|
} finally {
|
|
153212
153400
|
await mf.dispose();
|
|
153213
153401
|
}
|
|
153214
|
-
(0,
|
|
153402
|
+
(0, import_node_assert17.default)(Array.isArray(results));
|
|
153215
153403
|
const allResults = results.map((result) => ({
|
|
153216
153404
|
results: (result.results ?? []).map(
|
|
153217
153405
|
(row) => Object.fromEntries(
|
|
@@ -153466,12 +153654,12 @@ async function checkForSQLiteBinary(filename) {
|
|
|
153466
153654
|
);
|
|
153467
153655
|
}
|
|
153468
153656
|
}
|
|
153469
|
-
var import_fs16,
|
|
153657
|
+
var import_fs16, import_node_assert17, import_node_path25, import_md5_file, import_miniflare12, import_undici8, d1ExecuteCommand;
|
|
153470
153658
|
var init_execute = __esm({
|
|
153471
153659
|
"src/d1/execute.ts"() {
|
|
153472
153660
|
init_import_meta_url();
|
|
153473
153661
|
import_fs16 = require("fs");
|
|
153474
|
-
|
|
153662
|
+
import_node_assert17 = __toESM(require("assert"));
|
|
153475
153663
|
import_node_path25 = __toESM(require("path"));
|
|
153476
153664
|
init_interactive();
|
|
153477
153665
|
init_source();
|
|
@@ -155661,11 +155849,11 @@ ${jsonString}
|
|
|
155661
155849
|
logger.log("\nProceeding with deployment...\n");
|
|
155662
155850
|
return args;
|
|
155663
155851
|
}
|
|
155664
|
-
var
|
|
155852
|
+
var import_node_assert18, import_node_fs20, import_node_path30, deployCommand;
|
|
155665
155853
|
var init_deploy4 = __esm({
|
|
155666
155854
|
"src/deploy/index.ts"() {
|
|
155667
155855
|
init_import_meta_url();
|
|
155668
|
-
|
|
155856
|
+
import_node_assert18 = __toESM(require("assert"));
|
|
155669
155857
|
import_node_fs20 = require("fs");
|
|
155670
155858
|
import_node_path30 = __toESM(require("path"));
|
|
155671
155859
|
init_source();
|
|
@@ -155875,13 +156063,6 @@ var init_deploy4 = __esm({
|
|
|
155875
156063
|
describe: "Name of a dispatch namespace to deploy the Worker to (Workers for Platforms)",
|
|
155876
156064
|
type: "string"
|
|
155877
156065
|
},
|
|
155878
|
-
"experimental-auto-create": {
|
|
155879
|
-
describe: "Automatically provision draft bindings with new resources",
|
|
155880
|
-
type: "boolean",
|
|
155881
|
-
default: true,
|
|
155882
|
-
hidden: true,
|
|
155883
|
-
alias: "x-auto-create"
|
|
155884
|
-
},
|
|
155885
156066
|
"containers-rollout": {
|
|
155886
156067
|
describe: "Rollout strategy for Containers changes. If set to immediate, it will override `rollout_percentage_steps` if configured and roll out to 100% of instances in one step. ",
|
|
155887
156068
|
choices: ["immediate", "gradual"]
|
|
@@ -155904,7 +156085,8 @@ var init_deploy4 = __esm({
|
|
|
155904
156085
|
MULTIWORKER: false,
|
|
155905
156086
|
RESOURCES_PROVISION: args.experimentalProvision ?? false,
|
|
155906
156087
|
REMOTE_BINDINGS: args.experimentalRemoteBindings ?? true,
|
|
155907
|
-
DEPLOY_REMOTE_DIFF_CHECK: args.experimentalDeployRemoteDiffCheck ?? false
|
|
156088
|
+
DEPLOY_REMOTE_DIFF_CHECK: args.experimentalDeployRemoteDiffCheck ?? false,
|
|
156089
|
+
AUTOCREATE_RESOURCES: args.experimentalAutoCreate
|
|
155908
156090
|
}), "overrideExperimentalFlags"),
|
|
155909
156091
|
warnIfMultipleEnvsConfiguredButNoneSpecified: true
|
|
155910
156092
|
},
|
|
@@ -155976,7 +156158,7 @@ var init_deploy4 = __esm({
|
|
|
155976
156158
|
);
|
|
155977
156159
|
}
|
|
155978
156160
|
if (!args.dryRun) {
|
|
155979
|
-
(0,
|
|
156161
|
+
(0, import_node_assert18.default)(accountId, "Missing account ID");
|
|
155980
156162
|
await verifyWorkerMatchesCITag(
|
|
155981
156163
|
config,
|
|
155982
156164
|
accountId,
|
|
@@ -156255,8 +156437,8 @@ async function runSearch(searchTerm) {
|
|
|
156255
156437
|
hitsPerPage: "1",
|
|
156256
156438
|
getRankingInfo: "0"
|
|
156257
156439
|
});
|
|
156258
|
-
(0,
|
|
156259
|
-
(0,
|
|
156440
|
+
(0, import_node_assert19.default)(id, "Missing Algolia App ID");
|
|
156441
|
+
(0, import_node_assert19.default)(key, "Missing Algolia Key");
|
|
156260
156442
|
const searchResp = await (0, import_undici10.fetch)(
|
|
156261
156443
|
`https://${id}-dsn.algolia.net/1/indexes/${index}/query`,
|
|
156262
156444
|
{
|
|
@@ -156285,11 +156467,11 @@ async function runSearch(searchTerm) {
|
|
|
156285
156467
|
return;
|
|
156286
156468
|
}
|
|
156287
156469
|
}
|
|
156288
|
-
var
|
|
156470
|
+
var import_node_assert19, import_undici10;
|
|
156289
156471
|
var init_helpers7 = __esm({
|
|
156290
156472
|
"src/docs/helpers.ts"() {
|
|
156291
156473
|
init_import_meta_url();
|
|
156292
|
-
|
|
156474
|
+
import_node_assert19 = __toESM(require("assert"));
|
|
156293
156475
|
import_undici10 = __toESM(require_undici());
|
|
156294
156476
|
init_logger();
|
|
156295
156477
|
__name(runSearch, "runSearch");
|
|
@@ -157368,13 +157550,12 @@ async function downloadWorker(accountId, workerName) {
|
|
|
157368
157550
|
config
|
|
157369
157551
|
};
|
|
157370
157552
|
}
|
|
157371
|
-
var import_promises13, import_node_path31,
|
|
157553
|
+
var import_promises13, import_node_path31, init2;
|
|
157372
157554
|
var init_init = __esm({
|
|
157373
157555
|
"src/init.ts"() {
|
|
157374
157556
|
init_import_meta_url();
|
|
157375
157557
|
import_promises13 = require("fs/promises");
|
|
157376
157558
|
import_node_path31 = __toESM(require("path"));
|
|
157377
|
-
import_toml5 = __toESM(require_toml());
|
|
157378
157559
|
init_execa();
|
|
157379
157560
|
init_cfetch();
|
|
157380
157561
|
init_internal();
|
|
@@ -157478,8 +157659,8 @@ var init_init = __esm({
|
|
|
157478
157659
|
);
|
|
157479
157660
|
}
|
|
157480
157661
|
await (0, import_promises13.writeFile)(
|
|
157481
|
-
import_node_path31.default.join(creationDir, "wrangler.
|
|
157482
|
-
|
|
157662
|
+
import_node_path31.default.join(creationDir, "wrangler.jsonc"),
|
|
157663
|
+
JSON.stringify(config, null, 2)
|
|
157483
157664
|
);
|
|
157484
157665
|
} else {
|
|
157485
157666
|
logger.log(`\u{1F300} Running ${replacementC3Command}...`);
|
|
@@ -157499,11 +157680,11 @@ var init_init = __esm({
|
|
|
157499
157680
|
});
|
|
157500
157681
|
|
|
157501
157682
|
// src/kv/index.ts
|
|
157502
|
-
var
|
|
157683
|
+
var import_node_assert20, import_node_buffer4, import_consumers2, import_node_string_decoder, kvNamespace, kvNamespaceNamespace, kvKeyNamespace, kvBulkNamespace, kvNamespaceCreateCommand, kvNamespaceListCommand, kvNamespaceDeleteCommand, kvNamespaceRenameCommand, kvKeyPutCommand, kvKeyListCommand, kvKeyGetCommand, kvKeyDeleteCommand, kvBulkGetCommand, kvBulkPutCommand, kvBulkDeleteCommand;
|
|
157503
157684
|
var init_kv2 = __esm({
|
|
157504
157685
|
"src/kv/index.ts"() {
|
|
157505
157686
|
init_import_meta_url();
|
|
157506
|
-
|
|
157687
|
+
import_node_assert20 = require("assert");
|
|
157507
157688
|
import_node_buffer4 = require("buffer");
|
|
157508
157689
|
import_consumers2 = require("stream/consumers");
|
|
157509
157690
|
import_node_string_decoder = require("string_decoder");
|
|
@@ -157650,7 +157831,7 @@ var init_kv2 = __esm({
|
|
|
157650
157831
|
printResourceLocation("remote");
|
|
157651
157832
|
let id;
|
|
157652
157833
|
try {
|
|
157653
|
-
id = getKVNamespaceId(args, config);
|
|
157834
|
+
id = await getKVNamespaceId(args, config, false);
|
|
157654
157835
|
} catch (e8) {
|
|
157655
157836
|
throw new CommandLineArgsError(
|
|
157656
157837
|
"Not able to delete namespace.\n" + (e8.message ?? e8)
|
|
@@ -157719,7 +157900,7 @@ var init_kv2 = __esm({
|
|
|
157719
157900
|
}
|
|
157720
157901
|
namespaceId = namespace.id;
|
|
157721
157902
|
}
|
|
157722
|
-
(0,
|
|
157903
|
+
(0, import_node_assert20.strict)(namespaceId, "namespaceId should be defined");
|
|
157723
157904
|
logger.log(`Renaming KV namespace ${namespaceId} to "${args.newName}".`);
|
|
157724
157905
|
const updatedNamespace = await updateKVNamespace(
|
|
157725
157906
|
config,
|
|
@@ -157810,7 +157991,7 @@ var init_kv2 = __esm({
|
|
|
157810
157991
|
async handler({ key, ttl, expiration, metadata, ...args }) {
|
|
157811
157992
|
const localMode = isLocal(args);
|
|
157812
157993
|
const config = readConfig(args);
|
|
157813
|
-
const namespaceId = getKVNamespaceId(args, config);
|
|
157994
|
+
const namespaceId = await getKVNamespaceId(args, config, localMode);
|
|
157814
157995
|
const value = args.path ? readFileSyncToBuffer(args.path) : (
|
|
157815
157996
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
157816
157997
|
args.value
|
|
@@ -157907,7 +158088,7 @@ var init_kv2 = __esm({
|
|
|
157907
158088
|
async handler({ prefix, ...args }) {
|
|
157908
158089
|
const localMode = isLocal(args);
|
|
157909
158090
|
const config = readConfig(args);
|
|
157910
|
-
const namespaceId = getKVNamespaceId(args, config);
|
|
158091
|
+
const namespaceId = await getKVNamespaceId(args, config, localMode);
|
|
157911
158092
|
let result;
|
|
157912
158093
|
let metricEvent;
|
|
157913
158094
|
if (localMode) {
|
|
@@ -157993,7 +158174,7 @@ var init_kv2 = __esm({
|
|
|
157993
158174
|
async handler({ key, ...args }) {
|
|
157994
158175
|
const localMode = isLocal(args);
|
|
157995
158176
|
const config = readConfig(args);
|
|
157996
|
-
const namespaceId = getKVNamespaceId(args, config);
|
|
158177
|
+
const namespaceId = await getKVNamespaceId(args, config, localMode);
|
|
157997
158178
|
let bufferKVValue;
|
|
157998
158179
|
let metricEvent;
|
|
157999
158180
|
if (localMode) {
|
|
@@ -158077,7 +158258,7 @@ var init_kv2 = __esm({
|
|
|
158077
158258
|
async handler({ key, ...args }) {
|
|
158078
158259
|
const localMode = isLocal(args);
|
|
158079
158260
|
const config = readConfig(args);
|
|
158080
|
-
const namespaceId = getKVNamespaceId(args, config);
|
|
158261
|
+
const namespaceId = await getKVNamespaceId(args, config, localMode);
|
|
158081
158262
|
logger.log(`Deleting the key "${key}" on namespace ${namespaceId}.`);
|
|
158082
158263
|
let metricEvent;
|
|
158083
158264
|
if (localMode) {
|
|
@@ -158146,7 +158327,7 @@ var init_kv2 = __esm({
|
|
|
158146
158327
|
async handler({ filename, ...args }) {
|
|
158147
158328
|
const localMode = isLocal(args);
|
|
158148
158329
|
const config = readConfig(args);
|
|
158149
|
-
const namespaceId = getKVNamespaceId(args, config);
|
|
158330
|
+
const namespaceId = await getKVNamespaceId(args, config, localMode);
|
|
158150
158331
|
const content = parseJSON(readFileSync6(filename), filename);
|
|
158151
158332
|
if (!Array.isArray(content)) {
|
|
158152
158333
|
throw new UserError2(
|
|
@@ -158271,7 +158452,7 @@ Expected an array of strings or objects with a "name" key.
|
|
|
158271
158452
|
async handler({ filename, ...args }) {
|
|
158272
158453
|
const localMode = isLocal(args);
|
|
158273
158454
|
const config = readConfig(args);
|
|
158274
|
-
const namespaceId = getKVNamespaceId(args, config);
|
|
158455
|
+
const namespaceId = await getKVNamespaceId(args, config, localMode);
|
|
158275
158456
|
const content = parseJSON(readFileSync6(filename), filename);
|
|
158276
158457
|
if (!Array.isArray(content)) {
|
|
158277
158458
|
throw new UserError2(
|
|
@@ -158415,7 +158596,7 @@ interface KeyValue {
|
|
|
158415
158596
|
async handler({ filename, ...args }) {
|
|
158416
158597
|
const localMode = isLocal(args);
|
|
158417
158598
|
const config = readConfig(args);
|
|
158418
|
-
const namespaceId = getKVNamespaceId(args, config);
|
|
158599
|
+
const namespaceId = await getKVNamespaceId(args, config, localMode);
|
|
158419
158600
|
if (!args.force) {
|
|
158420
158601
|
const result = await confirm(
|
|
158421
158602
|
`Are you sure you want to delete all the keys read from "${filename}" from kv-namespace with id "${namespaceId}"?`
|
|
@@ -165554,7 +165735,8 @@ ${JSON.stringify(defaultRoutesJSONSpec, null, 2)}`
|
|
|
165554
165735
|
MULTIWORKER: Array.isArray(args.config),
|
|
165555
165736
|
RESOURCES_PROVISION: false,
|
|
165556
165737
|
REMOTE_BINDINGS: false,
|
|
165557
|
-
DEPLOY_REMOTE_DIFF_CHECK: false
|
|
165738
|
+
DEPLOY_REMOTE_DIFF_CHECK: false,
|
|
165739
|
+
AUTOCREATE_RESOURCES: false
|
|
165558
165740
|
},
|
|
165559
165741
|
() => startDev({
|
|
165560
165742
|
script: scriptEntrypoint,
|
|
@@ -165621,6 +165803,7 @@ ${JSON.stringify(defaultRoutesJSONSpec, null, 2)}`
|
|
|
165621
165803
|
experimentalRemoteBindings: true,
|
|
165622
165804
|
experimentalVectorizeBindToProd: false,
|
|
165623
165805
|
experimentalImagesLocalMode: false,
|
|
165806
|
+
experimentalAutoCreate: false,
|
|
165624
165807
|
enableIpc: true,
|
|
165625
165808
|
config: Array.isArray(args.config) ? args.config : void 0,
|
|
165626
165809
|
site: void 0,
|
|
@@ -165760,7 +165943,7 @@ async function toEnvironment(deploymentConfig, accountId) {
|
|
|
165760
165943
|
return configObj;
|
|
165761
165944
|
}
|
|
165762
165945
|
async function writeWranglerToml(toml) {
|
|
165763
|
-
let tomlString =
|
|
165946
|
+
let tomlString = import_toml5.default.stringify(toml);
|
|
165764
165947
|
tomlString = tomlString.split("\n").map((line) => line.trimStart()).join("\n");
|
|
165765
165948
|
await (0, import_promises24.writeFile)(
|
|
165766
165949
|
"wrangler.toml",
|
|
@@ -165819,13 +166002,13 @@ async function downloadProject(accountId, projectName) {
|
|
|
165819
166002
|
}
|
|
165820
166003
|
};
|
|
165821
166004
|
}
|
|
165822
|
-
var import_fs17, import_promises24,
|
|
166005
|
+
var import_fs17, import_promises24, import_toml5, import_miniflare16, pagesDownloadConfigCommand;
|
|
165823
166006
|
var init_download_config = __esm({
|
|
165824
166007
|
"src/pages/download-config.ts"() {
|
|
165825
166008
|
init_import_meta_url();
|
|
165826
166009
|
import_fs17 = require("fs");
|
|
165827
166010
|
import_promises24 = require("fs/promises");
|
|
165828
|
-
|
|
166011
|
+
import_toml5 = __toESM(require_toml());
|
|
165829
166012
|
init_source();
|
|
165830
166013
|
import_miniflare16 = require("miniflare");
|
|
165831
166014
|
init_cfetch();
|
|
@@ -199761,7 +199944,7 @@ async function generateR2ServiceToken(accountId, bucketName, pipelineName) {
|
|
|
199761
199944
|
const timeoutPromise = (0, import_promises26.setTimeout)(12e4, "timeout", { signal });
|
|
199762
199945
|
const serverPromise = new Promise((resolve25, reject) => {
|
|
199763
199946
|
const server = import_node_http2.default.createServer(async (request4, response) => {
|
|
199764
|
-
(0,
|
|
199947
|
+
(0, import_node_assert21.default)(request4.url, "This request doesn't have a URL");
|
|
199765
199948
|
if (request4.method !== "GET") {
|
|
199766
199949
|
response.writeHead(405);
|
|
199767
199950
|
response.end("Method not allowed.");
|
|
@@ -199813,11 +199996,11 @@ async function getR2Bucket2(complianceConfig, accountId, name2) {
|
|
|
199813
199996
|
`/accounts/${accountId}/r2/buckets/${name2}`
|
|
199814
199997
|
);
|
|
199815
199998
|
}
|
|
199816
|
-
var
|
|
199999
|
+
var import_node_assert21, import_node_http2, import_promises26, import_node_url9;
|
|
199817
200000
|
var init_client7 = __esm({
|
|
199818
200001
|
"src/pipelines/client.ts"() {
|
|
199819
200002
|
init_import_meta_url();
|
|
199820
|
-
|
|
200003
|
+
import_node_assert21 = __toESM(require("assert"));
|
|
199821
200004
|
import_node_http2 = __toESM(require("http"));
|
|
199822
200005
|
import_promises26 = require("timers/promises");
|
|
199823
200006
|
import_node_url9 = require("url");
|
|
@@ -204787,6 +204970,7 @@ var init_catalog = __esm({
|
|
|
204787
204970
|
init_create_command();
|
|
204788
204971
|
init_dialogs();
|
|
204789
204972
|
init_misc_variables();
|
|
204973
|
+
init_errors();
|
|
204790
204974
|
init_logger();
|
|
204791
204975
|
init_parse();
|
|
204792
204976
|
init_user3();
|
|
@@ -204929,17 +205113,27 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/`
|
|
|
204929
205113
|
});
|
|
204930
205114
|
r2BucketCatalogCompactionEnableCommand = createCommand({
|
|
204931
205115
|
metadata: {
|
|
204932
|
-
description: "Enable automatic file compaction for your R2 data catalog",
|
|
205116
|
+
description: "Enable automatic file compaction for your R2 data catalog or a specific table",
|
|
204933
205117
|
status: "open-beta",
|
|
204934
205118
|
owner: "Product: R2 Data Catalog"
|
|
204935
205119
|
},
|
|
204936
|
-
positionalArgs: ["bucket"],
|
|
205120
|
+
positionalArgs: ["bucket", "namespace", "table"],
|
|
204937
205121
|
args: {
|
|
204938
205122
|
bucket: {
|
|
204939
205123
|
describe: "The name of the bucket which contains the catalog",
|
|
204940
205124
|
type: "string",
|
|
204941
205125
|
demandOption: true
|
|
204942
205126
|
},
|
|
205127
|
+
namespace: {
|
|
205128
|
+
describe: "The namespace containing the table (optional, for table-level compaction)",
|
|
205129
|
+
type: "string",
|
|
205130
|
+
demandOption: false
|
|
205131
|
+
},
|
|
205132
|
+
table: {
|
|
205133
|
+
describe: "The name of the table (optional, for table-level compaction)",
|
|
205134
|
+
type: "string",
|
|
205135
|
+
demandOption: false
|
|
205136
|
+
},
|
|
204943
205137
|
"target-size": {
|
|
204944
205138
|
describe: "The target size for compacted files in MB (allowed values: 64, 128, 256, 512)",
|
|
204945
205139
|
type: "number",
|
|
@@ -204947,57 +205141,121 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/`
|
|
|
204947
205141
|
default: 128
|
|
204948
205142
|
},
|
|
204949
205143
|
token: {
|
|
204950
|
-
describe: "A cloudflare api token with access to R2 and R2 Data Catalog
|
|
204951
|
-
demandOption:
|
|
205144
|
+
describe: "A cloudflare api token with access to R2 and R2 Data Catalog (required for catalog-level compaction settings only)",
|
|
205145
|
+
demandOption: false,
|
|
204952
205146
|
type: "string"
|
|
204953
205147
|
}
|
|
204954
205148
|
},
|
|
204955
205149
|
async handler(args, { config }) {
|
|
204956
205150
|
const accountId = await requireAuth(config);
|
|
204957
|
-
|
|
204958
|
-
|
|
204959
|
-
|
|
204960
|
-
|
|
204961
|
-
|
|
204962
|
-
|
|
204963
|
-
|
|
204964
|
-
|
|
204965
|
-
|
|
204966
|
-
|
|
204967
|
-
|
|
204968
|
-
|
|
204969
|
-
|
|
204970
|
-
|
|
204971
|
-
|
|
205151
|
+
if (args.namespace && !args.table) {
|
|
205152
|
+
throw new UserError2("Table name is required when namespace is specified");
|
|
205153
|
+
}
|
|
205154
|
+
if (!args.namespace && args.table) {
|
|
205155
|
+
throw new UserError2("Namespace is required when table is specified");
|
|
205156
|
+
}
|
|
205157
|
+
if (args.namespace && args.table) {
|
|
205158
|
+
await enableR2CatalogTableCompaction(
|
|
205159
|
+
config,
|
|
205160
|
+
accountId,
|
|
205161
|
+
args.bucket,
|
|
205162
|
+
args.namespace,
|
|
205163
|
+
args.table,
|
|
205164
|
+
args.targetSize !== 128 ? args.targetSize : void 0
|
|
205165
|
+
);
|
|
205166
|
+
logger.log(
|
|
205167
|
+
`\u2728 Successfully enabled file compaction for table '${args.namespace}.${args.table}' in bucket '${args.bucket}'.`
|
|
205168
|
+
);
|
|
205169
|
+
} else {
|
|
205170
|
+
if (!args.token) {
|
|
205171
|
+
throw new UserError2(
|
|
205172
|
+
"Token is required for catalog-level compaction. Use --token flag to provide a Cloudflare API token."
|
|
205173
|
+
);
|
|
205174
|
+
}
|
|
205175
|
+
await upsertR2DataCatalogCredential(
|
|
205176
|
+
config,
|
|
205177
|
+
accountId,
|
|
205178
|
+
args.bucket,
|
|
205179
|
+
args.token
|
|
205180
|
+
);
|
|
205181
|
+
await enableR2CatalogCompaction(
|
|
205182
|
+
config,
|
|
205183
|
+
accountId,
|
|
205184
|
+
args.bucket,
|
|
205185
|
+
args.targetSize
|
|
205186
|
+
);
|
|
205187
|
+
logger.log(
|
|
205188
|
+
`\u2728 Successfully enabled file compaction for the data catalog for bucket '${args.bucket}'.
|
|
205189
|
+
|
|
205190
|
+
Compaction will automatically combine small files into larger ones to improve query performance.
|
|
205191
|
+
For more details, refer to: https://developers.cloudflare.com/r2/data-catalog/about-compaction/`
|
|
205192
|
+
);
|
|
205193
|
+
}
|
|
204972
205194
|
}
|
|
204973
205195
|
});
|
|
204974
205196
|
r2BucketCatalogCompactionDisableCommand = createCommand({
|
|
204975
205197
|
metadata: {
|
|
204976
|
-
description: "Disable automatic file compaction for your R2 data catalog",
|
|
205198
|
+
description: "Disable automatic file compaction for your R2 data catalog or a specific table",
|
|
204977
205199
|
status: "open-beta",
|
|
204978
205200
|
owner: "Product: R2 Data Catalog"
|
|
204979
205201
|
},
|
|
204980
|
-
positionalArgs: ["bucket"],
|
|
205202
|
+
positionalArgs: ["bucket", "namespace", "table"],
|
|
204981
205203
|
args: {
|
|
204982
205204
|
bucket: {
|
|
204983
205205
|
describe: "The name of the bucket which contains the catalog",
|
|
204984
205206
|
type: "string",
|
|
204985
205207
|
demandOption: true
|
|
205208
|
+
},
|
|
205209
|
+
namespace: {
|
|
205210
|
+
describe: "The namespace containing the table (optional, for table-level compaction)",
|
|
205211
|
+
type: "string",
|
|
205212
|
+
demandOption: false
|
|
205213
|
+
},
|
|
205214
|
+
table: {
|
|
205215
|
+
describe: "The name of the table (optional, for table-level compaction)",
|
|
205216
|
+
type: "string",
|
|
205217
|
+
demandOption: false
|
|
204986
205218
|
}
|
|
204987
205219
|
},
|
|
204988
205220
|
async handler(args, { config }) {
|
|
204989
205221
|
const accountId = await requireAuth(config);
|
|
204990
|
-
|
|
204991
|
-
|
|
204992
|
-
|
|
204993
|
-
if (!
|
|
204994
|
-
|
|
204995
|
-
|
|
205222
|
+
if (args.namespace && !args.table) {
|
|
205223
|
+
throw new UserError2("Table name is required when namespace is specified");
|
|
205224
|
+
}
|
|
205225
|
+
if (!args.namespace && args.table) {
|
|
205226
|
+
throw new UserError2("Namespace is required when table is specified");
|
|
205227
|
+
}
|
|
205228
|
+
if (args.namespace && args.table) {
|
|
205229
|
+
const confirmedDisable = await confirm(
|
|
205230
|
+
`Are you sure you want to disable file compaction for table '${args.namespace}.${args.table}' in bucket '${args.bucket}'?`
|
|
205231
|
+
);
|
|
205232
|
+
if (!confirmedDisable) {
|
|
205233
|
+
logger.log("Disable cancelled.");
|
|
205234
|
+
return;
|
|
205235
|
+
}
|
|
205236
|
+
await disableR2CatalogTableCompaction(
|
|
205237
|
+
config,
|
|
205238
|
+
accountId,
|
|
205239
|
+
args.bucket,
|
|
205240
|
+
args.namespace,
|
|
205241
|
+
args.table
|
|
205242
|
+
);
|
|
205243
|
+
logger.log(
|
|
205244
|
+
`Successfully disabled file compaction for table '${args.namespace}.${args.table}' in bucket '${args.bucket}'.`
|
|
205245
|
+
);
|
|
205246
|
+
} else {
|
|
205247
|
+
const confirmedDisable = await confirm(
|
|
205248
|
+
`Are you sure you want to disable file compaction for the data catalog for bucket '${args.bucket}'?`
|
|
205249
|
+
);
|
|
205250
|
+
if (!confirmedDisable) {
|
|
205251
|
+
logger.log("Disable cancelled.");
|
|
205252
|
+
return;
|
|
205253
|
+
}
|
|
205254
|
+
await disableR2CatalogCompaction(config, accountId, args.bucket);
|
|
205255
|
+
logger.log(
|
|
205256
|
+
`Successfully disabled file compaction for the data catalog for bucket '${args.bucket}'.`
|
|
205257
|
+
);
|
|
204996
205258
|
}
|
|
204997
|
-
await disableR2CatalogCompaction(config, accountId, args.bucket);
|
|
204998
|
-
logger.log(
|
|
204999
|
-
`Successfully disabled file compaction for the data catalog for bucket '${args.bucket}'.`
|
|
205000
|
-
);
|
|
205001
205259
|
}
|
|
205002
205260
|
});
|
|
205003
205261
|
}
|
|
@@ -223579,7 +223837,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
223579
223837
|
workerBundle = createWorkerUploadForm(worker);
|
|
223580
223838
|
printBindings({ ...bindings, vars: maskedVars }, config.tail_consumers);
|
|
223581
223839
|
} else {
|
|
223582
|
-
(0,
|
|
223840
|
+
(0, import_node_assert22.default)(accountId, "Missing accountId");
|
|
223583
223841
|
if (getFlag("RESOURCES_PROVISION")) {
|
|
223584
223842
|
await provisionBindings(
|
|
223585
223843
|
bindings,
|
|
@@ -223760,11 +224018,11 @@ function generatePreviewAlias(scriptName) {
|
|
|
223760
224018
|
);
|
|
223761
224019
|
return truncatedAlias || warnAndExit();
|
|
223762
224020
|
}
|
|
223763
|
-
var
|
|
224021
|
+
var import_node_assert22, import_node_child_process7, import_node_crypto12, import_node_fs35, import_node_path53, import_undici20, versionsUploadCommand, MAX_DNS_LABEL_LENGTH, HASH_LENGTH, ALIAS_VALIDATION_REGEX;
|
|
223764
224022
|
var init_upload5 = __esm({
|
|
223765
224023
|
"src/versions/upload.ts"() {
|
|
223766
224024
|
init_import_meta_url();
|
|
223767
|
-
|
|
224025
|
+
import_node_assert22 = __toESM(require("assert"));
|
|
223768
224026
|
import_node_child_process7 = require("child_process");
|
|
223769
224027
|
import_node_crypto12 = require("crypto");
|
|
223770
224028
|
import_node_fs35 = require("fs");
|
|
@@ -223975,7 +224233,8 @@ var init_upload5 = __esm({
|
|
|
223975
224233
|
MULTIWORKER: false,
|
|
223976
224234
|
RESOURCES_PROVISION: args.experimentalProvision ?? false,
|
|
223977
224235
|
REMOTE_BINDINGS: args.experimentalRemoteBindings ?? true,
|
|
223978
|
-
DEPLOY_REMOTE_DIFF_CHECK: false
|
|
224236
|
+
DEPLOY_REMOTE_DIFF_CHECK: false,
|
|
224237
|
+
AUTOCREATE_RESOURCES: args.experimentalAutoCreate
|
|
223979
224238
|
}), "overrideExperimentalFlags"),
|
|
223980
224239
|
warnIfMultipleEnvsConfiguredButNoneSpecified: true
|
|
223981
224240
|
},
|
|
@@ -224038,7 +224297,7 @@ var init_upload5 = __esm({
|
|
|
224038
224297
|
}
|
|
224039
224298
|
const previewAlias = args.previewAlias ?? (getCIGeneratePreviewAlias() === "true" ? generatePreviewAlias(name2) : void 0);
|
|
224040
224299
|
if (!args.dryRun) {
|
|
224041
|
-
(0,
|
|
224300
|
+
(0, import_node_assert22.default)(accountId, "Missing account ID");
|
|
224042
224301
|
await verifyWorkerMatchesCITag(
|
|
224043
224302
|
config,
|
|
224044
224303
|
accountId,
|
|
@@ -224103,85 +224362,17 @@ var init_upload5 = __esm({
|
|
|
224103
224362
|
});
|
|
224104
224363
|
|
|
224105
224364
|
// src/versions/view.ts
|
|
224106
|
-
function printBindingAsToml(binding) {
|
|
224107
|
-
switch (binding.type) {
|
|
224108
|
-
case "ai":
|
|
224109
|
-
return `[ai]
|
|
224110
|
-
binding = ${binding.name}`;
|
|
224111
|
-
case "analytics_engine":
|
|
224112
|
-
return `[[analytics_engine_datasets]]
|
|
224113
|
-
binding = ${binding.name}` + (binding.dataset ? `
|
|
224114
|
-
dataset = ${binding.dataset}` : "");
|
|
224115
|
-
case "browser":
|
|
224116
|
-
return `[browser]
|
|
224117
|
-
binding = "${binding.name}"`;
|
|
224118
|
-
case "d1":
|
|
224119
|
-
return `[[d1_databases]]
|
|
224120
|
-
binding = "${binding.name}"
|
|
224121
|
-
database_id = "${binding.id}"`;
|
|
224122
|
-
case "dispatch_namespace":
|
|
224123
|
-
return `[[dispatch_namespaces]]
|
|
224124
|
-
binding = "${binding.name}"
|
|
224125
|
-
namespce = "${binding.namespace}"` + (binding.outbound ? `
|
|
224126
|
-
outbound = { service = "${binding.outbound.worker.service}"` + (binding.outbound.params ? `, parameters = [${binding.outbound.params.map((param) => param.name).join(", ")}]` : "") + " }" : "");
|
|
224127
|
-
case "durable_object_namespace":
|
|
224128
|
-
return `[[durable_objects.bindings]]
|
|
224129
|
-
name = "${binding.name}"
|
|
224130
|
-
class_name = "${binding.class_name}"` + (binding.script_name ? `
|
|
224131
|
-
script_name = "${binding.script_name}"` : "");
|
|
224132
|
-
case "hyperdrive":
|
|
224133
|
-
return `[[hyperdrive]]
|
|
224134
|
-
binding = "${binding.name}"
|
|
224135
|
-
id = "${binding.id}"`;
|
|
224136
|
-
case "kv_namespace":
|
|
224137
|
-
return `[[kv_namespaces]]
|
|
224138
|
-
binding = "${binding.name}"
|
|
224139
|
-
id = "${binding.namespace_id}"`;
|
|
224140
|
-
case "mtls_certificate":
|
|
224141
|
-
return `[[mtls_certificates]]
|
|
224142
|
-
binding = "${binding.name}"
|
|
224143
|
-
certificate_id = "${binding.certificate_id}"`;
|
|
224144
|
-
case "queue":
|
|
224145
|
-
return `[[queues.producers]]
|
|
224146
|
-
binding = "${binding.name}"
|
|
224147
|
-
queue = "${binding.queue_name}"` + (binding.delivery_delay ? `
|
|
224148
|
-
delivery_delay = ${binding.delivery_delay}` : "");
|
|
224149
|
-
case "r2_bucket":
|
|
224150
|
-
return `[[r2_buckets]]
|
|
224151
|
-
binding = "${binding.name}"
|
|
224152
|
-
bucket_name = "${binding.bucket_name}"` + (binding.jurisdiction ? `
|
|
224153
|
-
jurisdiction = "${binding.jurisdiction}"` : "");
|
|
224154
|
-
case "send_email":
|
|
224155
|
-
return `[[send_email]]
|
|
224156
|
-
name = "${binding.name}"` + (binding.destination_address ? `
|
|
224157
|
-
destination_address = "${binding.destination_address}"` : "") + (binding.allowed_destination_addresses ? `
|
|
224158
|
-
allowed_destination_addresses = [${binding.allowed_destination_addresses.map((addr) => `"${addr}"`).join(", ")}]` : "") + (binding.allowed_sender_addresses ? `
|
|
224159
|
-
allowed_sender_addresses = [${binding.allowed_sender_addresses.map((addr) => `"${addr}"`).join(", ")}]` : "");
|
|
224160
|
-
case "service":
|
|
224161
|
-
return `[[services]]
|
|
224162
|
-
binding = "${binding.name}"
|
|
224163
|
-
service = "${binding.name}"` + (binding.entrypoint ? `
|
|
224164
|
-
entrypoint = "${binding.entrypoint}"` : "");
|
|
224165
|
-
case "vectorize":
|
|
224166
|
-
return `[[vectorize]]
|
|
224167
|
-
binding = "${binding.name}"
|
|
224168
|
-
index_name = "${binding.index_name}"`;
|
|
224169
|
-
case "version_metadata":
|
|
224170
|
-
return `[version_metadata]
|
|
224171
|
-
binding = "${binding.name}"`;
|
|
224172
|
-
default:
|
|
224173
|
-
return null;
|
|
224174
|
-
}
|
|
224175
|
-
}
|
|
224176
224365
|
var BLANK_INPUT5, versionsViewCommand;
|
|
224177
224366
|
var init_view2 = __esm({
|
|
224178
224367
|
"src/versions/view.ts"() {
|
|
224179
224368
|
init_import_meta_url();
|
|
224180
224369
|
init_cli();
|
|
224370
|
+
init_utils4();
|
|
224181
224371
|
init_create_command();
|
|
224182
224372
|
init_errors();
|
|
224183
224373
|
init_metrics2();
|
|
224184
224374
|
init_user3();
|
|
224375
|
+
init_print_bindings();
|
|
224185
224376
|
init_render_labelled_values();
|
|
224186
224377
|
init_api();
|
|
224187
224378
|
init_list11();
|
|
@@ -224214,7 +224405,7 @@ var init_view2 = __esm({
|
|
|
224214
224405
|
}
|
|
224215
224406
|
},
|
|
224216
224407
|
positionalArgs: ["version-id"],
|
|
224217
|
-
|
|
224408
|
+
async handler(args, { config }) {
|
|
224218
224409
|
sendMetricsEvent(
|
|
224219
224410
|
"view worker version",
|
|
224220
224411
|
{},
|
|
@@ -224261,14 +224452,14 @@ var init_view2 = __esm({
|
|
|
224261
224452
|
scriptInfo["Compatibility Flags"] = version5.resources.script_runtime.compatibility_flags.join(", ");
|
|
224262
224453
|
}
|
|
224263
224454
|
if (Object.keys(scriptInfo).length > 0) {
|
|
224264
|
-
logRaw("
|
|
224455
|
+
logRaw("");
|
|
224265
224456
|
logRaw(formatLabelledValues(scriptInfo));
|
|
224266
224457
|
}
|
|
224267
224458
|
const secrets = version5.resources.bindings.filter(
|
|
224268
224459
|
(binding) => binding.type === "secret_text"
|
|
224269
224460
|
);
|
|
224270
224461
|
if (secrets.length > 0) {
|
|
224271
|
-
logRaw("
|
|
224462
|
+
logRaw("Secrets:");
|
|
224272
224463
|
for (const secret of secrets) {
|
|
224273
224464
|
logRaw(
|
|
224274
224465
|
formatLabelledValues({
|
|
@@ -224281,31 +224472,12 @@ var init_view2 = __esm({
|
|
|
224281
224472
|
(binding) => binding.type !== "secret_text"
|
|
224282
224473
|
);
|
|
224283
224474
|
if (bindings.length > 0) {
|
|
224284
|
-
|
|
224285
|
-
|
|
224286
|
-
(binding) => binding.type === "plain_text"
|
|
224287
|
-
);
|
|
224288
|
-
if (envVars.length > 0) {
|
|
224289
|
-
logRaw(
|
|
224290
|
-
`[vars]
|
|
224291
|
-
` + // ts is having issues typing from the filter
|
|
224292
|
-
envVars.map((envVar) => `${envVar.name} = "${envVar.text}"`).join("\n")
|
|
224293
|
-
);
|
|
224294
|
-
}
|
|
224295
|
-
const restOfBindings = bindings.filter(
|
|
224296
|
-
(binding) => binding.type !== "plain_text"
|
|
224475
|
+
printBindings(
|
|
224476
|
+
(await convertBindingsToCfWorkerInitBindings(bindings)).bindings
|
|
224297
224477
|
);
|
|
224298
|
-
for (const binding of restOfBindings) {
|
|
224299
|
-
const output = printBindingAsToml(binding);
|
|
224300
|
-
if (output !== null) {
|
|
224301
|
-
logRaw(output);
|
|
224302
|
-
logRaw("");
|
|
224303
|
-
}
|
|
224304
|
-
}
|
|
224305
224478
|
}
|
|
224306
|
-
}
|
|
224479
|
+
}
|
|
224307
224480
|
});
|
|
224308
|
-
__name(printBindingAsToml, "printBindingAsToml");
|
|
224309
224481
|
}
|
|
224310
224482
|
});
|
|
224311
224483
|
|
|
@@ -228463,6 +228635,13 @@ function createCLIParser(argv) {
|
|
|
228463
228635
|
type: "boolean",
|
|
228464
228636
|
hidden: true,
|
|
228465
228637
|
alias: ["x-provision"]
|
|
228638
|
+
},
|
|
228639
|
+
"experimental-auto-create": {
|
|
228640
|
+
describe: "Automatically provision draft bindings with new resources",
|
|
228641
|
+
type: "boolean",
|
|
228642
|
+
default: true,
|
|
228643
|
+
hidden: true,
|
|
228644
|
+
alias: "x-auto-create"
|
|
228466
228645
|
}
|
|
228467
228646
|
};
|
|
228468
228647
|
const wrangler = yargs_default(argv).strict().showHelpOnFail(false).fail((msg, error2) => {
|
|
@@ -229599,7 +229778,7 @@ async function main(argv) {
|
|
|
229599
229778
|
if (e8.cause instanceof ApiError) {
|
|
229600
229779
|
logger.error(e8.cause);
|
|
229601
229780
|
} else {
|
|
229602
|
-
(0,
|
|
229781
|
+
(0, import_node_assert23.default)(isAuthenticationError(e8));
|
|
229603
229782
|
logger.error(e8);
|
|
229604
229783
|
}
|
|
229605
229784
|
const envAuth = getAuthFromEnv();
|
|
@@ -229713,11 +229892,11 @@ ${tryRunningItIn}${oneOfThese}`
|
|
|
229713
229892
|
}
|
|
229714
229893
|
}
|
|
229715
229894
|
}
|
|
229716
|
-
var
|
|
229895
|
+
var import_node_assert23, import_node_path54, import_promises31, import_undici21;
|
|
229717
229896
|
var init_src2 = __esm({
|
|
229718
229897
|
"src/index.ts"() {
|
|
229719
229898
|
init_import_meta_url();
|
|
229720
|
-
|
|
229899
|
+
import_node_assert23 = __toESM(require("assert"));
|
|
229721
229900
|
import_node_path54 = require("path");
|
|
229722
229901
|
import_promises31 = require("timers/promises");
|
|
229723
229902
|
init_cli();
|
|
@@ -229966,7 +230145,13 @@ async function checkStartupHandler({
|
|
|
229966
230145
|
});
|
|
229967
230146
|
await (0, import_promises33.writeFile)(outfile, JSON.stringify(await cpuProfileResult));
|
|
229968
230147
|
log(
|
|
229969
|
-
|
|
230148
|
+
[
|
|
230149
|
+
`CPU Profile has been written to ${outfile}. Load it into the Chrome DevTools profiler (or directly in VSCode) to view a flamegraph.`,
|
|
230150
|
+
"",
|
|
230151
|
+
"Note that the CPU Profile was measured on your Worker running locally on your machine, which has a different CPU than when your Worker runs on Cloudflare.",
|
|
230152
|
+
"",
|
|
230153
|
+
"As such, CPU Profile can be used to understand where time is spent at startup, but the overall startup time in the profile should not be expected to exactly match what your Worker's startup time will be when deploying to Cloudflare."
|
|
230154
|
+
].join("\n")
|
|
229970
230155
|
);
|
|
229971
230156
|
}
|
|
229972
230157
|
async function getEntryValue(entry) {
|
|
@@ -230622,7 +230807,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
230622
230807
|
);
|
|
230623
230808
|
}
|
|
230624
230809
|
const scriptName = props.name;
|
|
230625
|
-
(0,
|
|
230810
|
+
(0, import_node_assert24.default)(
|
|
230626
230811
|
!config.site || config.site.bucket,
|
|
230627
230812
|
"A [site] definition requires a `bucket` field with a path to the site's assets directory."
|
|
230628
230813
|
);
|
|
@@ -230887,14 +231072,14 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
230887
231072
|
}
|
|
230888
231073
|
}
|
|
230889
231074
|
}
|
|
230890
|
-
workerBundle = createWorkerUploadForm(worker);
|
|
231075
|
+
workerBundle = createWorkerUploadForm(worker, { dryRun: true });
|
|
230891
231076
|
printBindings(
|
|
230892
231077
|
{ ...withoutStaticAssets, vars: maskedVars },
|
|
230893
231078
|
config.tail_consumers,
|
|
230894
231079
|
{ warnIfNoBindings: true }
|
|
230895
231080
|
);
|
|
230896
231081
|
} else {
|
|
230897
|
-
(0,
|
|
231082
|
+
(0, import_node_assert24.default)(accountId, "Missing accountId");
|
|
230898
231083
|
if (getFlag("RESOURCES_PROVISION")) {
|
|
230899
231084
|
await provisionBindings(
|
|
230900
231085
|
bindings,
|
|
@@ -231087,7 +231272,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
231087
231272
|
return { versionId, workerTag };
|
|
231088
231273
|
}
|
|
231089
231274
|
if (normalisedContainerConfig.length) {
|
|
231090
|
-
(0,
|
|
231275
|
+
(0, import_node_assert24.default)(versionId && accountId);
|
|
231091
231276
|
await deployContainers(config, normalisedContainerConfig, {
|
|
231092
231277
|
versionId,
|
|
231093
231278
|
accountId,
|
|
@@ -231335,11 +231520,11 @@ function getDeployConfirmFunction(strictMode = false) {
|
|
|
231335
231520
|
}
|
|
231336
231521
|
return confirm;
|
|
231337
231522
|
}
|
|
231338
|
-
var
|
|
231523
|
+
var import_node_assert24, import_node_fs36, import_node_path56, import_node_url10, import_undici22, validateRoutes3;
|
|
231339
231524
|
var init_deploy8 = __esm({
|
|
231340
231525
|
"src/deploy/deploy.ts"() {
|
|
231341
231526
|
init_import_meta_url();
|
|
231342
|
-
|
|
231527
|
+
import_node_assert24 = __toESM(require("assert"));
|
|
231343
231528
|
import_node_fs36 = require("fs");
|
|
231344
231529
|
import_node_path56 = __toESM(require("path"));
|
|
231345
231530
|
import_node_url10 = require("url");
|
|
@@ -231591,11 +231776,11 @@ function errorOnLegacyPagesWorkerJSAsset(file, hasAssetsIgnoreFile) {
|
|
|
231591
231776
|
}
|
|
231592
231777
|
}
|
|
231593
231778
|
}
|
|
231594
|
-
var
|
|
231779
|
+
var import_node_assert25, import_node_fs37, import_promises35, path58, import_undici23, BULK_UPLOAD_CONCURRENCY2, MAX_UPLOAD_ATTEMPTS2, MAX_UPLOAD_GATEWAY_ERRORS2, MAX_DIFF_LINES2, syncAssets, buildAssetManifest, NonExistentAssetsDirError, WORKER_JS_FILENAME;
|
|
231595
231780
|
var init_assets5 = __esm({
|
|
231596
231781
|
"src/assets.ts"() {
|
|
231597
231782
|
init_import_meta_url();
|
|
231598
|
-
|
|
231783
|
+
import_node_assert25 = __toESM(require("assert"));
|
|
231599
231784
|
import_node_fs37 = require("fs");
|
|
231600
231785
|
import_promises35 = require("fs/promises");
|
|
231601
231786
|
path58 = __toESM(require("path"));
|
|
@@ -231620,7 +231805,7 @@ var init_assets5 = __esm({
|
|
|
231620
231805
|
MAX_UPLOAD_GATEWAY_ERRORS2 = 5;
|
|
231621
231806
|
MAX_DIFF_LINES2 = 100;
|
|
231622
231807
|
syncAssets = /* @__PURE__ */ __name(async (complianceConfig, accountId, assetDirectory, scriptName, dispatchNamespace) => {
|
|
231623
|
-
(0,
|
|
231808
|
+
(0, import_node_assert25.default)(accountId, "Missing accountId");
|
|
231624
231809
|
logger.info("\u{1F300} Building list of assets...");
|
|
231625
231810
|
const manifest = await buildAssetManifest(assetDirectory);
|
|
231626
231811
|
const url4 = dispatchNamespace ? `/accounts/${accountId}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}/assets-upload-session` : `/accounts/${accountId}/workers/scripts/${scriptName}/assets-upload-session`;
|
|
@@ -232100,11 +232285,11 @@ function getAssetChangeMessage(eventName, assetPath) {
|
|
|
232100
232285
|
}
|
|
232101
232286
|
return message;
|
|
232102
232287
|
}
|
|
232103
|
-
var
|
|
232288
|
+
var import_node_assert26, import_node_events4, import_env2, dev;
|
|
232104
232289
|
var init_dev2 = __esm({
|
|
232105
232290
|
"src/dev.ts"() {
|
|
232106
232291
|
init_import_meta_url();
|
|
232107
|
-
|
|
232292
|
+
import_node_assert26 = __toESM(require("assert"));
|
|
232108
232293
|
import_node_events4 = __toESM(require("events"));
|
|
232109
232294
|
import_env2 = __toESM(require_dist2());
|
|
232110
232295
|
init_assets5();
|
|
@@ -232125,7 +232310,8 @@ var init_dev2 = __esm({
|
|
|
232125
232310
|
MULTIWORKER: Array.isArray(args.config),
|
|
232126
232311
|
RESOURCES_PROVISION: args.experimentalProvision ?? false,
|
|
232127
232312
|
REMOTE_BINDINGS: args.local ? false : args.experimentalRemoteBindings ?? true,
|
|
232128
|
-
DEPLOY_REMOTE_DIFF_CHECK: false
|
|
232313
|
+
DEPLOY_REMOTE_DIFF_CHECK: false,
|
|
232314
|
+
AUTOCREATE_RESOURCES: args.experimentalAutoCreate
|
|
232129
232315
|
}), "overrideExperimentalFlags")
|
|
232130
232316
|
},
|
|
232131
232317
|
metadata: {
|
|
@@ -232372,7 +232558,7 @@ var init_dev2 = __esm({
|
|
|
232372
232558
|
},
|
|
232373
232559
|
async handler(args) {
|
|
232374
232560
|
const devInstance = await startDev(args);
|
|
232375
|
-
(0,
|
|
232561
|
+
(0, import_node_assert26.default)(devInstance.devEnv !== void 0);
|
|
232376
232562
|
await import_node_events4.default.once(devInstance.devEnv, "teardown");
|
|
232377
232563
|
await Promise.all(devInstance.secondary.map((d7) => d7.teardown()));
|
|
232378
232564
|
if (devInstance.teardownRegistryPromise) {
|
|
@@ -232440,7 +232626,7 @@ function runBuild({
|
|
|
232440
232626
|
async function updateBundle() {
|
|
232441
232627
|
const newAdditionalModules = await getAdditionalModules();
|
|
232442
232628
|
setBundle((previousBundle) => {
|
|
232443
|
-
(0,
|
|
232629
|
+
(0, import_node_assert27.default)(
|
|
232444
232630
|
previousBundle,
|
|
232445
232631
|
"Rebuild triggered with no previous build available"
|
|
232446
232632
|
);
|
|
@@ -232530,11 +232716,11 @@ function runBuild({
|
|
|
232530
232716
|
});
|
|
232531
232717
|
return () => stopWatching?.();
|
|
232532
232718
|
}
|
|
232533
|
-
var
|
|
232719
|
+
var import_node_assert27, import_node_fs38, import_node_path57;
|
|
232534
232720
|
var init_use_esbuild = __esm({
|
|
232535
232721
|
"src/dev/use-esbuild.ts"() {
|
|
232536
232722
|
init_import_meta_url();
|
|
232537
|
-
|
|
232723
|
+
import_node_assert27 = __toESM(require("assert"));
|
|
232538
232724
|
import_node_fs38 = require("fs");
|
|
232539
232725
|
import_node_path57 = __toESM(require("path"));
|
|
232540
232726
|
init_esm6();
|
|
@@ -233131,7 +233317,7 @@ async function resolveDevConfig(config, input) {
|
|
|
233131
233317
|
);
|
|
233132
233318
|
if (input.dev?.remote) {
|
|
233133
233319
|
const { accountId } = await auth();
|
|
233134
|
-
(0,
|
|
233320
|
+
(0, import_node_assert28.default)(accountId, "Account ID must be provided for remote dev");
|
|
233135
233321
|
await getZoneIdForPreview(config, { host, routes, accountId });
|
|
233136
233322
|
}
|
|
233137
233323
|
const initialIp = input.dev?.server?.hostname ?? config.dev.ip;
|
|
@@ -233388,11 +233574,11 @@ If you are trying to develop Pages and Workers together, please use \`wrangler p
|
|
|
233388
233574
|
}
|
|
233389
233575
|
return { config: resolved, printCurrentBindings };
|
|
233390
233576
|
}
|
|
233391
|
-
var
|
|
233577
|
+
var import_node_assert28, import_node_path58, import_miniflare22, getInspectorPort, getLocalPort, ConfigController;
|
|
233392
233578
|
var init_ConfigController = __esm({
|
|
233393
233579
|
"src/api/startDevWorker/ConfigController.ts"() {
|
|
233394
233580
|
init_import_meta_url();
|
|
233395
|
-
|
|
233581
|
+
import_node_assert28 = __toESM(require("assert"));
|
|
233396
233582
|
import_node_path58 = __toESM(require("path"));
|
|
233397
233583
|
init_containers_shared();
|
|
233398
233584
|
init_esm6();
|
|
@@ -233449,7 +233635,7 @@ var init_ConfigController = __esm({
|
|
|
233449
233635
|
return;
|
|
233450
233636
|
}
|
|
233451
233637
|
logger.debug(`${import_node_path58.default.basename(configPath)} changed...`);
|
|
233452
|
-
(0,
|
|
233638
|
+
(0, import_node_assert28.default)(
|
|
233453
233639
|
this.latestInput,
|
|
233454
233640
|
"Cannot be watching config without having first set an input"
|
|
233455
233641
|
);
|
|
@@ -233475,7 +233661,7 @@ var init_ConfigController = __esm({
|
|
|
233475
233661
|
}
|
|
233476
233662
|
patch(input) {
|
|
233477
233663
|
logger.debug("patching config");
|
|
233478
|
-
(0,
|
|
233664
|
+
(0, import_node_assert28.default)(
|
|
233479
233665
|
this.latestInput,
|
|
233480
233666
|
"Cannot call updateConfig without previously calling setConfig"
|
|
233481
233667
|
);
|
|
@@ -233642,7 +233828,7 @@ function maybeGetSourceMappingURL(sourcePath) {
|
|
|
233642
233828
|
return;
|
|
233643
233829
|
}
|
|
233644
233830
|
const sourceMappingURLMatch = source.substring(sourceMappingURLIndex).match(/^\/\/# sourceMappingURL=(.+)/);
|
|
233645
|
-
(0,
|
|
233831
|
+
(0, import_node_assert29.default)(sourceMappingURLMatch !== null);
|
|
233646
233832
|
const sourceMappingURLSpecifier = sourceMappingURLMatch[1];
|
|
233647
233833
|
const sourceURL = (0, import_node_url11.pathToFileURL)(sourcePath);
|
|
233648
233834
|
try {
|
|
@@ -233654,11 +233840,11 @@ function maybeGetSourceMappingURL(sourcePath) {
|
|
|
233654
233840
|
} catch {
|
|
233655
233841
|
}
|
|
233656
233842
|
}
|
|
233657
|
-
var
|
|
233843
|
+
var import_node_assert29, import_node_fs39, import_node_path61, import_node_url11, bundleReferencedPathsCache;
|
|
233658
233844
|
var init_bundle_allowed_paths = __esm({
|
|
233659
233845
|
"src/api/startDevWorker/bundle-allowed-paths.ts"() {
|
|
233660
233846
|
init_import_meta_url();
|
|
233661
|
-
|
|
233847
|
+
import_node_assert29 = __toESM(require("assert"));
|
|
233662
233848
|
import_node_fs39 = __toESM(require("fs"));
|
|
233663
233849
|
import_node_path61 = __toESM(require("path"));
|
|
233664
233850
|
import_node_url11 = require("url");
|
|
@@ -252211,11 +252397,11 @@ function didMiniflareOptionsChange(prev, next) {
|
|
|
252211
252397
|
}
|
|
252212
252398
|
return !deepEquality(prev, next);
|
|
252213
252399
|
}
|
|
252214
|
-
var
|
|
252400
|
+
var import_node_assert30, import_node_crypto13, import_node_events5, import_node_path62, import_miniflare24, ProxyController, ProxyControllerLogger;
|
|
252215
252401
|
var init_ProxyController = __esm({
|
|
252216
252402
|
"src/api/startDevWorker/ProxyController.ts"() {
|
|
252217
252403
|
init_import_meta_url();
|
|
252218
|
-
|
|
252404
|
+
import_node_assert30 = __toESM(require("assert"));
|
|
252219
252405
|
import_node_crypto13 = require("crypto");
|
|
252220
252406
|
import_node_events5 = __toESM(require("events"));
|
|
252221
252407
|
import_node_path62 = __toESM(require("path"));
|
|
@@ -252249,7 +252435,7 @@ var init_ProxyController = __esm({
|
|
|
252249
252435
|
if (this._torndown) {
|
|
252250
252436
|
return;
|
|
252251
252437
|
}
|
|
252252
|
-
(0,
|
|
252438
|
+
(0, import_node_assert30.default)(this.latestConfig !== void 0);
|
|
252253
252439
|
const inVscodeJsDebugTerminal = !!process.env.VSCODE_INSPECTOR_OPTIONS;
|
|
252254
252440
|
const cert = this.latestConfig.dev?.server?.secure || this.latestConfig.dev.inspector !== false && this.latestConfig.dev?.inspector?.secure ? getHttpsOptions(
|
|
252255
252441
|
this.latestConfig.dev.server?.httpsKeyPath,
|
|
@@ -252373,7 +252559,7 @@ var init_ProxyController = __esm({
|
|
|
252373
252559
|
inspectorUrl
|
|
252374
252560
|
]);
|
|
252375
252561
|
}).then(([url4, inspectorUrl]) => {
|
|
252376
|
-
(0,
|
|
252562
|
+
(0, import_node_assert30.default)(url4);
|
|
252377
252563
|
this.emitReadyEvent(proxyWorker, url4, inspectorUrl);
|
|
252378
252564
|
}).catch((error2) => {
|
|
252379
252565
|
if (this._torndown) {
|
|
@@ -252390,7 +252576,7 @@ var init_ProxyController = __esm({
|
|
|
252390
252576
|
if (this._torndown) {
|
|
252391
252577
|
return;
|
|
252392
252578
|
}
|
|
252393
|
-
(0,
|
|
252579
|
+
(0, import_node_assert30.default)(
|
|
252394
252580
|
this.latestConfig?.dev.inspector !== false,
|
|
252395
252581
|
"Trying to reconnect with inspector proxy worker when inspector is disabled"
|
|
252396
252582
|
);
|
|
@@ -252401,7 +252587,7 @@ var init_ProxyController = __esm({
|
|
|
252401
252587
|
this.inspectorProxyWorkerWebSocket = createDeferred();
|
|
252402
252588
|
let webSocket = null;
|
|
252403
252589
|
try {
|
|
252404
|
-
(0,
|
|
252590
|
+
(0, import_node_assert30.default)(this.proxyWorker);
|
|
252405
252591
|
const inspectorProxyWorkerUrl = await this.proxyWorker.unsafeGetDirectURL(
|
|
252406
252592
|
"InspectorProxyWorker"
|
|
252407
252593
|
);
|
|
@@ -252420,12 +252606,12 @@ var init_ProxyController = __esm({
|
|
|
252420
252606
|
this.emitErrorEvent("Could not connect to InspectorProxyWorker", error2);
|
|
252421
252607
|
return;
|
|
252422
252608
|
}
|
|
252423
|
-
(0,
|
|
252609
|
+
(0, import_node_assert30.default)(
|
|
252424
252610
|
webSocket,
|
|
252425
252611
|
"Expected webSocket on response from inspectorProxyWorker"
|
|
252426
252612
|
);
|
|
252427
252613
|
webSocket.addEventListener("message", (event) => {
|
|
252428
|
-
(0,
|
|
252614
|
+
(0, import_node_assert30.default)(typeof event.data === "string");
|
|
252429
252615
|
this.onInspectorProxyWorkerMessage(JSON.parse(event.data));
|
|
252430
252616
|
});
|
|
252431
252617
|
webSocket.addEventListener("close", () => {
|
|
@@ -252480,13 +252666,13 @@ var init_ProxyController = __esm({
|
|
|
252480
252666
|
if (this._torndown) {
|
|
252481
252667
|
return;
|
|
252482
252668
|
}
|
|
252483
|
-
(0,
|
|
252669
|
+
(0, import_node_assert30.default)(
|
|
252484
252670
|
this.latestConfig?.dev.inspector !== false,
|
|
252485
252671
|
"Trying to send message to inspector proxy worker when inspector is disabled"
|
|
252486
252672
|
);
|
|
252487
252673
|
try {
|
|
252488
252674
|
const websocket = await this.reconnectInspectorProxyWorker();
|
|
252489
|
-
(0,
|
|
252675
|
+
(0, import_node_assert30.default)(websocket);
|
|
252490
252676
|
websocket.send(JSON.stringify(message));
|
|
252491
252677
|
} catch (cause) {
|
|
252492
252678
|
if (this._torndown) {
|
|
@@ -252554,7 +252740,7 @@ var init_ProxyController = __esm({
|
|
|
252554
252740
|
}
|
|
252555
252741
|
}
|
|
252556
252742
|
onInspectorProxyWorkerMessage(message) {
|
|
252557
|
-
(0,
|
|
252743
|
+
(0, import_node_assert30.default)(
|
|
252558
252744
|
this.latestConfig?.dev.inspector !== false,
|
|
252559
252745
|
"Trying to handle inspector message when inspector is disabled"
|
|
252560
252746
|
);
|
|
@@ -252580,7 +252766,7 @@ var init_ProxyController = __esm({
|
|
|
252580
252766
|
}
|
|
252581
252767
|
}
|
|
252582
252768
|
async onInspectorProxyWorkerRequest(message) {
|
|
252583
|
-
(0,
|
|
252769
|
+
(0, import_node_assert30.default)(
|
|
252584
252770
|
this.latestConfig?.dev.inspector !== false,
|
|
252585
252771
|
"Trying to handle inspector request when inspector is disabled"
|
|
252586
252772
|
);
|
|
@@ -252601,8 +252787,8 @@ var init_ProxyController = __esm({
|
|
|
252601
252787
|
logger.debug("[InspectorProxyWorker]", ...message.args);
|
|
252602
252788
|
break;
|
|
252603
252789
|
case "load-network-resource": {
|
|
252604
|
-
(0,
|
|
252605
|
-
(0,
|
|
252790
|
+
(0, import_node_assert30.default)(this.latestConfig !== void 0);
|
|
252791
|
+
(0, import_node_assert30.default)(this.latestBundle !== void 0);
|
|
252606
252792
|
let maybeContents;
|
|
252607
252793
|
if (message.url.startsWith("wrangler-file:")) {
|
|
252608
252794
|
maybeContents = maybeHandleNetworkLoadResource(
|
|
@@ -252725,18 +252911,20 @@ async function createPreviewSession(complianceConfig, account, ctx, abortSignal)
|
|
|
252725
252911
|
abortSignal,
|
|
252726
252912
|
apiToken
|
|
252727
252913
|
);
|
|
252728
|
-
const switchedExchangeUrl = switchHost(
|
|
252729
|
-
|
|
252730
|
-
|
|
252731
|
-
|
|
252732
|
-
|
|
252914
|
+
const switchedExchangeUrl = switchHost(exchange_url, ctx.host, !!ctx.zone);
|
|
252915
|
+
const headers = {};
|
|
252916
|
+
const accessToken = await getAccessToken(switchedExchangeUrl.hostname);
|
|
252917
|
+
if (accessToken) {
|
|
252918
|
+
headers.cookie = `CF_Authorization=${accessToken}`;
|
|
252919
|
+
}
|
|
252733
252920
|
logger.debugWithSanitization(
|
|
252734
252921
|
"-- START EXCHANGE API REQUEST:",
|
|
252735
|
-
` GET ${switchedExchangeUrl}`
|
|
252922
|
+
` GET ${switchedExchangeUrl.href}`
|
|
252736
252923
|
);
|
|
252737
252924
|
logger.debug("-- END EXCHANGE API REQUEST");
|
|
252738
252925
|
const exchangeResponse = await (0, import_undici24.fetch)(switchedExchangeUrl, {
|
|
252739
|
-
signal: abortSignal
|
|
252926
|
+
signal: abortSignal,
|
|
252927
|
+
headers
|
|
252740
252928
|
});
|
|
252741
252929
|
const bodyText = await exchangeResponse.text();
|
|
252742
252930
|
logger.debug(
|
|
@@ -252868,7 +253056,7 @@ var init_create_worker_preview = __esm({
|
|
|
252868
253056
|
|
|
252869
253057
|
// src/dev/remote.ts
|
|
252870
253058
|
function handlePreviewSessionUploadError(err, accountId) {
|
|
252871
|
-
(0,
|
|
253059
|
+
(0, import_node_assert31.default)(err && typeof err === "object");
|
|
252872
253060
|
if (!isAbortError(err)) {
|
|
252873
253061
|
if ("code" in err && err.code === 10049) {
|
|
252874
253062
|
logger.log("Preview token expired, fetching a new one");
|
|
@@ -252880,7 +253068,7 @@ function handlePreviewSessionUploadError(err, accountId) {
|
|
|
252880
253068
|
return false;
|
|
252881
253069
|
}
|
|
252882
253070
|
function handlePreviewSessionCreationError(err, accountId) {
|
|
252883
|
-
(0,
|
|
253071
|
+
(0, import_node_assert31.default)(err && typeof err === "object");
|
|
252884
253072
|
if ("code" in err && err.code === 10063) {
|
|
252885
253073
|
logger.error(
|
|
252886
253074
|
`You need to register a workers.dev subdomain before running the dev command in remote mode. You can either enable local mode by pressing l, or register a workers.dev subdomain here: https://dash.cloudflare.com/${accountId}/workers/onboarding`
|
|
@@ -253032,11 +253220,11 @@ function handleUserFriendlyError(error2, accountId) {
|
|
|
253032
253220
|
}
|
|
253033
253221
|
}
|
|
253034
253222
|
}
|
|
253035
|
-
var
|
|
253223
|
+
var import_node_assert31, import_node_path63;
|
|
253036
253224
|
var init_remote = __esm({
|
|
253037
253225
|
"src/dev/remote.ts"() {
|
|
253038
253226
|
init_import_meta_url();
|
|
253039
|
-
|
|
253227
|
+
import_node_assert31 = __toESM(require("assert"));
|
|
253040
253228
|
import_node_path63 = __toESM(require("path"));
|
|
253041
253229
|
init_assets5();
|
|
253042
253230
|
init_bundle_reporter();
|
|
@@ -253363,7 +253551,7 @@ function createWorkerObject(devEnv) {
|
|
|
253363
253551
|
return devEnv.proxy.ready.promise.then((ev) => ev.inspectorUrl);
|
|
253364
253552
|
},
|
|
253365
253553
|
get config() {
|
|
253366
|
-
(0,
|
|
253554
|
+
(0, import_node_assert32.default)(devEnv.config.latestConfig);
|
|
253367
253555
|
return devEnv.config.latestConfig;
|
|
253368
253556
|
},
|
|
253369
253557
|
async setConfig(config, throwErrors) {
|
|
@@ -253378,7 +253566,7 @@ function createWorkerObject(devEnv) {
|
|
|
253378
253566
|
return proxyWorker.dispatchFetch(...args);
|
|
253379
253567
|
},
|
|
253380
253568
|
async queue(...args) {
|
|
253381
|
-
(0,
|
|
253569
|
+
(0, import_node_assert32.default)(
|
|
253382
253570
|
this.config.name,
|
|
253383
253571
|
"Worker name must be defined to use `Worker.queue()`"
|
|
253384
253572
|
);
|
|
@@ -253387,7 +253575,7 @@ function createWorkerObject(devEnv) {
|
|
|
253387
253575
|
return w7.queue(...args);
|
|
253388
253576
|
},
|
|
253389
253577
|
async scheduled(...args) {
|
|
253390
|
-
(0,
|
|
253578
|
+
(0, import_node_assert32.default)(
|
|
253391
253579
|
this.config.name,
|
|
253392
253580
|
"Worker name must be defined to use `Worker.scheduled()`"
|
|
253393
253581
|
);
|
|
@@ -253401,11 +253589,11 @@ function createWorkerObject(devEnv) {
|
|
|
253401
253589
|
raw: devEnv
|
|
253402
253590
|
};
|
|
253403
253591
|
}
|
|
253404
|
-
var
|
|
253592
|
+
var import_node_assert32, import_node_events6, import_miniflare27, DevEnv;
|
|
253405
253593
|
var init_DevEnv = __esm({
|
|
253406
253594
|
"src/api/startDevWorker/DevEnv.ts"() {
|
|
253407
253595
|
init_import_meta_url();
|
|
253408
|
-
|
|
253596
|
+
import_node_assert32 = __toESM(require("assert"));
|
|
253409
253597
|
import_node_events6 = require("events");
|
|
253410
253598
|
import_miniflare27 = require("miniflare");
|
|
253411
253599
|
init_errors();
|
|
@@ -253717,17 +253905,17 @@ function getAuthHook(auth, config) {
|
|
|
253717
253905
|
}
|
|
253718
253906
|
function deepStrictEqual(source, target) {
|
|
253719
253907
|
try {
|
|
253720
|
-
|
|
253908
|
+
import_node_assert33.default.deepStrictEqual(source, target);
|
|
253721
253909
|
return true;
|
|
253722
253910
|
} catch {
|
|
253723
253911
|
return false;
|
|
253724
253912
|
}
|
|
253725
253913
|
}
|
|
253726
|
-
var
|
|
253914
|
+
var import_node_assert33;
|
|
253727
253915
|
var init_remoteBindings = __esm({
|
|
253728
253916
|
"src/api/remoteBindings/index.ts"() {
|
|
253729
253917
|
init_import_meta_url();
|
|
253730
|
-
|
|
253918
|
+
import_node_assert33 = __toESM(require("assert"));
|
|
253731
253919
|
init_config5();
|
|
253732
253920
|
init_misc_variables();
|
|
253733
253921
|
init_user3();
|
|
@@ -253878,11 +254066,11 @@ async function getContainerDevOptions(containersConfig, containerBuildId) {
|
|
|
253878
254066
|
}
|
|
253879
254067
|
return containers2;
|
|
253880
254068
|
}
|
|
253881
|
-
var
|
|
254069
|
+
var import_node_assert34, import_node_crypto15, import_promises36, import_miniflare28, LocalRuntimeController;
|
|
253882
254070
|
var init_LocalRuntimeController = __esm({
|
|
253883
254071
|
"src/api/startDevWorker/LocalRuntimeController.ts"() {
|
|
253884
254072
|
init_import_meta_url();
|
|
253885
|
-
|
|
254073
|
+
import_node_assert34 = __toESM(require("assert"));
|
|
253886
254074
|
import_node_crypto15 = require("crypto");
|
|
253887
254075
|
import_promises36 = require("fs/promises");
|
|
253888
254076
|
init_containers_shared();
|
|
@@ -253957,7 +254145,7 @@ var init_LocalRuntimeController = __esm({
|
|
|
253957
254145
|
}
|
|
253958
254146
|
if (data.config.containers?.length && data.config.dev.enableContainers && this.#currentContainerBuildId !== data.config.dev.containerBuildId) {
|
|
253959
254147
|
this.dockerPath = data.config.dev?.dockerPath ?? getDockerPath();
|
|
253960
|
-
(0,
|
|
254148
|
+
(0, import_node_assert34.default)(
|
|
253961
254149
|
data.config.dev.containerBuildId,
|
|
253962
254150
|
"Build ID should be set if containers are enabled and defined"
|
|
253963
254151
|
);
|
|
@@ -254087,7 +254275,7 @@ var init_LocalRuntimeController = __esm({
|
|
|
254087
254275
|
if (!this.containerImageTagsSeen.size) {
|
|
254088
254276
|
return;
|
|
254089
254277
|
}
|
|
254090
|
-
(0,
|
|
254278
|
+
(0, import_node_assert34.default)(
|
|
254091
254279
|
this.dockerPath,
|
|
254092
254280
|
"Docker path should have been set if containers are enabled"
|
|
254093
254281
|
);
|
|
@@ -254152,11 +254340,11 @@ function ensureMatchingSql(options) {
|
|
|
254152
254340
|
}
|
|
254153
254341
|
return options;
|
|
254154
254342
|
}
|
|
254155
|
-
var
|
|
254343
|
+
var import_node_assert35, import_node_crypto16, import_miniflare29, MultiworkerRuntimeController;
|
|
254156
254344
|
var init_MultiworkerRuntimeController = __esm({
|
|
254157
254345
|
"src/api/startDevWorker/MultiworkerRuntimeController.ts"() {
|
|
254158
254346
|
init_import_meta_url();
|
|
254159
|
-
|
|
254347
|
+
import_node_assert35 = __toESM(require("assert"));
|
|
254160
254348
|
import_node_crypto16 = require("crypto");
|
|
254161
254349
|
init_containers_shared();
|
|
254162
254350
|
init_source();
|
|
@@ -254200,7 +254388,7 @@ var init_MultiworkerRuntimeController = __esm({
|
|
|
254200
254388
|
}
|
|
254201
254389
|
#mergedMfOptions() {
|
|
254202
254390
|
const primary = [...this.#options.values()].find((o6) => o6.primary);
|
|
254203
|
-
(0,
|
|
254391
|
+
(0, import_node_assert35.default)(primary !== void 0);
|
|
254204
254392
|
const secondary = [...this.#options.values()].filter((o6) => !o6.primary);
|
|
254205
254393
|
return {
|
|
254206
254394
|
...primary.options,
|
|
@@ -254236,7 +254424,7 @@ var init_MultiworkerRuntimeController = __esm({
|
|
|
254236
254424
|
}
|
|
254237
254425
|
if (data.config.containers?.length && this.#currentContainerBuildId !== data.config.dev.containerBuildId) {
|
|
254238
254426
|
logger.log(source_default.dim("\u2394 Preparing container image(s)..."));
|
|
254239
|
-
(0,
|
|
254427
|
+
(0, import_node_assert35.default)(
|
|
254240
254428
|
data.config.dev.containerBuildId,
|
|
254241
254429
|
"Build ID should be set if containers are enabled and defined"
|
|
254242
254430
|
);
|
|
@@ -256848,11 +257036,11 @@ async function generateAssetsFetch(directory, log2) {
|
|
|
256848
257036
|
return await generateResponse(request4);
|
|
256849
257037
|
};
|
|
256850
257038
|
}
|
|
256851
|
-
var
|
|
257039
|
+
var import_node_assert36, import_node_fs40, import_node_path66, import_mime3, import_miniflare31, import_undici25, ProxyDispatcher, invalidAssetsFetch;
|
|
256852
257040
|
var init_assets6 = __esm({
|
|
256853
257041
|
"src/miniflare-cli/assets.ts"() {
|
|
256854
257042
|
init_import_meta_url();
|
|
256855
|
-
|
|
257043
|
+
import_node_assert36 = __toESM(require("assert"));
|
|
256856
257044
|
import_node_fs40 = require("fs");
|
|
256857
257045
|
import_node_path66 = require("path");
|
|
256858
257046
|
init_createMetadataObject();
|
|
@@ -256890,12 +257078,12 @@ var init_assets6 = __esm({
|
|
|
256890
257078
|
* by the `fetch()` function before calling `dispatcher.dispatch()`.
|
|
256891
257079
|
*/
|
|
256892
257080
|
static reinstateHostHeader(headers, host) {
|
|
256893
|
-
(0,
|
|
256894
|
-
(0,
|
|
257081
|
+
(0, import_node_assert36.default)(headers, "Expected all proxy requests to contain headers.");
|
|
257082
|
+
(0, import_node_assert36.default)(
|
|
256895
257083
|
!Array.isArray(headers),
|
|
256896
257084
|
"Expected proxy request headers to be a hash object"
|
|
256897
257085
|
);
|
|
256898
|
-
(0,
|
|
257086
|
+
(0, import_node_assert36.default)(
|
|
256899
257087
|
Object.keys(headers).every((h7) => h7.toLowerCase() !== "host"),
|
|
256900
257088
|
"Expected Host header to have been deleted."
|
|
256901
257089
|
);
|
|
@@ -256929,7 +257117,7 @@ async function startDev(args) {
|
|
|
256929
257117
|
unregisterHotKeys?.();
|
|
256930
257118
|
accountId = await requireAuth(config);
|
|
256931
257119
|
if (hotkeysDisplayed) {
|
|
256932
|
-
(0,
|
|
257120
|
+
(0, import_node_assert37.default)(devEnv !== void 0);
|
|
256933
257121
|
unregisterHotKeys = registerDevHotKeys(
|
|
256934
257122
|
Array.isArray(devEnv) ? devEnv : [devEnv],
|
|
256935
257123
|
args,
|
|
@@ -257018,7 +257206,7 @@ async function startDev(args) {
|
|
|
257018
257206
|
...Array.isArray(devEnv) ? devEnv.map((d7) => d7.teardown()) : [devEnv?.teardown()],
|
|
257019
257207
|
(async () => {
|
|
257020
257208
|
if (teardownRegistryPromise) {
|
|
257021
|
-
(0,
|
|
257209
|
+
(0, import_node_assert37.default)(devEnv === void 0 || !Array.isArray(devEnv));
|
|
257022
257210
|
const teardownRegistry = await teardownRegistryPromise;
|
|
257023
257211
|
await teardownRegistry(devEnv?.config.latestConfig?.name);
|
|
257024
257212
|
}
|
|
@@ -257164,11 +257352,11 @@ function getResolvedSiteAssetPaths(args, configParam) {
|
|
|
257164
257352
|
args.siteExclude
|
|
257165
257353
|
);
|
|
257166
257354
|
}
|
|
257167
|
-
var
|
|
257355
|
+
var import_node_assert37, import_node_path67;
|
|
257168
257356
|
var init_start_dev = __esm({
|
|
257169
257357
|
"src/dev/start-dev.ts"() {
|
|
257170
257358
|
init_import_meta_url();
|
|
257171
|
-
|
|
257359
|
+
import_node_assert37 = __toESM(require("assert"));
|
|
257172
257360
|
import_node_path67 = __toESM(require("path"));
|
|
257173
257361
|
init_colors();
|
|
257174
257362
|
init_containers_shared();
|
|
@@ -257301,6 +257489,7 @@ unstable_dev()'s behaviour will likely change in future releases`
|
|
|
257301
257489
|
logLevel: options?.logLevel ?? defaultLogLevel,
|
|
257302
257490
|
port: options?.port ?? 0,
|
|
257303
257491
|
experimentalProvision: void 0,
|
|
257492
|
+
experimentalAutoCreate: false,
|
|
257304
257493
|
experimentalRemoteBindings: true,
|
|
257305
257494
|
experimentalVectorizeBindToProd: vectorizeBindToProd ?? false,
|
|
257306
257495
|
experimentalImagesLocalMode: imagesLocalMode ?? false,
|
|
@@ -257316,7 +257505,8 @@ unstable_dev()'s behaviour will likely change in future releases`
|
|
|
257316
257505
|
MULTIWORKER: false,
|
|
257317
257506
|
RESOURCES_PROVISION: false,
|
|
257318
257507
|
REMOTE_BINDINGS: false,
|
|
257319
|
-
DEPLOY_REMOTE_DIFF_CHECK: false
|
|
257508
|
+
DEPLOY_REMOTE_DIFF_CHECK: false,
|
|
257509
|
+
AUTOCREATE_RESOURCES: false
|
|
257320
257510
|
},
|
|
257321
257511
|
() => startDev(devOptions)
|
|
257322
257512
|
);
|