wrangler 4.20.0 → 4.20.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config-schema.json +42 -13
- package/package.json +7 -7
- package/wrangler-dist/cli.d.ts +53 -14
- package/wrangler-dist/cli.js +937 -719
- 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, getDockerHost;
|
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() {
|
@@ -26118,6 +26115,12 @@ var init_misc_variables = __esm({
|
|
26118
26115
|
return "docker";
|
26119
26116
|
}
|
26120
26117
|
});
|
26118
|
+
getDockerHost = getEnvironmentVariableFactory({
|
26119
|
+
variableName: "WRANGLER_DOCKER_HOST",
|
26120
|
+
defaultValue() {
|
26121
|
+
return process.platform === "win32" ? "//./pipe/docker_engine" : "unix:/var/run/docker.sock";
|
26122
|
+
}
|
26123
|
+
});
|
26121
26124
|
}
|
26122
26125
|
});
|
26123
26126
|
|
@@ -26173,7 +26176,7 @@ var require_signal_exit = __commonJS({
|
|
26173
26176
|
};
|
26174
26177
|
};
|
26175
26178
|
} else {
|
26176
|
-
|
26179
|
+
assert39 = require("assert");
|
26177
26180
|
signals = require_signals();
|
26178
26181
|
isWin = /^win/i.test(process11.platform);
|
26179
26182
|
EE = require("events");
|
@@ -26196,7 +26199,7 @@ var require_signal_exit = __commonJS({
|
|
26196
26199
|
return function() {
|
26197
26200
|
};
|
26198
26201
|
}
|
26199
|
-
|
26202
|
+
assert39.equal(typeof cb2, "function", "a callback must be provided for exit handler");
|
26200
26203
|
if (loaded === false) {
|
26201
26204
|
load();
|
26202
26205
|
}
|
@@ -26302,7 +26305,7 @@ var require_signal_exit = __commonJS({
|
|
26302
26305
|
}
|
26303
26306
|
}, "processEmit");
|
26304
26307
|
}
|
26305
|
-
var
|
26308
|
+
var assert39;
|
26306
26309
|
var signals;
|
26307
26310
|
var isWin;
|
26308
26311
|
var EE;
|
@@ -26482,7 +26485,6 @@ var init_logger = __esm({
|
|
26482
26485
|
__name(getLoggerLevel, "getLoggerLevel");
|
26483
26486
|
overrideLoggerLevel = new import_node_async_hooks.AsyncLocalStorage();
|
26484
26487
|
runWithLogLevel = /* @__PURE__ */ __name((overrideLogLevel, cb2) => overrideLoggerLevel.run({ logLevel: overrideLogLevel }, cb2), "runWithLogLevel");
|
26485
|
-
overrideLoggerLevel.getStore;
|
26486
26488
|
__name(consoleMethodToLoggerLevel, "consoleMethodToLoggerLevel");
|
26487
26489
|
Logger = class _Logger {
|
26488
26490
|
static {
|
@@ -26908,7 +26910,7 @@ var name, version;
|
|
26908
26910
|
var init_package = __esm({
|
26909
26911
|
"package.json"() {
|
26910
26912
|
name = "wrangler";
|
26911
|
-
version = "4.20.
|
26913
|
+
version = "4.20.2";
|
26912
26914
|
}
|
26913
26915
|
});
|
26914
26916
|
|
@@ -34961,7 +34963,7 @@ function normalizeAndValidateConfig(rawConfig, configPath, userConfigPath, args)
|
|
34961
34963
|
const envName = args.env;
|
34962
34964
|
(0, import_node_assert.default)(envName === void 0 || typeof envName === "string");
|
34963
34965
|
let activeEnv = topLevelEnv;
|
34964
|
-
if (envName
|
34966
|
+
if (envName) {
|
34965
34967
|
if (isRedirectedConfig) {
|
34966
34968
|
if (!isPagesConfig(rawConfig)) {
|
34967
34969
|
diagnostics.errors.push(dedent`
|
@@ -35162,7 +35164,8 @@ function normalizeAndValidateDev(diagnostics, rawDev, args) {
|
|
35162
35164
|
localProtocol: localProtocolArg,
|
35163
35165
|
upstreamProtocol: upstreamProtocolArg,
|
35164
35166
|
remote: remoteArg,
|
35165
|
-
enableContainers: enableContainersArg
|
35167
|
+
enableContainers: enableContainersArg,
|
35168
|
+
containerEngine: containerEngineArg
|
35166
35169
|
} = args;
|
35167
35170
|
(0, import_node_assert.default)(
|
35168
35171
|
localProtocolArg === void 0 || localProtocolArg === "http" || localProtocolArg === "https"
|
@@ -35174,6 +35177,9 @@ function normalizeAndValidateDev(diagnostics, rawDev, args) {
|
|
35174
35177
|
(0, import_node_assert.default)(
|
35175
35178
|
enableContainersArg === void 0 || typeof enableContainersArg === "boolean"
|
35176
35179
|
);
|
35180
|
+
(0, import_node_assert.default)(
|
35181
|
+
containerEngineArg === void 0 || typeof containerEngineArg === "string" || typeof containerEngineArg?.localDocker?.socketPath === "string"
|
35182
|
+
);
|
35177
35183
|
const {
|
35178
35184
|
// On Windows, when specifying `localhost` as the socket hostname, `workerd`
|
35179
35185
|
// will only listen on the IPv4 loopback `127.0.0.1`, not the IPv6 `::1`:
|
@@ -35233,7 +35239,8 @@ function normalizeAndValidateDev(diagnostics, rawDev, args) {
|
|
35233
35239
|
local_protocol,
|
35234
35240
|
upstream_protocol,
|
35235
35241
|
host,
|
35236
|
-
enable_containers
|
35242
|
+
enable_containers,
|
35243
|
+
container_engine: containerEngineArg
|
35237
35244
|
};
|
35238
35245
|
}
|
35239
35246
|
function normalizeAndValidateAssets(diagnostics, topLevelEnv, rawEnv) {
|
@@ -37828,7 +37835,8 @@ var init_config = __esm({
|
|
37828
37835
|
upstream_protocol: "http",
|
37829
37836
|
host: void 0,
|
37830
37837
|
// Note this one is also workers only
|
37831
|
-
enable_containers: true
|
37838
|
+
enable_containers: true,
|
37839
|
+
container_engine: void 0
|
37832
37840
|
},
|
37833
37841
|
/** INHERITABLE ENVIRONMENT FIELDS **/
|
37834
37842
|
name: void 0,
|
@@ -46471,44 +46479,44 @@ var init_open_in_browser = __esm({
|
|
46471
46479
|
});
|
46472
46480
|
|
46473
46481
|
// src/user/access.ts
|
46474
|
-
async function domainUsesAccess(
|
46475
|
-
logger.debug("Checking if domain has Access enabled:",
|
46476
|
-
if (usesAccessCache.has(
|
46482
|
+
async function domainUsesAccess(domain2) {
|
46483
|
+
logger.debug("Checking if domain has Access enabled:", domain2);
|
46484
|
+
if (usesAccessCache.has(domain2)) {
|
46477
46485
|
logger.debug(
|
46478
46486
|
"Using cached Access switch for:",
|
46479
|
-
|
46480
|
-
usesAccessCache.get(
|
46487
|
+
domain2,
|
46488
|
+
usesAccessCache.get(domain2)
|
46481
46489
|
);
|
46482
|
-
return usesAccessCache.get(
|
46490
|
+
return usesAccessCache.get(domain2);
|
46483
46491
|
}
|
46484
|
-
logger.debug("Access switch not cached for:",
|
46492
|
+
logger.debug("Access switch not cached for:", domain2);
|
46485
46493
|
try {
|
46486
46494
|
const controller = new AbortController();
|
46487
46495
|
const cancel3 = setTimeout(() => {
|
46488
46496
|
controller.abort();
|
46489
46497
|
}, 1e3);
|
46490
|
-
const output = await (0, import_undici.fetch)(`https://${
|
46498
|
+
const output = await (0, import_undici.fetch)(`https://${domain2}`, {
|
46491
46499
|
redirect: "manual",
|
46492
46500
|
signal: controller.signal
|
46493
46501
|
});
|
46494
46502
|
clearTimeout(cancel3);
|
46495
46503
|
const usesAccess = !!(output.status === 302 && output.headers.get("location")?.includes("cloudflareaccess.com"));
|
46496
|
-
logger.debug("Caching access switch for:",
|
46497
|
-
usesAccessCache.set(
|
46504
|
+
logger.debug("Caching access switch for:", domain2);
|
46505
|
+
usesAccessCache.set(domain2, usesAccess);
|
46498
46506
|
return usesAccess;
|
46499
46507
|
} catch (e7) {
|
46500
|
-
usesAccessCache.set(
|
46508
|
+
usesAccessCache.set(domain2, false);
|
46501
46509
|
return false;
|
46502
46510
|
}
|
46503
46511
|
}
|
46504
|
-
async function getAccessToken(
|
46505
|
-
if (!await domainUsesAccess(
|
46512
|
+
async function getAccessToken(domain2) {
|
46513
|
+
if (!await domainUsesAccess(domain2)) {
|
46506
46514
|
return void 0;
|
46507
46515
|
}
|
46508
|
-
if (cache[
|
46509
|
-
return cache[
|
46516
|
+
if (cache[domain2]) {
|
46517
|
+
return cache[domain2];
|
46510
46518
|
}
|
46511
|
-
const output = (0, import_child_process.spawnSync)("cloudflared", ["access", "login",
|
46519
|
+
const output = (0, import_child_process.spawnSync)("cloudflared", ["access", "login", domain2]);
|
46512
46520
|
if (output.error) {
|
46513
46521
|
throw new UserError(
|
46514
46522
|
"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 +46525,7 @@ async function getAccessToken(domain3) {
|
|
46517
46525
|
const stringOutput = output.stdout.toString();
|
46518
46526
|
const matches = stringOutput.match(/fetched your token:\n\n(.*)/m);
|
46519
46527
|
if (matches && matches.length >= 2) {
|
46520
|
-
cache[
|
46528
|
+
cache[domain2] = matches[1];
|
46521
46529
|
return matches[1];
|
46522
46530
|
}
|
46523
46531
|
throw new Error("Failed to authenticate with Cloudflare Access");
|
@@ -51660,22 +51668,29 @@ function buildMiniflareBindingOptions(config, mixedModeConnectionString, mixedMo
|
|
51660
51668
|
const classNameToUseSQLite = getClassNamesWhichUseSQLite(config.migrations);
|
51661
51669
|
const internalObjects = [];
|
51662
51670
|
const externalObjects = [];
|
51663
|
-
const externalWorkers = [];
|
51664
51671
|
for (const binding of bindings.durable_objects?.bindings ?? []) {
|
51665
|
-
const
|
51666
|
-
|
51672
|
+
const isInternal = binding.script_name === void 0 || binding.script_name === config.name;
|
51673
|
+
if (isInternal) {
|
51674
|
+
internalObjects.push(binding);
|
51675
|
+
} else {
|
51676
|
+
externalObjects.push(binding);
|
51677
|
+
}
|
51667
51678
|
}
|
51679
|
+
const externalWorkers = [];
|
51668
51680
|
if (config.workerDefinitions !== null) {
|
51669
51681
|
externalWorkers.push({
|
51670
51682
|
name: EXTERNAL_SERVICE_WORKER_NAME,
|
51671
51683
|
// Bind all internal objects, so they're accessible by all other sessions
|
51672
51684
|
// that proxy requests for our objects to this worker
|
51673
51685
|
durableObjects: Object.fromEntries(
|
51674
|
-
internalObjects.map(({ class_name }) => {
|
51675
|
-
const useSQLite = classNameToUseSQLite.get(class_name);
|
51686
|
+
internalObjects.map(({ class_name: className }) => {
|
51676
51687
|
return [
|
51677
|
-
|
51678
|
-
{
|
51688
|
+
className,
|
51689
|
+
{
|
51690
|
+
className,
|
51691
|
+
scriptName: getName(config),
|
51692
|
+
useSQLite: classNameToUseSQLite.get(className)
|
51693
|
+
}
|
51679
51694
|
];
|
51680
51695
|
})
|
51681
51696
|
),
|
@@ -51897,40 +51912,42 @@ function buildMiniflareBindingOptions(config, mixedModeConnectionString, mixedMo
|
|
51897
51912
|
) ?? []
|
51898
51913
|
) : void 0,
|
51899
51914
|
durableObjects: Object.fromEntries([
|
51900
|
-
...internalObjects.map(({ name: name2, class_name }) => {
|
51901
|
-
const useSQLite = classNameToUseSQLite.get(class_name);
|
51915
|
+
...internalObjects.map(({ name: name2, class_name: className }) => {
|
51902
51916
|
return [
|
51903
51917
|
name2,
|
51904
51918
|
{
|
51905
|
-
className
|
51906
|
-
useSQLite
|
51919
|
+
className,
|
51920
|
+
useSQLite: classNameToUseSQLite.get(className),
|
51921
|
+
container: getContainerOptions(className, config.containers)
|
51907
51922
|
}
|
51908
51923
|
];
|
51909
51924
|
}),
|
51910
|
-
...externalObjects.map(
|
51911
|
-
|
51912
|
-
|
51913
|
-
|
51914
|
-
|
51915
|
-
|
51916
|
-
|
51917
|
-
|
51918
|
-
|
51919
|
-
|
51920
|
-
|
51921
|
-
|
51922
|
-
|
51923
|
-
|
51924
|
-
|
51925
|
-
|
51926
|
-
|
51927
|
-
|
51928
|
-
|
51929
|
-
|
51930
|
-
|
51931
|
-
|
51932
|
-
|
51933
|
-
|
51925
|
+
...externalObjects.map(
|
51926
|
+
({ name: name2, class_name: className, script_name: scriptName }) => {
|
51927
|
+
const identifier = getIdentifier(`do_${scriptName}_${className}`);
|
51928
|
+
const useSQLite = classNameToUseSQLite.get(className);
|
51929
|
+
return config.workerDefinitions === null ? [
|
51930
|
+
name2,
|
51931
|
+
{
|
51932
|
+
className,
|
51933
|
+
scriptName
|
51934
|
+
}
|
51935
|
+
] : [
|
51936
|
+
name2,
|
51937
|
+
{
|
51938
|
+
className: identifier,
|
51939
|
+
scriptName: EXTERNAL_SERVICE_WORKER_NAME,
|
51940
|
+
useSQLite,
|
51941
|
+
// Matches the unique key Miniflare will generate for this object in
|
51942
|
+
// the target session. We need to do this so workerd generates the
|
51943
|
+
// same IDs it would if this were part of the same process. workerd
|
51944
|
+
// doesn't allow IDs from Durable Objects with different unique keys
|
51945
|
+
// to be used with each other.
|
51946
|
+
unsafeUniqueKey: `${scriptName}-${className}`
|
51947
|
+
}
|
51948
|
+
];
|
51949
|
+
}
|
51950
|
+
)
|
51934
51951
|
]),
|
51935
51952
|
ratelimits: Object.fromEntries(
|
51936
51953
|
bindings.unsafe?.bindings?.filter((b6) => b6.type == "ratelimit").map(ratelimitEntry) ?? []
|
@@ -52140,7 +52157,16 @@ async function buildMiniflareOptions(log2, config, proxyToUserWorkerAuthenticati
|
|
52140
52157
|
};
|
52141
52158
|
return { options, internalObjects, entrypointNames };
|
52142
52159
|
}
|
52143
|
-
|
52160
|
+
function getContainerOptions(className, containers2) {
|
52161
|
+
if (!containers2 || !(className in containers2)) {
|
52162
|
+
return void 0;
|
52163
|
+
}
|
52164
|
+
const container = containers2[className];
|
52165
|
+
return {
|
52166
|
+
imageName: `${CONTAINER_IMAGE_PREFIX}/${container.name}`
|
52167
|
+
};
|
52168
|
+
}
|
52169
|
+
var import_node_assert5, import_node_crypto4, import_node_path17, import_miniflare8, EXTERNAL_SERVICE_WORKER_NAME, EXTERNAL_SERVICE_WORKER_SCRIPT, WranglerLog, DEFAULT_WORKER_NAME, IDENTIFIER_UNSAFE_REGEXP, didWarnMiniflareCronSupport, didWarnMiniflareVectorizeSupport, didWarnAiAccountUsage, CONTAINER_IMAGE_PREFIX;
|
52144
52170
|
var init_miniflare = __esm({
|
52145
52171
|
"src/dev/miniflare.ts"() {
|
52146
52172
|
init_import_meta_url();
|
@@ -52321,6 +52347,8 @@ export default {
|
|
52321
52347
|
didWarnMiniflareVectorizeSupport = false;
|
52322
52348
|
didWarnAiAccountUsage = false;
|
52323
52349
|
__name(buildMiniflareOptions, "buildMiniflareOptions");
|
52350
|
+
CONTAINER_IMAGE_PREFIX = "cloudflare-dev";
|
52351
|
+
__name(getContainerOptions, "getContainerOptions");
|
52324
52352
|
}
|
52325
52353
|
});
|
52326
52354
|
|
@@ -55234,7 +55262,7 @@ function parseStaticRouting(input) {
|
|
55234
55262
|
}
|
55235
55263
|
if (input.length > MAX_ROUTES_RULES) {
|
55236
55264
|
throw new Error(
|
55237
|
-
`Too many rules were provided; ${input.length} rules provided exceeds max of ${MAX_ROUTES_RULES}
|
55265
|
+
`Too many \`run_worker_first\` rules were provided; ${input.length} rules provided exceeds max of ${MAX_ROUTES_RULES}.`
|
55238
55266
|
);
|
55239
55267
|
}
|
55240
55268
|
const rawAssetWorkerRules = [];
|
@@ -55255,7 +55283,7 @@ function parseStaticRouting(input) {
|
|
55255
55283
|
}
|
55256
55284
|
if (assetWorkerRules.length > 0 && userWorkerRules.length === 0) {
|
55257
55285
|
throw new Error(
|
55258
|
-
|
55286
|
+
"Only negative `run_worker_first` rules were provided; must provide at least 1 non-negative rule"
|
55259
55287
|
);
|
55260
55288
|
}
|
55261
55289
|
const invalidAssetWorkerRules = validateStaticRoutingRules(rawAssetWorkerRules);
|
@@ -55265,10 +55293,10 @@ function parseStaticRouting(input) {
|
|
55265
55293
|
...invalidUserWorkerRules,
|
55266
55294
|
...invalidAssetWorkerRules
|
55267
55295
|
]);
|
55268
|
-
|
55269
|
-
|
55270
|
-
|
55271
|
-
};
|
55296
|
+
if (errorMessage) {
|
55297
|
+
throw new Error(errorMessage);
|
55298
|
+
}
|
55299
|
+
return { asset_worker: assetWorkerRules, user_worker: userWorkerRules };
|
55272
55300
|
}
|
55273
55301
|
function validateStaticRoutingRules(rules) {
|
55274
55302
|
const invalid = [];
|
@@ -55304,7 +55332,7 @@ var init_parseStaticRouting = __esm({
|
|
55304
55332
|
if (invalidRules.length === 0) {
|
55305
55333
|
return void 0;
|
55306
55334
|
}
|
55307
|
-
return `Invalid routes in run_worker_first
|
55335
|
+
return `Invalid routes in \`run_worker_first\`:
|
55308
55336
|
` + invalidRules.join("\n");
|
55309
55337
|
}, "formatInvalidRoutes");
|
55310
55338
|
}
|
@@ -56676,15 +56704,9 @@ ${directory}`,
|
|
56676
56704
|
if (typeof config.assets?.run_worker_first === "boolean") {
|
56677
56705
|
routerConfig.invoke_user_worker_ahead_of_assets = config.assets.run_worker_first;
|
56678
56706
|
} else if (Array.isArray(config.assets?.run_worker_first)) {
|
56679
|
-
|
56707
|
+
routerConfig.static_routing = parseStaticRouting(
|
56680
56708
|
config.assets.run_worker_first
|
56681
56709
|
);
|
56682
|
-
if (errorMessage) {
|
56683
|
-
throw new UserError(errorMessage, {
|
56684
|
-
telemetryMessage: "invalid run_worker_first rules"
|
56685
|
-
});
|
56686
|
-
}
|
56687
|
-
routerConfig.static_routing = parsed;
|
56688
56710
|
}
|
56689
56711
|
if (routerConfig.invoke_user_worker_ahead_of_assets && !config?.assets?.binding) {
|
56690
56712
|
logger.warn(
|
@@ -57014,139 +57036,6 @@ Ensure all assets in your assets directory "${dir}" conform with the Workers max
|
|
57014
57036
|
}
|
57015
57037
|
});
|
57016
57038
|
|
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
57039
|
// ../containers-shared/src/client/core/ApiError.ts
|
57151
57040
|
var ApiError;
|
57152
57041
|
var init_ApiError = __esm({
|
@@ -58686,12 +58575,12 @@ var init_ImageRegistriesService = __esm({
|
|
58686
58575
|
* @returns AccountRegistryToken Credentials with 'pull' or 'push' permissions to access the registry
|
58687
58576
|
* @throws ApiError
|
58688
58577
|
*/
|
58689
|
-
static generateImageRegistryCredentials(
|
58578
|
+
static generateImageRegistryCredentials(domain2, requestBody) {
|
58690
58579
|
return request(OpenAPI, {
|
58691
58580
|
method: "POST",
|
58692
58581
|
url: "/registries/{domain}/credentials",
|
58693
58582
|
path: {
|
58694
|
-
domain:
|
58583
|
+
domain: domain2
|
58695
58584
|
},
|
58696
58585
|
body: requestBody,
|
58697
58586
|
mediaType: "application/json",
|
@@ -58710,12 +58599,12 @@ var init_ImageRegistriesService = __esm({
|
|
58710
58599
|
* @returns EmptyResponse The image registry is deleted
|
58711
58600
|
* @throws ApiError
|
58712
58601
|
*/
|
58713
|
-
static deleteImageRegistry(
|
58602
|
+
static deleteImageRegistry(domain2) {
|
58714
58603
|
return request(OpenAPI, {
|
58715
58604
|
method: "DELETE",
|
58716
58605
|
url: "/registries/{domain}",
|
58717
58606
|
path: {
|
58718
|
-
domain:
|
58607
|
+
domain: domain2
|
58719
58608
|
},
|
58720
58609
|
errors: {
|
58721
58610
|
404: `The image registry does not exist`,
|
@@ -59144,7 +59033,14 @@ var init_client2 = __esm({
|
|
59144
59033
|
// ../containers-shared/src/build.ts
|
59145
59034
|
async function constructBuildCommand(options, logger4) {
|
59146
59035
|
const platform3 = options.platform ?? "linux/amd64";
|
59147
|
-
const buildCmd = [
|
59036
|
+
const buildCmd = [
|
59037
|
+
"build",
|
59038
|
+
"-t",
|
59039
|
+
options.tag,
|
59040
|
+
"--platform",
|
59041
|
+
platform3,
|
59042
|
+
"--provenance=false"
|
59043
|
+
];
|
59148
59044
|
if (options.args) {
|
59149
59045
|
for (const arg in options.args) {
|
59150
59046
|
buildCmd.push("--build-arg", `${arg}=${options.args[arg]}`);
|
@@ -59196,25 +59092,36 @@ var init_build = __esm({
|
|
59196
59092
|
}
|
59197
59093
|
});
|
59198
59094
|
|
59199
|
-
// ../containers-shared/src/
|
59200
|
-
var
|
59201
|
-
var
|
59202
|
-
"../containers-shared/src/
|
59095
|
+
// ../containers-shared/src/knobs.ts
|
59096
|
+
var getCloudflareContainerRegistry;
|
59097
|
+
var init_knobs = __esm({
|
59098
|
+
"../containers-shared/src/knobs.ts"() {
|
59203
59099
|
init_import_meta_url();
|
59204
|
-
|
59100
|
+
getCloudflareContainerRegistry = /* @__PURE__ */ __name(() => {
|
59101
|
+
return process.env.CLOUDFLARE_CONTAINER_REGISTRY ?? "registry.cloudflare.com";
|
59102
|
+
}, "getCloudflareContainerRegistry");
|
59205
59103
|
}
|
59206
59104
|
});
|
59207
59105
|
|
59208
59106
|
// ../containers-shared/src/login.ts
|
59209
59107
|
async function dockerLoginManagedRegistry(pathToDocker) {
|
59210
59108
|
const expirationMinutes = 15;
|
59211
|
-
const credentials = await ImageRegistriesService.generateImageRegistryCredentials(
|
59212
|
-
|
59213
|
-
|
59214
|
-
|
59109
|
+
const credentials = await ImageRegistriesService.generateImageRegistryCredentials(
|
59110
|
+
getCloudflareContainerRegistry(),
|
59111
|
+
{
|
59112
|
+
expiration_minutes: expirationMinutes,
|
59113
|
+
permissions: ["push", "pull"]
|
59114
|
+
}
|
59115
|
+
);
|
59215
59116
|
const child = (0, import_node_child_process.spawn)(
|
59216
59117
|
pathToDocker,
|
59217
|
-
[
|
59118
|
+
[
|
59119
|
+
"login",
|
59120
|
+
"--password-stdin",
|
59121
|
+
"--username",
|
59122
|
+
"v1",
|
59123
|
+
getCloudflareContainerRegistry()
|
59124
|
+
],
|
59218
59125
|
{ stdio: ["pipe", "inherit", "inherit"] }
|
59219
59126
|
).on("error", (err) => {
|
59220
59127
|
throw err;
|
@@ -59237,17 +59144,22 @@ var init_login = __esm({
|
|
59237
59144
|
init_import_meta_url();
|
59238
59145
|
import_node_child_process = require("child_process");
|
59239
59146
|
init_client2();
|
59240
|
-
|
59147
|
+
init_knobs();
|
59241
59148
|
__name(dockerLoginManagedRegistry, "dockerLoginManagedRegistry");
|
59242
59149
|
}
|
59243
59150
|
});
|
59244
59151
|
|
59245
59152
|
// ../containers-shared/src/utils.ts
|
59246
|
-
|
59153
|
+
function isDir(path70) {
|
59154
|
+
const stats = (0, import_fs11.statSync)(path70);
|
59155
|
+
return stats.isDirectory();
|
59156
|
+
}
|
59157
|
+
var import_child_process3, import_fs11, runDockerCmd, isDockerfile;
|
59247
59158
|
var init_utils2 = __esm({
|
59248
59159
|
"../containers-shared/src/utils.ts"() {
|
59249
59160
|
init_import_meta_url();
|
59250
59161
|
import_child_process3 = require("child_process");
|
59162
|
+
import_fs11 = require("fs");
|
59251
59163
|
runDockerCmd = /* @__PURE__ */ __name(async (dockerPath, args, stdio) => {
|
59252
59164
|
const child = (0, import_child_process3.spawn)(dockerPath, args, {
|
59253
59165
|
stdio: stdio ?? "inherit"
|
@@ -59270,6 +59182,39 @@ var init_utils2 = __esm({
|
|
59270
59182
|
});
|
59271
59183
|
});
|
59272
59184
|
}, "runDockerCmd");
|
59185
|
+
__name(isDir, "isDir");
|
59186
|
+
isDockerfile = /* @__PURE__ */ __name((image) => {
|
59187
|
+
if ((0, import_fs11.existsSync)(image)) {
|
59188
|
+
if (isDir(image)) {
|
59189
|
+
throw new Error(
|
59190
|
+
`${image} is a directory, you should specify a path to the Dockerfile`
|
59191
|
+
);
|
59192
|
+
}
|
59193
|
+
return true;
|
59194
|
+
}
|
59195
|
+
const errorPrefix = `The image "${image}" does not appear to be a valid path to a Dockerfile, or a valid image registry path:
|
59196
|
+
`;
|
59197
|
+
try {
|
59198
|
+
new URL(`https://${image}`);
|
59199
|
+
} catch (e7) {
|
59200
|
+
if (e7 instanceof Error) {
|
59201
|
+
throw new Error(errorPrefix + e7.message);
|
59202
|
+
}
|
59203
|
+
throw e7;
|
59204
|
+
}
|
59205
|
+
const imageParts = image.split("/");
|
59206
|
+
if (!imageParts[imageParts.length - 1].includes(":")) {
|
59207
|
+
throw new Error(
|
59208
|
+
errorPrefix + `If this is an image registry path, it needs to include at least a tag ':' (e.g: docker.io/httpd:1)`
|
59209
|
+
);
|
59210
|
+
}
|
59211
|
+
if (image.includes("://")) {
|
59212
|
+
throw new Error(
|
59213
|
+
errorPrefix + `Image reference should not include the protocol part (e.g: docker.io/httpd:1, not https://docker.io/httpd:1)`
|
59214
|
+
);
|
59215
|
+
}
|
59216
|
+
return false;
|
59217
|
+
}, "isDockerfile");
|
59273
59218
|
}
|
59274
59219
|
});
|
59275
59220
|
|
@@ -59314,6 +59259,46 @@ var init_inspect = __esm({
|
|
59314
59259
|
}
|
59315
59260
|
});
|
59316
59261
|
|
59262
|
+
// ../containers-shared/src/registry.ts
|
59263
|
+
var getCloudflareRegistryWithAccountNamespace;
|
59264
|
+
var init_registry = __esm({
|
59265
|
+
"../containers-shared/src/registry.ts"() {
|
59266
|
+
init_import_meta_url();
|
59267
|
+
init_knobs();
|
59268
|
+
getCloudflareRegistryWithAccountNamespace = /* @__PURE__ */ __name((accountID, tag) => {
|
59269
|
+
return `${getCloudflareContainerRegistry()}/${accountID}/${tag}`;
|
59270
|
+
}, "getCloudflareRegistryWithAccountNamespace");
|
59271
|
+
}
|
59272
|
+
});
|
59273
|
+
|
59274
|
+
// ../containers-shared/src/images.ts
|
59275
|
+
async function getDockerImageDigest(dockerPath, imageTag) {
|
59276
|
+
return new Promise((resolve24, reject) => {
|
59277
|
+
(0, import_child_process5.execFile)(
|
59278
|
+
dockerPath,
|
59279
|
+
["images", "--digests", "--format", "{{.Digest}}", imageTag],
|
59280
|
+
(error2, stdout2, stderr2) => {
|
59281
|
+
if (error2) {
|
59282
|
+
return reject(
|
59283
|
+
new Error(
|
59284
|
+
`Failed getting docker image digest for image: ${imageTag} with error: ${error2}.`
|
59285
|
+
)
|
59286
|
+
);
|
59287
|
+
}
|
59288
|
+
return resolve24(stdout2.trim());
|
59289
|
+
}
|
59290
|
+
);
|
59291
|
+
});
|
59292
|
+
}
|
59293
|
+
var import_child_process5;
|
59294
|
+
var init_images = __esm({
|
59295
|
+
"../containers-shared/src/images.ts"() {
|
59296
|
+
init_import_meta_url();
|
59297
|
+
import_child_process5 = require("child_process");
|
59298
|
+
__name(getDockerImageDigest, "getDockerImageDigest");
|
59299
|
+
}
|
59300
|
+
});
|
59301
|
+
|
59317
59302
|
// ../containers-shared/index.ts
|
59318
59303
|
var init_containers_shared = __esm({
|
59319
59304
|
"../containers-shared/index.ts"() {
|
@@ -59321,10 +59306,145 @@ var init_containers_shared = __esm({
|
|
59321
59306
|
init_client2();
|
59322
59307
|
init_build();
|
59323
59308
|
init_login();
|
59324
|
-
|
59309
|
+
init_knobs();
|
59325
59310
|
init_utils2();
|
59326
59311
|
init_types3();
|
59327
59312
|
init_inspect();
|
59313
|
+
init_registry();
|
59314
|
+
init_images();
|
59315
|
+
}
|
59316
|
+
});
|
59317
|
+
|
59318
|
+
// src/versions/api.ts
|
59319
|
+
async function fetchVersion(complianceConfig, accountId, workerName, versionId, versionCache) {
|
59320
|
+
const cachedVersion = versionCache?.get(versionId);
|
59321
|
+
if (cachedVersion) {
|
59322
|
+
return cachedVersion;
|
59323
|
+
}
|
59324
|
+
const version5 = await fetchResult(
|
59325
|
+
complianceConfig,
|
59326
|
+
`/accounts/${accountId}/workers/scripts/${workerName}/versions/${versionId}`
|
59327
|
+
);
|
59328
|
+
versionCache?.set(version5.id, version5);
|
59329
|
+
return version5;
|
59330
|
+
}
|
59331
|
+
async function fetchVersions(complianceConfig, accountId, workerName, versionCache, ...versionIds) {
|
59332
|
+
return Promise.all(
|
59333
|
+
versionIds.map(
|
59334
|
+
(versionId) => fetchVersion(
|
59335
|
+
complianceConfig,
|
59336
|
+
accountId,
|
59337
|
+
workerName,
|
59338
|
+
versionId,
|
59339
|
+
versionCache
|
59340
|
+
)
|
59341
|
+
)
|
59342
|
+
);
|
59343
|
+
}
|
59344
|
+
async function fetchLatestDeployments(complianceConfig, accountId, workerName) {
|
59345
|
+
const { deployments } = await fetchResult(
|
59346
|
+
complianceConfig,
|
59347
|
+
`/accounts/${accountId}/workers/scripts/${workerName}/deployments`
|
59348
|
+
);
|
59349
|
+
return deployments;
|
59350
|
+
}
|
59351
|
+
async function fetchLatestDeployment(complianceConfig, accountId, workerName) {
|
59352
|
+
const deployments = await fetchLatestDeployments(
|
59353
|
+
complianceConfig,
|
59354
|
+
accountId,
|
59355
|
+
workerName
|
59356
|
+
);
|
59357
|
+
return deployments.at(0);
|
59358
|
+
}
|
59359
|
+
async function fetchDeploymentVersions(complianceConfig, accountId, workerName, deployment, versionCache) {
|
59360
|
+
if (!deployment) {
|
59361
|
+
return [[], /* @__PURE__ */ new Map()];
|
59362
|
+
}
|
59363
|
+
const versionTraffic = new Map(
|
59364
|
+
deployment.versions.map((v7) => [v7.version_id, v7.percentage])
|
59365
|
+
);
|
59366
|
+
const versions2 = await fetchVersions(
|
59367
|
+
complianceConfig,
|
59368
|
+
accountId,
|
59369
|
+
workerName,
|
59370
|
+
versionCache,
|
59371
|
+
...versionTraffic.keys()
|
59372
|
+
);
|
59373
|
+
return [versions2, versionTraffic];
|
59374
|
+
}
|
59375
|
+
async function fetchDeployableVersions(complianceConfig, accountId, workerName, versionCache) {
|
59376
|
+
const { items: versions2 } = await fetchResult(
|
59377
|
+
complianceConfig,
|
59378
|
+
`/accounts/${accountId}/workers/scripts/${workerName}/versions?deployable=true`
|
59379
|
+
);
|
59380
|
+
for (const version5 of versions2) {
|
59381
|
+
versionCache.set(version5.id, version5);
|
59382
|
+
}
|
59383
|
+
return versions2;
|
59384
|
+
}
|
59385
|
+
async function createDeployment(complianceConfig, accountId, workerName, versionTraffic, message, force) {
|
59386
|
+
return await fetchResult(
|
59387
|
+
complianceConfig,
|
59388
|
+
`/accounts/${accountId}/workers/scripts/${workerName}/deployments${force ? "?force=true" : ""}`,
|
59389
|
+
{
|
59390
|
+
method: "POST",
|
59391
|
+
headers: { "Content-Type": "application/json" },
|
59392
|
+
body: JSON.stringify({
|
59393
|
+
strategy: "percentage",
|
59394
|
+
versions: Array.from(versionTraffic).map(
|
59395
|
+
([version_id, percentage]) => ({ version_id, percentage })
|
59396
|
+
),
|
59397
|
+
annotations: {
|
59398
|
+
"workers/message": message
|
59399
|
+
}
|
59400
|
+
})
|
59401
|
+
}
|
59402
|
+
);
|
59403
|
+
}
|
59404
|
+
async function patchNonVersionedScriptSettings(complianceConfig, accountId, workerName, settings) {
|
59405
|
+
const res = await fetchResult(
|
59406
|
+
complianceConfig,
|
59407
|
+
`/accounts/${accountId}/workers/scripts/${workerName}/script-settings`,
|
59408
|
+
{
|
59409
|
+
method: "PATCH",
|
59410
|
+
headers: { "Content-Type": "application/json" },
|
59411
|
+
body: JSON.stringify(settings)
|
59412
|
+
}
|
59413
|
+
);
|
59414
|
+
return res;
|
59415
|
+
}
|
59416
|
+
var init_api = __esm({
|
59417
|
+
"src/versions/api.ts"() {
|
59418
|
+
init_import_meta_url();
|
59419
|
+
init_cfetch();
|
59420
|
+
__name(fetchVersion, "fetchVersion");
|
59421
|
+
__name(fetchVersions, "fetchVersions");
|
59422
|
+
__name(fetchLatestDeployments, "fetchLatestDeployments");
|
59423
|
+
__name(fetchLatestDeployment, "fetchLatestDeployment");
|
59424
|
+
__name(fetchDeploymentVersions, "fetchDeploymentVersions");
|
59425
|
+
__name(fetchDeployableVersions, "fetchDeployableVersions");
|
59426
|
+
__name(createDeployment, "createDeployment");
|
59427
|
+
__name(patchNonVersionedScriptSettings, "patchNonVersionedScriptSettings");
|
59428
|
+
}
|
59429
|
+
});
|
59430
|
+
|
59431
|
+
// ../cli/args.ts
|
59432
|
+
var processArgument;
|
59433
|
+
var init_args = __esm({
|
59434
|
+
"../cli/args.ts"() {
|
59435
|
+
init_import_meta_url();
|
59436
|
+
init_interactive();
|
59437
|
+
processArgument = /* @__PURE__ */ __name(async (args, name2, promptConfig) => {
|
59438
|
+
const value = args[name2];
|
59439
|
+
const result = await inputPrompt({
|
59440
|
+
...promptConfig,
|
59441
|
+
// Accept the default value if the arg is already set
|
59442
|
+
acceptDefault: promptConfig.acceptDefault ?? value !== void 0,
|
59443
|
+
defaultValue: value ?? promptConfig.defaultValue
|
59444
|
+
});
|
59445
|
+
args[name2] = result;
|
59446
|
+
return result;
|
59447
|
+
}, "processArgument");
|
59328
59448
|
}
|
59329
59449
|
});
|
59330
59450
|
|
@@ -59504,7 +59624,7 @@ async function fillOpenAPIConfiguration(config, json) {
|
|
59504
59624
|
if (json && err instanceof ApiError) {
|
59505
59625
|
message = JSON.stringify(err);
|
59506
59626
|
}
|
59507
|
-
throw new UserError("
|
59627
|
+
throw new UserError("Loading account failed: " + message);
|
59508
59628
|
}
|
59509
59629
|
}
|
59510
59630
|
function interactWithUser(config) {
|
@@ -59792,8 +59912,8 @@ var init_common = __esm({
|
|
59792
59912
|
const alphaNumeric = "[a-z0-9]+";
|
59793
59913
|
const separator = "(?:\\.|_|__|-+)";
|
59794
59914
|
const port = ":[0-9]+";
|
59795
|
-
const
|
59796
|
-
const name2 = `(?:${
|
59915
|
+
const domain2 = `${alphaNumeric}(?:${separator}${alphaNumeric})*`;
|
59916
|
+
const name2 = `(?:${domain2}(?:${port})?/)?(?:${domain2}/)*(?:${domain2})`;
|
59797
59917
|
const tag = ":([a-zA-Z0-9_][a-zA-Z0-9._-]{0,127})";
|
59798
59918
|
const digest = "@(sha256:[A-Fa-f0-9]+)";
|
59799
59919
|
const reference = `(?:${tag}(?:${digest})?|${digest})`;
|
@@ -60272,11 +60392,14 @@ async function apply(args, config) {
|
|
60272
60392
|
const actions = [];
|
60273
60393
|
log(dim("Container application changes\n"));
|
60274
60394
|
for (const appConfigNoDefaults of config.containers) {
|
60395
|
+
const application = applicationByNames[appConfigNoDefaults.name];
|
60396
|
+
if (!appConfigNoDefaults.configuration.image && application) {
|
60397
|
+
appConfigNoDefaults.configuration.image = application.configuration.image;
|
60398
|
+
}
|
60275
60399
|
const appConfig = containerAppToCreateApplication(
|
60276
60400
|
appConfigNoDefaults,
|
60277
60401
|
args.skipDefaults
|
60278
60402
|
);
|
60279
|
-
const application = applicationByNames[appConfig.name];
|
60280
60403
|
if (application !== void 0 && application !== null) {
|
60281
60404
|
const prevApp = sortObjectRecursive(
|
60282
60405
|
stripUndefined(applicationToCreateApplication(application))
|
@@ -60618,13 +60741,14 @@ function pushYargs(yargs) {
|
|
60618
60741
|
demandOption: false
|
60619
60742
|
}).positional("TAG", { type: "string", demandOption: true });
|
60620
60743
|
}
|
60621
|
-
function isDir(path70) {
|
60622
|
-
const stats = (0, import_fs11.statSync)(path70);
|
60623
|
-
return stats.isDirectory();
|
60624
|
-
}
|
60625
60744
|
async function buildAndMaybePush(args, pathToDocker, push, containerConfig) {
|
60626
|
-
const imageTag = DOMAIN + "/" + args.tag;
|
60627
60745
|
try {
|
60746
|
+
const account = await loadAccount();
|
60747
|
+
const cloudflareAccountID = account.external_account_id;
|
60748
|
+
const imageTag = getCloudflareRegistryWithAccountNamespace(
|
60749
|
+
cloudflareAccountID,
|
60750
|
+
args.tag
|
60751
|
+
);
|
60628
60752
|
const { buildCmd, dockerfile } = await constructBuildCommand(
|
60629
60753
|
{
|
60630
60754
|
tag: imageTag,
|
@@ -60640,12 +60764,10 @@ async function buildAndMaybePush(args, pathToDocker, push, containerConfig) {
|
|
60640
60764
|
buildCmd,
|
60641
60765
|
dockerfile
|
60642
60766
|
});
|
60643
|
-
const account = await loadAccount();
|
60644
60767
|
const inspectOutput = await dockerImageInspect(pathToDocker, {
|
60645
60768
|
imageTag,
|
60646
60769
|
formatString: "{{ .Size }} {{ len .RootFS.Layers }}"
|
60647
60770
|
});
|
60648
|
-
console.dir("hi" + JSON.stringify(inspectOutput));
|
60649
60771
|
const [sizeStr, layerStr] = inspectOutput.split(" ");
|
60650
60772
|
const size = parseInt(sizeStr, 10);
|
60651
60773
|
const layers = parseInt(layerStr, 10);
|
@@ -60658,7 +60780,25 @@ async function buildAndMaybePush(args, pathToDocker, push, containerConfig) {
|
|
60658
60780
|
});
|
60659
60781
|
if (push) {
|
60660
60782
|
await dockerLoginManagedRegistry(pathToDocker);
|
60661
|
-
|
60783
|
+
try {
|
60784
|
+
const repositoryOnly = imageTag.split(":")[0];
|
60785
|
+
const localDigest = await getDockerImageDigest(pathToDocker, imageTag);
|
60786
|
+
const digest = repositoryOnly + "@" + localDigest;
|
60787
|
+
await runDockerCmd(
|
60788
|
+
pathToDocker,
|
60789
|
+
["manifest", "inspect", digest],
|
60790
|
+
"ignore"
|
60791
|
+
);
|
60792
|
+
logger.log("Image already exists remotely, skipping push");
|
60793
|
+
logger.debug(
|
60794
|
+
`Untagging built image: ${imageTag} since there was no change.`
|
60795
|
+
);
|
60796
|
+
await runDockerCmd(pathToDocker, ["image", "rm", imageTag]);
|
60797
|
+
return "";
|
60798
|
+
} catch (error2) {
|
60799
|
+
logger.log(`Image does not exist remotely, pushing: ${imageTag}`);
|
60800
|
+
await runDockerCmd(pathToDocker, ["push", imageTag]);
|
60801
|
+
}
|
60662
60802
|
}
|
60663
60803
|
return imageTag;
|
60664
60804
|
} catch (error2) {
|
@@ -60669,7 +60809,7 @@ async function buildAndMaybePush(args, pathToDocker, push, containerConfig) {
|
|
60669
60809
|
}
|
60670
60810
|
}
|
60671
60811
|
async function buildCommand(args, config) {
|
60672
|
-
if ((0,
|
60812
|
+
if ((0, import_fs12.existsSync)(args.PATH) && !isDir(args.PATH)) {
|
60673
60813
|
throw new UserError(
|
60674
60814
|
`${args.PATH} is not a directory. Please specify a valid directory path.`
|
60675
60815
|
);
|
@@ -60694,7 +60834,11 @@ async function buildCommand(args, config) {
|
|
60694
60834
|
async function pushCommand(args, _4) {
|
60695
60835
|
try {
|
60696
60836
|
await dockerLoginManagedRegistry(args.pathToDocker);
|
60697
|
-
const
|
60837
|
+
const account = await loadAccount();
|
60838
|
+
const newTag = getCloudflareRegistryWithAccountNamespace(
|
60839
|
+
account.external_account_id,
|
60840
|
+
args.TAG
|
60841
|
+
);
|
60698
60842
|
const dockerPath = args.pathToDocker ?? getDockerPath();
|
60699
60843
|
await runDockerCmd(dockerPath, ["tag", args.TAG, newTag]);
|
60700
60844
|
await runDockerCmd(dockerPath, ["push", newTag]);
|
@@ -60726,11 +60870,11 @@ async function ensureDiskLimits(options) {
|
|
60726
60870
|
);
|
60727
60871
|
}
|
60728
60872
|
}
|
60729
|
-
var
|
60873
|
+
var import_fs12, import_path7;
|
60730
60874
|
var init_build2 = __esm({
|
60731
60875
|
"src/cloudchamber/build.ts"() {
|
60732
60876
|
init_import_meta_url();
|
60733
|
-
|
60877
|
+
import_fs12 = require("fs");
|
60734
60878
|
import_path7 = require("path");
|
60735
60879
|
init_containers_shared();
|
60736
60880
|
init_misc_variables();
|
@@ -60740,7 +60884,6 @@ var init_build2 = __esm({
|
|
60740
60884
|
init_locations();
|
60741
60885
|
__name(buildYargs, "buildYargs");
|
60742
60886
|
__name(pushYargs, "pushYargs");
|
60743
|
-
__name(isDir, "isDir");
|
60744
60887
|
__name(buildAndMaybePush, "buildAndMaybePush");
|
60745
60888
|
__name(buildCommand, "buildCommand");
|
60746
60889
|
__name(pushCommand, "pushCommand");
|
@@ -60750,8 +60893,17 @@ var init_build2 = __esm({
|
|
60750
60893
|
|
60751
60894
|
// src/cloudchamber/deploy.ts
|
60752
60895
|
async function maybeBuildContainer(containerConfig, imageTag, dryRun, pathToDocker) {
|
60753
|
-
|
60754
|
-
|
60896
|
+
try {
|
60897
|
+
if (!isDockerfile(
|
60898
|
+
containerConfig.image ?? containerConfig.configuration.image
|
60899
|
+
)) {
|
60900
|
+
return containerConfig.image ?? containerConfig.configuration.image;
|
60901
|
+
}
|
60902
|
+
} catch (err) {
|
60903
|
+
if (err instanceof Error) {
|
60904
|
+
throw new UserError(err.message);
|
60905
|
+
}
|
60906
|
+
throw err;
|
60755
60907
|
}
|
60756
60908
|
const options = getBuildArguments(containerConfig, imageTag);
|
60757
60909
|
logger.log("Building image", options.tag);
|
@@ -60821,11 +60973,10 @@ function getBuildArguments(container, idForImageTag) {
|
|
60821
60973
|
args: container.image_vars
|
60822
60974
|
};
|
60823
60975
|
}
|
60824
|
-
var import_fs12, isDockerfile;
|
60825
60976
|
var init_deploy = __esm({
|
60826
60977
|
"src/cloudchamber/deploy.ts"() {
|
60827
60978
|
init_import_meta_url();
|
60828
|
-
|
60979
|
+
init_containers_shared();
|
60829
60980
|
init_misc_variables();
|
60830
60981
|
init_errors();
|
60831
60982
|
init_is_interactive();
|
@@ -60837,44 +60988,12 @@ var init_deploy = __esm({
|
|
60837
60988
|
__name(maybeBuildContainer, "maybeBuildContainer");
|
60838
60989
|
__name(deployContainers, "deployContainers");
|
60839
60990
|
__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
60991
|
}
|
60873
60992
|
});
|
60874
60993
|
|
60875
60994
|
// src/d1/constants.ts
|
60876
60995
|
var DEFAULT_MIGRATION_PATH, DEFAULT_MIGRATION_TABLE, LOCATION_CHOICES;
|
60877
|
-
var
|
60996
|
+
var init_constants4 = __esm({
|
60878
60997
|
"src/d1/constants.ts"() {
|
60879
60998
|
init_import_meta_url();
|
60880
60999
|
DEFAULT_MIGRATION_PATH = "./migrations";
|
@@ -60918,7 +61037,7 @@ var init_create = __esm({
|
|
60918
61037
|
init_errors();
|
60919
61038
|
init_logger();
|
60920
61039
|
init_user2();
|
60921
|
-
|
61040
|
+
init_constants4();
|
60922
61041
|
__name(createD1Database, "createD1Database");
|
60923
61042
|
d1CreateCommand = createCommand({
|
60924
61043
|
metadata: {
|
@@ -61066,7 +61185,7 @@ var init_utils3 = __esm({
|
|
61066
61185
|
init_import_meta_url();
|
61067
61186
|
init_cfetch();
|
61068
61187
|
init_errors();
|
61069
|
-
|
61188
|
+
init_constants4();
|
61070
61189
|
init_list();
|
61071
61190
|
__name(getDatabaseInfoFromConfig, "getDatabaseInfoFromConfig");
|
61072
61191
|
getDatabaseByNameOrBinding = /* @__PURE__ */ __name(async (config, accountId, name2) => {
|
@@ -64445,16 +64564,16 @@ var init_als_external = __esm({
|
|
64445
64564
|
});
|
64446
64565
|
|
64447
64566
|
// 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;
|
64567
|
+
function nodejsHybridPlugin() {
|
64455
64568
|
return {
|
64456
64569
|
name: "hybrid-nodejs_compat",
|
64457
|
-
setup(build5) {
|
64570
|
+
async setup(build5) {
|
64571
|
+
const { defineEnv } = await import("unenv");
|
64572
|
+
const { cloudflare } = await import("@cloudflare/unenv-preset");
|
64573
|
+
const { alias, inject, external, polyfill: polyfill2 } = defineEnv({
|
64574
|
+
presets: [cloudflare],
|
64575
|
+
npmShims: true
|
64576
|
+
}).env;
|
64458
64577
|
errorOnServiceWorkerFormat(build5);
|
64459
64578
|
handleRequireCallsToNodeJSBuiltins(build5);
|
64460
64579
|
handleUnenvAliasedPackages(build5, alias, external);
|
@@ -64700,9 +64819,8 @@ var init_nodejs_compat = __esm({
|
|
64700
64819
|
});
|
64701
64820
|
|
64702
64821
|
// src/deployment-bundle/esbuild-plugins/nodejs-plugins.ts
|
64703
|
-
|
64704
|
-
mode
|
64705
|
-
unenvResolvePaths
|
64822
|
+
function getNodeJSCompatPlugins({
|
64823
|
+
mode
|
64706
64824
|
}) {
|
64707
64825
|
switch (mode) {
|
64708
64826
|
case "als":
|
@@ -64710,7 +64828,7 @@ async function getNodeJSCompatPlugins({
|
|
64710
64828
|
case "v1":
|
64711
64829
|
return [nodejsCompatPlugin(mode)];
|
64712
64830
|
case "v2":
|
64713
|
-
return [
|
64831
|
+
return [nodejsHybridPlugin()];
|
64714
64832
|
case null:
|
64715
64833
|
return [nodejsCompatPlugin(mode)];
|
64716
64834
|
}
|
@@ -64819,24 +64937,6 @@ async function bundleWorker(entry, destination, {
|
|
64819
64937
|
}
|
64820
64938
|
inject.push(checkedFetchFileToInject);
|
64821
64939
|
}
|
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
64940
|
if (getFlag("MULTIWORKER")) {
|
64841
64941
|
middlewareToLoad.push({
|
64842
64942
|
name: "patch-console-prefix",
|
@@ -64890,7 +64990,6 @@ async function bundleWorker(entry, destination, {
|
|
64890
64990
|
});
|
64891
64991
|
}
|
64892
64992
|
};
|
64893
|
-
const unenvResolvePaths = getUnenvResolvePathsFromEnv()?.split(",");
|
64894
64993
|
const buildOptions = {
|
64895
64994
|
// Don't use entryFile here as the file may have been changed when applying the middleware
|
64896
64995
|
entryPoints: [entry.file],
|
@@ -64931,9 +65030,8 @@ async function bundleWorker(entry, destination, {
|
|
64931
65030
|
plugins: [
|
64932
65031
|
aliasPlugin,
|
64933
65032
|
moduleCollector.plugin,
|
64934
|
-
...
|
64935
|
-
mode: nodejsCompatMode ?? null
|
64936
|
-
unenvResolvePaths
|
65033
|
+
...getNodeJSCompatPlugins({
|
65034
|
+
mode: nodejsCompatMode ?? null
|
64937
65035
|
}),
|
64938
65036
|
cloudflareInternalPlugin,
|
64939
65037
|
buildResultPlugin,
|
@@ -76201,7 +76299,7 @@ public_key: ${dim(
|
|
76201
76299
|
}
|
76202
76300
|
async function handleConfigureImageRegistryCommand(args, _config) {
|
76203
76301
|
startSection("Configure a Docker registry in Cloudflare");
|
76204
|
-
const
|
76302
|
+
const domain2 = await processArgument({ domain: args.domain }, "domain", {
|
76205
76303
|
type: "text",
|
76206
76304
|
question: "What is the domain of your registry?",
|
76207
76305
|
validate: /* @__PURE__ */ __name((text) => {
|
@@ -76223,7 +76321,7 @@ async function handleConfigureImageRegistryCommand(args, _config) {
|
|
76223
76321
|
const [registry, err] = await wrap2(
|
76224
76322
|
promiseSpinner(
|
76225
76323
|
ImageRegistriesService.createImageRegistry({
|
76226
|
-
domain:
|
76324
|
+
domain: domain2,
|
76227
76325
|
is_public: isPublic
|
76228
76326
|
})
|
76229
76327
|
)
|
@@ -76252,7 +76350,7 @@ async function handleConfigureImageRegistryCommand(args, _config) {
|
|
76252
76350
|
);
|
76253
76351
|
}
|
76254
76352
|
var registriesCommand;
|
76255
|
-
var
|
76353
|
+
var init_images2 = __esm({
|
76256
76354
|
"src/cloudchamber/images/images.ts"() {
|
76257
76355
|
init_import_meta_url();
|
76258
76356
|
init_cli();
|
@@ -76385,7 +76483,7 @@ async function handleDeleteImageCommand(args, _config) {
|
|
76385
76483
|
}
|
76386
76484
|
return await promiseSpinner(
|
76387
76485
|
getCreds().then(async (creds) => {
|
76388
|
-
const url4 = new URL(`https://${
|
76486
|
+
const url4 = new URL(`https://${getCloudflareContainerRegistry()}`);
|
76389
76487
|
const baseUrl = `${url4.protocol}//${url4.host}`;
|
76390
76488
|
const [image, tag] = args.image.split(":");
|
76391
76489
|
await deleteTag(baseUrl, image, tag, creds);
|
@@ -76457,7 +76555,7 @@ async function ListTags(responses, digests = false, json = false) {
|
|
76457
76555
|
}
|
76458
76556
|
}
|
76459
76557
|
async function listTags(repo, creds) {
|
76460
|
-
const url4 = new URL(`https://${
|
76558
|
+
const url4 = new URL(`https://${getCloudflareContainerRegistry()}`);
|
76461
76559
|
const baseUrl = `${url4.protocol}//${url4.host}`;
|
76462
76560
|
const tagsUrl = `${baseUrl}/v2/${repo}/tags/list`;
|
76463
76561
|
const tagsResponse = await fetch(tagsUrl, {
|
@@ -76470,7 +76568,7 @@ async function listTags(repo, creds) {
|
|
76470
76568
|
return tagsData.tags || [];
|
76471
76569
|
}
|
76472
76570
|
async function listRepos(creds) {
|
76473
|
-
const url4 = new URL(`https://${
|
76571
|
+
const url4 = new URL(`https://${getCloudflareContainerRegistry()}`);
|
76474
76572
|
const catalogUrl = `${url4.protocol}//${url4.host}/v2/_catalog`;
|
76475
76573
|
const response = await fetch(catalogUrl, {
|
76476
76574
|
method: "GET",
|
@@ -76521,21 +76619,23 @@ async function deleteTag(baseUrl, image, tag, creds) {
|
|
76521
76619
|
}
|
76522
76620
|
}
|
76523
76621
|
async function getCreds() {
|
76524
|
-
return await ImageRegistriesService.generateImageRegistryCredentials(
|
76525
|
-
|
76526
|
-
|
76527
|
-
|
76622
|
+
return await ImageRegistriesService.generateImageRegistryCredentials(
|
76623
|
+
getCloudflareContainerRegistry(),
|
76624
|
+
{
|
76625
|
+
expiration_minutes: 5,
|
76626
|
+
permissions: ["pull", "push"]
|
76627
|
+
}
|
76628
|
+
).then(async (credentials) => {
|
76528
76629
|
return Buffer.from(`v1:${credentials.password}`).toString("base64");
|
76529
76630
|
});
|
76530
76631
|
}
|
76531
|
-
var
|
76632
|
+
var imagesCommand;
|
76532
76633
|
var init_list2 = __esm({
|
76533
76634
|
"src/cloudchamber/images/list.ts"() {
|
76534
76635
|
init_import_meta_url();
|
76535
76636
|
init_containers_shared();
|
76536
76637
|
init_logger();
|
76537
76638
|
init_common();
|
76538
|
-
domain = "registry.cloudchamber.cfdata.org";
|
76539
76639
|
imagesCommand = /* @__PURE__ */ __name((yargs) => {
|
76540
76640
|
return yargs.command(
|
76541
76641
|
"list",
|
@@ -76963,7 +77063,7 @@ var init_cloudchamber = __esm({
|
|
76963
77063
|
init_create2();
|
76964
77064
|
init_curl();
|
76965
77065
|
init_delete();
|
76966
|
-
|
77066
|
+
init_images2();
|
76967
77067
|
init_list2();
|
76968
77068
|
init_list3();
|
76969
77069
|
init_modify();
|
@@ -78033,11 +78133,11 @@ function createRegisterYargsCommand(yargs, subHelp) {
|
|
78033
78133
|
registerSubTreeCallback();
|
78034
78134
|
},
|
78035
78135
|
// Only attach the handler for commands, not namespaces
|
78036
|
-
def.type === "command" ? createHandler(def) : void 0
|
78136
|
+
def.type === "command" ? createHandler(def, def.command) : void 0
|
78037
78137
|
);
|
78038
78138
|
}, "registerCommand");
|
78039
78139
|
}
|
78040
|
-
function createHandler(def) {
|
78140
|
+
function createHandler(def, commandName) {
|
78041
78141
|
return /* @__PURE__ */ __name(async function handler(args) {
|
78042
78142
|
try {
|
78043
78143
|
const shouldPrintBanner = def.behaviour?.printBanner;
|
@@ -78076,18 +78176,38 @@ function createHandler(def) {
|
|
78076
78176
|
RESOURCES_PROVISION: args.experimentalProvision ?? false,
|
78077
78177
|
MIXED_MODE: args.experimentalMixedMode ?? false
|
78078
78178
|
};
|
78079
|
-
await run(
|
78080
|
-
|
78081
|
-
|
78082
|
-
|
78083
|
-
|
78084
|
-
|
78085
|
-
|
78179
|
+
await run(experimentalFlags, () => {
|
78180
|
+
const config = def.behaviour?.provideConfig ?? true ? readConfig(args, {
|
78181
|
+
hideWarnings: !(def.behaviour?.printConfigWarnings ?? true),
|
78182
|
+
useRedirectIfAvailable: def.behaviour?.useConfigRedirectIfAvailable
|
78183
|
+
}) : defaultWranglerConfig;
|
78184
|
+
if (def.behaviour?.warnIfMultipleEnvsConfiguredButNoneSpecified) {
|
78185
|
+
if (!("env" in args) && config.configPath) {
|
78186
|
+
const { rawConfig } = experimental_readRawConfig(
|
78187
|
+
{
|
78188
|
+
config: config.configPath
|
78189
|
+
},
|
78190
|
+
{ hideWarnings: true }
|
78191
|
+
);
|
78192
|
+
const availableEnvs = Object.keys(rawConfig.env ?? {});
|
78193
|
+
if (availableEnvs.length > 0) {
|
78194
|
+
logger.warn(
|
78195
|
+
dedent2`
|
78196
|
+
Multiple environments are defined in the Wrangler configuration file, but no target environment was specified for the ${commandName.replace(/^wrangler\s+/, "")} command.
|
78197
|
+
To avoid unintentional changes to the wrong environment, it is recommended to explicitly specify the target environment using the \`-e|--env\` flag.
|
78198
|
+
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=""\`.
|
78199
|
+
`
|
78200
|
+
);
|
78201
|
+
}
|
78202
|
+
}
|
78203
|
+
}
|
78204
|
+
return def.handler(args, {
|
78205
|
+
config,
|
78086
78206
|
errors: { UserError, FatalError },
|
78087
78207
|
logger,
|
78088
78208
|
fetchResult
|
78089
|
-
})
|
78090
|
-
);
|
78209
|
+
});
|
78210
|
+
});
|
78091
78211
|
} catch (err) {
|
78092
78212
|
throw err;
|
78093
78213
|
}
|
@@ -78103,6 +78223,7 @@ var init_register_yargs_command = __esm({
|
|
78103
78223
|
init_errors();
|
78104
78224
|
init_experimental_flags();
|
78105
78225
|
init_logger();
|
78226
|
+
init_dedent();
|
78106
78227
|
init_is_local();
|
78107
78228
|
init_wrangler_banner();
|
78108
78229
|
init_helpers5();
|
@@ -79559,7 +79680,7 @@ var init_helpers6 = __esm({
|
|
79559
79680
|
init_errors();
|
79560
79681
|
init_is_interactive();
|
79561
79682
|
init_logger();
|
79562
|
-
|
79683
|
+
init_constants4();
|
79563
79684
|
init_execute();
|
79564
79685
|
__name(getMigrationsPath, "getMigrationsPath");
|
79565
79686
|
__name(getUnappliedMigrations, "getUnappliedMigrations");
|
@@ -79635,7 +79756,7 @@ var init_apply2 = __esm({
|
|
79635
79756
|
init_errors();
|
79636
79757
|
init_is_interactive();
|
79637
79758
|
init_logger();
|
79638
|
-
|
79759
|
+
init_constants4();
|
79639
79760
|
init_execute();
|
79640
79761
|
init_utils3();
|
79641
79762
|
init_helpers6();
|
@@ -79823,7 +79944,7 @@ var init_create3 = __esm({
|
|
79823
79944
|
init_create_command();
|
79824
79945
|
init_errors();
|
79825
79946
|
init_logger();
|
79826
|
-
|
79947
|
+
init_constants4();
|
79827
79948
|
init_utils3();
|
79828
79949
|
init_helpers6();
|
79829
79950
|
d1MigrationsCreateCommand = createCommand({
|
@@ -79893,7 +80014,7 @@ var init_list4 = __esm({
|
|
79893
80014
|
init_errors();
|
79894
80015
|
init_logger();
|
79895
80016
|
init_user2();
|
79896
|
-
|
80017
|
+
init_constants4();
|
79897
80018
|
init_utils3();
|
79898
80019
|
init_helpers6();
|
79899
80020
|
d1MigrationsListCommand = createCommand({
|
@@ -81188,7 +81309,8 @@ var init_deploy3 = __esm({
|
|
81188
81309
|
MULTIWORKER: false,
|
81189
81310
|
RESOURCES_PROVISION: args.experimentalProvision ?? false,
|
81190
81311
|
MIXED_MODE: false
|
81191
|
-
}), "overrideExperimentalFlags")
|
81312
|
+
}), "overrideExperimentalFlags"),
|
81313
|
+
warnIfMultipleEnvsConfiguredButNoneSpecified: true
|
81192
81314
|
},
|
81193
81315
|
validateArgs(args) {
|
81194
81316
|
if (args.nodeCompat) {
|
@@ -84105,7 +84227,7 @@ var init_commands = __esm({
|
|
84105
84227
|
logTelemetryStatus(savedConfig.permission?.enabled ?? true);
|
84106
84228
|
}
|
84107
84229
|
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"
|
84230
|
+
"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
84231
|
);
|
84110
84232
|
}
|
84111
84233
|
});
|
@@ -88291,7 +88413,7 @@ var require_dist4 = __commonJS({
|
|
88291
88413
|
|
88292
88414
|
// src/utils/constants.ts
|
88293
88415
|
var resetColor, fgGreenColor, betaCmdColor, DEFAULT_LOCAL_PORT, DEFAULT_INSPECTOR_PORT, proxy;
|
88294
|
-
var
|
88416
|
+
var init_constants5 = __esm({
|
88295
88417
|
"src/utils/constants.ts"() {
|
88296
88418
|
init_import_meta_url();
|
88297
88419
|
resetColor = "\x1B[0m";
|
@@ -88642,7 +88764,7 @@ var init_createTail = __esm({
|
|
88642
88764
|
init_package();
|
88643
88765
|
init_cfetch();
|
88644
88766
|
init_misc_variables();
|
88645
|
-
|
88767
|
+
init_constants5();
|
88646
88768
|
init_filters();
|
88647
88769
|
init_printing();
|
88648
88770
|
TRACE_VERSION = "trace-v1";
|
@@ -90487,6 +90609,9 @@ var init_secret = __esm({
|
|
90487
90609
|
owner: "Workers: Deploy and Config"
|
90488
90610
|
},
|
90489
90611
|
positionalArgs: ["key"],
|
90612
|
+
behaviour: {
|
90613
|
+
warnIfMultipleEnvsConfiguredButNoneSpecified: true
|
90614
|
+
},
|
90490
90615
|
args: {
|
90491
90616
|
key: {
|
90492
90617
|
describe: "The variable name to be accessible in the Worker",
|
@@ -90578,6 +90703,9 @@ var init_secret = __esm({
|
|
90578
90703
|
owner: "Workers: Deploy and Config"
|
90579
90704
|
},
|
90580
90705
|
positionalArgs: ["key"],
|
90706
|
+
behaviour: {
|
90707
|
+
warnIfMultipleEnvsConfiguredButNoneSpecified: true
|
90708
|
+
},
|
90581
90709
|
args: {
|
90582
90710
|
key: {
|
90583
90711
|
describe: "The variable name to be accessible in the Worker",
|
@@ -90687,6 +90815,9 @@ var init_secret = __esm({
|
|
90687
90815
|
owner: "Workers: Deploy and Config"
|
90688
90816
|
},
|
90689
90817
|
positionalArgs: ["file"],
|
90818
|
+
behaviour: {
|
90819
|
+
warnIfMultipleEnvsConfiguredButNoneSpecified: true
|
90820
|
+
},
|
90690
90821
|
args: {
|
90691
90822
|
file: {
|
90692
90823
|
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 +91970,7 @@ var init_dist_es3 = __esm({
|
|
91839
91970
|
|
91840
91971
|
// ../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/constants.js
|
91841
91972
|
var RequestChecksumCalculation, DEFAULT_REQUEST_CHECKSUM_CALCULATION, ResponseChecksumValidation, DEFAULT_RESPONSE_CHECKSUM_VALIDATION, ChecksumAlgorithm, ChecksumLocation, DEFAULT_CHECKSUM_ALGORITHM, S3_EXPRESS_DEFAULT_CHECKSUM_ALGORITHM;
|
91842
|
-
var
|
91973
|
+
var init_constants6 = __esm({
|
91843
91974
|
"../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/constants.js"() {
|
91844
91975
|
init_import_meta_url();
|
91845
91976
|
RequestChecksumCalculation = {
|
@@ -91894,7 +92025,7 @@ var ENV_REQUEST_CHECKSUM_CALCULATION, CONFIG_REQUEST_CHECKSUM_CALCULATION, NODE_
|
|
91894
92025
|
var init_NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS = __esm({
|
91895
92026
|
"../../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
92027
|
init_import_meta_url();
|
91897
|
-
|
92028
|
+
init_constants6();
|
91898
92029
|
init_stringUnionSelector();
|
91899
92030
|
ENV_REQUEST_CHECKSUM_CALCULATION = "AWS_REQUEST_CHECKSUM_CALCULATION";
|
91900
92031
|
CONFIG_REQUEST_CHECKSUM_CALCULATION = "request_checksum_calculation";
|
@@ -91911,7 +92042,7 @@ var ENV_RESPONSE_CHECKSUM_VALIDATION, CONFIG_RESPONSE_CHECKSUM_VALIDATION, NODE_
|
|
91911
92042
|
var init_NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS = __esm({
|
91912
92043
|
"../../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
92044
|
init_import_meta_url();
|
91914
|
-
|
92045
|
+
init_constants6();
|
91915
92046
|
init_stringUnionSelector();
|
91916
92047
|
ENV_RESPONSE_CHECKSUM_VALIDATION = "AWS_RESPONSE_CHECKSUM_VALIDATION";
|
91917
92048
|
CONFIG_RESPONSE_CHECKSUM_VALIDATION = "response_checksum_validation";
|
@@ -92803,7 +92934,7 @@ var init_dist_es11 = __esm({
|
|
92803
92934
|
|
92804
92935
|
// ../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/constants.js
|
92805
92936
|
var NODEJS_TIMEOUT_ERROR_CODES;
|
92806
|
-
var
|
92937
|
+
var init_constants7 = __esm({
|
92807
92938
|
"../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/constants.js"() {
|
92808
92939
|
init_import_meta_url();
|
92809
92940
|
NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"];
|
@@ -93010,7 +93141,7 @@ var init_node_http_handler = __esm({
|
|
93010
93141
|
init_dist_es11();
|
93011
93142
|
import_http = require("http");
|
93012
93143
|
import_https = require("https");
|
93013
|
-
|
93144
|
+
init_constants7();
|
93014
93145
|
init_get_transformed_headers();
|
93015
93146
|
init_set_connection_timeout();
|
93016
93147
|
init_set_socket_keep_alive();
|
@@ -94390,7 +94521,7 @@ var init_resolveAwsSdkSigV4AConfig = __esm({
|
|
94390
94521
|
|
94391
94522
|
// ../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/constants.js
|
94392
94523
|
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
|
94524
|
+
var init_constants8 = __esm({
|
94394
94525
|
"../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/constants.js"() {
|
94395
94526
|
init_import_meta_url();
|
94396
94527
|
ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm";
|
@@ -94442,7 +94573,7 @@ var init_credentialDerivation = __esm({
|
|
94442
94573
|
init_import_meta_url();
|
94443
94574
|
init_dist_es14();
|
94444
94575
|
init_dist_es8();
|
94445
|
-
|
94576
|
+
init_constants8();
|
94446
94577
|
signingKeyCache = {};
|
94447
94578
|
cacheQueue = [];
|
94448
94579
|
createScope = /* @__PURE__ */ __name((shortDate, region, service) => `${shortDate}/${region}/${service}/${KEY_TYPE_IDENTIFIER}`, "createScope");
|
@@ -94475,7 +94606,7 @@ var getCanonicalHeaders;
|
|
94475
94606
|
var init_getCanonicalHeaders = __esm({
|
94476
94607
|
"../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/getCanonicalHeaders.js"() {
|
94477
94608
|
init_import_meta_url();
|
94478
|
-
|
94609
|
+
init_constants8();
|
94479
94610
|
getCanonicalHeaders = /* @__PURE__ */ __name(({ headers }, unsignableHeaders, signableHeaders) => {
|
94480
94611
|
const canonical = {};
|
94481
94612
|
for (const headerName of Object.keys(headers).sort()) {
|
@@ -94501,7 +94632,7 @@ var init_getCanonicalQuery = __esm({
|
|
94501
94632
|
"../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js"() {
|
94502
94633
|
init_import_meta_url();
|
94503
94634
|
init_dist_es10();
|
94504
|
-
|
94635
|
+
init_constants8();
|
94505
94636
|
getCanonicalQuery = /* @__PURE__ */ __name(({ query = {} }) => {
|
94506
94637
|
const keys = [];
|
94507
94638
|
const serialized = {};
|
@@ -94531,7 +94662,7 @@ var init_getPayloadHash = __esm({
|
|
94531
94662
|
init_dist_es6();
|
94532
94663
|
init_dist_es14();
|
94533
94664
|
init_dist_es8();
|
94534
|
-
|
94665
|
+
init_constants8();
|
94535
94666
|
getPayloadHash = /* @__PURE__ */ __name(async ({ headers, body }, hashConstructor) => {
|
94536
94667
|
for (const headerName of Object.keys(headers)) {
|
94537
94668
|
if (headerName.toLowerCase() === SHA256_HEADER) {
|
@@ -94736,7 +94867,7 @@ var init_prepareRequest = __esm({
|
|
94736
94867
|
"../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/prepareRequest.js"() {
|
94737
94868
|
init_import_meta_url();
|
94738
94869
|
init_dist_es2();
|
94739
|
-
|
94870
|
+
init_constants8();
|
94740
94871
|
prepareRequest = /* @__PURE__ */ __name((request4) => {
|
94741
94872
|
request4 = HttpRequest.clone(request4);
|
94742
94873
|
for (const headerName of Object.keys(request4.headers)) {
|
@@ -94779,7 +94910,7 @@ var init_SignatureV4 = __esm({
|
|
94779
94910
|
init_dist_es4();
|
94780
94911
|
init_dist_es10();
|
94781
94912
|
init_dist_es8();
|
94782
|
-
|
94913
|
+
init_constants8();
|
94783
94914
|
init_credentialDerivation();
|
94784
94915
|
init_getCanonicalHeaders();
|
94785
94916
|
init_getCanonicalQuery();
|
@@ -95561,7 +95692,7 @@ var init_command4 = __esm({
|
|
95561
95692
|
|
95562
95693
|
// ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/constants.js
|
95563
95694
|
var SENSITIVE_STRING;
|
95564
|
-
var
|
95695
|
+
var init_constants9 = __esm({
|
95565
95696
|
"../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/constants.js"() {
|
95566
95697
|
init_import_meta_url();
|
95567
95698
|
SENSITIVE_STRING = "***SensitiveInformation***";
|
@@ -96410,7 +96541,7 @@ var init_dist_es20 = __esm({
|
|
96410
96541
|
init_client6();
|
96411
96542
|
init_collect_stream_body2();
|
96412
96543
|
init_command4();
|
96413
|
-
|
96544
|
+
init_constants9();
|
96414
96545
|
init_create_aggregated_client();
|
96415
96546
|
init_date_utils();
|
96416
96547
|
init_default_error_handler();
|
@@ -98315,7 +98446,7 @@ var CLIENT_SUPPORTED_ALGORITHMS, PRIORITY_ORDER_ALGORITHMS;
|
|
98315
98446
|
var init_types5 = __esm({
|
98316
98447
|
"../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/types.js"() {
|
98317
98448
|
init_import_meta_url();
|
98318
|
-
|
98449
|
+
init_constants6();
|
98319
98450
|
CLIENT_SUPPORTED_ALGORITHMS = [
|
98320
98451
|
ChecksumAlgorithm.CRC32,
|
98321
98452
|
ChecksumAlgorithm.CRC32C,
|
@@ -98336,7 +98467,7 @@ var getChecksumAlgorithmForRequest;
|
|
98336
98467
|
var init_getChecksumAlgorithmForRequest = __esm({
|
98337
98468
|
"../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getChecksumAlgorithmForRequest.js"() {
|
98338
98469
|
init_import_meta_url();
|
98339
|
-
|
98470
|
+
init_constants6();
|
98340
98471
|
init_types5();
|
98341
98472
|
getChecksumAlgorithmForRequest = /* @__PURE__ */ __name((input, { requestChecksumRequired, requestAlgorithmMember }, isS3Express) => {
|
98342
98473
|
const defaultAlgorithm = isS3Express ? S3_EXPRESS_DEFAULT_CHECKSUM_ALGORITHM : DEFAULT_CHECKSUM_ALGORITHM;
|
@@ -98357,7 +98488,7 @@ var getChecksumLocationName;
|
|
98357
98488
|
var init_getChecksumLocationName = __esm({
|
98358
98489
|
"../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getChecksumLocationName.js"() {
|
98359
98490
|
init_import_meta_url();
|
98360
|
-
|
98491
|
+
init_constants6();
|
98361
98492
|
getChecksumLocationName = /* @__PURE__ */ __name((algorithm) => algorithm === ChecksumAlgorithm.MD5 ? "content-md5" : `x-amz-checksum-${algorithm.toLowerCase()}`, "getChecksumLocationName");
|
98362
98493
|
}
|
98363
98494
|
});
|
@@ -99382,7 +99513,7 @@ var init_selectChecksumAlgorithmFunction = __esm({
|
|
99382
99513
|
"../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/selectChecksumAlgorithmFunction.js"() {
|
99383
99514
|
init_import_meta_url();
|
99384
99515
|
init_module2();
|
99385
|
-
|
99516
|
+
init_constants6();
|
99386
99517
|
init_getCrc32ChecksumAlgorithmFunction();
|
99387
99518
|
selectChecksumAlgorithmFunction = /* @__PURE__ */ __name((checksumAlgorithm, config) => {
|
99388
99519
|
switch (checksumAlgorithm) {
|
@@ -99424,7 +99555,7 @@ var init_flexibleChecksumsMiddleware = __esm({
|
|
99424
99555
|
init_import_meta_url();
|
99425
99556
|
init_dist_es21();
|
99426
99557
|
init_dist_es2();
|
99427
|
-
|
99558
|
+
init_constants6();
|
99428
99559
|
init_getChecksumAlgorithmForRequest();
|
99429
99560
|
init_getChecksumLocationName();
|
99430
99561
|
init_hasHeader();
|
@@ -99696,7 +99827,7 @@ var init_resolveFlexibleChecksumsConfig = __esm({
|
|
99696
99827
|
"../../node_modules/.pnpm/@aws-sdk+middleware-flexible-checksums@3.717.0/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/resolveFlexibleChecksumsConfig.js"() {
|
99697
99828
|
init_import_meta_url();
|
99698
99829
|
init_dist_es4();
|
99699
|
-
|
99830
|
+
init_constants6();
|
99700
99831
|
resolveFlexibleChecksumsConfig = /* @__PURE__ */ __name((input) => ({
|
99701
99832
|
...input,
|
99702
99833
|
requestChecksumCalculation: normalizeProvider(input.requestChecksumCalculation ?? DEFAULT_REQUEST_CHECKSUM_CALCULATION),
|
@@ -99711,7 +99842,7 @@ var init_dist_es25 = __esm({
|
|
99711
99842
|
init_import_meta_url();
|
99712
99843
|
init_NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS();
|
99713
99844
|
init_NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS();
|
99714
|
-
|
99845
|
+
init_constants6();
|
99715
99846
|
init_flexibleChecksumsMiddleware();
|
99716
99847
|
init_getFlexibleChecksumsPlugin();
|
99717
99848
|
init_resolveFlexibleChecksumsConfig();
|
@@ -100204,7 +100335,7 @@ var init_dist_es29 = __esm({
|
|
100204
100335
|
|
100205
100336
|
// ../../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
100337
|
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
|
100338
|
+
var init_constants10 = __esm({
|
100208
100339
|
"../../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
100340
|
init_import_meta_url();
|
100210
100341
|
init_dist_es29();
|
@@ -100249,7 +100380,7 @@ var init_SignatureV4S3Express = __esm({
|
|
100249
100380
|
"../../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
100381
|
init_import_meta_url();
|
100251
100382
|
init_dist_es18();
|
100252
|
-
|
100383
|
+
init_constants10();
|
100253
100384
|
SignatureV4S3Express = class extends SignatureV4 {
|
100254
100385
|
static {
|
100255
100386
|
__name(this, "SignatureV4S3Express");
|
@@ -100284,7 +100415,7 @@ var init_s3ExpressMiddleware = __esm({
|
|
100284
100415
|
init_import_meta_url();
|
100285
100416
|
init_dist_es21();
|
100286
100417
|
init_dist_es2();
|
100287
|
-
|
100418
|
+
init_constants10();
|
100288
100419
|
s3ExpressMiddleware = /* @__PURE__ */ __name((options) => {
|
100289
100420
|
return (next, context2) => async (args) => {
|
100290
100421
|
if (context2.endpointV2) {
|
@@ -100394,7 +100525,7 @@ var init_s3_express = __esm({
|
|
100394
100525
|
init_S3ExpressIdentityCacheEntry();
|
100395
100526
|
init_S3ExpressIdentityProviderImpl();
|
100396
100527
|
init_SignatureV4S3Express();
|
100397
|
-
|
100528
|
+
init_constants10();
|
100398
100529
|
init_s3ExpressMiddleware();
|
100399
100530
|
init_s3ExpressHttpSigningMiddleware();
|
100400
100531
|
}
|
@@ -101937,7 +102068,7 @@ var init_check_features = __esm({
|
|
101937
102068
|
|
101938
102069
|
// ../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.721.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/constants.js
|
101939
102070
|
var USER_AGENT, X_AMZ_USER_AGENT, SPACE, UA_NAME_SEPARATOR, UA_NAME_ESCAPE_REGEX, UA_VALUE_ESCAPE_REGEX, UA_ESCAPE_CHAR;
|
101940
|
-
var
|
102071
|
+
var init_constants11 = __esm({
|
101941
102072
|
"../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.721.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/constants.js"() {
|
101942
102073
|
init_import_meta_url();
|
101943
102074
|
USER_AGENT = "user-agent";
|
@@ -101984,7 +102115,7 @@ var init_user_agent_middleware = __esm({
|
|
101984
102115
|
init_dist_es33();
|
101985
102116
|
init_dist_es2();
|
101986
102117
|
init_check_features();
|
101987
|
-
|
102118
|
+
init_constants11();
|
101988
102119
|
init_encode_features();
|
101989
102120
|
userAgentMiddleware = /* @__PURE__ */ __name((options) => (next, context2) => async (args) => {
|
101990
102121
|
const { request: request4 } = args;
|
@@ -103194,7 +103325,7 @@ var init_config5 = __esm({
|
|
103194
103325
|
|
103195
103326
|
// ../../node_modules/.pnpm/@smithy+service-error-classification@3.0.11/node_modules/@smithy/service-error-classification/dist-es/constants.js
|
103196
103327
|
var THROTTLING_ERROR_CODES, TRANSIENT_ERROR_CODES, TRANSIENT_ERROR_STATUS_CODES, NODEJS_TIMEOUT_ERROR_CODES2;
|
103197
|
-
var
|
103328
|
+
var init_constants12 = __esm({
|
103198
103329
|
"../../node_modules/.pnpm/@smithy+service-error-classification@3.0.11/node_modules/@smithy/service-error-classification/dist-es/constants.js"() {
|
103199
103330
|
init_import_meta_url();
|
103200
103331
|
THROTTLING_ERROR_CODES = [
|
@@ -103224,7 +103355,7 @@ var isClockSkewCorrectedError, isThrottlingError, isTransientError, isServerErro
|
|
103224
103355
|
var init_dist_es43 = __esm({
|
103225
103356
|
"../../node_modules/.pnpm/@smithy+service-error-classification@3.0.11/node_modules/@smithy/service-error-classification/dist-es/index.js"() {
|
103226
103357
|
init_import_meta_url();
|
103227
|
-
|
103358
|
+
init_constants12();
|
103228
103359
|
isClockSkewCorrectedError = /* @__PURE__ */ __name((error2) => error2.$metadata?.clockSkewCorrected, "isClockSkewCorrectedError");
|
103229
103360
|
isThrottlingError = /* @__PURE__ */ __name((error2) => error2.$metadata?.httpStatusCode === 429 || THROTTLING_ERROR_CODES.includes(error2.name) || error2.$retryable?.throttling == true, "isThrottlingError");
|
103230
103361
|
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 +103484,7 @@ var init_DefaultRateLimiter = __esm({
|
|
103353
103484
|
|
103354
103485
|
// ../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/constants.js
|
103355
103486
|
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
|
103487
|
+
var init_constants13 = __esm({
|
103357
103488
|
"../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/constants.js"() {
|
103358
103489
|
init_import_meta_url();
|
103359
103490
|
DEFAULT_RETRY_DELAY_BASE = 100;
|
@@ -103373,7 +103504,7 @@ var getDefaultRetryBackoffStrategy;
|
|
103373
103504
|
var init_defaultRetryBackoffStrategy = __esm({
|
103374
103505
|
"../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/defaultRetryBackoffStrategy.js"() {
|
103375
103506
|
init_import_meta_url();
|
103376
|
-
|
103507
|
+
init_constants13();
|
103377
103508
|
getDefaultRetryBackoffStrategy = /* @__PURE__ */ __name(() => {
|
103378
103509
|
let delayBase = DEFAULT_RETRY_DELAY_BASE;
|
103379
103510
|
const computeNextBackoffDelay = /* @__PURE__ */ __name((attempts) => {
|
@@ -103395,7 +103526,7 @@ var createDefaultRetryToken;
|
|
103395
103526
|
var init_defaultRetryToken = __esm({
|
103396
103527
|
"../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/defaultRetryToken.js"() {
|
103397
103528
|
init_import_meta_url();
|
103398
|
-
|
103529
|
+
init_constants13();
|
103399
103530
|
createDefaultRetryToken = /* @__PURE__ */ __name(({ retryDelay, retryCount, retryCost }) => {
|
103400
103531
|
const getRetryCount = /* @__PURE__ */ __name(() => retryCount, "getRetryCount");
|
103401
103532
|
const getRetryDelay = /* @__PURE__ */ __name(() => Math.min(MAXIMUM_RETRY_DELAY, retryDelay), "getRetryDelay");
|
@@ -103415,7 +103546,7 @@ var init_StandardRetryStrategy = __esm({
|
|
103415
103546
|
"../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/StandardRetryStrategy.js"() {
|
103416
103547
|
init_import_meta_url();
|
103417
103548
|
init_config5();
|
103418
|
-
|
103549
|
+
init_constants13();
|
103419
103550
|
init_defaultRetryBackoffStrategy();
|
103420
103551
|
init_defaultRetryToken();
|
103421
103552
|
StandardRetryStrategy = class {
|
@@ -103519,7 +103650,7 @@ var init_AdaptiveRetryStrategy = __esm({
|
|
103519
103650
|
var init_ConfiguredRetryStrategy = __esm({
|
103520
103651
|
"../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/ConfiguredRetryStrategy.js"() {
|
103521
103652
|
init_import_meta_url();
|
103522
|
-
|
103653
|
+
init_constants13();
|
103523
103654
|
init_StandardRetryStrategy();
|
103524
103655
|
}
|
103525
103656
|
});
|
@@ -103540,7 +103671,7 @@ var init_dist_es44 = __esm({
|
|
103540
103671
|
init_DefaultRateLimiter();
|
103541
103672
|
init_StandardRetryStrategy();
|
103542
103673
|
init_config5();
|
103543
|
-
|
103674
|
+
init_constants13();
|
103544
103675
|
init_types11();
|
103545
103676
|
}
|
103546
103677
|
});
|
@@ -113404,7 +113535,7 @@ var init_isSsoProfile = __esm({
|
|
113404
113535
|
|
113405
113536
|
// ../../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
113537
|
var EXPIRE_WINDOW_MS, REFRESH_MESSAGE;
|
113407
|
-
var
|
113538
|
+
var init_constants14 = __esm({
|
113408
113539
|
"../../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
113540
|
init_import_meta_url();
|
113410
113541
|
EXPIRE_WINDOW_MS = 5 * 60 * 1e3;
|
@@ -113880,7 +114011,7 @@ var init_runtimeConfig_shared = __esm({
|
|
113880
114011
|
|
113881
114012
|
// ../../node_modules/.pnpm/@smithy+util-defaults-mode-node@3.0.34/node_modules/@smithy/util-defaults-mode-node/dist-es/constants.js
|
113882
114013
|
var AWS_EXECUTION_ENV, AWS_REGION_ENV, AWS_DEFAULT_REGION_ENV, ENV_IMDS_DISABLED2, DEFAULTS_MODE_OPTIONS, IMDS_REGION_PATH;
|
113883
|
-
var
|
114014
|
+
var init_constants15 = __esm({
|
113884
114015
|
"../../node_modules/.pnpm/@smithy+util-defaults-mode-node@3.0.34/node_modules/@smithy/util-defaults-mode-node/dist-es/constants.js"() {
|
113885
114016
|
init_import_meta_url();
|
113886
114017
|
AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV";
|
@@ -113919,7 +114050,7 @@ var init_resolveDefaultsModeConfig = __esm({
|
|
113919
114050
|
init_dist_es35();
|
113920
114051
|
init_dist_es39();
|
113921
114052
|
init_dist_es17();
|
113922
|
-
|
114053
|
+
init_constants15();
|
113923
114054
|
init_defaultsModeConfig();
|
113924
114055
|
resolveDefaultsModeConfig = /* @__PURE__ */ __name(({ region = loadConfig(NODE_REGION_CONFIG_OPTIONS), defaultsMode = loadConfig(NODE_DEFAULTS_MODE_CONFIG_OPTIONS) } = {}) => memoize(async () => {
|
113925
114056
|
const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode;
|
@@ -115202,7 +115333,7 @@ var init_validateTokenExpiry = __esm({
|
|
115202
115333
|
"../../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
115334
|
init_import_meta_url();
|
115204
115335
|
init_dist_es17();
|
115205
|
-
|
115336
|
+
init_constants14();
|
115206
115337
|
validateTokenExpiry = /* @__PURE__ */ __name((token) => {
|
115207
115338
|
if (token.expiration && token.expiration.getTime() < Date.now()) {
|
115208
115339
|
throw new TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false);
|
@@ -115217,7 +115348,7 @@ var init_validateTokenKey = __esm({
|
|
115217
115348
|
"../../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
115349
|
init_import_meta_url();
|
115219
115350
|
init_dist_es17();
|
115220
|
-
|
115351
|
+
init_constants14();
|
115221
115352
|
validateTokenKey = /* @__PURE__ */ __name((key, value, forRefresh = false) => {
|
115222
115353
|
if (typeof value === "undefined") {
|
115223
115354
|
throw new TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${REFRESH_MESSAGE}`, false);
|
@@ -115249,7 +115380,7 @@ var init_fromSso = __esm({
|
|
115249
115380
|
init_import_meta_url();
|
115250
115381
|
init_dist_es17();
|
115251
115382
|
init_dist_es38();
|
115252
|
-
|
115383
|
+
init_constants14();
|
115253
115384
|
init_getNewSsoOidcToken();
|
115254
115385
|
init_validateTokenExpiry();
|
115255
115386
|
init_validateTokenKey();
|
@@ -118820,12 +118951,12 @@ var init_getValidatedProcessCredentials = __esm({
|
|
118820
118951
|
});
|
118821
118952
|
|
118822
118953
|
// ../../node_modules/.pnpm/@aws-sdk+credential-provider-process@3.716.0/node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js
|
118823
|
-
var
|
118954
|
+
var import_child_process6, import_util14, resolveProcessCredentials;
|
118824
118955
|
var init_resolveProcessCredentials = __esm({
|
118825
118956
|
"../../node_modules/.pnpm/@aws-sdk+credential-provider-process@3.716.0/node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js"() {
|
118826
118957
|
init_import_meta_url();
|
118827
118958
|
init_dist_es17();
|
118828
|
-
|
118959
|
+
import_child_process6 = require("child_process");
|
118829
118960
|
import_util14 = require("util");
|
118830
118961
|
init_getValidatedProcessCredentials();
|
118831
118962
|
resolveProcessCredentials = /* @__PURE__ */ __name(async (profileName, profiles, logger4) => {
|
@@ -118833,7 +118964,7 @@ var init_resolveProcessCredentials = __esm({
|
|
118833
118964
|
if (profiles[profileName]) {
|
118834
118965
|
const credentialProcess = profile["credential_process"];
|
118835
118966
|
if (credentialProcess !== void 0) {
|
118836
|
-
const execPromise = (0, import_util14.promisify)(
|
118967
|
+
const execPromise = (0, import_util14.promisify)(import_child_process6.exec);
|
118837
118968
|
try {
|
118838
118969
|
const { stdout: stdout2 } = await execPromise(credentialProcess);
|
118839
118970
|
let data;
|
@@ -125783,7 +125914,7 @@ var init_remove2 = __esm({
|
|
125783
125914
|
|
125784
125915
|
// src/queues/constants.ts
|
125785
125916
|
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
|
125917
|
+
var init_constants16 = __esm({
|
125787
125918
|
"src/queues/constants.ts"() {
|
125788
125919
|
init_import_meta_url();
|
125789
125920
|
INVALID_CONSUMER_SETTINGS_ERROR = 100127;
|
@@ -125809,7 +125940,7 @@ var init_utils11 = __esm({
|
|
125809
125940
|
"src/queues/utils.ts"() {
|
125810
125941
|
init_import_meta_url();
|
125811
125942
|
init_errors();
|
125812
|
-
|
125943
|
+
init_constants16();
|
125813
125944
|
__name(handleFetchError, "handleFetchError");
|
125814
125945
|
}
|
125815
125946
|
});
|
@@ -125852,7 +125983,7 @@ var init_create6 = __esm({
|
|
125852
125983
|
init_logger();
|
125853
125984
|
init_getValidBindingName();
|
125854
125985
|
init_client();
|
125855
|
-
|
125986
|
+
init_constants16();
|
125856
125987
|
init_utils11();
|
125857
125988
|
queuesCreateCommand = createCommand({
|
125858
125989
|
metadata: {
|
@@ -126216,7 +126347,7 @@ var init_update3 = __esm({
|
|
126216
126347
|
init_errors();
|
126217
126348
|
init_logger();
|
126218
126349
|
init_client();
|
126219
|
-
|
126350
|
+
init_constants16();
|
126220
126351
|
init_utils11();
|
126221
126352
|
queuesUpdateCommand = createCommand({
|
126222
126353
|
metadata: {
|
@@ -126274,7 +126405,7 @@ var init_r2 = __esm({
|
|
126274
126405
|
|
126275
126406
|
// src/r2/constants.ts
|
126276
126407
|
var MAX_UPLOAD_SIZE, LOCATION_CHOICES2;
|
126277
|
-
var
|
126408
|
+
var init_constants17 = __esm({
|
126278
126409
|
"src/r2/constants.ts"() {
|
126279
126410
|
init_import_meta_url();
|
126280
126411
|
MAX_UPLOAD_SIZE = 300 * 1024 * 1024;
|
@@ -126296,7 +126427,7 @@ var init_bucket = __esm({
|
|
126296
126427
|
init_user2();
|
126297
126428
|
init_getValidBindingName();
|
126298
126429
|
init_render_labelled_values();
|
126299
|
-
|
126430
|
+
init_constants17();
|
126300
126431
|
init_helpers2();
|
126301
126432
|
r2BucketNamespace = createNamespace({
|
126302
126433
|
metadata: {
|
@@ -126889,16 +127020,16 @@ var init_domain = __esm({
|
|
126889
127020
|
type: "string"
|
126890
127021
|
}
|
126891
127022
|
},
|
126892
|
-
async handler({ bucket, domain:
|
127023
|
+
async handler({ bucket, domain: domain2, jurisdiction }, { config }) {
|
126893
127024
|
const accountId = await requireAuth(config);
|
126894
127025
|
logger.log(
|
126895
|
-
`Retrieving custom domain '${
|
127026
|
+
`Retrieving custom domain '${domain2}' connected to bucket '${bucket}'...`
|
126896
127027
|
);
|
126897
127028
|
const domainResponse = await getCustomDomain(
|
126898
127029
|
config,
|
126899
127030
|
accountId,
|
126900
127031
|
bucket,
|
126901
|
-
|
127032
|
+
domain2,
|
126902
127033
|
jurisdiction
|
126903
127034
|
);
|
126904
127035
|
const tableOutput = tableFromCustomDomainListResponse([domainResponse]);
|
@@ -126988,7 +127119,7 @@ var init_domain = __esm({
|
|
126988
127119
|
const accountId = await requireAuth(config);
|
126989
127120
|
const {
|
126990
127121
|
bucket,
|
126991
|
-
domain:
|
127122
|
+
domain: domain2,
|
126992
127123
|
zoneId,
|
126993
127124
|
minTls = "1.0",
|
126994
127125
|
jurisdiction,
|
@@ -126996,26 +127127,26 @@ var init_domain = __esm({
|
|
126996
127127
|
} = args;
|
126997
127128
|
if (!force) {
|
126998
127129
|
const confirmedAdd = await confirm(
|
126999
|
-
`Are you sure you want to add the custom domain '${
|
127130
|
+
`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
127131
|
);
|
127001
127132
|
if (!confirmedAdd) {
|
127002
127133
|
logger.log("Add cancelled.");
|
127003
127134
|
return;
|
127004
127135
|
}
|
127005
127136
|
}
|
127006
|
-
logger.log(`Connecting custom domain '${
|
127137
|
+
logger.log(`Connecting custom domain '${domain2}' to bucket '${bucket}'...`);
|
127007
127138
|
await attachCustomDomainToBucket(
|
127008
127139
|
config,
|
127009
127140
|
accountId,
|
127010
127141
|
bucket,
|
127011
127142
|
{
|
127012
|
-
domain:
|
127143
|
+
domain: domain2,
|
127013
127144
|
zoneId,
|
127014
127145
|
minTLS: minTls
|
127015
127146
|
},
|
127016
127147
|
jurisdiction
|
127017
127148
|
);
|
127018
|
-
logger.log(`\u2728 Custom domain '${
|
127149
|
+
logger.log(`\u2728 Custom domain '${domain2}' connected successfully.`);
|
127019
127150
|
}
|
127020
127151
|
});
|
127021
127152
|
r2BucketDomainRemoveCommand = createCommand({
|
@@ -127051,25 +127182,25 @@ var init_domain = __esm({
|
|
127051
127182
|
},
|
127052
127183
|
async handler(args, { config }) {
|
127053
127184
|
const accountId = await requireAuth(config);
|
127054
|
-
const { bucket, domain:
|
127185
|
+
const { bucket, domain: domain2, jurisdiction, force } = args;
|
127055
127186
|
if (!force) {
|
127056
127187
|
const confirmedRemoval = await confirm(
|
127057
|
-
`Are you sure you want to remove the custom domain '${
|
127188
|
+
`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
127189
|
);
|
127059
127190
|
if (!confirmedRemoval) {
|
127060
127191
|
logger.log("Removal cancelled.");
|
127061
127192
|
return;
|
127062
127193
|
}
|
127063
127194
|
}
|
127064
|
-
logger.log(`Removing custom domain '${
|
127195
|
+
logger.log(`Removing custom domain '${domain2}' from bucket '${bucket}'...`);
|
127065
127196
|
await removeCustomDomainFromBucket(
|
127066
127197
|
config,
|
127067
127198
|
accountId,
|
127068
127199
|
bucket,
|
127069
|
-
|
127200
|
+
domain2,
|
127070
127201
|
jurisdiction
|
127071
127202
|
);
|
127072
|
-
logger.log(`Custom domain '${
|
127203
|
+
logger.log(`Custom domain '${domain2}' removed successfully.`);
|
127073
127204
|
}
|
127074
127205
|
});
|
127075
127206
|
r2BucketDomainUpdateCommand = createCommand({
|
@@ -127104,20 +127235,20 @@ var init_domain = __esm({
|
|
127104
127235
|
},
|
127105
127236
|
async handler(args, { config }) {
|
127106
127237
|
const accountId = await requireAuth(config);
|
127107
|
-
const { bucket, domain:
|
127108
|
-
logger.log(`Updating custom domain '${
|
127238
|
+
const { bucket, domain: domain2, minTls, jurisdiction } = args;
|
127239
|
+
logger.log(`Updating custom domain '${domain2}' for bucket '${bucket}'...`);
|
127109
127240
|
await configureCustomDomainSettings(
|
127110
127241
|
config,
|
127111
127242
|
accountId,
|
127112
127243
|
bucket,
|
127113
|
-
|
127244
|
+
domain2,
|
127114
127245
|
{
|
127115
|
-
domain:
|
127246
|
+
domain: domain2,
|
127116
127247
|
minTLS: minTls
|
127117
127248
|
},
|
127118
127249
|
jurisdiction
|
127119
127250
|
);
|
127120
|
-
logger.log(`\u2728 Custom domain '${
|
127251
|
+
logger.log(`\u2728 Custom domain '${domain2}' updated successfully.`);
|
127121
127252
|
}
|
127122
127253
|
});
|
127123
127254
|
}
|
@@ -128097,7 +128228,7 @@ var init_object = __esm({
|
|
128097
128228
|
init_logger();
|
128098
128229
|
init_user2();
|
128099
128230
|
init_is_local();
|
128100
|
-
|
128231
|
+
init_constants17();
|
128101
128232
|
init_helpers2();
|
128102
128233
|
r2ObjectNamespace = createNamespace({
|
128103
128234
|
metadata: {
|
@@ -132268,7 +132399,7 @@ var init_debug_build2 = __esm({
|
|
132268
132399
|
|
132269
132400
|
// ../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/constants.js
|
132270
132401
|
var DEFAULT_ENVIRONMENT;
|
132271
|
-
var
|
132402
|
+
var init_constants18 = __esm({
|
132272
132403
|
"../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/constants.js"() {
|
132273
132404
|
init_import_meta_url();
|
132274
132405
|
DEFAULT_ENVIRONMENT = "production";
|
@@ -132971,7 +133102,7 @@ var init_hub = __esm({
|
|
132971
133102
|
"../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/hub.js"() {
|
132972
133103
|
init_import_meta_url();
|
132973
133104
|
init_esm6();
|
132974
|
-
|
133105
|
+
init_constants18();
|
132975
133106
|
init_debug_build2();
|
132976
133107
|
init_scope();
|
132977
133108
|
init_session();
|
@@ -133724,7 +133855,7 @@ var init_dynamicSamplingContext = __esm({
|
|
133724
133855
|
"../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js"() {
|
133725
133856
|
init_import_meta_url();
|
133726
133857
|
init_esm6();
|
133727
|
-
|
133858
|
+
init_constants18();
|
133728
133859
|
__name(getDynamicSamplingContextFromClient, "getDynamicSamplingContextFromClient");
|
133729
133860
|
}
|
133730
133861
|
});
|
@@ -134179,7 +134310,7 @@ var init_prepareEvent = __esm({
|
|
134179
134310
|
"../../node_modules/.pnpm/@sentry+core@7.87.0/node_modules/@sentry/core/esm/utils/prepareEvent.js"() {
|
134180
134311
|
init_import_meta_url();
|
134181
134312
|
init_esm6();
|
134182
|
-
|
134313
|
+
init_constants18();
|
134183
134314
|
init_eventProcessors();
|
134184
134315
|
init_scope();
|
134185
134316
|
__name(prepareEvent, "prepareEvent");
|
@@ -138419,7 +138550,7 @@ var init_nodeVersion = __esm({
|
|
138419
138550
|
|
138420
138551
|
// ../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/async/domain.js
|
138421
138552
|
function getActiveDomain() {
|
138422
|
-
return
|
138553
|
+
return domain.active;
|
138423
138554
|
}
|
138424
138555
|
function getCurrentHub2() {
|
138425
138556
|
const activeDomain = getActiveDomain();
|
@@ -138439,7 +138570,7 @@ function runWithAsyncContext2(callback, options) {
|
|
138439
138570
|
if (activeDomain && _optionalChain([options, "optionalAccess", (_4) => _4.reuseExisting])) {
|
138440
138571
|
return callback();
|
138441
138572
|
}
|
138442
|
-
const local =
|
138573
|
+
const local = domain.create();
|
138443
138574
|
const parentHub = activeDomain ? getHubFromCarrier(activeDomain) : void 0;
|
138444
138575
|
const newHub = createNewHub(parentHub);
|
138445
138576
|
setHubOnCarrier(local, newHub);
|
@@ -138450,12 +138581,12 @@ function runWithAsyncContext2(callback, options) {
|
|
138450
138581
|
function setDomainAsyncContextStrategy() {
|
138451
138582
|
setAsyncContextStrategy({ getCurrentHub: getCurrentHub2, runWithAsyncContext: runWithAsyncContext2 });
|
138452
138583
|
}
|
138453
|
-
var
|
138584
|
+
var domain;
|
138454
138585
|
var init_domain2 = __esm({
|
138455
138586
|
"../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/async/domain.js"() {
|
138456
138587
|
init_import_meta_url();
|
138457
138588
|
init_esm6();
|
138458
|
-
|
138589
|
+
domain = __toESM(require("domain"));
|
138459
138590
|
init_esm7();
|
138460
138591
|
__name(getActiveDomain, "getActiveDomain");
|
138461
138592
|
__name(getCurrentHub2, "getCurrentHub");
|
@@ -139462,7 +139593,7 @@ async function getDarwinInfo() {
|
|
139462
139593
|
};
|
139463
139594
|
try {
|
139464
139595
|
const output = await new Promise((resolve24, reject) => {
|
139465
|
-
(0,
|
139596
|
+
(0, import_child_process7.execFile)("/usr/bin/sw_vers", (error2, stdout2) => {
|
139466
139597
|
if (error2) {
|
139467
139598
|
reject(error2);
|
139468
139599
|
return;
|
@@ -139556,12 +139687,12 @@ function getCloudResourceContext() {
|
|
139556
139687
|
return void 0;
|
139557
139688
|
}
|
139558
139689
|
}
|
139559
|
-
var
|
139690
|
+
var import_child_process7, import_fs23, os8, import_path22, import_util16, readFileAsync, readDirAsync, Context, PLATFORM_NAMES, LINUX_DISTROS, LINUX_VERSIONS;
|
139560
139691
|
var init_context = __esm({
|
139561
139692
|
"../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/integrations/context.js"() {
|
139562
139693
|
init_import_meta_url();
|
139563
139694
|
init_esm6();
|
139564
|
-
|
139695
|
+
import_child_process7 = require("child_process");
|
139565
139696
|
import_fs23 = require("fs");
|
139566
139697
|
os8 = __toESM(require("os"));
|
139567
139698
|
import_path22 = require("path");
|
@@ -140987,6 +141118,9 @@ var init_triggers = __esm({
|
|
140987
141118
|
hidden: true
|
140988
141119
|
}
|
140989
141120
|
},
|
141121
|
+
behaviour: {
|
141122
|
+
warnIfMultipleEnvsConfiguredButNoneSpecified: true
|
141123
|
+
},
|
140990
141124
|
async handler(args, { config }) {
|
140991
141125
|
const assetsOptions = getAssetsOptions({ assets: void 0 }, config);
|
140992
141126
|
sendMetricsEvent(
|
@@ -142190,7 +142324,7 @@ var init_logPossibleBugMessage = __esm({
|
|
142190
142324
|
init_import_meta_url();
|
142191
142325
|
init_logger();
|
142192
142326
|
init_update_check();
|
142193
|
-
|
142327
|
+
init_constants5();
|
142194
142328
|
__name(logPossibleBugMessage, "logPossibleBugMessage");
|
142195
142329
|
}
|
142196
142330
|
});
|
@@ -143881,7 +144015,8 @@ var init_deploy6 = __esm({
|
|
143881
144015
|
status: "stable"
|
143882
144016
|
},
|
143883
144017
|
behaviour: {
|
143884
|
-
useConfigRedirectIfAvailable: true
|
144018
|
+
useConfigRedirectIfAvailable: true,
|
144019
|
+
warnIfMultipleEnvsConfiguredButNoneSpecified: true
|
143885
144020
|
},
|
143886
144021
|
args: {
|
143887
144022
|
name: {
|
@@ -144807,7 +144942,8 @@ var init_bulk = __esm({
|
|
144807
144942
|
status: "stable"
|
144808
144943
|
},
|
144809
144944
|
behaviour: {
|
144810
|
-
printConfigWarnings: false
|
144945
|
+
printConfigWarnings: false,
|
144946
|
+
warnIfMultipleEnvsConfiguredButNoneSpecified: true
|
144811
144947
|
},
|
144812
144948
|
args: {
|
144813
144949
|
file: {
|
@@ -144905,7 +145041,8 @@ var init_delete8 = __esm({
|
|
144905
145041
|
status: "stable"
|
144906
145042
|
},
|
144907
145043
|
behaviour: {
|
144908
|
-
printConfigWarnings: false
|
145044
|
+
printConfigWarnings: false,
|
145045
|
+
warnIfMultipleEnvsConfiguredButNoneSpecified: true
|
144909
145046
|
},
|
144910
145047
|
args: {
|
144911
145048
|
key: {
|
@@ -145110,7 +145247,8 @@ var init_put = __esm({
|
|
145110
145247
|
status: "stable"
|
145111
145248
|
},
|
145112
145249
|
behaviour: {
|
145113
|
-
printConfigWarnings: false
|
145250
|
+
printConfigWarnings: false,
|
145251
|
+
warnIfMultipleEnvsConfiguredButNoneSpecified: true
|
145114
145252
|
},
|
145115
145253
|
args: {
|
145116
145254
|
key: {
|
@@ -145806,7 +145944,8 @@ var init_upload2 = __esm({
|
|
145806
145944
|
MULTIWORKER: false,
|
145807
145945
|
RESOURCES_PROVISION: args.experimentalProvision ?? false,
|
145808
145946
|
MIXED_MODE: false
|
145809
|
-
}), "overrideExperimentalFlags")
|
145947
|
+
}), "overrideExperimentalFlags"),
|
145948
|
+
warnIfMultipleEnvsConfiguredButNoneSpecified: true
|
145810
145949
|
},
|
145811
145950
|
handler: /* @__PURE__ */ __name(async function versionsUploadHandler(args, { config }) {
|
145812
145951
|
const entry = await getEntry(args, config, "versions upload");
|
@@ -146253,7 +146392,7 @@ var init_describe = __esm({
|
|
146253
146392
|
|
146254
146393
|
// ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constants.js
|
146255
146394
|
var daysInYear, maxTime, minTime, millisecondsInMinute, minutesInYear, minutesInMonth, minutesInDay, secondsInHour, secondsInDay, secondsInWeek, secondsInYear, secondsInMonth, secondsInQuarter, constructFromSymbol;
|
146256
|
-
var
|
146395
|
+
var init_constants19 = __esm({
|
146257
146396
|
"../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constants.js"() {
|
146258
146397
|
init_import_meta_url();
|
146259
146398
|
daysInYear = 365.2425;
|
@@ -146284,7 +146423,7 @@ function constructFrom(date, value) {
|
|
146284
146423
|
var init_constructFrom = __esm({
|
146285
146424
|
"../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constructFrom.js"() {
|
146286
146425
|
init_import_meta_url();
|
146287
|
-
|
146426
|
+
init_constants19();
|
146288
146427
|
__name(constructFrom, "constructFrom");
|
146289
146428
|
}
|
146290
146429
|
});
|
@@ -147669,7 +147808,7 @@ var init_formatDistanceStrict = __esm({
|
|
147669
147808
|
init_getTimezoneOffsetInMilliseconds();
|
147670
147809
|
init_normalizeDates();
|
147671
147810
|
init_compareAsc();
|
147672
|
-
|
147811
|
+
init_constants19();
|
147673
147812
|
__name(formatDistanceStrict, "formatDistanceStrict");
|
147674
147813
|
}
|
147675
147814
|
});
|
@@ -151060,7 +151199,7 @@ var init_src = __esm({
|
|
151060
151199
|
init_user2();
|
151061
151200
|
init_commands8();
|
151062
151201
|
init_whoami();
|
151063
|
-
|
151202
|
+
init_constants5();
|
151064
151203
|
init_log_file();
|
151065
151204
|
init_logPossibleBugMessage();
|
151066
151205
|
init_create7();
|
@@ -151458,19 +151597,19 @@ async function publishCustomDomains(complianceConfig, workerUrl, accountId, doma
|
|
151458
151597
|
}
|
151459
151598
|
);
|
151460
151599
|
const updatesRequired = changeset.updated.filter(
|
151461
|
-
(
|
151600
|
+
(domain2) => domain2.modified
|
151462
151601
|
);
|
151463
151602
|
if (updatesRequired.length > 0) {
|
151464
151603
|
const existing = await Promise.all(
|
151465
151604
|
updatesRequired.map(
|
151466
|
-
(
|
151605
|
+
(domain2) => fetchResult(
|
151467
151606
|
complianceConfig,
|
151468
|
-
`/accounts/${accountId}/workers/domains/records/${
|
151607
|
+
`/accounts/${accountId}/workers/domains/records/${domain2.id}`
|
151469
151608
|
)
|
151470
151609
|
)
|
151471
151610
|
);
|
151472
151611
|
const existingRendered = existing.map(
|
151473
|
-
(
|
151612
|
+
(domain2) => ` \u2022 ${domain2.hostname} (used as a domain for "${domain2.service}")`
|
151474
151613
|
).join("\n");
|
151475
151614
|
const message = `Custom Domains already exist for these domains:
|
151476
151615
|
${existingRendered}
|
@@ -151481,7 +151620,7 @@ Update them to point to this script instead?`;
|
|
151481
151620
|
options.override_existing_origin = true;
|
151482
151621
|
}
|
151483
151622
|
if (changeset.conflicting.length > 0) {
|
151484
|
-
const conflicitingRendered = changeset.conflicting.map((
|
151623
|
+
const conflicitingRendered = changeset.conflicting.map((domain2) => ` \u2022 ${domain2.hostname}`).join("\n");
|
151485
151624
|
const message = `You already have DNS records that conflict for these Custom Domains:
|
151486
151625
|
${conflicitingRendered}
|
151487
151626
|
Update them to point to this script instead?`;
|
@@ -151498,7 +151637,7 @@ Update them to point to this script instead?`;
|
|
151498
151637
|
"Content-Type": "application/json"
|
151499
151638
|
}
|
151500
151639
|
});
|
151501
|
-
return domains.map((
|
151640
|
+
return domains.map((domain2) => renderRoute(domain2));
|
151502
151641
|
}
|
151503
151642
|
async function deploy(props) {
|
151504
151643
|
const { config, accountId, name: name2 } = props;
|
@@ -152984,7 +153123,7 @@ async function resolveDevConfig(config, input) {
|
|
152984
153123
|
httpsKeyPath: input.dev?.server?.httpsKeyPath,
|
152985
153124
|
httpsCertPath: input.dev?.server?.httpsCertPath
|
152986
153125
|
},
|
152987
|
-
inspector: {
|
153126
|
+
inspector: input.dev?.inspector === false ? false : {
|
152988
153127
|
port: input.dev?.inspector?.port ?? config.dev.inspector_port ?? await getInspectorPort()
|
152989
153128
|
},
|
152990
153129
|
origin: {
|
@@ -153001,7 +153140,8 @@ async function resolveDevConfig(config, input) {
|
|
153001
153140
|
imagesLocalMode: input.dev?.imagesLocalMode ?? false,
|
153002
153141
|
experimentalMixedMode: input.dev?.experimentalMixedMode ?? getFlag("MIXED_MODE"),
|
153003
153142
|
enableContainers: input.dev?.enableContainers ?? config.dev.enable_containers,
|
153004
|
-
dockerPath: input.dev?.dockerPath ?? getDockerPath()
|
153143
|
+
dockerPath: input.dev?.dockerPath ?? getDockerPath(),
|
153144
|
+
containerEngine: input.dev?.containerEngine ?? getDockerHost()
|
153005
153145
|
};
|
153006
153146
|
}
|
153007
153147
|
async function resolveBindings(config, input) {
|
@@ -153206,12 +153346,14 @@ If you are trying to develop Pages and Workers together, please use \`wrangler p
|
|
153206
153346
|
}
|
153207
153347
|
function resolveContainerConfig(config) {
|
153208
153348
|
const containers2 = {};
|
153349
|
+
if (!config.dev.enable_containers) {
|
153350
|
+
return containers2;
|
153351
|
+
}
|
153209
153352
|
for (const container of config.containers ?? []) {
|
153210
153353
|
containers2[container.class_name] = {
|
153211
153354
|
image: container.image ?? container.configuration.image,
|
153212
153355
|
maxInstances: container.max_instances,
|
153213
153356
|
imageBuildContext: container.image_build_context,
|
153214
|
-
exposedPorts: container.dev_exposed_ports,
|
153215
153357
|
name: container.name
|
153216
153358
|
};
|
153217
153359
|
}
|
@@ -153236,7 +153378,7 @@ var init_ConfigController = __esm({
|
|
153236
153378
|
init_logger();
|
153237
153379
|
init_helpers8();
|
153238
153380
|
init_user2();
|
153239
|
-
|
153381
|
+
init_constants5();
|
153240
153382
|
init_getDevCompatibilityDate();
|
153241
153383
|
init_getRules();
|
153242
153384
|
init_getScriptName();
|
@@ -172034,7 +172176,7 @@ var init_ProxyController = __esm({
|
|
172034
172176
|
return;
|
172035
172177
|
}
|
172036
172178
|
(0, import_node_assert25.default)(this.latestConfig !== void 0);
|
172037
|
-
const cert = this.latestConfig.dev?.server?.secure || this.latestConfig.dev?.inspector?.secure ? getHttpsOptions(
|
172179
|
+
const cert = this.latestConfig.dev?.server?.secure || this.latestConfig.dev.inspector !== false && this.latestConfig.dev?.inspector?.secure ? getHttpsOptions(
|
172038
172180
|
this.latestConfig.dev.server?.httpsKeyPath,
|
172039
172181
|
this.latestConfig.dev.server?.httpsCertPath
|
172040
172182
|
) : void 0;
|
@@ -172073,40 +172215,6 @@ var init_ProxyController = __esm({
|
|
172073
172215
|
// no need to use file-system, so don't
|
172074
172216
|
cache: false,
|
172075
172217
|
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
172218
|
}
|
172111
172219
|
],
|
172112
172220
|
verbose: logger.loggerLevel === "debug",
|
@@ -172120,6 +172228,42 @@ var init_ProxyController = __esm({
|
|
172120
172228
|
handleRuntimeStdio,
|
172121
172229
|
liveReload: false
|
172122
172230
|
};
|
172231
|
+
if (this.latestConfig.dev.inspector !== false) {
|
172232
|
+
proxyWorkerOptions.workers.push({
|
172233
|
+
name: "InspectorProxyWorker",
|
172234
|
+
compatibilityDate: "2023-12-18",
|
172235
|
+
compatibilityFlags: [
|
172236
|
+
"nodejs_compat",
|
172237
|
+
"increase_websocket_message_size"
|
172238
|
+
],
|
172239
|
+
modulesRoot: import_node_path61.default.dirname(InspectorProxyWorker_default),
|
172240
|
+
modules: [{ type: "ESModule", path: InspectorProxyWorker_default }],
|
172241
|
+
durableObjects: {
|
172242
|
+
DURABLE_OBJECT: {
|
172243
|
+
className: "InspectorProxyWorker",
|
172244
|
+
unsafePreventEviction: true
|
172245
|
+
}
|
172246
|
+
},
|
172247
|
+
serviceBindings: {
|
172248
|
+
PROXY_CONTROLLER: /* @__PURE__ */ __name(async (req) => {
|
172249
|
+
const body = await req.json();
|
172250
|
+
return this.onInspectorProxyWorkerRequest(body);
|
172251
|
+
}, "PROXY_CONTROLLER")
|
172252
|
+
},
|
172253
|
+
bindings: {
|
172254
|
+
PROXY_CONTROLLER_AUTH_SECRET: this.secret
|
172255
|
+
},
|
172256
|
+
unsafeDirectSockets: [
|
172257
|
+
{
|
172258
|
+
host: this.latestConfig.dev?.inspector?.hostname,
|
172259
|
+
port: this.latestConfig.dev?.inspector?.port ?? 0
|
172260
|
+
}
|
172261
|
+
],
|
172262
|
+
// no need to use file-system, so don't
|
172263
|
+
cache: false,
|
172264
|
+
unsafeEphemeralDurableObjects: true
|
172265
|
+
});
|
172266
|
+
}
|
172123
172267
|
const proxyWorkerOptionsChanged = didMiniflareOptionsChange(
|
172124
172268
|
this.proxyWorkerOptions,
|
172125
172269
|
proxyWorkerOptions
|
@@ -172138,13 +172282,17 @@ var init_ProxyController = __esm({
|
|
172138
172282
|
if (willInstantiateMiniflareInstance) {
|
172139
172283
|
void Promise.all([
|
172140
172284
|
proxyWorker.ready,
|
172141
|
-
proxyWorker.unsafeGetDirectURL("InspectorProxyWorker")
|
172285
|
+
this.latestConfig.dev.inspector === false ? Promise.resolve(void 0) : proxyWorker.unsafeGetDirectURL("InspectorProxyWorker")
|
172142
172286
|
]).then(([url4, inspectorUrl]) => {
|
172287
|
+
if (!inspectorUrl) {
|
172288
|
+
return [url4, void 0];
|
172289
|
+
}
|
172143
172290
|
return this.reconnectInspectorProxyWorker().then(() => [
|
172144
172291
|
url4,
|
172145
172292
|
inspectorUrl
|
172146
172293
|
]);
|
172147
172294
|
}).then(([url4, inspectorUrl]) => {
|
172295
|
+
(0, import_node_assert25.default)(url4);
|
172148
172296
|
this.emitReadyEvent(proxyWorker, url4, inspectorUrl);
|
172149
172297
|
}).catch((error2) => {
|
172150
172298
|
if (this._torndown) {
|
@@ -172161,6 +172309,10 @@ var init_ProxyController = __esm({
|
|
172161
172309
|
if (this._torndown) {
|
172162
172310
|
return;
|
172163
172311
|
}
|
172312
|
+
(0, import_node_assert25.default)(
|
172313
|
+
this.latestConfig?.dev.inspector !== false,
|
172314
|
+
"Trying to reconnect with inspector proxy worker when inspector is disabled"
|
172315
|
+
);
|
172164
172316
|
const existingWebSocket = await this.inspectorProxyWorkerWebSocket?.promise;
|
172165
172317
|
if (existingWebSocket?.readyState === wrapper_default.OPEN) {
|
172166
172318
|
return existingWebSocket;
|
@@ -172201,7 +172353,9 @@ var init_ProxyController = __esm({
|
|
172201
172353
|
if (this._torndown) {
|
172202
172354
|
return;
|
172203
172355
|
}
|
172204
|
-
|
172356
|
+
if (this.latestConfig?.dev.inspector !== false) {
|
172357
|
+
void this.reconnectInspectorProxyWorker();
|
172358
|
+
}
|
172205
172359
|
});
|
172206
172360
|
await import_node_events4.default.once(webSocket, "open");
|
172207
172361
|
this.inspectorProxyWorkerWebSocket?.resolve(webSocket);
|
@@ -172245,6 +172399,10 @@ var init_ProxyController = __esm({
|
|
172245
172399
|
if (this._torndown) {
|
172246
172400
|
return;
|
172247
172401
|
}
|
172402
|
+
(0, import_node_assert25.default)(
|
172403
|
+
this.latestConfig?.dev.inspector !== false,
|
172404
|
+
"Trying to send message to inspector proxy worker when inspector is disabled"
|
172405
|
+
);
|
172248
172406
|
try {
|
172249
172407
|
const websocket = await this.reconnectInspectorProxyWorker();
|
172250
172408
|
(0, import_node_assert25.default)(websocket);
|
@@ -172280,7 +172438,9 @@ var init_ProxyController = __esm({
|
|
172280
172438
|
onReloadStart(data) {
|
172281
172439
|
this.latestConfig = data.config;
|
172282
172440
|
void this.sendMessageToProxyWorker({ type: "pause" });
|
172283
|
-
|
172441
|
+
if (this.latestConfig.dev.inspector !== false) {
|
172442
|
+
void this.sendMessageToInspectorProxyWorker({ type: "reloadStart" });
|
172443
|
+
}
|
172284
172444
|
}
|
172285
172445
|
onReloadComplete(data) {
|
172286
172446
|
this.latestConfig = data.config;
|
@@ -172289,10 +172449,12 @@ var init_ProxyController = __esm({
|
|
172289
172449
|
type: "play",
|
172290
172450
|
proxyData: data.proxyData
|
172291
172451
|
});
|
172292
|
-
|
172293
|
-
|
172294
|
-
|
172295
|
-
|
172452
|
+
if (this.latestConfig.dev.inspector !== false) {
|
172453
|
+
void this.sendMessageToInspectorProxyWorker({
|
172454
|
+
type: "reloadComplete",
|
172455
|
+
proxyData: data.proxyData
|
172456
|
+
});
|
172457
|
+
}
|
172296
172458
|
}
|
172297
172459
|
onProxyWorkerMessage(message) {
|
172298
172460
|
switch (message.type) {
|
@@ -172310,6 +172472,10 @@ var init_ProxyController = __esm({
|
|
172310
172472
|
}
|
172311
172473
|
}
|
172312
172474
|
onInspectorProxyWorkerMessage(message) {
|
172475
|
+
(0, import_node_assert25.default)(
|
172476
|
+
this.latestConfig?.dev.inspector !== false,
|
172477
|
+
"Trying to handle inspector message when inspector is disabled"
|
172478
|
+
);
|
172313
172479
|
switch (message.method) {
|
172314
172480
|
case "Runtime.consoleAPICalled": {
|
172315
172481
|
if (this._torndown) {
|
@@ -172332,6 +172498,10 @@ var init_ProxyController = __esm({
|
|
172332
172498
|
}
|
172333
172499
|
}
|
172334
172500
|
async onInspectorProxyWorkerRequest(message) {
|
172501
|
+
(0, import_node_assert25.default)(
|
172502
|
+
this.latestConfig?.dev.inspector !== false,
|
172503
|
+
"Trying to handle inspector request when inspector is disabled"
|
172504
|
+
);
|
172335
172505
|
switch (message.type) {
|
172336
172506
|
case "runtime-websocket-error":
|
172337
172507
|
logger.debug(
|
@@ -173294,6 +173464,7 @@ var init_startDevWorker = __esm({
|
|
173294
173464
|
// src/api/mixedMode/index.ts
|
173295
173465
|
var mixedMode_exports = {};
|
173296
173466
|
__export(mixedMode_exports, {
|
173467
|
+
maybeStartOrUpdateMixedModeSession: () => maybeStartOrUpdateMixedModeSession,
|
173297
173468
|
pickRemoteBindings: () => pickRemoteBindings,
|
173298
173469
|
startMixedModeSession: () => startMixedModeSession
|
173299
173470
|
});
|
@@ -173317,12 +173488,7 @@ async function startMixedModeSession(bindings, options) {
|
|
173317
173488
|
server: {
|
173318
173489
|
port: await getPorts()
|
173319
173490
|
},
|
173320
|
-
|
173321
|
-
// default one, we should ideally add an option to actually disable
|
173322
|
-
// the inspector
|
173323
|
-
inspector: {
|
173324
|
-
port: await getPorts()
|
173325
|
-
},
|
173491
|
+
inspector: false,
|
173326
173492
|
logLevel: "error"
|
173327
173493
|
},
|
173328
173494
|
bindings: rawBindings
|
@@ -173354,16 +173520,63 @@ function pickRemoteBindings(bindings) {
|
|
173354
173520
|
})
|
173355
173521
|
);
|
173356
173522
|
}
|
173357
|
-
|
173523
|
+
async function maybeStartOrUpdateMixedModeSession(configPathOrWorkerConfig, preExistingMixedModeSessionData) {
|
173524
|
+
if (typeof configPathOrWorkerConfig === "string") {
|
173525
|
+
const configPath = configPathOrWorkerConfig;
|
173526
|
+
const config = readConfig({ config: configPath });
|
173527
|
+
(0, import_node_assert28.default)(config.name);
|
173528
|
+
configPathOrWorkerConfig = {
|
173529
|
+
name: config.name,
|
173530
|
+
bindings: convertConfigBindingsToStartWorkerBindings(config) ?? {}
|
173531
|
+
};
|
173532
|
+
}
|
173533
|
+
const workerConfigs = configPathOrWorkerConfig;
|
173534
|
+
const remoteBindings = pickRemoteBindings(workerConfigs.bindings);
|
173535
|
+
let mixedModeSession = preExistingMixedModeSessionData?.session;
|
173536
|
+
const remoteBindingsAreSameAsBefore = deepStrictEqual(
|
173537
|
+
remoteBindings,
|
173538
|
+
preExistingMixedModeSessionData?.remoteBindings
|
173539
|
+
);
|
173540
|
+
if (!remoteBindingsAreSameAsBefore) {
|
173541
|
+
if (!mixedModeSession) {
|
173542
|
+
if (Object.keys(remoteBindings).length > 0) {
|
173543
|
+
mixedModeSession = await startMixedModeSession(remoteBindings);
|
173544
|
+
}
|
173545
|
+
} else {
|
173546
|
+
await mixedModeSession.updateBindings(remoteBindings);
|
173547
|
+
}
|
173548
|
+
}
|
173549
|
+
await mixedModeSession?.ready;
|
173550
|
+
if (!mixedModeSession) {
|
173551
|
+
return null;
|
173552
|
+
}
|
173553
|
+
return {
|
173554
|
+
session: mixedModeSession,
|
173555
|
+
remoteBindings
|
173556
|
+
};
|
173557
|
+
}
|
173558
|
+
function deepStrictEqual(source, target) {
|
173559
|
+
try {
|
173560
|
+
import_node_assert28.default.deepStrictEqual(source, target);
|
173561
|
+
return true;
|
173562
|
+
} catch {
|
173563
|
+
return false;
|
173564
|
+
}
|
173565
|
+
}
|
173566
|
+
var import_node_assert28, import_node_path63;
|
173358
173567
|
var init_mixedMode = __esm({
|
173359
173568
|
"src/api/mixedMode/index.ts"() {
|
173360
173569
|
init_import_meta_url();
|
173570
|
+
import_node_assert28 = __toESM(require("assert"));
|
173361
173571
|
import_node_path63 = __toESM(require("path"));
|
173362
173572
|
init_get_port();
|
173573
|
+
init_config2();
|
173363
173574
|
init_paths();
|
173364
173575
|
init_startDevWorker();
|
173365
173576
|
__name(startMixedModeSession, "startMixedModeSession");
|
173366
173577
|
__name(pickRemoteBindings, "pickRemoteBindings");
|
173578
|
+
__name(maybeStartOrUpdateMixedModeSession, "maybeStartOrUpdateMixedModeSession");
|
173579
|
+
__name(deepStrictEqual, "deepStrictEqual");
|
173367
173580
|
}
|
173368
173581
|
});
|
173369
173582
|
|
@@ -173447,7 +173660,13 @@ async function convertToConfigBundle(event) {
|
|
173447
173660
|
initialPort: void 0,
|
173448
173661
|
initialIp: "127.0.0.1",
|
173449
173662
|
rules: [],
|
173450
|
-
|
173663
|
+
...event.config.dev.inspector === false ? {
|
173664
|
+
inspect: false,
|
173665
|
+
inspectorPort: void 0
|
173666
|
+
} : {
|
173667
|
+
inspect: true,
|
173668
|
+
inspectorPort: 0
|
173669
|
+
},
|
173451
173670
|
localPersistencePath: event.config.dev.persist,
|
173452
173671
|
liveReload: event.config.dev?.liveReload ?? false,
|
173453
173672
|
crons,
|
@@ -173457,7 +173676,6 @@ async function convertToConfigBundle(event) {
|
|
173457
173676
|
httpsKeyPath: event.config.dev?.server?.httpsKeyPath,
|
173458
173677
|
localUpstream: event.config.dev?.origin?.hostname,
|
173459
173678
|
upstreamProtocol: event.config.dev?.origin?.secure ? "https" : "http",
|
173460
|
-
inspect: true,
|
173461
173679
|
services: bindings.services,
|
173462
173680
|
serviceBindings: fetchers,
|
173463
173681
|
bindVectorizeToProd: event.config.dev?.bindVectorizeToProd ?? false,
|
@@ -173466,29 +173684,10 @@ async function convertToConfigBundle(event) {
|
|
173466
173684
|
tails: event.config.tailConsumers,
|
173467
173685
|
containers: event.config.containers ?? {},
|
173468
173686
|
enableContainers: event.config.dev.enableContainers ?? true,
|
173469
|
-
dockerPath: event.config.dev.dockerPath ?? "docker"
|
173687
|
+
dockerPath: event.config.dev.dockerPath ?? "docker",
|
173688
|
+
containerEngine: event.config.dev.containerEngine
|
173470
173689
|
};
|
173471
173690
|
}
|
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
173691
|
var import_node_crypto14, import_promises37, import_miniflare26, LocalRuntimeController;
|
173493
173692
|
var init_LocalRuntimeController = __esm({
|
173494
173693
|
"src/api/startDevWorker/LocalRuntimeController.ts"() {
|
@@ -173524,7 +173723,7 @@ var init_LocalRuntimeController = __esm({
|
|
173524
173723
|
// wrap updates in a mutex, so they're always applied in invocation order.
|
173525
173724
|
#mutex = new import_miniflare26.Mutex();
|
173526
173725
|
#mf;
|
173527
|
-
#
|
173726
|
+
#mixedModeSessionData = null;
|
173528
173727
|
onBundleStart(_4) {
|
173529
173728
|
}
|
173530
173729
|
async #onBundleComplete(data, id) {
|
@@ -173532,16 +173731,20 @@ var init_LocalRuntimeController = __esm({
|
|
173532
173731
|
const configBundle = await convertToConfigBundle(data);
|
173533
173732
|
const experimentalMixedMode = data.config.dev.experimentalMixedMode ?? false;
|
173534
173733
|
if (experimentalMixedMode && !data.config.dev?.remote) {
|
173535
|
-
|
173536
|
-
|
173537
|
-
|
173734
|
+
const { maybeStartOrUpdateMixedModeSession: maybeStartOrUpdateMixedModeSession2 } = await Promise.resolve().then(() => (init_mixedMode(), mixedMode_exports));
|
173735
|
+
this.#mixedModeSessionData = await maybeStartOrUpdateMixedModeSession2(
|
173736
|
+
{
|
173737
|
+
name: configBundle.name,
|
173738
|
+
bindings: convertCfWorkerInitBindingsToBindings(configBundle.bindings) ?? {}
|
173739
|
+
},
|
173740
|
+
this.#mixedModeSessionData ?? null
|
173538
173741
|
);
|
173539
173742
|
}
|
173540
173743
|
const { options, internalObjects, entrypointNames } = await buildMiniflareOptions(
|
173541
173744
|
this.#log,
|
173542
173745
|
configBundle,
|
173543
173746
|
this.#proxyToUserWorkerAuthenticationSecret,
|
173544
|
-
this.#
|
173747
|
+
this.#mixedModeSessionData?.session?.mixedModeConnectionString,
|
173545
173748
|
!!experimentalMixedMode
|
173546
173749
|
);
|
173547
173750
|
options.liveReload = false;
|
@@ -173553,7 +173756,7 @@ var init_LocalRuntimeController = __esm({
|
|
173553
173756
|
await this.#mf.setOptions(options);
|
173554
173757
|
}
|
173555
173758
|
const userWorkerUrl = await this.#mf.ready;
|
173556
|
-
const userWorkerInspectorUrl = await this.#mf.getInspectorURL();
|
173759
|
+
const userWorkerInspectorUrl = options.inspectorPort === void 0 ? void 0 : await this.#mf.getInspectorURL();
|
173557
173760
|
if (id !== this.#currentBundleId) {
|
173558
173761
|
return;
|
173559
173762
|
}
|
@@ -173573,12 +173776,14 @@ var init_LocalRuntimeController = __esm({
|
|
173573
173776
|
hostname: userWorkerUrl.hostname,
|
173574
173777
|
port: userWorkerUrl.port
|
173575
173778
|
},
|
173576
|
-
userWorkerInspectorUrl
|
173577
|
-
|
173578
|
-
|
173579
|
-
|
173580
|
-
|
173581
|
-
|
173779
|
+
...userWorkerInspectorUrl ? {
|
173780
|
+
userWorkerInspectorUrl: {
|
173781
|
+
protocol: userWorkerInspectorUrl.protocol,
|
173782
|
+
hostname: userWorkerInspectorUrl.hostname,
|
173783
|
+
port: userWorkerInspectorUrl.port,
|
173784
|
+
pathname: `/core:user:${getName2(data.config)}`
|
173785
|
+
}
|
173786
|
+
} : {},
|
173582
173787
|
userWorkerInnerUrlOverrides: {
|
173583
173788
|
protocol: data.config?.dev?.origin?.secure ? "https:" : "http:",
|
173584
173789
|
hostname: data.config?.dev?.origin?.hostname,
|
@@ -173626,11 +173831,11 @@ var init_LocalRuntimeController = __esm({
|
|
173626
173831
|
}
|
173627
173832
|
await this.#mf?.dispose();
|
173628
173833
|
this.#mf = void 0;
|
173629
|
-
if (this.#
|
173834
|
+
if (this.#mixedModeSessionData) {
|
173630
173835
|
logger.log(source_default.dim("\u2394 Shutting down remote connection..."));
|
173631
173836
|
}
|
173632
|
-
await this.#
|
173633
|
-
this.#
|
173837
|
+
await this.#mixedModeSessionData?.session?.dispose();
|
173838
|
+
this.#mixedModeSessionData = null;
|
173634
173839
|
logger.debug("LocalRuntimeController teardown complete");
|
173635
173840
|
}, "#teardown");
|
173636
173841
|
async teardown() {
|
@@ -173646,7 +173851,6 @@ var init_LocalRuntimeController = __esm({
|
|
173646
173851
|
this.emit("reloadComplete", data);
|
173647
173852
|
}
|
173648
173853
|
};
|
173649
|
-
__name(maybeStartOrUpdateMixedModeSession, "maybeStartOrUpdateMixedModeSession");
|
173650
173854
|
}
|
173651
173855
|
});
|
173652
173856
|
|
@@ -173673,11 +173877,11 @@ function ensureMatchingSql(options) {
|
|
173673
173877
|
}
|
173674
173878
|
return options;
|
173675
173879
|
}
|
173676
|
-
var
|
173880
|
+
var import_node_assert29, import_node_crypto15, import_miniflare27, MultiworkerRuntimeController;
|
173677
173881
|
var init_MultiworkerRuntimeController = __esm({
|
173678
173882
|
"src/api/startDevWorker/MultiworkerRuntimeController.ts"() {
|
173679
173883
|
init_import_meta_url();
|
173680
|
-
|
173884
|
+
import_node_assert29 = __toESM(require("assert"));
|
173681
173885
|
import_node_crypto15 = require("crypto");
|
173682
173886
|
init_source();
|
173683
173887
|
import_miniflare27 = require("miniflare");
|
@@ -173685,6 +173889,7 @@ var init_MultiworkerRuntimeController = __esm({
|
|
173685
173889
|
init_logger();
|
173686
173890
|
init_events();
|
173687
173891
|
init_LocalRuntimeController();
|
173892
|
+
init_utils();
|
173688
173893
|
__name(ensureMatchingSql, "ensureMatchingSql");
|
173689
173894
|
MultiworkerRuntimeController = class extends LocalRuntimeController {
|
173690
173895
|
constructor(numWorkers) {
|
@@ -173709,13 +173914,13 @@ var init_MultiworkerRuntimeController = __esm({
|
|
173709
173914
|
#mutex = new import_miniflare27.Mutex();
|
173710
173915
|
#mf;
|
173711
173916
|
#options = /* @__PURE__ */ new Map();
|
173712
|
-
#
|
173917
|
+
#mixedModeSessionsData = /* @__PURE__ */ new Map();
|
173713
173918
|
#canStartMiniflare() {
|
173714
173919
|
return [...this.#options.values()].some((o5) => o5.primary) && [...this.#options.values()].length === this.numWorkers;
|
173715
173920
|
}
|
173716
173921
|
#mergedMfOptions() {
|
173717
173922
|
const primary = [...this.#options.values()].find((o5) => o5.primary);
|
173718
|
-
(0,
|
173923
|
+
(0, import_node_assert29.default)(primary !== void 0);
|
173719
173924
|
const secondary = [...this.#options.values()].filter((o5) => !o5.primary);
|
173720
173925
|
return {
|
173721
173926
|
...primary.options,
|
@@ -173735,17 +173940,24 @@ var init_MultiworkerRuntimeController = __esm({
|
|
173735
173940
|
const configBundle = await convertToConfigBundle(data);
|
173736
173941
|
const experimentalMixedMode = data.config.dev.experimentalMixedMode;
|
173737
173942
|
if (experimentalMixedMode && !data.config.dev?.remote) {
|
173738
|
-
const
|
173739
|
-
|
173740
|
-
|
173943
|
+
const { maybeStartOrUpdateMixedModeSession: maybeStartOrUpdateMixedModeSession2 } = await Promise.resolve().then(() => (init_mixedMode(), mixedMode_exports));
|
173944
|
+
const mixedModeSession = await maybeStartOrUpdateMixedModeSession2(
|
173945
|
+
{
|
173946
|
+
name: configBundle.name,
|
173947
|
+
bindings: convertCfWorkerInitBindingsToBindings(configBundle.bindings) ?? {}
|
173948
|
+
},
|
173949
|
+
this.#mixedModeSessionsData.get(data.config.name) ?? null
|
173950
|
+
);
|
173951
|
+
this.#mixedModeSessionsData.set(
|
173952
|
+
data.config.name,
|
173953
|
+
mixedModeSession ?? null
|
173741
173954
|
);
|
173742
|
-
this.#mixedModeSessions.set(data.config.name, mixedModeSession);
|
173743
173955
|
}
|
173744
173956
|
const { options } = await buildMiniflareOptions(
|
173745
173957
|
this.#log,
|
173746
173958
|
await convertToConfigBundle(data),
|
173747
173959
|
this.#proxyToUserWorkerAuthenticationSecret,
|
173748
|
-
this.#
|
173960
|
+
this.#mixedModeSessionsData.get(data.config.name)?.session?.mixedModeConnectionString,
|
173749
173961
|
!!experimentalMixedMode
|
173750
173962
|
);
|
173751
173963
|
this.#options.set(data.config.name, {
|
@@ -173837,15 +174049,15 @@ var init_MultiworkerRuntimeController = __esm({
|
|
173837
174049
|
}
|
173838
174050
|
await this.#mf?.dispose();
|
173839
174051
|
this.#mf = void 0;
|
173840
|
-
if (this.#
|
174052
|
+
if (this.#mixedModeSessionsData.size > 0) {
|
173841
174053
|
logger.log(source_default.dim("\u2394 Shutting down remote connections..."));
|
173842
174054
|
}
|
173843
174055
|
await Promise.all(
|
173844
|
-
[...this.#
|
173845
|
-
(
|
174056
|
+
[...this.#mixedModeSessionsData.values()].map(
|
174057
|
+
(mixedModeSessionData) => mixedModeSessionData?.session?.dispose()
|
173846
174058
|
)
|
173847
174059
|
);
|
173848
|
-
this.#
|
174060
|
+
this.#mixedModeSessionsData.clear();
|
173849
174061
|
logger.debug("MultiworkerRuntimeController teardown complete");
|
173850
174062
|
}, "#teardown");
|
173851
174063
|
async teardown() {
|
@@ -174197,6 +174409,7 @@ function registerDevHotKeys(devEnv, args) {
|
|
174197
174409
|
label: "open devtools",
|
174198
174410
|
handler: /* @__PURE__ */ __name(async () => {
|
174199
174411
|
const { inspectorUrl } = await devEnv.proxy.ready.promise;
|
174412
|
+
(0, import_assert7.default)(inspectorUrl, "Error: no inspectorUrl available");
|
174200
174413
|
await openInspector(
|
174201
174414
|
parseInt(inspectorUrl.port),
|
174202
174415
|
devEnv.config.latestConfig?.name
|
@@ -174232,9 +174445,11 @@ function registerDevHotKeys(devEnv, args) {
|
|
174232
174445
|
]);
|
174233
174446
|
return unregisterHotKeys;
|
174234
174447
|
}
|
174448
|
+
var import_assert7;
|
174235
174449
|
var init_hotkeys = __esm({
|
174236
174450
|
"src/dev/hotkeys.ts"() {
|
174237
174451
|
init_import_meta_url();
|
174452
|
+
import_assert7 = __toESM(require("assert"));
|
174238
174453
|
init_cli_hotkeys();
|
174239
174454
|
init_logger();
|
174240
174455
|
init_open_in_browser();
|
@@ -174417,7 +174632,7 @@ var init_constructConfiguration = __esm({
|
|
174417
174632
|
|
174418
174633
|
// ../pages-shared/metadata-generator/constants.ts
|
174419
174634
|
var ANALYTICS_VERSION;
|
174420
|
-
var
|
174635
|
+
var init_constants20 = __esm({
|
174421
174636
|
"../pages-shared/metadata-generator/constants.ts"() {
|
174422
174637
|
init_import_meta_url();
|
174423
174638
|
ANALYTICS_VERSION = 1;
|
@@ -174461,7 +174676,7 @@ var init_createMetadataObject = __esm({
|
|
174461
174676
|
"../pages-shared/metadata-generator/createMetadataObject.ts"() {
|
174462
174677
|
init_import_meta_url();
|
174463
174678
|
init_constructConfiguration();
|
174464
|
-
|
174679
|
+
init_constants20();
|
174465
174680
|
noopLogger = {
|
174466
174681
|
debug: /* @__PURE__ */ __name((_message) => {
|
174467
174682
|
}, "debug"),
|
@@ -175499,7 +175714,7 @@ var init_compatibility_flags = __esm({
|
|
175499
175714
|
});
|
175500
175715
|
|
175501
175716
|
// ../workers-shared/asset-worker/src/constants.ts
|
175502
|
-
var
|
175717
|
+
var init_constants21 = __esm({
|
175503
175718
|
"../workers-shared/asset-worker/src/constants.ts"() {
|
175504
175719
|
init_import_meta_url();
|
175505
175720
|
}
|
@@ -175511,7 +175726,7 @@ var init_headers = __esm({
|
|
175511
175726
|
init_import_meta_url();
|
175512
175727
|
init_tracing2();
|
175513
175728
|
init_compatibility_flags();
|
175514
|
-
|
175729
|
+
init_constants21();
|
175515
175730
|
init_handler2();
|
175516
175731
|
init_rules_engine();
|
175517
175732
|
}
|
@@ -176494,11 +176709,11 @@ async function generateAssetsFetch(directory, log2) {
|
|
176494
176709
|
return await generateResponse(request4);
|
176495
176710
|
};
|
176496
176711
|
}
|
176497
|
-
var
|
176712
|
+
var import_node_assert30, import_node_fs35, import_node_path66, import_mime3, import_miniflare29, import_undici24, ProxyDispatcher, invalidAssetsFetch;
|
176498
176713
|
var init_assets2 = __esm({
|
176499
176714
|
"src/miniflare-cli/assets.ts"() {
|
176500
176715
|
init_import_meta_url();
|
176501
|
-
|
176716
|
+
import_node_assert30 = __toESM(require("assert"));
|
176502
176717
|
import_node_fs35 = require("fs");
|
176503
176718
|
import_node_path66 = require("path");
|
176504
176719
|
init_createMetadataObject();
|
@@ -176535,12 +176750,12 @@ var init_assets2 = __esm({
|
|
176535
176750
|
* by the `fetch()` function before calling `dispatcher.dispatch()`.
|
176536
176751
|
*/
|
176537
176752
|
static reinstateHostHeader(headers, host) {
|
176538
|
-
(0,
|
176539
|
-
(0,
|
176753
|
+
(0, import_node_assert30.default)(headers, "Expected all proxy requests to contain headers.");
|
176754
|
+
(0, import_node_assert30.default)(
|
176540
176755
|
!Array.isArray(headers),
|
176541
176756
|
"Expected proxy request headers to be a hash object"
|
176542
176757
|
);
|
176543
|
-
(0,
|
176758
|
+
(0, import_node_assert30.default)(
|
176544
176759
|
Object.keys(headers).every((h6) => h6.toLowerCase() !== "host"),
|
176545
176760
|
"Expected Host header to have been deleted."
|
176546
176761
|
);
|
@@ -176738,7 +176953,7 @@ async function startDev(args) {
|
|
176738
176953
|
unregisterHotKeys?.();
|
176739
176954
|
accountId = await requireAuth(config);
|
176740
176955
|
if (hotkeysDisplayed) {
|
176741
|
-
(0,
|
176956
|
+
(0, import_node_assert31.default)(devEnv !== void 0);
|
176742
176957
|
unregisterHotKeys = registerDevHotKeys(
|
176743
176958
|
Array.isArray(devEnv) ? devEnv[0] : devEnv,
|
176744
176959
|
args
|
@@ -176799,7 +177014,7 @@ async function startDev(args) {
|
|
176799
177014
|
});
|
176800
177015
|
if (!args.disableDevRegistry) {
|
176801
177016
|
teardownRegistryPromise = devRegistry2((registry) => {
|
176802
|
-
(0,
|
177017
|
+
(0, import_node_assert31.default)(devEnv !== void 0 && !Array.isArray(devEnv));
|
176803
177018
|
void updateDevEnvRegistry(devEnv, registry);
|
176804
177019
|
});
|
176805
177020
|
devEnv.runtimes.forEach((runtime) => {
|
@@ -176807,7 +177022,7 @@ async function startDev(args) {
|
|
176807
177022
|
"reloadComplete",
|
176808
177023
|
async (reloadEvent) => {
|
176809
177024
|
if (!reloadEvent.config.dev?.remote) {
|
176810
|
-
(0,
|
177025
|
+
(0, import_node_assert31.default)(devEnv !== void 0 && !Array.isArray(devEnv));
|
176811
177026
|
const { url: url4 } = await devEnv.proxy.ready.promise;
|
176812
177027
|
await maybeRegisterLocalWorker(
|
176813
177028
|
url4,
|
@@ -176838,7 +177053,7 @@ async function startDev(args) {
|
|
176838
177053
|
...Array.isArray(devEnv) ? devEnv.map((d6) => d6.teardown()) : [devEnv?.teardown()],
|
176839
177054
|
(async () => {
|
176840
177055
|
if (teardownRegistryPromise) {
|
176841
|
-
(0,
|
177056
|
+
(0, import_node_assert31.default)(devEnv === void 0 || !Array.isArray(devEnv));
|
176842
177057
|
const teardownRegistry = await teardownRegistryPromise;
|
176843
177058
|
await teardownRegistry(devEnv?.config.latestConfig?.name);
|
176844
177059
|
}
|
@@ -177066,11 +177281,11 @@ function getAssetChangeMessage(eventName, assetPath) {
|
|
177066
177281
|
}
|
177067
177282
|
return message;
|
177068
177283
|
}
|
177069
|
-
var
|
177284
|
+
var import_node_assert31, import_node_events6, import_node_path67, import_node_util3, import_env2, dev;
|
177070
177285
|
var init_dev2 = __esm({
|
177071
177286
|
"src/dev.ts"() {
|
177072
177287
|
init_import_meta_url();
|
177073
|
-
|
177288
|
+
import_node_assert31 = __toESM(require("assert"));
|
177074
177289
|
import_node_events6 = __toESM(require("events"));
|
177075
177290
|
import_node_path67 = __toESM(require("path"));
|
177076
177291
|
import_node_util3 = __toESM(require("util"));
|
@@ -177348,7 +177563,7 @@ var init_dev2 = __esm({
|
|
177348
177563
|
},
|
177349
177564
|
async handler(args) {
|
177350
177565
|
const devInstance = await startDev(args);
|
177351
|
-
(0,
|
177566
|
+
(0, import_node_assert31.default)(devInstance.devEnv !== void 0);
|
177352
177567
|
await import_node_events6.default.once(devInstance.devEnv, "teardown");
|
177353
177568
|
await Promise.all(devInstance.secondary.map((d6) => d6.teardown()));
|
177354
177569
|
if (devInstance.teardownRegistryPromise) {
|
@@ -177484,7 +177699,8 @@ unstable_dev()'s behaviour will likely change in future releases`
|
|
177484
177699
|
enableIpc: options?.experimental?.enableIpc,
|
177485
177700
|
nodeCompat: void 0,
|
177486
177701
|
enableContainers: options?.experimental?.enableContainers ?? false,
|
177487
|
-
dockerPath: options?.experimental?.dockerPath ?? getDockerPath()
|
177702
|
+
dockerPath: options?.experimental?.dockerPath ?? getDockerPath(),
|
177703
|
+
containerEngine: options?.experimental?.containerEngine ?? getDockerHost()
|
177488
177704
|
};
|
177489
177705
|
const devServer = await run(
|
177490
177706
|
{
|
@@ -177952,6 +178168,7 @@ var init_api3 = __esm({
|
|
177952
178168
|
// src/cli.ts
|
177953
178169
|
var cli_exports2 = {};
|
177954
178170
|
__export(cli_exports2, {
|
178171
|
+
experimental_maybeStartOrUpdateMixedModeSession: () => maybeStartOrUpdateMixedModeSession,
|
177955
178172
|
experimental_patchConfig: () => experimental_patchConfig,
|
177956
178173
|
experimental_pickRemoteBindings: () => pickRemoteBindings,
|
177957
178174
|
experimental_readRawConfig: () => experimental_readRawConfig,
|
@@ -178060,6 +178277,7 @@ var generateASSETSBinding2 = (
|
|
178060
178277
|
);
|
178061
178278
|
// Annotate the CommonJS export names for ESM import in node:
|
178062
178279
|
0 && (module.exports = {
|
178280
|
+
experimental_maybeStartOrUpdateMixedModeSession,
|
178063
178281
|
experimental_patchConfig,
|
178064
178282
|
experimental_pickRemoteBindings,
|
178065
178283
|
experimental_readRawConfig,
|