wrangler 3.24.0 → 3.26.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/wrangler-dist/cli.js
CHANGED
|
@@ -353,7 +353,7 @@ var require_util = __commonJS({
|
|
|
353
353
|
"../../node_modules/.pnpm/undici@5.28.2/node_modules/undici/lib/core/util.js"(exports2, module3) {
|
|
354
354
|
"use strict";
|
|
355
355
|
init_import_meta_url();
|
|
356
|
-
var
|
|
356
|
+
var assert23 = require("assert");
|
|
357
357
|
var { kDestroyed, kBodyUsed } = require_symbols();
|
|
358
358
|
var { IncomingMessage } = require("http");
|
|
359
359
|
var stream2 = require("stream");
|
|
@@ -440,7 +440,7 @@ var require_util = __commonJS({
|
|
|
440
440
|
function getHostname(host) {
|
|
441
441
|
if (host[0] === "[") {
|
|
442
442
|
const idx2 = host.indexOf("]");
|
|
443
|
-
|
|
443
|
+
assert23(idx2 !== -1);
|
|
444
444
|
return host.substring(1, idx2);
|
|
445
445
|
}
|
|
446
446
|
const idx = host.indexOf(":");
|
|
@@ -453,7 +453,7 @@ var require_util = __commonJS({
|
|
|
453
453
|
if (!host) {
|
|
454
454
|
return null;
|
|
455
455
|
}
|
|
456
|
-
|
|
456
|
+
assert23.strictEqual(typeof host, "string");
|
|
457
457
|
const servername = getHostname(host);
|
|
458
458
|
if (net3.isIP(servername)) {
|
|
459
459
|
return "";
|
|
@@ -3112,7 +3112,7 @@ var require_util2 = __commonJS({
|
|
|
3112
3112
|
var { getGlobalOrigin } = require_global();
|
|
3113
3113
|
var { performance: performance2 } = require("perf_hooks");
|
|
3114
3114
|
var { isBlobLike, toUSVString, ReadableStreamFrom } = require_util();
|
|
3115
|
-
var
|
|
3115
|
+
var assert23 = require("assert");
|
|
3116
3116
|
var { isUint8Array } = require("util/types");
|
|
3117
3117
|
var crypto5;
|
|
3118
3118
|
try {
|
|
@@ -3319,7 +3319,7 @@ var require_util2 = __commonJS({
|
|
|
3319
3319
|
__name(clonePolicyContainer, "clonePolicyContainer");
|
|
3320
3320
|
function determineRequestsReferrer(request3) {
|
|
3321
3321
|
const policy = request3.referrerPolicy;
|
|
3322
|
-
|
|
3322
|
+
assert23(policy);
|
|
3323
3323
|
let referrerSource = null;
|
|
3324
3324
|
if (request3.referrer === "client") {
|
|
3325
3325
|
const globalOrigin = getGlobalOrigin();
|
|
@@ -3364,7 +3364,7 @@ var require_util2 = __commonJS({
|
|
|
3364
3364
|
}
|
|
3365
3365
|
__name(determineRequestsReferrer, "determineRequestsReferrer");
|
|
3366
3366
|
function stripURLForReferrer(url4, originOnly) {
|
|
3367
|
-
|
|
3367
|
+
assert23(url4 instanceof URL);
|
|
3368
3368
|
if (url4.protocol === "file:" || url4.protocol === "about:" || url4.protocol === "blank:") {
|
|
3369
3369
|
return "no-referrer";
|
|
3370
3370
|
}
|
|
@@ -3520,7 +3520,7 @@ var require_util2 = __commonJS({
|
|
|
3520
3520
|
if (result === void 0) {
|
|
3521
3521
|
throw new TypeError("Value is not JSON serializable");
|
|
3522
3522
|
}
|
|
3523
|
-
|
|
3523
|
+
assert23(typeof result === "string");
|
|
3524
3524
|
return result;
|
|
3525
3525
|
}
|
|
3526
3526
|
__name(serializeJavascriptValueToJSONString, "serializeJavascriptValueToJSONString");
|
|
@@ -3621,7 +3621,7 @@ var require_util2 = __commonJS({
|
|
|
3621
3621
|
__name(readableStreamClose, "readableStreamClose");
|
|
3622
3622
|
function isomorphicEncode(input) {
|
|
3623
3623
|
for (let i = 0; i < input.length; i++) {
|
|
3624
|
-
|
|
3624
|
+
assert23(input.charCodeAt(i) <= 255);
|
|
3625
3625
|
}
|
|
3626
3626
|
return input;
|
|
3627
3627
|
}
|
|
@@ -3643,7 +3643,7 @@ var require_util2 = __commonJS({
|
|
|
3643
3643
|
}
|
|
3644
3644
|
__name(readAllBytes, "readAllBytes");
|
|
3645
3645
|
function urlIsLocal(url4) {
|
|
3646
|
-
|
|
3646
|
+
assert23("protocol" in url4);
|
|
3647
3647
|
const protocol = url4.protocol;
|
|
3648
3648
|
return protocol === "about:" || protocol === "blob:" || protocol === "data:";
|
|
3649
3649
|
}
|
|
@@ -3656,7 +3656,7 @@ var require_util2 = __commonJS({
|
|
|
3656
3656
|
}
|
|
3657
3657
|
__name(urlHasHttpsScheme, "urlHasHttpsScheme");
|
|
3658
3658
|
function urlIsHttpHttpsScheme(url4) {
|
|
3659
|
-
|
|
3659
|
+
assert23("protocol" in url4);
|
|
3660
3660
|
const protocol = url4.protocol;
|
|
3661
3661
|
return protocol === "http:" || protocol === "https:";
|
|
3662
3662
|
}
|
|
@@ -4101,7 +4101,7 @@ var require_webidl = __commonJS({
|
|
|
4101
4101
|
var require_dataURL = __commonJS({
|
|
4102
4102
|
"../../node_modules/.pnpm/undici@5.28.2/node_modules/undici/lib/fetch/dataURL.js"(exports2, module3) {
|
|
4103
4103
|
init_import_meta_url();
|
|
4104
|
-
var
|
|
4104
|
+
var assert23 = require("assert");
|
|
4105
4105
|
var { atob: atob2 } = require("buffer");
|
|
4106
4106
|
var { isomorphicDecode } = require_util2();
|
|
4107
4107
|
var encoder = new TextEncoder();
|
|
@@ -4109,7 +4109,7 @@ var require_dataURL = __commonJS({
|
|
|
4109
4109
|
var HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/;
|
|
4110
4110
|
var HTTP_QUOTED_STRING_TOKENS = /[\u0009|\u0020-\u007E|\u0080-\u00FF]/;
|
|
4111
4111
|
function dataURLProcessor(dataURL) {
|
|
4112
|
-
|
|
4112
|
+
assert23(dataURL.protocol === "data:");
|
|
4113
4113
|
let input = URLSerializer(dataURL, true);
|
|
4114
4114
|
input = input.slice(5);
|
|
4115
4115
|
const position = { position: 0 };
|
|
@@ -4303,7 +4303,7 @@ var require_dataURL = __commonJS({
|
|
|
4303
4303
|
function collectAnHTTPQuotedString(input, position, extractValue) {
|
|
4304
4304
|
const positionStart = position.position;
|
|
4305
4305
|
let value = "";
|
|
4306
|
-
|
|
4306
|
+
assert23(input[position.position] === '"');
|
|
4307
4307
|
position.position++;
|
|
4308
4308
|
while (true) {
|
|
4309
4309
|
value += collectASequenceOfCodePoints(
|
|
@@ -4324,7 +4324,7 @@ var require_dataURL = __commonJS({
|
|
|
4324
4324
|
value += input[position.position];
|
|
4325
4325
|
position.position++;
|
|
4326
4326
|
} else {
|
|
4327
|
-
|
|
4327
|
+
assert23(quoteOrBackslash === '"');
|
|
4328
4328
|
break;
|
|
4329
4329
|
}
|
|
4330
4330
|
}
|
|
@@ -4335,7 +4335,7 @@ var require_dataURL = __commonJS({
|
|
|
4335
4335
|
}
|
|
4336
4336
|
__name(collectAnHTTPQuotedString, "collectAnHTTPQuotedString");
|
|
4337
4337
|
function serializeAMimeType(mimeType) {
|
|
4338
|
-
|
|
4338
|
+
assert23(mimeType !== "failure");
|
|
4339
4339
|
const { parameters, essence } = mimeType;
|
|
4340
4340
|
let serialization = essence;
|
|
4341
4341
|
for (let [name, value] of parameters.entries()) {
|
|
@@ -4773,7 +4773,7 @@ var require_body = __commonJS({
|
|
|
4773
4773
|
var { DOMException: DOMException2, structuredClone } = require_constants();
|
|
4774
4774
|
var { Blob: Blob5, File: NativeFile } = require("buffer");
|
|
4775
4775
|
var { kBodyUsed } = require_symbols();
|
|
4776
|
-
var
|
|
4776
|
+
var assert23 = require("assert");
|
|
4777
4777
|
var { isErrored } = require_util();
|
|
4778
4778
|
var { isUint8Array, isArrayBuffer } = require("util/types");
|
|
4779
4779
|
var { File: UndiciFile } = require_file();
|
|
@@ -4804,7 +4804,7 @@ var require_body = __commonJS({
|
|
|
4804
4804
|
type: void 0
|
|
4805
4805
|
});
|
|
4806
4806
|
}
|
|
4807
|
-
|
|
4807
|
+
assert23(isReadableStreamLike(stream2));
|
|
4808
4808
|
let action = null;
|
|
4809
4809
|
let source = null;
|
|
4810
4810
|
let length = null;
|
|
@@ -4921,8 +4921,8 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
|
4921
4921
|
ReadableStream2 = require("stream/web").ReadableStream;
|
|
4922
4922
|
}
|
|
4923
4923
|
if (object instanceof ReadableStream2) {
|
|
4924
|
-
|
|
4925
|
-
|
|
4924
|
+
assert23(!util4.isDisturbed(object), "The body has already been consumed.");
|
|
4925
|
+
assert23(!object.locked, "The stream is locked.");
|
|
4926
4926
|
}
|
|
4927
4927
|
return extractBody(object, keepalive);
|
|
4928
4928
|
}
|
|
@@ -5148,7 +5148,7 @@ var require_request = __commonJS({
|
|
|
5148
5148
|
InvalidArgumentError,
|
|
5149
5149
|
NotSupportedError
|
|
5150
5150
|
} = require_errors();
|
|
5151
|
-
var
|
|
5151
|
+
var assert23 = require("assert");
|
|
5152
5152
|
var { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = require_symbols();
|
|
5153
5153
|
var util4 = require_util();
|
|
5154
5154
|
var tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/;
|
|
@@ -5329,8 +5329,8 @@ var require_request = __commonJS({
|
|
|
5329
5329
|
}
|
|
5330
5330
|
}
|
|
5331
5331
|
onConnect(abort) {
|
|
5332
|
-
|
|
5333
|
-
|
|
5332
|
+
assert23(!this.aborted);
|
|
5333
|
+
assert23(!this.completed);
|
|
5334
5334
|
if (this.error) {
|
|
5335
5335
|
abort(this.error);
|
|
5336
5336
|
} else {
|
|
@@ -5339,8 +5339,8 @@ var require_request = __commonJS({
|
|
|
5339
5339
|
}
|
|
5340
5340
|
}
|
|
5341
5341
|
onHeaders(statusCode, headers, resume, statusText) {
|
|
5342
|
-
|
|
5343
|
-
|
|
5342
|
+
assert23(!this.aborted);
|
|
5343
|
+
assert23(!this.completed);
|
|
5344
5344
|
if (channels.headers.hasSubscribers) {
|
|
5345
5345
|
channels.headers.publish({ request: this, response: { statusCode, headers, statusText } });
|
|
5346
5346
|
}
|
|
@@ -5351,8 +5351,8 @@ var require_request = __commonJS({
|
|
|
5351
5351
|
}
|
|
5352
5352
|
}
|
|
5353
5353
|
onData(chunk) {
|
|
5354
|
-
|
|
5355
|
-
|
|
5354
|
+
assert23(!this.aborted);
|
|
5355
|
+
assert23(!this.completed);
|
|
5356
5356
|
try {
|
|
5357
5357
|
return this[kHandler].onData(chunk);
|
|
5358
5358
|
} catch (err) {
|
|
@@ -5361,13 +5361,13 @@ var require_request = __commonJS({
|
|
|
5361
5361
|
}
|
|
5362
5362
|
}
|
|
5363
5363
|
onUpgrade(statusCode, headers, socket) {
|
|
5364
|
-
|
|
5365
|
-
|
|
5364
|
+
assert23(!this.aborted);
|
|
5365
|
+
assert23(!this.completed);
|
|
5366
5366
|
return this[kHandler].onUpgrade(statusCode, headers, socket);
|
|
5367
5367
|
}
|
|
5368
5368
|
onComplete(trailers) {
|
|
5369
5369
|
this.onFinally();
|
|
5370
|
-
|
|
5370
|
+
assert23(!this.aborted);
|
|
5371
5371
|
this.completed = true;
|
|
5372
5372
|
if (channels.trailers.hasSubscribers) {
|
|
5373
5373
|
channels.trailers.publish({ request: this, trailers });
|
|
@@ -5715,7 +5715,7 @@ var require_connect = __commonJS({
|
|
|
5715
5715
|
"use strict";
|
|
5716
5716
|
init_import_meta_url();
|
|
5717
5717
|
var net3 = require("net");
|
|
5718
|
-
var
|
|
5718
|
+
var assert23 = require("assert");
|
|
5719
5719
|
var util4 = require_util();
|
|
5720
5720
|
var { InvalidArgumentError, ConnectTimeoutError } = require_errors();
|
|
5721
5721
|
var tls;
|
|
@@ -5785,7 +5785,7 @@ var require_connect = __commonJS({
|
|
|
5785
5785
|
servername = servername || options25.servername || util4.getServerName(host) || null;
|
|
5786
5786
|
const sessionKey = servername || hostname2;
|
|
5787
5787
|
const session = sessionCache.get(sessionKey) || null;
|
|
5788
|
-
|
|
5788
|
+
assert23(sessionKey);
|
|
5789
5789
|
socket = tls.connect({
|
|
5790
5790
|
highWaterMark: 16384,
|
|
5791
5791
|
// TLS in node can't have bigger HWM anyway...
|
|
@@ -5804,7 +5804,7 @@ var require_connect = __commonJS({
|
|
|
5804
5804
|
sessionCache.set(sessionKey, session2);
|
|
5805
5805
|
});
|
|
5806
5806
|
} else {
|
|
5807
|
-
|
|
5807
|
+
assert23(!httpSocket, "httpSocket can only be sent on TLS update");
|
|
5808
5808
|
socket = net3.connect({
|
|
5809
5809
|
highWaterMark: 64 * 1024,
|
|
5810
5810
|
// Same as nodejs fs streams.
|
|
@@ -6220,7 +6220,7 @@ var require_RedirectHandler = __commonJS({
|
|
|
6220
6220
|
init_import_meta_url();
|
|
6221
6221
|
var util4 = require_util();
|
|
6222
6222
|
var { kBodyUsed } = require_symbols();
|
|
6223
|
-
var
|
|
6223
|
+
var assert23 = require("assert");
|
|
6224
6224
|
var { InvalidArgumentError } = require_errors();
|
|
6225
6225
|
var EE = require("events");
|
|
6226
6226
|
var redirectableStatusCodes = [300, 301, 302, 303, 307, 308];
|
|
@@ -6231,7 +6231,7 @@ var require_RedirectHandler = __commonJS({
|
|
|
6231
6231
|
this[kBodyUsed] = false;
|
|
6232
6232
|
}
|
|
6233
6233
|
async *[Symbol.asyncIterator]() {
|
|
6234
|
-
|
|
6234
|
+
assert23(!this[kBodyUsed], "disturbed");
|
|
6235
6235
|
this[kBodyUsed] = true;
|
|
6236
6236
|
yield* this[kBody];
|
|
6237
6237
|
}
|
|
@@ -6253,7 +6253,7 @@ var require_RedirectHandler = __commonJS({
|
|
|
6253
6253
|
if (util4.isStream(this.opts.body)) {
|
|
6254
6254
|
if (util4.bodyLength(this.opts.body) === 0) {
|
|
6255
6255
|
this.opts.body.on("data", function() {
|
|
6256
|
-
|
|
6256
|
+
assert23(false);
|
|
6257
6257
|
});
|
|
6258
6258
|
}
|
|
6259
6259
|
if (typeof this.opts.body.readableDidRead !== "boolean") {
|
|
@@ -6350,7 +6350,7 @@ var require_RedirectHandler = __commonJS({
|
|
|
6350
6350
|
}
|
|
6351
6351
|
}
|
|
6352
6352
|
} else {
|
|
6353
|
-
|
|
6353
|
+
assert23(headers == null, "headers must be an object or an array");
|
|
6354
6354
|
}
|
|
6355
6355
|
return ret;
|
|
6356
6356
|
}
|
|
@@ -6404,7 +6404,7 @@ var require_client = __commonJS({
|
|
|
6404
6404
|
"../../node_modules/.pnpm/undici@5.28.2/node_modules/undici/lib/client.js"(exports2, module3) {
|
|
6405
6405
|
"use strict";
|
|
6406
6406
|
init_import_meta_url();
|
|
6407
|
-
var
|
|
6407
|
+
var assert23 = require("assert");
|
|
6408
6408
|
var net3 = require("net");
|
|
6409
6409
|
var http4 = require("http");
|
|
6410
6410
|
var { pipeline } = require("stream");
|
|
@@ -6743,7 +6743,7 @@ var require_client = __commonJS({
|
|
|
6743
6743
|
};
|
|
6744
6744
|
__name(Client, "Client");
|
|
6745
6745
|
function onHttp2SessionError(err) {
|
|
6746
|
-
|
|
6746
|
+
assert23(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
|
|
6747
6747
|
this[kSocket][kError] = err;
|
|
6748
6748
|
onError(this[kClient], err);
|
|
6749
6749
|
}
|
|
@@ -6767,7 +6767,7 @@ var require_client = __commonJS({
|
|
|
6767
6767
|
client[kSocket] = null;
|
|
6768
6768
|
client[kHTTP2Session] = null;
|
|
6769
6769
|
if (client.destroyed) {
|
|
6770
|
-
|
|
6770
|
+
assert23(this[kPending] === 0);
|
|
6771
6771
|
const requests = client[kQueue].splice(client[kRunningIdx]);
|
|
6772
6772
|
for (let i = 0; i < requests.length; i++) {
|
|
6773
6773
|
const request3 = requests[i];
|
|
@@ -6779,7 +6779,7 @@ var require_client = __commonJS({
|
|
|
6779
6779
|
errorRequest(client, request3, err);
|
|
6780
6780
|
}
|
|
6781
6781
|
client[kPendingIdx] = client[kRunningIdx];
|
|
6782
|
-
|
|
6782
|
+
assert23(client[kRunning] === 0);
|
|
6783
6783
|
client.emit(
|
|
6784
6784
|
"disconnect",
|
|
6785
6785
|
client[kUrl],
|
|
@@ -6807,35 +6807,35 @@ var require_client = __commonJS({
|
|
|
6807
6807
|
return 0;
|
|
6808
6808
|
},
|
|
6809
6809
|
wasm_on_status: (p2, at, len) => {
|
|
6810
|
-
|
|
6810
|
+
assert23.strictEqual(currentParser.ptr, p2);
|
|
6811
6811
|
const start = at - currentBufferPtr + currentBufferRef.byteOffset;
|
|
6812
6812
|
return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0;
|
|
6813
6813
|
},
|
|
6814
6814
|
wasm_on_message_begin: (p2) => {
|
|
6815
|
-
|
|
6815
|
+
assert23.strictEqual(currentParser.ptr, p2);
|
|
6816
6816
|
return currentParser.onMessageBegin() || 0;
|
|
6817
6817
|
},
|
|
6818
6818
|
wasm_on_header_field: (p2, at, len) => {
|
|
6819
|
-
|
|
6819
|
+
assert23.strictEqual(currentParser.ptr, p2);
|
|
6820
6820
|
const start = at - currentBufferPtr + currentBufferRef.byteOffset;
|
|
6821
6821
|
return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0;
|
|
6822
6822
|
},
|
|
6823
6823
|
wasm_on_header_value: (p2, at, len) => {
|
|
6824
|
-
|
|
6824
|
+
assert23.strictEqual(currentParser.ptr, p2);
|
|
6825
6825
|
const start = at - currentBufferPtr + currentBufferRef.byteOffset;
|
|
6826
6826
|
return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0;
|
|
6827
6827
|
},
|
|
6828
6828
|
wasm_on_headers_complete: (p2, statusCode, upgrade, shouldKeepAlive) => {
|
|
6829
|
-
|
|
6829
|
+
assert23.strictEqual(currentParser.ptr, p2);
|
|
6830
6830
|
return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0;
|
|
6831
6831
|
},
|
|
6832
6832
|
wasm_on_body: (p2, at, len) => {
|
|
6833
|
-
|
|
6833
|
+
assert23.strictEqual(currentParser.ptr, p2);
|
|
6834
6834
|
const start = at - currentBufferPtr + currentBufferRef.byteOffset;
|
|
6835
6835
|
return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0;
|
|
6836
6836
|
},
|
|
6837
6837
|
wasm_on_message_complete: (p2) => {
|
|
6838
|
-
|
|
6838
|
+
assert23.strictEqual(currentParser.ptr, p2);
|
|
6839
6839
|
return currentParser.onMessageComplete() || 0;
|
|
6840
6840
|
}
|
|
6841
6841
|
/* eslint-enable camelcase */
|
|
@@ -6855,7 +6855,7 @@ var require_client = __commonJS({
|
|
|
6855
6855
|
var TIMEOUT_IDLE = 3;
|
|
6856
6856
|
var Parser2 = class {
|
|
6857
6857
|
constructor(client, socket, { exports: exports3 }) {
|
|
6858
|
-
|
|
6858
|
+
assert23(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0);
|
|
6859
6859
|
this.llhttp = exports3;
|
|
6860
6860
|
this.ptr = this.llhttp.llhttp_alloc(constants3.TYPE.RESPONSE);
|
|
6861
6861
|
this.client = client;
|
|
@@ -6901,10 +6901,10 @@ var require_client = __commonJS({
|
|
|
6901
6901
|
if (this.socket.destroyed || !this.paused) {
|
|
6902
6902
|
return;
|
|
6903
6903
|
}
|
|
6904
|
-
|
|
6905
|
-
|
|
6904
|
+
assert23(this.ptr != null);
|
|
6905
|
+
assert23(currentParser == null);
|
|
6906
6906
|
this.llhttp.llhttp_resume(this.ptr);
|
|
6907
|
-
|
|
6907
|
+
assert23(this.timeoutType === TIMEOUT_BODY);
|
|
6908
6908
|
if (this.timeout) {
|
|
6909
6909
|
if (this.timeout.refresh) {
|
|
6910
6910
|
this.timeout.refresh();
|
|
@@ -6924,9 +6924,9 @@ var require_client = __commonJS({
|
|
|
6924
6924
|
}
|
|
6925
6925
|
}
|
|
6926
6926
|
execute(data) {
|
|
6927
|
-
|
|
6928
|
-
|
|
6929
|
-
|
|
6927
|
+
assert23(this.ptr != null);
|
|
6928
|
+
assert23(currentParser == null);
|
|
6929
|
+
assert23(!this.paused);
|
|
6930
6930
|
const { socket, llhttp } = this;
|
|
6931
6931
|
if (data.length > currentBufferSize) {
|
|
6932
6932
|
if (currentBufferPtr) {
|
|
@@ -6968,8 +6968,8 @@ var require_client = __commonJS({
|
|
|
6968
6968
|
}
|
|
6969
6969
|
}
|
|
6970
6970
|
destroy() {
|
|
6971
|
-
|
|
6972
|
-
|
|
6971
|
+
assert23(this.ptr != null);
|
|
6972
|
+
assert23(currentParser == null);
|
|
6973
6973
|
this.llhttp.llhttp_free(this.ptr);
|
|
6974
6974
|
this.ptr = null;
|
|
6975
6975
|
timers.clearTimeout(this.timeout);
|
|
@@ -7026,17 +7026,17 @@ var require_client = __commonJS({
|
|
|
7026
7026
|
}
|
|
7027
7027
|
onUpgrade(head) {
|
|
7028
7028
|
const { upgrade, client, socket, headers, statusCode } = this;
|
|
7029
|
-
|
|
7029
|
+
assert23(upgrade);
|
|
7030
7030
|
const request3 = client[kQueue][client[kRunningIdx]];
|
|
7031
|
-
|
|
7032
|
-
|
|
7033
|
-
|
|
7034
|
-
|
|
7035
|
-
|
|
7031
|
+
assert23(request3);
|
|
7032
|
+
assert23(!socket.destroyed);
|
|
7033
|
+
assert23(socket === client[kSocket]);
|
|
7034
|
+
assert23(!this.paused);
|
|
7035
|
+
assert23(request3.upgrade || request3.method === "CONNECT");
|
|
7036
7036
|
this.statusCode = null;
|
|
7037
7037
|
this.statusText = "";
|
|
7038
7038
|
this.shouldKeepAlive = null;
|
|
7039
|
-
|
|
7039
|
+
assert23(this.headers.length % 2 === 0);
|
|
7040
7040
|
this.headers = [];
|
|
7041
7041
|
this.headersSize = 0;
|
|
7042
7042
|
socket.unshift(head);
|
|
@@ -7064,8 +7064,8 @@ var require_client = __commonJS({
|
|
|
7064
7064
|
if (!request3) {
|
|
7065
7065
|
return -1;
|
|
7066
7066
|
}
|
|
7067
|
-
|
|
7068
|
-
|
|
7067
|
+
assert23(!this.upgrade);
|
|
7068
|
+
assert23(this.statusCode < 200);
|
|
7069
7069
|
if (statusCode === 100) {
|
|
7070
7070
|
util4.destroy(socket, new SocketError("bad response", util4.getSocketInfo(socket)));
|
|
7071
7071
|
return -1;
|
|
@@ -7074,7 +7074,7 @@ var require_client = __commonJS({
|
|
|
7074
7074
|
util4.destroy(socket, new SocketError("bad upgrade", util4.getSocketInfo(socket)));
|
|
7075
7075
|
return -1;
|
|
7076
7076
|
}
|
|
7077
|
-
|
|
7077
|
+
assert23.strictEqual(this.timeoutType, TIMEOUT_HEADERS);
|
|
7078
7078
|
this.statusCode = statusCode;
|
|
7079
7079
|
this.shouldKeepAlive = shouldKeepAlive || // Override llhttp value which does not allow keepAlive for HEAD.
|
|
7080
7080
|
request3.method === "HEAD" && !socket[kReset2] && this.connection.toLowerCase() === "keep-alive";
|
|
@@ -7087,16 +7087,16 @@ var require_client = __commonJS({
|
|
|
7087
7087
|
}
|
|
7088
7088
|
}
|
|
7089
7089
|
if (request3.method === "CONNECT") {
|
|
7090
|
-
|
|
7090
|
+
assert23(client[kRunning] === 1);
|
|
7091
7091
|
this.upgrade = true;
|
|
7092
7092
|
return 2;
|
|
7093
7093
|
}
|
|
7094
7094
|
if (upgrade) {
|
|
7095
|
-
|
|
7095
|
+
assert23(client[kRunning] === 1);
|
|
7096
7096
|
this.upgrade = true;
|
|
7097
7097
|
return 2;
|
|
7098
7098
|
}
|
|
7099
|
-
|
|
7099
|
+
assert23(this.headers.length % 2 === 0);
|
|
7100
7100
|
this.headers = [];
|
|
7101
7101
|
this.headersSize = 0;
|
|
7102
7102
|
if (this.shouldKeepAlive && client[kPipelining]) {
|
|
@@ -7139,14 +7139,14 @@ var require_client = __commonJS({
|
|
|
7139
7139
|
return -1;
|
|
7140
7140
|
}
|
|
7141
7141
|
const request3 = client[kQueue][client[kRunningIdx]];
|
|
7142
|
-
|
|
7143
|
-
|
|
7142
|
+
assert23(request3);
|
|
7143
|
+
assert23.strictEqual(this.timeoutType, TIMEOUT_BODY);
|
|
7144
7144
|
if (this.timeout) {
|
|
7145
7145
|
if (this.timeout.refresh) {
|
|
7146
7146
|
this.timeout.refresh();
|
|
7147
7147
|
}
|
|
7148
7148
|
}
|
|
7149
|
-
|
|
7149
|
+
assert23(statusCode >= 200);
|
|
7150
7150
|
if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
|
|
7151
7151
|
util4.destroy(socket, new ResponseExceededMaxSizeError());
|
|
7152
7152
|
return -1;
|
|
@@ -7165,15 +7165,15 @@ var require_client = __commonJS({
|
|
|
7165
7165
|
return;
|
|
7166
7166
|
}
|
|
7167
7167
|
const request3 = client[kQueue][client[kRunningIdx]];
|
|
7168
|
-
|
|
7169
|
-
|
|
7168
|
+
assert23(request3);
|
|
7169
|
+
assert23(statusCode >= 100);
|
|
7170
7170
|
this.statusCode = null;
|
|
7171
7171
|
this.statusText = "";
|
|
7172
7172
|
this.bytesRead = 0;
|
|
7173
7173
|
this.contentLength = "";
|
|
7174
7174
|
this.keepAlive = "";
|
|
7175
7175
|
this.connection = "";
|
|
7176
|
-
|
|
7176
|
+
assert23(this.headers.length % 2 === 0);
|
|
7177
7177
|
this.headers = [];
|
|
7178
7178
|
this.headersSize = 0;
|
|
7179
7179
|
if (statusCode < 200) {
|
|
@@ -7186,7 +7186,7 @@ var require_client = __commonJS({
|
|
|
7186
7186
|
request3.onComplete(headers);
|
|
7187
7187
|
client[kQueue][client[kRunningIdx]++] = null;
|
|
7188
7188
|
if (socket[kWriting]) {
|
|
7189
|
-
|
|
7189
|
+
assert23.strictEqual(client[kRunning], 0);
|
|
7190
7190
|
util4.destroy(socket, new InformationalError("reset"));
|
|
7191
7191
|
return constants3.ERROR.PAUSED;
|
|
7192
7192
|
} else if (!shouldKeepAlive) {
|
|
@@ -7207,7 +7207,7 @@ var require_client = __commonJS({
|
|
|
7207
7207
|
const { socket, timeoutType, client } = parser2;
|
|
7208
7208
|
if (timeoutType === TIMEOUT_HEADERS) {
|
|
7209
7209
|
if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
|
|
7210
|
-
|
|
7210
|
+
assert23(!parser2.paused, "cannot be paused while waiting for headers");
|
|
7211
7211
|
util4.destroy(socket, new HeadersTimeoutError());
|
|
7212
7212
|
}
|
|
7213
7213
|
} else if (timeoutType === TIMEOUT_BODY) {
|
|
@@ -7215,7 +7215,7 @@ var require_client = __commonJS({
|
|
|
7215
7215
|
util4.destroy(socket, new BodyTimeoutError());
|
|
7216
7216
|
}
|
|
7217
7217
|
} else if (timeoutType === TIMEOUT_IDLE) {
|
|
7218
|
-
|
|
7218
|
+
assert23(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]);
|
|
7219
7219
|
util4.destroy(socket, new InformationalError("socket idle timeout"));
|
|
7220
7220
|
}
|
|
7221
7221
|
}
|
|
@@ -7229,7 +7229,7 @@ var require_client = __commonJS({
|
|
|
7229
7229
|
__name(onSocketReadable, "onSocketReadable");
|
|
7230
7230
|
function onSocketError(err) {
|
|
7231
7231
|
const { [kClient]: client, [kParser]: parser2 } = this;
|
|
7232
|
-
|
|
7232
|
+
assert23(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
|
|
7233
7233
|
if (client[kHTTPConnVersion] !== "h2") {
|
|
7234
7234
|
if (err.code === "ECONNRESET" && parser2.statusCode && !parser2.shouldKeepAlive) {
|
|
7235
7235
|
parser2.onMessageComplete();
|
|
@@ -7242,13 +7242,13 @@ var require_client = __commonJS({
|
|
|
7242
7242
|
__name(onSocketError, "onSocketError");
|
|
7243
7243
|
function onError(client, err) {
|
|
7244
7244
|
if (client[kRunning] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") {
|
|
7245
|
-
|
|
7245
|
+
assert23(client[kPendingIdx] === client[kRunningIdx]);
|
|
7246
7246
|
const requests = client[kQueue].splice(client[kRunningIdx]);
|
|
7247
7247
|
for (let i = 0; i < requests.length; i++) {
|
|
7248
7248
|
const request3 = requests[i];
|
|
7249
7249
|
errorRequest(client, request3, err);
|
|
7250
7250
|
}
|
|
7251
|
-
|
|
7251
|
+
assert23(client[kSize] === 0);
|
|
7252
7252
|
}
|
|
7253
7253
|
}
|
|
7254
7254
|
__name(onError, "onError");
|
|
@@ -7275,7 +7275,7 @@ var require_client = __commonJS({
|
|
|
7275
7275
|
const err = this[kError] || new SocketError("closed", util4.getSocketInfo(this));
|
|
7276
7276
|
client[kSocket] = null;
|
|
7277
7277
|
if (client.destroyed) {
|
|
7278
|
-
|
|
7278
|
+
assert23(client[kPending] === 0);
|
|
7279
7279
|
const requests = client[kQueue].splice(client[kRunningIdx]);
|
|
7280
7280
|
for (let i = 0; i < requests.length; i++) {
|
|
7281
7281
|
const request3 = requests[i];
|
|
@@ -7287,20 +7287,20 @@ var require_client = __commonJS({
|
|
|
7287
7287
|
errorRequest(client, request3, err);
|
|
7288
7288
|
}
|
|
7289
7289
|
client[kPendingIdx] = client[kRunningIdx];
|
|
7290
|
-
|
|
7290
|
+
assert23(client[kRunning] === 0);
|
|
7291
7291
|
client.emit("disconnect", client[kUrl], [client], err);
|
|
7292
7292
|
resume(client);
|
|
7293
7293
|
}
|
|
7294
7294
|
__name(onSocketClose, "onSocketClose");
|
|
7295
7295
|
async function connect2(client) {
|
|
7296
|
-
|
|
7297
|
-
|
|
7296
|
+
assert23(!client[kConnecting]);
|
|
7297
|
+
assert23(!client[kSocket]);
|
|
7298
7298
|
let { host, hostname: hostname2, protocol, port: port2 } = client[kUrl];
|
|
7299
7299
|
if (hostname2[0] === "[") {
|
|
7300
7300
|
const idx = hostname2.indexOf("]");
|
|
7301
|
-
|
|
7301
|
+
assert23(idx !== -1);
|
|
7302
7302
|
const ip2 = hostname2.substring(1, idx);
|
|
7303
|
-
|
|
7303
|
+
assert23(net3.isIP(ip2));
|
|
7304
7304
|
hostname2 = ip2;
|
|
7305
7305
|
}
|
|
7306
7306
|
client[kConnecting] = true;
|
|
@@ -7340,7 +7340,7 @@ var require_client = __commonJS({
|
|
|
7340
7340
|
return;
|
|
7341
7341
|
}
|
|
7342
7342
|
client[kConnecting] = false;
|
|
7343
|
-
|
|
7343
|
+
assert23(socket);
|
|
7344
7344
|
const isH2 = socket.alpnProtocol === "h2";
|
|
7345
7345
|
if (isH2) {
|
|
7346
7346
|
if (!h2ExperimentalWarned) {
|
|
@@ -7416,7 +7416,7 @@ var require_client = __commonJS({
|
|
|
7416
7416
|
});
|
|
7417
7417
|
}
|
|
7418
7418
|
if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") {
|
|
7419
|
-
|
|
7419
|
+
assert23(client[kRunning] === 0);
|
|
7420
7420
|
while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
|
|
7421
7421
|
const request3 = client[kQueue][client[kPendingIdx]++];
|
|
7422
7422
|
errorRequest(client, request3, err);
|
|
@@ -7451,7 +7451,7 @@ var require_client = __commonJS({
|
|
|
7451
7451
|
function _resume(client, sync) {
|
|
7452
7452
|
while (true) {
|
|
7453
7453
|
if (client.destroyed) {
|
|
7454
|
-
|
|
7454
|
+
assert23(client[kPending] === 0);
|
|
7455
7455
|
return;
|
|
7456
7456
|
}
|
|
7457
7457
|
if (client[kClosedResolve] && !client[kSize]) {
|
|
@@ -7625,13 +7625,13 @@ upgrade: ${upgrade}\r
|
|
|
7625
7625
|
\r
|
|
7626
7626
|
`, "latin1");
|
|
7627
7627
|
} else {
|
|
7628
|
-
|
|
7628
|
+
assert23(contentLength === null, "no body must not have content length");
|
|
7629
7629
|
socket.write(`${header}\r
|
|
7630
7630
|
`, "latin1");
|
|
7631
7631
|
}
|
|
7632
7632
|
request3.onRequestSent();
|
|
7633
7633
|
} else if (util4.isBuffer(body)) {
|
|
7634
|
-
|
|
7634
|
+
assert23(contentLength === body.byteLength, "buffer body must have content length");
|
|
7635
7635
|
socket.cork();
|
|
7636
7636
|
socket.write(`${header}content-length: ${contentLength}\r
|
|
7637
7637
|
\r
|
|
@@ -7654,7 +7654,7 @@ upgrade: ${upgrade}\r
|
|
|
7654
7654
|
} else if (util4.isIterable(body)) {
|
|
7655
7655
|
writeIterable({ body, client, request: request3, socket, contentLength, header, expectsPayload });
|
|
7656
7656
|
} else {
|
|
7657
|
-
|
|
7657
|
+
assert23(false);
|
|
7658
7658
|
}
|
|
7659
7659
|
return true;
|
|
7660
7660
|
}
|
|
@@ -7727,7 +7727,7 @@ upgrade: ${upgrade}\r
|
|
|
7727
7727
|
process.emitWarning(new RequestContentLengthMismatchError());
|
|
7728
7728
|
}
|
|
7729
7729
|
if (contentLength != null) {
|
|
7730
|
-
|
|
7730
|
+
assert23(body, "no body must not have content length");
|
|
7731
7731
|
headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`;
|
|
7732
7732
|
}
|
|
7733
7733
|
session.ref();
|
|
@@ -7783,7 +7783,7 @@ upgrade: ${upgrade}\r
|
|
|
7783
7783
|
if (!body) {
|
|
7784
7784
|
request3.onRequestSent();
|
|
7785
7785
|
} else if (util4.isBuffer(body)) {
|
|
7786
|
-
|
|
7786
|
+
assert23(contentLength === body.byteLength, "buffer body must have content length");
|
|
7787
7787
|
stream2.cork();
|
|
7788
7788
|
stream2.write(body);
|
|
7789
7789
|
stream2.uncork();
|
|
@@ -7837,14 +7837,14 @@ upgrade: ${upgrade}\r
|
|
|
7837
7837
|
socket: client[kSocket]
|
|
7838
7838
|
});
|
|
7839
7839
|
} else {
|
|
7840
|
-
|
|
7840
|
+
assert23(false);
|
|
7841
7841
|
}
|
|
7842
7842
|
}
|
|
7843
7843
|
__name(writeBodyH2, "writeBodyH2");
|
|
7844
7844
|
}
|
|
7845
7845
|
__name(writeH2, "writeH2");
|
|
7846
7846
|
function writeStream({ h2stream, body, client, request: request3, socket, contentLength, header, expectsPayload }) {
|
|
7847
|
-
|
|
7847
|
+
assert23(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
|
|
7848
7848
|
if (client[kHTTPConnVersion] === "h2") {
|
|
7849
7849
|
let onPipeData = function(chunk) {
|
|
7850
7850
|
request3.onBodySent(chunk);
|
|
@@ -7903,7 +7903,7 @@ upgrade: ${upgrade}\r
|
|
|
7903
7903
|
return;
|
|
7904
7904
|
}
|
|
7905
7905
|
finished = true;
|
|
7906
|
-
|
|
7906
|
+
assert23(socket.destroyed || socket[kWriting] && client[kRunning] <= 1);
|
|
7907
7907
|
socket.off("drain", onDrain).off("error", onFinished);
|
|
7908
7908
|
body.removeListener("data", onData).removeListener("end", onFinished).removeListener("error", onFinished).removeListener("close", onAbort);
|
|
7909
7909
|
if (!err) {
|
|
@@ -7928,7 +7928,7 @@ upgrade: ${upgrade}\r
|
|
|
7928
7928
|
}
|
|
7929
7929
|
__name(writeStream, "writeStream");
|
|
7930
7930
|
async function writeBlob({ h2stream, body, client, request: request3, socket, contentLength, header, expectsPayload }) {
|
|
7931
|
-
|
|
7931
|
+
assert23(contentLength === body.size, "blob body must have content length");
|
|
7932
7932
|
const isH2 = client[kHTTPConnVersion] === "h2";
|
|
7933
7933
|
try {
|
|
7934
7934
|
if (contentLength != null && contentLength !== body.size) {
|
|
@@ -7959,7 +7959,7 @@ upgrade: ${upgrade}\r
|
|
|
7959
7959
|
}
|
|
7960
7960
|
__name(writeBlob, "writeBlob");
|
|
7961
7961
|
async function writeIterable({ h2stream, body, client, request: request3, socket, contentLength, header, expectsPayload }) {
|
|
7962
|
-
|
|
7962
|
+
assert23(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
|
|
7963
7963
|
let callback = null;
|
|
7964
7964
|
function onDrain() {
|
|
7965
7965
|
if (callback) {
|
|
@@ -7970,7 +7970,7 @@ upgrade: ${upgrade}\r
|
|
|
7970
7970
|
}
|
|
7971
7971
|
__name(onDrain, "onDrain");
|
|
7972
7972
|
const waitForDrain = /* @__PURE__ */ __name(() => new Promise((resolve19, reject) => {
|
|
7973
|
-
|
|
7973
|
+
assert23(callback === null);
|
|
7974
7974
|
if (socket[kError]) {
|
|
7975
7975
|
reject(socket[kError]);
|
|
7976
7976
|
} else {
|
|
@@ -8119,7 +8119,7 @@ ${len.toString(16)}\r
|
|
|
8119
8119
|
const { socket, client } = this;
|
|
8120
8120
|
socket[kWriting] = false;
|
|
8121
8121
|
if (err) {
|
|
8122
|
-
|
|
8122
|
+
assert23(client[kRunning] <= 1, "pipeline should only contain this request");
|
|
8123
8123
|
util4.destroy(socket, err);
|
|
8124
8124
|
}
|
|
8125
8125
|
}
|
|
@@ -8128,7 +8128,7 @@ ${len.toString(16)}\r
|
|
|
8128
8128
|
function errorRequest(client, request3, err) {
|
|
8129
8129
|
try {
|
|
8130
8130
|
request3.onError(err);
|
|
8131
|
-
|
|
8131
|
+
assert23(request3.aborted);
|
|
8132
8132
|
} catch (err2) {
|
|
8133
8133
|
client.emit("error", err2);
|
|
8134
8134
|
}
|
|
@@ -8784,7 +8784,7 @@ var require_readable = __commonJS({
|
|
|
8784
8784
|
"../../node_modules/.pnpm/undici@5.28.2/node_modules/undici/lib/api/readable.js"(exports2, module3) {
|
|
8785
8785
|
"use strict";
|
|
8786
8786
|
init_import_meta_url();
|
|
8787
|
-
var
|
|
8787
|
+
var assert23 = require("assert");
|
|
8788
8788
|
var { Readable: Readable2 } = require("stream");
|
|
8789
8789
|
var { RequestAbortedError, NotSupportedError, InvalidArgumentError } = require_errors();
|
|
8790
8790
|
var util4 = require_util();
|
|
@@ -8893,7 +8893,7 @@ var require_readable = __commonJS({
|
|
|
8893
8893
|
this[kBody] = ReadableStreamFrom(this);
|
|
8894
8894
|
if (this[kConsume]) {
|
|
8895
8895
|
this[kBody].getReader();
|
|
8896
|
-
|
|
8896
|
+
assert23(this[kBody].locked);
|
|
8897
8897
|
}
|
|
8898
8898
|
}
|
|
8899
8899
|
return this[kBody];
|
|
@@ -8946,7 +8946,7 @@ var require_readable = __commonJS({
|
|
|
8946
8946
|
if (isUnusable(stream2)) {
|
|
8947
8947
|
throw new TypeError("unusable");
|
|
8948
8948
|
}
|
|
8949
|
-
|
|
8949
|
+
assert23(!stream2[kConsume]);
|
|
8950
8950
|
return new Promise((resolve19, reject) => {
|
|
8951
8951
|
stream2[kConsume] = {
|
|
8952
8952
|
type,
|
|
@@ -9043,13 +9043,13 @@ var require_readable = __commonJS({
|
|
|
9043
9043
|
var require_util3 = __commonJS({
|
|
9044
9044
|
"../../node_modules/.pnpm/undici@5.28.2/node_modules/undici/lib/api/util.js"(exports2, module3) {
|
|
9045
9045
|
init_import_meta_url();
|
|
9046
|
-
var
|
|
9046
|
+
var assert23 = require("assert");
|
|
9047
9047
|
var {
|
|
9048
9048
|
ResponseStatusCodeError
|
|
9049
9049
|
} = require_errors();
|
|
9050
9050
|
var { toUSVString } = require_util();
|
|
9051
9051
|
async function getResolveErrorBodyCallback({ callback, body, contentType, statusCode, statusMessage, headers }) {
|
|
9052
|
-
|
|
9052
|
+
assert23(body);
|
|
9053
9053
|
let chunks = [];
|
|
9054
9054
|
let limit = 0;
|
|
9055
9055
|
for await (const chunk of body) {
|
|
@@ -9489,7 +9489,7 @@ var require_api_pipeline = __commonJS({
|
|
|
9489
9489
|
var util4 = require_util();
|
|
9490
9490
|
var { AsyncResource } = require("async_hooks");
|
|
9491
9491
|
var { addSignal, removeSignal } = require_abort_signal();
|
|
9492
|
-
var
|
|
9492
|
+
var assert23 = require("assert");
|
|
9493
9493
|
var kResume = Symbol("resume");
|
|
9494
9494
|
var PipelineRequest = class extends Readable2 {
|
|
9495
9495
|
constructor() {
|
|
@@ -9591,7 +9591,7 @@ var require_api_pipeline = __commonJS({
|
|
|
9591
9591
|
}
|
|
9592
9592
|
onConnect(abort, context2) {
|
|
9593
9593
|
const { ret, res } = this;
|
|
9594
|
-
|
|
9594
|
+
assert23(!res, "pipeline cannot be retried");
|
|
9595
9595
|
if (ret.destroyed) {
|
|
9596
9596
|
throw new RequestAbortedError();
|
|
9597
9597
|
}
|
|
@@ -9683,7 +9683,7 @@ var require_api_upgrade = __commonJS({
|
|
|
9683
9683
|
var { AsyncResource } = require("async_hooks");
|
|
9684
9684
|
var util4 = require_util();
|
|
9685
9685
|
var { addSignal, removeSignal } = require_abort_signal();
|
|
9686
|
-
var
|
|
9686
|
+
var assert23 = require("assert");
|
|
9687
9687
|
var UpgradeHandler = class extends AsyncResource {
|
|
9688
9688
|
constructor(opts, callback) {
|
|
9689
9689
|
if (!opts || typeof opts !== "object") {
|
|
@@ -9716,7 +9716,7 @@ var require_api_upgrade = __commonJS({
|
|
|
9716
9716
|
}
|
|
9717
9717
|
onUpgrade(statusCode, rawHeaders, socket) {
|
|
9718
9718
|
const { callback, opaque, context: context2 } = this;
|
|
9719
|
-
|
|
9719
|
+
assert23.strictEqual(statusCode, 101);
|
|
9720
9720
|
removeSignal(this);
|
|
9721
9721
|
this.callback = null;
|
|
9722
9722
|
const headers = this.responseHeaders === "raw" ? util4.parseRawHeaders(rawHeaders) : util4.parseHeaders(rawHeaders);
|
|
@@ -10874,7 +10874,7 @@ var require_proxy_agent = __commonJS({
|
|
|
10874
10874
|
var require_RetryHandler = __commonJS({
|
|
10875
10875
|
"../../node_modules/.pnpm/undici@5.28.2/node_modules/undici/lib/handler/RetryHandler.js"(exports2, module3) {
|
|
10876
10876
|
init_import_meta_url();
|
|
10877
|
-
var
|
|
10877
|
+
var assert23 = require("assert");
|
|
10878
10878
|
var { kRetryHandlerDefaultRetry } = require_symbols();
|
|
10879
10879
|
var { RequestRetryError } = require_errors();
|
|
10880
10880
|
var { isDisturbed, parseHeaders: parseHeaders2, parseRangeHeader } = require_util();
|
|
@@ -11041,8 +11041,8 @@ var require_RetryHandler = __commonJS({
|
|
|
11041
11041
|
return false;
|
|
11042
11042
|
}
|
|
11043
11043
|
const { start, size, end = size } = contentRange;
|
|
11044
|
-
|
|
11045
|
-
|
|
11044
|
+
assert23(this.start === start, "content-range mismatch");
|
|
11045
|
+
assert23(this.end == null || this.end === end, "content-range mismatch");
|
|
11046
11046
|
this.resume = resume;
|
|
11047
11047
|
return true;
|
|
11048
11048
|
}
|
|
@@ -11058,12 +11058,12 @@ var require_RetryHandler = __commonJS({
|
|
|
11058
11058
|
);
|
|
11059
11059
|
}
|
|
11060
11060
|
const { start, size, end = size } = range;
|
|
11061
|
-
|
|
11061
|
+
assert23(
|
|
11062
11062
|
start != null && Number.isFinite(start) && this.start !== start,
|
|
11063
11063
|
"content-range mismatch"
|
|
11064
11064
|
);
|
|
11065
|
-
|
|
11066
|
-
|
|
11065
|
+
assert23(Number.isFinite(start));
|
|
11066
|
+
assert23(
|
|
11067
11067
|
end != null && Number.isFinite(end) && this.end !== end,
|
|
11068
11068
|
"invalid content-length"
|
|
11069
11069
|
);
|
|
@@ -11074,8 +11074,8 @@ var require_RetryHandler = __commonJS({
|
|
|
11074
11074
|
const contentLength = headers["content-length"];
|
|
11075
11075
|
this.end = contentLength != null ? Number(contentLength) : null;
|
|
11076
11076
|
}
|
|
11077
|
-
|
|
11078
|
-
|
|
11077
|
+
assert23(Number.isFinite(this.start));
|
|
11078
|
+
assert23(
|
|
11079
11079
|
this.end == null || Number.isFinite(this.end),
|
|
11080
11080
|
"invalid content-length"
|
|
11081
11081
|
);
|
|
@@ -11224,7 +11224,7 @@ var require_headers = __commonJS({
|
|
|
11224
11224
|
isValidHeaderValue
|
|
11225
11225
|
} = require_util2();
|
|
11226
11226
|
var { webidl } = require_webidl();
|
|
11227
|
-
var
|
|
11227
|
+
var assert23 = require("assert");
|
|
11228
11228
|
var kHeadersMap = Symbol("headers map");
|
|
11229
11229
|
var kHeadersSortedMap = Symbol("headers map sorted");
|
|
11230
11230
|
function isHTTPWhiteSpaceCharCode(code) {
|
|
@@ -11489,7 +11489,7 @@ var require_headers = __commonJS({
|
|
|
11489
11489
|
headers.push([name, cookies[j2]]);
|
|
11490
11490
|
}
|
|
11491
11491
|
} else {
|
|
11492
|
-
|
|
11492
|
+
assert23(value !== null);
|
|
11493
11493
|
headers.push([name, value]);
|
|
11494
11494
|
}
|
|
11495
11495
|
}
|
|
@@ -11634,7 +11634,7 @@ var require_response = __commonJS({
|
|
|
11634
11634
|
var { getGlobalOrigin } = require_global();
|
|
11635
11635
|
var { URLSerializer } = require_dataURL();
|
|
11636
11636
|
var { kHeadersList, kConstruct } = require_symbols();
|
|
11637
|
-
var
|
|
11637
|
+
var assert23 = require("assert");
|
|
11638
11638
|
var { types } = require("util");
|
|
11639
11639
|
var ReadableStream2 = globalThis.ReadableStream || require("stream/web").ReadableStream;
|
|
11640
11640
|
var textEncoder = new TextEncoder("utf-8");
|
|
@@ -11854,7 +11854,7 @@ var require_response = __commonJS({
|
|
|
11854
11854
|
return p2 in state ? state[p2] : target[p2];
|
|
11855
11855
|
},
|
|
11856
11856
|
set(target, p2, value) {
|
|
11857
|
-
|
|
11857
|
+
assert23(!(p2 in state));
|
|
11858
11858
|
target[p2] = value;
|
|
11859
11859
|
return true;
|
|
11860
11860
|
}
|
|
@@ -11889,12 +11889,12 @@ var require_response = __commonJS({
|
|
|
11889
11889
|
body: null
|
|
11890
11890
|
});
|
|
11891
11891
|
} else {
|
|
11892
|
-
|
|
11892
|
+
assert23(false);
|
|
11893
11893
|
}
|
|
11894
11894
|
}
|
|
11895
11895
|
__name(filterResponse, "filterResponse");
|
|
11896
11896
|
function makeAppropriateNetworkError(fetchParams, err = null) {
|
|
11897
|
-
|
|
11897
|
+
assert23(isCancelled(fetchParams));
|
|
11898
11898
|
return isAborted(fetchParams) ? makeNetworkError(Object.assign(new DOMException2("The operation was aborted.", "AbortError"), { cause: err })) : makeNetworkError(Object.assign(new DOMException2("Request was cancelled."), { cause: err }));
|
|
11899
11899
|
}
|
|
11900
11900
|
__name(makeAppropriateNetworkError, "makeAppropriateNetworkError");
|
|
@@ -12025,7 +12025,7 @@ var require_request2 = __commonJS({
|
|
|
12025
12025
|
var { getGlobalOrigin } = require_global();
|
|
12026
12026
|
var { URLSerializer } = require_dataURL();
|
|
12027
12027
|
var { kHeadersList, kConstruct } = require_symbols();
|
|
12028
|
-
var
|
|
12028
|
+
var assert23 = require("assert");
|
|
12029
12029
|
var { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require("events");
|
|
12030
12030
|
var TransformStream = globalThis.TransformStream;
|
|
12031
12031
|
var kAbortController = Symbol("abortController");
|
|
@@ -12069,7 +12069,7 @@ var require_request2 = __commonJS({
|
|
|
12069
12069
|
request3 = makeRequest({ urlList: [parsedURL] });
|
|
12070
12070
|
fallbackMode = "cors";
|
|
12071
12071
|
} else {
|
|
12072
|
-
|
|
12072
|
+
assert23(input instanceof Request3);
|
|
12073
12073
|
request3 = input[kState];
|
|
12074
12074
|
signal = input[kSignal];
|
|
12075
12075
|
}
|
|
@@ -12682,7 +12682,7 @@ var require_fetch = __commonJS({
|
|
|
12682
12682
|
urlHasHttpsScheme
|
|
12683
12683
|
} = require_util2();
|
|
12684
12684
|
var { kState, kHeaders, kGuard, kRealm } = require_symbols2();
|
|
12685
|
-
var
|
|
12685
|
+
var assert23 = require("assert");
|
|
12686
12686
|
var { safelyExtractBody } = require_body();
|
|
12687
12687
|
var {
|
|
12688
12688
|
redirectStatusSet,
|
|
@@ -12763,7 +12763,7 @@ var require_fetch = __commonJS({
|
|
|
12763
12763
|
requestObject.signal,
|
|
12764
12764
|
() => {
|
|
12765
12765
|
locallyAborted = true;
|
|
12766
|
-
|
|
12766
|
+
assert23(controller != null);
|
|
12767
12767
|
controller.abort(requestObject.signal.reason);
|
|
12768
12768
|
abortFetch(p2, request3, responseObject, requestObject.signal.reason);
|
|
12769
12769
|
}
|
|
@@ -12900,7 +12900,7 @@ var require_fetch = __commonJS({
|
|
|
12900
12900
|
taskDestination,
|
|
12901
12901
|
crossOriginIsolatedCapability
|
|
12902
12902
|
};
|
|
12903
|
-
|
|
12903
|
+
assert23(!request3.body || request3.body.stream);
|
|
12904
12904
|
if (request3.window === "client") {
|
|
12905
12905
|
request3.window = request3.client?.globalObject?.constructor?.name === "Window" ? request3.client : "no-window";
|
|
12906
12906
|
}
|
|
@@ -12994,7 +12994,7 @@ var require_fetch = __commonJS({
|
|
|
12994
12994
|
} else if (request3.responseTainting === "opaque") {
|
|
12995
12995
|
response = filterResponse(response, "opaque");
|
|
12996
12996
|
} else {
|
|
12997
|
-
|
|
12997
|
+
assert23(false);
|
|
12998
12998
|
}
|
|
12999
12999
|
}
|
|
13000
13000
|
let internalResponse = response.status === 0 ? response : response.internalResponse;
|
|
@@ -13190,7 +13190,7 @@ var require_fetch = __commonJS({
|
|
|
13190
13190
|
} else if (request3.redirect === "follow") {
|
|
13191
13191
|
response = await httpRedirectFetch(fetchParams, response);
|
|
13192
13192
|
} else {
|
|
13193
|
-
|
|
13193
|
+
assert23(false);
|
|
13194
13194
|
}
|
|
13195
13195
|
}
|
|
13196
13196
|
response.timingInfo = timingInfo;
|
|
@@ -13243,7 +13243,7 @@ var require_fetch = __commonJS({
|
|
|
13243
13243
|
request3.headersList.delete("host");
|
|
13244
13244
|
}
|
|
13245
13245
|
if (request3.body != null) {
|
|
13246
|
-
|
|
13246
|
+
assert23(request3.body.source != null);
|
|
13247
13247
|
request3.body = safelyExtractBody(request3.body.source)[0];
|
|
13248
13248
|
}
|
|
13249
13249
|
const timingInfo = fetchParams.timingInfo;
|
|
@@ -13378,7 +13378,7 @@ var require_fetch = __commonJS({
|
|
|
13378
13378
|
}
|
|
13379
13379
|
__name(httpNetworkOrCacheFetch, "httpNetworkOrCacheFetch");
|
|
13380
13380
|
async function httpNetworkFetch(fetchParams, includeCredentials = false, forceNewConnection = false) {
|
|
13381
|
-
|
|
13381
|
+
assert23(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed);
|
|
13382
13382
|
fetchParams.controller.connection = {
|
|
13383
13383
|
abort: null,
|
|
13384
13384
|
destroyed: false,
|
|
@@ -14532,7 +14532,7 @@ var require_util5 = __commonJS({
|
|
|
14532
14532
|
"../../node_modules/.pnpm/undici@5.28.2/node_modules/undici/lib/cache/util.js"(exports2, module3) {
|
|
14533
14533
|
"use strict";
|
|
14534
14534
|
init_import_meta_url();
|
|
14535
|
-
var
|
|
14535
|
+
var assert23 = require("assert");
|
|
14536
14536
|
var { URLSerializer } = require_dataURL();
|
|
14537
14537
|
var { isValidHeaderName } = require_util2();
|
|
14538
14538
|
function urlEquals(A, B, excludeFragment = false) {
|
|
@@ -14542,7 +14542,7 @@ var require_util5 = __commonJS({
|
|
|
14542
14542
|
}
|
|
14543
14543
|
__name(urlEquals, "urlEquals");
|
|
14544
14544
|
function fieldValues(header) {
|
|
14545
|
-
|
|
14545
|
+
assert23(header !== null);
|
|
14546
14546
|
const values = [];
|
|
14547
14547
|
for (let value of header.split(",")) {
|
|
14548
14548
|
value = value.trim();
|
|
@@ -14578,9 +14578,9 @@ var require_cache = __commonJS({
|
|
|
14578
14578
|
var { kState, kHeaders, kGuard, kRealm } = require_symbols2();
|
|
14579
14579
|
var { fetching } = require_fetch();
|
|
14580
14580
|
var { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = require_util2();
|
|
14581
|
-
var
|
|
14581
|
+
var assert23 = require("assert");
|
|
14582
14582
|
var { getGlobalDispatcher } = require_global2();
|
|
14583
|
-
var
|
|
14583
|
+
var Cache3 = class {
|
|
14584
14584
|
/**
|
|
14585
14585
|
* @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list
|
|
14586
14586
|
* @type {requestResponseList}
|
|
@@ -14593,7 +14593,7 @@ var require_cache = __commonJS({
|
|
|
14593
14593
|
this.#relevantRequestResponseList = arguments[1];
|
|
14594
14594
|
}
|
|
14595
14595
|
async match(request3, options25 = {}) {
|
|
14596
|
-
webidl.brandCheck(this,
|
|
14596
|
+
webidl.brandCheck(this, Cache3);
|
|
14597
14597
|
webidl.argumentLengthCheck(arguments, 1, { header: "Cache.match" });
|
|
14598
14598
|
request3 = webidl.converters.RequestInfo(request3);
|
|
14599
14599
|
options25 = webidl.converters.CacheQueryOptions(options25);
|
|
@@ -14604,7 +14604,7 @@ var require_cache = __commonJS({
|
|
|
14604
14604
|
return p2[0];
|
|
14605
14605
|
}
|
|
14606
14606
|
async matchAll(request3 = void 0, options25 = {}) {
|
|
14607
|
-
webidl.brandCheck(this,
|
|
14607
|
+
webidl.brandCheck(this, Cache3);
|
|
14608
14608
|
if (request3 !== void 0)
|
|
14609
14609
|
request3 = webidl.converters.RequestInfo(request3);
|
|
14610
14610
|
options25 = webidl.converters.CacheQueryOptions(options25);
|
|
@@ -14643,7 +14643,7 @@ var require_cache = __commonJS({
|
|
|
14643
14643
|
return Object.freeze(responseList);
|
|
14644
14644
|
}
|
|
14645
14645
|
async add(request3) {
|
|
14646
|
-
webidl.brandCheck(this,
|
|
14646
|
+
webidl.brandCheck(this, Cache3);
|
|
14647
14647
|
webidl.argumentLengthCheck(arguments, 1, { header: "Cache.add" });
|
|
14648
14648
|
request3 = webidl.converters.RequestInfo(request3);
|
|
14649
14649
|
const requests = [request3];
|
|
@@ -14651,7 +14651,7 @@ var require_cache = __commonJS({
|
|
|
14651
14651
|
return await responseArrayPromise;
|
|
14652
14652
|
}
|
|
14653
14653
|
async addAll(requests) {
|
|
14654
|
-
webidl.brandCheck(this,
|
|
14654
|
+
webidl.brandCheck(this, Cache3);
|
|
14655
14655
|
webidl.argumentLengthCheck(arguments, 1, { header: "Cache.addAll" });
|
|
14656
14656
|
requests = webidl.converters["sequence<RequestInfo>"](requests);
|
|
14657
14657
|
const responsePromises = [];
|
|
@@ -14749,7 +14749,7 @@ var require_cache = __commonJS({
|
|
|
14749
14749
|
return cacheJobPromise.promise;
|
|
14750
14750
|
}
|
|
14751
14751
|
async put(request3, response) {
|
|
14752
|
-
webidl.brandCheck(this,
|
|
14752
|
+
webidl.brandCheck(this, Cache3);
|
|
14753
14753
|
webidl.argumentLengthCheck(arguments, 2, { header: "Cache.put" });
|
|
14754
14754
|
request3 = webidl.converters.RequestInfo(request3);
|
|
14755
14755
|
response = webidl.converters.Response(response);
|
|
@@ -14829,7 +14829,7 @@ var require_cache = __commonJS({
|
|
|
14829
14829
|
return cacheJobPromise.promise;
|
|
14830
14830
|
}
|
|
14831
14831
|
async delete(request3, options25 = {}) {
|
|
14832
|
-
webidl.brandCheck(this,
|
|
14832
|
+
webidl.brandCheck(this, Cache3);
|
|
14833
14833
|
webidl.argumentLengthCheck(arguments, 1, { header: "Cache.delete" });
|
|
14834
14834
|
request3 = webidl.converters.RequestInfo(request3);
|
|
14835
14835
|
options25 = webidl.converters.CacheQueryOptions(options25);
|
|
@@ -14840,7 +14840,7 @@ var require_cache = __commonJS({
|
|
|
14840
14840
|
return false;
|
|
14841
14841
|
}
|
|
14842
14842
|
} else {
|
|
14843
|
-
|
|
14843
|
+
assert23(typeof request3 === "string");
|
|
14844
14844
|
r3 = new Request3(request3)[kState];
|
|
14845
14845
|
}
|
|
14846
14846
|
const operations = [];
|
|
@@ -14874,7 +14874,7 @@ var require_cache = __commonJS({
|
|
|
14874
14874
|
* @returns {readonly Request[]}
|
|
14875
14875
|
*/
|
|
14876
14876
|
async keys(request3 = void 0, options25 = {}) {
|
|
14877
|
-
webidl.brandCheck(this,
|
|
14877
|
+
webidl.brandCheck(this, Cache3);
|
|
14878
14878
|
if (request3 !== void 0)
|
|
14879
14879
|
request3 = webidl.converters.RequestInfo(request3);
|
|
14880
14880
|
options25 = webidl.converters.CacheQueryOptions(options25);
|
|
@@ -14950,7 +14950,7 @@ var require_cache = __commonJS({
|
|
|
14950
14950
|
}
|
|
14951
14951
|
for (const requestResponse of requestResponses) {
|
|
14952
14952
|
const idx = cache2.indexOf(requestResponse);
|
|
14953
|
-
|
|
14953
|
+
assert23(idx !== -1);
|
|
14954
14954
|
cache2.splice(idx, 1);
|
|
14955
14955
|
}
|
|
14956
14956
|
} else if (operation.type === "put") {
|
|
@@ -14982,7 +14982,7 @@ var require_cache = __commonJS({
|
|
|
14982
14982
|
requestResponses = this.#queryCache(operation.request);
|
|
14983
14983
|
for (const requestResponse of requestResponses) {
|
|
14984
14984
|
const idx = cache2.indexOf(requestResponse);
|
|
14985
|
-
|
|
14985
|
+
assert23(idx !== -1);
|
|
14986
14986
|
cache2.splice(idx, 1);
|
|
14987
14987
|
}
|
|
14988
14988
|
cache2.push([operation.request, operation.response]);
|
|
@@ -15050,8 +15050,8 @@ var require_cache = __commonJS({
|
|
|
15050
15050
|
return true;
|
|
15051
15051
|
}
|
|
15052
15052
|
};
|
|
15053
|
-
__name(
|
|
15054
|
-
Object.defineProperties(
|
|
15053
|
+
__name(Cache3, "Cache");
|
|
15054
|
+
Object.defineProperties(Cache3.prototype, {
|
|
15055
15055
|
[Symbol.toStringTag]: {
|
|
15056
15056
|
value: "Cache",
|
|
15057
15057
|
configurable: true
|
|
@@ -15094,7 +15094,7 @@ var require_cache = __commonJS({
|
|
|
15094
15094
|
webidl.converters.RequestInfo
|
|
15095
15095
|
);
|
|
15096
15096
|
module3.exports = {
|
|
15097
|
-
Cache:
|
|
15097
|
+
Cache: Cache3
|
|
15098
15098
|
};
|
|
15099
15099
|
}
|
|
15100
15100
|
});
|
|
@@ -15105,10 +15105,10 @@ var require_cachestorage = __commonJS({
|
|
|
15105
15105
|
"use strict";
|
|
15106
15106
|
init_import_meta_url();
|
|
15107
15107
|
var { kConstruct } = require_symbols4();
|
|
15108
|
-
var { Cache:
|
|
15108
|
+
var { Cache: Cache3 } = require_cache();
|
|
15109
15109
|
var { webidl } = require_webidl();
|
|
15110
15110
|
var { kEnumerableProperty } = require_util();
|
|
15111
|
-
var
|
|
15111
|
+
var CacheStorage2 = class {
|
|
15112
15112
|
/**
|
|
15113
15113
|
* @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map
|
|
15114
15114
|
* @type {Map<string, import('./cache').requestResponseList}
|
|
@@ -15120,19 +15120,19 @@ var require_cachestorage = __commonJS({
|
|
|
15120
15120
|
}
|
|
15121
15121
|
}
|
|
15122
15122
|
async match(request3, options25 = {}) {
|
|
15123
|
-
webidl.brandCheck(this,
|
|
15123
|
+
webidl.brandCheck(this, CacheStorage2);
|
|
15124
15124
|
webidl.argumentLengthCheck(arguments, 1, { header: "CacheStorage.match" });
|
|
15125
15125
|
request3 = webidl.converters.RequestInfo(request3);
|
|
15126
15126
|
options25 = webidl.converters.MultiCacheQueryOptions(options25);
|
|
15127
15127
|
if (options25.cacheName != null) {
|
|
15128
15128
|
if (this.#caches.has(options25.cacheName)) {
|
|
15129
15129
|
const cacheList = this.#caches.get(options25.cacheName);
|
|
15130
|
-
const cache2 = new
|
|
15130
|
+
const cache2 = new Cache3(kConstruct, cacheList);
|
|
15131
15131
|
return await cache2.match(request3, options25);
|
|
15132
15132
|
}
|
|
15133
15133
|
} else {
|
|
15134
15134
|
for (const cacheList of this.#caches.values()) {
|
|
15135
|
-
const cache2 = new
|
|
15135
|
+
const cache2 = new Cache3(kConstruct, cacheList);
|
|
15136
15136
|
const response = await cache2.match(request3, options25);
|
|
15137
15137
|
if (response !== void 0) {
|
|
15138
15138
|
return response;
|
|
@@ -15146,7 +15146,7 @@ var require_cachestorage = __commonJS({
|
|
|
15146
15146
|
* @returns {Promise<boolean>}
|
|
15147
15147
|
*/
|
|
15148
15148
|
async has(cacheName) {
|
|
15149
|
-
webidl.brandCheck(this,
|
|
15149
|
+
webidl.brandCheck(this, CacheStorage2);
|
|
15150
15150
|
webidl.argumentLengthCheck(arguments, 1, { header: "CacheStorage.has" });
|
|
15151
15151
|
cacheName = webidl.converters.DOMString(cacheName);
|
|
15152
15152
|
return this.#caches.has(cacheName);
|
|
@@ -15157,16 +15157,16 @@ var require_cachestorage = __commonJS({
|
|
|
15157
15157
|
* @returns {Promise<Cache>}
|
|
15158
15158
|
*/
|
|
15159
15159
|
async open(cacheName) {
|
|
15160
|
-
webidl.brandCheck(this,
|
|
15160
|
+
webidl.brandCheck(this, CacheStorage2);
|
|
15161
15161
|
webidl.argumentLengthCheck(arguments, 1, { header: "CacheStorage.open" });
|
|
15162
15162
|
cacheName = webidl.converters.DOMString(cacheName);
|
|
15163
15163
|
if (this.#caches.has(cacheName)) {
|
|
15164
15164
|
const cache3 = this.#caches.get(cacheName);
|
|
15165
|
-
return new
|
|
15165
|
+
return new Cache3(kConstruct, cache3);
|
|
15166
15166
|
}
|
|
15167
15167
|
const cache2 = [];
|
|
15168
15168
|
this.#caches.set(cacheName, cache2);
|
|
15169
|
-
return new
|
|
15169
|
+
return new Cache3(kConstruct, cache2);
|
|
15170
15170
|
}
|
|
15171
15171
|
/**
|
|
15172
15172
|
* @see https://w3c.github.io/ServiceWorker/#cache-storage-delete
|
|
@@ -15174,7 +15174,7 @@ var require_cachestorage = __commonJS({
|
|
|
15174
15174
|
* @returns {Promise<boolean>}
|
|
15175
15175
|
*/
|
|
15176
15176
|
async delete(cacheName) {
|
|
15177
|
-
webidl.brandCheck(this,
|
|
15177
|
+
webidl.brandCheck(this, CacheStorage2);
|
|
15178
15178
|
webidl.argumentLengthCheck(arguments, 1, { header: "CacheStorage.delete" });
|
|
15179
15179
|
cacheName = webidl.converters.DOMString(cacheName);
|
|
15180
15180
|
return this.#caches.delete(cacheName);
|
|
@@ -15184,13 +15184,13 @@ var require_cachestorage = __commonJS({
|
|
|
15184
15184
|
* @returns {string[]}
|
|
15185
15185
|
*/
|
|
15186
15186
|
async keys() {
|
|
15187
|
-
webidl.brandCheck(this,
|
|
15187
|
+
webidl.brandCheck(this, CacheStorage2);
|
|
15188
15188
|
const keys = this.#caches.keys();
|
|
15189
15189
|
return [...keys];
|
|
15190
15190
|
}
|
|
15191
15191
|
};
|
|
15192
|
-
__name(
|
|
15193
|
-
Object.defineProperties(
|
|
15192
|
+
__name(CacheStorage2, "CacheStorage");
|
|
15193
|
+
Object.defineProperties(CacheStorage2.prototype, {
|
|
15194
15194
|
[Symbol.toStringTag]: {
|
|
15195
15195
|
value: "CacheStorage",
|
|
15196
15196
|
configurable: true
|
|
@@ -15202,7 +15202,7 @@ var require_cachestorage = __commonJS({
|
|
|
15202
15202
|
keys: kEnumerableProperty
|
|
15203
15203
|
});
|
|
15204
15204
|
module3.exports = {
|
|
15205
|
-
CacheStorage
|
|
15205
|
+
CacheStorage: CacheStorage2
|
|
15206
15206
|
};
|
|
15207
15207
|
}
|
|
15208
15208
|
});
|
|
@@ -15226,7 +15226,7 @@ var require_util6 = __commonJS({
|
|
|
15226
15226
|
"../../node_modules/.pnpm/undici@5.28.2/node_modules/undici/lib/cookies/util.js"(exports2, module3) {
|
|
15227
15227
|
"use strict";
|
|
15228
15228
|
init_import_meta_url();
|
|
15229
|
-
var
|
|
15229
|
+
var assert23 = require("assert");
|
|
15230
15230
|
var { kHeadersList } = require_symbols();
|
|
15231
15231
|
function isCTLExcludingHtab(value) {
|
|
15232
15232
|
if (value.length === 0) {
|
|
@@ -15375,10 +15375,10 @@ var require_util6 = __commonJS({
|
|
|
15375
15375
|
kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
|
|
15376
15376
|
(symbol) => symbol.description === "headers list"
|
|
15377
15377
|
);
|
|
15378
|
-
|
|
15378
|
+
assert23(kHeadersListNode, "Headers cannot be parsed");
|
|
15379
15379
|
}
|
|
15380
15380
|
const headersList = headers[kHeadersListNode];
|
|
15381
|
-
|
|
15381
|
+
assert23(headersList);
|
|
15382
15382
|
return headersList;
|
|
15383
15383
|
}
|
|
15384
15384
|
__name(getHeadersList, "getHeadersList");
|
|
@@ -15398,7 +15398,7 @@ var require_parse = __commonJS({
|
|
|
15398
15398
|
var { maxNameValuePairSize, maxAttributeValueSize } = require_constants3();
|
|
15399
15399
|
var { isCTLExcludingHtab } = require_util6();
|
|
15400
15400
|
var { collectASequenceOfCodePointsFast } = require_dataURL();
|
|
15401
|
-
var
|
|
15401
|
+
var assert23 = require("assert");
|
|
15402
15402
|
function parseSetCookie(header) {
|
|
15403
15403
|
if (isCTLExcludingHtab(header)) {
|
|
15404
15404
|
return null;
|
|
@@ -15441,7 +15441,7 @@ var require_parse = __commonJS({
|
|
|
15441
15441
|
if (unparsedAttributes.length === 0) {
|
|
15442
15442
|
return cookieAttributeList;
|
|
15443
15443
|
}
|
|
15444
|
-
|
|
15444
|
+
assert23(unparsedAttributes[0] === ";");
|
|
15445
15445
|
unparsedAttributes = unparsedAttributes.slice(1);
|
|
15446
15446
|
let cookieAv = "";
|
|
15447
15447
|
if (unparsedAttributes.includes(";")) {
|
|
@@ -17043,9 +17043,9 @@ var require_undici = __commonJS({
|
|
|
17043
17043
|
const { setGlobalOrigin, getGlobalOrigin } = require_global();
|
|
17044
17044
|
module3.exports.setGlobalOrigin = setGlobalOrigin;
|
|
17045
17045
|
module3.exports.getGlobalOrigin = getGlobalOrigin;
|
|
17046
|
-
const { CacheStorage } = require_cachestorage();
|
|
17046
|
+
const { CacheStorage: CacheStorage2 } = require_cachestorage();
|
|
17047
17047
|
const { kConstruct } = require_symbols4();
|
|
17048
|
-
module3.exports.caches = new
|
|
17048
|
+
module3.exports.caches = new CacheStorage2(kConstruct);
|
|
17049
17049
|
}
|
|
17050
17050
|
if (util4.nodeMajor >= 16) {
|
|
17051
17051
|
const { deleteCookie, getCookies, getSetCookies, setCookie } = require_cookies();
|
|
@@ -23821,7 +23821,7 @@ var require_signal_exit = __commonJS({
|
|
|
23821
23821
|
};
|
|
23822
23822
|
};
|
|
23823
23823
|
} else {
|
|
23824
|
-
|
|
23824
|
+
assert23 = require("assert");
|
|
23825
23825
|
signals = require_signals();
|
|
23826
23826
|
isWin = /^win/i.test(process11.platform);
|
|
23827
23827
|
EE = require("events");
|
|
@@ -23844,7 +23844,7 @@ var require_signal_exit = __commonJS({
|
|
|
23844
23844
|
return function() {
|
|
23845
23845
|
};
|
|
23846
23846
|
}
|
|
23847
|
-
|
|
23847
|
+
assert23.equal(typeof cb, "function", "a callback must be provided for exit handler");
|
|
23848
23848
|
if (loaded === false) {
|
|
23849
23849
|
load();
|
|
23850
23850
|
}
|
|
@@ -23950,7 +23950,7 @@ var require_signal_exit = __commonJS({
|
|
|
23950
23950
|
}
|
|
23951
23951
|
}, "processEmit");
|
|
23952
23952
|
}
|
|
23953
|
-
var
|
|
23953
|
+
var assert23;
|
|
23954
23954
|
var signals;
|
|
23955
23955
|
var isWin;
|
|
23956
23956
|
var EE;
|
|
@@ -94602,19 +94602,19 @@ var require_cache2 = __commonJS({
|
|
|
94602
94602
|
"../../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/cache.js"(exports2, module3) {
|
|
94603
94603
|
"use strict";
|
|
94604
94604
|
init_import_meta_url();
|
|
94605
|
-
var
|
|
94605
|
+
var Cache3 = module3.exports = /* @__PURE__ */ __name(function Cache4() {
|
|
94606
94606
|
this._cache = {};
|
|
94607
94607
|
}, "Cache");
|
|
94608
|
-
|
|
94608
|
+
Cache3.prototype.put = /* @__PURE__ */ __name(function Cache_put(key, value) {
|
|
94609
94609
|
this._cache[key] = value;
|
|
94610
94610
|
}, "Cache_put");
|
|
94611
|
-
|
|
94611
|
+
Cache3.prototype.get = /* @__PURE__ */ __name(function Cache_get(key) {
|
|
94612
94612
|
return this._cache[key];
|
|
94613
94613
|
}, "Cache_get");
|
|
94614
|
-
|
|
94614
|
+
Cache3.prototype.del = /* @__PURE__ */ __name(function Cache_del(key) {
|
|
94615
94615
|
delete this._cache[key];
|
|
94616
94616
|
}, "Cache_del");
|
|
94617
|
-
|
|
94617
|
+
Cache3.prototype.clear = /* @__PURE__ */ __name(function Cache_clear() {
|
|
94618
94618
|
this._cache = {};
|
|
94619
94619
|
}, "Cache_clear");
|
|
94620
94620
|
}
|
|
@@ -98140,7 +98140,7 @@ var require_ajv = __commonJS({
|
|
|
98140
98140
|
init_import_meta_url();
|
|
98141
98141
|
var compileSchema = require_compile();
|
|
98142
98142
|
var resolve19 = require_resolve2();
|
|
98143
|
-
var
|
|
98143
|
+
var Cache3 = require_cache2();
|
|
98144
98144
|
var SchemaObject = require_schema_obj();
|
|
98145
98145
|
var stableStringify = require_fast_json_stable_stringify();
|
|
98146
98146
|
var formats = require_formats2();
|
|
@@ -98181,7 +98181,7 @@ var require_ajv = __commonJS({
|
|
|
98181
98181
|
this._refs = {};
|
|
98182
98182
|
this._fragments = {};
|
|
98183
98183
|
this._formats = formats(opts.format);
|
|
98184
|
-
this._cache = opts.cache || new
|
|
98184
|
+
this._cache = opts.cache || new Cache3();
|
|
98185
98185
|
this._loadingSchemas = {};
|
|
98186
98186
|
this._compilations = [];
|
|
98187
98187
|
this.RULES = rules();
|
|
@@ -104585,8 +104585,7 @@ function createMetadataObject({
|
|
|
104585
104585
|
webAnalyticsToken,
|
|
104586
104586
|
deploymentId,
|
|
104587
104587
|
failOpen,
|
|
104588
|
-
logger: logger3 =
|
|
104589
|
-
}, "logger")
|
|
104588
|
+
logger: logger3 = noopLogger
|
|
104590
104589
|
}) {
|
|
104591
104590
|
return {
|
|
104592
104591
|
...constructRedirects({ redirects, logger: logger3 }),
|
|
@@ -104604,15 +104603,16 @@ function constructRedirects({
|
|
|
104604
104603
|
return {};
|
|
104605
104604
|
const num_valid = redirects.rules.length;
|
|
104606
104605
|
const num_invalid = redirects.invalid.length;
|
|
104607
|
-
logger3(
|
|
104606
|
+
logger3.log(
|
|
104608
104607
|
`Parsed ${num_valid} valid redirect rule${num_valid === 1 ? "" : "s"}.`
|
|
104609
104608
|
);
|
|
104610
104609
|
if (num_invalid > 0) {
|
|
104611
|
-
logger3(`Found invalid redirect lines:`);
|
|
104610
|
+
logger3.warn(`Found invalid redirect lines:`);
|
|
104612
104611
|
for (const { line, lineNumber, message } of redirects.invalid) {
|
|
104613
|
-
if (line)
|
|
104614
|
-
logger3(` - ${lineNumber ? `#${lineNumber}: ` : ""}${line}`);
|
|
104615
|
-
|
|
104612
|
+
if (line) {
|
|
104613
|
+
logger3.warn(` - ${lineNumber ? `#${lineNumber}: ` : ""}${line}`);
|
|
104614
|
+
}
|
|
104615
|
+
logger3.warn(` ${message}`);
|
|
104616
104616
|
}
|
|
104617
104617
|
}
|
|
104618
104618
|
if (num_valid === 0) {
|
|
@@ -104631,8 +104631,8 @@ function constructRedirects({
|
|
|
104631
104631
|
};
|
|
104632
104632
|
continue;
|
|
104633
104633
|
} else {
|
|
104634
|
-
logger3(
|
|
104635
|
-
`
|
|
104634
|
+
logger3.info(
|
|
104635
|
+
`The redirect rule ${rule.from} \u2192 ${rule.status} ${rule.to} could be made more performant by bringing it above any lines with splats or placeholders.`
|
|
104636
104636
|
);
|
|
104637
104637
|
}
|
|
104638
104638
|
}
|
|
@@ -104655,13 +104655,16 @@ function constructHeaders({
|
|
|
104655
104655
|
return {};
|
|
104656
104656
|
const num_valid = headers.rules.length;
|
|
104657
104657
|
const num_invalid = headers.invalid.length;
|
|
104658
|
-
logger3(
|
|
104658
|
+
logger3.log(
|
|
104659
|
+
`Parsed ${num_valid} valid header rule${num_valid === 1 ? "" : "s"}.`
|
|
104660
|
+
);
|
|
104659
104661
|
if (num_invalid > 0) {
|
|
104660
|
-
logger3(`Found invalid header lines:`);
|
|
104662
|
+
logger3.warn(`Found invalid header lines:`);
|
|
104661
104663
|
for (const { line, lineNumber, message } of headers.invalid) {
|
|
104662
|
-
if (line)
|
|
104663
|
-
logger3(` - ${lineNumber ? `#${lineNumber}: ` : ""} ${line}`);
|
|
104664
|
-
|
|
104664
|
+
if (line) {
|
|
104665
|
+
logger3.warn(` - ${lineNumber ? `#${lineNumber}: ` : ""} ${line}`);
|
|
104666
|
+
}
|
|
104667
|
+
logger3.warn(` ${message}`);
|
|
104665
104668
|
}
|
|
104666
104669
|
}
|
|
104667
104670
|
if (num_valid === 0) {
|
|
@@ -104696,10 +104699,23 @@ function constructWebAnalytics({
|
|
|
104696
104699
|
}
|
|
104697
104700
|
};
|
|
104698
104701
|
}
|
|
104702
|
+
var noopLogger;
|
|
104699
104703
|
var init_createMetadataObject = __esm({
|
|
104700
104704
|
"../pages-shared/metadata-generator/createMetadataObject.ts"() {
|
|
104701
104705
|
init_import_meta_url();
|
|
104702
104706
|
init_constants();
|
|
104707
|
+
noopLogger = {
|
|
104708
|
+
debug: (_message) => {
|
|
104709
|
+
},
|
|
104710
|
+
log: (_message) => {
|
|
104711
|
+
},
|
|
104712
|
+
info: (_message) => {
|
|
104713
|
+
},
|
|
104714
|
+
warn: (_message) => {
|
|
104715
|
+
},
|
|
104716
|
+
error: (_error) => {
|
|
104717
|
+
}
|
|
104718
|
+
};
|
|
104703
104719
|
__name(createMetadataObject, "createMetadataObject");
|
|
104704
104720
|
__name(constructRedirects, "constructRedirects");
|
|
104705
104721
|
__name(constructHeaders, "constructHeaders");
|
|
@@ -105888,7 +105904,7 @@ async function generateAssetsFetch(directory, log2) {
|
|
|
105888
105904
|
let metadata = createMetadataObject({
|
|
105889
105905
|
redirects,
|
|
105890
105906
|
headers,
|
|
105891
|
-
logger: log2
|
|
105907
|
+
logger: log2
|
|
105892
105908
|
});
|
|
105893
105909
|
(0, import_chokidar.watch)([headersFile, redirectsFile], { persistent: true }).on(
|
|
105894
105910
|
"change",
|
|
@@ -105910,7 +105926,7 @@ async function generateAssetsFetch(directory, log2) {
|
|
|
105910
105926
|
metadata = createMetadataObject({
|
|
105911
105927
|
redirects,
|
|
105912
105928
|
headers,
|
|
105913
|
-
logger: log2
|
|
105929
|
+
logger: log2
|
|
105914
105930
|
});
|
|
105915
105931
|
}
|
|
105916
105932
|
);
|
|
@@ -119521,6 +119537,7 @@ __name(parseHumanDuration, "parseHumanDuration");
|
|
|
119521
119537
|
|
|
119522
119538
|
// src/config/validation.ts
|
|
119523
119539
|
init_import_meta_url();
|
|
119540
|
+
var import_node_assert3 = __toESM(require("node:assert"));
|
|
119524
119541
|
var import_node_path7 = __toESM(require("node:path"));
|
|
119525
119542
|
var import_toml3 = __toESM(require_toml());
|
|
119526
119543
|
|
|
@@ -119556,7 +119573,7 @@ var import_node_assert2 = __toESM(require("node:assert"));
|
|
|
119556
119573
|
var import_undici3 = __toESM(require_undici());
|
|
119557
119574
|
|
|
119558
119575
|
// package.json
|
|
119559
|
-
var version = "3.
|
|
119576
|
+
var version = "3.26.0";
|
|
119560
119577
|
var package_default = {
|
|
119561
119578
|
name: "wrangler",
|
|
119562
119579
|
version,
|
|
@@ -121666,7 +121683,7 @@ function normalizeAndValidateConfig(rawConfig, configPath, args) {
|
|
|
121666
121683
|
rawConfig.keep_vars,
|
|
121667
121684
|
"boolean"
|
|
121668
121685
|
);
|
|
121669
|
-
const isLegacyEnv2 = args["legacy-env"]
|
|
121686
|
+
const isLegacyEnv2 = typeof args["legacy-env"] === "boolean" ? args["legacy-env"] : rawConfig.legacy_env ?? true;
|
|
121670
121687
|
if (!isLegacyEnv2) {
|
|
121671
121688
|
diagnostics.warnings.push(
|
|
121672
121689
|
"Experimental: Service environments are in beta, and their behaviour is guaranteed to change in the future. DO NOT USE IN PRODUCTION."
|
|
@@ -121678,6 +121695,7 @@ function normalizeAndValidateConfig(rawConfig, configPath, args) {
|
|
|
121678
121695
|
rawConfig
|
|
121679
121696
|
);
|
|
121680
121697
|
const envName = args.env;
|
|
121698
|
+
(0, import_node_assert3.default)(envName === void 0 || typeof envName === "string");
|
|
121681
121699
|
let activeEnv = topLevelEnv;
|
|
121682
121700
|
if (envName !== void 0) {
|
|
121683
121701
|
const envDiagnostics = new Diagnostics(
|
|
@@ -121728,7 +121746,7 @@ Consider adding an environment configuration section to the wrangler.toml file:
|
|
|
121728
121746
|
send_metrics: rawConfig.send_metrics,
|
|
121729
121747
|
keep_vars: rawConfig.keep_vars,
|
|
121730
121748
|
...activeEnv,
|
|
121731
|
-
dev: normalizeAndValidateDev(diagnostics, rawConfig.dev ?? {}),
|
|
121749
|
+
dev: normalizeAndValidateDev(diagnostics, rawConfig.dev ?? {}, args),
|
|
121732
121750
|
migrations: normalizeAndValidateMigrations(
|
|
121733
121751
|
diagnostics,
|
|
121734
121752
|
rawConfig.migrations ?? [],
|
|
@@ -121881,7 +121899,20 @@ function normalizeAndValidateBaseDirField(configPath, rawDir) {
|
|
|
121881
121899
|
}
|
|
121882
121900
|
}
|
|
121883
121901
|
__name(normalizeAndValidateBaseDirField, "normalizeAndValidateBaseDirField");
|
|
121884
|
-
function normalizeAndValidateDev(diagnostics, rawDev) {
|
|
121902
|
+
function normalizeAndValidateDev(diagnostics, rawDev, args) {
|
|
121903
|
+
(0, import_node_assert3.default)(typeof args === "object" && args !== null && !Array.isArray(args));
|
|
121904
|
+
const {
|
|
121905
|
+
localProtocol: localProtocolArg,
|
|
121906
|
+
upstreamProtocol: upstreamProtocolArg,
|
|
121907
|
+
remote: remoteArg
|
|
121908
|
+
} = args;
|
|
121909
|
+
(0, import_node_assert3.default)(
|
|
121910
|
+
localProtocolArg === void 0 || localProtocolArg === "http" || localProtocolArg === "https"
|
|
121911
|
+
);
|
|
121912
|
+
(0, import_node_assert3.default)(
|
|
121913
|
+
upstreamProtocolArg === void 0 || upstreamProtocolArg === "http" || upstreamProtocolArg === "https"
|
|
121914
|
+
);
|
|
121915
|
+
(0, import_node_assert3.default)(remoteArg === void 0 || typeof remoteArg === "boolean");
|
|
121885
121916
|
const {
|
|
121886
121917
|
// On Windows, when specifying `localhost` as the socket hostname, `workerd`
|
|
121887
121918
|
// will only listen on the IPv4 loopback `127.0.0.1`, not the IPv6 `::1`:
|
|
@@ -121893,8 +121924,9 @@ function normalizeAndValidateDev(diagnostics, rawDev) {
|
|
|
121893
121924
|
ip: ip2 = process.platform === "win32" ? "127.0.0.1" : "localhost",
|
|
121894
121925
|
port: port2,
|
|
121895
121926
|
inspector_port,
|
|
121896
|
-
local_protocol = "http",
|
|
121897
|
-
upstream_protocol
|
|
121927
|
+
local_protocol = localProtocolArg ?? "http",
|
|
121928
|
+
// In remote mode upstream_protocol must be https, otherwise it defaults to local_protocol.
|
|
121929
|
+
upstream_protocol = upstreamProtocolArg ?? remoteArg ? "https" : local_protocol,
|
|
121898
121930
|
host,
|
|
121899
121931
|
...rest
|
|
121900
121932
|
} = rawDev;
|
|
@@ -124311,11 +124343,11 @@ var path9 = __toESM(require("node:path"));
|
|
|
124311
124343
|
|
|
124312
124344
|
// src/utils/dedent.ts
|
|
124313
124345
|
init_import_meta_url();
|
|
124314
|
-
var
|
|
124346
|
+
var import_node_assert4 = __toESM(require("node:assert"));
|
|
124315
124347
|
function dedent(strings, ...values) {
|
|
124316
124348
|
const raw = String.raw({ raw: strings }, ...values);
|
|
124317
124349
|
let lines = raw.split("\n");
|
|
124318
|
-
(0,
|
|
124350
|
+
(0, import_node_assert4.default)(lines.length > 0);
|
|
124319
124351
|
if (lines[lines.length - 1].trim() === "") {
|
|
124320
124352
|
lines = lines.slice(0, lines.length - 1);
|
|
124321
124353
|
}
|
|
@@ -124485,19 +124517,19 @@ __name(dedupeModulesByName, "dedupeModulesByName");
|
|
|
124485
124517
|
|
|
124486
124518
|
// src/deployment-bundle/entry-point-from-metafile.ts
|
|
124487
124519
|
init_import_meta_url();
|
|
124488
|
-
var
|
|
124520
|
+
var import_node_assert5 = __toESM(require("node:assert"));
|
|
124489
124521
|
function getEntryPointFromMetafile(entryFile, metafile) {
|
|
124490
124522
|
const entryPoints = Object.entries(metafile.outputs).filter(
|
|
124491
124523
|
([_path, output]) => output.entryPoint !== void 0
|
|
124492
124524
|
);
|
|
124493
124525
|
if (entryPoints.length !== 1) {
|
|
124494
124526
|
const entryPointList = entryPoints.map(([_input, output]) => output.entryPoint).join("\n");
|
|
124495
|
-
(0,
|
|
124527
|
+
(0, import_node_assert5.default)(
|
|
124496
124528
|
entryPoints.length > 0,
|
|
124497
124529
|
`Cannot find entry-point "${entryFile}" in generated bundle.
|
|
124498
124530
|
${entryPointList}`
|
|
124499
124531
|
);
|
|
124500
|
-
(0,
|
|
124532
|
+
(0, import_node_assert5.default)(
|
|
124501
124533
|
entryPoints.length < 2,
|
|
124502
124534
|
`More than one entry-point found for generated bundle.
|
|
124503
124535
|
${entryPointList}`
|
|
@@ -127016,7 +127048,7 @@ var import_open2 = __toESM(require_open());
|
|
|
127016
127048
|
|
|
127017
127049
|
// src/api/startDevWorker/bundle-allowed-paths.ts
|
|
127018
127050
|
init_import_meta_url();
|
|
127019
|
-
var
|
|
127051
|
+
var import_node_assert6 = __toESM(require("node:assert"));
|
|
127020
127052
|
var import_node_fs8 = __toESM(require("node:fs"));
|
|
127021
127053
|
var import_node_path18 = __toESM(require("node:path"));
|
|
127022
127054
|
var import_node_url8 = require("node:url");
|
|
@@ -127074,7 +127106,7 @@ function maybeGetSourceMappingURL(sourcePath) {
|
|
|
127074
127106
|
if (sourceMappingURLIndex === -1)
|
|
127075
127107
|
return;
|
|
127076
127108
|
const sourceMappingURLMatch = source.substring(sourceMappingURLIndex).match(/^\/\/# sourceMappingURL=(.+)/);
|
|
127077
|
-
(0,
|
|
127109
|
+
(0, import_node_assert6.default)(sourceMappingURLMatch !== null);
|
|
127078
127110
|
const sourceMappingURLSpecifier = sourceMappingURLMatch[1];
|
|
127079
127111
|
const sourceURL = (0, import_node_url8.pathToFileURL)(sourcePath);
|
|
127080
127112
|
try {
|
|
@@ -127089,7 +127121,7 @@ __name(maybeGetSourceMappingURL, "maybeGetSourceMappingURL");
|
|
|
127089
127121
|
|
|
127090
127122
|
// src/sourcemap.ts
|
|
127091
127123
|
init_import_meta_url();
|
|
127092
|
-
var
|
|
127124
|
+
var import_node_assert7 = __toESM(require("node:assert"));
|
|
127093
127125
|
var import_node_fs9 = __toESM(require("node:fs"));
|
|
127094
127126
|
var import_node_url9 = __toESM(require("node:url"));
|
|
127095
127127
|
var import_miniflare2 = require("miniflare");
|
|
@@ -127152,7 +127184,7 @@ function getSourceMappingPrepareStackTrace(retrieveSourceMap) {
|
|
|
127152
127184
|
}
|
|
127153
127185
|
});
|
|
127154
127186
|
sourceMappingPrepareStackTrace = Error.prepareStackTrace;
|
|
127155
|
-
(0,
|
|
127187
|
+
(0, import_node_assert7.default)(sourceMappingPrepareStackTrace !== void 0);
|
|
127156
127188
|
Error.prepareStackTrace = originalPrepareStackTrace;
|
|
127157
127189
|
return sourceMappingPrepareStackTrace;
|
|
127158
127190
|
}
|
|
@@ -127197,7 +127229,7 @@ function getSourceMappedString(value, retrieveSourceMap) {
|
|
|
127197
127229
|
continue;
|
|
127198
127230
|
const callSiteLine = callSiteLines[i][0];
|
|
127199
127231
|
const callSiteAtIndex = callSiteLine.indexOf("at");
|
|
127200
|
-
(0,
|
|
127232
|
+
(0, import_node_assert7.default)(callSiteAtIndex !== -1);
|
|
127201
127233
|
const callSiteLineLeftPad = callSiteLine.substring(0, callSiteAtIndex);
|
|
127202
127234
|
value = value.replace(
|
|
127203
127235
|
callSiteLine,
|
|
@@ -127507,14 +127539,14 @@ var openInspector = /* @__PURE__ */ __name(async (inspectorPort, worker) => {
|
|
|
127507
127539
|
|
|
127508
127540
|
// src/dev/local.tsx
|
|
127509
127541
|
init_import_meta_url();
|
|
127510
|
-
var
|
|
127542
|
+
var import_node_assert9 = __toESM(require("node:assert"));
|
|
127511
127543
|
var import_chalk5 = __toESM(require_chalk());
|
|
127512
127544
|
var import_react = __toESM(require_react());
|
|
127513
127545
|
var import_signal_exit4 = __toESM(require_signal_exit());
|
|
127514
127546
|
|
|
127515
127547
|
// src/dev/miniflare.ts
|
|
127516
127548
|
init_import_meta_url();
|
|
127517
|
-
var
|
|
127549
|
+
var import_node_assert8 = __toESM(require("node:assert"));
|
|
127518
127550
|
var import_node_crypto4 = require("node:crypto");
|
|
127519
127551
|
var import_node_fs11 = require("node:fs");
|
|
127520
127552
|
var import_node_path19 = __toESM(require("node:path"));
|
|
@@ -127896,7 +127928,7 @@ function buildMiniflareBindingOptions(config) {
|
|
|
127896
127928
|
modules: true,
|
|
127897
127929
|
script: EXTERNAL_DURABLE_OBJECTS_WORKER_SCRIPT + // Add stub object classes that proxy requests to the correct session
|
|
127898
127930
|
externalObjects.map(({ class_name, script_name }) => {
|
|
127899
|
-
(0,
|
|
127931
|
+
(0, import_node_assert8.default)(script_name !== void 0);
|
|
127900
127932
|
const target = config.workerDefinitions?.[script_name];
|
|
127901
127933
|
const targetHasClass = target?.durableObjects.some(
|
|
127902
127934
|
({ className }) => className === class_name
|
|
@@ -128056,7 +128088,7 @@ async function buildMiniflareOptions(log2, config, proxyToUserWorkerAuthenticati
|
|
|
128056
128088
|
"Vectorize bindings are not currently supported in local mode. Please use --remote if you are working with them."
|
|
128057
128089
|
);
|
|
128058
128090
|
}
|
|
128059
|
-
const upstream = typeof config.localUpstream === "string" ? `${config.
|
|
128091
|
+
const upstream = typeof config.localUpstream === "string" ? `${config.upstreamProtocol}://${config.localUpstream}` : void 0;
|
|
128060
128092
|
const sourceOptions = await buildSourceOptions(config);
|
|
128061
128093
|
const { bindingOptions, internalObjects, externalDurableObjectWorker } = buildMiniflareBindingOptions(config);
|
|
128062
128094
|
const sitesOptions = buildSitesOptions(config);
|
|
@@ -128171,7 +128203,7 @@ __name(MiniflareServer, "MiniflareServer");
|
|
|
128171
128203
|
|
|
128172
128204
|
// src/dev/local.tsx
|
|
128173
128205
|
async function localPropsToConfigBundle(props) {
|
|
128174
|
-
(0,
|
|
128206
|
+
(0, import_node_assert9.default)(props.bundle !== void 0);
|
|
128175
128207
|
const serviceBindings = {};
|
|
128176
128208
|
if (props.enablePagesAssetsServiceBinding !== void 0) {
|
|
128177
128209
|
const generateASSETSBinding2 = (init_assets(), __toCommonJS(assets_exports)).default;
|
|
@@ -128200,6 +128232,7 @@ async function localPropsToConfigBundle(props) {
|
|
|
128200
128232
|
queueConsumers: props.queueConsumers,
|
|
128201
128233
|
localProtocol: props.localProtocol,
|
|
128202
128234
|
localUpstream: props.localUpstream,
|
|
128235
|
+
upstreamProtocol: props.upstreamProtocol,
|
|
128203
128236
|
inspect: props.inspect,
|
|
128204
128237
|
serviceBindings
|
|
128205
128238
|
};
|
|
@@ -128273,7 +128306,7 @@ function useLocalWorker(props) {
|
|
|
128273
128306
|
pathname: `/core:user:${props.name ?? DEFAULT_WORKER_NAME}`
|
|
128274
128307
|
},
|
|
128275
128308
|
userWorkerInnerUrlOverrides: {
|
|
128276
|
-
protocol: props.
|
|
128309
|
+
protocol: props.upstreamProtocol,
|
|
128277
128310
|
hostname: props.localUpstream,
|
|
128278
128311
|
port: props.localUpstream ? "" : void 0
|
|
128279
128312
|
// `localUpstream` was essentially `host`, not `hostname`, so if it was set delete the `port`
|
|
@@ -128340,7 +128373,7 @@ var import_react17 = __toESM(require_react());
|
|
|
128340
128373
|
|
|
128341
128374
|
// src/deploy/deploy.ts
|
|
128342
128375
|
init_import_meta_url();
|
|
128343
|
-
var
|
|
128376
|
+
var import_node_assert16 = __toESM(require("node:assert"));
|
|
128344
128377
|
var import_node_fs32 = require("node:fs");
|
|
128345
128378
|
var import_node_path49 = __toESM(require("node:path"));
|
|
128346
128379
|
var import_node_url13 = require("node:url");
|
|
@@ -128405,7 +128438,7 @@ __name(getBundleType, "getBundleType");
|
|
|
128405
128438
|
|
|
128406
128439
|
// src/deployment-bundle/create-worker-upload-form.ts
|
|
128407
128440
|
init_import_meta_url();
|
|
128408
|
-
var
|
|
128441
|
+
var import_node_assert10 = __toESM(require("node:assert"));
|
|
128409
128442
|
var import_node_fs15 = require("node:fs");
|
|
128410
128443
|
var import_node_path23 = __toESM(require("node:path"));
|
|
128411
128444
|
var import_undici5 = __toESM(require_undici());
|
|
@@ -128661,7 +128694,7 @@ function createWorkerUploadForm(worker) {
|
|
|
128661
128694
|
const manifestModuleName = "__STATIC_CONTENT_MANIFEST";
|
|
128662
128695
|
const hasManifest = modules?.some(({ name }) => name === manifestModuleName);
|
|
128663
128696
|
if (hasManifest && main2.type === "esm") {
|
|
128664
|
-
(0,
|
|
128697
|
+
(0, import_node_assert10.default)(modules !== void 0);
|
|
128665
128698
|
const subDirs = new Set(
|
|
128666
128699
|
modules.map((module3) => import_node_path23.default.posix.dirname(module3.name))
|
|
128667
128700
|
);
|
|
@@ -133846,6 +133879,7 @@ var inputPrompt = /* @__PURE__ */ __name(async (promptConfig) => {
|
|
|
133846
133879
|
if (promptConfig.type === "select") {
|
|
133847
133880
|
prompt2 = new ED({
|
|
133848
133881
|
...promptConfig,
|
|
133882
|
+
options: promptConfig.options.filter((o2) => !o2.hidden),
|
|
133849
133883
|
initialValue: String(promptConfig.defaultValue),
|
|
133850
133884
|
render() {
|
|
133851
133885
|
return dispatchRender(this, prompt2);
|
|
@@ -134326,7 +134360,7 @@ __name(CancelablePromise, "CancelablePromise");
|
|
|
134326
134360
|
// src/cloudchamber/client/core/OpenAPI.ts
|
|
134327
134361
|
init_import_meta_url();
|
|
134328
134362
|
var OpenAPI = {
|
|
134329
|
-
BASE: "
|
|
134363
|
+
BASE: "",
|
|
134330
134364
|
VERSION: "1.0.0",
|
|
134331
134365
|
WITH_CREDENTIALS: false,
|
|
134332
134366
|
CREDENTIALS: "include",
|
|
@@ -134562,7 +134596,8 @@ var sendRequest = /* @__PURE__ */ __name(async (config, options25, url4, body, f
|
|
|
134562
134596
|
headers,
|
|
134563
134597
|
body: body ?? formData,
|
|
134564
134598
|
method: options25.method,
|
|
134565
|
-
signal: controller.signal
|
|
134599
|
+
signal: controller.signal,
|
|
134600
|
+
dispatcher: config.AGENT ?? void 0
|
|
134566
134601
|
};
|
|
134567
134602
|
if (config.WITH_CREDENTIALS) {
|
|
134568
134603
|
request3.credentials = config.CREDENTIALS;
|
|
@@ -135275,7 +135310,7 @@ async function promiseSpinner(promise, {
|
|
|
135275
135310
|
}
|
|
135276
135311
|
__name(promiseSpinner, "promiseSpinner");
|
|
135277
135312
|
async function fillOpenAPIConfiguration(config, json) {
|
|
135278
|
-
const headers = {};
|
|
135313
|
+
const headers = OpenAPI.HEADERS !== void 0 ? { ...OpenAPI.HEADERS } : {};
|
|
135279
135314
|
if (Object.keys(getConfigCache("wrangler-account.json")).length === 0) {
|
|
135280
135315
|
await wrap2((0, import_promises4.mkdir)("node_modules", {}));
|
|
135281
135316
|
purgeConfigCaches();
|
|
@@ -135323,16 +135358,22 @@ async function fillOpenAPIConfiguration(config, json) {
|
|
|
135323
135358
|
headers["Authorization"] = `Bearer ${val}`;
|
|
135324
135359
|
headers["User-Agent"] = `wrangler/${version}`;
|
|
135325
135360
|
OpenAPI.CREDENTIALS = "omit";
|
|
135326
|
-
|
|
135327
|
-
|
|
135328
|
-
|
|
135329
|
-
|
|
135361
|
+
if (OpenAPI.BASE.length === 0) {
|
|
135362
|
+
const [base, errApiURL] = await wrap2(getAPIUrl(config));
|
|
135363
|
+
if (errApiURL) {
|
|
135364
|
+
crash("getting the API url:" + errApiURL.message);
|
|
135365
|
+
}
|
|
135366
|
+
OpenAPI.BASE = base;
|
|
135330
135367
|
}
|
|
135331
|
-
OpenAPI.BASE = base;
|
|
135332
135368
|
OpenAPI.HEADERS = headers;
|
|
135333
135369
|
const [, err] = await wrap2(loadAccountSpinner({ json }));
|
|
135334
|
-
if (err)
|
|
135335
|
-
|
|
135370
|
+
if (err) {
|
|
135371
|
+
let message = err.message;
|
|
135372
|
+
if (json && err instanceof ApiError) {
|
|
135373
|
+
message = JSON.stringify(err);
|
|
135374
|
+
}
|
|
135375
|
+
crash("loading Cloudchamber account failed:" + message);
|
|
135376
|
+
}
|
|
135336
135377
|
}
|
|
135337
135378
|
__name(fillOpenAPIConfiguration, "fillOpenAPIConfiguration");
|
|
135338
135379
|
function interactWithUser(config) {
|
|
@@ -137086,7 +137127,17 @@ __name(handleModifyCommand, "handleModifyCommand");
|
|
|
137086
137127
|
var modifyImageQuestion = "Insert the image url you want to change your deployment to";
|
|
137087
137128
|
|
|
137088
137129
|
// src/cloudchamber/index.ts
|
|
137130
|
+
function internalCommands(args) {
|
|
137131
|
+
try {
|
|
137132
|
+
const cloudchamberInternalRequireEntry = require("./internal/index");
|
|
137133
|
+
return cloudchamberInternalRequireEntry.internalCommands(args);
|
|
137134
|
+
} catch {
|
|
137135
|
+
return args;
|
|
137136
|
+
}
|
|
137137
|
+
}
|
|
137138
|
+
__name(internalCommands, "internalCommands");
|
|
137089
137139
|
var cloudchamber = /* @__PURE__ */ __name((yargs, subHelp) => {
|
|
137140
|
+
yargs = internalCommands(yargs);
|
|
137090
137141
|
return yargs.command(
|
|
137091
137142
|
"delete [deploymentId]",
|
|
137092
137143
|
"Delete an existing deployment that is running in the Cloudflare edge",
|
|
@@ -138362,12 +138413,12 @@ function _createClass3(Constructor, protoProps, staticProps) {
|
|
|
138362
138413
|
}
|
|
138363
138414
|
__name(_createClass3, "_createClass");
|
|
138364
138415
|
var Cache = /* @__PURE__ */ function() {
|
|
138365
|
-
function
|
|
138366
|
-
_classCallCheck3(this,
|
|
138416
|
+
function Cache3() {
|
|
138417
|
+
_classCallCheck3(this, Cache3);
|
|
138367
138418
|
this.cache = {};
|
|
138368
138419
|
}
|
|
138369
|
-
__name(
|
|
138370
|
-
_createClass3(
|
|
138420
|
+
__name(Cache3, "Cache");
|
|
138421
|
+
_createClass3(Cache3, [{
|
|
138371
138422
|
key: "get",
|
|
138372
138423
|
value: /* @__PURE__ */ __name(function get() {
|
|
138373
138424
|
var cache2 = this.cache;
|
|
@@ -138402,7 +138453,7 @@ var Cache = /* @__PURE__ */ function() {
|
|
|
138402
138453
|
return cache2[lastKey] = value;
|
|
138403
138454
|
}, "put")
|
|
138404
138455
|
}]);
|
|
138405
|
-
return
|
|
138456
|
+
return Cache3;
|
|
138406
138457
|
}();
|
|
138407
138458
|
|
|
138408
138459
|
// ../../node_modules/.pnpm/javascript-time-ago@2.5.7/node_modules/javascript-time-ago/modules/locale.js
|
|
@@ -140793,7 +140844,7 @@ var Handler3 = withConfig(
|
|
|
140793
140844
|
|
|
140794
140845
|
// src/d1/execute.tsx
|
|
140795
140846
|
init_import_meta_url();
|
|
140796
|
-
var
|
|
140847
|
+
var import_node_assert11 = __toESM(require("node:assert"));
|
|
140797
140848
|
var import_node_path27 = __toESM(require("node:path"));
|
|
140798
140849
|
var import_chalk8 = __toESM(require_chalk());
|
|
140799
140850
|
var import_ink3 = __toESM(require_build2());
|
|
@@ -141131,7 +141182,7 @@ async function executeLocally({
|
|
|
141131
141182
|
} finally {
|
|
141132
141183
|
await mf.dispose();
|
|
141133
141184
|
}
|
|
141134
|
-
(0,
|
|
141185
|
+
(0, import_node_assert11.default)(Array.isArray(results));
|
|
141135
141186
|
return results.map((result) => ({
|
|
141136
141187
|
results: (result.results ?? []).map(
|
|
141137
141188
|
(row) => Object.fromEntries(
|
|
@@ -141360,7 +141411,7 @@ init_import_meta_url();
|
|
|
141360
141411
|
|
|
141361
141412
|
// src/d1/migrations/apply.tsx
|
|
141362
141413
|
init_import_meta_url();
|
|
141363
|
-
var
|
|
141414
|
+
var import_node_assert12 = __toESM(require("node:assert"));
|
|
141364
141415
|
var import_node_fs20 = __toESM(require("node:fs"));
|
|
141365
141416
|
var import_path7 = __toESM(require("path"));
|
|
141366
141417
|
var import_ink4 = __toESM(require_build2());
|
|
@@ -141586,7 +141637,7 @@ Your database may not be available to serve requests during the migration, conti
|
|
|
141586
141637
|
if (!ok)
|
|
141587
141638
|
return;
|
|
141588
141639
|
if (!(local || preview)) {
|
|
141589
|
-
(0,
|
|
141640
|
+
(0, import_node_assert12.default)(
|
|
141590
141641
|
databaseInfo,
|
|
141591
141642
|
"In non-local mode `databaseInfo` should be defined."
|
|
141592
141643
|
);
|
|
@@ -141792,7 +141843,7 @@ var getBookmarkIdFromTimestamp = /* @__PURE__ */ __name(async (accountId, databa
|
|
|
141792
141843
|
searchParams.append("timestamp", convertTimestampToISO(timestamp));
|
|
141793
141844
|
}
|
|
141794
141845
|
const bookmarkResult = await fetchResult(
|
|
141795
|
-
`/accounts/${accountId}/d1/database/${databaseId}/
|
|
141846
|
+
`/accounts/${accountId}/d1/database/${databaseId}/time_travel/bookmark?${searchParams.toString()}`,
|
|
141796
141847
|
{
|
|
141797
141848
|
headers: {
|
|
141798
141849
|
"Content-Type": "application/json"
|
|
@@ -141956,7 +142007,7 @@ In-flight queries and transactions will be cancelled.
|
|
|
141956
142007
|
);
|
|
141957
142008
|
var handleRestore = /* @__PURE__ */ __name(async (accountId, databaseId, searchParams) => {
|
|
141958
142009
|
return await fetchResult(
|
|
141959
|
-
`/accounts/${accountId}/d1/database/${databaseId}/
|
|
142010
|
+
`/accounts/${accountId}/d1/database/${databaseId}/time_travel/restore?${searchParams.toString()}`,
|
|
141960
142011
|
{
|
|
141961
142012
|
headers: {
|
|
141962
142013
|
"Content-Type": "application/json"
|
|
@@ -142714,7 +142765,7 @@ var import_chalk10 = __toESM(require_chalk());
|
|
|
142714
142765
|
|
|
142715
142766
|
// src/sites.ts
|
|
142716
142767
|
init_import_meta_url();
|
|
142717
|
-
var
|
|
142768
|
+
var import_node_assert13 = __toESM(require("node:assert"));
|
|
142718
142769
|
var import_promises7 = require("node:fs/promises");
|
|
142719
142770
|
var path35 = __toESM(require("node:path"));
|
|
142720
142771
|
var import_chalk9 = __toESM(require_chalk());
|
|
@@ -142845,7 +142896,7 @@ async function syncAssets(accountId, scriptName, siteAssets, preview, dryRun, ol
|
|
|
142845
142896
|
logger.log("(Note: doing a dry run, not uploading or deleting anything.)");
|
|
142846
142897
|
return { manifest: void 0, namespace: void 0 };
|
|
142847
142898
|
}
|
|
142848
|
-
(0,
|
|
142899
|
+
(0, import_node_assert13.default)(accountId, "Missing accountId");
|
|
142849
142900
|
const title = `__${scriptName}-workers_sites_assets${preview ? "_preview" : ""}`;
|
|
142850
142901
|
const { id: namespace } = await createKVNamespaceIfNotAlreadyExisting(
|
|
142851
142902
|
title,
|
|
@@ -143298,7 +143349,8 @@ async function deployHandler(args) {
|
|
|
143298
143349
|
args.siteInclude,
|
|
143299
143350
|
args.siteExclude
|
|
143300
143351
|
);
|
|
143301
|
-
|
|
143352
|
+
if (!args.dryRun)
|
|
143353
|
+
await standardPricingWarning(accountId, config);
|
|
143302
143354
|
await deploy({
|
|
143303
143355
|
config,
|
|
143304
143356
|
accountId,
|
|
@@ -143616,7 +143668,7 @@ init_import_meta_url();
|
|
|
143616
143668
|
|
|
143617
143669
|
// src/docs/helpers.ts
|
|
143618
143670
|
init_import_meta_url();
|
|
143619
|
-
var
|
|
143671
|
+
var import_node_assert14 = __toESM(require("node:assert"));
|
|
143620
143672
|
var import_undici10 = __toESM(require_undici());
|
|
143621
143673
|
async function runSearch(searchTerm) {
|
|
143622
143674
|
const id = "8MU1G3QO9P";
|
|
@@ -143627,8 +143679,8 @@ async function runSearch(searchTerm) {
|
|
|
143627
143679
|
hitsPerPage: "1",
|
|
143628
143680
|
getRankingInfo: "0"
|
|
143629
143681
|
});
|
|
143630
|
-
(0,
|
|
143631
|
-
(0,
|
|
143682
|
+
(0, import_node_assert14.default)(id, "Missing Algolia App ID");
|
|
143683
|
+
(0, import_node_assert14.default)(key, "Missing Algolia Key");
|
|
143632
143684
|
const searchResp = await (0, import_undici10.fetch)(
|
|
143633
143685
|
`https://${id}-dsn.algolia.net/1/indexes/${index}/query`,
|
|
143634
143686
|
{
|
|
@@ -147268,7 +147320,7 @@ function renderProgress(done, total) {
|
|
|
147268
147320
|
/* @__PURE__ */ import_react10.default.createElement(Progress, { done, total })
|
|
147269
147321
|
);
|
|
147270
147322
|
return {
|
|
147271
|
-
// eslint-disable-next-line no-shadow
|
|
147323
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
147272
147324
|
rerender(done2, total2) {
|
|
147273
147325
|
rerender(/* @__PURE__ */ import_react10.default.createElement(Progress, { done: done2, total: total2 }));
|
|
147274
147326
|
},
|
|
@@ -149407,7 +149459,7 @@ function pages(yargs) {
|
|
|
149407
149459
|
).command(
|
|
149408
149460
|
"functions",
|
|
149409
149461
|
false,
|
|
149410
|
-
(
|
|
149462
|
+
(args) => args.command(
|
|
149411
149463
|
"build [directory]",
|
|
149412
149464
|
"Compile a folder of Cloudflare Pages Functions into a single Worker",
|
|
149413
149465
|
Options6,
|
|
@@ -149421,7 +149473,7 @@ function pages(yargs) {
|
|
|
149421
149473
|
).command(
|
|
149422
149474
|
"project",
|
|
149423
149475
|
"\u26A1\uFE0F Interact with your Pages projects",
|
|
149424
|
-
(
|
|
149476
|
+
(args) => args.command(
|
|
149425
149477
|
"list",
|
|
149426
149478
|
"List your Cloudflare Pages projects",
|
|
149427
149479
|
ListOptions3,
|
|
@@ -149445,7 +149497,7 @@ function pages(yargs) {
|
|
|
149445
149497
|
).command(
|
|
149446
149498
|
"deployment",
|
|
149447
149499
|
"\u{1F680} Interact with the deployments of a project",
|
|
149448
|
-
(
|
|
149500
|
+
(args) => args.command(
|
|
149449
149501
|
"list",
|
|
149450
149502
|
"List deployments in your Cloudflare Pages project",
|
|
149451
149503
|
ListOptions4,
|
|
@@ -150563,6 +150615,209 @@ async function putR2Sippy(accountId, bucketName, config, jurisdiction) {
|
|
|
150563
150615
|
}
|
|
150564
150616
|
__name(putR2Sippy, "putR2Sippy");
|
|
150565
150617
|
|
|
150618
|
+
// src/r2/sippy.ts
|
|
150619
|
+
init_import_meta_url();
|
|
150620
|
+
var NO_SUCH_OBJECT_KEY = 10007;
|
|
150621
|
+
var SIPPY_PROVIDER_CHOICES = ["AWS", "GCS"];
|
|
150622
|
+
function EnableOptions(yargs) {
|
|
150623
|
+
return yargs.positional("name", {
|
|
150624
|
+
describe: "The name of the bucket",
|
|
150625
|
+
type: "string",
|
|
150626
|
+
demandOption: true
|
|
150627
|
+
}).option("jurisdiction", {
|
|
150628
|
+
describe: "The jurisdiction where the bucket exists",
|
|
150629
|
+
alias: "J",
|
|
150630
|
+
requiresArg: true,
|
|
150631
|
+
type: "string"
|
|
150632
|
+
}).option("provider", {
|
|
150633
|
+
choices: SIPPY_PROVIDER_CHOICES
|
|
150634
|
+
}).option("bucket", {
|
|
150635
|
+
description: "The name of the upstream bucket",
|
|
150636
|
+
string: true
|
|
150637
|
+
}).option("region", {
|
|
150638
|
+
description: "(AWS provider only) The region of the upstream bucket",
|
|
150639
|
+
string: true
|
|
150640
|
+
}).option("key-id", {
|
|
150641
|
+
description: "(AWS provider only) The secret access key id for the upstream bucket",
|
|
150642
|
+
string: true
|
|
150643
|
+
}).option("secret-access-key", {
|
|
150644
|
+
description: "(AWS provider only) The secret access key for the upstream bucket",
|
|
150645
|
+
string: true
|
|
150646
|
+
}).option("service-account-key-file", {
|
|
150647
|
+
description: "(GCS provider only) The path to your Google Cloud service account key JSON file",
|
|
150648
|
+
string: true
|
|
150649
|
+
}).option("client-email", {
|
|
150650
|
+
description: "(GCS provider only) The client email for your Google Cloud service account key",
|
|
150651
|
+
string: true
|
|
150652
|
+
}).option("private-key", {
|
|
150653
|
+
description: "(GCS provider only) The private key for your Google Cloud service account key",
|
|
150654
|
+
string: true
|
|
150655
|
+
}).option("r2-key-id", {
|
|
150656
|
+
description: "The secret access key id for this R2 bucket",
|
|
150657
|
+
string: true
|
|
150658
|
+
}).option("r2-secret-access-key", {
|
|
150659
|
+
description: "The secret access key for this R2 bucket",
|
|
150660
|
+
string: true
|
|
150661
|
+
});
|
|
150662
|
+
}
|
|
150663
|
+
__name(EnableOptions, "EnableOptions");
|
|
150664
|
+
async function EnableHandler(args) {
|
|
150665
|
+
const isInteractive3 = process.stdin.isTTY;
|
|
150666
|
+
const config = readConfig(args.config, args);
|
|
150667
|
+
const accountId = await requireAuth(config);
|
|
150668
|
+
if (isInteractive3) {
|
|
150669
|
+
args.provider ??= await prompt(
|
|
150670
|
+
"Enter the cloud storage provider of your bucket (AWS or GCS):"
|
|
150671
|
+
);
|
|
150672
|
+
if (!args.provider) {
|
|
150673
|
+
throw new UserError("Must specify a cloud storage provider.");
|
|
150674
|
+
}
|
|
150675
|
+
if (!SIPPY_PROVIDER_CHOICES.includes(args.provider)) {
|
|
150676
|
+
throw new UserError("Cloud storage provider must be: AWS or GCS");
|
|
150677
|
+
}
|
|
150678
|
+
args.bucket ??= await prompt(
|
|
150679
|
+
`Enter the name of your ${args.provider} bucket:`
|
|
150680
|
+
);
|
|
150681
|
+
if (!args.bucket) {
|
|
150682
|
+
throw new UserError(`Must specify ${args.provider} bucket name.`);
|
|
150683
|
+
}
|
|
150684
|
+
if (args.provider == "AWS") {
|
|
150685
|
+
args.region ??= await prompt(
|
|
150686
|
+
"Enter the AWS region where your S3 bucket is located (example: us-west-2):"
|
|
150687
|
+
);
|
|
150688
|
+
args.keyId ??= await prompt(
|
|
150689
|
+
"Enter your AWS Access Key ID (requires read and list access):"
|
|
150690
|
+
);
|
|
150691
|
+
if (!args.keyId) {
|
|
150692
|
+
throw new UserError("Must specify an AWS Access Key ID.");
|
|
150693
|
+
}
|
|
150694
|
+
args.secretAccessKey ??= await prompt(
|
|
150695
|
+
"Enter your AWS Secret Access Key:"
|
|
150696
|
+
);
|
|
150697
|
+
if (!args.secretAccessKey) {
|
|
150698
|
+
throw new UserError("Must specify an AWS Secret Access Key.");
|
|
150699
|
+
}
|
|
150700
|
+
} else if (args.provider == "GCS") {
|
|
150701
|
+
if (!(args.clientEmail && args.privateKey) && !args.serviceAccountKeyFile) {
|
|
150702
|
+
args.serviceAccountKeyFile = await prompt(
|
|
150703
|
+
"Enter the path to your Google Cloud service account key JSON file:"
|
|
150704
|
+
);
|
|
150705
|
+
if (!args.serviceAccountKeyFile) {
|
|
150706
|
+
throw new UserError(
|
|
150707
|
+
"Must specify the path to a service account key JSON file."
|
|
150708
|
+
);
|
|
150709
|
+
}
|
|
150710
|
+
}
|
|
150711
|
+
}
|
|
150712
|
+
args.r2KeyId ??= await prompt(
|
|
150713
|
+
"Enter your R2 Access Key ID (requires read and write access):"
|
|
150714
|
+
);
|
|
150715
|
+
if (!args.r2KeyId) {
|
|
150716
|
+
throw new UserError("Must specify an R2 Access Key ID.");
|
|
150717
|
+
}
|
|
150718
|
+
args.r2SecretAccessKey ??= await prompt("Enter your R2 Secret Access Key:");
|
|
150719
|
+
if (!args.r2SecretAccessKey) {
|
|
150720
|
+
throw new UserError("Must specify an R2 Secret Access Key.");
|
|
150721
|
+
}
|
|
150722
|
+
}
|
|
150723
|
+
let sippyConfig = {
|
|
150724
|
+
bucket: args.bucket ?? "",
|
|
150725
|
+
r2_key_id: args.r2KeyId ?? "",
|
|
150726
|
+
r2_access_key: args.r2SecretAccessKey ?? ""
|
|
150727
|
+
};
|
|
150728
|
+
if (args.provider == "AWS") {
|
|
150729
|
+
if (!(args.keyId && args.secretAccessKey)) {
|
|
150730
|
+
throw new UserError(
|
|
150731
|
+
`Error: must provide --key-id and --secret-access-key.`
|
|
150732
|
+
);
|
|
150733
|
+
}
|
|
150734
|
+
sippyConfig = {
|
|
150735
|
+
...sippyConfig,
|
|
150736
|
+
provider: "AWS",
|
|
150737
|
+
zone: args.region,
|
|
150738
|
+
key_id: args.keyId,
|
|
150739
|
+
access_key: args.secretAccessKey
|
|
150740
|
+
};
|
|
150741
|
+
} else if (args.provider == "GCS") {
|
|
150742
|
+
if (args.serviceAccountKeyFile) {
|
|
150743
|
+
const serviceAccount = JSON.parse(
|
|
150744
|
+
readFileSync5(args.serviceAccountKeyFile)
|
|
150745
|
+
);
|
|
150746
|
+
if ("client_email" in serviceAccount && "private_key" in serviceAccount) {
|
|
150747
|
+
args.clientEmail = serviceAccount["client_email"];
|
|
150748
|
+
args.privateKey = serviceAccount["private_key"];
|
|
150749
|
+
}
|
|
150750
|
+
}
|
|
150751
|
+
if (!(args.clientEmail && args.privateKey)) {
|
|
150752
|
+
throw new UserError(
|
|
150753
|
+
`Error: must provide --service-account-key-file or --client-email and --private-key.`
|
|
150754
|
+
);
|
|
150755
|
+
}
|
|
150756
|
+
args.privateKey = args.privateKey.replace(/\\n/g, "\n");
|
|
150757
|
+
sippyConfig = {
|
|
150758
|
+
...sippyConfig,
|
|
150759
|
+
provider: "GCS",
|
|
150760
|
+
client_email: args.clientEmail,
|
|
150761
|
+
private_key: args.privateKey
|
|
150762
|
+
};
|
|
150763
|
+
}
|
|
150764
|
+
await putR2Sippy(accountId, args.name, sippyConfig, args.jurisdiction);
|
|
150765
|
+
logger.log(`\u2728 Successfully enabled Sippy on the '${args.name}' bucket.`);
|
|
150766
|
+
}
|
|
150767
|
+
__name(EnableHandler, "EnableHandler");
|
|
150768
|
+
function GetOptions(yargs) {
|
|
150769
|
+
return yargs.positional("name", {
|
|
150770
|
+
describe: "The name of the bucket",
|
|
150771
|
+
type: "string",
|
|
150772
|
+
demandOption: true
|
|
150773
|
+
}).option("jurisdiction", {
|
|
150774
|
+
describe: "The jurisdiction where the bucket exists",
|
|
150775
|
+
alias: "J",
|
|
150776
|
+
requiresArg: true,
|
|
150777
|
+
type: "string"
|
|
150778
|
+
});
|
|
150779
|
+
}
|
|
150780
|
+
__name(GetOptions, "GetOptions");
|
|
150781
|
+
async function GetHandler(args) {
|
|
150782
|
+
const config = readConfig(args.config, args);
|
|
150783
|
+
const accountId = await requireAuth(config);
|
|
150784
|
+
try {
|
|
150785
|
+
const sippyBucket = await getR2Sippy(
|
|
150786
|
+
accountId,
|
|
150787
|
+
args.name,
|
|
150788
|
+
args.jurisdiction
|
|
150789
|
+
);
|
|
150790
|
+
logger.log(`Sippy upstream bucket: ${sippyBucket}.`);
|
|
150791
|
+
} catch (e3) {
|
|
150792
|
+
if (e3 instanceof APIError && "code" in e3 && e3.code == NO_SUCH_OBJECT_KEY) {
|
|
150793
|
+
logger.log(`No Sippy configuration found for the '${args.name}' bucket.`);
|
|
150794
|
+
} else {
|
|
150795
|
+
throw e3;
|
|
150796
|
+
}
|
|
150797
|
+
}
|
|
150798
|
+
}
|
|
150799
|
+
__name(GetHandler, "GetHandler");
|
|
150800
|
+
function DisableOptions(yargs) {
|
|
150801
|
+
return yargs.positional("name", {
|
|
150802
|
+
describe: "The name of the bucket",
|
|
150803
|
+
type: "string",
|
|
150804
|
+
demandOption: true
|
|
150805
|
+
}).option("jurisdiction", {
|
|
150806
|
+
describe: "The jurisdiction where the bucket exists",
|
|
150807
|
+
alias: "J",
|
|
150808
|
+
requiresArg: true,
|
|
150809
|
+
type: "string"
|
|
150810
|
+
});
|
|
150811
|
+
}
|
|
150812
|
+
__name(DisableOptions, "DisableOptions");
|
|
150813
|
+
async function DisableHandler(args) {
|
|
150814
|
+
const config = readConfig(args.config, args);
|
|
150815
|
+
const accountId = await requireAuth(config);
|
|
150816
|
+
await deleteR2Sippy(accountId, args.name, args.jurisdiction);
|
|
150817
|
+
logger.log(`\u2728 Successfully disabled Sippy on the '${args.name}' bucket.`);
|
|
150818
|
+
}
|
|
150819
|
+
__name(DisableHandler, "DisableHandler");
|
|
150820
|
+
|
|
150566
150821
|
// src/r2/index.ts
|
|
150567
150822
|
var CHUNK_SIZE = 1024;
|
|
150568
150823
|
async function createFileReadableStream(filePath) {
|
|
@@ -150987,103 +151242,18 @@ ${key} is ${prettyBytes(objectSize, {
|
|
|
150987
151242
|
return sippyYargs.command(
|
|
150988
151243
|
"enable <name>",
|
|
150989
151244
|
"Enable Sippy on an R2 bucket",
|
|
150990
|
-
|
|
150991
|
-
|
|
150992
|
-
type: "string",
|
|
150993
|
-
demandOption: true
|
|
150994
|
-
}).option("jurisdiction", {
|
|
150995
|
-
describe: "The jurisdiction where the bucket exists",
|
|
150996
|
-
alias: "J",
|
|
150997
|
-
requiresArg: true,
|
|
150998
|
-
type: "string"
|
|
150999
|
-
}).option("provider", {
|
|
151000
|
-
choices: ["AWS"],
|
|
151001
|
-
default: "AWS",
|
|
151002
|
-
implies: [
|
|
151003
|
-
"bucket",
|
|
151004
|
-
"key-id",
|
|
151005
|
-
"secret-access-key",
|
|
151006
|
-
"r2-key-id",
|
|
151007
|
-
"r2-secret-access-key"
|
|
151008
|
-
]
|
|
151009
|
-
}).option("bucket", {
|
|
151010
|
-
description: "The name of the upstream bucket",
|
|
151011
|
-
string: true
|
|
151012
|
-
}).option("region", {
|
|
151013
|
-
description: "The region of the upstream bucket",
|
|
151014
|
-
string: true
|
|
151015
|
-
}).option("key-id", {
|
|
151016
|
-
description: "The secret access key id for the upstream bucket",
|
|
151017
|
-
string: true
|
|
151018
|
-
}).option("secret-access-key", {
|
|
151019
|
-
description: "The secret access key for the upstream bucket",
|
|
151020
|
-
string: true
|
|
151021
|
-
}).option("r2-key-id", {
|
|
151022
|
-
description: "The secret access key id for this R2 bucket",
|
|
151023
|
-
string: true
|
|
151024
|
-
}).option("r2-secret-access-key", {
|
|
151025
|
-
description: "The secret access key for this R2 bucket",
|
|
151026
|
-
string: true
|
|
151027
|
-
}),
|
|
151028
|
-
async (args) => {
|
|
151029
|
-
const config = readConfig(args.config, args);
|
|
151030
|
-
const accountId = await requireAuth(config);
|
|
151031
|
-
await putR2Sippy(
|
|
151032
|
-
accountId,
|
|
151033
|
-
args.name,
|
|
151034
|
-
{
|
|
151035
|
-
provider: "AWS",
|
|
151036
|
-
zone: args["region"],
|
|
151037
|
-
bucket: args.bucket ?? "",
|
|
151038
|
-
key_id: args["key-id"] ?? "",
|
|
151039
|
-
access_key: args["secret-access-key"] ?? "",
|
|
151040
|
-
r2_key_id: args["r2-key-id"] ?? "",
|
|
151041
|
-
r2_access_key: args["r2-secret-access-key"] ?? ""
|
|
151042
|
-
},
|
|
151043
|
-
args.jurisdiction
|
|
151044
|
-
);
|
|
151045
|
-
}
|
|
151245
|
+
EnableOptions,
|
|
151246
|
+
EnableHandler
|
|
151046
151247
|
).command(
|
|
151047
151248
|
"disable <name>",
|
|
151048
151249
|
"Disable Sippy on an R2 bucket",
|
|
151049
|
-
|
|
151050
|
-
|
|
151051
|
-
type: "string",
|
|
151052
|
-
demandOption: true
|
|
151053
|
-
}).option("jurisdiction", {
|
|
151054
|
-
describe: "The jurisdiction where the bucket exists",
|
|
151055
|
-
alias: "J",
|
|
151056
|
-
requiresArg: true,
|
|
151057
|
-
type: "string"
|
|
151058
|
-
}),
|
|
151059
|
-
async (args) => {
|
|
151060
|
-
const config = readConfig(args.config, args);
|
|
151061
|
-
const accountId = await requireAuth(config);
|
|
151062
|
-
await deleteR2Sippy(accountId, args.name, args.jurisdiction);
|
|
151063
|
-
}
|
|
151250
|
+
DisableOptions,
|
|
151251
|
+
DisableHandler
|
|
151064
151252
|
).command(
|
|
151065
151253
|
"get <name>",
|
|
151066
151254
|
"Check the status of Sippy on an R2 bucket",
|
|
151067
|
-
|
|
151068
|
-
|
|
151069
|
-
type: "string",
|
|
151070
|
-
demandOption: true
|
|
151071
|
-
}).option("jurisdiction", {
|
|
151072
|
-
describe: "The jurisdiction where the bucket exists",
|
|
151073
|
-
alias: "J",
|
|
151074
|
-
requiresArg: true,
|
|
151075
|
-
type: "string"
|
|
151076
|
-
}),
|
|
151077
|
-
async (args) => {
|
|
151078
|
-
const config = readConfig(args.config, args);
|
|
151079
|
-
const accountId = await requireAuth(config);
|
|
151080
|
-
const sippyBucket = await getR2Sippy(
|
|
151081
|
-
accountId,
|
|
151082
|
-
args.name,
|
|
151083
|
-
args.jurisdiction
|
|
151084
|
-
);
|
|
151085
|
-
logger.log(`Sippy upstream bucket: ${sippyBucket}.`);
|
|
151086
|
-
}
|
|
151255
|
+
GetOptions,
|
|
151256
|
+
GetHandler
|
|
151087
151257
|
);
|
|
151088
151258
|
}
|
|
151089
151259
|
);
|
|
@@ -151397,7 +151567,7 @@ var secretBulkHandler = /* @__PURE__ */ __name(async (secretBulkArgs) => {
|
|
|
151397
151567
|
}
|
|
151398
151568
|
}
|
|
151399
151569
|
const inheritBindings = existingBindings.filter((binding) => {
|
|
151400
|
-
return binding.type !== "secret_text" ||
|
|
151570
|
+
return binding.type !== "secret_text" || content[binding.name] === void 0;
|
|
151401
151571
|
}).map((binding) => ({ type: binding.type, name: binding.name }));
|
|
151402
151572
|
const upsertBindings = Object.entries(
|
|
151403
151573
|
content
|
|
@@ -161357,10 +161527,10 @@ var import_node_url12 = require("node:url");
|
|
|
161357
161527
|
|
|
161358
161528
|
// src/durable.ts
|
|
161359
161529
|
init_import_meta_url();
|
|
161360
|
-
var
|
|
161530
|
+
var import_node_assert15 = __toESM(require("node:assert"));
|
|
161361
161531
|
async function getMigrationsToUpload(scriptName, props) {
|
|
161362
161532
|
const { config, accountId } = props;
|
|
161363
|
-
(0,
|
|
161533
|
+
(0, import_node_assert15.default)(accountId, "Missing accountId");
|
|
161364
161534
|
let migrations;
|
|
161365
161535
|
if (config.migrations.length > 0) {
|
|
161366
161536
|
let script;
|
|
@@ -164098,7 +164268,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
164098
164268
|
}
|
|
164099
164269
|
const compatibilityFlags = props.compatibilityFlags ?? config.compatibility_flags;
|
|
164100
164270
|
const nodejsCompat = compatibilityFlags.includes("nodejs_compat");
|
|
164101
|
-
(0,
|
|
164271
|
+
(0, import_node_assert16.default)(
|
|
164102
164272
|
!(legacyNodeCompat && nodejsCompat),
|
|
164103
164273
|
"The `nodejs_compat` compatibility flag cannot be used in conjunction with the legacy `--node-compat` flag. If you want to use the Workers runtime Node.js compatibility features, please remove the `--node-compat` argument from your CLI command or `node_compat = true` from your config file."
|
|
164104
164274
|
);
|
|
@@ -164113,11 +164283,11 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
164113
164283
|
);
|
|
164114
164284
|
}
|
|
164115
164285
|
const scriptName = props.name;
|
|
164116
|
-
(0,
|
|
164286
|
+
(0, import_node_assert16.default)(
|
|
164117
164287
|
scriptName,
|
|
164118
164288
|
'You need to provide a name when publishing a worker. Either pass it as a cli arg with `--name <name>` or in your config file as `name = "<name>"`'
|
|
164119
164289
|
);
|
|
164120
|
-
(0,
|
|
164290
|
+
(0, import_node_assert16.default)(
|
|
164121
164291
|
!config.site || config.site.bucket,
|
|
164122
164292
|
"A [site] definition requires a `bucket` field with a path to the site's assets directory."
|
|
164123
164293
|
);
|
|
@@ -164387,7 +164557,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
164387
164557
|
logger.log(`--dry-run: exiting now.`);
|
|
164388
164558
|
return;
|
|
164389
164559
|
}
|
|
164390
|
-
(0,
|
|
164560
|
+
(0, import_node_assert16.default)(accountId, "Missing accountId");
|
|
164391
164561
|
const uploadMs = Date.now() - start;
|
|
164392
164562
|
const deployments2 = [];
|
|
164393
164563
|
if (deployToWorkersDev) {
|
|
@@ -165685,7 +165855,7 @@ __name(ChooseAccount, "ChooseAccount");
|
|
|
165685
165855
|
|
|
165686
165856
|
// src/dev/use-esbuild.ts
|
|
165687
165857
|
init_import_meta_url();
|
|
165688
|
-
var
|
|
165858
|
+
var import_node_assert17 = __toESM(require("node:assert"));
|
|
165689
165859
|
var import_node_path51 = __toESM(require("node:path"));
|
|
165690
165860
|
var import_chokidar3 = require("chokidar");
|
|
165691
165861
|
var import_ink12 = __toESM(require_build2());
|
|
@@ -165741,7 +165911,7 @@ function useEsbuild({
|
|
|
165741
165911
|
async function updateBundle() {
|
|
165742
165912
|
const newAdditionalModules = await getAdditionalModules();
|
|
165743
165913
|
setBundle((previousBundle) => {
|
|
165744
|
-
(0,
|
|
165914
|
+
(0, import_node_assert17.default)(
|
|
165745
165915
|
previousBundle,
|
|
165746
165916
|
"Rebuild triggered with no previous build available"
|
|
165747
165917
|
);
|
|
@@ -166162,6 +166332,7 @@ function DevSession(props) {
|
|
|
166162
166332
|
queueConsumers: props.queueConsumers,
|
|
166163
166333
|
localProtocol: "http",
|
|
166164
166334
|
localUpstream: props.localUpstream,
|
|
166335
|
+
upstreamProtocol: props.upstreamProtocol,
|
|
166165
166336
|
inspect: props.inspect,
|
|
166166
166337
|
onReady: announceAndOnReady,
|
|
166167
166338
|
enablePagesAssetsServiceBinding: props.enablePagesAssetsServiceBinding,
|
|
@@ -166442,7 +166613,7 @@ async function startDevServer(props) {
|
|
|
166442
166613
|
port: props.inspectorPort
|
|
166443
166614
|
},
|
|
166444
166615
|
urlOverrides: {
|
|
166445
|
-
secure: props.
|
|
166616
|
+
secure: props.upstreamProtocol === "https",
|
|
166446
166617
|
hostname: props.localUpstream
|
|
166447
166618
|
},
|
|
166448
166619
|
liveReload: props.liveReload,
|
|
@@ -166508,6 +166679,7 @@ async function startDevServer(props) {
|
|
|
166508
166679
|
queueConsumers: props.queueConsumers,
|
|
166509
166680
|
localProtocol: props.localProtocol,
|
|
166510
166681
|
localUpstream: props.localUpstream,
|
|
166682
|
+
upstreamProtocol: props.upstreamProtocol,
|
|
166511
166683
|
inspect: true,
|
|
166512
166684
|
onReady: async (ip2, port2, proxyData) => {
|
|
166513
166685
|
const { proxyWorker } = await devEnv.proxy.ready.promise;
|
|
@@ -166704,7 +166876,7 @@ async function startLocalServer(props) {
|
|
|
166704
166876
|
pathname: `/core:user:${props.name ?? DEFAULT_WORKER_NAME}`
|
|
166705
166877
|
},
|
|
166706
166878
|
userWorkerInnerUrlOverrides: {
|
|
166707
|
-
protocol: props.
|
|
166879
|
+
protocol: props.upstreamProtocol,
|
|
166708
166880
|
hostname: props.localUpstream,
|
|
166709
166881
|
port: props.localUpstream ? "" : void 0
|
|
166710
166882
|
// `localUpstream` was essentially `host`, not `hostname`, so if it was set delete the `port`
|
|
@@ -167290,9 +167462,9 @@ async function validateDevServerSettings(args, config) {
|
|
|
167290
167462
|
);
|
|
167291
167463
|
}
|
|
167292
167464
|
const upstreamProtocol = args.upstreamProtocol ?? config.dev.upstream_protocol;
|
|
167293
|
-
if (upstreamProtocol === "http") {
|
|
167465
|
+
if (upstreamProtocol === "http" && args.remote) {
|
|
167294
167466
|
logger.warn(
|
|
167295
|
-
"Setting upstream-protocol to http is not currently
|
|
167467
|
+
"Setting upstream-protocol to http is not currently supported for remote mode.\nIf this is required in your project, please add your use case to the following issue:\nhttps://github.com/cloudflare/workers-sdk/issues/583."
|
|
167296
167468
|
);
|
|
167297
167469
|
}
|
|
167298
167470
|
const legacyNodeCompat = args.nodeCompat ?? config.node_compat;
|
|
@@ -167655,7 +167827,7 @@ init_import_meta_url();
|
|
|
167655
167827
|
|
|
167656
167828
|
// src/api/startDevWorker/DevEnv.ts
|
|
167657
167829
|
init_import_meta_url();
|
|
167658
|
-
var
|
|
167830
|
+
var import_node_assert20 = __toESM(require("node:assert"));
|
|
167659
167831
|
var import_node_events4 = require("node:events");
|
|
167660
167832
|
|
|
167661
167833
|
// src/api/startDevWorker/BundlerController.ts
|
|
@@ -167775,7 +167947,7 @@ __name(LocalRuntimeController, "LocalRuntimeController");
|
|
|
167775
167947
|
|
|
167776
167948
|
// src/api/startDevWorker/ProxyController.ts
|
|
167777
167949
|
init_import_meta_url();
|
|
167778
|
-
var
|
|
167950
|
+
var import_node_assert19 = __toESM(require("node:assert"));
|
|
167779
167951
|
var import_node_crypto6 = require("node:crypto");
|
|
167780
167952
|
var import_node_events3 = require("node:events");
|
|
167781
167953
|
var import_node_path55 = __toESM(require("node:path"));
|
|
@@ -167811,15 +167983,15 @@ __name(castErrorCause, "castErrorCause");
|
|
|
167811
167983
|
|
|
167812
167984
|
// src/api/startDevWorker/utils.ts
|
|
167813
167985
|
init_import_meta_url();
|
|
167814
|
-
var
|
|
167986
|
+
var import_node_assert18 = __toESM(require("node:assert"));
|
|
167815
167987
|
function createDeferred(previousDeferred) {
|
|
167816
167988
|
let resolve19, reject;
|
|
167817
167989
|
const newPromise = new Promise((_resolve, _reject) => {
|
|
167818
167990
|
resolve19 = _resolve;
|
|
167819
167991
|
reject = _reject;
|
|
167820
167992
|
});
|
|
167821
|
-
(0,
|
|
167822
|
-
(0,
|
|
167993
|
+
(0, import_node_assert18.default)(resolve19);
|
|
167994
|
+
(0, import_node_assert18.default)(reject);
|
|
167823
167995
|
previousDeferred?.resolve(newPromise);
|
|
167824
167996
|
return {
|
|
167825
167997
|
promise: newPromise,
|
|
@@ -167844,7 +168016,7 @@ var ProxyController = class extends import_node_events3.EventEmitter {
|
|
|
167844
168016
|
createProxyWorker() {
|
|
167845
168017
|
if (this._torndown)
|
|
167846
168018
|
return;
|
|
167847
|
-
(0,
|
|
168019
|
+
(0, import_node_assert19.default)(this.latestConfig !== void 0);
|
|
167848
168020
|
const cert = this.latestConfig.dev?.server?.secure || this.latestConfig.dev?.inspector?.secure ? getHttpsOptions() : void 0;
|
|
167849
168021
|
const proxyWorkerOptions = {
|
|
167850
168022
|
host: this.latestConfig.dev?.server?.hostname,
|
|
@@ -167954,7 +168126,7 @@ var ProxyController = class extends import_node_events3.EventEmitter {
|
|
|
167954
168126
|
this.inspectorProxyWorkerWebSocket = createDeferred();
|
|
167955
168127
|
let webSocket = null;
|
|
167956
168128
|
try {
|
|
167957
|
-
(0,
|
|
168129
|
+
(0, import_node_assert19.default)(this.proxyWorker);
|
|
167958
168130
|
const inspectorProxyWorker = await this.proxyWorker.getWorker(
|
|
167959
168131
|
"InspectorProxyWorker"
|
|
167960
168132
|
);
|
|
@@ -167972,12 +168144,12 @@ var ProxyController = class extends import_node_events3.EventEmitter {
|
|
|
167972
168144
|
this.emitErrorEvent("Could not connect to InspectorProxyWorker", error2);
|
|
167973
168145
|
return;
|
|
167974
168146
|
}
|
|
167975
|
-
(0,
|
|
168147
|
+
(0, import_node_assert19.default)(
|
|
167976
168148
|
webSocket,
|
|
167977
168149
|
"Expected webSocket on response from inspectorProxyWorker"
|
|
167978
168150
|
);
|
|
167979
168151
|
webSocket.addEventListener("message", (event) => {
|
|
167980
|
-
(0,
|
|
168152
|
+
(0, import_node_assert19.default)(typeof event.data === "string");
|
|
167981
168153
|
this.onInspectorProxyWorkerMessage(JSON.parse(event.data));
|
|
167982
168154
|
});
|
|
167983
168155
|
webSocket.addEventListener("close", () => {
|
|
@@ -167997,7 +168169,7 @@ var ProxyController = class extends import_node_events3.EventEmitter {
|
|
|
167997
168169
|
return;
|
|
167998
168170
|
try {
|
|
167999
168171
|
await this.runtimeMessageMutex.runWith(async () => {
|
|
168000
|
-
(0,
|
|
168172
|
+
(0, import_node_assert19.default)(this.proxyWorker, "proxyWorker should already be instantiated");
|
|
168001
168173
|
const ready = await this.proxyWorker.ready.catch(() => void 0);
|
|
168002
168174
|
if (!ready)
|
|
168003
168175
|
return;
|
|
@@ -168028,7 +168200,7 @@ var ProxyController = class extends import_node_events3.EventEmitter {
|
|
|
168028
168200
|
return;
|
|
168029
168201
|
try {
|
|
168030
168202
|
const websocket = await this.reconnectInspectorProxyWorker();
|
|
168031
|
-
(0,
|
|
168203
|
+
(0, import_node_assert19.default)(websocket);
|
|
168032
168204
|
websocket.send(JSON.stringify(message));
|
|
168033
168205
|
} catch (cause) {
|
|
168034
168206
|
if (this._torndown)
|
|
@@ -168127,8 +168299,8 @@ var ProxyController = class extends import_node_events3.EventEmitter {
|
|
|
168127
168299
|
logger.debug("[InspectorProxyWorker]", ...message.args);
|
|
168128
168300
|
break;
|
|
168129
168301
|
case "load-network-resource": {
|
|
168130
|
-
(0,
|
|
168131
|
-
(0,
|
|
168302
|
+
(0, import_node_assert19.default)(this.latestConfig !== void 0);
|
|
168303
|
+
(0, import_node_assert19.default)(this.latestBundle !== void 0);
|
|
168132
168304
|
let maybeContents;
|
|
168133
168305
|
if (message.url.startsWith("wrangler-file:")) {
|
|
168134
168306
|
maybeContents = maybeHandleNetworkLoadResource(
|
|
@@ -168319,7 +168491,7 @@ var DevEnv = class extends import_node_events4.EventEmitter {
|
|
|
168319
168491
|
}
|
|
168320
168492
|
emitErrorEvent(ev) {
|
|
168321
168493
|
if (ev.source === "ProxyController" && ev.reason === "Failed to start ProxyWorker or InspectorProxyWorker") {
|
|
168322
|
-
(0,
|
|
168494
|
+
(0, import_node_assert20.default)(ev.data.config);
|
|
168323
168495
|
const { config } = ev.data;
|
|
168324
168496
|
const port2 = config.dev?.server?.port;
|
|
168325
168497
|
const inspectorPort = config.dev?.inspector?.port;
|
|
@@ -168389,6 +168561,29 @@ init_import_meta_url();
|
|
|
168389
168561
|
init_import_meta_url();
|
|
168390
168562
|
var import_miniflare18 = require("miniflare");
|
|
168391
168563
|
|
|
168564
|
+
// src/api/integrations/bindings/caches.ts
|
|
168565
|
+
init_import_meta_url();
|
|
168566
|
+
var CacheStorage = class {
|
|
168567
|
+
async open(cacheName) {
|
|
168568
|
+
return new Cache2();
|
|
168569
|
+
}
|
|
168570
|
+
get default() {
|
|
168571
|
+
return new Cache2();
|
|
168572
|
+
}
|
|
168573
|
+
};
|
|
168574
|
+
__name(CacheStorage, "CacheStorage");
|
|
168575
|
+
var Cache2 = class {
|
|
168576
|
+
async delete(request3, options25) {
|
|
168577
|
+
return false;
|
|
168578
|
+
}
|
|
168579
|
+
async match(request3, options25) {
|
|
168580
|
+
return void 0;
|
|
168581
|
+
}
|
|
168582
|
+
async put(request3, response) {
|
|
168583
|
+
}
|
|
168584
|
+
};
|
|
168585
|
+
__name(Cache2, "Cache");
|
|
168586
|
+
|
|
168392
168587
|
// src/api/integrations/bindings/services.ts
|
|
168393
168588
|
init_import_meta_url();
|
|
168394
168589
|
var import_miniflare17 = require("miniflare");
|
|
@@ -168482,6 +168677,7 @@ async function getBindingsProxy(options25 = {}) {
|
|
|
168482
168677
|
...vars,
|
|
168483
168678
|
...bindings
|
|
168484
168679
|
},
|
|
168680
|
+
caches: new CacheStorage(),
|
|
168485
168681
|
dispose: () => mf.dispose()
|
|
168486
168682
|
};
|
|
168487
168683
|
}
|
|
@@ -168507,7 +168703,10 @@ async function getMiniflareOptionsFromConfig(rawConfig, env5, options25) {
|
|
|
168507
168703
|
script: "",
|
|
168508
168704
|
modules: true,
|
|
168509
168705
|
...bindingOptions,
|
|
168510
|
-
serviceBindings
|
|
168706
|
+
serviceBindings: {
|
|
168707
|
+
...serviceBindings,
|
|
168708
|
+
...bindingOptions.serviceBindings
|
|
168709
|
+
}
|
|
168511
168710
|
},
|
|
168512
168711
|
externalDurableObjectWorker
|
|
168513
168712
|
],
|