wrangler 4.20.0 → 4.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config-schema.json +4 -11
- package/package.json +7 -7
- package/wrangler-dist/cli.d.ts +34 -14
- package/wrangler-dist/cli.js +788 -664
- package/wrangler-dist/metafile-cjs.json +1 -1
- package/templates/strip-cf-connecting-ip-header.js +0 -13
package/wrangler-dist/cli.js
CHANGED
@@ -2301,7 +2301,7 @@ var require_util = __commonJS({
|
|
2301
2301
|
"../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/core/util.js"(exports2, module3) {
|
2302
2302
|
"use strict";
|
2303
2303
|
init_import_meta_url();
|
2304
|
-
var
|
2304
|
+
var assert39 = require("assert");
|
2305
2305
|
var { kDestroyed, kBodyUsed } = require_symbols();
|
2306
2306
|
var { IncomingMessage } = require("http");
|
2307
2307
|
var stream2 = require("stream");
|
@@ -2389,7 +2389,7 @@ var require_util = __commonJS({
|
|
2389
2389
|
function getHostname(host) {
|
2390
2390
|
if (host[0] === "[") {
|
2391
2391
|
const idx2 = host.indexOf("]");
|
2392
|
-
|
2392
|
+
assert39(idx2 !== -1);
|
2393
2393
|
return host.substring(1, idx2);
|
2394
2394
|
}
|
2395
2395
|
const idx = host.indexOf(":");
|
@@ -2401,7 +2401,7 @@ var require_util = __commonJS({
|
|
2401
2401
|
if (!host) {
|
2402
2402
|
return null;
|
2403
2403
|
}
|
2404
|
-
|
2404
|
+
assert39.strictEqual(typeof host, "string");
|
2405
2405
|
const servername = getHostname(host);
|
2406
2406
|
if (net2.isIP(servername)) {
|
2407
2407
|
return "";
|
@@ -5067,7 +5067,7 @@ var require_util2 = __commonJS({
|
|
5067
5067
|
var { getGlobalOrigin } = require_global();
|
5068
5068
|
var { performance: performance2 } = require("perf_hooks");
|
5069
5069
|
var { isBlobLike, toUSVString, ReadableStreamFrom } = require_util();
|
5070
|
-
var
|
5070
|
+
var assert39 = require("assert");
|
5071
5071
|
var { isUint8Array } = require("util/types");
|
5072
5072
|
var supportedHashes = [];
|
5073
5073
|
var crypto8;
|
@@ -5277,7 +5277,7 @@ var require_util2 = __commonJS({
|
|
5277
5277
|
__name(clonePolicyContainer, "clonePolicyContainer");
|
5278
5278
|
function determineRequestsReferrer(request4) {
|
5279
5279
|
const policy = request4.referrerPolicy;
|
5280
|
-
|
5280
|
+
assert39(policy);
|
5281
5281
|
let referrerSource = null;
|
5282
5282
|
if (request4.referrer === "client") {
|
5283
5283
|
const globalOrigin = getGlobalOrigin();
|
@@ -5336,7 +5336,7 @@ var require_util2 = __commonJS({
|
|
5336
5336
|
}
|
5337
5337
|
__name(determineRequestsReferrer, "determineRequestsReferrer");
|
5338
5338
|
function stripURLForReferrer(url4, originOnly) {
|
5339
|
-
|
5339
|
+
assert39(url4 instanceof URL);
|
5340
5340
|
if (url4.protocol === "file:" || url4.protocol === "about:" || url4.protocol === "blank:") {
|
5341
5341
|
return "no-referrer";
|
5342
5342
|
}
|
@@ -5529,7 +5529,7 @@ var require_util2 = __commonJS({
|
|
5529
5529
|
if (result === void 0) {
|
5530
5530
|
throw new TypeError("Value is not JSON serializable");
|
5531
5531
|
}
|
5532
|
-
|
5532
|
+
assert39(typeof result === "string");
|
5533
5533
|
return result;
|
5534
5534
|
}
|
5535
5535
|
__name(serializeJavascriptValueToJSONString, "serializeJavascriptValueToJSONString");
|
@@ -5630,7 +5630,7 @@ var require_util2 = __commonJS({
|
|
5630
5630
|
__name(readableStreamClose, "readableStreamClose");
|
5631
5631
|
function isomorphicEncode(input) {
|
5632
5632
|
for (let i5 = 0; i5 < input.length; i5++) {
|
5633
|
-
|
5633
|
+
assert39(input.charCodeAt(i5) <= 255);
|
5634
5634
|
}
|
5635
5635
|
return input;
|
5636
5636
|
}
|
@@ -5652,7 +5652,7 @@ var require_util2 = __commonJS({
|
|
5652
5652
|
}
|
5653
5653
|
__name(readAllBytes, "readAllBytes");
|
5654
5654
|
function urlIsLocal(url4) {
|
5655
|
-
|
5655
|
+
assert39("protocol" in url4);
|
5656
5656
|
const protocol = url4.protocol;
|
5657
5657
|
return protocol === "about:" || protocol === "blob:" || protocol === "data:";
|
5658
5658
|
}
|
@@ -5665,7 +5665,7 @@ var require_util2 = __commonJS({
|
|
5665
5665
|
}
|
5666
5666
|
__name(urlHasHttpsScheme, "urlHasHttpsScheme");
|
5667
5667
|
function urlIsHttpHttpsScheme(url4) {
|
5668
|
-
|
5668
|
+
assert39("protocol" in url4);
|
5669
5669
|
const protocol = url4.protocol;
|
5670
5670
|
return protocol === "http:" || protocol === "https:";
|
5671
5671
|
}
|
@@ -6111,7 +6111,7 @@ var require_webidl = __commonJS({
|
|
6111
6111
|
var require_dataURL = __commonJS({
|
6112
6112
|
"../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fetch/dataURL.js"(exports2, module3) {
|
6113
6113
|
init_import_meta_url();
|
6114
|
-
var
|
6114
|
+
var assert39 = require("assert");
|
6115
6115
|
var { atob: atob2 } = require("buffer");
|
6116
6116
|
var { isomorphicDecode } = require_util2();
|
6117
6117
|
var encoder = new TextEncoder();
|
@@ -6119,7 +6119,7 @@ var require_dataURL = __commonJS({
|
|
6119
6119
|
var HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/;
|
6120
6120
|
var HTTP_QUOTED_STRING_TOKENS = /[\u0009|\u0020-\u007E|\u0080-\u00FF]/;
|
6121
6121
|
function dataURLProcessor(dataURL) {
|
6122
|
-
|
6122
|
+
assert39(dataURL.protocol === "data:");
|
6123
6123
|
let input = URLSerializer(dataURL, true);
|
6124
6124
|
input = input.slice(5);
|
6125
6125
|
const position = { position: 0 };
|
@@ -6313,7 +6313,7 @@ var require_dataURL = __commonJS({
|
|
6313
6313
|
function collectAnHTTPQuotedString(input, position, extractValue) {
|
6314
6314
|
const positionStart = position.position;
|
6315
6315
|
let value = "";
|
6316
|
-
|
6316
|
+
assert39(input[position.position] === '"');
|
6317
6317
|
position.position++;
|
6318
6318
|
while (true) {
|
6319
6319
|
value += collectASequenceOfCodePoints(
|
@@ -6334,7 +6334,7 @@ var require_dataURL = __commonJS({
|
|
6334
6334
|
value += input[position.position];
|
6335
6335
|
position.position++;
|
6336
6336
|
} else {
|
6337
|
-
|
6337
|
+
assert39(quoteOrBackslash === '"');
|
6338
6338
|
break;
|
6339
6339
|
}
|
6340
6340
|
}
|
@@ -6345,7 +6345,7 @@ var require_dataURL = __commonJS({
|
|
6345
6345
|
}
|
6346
6346
|
__name(collectAnHTTPQuotedString, "collectAnHTTPQuotedString");
|
6347
6347
|
function serializeAMimeType(mimeType) {
|
6348
|
-
|
6348
|
+
assert39(mimeType !== "failure");
|
6349
6349
|
const { parameters, essence } = mimeType;
|
6350
6350
|
let serialization = essence;
|
6351
6351
|
for (let [name2, value] of parameters.entries()) {
|
@@ -6785,7 +6785,7 @@ var require_body = __commonJS({
|
|
6785
6785
|
var { DOMException: DOMException2, structuredClone } = require_constants2();
|
6786
6786
|
var { Blob: Blob6, File: NativeFile } = require("buffer");
|
6787
6787
|
var { kBodyUsed } = require_symbols();
|
6788
|
-
var
|
6788
|
+
var assert39 = require("assert");
|
6789
6789
|
var { isErrored } = require_util();
|
6790
6790
|
var { isUint8Array, isArrayBuffer: isArrayBuffer3 } = require("util/types");
|
6791
6791
|
var { File: UndiciFile } = require_file();
|
@@ -6823,7 +6823,7 @@ var require_body = __commonJS({
|
|
6823
6823
|
type: void 0
|
6824
6824
|
});
|
6825
6825
|
}
|
6826
|
-
|
6826
|
+
assert39(isReadableStreamLike(stream2));
|
6827
6827
|
let action = null;
|
6828
6828
|
let source = null;
|
6829
6829
|
let length = null;
|
@@ -6940,8 +6940,8 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
6940
6940
|
ReadableStream3 = require("stream/web").ReadableStream;
|
6941
6941
|
}
|
6942
6942
|
if (object instanceof ReadableStream3) {
|
6943
|
-
|
6944
|
-
|
6943
|
+
assert39(!util5.isDisturbed(object), "The body has already been consumed.");
|
6944
|
+
assert39(!object.locked, "The stream is locked.");
|
6945
6945
|
}
|
6946
6946
|
return extractBody(object, keepalive);
|
6947
6947
|
}
|
@@ -7164,7 +7164,7 @@ var require_request = __commonJS({
|
|
7164
7164
|
InvalidArgumentError,
|
7165
7165
|
NotSupportedError
|
7166
7166
|
} = require_errors();
|
7167
|
-
var
|
7167
|
+
var assert39 = require("assert");
|
7168
7168
|
var { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = require_symbols();
|
7169
7169
|
var util5 = require_util();
|
7170
7170
|
var tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/;
|
@@ -7348,8 +7348,8 @@ var require_request = __commonJS({
|
|
7348
7348
|
}
|
7349
7349
|
}
|
7350
7350
|
onConnect(abort) {
|
7351
|
-
|
7352
|
-
|
7351
|
+
assert39(!this.aborted);
|
7352
|
+
assert39(!this.completed);
|
7353
7353
|
if (this.error) {
|
7354
7354
|
abort(this.error);
|
7355
7355
|
} else {
|
@@ -7358,8 +7358,8 @@ var require_request = __commonJS({
|
|
7358
7358
|
}
|
7359
7359
|
}
|
7360
7360
|
onHeaders(statusCode, headers, resume, statusText) {
|
7361
|
-
|
7362
|
-
|
7361
|
+
assert39(!this.aborted);
|
7362
|
+
assert39(!this.completed);
|
7363
7363
|
if (channels.headers.hasSubscribers) {
|
7364
7364
|
channels.headers.publish({ request: this, response: { statusCode, headers, statusText } });
|
7365
7365
|
}
|
@@ -7370,8 +7370,8 @@ var require_request = __commonJS({
|
|
7370
7370
|
}
|
7371
7371
|
}
|
7372
7372
|
onData(chunk) {
|
7373
|
-
|
7374
|
-
|
7373
|
+
assert39(!this.aborted);
|
7374
|
+
assert39(!this.completed);
|
7375
7375
|
try {
|
7376
7376
|
return this[kHandler].onData(chunk);
|
7377
7377
|
} catch (err) {
|
@@ -7380,13 +7380,13 @@ var require_request = __commonJS({
|
|
7380
7380
|
}
|
7381
7381
|
}
|
7382
7382
|
onUpgrade(statusCode, headers, socket) {
|
7383
|
-
|
7384
|
-
|
7383
|
+
assert39(!this.aborted);
|
7384
|
+
assert39(!this.completed);
|
7385
7385
|
return this[kHandler].onUpgrade(statusCode, headers, socket);
|
7386
7386
|
}
|
7387
7387
|
onComplete(trailers) {
|
7388
7388
|
this.onFinally();
|
7389
|
-
|
7389
|
+
assert39(!this.aborted);
|
7390
7390
|
this.completed = true;
|
7391
7391
|
if (channels.trailers.hasSubscribers) {
|
7392
7392
|
channels.trailers.publish({ request: this, trailers });
|
@@ -7728,7 +7728,7 @@ var require_connect = __commonJS({
|
|
7728
7728
|
"use strict";
|
7729
7729
|
init_import_meta_url();
|
7730
7730
|
var net2 = require("net");
|
7731
|
-
var
|
7731
|
+
var assert39 = require("assert");
|
7732
7732
|
var util5 = require_util();
|
7733
7733
|
var { InvalidArgumentError, ConnectTimeoutError } = require_errors();
|
7734
7734
|
var tls;
|
@@ -7804,7 +7804,7 @@ var require_connect = __commonJS({
|
|
7804
7804
|
servername = servername || options.servername || util5.getServerName(host) || null;
|
7805
7805
|
const sessionKey = servername || hostname2;
|
7806
7806
|
const session = sessionCache.get(sessionKey) || null;
|
7807
|
-
|
7807
|
+
assert39(sessionKey);
|
7808
7808
|
socket = tls.connect({
|
7809
7809
|
highWaterMark: 16384,
|
7810
7810
|
// TLS in node can't have bigger HWM anyway...
|
@@ -7823,7 +7823,7 @@ var require_connect = __commonJS({
|
|
7823
7823
|
sessionCache.set(sessionKey, session2);
|
7824
7824
|
});
|
7825
7825
|
} else {
|
7826
|
-
|
7826
|
+
assert39(!httpSocket, "httpSocket can only be sent on TLS update");
|
7827
7827
|
socket = net2.connect({
|
7828
7828
|
highWaterMark: 64 * 1024,
|
7829
7829
|
// Same as nodejs fs streams.
|
@@ -8239,7 +8239,7 @@ var require_RedirectHandler = __commonJS({
|
|
8239
8239
|
init_import_meta_url();
|
8240
8240
|
var util5 = require_util();
|
8241
8241
|
var { kBodyUsed } = require_symbols();
|
8242
|
-
var
|
8242
|
+
var assert39 = require("assert");
|
8243
8243
|
var { InvalidArgumentError } = require_errors();
|
8244
8244
|
var EE = require("events");
|
8245
8245
|
var redirectableStatusCodes = [300, 301, 302, 303, 307, 308];
|
@@ -8253,7 +8253,7 @@ var require_RedirectHandler = __commonJS({
|
|
8253
8253
|
this[kBodyUsed] = false;
|
8254
8254
|
}
|
8255
8255
|
async *[Symbol.asyncIterator]() {
|
8256
|
-
|
8256
|
+
assert39(!this[kBodyUsed], "disturbed");
|
8257
8257
|
this[kBodyUsed] = true;
|
8258
8258
|
yield* this[kBody];
|
8259
8259
|
}
|
@@ -8277,7 +8277,7 @@ var require_RedirectHandler = __commonJS({
|
|
8277
8277
|
if (util5.isStream(this.opts.body)) {
|
8278
8278
|
if (util5.bodyLength(this.opts.body) === 0) {
|
8279
8279
|
this.opts.body.on("data", function() {
|
8280
|
-
|
8280
|
+
assert39(false);
|
8281
8281
|
});
|
8282
8282
|
}
|
8283
8283
|
if (typeof this.opts.body.readableDidRead !== "boolean") {
|
@@ -8383,7 +8383,7 @@ var require_RedirectHandler = __commonJS({
|
|
8383
8383
|
}
|
8384
8384
|
}
|
8385
8385
|
} else {
|
8386
|
-
|
8386
|
+
assert39(headers == null, "headers must be an object or an array");
|
8387
8387
|
}
|
8388
8388
|
return ret;
|
8389
8389
|
}
|
@@ -8437,7 +8437,7 @@ var require_client = __commonJS({
|
|
8437
8437
|
"../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/client.js"(exports2, module3) {
|
8438
8438
|
"use strict";
|
8439
8439
|
init_import_meta_url();
|
8440
|
-
var
|
8440
|
+
var assert39 = require("assert");
|
8441
8441
|
var net2 = require("net");
|
8442
8442
|
var http5 = require("http");
|
8443
8443
|
var { pipeline } = require("stream");
|
@@ -8778,7 +8778,7 @@ var require_client = __commonJS({
|
|
8778
8778
|
}
|
8779
8779
|
};
|
8780
8780
|
function onHttp2SessionError(err) {
|
8781
|
-
|
8781
|
+
assert39(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
|
8782
8782
|
this[kSocket][kError] = err;
|
8783
8783
|
onError(this[kClient], err);
|
8784
8784
|
}
|
@@ -8802,7 +8802,7 @@ var require_client = __commonJS({
|
|
8802
8802
|
client[kSocket] = null;
|
8803
8803
|
client[kHTTP2Session] = null;
|
8804
8804
|
if (client.destroyed) {
|
8805
|
-
|
8805
|
+
assert39(this[kPending] === 0);
|
8806
8806
|
const requests = client[kQueue].splice(client[kRunningIdx]);
|
8807
8807
|
for (let i5 = 0; i5 < requests.length; i5++) {
|
8808
8808
|
const request4 = requests[i5];
|
@@ -8814,7 +8814,7 @@ var require_client = __commonJS({
|
|
8814
8814
|
errorRequest(client, request4, err);
|
8815
8815
|
}
|
8816
8816
|
client[kPendingIdx] = client[kRunningIdx];
|
8817
|
-
|
8817
|
+
assert39(client[kRunning] === 0);
|
8818
8818
|
client.emit(
|
8819
8819
|
"disconnect",
|
8820
8820
|
client[kUrl],
|
@@ -8842,35 +8842,35 @@ var require_client = __commonJS({
|
|
8842
8842
|
return 0;
|
8843
8843
|
}, "wasm_on_url"),
|
8844
8844
|
wasm_on_status: /* @__PURE__ */ __name((p6, at2, len) => {
|
8845
|
-
|
8845
|
+
assert39.strictEqual(currentParser.ptr, p6);
|
8846
8846
|
const start = at2 - currentBufferPtr + currentBufferRef.byteOffset;
|
8847
8847
|
return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0;
|
8848
8848
|
}, "wasm_on_status"),
|
8849
8849
|
wasm_on_message_begin: /* @__PURE__ */ __name((p6) => {
|
8850
|
-
|
8850
|
+
assert39.strictEqual(currentParser.ptr, p6);
|
8851
8851
|
return currentParser.onMessageBegin() || 0;
|
8852
8852
|
}, "wasm_on_message_begin"),
|
8853
8853
|
wasm_on_header_field: /* @__PURE__ */ __name((p6, at2, len) => {
|
8854
|
-
|
8854
|
+
assert39.strictEqual(currentParser.ptr, p6);
|
8855
8855
|
const start = at2 - currentBufferPtr + currentBufferRef.byteOffset;
|
8856
8856
|
return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0;
|
8857
8857
|
}, "wasm_on_header_field"),
|
8858
8858
|
wasm_on_header_value: /* @__PURE__ */ __name((p6, at2, len) => {
|
8859
|
-
|
8859
|
+
assert39.strictEqual(currentParser.ptr, p6);
|
8860
8860
|
const start = at2 - currentBufferPtr + currentBufferRef.byteOffset;
|
8861
8861
|
return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0;
|
8862
8862
|
}, "wasm_on_header_value"),
|
8863
8863
|
wasm_on_headers_complete: /* @__PURE__ */ __name((p6, statusCode, upgrade, shouldKeepAlive) => {
|
8864
|
-
|
8864
|
+
assert39.strictEqual(currentParser.ptr, p6);
|
8865
8865
|
return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0;
|
8866
8866
|
}, "wasm_on_headers_complete"),
|
8867
8867
|
wasm_on_body: /* @__PURE__ */ __name((p6, at2, len) => {
|
8868
|
-
|
8868
|
+
assert39.strictEqual(currentParser.ptr, p6);
|
8869
8869
|
const start = at2 - currentBufferPtr + currentBufferRef.byteOffset;
|
8870
8870
|
return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0;
|
8871
8871
|
}, "wasm_on_body"),
|
8872
8872
|
wasm_on_message_complete: /* @__PURE__ */ __name((p6) => {
|
8873
|
-
|
8873
|
+
assert39.strictEqual(currentParser.ptr, p6);
|
8874
8874
|
return currentParser.onMessageComplete() || 0;
|
8875
8875
|
}, "wasm_on_message_complete")
|
8876
8876
|
/* eslint-enable camelcase */
|
@@ -8893,7 +8893,7 @@ var require_client = __commonJS({
|
|
8893
8893
|
__name(this, "Parser");
|
8894
8894
|
}
|
8895
8895
|
constructor(client, socket, { exports: exports3 }) {
|
8896
|
-
|
8896
|
+
assert39(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0);
|
8897
8897
|
this.llhttp = exports3;
|
8898
8898
|
this.ptr = this.llhttp.llhttp_alloc(constants4.TYPE.RESPONSE);
|
8899
8899
|
this.client = client;
|
@@ -8939,10 +8939,10 @@ var require_client = __commonJS({
|
|
8939
8939
|
if (this.socket.destroyed || !this.paused) {
|
8940
8940
|
return;
|
8941
8941
|
}
|
8942
|
-
|
8943
|
-
|
8942
|
+
assert39(this.ptr != null);
|
8943
|
+
assert39(currentParser == null);
|
8944
8944
|
this.llhttp.llhttp_resume(this.ptr);
|
8945
|
-
|
8945
|
+
assert39(this.timeoutType === TIMEOUT_BODY);
|
8946
8946
|
if (this.timeout) {
|
8947
8947
|
if (this.timeout.refresh) {
|
8948
8948
|
this.timeout.refresh();
|
@@ -8962,9 +8962,9 @@ var require_client = __commonJS({
|
|
8962
8962
|
}
|
8963
8963
|
}
|
8964
8964
|
execute(data) {
|
8965
|
-
|
8966
|
-
|
8967
|
-
|
8965
|
+
assert39(this.ptr != null);
|
8966
|
+
assert39(currentParser == null);
|
8967
|
+
assert39(!this.paused);
|
8968
8968
|
const { socket, llhttp } = this;
|
8969
8969
|
if (data.length > currentBufferSize) {
|
8970
8970
|
if (currentBufferPtr) {
|
@@ -9006,8 +9006,8 @@ var require_client = __commonJS({
|
|
9006
9006
|
}
|
9007
9007
|
}
|
9008
9008
|
destroy() {
|
9009
|
-
|
9010
|
-
|
9009
|
+
assert39(this.ptr != null);
|
9010
|
+
assert39(currentParser == null);
|
9011
9011
|
this.llhttp.llhttp_free(this.ptr);
|
9012
9012
|
this.ptr = null;
|
9013
9013
|
timers.clearTimeout(this.timeout);
|
@@ -9064,17 +9064,17 @@ var require_client = __commonJS({
|
|
9064
9064
|
}
|
9065
9065
|
onUpgrade(head) {
|
9066
9066
|
const { upgrade, client, socket, headers, statusCode } = this;
|
9067
|
-
|
9067
|
+
assert39(upgrade);
|
9068
9068
|
const request4 = client[kQueue][client[kRunningIdx]];
|
9069
|
-
|
9070
|
-
|
9071
|
-
|
9072
|
-
|
9073
|
-
|
9069
|
+
assert39(request4);
|
9070
|
+
assert39(!socket.destroyed);
|
9071
|
+
assert39(socket === client[kSocket]);
|
9072
|
+
assert39(!this.paused);
|
9073
|
+
assert39(request4.upgrade || request4.method === "CONNECT");
|
9074
9074
|
this.statusCode = null;
|
9075
9075
|
this.statusText = "";
|
9076
9076
|
this.shouldKeepAlive = null;
|
9077
|
-
|
9077
|
+
assert39(this.headers.length % 2 === 0);
|
9078
9078
|
this.headers = [];
|
9079
9079
|
this.headersSize = 0;
|
9080
9080
|
socket.unshift(head);
|
@@ -9102,8 +9102,8 @@ var require_client = __commonJS({
|
|
9102
9102
|
if (!request4) {
|
9103
9103
|
return -1;
|
9104
9104
|
}
|
9105
|
-
|
9106
|
-
|
9105
|
+
assert39(!this.upgrade);
|
9106
|
+
assert39(this.statusCode < 200);
|
9107
9107
|
if (statusCode === 100) {
|
9108
9108
|
util5.destroy(socket, new SocketError("bad response", util5.getSocketInfo(socket)));
|
9109
9109
|
return -1;
|
@@ -9112,7 +9112,7 @@ var require_client = __commonJS({
|
|
9112
9112
|
util5.destroy(socket, new SocketError("bad upgrade", util5.getSocketInfo(socket)));
|
9113
9113
|
return -1;
|
9114
9114
|
}
|
9115
|
-
|
9115
|
+
assert39.strictEqual(this.timeoutType, TIMEOUT_HEADERS);
|
9116
9116
|
this.statusCode = statusCode;
|
9117
9117
|
this.shouldKeepAlive = shouldKeepAlive || // Override llhttp value which does not allow keepAlive for HEAD.
|
9118
9118
|
request4.method === "HEAD" && !socket[kReset2] && this.connection.toLowerCase() === "keep-alive";
|
@@ -9125,16 +9125,16 @@ var require_client = __commonJS({
|
|
9125
9125
|
}
|
9126
9126
|
}
|
9127
9127
|
if (request4.method === "CONNECT") {
|
9128
|
-
|
9128
|
+
assert39(client[kRunning] === 1);
|
9129
9129
|
this.upgrade = true;
|
9130
9130
|
return 2;
|
9131
9131
|
}
|
9132
9132
|
if (upgrade) {
|
9133
|
-
|
9133
|
+
assert39(client[kRunning] === 1);
|
9134
9134
|
this.upgrade = true;
|
9135
9135
|
return 2;
|
9136
9136
|
}
|
9137
|
-
|
9137
|
+
assert39(this.headers.length % 2 === 0);
|
9138
9138
|
this.headers = [];
|
9139
9139
|
this.headersSize = 0;
|
9140
9140
|
if (this.shouldKeepAlive && client[kPipelining]) {
|
@@ -9177,14 +9177,14 @@ var require_client = __commonJS({
|
|
9177
9177
|
return -1;
|
9178
9178
|
}
|
9179
9179
|
const request4 = client[kQueue][client[kRunningIdx]];
|
9180
|
-
|
9181
|
-
|
9180
|
+
assert39(request4);
|
9181
|
+
assert39.strictEqual(this.timeoutType, TIMEOUT_BODY);
|
9182
9182
|
if (this.timeout) {
|
9183
9183
|
if (this.timeout.refresh) {
|
9184
9184
|
this.timeout.refresh();
|
9185
9185
|
}
|
9186
9186
|
}
|
9187
|
-
|
9187
|
+
assert39(statusCode >= 200);
|
9188
9188
|
if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
|
9189
9189
|
util5.destroy(socket, new ResponseExceededMaxSizeError());
|
9190
9190
|
return -1;
|
@@ -9203,15 +9203,15 @@ var require_client = __commonJS({
|
|
9203
9203
|
return;
|
9204
9204
|
}
|
9205
9205
|
const request4 = client[kQueue][client[kRunningIdx]];
|
9206
|
-
|
9207
|
-
|
9206
|
+
assert39(request4);
|
9207
|
+
assert39(statusCode >= 100);
|
9208
9208
|
this.statusCode = null;
|
9209
9209
|
this.statusText = "";
|
9210
9210
|
this.bytesRead = 0;
|
9211
9211
|
this.contentLength = "";
|
9212
9212
|
this.keepAlive = "";
|
9213
9213
|
this.connection = "";
|
9214
|
-
|
9214
|
+
assert39(this.headers.length % 2 === 0);
|
9215
9215
|
this.headers = [];
|
9216
9216
|
this.headersSize = 0;
|
9217
9217
|
if (statusCode < 200) {
|
@@ -9224,7 +9224,7 @@ var require_client = __commonJS({
|
|
9224
9224
|
request4.onComplete(headers);
|
9225
9225
|
client[kQueue][client[kRunningIdx]++] = null;
|
9226
9226
|
if (socket[kWriting]) {
|
9227
|
-
|
9227
|
+
assert39.strictEqual(client[kRunning], 0);
|
9228
9228
|
util5.destroy(socket, new InformationalError("reset"));
|
9229
9229
|
return constants4.ERROR.PAUSED;
|
9230
9230
|
} else if (!shouldKeepAlive) {
|
@@ -9244,7 +9244,7 @@ var require_client = __commonJS({
|
|
9244
9244
|
const { socket, timeoutType, client } = parser2;
|
9245
9245
|
if (timeoutType === TIMEOUT_HEADERS) {
|
9246
9246
|
if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
|
9247
|
-
|
9247
|
+
assert39(!parser2.paused, "cannot be paused while waiting for headers");
|
9248
9248
|
util5.destroy(socket, new HeadersTimeoutError());
|
9249
9249
|
}
|
9250
9250
|
} else if (timeoutType === TIMEOUT_BODY) {
|
@@ -9252,7 +9252,7 @@ var require_client = __commonJS({
|
|
9252
9252
|
util5.destroy(socket, new BodyTimeoutError());
|
9253
9253
|
}
|
9254
9254
|
} else if (timeoutType === TIMEOUT_IDLE) {
|
9255
|
-
|
9255
|
+
assert39(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]);
|
9256
9256
|
util5.destroy(socket, new InformationalError("socket idle timeout"));
|
9257
9257
|
}
|
9258
9258
|
}
|
@@ -9266,7 +9266,7 @@ var require_client = __commonJS({
|
|
9266
9266
|
__name(onSocketReadable, "onSocketReadable");
|
9267
9267
|
function onSocketError(err) {
|
9268
9268
|
const { [kClient]: client, [kParser]: parser2 } = this;
|
9269
|
-
|
9269
|
+
assert39(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
|
9270
9270
|
if (client[kHTTPConnVersion] !== "h2") {
|
9271
9271
|
if (err.code === "ECONNRESET" && parser2.statusCode && !parser2.shouldKeepAlive) {
|
9272
9272
|
parser2.onMessageComplete();
|
@@ -9279,13 +9279,13 @@ var require_client = __commonJS({
|
|
9279
9279
|
__name(onSocketError, "onSocketError");
|
9280
9280
|
function onError(client, err) {
|
9281
9281
|
if (client[kRunning] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") {
|
9282
|
-
|
9282
|
+
assert39(client[kPendingIdx] === client[kRunningIdx]);
|
9283
9283
|
const requests = client[kQueue].splice(client[kRunningIdx]);
|
9284
9284
|
for (let i5 = 0; i5 < requests.length; i5++) {
|
9285
9285
|
const request4 = requests[i5];
|
9286
9286
|
errorRequest(client, request4, err);
|
9287
9287
|
}
|
9288
|
-
|
9288
|
+
assert39(client[kSize] === 0);
|
9289
9289
|
}
|
9290
9290
|
}
|
9291
9291
|
__name(onError, "onError");
|
@@ -9312,7 +9312,7 @@ var require_client = __commonJS({
|
|
9312
9312
|
const err = this[kError] || new SocketError("closed", util5.getSocketInfo(this));
|
9313
9313
|
client[kSocket] = null;
|
9314
9314
|
if (client.destroyed) {
|
9315
|
-
|
9315
|
+
assert39(client[kPending] === 0);
|
9316
9316
|
const requests = client[kQueue].splice(client[kRunningIdx]);
|
9317
9317
|
for (let i5 = 0; i5 < requests.length; i5++) {
|
9318
9318
|
const request4 = requests[i5];
|
@@ -9324,20 +9324,20 @@ var require_client = __commonJS({
|
|
9324
9324
|
errorRequest(client, request4, err);
|
9325
9325
|
}
|
9326
9326
|
client[kPendingIdx] = client[kRunningIdx];
|
9327
|
-
|
9327
|
+
assert39(client[kRunning] === 0);
|
9328
9328
|
client.emit("disconnect", client[kUrl], [client], err);
|
9329
9329
|
resume(client);
|
9330
9330
|
}
|
9331
9331
|
__name(onSocketClose, "onSocketClose");
|
9332
9332
|
async function connect(client) {
|
9333
|
-
|
9334
|
-
|
9333
|
+
assert39(!client[kConnecting]);
|
9334
|
+
assert39(!client[kSocket]);
|
9335
9335
|
let { host, hostname: hostname2, protocol, port } = client[kUrl];
|
9336
9336
|
if (hostname2[0] === "[") {
|
9337
9337
|
const idx = hostname2.indexOf("]");
|
9338
|
-
|
9338
|
+
assert39(idx !== -1);
|
9339
9339
|
const ip = hostname2.substring(1, idx);
|
9340
|
-
|
9340
|
+
assert39(net2.isIP(ip));
|
9341
9341
|
hostname2 = ip;
|
9342
9342
|
}
|
9343
9343
|
client[kConnecting] = true;
|
@@ -9377,7 +9377,7 @@ var require_client = __commonJS({
|
|
9377
9377
|
return;
|
9378
9378
|
}
|
9379
9379
|
client[kConnecting] = false;
|
9380
|
-
|
9380
|
+
assert39(socket);
|
9381
9381
|
const isH22 = socket.alpnProtocol === "h2";
|
9382
9382
|
if (isH22) {
|
9383
9383
|
if (!h2ExperimentalWarned) {
|
@@ -9453,7 +9453,7 @@ var require_client = __commonJS({
|
|
9453
9453
|
});
|
9454
9454
|
}
|
9455
9455
|
if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") {
|
9456
|
-
|
9456
|
+
assert39(client[kRunning] === 0);
|
9457
9457
|
while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
|
9458
9458
|
const request4 = client[kQueue][client[kPendingIdx]++];
|
9459
9459
|
errorRequest(client, request4, err);
|
@@ -9488,7 +9488,7 @@ var require_client = __commonJS({
|
|
9488
9488
|
function _resume(client, sync) {
|
9489
9489
|
while (true) {
|
9490
9490
|
if (client.destroyed) {
|
9491
|
-
|
9491
|
+
assert39(client[kPending] === 0);
|
9492
9492
|
return;
|
9493
9493
|
}
|
9494
9494
|
if (client[kClosedResolve] && !client[kSize]) {
|
@@ -9662,13 +9662,13 @@ upgrade: ${upgrade}\r
|
|
9662
9662
|
\r
|
9663
9663
|
`, "latin1");
|
9664
9664
|
} else {
|
9665
|
-
|
9665
|
+
assert39(contentLength === null, "no body must not have content length");
|
9666
9666
|
socket.write(`${header}\r
|
9667
9667
|
`, "latin1");
|
9668
9668
|
}
|
9669
9669
|
request4.onRequestSent();
|
9670
9670
|
} else if (util5.isBuffer(body)) {
|
9671
|
-
|
9671
|
+
assert39(contentLength === body.byteLength, "buffer body must have content length");
|
9672
9672
|
socket.cork();
|
9673
9673
|
socket.write(`${header}content-length: ${contentLength}\r
|
9674
9674
|
\r
|
@@ -9691,7 +9691,7 @@ upgrade: ${upgrade}\r
|
|
9691
9691
|
} else if (util5.isIterable(body)) {
|
9692
9692
|
writeIterable({ body, client, request: request4, socket, contentLength, header, expectsPayload });
|
9693
9693
|
} else {
|
9694
|
-
|
9694
|
+
assert39(false);
|
9695
9695
|
}
|
9696
9696
|
return true;
|
9697
9697
|
}
|
@@ -9761,7 +9761,7 @@ upgrade: ${upgrade}\r
|
|
9761
9761
|
process.emitWarning(new RequestContentLengthMismatchError());
|
9762
9762
|
}
|
9763
9763
|
if (contentLength != null) {
|
9764
|
-
|
9764
|
+
assert39(body, "no body must not have content length");
|
9765
9765
|
headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`;
|
9766
9766
|
}
|
9767
9767
|
session.ref();
|
@@ -9817,7 +9817,7 @@ upgrade: ${upgrade}\r
|
|
9817
9817
|
if (!body) {
|
9818
9818
|
request4.onRequestSent();
|
9819
9819
|
} else if (util5.isBuffer(body)) {
|
9820
|
-
|
9820
|
+
assert39(contentLength === body.byteLength, "buffer body must have content length");
|
9821
9821
|
stream2.cork();
|
9822
9822
|
stream2.write(body);
|
9823
9823
|
stream2.uncork();
|
@@ -9871,14 +9871,14 @@ upgrade: ${upgrade}\r
|
|
9871
9871
|
socket: client[kSocket]
|
9872
9872
|
});
|
9873
9873
|
} else {
|
9874
|
-
|
9874
|
+
assert39(false);
|
9875
9875
|
}
|
9876
9876
|
}
|
9877
9877
|
__name(writeBodyH2, "writeBodyH2");
|
9878
9878
|
}
|
9879
9879
|
__name(writeH2, "writeH2");
|
9880
9880
|
function writeStream({ h2stream, body, client, request: request4, socket, contentLength, header, expectsPayload }) {
|
9881
|
-
|
9881
|
+
assert39(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
|
9882
9882
|
if (client[kHTTPConnVersion] === "h2") {
|
9883
9883
|
let onPipeData = function(chunk) {
|
9884
9884
|
request4.onBodySent(chunk);
|
@@ -9937,7 +9937,7 @@ upgrade: ${upgrade}\r
|
|
9937
9937
|
return;
|
9938
9938
|
}
|
9939
9939
|
finished = true;
|
9940
|
-
|
9940
|
+
assert39(socket.destroyed || socket[kWriting] && client[kRunning] <= 1);
|
9941
9941
|
socket.off("drain", onDrain).off("error", onFinished);
|
9942
9942
|
body.removeListener("data", onData).removeListener("end", onFinished).removeListener("error", onFinished).removeListener("close", onAbort);
|
9943
9943
|
if (!err) {
|
@@ -9962,7 +9962,7 @@ upgrade: ${upgrade}\r
|
|
9962
9962
|
}
|
9963
9963
|
__name(writeStream, "writeStream");
|
9964
9964
|
async function writeBlob({ h2stream, body, client, request: request4, socket, contentLength, header, expectsPayload }) {
|
9965
|
-
|
9965
|
+
assert39(contentLength === body.size, "blob body must have content length");
|
9966
9966
|
const isH22 = client[kHTTPConnVersion] === "h2";
|
9967
9967
|
try {
|
9968
9968
|
if (contentLength != null && contentLength !== body.size) {
|
@@ -9993,7 +9993,7 @@ upgrade: ${upgrade}\r
|
|
9993
9993
|
}
|
9994
9994
|
__name(writeBlob, "writeBlob");
|
9995
9995
|
async function writeIterable({ h2stream, body, client, request: request4, socket, contentLength, header, expectsPayload }) {
|
9996
|
-
|
9996
|
+
assert39(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
|
9997
9997
|
let callback = null;
|
9998
9998
|
function onDrain() {
|
9999
9999
|
if (callback) {
|
@@ -10004,7 +10004,7 @@ upgrade: ${upgrade}\r
|
|
10004
10004
|
}
|
10005
10005
|
__name(onDrain, "onDrain");
|
10006
10006
|
const waitForDrain = /* @__PURE__ */ __name(() => new Promise((resolve24, reject) => {
|
10007
|
-
|
10007
|
+
assert39(callback === null);
|
10008
10008
|
if (socket[kError]) {
|
10009
10009
|
reject(socket[kError]);
|
10010
10010
|
} else {
|
@@ -10156,7 +10156,7 @@ ${len.toString(16)}\r
|
|
10156
10156
|
const { socket, client } = this;
|
10157
10157
|
socket[kWriting] = false;
|
10158
10158
|
if (err) {
|
10159
|
-
|
10159
|
+
assert39(client[kRunning] <= 1, "pipeline should only contain this request");
|
10160
10160
|
util5.destroy(socket, err);
|
10161
10161
|
}
|
10162
10162
|
}
|
@@ -10164,7 +10164,7 @@ ${len.toString(16)}\r
|
|
10164
10164
|
function errorRequest(client, request4, err) {
|
10165
10165
|
try {
|
10166
10166
|
request4.onError(err);
|
10167
|
-
|
10167
|
+
assert39(request4.aborted);
|
10168
10168
|
} catch (err2) {
|
10169
10169
|
client.emit("error", err2);
|
10170
10170
|
}
|
@@ -10838,7 +10838,7 @@ var require_readable = __commonJS({
|
|
10838
10838
|
"../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/api/readable.js"(exports2, module3) {
|
10839
10839
|
"use strict";
|
10840
10840
|
init_import_meta_url();
|
10841
|
-
var
|
10841
|
+
var assert39 = require("assert");
|
10842
10842
|
var { Readable: Readable8 } = require("stream");
|
10843
10843
|
var { RequestAbortedError, NotSupportedError, InvalidArgumentError } = require_errors();
|
10844
10844
|
var util5 = require_util();
|
@@ -10950,7 +10950,7 @@ var require_readable = __commonJS({
|
|
10950
10950
|
this[kBody] = ReadableStreamFrom(this);
|
10951
10951
|
if (this[kConsume]) {
|
10952
10952
|
this[kBody].getReader();
|
10953
|
-
|
10953
|
+
assert39(this[kBody].locked);
|
10954
10954
|
}
|
10955
10955
|
}
|
10956
10956
|
return this[kBody];
|
@@ -11003,7 +11003,7 @@ var require_readable = __commonJS({
|
|
11003
11003
|
if (isUnusable(stream2)) {
|
11004
11004
|
throw new TypeError("unusable");
|
11005
11005
|
}
|
11006
|
-
|
11006
|
+
assert39(!stream2[kConsume]);
|
11007
11007
|
return new Promise((resolve24, reject) => {
|
11008
11008
|
stream2[kConsume] = {
|
11009
11009
|
type,
|
@@ -11100,13 +11100,13 @@ var require_readable = __commonJS({
|
|
11100
11100
|
var require_util3 = __commonJS({
|
11101
11101
|
"../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/api/util.js"(exports2, module3) {
|
11102
11102
|
init_import_meta_url();
|
11103
|
-
var
|
11103
|
+
var assert39 = require("assert");
|
11104
11104
|
var {
|
11105
11105
|
ResponseStatusCodeError
|
11106
11106
|
} = require_errors();
|
11107
11107
|
var { toUSVString } = require_util();
|
11108
11108
|
async function getResolveErrorBodyCallback({ callback, body, contentType, statusCode, statusMessage, headers }) {
|
11109
|
-
|
11109
|
+
assert39(body);
|
11110
11110
|
let chunks = [];
|
11111
11111
|
let limit = 0;
|
11112
11112
|
for await (const chunk of body) {
|
@@ -11550,7 +11550,7 @@ var require_api_pipeline = __commonJS({
|
|
11550
11550
|
var util5 = require_util();
|
11551
11551
|
var { AsyncResource } = require("async_hooks");
|
11552
11552
|
var { addSignal, removeSignal } = require_abort_signal();
|
11553
|
-
var
|
11553
|
+
var assert39 = require("assert");
|
11554
11554
|
var kResume = Symbol("resume");
|
11555
11555
|
var PipelineRequest = class extends Readable8 {
|
11556
11556
|
static {
|
@@ -11659,7 +11659,7 @@ var require_api_pipeline = __commonJS({
|
|
11659
11659
|
}
|
11660
11660
|
onConnect(abort, context2) {
|
11661
11661
|
const { ret, res } = this;
|
11662
|
-
|
11662
|
+
assert39(!res, "pipeline cannot be retried");
|
11663
11663
|
if (ret.destroyed) {
|
11664
11664
|
throw new RequestAbortedError();
|
11665
11665
|
}
|
@@ -11750,7 +11750,7 @@ var require_api_upgrade = __commonJS({
|
|
11750
11750
|
var { AsyncResource } = require("async_hooks");
|
11751
11751
|
var util5 = require_util();
|
11752
11752
|
var { addSignal, removeSignal } = require_abort_signal();
|
11753
|
-
var
|
11753
|
+
var assert39 = require("assert");
|
11754
11754
|
var UpgradeHandler = class extends AsyncResource {
|
11755
11755
|
static {
|
11756
11756
|
__name(this, "UpgradeHandler");
|
@@ -11786,7 +11786,7 @@ var require_api_upgrade = __commonJS({
|
|
11786
11786
|
}
|
11787
11787
|
onUpgrade(statusCode, rawHeaders, socket) {
|
11788
11788
|
const { callback, opaque, context: context2 } = this;
|
11789
|
-
|
11789
|
+
assert39.strictEqual(statusCode, 101);
|
11790
11790
|
removeSignal(this);
|
11791
11791
|
this.callback = null;
|
11792
11792
|
const headers = this.responseHeaders === "raw" ? util5.parseRawHeaders(rawHeaders) : util5.parseHeaders(rawHeaders);
|
@@ -12967,7 +12967,7 @@ var require_proxy_agent = __commonJS({
|
|
12967
12967
|
var require_RetryHandler = __commonJS({
|
12968
12968
|
"../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/handler/RetryHandler.js"(exports2, module3) {
|
12969
12969
|
init_import_meta_url();
|
12970
|
-
var
|
12970
|
+
var assert39 = require("assert");
|
12971
12971
|
var { kRetryHandlerDefaultRetry } = require_symbols();
|
12972
12972
|
var { RequestRetryError } = require_errors();
|
12973
12973
|
var { isDisturbed, parseHeaders: parseHeaders2, parseRangeHeader } = require_util();
|
@@ -13136,8 +13136,8 @@ var require_RetryHandler = __commonJS({
|
|
13136
13136
|
return false;
|
13137
13137
|
}
|
13138
13138
|
const { start, size, end = size } = contentRange;
|
13139
|
-
|
13140
|
-
|
13139
|
+
assert39(this.start === start, "content-range mismatch");
|
13140
|
+
assert39(this.end == null || this.end === end, "content-range mismatch");
|
13141
13141
|
this.resume = resume;
|
13142
13142
|
return true;
|
13143
13143
|
}
|
@@ -13153,12 +13153,12 @@ var require_RetryHandler = __commonJS({
|
|
13153
13153
|
);
|
13154
13154
|
}
|
13155
13155
|
const { start, size, end = size } = range;
|
13156
|
-
|
13156
|
+
assert39(
|
13157
13157
|
start != null && Number.isFinite(start) && this.start !== start,
|
13158
13158
|
"content-range mismatch"
|
13159
13159
|
);
|
13160
|
-
|
13161
|
-
|
13160
|
+
assert39(Number.isFinite(start));
|
13161
|
+
assert39(
|
13162
13162
|
end != null && Number.isFinite(end) && this.end !== end,
|
13163
13163
|
"invalid content-length"
|
13164
13164
|
);
|
@@ -13169,8 +13169,8 @@ var require_RetryHandler = __commonJS({
|
|
13169
13169
|
const contentLength = headers["content-length"];
|
13170
13170
|
this.end = contentLength != null ? Number(contentLength) : null;
|
13171
13171
|
}
|
13172
|
-
|
13173
|
-
|
13172
|
+
assert39(Number.isFinite(this.start));
|
13173
|
+
assert39(
|
13174
13174
|
this.end == null || Number.isFinite(this.end),
|
13175
13175
|
"invalid content-length"
|
13176
13176
|
);
|
@@ -13321,7 +13321,7 @@ var require_headers = __commonJS({
|
|
13321
13321
|
isValidHeaderValue
|
13322
13322
|
} = require_util2();
|
13323
13323
|
var { webidl } = require_webidl();
|
13324
|
-
var
|
13324
|
+
var assert39 = require("assert");
|
13325
13325
|
var kHeadersMap = Symbol("headers map");
|
13326
13326
|
var kHeadersSortedMap = Symbol("headers map sorted");
|
13327
13327
|
function isHTTPWhiteSpaceCharCode(code) {
|
@@ -13589,7 +13589,7 @@ var require_headers = __commonJS({
|
|
13589
13589
|
headers.push([name2, cookies[j6]]);
|
13590
13590
|
}
|
13591
13591
|
} else {
|
13592
|
-
|
13592
|
+
assert39(value !== null);
|
13593
13593
|
headers.push([name2, value]);
|
13594
13594
|
}
|
13595
13595
|
}
|
@@ -13733,7 +13733,7 @@ var require_response = __commonJS({
|
|
13733
13733
|
var { getGlobalOrigin } = require_global();
|
13734
13734
|
var { URLSerializer } = require_dataURL();
|
13735
13735
|
var { kHeadersList, kConstruct } = require_symbols();
|
13736
|
-
var
|
13736
|
+
var assert39 = require("assert");
|
13737
13737
|
var { types } = require("util");
|
13738
13738
|
var ReadableStream3 = globalThis.ReadableStream || require("stream/web").ReadableStream;
|
13739
13739
|
var textEncoder = new TextEncoder("utf-8");
|
@@ -13955,7 +13955,7 @@ var require_response = __commonJS({
|
|
13955
13955
|
return p6 in state2 ? state2[p6] : target[p6];
|
13956
13956
|
},
|
13957
13957
|
set(target, p6, value) {
|
13958
|
-
|
13958
|
+
assert39(!(p6 in state2));
|
13959
13959
|
target[p6] = value;
|
13960
13960
|
return true;
|
13961
13961
|
}
|
@@ -13990,12 +13990,12 @@ var require_response = __commonJS({
|
|
13990
13990
|
body: null
|
13991
13991
|
});
|
13992
13992
|
} else {
|
13993
|
-
|
13993
|
+
assert39(false);
|
13994
13994
|
}
|
13995
13995
|
}
|
13996
13996
|
__name(filterResponse, "filterResponse");
|
13997
13997
|
function makeAppropriateNetworkError(fetchParams, err = null) {
|
13998
|
-
|
13998
|
+
assert39(isCancelled(fetchParams));
|
13999
13999
|
return isAborted2(fetchParams) ? makeNetworkError(Object.assign(new DOMException2("The operation was aborted.", "AbortError"), { cause: err })) : makeNetworkError(Object.assign(new DOMException2("Request was cancelled."), { cause: err }));
|
14000
14000
|
}
|
14001
14001
|
__name(makeAppropriateNetworkError, "makeAppropriateNetworkError");
|
@@ -14126,7 +14126,7 @@ var require_request2 = __commonJS({
|
|
14126
14126
|
var { getGlobalOrigin } = require_global();
|
14127
14127
|
var { URLSerializer } = require_dataURL();
|
14128
14128
|
var { kHeadersList, kConstruct } = require_symbols();
|
14129
|
-
var
|
14129
|
+
var assert39 = require("assert");
|
14130
14130
|
var { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require("events");
|
14131
14131
|
var TransformStream3 = globalThis.TransformStream;
|
14132
14132
|
var kAbortController = Symbol("abortController");
|
@@ -14173,7 +14173,7 @@ var require_request2 = __commonJS({
|
|
14173
14173
|
request4 = makeRequest({ urlList: [parsedURL] });
|
14174
14174
|
fallbackMode = "cors";
|
14175
14175
|
} else {
|
14176
|
-
|
14176
|
+
assert39(input instanceof _Request);
|
14177
14177
|
request4 = input[kState];
|
14178
14178
|
signal = input[kSignal];
|
14179
14179
|
}
|
@@ -14785,7 +14785,7 @@ var require_fetch = __commonJS({
|
|
14785
14785
|
urlHasHttpsScheme
|
14786
14786
|
} = require_util2();
|
14787
14787
|
var { kState, kHeaders, kGuard, kRealm } = require_symbols2();
|
14788
|
-
var
|
14788
|
+
var assert39 = require("assert");
|
14789
14789
|
var { safelyExtractBody } = require_body();
|
14790
14790
|
var {
|
14791
14791
|
redirectStatusSet,
|
@@ -14868,7 +14868,7 @@ var require_fetch = __commonJS({
|
|
14868
14868
|
requestObject.signal,
|
14869
14869
|
() => {
|
14870
14870
|
locallyAborted = true;
|
14871
|
-
|
14871
|
+
assert39(controller != null);
|
14872
14872
|
controller.abort(requestObject.signal.reason);
|
14873
14873
|
abortFetch(p6, request4, responseObject, requestObject.signal.reason);
|
14874
14874
|
}
|
@@ -15005,7 +15005,7 @@ var require_fetch = __commonJS({
|
|
15005
15005
|
taskDestination,
|
15006
15006
|
crossOriginIsolatedCapability
|
15007
15007
|
};
|
15008
|
-
|
15008
|
+
assert39(!request4.body || request4.body.stream);
|
15009
15009
|
if (request4.window === "client") {
|
15010
15010
|
request4.window = request4.client?.globalObject?.constructor?.name === "Window" ? request4.client : "no-window";
|
15011
15011
|
}
|
@@ -15099,7 +15099,7 @@ var require_fetch = __commonJS({
|
|
15099
15099
|
} else if (request4.responseTainting === "opaque") {
|
15100
15100
|
response = filterResponse(response, "opaque");
|
15101
15101
|
} else {
|
15102
|
-
|
15102
|
+
assert39(false);
|
15103
15103
|
}
|
15104
15104
|
}
|
15105
15105
|
let internalResponse = response.status === 0 ? response : response.internalResponse;
|
@@ -15295,7 +15295,7 @@ var require_fetch = __commonJS({
|
|
15295
15295
|
} else if (request4.redirect === "follow") {
|
15296
15296
|
response = await httpRedirectFetch(fetchParams, response);
|
15297
15297
|
} else {
|
15298
|
-
|
15298
|
+
assert39(false);
|
15299
15299
|
}
|
15300
15300
|
}
|
15301
15301
|
response.timingInfo = timingInfo;
|
@@ -15349,7 +15349,7 @@ var require_fetch = __commonJS({
|
|
15349
15349
|
request4.headersList.delete("host");
|
15350
15350
|
}
|
15351
15351
|
if (request4.body != null) {
|
15352
|
-
|
15352
|
+
assert39(request4.body.source != null);
|
15353
15353
|
request4.body = safelyExtractBody(request4.body.source)[0];
|
15354
15354
|
}
|
15355
15355
|
const timingInfo = fetchParams.timingInfo;
|
@@ -15484,7 +15484,7 @@ var require_fetch = __commonJS({
|
|
15484
15484
|
}
|
15485
15485
|
__name(httpNetworkOrCacheFetch, "httpNetworkOrCacheFetch");
|
15486
15486
|
async function httpNetworkFetch(fetchParams, includeCredentials = false, forceNewConnection = false) {
|
15487
|
-
|
15487
|
+
assert39(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed);
|
15488
15488
|
fetchParams.controller.connection = {
|
15489
15489
|
abort: null,
|
15490
15490
|
destroyed: false,
|
@@ -16642,7 +16642,7 @@ var require_util5 = __commonJS({
|
|
16642
16642
|
"../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/cache/util.js"(exports2, module3) {
|
16643
16643
|
"use strict";
|
16644
16644
|
init_import_meta_url();
|
16645
|
-
var
|
16645
|
+
var assert39 = require("assert");
|
16646
16646
|
var { URLSerializer } = require_dataURL();
|
16647
16647
|
var { isValidHeaderName } = require_util2();
|
16648
16648
|
function urlEquals(A3, B3, excludeFragment = false) {
|
@@ -16652,7 +16652,7 @@ var require_util5 = __commonJS({
|
|
16652
16652
|
}
|
16653
16653
|
__name(urlEquals, "urlEquals");
|
16654
16654
|
function fieldValues(header) {
|
16655
|
-
|
16655
|
+
assert39(header !== null);
|
16656
16656
|
const values = [];
|
16657
16657
|
for (let value of header.split(",")) {
|
16658
16658
|
value = value.trim();
|
@@ -16688,7 +16688,7 @@ var require_cache = __commonJS({
|
|
16688
16688
|
var { kState, kHeaders, kGuard, kRealm } = require_symbols2();
|
16689
16689
|
var { fetching } = require_fetch();
|
16690
16690
|
var { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = require_util2();
|
16691
|
-
var
|
16691
|
+
var assert39 = require("assert");
|
16692
16692
|
var { getGlobalDispatcher: getGlobalDispatcher2 } = require_global2();
|
16693
16693
|
var Cache2 = class _Cache {
|
16694
16694
|
static {
|
@@ -16952,7 +16952,7 @@ var require_cache = __commonJS({
|
|
16952
16952
|
return false;
|
16953
16953
|
}
|
16954
16954
|
} else {
|
16955
|
-
|
16955
|
+
assert39(typeof request4 === "string");
|
16956
16956
|
r7 = new Request4(request4)[kState];
|
16957
16957
|
}
|
16958
16958
|
const operations = [];
|
@@ -17061,7 +17061,7 @@ var require_cache = __commonJS({
|
|
17061
17061
|
}
|
17062
17062
|
for (const requestResponse of requestResponses) {
|
17063
17063
|
const idx = cache6.indexOf(requestResponse);
|
17064
|
-
|
17064
|
+
assert39(idx !== -1);
|
17065
17065
|
cache6.splice(idx, 1);
|
17066
17066
|
}
|
17067
17067
|
} else if (operation.type === "put") {
|
@@ -17093,7 +17093,7 @@ var require_cache = __commonJS({
|
|
17093
17093
|
requestResponses = this.#queryCache(operation.request);
|
17094
17094
|
for (const requestResponse of requestResponses) {
|
17095
17095
|
const idx = cache6.indexOf(requestResponse);
|
17096
|
-
|
17096
|
+
assert39(idx !== -1);
|
17097
17097
|
cache6.splice(idx, 1);
|
17098
17098
|
}
|
17099
17099
|
cache6.push([operation.request, operation.response]);
|
@@ -17338,7 +17338,7 @@ var require_util6 = __commonJS({
|
|
17338
17338
|
"../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/cookies/util.js"(exports2, module3) {
|
17339
17339
|
"use strict";
|
17340
17340
|
init_import_meta_url();
|
17341
|
-
var
|
17341
|
+
var assert39 = require("assert");
|
17342
17342
|
var { kHeadersList } = require_symbols();
|
17343
17343
|
function isCTLExcludingHtab(value) {
|
17344
17344
|
if (value.length === 0) {
|
@@ -17380,8 +17380,8 @@ var require_util6 = __commonJS({
|
|
17380
17380
|
}
|
17381
17381
|
}
|
17382
17382
|
__name(validateCookiePath, "validateCookiePath");
|
17383
|
-
function validateCookieDomain(
|
17384
|
-
if (
|
17383
|
+
function validateCookieDomain(domain2) {
|
17384
|
+
if (domain2.startsWith("-") || domain2.endsWith(".") || domain2.endsWith("-")) {
|
17385
17385
|
throw new Error("Invalid cookie domain");
|
17386
17386
|
}
|
17387
17387
|
}
|
@@ -17487,10 +17487,10 @@ var require_util6 = __commonJS({
|
|
17487
17487
|
kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
|
17488
17488
|
(symbol) => symbol.description === "headers list"
|
17489
17489
|
);
|
17490
|
-
|
17490
|
+
assert39(kHeadersListNode, "Headers cannot be parsed");
|
17491
17491
|
}
|
17492
17492
|
const headersList = headers[kHeadersListNode];
|
17493
|
-
|
17493
|
+
assert39(headersList);
|
17494
17494
|
return headersList;
|
17495
17495
|
}
|
17496
17496
|
__name(getHeadersList, "getHeadersList");
|
@@ -17510,7 +17510,7 @@ var require_parse = __commonJS({
|
|
17510
17510
|
var { maxNameValuePairSize, maxAttributeValueSize } = require_constants4();
|
17511
17511
|
var { isCTLExcludingHtab } = require_util6();
|
17512
17512
|
var { collectASequenceOfCodePointsFast } = require_dataURL();
|
17513
|
-
var
|
17513
|
+
var assert39 = require("assert");
|
17514
17514
|
function parseSetCookie(header) {
|
17515
17515
|
if (isCTLExcludingHtab(header)) {
|
17516
17516
|
return null;
|
@@ -17553,7 +17553,7 @@ var require_parse = __commonJS({
|
|
17553
17553
|
if (unparsedAttributes.length === 0) {
|
17554
17554
|
return cookieAttributeList;
|
17555
17555
|
}
|
17556
|
-
|
17556
|
+
assert39(unparsedAttributes[0] === ";");
|
17557
17557
|
unparsedAttributes = unparsedAttributes.slice(1);
|
17558
17558
|
let cookieAv = "";
|
17559
17559
|
if (unparsedAttributes.includes(";")) {
|
@@ -26020,7 +26020,7 @@ function getComplianceRegionSubdomain(complianceConfig) {
|
|
26020
26020
|
function getStagingSubdomain() {
|
26021
26021
|
return getCloudflareApiEnvironmentFromEnv() === "staging" ? ".staging" : "";
|
26022
26022
|
}
|
26023
|
-
var import_node_path2, getC3CommandFromEnv, getWranglerSendMetricsFromEnv, getCloudflareApiEnvironmentFromEnv, COMPLIANCE_REGION_CONFIG_PUBLIC, COMPLIANCE_REGION_CONFIG_UNKNOWN, getCloudflareComplianceRegionFromEnv, getCloudflareComplianceRegion, getCloudflareApiBaseUrlFromEnv, getCloudflareApiBaseUrl, getSanitizeLogs, getOutputFileDirectoryFromEnv, getOutputFilePathFromEnv, getCIMatchTag, getCIOverrideName, getCIOverrideNetworkModeHost, getCIGeneratePreviewAlias, getBuildConditionsFromEnv, getBuildPlatformFromEnv,
|
26023
|
+
var import_node_path2, getC3CommandFromEnv, getWranglerSendMetricsFromEnv, getCloudflareApiEnvironmentFromEnv, COMPLIANCE_REGION_CONFIG_PUBLIC, COMPLIANCE_REGION_CONFIG_UNKNOWN, getCloudflareComplianceRegionFromEnv, getCloudflareComplianceRegion, getCloudflareApiBaseUrlFromEnv, getCloudflareApiBaseUrl, getSanitizeLogs, getOutputFileDirectoryFromEnv, getOutputFilePathFromEnv, getCIMatchTag, getCIOverrideName, getCIOverrideNetworkModeHost, getCIGeneratePreviewAlias, getBuildConditionsFromEnv, getBuildPlatformFromEnv, getRegistryPath, getDockerPath;
|
26024
26024
|
var init_misc_variables = __esm({
|
26025
26025
|
"src/environment-variables/misc-variables.ts"() {
|
26026
26026
|
init_import_meta_url();
|
@@ -26103,9 +26103,6 @@ var init_misc_variables = __esm({
|
|
26103
26103
|
getBuildPlatformFromEnv = getEnvironmentVariableFactory({
|
26104
26104
|
variableName: "WRANGLER_BUILD_PLATFORM"
|
26105
26105
|
});
|
26106
|
-
getUnenvResolvePathsFromEnv = getEnvironmentVariableFactory({
|
26107
|
-
variableName: "WRANGLER_UNENV_RESOLVE_PATHS"
|
26108
|
-
});
|
26109
26106
|
getRegistryPath = getEnvironmentVariableFactory({
|
26110
26107
|
variableName: "WRANGLER_REGISTRY_PATH",
|
26111
26108
|
defaultValue() {
|
@@ -26173,7 +26170,7 @@ var require_signal_exit = __commonJS({
|
|
26173
26170
|
};
|
26174
26171
|
};
|
26175
26172
|
} else {
|
26176
|
-
|
26173
|
+
assert39 = require("assert");
|
26177
26174
|
signals = require_signals();
|
26178
26175
|
isWin = /^win/i.test(process11.platform);
|
26179
26176
|
EE = require("events");
|
@@ -26196,7 +26193,7 @@ var require_signal_exit = __commonJS({
|
|
26196
26193
|
return function() {
|
26197
26194
|
};
|
26198
26195
|
}
|
26199
|
-
|
26196
|
+
assert39.equal(typeof cb2, "function", "a callback must be provided for exit handler");
|
26200
26197
|
if (loaded === false) {
|
26201
26198
|
load();
|
26202
26199
|
}
|
@@ -26302,7 +26299,7 @@ var require_signal_exit = __commonJS({
|
|
26302
26299
|
}
|
26303
26300
|
}, "processEmit");
|
26304
26301
|
}
|
26305
|
-
var
|
26302
|
+
var assert39;
|
26306
26303
|
var signals;
|
26307
26304
|
var isWin;
|
26308
26305
|
var EE;
|
@@ -26908,7 +26905,7 @@ var name, version;
|
|
26908
26905
|
var init_package = __esm({
|
26909
26906
|
"package.json"() {
|
26910
26907
|
name = "wrangler";
|
26911
|
-
version = "4.20.
|
26908
|
+
version = "4.20.1";
|
26912
26909
|
}
|
26913
26910
|
});
|
26914
26911
|
|
@@ -34961,7 +34958,7 @@ function normalizeAndValidateConfig(rawConfig, configPath, userConfigPath, args)
|
|
34961
34958
|
const envName = args.env;
|
34962
34959
|
(0, import_node_assert.default)(envName === void 0 || typeof envName === "string");
|
34963
34960
|
let activeEnv = topLevelEnv;
|
34964
|
-
if (envName
|
34961
|
+
if (envName) {
|
34965
34962
|
if (isRedirectedConfig) {
|
34966
34963
|
if (!isPagesConfig(rawConfig)) {
|
34967
34964
|
diagnostics.errors.push(dedent`
|
@@ -46471,44 +46468,44 @@ var init_open_in_browser = __esm({
|
|
46471
46468
|
});
|
46472
46469
|
|
46473
46470
|
// src/user/access.ts
|
46474
|
-
async function domainUsesAccess(
|
46475
|
-
logger.debug("Checking if domain has Access enabled:",
|
46476
|
-
if (usesAccessCache.has(
|
46471
|
+
async function domainUsesAccess(domain2) {
|
46472
|
+
logger.debug("Checking if domain has Access enabled:", domain2);
|
46473
|
+
if (usesAccessCache.has(domain2)) {
|
46477
46474
|
logger.debug(
|
46478
46475
|
"Using cached Access switch for:",
|
46479
|
-
|
46480
|
-
usesAccessCache.get(
|
46476
|
+
domain2,
|
46477
|
+
usesAccessCache.get(domain2)
|
46481
46478
|
);
|
46482
|
-
return usesAccessCache.get(
|
46479
|
+
return usesAccessCache.get(domain2);
|
46483
46480
|
}
|
46484
|
-
logger.debug("Access switch not cached for:",
|
46481
|
+
logger.debug("Access switch not cached for:", domain2);
|
46485
46482
|
try {
|
46486
46483
|
const controller = new AbortController();
|
46487
46484
|
const cancel3 = setTimeout(() => {
|
46488
46485
|
controller.abort();
|
46489
46486
|
}, 1e3);
|
46490
|
-
const output = await (0, import_undici.fetch)(`https://${
|
46487
|
+
const output = await (0, import_undici.fetch)(`https://${domain2}`, {
|
46491
46488
|
redirect: "manual",
|
46492
46489
|
signal: controller.signal
|
46493
46490
|
});
|
46494
46491
|
clearTimeout(cancel3);
|
46495
46492
|
const usesAccess = !!(output.status === 302 && output.headers.get("location")?.includes("cloudflareaccess.com"));
|
46496
|
-
logger.debug("Caching access switch for:",
|
46497
|
-
usesAccessCache.set(
|
46493
|
+
logger.debug("Caching access switch for:", domain2);
|
46494
|
+
usesAccessCache.set(domain2, usesAccess);
|
46498
46495
|
return usesAccess;
|
46499
46496
|
} catch (e7) {
|
46500
|
-
usesAccessCache.set(
|
46497
|
+
usesAccessCache.set(domain2, false);
|
46501
46498
|
return false;
|
46502
46499
|
}
|
46503
46500
|
}
|
46504
|
-
async function getAccessToken(
|
46505
|
-
if (!await domainUsesAccess(
|
46501
|
+
async function getAccessToken(domain2) {
|
46502
|
+
if (!await domainUsesAccess(domain2)) {
|
46506
46503
|
return void 0;
|
46507
46504
|
}
|
46508
|
-
if (cache[
|
46509
|
-
return cache[
|
46505
|
+
if (cache[domain2]) {
|
46506
|
+
return cache[domain2];
|
46510
46507
|
}
|
46511
|
-
const output = (0, import_child_process.spawnSync)("cloudflared", ["access", "login",
|
46508
|
+
const output = (0, import_child_process.spawnSync)("cloudflared", ["access", "login", domain2]);
|
46512
46509
|
if (output.error) {
|
46513
46510
|
throw new UserError(
|
46514
46511
|
"To use Wrangler with Cloudflare Access, please install `cloudflared` from https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/installation"
|
@@ -46517,7 +46514,7 @@ async function getAccessToken(domain3) {
|
|
46517
46514
|
const stringOutput = output.stdout.toString();
|
46518
46515
|
const matches = stringOutput.match(/fetched your token:\n\n(.*)/m);
|
46519
46516
|
if (matches && matches.length >= 2) {
|
46520
|
-
cache[
|
46517
|
+
cache[domain2] = matches[1];
|
46521
46518
|
return matches[1];
|
46522
46519
|
}
|
46523
46520
|
throw new Error("Failed to authenticate with Cloudflare Access");
|
@@ -55234,7 +55231,7 @@ function parseStaticRouting(input) {
|
|
55234
55231
|
}
|
55235
55232
|
if (input.length > MAX_ROUTES_RULES) {
|
55236
55233
|
throw new Error(
|
55237
|
-
`Too many rules were provided; ${input.length} rules provided exceeds max of ${MAX_ROUTES_RULES}
|
55234
|
+
`Too many \`run_worker_first\` rules were provided; ${input.length} rules provided exceeds max of ${MAX_ROUTES_RULES}.`
|
55238
55235
|
);
|
55239
55236
|
}
|
55240
55237
|
const rawAssetWorkerRules = [];
|
@@ -55255,7 +55252,7 @@ function parseStaticRouting(input) {
|
|
55255
55252
|
}
|
55256
55253
|
if (assetWorkerRules.length > 0 && userWorkerRules.length === 0) {
|
55257
55254
|
throw new Error(
|
55258
|
-
|
55255
|
+
"Only negative `run_worker_first` rules were provided; must provide at least 1 non-negative rule"
|
55259
55256
|
);
|
55260
55257
|
}
|
55261
55258
|
const invalidAssetWorkerRules = validateStaticRoutingRules(rawAssetWorkerRules);
|
@@ -55265,10 +55262,10 @@ function parseStaticRouting(input) {
|
|
55265
55262
|
...invalidUserWorkerRules,
|
55266
55263
|
...invalidAssetWorkerRules
|
55267
55264
|
]);
|
55268
|
-
|
55269
|
-
|
55270
|
-
|
55271
|
-
};
|
55265
|
+
if (errorMessage) {
|
55266
|
+
throw new Error(errorMessage);
|
55267
|
+
}
|
55268
|
+
return { asset_worker: assetWorkerRules, user_worker: userWorkerRules };
|
55272
55269
|
}
|
55273
55270
|
function validateStaticRoutingRules(rules) {
|
55274
55271
|
const invalid = [];
|
@@ -55304,7 +55301,7 @@ var init_parseStaticRouting = __esm({
|
|
55304
55301
|
if (invalidRules.length === 0) {
|
55305
55302
|
return void 0;
|
55306
55303
|
}
|
55307
|
-
return `Invalid routes in run_worker_first
|
55304
|
+
return `Invalid routes in \`run_worker_first\`:
|
55308
55305
|
` + invalidRules.join("\n");
|
55309
55306
|
}, "formatInvalidRoutes");
|
55310
55307
|
}
|
@@ -56676,15 +56673,9 @@ ${directory}`,
|
|
56676
56673
|
if (typeof config.assets?.run_worker_first === "boolean") {
|
56677
56674
|
routerConfig.invoke_user_worker_ahead_of_assets = config.assets.run_worker_first;
|
56678
56675
|
} else if (Array.isArray(config.assets?.run_worker_first)) {
|
56679
|
-
|
56676
|
+
routerConfig.static_routing = parseStaticRouting(
|
56680
56677
|
config.assets.run_worker_first
|
56681
56678
|
);
|
56682
|
-
if (errorMessage) {
|
56683
|
-
throw new UserError(errorMessage, {
|
56684
|
-
telemetryMessage: "invalid run_worker_first rules"
|
56685
|
-
});
|
56686
|
-
}
|
56687
|
-
routerConfig.static_routing = parsed;
|
56688
56679
|
}
|
56689
56680
|
if (routerConfig.invoke_user_worker_ahead_of_assets && !config?.assets?.binding) {
|
56690
56681
|
logger.warn(
|
@@ -57014,139 +57005,6 @@ Ensure all assets in your assets directory "${dir}" conform with the Workers max
|
|
57014
57005
|
}
|
57015
57006
|
});
|
57016
57007
|
|
57017
|
-
// src/versions/api.ts
|
57018
|
-
async function fetchVersion(complianceConfig, accountId, workerName, versionId, versionCache) {
|
57019
|
-
const cachedVersion = versionCache?.get(versionId);
|
57020
|
-
if (cachedVersion) {
|
57021
|
-
return cachedVersion;
|
57022
|
-
}
|
57023
|
-
const version5 = await fetchResult(
|
57024
|
-
complianceConfig,
|
57025
|
-
`/accounts/${accountId}/workers/scripts/${workerName}/versions/${versionId}`
|
57026
|
-
);
|
57027
|
-
versionCache?.set(version5.id, version5);
|
57028
|
-
return version5;
|
57029
|
-
}
|
57030
|
-
async function fetchVersions(complianceConfig, accountId, workerName, versionCache, ...versionIds) {
|
57031
|
-
return Promise.all(
|
57032
|
-
versionIds.map(
|
57033
|
-
(versionId) => fetchVersion(
|
57034
|
-
complianceConfig,
|
57035
|
-
accountId,
|
57036
|
-
workerName,
|
57037
|
-
versionId,
|
57038
|
-
versionCache
|
57039
|
-
)
|
57040
|
-
)
|
57041
|
-
);
|
57042
|
-
}
|
57043
|
-
async function fetchLatestDeployments(complianceConfig, accountId, workerName) {
|
57044
|
-
const { deployments } = await fetchResult(
|
57045
|
-
complianceConfig,
|
57046
|
-
`/accounts/${accountId}/workers/scripts/${workerName}/deployments`
|
57047
|
-
);
|
57048
|
-
return deployments;
|
57049
|
-
}
|
57050
|
-
async function fetchLatestDeployment(complianceConfig, accountId, workerName) {
|
57051
|
-
const deployments = await fetchLatestDeployments(
|
57052
|
-
complianceConfig,
|
57053
|
-
accountId,
|
57054
|
-
workerName
|
57055
|
-
);
|
57056
|
-
return deployments.at(0);
|
57057
|
-
}
|
57058
|
-
async function fetchDeploymentVersions(complianceConfig, accountId, workerName, deployment, versionCache) {
|
57059
|
-
if (!deployment) {
|
57060
|
-
return [[], /* @__PURE__ */ new Map()];
|
57061
|
-
}
|
57062
|
-
const versionTraffic = new Map(
|
57063
|
-
deployment.versions.map((v7) => [v7.version_id, v7.percentage])
|
57064
|
-
);
|
57065
|
-
const versions2 = await fetchVersions(
|
57066
|
-
complianceConfig,
|
57067
|
-
accountId,
|
57068
|
-
workerName,
|
57069
|
-
versionCache,
|
57070
|
-
...versionTraffic.keys()
|
57071
|
-
);
|
57072
|
-
return [versions2, versionTraffic];
|
57073
|
-
}
|
57074
|
-
async function fetchDeployableVersions(complianceConfig, accountId, workerName, versionCache) {
|
57075
|
-
const { items: versions2 } = await fetchResult(
|
57076
|
-
complianceConfig,
|
57077
|
-
`/accounts/${accountId}/workers/scripts/${workerName}/versions?deployable=true`
|
57078
|
-
);
|
57079
|
-
for (const version5 of versions2) {
|
57080
|
-
versionCache.set(version5.id, version5);
|
57081
|
-
}
|
57082
|
-
return versions2;
|
57083
|
-
}
|
57084
|
-
async function createDeployment(complianceConfig, accountId, workerName, versionTraffic, message, force) {
|
57085
|
-
return await fetchResult(
|
57086
|
-
complianceConfig,
|
57087
|
-
`/accounts/${accountId}/workers/scripts/${workerName}/deployments${force ? "?force=true" : ""}`,
|
57088
|
-
{
|
57089
|
-
method: "POST",
|
57090
|
-
headers: { "Content-Type": "application/json" },
|
57091
|
-
body: JSON.stringify({
|
57092
|
-
strategy: "percentage",
|
57093
|
-
versions: Array.from(versionTraffic).map(
|
57094
|
-
([version_id, percentage]) => ({ version_id, percentage })
|
57095
|
-
),
|
57096
|
-
annotations: {
|
57097
|
-
"workers/message": message
|
57098
|
-
}
|
57099
|
-
})
|
57100
|
-
}
|
57101
|
-
);
|
57102
|
-
}
|
57103
|
-
async function patchNonVersionedScriptSettings(complianceConfig, accountId, workerName, settings) {
|
57104
|
-
const res = await fetchResult(
|
57105
|
-
complianceConfig,
|
57106
|
-
`/accounts/${accountId}/workers/scripts/${workerName}/script-settings`,
|
57107
|
-
{
|
57108
|
-
method: "PATCH",
|
57109
|
-
headers: { "Content-Type": "application/json" },
|
57110
|
-
body: JSON.stringify(settings)
|
57111
|
-
}
|
57112
|
-
);
|
57113
|
-
return res;
|
57114
|
-
}
|
57115
|
-
var init_api = __esm({
|
57116
|
-
"src/versions/api.ts"() {
|
57117
|
-
init_import_meta_url();
|
57118
|
-
init_cfetch();
|
57119
|
-
__name(fetchVersion, "fetchVersion");
|
57120
|
-
__name(fetchVersions, "fetchVersions");
|
57121
|
-
__name(fetchLatestDeployments, "fetchLatestDeployments");
|
57122
|
-
__name(fetchLatestDeployment, "fetchLatestDeployment");
|
57123
|
-
__name(fetchDeploymentVersions, "fetchDeploymentVersions");
|
57124
|
-
__name(fetchDeployableVersions, "fetchDeployableVersions");
|
57125
|
-
__name(createDeployment, "createDeployment");
|
57126
|
-
__name(patchNonVersionedScriptSettings, "patchNonVersionedScriptSettings");
|
57127
|
-
}
|
57128
|
-
});
|
57129
|
-
|
57130
|
-
// ../cli/args.ts
|
57131
|
-
var processArgument;
|
57132
|
-
var init_args = __esm({
|
57133
|
-
"../cli/args.ts"() {
|
57134
|
-
init_import_meta_url();
|
57135
|
-
init_interactive();
|
57136
|
-
processArgument = /* @__PURE__ */ __name(async (args, name2, promptConfig) => {
|
57137
|
-
const value = args[name2];
|
57138
|
-
const result = await inputPrompt({
|
57139
|
-
...promptConfig,
|
57140
|
-
// Accept the default value if the arg is already set
|
57141
|
-
acceptDefault: promptConfig.acceptDefault ?? value !== void 0,
|
57142
|
-
defaultValue: value ?? promptConfig.defaultValue
|
57143
|
-
});
|
57144
|
-
args[name2] = result;
|
57145
|
-
return result;
|
57146
|
-
}, "processArgument");
|
57147
|
-
}
|
57148
|
-
});
|
57149
|
-
|
57150
57008
|
// ../containers-shared/src/client/core/ApiError.ts
|
57151
57009
|
var ApiError;
|
57152
57010
|
var init_ApiError = __esm({
|
@@ -58686,12 +58544,12 @@ var init_ImageRegistriesService = __esm({
|
|
58686
58544
|
* @returns AccountRegistryToken Credentials with 'pull' or 'push' permissions to access the registry
|
58687
58545
|
* @throws ApiError
|
58688
58546
|
*/
|
58689
|
-
static generateImageRegistryCredentials(
|
58547
|
+
static generateImageRegistryCredentials(domain2, requestBody) {
|
58690
58548
|
return request(OpenAPI, {
|
58691
58549
|
method: "POST",
|
58692
58550
|
url: "/registries/{domain}/credentials",
|
58693
58551
|
path: {
|
58694
|
-
domain:
|
58552
|
+
domain: domain2
|
58695
58553
|
},
|
58696
58554
|
body: requestBody,
|
58697
58555
|
mediaType: "application/json",
|
@@ -58710,12 +58568,12 @@ var init_ImageRegistriesService = __esm({
|
|
58710
58568
|
* @returns EmptyResponse The image registry is deleted
|
58711
58569
|
* @throws ApiError
|
58712
58570
|
*/
|
58713
|
-
static deleteImageRegistry(
|
58571
|
+
static deleteImageRegistry(domain2) {
|
58714
58572
|
return request(OpenAPI, {
|
58715
58573
|
method: "DELETE",
|
58716
58574
|
url: "/registries/{domain}",
|
58717
58575
|
path: {
|
58718
|
-
domain:
|
58576
|
+
domain: domain2
|
58719
58577
|
},
|
58720
58578
|
errors: {
|
58721
58579
|
404: `The image registry does not exist`,
|
@@ -59196,25 +59054,36 @@ var init_build = __esm({
|
|
59196
59054
|
}
|
59197
59055
|
});
|
59198
59056
|
|
59199
|
-
// ../containers-shared/src/
|
59200
|
-
var
|
59201
|
-
var
|
59202
|
-
"../containers-shared/src/
|
59057
|
+
// ../containers-shared/src/knobs.ts
|
59058
|
+
var getCloudflareContainerRegistry;
|
59059
|
+
var init_knobs = __esm({
|
59060
|
+
"../containers-shared/src/knobs.ts"() {
|
59203
59061
|
init_import_meta_url();
|
59204
|
-
|
59062
|
+
getCloudflareContainerRegistry = /* @__PURE__ */ __name(() => {
|
59063
|
+
return process.env.CLOUDFLARE_CONTAINER_REGISTRY ?? "registry.cloudflare.com";
|
59064
|
+
}, "getCloudflareContainerRegistry");
|
59205
59065
|
}
|
59206
59066
|
});
|
59207
59067
|
|
59208
59068
|
// ../containers-shared/src/login.ts
|
59209
59069
|
async function dockerLoginManagedRegistry(pathToDocker) {
|
59210
59070
|
const expirationMinutes = 15;
|
59211
|
-
const credentials = await ImageRegistriesService.generateImageRegistryCredentials(
|
59212
|
-
|
59213
|
-
|
59214
|
-
|
59071
|
+
const credentials = await ImageRegistriesService.generateImageRegistryCredentials(
|
59072
|
+
getCloudflareContainerRegistry(),
|
59073
|
+
{
|
59074
|
+
expiration_minutes: expirationMinutes,
|
59075
|
+
permissions: ["push"]
|
59076
|
+
}
|
59077
|
+
);
|
59215
59078
|
const child = (0, import_node_child_process.spawn)(
|
59216
59079
|
pathToDocker,
|
59217
|
-
[
|
59080
|
+
[
|
59081
|
+
"login",
|
59082
|
+
"--password-stdin",
|
59083
|
+
"--username",
|
59084
|
+
"v1",
|
59085
|
+
getCloudflareContainerRegistry()
|
59086
|
+
],
|
59218
59087
|
{ stdio: ["pipe", "inherit", "inherit"] }
|
59219
59088
|
).on("error", (err) => {
|
59220
59089
|
throw err;
|
@@ -59237,17 +59106,22 @@ var init_login = __esm({
|
|
59237
59106
|
init_import_meta_url();
|
59238
59107
|
import_node_child_process = require("child_process");
|
59239
59108
|
init_client2();
|
59240
|
-
|
59109
|
+
init_knobs();
|
59241
59110
|
__name(dockerLoginManagedRegistry, "dockerLoginManagedRegistry");
|
59242
59111
|
}
|
59243
59112
|
});
|
59244
59113
|
|
59245
59114
|
// ../containers-shared/src/utils.ts
|
59246
|
-
|
59115
|
+
function isDir(path70) {
|
59116
|
+
const stats = (0, import_fs11.statSync)(path70);
|
59117
|
+
return stats.isDirectory();
|
59118
|
+
}
|
59119
|
+
var import_child_process3, import_fs11, runDockerCmd, isDockerfile;
|
59247
59120
|
var init_utils2 = __esm({
|
59248
59121
|
"../containers-shared/src/utils.ts"() {
|
59249
59122
|
init_import_meta_url();
|
59250
59123
|
import_child_process3 = require("child_process");
|
59124
|
+
import_fs11 = require("fs");
|
59251
59125
|
runDockerCmd = /* @__PURE__ */ __name(async (dockerPath, args, stdio) => {
|
59252
59126
|
const child = (0, import_child_process3.spawn)(dockerPath, args, {
|
59253
59127
|
stdio: stdio ?? "inherit"
|
@@ -59270,6 +59144,39 @@ var init_utils2 = __esm({
|
|
59270
59144
|
});
|
59271
59145
|
});
|
59272
59146
|
}, "runDockerCmd");
|
59147
|
+
__name(isDir, "isDir");
|
59148
|
+
isDockerfile = /* @__PURE__ */ __name((image) => {
|
59149
|
+
if ((0, import_fs11.existsSync)(image)) {
|
59150
|
+
if (isDir(image)) {
|
59151
|
+
throw new Error(
|
59152
|
+
`${image} is a directory, you should specify a path to the Dockerfile`
|
59153
|
+
);
|
59154
|
+
}
|
59155
|
+
return true;
|
59156
|
+
}
|
59157
|
+
const errorPrefix = `The image "${image}" does not appear to be a valid path to a Dockerfile, or a valid image registry path:
|
59158
|
+
`;
|
59159
|
+
try {
|
59160
|
+
new URL(`https://${image}`);
|
59161
|
+
} catch (e7) {
|
59162
|
+
if (e7 instanceof Error) {
|
59163
|
+
throw new Error(errorPrefix + e7.message);
|
59164
|
+
}
|
59165
|
+
throw e7;
|
59166
|
+
}
|
59167
|
+
const imageParts = image.split("/");
|
59168
|
+
if (!imageParts[imageParts.length - 1].includes(":")) {
|
59169
|
+
throw new Error(
|
59170
|
+
errorPrefix + `If this is an image registry path, it needs to include at least a tag ':' (e.g: docker.io/httpd:1)`
|
59171
|
+
);
|
59172
|
+
}
|
59173
|
+
if (image.includes("://")) {
|
59174
|
+
throw new Error(
|
59175
|
+
errorPrefix + `Image reference should not include the protocol part (e.g: docker.io/httpd:1, not https://docker.io/httpd:1)`
|
59176
|
+
);
|
59177
|
+
}
|
59178
|
+
return false;
|
59179
|
+
}, "isDockerfile");
|
59273
59180
|
}
|
59274
59181
|
});
|
59275
59182
|
|
@@ -59314,6 +59221,18 @@ var init_inspect = __esm({
|
|
59314
59221
|
}
|
59315
59222
|
});
|
59316
59223
|
|
59224
|
+
// ../containers-shared/src/registry.ts
|
59225
|
+
var getCloudflareRegistryWithAccountNamespace;
|
59226
|
+
var init_registry = __esm({
|
59227
|
+
"../containers-shared/src/registry.ts"() {
|
59228
|
+
init_import_meta_url();
|
59229
|
+
init_knobs();
|
59230
|
+
getCloudflareRegistryWithAccountNamespace = /* @__PURE__ */ __name((accountID, tag) => {
|
59231
|
+
return `${getCloudflareContainerRegistry()}/${accountID}/${tag}`;
|
59232
|
+
}, "getCloudflareRegistryWithAccountNamespace");
|
59233
|
+
}
|
59234
|
+
});
|
59235
|
+
|
59317
59236
|
// ../containers-shared/index.ts
|
59318
59237
|
var init_containers_shared = __esm({
|
59319
59238
|
"../containers-shared/index.ts"() {
|
@@ -59321,10 +59240,144 @@ var init_containers_shared = __esm({
|
|
59321
59240
|
init_client2();
|
59322
59241
|
init_build();
|
59323
59242
|
init_login();
|
59324
|
-
|
59243
|
+
init_knobs();
|
59325
59244
|
init_utils2();
|
59326
59245
|
init_types3();
|
59327
59246
|
init_inspect();
|
59247
|
+
init_registry();
|
59248
|
+
}
|
59249
|
+
});
|
59250
|
+
|
59251
|
+
// src/versions/api.ts
|
59252
|
+
async function fetchVersion(complianceConfig, accountId, workerName, versionId, versionCache) {
|
59253
|
+
const cachedVersion = versionCache?.get(versionId);
|
59254
|
+
if (cachedVersion) {
|
59255
|
+
return cachedVersion;
|
59256
|
+
}
|
59257
|
+
const version5 = await fetchResult(
|
59258
|
+
complianceConfig,
|
59259
|
+
`/accounts/${accountId}/workers/scripts/${workerName}/versions/${versionId}`
|
59260
|
+
);
|
59261
|
+
versionCache?.set(version5.id, version5);
|
59262
|
+
return version5;
|
59263
|
+
}
|
59264
|
+
async function fetchVersions(complianceConfig, accountId, workerName, versionCache, ...versionIds) {
|
59265
|
+
return Promise.all(
|
59266
|
+
versionIds.map(
|
59267
|
+
(versionId) => fetchVersion(
|
59268
|
+
complianceConfig,
|
59269
|
+
accountId,
|
59270
|
+
workerName,
|
59271
|
+
versionId,
|
59272
|
+
versionCache
|
59273
|
+
)
|
59274
|
+
)
|
59275
|
+
);
|
59276
|
+
}
|
59277
|
+
async function fetchLatestDeployments(complianceConfig, accountId, workerName) {
|
59278
|
+
const { deployments } = await fetchResult(
|
59279
|
+
complianceConfig,
|
59280
|
+
`/accounts/${accountId}/workers/scripts/${workerName}/deployments`
|
59281
|
+
);
|
59282
|
+
return deployments;
|
59283
|
+
}
|
59284
|
+
async function fetchLatestDeployment(complianceConfig, accountId, workerName) {
|
59285
|
+
const deployments = await fetchLatestDeployments(
|
59286
|
+
complianceConfig,
|
59287
|
+
accountId,
|
59288
|
+
workerName
|
59289
|
+
);
|
59290
|
+
return deployments.at(0);
|
59291
|
+
}
|
59292
|
+
async function fetchDeploymentVersions(complianceConfig, accountId, workerName, deployment, versionCache) {
|
59293
|
+
if (!deployment) {
|
59294
|
+
return [[], /* @__PURE__ */ new Map()];
|
59295
|
+
}
|
59296
|
+
const versionTraffic = new Map(
|
59297
|
+
deployment.versions.map((v7) => [v7.version_id, v7.percentage])
|
59298
|
+
);
|
59299
|
+
const versions2 = await fetchVersions(
|
59300
|
+
complianceConfig,
|
59301
|
+
accountId,
|
59302
|
+
workerName,
|
59303
|
+
versionCache,
|
59304
|
+
...versionTraffic.keys()
|
59305
|
+
);
|
59306
|
+
return [versions2, versionTraffic];
|
59307
|
+
}
|
59308
|
+
async function fetchDeployableVersions(complianceConfig, accountId, workerName, versionCache) {
|
59309
|
+
const { items: versions2 } = await fetchResult(
|
59310
|
+
complianceConfig,
|
59311
|
+
`/accounts/${accountId}/workers/scripts/${workerName}/versions?deployable=true`
|
59312
|
+
);
|
59313
|
+
for (const version5 of versions2) {
|
59314
|
+
versionCache.set(version5.id, version5);
|
59315
|
+
}
|
59316
|
+
return versions2;
|
59317
|
+
}
|
59318
|
+
async function createDeployment(complianceConfig, accountId, workerName, versionTraffic, message, force) {
|
59319
|
+
return await fetchResult(
|
59320
|
+
complianceConfig,
|
59321
|
+
`/accounts/${accountId}/workers/scripts/${workerName}/deployments${force ? "?force=true" : ""}`,
|
59322
|
+
{
|
59323
|
+
method: "POST",
|
59324
|
+
headers: { "Content-Type": "application/json" },
|
59325
|
+
body: JSON.stringify({
|
59326
|
+
strategy: "percentage",
|
59327
|
+
versions: Array.from(versionTraffic).map(
|
59328
|
+
([version_id, percentage]) => ({ version_id, percentage })
|
59329
|
+
),
|
59330
|
+
annotations: {
|
59331
|
+
"workers/message": message
|
59332
|
+
}
|
59333
|
+
})
|
59334
|
+
}
|
59335
|
+
);
|
59336
|
+
}
|
59337
|
+
async function patchNonVersionedScriptSettings(complianceConfig, accountId, workerName, settings) {
|
59338
|
+
const res = await fetchResult(
|
59339
|
+
complianceConfig,
|
59340
|
+
`/accounts/${accountId}/workers/scripts/${workerName}/script-settings`,
|
59341
|
+
{
|
59342
|
+
method: "PATCH",
|
59343
|
+
headers: { "Content-Type": "application/json" },
|
59344
|
+
body: JSON.stringify(settings)
|
59345
|
+
}
|
59346
|
+
);
|
59347
|
+
return res;
|
59348
|
+
}
|
59349
|
+
var init_api = __esm({
|
59350
|
+
"src/versions/api.ts"() {
|
59351
|
+
init_import_meta_url();
|
59352
|
+
init_cfetch();
|
59353
|
+
__name(fetchVersion, "fetchVersion");
|
59354
|
+
__name(fetchVersions, "fetchVersions");
|
59355
|
+
__name(fetchLatestDeployments, "fetchLatestDeployments");
|
59356
|
+
__name(fetchLatestDeployment, "fetchLatestDeployment");
|
59357
|
+
__name(fetchDeploymentVersions, "fetchDeploymentVersions");
|
59358
|
+
__name(fetchDeployableVersions, "fetchDeployableVersions");
|
59359
|
+
__name(createDeployment, "createDeployment");
|
59360
|
+
__name(patchNonVersionedScriptSettings, "patchNonVersionedScriptSettings");
|
59361
|
+
}
|
59362
|
+
});
|
59363
|
+
|
59364
|
+
// ../cli/args.ts
|
59365
|
+
var processArgument;
|
59366
|
+
var init_args = __esm({
|
59367
|
+
"../cli/args.ts"() {
|
59368
|
+
init_import_meta_url();
|
59369
|
+
init_interactive();
|
59370
|
+
processArgument = /* @__PURE__ */ __name(async (args, name2, promptConfig) => {
|
59371
|
+
const value = args[name2];
|
59372
|
+
const result = await inputPrompt({
|
59373
|
+
...promptConfig,
|
59374
|
+
// Accept the default value if the arg is already set
|
59375
|
+
acceptDefault: promptConfig.acceptDefault ?? value !== void 0,
|
59376
|
+
defaultValue: value ?? promptConfig.defaultValue
|
59377
|
+
});
|
59378
|
+
args[name2] = result;
|
59379
|
+
return result;
|
59380
|
+
}, "processArgument");
|
59328
59381
|
}
|
59329
59382
|
});
|
59330
59383
|
|
@@ -59792,8 +59845,8 @@ var init_common = __esm({
|
|
59792
59845
|
const alphaNumeric = "[a-z0-9]+";
|
59793
59846
|
const separator = "(?:\\.|_|__|-+)";
|
59794
59847
|
const port = ":[0-9]+";
|
59795
|
-
const
|
59796
|
-
const name2 = `(?:${
|
59848
|
+
const domain2 = `${alphaNumeric}(?:${separator}${alphaNumeric})*`;
|
59849
|
+
const name2 = `(?:${domain2}(?:${port})?/)?(?:${domain2}/)*(?:${domain2})`;
|
59797
59850
|
const tag = ":([a-zA-Z0-9_][a-zA-Z0-9._-]{0,127})";
|
59798
59851
|
const digest = "@(sha256:[A-Fa-f0-9]+)";
|
59799
59852
|
const reference = `(?:${tag}(?:${digest})?|${digest})`;
|
@@ -60618,13 +60671,14 @@ function pushYargs(yargs) {
|
|
60618
60671
|
demandOption: false
|
60619
60672
|
}).positional("TAG", { type: "string", demandOption: true });
|
60620
60673
|
}
|
60621
|
-
function isDir(path70) {
|
60622
|
-
const stats = (0, import_fs11.statSync)(path70);
|
60623
|
-
return stats.isDirectory();
|
60624
|
-
}
|
60625
60674
|
async function buildAndMaybePush(args, pathToDocker, push, containerConfig) {
|
60626
|
-
const imageTag = DOMAIN + "/" + args.tag;
|
60627
60675
|
try {
|
60676
|
+
const account = await loadAccount();
|
60677
|
+
const cloudflareAccountID = account.external_account_id;
|
60678
|
+
const imageTag = getCloudflareRegistryWithAccountNamespace(
|
60679
|
+
cloudflareAccountID,
|
60680
|
+
args.tag
|
60681
|
+
);
|
60628
60682
|
const { buildCmd, dockerfile } = await constructBuildCommand(
|
60629
60683
|
{
|
60630
60684
|
tag: imageTag,
|
@@ -60640,12 +60694,10 @@ async function buildAndMaybePush(args, pathToDocker, push, containerConfig) {
|
|
60640
60694
|
buildCmd,
|
60641
60695
|
dockerfile
|
60642
60696
|
});
|
60643
|
-
const account = await loadAccount();
|
60644
60697
|
const inspectOutput = await dockerImageInspect(pathToDocker, {
|
60645
60698
|
imageTag,
|
60646
60699
|
formatString: "{{ .Size }} {{ len .RootFS.Layers }}"
|
60647
60700
|
});
|
60648
|
-
console.dir("hi" + JSON.stringify(inspectOutput));
|
60649
60701
|
const [sizeStr, layerStr] = inspectOutput.split(" ");
|
60650
60702
|
const size = parseInt(sizeStr, 10);
|
60651
60703
|
const layers = parseInt(layerStr, 10);
|
@@ -60669,7 +60721,7 @@ async function buildAndMaybePush(args, pathToDocker, push, containerConfig) {
|
|
60669
60721
|
}
|
60670
60722
|
}
|
60671
60723
|
async function buildCommand(args, config) {
|
60672
|
-
if ((0,
|
60724
|
+
if ((0, import_fs12.existsSync)(args.PATH) && !isDir(args.PATH)) {
|
60673
60725
|
throw new UserError(
|
60674
60726
|
`${args.PATH} is not a directory. Please specify a valid directory path.`
|
60675
60727
|
);
|
@@ -60694,7 +60746,11 @@ async function buildCommand(args, config) {
|
|
60694
60746
|
async function pushCommand(args, _4) {
|
60695
60747
|
try {
|
60696
60748
|
await dockerLoginManagedRegistry(args.pathToDocker);
|
60697
|
-
const
|
60749
|
+
const account = await loadAccount();
|
60750
|
+
const newTag = getCloudflareRegistryWithAccountNamespace(
|
60751
|
+
account.external_account_id,
|
60752
|
+
args.TAG
|
60753
|
+
);
|
60698
60754
|
const dockerPath = args.pathToDocker ?? getDockerPath();
|
60699
60755
|
await runDockerCmd(dockerPath, ["tag", args.TAG, newTag]);
|
60700
60756
|
await runDockerCmd(dockerPath, ["push", newTag]);
|
@@ -60726,11 +60782,11 @@ async function ensureDiskLimits(options) {
|
|
60726
60782
|
);
|
60727
60783
|
}
|
60728
60784
|
}
|
60729
|
-
var
|
60785
|
+
var import_fs12, import_path7;
|
60730
60786
|
var init_build2 = __esm({
|
60731
60787
|
"src/cloudchamber/build.ts"() {
|
60732
60788
|
init_import_meta_url();
|
60733
|
-
|
60789
|
+
import_fs12 = require("fs");
|
60734
60790
|
import_path7 = require("path");
|
60735
60791
|
init_containers_shared();
|
60736
60792
|
init_misc_variables();
|
@@ -60740,7 +60796,6 @@ var init_build2 = __esm({
|
|
60740
60796
|
init_locations();
|
60741
60797
|
__name(buildYargs, "buildYargs");
|
60742
60798
|
__name(pushYargs, "pushYargs");
|
60743
|
-
__name(isDir, "isDir");
|
60744
60799
|
__name(buildAndMaybePush, "buildAndMaybePush");
|
60745
60800
|
__name(buildCommand, "buildCommand");
|
60746
60801
|
__name(pushCommand, "pushCommand");
|
@@ -60750,8 +60805,17 @@ var init_build2 = __esm({
|
|
60750
60805
|
|
60751
60806
|
// src/cloudchamber/deploy.ts
|
60752
60807
|
async function maybeBuildContainer(containerConfig, imageTag, dryRun, pathToDocker) {
|
60753
|
-
|
60754
|
-
|
60808
|
+
try {
|
60809
|
+
if (!isDockerfile(
|
60810
|
+
containerConfig.image ?? containerConfig.configuration.image
|
60811
|
+
)) {
|
60812
|
+
return containerConfig.image ?? containerConfig.configuration.image;
|
60813
|
+
}
|
60814
|
+
} catch (err) {
|
60815
|
+
if (err instanceof Error) {
|
60816
|
+
throw new UserError(err.message);
|
60817
|
+
}
|
60818
|
+
throw err;
|
60755
60819
|
}
|
60756
60820
|
const options = getBuildArguments(containerConfig, imageTag);
|
60757
60821
|
logger.log("Building image", options.tag);
|
@@ -60821,11 +60885,10 @@ function getBuildArguments(container, idForImageTag) {
|
|
60821
60885
|
args: container.image_vars
|
60822
60886
|
};
|
60823
60887
|
}
|
60824
|
-
var import_fs12, isDockerfile;
|
60825
60888
|
var init_deploy = __esm({
|
60826
60889
|
"src/cloudchamber/deploy.ts"() {
|
60827
60890
|
init_import_meta_url();
|
60828
|
-
|
60891
|
+
init_containers_shared();
|
60829
60892
|
init_misc_variables();
|
60830
60893
|
init_errors();
|
60831
60894
|
init_is_interactive();
|
@@ -60837,44 +60900,12 @@ var init_deploy = __esm({
|
|
60837
60900
|
__name(maybeBuildContainer, "maybeBuildContainer");
|
60838
60901
|
__name(deployContainers, "deployContainers");
|
60839
60902
|
__name(getBuildArguments, "getBuildArguments");
|
60840
|
-
isDockerfile = /* @__PURE__ */ __name((image) => {
|
60841
|
-
if ((0, import_fs12.existsSync)(image)) {
|
60842
|
-
if (isDir(image)) {
|
60843
|
-
throw new UserError(
|
60844
|
-
`${image} is a directory, you should specify a path to the Dockerfile`
|
60845
|
-
);
|
60846
|
-
}
|
60847
|
-
return true;
|
60848
|
-
}
|
60849
|
-
const errorPrefix = `The image "${image}" does not appear to be a valid path to a Dockerfile, or a valid image registry path:
|
60850
|
-
`;
|
60851
|
-
try {
|
60852
|
-
new URL(`https://${image}`);
|
60853
|
-
} catch (e7) {
|
60854
|
-
if (e7 instanceof Error) {
|
60855
|
-
throw new UserError(errorPrefix + e7.message);
|
60856
|
-
}
|
60857
|
-
throw e7;
|
60858
|
-
}
|
60859
|
-
const imageParts = image.split("/");
|
60860
|
-
if (!imageParts[imageParts.length - 1].includes(":")) {
|
60861
|
-
throw new UserError(
|
60862
|
-
errorPrefix + `If this is an image registry path, it needs to include at least a tag ':' (e.g: docker.io/httpd:1)`
|
60863
|
-
);
|
60864
|
-
}
|
60865
|
-
if (image.includes("://")) {
|
60866
|
-
throw new UserError(
|
60867
|
-
errorPrefix + `Image reference should not include the protocol part (e.g: docker.io/httpd:1, not https://docker.io/httpd:1)`
|
60868
|
-
);
|
60869
|
-
}
|
60870
|
-
return false;
|
60871
|
-
}, "isDockerfile");
|
60872
60903
|
}
|
60873
60904
|
});
|
60874
60905
|
|
60875
60906
|
// src/d1/constants.ts
|
60876
60907
|
var DEFAULT_MIGRATION_PATH, DEFAULT_MIGRATION_TABLE, LOCATION_CHOICES;
|
60877
|
-
var
|
60908
|
+
var init_constants4 = __esm({
|
60878
60909
|
"src/d1/constants.ts"() {
|
60879
60910
|
init_import_meta_url();
|
60880
60911
|
DEFAULT_MIGRATION_PATH = "./migrations";
|
@@ -60918,7 +60949,7 @@ var init_create = __esm({
|
|
60918
60949
|
init_errors();
|
60919
60950
|
init_logger();
|
60920
60951
|
init_user2();
|
60921
|
-
|
60952
|
+
init_constants4();
|
60922
60953
|
__name(createD1Database, "createD1Database");
|
60923
60954
|
d1CreateCommand = createCommand({
|
60924
60955
|
metadata: {
|
@@ -61066,7 +61097,7 @@ var init_utils3 = __esm({
|
|
61066
61097
|
init_import_meta_url();
|
61067
61098
|
init_cfetch();
|
61068
61099
|
init_errors();
|
61069
|
-
|
61100
|
+
init_constants4();
|
61070
61101
|
init_list();
|
61071
61102
|
__name(getDatabaseInfoFromConfig, "getDatabaseInfoFromConfig");
|
61072
61103
|
getDatabaseByNameOrBinding = /* @__PURE__ */ __name(async (config, accountId, name2) => {
|
@@ -64445,16 +64476,16 @@ var init_als_external = __esm({
|
|
64445
64476
|
});
|
64446
64477
|
|
64447
64478
|
// src/deployment-bundle/esbuild-plugins/hybrid-nodejs-compat.ts
|
64448
|
-
|
64449
|
-
const { defineEnv } = await import("unenv");
|
64450
|
-
const { cloudflare } = await import("@cloudflare/unenv-preset");
|
64451
|
-
const { alias, inject, external, polyfill: polyfill2 } = defineEnv({
|
64452
|
-
presets: [cloudflare],
|
64453
|
-
npmShims: true
|
64454
|
-
}).env;
|
64479
|
+
function nodejsHybridPlugin() {
|
64455
64480
|
return {
|
64456
64481
|
name: "hybrid-nodejs_compat",
|
64457
|
-
setup(build5) {
|
64482
|
+
async setup(build5) {
|
64483
|
+
const { defineEnv } = await import("unenv");
|
64484
|
+
const { cloudflare } = await import("@cloudflare/unenv-preset");
|
64485
|
+
const { alias, inject, external, polyfill: polyfill2 } = defineEnv({
|
64486
|
+
presets: [cloudflare],
|
64487
|
+
npmShims: true
|
64488
|
+
}).env;
|
64458
64489
|
errorOnServiceWorkerFormat(build5);
|
64459
64490
|
handleRequireCallsToNodeJSBuiltins(build5);
|
64460
64491
|
handleUnenvAliasedPackages(build5, alias, external);
|
@@ -64700,9 +64731,8 @@ var init_nodejs_compat = __esm({
|
|
64700
64731
|
});
|
64701
64732
|
|
64702
64733
|
// src/deployment-bundle/esbuild-plugins/nodejs-plugins.ts
|
64703
|
-
|
64704
|
-
mode
|
64705
|
-
unenvResolvePaths
|
64734
|
+
function getNodeJSCompatPlugins({
|
64735
|
+
mode
|
64706
64736
|
}) {
|
64707
64737
|
switch (mode) {
|
64708
64738
|
case "als":
|
@@ -64710,7 +64740,7 @@ async function getNodeJSCompatPlugins({
|
|
64710
64740
|
case "v1":
|
64711
64741
|
return [nodejsCompatPlugin(mode)];
|
64712
64742
|
case "v2":
|
64713
|
-
return [
|
64743
|
+
return [nodejsHybridPlugin()];
|
64714
64744
|
case null:
|
64715
64745
|
return [nodejsCompatPlugin(mode)];
|
64716
64746
|
}
|
@@ -64819,24 +64849,6 @@ async function bundleWorker(entry, destination, {
|
|
64819
64849
|
}
|
64820
64850
|
inject.push(checkedFetchFileToInject);
|
64821
64851
|
}
|
64822
|
-
if (targetConsumer === "dev" && local) {
|
64823
|
-
const stripCfConnectingIpHeaderFileToInject = path23.join(
|
64824
|
-
tmpDir.path,
|
64825
|
-
"strip-cf-connecting-ip-header.js"
|
64826
|
-
);
|
64827
|
-
if (!fs10.existsSync(stripCfConnectingIpHeaderFileToInject)) {
|
64828
|
-
fs10.writeFileSync(
|
64829
|
-
stripCfConnectingIpHeaderFileToInject,
|
64830
|
-
fs10.readFileSync(
|
64831
|
-
path23.resolve(
|
64832
|
-
getBasePath(),
|
64833
|
-
"templates/strip-cf-connecting-ip-header.js"
|
64834
|
-
)
|
64835
|
-
)
|
64836
|
-
);
|
64837
|
-
}
|
64838
|
-
inject.push(stripCfConnectingIpHeaderFileToInject);
|
64839
|
-
}
|
64840
64852
|
if (getFlag("MULTIWORKER")) {
|
64841
64853
|
middlewareToLoad.push({
|
64842
64854
|
name: "patch-console-prefix",
|
@@ -64890,7 +64902,6 @@ async function bundleWorker(entry, destination, {
|
|
64890
64902
|
});
|
64891
64903
|
}
|
64892
64904
|
};
|
64893
|
-
const unenvResolvePaths = getUnenvResolvePathsFromEnv()?.split(",");
|
64894
64905
|
const buildOptions = {
|
64895
64906
|
// Don't use entryFile here as the file may have been changed when applying the middleware
|
64896
64907
|
entryPoints: [entry.file],
|
@@ -64931,9 +64942,8 @@ async function bundleWorker(entry, destination, {
|
|
64931
64942
|
plugins: [
|
64932
64943
|
aliasPlugin,
|
64933
64944
|
moduleCollector.plugin,
|
64934
|
-
...
|
64935
|
-
mode: nodejsCompatMode ?? null
|
64936
|
-
unenvResolvePaths
|
64945
|
+
...getNodeJSCompatPlugins({
|
64946
|
+
mode: nodejsCompatMode ?? null
|
64937
64947
|
}),
|
64938
64948
|
cloudflareInternalPlugin,
|
64939
64949
|
buildResultPlugin,
|
@@ -76201,7 +76211,7 @@ public_key: ${dim(
|
|
76201
76211
|
}
|
76202
76212
|
async function handleConfigureImageRegistryCommand(args, _config) {
|
76203
76213
|
startSection("Configure a Docker registry in Cloudflare");
|
76204
|
-
const
|
76214
|
+
const domain2 = await processArgument({ domain: args.domain }, "domain", {
|
76205
76215
|
type: "text",
|
76206
76216
|
question: "What is the domain of your registry?",
|
76207
76217
|
validate: /* @__PURE__ */ __name((text) => {
|
@@ -76223,7 +76233,7 @@ async function handleConfigureImageRegistryCommand(args, _config) {
|
|
76223
76233
|
const [registry, err] = await wrap2(
|
76224
76234
|
promiseSpinner(
|
76225
76235
|
ImageRegistriesService.createImageRegistry({
|
76226
|
-
domain:
|
76236
|
+
domain: domain2,
|
76227
76237
|
is_public: isPublic
|
76228
76238
|
})
|
76229
76239
|
)
|
@@ -76385,7 +76395,7 @@ async function handleDeleteImageCommand(args, _config) {
|
|
76385
76395
|
}
|
76386
76396
|
return await promiseSpinner(
|
76387
76397
|
getCreds().then(async (creds) => {
|
76388
|
-
const url4 = new URL(`https://${
|
76398
|
+
const url4 = new URL(`https://${getCloudflareContainerRegistry()}`);
|
76389
76399
|
const baseUrl = `${url4.protocol}//${url4.host}`;
|
76390
76400
|
const [image, tag] = args.image.split(":");
|
76391
76401
|
await deleteTag(baseUrl, image, tag, creds);
|
@@ -76457,7 +76467,7 @@ async function ListTags(responses, digests = false, json = false) {
|
|
76457
76467
|
}
|
76458
76468
|
}
|
76459
76469
|
async function listTags(repo, creds) {
|
76460
|
-
const url4 = new URL(`https://${
|
76470
|
+
const url4 = new URL(`https://${getCloudflareContainerRegistry()}`);
|
76461
76471
|
const baseUrl = `${url4.protocol}//${url4.host}`;
|
76462
76472
|
const tagsUrl = `${baseUrl}/v2/${repo}/tags/list`;
|
76463
76473
|
const tagsResponse = await fetch(tagsUrl, {
|
@@ -76470,7 +76480,7 @@ async function listTags(repo, creds) {
|
|
76470
76480
|
return tagsData.tags || [];
|
76471
76481
|
}
|
76472
76482
|
async function listRepos(creds) {
|
76473
|
-
const url4 = new URL(`https://${
|
76483
|
+
const url4 = new URL(`https://${getCloudflareContainerRegistry()}`);
|
76474
76484
|
const catalogUrl = `${url4.protocol}//${url4.host}/v2/_catalog`;
|
76475
76485
|
const response = await fetch(catalogUrl, {
|
76476
76486
|
method: "GET",
|
@@ -76521,21 +76531,23 @@ async function deleteTag(baseUrl, image, tag, creds) {
|
|
76521
76531
|
}
|
76522
76532
|
}
|
76523
76533
|
async function getCreds() {
|
76524
|
-
return await ImageRegistriesService.generateImageRegistryCredentials(
|
76525
|
-
|
76526
|
-
|
76527
|
-
|
76534
|
+
return await ImageRegistriesService.generateImageRegistryCredentials(
|
76535
|
+
getCloudflareContainerRegistry(),
|
76536
|
+
{
|
76537
|
+
expiration_minutes: 5,
|
76538
|
+
permissions: ["pull", "push"]
|
76539
|
+
}
|
76540
|
+
).then(async (credentials) => {
|
76528
76541
|
return Buffer.from(`v1:${credentials.password}`).toString("base64");
|
76529
76542
|
});
|
76530
76543
|
}
|
76531
|
-
var
|
76544
|
+
var imagesCommand;
|
76532
76545
|
var init_list2 = __esm({
|
76533
76546
|
"src/cloudchamber/images/list.ts"() {
|
76534
76547
|
init_import_meta_url();
|
76535
76548
|
init_containers_shared();
|
76536
76549
|
init_logger();
|
76537
76550
|
init_common();
|
76538
|
-
domain = "registry.cloudchamber.cfdata.org";
|
76539
76551
|
imagesCommand = /* @__PURE__ */ __name((yargs) => {
|
76540
76552
|
return yargs.command(
|
76541
76553
|
"list",
|
@@ -78033,11 +78045,11 @@ function createRegisterYargsCommand(yargs, subHelp) {
|
|
78033
78045
|
registerSubTreeCallback();
|
78034
78046
|
},
|
78035
78047
|
// Only attach the handler for commands, not namespaces
|
78036
|
-
def.type === "command" ? createHandler(def) : void 0
|
78048
|
+
def.type === "command" ? createHandler(def, def.command) : void 0
|
78037
78049
|
);
|
78038
78050
|
}, "registerCommand");
|
78039
78051
|
}
|
78040
|
-
function createHandler(def) {
|
78052
|
+
function createHandler(def, commandName) {
|
78041
78053
|
return /* @__PURE__ */ __name(async function handler(args) {
|
78042
78054
|
try {
|
78043
78055
|
const shouldPrintBanner = def.behaviour?.printBanner;
|
@@ -78076,18 +78088,38 @@ function createHandler(def) {
|
|
78076
78088
|
RESOURCES_PROVISION: args.experimentalProvision ?? false,
|
78077
78089
|
MIXED_MODE: args.experimentalMixedMode ?? false
|
78078
78090
|
};
|
78079
|
-
await run(
|
78080
|
-
|
78081
|
-
|
78082
|
-
|
78083
|
-
|
78084
|
-
|
78085
|
-
|
78091
|
+
await run(experimentalFlags, () => {
|
78092
|
+
const config = def.behaviour?.provideConfig ?? true ? readConfig(args, {
|
78093
|
+
hideWarnings: !(def.behaviour?.printConfigWarnings ?? true),
|
78094
|
+
useRedirectIfAvailable: def.behaviour?.useConfigRedirectIfAvailable
|
78095
|
+
}) : defaultWranglerConfig;
|
78096
|
+
if (def.behaviour?.warnIfMultipleEnvsConfiguredButNoneSpecified) {
|
78097
|
+
if (!("env" in args) && config.configPath) {
|
78098
|
+
const { rawConfig } = experimental_readRawConfig(
|
78099
|
+
{
|
78100
|
+
config: config.configPath
|
78101
|
+
},
|
78102
|
+
{ hideWarnings: true }
|
78103
|
+
);
|
78104
|
+
const availableEnvs = Object.keys(rawConfig.env ?? {});
|
78105
|
+
if (availableEnvs.length > 0) {
|
78106
|
+
logger.warn(
|
78107
|
+
dedent2`
|
78108
|
+
Multiple environments are defined in the Wrangler configuration file, but no target environment was specified for the ${commandName.replace(/^wrangler\s+/, "")} command.
|
78109
|
+
To avoid unintentional changes to the wrong environment, it is recommended to explicitly specify the target environment using the \`-e|--env\` flag.
|
78110
|
+
If your intention is to use the top-level environment of your configuration simply pass an empty string to the flag to target such environment. For example \`--env=""\`.
|
78111
|
+
`
|
78112
|
+
);
|
78113
|
+
}
|
78114
|
+
}
|
78115
|
+
}
|
78116
|
+
return def.handler(args, {
|
78117
|
+
config,
|
78086
78118
|
errors: { UserError, FatalError },
|
78087
78119
|
logger,
|
78088
78120
|
fetchResult
|
78089
|
-
})
|
78090
|
-
);
|
78121
|
+
});
|
78122
|
+
});
|
78091
78123
|
} catch (err) {
|
78092
78124
|
throw err;
|
78093
78125
|
}
|
@@ -78103,6 +78135,7 @@ var init_register_yargs_command = __esm({
|
|
78103
78135
|
init_errors();
|
78104
78136
|
init_experimental_flags();
|
78105
78137
|
init_logger();
|
78138
|
+
init_dedent();
|
78106
78139
|
init_is_local();
|
78107
78140
|
init_wrangler_banner();
|
78108
78141
|
init_helpers5();
|
@@ -79559,7 +79592,7 @@ var init_helpers6 = __esm({
|
|
79559
79592
|
init_errors();
|
79560
79593
|
init_is_interactive();
|
79561
79594
|
init_logger();
|
79562
|
-
|
79595
|
+
init_constants4();
|
79563
79596
|
init_execute();
|
79564
79597
|
__name(getMigrationsPath, "getMigrationsPath");
|
79565
79598
|
__name(getUnappliedMigrations, "getUnappliedMigrations");
|
@@ -79635,7 +79668,7 @@ var init_apply2 = __esm({
|
|
79635
79668
|
init_errors();
|
79636
79669
|
init_is_interactive();
|
79637
79670
|
init_logger();
|
79638
|
-
|
79671
|
+
init_constants4();
|
79639
79672
|
init_execute();
|
79640
79673
|
init_utils3();
|
79641
79674
|
init_helpers6();
|
@@ -79823,7 +79856,7 @@ var init_create3 = __esm({
|
|
79823
79856
|
init_create_command();
|
79824
79857
|
init_errors();
|
79825
79858
|
init_logger();
|
79826
|
-
|
79859
|
+
init_constants4();
|
79827
79860
|
init_utils3();
|
79828
79861
|
init_helpers6();
|
79829
79862
|
d1MigrationsCreateCommand = createCommand({
|
@@ -79893,7 +79926,7 @@ var init_list4 = __esm({
|
|
79893
79926
|
init_errors();
|
79894
79927
|
init_logger();
|
79895
79928
|
init_user2();
|
79896
|
-
|
79929
|
+
init_constants4();
|
79897
79930
|
init_utils3();
|
79898
79931
|
init_helpers6();
|
79899
79932
|
d1MigrationsListCommand = createCommand({
|
@@ -81188,7 +81221,8 @@ var init_deploy3 = __esm({
|
|
81188
81221
|
MULTIWORKER: false,
|
81189
81222
|
RESOURCES_PROVISION: args.experimentalProvision ?? false,
|
81190
81223
|
MIXED_MODE: false
|
81191
|
-
}), "overrideExperimentalFlags")
|
81224
|
+
}), "overrideExperimentalFlags"),
|
81225
|
+
warnIfMultipleEnvsConfiguredButNoneSpecified: true
|
81192
81226
|
},
|
81193
81227
|
validateArgs(args) {
|
81194
81228
|
if (args.nodeCompat) {
|
@@ -84105,7 +84139,7 @@ var init_commands = __esm({
|
|
84105
84139
|
logTelemetryStatus(savedConfig.permission?.enabled ?? true);
|
84106
84140
|
}
|
84107
84141
|
logger.log(
|
84108
|
-
"To configure telemetry globally on this machine, you can run `wrangler telemetry disable / enable`.\nYou can override this for individual projects with the environment variable `WRANGLER_SEND_METRICS=true/false`.\nLearn more at https://github.com/cloudflare/workers-sdk/tree/main/telemetry.md\n"
|
84142
|
+
"To configure telemetry globally on this machine, you can run `wrangler telemetry disable / enable`.\nYou can override this for individual projects with the environment variable `WRANGLER_SEND_METRICS=true/false`.\nLearn more at https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler/telemetry.md\n"
|
84109
84143
|
);
|
84110
84144
|
}
|
84111
84145
|
});
|
@@ -88291,7 +88325,7 @@ var require_dist4 = __commonJS({
|
|
88291
88325
|
|
88292
88326
|
// src/utils/constants.ts
|
88293
88327
|
var resetColor, fgGreenColor, betaCmdColor, DEFAULT_LOCAL_PORT, DEFAULT_INSPECTOR_PORT, proxy;
|
88294
|
-
var
|
88328
|
+
var init_constants5 = __esm({
|
88295
88329
|
"src/utils/constants.ts"() {
|
88296
88330
|
init_import_meta_url();
|
88297
88331
|
resetColor = "\x1B[0m";
|
@@ -88642,7 +88676,7 @@ var init_createTail = __esm({
|
|
88642
88676
|
init_package();
|
88643
88677
|
init_cfetch();
|
88644
88678
|
init_misc_variables();
|
88645
|
-
|
88679
|
+
init_constants5();
|
88646
88680
|
init_filters();
|
88647
88681
|
init_printing();
|
88648
88682
|
TRACE_VERSION = "trace-v1";
|
@@ -90487,6 +90521,9 @@ var init_secret = __esm({
|
|
90487
90521
|
owner: "Workers: Deploy and Config"
|
90488
90522
|
},
|
90489
90523
|
positionalArgs: ["key"],
|
90524
|
+
behaviour: {
|
90525
|
+
warnIfMultipleEnvsConfiguredButNoneSpecified: true
|
90526
|
+
},
|
90490
90527
|
args: {
|
90491
90528
|
key: {
|
90492
90529
|
describe: "The variable name to be accessible in the Worker",
|
@@ -90578,6 +90615,9 @@ var init_secret = __esm({
|
|
90578
90615
|
owner: "Workers: Deploy and Config"
|
90579
90616
|
},
|
90580
90617
|
positionalArgs: ["key"],
|
90618
|
+
behaviour: {
|
90619
|
+
warnIfMultipleEnvsConfiguredButNoneSpecified: true
|
90620
|
+
},
|
90581
90621
|
args: {
|
90582
90622
|
key: {
|
90583
90623
|
describe: "The variable name to be accessible in the Worker",
|
@@ -90687,6 +90727,9 @@ var init_secret = __esm({
|
|
90687
90727
|
owner: "Workers: Deploy and Config"
|
90688
90728
|
},
|
90689
90729
|
positionalArgs: ["file"],
|
90730
|
+
behaviour: {
|
90731
|
+
warnIfMultipleEnvsConfiguredButNoneSpecified: true
|
90732
|
+
},
|
90690
90733
|
args: {
|
90691
90734
|
file: {
|
90692
90735
|
describe: `The file of key-value pairs to upload, as JSON in form {"key": value, ...} or .dev.vars file in the form KEY=VALUE`,
|
@@ -91839,7 +91882,7 @@ var init_dist_es3 = __esm({
|
|
91839
91882
|
|
91840
91883
|
// ../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/constants.js
|
91841
91884
|
var RequestChecksumCalculation, DEFAULT_REQUEST_CHECKSUM_CALCULATION, ResponseChecksumValidation, DEFAULT_RESPONSE_CHECKSUM_VALIDATION, ChecksumAlgorithm, ChecksumLocation, DEFAULT_CHECKSUM_ALGORITHM, S3_EXPRESS_DEFAULT_CHECKSUM_ALGORITHM;
|
91842
|
-
var
|
91885
|
+
var init_constants6 = __esm({
|
91843
91886
|
"../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/constants.js"() {
|
91844
91887
|
init_import_meta_url();
|
91845
91888
|
RequestChecksumCalculation = {
|
@@ -91894,7 +91937,7 @@ var ENV_REQUEST_CHECKSUM_CALCULATION, CONFIG_REQUEST_CHECKSUM_CALCULATION, NODE_
|
|
91894
91937
|
var init_NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS = __esm({
|
91895
91938
|
"../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS.js"() {
|
91896
91939
|
init_import_meta_url();
|
91897
|
-
|
91940
|
+
init_constants6();
|
91898
91941
|
init_stringUnionSelector();
|
91899
91942
|
ENV_REQUEST_CHECKSUM_CALCULATION = "AWS_REQUEST_CHECKSUM_CALCULATION";
|
91900
91943
|
CONFIG_REQUEST_CHECKSUM_CALCULATION = "request_checksum_calculation";
|
@@ -91911,7 +91954,7 @@ var ENV_RESPONSE_CHECKSUM_VALIDATION, CONFIG_RESPONSE_CHECKSUM_VALIDATION, NODE_
|
|
91911
91954
|
var init_NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS = __esm({
|
91912
91955
|
"../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS.js"() {
|
91913
91956
|
init_import_meta_url();
|
91914
|
-
|
91957
|
+
init_constants6();
|
91915
91958
|
init_stringUnionSelector();
|
91916
91959
|
ENV_RESPONSE_CHECKSUM_VALIDATION = "AWS_RESPONSE_CHECKSUM_VALIDATION";
|
91917
91960
|
CONFIG_RESPONSE_CHECKSUM_VALIDATION = "response_checksum_validation";
|
@@ -92803,7 +92846,7 @@ var init_dist_es11 = __esm({
|
|
92803
92846
|
|
92804
92847
|
// ../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/constants.js
|
92805
92848
|
var NODEJS_TIMEOUT_ERROR_CODES;
|
92806
|
-
var
|
92849
|
+
var init_constants7 = __esm({
|
92807
92850
|
"../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/constants.js"() {
|
92808
92851
|
init_import_meta_url();
|
92809
92852
|
NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"];
|
@@ -93010,7 +93053,7 @@ var init_node_http_handler = __esm({
|
|
93010
93053
|
init_dist_es11();
|
93011
93054
|
import_http = require("http");
|
93012
93055
|
import_https = require("https");
|
93013
|
-
|
93056
|
+
init_constants7();
|
93014
93057
|
init_get_transformed_headers();
|
93015
93058
|
init_set_connection_timeout();
|
93016
93059
|
init_set_socket_keep_alive();
|
@@ -94390,7 +94433,7 @@ var init_resolveAwsSdkSigV4AConfig = __esm({
|
|
94390
94433
|
|
94391
94434
|
// ../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/constants.js
|
94392
94435
|
var ALGORITHM_QUERY_PARAM, CREDENTIAL_QUERY_PARAM, AMZ_DATE_QUERY_PARAM, SIGNED_HEADERS_QUERY_PARAM, EXPIRES_QUERY_PARAM, SIGNATURE_QUERY_PARAM, TOKEN_QUERY_PARAM, AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER, GENERATED_HEADERS, SIGNATURE_HEADER, SHA256_HEADER, TOKEN_HEADER, ALWAYS_UNSIGNABLE_HEADERS, PROXY_HEADER_PATTERN, SEC_HEADER_PATTERN, ALGORITHM_IDENTIFIER, EVENT_ALGORITHM_IDENTIFIER, UNSIGNED_PAYLOAD, MAX_CACHE_SIZE, KEY_TYPE_IDENTIFIER, MAX_PRESIGNED_TTL;
|
94393
|
-
var
|
94436
|
+
var init_constants8 = __esm({
|
94394
94437
|
"../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/constants.js"() {
|
94395
94438
|
init_import_meta_url();
|
94396
94439
|
ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm";
|
@@ -94442,7 +94485,7 @@ var init_credentialDerivation = __esm({
|
|
94442
94485
|
init_import_meta_url();
|
94443
94486
|
init_dist_es14();
|
94444
94487
|
init_dist_es8();
|
94445
|
-
|
94488
|
+
init_constants8();
|
94446
94489
|
signingKeyCache = {};
|
94447
94490
|
cacheQueue = [];
|
94448
94491
|
createScope = /* @__PURE__ */ __name((shortDate, region, service) => `${shortDate}/${region}/${service}/${KEY_TYPE_IDENTIFIER}`, "createScope");
|
@@ -94475,7 +94518,7 @@ var getCanonicalHeaders;
|
|
94475
94518
|
var init_getCanonicalHeaders = __esm({
|
94476
94519
|
"../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/getCanonicalHeaders.js"() {
|
94477
94520
|
init_import_meta_url();
|
94478
|
-
|
94521
|
+
init_constants8();
|
94479
94522
|
getCanonicalHeaders = /* @__PURE__ */ __name(({ headers }, unsignableHeaders, signableHeaders) => {
|
94480
94523
|
const canonical = {};
|
94481
94524
|
for (const headerName of Object.keys(headers).sort()) {
|
@@ -94501,7 +94544,7 @@ var init_getCanonicalQuery = __esm({
|
|
94501
94544
|
"../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js"() {
|
94502
94545
|
init_import_meta_url();
|
94503
94546
|
init_dist_es10();
|
94504
|
-
|
94547
|
+
init_constants8();
|
94505
94548
|
getCanonicalQuery = /* @__PURE__ */ __name(({ query = {} }) => {
|
94506
94549
|
const keys = [];
|
94507
94550
|
const serialized = {};
|
@@ -94531,7 +94574,7 @@ var init_getPayloadHash = __esm({
|
|
94531
94574
|
init_dist_es6();
|
94532
94575
|
init_dist_es14();
|
94533
94576
|
init_dist_es8();
|
94534
|
-
|
94577
|
+
init_constants8();
|
94535
94578
|
getPayloadHash = /* @__PURE__ */ __name(async ({ headers, body }, hashConstructor) => {
|
94536
94579
|
for (const headerName of Object.keys(headers)) {
|
94537
94580
|
if (headerName.toLowerCase() === SHA256_HEADER) {
|
@@ -94736,7 +94779,7 @@ var init_prepareRequest = __esm({
|
|
94736
94779
|
"../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/prepareRequest.js"() {
|
94737
94780
|
init_import_meta_url();
|
94738
94781
|
init_dist_es2();
|
94739
|
-
|
94782
|
+
init_constants8();
|
94740
94783
|
prepareRequest = /* @__PURE__ */ __name((request4) => {
|
94741
94784
|
request4 = HttpRequest.clone(request4);
|
94742
94785
|
for (const headerName of Object.keys(request4.headers)) {
|
@@ -94779,7 +94822,7 @@ var init_SignatureV4 = __esm({
|
|
94779
94822
|
init_dist_es4();
|
94780
94823
|
init_dist_es10();
|
94781
94824
|
init_dist_es8();
|
94782
|
-
|
94825
|
+
init_constants8();
|
94783
94826
|
init_credentialDerivation();
|
94784
94827
|
init_getCanonicalHeaders();
|
94785
94828
|
init_getCanonicalQuery();
|
@@ -95561,7 +95604,7 @@ var init_command4 = __esm({
|
|
95561
95604
|
|
95562
95605
|
// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/constants.js
|
95563
95606
|
var SENSITIVE_STRING;
|
95564
|
-
var
|
95607
|
+
var init_constants9 = __esm({
|
95565
95608
|
"../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/constants.js"() {
|
95566
95609
|
init_import_meta_url();
|
95567
95610
|
SENSITIVE_STRING = "***SensitiveInformation***";
|
@@ -96410,7 +96453,7 @@ var init_dist_es20 = __esm({
|
|
96410
96453
|
init_client6();
|
96411
96454
|
init_collect_stream_body2();
|
96412
96455
|
init_command4();
|
96413
|
-
|
96456
|
+
init_constants9();
|
96414
96457
|
init_create_aggregated_client();
|
96415
96458
|
init_date_utils();
|
96416
96459
|
init_default_error_handler();
|
@@ -98315,7 +98358,7 @@ var CLIENT_SUPPORTED_ALGORITHMS, PRIORITY_ORDER_ALGORITHMS;
|
|
98315
98358
|
var init_types5 = __esm({
|
98316
98359
|
"../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/types.js"() {
|
98317
98360
|
init_import_meta_url();
|
98318
|
-
|
98361
|
+
init_constants6();
|
98319
98362
|
CLIENT_SUPPORTED_ALGORITHMS = [
|
98320
98363
|
ChecksumAlgorithm.CRC32,
|
98321
98364
|
ChecksumAlgorithm.CRC32C,
|
@@ -98336,7 +98379,7 @@ var getChecksumAlgorithmForRequest;
|
|
98336
98379
|
var init_getChecksumAlgorithmForRequest = __esm({
|
98337
98380
|
"../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getChecksumAlgorithmForRequest.js"() {
|
98338
98381
|
init_import_meta_url();
|
98339
|
-
|
98382
|
+
init_constants6();
|
98340
98383
|
init_types5();
|
98341
98384
|
getChecksumAlgorithmForRequest = /* @__PURE__ */ __name((input, { requestChecksumRequired, requestAlgorithmMember }, isS3Express) => {
|
98342
98385
|
const defaultAlgorithm = isS3Express ? S3_EXPRESS_DEFAULT_CHECKSUM_ALGORITHM : DEFAULT_CHECKSUM_ALGORITHM;
|
@@ -98357,7 +98400,7 @@ var getChecksumLocationName;
|
|
98357
98400
|
var init_getChecksumLocationName = __esm({
|
98358
98401
|
"../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getChecksumLocationName.js"() {
|
98359
98402
|
init_import_meta_url();
|
98360
|
-
|
98403
|
+
init_constants6();
|
98361
98404
|
getChecksumLocationName = /* @__PURE__ */ __name((algorithm) => algorithm === ChecksumAlgorithm.MD5 ? "content-md5" : `x-amz-checksum-${algorithm.toLowerCase()}`, "getChecksumLocationName");
|
98362
98405
|
}
|
98363
98406
|
});
|
@@ -99382,7 +99425,7 @@ var init_selectChecksumAlgorithmFunction = __esm({
|
|
99382
99425
|
"../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/selectChecksumAlgorithmFunction.js"() {
|
99383
99426
|
init_import_meta_url();
|
99384
99427
|
init_module2();
|
99385
|
-
|
99428
|
+
init_constants6();
|
99386
99429
|
init_getCrc32ChecksumAlgorithmFunction();
|
99387
99430
|
selectChecksumAlgorithmFunction = /* @__PURE__ */ __name((checksumAlgorithm, config) => {
|
99388
99431
|
switch (checksumAlgorithm) {
|
@@ -99424,7 +99467,7 @@ var init_flexibleChecksumsMiddleware = __esm({
|
|
99424
99467
|
init_import_meta_url();
|
99425
99468
|
init_dist_es21();
|
99426
99469
|
init_dist_es2();
|
99427
|
-
|
99470
|
+
init_constants6();
|
99428
99471
|
init_getChecksumAlgorithmForRequest();
|
99429
99472
|
init_getChecksumLocationName();
|
99430
99473
|
init_hasHeader();
|
@@ -99696,7 +99739,7 @@ var init_resolveFlexibleChecksumsConfig = __esm({
|
|
99696
99739
|
"../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/resolveFlexibleChecksumsConfig.js"() {
|
99697
99740
|
init_import_meta_url();
|
99698
99741
|
init_dist_es4();
|
99699
|
-
|
99742
|
+
init_constants6();
|
99700
99743
|
resolveFlexibleChecksumsConfig = /* @__PURE__ */ __name((input) => ({
|
99701
99744
|
...input,
|
99702
99745
|
requestChecksumCalculation: normalizeProvider(input.requestChecksumCalculation ?? DEFAULT_REQUEST_CHECKSUM_CALCULATION),
|
@@ -99711,7 +99754,7 @@ var init_dist_es25 = __esm({
|
|
99711
99754
|
init_import_meta_url();
|
99712
99755
|
init_NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS();
|
99713
99756
|
init_NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS();
|
99714
|
-
|
99757
|
+
init_constants6();
|
99715
99758
|
init_flexibleChecksumsMiddleware();
|
99716
99759
|
init_getFlexibleChecksumsPlugin();
|
99717
99760
|
init_resolveFlexibleChecksumsConfig();
|
@@ -100204,7 +100247,7 @@ var init_dist_es29 = __esm({
|
|
100204
100247
|
|
100205
100248
|
// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/constants.js
|
100206
100249
|
var S3_EXPRESS_BUCKET_TYPE, S3_EXPRESS_BACKEND, S3_EXPRESS_AUTH_SCHEME, SESSION_TOKEN_QUERY_PARAM, SESSION_TOKEN_HEADER, NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_ENV_NAME, NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_INI_NAME, NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS;
|
100207
|
-
var
|
100250
|
+
var init_constants10 = __esm({
|
100208
100251
|
"../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/constants.js"() {
|
100209
100252
|
init_import_meta_url();
|
100210
100253
|
init_dist_es29();
|
@@ -100249,7 +100292,7 @@ var init_SignatureV4S3Express = __esm({
|
|
100249
100292
|
"../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.716.0/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/classes/SignatureV4S3Express.js"() {
|
100250
100293
|
init_import_meta_url();
|
100251
100294
|
init_dist_es18();
|
100252
|
-
|
100295
|
+
init_constants10();
|
100253
100296
|
SignatureV4S3Express = class extends SignatureV4 {
|
100254
100297
|
static {
|
100255
100298
|
__name(this, "SignatureV4S3Express");
|
@@ -100284,7 +100327,7 @@ var init_s3ExpressMiddleware = __esm({
|
|
100284
100327
|
init_import_meta_url();
|
100285
100328
|
init_dist_es21();
|
100286
100329
|
init_dist_es2();
|
100287
|
-
|
100330
|
+
init_constants10();
|
100288
100331
|
s3ExpressMiddleware = /* @__PURE__ */ __name((options) => {
|
100289
100332
|
return (next, context2) => async (args) => {
|
100290
100333
|
if (context2.endpointV2) {
|
@@ -100394,7 +100437,7 @@ var init_s3_express = __esm({
|
|
100394
100437
|
init_S3ExpressIdentityCacheEntry();
|
100395
100438
|
init_S3ExpressIdentityProviderImpl();
|
100396
100439
|
init_SignatureV4S3Express();
|
100397
|
-
|
100440
|
+
init_constants10();
|
100398
100441
|
init_s3ExpressMiddleware();
|
100399
100442
|
init_s3ExpressHttpSigningMiddleware();
|
100400
100443
|
}
|
@@ -101937,7 +101980,7 @@ var init_check_features = __esm({
|
|
101937
101980
|
|
101938
101981
|
// ../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.721.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/constants.js
|
101939
101982
|
var USER_AGENT, X_AMZ_USER_AGENT, SPACE, UA_NAME_SEPARATOR, UA_NAME_ESCAPE_REGEX, UA_VALUE_ESCAPE_REGEX, UA_ESCAPE_CHAR;
|
101940
|
-
var
|
101983
|
+
var init_constants11 = __esm({
|
101941
101984
|
"../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.721.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/constants.js"() {
|
101942
101985
|
init_import_meta_url();
|
101943
101986
|
USER_AGENT = "user-agent";
|
@@ -101984,7 +102027,7 @@ var init_user_agent_middleware = __esm({
|
|
101984
102027
|
init_dist_es33();
|
101985
102028
|
init_dist_es2();
|
101986
102029
|
init_check_features();
|
101987
|
-
|
102030
|
+
init_constants11();
|
101988
102031
|
init_encode_features();
|
101989
102032
|
userAgentMiddleware = /* @__PURE__ */ __name((options) => (next, context2) => async (args) => {
|
101990
102033
|
const { request: request4 } = args;
|
@@ -103194,7 +103237,7 @@ var init_config5 = __esm({
|
|
103194
103237
|
|
103195
103238
|
// ../../node_modules/.pnpm/@smithy+service-error-classification@3.0.11/node_modules/@smithy/service-error-classification/dist-es/constants.js
|
103196
103239
|
var THROTTLING_ERROR_CODES, TRANSIENT_ERROR_CODES, TRANSIENT_ERROR_STATUS_CODES, NODEJS_TIMEOUT_ERROR_CODES2;
|
103197
|
-
var
|
103240
|
+
var init_constants12 = __esm({
|
103198
103241
|
"../../node_modules/.pnpm/@smithy+service-error-classification@3.0.11/node_modules/@smithy/service-error-classification/dist-es/constants.js"() {
|
103199
103242
|
init_import_meta_url();
|
103200
103243
|
THROTTLING_ERROR_CODES = [
|
@@ -103224,7 +103267,7 @@ var isClockSkewCorrectedError, isThrottlingError, isTransientError, isServerErro
|
|
103224
103267
|
var init_dist_es43 = __esm({
|
103225
103268
|
"../../node_modules/.pnpm/@smithy+service-error-classification@3.0.11/node_modules/@smithy/service-error-classification/dist-es/index.js"() {
|
103226
103269
|
init_import_meta_url();
|
103227
|
-
|
103270
|
+
init_constants12();
|
103228
103271
|
isClockSkewCorrectedError = /* @__PURE__ */ __name((error2) => error2.$metadata?.clockSkewCorrected, "isClockSkewCorrectedError");
|
103229
103272
|
isThrottlingError = /* @__PURE__ */ __name((error2) => error2.$metadata?.httpStatusCode === 429 || THROTTLING_ERROR_CODES.includes(error2.name) || error2.$retryable?.throttling == true, "isThrottlingError");
|
103230
103273
|
isTransientError = /* @__PURE__ */ __name((error2, depth = 0) => isClockSkewCorrectedError(error2) || TRANSIENT_ERROR_CODES.includes(error2.name) || NODEJS_TIMEOUT_ERROR_CODES2.includes(error2?.code || "") || TRANSIENT_ERROR_STATUS_CODES.includes(error2.$metadata?.httpStatusCode || 0) || error2.cause !== void 0 && depth <= 10 && isTransientError(error2.cause, depth + 1), "isTransientError");
|
@@ -103353,7 +103396,7 @@ var init_DefaultRateLimiter = __esm({
|
|
103353
103396
|
|
103354
103397
|
// ../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/constants.js
|
103355
103398
|
var DEFAULT_RETRY_DELAY_BASE, MAXIMUM_RETRY_DELAY, THROTTLING_RETRY_DELAY_BASE, INITIAL_RETRY_TOKENS, RETRY_COST, TIMEOUT_RETRY_COST, NO_RETRY_INCREMENT, INVOCATION_ID_HEADER, REQUEST_HEADER;
|
103356
|
-
var
|
103399
|
+
var init_constants13 = __esm({
|
103357
103400
|
"../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/constants.js"() {
|
103358
103401
|
init_import_meta_url();
|
103359
103402
|
DEFAULT_RETRY_DELAY_BASE = 100;
|
@@ -103373,7 +103416,7 @@ var getDefaultRetryBackoffStrategy;
|
|
103373
103416
|
var init_defaultRetryBackoffStrategy = __esm({
|
103374
103417
|
"../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/defaultRetryBackoffStrategy.js"() {
|
103375
103418
|
init_import_meta_url();
|
103376
|
-
|
103419
|
+
init_constants13();
|
103377
103420
|
getDefaultRetryBackoffStrategy = /* @__PURE__ */ __name(() => {
|
103378
103421
|
let delayBase = DEFAULT_RETRY_DELAY_BASE;
|
103379
103422
|
const computeNextBackoffDelay = /* @__PURE__ */ __name((attempts) => {
|
@@ -103395,7 +103438,7 @@ var createDefaultRetryToken;
|
|
103395
103438
|
var init_defaultRetryToken = __esm({
|
103396
103439
|
"../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/defaultRetryToken.js"() {
|
103397
103440
|
init_import_meta_url();
|
103398
|
-
|
103441
|
+
init_constants13();
|
103399
103442
|
createDefaultRetryToken = /* @__PURE__ */ __name(({ retryDelay, retryCount, retryCost }) => {
|
103400
103443
|
const getRetryCount = /* @__PURE__ */ __name(() => retryCount, "getRetryCount");
|
103401
103444
|
const getRetryDelay = /* @__PURE__ */ __name(() => Math.min(MAXIMUM_RETRY_DELAY, retryDelay), "getRetryDelay");
|
@@ -103415,7 +103458,7 @@ var init_StandardRetryStrategy = __esm({
|
|
103415
103458
|
"../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/StandardRetryStrategy.js"() {
|
103416
103459
|
init_import_meta_url();
|
103417
103460
|
init_config5();
|
103418
|
-
|
103461
|
+
init_constants13();
|
103419
103462
|
init_defaultRetryBackoffStrategy();
|
103420
103463
|
init_defaultRetryToken();
|
103421
103464
|
StandardRetryStrategy = class {
|
@@ -103519,7 +103562,7 @@ var init_AdaptiveRetryStrategy = __esm({
|
|
103519
103562
|
var init_ConfiguredRetryStrategy = __esm({
|
103520
103563
|
"../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/ConfiguredRetryStrategy.js"() {
|
103521
103564
|
init_import_meta_url();
|
103522
|
-
|
103565
|
+
init_constants13();
|
103523
103566
|
init_StandardRetryStrategy();
|
103524
103567
|
}
|
103525
103568
|
});
|
@@ -103540,7 +103583,7 @@ var init_dist_es44 = __esm({
|
|
103540
103583
|
init_DefaultRateLimiter();
|
103541
103584
|
init_StandardRetryStrategy();
|
103542
103585
|
init_config5();
|
103543
|
-
|
103586
|
+
init_constants13();
|
103544
103587
|
init_types11();
|
103545
103588
|
}
|
103546
103589
|
});
|
@@ -113404,7 +113447,7 @@ var init_isSsoProfile = __esm({
|
|
113404
113447
|
|
113405
113448
|
// ../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/constants.js
|
113406
113449
|
var EXPIRE_WINDOW_MS, REFRESH_MESSAGE;
|
113407
|
-
var
|
113450
|
+
var init_constants14 = __esm({
|
113408
113451
|
"../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/constants.js"() {
|
113409
113452
|
init_import_meta_url();
|
113410
113453
|
EXPIRE_WINDOW_MS = 5 * 60 * 1e3;
|
@@ -113880,7 +113923,7 @@ var init_runtimeConfig_shared = __esm({
|
|
113880
113923
|
|
113881
113924
|
// ../../node_modules/.pnpm/@smithy+util-defaults-mode-node@3.0.34/node_modules/@smithy/util-defaults-mode-node/dist-es/constants.js
|
113882
113925
|
var AWS_EXECUTION_ENV, AWS_REGION_ENV, AWS_DEFAULT_REGION_ENV, ENV_IMDS_DISABLED2, DEFAULTS_MODE_OPTIONS, IMDS_REGION_PATH;
|
113883
|
-
var
|
113926
|
+
var init_constants15 = __esm({
|
113884
113927
|
"../../node_modules/.pnpm/@smithy+util-defaults-mode-node@3.0.34/node_modules/@smithy/util-defaults-mode-node/dist-es/constants.js"() {
|
113885
113928
|
init_import_meta_url();
|
113886
113929
|
AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV";
|
@@ -113919,7 +113962,7 @@ var init_resolveDefaultsModeConfig = __esm({
|
|
113919
113962
|
init_dist_es35();
|
113920
113963
|
init_dist_es39();
|
113921
113964
|
init_dist_es17();
|
113922
|
-
|
113965
|
+
init_constants15();
|
113923
113966
|
init_defaultsModeConfig();
|
113924
113967
|
resolveDefaultsModeConfig = /* @__PURE__ */ __name(({ region = loadConfig(NODE_REGION_CONFIG_OPTIONS), defaultsMode = loadConfig(NODE_DEFAULTS_MODE_CONFIG_OPTIONS) } = {}) => memoize(async () => {
|
113925
113968
|
const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode;
|
@@ -115202,7 +115245,7 @@ var init_validateTokenExpiry = __esm({
|
|
115202
115245
|
"../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js"() {
|
115203
115246
|
init_import_meta_url();
|
115204
115247
|
init_dist_es17();
|
115205
|
-
|
115248
|
+
init_constants14();
|
115206
115249
|
validateTokenExpiry = /* @__PURE__ */ __name((token) => {
|
115207
115250
|
if (token.expiration && token.expiration.getTime() < Date.now()) {
|
115208
115251
|
throw new TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false);
|
@@ -115217,7 +115260,7 @@ var init_validateTokenKey = __esm({
|
|
115217
115260
|
"../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js"() {
|
115218
115261
|
init_import_meta_url();
|
115219
115262
|
init_dist_es17();
|
115220
|
-
|
115263
|
+
init_constants14();
|
115221
115264
|
validateTokenKey = /* @__PURE__ */ __name((key, value, forRefresh = false) => {
|
115222
115265
|
if (typeof value === "undefined") {
|
115223
115266
|
throw new TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${REFRESH_MESSAGE}`, false);
|
@@ -115249,7 +115292,7 @@ var init_fromSso = __esm({
|
|
115249
115292
|
init_import_meta_url();
|
115250
115293
|
init_dist_es17();
|
115251
115294
|
init_dist_es38();
|
115252
|
-
|
115295
|
+
init_constants14();
|
115253
115296
|
init_getNewSsoOidcToken();
|
115254
115297
|
init_validateTokenExpiry();
|
115255
115298
|
init_validateTokenKey();
|
@@ -125783,7 +125826,7 @@ var init_remove2 = __esm({
|
|
125783
125826
|
|
125784
125827
|
// src/queues/constants.ts
|
125785
125828
|
var INVALID_CONSUMER_SETTINGS_ERROR, INVALID_QUEUE_SETTINGS_ERROR, MIN_DELIVERY_DELAY_SECS, MAX_DELIVERY_DELAY_SECS, MIN_MESSAGE_RETENTION_PERIOD_SECS, MAX_MESSAGE_RETENTION_PERIOD_SECS;
|
125786
|
-
var
|
125829
|
+
var init_constants16 = __esm({
|
125787
125830
|
"src/queues/constants.ts"() {
|
125788
125831
|
init_import_meta_url();
|
125789
125832
|
INVALID_CONSUMER_SETTINGS_ERROR = 100127;
|
@@ -125809,7 +125852,7 @@ var init_utils11 = __esm({
|
|
125809
125852
|
"src/queues/utils.ts"() {
|
125810
125853
|
init_import_meta_url();
|
125811
125854
|
init_errors();
|
125812
|
-
|
125855
|
+
init_constants16();
|
125813
125856
|
__name(handleFetchError, "handleFetchError");
|
125814
125857
|
}
|
125815
125858
|
});
|
@@ -125852,7 +125895,7 @@ var init_create6 = __esm({
|
|
125852
125895
|
init_logger();
|
125853
125896
|
init_getValidBindingName();
|
125854
125897
|
init_client();
|
125855
|
-
|
125898
|
+
init_constants16();
|
125856
125899
|
init_utils11();
|
125857
125900
|
queuesCreateCommand = createCommand({
|
125858
125901
|
metadata: {
|
@@ -126216,7 +126259,7 @@ var init_update3 = __esm({
|
|
126216
126259
|
init_errors();
|
126217
126260
|
init_logger();
|
126218
126261
|
init_client();
|
126219
|
-
|
126262
|
+
init_constants16();
|
126220
126263
|
init_utils11();
|
126221
126264
|
queuesUpdateCommand = createCommand({
|
126222
126265
|
metadata: {
|
@@ -126274,7 +126317,7 @@ var init_r2 = __esm({
|
|
126274
126317
|
|
126275
126318
|
// src/r2/constants.ts
|
126276
126319
|
var MAX_UPLOAD_SIZE, LOCATION_CHOICES2;
|
126277
|
-
var
|
126320
|
+
var init_constants17 = __esm({
|
126278
126321
|
"src/r2/constants.ts"() {
|
126279
126322
|
init_import_meta_url();
|
126280
126323
|
MAX_UPLOAD_SIZE = 300 * 1024 * 1024;
|
@@ -126296,7 +126339,7 @@ var init_bucket = __esm({
|
|
126296
126339
|
init_user2();
|
126297
126340
|
init_getValidBindingName();
|
126298
126341
|
init_render_labelled_values();
|
126299
|
-
|
126342
|
+
init_constants17();
|
126300
126343
|
init_helpers2();
|
126301
126344
|
r2BucketNamespace = createNamespace({
|
126302
126345
|
metadata: {
|
@@ -126889,16 +126932,16 @@ var init_domain = __esm({
|
|
126889
126932
|
type: "string"
|
126890
126933
|
}
|
126891
126934
|
},
|
126892
|
-
async handler({ bucket, domain:
|
126935
|
+
async handler({ bucket, domain: domain2, jurisdiction }, { config }) {
|
126893
126936
|
const accountId = await requireAuth(config);
|
126894
126937
|
logger.log(
|
126895
|
-
`Retrieving custom domain '${
|
126938
|
+
`Retrieving custom domain '${domain2}' connected to bucket '${bucket}'...`
|
126896
126939
|
);
|
126897
126940
|
const domainResponse = await getCustomDomain(
|
126898
126941
|
config,
|
126899
126942
|
accountId,
|
126900
126943
|
bucket,
|
126901
|
-
|
126944
|
+
domain2,
|
126902
126945
|
jurisdiction
|
126903
126946
|
);
|
126904
126947
|
const tableOutput = tableFromCustomDomainListResponse([domainResponse]);
|
@@ -126988,7 +127031,7 @@ var init_domain = __esm({
|
|
126988
127031
|
const accountId = await requireAuth(config);
|
126989
127032
|
const {
|
126990
127033
|
bucket,
|
126991
|
-
domain:
|
127034
|
+
domain: domain2,
|
126992
127035
|
zoneId,
|
126993
127036
|
minTls = "1.0",
|
126994
127037
|
jurisdiction,
|
@@ -126996,26 +127039,26 @@ var init_domain = __esm({
|
|
126996
127039
|
} = args;
|
126997
127040
|
if (!force) {
|
126998
127041
|
const confirmedAdd = await confirm(
|
126999
|
-
`Are you sure you want to add the custom domain '${
|
127042
|
+
`Are you sure you want to add the custom domain '${domain2}' to bucket '${bucket}'? The contents of your bucket will be made publicly available at 'https://${domain2}'`
|
127000
127043
|
);
|
127001
127044
|
if (!confirmedAdd) {
|
127002
127045
|
logger.log("Add cancelled.");
|
127003
127046
|
return;
|
127004
127047
|
}
|
127005
127048
|
}
|
127006
|
-
logger.log(`Connecting custom domain '${
|
127049
|
+
logger.log(`Connecting custom domain '${domain2}' to bucket '${bucket}'...`);
|
127007
127050
|
await attachCustomDomainToBucket(
|
127008
127051
|
config,
|
127009
127052
|
accountId,
|
127010
127053
|
bucket,
|
127011
127054
|
{
|
127012
|
-
domain:
|
127055
|
+
domain: domain2,
|
127013
127056
|
zoneId,
|
127014
127057
|
minTLS: minTls
|
127015
127058
|
},
|
127016
127059
|
jurisdiction
|
127017
127060
|
);
|
127018
|
-
logger.log(`\u2728 Custom domain '${
|
127061
|
+
logger.log(`\u2728 Custom domain '${domain2}' connected successfully.`);
|
127019
127062
|
}
|
127020
127063
|
});
|
127021
127064
|
r2BucketDomainRemoveCommand = createCommand({
|
@@ -127051,25 +127094,25 @@ var init_domain = __esm({
|
|
127051
127094
|
},
|
127052
127095
|
async handler(args, { config }) {
|
127053
127096
|
const accountId = await requireAuth(config);
|
127054
|
-
const { bucket, domain:
|
127097
|
+
const { bucket, domain: domain2, jurisdiction, force } = args;
|
127055
127098
|
if (!force) {
|
127056
127099
|
const confirmedRemoval = await confirm(
|
127057
|
-
`Are you sure you want to remove the custom domain '${
|
127100
|
+
`Are you sure you want to remove the custom domain '${domain2}' from bucket '${bucket}'? Your bucket will no longer be available from 'https://${domain2}'`
|
127058
127101
|
);
|
127059
127102
|
if (!confirmedRemoval) {
|
127060
127103
|
logger.log("Removal cancelled.");
|
127061
127104
|
return;
|
127062
127105
|
}
|
127063
127106
|
}
|
127064
|
-
logger.log(`Removing custom domain '${
|
127107
|
+
logger.log(`Removing custom domain '${domain2}' from bucket '${bucket}'...`);
|
127065
127108
|
await removeCustomDomainFromBucket(
|
127066
127109
|
config,
|
127067
127110
|
accountId,
|
127068
127111
|
bucket,
|
127069
|
-
|
127112
|
+
domain2,
|
127070
127113
|
jurisdiction
|
127071
127114
|
);
|
127072
|
-
logger.log(`Custom domain '${
|
127115
|
+
logger.log(`Custom domain '${domain2}' removed successfully.`);
|
127073
127116
|
}
|
127074
127117
|
});
|
127075
127118
|
r2BucketDomainUpdateCommand = createCommand({
|
@@ -127104,20 +127147,20 @@ var init_domain = __esm({
|
|
127104
127147
|
},
|
127105
127148
|
async handler(args, { config }) {
|
127106
127149
|
const accountId = await requireAuth(config);
|
127107
|
-
const { bucket, domain:
|
127108
|
-
logger.log(`Updating custom domain '${
|
127150
|
+
const { bucket, domain: domain2, minTls, jurisdiction } = args;
|
127151
|
+
logger.log(`Updating custom domain '${domain2}' for bucket '${bucket}'...`);
|
127109
127152
|
await configureCustomDomainSettings(
|
127110
127153
|
config,
|
127111
127154
|
accountId,
|
127112
127155
|
bucket,
|
127113
|
-
|
127156
|
+
domain2,
|
127114
127157
|
{
|
127115
|
-
domain:
|
127158
|
+
domain: domain2,
|
127116
127159
|
minTLS: minTls
|
127117
127160
|
},
|
127118
127161
|
jurisdiction
|
127119
127162
|
);
|
127120
|
-
logger.log(`\u2728 Custom domain '${
|
127163
|
+
logger.log(`\u2728 Custom domain '${domain2}' updated successfully.`);
|
127121
127164
|
}
|
127122
127165
|
});
|
127123
127166
|
}
|
@@ -128097,7 +128140,7 @@ var init_object = __esm({
|
|
128097
128140
|
init_logger();
|
128098
128141
|
init_user2();
|
128099
128142
|
init_is_local();
|
128100
|
-
|
128143
|
+
init_constants17();
|
128101
128144
|
init_helpers2();
|
128102
128145
|
r2ObjectNamespace = createNamespace({
|
128103
128146
|
metadata: {
|
@@ -132268,7 +132311,7 @@ var init_debug_build2 = __esm({
|
|
132268
132311
|
|
132269
132312
|
// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/constants.js
|
132270
132313
|
var DEFAULT_ENVIRONMENT;
|
132271
|
-
var
|
132314
|
+
var init_constants18 = __esm({
|
132272
132315
|
"../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/constants.js"() {
|
132273
132316
|
init_import_meta_url();
|
132274
132317
|
DEFAULT_ENVIRONMENT = "production";
|
@@ -132971,7 +133014,7 @@ var init_hub = __esm({
|
|
132971
133014
|
"../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/hub.js"() {
|
132972
133015
|
init_import_meta_url();
|
132973
133016
|
init_esm6();
|
132974
|
-
|
133017
|
+
init_constants18();
|
132975
133018
|
init_debug_build2();
|
132976
133019
|
init_scope();
|
132977
133020
|
init_session();
|
@@ -133724,7 +133767,7 @@ var init_dynamicSamplingContext = __esm({
|
|
133724
133767
|
"../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js"() {
|
133725
133768
|
init_import_meta_url();
|
133726
133769
|
init_esm6();
|
133727
|
-
|
133770
|
+
init_constants18();
|
133728
133771
|
__name(getDynamicSamplingContextFromClient, "getDynamicSamplingContextFromClient");
|
133729
133772
|
}
|
133730
133773
|
});
|
@@ -134179,7 +134222,7 @@ var init_prepareEvent = __esm({
|
|
134179
134222
|
"../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/utils/prepareEvent.js"() {
|
134180
134223
|
init_import_meta_url();
|
134181
134224
|
init_esm6();
|
134182
|
-
|
134225
|
+
init_constants18();
|
134183
134226
|
init_eventProcessors();
|
134184
134227
|
init_scope();
|
134185
134228
|
__name(prepareEvent, "prepareEvent");
|
@@ -138419,7 +138462,7 @@ var init_nodeVersion = __esm({
|
|
138419
138462
|
|
138420
138463
|
// ../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/async/domain.js
|
138421
138464
|
function getActiveDomain() {
|
138422
|
-
return
|
138465
|
+
return domain.active;
|
138423
138466
|
}
|
138424
138467
|
function getCurrentHub2() {
|
138425
138468
|
const activeDomain = getActiveDomain();
|
@@ -138439,7 +138482,7 @@ function runWithAsyncContext2(callback, options) {
|
|
138439
138482
|
if (activeDomain && _optionalChain([options, "optionalAccess", (_4) => _4.reuseExisting])) {
|
138440
138483
|
return callback();
|
138441
138484
|
}
|
138442
|
-
const local =
|
138485
|
+
const local = domain.create();
|
138443
138486
|
const parentHub = activeDomain ? getHubFromCarrier(activeDomain) : void 0;
|
138444
138487
|
const newHub = createNewHub(parentHub);
|
138445
138488
|
setHubOnCarrier(local, newHub);
|
@@ -138450,12 +138493,12 @@ function runWithAsyncContext2(callback, options) {
|
|
138450
138493
|
function setDomainAsyncContextStrategy() {
|
138451
138494
|
setAsyncContextStrategy({ getCurrentHub: getCurrentHub2, runWithAsyncContext: runWithAsyncContext2 });
|
138452
138495
|
}
|
138453
|
-
var
|
138496
|
+
var domain;
|
138454
138497
|
var init_domain2 = __esm({
|
138455
138498
|
"../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/async/domain.js"() {
|
138456
138499
|
init_import_meta_url();
|
138457
138500
|
init_esm6();
|
138458
|
-
|
138501
|
+
domain = __toESM(require("domain"));
|
138459
138502
|
init_esm7();
|
138460
138503
|
__name(getActiveDomain, "getActiveDomain");
|
138461
138504
|
__name(getCurrentHub2, "getCurrentHub");
|
@@ -140987,6 +141030,9 @@ var init_triggers = __esm({
|
|
140987
141030
|
hidden: true
|
140988
141031
|
}
|
140989
141032
|
},
|
141033
|
+
behaviour: {
|
141034
|
+
warnIfMultipleEnvsConfiguredButNoneSpecified: true
|
141035
|
+
},
|
140990
141036
|
async handler(args, { config }) {
|
140991
141037
|
const assetsOptions = getAssetsOptions({ assets: void 0 }, config);
|
140992
141038
|
sendMetricsEvent(
|
@@ -142190,7 +142236,7 @@ var init_logPossibleBugMessage = __esm({
|
|
142190
142236
|
init_import_meta_url();
|
142191
142237
|
init_logger();
|
142192
142238
|
init_update_check();
|
142193
|
-
|
142239
|
+
init_constants5();
|
142194
142240
|
__name(logPossibleBugMessage, "logPossibleBugMessage");
|
142195
142241
|
}
|
142196
142242
|
});
|
@@ -143881,7 +143927,8 @@ var init_deploy6 = __esm({
|
|
143881
143927
|
status: "stable"
|
143882
143928
|
},
|
143883
143929
|
behaviour: {
|
143884
|
-
useConfigRedirectIfAvailable: true
|
143930
|
+
useConfigRedirectIfAvailable: true,
|
143931
|
+
warnIfMultipleEnvsConfiguredButNoneSpecified: true
|
143885
143932
|
},
|
143886
143933
|
args: {
|
143887
143934
|
name: {
|
@@ -144807,7 +144854,8 @@ var init_bulk = __esm({
|
|
144807
144854
|
status: "stable"
|
144808
144855
|
},
|
144809
144856
|
behaviour: {
|
144810
|
-
printConfigWarnings: false
|
144857
|
+
printConfigWarnings: false,
|
144858
|
+
warnIfMultipleEnvsConfiguredButNoneSpecified: true
|
144811
144859
|
},
|
144812
144860
|
args: {
|
144813
144861
|
file: {
|
@@ -144905,7 +144953,8 @@ var init_delete8 = __esm({
|
|
144905
144953
|
status: "stable"
|
144906
144954
|
},
|
144907
144955
|
behaviour: {
|
144908
|
-
printConfigWarnings: false
|
144956
|
+
printConfigWarnings: false,
|
144957
|
+
warnIfMultipleEnvsConfiguredButNoneSpecified: true
|
144909
144958
|
},
|
144910
144959
|
args: {
|
144911
144960
|
key: {
|
@@ -145110,7 +145159,8 @@ var init_put = __esm({
|
|
145110
145159
|
status: "stable"
|
145111
145160
|
},
|
145112
145161
|
behaviour: {
|
145113
|
-
printConfigWarnings: false
|
145162
|
+
printConfigWarnings: false,
|
145163
|
+
warnIfMultipleEnvsConfiguredButNoneSpecified: true
|
145114
145164
|
},
|
145115
145165
|
args: {
|
145116
145166
|
key: {
|
@@ -145806,7 +145856,8 @@ var init_upload2 = __esm({
|
|
145806
145856
|
MULTIWORKER: false,
|
145807
145857
|
RESOURCES_PROVISION: args.experimentalProvision ?? false,
|
145808
145858
|
MIXED_MODE: false
|
145809
|
-
}), "overrideExperimentalFlags")
|
145859
|
+
}), "overrideExperimentalFlags"),
|
145860
|
+
warnIfMultipleEnvsConfiguredButNoneSpecified: true
|
145810
145861
|
},
|
145811
145862
|
handler: /* @__PURE__ */ __name(async function versionsUploadHandler(args, { config }) {
|
145812
145863
|
const entry = await getEntry(args, config, "versions upload");
|
@@ -146253,7 +146304,7 @@ var init_describe = __esm({
|
|
146253
146304
|
|
146254
146305
|
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constants.js
|
146255
146306
|
var daysInYear, maxTime, minTime, millisecondsInMinute, minutesInYear, minutesInMonth, minutesInDay, secondsInHour, secondsInDay, secondsInWeek, secondsInYear, secondsInMonth, secondsInQuarter, constructFromSymbol;
|
146256
|
-
var
|
146307
|
+
var init_constants19 = __esm({
|
146257
146308
|
"../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constants.js"() {
|
146258
146309
|
init_import_meta_url();
|
146259
146310
|
daysInYear = 365.2425;
|
@@ -146284,7 +146335,7 @@ function constructFrom(date, value) {
|
|
146284
146335
|
var init_constructFrom = __esm({
|
146285
146336
|
"../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constructFrom.js"() {
|
146286
146337
|
init_import_meta_url();
|
146287
|
-
|
146338
|
+
init_constants19();
|
146288
146339
|
__name(constructFrom, "constructFrom");
|
146289
146340
|
}
|
146290
146341
|
});
|
@@ -147669,7 +147720,7 @@ var init_formatDistanceStrict = __esm({
|
|
147669
147720
|
init_getTimezoneOffsetInMilliseconds();
|
147670
147721
|
init_normalizeDates();
|
147671
147722
|
init_compareAsc();
|
147672
|
-
|
147723
|
+
init_constants19();
|
147673
147724
|
__name(formatDistanceStrict, "formatDistanceStrict");
|
147674
147725
|
}
|
147675
147726
|
});
|
@@ -151060,7 +151111,7 @@ var init_src = __esm({
|
|
151060
151111
|
init_user2();
|
151061
151112
|
init_commands8();
|
151062
151113
|
init_whoami();
|
151063
|
-
|
151114
|
+
init_constants5();
|
151064
151115
|
init_log_file();
|
151065
151116
|
init_logPossibleBugMessage();
|
151066
151117
|
init_create7();
|
@@ -151458,19 +151509,19 @@ async function publishCustomDomains(complianceConfig, workerUrl, accountId, doma
|
|
151458
151509
|
}
|
151459
151510
|
);
|
151460
151511
|
const updatesRequired = changeset.updated.filter(
|
151461
|
-
(
|
151512
|
+
(domain2) => domain2.modified
|
151462
151513
|
);
|
151463
151514
|
if (updatesRequired.length > 0) {
|
151464
151515
|
const existing = await Promise.all(
|
151465
151516
|
updatesRequired.map(
|
151466
|
-
(
|
151517
|
+
(domain2) => fetchResult(
|
151467
151518
|
complianceConfig,
|
151468
|
-
`/accounts/${accountId}/workers/domains/records/${
|
151519
|
+
`/accounts/${accountId}/workers/domains/records/${domain2.id}`
|
151469
151520
|
)
|
151470
151521
|
)
|
151471
151522
|
);
|
151472
151523
|
const existingRendered = existing.map(
|
151473
|
-
(
|
151524
|
+
(domain2) => ` \u2022 ${domain2.hostname} (used as a domain for "${domain2.service}")`
|
151474
151525
|
).join("\n");
|
151475
151526
|
const message = `Custom Domains already exist for these domains:
|
151476
151527
|
${existingRendered}
|
@@ -151481,7 +151532,7 @@ Update them to point to this script instead?`;
|
|
151481
151532
|
options.override_existing_origin = true;
|
151482
151533
|
}
|
151483
151534
|
if (changeset.conflicting.length > 0) {
|
151484
|
-
const conflicitingRendered = changeset.conflicting.map((
|
151535
|
+
const conflicitingRendered = changeset.conflicting.map((domain2) => ` \u2022 ${domain2.hostname}`).join("\n");
|
151485
151536
|
const message = `You already have DNS records that conflict for these Custom Domains:
|
151486
151537
|
${conflicitingRendered}
|
151487
151538
|
Update them to point to this script instead?`;
|
@@ -151498,7 +151549,7 @@ Update them to point to this script instead?`;
|
|
151498
151549
|
"Content-Type": "application/json"
|
151499
151550
|
}
|
151500
151551
|
});
|
151501
|
-
return domains.map((
|
151552
|
+
return domains.map((domain2) => renderRoute(domain2));
|
151502
151553
|
}
|
151503
151554
|
async function deploy(props) {
|
151504
151555
|
const { config, accountId, name: name2 } = props;
|
@@ -152984,7 +153035,7 @@ async function resolveDevConfig(config, input) {
|
|
152984
153035
|
httpsKeyPath: input.dev?.server?.httpsKeyPath,
|
152985
153036
|
httpsCertPath: input.dev?.server?.httpsCertPath
|
152986
153037
|
},
|
152987
|
-
inspector: {
|
153038
|
+
inspector: input.dev?.inspector === false ? false : {
|
152988
153039
|
port: input.dev?.inspector?.port ?? config.dev.inspector_port ?? await getInspectorPort()
|
152989
153040
|
},
|
152990
153041
|
origin: {
|
@@ -153211,7 +153262,6 @@ function resolveContainerConfig(config) {
|
|
153211
153262
|
image: container.image ?? container.configuration.image,
|
153212
153263
|
maxInstances: container.max_instances,
|
153213
153264
|
imageBuildContext: container.image_build_context,
|
153214
|
-
exposedPorts: container.dev_exposed_ports,
|
153215
153265
|
name: container.name
|
153216
153266
|
};
|
153217
153267
|
}
|
@@ -153236,7 +153286,7 @@ var init_ConfigController = __esm({
|
|
153236
153286
|
init_logger();
|
153237
153287
|
init_helpers8();
|
153238
153288
|
init_user2();
|
153239
|
-
|
153289
|
+
init_constants5();
|
153240
153290
|
init_getDevCompatibilityDate();
|
153241
153291
|
init_getRules();
|
153242
153292
|
init_getScriptName();
|
@@ -172034,7 +172084,7 @@ var init_ProxyController = __esm({
|
|
172034
172084
|
return;
|
172035
172085
|
}
|
172036
172086
|
(0, import_node_assert25.default)(this.latestConfig !== void 0);
|
172037
|
-
const cert = this.latestConfig.dev?.server?.secure || this.latestConfig.dev?.inspector?.secure ? getHttpsOptions(
|
172087
|
+
const cert = this.latestConfig.dev?.server?.secure || this.latestConfig.dev.inspector !== false && this.latestConfig.dev?.inspector?.secure ? getHttpsOptions(
|
172038
172088
|
this.latestConfig.dev.server?.httpsKeyPath,
|
172039
172089
|
this.latestConfig.dev.server?.httpsCertPath
|
172040
172090
|
) : void 0;
|
@@ -172073,40 +172123,6 @@ var init_ProxyController = __esm({
|
|
172073
172123
|
// no need to use file-system, so don't
|
172074
172124
|
cache: false,
|
172075
172125
|
unsafeEphemeralDurableObjects: true
|
172076
|
-
},
|
172077
|
-
{
|
172078
|
-
name: "InspectorProxyWorker",
|
172079
|
-
compatibilityDate: "2023-12-18",
|
172080
|
-
compatibilityFlags: [
|
172081
|
-
"nodejs_compat",
|
172082
|
-
"increase_websocket_message_size"
|
172083
|
-
],
|
172084
|
-
modulesRoot: import_node_path61.default.dirname(InspectorProxyWorker_default),
|
172085
|
-
modules: [{ type: "ESModule", path: InspectorProxyWorker_default }],
|
172086
|
-
durableObjects: {
|
172087
|
-
DURABLE_OBJECT: {
|
172088
|
-
className: "InspectorProxyWorker",
|
172089
|
-
unsafePreventEviction: true
|
172090
|
-
}
|
172091
|
-
},
|
172092
|
-
serviceBindings: {
|
172093
|
-
PROXY_CONTROLLER: /* @__PURE__ */ __name(async (req) => {
|
172094
|
-
const body = await req.json();
|
172095
|
-
return this.onInspectorProxyWorkerRequest(body);
|
172096
|
-
}, "PROXY_CONTROLLER")
|
172097
|
-
},
|
172098
|
-
bindings: {
|
172099
|
-
PROXY_CONTROLLER_AUTH_SECRET: this.secret
|
172100
|
-
},
|
172101
|
-
unsafeDirectSockets: [
|
172102
|
-
{
|
172103
|
-
host: this.latestConfig.dev?.inspector?.hostname,
|
172104
|
-
port: this.latestConfig.dev?.inspector?.port ?? 0
|
172105
|
-
}
|
172106
|
-
],
|
172107
|
-
// no need to use file-system, so don't
|
172108
|
-
cache: false,
|
172109
|
-
unsafeEphemeralDurableObjects: true
|
172110
172126
|
}
|
172111
172127
|
],
|
172112
172128
|
verbose: logger.loggerLevel === "debug",
|
@@ -172120,6 +172136,42 @@ var init_ProxyController = __esm({
|
|
172120
172136
|
handleRuntimeStdio,
|
172121
172137
|
liveReload: false
|
172122
172138
|
};
|
172139
|
+
if (this.latestConfig.dev.inspector !== false) {
|
172140
|
+
proxyWorkerOptions.workers.push({
|
172141
|
+
name: "InspectorProxyWorker",
|
172142
|
+
compatibilityDate: "2023-12-18",
|
172143
|
+
compatibilityFlags: [
|
172144
|
+
"nodejs_compat",
|
172145
|
+
"increase_websocket_message_size"
|
172146
|
+
],
|
172147
|
+
modulesRoot: import_node_path61.default.dirname(InspectorProxyWorker_default),
|
172148
|
+
modules: [{ type: "ESModule", path: InspectorProxyWorker_default }],
|
172149
|
+
durableObjects: {
|
172150
|
+
DURABLE_OBJECT: {
|
172151
|
+
className: "InspectorProxyWorker",
|
172152
|
+
unsafePreventEviction: true
|
172153
|
+
}
|
172154
|
+
},
|
172155
|
+
serviceBindings: {
|
172156
|
+
PROXY_CONTROLLER: /* @__PURE__ */ __name(async (req) => {
|
172157
|
+
const body = await req.json();
|
172158
|
+
return this.onInspectorProxyWorkerRequest(body);
|
172159
|
+
}, "PROXY_CONTROLLER")
|
172160
|
+
},
|
172161
|
+
bindings: {
|
172162
|
+
PROXY_CONTROLLER_AUTH_SECRET: this.secret
|
172163
|
+
},
|
172164
|
+
unsafeDirectSockets: [
|
172165
|
+
{
|
172166
|
+
host: this.latestConfig.dev?.inspector?.hostname,
|
172167
|
+
port: this.latestConfig.dev?.inspector?.port ?? 0
|
172168
|
+
}
|
172169
|
+
],
|
172170
|
+
// no need to use file-system, so don't
|
172171
|
+
cache: false,
|
172172
|
+
unsafeEphemeralDurableObjects: true
|
172173
|
+
});
|
172174
|
+
}
|
172123
172175
|
const proxyWorkerOptionsChanged = didMiniflareOptionsChange(
|
172124
172176
|
this.proxyWorkerOptions,
|
172125
172177
|
proxyWorkerOptions
|
@@ -172138,13 +172190,17 @@ var init_ProxyController = __esm({
|
|
172138
172190
|
if (willInstantiateMiniflareInstance) {
|
172139
172191
|
void Promise.all([
|
172140
172192
|
proxyWorker.ready,
|
172141
|
-
proxyWorker.unsafeGetDirectURL("InspectorProxyWorker")
|
172193
|
+
this.latestConfig.dev.inspector === false ? Promise.resolve(void 0) : proxyWorker.unsafeGetDirectURL("InspectorProxyWorker")
|
172142
172194
|
]).then(([url4, inspectorUrl]) => {
|
172195
|
+
if (!inspectorUrl) {
|
172196
|
+
return [url4, void 0];
|
172197
|
+
}
|
172143
172198
|
return this.reconnectInspectorProxyWorker().then(() => [
|
172144
172199
|
url4,
|
172145
172200
|
inspectorUrl
|
172146
172201
|
]);
|
172147
172202
|
}).then(([url4, inspectorUrl]) => {
|
172203
|
+
(0, import_node_assert25.default)(url4);
|
172148
172204
|
this.emitReadyEvent(proxyWorker, url4, inspectorUrl);
|
172149
172205
|
}).catch((error2) => {
|
172150
172206
|
if (this._torndown) {
|
@@ -172161,6 +172217,10 @@ var init_ProxyController = __esm({
|
|
172161
172217
|
if (this._torndown) {
|
172162
172218
|
return;
|
172163
172219
|
}
|
172220
|
+
(0, import_node_assert25.default)(
|
172221
|
+
this.latestConfig?.dev.inspector !== false,
|
172222
|
+
"Trying to reconnect with inspector proxy worker when inspector is disabled"
|
172223
|
+
);
|
172164
172224
|
const existingWebSocket = await this.inspectorProxyWorkerWebSocket?.promise;
|
172165
172225
|
if (existingWebSocket?.readyState === wrapper_default.OPEN) {
|
172166
172226
|
return existingWebSocket;
|
@@ -172201,7 +172261,9 @@ var init_ProxyController = __esm({
|
|
172201
172261
|
if (this._torndown) {
|
172202
172262
|
return;
|
172203
172263
|
}
|
172204
|
-
|
172264
|
+
if (this.latestConfig?.dev.inspector !== false) {
|
172265
|
+
void this.reconnectInspectorProxyWorker();
|
172266
|
+
}
|
172205
172267
|
});
|
172206
172268
|
await import_node_events4.default.once(webSocket, "open");
|
172207
172269
|
this.inspectorProxyWorkerWebSocket?.resolve(webSocket);
|
@@ -172245,6 +172307,10 @@ var init_ProxyController = __esm({
|
|
172245
172307
|
if (this._torndown) {
|
172246
172308
|
return;
|
172247
172309
|
}
|
172310
|
+
(0, import_node_assert25.default)(
|
172311
|
+
this.latestConfig?.dev.inspector !== false,
|
172312
|
+
"Trying to send message to inspector proxy worker when inspector is disabled"
|
172313
|
+
);
|
172248
172314
|
try {
|
172249
172315
|
const websocket = await this.reconnectInspectorProxyWorker();
|
172250
172316
|
(0, import_node_assert25.default)(websocket);
|
@@ -172280,7 +172346,9 @@ var init_ProxyController = __esm({
|
|
172280
172346
|
onReloadStart(data) {
|
172281
172347
|
this.latestConfig = data.config;
|
172282
172348
|
void this.sendMessageToProxyWorker({ type: "pause" });
|
172283
|
-
|
172349
|
+
if (this.latestConfig.dev.inspector !== false) {
|
172350
|
+
void this.sendMessageToInspectorProxyWorker({ type: "reloadStart" });
|
172351
|
+
}
|
172284
172352
|
}
|
172285
172353
|
onReloadComplete(data) {
|
172286
172354
|
this.latestConfig = data.config;
|
@@ -172289,10 +172357,12 @@ var init_ProxyController = __esm({
|
|
172289
172357
|
type: "play",
|
172290
172358
|
proxyData: data.proxyData
|
172291
172359
|
});
|
172292
|
-
|
172293
|
-
|
172294
|
-
|
172295
|
-
|
172360
|
+
if (this.latestConfig.dev.inspector !== false) {
|
172361
|
+
void this.sendMessageToInspectorProxyWorker({
|
172362
|
+
type: "reloadComplete",
|
172363
|
+
proxyData: data.proxyData
|
172364
|
+
});
|
172365
|
+
}
|
172296
172366
|
}
|
172297
172367
|
onProxyWorkerMessage(message) {
|
172298
172368
|
switch (message.type) {
|
@@ -172310,6 +172380,10 @@ var init_ProxyController = __esm({
|
|
172310
172380
|
}
|
172311
172381
|
}
|
172312
172382
|
onInspectorProxyWorkerMessage(message) {
|
172383
|
+
(0, import_node_assert25.default)(
|
172384
|
+
this.latestConfig?.dev.inspector !== false,
|
172385
|
+
"Trying to handle inspector message when inspector is disabled"
|
172386
|
+
);
|
172313
172387
|
switch (message.method) {
|
172314
172388
|
case "Runtime.consoleAPICalled": {
|
172315
172389
|
if (this._torndown) {
|
@@ -172332,6 +172406,10 @@ var init_ProxyController = __esm({
|
|
172332
172406
|
}
|
172333
172407
|
}
|
172334
172408
|
async onInspectorProxyWorkerRequest(message) {
|
172409
|
+
(0, import_node_assert25.default)(
|
172410
|
+
this.latestConfig?.dev.inspector !== false,
|
172411
|
+
"Trying to handle inspector request when inspector is disabled"
|
172412
|
+
);
|
172335
172413
|
switch (message.type) {
|
172336
172414
|
case "runtime-websocket-error":
|
172337
172415
|
logger.debug(
|
@@ -173294,6 +173372,7 @@ var init_startDevWorker = __esm({
|
|
173294
173372
|
// src/api/mixedMode/index.ts
|
173295
173373
|
var mixedMode_exports = {};
|
173296
173374
|
__export(mixedMode_exports, {
|
173375
|
+
maybeStartOrUpdateMixedModeSession: () => maybeStartOrUpdateMixedModeSession,
|
173297
173376
|
pickRemoteBindings: () => pickRemoteBindings,
|
173298
173377
|
startMixedModeSession: () => startMixedModeSession
|
173299
173378
|
});
|
@@ -173317,12 +173396,7 @@ async function startMixedModeSession(bindings, options) {
|
|
173317
173396
|
server: {
|
173318
173397
|
port: await getPorts()
|
173319
173398
|
},
|
173320
|
-
|
173321
|
-
// default one, we should ideally add an option to actually disable
|
173322
|
-
// the inspector
|
173323
|
-
inspector: {
|
173324
|
-
port: await getPorts()
|
173325
|
-
},
|
173399
|
+
inspector: false,
|
173326
173400
|
logLevel: "error"
|
173327
173401
|
},
|
173328
173402
|
bindings: rawBindings
|
@@ -173354,16 +173428,63 @@ function pickRemoteBindings(bindings) {
|
|
173354
173428
|
})
|
173355
173429
|
);
|
173356
173430
|
}
|
173357
|
-
|
173431
|
+
async function maybeStartOrUpdateMixedModeSession(configPathOrWorkerConfig, preExistingMixedModeSessionData) {
|
173432
|
+
if (typeof configPathOrWorkerConfig === "string") {
|
173433
|
+
const configPath = configPathOrWorkerConfig;
|
173434
|
+
const config = readConfig({ config: configPath });
|
173435
|
+
(0, import_node_assert28.default)(config.name);
|
173436
|
+
configPathOrWorkerConfig = {
|
173437
|
+
name: config.name,
|
173438
|
+
bindings: convertConfigBindingsToStartWorkerBindings(config) ?? {}
|
173439
|
+
};
|
173440
|
+
}
|
173441
|
+
const workerConfigs = configPathOrWorkerConfig;
|
173442
|
+
const remoteBindings = pickRemoteBindings(workerConfigs.bindings);
|
173443
|
+
let mixedModeSession = preExistingMixedModeSessionData?.session;
|
173444
|
+
const remoteBindingsAreSameAsBefore = deepStrictEqual(
|
173445
|
+
remoteBindings,
|
173446
|
+
preExistingMixedModeSessionData?.remoteBindings
|
173447
|
+
);
|
173448
|
+
if (!remoteBindingsAreSameAsBefore) {
|
173449
|
+
if (!mixedModeSession) {
|
173450
|
+
if (Object.keys(remoteBindings).length > 0) {
|
173451
|
+
mixedModeSession = await startMixedModeSession(remoteBindings);
|
173452
|
+
}
|
173453
|
+
} else {
|
173454
|
+
await mixedModeSession.updateBindings(remoteBindings);
|
173455
|
+
}
|
173456
|
+
}
|
173457
|
+
await mixedModeSession?.ready;
|
173458
|
+
if (!mixedModeSession) {
|
173459
|
+
return null;
|
173460
|
+
}
|
173461
|
+
return {
|
173462
|
+
session: mixedModeSession,
|
173463
|
+
remoteBindings
|
173464
|
+
};
|
173465
|
+
}
|
173466
|
+
function deepStrictEqual(source, target) {
|
173467
|
+
try {
|
173468
|
+
import_node_assert28.default.deepStrictEqual(source, target);
|
173469
|
+
return true;
|
173470
|
+
} catch {
|
173471
|
+
return false;
|
173472
|
+
}
|
173473
|
+
}
|
173474
|
+
var import_node_assert28, import_node_path63;
|
173358
173475
|
var init_mixedMode = __esm({
|
173359
173476
|
"src/api/mixedMode/index.ts"() {
|
173360
173477
|
init_import_meta_url();
|
173478
|
+
import_node_assert28 = __toESM(require("assert"));
|
173361
173479
|
import_node_path63 = __toESM(require("path"));
|
173362
173480
|
init_get_port();
|
173481
|
+
init_config2();
|
173363
173482
|
init_paths();
|
173364
173483
|
init_startDevWorker();
|
173365
173484
|
__name(startMixedModeSession, "startMixedModeSession");
|
173366
173485
|
__name(pickRemoteBindings, "pickRemoteBindings");
|
173486
|
+
__name(maybeStartOrUpdateMixedModeSession, "maybeStartOrUpdateMixedModeSession");
|
173487
|
+
__name(deepStrictEqual, "deepStrictEqual");
|
173367
173488
|
}
|
173368
173489
|
});
|
173369
173490
|
|
@@ -173447,7 +173568,13 @@ async function convertToConfigBundle(event) {
|
|
173447
173568
|
initialPort: void 0,
|
173448
173569
|
initialIp: "127.0.0.1",
|
173449
173570
|
rules: [],
|
173450
|
-
|
173571
|
+
...event.config.dev.inspector === false ? {
|
173572
|
+
inspect: false,
|
173573
|
+
inspectorPort: void 0
|
173574
|
+
} : {
|
173575
|
+
inspect: true,
|
173576
|
+
inspectorPort: 0
|
173577
|
+
},
|
173451
173578
|
localPersistencePath: event.config.dev.persist,
|
173452
173579
|
liveReload: event.config.dev?.liveReload ?? false,
|
173453
173580
|
crons,
|
@@ -173457,7 +173584,6 @@ async function convertToConfigBundle(event) {
|
|
173457
173584
|
httpsKeyPath: event.config.dev?.server?.httpsKeyPath,
|
173458
173585
|
localUpstream: event.config.dev?.origin?.hostname,
|
173459
173586
|
upstreamProtocol: event.config.dev?.origin?.secure ? "https" : "http",
|
173460
|
-
inspect: true,
|
173461
173587
|
services: bindings.services,
|
173462
173588
|
serviceBindings: fetchers,
|
173463
173589
|
bindVectorizeToProd: event.config.dev?.bindVectorizeToProd ?? false,
|
@@ -173469,26 +173595,6 @@ async function convertToConfigBundle(event) {
|
|
173469
173595
|
dockerPath: event.config.dev.dockerPath ?? "docker"
|
173470
173596
|
};
|
173471
173597
|
}
|
173472
|
-
async function maybeStartOrUpdateMixedModeSession(configBundle, mixedModeSession) {
|
173473
|
-
const { startMixedModeSession: startMixedModeSession2, pickRemoteBindings: pickRemoteBindings2 } = await Promise.resolve().then(() => (init_mixedMode(), mixedMode_exports));
|
173474
|
-
const convertedBindings = convertCfWorkerInitBindingsToBindings(
|
173475
|
-
configBundle.bindings
|
173476
|
-
);
|
173477
|
-
const remoteBindings = pickRemoteBindings2(convertedBindings ?? {});
|
173478
|
-
if (mixedModeSession === void 0) {
|
173479
|
-
const numOfRemoteBindings = Object.keys(remoteBindings ?? {}).length;
|
173480
|
-
if (numOfRemoteBindings > 0) {
|
173481
|
-
mixedModeSession = await startMixedModeSession2(remoteBindings, {
|
173482
|
-
workerName: configBundle.name,
|
173483
|
-
complianceRegion: configBundle.complianceRegion
|
173484
|
-
});
|
173485
|
-
}
|
173486
|
-
} else {
|
173487
|
-
await mixedModeSession.updateBindings(remoteBindings);
|
173488
|
-
}
|
173489
|
-
await mixedModeSession?.ready;
|
173490
|
-
return mixedModeSession;
|
173491
|
-
}
|
173492
173598
|
var import_node_crypto14, import_promises37, import_miniflare26, LocalRuntimeController;
|
173493
173599
|
var init_LocalRuntimeController = __esm({
|
173494
173600
|
"src/api/startDevWorker/LocalRuntimeController.ts"() {
|
@@ -173524,7 +173630,7 @@ var init_LocalRuntimeController = __esm({
|
|
173524
173630
|
// wrap updates in a mutex, so they're always applied in invocation order.
|
173525
173631
|
#mutex = new import_miniflare26.Mutex();
|
173526
173632
|
#mf;
|
173527
|
-
#
|
173633
|
+
#mixedModeSessionData = null;
|
173528
173634
|
onBundleStart(_4) {
|
173529
173635
|
}
|
173530
173636
|
async #onBundleComplete(data, id) {
|
@@ -173532,16 +173638,20 @@ var init_LocalRuntimeController = __esm({
|
|
173532
173638
|
const configBundle = await convertToConfigBundle(data);
|
173533
173639
|
const experimentalMixedMode = data.config.dev.experimentalMixedMode ?? false;
|
173534
173640
|
if (experimentalMixedMode && !data.config.dev?.remote) {
|
173535
|
-
|
173536
|
-
|
173537
|
-
|
173641
|
+
const { maybeStartOrUpdateMixedModeSession: maybeStartOrUpdateMixedModeSession2 } = await Promise.resolve().then(() => (init_mixedMode(), mixedMode_exports));
|
173642
|
+
this.#mixedModeSessionData = await maybeStartOrUpdateMixedModeSession2(
|
173643
|
+
{
|
173644
|
+
name: configBundle.name,
|
173645
|
+
bindings: convertCfWorkerInitBindingsToBindings(configBundle.bindings) ?? {}
|
173646
|
+
},
|
173647
|
+
this.#mixedModeSessionData ?? null
|
173538
173648
|
);
|
173539
173649
|
}
|
173540
173650
|
const { options, internalObjects, entrypointNames } = await buildMiniflareOptions(
|
173541
173651
|
this.#log,
|
173542
173652
|
configBundle,
|
173543
173653
|
this.#proxyToUserWorkerAuthenticationSecret,
|
173544
|
-
this.#
|
173654
|
+
this.#mixedModeSessionData?.session?.mixedModeConnectionString,
|
173545
173655
|
!!experimentalMixedMode
|
173546
173656
|
);
|
173547
173657
|
options.liveReload = false;
|
@@ -173553,7 +173663,7 @@ var init_LocalRuntimeController = __esm({
|
|
173553
173663
|
await this.#mf.setOptions(options);
|
173554
173664
|
}
|
173555
173665
|
const userWorkerUrl = await this.#mf.ready;
|
173556
|
-
const userWorkerInspectorUrl = await this.#mf.getInspectorURL();
|
173666
|
+
const userWorkerInspectorUrl = options.inspectorPort === void 0 ? void 0 : await this.#mf.getInspectorURL();
|
173557
173667
|
if (id !== this.#currentBundleId) {
|
173558
173668
|
return;
|
173559
173669
|
}
|
@@ -173573,12 +173683,14 @@ var init_LocalRuntimeController = __esm({
|
|
173573
173683
|
hostname: userWorkerUrl.hostname,
|
173574
173684
|
port: userWorkerUrl.port
|
173575
173685
|
},
|
173576
|
-
userWorkerInspectorUrl
|
173577
|
-
|
173578
|
-
|
173579
|
-
|
173580
|
-
|
173581
|
-
|
173686
|
+
...userWorkerInspectorUrl ? {
|
173687
|
+
userWorkerInspectorUrl: {
|
173688
|
+
protocol: userWorkerInspectorUrl.protocol,
|
173689
|
+
hostname: userWorkerInspectorUrl.hostname,
|
173690
|
+
port: userWorkerInspectorUrl.port,
|
173691
|
+
pathname: `/core:user:${getName2(data.config)}`
|
173692
|
+
}
|
173693
|
+
} : {},
|
173582
173694
|
userWorkerInnerUrlOverrides: {
|
173583
173695
|
protocol: data.config?.dev?.origin?.secure ? "https:" : "http:",
|
173584
173696
|
hostname: data.config?.dev?.origin?.hostname,
|
@@ -173626,11 +173738,11 @@ var init_LocalRuntimeController = __esm({
|
|
173626
173738
|
}
|
173627
173739
|
await this.#mf?.dispose();
|
173628
173740
|
this.#mf = void 0;
|
173629
|
-
if (this.#
|
173741
|
+
if (this.#mixedModeSessionData) {
|
173630
173742
|
logger.log(source_default.dim("\u2394 Shutting down remote connection..."));
|
173631
173743
|
}
|
173632
|
-
await this.#
|
173633
|
-
this.#
|
173744
|
+
await this.#mixedModeSessionData?.session?.dispose();
|
173745
|
+
this.#mixedModeSessionData = null;
|
173634
173746
|
logger.debug("LocalRuntimeController teardown complete");
|
173635
173747
|
}, "#teardown");
|
173636
173748
|
async teardown() {
|
@@ -173646,7 +173758,6 @@ var init_LocalRuntimeController = __esm({
|
|
173646
173758
|
this.emit("reloadComplete", data);
|
173647
173759
|
}
|
173648
173760
|
};
|
173649
|
-
__name(maybeStartOrUpdateMixedModeSession, "maybeStartOrUpdateMixedModeSession");
|
173650
173761
|
}
|
173651
173762
|
});
|
173652
173763
|
|
@@ -173673,11 +173784,11 @@ function ensureMatchingSql(options) {
|
|
173673
173784
|
}
|
173674
173785
|
return options;
|
173675
173786
|
}
|
173676
|
-
var
|
173787
|
+
var import_node_assert29, import_node_crypto15, import_miniflare27, MultiworkerRuntimeController;
|
173677
173788
|
var init_MultiworkerRuntimeController = __esm({
|
173678
173789
|
"src/api/startDevWorker/MultiworkerRuntimeController.ts"() {
|
173679
173790
|
init_import_meta_url();
|
173680
|
-
|
173791
|
+
import_node_assert29 = __toESM(require("assert"));
|
173681
173792
|
import_node_crypto15 = require("crypto");
|
173682
173793
|
init_source();
|
173683
173794
|
import_miniflare27 = require("miniflare");
|
@@ -173685,6 +173796,7 @@ var init_MultiworkerRuntimeController = __esm({
|
|
173685
173796
|
init_logger();
|
173686
173797
|
init_events();
|
173687
173798
|
init_LocalRuntimeController();
|
173799
|
+
init_utils();
|
173688
173800
|
__name(ensureMatchingSql, "ensureMatchingSql");
|
173689
173801
|
MultiworkerRuntimeController = class extends LocalRuntimeController {
|
173690
173802
|
constructor(numWorkers) {
|
@@ -173709,13 +173821,13 @@ var init_MultiworkerRuntimeController = __esm({
|
|
173709
173821
|
#mutex = new import_miniflare27.Mutex();
|
173710
173822
|
#mf;
|
173711
173823
|
#options = /* @__PURE__ */ new Map();
|
173712
|
-
#
|
173824
|
+
#mixedModeSessionsData = /* @__PURE__ */ new Map();
|
173713
173825
|
#canStartMiniflare() {
|
173714
173826
|
return [...this.#options.values()].some((o5) => o5.primary) && [...this.#options.values()].length === this.numWorkers;
|
173715
173827
|
}
|
173716
173828
|
#mergedMfOptions() {
|
173717
173829
|
const primary = [...this.#options.values()].find((o5) => o5.primary);
|
173718
|
-
(0,
|
173830
|
+
(0, import_node_assert29.default)(primary !== void 0);
|
173719
173831
|
const secondary = [...this.#options.values()].filter((o5) => !o5.primary);
|
173720
173832
|
return {
|
173721
173833
|
...primary.options,
|
@@ -173735,17 +173847,24 @@ var init_MultiworkerRuntimeController = __esm({
|
|
173735
173847
|
const configBundle = await convertToConfigBundle(data);
|
173736
173848
|
const experimentalMixedMode = data.config.dev.experimentalMixedMode;
|
173737
173849
|
if (experimentalMixedMode && !data.config.dev?.remote) {
|
173738
|
-
const
|
173739
|
-
|
173740
|
-
|
173850
|
+
const { maybeStartOrUpdateMixedModeSession: maybeStartOrUpdateMixedModeSession2 } = await Promise.resolve().then(() => (init_mixedMode(), mixedMode_exports));
|
173851
|
+
const mixedModeSession = await maybeStartOrUpdateMixedModeSession2(
|
173852
|
+
{
|
173853
|
+
name: configBundle.name,
|
173854
|
+
bindings: convertCfWorkerInitBindingsToBindings(configBundle.bindings) ?? {}
|
173855
|
+
},
|
173856
|
+
this.#mixedModeSessionsData.get(data.config.name) ?? null
|
173857
|
+
);
|
173858
|
+
this.#mixedModeSessionsData.set(
|
173859
|
+
data.config.name,
|
173860
|
+
mixedModeSession ?? null
|
173741
173861
|
);
|
173742
|
-
this.#mixedModeSessions.set(data.config.name, mixedModeSession);
|
173743
173862
|
}
|
173744
173863
|
const { options } = await buildMiniflareOptions(
|
173745
173864
|
this.#log,
|
173746
173865
|
await convertToConfigBundle(data),
|
173747
173866
|
this.#proxyToUserWorkerAuthenticationSecret,
|
173748
|
-
this.#
|
173867
|
+
this.#mixedModeSessionsData.get(data.config.name)?.session?.mixedModeConnectionString,
|
173749
173868
|
!!experimentalMixedMode
|
173750
173869
|
);
|
173751
173870
|
this.#options.set(data.config.name, {
|
@@ -173837,15 +173956,15 @@ var init_MultiworkerRuntimeController = __esm({
|
|
173837
173956
|
}
|
173838
173957
|
await this.#mf?.dispose();
|
173839
173958
|
this.#mf = void 0;
|
173840
|
-
if (this.#
|
173959
|
+
if (this.#mixedModeSessionsData.size > 0) {
|
173841
173960
|
logger.log(source_default.dim("\u2394 Shutting down remote connections..."));
|
173842
173961
|
}
|
173843
173962
|
await Promise.all(
|
173844
|
-
[...this.#
|
173845
|
-
(
|
173963
|
+
[...this.#mixedModeSessionsData.values()].map(
|
173964
|
+
(mixedModeSessionData) => mixedModeSessionData?.session?.dispose()
|
173846
173965
|
)
|
173847
173966
|
);
|
173848
|
-
this.#
|
173967
|
+
this.#mixedModeSessionsData.clear();
|
173849
173968
|
logger.debug("MultiworkerRuntimeController teardown complete");
|
173850
173969
|
}, "#teardown");
|
173851
173970
|
async teardown() {
|
@@ -174197,6 +174316,7 @@ function registerDevHotKeys(devEnv, args) {
|
|
174197
174316
|
label: "open devtools",
|
174198
174317
|
handler: /* @__PURE__ */ __name(async () => {
|
174199
174318
|
const { inspectorUrl } = await devEnv.proxy.ready.promise;
|
174319
|
+
(0, import_assert7.default)(inspectorUrl, "Error: no inspectorUrl available");
|
174200
174320
|
await openInspector(
|
174201
174321
|
parseInt(inspectorUrl.port),
|
174202
174322
|
devEnv.config.latestConfig?.name
|
@@ -174232,9 +174352,11 @@ function registerDevHotKeys(devEnv, args) {
|
|
174232
174352
|
]);
|
174233
174353
|
return unregisterHotKeys;
|
174234
174354
|
}
|
174355
|
+
var import_assert7;
|
174235
174356
|
var init_hotkeys = __esm({
|
174236
174357
|
"src/dev/hotkeys.ts"() {
|
174237
174358
|
init_import_meta_url();
|
174359
|
+
import_assert7 = __toESM(require("assert"));
|
174238
174360
|
init_cli_hotkeys();
|
174239
174361
|
init_logger();
|
174240
174362
|
init_open_in_browser();
|
@@ -174417,7 +174539,7 @@ var init_constructConfiguration = __esm({
|
|
174417
174539
|
|
174418
174540
|
// ../pages-shared/metadata-generator/constants.ts
|
174419
174541
|
var ANALYTICS_VERSION;
|
174420
|
-
var
|
174542
|
+
var init_constants20 = __esm({
|
174421
174543
|
"../pages-shared/metadata-generator/constants.ts"() {
|
174422
174544
|
init_import_meta_url();
|
174423
174545
|
ANALYTICS_VERSION = 1;
|
@@ -174461,7 +174583,7 @@ var init_createMetadataObject = __esm({
|
|
174461
174583
|
"../pages-shared/metadata-generator/createMetadataObject.ts"() {
|
174462
174584
|
init_import_meta_url();
|
174463
174585
|
init_constructConfiguration();
|
174464
|
-
|
174586
|
+
init_constants20();
|
174465
174587
|
noopLogger = {
|
174466
174588
|
debug: /* @__PURE__ */ __name((_message) => {
|
174467
174589
|
}, "debug"),
|
@@ -175499,7 +175621,7 @@ var init_compatibility_flags = __esm({
|
|
175499
175621
|
});
|
175500
175622
|
|
175501
175623
|
// ../workers-shared/asset-worker/src/constants.ts
|
175502
|
-
var
|
175624
|
+
var init_constants21 = __esm({
|
175503
175625
|
"../workers-shared/asset-worker/src/constants.ts"() {
|
175504
175626
|
init_import_meta_url();
|
175505
175627
|
}
|
@@ -175511,7 +175633,7 @@ var init_headers = __esm({
|
|
175511
175633
|
init_import_meta_url();
|
175512
175634
|
init_tracing2();
|
175513
175635
|
init_compatibility_flags();
|
175514
|
-
|
175636
|
+
init_constants21();
|
175515
175637
|
init_handler2();
|
175516
175638
|
init_rules_engine();
|
175517
175639
|
}
|
@@ -176494,11 +176616,11 @@ async function generateAssetsFetch(directory, log2) {
|
|
176494
176616
|
return await generateResponse(request4);
|
176495
176617
|
};
|
176496
176618
|
}
|
176497
|
-
var
|
176619
|
+
var import_node_assert30, import_node_fs35, import_node_path66, import_mime3, import_miniflare29, import_undici24, ProxyDispatcher, invalidAssetsFetch;
|
176498
176620
|
var init_assets2 = __esm({
|
176499
176621
|
"src/miniflare-cli/assets.ts"() {
|
176500
176622
|
init_import_meta_url();
|
176501
|
-
|
176623
|
+
import_node_assert30 = __toESM(require("assert"));
|
176502
176624
|
import_node_fs35 = require("fs");
|
176503
176625
|
import_node_path66 = require("path");
|
176504
176626
|
init_createMetadataObject();
|
@@ -176535,12 +176657,12 @@ var init_assets2 = __esm({
|
|
176535
176657
|
* by the `fetch()` function before calling `dispatcher.dispatch()`.
|
176536
176658
|
*/
|
176537
176659
|
static reinstateHostHeader(headers, host) {
|
176538
|
-
(0,
|
176539
|
-
(0,
|
176660
|
+
(0, import_node_assert30.default)(headers, "Expected all proxy requests to contain headers.");
|
176661
|
+
(0, import_node_assert30.default)(
|
176540
176662
|
!Array.isArray(headers),
|
176541
176663
|
"Expected proxy request headers to be a hash object"
|
176542
176664
|
);
|
176543
|
-
(0,
|
176665
|
+
(0, import_node_assert30.default)(
|
176544
176666
|
Object.keys(headers).every((h6) => h6.toLowerCase() !== "host"),
|
176545
176667
|
"Expected Host header to have been deleted."
|
176546
176668
|
);
|
@@ -176738,7 +176860,7 @@ async function startDev(args) {
|
|
176738
176860
|
unregisterHotKeys?.();
|
176739
176861
|
accountId = await requireAuth(config);
|
176740
176862
|
if (hotkeysDisplayed) {
|
176741
|
-
(0,
|
176863
|
+
(0, import_node_assert31.default)(devEnv !== void 0);
|
176742
176864
|
unregisterHotKeys = registerDevHotKeys(
|
176743
176865
|
Array.isArray(devEnv) ? devEnv[0] : devEnv,
|
176744
176866
|
args
|
@@ -176799,7 +176921,7 @@ async function startDev(args) {
|
|
176799
176921
|
});
|
176800
176922
|
if (!args.disableDevRegistry) {
|
176801
176923
|
teardownRegistryPromise = devRegistry2((registry) => {
|
176802
|
-
(0,
|
176924
|
+
(0, import_node_assert31.default)(devEnv !== void 0 && !Array.isArray(devEnv));
|
176803
176925
|
void updateDevEnvRegistry(devEnv, registry);
|
176804
176926
|
});
|
176805
176927
|
devEnv.runtimes.forEach((runtime) => {
|
@@ -176807,7 +176929,7 @@ async function startDev(args) {
|
|
176807
176929
|
"reloadComplete",
|
176808
176930
|
async (reloadEvent) => {
|
176809
176931
|
if (!reloadEvent.config.dev?.remote) {
|
176810
|
-
(0,
|
176932
|
+
(0, import_node_assert31.default)(devEnv !== void 0 && !Array.isArray(devEnv));
|
176811
176933
|
const { url: url4 } = await devEnv.proxy.ready.promise;
|
176812
176934
|
await maybeRegisterLocalWorker(
|
176813
176935
|
url4,
|
@@ -176838,7 +176960,7 @@ async function startDev(args) {
|
|
176838
176960
|
...Array.isArray(devEnv) ? devEnv.map((d6) => d6.teardown()) : [devEnv?.teardown()],
|
176839
176961
|
(async () => {
|
176840
176962
|
if (teardownRegistryPromise) {
|
176841
|
-
(0,
|
176963
|
+
(0, import_node_assert31.default)(devEnv === void 0 || !Array.isArray(devEnv));
|
176842
176964
|
const teardownRegistry = await teardownRegistryPromise;
|
176843
176965
|
await teardownRegistry(devEnv?.config.latestConfig?.name);
|
176844
176966
|
}
|
@@ -177066,11 +177188,11 @@ function getAssetChangeMessage(eventName, assetPath) {
|
|
177066
177188
|
}
|
177067
177189
|
return message;
|
177068
177190
|
}
|
177069
|
-
var
|
177191
|
+
var import_node_assert31, import_node_events6, import_node_path67, import_node_util3, import_env2, dev;
|
177070
177192
|
var init_dev2 = __esm({
|
177071
177193
|
"src/dev.ts"() {
|
177072
177194
|
init_import_meta_url();
|
177073
|
-
|
177195
|
+
import_node_assert31 = __toESM(require("assert"));
|
177074
177196
|
import_node_events6 = __toESM(require("events"));
|
177075
177197
|
import_node_path67 = __toESM(require("path"));
|
177076
177198
|
import_node_util3 = __toESM(require("util"));
|
@@ -177348,7 +177470,7 @@ var init_dev2 = __esm({
|
|
177348
177470
|
},
|
177349
177471
|
async handler(args) {
|
177350
177472
|
const devInstance = await startDev(args);
|
177351
|
-
(0,
|
177473
|
+
(0, import_node_assert31.default)(devInstance.devEnv !== void 0);
|
177352
177474
|
await import_node_events6.default.once(devInstance.devEnv, "teardown");
|
177353
177475
|
await Promise.all(devInstance.secondary.map((d6) => d6.teardown()));
|
177354
177476
|
if (devInstance.teardownRegistryPromise) {
|
@@ -177952,6 +178074,7 @@ var init_api3 = __esm({
|
|
177952
178074
|
// src/cli.ts
|
177953
178075
|
var cli_exports2 = {};
|
177954
178076
|
__export(cli_exports2, {
|
178077
|
+
experimental_maybeStartOrUpdateMixedModeSession: () => maybeStartOrUpdateMixedModeSession,
|
177955
178078
|
experimental_patchConfig: () => experimental_patchConfig,
|
177956
178079
|
experimental_pickRemoteBindings: () => pickRemoteBindings,
|
177957
178080
|
experimental_readRawConfig: () => experimental_readRawConfig,
|
@@ -178060,6 +178183,7 @@ var generateASSETSBinding2 = (
|
|
178060
178183
|
);
|
178061
178184
|
// Annotate the CommonJS export names for ESM import in node:
|
178062
178185
|
0 && (module.exports = {
|
178186
|
+
experimental_maybeStartOrUpdateMixedModeSession,
|
178063
178187
|
experimental_patchConfig,
|
178064
178188
|
experimental_pickRemoteBindings,
|
178065
178189
|
experimental_readRawConfig,
|