wrangler 2.16.0 → 2.18.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/miniflare-dist/index.mjs +53 -27
- package/package.json +1 -1
- package/src/__tests__/index.test.ts +2 -2
- package/src/__tests__/mtls-certificates.test.ts +1 -1
- package/src/__tests__/publish.test.ts +610 -184
- package/src/__tests__/tsconfig.tsbuildinfo +1 -1
- package/src/docs/helpers.ts +50 -0
- package/src/docs/index.ts +25 -68
- package/src/index.ts +1 -1
- package/src/kv/helpers.ts +7 -4
- package/src/miniflare-cli/tsconfig.tsbuildinfo +1 -1
- package/src/pages/functions/tsconfig.tsbuildinfo +1 -1
- package/src/sites.ts +164 -52
- package/wrangler-dist/cli.js +485 -372
package/wrangler-dist/cli.js
CHANGED
|
@@ -327,7 +327,7 @@ var require_util = __commonJS({
|
|
|
327
327
|
"../../node_modules/undici/lib/core/util.js"(exports2, module2) {
|
|
328
328
|
"use strict";
|
|
329
329
|
init_import_meta_url();
|
|
330
|
-
var
|
|
330
|
+
var assert15 = require("assert");
|
|
331
331
|
var { kDestroyed, kBodyUsed } = require_symbols();
|
|
332
332
|
var { IncomingMessage } = require("http");
|
|
333
333
|
var stream2 = require("stream");
|
|
@@ -410,7 +410,7 @@ var require_util = __commonJS({
|
|
|
410
410
|
function getHostname(host) {
|
|
411
411
|
if (host[0] === "[") {
|
|
412
412
|
const idx2 = host.indexOf("]");
|
|
413
|
-
|
|
413
|
+
assert15(idx2 !== -1);
|
|
414
414
|
return host.substr(1, idx2 - 1);
|
|
415
415
|
}
|
|
416
416
|
const idx = host.indexOf(":");
|
|
@@ -423,7 +423,7 @@ var require_util = __commonJS({
|
|
|
423
423
|
if (!host) {
|
|
424
424
|
return null;
|
|
425
425
|
}
|
|
426
|
-
|
|
426
|
+
assert15.strictEqual(typeof host, "string");
|
|
427
427
|
const servername = getHostname(host);
|
|
428
428
|
if (net3.isIP(servername)) {
|
|
429
429
|
return "";
|
|
@@ -4691,7 +4691,7 @@ var require_util2 = __commonJS({
|
|
|
4691
4691
|
var { redirectStatus, badPorts, referrerPolicy: referrerPolicyTokens } = require_constants();
|
|
4692
4692
|
var { performance: performance2 } = require("perf_hooks");
|
|
4693
4693
|
var { isBlobLike, toUSVString, ReadableStreamFrom } = require_util();
|
|
4694
|
-
var
|
|
4694
|
+
var assert15 = require("assert");
|
|
4695
4695
|
var { isUint8Array } = require("util/types");
|
|
4696
4696
|
var crypto5;
|
|
4697
4697
|
try {
|
|
@@ -5042,7 +5042,7 @@ var require_util2 = __commonJS({
|
|
|
5042
5042
|
if (result === void 0) {
|
|
5043
5043
|
throw new TypeError("Value is not JSON serializable");
|
|
5044
5044
|
}
|
|
5045
|
-
|
|
5045
|
+
assert15(typeof result === "string");
|
|
5046
5046
|
return result;
|
|
5047
5047
|
}
|
|
5048
5048
|
__name(serializeJavascriptValueToJSONString, "serializeJavascriptValueToJSONString");
|
|
@@ -5136,7 +5136,7 @@ var require_util2 = __commonJS({
|
|
|
5136
5136
|
__name(readableStreamClose, "readableStreamClose");
|
|
5137
5137
|
function isomorphicEncode(input) {
|
|
5138
5138
|
for (let i = 0; i < input.length; i++) {
|
|
5139
|
-
|
|
5139
|
+
assert15(input.charCodeAt(i) <= 255);
|
|
5140
5140
|
}
|
|
5141
5141
|
return input;
|
|
5142
5142
|
}
|
|
@@ -5597,7 +5597,7 @@ var require_webidl = __commonJS({
|
|
|
5597
5597
|
var require_dataURL = __commonJS({
|
|
5598
5598
|
"../../node_modules/undici/lib/fetch/dataURL.js"(exports2, module2) {
|
|
5599
5599
|
init_import_meta_url();
|
|
5600
|
-
var
|
|
5600
|
+
var assert15 = require("assert");
|
|
5601
5601
|
var { atob: atob2 } = require("buffer");
|
|
5602
5602
|
var { format: format8 } = require("url");
|
|
5603
5603
|
var { isValidHTTPToken, isomorphicDecode } = require_util2();
|
|
@@ -5606,7 +5606,7 @@ var require_dataURL = __commonJS({
|
|
|
5606
5606
|
var HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/;
|
|
5607
5607
|
var HTTP_QUOTED_STRING_TOKENS = /^(\u0009|\x{0020}-\x{007E}|\x{0080}-\x{00FF})+$/;
|
|
5608
5608
|
function dataURLProcessor(dataURL) {
|
|
5609
|
-
|
|
5609
|
+
assert15(dataURL.protocol === "data:");
|
|
5610
5610
|
let input = URLSerializer(dataURL, true);
|
|
5611
5611
|
input = input.slice(5);
|
|
5612
5612
|
const position = { position: 0 };
|
|
@@ -5790,7 +5790,7 @@ var require_dataURL = __commonJS({
|
|
|
5790
5790
|
function collectAnHTTPQuotedString(input, position, extractValue) {
|
|
5791
5791
|
const positionStart = position.position;
|
|
5792
5792
|
let value = "";
|
|
5793
|
-
|
|
5793
|
+
assert15(input[position.position] === '"');
|
|
5794
5794
|
position.position++;
|
|
5795
5795
|
while (true) {
|
|
5796
5796
|
value += collectASequenceOfCodePoints(
|
|
@@ -5811,7 +5811,7 @@ var require_dataURL = __commonJS({
|
|
|
5811
5811
|
value += input[position.position];
|
|
5812
5812
|
position.position++;
|
|
5813
5813
|
} else {
|
|
5814
|
-
|
|
5814
|
+
assert15(quoteOrBackslash === '"');
|
|
5815
5815
|
break;
|
|
5816
5816
|
}
|
|
5817
5817
|
}
|
|
@@ -5822,7 +5822,7 @@ var require_dataURL = __commonJS({
|
|
|
5822
5822
|
}
|
|
5823
5823
|
__name(collectAnHTTPQuotedString, "collectAnHTTPQuotedString");
|
|
5824
5824
|
function serializeAMimeType(mimeType) {
|
|
5825
|
-
|
|
5825
|
+
assert15(mimeType !== "failure");
|
|
5826
5826
|
const { type, subtype, parameters } = mimeType;
|
|
5827
5827
|
let serialization = `${type}/${subtype}`;
|
|
5828
5828
|
for (let [name, value] of parameters.entries()) {
|
|
@@ -6225,7 +6225,7 @@ var require_body = __commonJS({
|
|
|
6225
6225
|
var { DOMException, structuredClone } = require_constants();
|
|
6226
6226
|
var { Blob: Blob3, File: NativeFile } = require("buffer");
|
|
6227
6227
|
var { kBodyUsed } = require_symbols();
|
|
6228
|
-
var
|
|
6228
|
+
var assert15 = require("assert");
|
|
6229
6229
|
var { isErrored } = require_util();
|
|
6230
6230
|
var { isUint8Array, isArrayBuffer } = require("util/types");
|
|
6231
6231
|
var { File: UndiciFile } = require_file();
|
|
@@ -6254,7 +6254,7 @@ var require_body = __commonJS({
|
|
|
6254
6254
|
type: void 0
|
|
6255
6255
|
});
|
|
6256
6256
|
}
|
|
6257
|
-
|
|
6257
|
+
assert15(isReadableStreamLike(stream2));
|
|
6258
6258
|
let action = null;
|
|
6259
6259
|
let source = null;
|
|
6260
6260
|
let length = null;
|
|
@@ -6364,8 +6364,8 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
|
6364
6364
|
ReadableStream = require("stream/web").ReadableStream;
|
|
6365
6365
|
}
|
|
6366
6366
|
if (object instanceof ReadableStream) {
|
|
6367
|
-
|
|
6368
|
-
|
|
6367
|
+
assert15(!util3.isDisturbed(object), "The body has already been consumed.");
|
|
6368
|
+
assert15(!object.locked, "The stream is locked.");
|
|
6369
6369
|
}
|
|
6370
6370
|
return extractBody(object, keepalive);
|
|
6371
6371
|
}
|
|
@@ -6592,7 +6592,7 @@ var require_request = __commonJS({
|
|
|
6592
6592
|
InvalidArgumentError,
|
|
6593
6593
|
NotSupportedError
|
|
6594
6594
|
} = require_errors();
|
|
6595
|
-
var
|
|
6595
|
+
var assert15 = require("assert");
|
|
6596
6596
|
var util3 = require_util();
|
|
6597
6597
|
var tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/;
|
|
6598
6598
|
var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
|
|
@@ -6743,30 +6743,30 @@ var require_request = __commonJS({
|
|
|
6743
6743
|
}
|
|
6744
6744
|
}
|
|
6745
6745
|
onConnect(abort) {
|
|
6746
|
-
|
|
6747
|
-
|
|
6746
|
+
assert15(!this.aborted);
|
|
6747
|
+
assert15(!this.completed);
|
|
6748
6748
|
return this[kHandler].onConnect(abort);
|
|
6749
6749
|
}
|
|
6750
6750
|
onHeaders(statusCode, headers, resume, statusText) {
|
|
6751
|
-
|
|
6752
|
-
|
|
6751
|
+
assert15(!this.aborted);
|
|
6752
|
+
assert15(!this.completed);
|
|
6753
6753
|
if (channels.headers.hasSubscribers) {
|
|
6754
6754
|
channels.headers.publish({ request: this, response: { statusCode, headers, statusText } });
|
|
6755
6755
|
}
|
|
6756
6756
|
return this[kHandler].onHeaders(statusCode, headers, resume, statusText);
|
|
6757
6757
|
}
|
|
6758
6758
|
onData(chunk) {
|
|
6759
|
-
|
|
6760
|
-
|
|
6759
|
+
assert15(!this.aborted);
|
|
6760
|
+
assert15(!this.completed);
|
|
6761
6761
|
return this[kHandler].onData(chunk);
|
|
6762
6762
|
}
|
|
6763
6763
|
onUpgrade(statusCode, headers, socket) {
|
|
6764
|
-
|
|
6765
|
-
|
|
6764
|
+
assert15(!this.aborted);
|
|
6765
|
+
assert15(!this.completed);
|
|
6766
6766
|
return this[kHandler].onUpgrade(statusCode, headers, socket);
|
|
6767
6767
|
}
|
|
6768
6768
|
onComplete(trailers) {
|
|
6769
|
-
|
|
6769
|
+
assert15(!this.aborted);
|
|
6770
6770
|
this.completed = true;
|
|
6771
6771
|
if (channels.trailers.hasSubscribers) {
|
|
6772
6772
|
channels.trailers.publish({ request: this, trailers });
|
|
@@ -7041,7 +7041,7 @@ var require_connect = __commonJS({
|
|
|
7041
7041
|
"use strict";
|
|
7042
7042
|
init_import_meta_url();
|
|
7043
7043
|
var net3 = require("net");
|
|
7044
|
-
var
|
|
7044
|
+
var assert15 = require("assert");
|
|
7045
7045
|
var util3 = require_util();
|
|
7046
7046
|
var { InvalidArgumentError, ConnectTimeoutError } = require_errors();
|
|
7047
7047
|
var tls;
|
|
@@ -7110,7 +7110,7 @@ var require_connect = __commonJS({
|
|
|
7110
7110
|
servername = servername || options6.servername || util3.getServerName(host) || null;
|
|
7111
7111
|
const sessionKey = servername || hostname;
|
|
7112
7112
|
const session = sessionCache.get(sessionKey) || null;
|
|
7113
|
-
|
|
7113
|
+
assert15(sessionKey);
|
|
7114
7114
|
socket = tls.connect({
|
|
7115
7115
|
highWaterMark: 16384,
|
|
7116
7116
|
...options6,
|
|
@@ -7125,7 +7125,7 @@ var require_connect = __commonJS({
|
|
|
7125
7125
|
sessionCache.set(sessionKey, session2);
|
|
7126
7126
|
});
|
|
7127
7127
|
} else {
|
|
7128
|
-
|
|
7128
|
+
assert15(!httpSocket, "httpSocket can only be sent on TLS update");
|
|
7129
7129
|
socket = net3.connect({
|
|
7130
7130
|
highWaterMark: 64 * 1024,
|
|
7131
7131
|
...options6,
|
|
@@ -7538,7 +7538,7 @@ var require_RedirectHandler = __commonJS({
|
|
|
7538
7538
|
init_import_meta_url();
|
|
7539
7539
|
var util3 = require_util();
|
|
7540
7540
|
var { kBodyUsed } = require_symbols();
|
|
7541
|
-
var
|
|
7541
|
+
var assert15 = require("assert");
|
|
7542
7542
|
var { InvalidArgumentError } = require_errors();
|
|
7543
7543
|
var EE = require("events");
|
|
7544
7544
|
var redirectableStatusCodes = [300, 301, 302, 303, 307, 308];
|
|
@@ -7549,7 +7549,7 @@ var require_RedirectHandler = __commonJS({
|
|
|
7549
7549
|
this[kBodyUsed] = false;
|
|
7550
7550
|
}
|
|
7551
7551
|
async *[Symbol.asyncIterator]() {
|
|
7552
|
-
|
|
7552
|
+
assert15(!this[kBodyUsed], "disturbed");
|
|
7553
7553
|
this[kBodyUsed] = true;
|
|
7554
7554
|
yield* this[kBody];
|
|
7555
7555
|
}
|
|
@@ -7571,7 +7571,7 @@ var require_RedirectHandler = __commonJS({
|
|
|
7571
7571
|
if (util3.isStream(this.opts.body)) {
|
|
7572
7572
|
if (util3.bodyLength(this.opts.body) === 0) {
|
|
7573
7573
|
this.opts.body.on("data", function() {
|
|
7574
|
-
|
|
7574
|
+
assert15(false);
|
|
7575
7575
|
});
|
|
7576
7576
|
}
|
|
7577
7577
|
if (typeof this.opts.body.readableDidRead !== "boolean") {
|
|
@@ -7668,7 +7668,7 @@ var require_RedirectHandler = __commonJS({
|
|
|
7668
7668
|
}
|
|
7669
7669
|
}
|
|
7670
7670
|
} else {
|
|
7671
|
-
|
|
7671
|
+
assert15(headers == null, "headers must be an object or an array");
|
|
7672
7672
|
}
|
|
7673
7673
|
return ret;
|
|
7674
7674
|
}
|
|
@@ -7722,7 +7722,7 @@ var require_client = __commonJS({
|
|
|
7722
7722
|
"../../node_modules/undici/lib/client.js"(exports2, module2) {
|
|
7723
7723
|
"use strict";
|
|
7724
7724
|
init_import_meta_url();
|
|
7725
|
-
var
|
|
7725
|
+
var assert15 = require("assert");
|
|
7726
7726
|
var net3 = require("net");
|
|
7727
7727
|
var util3 = require_util();
|
|
7728
7728
|
var timers = require_timers();
|
|
@@ -8017,35 +8017,35 @@ var require_client = __commonJS({
|
|
|
8017
8017
|
return 0;
|
|
8018
8018
|
},
|
|
8019
8019
|
wasm_on_status: (p, at, len) => {
|
|
8020
|
-
|
|
8020
|
+
assert15.strictEqual(currentParser.ptr, p);
|
|
8021
8021
|
const start = at - currentBufferPtr + currentBufferRef.byteOffset;
|
|
8022
8022
|
return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0;
|
|
8023
8023
|
},
|
|
8024
8024
|
wasm_on_message_begin: (p) => {
|
|
8025
|
-
|
|
8025
|
+
assert15.strictEqual(currentParser.ptr, p);
|
|
8026
8026
|
return currentParser.onMessageBegin() || 0;
|
|
8027
8027
|
},
|
|
8028
8028
|
wasm_on_header_field: (p, at, len) => {
|
|
8029
|
-
|
|
8029
|
+
assert15.strictEqual(currentParser.ptr, p);
|
|
8030
8030
|
const start = at - currentBufferPtr + currentBufferRef.byteOffset;
|
|
8031
8031
|
return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0;
|
|
8032
8032
|
},
|
|
8033
8033
|
wasm_on_header_value: (p, at, len) => {
|
|
8034
|
-
|
|
8034
|
+
assert15.strictEqual(currentParser.ptr, p);
|
|
8035
8035
|
const start = at - currentBufferPtr + currentBufferRef.byteOffset;
|
|
8036
8036
|
return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0;
|
|
8037
8037
|
},
|
|
8038
8038
|
wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {
|
|
8039
|
-
|
|
8039
|
+
assert15.strictEqual(currentParser.ptr, p);
|
|
8040
8040
|
return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0;
|
|
8041
8041
|
},
|
|
8042
8042
|
wasm_on_body: (p, at, len) => {
|
|
8043
|
-
|
|
8043
|
+
assert15.strictEqual(currentParser.ptr, p);
|
|
8044
8044
|
const start = at - currentBufferPtr + currentBufferRef.byteOffset;
|
|
8045
8045
|
return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0;
|
|
8046
8046
|
},
|
|
8047
8047
|
wasm_on_message_complete: (p) => {
|
|
8048
|
-
|
|
8048
|
+
assert15.strictEqual(currentParser.ptr, p);
|
|
8049
8049
|
return currentParser.onMessageComplete() || 0;
|
|
8050
8050
|
}
|
|
8051
8051
|
}
|
|
@@ -8064,7 +8064,7 @@ var require_client = __commonJS({
|
|
|
8064
8064
|
var TIMEOUT_IDLE = 3;
|
|
8065
8065
|
var Parser2 = class {
|
|
8066
8066
|
constructor(client, socket, { exports: exports3 }) {
|
|
8067
|
-
|
|
8067
|
+
assert15(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0);
|
|
8068
8068
|
this.llhttp = exports3;
|
|
8069
8069
|
this.ptr = this.llhttp.llhttp_alloc(constants3.TYPE.RESPONSE);
|
|
8070
8070
|
this.client = client;
|
|
@@ -8110,10 +8110,10 @@ var require_client = __commonJS({
|
|
|
8110
8110
|
if (this.socket.destroyed || !this.paused) {
|
|
8111
8111
|
return;
|
|
8112
8112
|
}
|
|
8113
|
-
|
|
8114
|
-
|
|
8113
|
+
assert15(this.ptr != null);
|
|
8114
|
+
assert15(currentParser == null);
|
|
8115
8115
|
this.llhttp.llhttp_resume(this.ptr);
|
|
8116
|
-
|
|
8116
|
+
assert15(this.timeoutType === TIMEOUT_BODY);
|
|
8117
8117
|
if (this.timeout) {
|
|
8118
8118
|
if (this.timeout.refresh) {
|
|
8119
8119
|
this.timeout.refresh();
|
|
@@ -8133,9 +8133,9 @@ var require_client = __commonJS({
|
|
|
8133
8133
|
}
|
|
8134
8134
|
}
|
|
8135
8135
|
execute(data) {
|
|
8136
|
-
|
|
8137
|
-
|
|
8138
|
-
|
|
8136
|
+
assert15(this.ptr != null);
|
|
8137
|
+
assert15(currentParser == null);
|
|
8138
|
+
assert15(!this.paused);
|
|
8139
8139
|
const { socket, llhttp } = this;
|
|
8140
8140
|
if (data.length > currentBufferSize) {
|
|
8141
8141
|
if (currentBufferPtr) {
|
|
@@ -8177,8 +8177,8 @@ var require_client = __commonJS({
|
|
|
8177
8177
|
}
|
|
8178
8178
|
}
|
|
8179
8179
|
destroy() {
|
|
8180
|
-
|
|
8181
|
-
|
|
8180
|
+
assert15(this.ptr != null);
|
|
8181
|
+
assert15(currentParser == null);
|
|
8182
8182
|
this.llhttp.llhttp_free(this.ptr);
|
|
8183
8183
|
this.ptr = null;
|
|
8184
8184
|
timers.clearTimeout(this.timeout);
|
|
@@ -8235,17 +8235,17 @@ var require_client = __commonJS({
|
|
|
8235
8235
|
}
|
|
8236
8236
|
onUpgrade(head) {
|
|
8237
8237
|
const { upgrade, client, socket, headers, statusCode } = this;
|
|
8238
|
-
|
|
8238
|
+
assert15(upgrade);
|
|
8239
8239
|
const request = client[kQueue][client[kRunningIdx]];
|
|
8240
|
-
|
|
8241
|
-
|
|
8242
|
-
|
|
8243
|
-
|
|
8244
|
-
|
|
8240
|
+
assert15(request);
|
|
8241
|
+
assert15(!socket.destroyed);
|
|
8242
|
+
assert15(socket === client[kSocket]);
|
|
8243
|
+
assert15(!this.paused);
|
|
8244
|
+
assert15(request.upgrade || request.method === "CONNECT");
|
|
8245
8245
|
this.statusCode = null;
|
|
8246
8246
|
this.statusText = "";
|
|
8247
8247
|
this.shouldKeepAlive = null;
|
|
8248
|
-
|
|
8248
|
+
assert15(this.headers.length % 2 === 0);
|
|
8249
8249
|
this.headers = [];
|
|
8250
8250
|
this.headersSize = 0;
|
|
8251
8251
|
socket.unshift(head);
|
|
@@ -8273,8 +8273,8 @@ var require_client = __commonJS({
|
|
|
8273
8273
|
if (!request) {
|
|
8274
8274
|
return -1;
|
|
8275
8275
|
}
|
|
8276
|
-
|
|
8277
|
-
|
|
8276
|
+
assert15(!this.upgrade);
|
|
8277
|
+
assert15(this.statusCode < 200);
|
|
8278
8278
|
if (statusCode === 100) {
|
|
8279
8279
|
util3.destroy(socket, new SocketError("bad response", util3.getSocketInfo(socket)));
|
|
8280
8280
|
return -1;
|
|
@@ -8283,7 +8283,7 @@ var require_client = __commonJS({
|
|
|
8283
8283
|
util3.destroy(socket, new SocketError("bad upgrade", util3.getSocketInfo(socket)));
|
|
8284
8284
|
return -1;
|
|
8285
8285
|
}
|
|
8286
|
-
|
|
8286
|
+
assert15.strictEqual(this.timeoutType, TIMEOUT_HEADERS);
|
|
8287
8287
|
this.statusCode = statusCode;
|
|
8288
8288
|
this.shouldKeepAlive = shouldKeepAlive || request.method === "HEAD" && !socket[kReset2] && this.connection.toLowerCase() === "keep-alive";
|
|
8289
8289
|
if (this.statusCode >= 200) {
|
|
@@ -8295,16 +8295,16 @@ var require_client = __commonJS({
|
|
|
8295
8295
|
}
|
|
8296
8296
|
}
|
|
8297
8297
|
if (request.method === "CONNECT") {
|
|
8298
|
-
|
|
8298
|
+
assert15(client[kRunning] === 1);
|
|
8299
8299
|
this.upgrade = true;
|
|
8300
8300
|
return 2;
|
|
8301
8301
|
}
|
|
8302
8302
|
if (upgrade) {
|
|
8303
|
-
|
|
8303
|
+
assert15(client[kRunning] === 1);
|
|
8304
8304
|
this.upgrade = true;
|
|
8305
8305
|
return 2;
|
|
8306
8306
|
}
|
|
8307
|
-
|
|
8307
|
+
assert15(this.headers.length % 2 === 0);
|
|
8308
8308
|
this.headers = [];
|
|
8309
8309
|
this.headersSize = 0;
|
|
8310
8310
|
if (this.shouldKeepAlive && client[kPipelining]) {
|
|
@@ -8350,14 +8350,14 @@ var require_client = __commonJS({
|
|
|
8350
8350
|
return -1;
|
|
8351
8351
|
}
|
|
8352
8352
|
const request = client[kQueue][client[kRunningIdx]];
|
|
8353
|
-
|
|
8354
|
-
|
|
8353
|
+
assert15(request);
|
|
8354
|
+
assert15.strictEqual(this.timeoutType, TIMEOUT_BODY);
|
|
8355
8355
|
if (this.timeout) {
|
|
8356
8356
|
if (this.timeout.refresh) {
|
|
8357
8357
|
this.timeout.refresh();
|
|
8358
8358
|
}
|
|
8359
8359
|
}
|
|
8360
|
-
|
|
8360
|
+
assert15(statusCode >= 200);
|
|
8361
8361
|
if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
|
|
8362
8362
|
util3.destroy(socket, new ResponseExceededMaxSizeError());
|
|
8363
8363
|
return -1;
|
|
@@ -8381,15 +8381,15 @@ var require_client = __commonJS({
|
|
|
8381
8381
|
return;
|
|
8382
8382
|
}
|
|
8383
8383
|
const request = client[kQueue][client[kRunningIdx]];
|
|
8384
|
-
|
|
8385
|
-
|
|
8384
|
+
assert15(request);
|
|
8385
|
+
assert15(statusCode >= 100);
|
|
8386
8386
|
this.statusCode = null;
|
|
8387
8387
|
this.statusText = "";
|
|
8388
8388
|
this.bytesRead = 0;
|
|
8389
8389
|
this.contentLength = "";
|
|
8390
8390
|
this.keepAlive = "";
|
|
8391
8391
|
this.connection = "";
|
|
8392
|
-
|
|
8392
|
+
assert15(this.headers.length % 2 === 0);
|
|
8393
8393
|
this.headers = [];
|
|
8394
8394
|
this.headersSize = 0;
|
|
8395
8395
|
if (statusCode < 200) {
|
|
@@ -8406,7 +8406,7 @@ var require_client = __commonJS({
|
|
|
8406
8406
|
}
|
|
8407
8407
|
client[kQueue][client[kRunningIdx]++] = null;
|
|
8408
8408
|
if (socket[kWriting]) {
|
|
8409
|
-
|
|
8409
|
+
assert15.strictEqual(client[kRunning], 0);
|
|
8410
8410
|
util3.destroy(socket, new InformationalError("reset"));
|
|
8411
8411
|
return constants3.ERROR.PAUSED;
|
|
8412
8412
|
} else if (!shouldKeepAlive) {
|
|
@@ -8427,7 +8427,7 @@ var require_client = __commonJS({
|
|
|
8427
8427
|
const { socket, timeoutType, client } = parser2;
|
|
8428
8428
|
if (timeoutType === TIMEOUT_HEADERS) {
|
|
8429
8429
|
if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
|
|
8430
|
-
|
|
8430
|
+
assert15(!parser2.paused, "cannot be paused while waiting for headers");
|
|
8431
8431
|
util3.destroy(socket, new HeadersTimeoutError());
|
|
8432
8432
|
}
|
|
8433
8433
|
} else if (timeoutType === TIMEOUT_BODY) {
|
|
@@ -8435,7 +8435,7 @@ var require_client = __commonJS({
|
|
|
8435
8435
|
util3.destroy(socket, new BodyTimeoutError());
|
|
8436
8436
|
}
|
|
8437
8437
|
} else if (timeoutType === TIMEOUT_IDLE) {
|
|
8438
|
-
|
|
8438
|
+
assert15(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]);
|
|
8439
8439
|
util3.destroy(socket, new InformationalError("socket idle timeout"));
|
|
8440
8440
|
}
|
|
8441
8441
|
}
|
|
@@ -8447,7 +8447,7 @@ var require_client = __commonJS({
|
|
|
8447
8447
|
__name(onSocketReadable, "onSocketReadable");
|
|
8448
8448
|
function onSocketError(err) {
|
|
8449
8449
|
const { [kParser]: parser2 } = this;
|
|
8450
|
-
|
|
8450
|
+
assert15(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
|
|
8451
8451
|
if (err.code === "ECONNRESET" && parser2.statusCode && !parser2.shouldKeepAlive) {
|
|
8452
8452
|
parser2.onMessageComplete();
|
|
8453
8453
|
return;
|
|
@@ -8458,13 +8458,13 @@ var require_client = __commonJS({
|
|
|
8458
8458
|
__name(onSocketError, "onSocketError");
|
|
8459
8459
|
function onError(client, err) {
|
|
8460
8460
|
if (client[kRunning] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") {
|
|
8461
|
-
|
|
8461
|
+
assert15(client[kPendingIdx] === client[kRunningIdx]);
|
|
8462
8462
|
const requests = client[kQueue].splice(client[kRunningIdx]);
|
|
8463
8463
|
for (let i = 0; i < requests.length; i++) {
|
|
8464
8464
|
const request = requests[i];
|
|
8465
8465
|
errorRequest(client, request, err);
|
|
8466
8466
|
}
|
|
8467
|
-
|
|
8467
|
+
assert15(client[kSize] === 0);
|
|
8468
8468
|
}
|
|
8469
8469
|
}
|
|
8470
8470
|
__name(onError, "onError");
|
|
@@ -8487,7 +8487,7 @@ var require_client = __commonJS({
|
|
|
8487
8487
|
const err = this[kError] || new SocketError("closed", util3.getSocketInfo(this));
|
|
8488
8488
|
client[kSocket] = null;
|
|
8489
8489
|
if (client.destroyed) {
|
|
8490
|
-
|
|
8490
|
+
assert15(client[kPending] === 0);
|
|
8491
8491
|
const requests = client[kQueue].splice(client[kRunningIdx]);
|
|
8492
8492
|
for (let i = 0; i < requests.length; i++) {
|
|
8493
8493
|
const request = requests[i];
|
|
@@ -8499,20 +8499,20 @@ var require_client = __commonJS({
|
|
|
8499
8499
|
errorRequest(client, request, err);
|
|
8500
8500
|
}
|
|
8501
8501
|
client[kPendingIdx] = client[kRunningIdx];
|
|
8502
|
-
|
|
8502
|
+
assert15(client[kRunning] === 0);
|
|
8503
8503
|
client.emit("disconnect", client[kUrl], [client], err);
|
|
8504
8504
|
resume(client);
|
|
8505
8505
|
}
|
|
8506
8506
|
__name(onSocketClose, "onSocketClose");
|
|
8507
8507
|
async function connect2(client) {
|
|
8508
|
-
|
|
8509
|
-
|
|
8508
|
+
assert15(!client[kConnecting]);
|
|
8509
|
+
assert15(!client[kSocket]);
|
|
8510
8510
|
let { host, hostname, protocol, port: port2 } = client[kUrl];
|
|
8511
8511
|
if (hostname[0] === "[") {
|
|
8512
8512
|
const idx = hostname.indexOf("]");
|
|
8513
|
-
|
|
8513
|
+
assert15(idx !== -1);
|
|
8514
8514
|
const ip2 = hostname.substr(1, idx - 1);
|
|
8515
|
-
|
|
8515
|
+
assert15(net3.isIP(ip2));
|
|
8516
8516
|
hostname = ip2;
|
|
8517
8517
|
}
|
|
8518
8518
|
client[kConnecting] = true;
|
|
@@ -8551,7 +8551,7 @@ var require_client = __commonJS({
|
|
|
8551
8551
|
llhttpPromise = null;
|
|
8552
8552
|
}
|
|
8553
8553
|
client[kConnecting] = false;
|
|
8554
|
-
|
|
8554
|
+
assert15(socket);
|
|
8555
8555
|
socket[kNoRef] = false;
|
|
8556
8556
|
socket[kWriting] = false;
|
|
8557
8557
|
socket[kReset2] = false;
|
|
@@ -8595,7 +8595,7 @@ var require_client = __commonJS({
|
|
|
8595
8595
|
});
|
|
8596
8596
|
}
|
|
8597
8597
|
if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") {
|
|
8598
|
-
|
|
8598
|
+
assert15(client[kRunning] === 0);
|
|
8599
8599
|
while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
|
|
8600
8600
|
const request = client[kQueue][client[kPendingIdx]++];
|
|
8601
8601
|
errorRequest(client, request, err);
|
|
@@ -8630,7 +8630,7 @@ var require_client = __commonJS({
|
|
|
8630
8630
|
function _resume(client, sync) {
|
|
8631
8631
|
while (true) {
|
|
8632
8632
|
if (client.destroyed) {
|
|
8633
|
-
|
|
8633
|
+
assert15(client[kPending] === 0);
|
|
8634
8634
|
return;
|
|
8635
8635
|
}
|
|
8636
8636
|
if (client.closed && !client[kSize]) {
|
|
@@ -8706,7 +8706,7 @@ var require_client = __commonJS({
|
|
|
8706
8706
|
}
|
|
8707
8707
|
if (util3.isStream(request.body) && util3.bodyLength(request.body) === 0) {
|
|
8708
8708
|
request.body.on("data", function() {
|
|
8709
|
-
|
|
8709
|
+
assert15(false);
|
|
8710
8710
|
}).on("error", function(err) {
|
|
8711
8711
|
errorRequest(client, request, err);
|
|
8712
8712
|
}).on("end", function() {
|
|
@@ -8804,13 +8804,13 @@ upgrade: ${upgrade}\r
|
|
|
8804
8804
|
\r
|
|
8805
8805
|
`, "ascii");
|
|
8806
8806
|
} else {
|
|
8807
|
-
|
|
8807
|
+
assert15(contentLength === null, "no body must not have content length");
|
|
8808
8808
|
socket.write(`${header}\r
|
|
8809
8809
|
`, "ascii");
|
|
8810
8810
|
}
|
|
8811
8811
|
request.onRequestSent();
|
|
8812
8812
|
} else if (util3.isBuffer(body)) {
|
|
8813
|
-
|
|
8813
|
+
assert15(contentLength === body.byteLength, "buffer body must have content length");
|
|
8814
8814
|
socket.cork();
|
|
8815
8815
|
socket.write(`${header}content-length: ${contentLength}\r
|
|
8816
8816
|
\r
|
|
@@ -8833,18 +8833,18 @@ upgrade: ${upgrade}\r
|
|
|
8833
8833
|
} else if (util3.isIterable(body)) {
|
|
8834
8834
|
writeIterable({ body, client, request, socket, contentLength, header, expectsPayload });
|
|
8835
8835
|
} else {
|
|
8836
|
-
|
|
8836
|
+
assert15(false);
|
|
8837
8837
|
}
|
|
8838
8838
|
return true;
|
|
8839
8839
|
}
|
|
8840
8840
|
__name(write, "write");
|
|
8841
8841
|
function writeStream({ body, client, request, socket, contentLength, header, expectsPayload }) {
|
|
8842
|
-
|
|
8842
|
+
assert15(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
|
|
8843
8843
|
let finished = false;
|
|
8844
8844
|
const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header });
|
|
8845
8845
|
const onData = /* @__PURE__ */ __name(function(chunk) {
|
|
8846
8846
|
try {
|
|
8847
|
-
|
|
8847
|
+
assert15(!finished);
|
|
8848
8848
|
if (!writer.write(chunk) && this.pause) {
|
|
8849
8849
|
this.pause();
|
|
8850
8850
|
}
|
|
@@ -8853,7 +8853,7 @@ upgrade: ${upgrade}\r
|
|
|
8853
8853
|
}
|
|
8854
8854
|
}, "onData");
|
|
8855
8855
|
const onDrain = /* @__PURE__ */ __name(function() {
|
|
8856
|
-
|
|
8856
|
+
assert15(!finished);
|
|
8857
8857
|
if (body.resume) {
|
|
8858
8858
|
body.resume();
|
|
8859
8859
|
}
|
|
@@ -8866,7 +8866,7 @@ upgrade: ${upgrade}\r
|
|
|
8866
8866
|
return;
|
|
8867
8867
|
}
|
|
8868
8868
|
finished = true;
|
|
8869
|
-
|
|
8869
|
+
assert15(socket.destroyed || socket[kWriting] && client[kRunning] <= 1);
|
|
8870
8870
|
socket.off("drain", onDrain).off("error", onFinished);
|
|
8871
8871
|
body.removeListener("data", onData).removeListener("end", onFinished).removeListener("error", onFinished).removeListener("close", onAbort);
|
|
8872
8872
|
if (!err) {
|
|
@@ -8891,7 +8891,7 @@ upgrade: ${upgrade}\r
|
|
|
8891
8891
|
}
|
|
8892
8892
|
__name(writeStream, "writeStream");
|
|
8893
8893
|
async function writeBlob({ body, client, request, socket, contentLength, header, expectsPayload }) {
|
|
8894
|
-
|
|
8894
|
+
assert15(contentLength === body.size, "blob body must have content length");
|
|
8895
8895
|
try {
|
|
8896
8896
|
if (contentLength != null && contentLength !== body.size) {
|
|
8897
8897
|
throw new RequestContentLengthMismatchError();
|
|
@@ -8915,7 +8915,7 @@ upgrade: ${upgrade}\r
|
|
|
8915
8915
|
}
|
|
8916
8916
|
__name(writeBlob, "writeBlob");
|
|
8917
8917
|
async function writeIterable({ body, client, request, socket, contentLength, header, expectsPayload }) {
|
|
8918
|
-
|
|
8918
|
+
assert15(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
|
|
8919
8919
|
let callback = null;
|
|
8920
8920
|
function onDrain() {
|
|
8921
8921
|
if (callback) {
|
|
@@ -8926,7 +8926,7 @@ upgrade: ${upgrade}\r
|
|
|
8926
8926
|
}
|
|
8927
8927
|
__name(onDrain, "onDrain");
|
|
8928
8928
|
const waitForDrain = /* @__PURE__ */ __name(() => new Promise((resolve16, reject) => {
|
|
8929
|
-
|
|
8929
|
+
assert15(callback === null);
|
|
8930
8930
|
if (socket[kError]) {
|
|
8931
8931
|
reject(socket[kError]);
|
|
8932
8932
|
} else {
|
|
@@ -9051,7 +9051,7 @@ ${len.toString(16)}\r
|
|
|
9051
9051
|
const { socket, client } = this;
|
|
9052
9052
|
socket[kWriting] = false;
|
|
9053
9053
|
if (err) {
|
|
9054
|
-
|
|
9054
|
+
assert15(client[kRunning] <= 1, "pipeline should only contain this request");
|
|
9055
9055
|
util3.destroy(socket, err);
|
|
9056
9056
|
}
|
|
9057
9057
|
}
|
|
@@ -9060,7 +9060,7 @@ ${len.toString(16)}\r
|
|
|
9060
9060
|
function errorRequest(client, request, err) {
|
|
9061
9061
|
try {
|
|
9062
9062
|
request.onError(err);
|
|
9063
|
-
|
|
9063
|
+
assert15(request.aborted);
|
|
9064
9064
|
} catch (err2) {
|
|
9065
9065
|
client.emit("error", err2);
|
|
9066
9066
|
}
|
|
@@ -9703,7 +9703,7 @@ var require_readable = __commonJS({
|
|
|
9703
9703
|
"../../node_modules/undici/lib/api/readable.js"(exports2, module2) {
|
|
9704
9704
|
"use strict";
|
|
9705
9705
|
init_import_meta_url();
|
|
9706
|
-
var
|
|
9706
|
+
var assert15 = require("assert");
|
|
9707
9707
|
var { Readable: Readable2 } = require("stream");
|
|
9708
9708
|
var { RequestAbortedError, NotSupportedError } = require_errors();
|
|
9709
9709
|
var util3 = require_util();
|
|
@@ -9797,7 +9797,7 @@ var require_readable = __commonJS({
|
|
|
9797
9797
|
this[kBody] = ReadableStreamFrom(this);
|
|
9798
9798
|
if (this[kConsume]) {
|
|
9799
9799
|
this[kBody].getReader();
|
|
9800
|
-
|
|
9800
|
+
assert15(this[kBody].locked);
|
|
9801
9801
|
}
|
|
9802
9802
|
}
|
|
9803
9803
|
return this[kBody];
|
|
@@ -9827,7 +9827,7 @@ var require_readable = __commonJS({
|
|
|
9827
9827
|
if (isUnusable(stream2)) {
|
|
9828
9828
|
throw new TypeError("unusable");
|
|
9829
9829
|
}
|
|
9830
|
-
|
|
9830
|
+
assert15(!stream2[kConsume]);
|
|
9831
9831
|
return new Promise((resolve16, reject) => {
|
|
9832
9832
|
stream2[kConsume] = {
|
|
9833
9833
|
type,
|
|
@@ -10327,7 +10327,7 @@ var require_api_pipeline = __commonJS({
|
|
|
10327
10327
|
var util3 = require_util();
|
|
10328
10328
|
var { AsyncResource } = require("async_hooks");
|
|
10329
10329
|
var { addSignal, removeSignal } = require_abort_signal();
|
|
10330
|
-
var
|
|
10330
|
+
var assert15 = require("assert");
|
|
10331
10331
|
var kResume = Symbol("resume");
|
|
10332
10332
|
var PipelineRequest = class extends Readable2 {
|
|
10333
10333
|
constructor() {
|
|
@@ -10429,7 +10429,7 @@ var require_api_pipeline = __commonJS({
|
|
|
10429
10429
|
}
|
|
10430
10430
|
onConnect(abort, context) {
|
|
10431
10431
|
const { ret, res } = this;
|
|
10432
|
-
|
|
10432
|
+
assert15(!res, "pipeline cannot be retried");
|
|
10433
10433
|
if (ret.destroyed) {
|
|
10434
10434
|
throw new RequestAbortedError();
|
|
10435
10435
|
}
|
|
@@ -10521,7 +10521,7 @@ var require_api_upgrade = __commonJS({
|
|
|
10521
10521
|
var { AsyncResource } = require("async_hooks");
|
|
10522
10522
|
var util3 = require_util();
|
|
10523
10523
|
var { addSignal, removeSignal } = require_abort_signal();
|
|
10524
|
-
var
|
|
10524
|
+
var assert15 = require("assert");
|
|
10525
10525
|
var UpgradeHandler = class extends AsyncResource {
|
|
10526
10526
|
constructor(opts, callback) {
|
|
10527
10527
|
if (!opts || typeof opts !== "object") {
|
|
@@ -10554,7 +10554,7 @@ var require_api_upgrade = __commonJS({
|
|
|
10554
10554
|
}
|
|
10555
10555
|
onUpgrade(statusCode, rawHeaders, socket) {
|
|
10556
10556
|
const { callback, opaque, context } = this;
|
|
10557
|
-
|
|
10557
|
+
assert15.strictEqual(statusCode, 101);
|
|
10558
10558
|
removeSignal(this);
|
|
10559
10559
|
this.callback = null;
|
|
10560
10560
|
const headers = this.responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders);
|
|
@@ -11745,7 +11745,7 @@ var require_headers = __commonJS({
|
|
|
11745
11745
|
isValidHeaderValue
|
|
11746
11746
|
} = require_util2();
|
|
11747
11747
|
var { webidl } = require_webidl();
|
|
11748
|
-
var
|
|
11748
|
+
var assert15 = require("assert");
|
|
11749
11749
|
var kHeadersMap = Symbol("headers map");
|
|
11750
11750
|
var kHeadersSortedMap = Symbol("headers map sorted");
|
|
11751
11751
|
function headerValueNormalize(potentialValue) {
|
|
@@ -11979,7 +11979,7 @@ var require_headers = __commonJS({
|
|
|
11979
11979
|
headers.push([name, value2]);
|
|
11980
11980
|
}
|
|
11981
11981
|
} else {
|
|
11982
|
-
|
|
11982
|
+
assert15(value !== null);
|
|
11983
11983
|
headers.push([name, value]);
|
|
11984
11984
|
}
|
|
11985
11985
|
}
|
|
@@ -12137,7 +12137,7 @@ var require_response = __commonJS({
|
|
|
12137
12137
|
var { getGlobalOrigin } = require_global2();
|
|
12138
12138
|
var { URLSerializer } = require_dataURL();
|
|
12139
12139
|
var { kHeadersList } = require_symbols();
|
|
12140
|
-
var
|
|
12140
|
+
var assert15 = require("assert");
|
|
12141
12141
|
var { types } = require("util");
|
|
12142
12142
|
var ReadableStream = globalThis.ReadableStream || require("stream/web").ReadableStream;
|
|
12143
12143
|
var Response3 = class {
|
|
@@ -12346,7 +12346,7 @@ var require_response = __commonJS({
|
|
|
12346
12346
|
return p in state ? state[p] : target[p];
|
|
12347
12347
|
},
|
|
12348
12348
|
set(target, p, value) {
|
|
12349
|
-
|
|
12349
|
+
assert15(!(p in state));
|
|
12350
12350
|
target[p] = value;
|
|
12351
12351
|
return true;
|
|
12352
12352
|
}
|
|
@@ -12381,12 +12381,12 @@ var require_response = __commonJS({
|
|
|
12381
12381
|
body: null
|
|
12382
12382
|
});
|
|
12383
12383
|
} else {
|
|
12384
|
-
|
|
12384
|
+
assert15(false);
|
|
12385
12385
|
}
|
|
12386
12386
|
}
|
|
12387
12387
|
__name(filterResponse, "filterResponse");
|
|
12388
12388
|
function makeAppropriateNetworkError(fetchParams) {
|
|
12389
|
-
|
|
12389
|
+
assert15(isCancelled(fetchParams));
|
|
12390
12390
|
return isAborted(fetchParams) ? makeNetworkError(new DOMException("The operation was aborted.", "AbortError")) : makeNetworkError("Request was cancelled.");
|
|
12391
12391
|
}
|
|
12392
12392
|
__name(makeAppropriateNetworkError, "makeAppropriateNetworkError");
|
|
@@ -12514,7 +12514,7 @@ var require_request2 = __commonJS({
|
|
|
12514
12514
|
var { getGlobalOrigin } = require_global2();
|
|
12515
12515
|
var { URLSerializer } = require_dataURL();
|
|
12516
12516
|
var { kHeadersList } = require_symbols();
|
|
12517
|
-
var
|
|
12517
|
+
var assert15 = require("assert");
|
|
12518
12518
|
var { setMaxListeners, getEventListeners, defaultMaxListeners } = require("events");
|
|
12519
12519
|
var TransformStream = globalThis.TransformStream;
|
|
12520
12520
|
var kInit = Symbol("init");
|
|
@@ -12553,7 +12553,7 @@ var require_request2 = __commonJS({
|
|
|
12553
12553
|
request = makeRequest({ urlList: [parsedURL] });
|
|
12554
12554
|
fallbackMode = "cors";
|
|
12555
12555
|
} else {
|
|
12556
|
-
|
|
12556
|
+
assert15(input instanceof Request2);
|
|
12557
12557
|
request = input[kState];
|
|
12558
12558
|
signal = input[kSignal];
|
|
12559
12559
|
}
|
|
@@ -13082,7 +13082,7 @@ var require_fetch = __commonJS({
|
|
|
13082
13082
|
isomorphicEncode
|
|
13083
13083
|
} = require_util2();
|
|
13084
13084
|
var { kState, kHeaders, kGuard, kRealm, kHeadersCaseInsensitive } = require_symbols2();
|
|
13085
|
-
var
|
|
13085
|
+
var assert15 = require("assert");
|
|
13086
13086
|
var { safelyExtractBody } = require_body();
|
|
13087
13087
|
var {
|
|
13088
13088
|
redirectStatus,
|
|
@@ -13134,7 +13134,7 @@ var require_fetch = __commonJS({
|
|
|
13134
13134
|
}
|
|
13135
13135
|
};
|
|
13136
13136
|
__name(Fetch, "Fetch");
|
|
13137
|
-
async function
|
|
13137
|
+
async function fetch11(input, init = {}) {
|
|
13138
13138
|
webidl.argumentLengthCheck(arguments, 1, { header: "globalThis.fetch" });
|
|
13139
13139
|
const p = createDeferredPromise();
|
|
13140
13140
|
let requestObject;
|
|
@@ -13199,7 +13199,7 @@ var require_fetch = __commonJS({
|
|
|
13199
13199
|
});
|
|
13200
13200
|
return p.promise;
|
|
13201
13201
|
}
|
|
13202
|
-
__name(
|
|
13202
|
+
__name(fetch11, "fetch");
|
|
13203
13203
|
function finalizeAndReportTiming(response, initiatorType = "other") {
|
|
13204
13204
|
if (response.type === "error" && response.aborted) {
|
|
13205
13205
|
return;
|
|
@@ -13298,7 +13298,7 @@ var require_fetch = __commonJS({
|
|
|
13298
13298
|
taskDestination,
|
|
13299
13299
|
crossOriginIsolatedCapability
|
|
13300
13300
|
};
|
|
13301
|
-
|
|
13301
|
+
assert15(!request.body || request.body.stream);
|
|
13302
13302
|
if (request.window === "client") {
|
|
13303
13303
|
request.window = request.client?.globalObject?.constructor?.name === "Window" ? request.client : "no-window";
|
|
13304
13304
|
}
|
|
@@ -13386,7 +13386,7 @@ var require_fetch = __commonJS({
|
|
|
13386
13386
|
} else if (request.responseTainting === "opaque") {
|
|
13387
13387
|
response = filterResponse(response, "opaque");
|
|
13388
13388
|
} else {
|
|
13389
|
-
|
|
13389
|
+
assert15(false);
|
|
13390
13390
|
}
|
|
13391
13391
|
}
|
|
13392
13392
|
let internalResponse = response.status === 0 ? response : response.internalResponse;
|
|
@@ -13581,7 +13581,7 @@ var require_fetch = __commonJS({
|
|
|
13581
13581
|
} else if (request.redirect === "follow") {
|
|
13582
13582
|
response = await httpRedirectFetch(fetchParams, response);
|
|
13583
13583
|
} else {
|
|
13584
|
-
|
|
13584
|
+
assert15(false);
|
|
13585
13585
|
}
|
|
13586
13586
|
}
|
|
13587
13587
|
response.timingInfo = timingInfo;
|
|
@@ -13632,7 +13632,7 @@ var require_fetch = __commonJS({
|
|
|
13632
13632
|
request.headersList.delete("authorization");
|
|
13633
13633
|
}
|
|
13634
13634
|
if (request.body != null) {
|
|
13635
|
-
|
|
13635
|
+
assert15(request.body.source);
|
|
13636
13636
|
request.body = safelyExtractBody(request.body.source)[0];
|
|
13637
13637
|
}
|
|
13638
13638
|
const timingInfo = fetchParams.timingInfo;
|
|
@@ -13761,7 +13761,7 @@ var require_fetch = __commonJS({
|
|
|
13761
13761
|
}
|
|
13762
13762
|
__name(httpNetworkOrCacheFetch, "httpNetworkOrCacheFetch");
|
|
13763
13763
|
async function httpNetworkFetch(fetchParams, includeCredentials = false, forceNewConnection = false) {
|
|
13764
|
-
|
|
13764
|
+
assert15(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed);
|
|
13765
13765
|
fetchParams.controller.connection = {
|
|
13766
13766
|
abort: null,
|
|
13767
13767
|
destroyed: false,
|
|
@@ -14041,7 +14041,7 @@ var require_fetch = __commonJS({
|
|
|
14041
14041
|
}
|
|
14042
14042
|
__name(httpNetworkFetch, "httpNetworkFetch");
|
|
14043
14043
|
module2.exports = {
|
|
14044
|
-
fetch:
|
|
14044
|
+
fetch: fetch11,
|
|
14045
14045
|
Fetch,
|
|
14046
14046
|
fetching,
|
|
14047
14047
|
finalizeAndReportTiming
|
|
@@ -14864,7 +14864,7 @@ var require_util4 = __commonJS({
|
|
|
14864
14864
|
"../../node_modules/undici/lib/cookies/util.js"(exports2, module2) {
|
|
14865
14865
|
"use strict";
|
|
14866
14866
|
init_import_meta_url();
|
|
14867
|
-
var
|
|
14867
|
+
var assert15 = require("assert");
|
|
14868
14868
|
var { kHeadersList } = require_symbols();
|
|
14869
14869
|
function isCTLExcludingHtab(value) {
|
|
14870
14870
|
if (value.length === 0) {
|
|
@@ -15012,10 +15012,10 @@ var require_util4 = __commonJS({
|
|
|
15012
15012
|
kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
|
|
15013
15013
|
(symbol) => symbol.description === "headers list"
|
|
15014
15014
|
);
|
|
15015
|
-
|
|
15015
|
+
assert15(kHeadersListNode, "Headers cannot be parsed");
|
|
15016
15016
|
}
|
|
15017
15017
|
const headersList = headers[kHeadersListNode];
|
|
15018
|
-
|
|
15018
|
+
assert15(headersList);
|
|
15019
15019
|
return headersList;
|
|
15020
15020
|
}
|
|
15021
15021
|
__name(getHeadersList, "getHeadersList");
|
|
@@ -15035,7 +15035,7 @@ var require_parse = __commonJS({
|
|
|
15035
15035
|
var { maxNameValuePairSize, maxAttributeValueSize } = require_constants3();
|
|
15036
15036
|
var { isCTLExcludingHtab } = require_util4();
|
|
15037
15037
|
var { collectASequenceOfCodePointsFast } = require_dataURL();
|
|
15038
|
-
var
|
|
15038
|
+
var assert15 = require("assert");
|
|
15039
15039
|
function parseSetCookie(header) {
|
|
15040
15040
|
if (isCTLExcludingHtab(header)) {
|
|
15041
15041
|
return null;
|
|
@@ -15078,7 +15078,7 @@ var require_parse = __commonJS({
|
|
|
15078
15078
|
if (unparsedAttributes.length === 0) {
|
|
15079
15079
|
return cookieAttributeList;
|
|
15080
15080
|
}
|
|
15081
|
-
|
|
15081
|
+
assert15(unparsedAttributes[0] === ";");
|
|
15082
15082
|
unparsedAttributes = unparsedAttributes.slice(1);
|
|
15083
15083
|
let cookieAv = "";
|
|
15084
15084
|
if (unparsedAttributes.includes(";")) {
|
|
@@ -16574,7 +16574,7 @@ var require_undici = __commonJS({
|
|
|
16574
16574
|
module2.exports.getGlobalDispatcher = getGlobalDispatcher;
|
|
16575
16575
|
if (util3.nodeMajor > 16 || util3.nodeMajor === 16 && util3.nodeMinor >= 8) {
|
|
16576
16576
|
let fetchImpl = null;
|
|
16577
|
-
module2.exports.fetch = /* @__PURE__ */ __name(async function
|
|
16577
|
+
module2.exports.fetch = /* @__PURE__ */ __name(async function fetch11(resource) {
|
|
16578
16578
|
if (!fetchImpl) {
|
|
16579
16579
|
fetchImpl = require_fetch().fetch;
|
|
16580
16580
|
}
|
|
@@ -17960,14 +17960,14 @@ var require_templates = __commonJS({
|
|
|
17960
17960
|
return results;
|
|
17961
17961
|
}
|
|
17962
17962
|
__name(parseStyle, "parseStyle");
|
|
17963
|
-
function buildStyle(
|
|
17963
|
+
function buildStyle(chalk15, styles) {
|
|
17964
17964
|
const enabled = {};
|
|
17965
17965
|
for (const layer of styles) {
|
|
17966
17966
|
for (const style of layer.styles) {
|
|
17967
17967
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
17968
17968
|
}
|
|
17969
17969
|
}
|
|
17970
|
-
let current =
|
|
17970
|
+
let current = chalk15;
|
|
17971
17971
|
for (const styleName of Object.keys(enabled)) {
|
|
17972
17972
|
if (Array.isArray(enabled[styleName])) {
|
|
17973
17973
|
if (!(styleName in current)) {
|
|
@@ -17983,7 +17983,7 @@ var require_templates = __commonJS({
|
|
|
17983
17983
|
return current;
|
|
17984
17984
|
}
|
|
17985
17985
|
__name(buildStyle, "buildStyle");
|
|
17986
|
-
module2.exports = (
|
|
17986
|
+
module2.exports = (chalk15, tmp5) => {
|
|
17987
17987
|
const styles = [];
|
|
17988
17988
|
const chunks = [];
|
|
17989
17989
|
let chunk = [];
|
|
@@ -17993,13 +17993,13 @@ var require_templates = __commonJS({
|
|
|
17993
17993
|
} else if (style) {
|
|
17994
17994
|
const str = chunk.join("");
|
|
17995
17995
|
chunk = [];
|
|
17996
|
-
chunks.push(styles.length === 0 ? str : buildStyle(
|
|
17996
|
+
chunks.push(styles.length === 0 ? str : buildStyle(chalk15, styles)(str));
|
|
17997
17997
|
styles.push({ inverse, styles: parseStyle(style) });
|
|
17998
17998
|
} else if (close) {
|
|
17999
17999
|
if (styles.length === 0) {
|
|
18000
18000
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
18001
18001
|
}
|
|
18002
|
-
chunks.push(buildStyle(
|
|
18002
|
+
chunks.push(buildStyle(chalk15, styles)(chunk.join("")));
|
|
18003
18003
|
chunk = [];
|
|
18004
18004
|
styles.pop();
|
|
18005
18005
|
} else {
|
|
@@ -18038,16 +18038,16 @@ var require_chalk = __commonJS({
|
|
|
18038
18038
|
__name(applyOptions, "applyOptions");
|
|
18039
18039
|
function Chalk(options6) {
|
|
18040
18040
|
if (!this || !(this instanceof Chalk) || this.template) {
|
|
18041
|
-
const
|
|
18042
|
-
applyOptions(
|
|
18043
|
-
|
|
18041
|
+
const chalk15 = {};
|
|
18042
|
+
applyOptions(chalk15, options6);
|
|
18043
|
+
chalk15.template = function() {
|
|
18044
18044
|
const args = [].slice.call(arguments);
|
|
18045
|
-
return chalkTag.apply(null, [
|
|
18045
|
+
return chalkTag.apply(null, [chalk15.template].concat(args));
|
|
18046
18046
|
};
|
|
18047
|
-
Object.setPrototypeOf(
|
|
18048
|
-
Object.setPrototypeOf(
|
|
18049
|
-
|
|
18050
|
-
return
|
|
18047
|
+
Object.setPrototypeOf(chalk15, Chalk.prototype);
|
|
18048
|
+
Object.setPrototypeOf(chalk15.template, chalk15);
|
|
18049
|
+
chalk15.template.constructor = Chalk;
|
|
18050
|
+
return chalk15.template;
|
|
18051
18051
|
}
|
|
18052
18052
|
applyOptions(this, options6);
|
|
18053
18053
|
}
|
|
@@ -18169,7 +18169,7 @@ var require_chalk = __commonJS({
|
|
|
18169
18169
|
return str;
|
|
18170
18170
|
}
|
|
18171
18171
|
__name(applyStyle, "applyStyle");
|
|
18172
|
-
function chalkTag(
|
|
18172
|
+
function chalkTag(chalk15, strings) {
|
|
18173
18173
|
if (!Array.isArray(strings)) {
|
|
18174
18174
|
return [].slice.call(arguments, 1).join(" ");
|
|
18175
18175
|
}
|
|
@@ -18179,7 +18179,7 @@ var require_chalk = __commonJS({
|
|
|
18179
18179
|
parts.push(String(args[i - 1]).replace(/[{}\\]/g, "\\$&"));
|
|
18180
18180
|
parts.push(String(strings.raw[i]));
|
|
18181
18181
|
}
|
|
18182
|
-
return template(
|
|
18182
|
+
return template(chalk15, parts.join(""));
|
|
18183
18183
|
}
|
|
18184
18184
|
__name(chalkTag, "chalkTag");
|
|
18185
18185
|
Object.defineProperties(Chalk.prototype, styles);
|
|
@@ -24742,7 +24742,7 @@ var require_signal_exit = __commonJS({
|
|
|
24742
24742
|
};
|
|
24743
24743
|
};
|
|
24744
24744
|
} else {
|
|
24745
|
-
|
|
24745
|
+
assert15 = require("assert");
|
|
24746
24746
|
signals = require_signals();
|
|
24747
24747
|
isWin = /^win/i.test(process8.platform);
|
|
24748
24748
|
EE = require("events");
|
|
@@ -24765,7 +24765,7 @@ var require_signal_exit = __commonJS({
|
|
|
24765
24765
|
return function() {
|
|
24766
24766
|
};
|
|
24767
24767
|
}
|
|
24768
|
-
|
|
24768
|
+
assert15.equal(typeof cb, "function", "a callback must be provided for exit handler");
|
|
24769
24769
|
if (loaded === false) {
|
|
24770
24770
|
load();
|
|
24771
24771
|
}
|
|
@@ -24870,7 +24870,7 @@ var require_signal_exit = __commonJS({
|
|
|
24870
24870
|
}
|
|
24871
24871
|
}, "processEmit");
|
|
24872
24872
|
}
|
|
24873
|
-
var
|
|
24873
|
+
var assert15;
|
|
24874
24874
|
var signals;
|
|
24875
24875
|
var isWin;
|
|
24876
24876
|
var EE;
|
|
@@ -53345,14 +53345,14 @@ var require_templates2 = __commonJS({
|
|
|
53345
53345
|
return results;
|
|
53346
53346
|
}
|
|
53347
53347
|
__name(parseStyle, "parseStyle");
|
|
53348
|
-
function buildStyle(
|
|
53348
|
+
function buildStyle(chalk15, styles) {
|
|
53349
53349
|
const enabled = {};
|
|
53350
53350
|
for (const layer of styles) {
|
|
53351
53351
|
for (const style of layer.styles) {
|
|
53352
53352
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
53353
53353
|
}
|
|
53354
53354
|
}
|
|
53355
|
-
let current =
|
|
53355
|
+
let current = chalk15;
|
|
53356
53356
|
for (const [styleName, styles2] of Object.entries(enabled)) {
|
|
53357
53357
|
if (!Array.isArray(styles2)) {
|
|
53358
53358
|
continue;
|
|
@@ -53365,7 +53365,7 @@ var require_templates2 = __commonJS({
|
|
|
53365
53365
|
return current;
|
|
53366
53366
|
}
|
|
53367
53367
|
__name(buildStyle, "buildStyle");
|
|
53368
|
-
module2.exports = (
|
|
53368
|
+
module2.exports = (chalk15, temporary) => {
|
|
53369
53369
|
const styles = [];
|
|
53370
53370
|
const chunks = [];
|
|
53371
53371
|
let chunk = [];
|
|
@@ -53375,13 +53375,13 @@ var require_templates2 = __commonJS({
|
|
|
53375
53375
|
} else if (style) {
|
|
53376
53376
|
const string = chunk.join("");
|
|
53377
53377
|
chunk = [];
|
|
53378
|
-
chunks.push(styles.length === 0 ? string : buildStyle(
|
|
53378
|
+
chunks.push(styles.length === 0 ? string : buildStyle(chalk15, styles)(string));
|
|
53379
53379
|
styles.push({ inverse, styles: parseStyle(style) });
|
|
53380
53380
|
} else if (close) {
|
|
53381
53381
|
if (styles.length === 0) {
|
|
53382
53382
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
53383
53383
|
}
|
|
53384
|
-
chunks.push(buildStyle(
|
|
53384
|
+
chunks.push(buildStyle(chalk15, styles)(chunk.join("")));
|
|
53385
53385
|
chunk = [];
|
|
53386
53386
|
styles.pop();
|
|
53387
53387
|
} else {
|
|
@@ -53431,16 +53431,16 @@ var require_source = __commonJS({
|
|
|
53431
53431
|
};
|
|
53432
53432
|
__name(ChalkClass, "ChalkClass");
|
|
53433
53433
|
var chalkFactory = /* @__PURE__ */ __name((options6) => {
|
|
53434
|
-
const
|
|
53435
|
-
applyOptions(
|
|
53436
|
-
|
|
53437
|
-
Object.setPrototypeOf(
|
|
53438
|
-
Object.setPrototypeOf(
|
|
53439
|
-
|
|
53434
|
+
const chalk16 = {};
|
|
53435
|
+
applyOptions(chalk16, options6);
|
|
53436
|
+
chalk16.template = (...arguments_) => chalkTag(chalk16.template, ...arguments_);
|
|
53437
|
+
Object.setPrototypeOf(chalk16, Chalk.prototype);
|
|
53438
|
+
Object.setPrototypeOf(chalk16.template, chalk16);
|
|
53439
|
+
chalk16.template.constructor = () => {
|
|
53440
53440
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
53441
53441
|
};
|
|
53442
|
-
|
|
53443
|
-
return
|
|
53442
|
+
chalk16.template.Instance = ChalkClass;
|
|
53443
|
+
return chalk16.template;
|
|
53444
53444
|
}, "chalkFactory");
|
|
53445
53445
|
function Chalk(options6) {
|
|
53446
53446
|
return chalkFactory(options6);
|
|
@@ -53552,7 +53552,7 @@ var require_source = __commonJS({
|
|
|
53552
53552
|
return openAll + string + closeAll;
|
|
53553
53553
|
}, "applyStyle");
|
|
53554
53554
|
var template;
|
|
53555
|
-
var chalkTag = /* @__PURE__ */ __name((
|
|
53555
|
+
var chalkTag = /* @__PURE__ */ __name((chalk16, ...strings) => {
|
|
53556
53556
|
const [firstString] = strings;
|
|
53557
53557
|
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
53558
53558
|
return strings.join(" ");
|
|
@@ -53568,14 +53568,14 @@ var require_source = __commonJS({
|
|
|
53568
53568
|
if (template === void 0) {
|
|
53569
53569
|
template = require_templates2();
|
|
53570
53570
|
}
|
|
53571
|
-
return template(
|
|
53571
|
+
return template(chalk16, parts.join(""));
|
|
53572
53572
|
}, "chalkTag");
|
|
53573
53573
|
Object.defineProperties(Chalk.prototype, styles);
|
|
53574
|
-
var
|
|
53575
|
-
|
|
53576
|
-
|
|
53577
|
-
|
|
53578
|
-
module2.exports =
|
|
53574
|
+
var chalk15 = Chalk();
|
|
53575
|
+
chalk15.supportsColor = stdoutColor;
|
|
53576
|
+
chalk15.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
53577
|
+
chalk15.stderr.supportsColor = stderrColor;
|
|
53578
|
+
module2.exports = chalk15;
|
|
53579
53579
|
}
|
|
53580
53580
|
});
|
|
53581
53581
|
|
|
@@ -62983,7 +62983,7 @@ var require_sync = __commonJS({
|
|
|
62983
62983
|
var Glob = require_glob().Glob;
|
|
62984
62984
|
var util3 = require("util");
|
|
62985
62985
|
var path43 = require("path");
|
|
62986
|
-
var
|
|
62986
|
+
var assert15 = require("assert");
|
|
62987
62987
|
var isAbsolute = require_path_is_absolute();
|
|
62988
62988
|
var common = require_common();
|
|
62989
62989
|
var setopts = common.setopts;
|
|
@@ -63015,7 +63015,7 @@ var require_sync = __commonJS({
|
|
|
63015
63015
|
}
|
|
63016
63016
|
__name(GlobSync, "GlobSync");
|
|
63017
63017
|
GlobSync.prototype._finish = function() {
|
|
63018
|
-
|
|
63018
|
+
assert15(this instanceof GlobSync);
|
|
63019
63019
|
if (this.realpath) {
|
|
63020
63020
|
var self2 = this;
|
|
63021
63021
|
this.matches.forEach(function(matchset, index) {
|
|
@@ -63037,7 +63037,7 @@ var require_sync = __commonJS({
|
|
|
63037
63037
|
common.finish(this);
|
|
63038
63038
|
};
|
|
63039
63039
|
GlobSync.prototype._process = function(pattern, index, inGlobStar) {
|
|
63040
|
-
|
|
63040
|
+
assert15(this instanceof GlobSync);
|
|
63041
63041
|
var n = 0;
|
|
63042
63042
|
while (typeof pattern[n] === "string") {
|
|
63043
63043
|
n++;
|
|
@@ -63468,7 +63468,7 @@ var require_glob = __commonJS({
|
|
|
63468
63468
|
var inherits = require_inherits();
|
|
63469
63469
|
var EE = require("events").EventEmitter;
|
|
63470
63470
|
var path43 = require("path");
|
|
63471
|
-
var
|
|
63471
|
+
var assert15 = require("assert");
|
|
63472
63472
|
var isAbsolute = require_path_is_absolute();
|
|
63473
63473
|
var globSync = require_sync();
|
|
63474
63474
|
var common = require_common();
|
|
@@ -63577,7 +63577,7 @@ var require_glob = __commonJS({
|
|
|
63577
63577
|
}
|
|
63578
63578
|
__name(Glob, "Glob");
|
|
63579
63579
|
Glob.prototype._finish = function() {
|
|
63580
|
-
|
|
63580
|
+
assert15(this instanceof Glob);
|
|
63581
63581
|
if (this.aborted)
|
|
63582
63582
|
return;
|
|
63583
63583
|
if (this.realpath && !this._didRealpath)
|
|
@@ -63667,8 +63667,8 @@ var require_glob = __commonJS({
|
|
|
63667
63667
|
}
|
|
63668
63668
|
};
|
|
63669
63669
|
Glob.prototype._process = function(pattern, index, inGlobStar, cb) {
|
|
63670
|
-
|
|
63671
|
-
|
|
63670
|
+
assert15(this instanceof Glob);
|
|
63671
|
+
assert15(typeof cb === "function");
|
|
63672
63672
|
if (this.aborted)
|
|
63673
63673
|
return;
|
|
63674
63674
|
this._processing++;
|
|
@@ -64023,7 +64023,7 @@ var require_glob = __commonJS({
|
|
|
64023
64023
|
var require_rimraf = __commonJS({
|
|
64024
64024
|
"../../node_modules/rimraf/rimraf.js"(exports2, module2) {
|
|
64025
64025
|
init_import_meta_url();
|
|
64026
|
-
var
|
|
64026
|
+
var assert15 = require("assert");
|
|
64027
64027
|
var path43 = require("path");
|
|
64028
64028
|
var fs18 = require("fs");
|
|
64029
64029
|
var glob = void 0;
|
|
@@ -64067,11 +64067,11 @@ var require_rimraf = __commonJS({
|
|
|
64067
64067
|
cb = options6;
|
|
64068
64068
|
options6 = {};
|
|
64069
64069
|
}
|
|
64070
|
-
|
|
64071
|
-
|
|
64072
|
-
|
|
64073
|
-
|
|
64074
|
-
|
|
64070
|
+
assert15(p, "rimraf: missing path");
|
|
64071
|
+
assert15.equal(typeof p, "string", "rimraf: path should be a string");
|
|
64072
|
+
assert15.equal(typeof cb, "function", "rimraf: callback function required");
|
|
64073
|
+
assert15(options6, "rimraf: invalid options argument provided");
|
|
64074
|
+
assert15.equal(typeof options6, "object", "rimraf: options should be object");
|
|
64075
64075
|
defaults(options6);
|
|
64076
64076
|
let busyTries = 0;
|
|
64077
64077
|
let errState = null;
|
|
@@ -64115,9 +64115,9 @@ var require_rimraf = __commonJS({
|
|
|
64115
64115
|
});
|
|
64116
64116
|
}, "rimraf");
|
|
64117
64117
|
var rimraf_ = /* @__PURE__ */ __name((p, options6, cb) => {
|
|
64118
|
-
|
|
64119
|
-
|
|
64120
|
-
|
|
64118
|
+
assert15(p);
|
|
64119
|
+
assert15(options6);
|
|
64120
|
+
assert15(typeof cb === "function");
|
|
64121
64121
|
options6.lstat(p, (er, st) => {
|
|
64122
64122
|
if (er && er.code === "ENOENT")
|
|
64123
64123
|
return cb(null);
|
|
@@ -64139,9 +64139,9 @@ var require_rimraf = __commonJS({
|
|
|
64139
64139
|
});
|
|
64140
64140
|
}, "rimraf_");
|
|
64141
64141
|
var fixWinEPERM = /* @__PURE__ */ __name((p, options6, er, cb) => {
|
|
64142
|
-
|
|
64143
|
-
|
|
64144
|
-
|
|
64142
|
+
assert15(p);
|
|
64143
|
+
assert15(options6);
|
|
64144
|
+
assert15(typeof cb === "function");
|
|
64145
64145
|
options6.chmod(p, 438, (er2) => {
|
|
64146
64146
|
if (er2)
|
|
64147
64147
|
cb(er2.code === "ENOENT" ? null : er);
|
|
@@ -64157,8 +64157,8 @@ var require_rimraf = __commonJS({
|
|
|
64157
64157
|
});
|
|
64158
64158
|
}, "fixWinEPERM");
|
|
64159
64159
|
var fixWinEPERMSync = /* @__PURE__ */ __name((p, options6, er) => {
|
|
64160
|
-
|
|
64161
|
-
|
|
64160
|
+
assert15(p);
|
|
64161
|
+
assert15(options6);
|
|
64162
64162
|
try {
|
|
64163
64163
|
options6.chmodSync(p, 438);
|
|
64164
64164
|
} catch (er2) {
|
|
@@ -64182,9 +64182,9 @@ var require_rimraf = __commonJS({
|
|
|
64182
64182
|
options6.unlinkSync(p);
|
|
64183
64183
|
}, "fixWinEPERMSync");
|
|
64184
64184
|
var rmdir = /* @__PURE__ */ __name((p, options6, originalEr, cb) => {
|
|
64185
|
-
|
|
64186
|
-
|
|
64187
|
-
|
|
64185
|
+
assert15(p);
|
|
64186
|
+
assert15(options6);
|
|
64187
|
+
assert15(typeof cb === "function");
|
|
64188
64188
|
options6.rmdir(p, (er) => {
|
|
64189
64189
|
if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM"))
|
|
64190
64190
|
rmkids(p, options6, cb);
|
|
@@ -64195,9 +64195,9 @@ var require_rimraf = __commonJS({
|
|
|
64195
64195
|
});
|
|
64196
64196
|
}, "rmdir");
|
|
64197
64197
|
var rmkids = /* @__PURE__ */ __name((p, options6, cb) => {
|
|
64198
|
-
|
|
64199
|
-
|
|
64200
|
-
|
|
64198
|
+
assert15(p);
|
|
64199
|
+
assert15(options6);
|
|
64200
|
+
assert15(typeof cb === "function");
|
|
64201
64201
|
options6.readdir(p, (er, files) => {
|
|
64202
64202
|
if (er)
|
|
64203
64203
|
return cb(er);
|
|
@@ -64220,10 +64220,10 @@ var require_rimraf = __commonJS({
|
|
|
64220
64220
|
var rimrafSync = /* @__PURE__ */ __name((p, options6) => {
|
|
64221
64221
|
options6 = options6 || {};
|
|
64222
64222
|
defaults(options6);
|
|
64223
|
-
|
|
64224
|
-
|
|
64225
|
-
|
|
64226
|
-
|
|
64223
|
+
assert15(p, "rimraf: missing path");
|
|
64224
|
+
assert15.equal(typeof p, "string", "rimraf: path should be a string");
|
|
64225
|
+
assert15(options6, "rimraf: missing options");
|
|
64226
|
+
assert15.equal(typeof options6, "object", "rimraf: options should be object");
|
|
64227
64227
|
let results;
|
|
64228
64228
|
if (options6.disableGlob || !glob.hasMagic(p)) {
|
|
64229
64229
|
results = [p];
|
|
@@ -64265,8 +64265,8 @@ var require_rimraf = __commonJS({
|
|
|
64265
64265
|
}
|
|
64266
64266
|
}, "rimrafSync");
|
|
64267
64267
|
var rmdirSync = /* @__PURE__ */ __name((p, options6, originalEr) => {
|
|
64268
|
-
|
|
64269
|
-
|
|
64268
|
+
assert15(p);
|
|
64269
|
+
assert15(options6);
|
|
64270
64270
|
try {
|
|
64271
64271
|
options6.rmdirSync(p);
|
|
64272
64272
|
} catch (er) {
|
|
@@ -64279,8 +64279,8 @@ var require_rimraf = __commonJS({
|
|
|
64279
64279
|
}
|
|
64280
64280
|
}, "rmdirSync");
|
|
64281
64281
|
var rmkidsSync = /* @__PURE__ */ __name((p, options6) => {
|
|
64282
|
-
|
|
64283
|
-
|
|
64282
|
+
assert15(p);
|
|
64283
|
+
assert15(options6);
|
|
64284
64284
|
options6.readdirSync(p).forEach((f) => rimrafSync(path43.join(p, f), options6));
|
|
64285
64285
|
const retries = isWindows2 ? 100 : 1;
|
|
64286
64286
|
let i = 0;
|
|
@@ -113647,7 +113647,7 @@ var init_constants = __esm({
|
|
|
113647
113647
|
REDIRECTS_VERSION = 1;
|
|
113648
113648
|
HEADERS_VERSION = 2;
|
|
113649
113649
|
ANALYTICS_VERSION = 1;
|
|
113650
|
-
PERMITTED_STATUS_CODES = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
|
|
113650
|
+
PERMITTED_STATUS_CODES = /* @__PURE__ */ new Set([200, 301, 302, 303, 307, 308]);
|
|
113651
113651
|
HEADER_SEPARATOR = ":";
|
|
113652
113652
|
MAX_LINE_LENGTH = 2e3;
|
|
113653
113653
|
MAX_HEADER_RULES = 100;
|
|
@@ -113789,6 +113789,10 @@ var init_createMetadataObject = __esm({
|
|
|
113789
113789
|
});
|
|
113790
113790
|
|
|
113791
113791
|
// ../pages-shared/metadata-generator/validateURL.ts
|
|
113792
|
+
function urlHasHost(token) {
|
|
113793
|
+
const host = URL_REGEX.exec(token);
|
|
113794
|
+
return Boolean(host && host.groups && host.groups.host);
|
|
113795
|
+
}
|
|
113792
113796
|
var extractPathname, URL_REGEX, PATH_REGEX, validateUrl;
|
|
113793
113797
|
var init_validateURL = __esm({
|
|
113794
113798
|
"../pages-shared/metadata-generator/validateURL.ts"() {
|
|
@@ -113834,6 +113838,7 @@ var init_validateURL = __esm({
|
|
|
113834
113838
|
onlyRelative ? "URLs should begin with a forward-slash." : 'URLs should either be relative (e.g. begin with a forward-slash), or use HTTPS (e.g. begin with "https://").'
|
|
113835
113839
|
];
|
|
113836
113840
|
}, "validateUrl");
|
|
113841
|
+
__name(urlHasHost, "urlHasHost");
|
|
113837
113842
|
}
|
|
113838
113843
|
});
|
|
113839
113844
|
|
|
@@ -114054,7 +114059,15 @@ function parseRedirects(input) {
|
|
|
114054
114059
|
invalid.push({
|
|
114055
114060
|
line,
|
|
114056
114061
|
lineNumber: i + 1,
|
|
114057
|
-
message: `Valid status codes are 301, 302 (default), 303, 307, or 308. Got ${str_status}.`
|
|
114062
|
+
message: `Valid status codes are 200, 301, 302 (default), 303, 307, or 308. Got ${str_status}.`
|
|
114063
|
+
});
|
|
114064
|
+
continue;
|
|
114065
|
+
}
|
|
114066
|
+
if (/\/\*?$/.test(from) && /\/index(.html)?$/.test(to) && !urlHasHost(to)) {
|
|
114067
|
+
invalid.push({
|
|
114068
|
+
line,
|
|
114069
|
+
lineNumber: i + 1,
|
|
114070
|
+
message: "Infinite loop detected in this rule and has been ignored. This will cause a redirect to strip `.html` or `/index` and end up triggering this rule again. Please fix or remove this rule to silence this warning."
|
|
114058
114071
|
});
|
|
114059
114072
|
continue;
|
|
114060
114073
|
}
|
|
@@ -114067,6 +114080,16 @@ function parseRedirects(input) {
|
|
|
114067
114080
|
continue;
|
|
114068
114081
|
}
|
|
114069
114082
|
seen_paths.add(from);
|
|
114083
|
+
if (status === 200) {
|
|
114084
|
+
if (urlHasHost(to)) {
|
|
114085
|
+
invalid.push({
|
|
114086
|
+
line,
|
|
114087
|
+
lineNumber: i + 1,
|
|
114088
|
+
message: `Proxy (200) redirects can only point to relative paths. Got ${to}`
|
|
114089
|
+
});
|
|
114090
|
+
continue;
|
|
114091
|
+
}
|
|
114092
|
+
}
|
|
114070
114093
|
rules.push({ from, to, status, lineNumber: i + 1 });
|
|
114071
114094
|
}
|
|
114072
114095
|
return {
|
|
@@ -114548,31 +114571,35 @@ async function generateHandler({
|
|
|
114548
114571
|
async function generateResponse() {
|
|
114549
114572
|
const match = staticRedirectsMatcher() || generateRedirectsMatcher()({ request })[0];
|
|
114550
114573
|
if (match) {
|
|
114551
|
-
|
|
114552
|
-
|
|
114553
|
-
|
|
114554
|
-
|
|
114555
|
-
|
|
114556
|
-
|
|
114557
|
-
|
|
114558
|
-
|
|
114559
|
-
|
|
114560
|
-
|
|
114561
|
-
|
|
114562
|
-
|
|
114563
|
-
|
|
114564
|
-
|
|
114565
|
-
|
|
114566
|
-
|
|
114567
|
-
|
|
114568
|
-
|
|
114569
|
-
|
|
114570
|
-
|
|
114571
|
-
|
|
114572
|
-
|
|
114573
|
-
|
|
114574
|
-
|
|
114575
|
-
|
|
114574
|
+
if (match.status === 200) {
|
|
114575
|
+
pathname = new URL(match.to, request.url).pathname;
|
|
114576
|
+
} else {
|
|
114577
|
+
const { status, to } = match;
|
|
114578
|
+
const destination = new URL(to, request.url);
|
|
114579
|
+
const location = destination.origin === new URL(request.url).origin ? `${destination.pathname}${destination.search || search}${destination.hash}` : `${destination.href}${destination.search ? "" : search}${destination.hash}`;
|
|
114580
|
+
switch (status) {
|
|
114581
|
+
case 301:
|
|
114582
|
+
return new MovedPermanentlyResponse(location, void 0, {
|
|
114583
|
+
preventLeadingDoubleSlash: false
|
|
114584
|
+
});
|
|
114585
|
+
case 303:
|
|
114586
|
+
return new SeeOtherResponse(location, void 0, {
|
|
114587
|
+
preventLeadingDoubleSlash: false
|
|
114588
|
+
});
|
|
114589
|
+
case 307:
|
|
114590
|
+
return new TemporaryRedirectResponse(location, void 0, {
|
|
114591
|
+
preventLeadingDoubleSlash: false
|
|
114592
|
+
});
|
|
114593
|
+
case 308:
|
|
114594
|
+
return new PermanentRedirectResponse(location, void 0, {
|
|
114595
|
+
preventLeadingDoubleSlash: false
|
|
114596
|
+
});
|
|
114597
|
+
case 302:
|
|
114598
|
+
default:
|
|
114599
|
+
return new FoundResponse(location, void 0, {
|
|
114600
|
+
preventLeadingDoubleSlash: false
|
|
114601
|
+
});
|
|
114602
|
+
}
|
|
114576
114603
|
}
|
|
114577
114604
|
}
|
|
114578
114605
|
if (!request.method.match(/^(get|head)$/i)) {
|
|
@@ -114909,7 +114936,7 @@ async function generateASSETSBinding(options6) {
|
|
|
114909
114936
|
const miniflare = options6.tre ? await import("@miniflare/tre") : await import("@miniflare/core");
|
|
114910
114937
|
const Request2 = miniflare.Request;
|
|
114911
114938
|
const Response3 = miniflare.Response;
|
|
114912
|
-
const
|
|
114939
|
+
const fetch11 = options6.tre ? miniflare.fetch : (await import("@miniflare/web-sockets")).upgradingFetch;
|
|
114913
114940
|
return async function(miniflareRequest) {
|
|
114914
114941
|
if (options6.proxyPort) {
|
|
114915
114942
|
try {
|
|
@@ -114920,7 +114947,7 @@ async function generateASSETSBinding(options6) {
|
|
|
114920
114947
|
proxyRequest.headers.delete("Sec-WebSocket-Accept");
|
|
114921
114948
|
proxyRequest.headers.delete("Sec-WebSocket-Key");
|
|
114922
114949
|
}
|
|
114923
|
-
return await
|
|
114950
|
+
return await fetch11(proxyRequest);
|
|
114924
114951
|
} catch (thrown) {
|
|
114925
114952
|
options6.log.error(new Error(`Could not proxy request: ${thrown}`));
|
|
114926
114953
|
return new Response3(`[wrangler] Could not proxy request: ${thrown}`, {
|
|
@@ -122100,12 +122127,12 @@ init_import_meta_url();
|
|
|
122100
122127
|
|
|
122101
122128
|
// src/api/dev.ts
|
|
122102
122129
|
init_import_meta_url();
|
|
122103
|
-
var
|
|
122130
|
+
var import_undici16 = __toESM(require_undici());
|
|
122104
122131
|
|
|
122105
122132
|
// src/dev.tsx
|
|
122106
122133
|
init_import_meta_url();
|
|
122107
122134
|
var import_node_path42 = __toESM(require("node:path"));
|
|
122108
|
-
var
|
|
122135
|
+
var import_chalk14 = __toESM(require_chalk());
|
|
122109
122136
|
var import_chokidar5 = require("chokidar");
|
|
122110
122137
|
|
|
122111
122138
|
// ../../node_modules/get-port/index.js
|
|
@@ -126480,7 +126507,7 @@ __name(useErrorHandler, "useErrorHandler");
|
|
|
126480
126507
|
// src/dev/dev.tsx
|
|
126481
126508
|
var import_signal_exit5 = __toESM(require_signal_exit());
|
|
126482
126509
|
var import_tmp_promise3 = __toESM(require_tmp_promise());
|
|
126483
|
-
var
|
|
126510
|
+
var import_undici15 = __toESM(require_undici());
|
|
126484
126511
|
|
|
126485
126512
|
// src/dev-registry.ts
|
|
126486
126513
|
init_import_meta_url();
|
|
@@ -128720,7 +128747,7 @@ var import_websocket_server = __toESM(require_websocket_server2(), 1);
|
|
|
128720
128747
|
var wrapper_default = import_websocket.default;
|
|
128721
128748
|
|
|
128722
128749
|
// package.json
|
|
128723
|
-
var version = "2.
|
|
128750
|
+
var version = "2.18.0";
|
|
128724
128751
|
var package_default = {
|
|
128725
128752
|
name: "wrangler",
|
|
128726
128753
|
version,
|
|
@@ -132652,19 +132679,19 @@ __name(createWorkerPreview, "createWorkerPreview");
|
|
|
132652
132679
|
|
|
132653
132680
|
// src/publish/publish.ts
|
|
132654
132681
|
init_import_meta_url();
|
|
132655
|
-
var
|
|
132682
|
+
var import_node_assert11 = __toESM(require("node:assert"));
|
|
132656
132683
|
var import_node_fs24 = require("node:fs");
|
|
132657
132684
|
var import_node_path40 = __toESM(require("node:path"));
|
|
132658
132685
|
var import_node_url12 = require("node:url");
|
|
132659
|
-
var
|
|
132686
|
+
var import_chalk13 = __toESM(require_chalk());
|
|
132660
132687
|
var import_tmp_promise2 = __toESM(require_tmp_promise());
|
|
132661
132688
|
|
|
132662
132689
|
// src/deployments.ts
|
|
132663
132690
|
init_import_meta_url();
|
|
132664
132691
|
var import_url2 = require("url");
|
|
132665
132692
|
var import_toml6 = __toESM(require_toml());
|
|
132666
|
-
var
|
|
132667
|
-
var
|
|
132693
|
+
var import_chalk10 = __toESM(require_chalk());
|
|
132694
|
+
var import_undici14 = __toESM(require_undici());
|
|
132668
132695
|
|
|
132669
132696
|
// src/init.ts
|
|
132670
132697
|
init_import_meta_url();
|
|
@@ -132938,7 +132965,7 @@ __name(sniffUserAgent, "sniffUserAgent");
|
|
|
132938
132965
|
init_import_meta_url();
|
|
132939
132966
|
var import_node_os14 = __toESM(require("node:os"));
|
|
132940
132967
|
var import_toml4 = __toESM(require_toml());
|
|
132941
|
-
var
|
|
132968
|
+
var import_chalk9 = __toESM(require_chalk());
|
|
132942
132969
|
|
|
132943
132970
|
// node_modules/supports-color/index.js
|
|
132944
132971
|
init_import_meta_url();
|
|
@@ -133065,7 +133092,7 @@ var supportsColor = {
|
|
|
133065
133092
|
var supports_color_default = supportsColor;
|
|
133066
133093
|
|
|
133067
133094
|
// src/index.ts
|
|
133068
|
-
var
|
|
133095
|
+
var import_undici13 = __toESM(require_undici());
|
|
133069
133096
|
|
|
133070
133097
|
// ../../node_modules/yargs/index.mjs
|
|
133071
133098
|
init_import_meta_url();
|
|
@@ -140494,7 +140521,7 @@ function logBulkProgress(operation, index, total) {
|
|
|
140494
140521
|
);
|
|
140495
140522
|
}
|
|
140496
140523
|
__name(logBulkProgress, "logBulkProgress");
|
|
140497
|
-
async function putKVBulkKeyValue(accountId, namespaceId, keyValues, quiet = false) {
|
|
140524
|
+
async function putKVBulkKeyValue(accountId, namespaceId, keyValues, quiet = false, abortSignal) {
|
|
140498
140525
|
for (let index = 0; index < keyValues.length; index += BATCH_KEY_MAX) {
|
|
140499
140526
|
if (!quiet && keyValues.length > BATCH_KEY_MAX) {
|
|
140500
140527
|
logBulkProgress("put", index, keyValues.length);
|
|
@@ -140505,7 +140532,9 @@ async function putKVBulkKeyValue(accountId, namespaceId, keyValues, quiet = fals
|
|
|
140505
140532
|
method: "PUT",
|
|
140506
140533
|
body: JSON.stringify(keyValues.slice(index, index + BATCH_KEY_MAX)),
|
|
140507
140534
|
headers: { "Content-Type": "application/json" }
|
|
140508
|
-
}
|
|
140535
|
+
},
|
|
140536
|
+
void 0,
|
|
140537
|
+
abortSignal
|
|
140509
140538
|
);
|
|
140510
140539
|
}
|
|
140511
140540
|
if (!quiet && keyValues.length > BATCH_KEY_MAX) {
|
|
@@ -141181,70 +141210,74 @@ __name(workerNamespaceCommands, "workerNamespaceCommands");
|
|
|
141181
141210
|
|
|
141182
141211
|
// src/docs/index.ts
|
|
141183
141212
|
init_import_meta_url();
|
|
141184
|
-
|
|
141185
|
-
|
|
141186
|
-
|
|
141187
|
-
|
|
141188
|
-
|
|
141189
|
-
|
|
141190
|
-
|
|
141191
|
-
|
|
141192
|
-
|
|
141193
|
-
|
|
141194
|
-
|
|
141195
|
-
|
|
141196
|
-
|
|
141197
|
-
|
|
141198
|
-
"
|
|
141199
|
-
|
|
141200
|
-
|
|
141201
|
-
|
|
141202
|
-
|
|
141203
|
-
|
|
141204
|
-
|
|
141205
|
-
|
|
141206
|
-
}
|
|
141213
|
+
|
|
141214
|
+
// src/docs/helpers.ts
|
|
141215
|
+
init_import_meta_url();
|
|
141216
|
+
var import_node_assert8 = __toESM(require("node:assert"));
|
|
141217
|
+
var import_undici10 = __toESM(require_undici());
|
|
141218
|
+
async function runSearch(searchTerm) {
|
|
141219
|
+
const id = "8MU1G3QO9P";
|
|
141220
|
+
const index = "developers-cloudflare2";
|
|
141221
|
+
const key = "045e8dbec8c137a52f0f56e196d7abe0";
|
|
141222
|
+
const params = new URLSearchParams({
|
|
141223
|
+
query: searchTerm,
|
|
141224
|
+
hitsPerPage: "1",
|
|
141225
|
+
getRankingInfo: "0"
|
|
141226
|
+
});
|
|
141227
|
+
(0, import_node_assert8.default)(id, "Missing Algolia App ID");
|
|
141228
|
+
(0, import_node_assert8.default)(key, "Missing Algolia Key");
|
|
141229
|
+
const searchResp = await (0, import_undici10.fetch)(
|
|
141230
|
+
`https://${id}-dsn.algolia.net/1/indexes/${index}/query`,
|
|
141231
|
+
{
|
|
141232
|
+
method: "POST",
|
|
141233
|
+
body: JSON.stringify({
|
|
141234
|
+
params: params.toString()
|
|
141235
|
+
}),
|
|
141236
|
+
headers: {
|
|
141237
|
+
"X-Algolia-API-Key": key,
|
|
141238
|
+
"X-Algolia-Application-Id": id
|
|
141239
|
+
}
|
|
141240
|
+
}
|
|
141241
|
+
);
|
|
141242
|
+
if (!searchResp.ok) {
|
|
141243
|
+
logger.error(`Could not search the docs. Please try again later.`);
|
|
141244
|
+
return;
|
|
141245
|
+
}
|
|
141246
|
+
const searchData = await searchResp.json();
|
|
141247
|
+
logger.debug("searchData: ", searchData);
|
|
141248
|
+
if (searchData.hits[0]) {
|
|
141249
|
+
return searchData.hits[0].url;
|
|
141250
|
+
} else {
|
|
141251
|
+
logger.error(
|
|
141252
|
+
`Could not find docs for: ${searchTerm}. Please try again with another search term.`
|
|
141253
|
+
);
|
|
141254
|
+
return;
|
|
141255
|
+
}
|
|
141256
|
+
}
|
|
141257
|
+
__name(runSearch, "runSearch");
|
|
141258
|
+
|
|
141259
|
+
// src/docs/index.ts
|
|
141207
141260
|
function docsOptions(yargs) {
|
|
141208
141261
|
return yargs.positional("command", {
|
|
141209
141262
|
describe: "Enter the wrangler command you want to know more about",
|
|
141210
141263
|
type: "string",
|
|
141211
|
-
|
|
141212
|
-
|
|
141213
|
-
|
|
141214
|
-
|
|
141215
|
-
|
|
141216
|
-
"publish",
|
|
141217
|
-
"delete",
|
|
141218
|
-
"tail",
|
|
141219
|
-
"secret",
|
|
141220
|
-
"secret:bulk",
|
|
141221
|
-
"kv:namespace",
|
|
141222
|
-
"kv:key",
|
|
141223
|
-
"kv:bulk",
|
|
141224
|
-
"pages",
|
|
141225
|
-
"r2 object",
|
|
141226
|
-
"r2 bucket",
|
|
141227
|
-
"d1",
|
|
141228
|
-
"login",
|
|
141229
|
-
"logout",
|
|
141230
|
-
"whoami",
|
|
141231
|
-
"types",
|
|
141232
|
-
"deployments",
|
|
141233
|
-
"api"
|
|
141234
|
-
]
|
|
141264
|
+
array: true
|
|
141265
|
+
}).option("yes", {
|
|
141266
|
+
alias: "y",
|
|
141267
|
+
type: "boolean",
|
|
141268
|
+
description: "Takes you to the docs, even if search fails"
|
|
141235
141269
|
});
|
|
141236
141270
|
}
|
|
141237
141271
|
__name(docsOptions, "docsOptions");
|
|
141238
|
-
function isValidParam(k) {
|
|
141239
|
-
return k in argToUrlHash;
|
|
141240
|
-
}
|
|
141241
|
-
__name(isValidParam, "isValidParam");
|
|
141242
141272
|
async function docsHandler(args) {
|
|
141243
|
-
let urlToOpen = "https://developers.cloudflare.com/workers/wrangler/commands/";
|
|
141244
|
-
if (args.command
|
|
141245
|
-
|
|
141246
|
-
|
|
141247
|
-
urlToOpen
|
|
141273
|
+
let urlToOpen = args.yes || !args.command || args.command.length === 0 ? "https://developers.cloudflare.com/workers/wrangler/commands/" : "";
|
|
141274
|
+
if (args.command && args.command.length > 0) {
|
|
141275
|
+
const searchTerm = args.command.join(" ");
|
|
141276
|
+
const searchResult = await runSearch(searchTerm);
|
|
141277
|
+
urlToOpen = searchResult ?? urlToOpen;
|
|
141278
|
+
}
|
|
141279
|
+
if (!urlToOpen) {
|
|
141280
|
+
return;
|
|
141248
141281
|
}
|
|
141249
141282
|
await printWranglerBanner();
|
|
141250
141283
|
logger.log(`Opening a link in your default browser: ${urlToOpen}`);
|
|
@@ -142035,7 +142068,7 @@ var import_node_path31 = require("node:path");
|
|
|
142035
142068
|
init_import_meta_url();
|
|
142036
142069
|
var import_node_fs18 = require("node:fs");
|
|
142037
142070
|
var import_node_path24 = __toESM(require("node:path"));
|
|
142038
|
-
var
|
|
142071
|
+
var import_undici11 = __toESM(require_undici());
|
|
142039
142072
|
async function createUploadWorkerBundleContents(workerBundle) {
|
|
142040
142073
|
const workerBundleFormData = createWorkerBundleFormData(workerBundle);
|
|
142041
142074
|
const metadata = JSON.parse(workerBundleFormData.get("metadata"));
|
|
@@ -142043,7 +142076,7 @@ async function createUploadWorkerBundleContents(workerBundle) {
|
|
|
142043
142076
|
"metadata",
|
|
142044
142077
|
JSON.stringify({ main_module: metadata.main_module })
|
|
142045
142078
|
);
|
|
142046
|
-
return await new
|
|
142079
|
+
return await new import_undici11.Response(workerBundleFormData).blob();
|
|
142047
142080
|
}
|
|
142048
142081
|
__name(createUploadWorkerBundleContents, "createUploadWorkerBundleContents");
|
|
142049
142082
|
function createWorkerBundleFormData(workerBundle) {
|
|
@@ -144882,7 +144915,7 @@ var import_node_fs23 = require("node:fs");
|
|
|
144882
144915
|
var import_node_os13 = require("node:os");
|
|
144883
144916
|
var import_node_path35 = require("node:path");
|
|
144884
144917
|
var import_node_process7 = require("node:process");
|
|
144885
|
-
var
|
|
144918
|
+
var import_undici12 = __toESM(require_undici());
|
|
144886
144919
|
|
|
144887
144920
|
// src/pages/upload.tsx
|
|
144888
144921
|
init_import_meta_url();
|
|
@@ -145734,7 +145767,7 @@ async function publish({
|
|
|
145734
145767
|
projectName,
|
|
145735
145768
|
skipCaching: skipCaching ?? false
|
|
145736
145769
|
});
|
|
145737
|
-
const formData = new
|
|
145770
|
+
const formData = new import_undici12.FormData();
|
|
145738
145771
|
formData.append("manifest", JSON.stringify(manifest));
|
|
145739
145772
|
if (branch) {
|
|
145740
145773
|
formData.append("branch", branch);
|
|
@@ -145749,17 +145782,17 @@ async function publish({
|
|
|
145749
145782
|
formData.append("commit_dirty", commitDirty);
|
|
145750
145783
|
}
|
|
145751
145784
|
if (_headers) {
|
|
145752
|
-
formData.append("_headers", new
|
|
145785
|
+
formData.append("_headers", new import_undici12.File([_headers], "_headers"));
|
|
145753
145786
|
logger.log(`\u2728 Uploading _headers`);
|
|
145754
145787
|
}
|
|
145755
145788
|
if (_redirects) {
|
|
145756
|
-
formData.append("_redirects", new
|
|
145789
|
+
formData.append("_redirects", new import_undici12.File([_redirects], "_redirects"));
|
|
145757
145790
|
logger.log(`\u2728 Uploading _redirects`);
|
|
145758
145791
|
}
|
|
145759
145792
|
if (filepathRoutingConfig) {
|
|
145760
145793
|
formData.append(
|
|
145761
145794
|
"functions-filepath-routing-config.json",
|
|
145762
|
-
new
|
|
145795
|
+
new import_undici12.File(
|
|
145763
145796
|
[filepathRoutingConfig],
|
|
145764
145797
|
"functions-filepath-routing-config.json"
|
|
145765
145798
|
)
|
|
@@ -145796,7 +145829,7 @@ async function publish({
|
|
|
145796
145829
|
);
|
|
145797
145830
|
formData.append(
|
|
145798
145831
|
"_worker.bundle",
|
|
145799
|
-
new
|
|
145832
|
+
new import_undici12.File([workerBundleContents], "_worker.bundle")
|
|
145800
145833
|
);
|
|
145801
145834
|
logger.log(`\u2728 Uploading Worker bundle`);
|
|
145802
145835
|
if (_routesCustom) {
|
|
@@ -145805,7 +145838,7 @@ async function publish({
|
|
|
145805
145838
|
validateRoutes2(routesCustomJSON, (0, import_node_path35.join)(directory, "_routes.json"));
|
|
145806
145839
|
formData.append(
|
|
145807
145840
|
"_routes.json",
|
|
145808
|
-
new
|
|
145841
|
+
new import_undici12.File([_routesCustom], "_routes.json")
|
|
145809
145842
|
);
|
|
145810
145843
|
logger.log(`\u2728 Uploading _routes.json`);
|
|
145811
145844
|
} catch (err) {
|
|
@@ -145821,7 +145854,7 @@ async function publish({
|
|
|
145821
145854
|
);
|
|
145822
145855
|
formData.append(
|
|
145823
145856
|
"_worker.bundle",
|
|
145824
|
-
new
|
|
145857
|
+
new import_undici12.File([workerBundleContents], "_worker.bundle")
|
|
145825
145858
|
);
|
|
145826
145859
|
logger.log(`\u2728 Uploading Functions bundle`);
|
|
145827
145860
|
if (_routesCustom) {
|
|
@@ -145830,7 +145863,7 @@ async function publish({
|
|
|
145830
145863
|
validateRoutes2(routesCustomJSON, (0, import_node_path35.join)(directory, "_routes.json"));
|
|
145831
145864
|
formData.append(
|
|
145832
145865
|
"_routes.json",
|
|
145833
|
-
new
|
|
145866
|
+
new import_undici12.File([_routesCustom], "_routes.json")
|
|
145834
145867
|
);
|
|
145835
145868
|
logger.log(`\u2728 Uploading _routes.json`);
|
|
145836
145869
|
} catch (err) {
|
|
@@ -145844,7 +145877,7 @@ async function publish({
|
|
|
145844
145877
|
if (_routesGenerated) {
|
|
145845
145878
|
formData.append(
|
|
145846
145879
|
"_routes.json",
|
|
145847
|
-
new
|
|
145880
|
+
new import_undici12.File([_routesGenerated], "_routes.json")
|
|
145848
145881
|
);
|
|
145849
145882
|
}
|
|
145850
145883
|
} catch {
|
|
@@ -146145,9 +146178,10 @@ var import_node_path36 = __toESM(require("node:path"));
|
|
|
146145
146178
|
|
|
146146
146179
|
// src/sites.ts
|
|
146147
146180
|
init_import_meta_url();
|
|
146148
|
-
var
|
|
146181
|
+
var import_node_assert9 = __toESM(require("node:assert"));
|
|
146149
146182
|
var import_promises12 = require("node:fs/promises");
|
|
146150
146183
|
var path32 = __toESM(require("node:path"));
|
|
146184
|
+
var import_chalk6 = __toESM(require_chalk());
|
|
146151
146185
|
var import_ignore = __toESM(require_ignore());
|
|
146152
146186
|
|
|
146153
146187
|
// ../../node_modules/xxhash-wasm/esm/xxhash-wasm.js
|
|
@@ -146258,6 +146292,14 @@ async function createKVNamespaceIfNotAlreadyExisting(title, accountId) {
|
|
|
146258
146292
|
};
|
|
146259
146293
|
}
|
|
146260
146294
|
__name(createKVNamespaceIfNotAlreadyExisting, "createKVNamespaceIfNotAlreadyExisting");
|
|
146295
|
+
var MAX_DIFF_LINES = 100;
|
|
146296
|
+
var MAX_BUCKET_SIZE2 = 98 * 1e3 * 1e3;
|
|
146297
|
+
var MAX_BUCKET_KEYS = BATCH_KEY_MAX;
|
|
146298
|
+
var MAX_BATCH_OPERATIONS = 5;
|
|
146299
|
+
function pluralise(count) {
|
|
146300
|
+
return count === 1 ? "" : "s";
|
|
146301
|
+
}
|
|
146302
|
+
__name(pluralise, "pluralise");
|
|
146261
146303
|
async function syncAssets(accountId, scriptName, siteAssets, preview, dryRun) {
|
|
146262
146304
|
if (siteAssets === void 0) {
|
|
146263
146305
|
return { manifest: void 0, namespace: void 0 };
|
|
@@ -146266,68 +146308,139 @@ async function syncAssets(accountId, scriptName, siteAssets, preview, dryRun) {
|
|
|
146266
146308
|
logger.log("(Note: doing a dry run, not uploading or deleting anything.)");
|
|
146267
146309
|
return { manifest: void 0, namespace: void 0 };
|
|
146268
146310
|
}
|
|
146269
|
-
(0,
|
|
146311
|
+
(0, import_node_assert9.default)(accountId, "Missing accountId");
|
|
146270
146312
|
const title = `__${scriptName}-workers_sites_assets${preview ? "_preview" : ""}`;
|
|
146271
146313
|
const { id: namespace } = await createKVNamespaceIfNotAlreadyExisting(
|
|
146272
146314
|
title,
|
|
146273
146315
|
accountId
|
|
146274
146316
|
);
|
|
146317
|
+
logger.info("Fetching list of already uploaded assets...");
|
|
146275
146318
|
const namespaceKeysResponse = await listKVNamespaceKeys(accountId, namespace);
|
|
146276
146319
|
const namespaceKeys = new Set(namespaceKeysResponse.map((x) => x.name));
|
|
146277
|
-
const manifest = {};
|
|
146278
|
-
const uploadBuckets = [];
|
|
146279
|
-
let uploadBucket = [];
|
|
146280
|
-
let uploadBucketSize = 0;
|
|
146281
|
-
const include = createPatternMatcher(siteAssets.includePatterns, false);
|
|
146282
|
-
const exclude = createPatternMatcher(siteAssets.excludePatterns, true);
|
|
146283
|
-
const hasher = await e();
|
|
146284
146320
|
const assetDirectory = path32.join(
|
|
146285
146321
|
siteAssets.baseDirectory,
|
|
146286
146322
|
siteAssets.assetDirectory
|
|
146287
146323
|
);
|
|
146324
|
+
const include = createPatternMatcher(siteAssets.includePatterns, false);
|
|
146325
|
+
const exclude = createPatternMatcher(siteAssets.excludePatterns, true);
|
|
146326
|
+
const hasher = await e();
|
|
146327
|
+
const manifest = {};
|
|
146328
|
+
const uploadBuckets = [];
|
|
146329
|
+
let uploadBucket = [];
|
|
146330
|
+
let uploadBucketSize = 0;
|
|
146331
|
+
let uploadCount = 0;
|
|
146332
|
+
let skipCount = 0;
|
|
146333
|
+
let diffCount = 0;
|
|
146334
|
+
function logDiff(line) {
|
|
146335
|
+
const level = logger.loggerLevel;
|
|
146336
|
+
if (LOGGER_LEVELS[level] >= LOGGER_LEVELS.debug) {
|
|
146337
|
+
logger.debug(line);
|
|
146338
|
+
} else if (diffCount < MAX_DIFF_LINES) {
|
|
146339
|
+
logger.info(line);
|
|
146340
|
+
} else if (diffCount === MAX_DIFF_LINES) {
|
|
146341
|
+
const msg = " (truncating changed assets log, set `WRANGLER_LOG=debug` environment variable to see full diff)";
|
|
146342
|
+
logger.info(import_chalk6.default.dim(msg));
|
|
146343
|
+
}
|
|
146344
|
+
diffCount++;
|
|
146345
|
+
}
|
|
146346
|
+
__name(logDiff, "logDiff");
|
|
146347
|
+
logger.info("Building list of assets to upload...");
|
|
146288
146348
|
for await (const absAssetFile of getFilesInFolder(assetDirectory)) {
|
|
146289
146349
|
const assetFile = path32.relative(assetDirectory, absAssetFile);
|
|
146290
|
-
if (!include(assetFile))
|
|
146291
|
-
continue;
|
|
146292
|
-
}
|
|
146293
|
-
if (exclude(assetFile)) {
|
|
146350
|
+
if (!include(assetFile) || exclude(assetFile))
|
|
146294
146351
|
continue;
|
|
146295
|
-
}
|
|
146296
|
-
logger.log(`Reading ${assetFile}...`);
|
|
146297
146352
|
const content = await (0, import_promises12.readFile)(absAssetFile, "base64");
|
|
146353
|
+
const assetSize = Buffer.byteLength(content);
|
|
146298
146354
|
await validateAssetSize(absAssetFile, assetFile);
|
|
146299
|
-
const assetSize = Buffer.from(content).length;
|
|
146300
146355
|
const assetKey = hashAsset(hasher, assetFile, content);
|
|
146301
146356
|
validateAssetKey(assetKey);
|
|
146302
146357
|
if (!namespaceKeys.has(assetKey)) {
|
|
146303
|
-
|
|
146304
|
-
|
|
146358
|
+
logDiff(
|
|
146359
|
+
import_chalk6.default.green(` + ${assetKey} (uploading new version of ${assetFile})`)
|
|
146360
|
+
);
|
|
146361
|
+
if (uploadBucketSize + assetSize > MAX_BUCKET_SIZE2 || uploadBucket.length + 1 > MAX_BUCKET_KEYS) {
|
|
146305
146362
|
uploadBuckets.push(uploadBucket);
|
|
146306
146363
|
uploadBucketSize = 0;
|
|
146307
146364
|
uploadBucket = [];
|
|
146308
146365
|
}
|
|
146309
146366
|
uploadBucketSize += assetSize;
|
|
146310
|
-
uploadBucket.push(
|
|
146311
|
-
|
|
146312
|
-
value: content,
|
|
146313
|
-
base64: true
|
|
146314
|
-
});
|
|
146367
|
+
uploadBucket.push([absAssetFile, assetKey]);
|
|
146368
|
+
uploadCount++;
|
|
146315
146369
|
} else {
|
|
146316
|
-
|
|
146370
|
+
logDiff(import_chalk6.default.dim(` = ${assetKey} (already uploaded ${assetFile})`));
|
|
146371
|
+
skipCount++;
|
|
146317
146372
|
}
|
|
146318
146373
|
namespaceKeys.delete(assetKey);
|
|
146319
146374
|
const manifestKey = urlSafe(path32.relative(assetDirectory, absAssetFile));
|
|
146320
146375
|
manifest[manifestKey] = assetKey;
|
|
146321
146376
|
}
|
|
146322
|
-
|
|
146377
|
+
if (uploadBucket.length > 0)
|
|
146378
|
+
uploadBuckets.push(uploadBucket);
|
|
146323
146379
|
for (const key of namespaceKeys) {
|
|
146324
|
-
|
|
146380
|
+
logDiff(import_chalk6.default.red(` - ${key} (removing as stale)`));
|
|
146381
|
+
}
|
|
146382
|
+
if (uploadCount > 0) {
|
|
146383
|
+
const s = pluralise(uploadCount);
|
|
146384
|
+
logger.info(`Uploading ${formatNumber(uploadCount)} new asset${s}...`);
|
|
146325
146385
|
}
|
|
146326
|
-
|
|
146327
|
-
|
|
146328
|
-
|
|
146386
|
+
if (skipCount > 0) {
|
|
146387
|
+
const s = pluralise(skipCount);
|
|
146388
|
+
logger.info(
|
|
146389
|
+
`Skipped uploading ${formatNumber(skipCount)} existing asset${s}.`
|
|
146390
|
+
);
|
|
146391
|
+
}
|
|
146392
|
+
let uploadedCount = 0;
|
|
146393
|
+
const controller = new AbortController();
|
|
146394
|
+
const uploaders = Array.from(Array(MAX_BATCH_OPERATIONS)).map(async () => {
|
|
146395
|
+
while (!controller.signal.aborted) {
|
|
146396
|
+
const nextBucket = uploadBuckets.shift();
|
|
146397
|
+
if (nextBucket === void 0)
|
|
146398
|
+
break;
|
|
146399
|
+
const bucket = [];
|
|
146400
|
+
for (const [absAssetFile, assetKey] of nextBucket) {
|
|
146401
|
+
bucket.push({
|
|
146402
|
+
key: assetKey,
|
|
146403
|
+
value: await (0, import_promises12.readFile)(absAssetFile, "base64"),
|
|
146404
|
+
base64: true
|
|
146405
|
+
});
|
|
146406
|
+
if (controller.signal.aborted)
|
|
146407
|
+
break;
|
|
146408
|
+
}
|
|
146409
|
+
try {
|
|
146410
|
+
await putKVBulkKeyValue(
|
|
146411
|
+
accountId,
|
|
146412
|
+
namespace,
|
|
146413
|
+
bucket,
|
|
146414
|
+
true,
|
|
146415
|
+
controller.signal
|
|
146416
|
+
);
|
|
146417
|
+
} catch (e2) {
|
|
146418
|
+
if (typeof e2 === "object" && e2 !== null && "name" in e2 && e2.name === "AbortError") {
|
|
146419
|
+
break;
|
|
146420
|
+
}
|
|
146421
|
+
throw e2;
|
|
146422
|
+
}
|
|
146423
|
+
uploadedCount += nextBucket.length;
|
|
146424
|
+
const percent = Math.floor(100 * uploadedCount / uploadCount);
|
|
146425
|
+
logger.info(
|
|
146426
|
+
`Uploaded ${percent}% [${formatNumber(
|
|
146427
|
+
uploadedCount
|
|
146428
|
+
)} out of ${formatNumber(uploadCount)}]`
|
|
146429
|
+
);
|
|
146430
|
+
}
|
|
146431
|
+
});
|
|
146432
|
+
try {
|
|
146433
|
+
await Promise.all(uploaders);
|
|
146434
|
+
} catch (e2) {
|
|
146435
|
+
logger.info(`Upload failed, aborting...`);
|
|
146436
|
+
controller.abort();
|
|
146437
|
+
throw e2;
|
|
146438
|
+
}
|
|
146439
|
+
const deleteCount = namespaceKeys.size;
|
|
146440
|
+
if (deleteCount > 0) {
|
|
146441
|
+
const s = pluralise(deleteCount);
|
|
146442
|
+
logger.info(`Removing ${formatNumber(deleteCount)} stale asset${s}...`);
|
|
146329
146443
|
}
|
|
146330
|
-
await Promise.all(bucketsToPut);
|
|
146331
146444
|
await deleteKVBulkKeyValue(accountId, namespace, Array.from(namespaceKeys));
|
|
146332
146445
|
logger.log("\u2197\uFE0F Done syncing assets");
|
|
146333
146446
|
return { manifest, namespace };
|
|
@@ -148481,7 +148594,7 @@ __name(writeDTSFile, "writeDTSFile");
|
|
|
148481
148594
|
|
|
148482
148595
|
// src/update-check.ts
|
|
148483
148596
|
init_import_meta_url();
|
|
148484
|
-
var
|
|
148597
|
+
var import_chalk7 = __toESM(require_chalk());
|
|
148485
148598
|
var import_update_check = __toESM(require_update_check());
|
|
148486
148599
|
async function updateCheck() {
|
|
148487
148600
|
let update = null;
|
|
@@ -148492,14 +148605,14 @@ async function updateCheck() {
|
|
|
148492
148605
|
} catch (err) {
|
|
148493
148606
|
}
|
|
148494
148607
|
if (update)
|
|
148495
|
-
return `(update available ${
|
|
148608
|
+
return `(update available ${import_chalk7.default.green(update.latest)})`;
|
|
148496
148609
|
return "";
|
|
148497
148610
|
}
|
|
148498
148611
|
__name(updateCheck, "updateCheck");
|
|
148499
148612
|
|
|
148500
148613
|
// src/whoami.ts
|
|
148501
148614
|
init_import_meta_url();
|
|
148502
|
-
var
|
|
148615
|
+
var import_chalk8 = __toESM(require_chalk());
|
|
148503
148616
|
async function whoami() {
|
|
148504
148617
|
logger.log("Getting User settings...");
|
|
148505
148618
|
const user = await getUserInfo();
|
|
@@ -148510,7 +148623,7 @@ async function whoami() {
|
|
|
148510
148623
|
}
|
|
148511
148624
|
if (user.email !== void 0) {
|
|
148512
148625
|
logger.log(
|
|
148513
|
-
`\u{1F44B} You are logged in with an ${user.authType}, associated with the email ${
|
|
148626
|
+
`\u{1F44B} You are logged in with an ${user.authType}, associated with the email ${import_chalk8.default.blue(user.email)}!`
|
|
148514
148627
|
);
|
|
148515
148628
|
} else {
|
|
148516
148629
|
logger.log(
|
|
@@ -148583,7 +148696,7 @@ var DEFAULT_LOCAL_PORT = 8787;
|
|
|
148583
148696
|
var DEFAULT_INSPECTOR_PORT = 9229;
|
|
148584
148697
|
var proxy = process.env.https_proxy || process.env.HTTPS_PROXY || process.env.http_proxy || process.env.HTTP_PROXY || void 0;
|
|
148585
148698
|
if (proxy) {
|
|
148586
|
-
(0,
|
|
148699
|
+
(0, import_undici13.setGlobalDispatcher)(new import_undici13.ProxyAgent(proxy));
|
|
148587
148700
|
logger.log(
|
|
148588
148701
|
`Proxy environment variables detected. We'll use your proxy for fetch requests.`
|
|
148589
148702
|
);
|
|
@@ -148611,7 +148724,7 @@ async function printWranglerBanner() {
|
|
|
148611
148724
|
}
|
|
148612
148725
|
const text = ` \u26C5\uFE0F wrangler ${version} ${await updateCheck()}`;
|
|
148613
148726
|
logger.log(
|
|
148614
|
-
text + "\n" + (supports_color_default.stdout ?
|
|
148727
|
+
text + "\n" + (supports_color_default.stdout ? import_chalk9.default.hex("#FF8800")("-".repeat(text.length)) : "-".repeat(text.length))
|
|
148615
148728
|
);
|
|
148616
148729
|
}
|
|
148617
148730
|
__name(printWranglerBanner, "printWranglerBanner");
|
|
@@ -148726,7 +148839,7 @@ function createCLIParser(argv) {
|
|
|
148726
148839
|
}
|
|
148727
148840
|
);
|
|
148728
148841
|
wrangler.command(
|
|
148729
|
-
"docs [command]",
|
|
148842
|
+
"docs [command..]",
|
|
148730
148843
|
"\u{1F4DA} Open wrangler's docs in your browser",
|
|
148731
148844
|
docsOptions,
|
|
148732
148845
|
docsHandler
|
|
@@ -149949,9 +150062,9 @@ async function rollbackDeployment(accountId, scriptName, { send_metrics: sendMet
|
|
|
149949
150062
|
rollbackMessage = message;
|
|
149950
150063
|
} else {
|
|
149951
150064
|
if (!await confirm(
|
|
149952
|
-
`This deployment ${
|
|
150065
|
+
`This deployment ${import_chalk10.default.underline(
|
|
149953
150066
|
firstHash
|
|
149954
|
-
)} will immediately replace the current deployment and become the active deployment across all your deployed routes and domains. However, your local development environment will not be affected by this rollback. ${
|
|
150067
|
+
)} will immediately replace the current deployment and become the active deployment across all your deployed routes and domains. However, your local development environment will not be affected by this rollback. ${import_chalk10.default.blue.bold(
|
|
149955
150068
|
"Note:"
|
|
149956
150069
|
)} Rolling back to a previous deployment will not rollback any of the bound resources (Durable Object, R2, KV, etc.).`
|
|
149957
150070
|
)) {
|
|
@@ -149983,7 +150096,7 @@ Successfully rolled back to Deployment ID: ${deploymentId}`);
|
|
|
149983
150096
|
}
|
|
149984
150097
|
__name(rollbackDeployment, "rollbackDeployment");
|
|
149985
150098
|
async function rollbackRequest(accountId, scriptName, deploymentId, rollbackReason) {
|
|
149986
|
-
const body = new
|
|
150099
|
+
const body = new import_undici14.FormData();
|
|
149987
150100
|
body.set("message", rollbackReason);
|
|
149988
150101
|
const { deployment_id } = await fetchResult(
|
|
149989
150102
|
`/accounts/${accountId}/workers/scripts/${scriptName}?rollback_to=${deploymentId}`,
|
|
@@ -150083,10 +150196,10 @@ __name(addHyphens, "addHyphens");
|
|
|
150083
150196
|
|
|
150084
150197
|
// src/durable.ts
|
|
150085
150198
|
init_import_meta_url();
|
|
150086
|
-
var
|
|
150199
|
+
var import_node_assert10 = __toESM(require("node:assert"));
|
|
150087
150200
|
async function getMigrationsToUpload(scriptName, props) {
|
|
150088
150201
|
const { config, accountId } = props;
|
|
150089
|
-
(0,
|
|
150202
|
+
(0, import_node_assert10.default)(accountId, "Missing accountId");
|
|
150090
150203
|
let migrations;
|
|
150091
150204
|
if (config.migrations.length > 0) {
|
|
150092
150205
|
let script;
|
|
@@ -150151,7 +150264,7 @@ __name(getMigrationsToUpload, "getMigrationsToUpload");
|
|
|
150151
150264
|
|
|
150152
150265
|
// src/routes.ts
|
|
150153
150266
|
init_import_meta_url();
|
|
150154
|
-
var
|
|
150267
|
+
var import_chalk11 = __toESM(require_chalk());
|
|
150155
150268
|
async function getWorkersDevSubdomain(accountId) {
|
|
150156
150269
|
try {
|
|
150157
150270
|
const { subdomain } = await fetchResult(
|
|
@@ -150212,8 +150325,8 @@ async function registerSubdomain(accountId) {
|
|
|
150212
150325
|
}
|
|
150213
150326
|
}
|
|
150214
150327
|
const ok = await confirm(
|
|
150215
|
-
`Creating a workers.dev subdomain for your account at ${
|
|
150216
|
-
|
|
150328
|
+
`Creating a workers.dev subdomain for your account at ${import_chalk11.default.blue(
|
|
150329
|
+
import_chalk11.default.underline(`https://${potentialName}.workers.dev`)
|
|
150217
150330
|
)}. Ok to proceed?`
|
|
150218
150331
|
);
|
|
150219
150332
|
if (!ok) {
|
|
@@ -150249,8 +150362,8 @@ ${onboardingLink}`);
|
|
|
150249
150362
|
}
|
|
150250
150363
|
logger.log("Success! It may take a few minutes for DNS records to update.");
|
|
150251
150364
|
logger.log(
|
|
150252
|
-
`Visit ${
|
|
150253
|
-
|
|
150365
|
+
`Visit ${import_chalk11.default.blue(
|
|
150366
|
+
import_chalk11.default.underline(
|
|
150254
150367
|
`https://dash.cloudflare.com/${accountId}/workers/subdomain`
|
|
150255
150368
|
)
|
|
150256
150369
|
)} to edit your workers.dev subdomain`
|
|
@@ -150263,7 +150376,7 @@ __name(registerSubdomain, "registerSubdomain");
|
|
|
150263
150376
|
init_import_meta_url();
|
|
150264
150377
|
var import_promises15 = require("node:fs/promises");
|
|
150265
150378
|
var import_node_path39 = __toESM(require("node:path"));
|
|
150266
|
-
var
|
|
150379
|
+
var import_chalk12 = __toESM(require_chalk());
|
|
150267
150380
|
async function getFiles(root, relativeTo) {
|
|
150268
150381
|
const files = [];
|
|
150269
150382
|
for (const file of await (0, import_promises15.readdir)(root, { withFileTypes: true })) {
|
|
@@ -150287,7 +150400,7 @@ async function traverseModuleGraph(entry, rules) {
|
|
|
150287
150400
|
if (modules.length > 0) {
|
|
150288
150401
|
logger.info(`Uploading additional modules:`);
|
|
150289
150402
|
modules.forEach(({ name, type }) => {
|
|
150290
|
-
logger.info(`- ${
|
|
150403
|
+
logger.info(`- ${import_chalk12.default.blue(name)} (${import_chalk12.default.green(type ?? "")})`);
|
|
150291
150404
|
});
|
|
150292
150405
|
}
|
|
150293
150406
|
return {
|
|
@@ -150488,7 +150601,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
150488
150601
|
}
|
|
150489
150602
|
const compatibilityFlags = props.compatibilityFlags ?? config.compatibility_flags;
|
|
150490
150603
|
const nodejsCompat = compatibilityFlags.includes("nodejs_compat");
|
|
150491
|
-
(0,
|
|
150604
|
+
(0, import_node_assert11.default)(
|
|
150492
150605
|
!(legacyNodeCompat && nodejsCompat),
|
|
150493
150606
|
"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."
|
|
150494
150607
|
);
|
|
@@ -150503,11 +150616,11 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
150503
150616
|
);
|
|
150504
150617
|
}
|
|
150505
150618
|
const scriptName = props.name;
|
|
150506
|
-
(0,
|
|
150619
|
+
(0, import_node_assert11.default)(
|
|
150507
150620
|
scriptName,
|
|
150508
150621
|
'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>"`'
|
|
150509
150622
|
);
|
|
150510
|
-
(0,
|
|
150623
|
+
(0, import_node_assert11.default)(
|
|
150511
150624
|
!config.site || config.site.bucket,
|
|
150512
150625
|
"A [site] definition requires a `bucket` field with a path to the site's assets directory."
|
|
150513
150626
|
);
|
|
@@ -150726,7 +150839,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
150726
150839
|
logger.log(`--dry-run: exiting now.`);
|
|
150727
150840
|
return;
|
|
150728
150841
|
}
|
|
150729
|
-
(0,
|
|
150842
|
+
(0, import_node_assert11.default)(accountId, "Missing accountId");
|
|
150730
150843
|
const uploadMs = Date.now() - start;
|
|
150731
150844
|
const deployments2 = [];
|
|
150732
150845
|
if (deployToWorkersDev) {
|
|
@@ -150781,13 +150894,13 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
150781
150894
|
const assignedRoutes = routesWithOtherBindings[worker];
|
|
150782
150895
|
errorMessage += `"${worker}" is already assigned to routes:
|
|
150783
150896
|
${assignedRoutes.map(
|
|
150784
|
-
(r) => ` - ${
|
|
150897
|
+
(r) => ` - ${import_chalk13.default.underline(r)}
|
|
150785
150898
|
`
|
|
150786
150899
|
)}`;
|
|
150787
150900
|
}
|
|
150788
150901
|
const resolution = "Unassign other workers from the routes you want to publish to, and then try again.";
|
|
150789
|
-
const dashLink = `Visit ${
|
|
150790
|
-
|
|
150902
|
+
const dashLink = `Visit ${import_chalk13.default.blue(
|
|
150903
|
+
import_chalk13.default.underline(
|
|
150791
150904
|
`https://dash.cloudflare.com/${accountId}/workers/overview`
|
|
150792
150905
|
)
|
|
150793
150906
|
)} to unassign a worker from a route.`;
|
|
@@ -151436,7 +151549,7 @@ __name(ChooseAccount, "ChooseAccount");
|
|
|
151436
151549
|
|
|
151437
151550
|
// src/dev/use-esbuild.ts
|
|
151438
151551
|
init_import_meta_url();
|
|
151439
|
-
var
|
|
151552
|
+
var import_node_assert12 = __toESM(require("node:assert"));
|
|
151440
151553
|
var import_chokidar3 = require("chokidar");
|
|
151441
151554
|
var import_ink11 = __toESM(require_build2());
|
|
151442
151555
|
var import_react17 = __toESM(require_react());
|
|
@@ -151470,7 +151583,7 @@ function useEsbuild({
|
|
|
151470
151583
|
let stopWatching = void 0;
|
|
151471
151584
|
function updateBundle() {
|
|
151472
151585
|
setBundle((previousBundle) => {
|
|
151473
|
-
(0,
|
|
151586
|
+
(0, import_node_assert12.default)(
|
|
151474
151587
|
previousBundle,
|
|
151475
151588
|
"Rebuild triggered with no previous build available"
|
|
151476
151589
|
);
|
|
@@ -151882,7 +151995,7 @@ async function findTunnelHostname() {
|
|
|
151882
151995
|
let hostName;
|
|
151883
151996
|
while (!hostName) {
|
|
151884
151997
|
try {
|
|
151885
|
-
const resp = await (0,
|
|
151998
|
+
const resp = await (0, import_undici15.fetch)("http://localhost:8789/metrics");
|
|
151886
151999
|
const data = await resp.text();
|
|
151887
152000
|
const matches = Array.from(data.matchAll(hostNameRegex));
|
|
151888
152001
|
hostName = matches[0][1];
|
|
@@ -152671,9 +152784,9 @@ async function startDev(args) {
|
|
|
152671
152784
|
await printWranglerBanner();
|
|
152672
152785
|
if (args.local && process.platform !== "win32") {
|
|
152673
152786
|
logger.info(
|
|
152674
|
-
|
|
152787
|
+
import_chalk14.default.magenta(
|
|
152675
152788
|
`Want to try out the next version of local mode using the open-source Workers runtime?
|
|
152676
|
-
Switch out --local for ${
|
|
152789
|
+
Switch out --local for ${import_chalk14.default.bold(
|
|
152677
152790
|
"--experimental-local"
|
|
152678
152791
|
)} and let us know what you think at https://discord.gg/cloudflaredev !`
|
|
152679
152792
|
)
|
|
@@ -153237,7 +153350,7 @@ unstable_dev()'s behaviour will likely change in future releases`
|
|
|
153237
153350
|
address: readyAddress,
|
|
153238
153351
|
stop: devServer.stop,
|
|
153239
153352
|
fetch: async (input, init) => {
|
|
153240
|
-
return await (0,
|
|
153353
|
+
return await (0, import_undici16.fetch)(
|
|
153241
153354
|
...parseRequestInput(
|
|
153242
153355
|
readyAddress,
|
|
153243
153356
|
readyPort,
|
|
@@ -153321,7 +153434,7 @@ unstable_dev()'s behaviour will likely change in future releases`
|
|
|
153321
153434
|
address: readyAddress,
|
|
153322
153435
|
stop: devServer.stop,
|
|
153323
153436
|
fetch: async (input, init) => {
|
|
153324
|
-
return await (0,
|
|
153437
|
+
return await (0, import_undici16.fetch)(
|
|
153325
153438
|
...parseRequestInput(
|
|
153326
153439
|
readyAddress,
|
|
153327
153440
|
readyPort,
|
|
@@ -153339,7 +153452,7 @@ unstable_dev()'s behaviour will likely change in future releases`
|
|
|
153339
153452
|
}
|
|
153340
153453
|
__name(unstable_dev, "unstable_dev");
|
|
153341
153454
|
function parseRequestInput(readyAddress, readyPort, input = "/", init, protocol = "http") {
|
|
153342
|
-
if (input instanceof
|
|
153455
|
+
if (input instanceof import_undici16.Request) {
|
|
153343
153456
|
return [input, void 0];
|
|
153344
153457
|
}
|
|
153345
153458
|
const url3 = new URL(`${input}`, `${protocol}://${readyAddress}:${readyPort}`);
|