wrangler 4.42.2 → 4.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2787,7 +2787,7 @@ var require_util = __commonJS({
2787
2787
  "../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/core/util.js"(exports2, module3) {
2788
2788
  "use strict";
2789
2789
  init_import_meta_url();
2790
- var assert44 = require("assert");
2790
+ var assert45 = require("assert");
2791
2791
  var { kDestroyed, kBodyUsed, kListeners, kBody } = require_symbols();
2792
2792
  var { IncomingMessage } = require("http");
2793
2793
  var stream2 = require("stream");
@@ -2808,7 +2808,7 @@ var require_util = __commonJS({
2808
2808
  this[kBodyUsed] = false;
2809
2809
  }
2810
2810
  async *[Symbol.asyncIterator]() {
2811
- assert44(!this[kBodyUsed], "disturbed");
2811
+ assert45(!this[kBodyUsed], "disturbed");
2812
2812
  this[kBodyUsed] = true;
2813
2813
  yield* this[kBody];
2814
2814
  }
@@ -2820,7 +2820,7 @@ var require_util = __commonJS({
2820
2820
  if (isStream2(body)) {
2821
2821
  if (bodyLength(body) === 0) {
2822
2822
  body.on("data", function() {
2823
- assert44(false);
2823
+ assert45(false);
2824
2824
  });
2825
2825
  }
2826
2826
  if (typeof body.readableDidRead !== "boolean") {
@@ -2934,7 +2934,7 @@ var require_util = __commonJS({
2934
2934
  function getHostname(host) {
2935
2935
  if (host[0] === "[") {
2936
2936
  const idx2 = host.indexOf("]");
2937
- assert44(idx2 !== -1);
2937
+ assert45(idx2 !== -1);
2938
2938
  return host.substring(1, idx2);
2939
2939
  }
2940
2940
  const idx = host.indexOf(":");
@@ -2946,7 +2946,7 @@ var require_util = __commonJS({
2946
2946
  if (!host) {
2947
2947
  return null;
2948
2948
  }
2949
- assert44(typeof host === "string");
2949
+ assert45(typeof host === "string");
2950
2950
  const servername = getHostname(host);
2951
2951
  if (net2.isIP(servername)) {
2952
2952
  return "";
@@ -3253,7 +3253,7 @@ var require_util = __commonJS({
3253
3253
  function errorRequest(client, request4, err) {
3254
3254
  try {
3255
3255
  request4.onError(err);
3256
- assert44(request4.aborted);
3256
+ assert45(request4.aborted);
3257
3257
  } catch (err2) {
3258
3258
  client.emit("error", err2);
3259
3259
  }
@@ -3629,7 +3629,7 @@ var require_request = __commonJS({
3629
3629
  InvalidArgumentError,
3630
3630
  NotSupportedError
3631
3631
  } = require_errors();
3632
- var assert44 = require("assert");
3632
+ var assert45 = require("assert");
3633
3633
  var {
3634
3634
  isValidHTTPToken,
3635
3635
  isValidHeaderValue,
@@ -3807,8 +3807,8 @@ var require_request = __commonJS({
3807
3807
  }
3808
3808
  }
3809
3809
  onConnect(abort) {
3810
- assert44(!this.aborted);
3811
- assert44(!this.completed);
3810
+ assert45(!this.aborted);
3811
+ assert45(!this.completed);
3812
3812
  if (this.error) {
3813
3813
  abort(this.error);
3814
3814
  } else {
@@ -3820,8 +3820,8 @@ var require_request = __commonJS({
3820
3820
  return this[kHandler].onResponseStarted?.();
3821
3821
  }
3822
3822
  onHeaders(statusCode, headers, resume, statusText) {
3823
- assert44(!this.aborted);
3824
- assert44(!this.completed);
3823
+ assert45(!this.aborted);
3824
+ assert45(!this.completed);
3825
3825
  if (channels.headers.hasSubscribers) {
3826
3826
  channels.headers.publish({ request: this, response: { statusCode, headers, statusText } });
3827
3827
  }
@@ -3832,8 +3832,8 @@ var require_request = __commonJS({
3832
3832
  }
3833
3833
  }
3834
3834
  onData(chunk) {
3835
- assert44(!this.aborted);
3836
- assert44(!this.completed);
3835
+ assert45(!this.aborted);
3836
+ assert45(!this.completed);
3837
3837
  if (channels.bodyChunkReceived.hasSubscribers) {
3838
3838
  channels.bodyChunkReceived.publish({ request: this, chunk });
3839
3839
  }
@@ -3845,14 +3845,14 @@ var require_request = __commonJS({
3845
3845
  }
3846
3846
  }
3847
3847
  onUpgrade(statusCode, headers, socket) {
3848
- assert44(!this.aborted);
3849
- assert44(!this.completed);
3848
+ assert45(!this.aborted);
3849
+ assert45(!this.completed);
3850
3850
  return this[kHandler].onUpgrade(statusCode, headers, socket);
3851
3851
  }
3852
3852
  onComplete(trailers) {
3853
3853
  this.onFinally();
3854
- assert44(!this.aborted);
3855
- assert44(!this.completed);
3854
+ assert45(!this.aborted);
3855
+ assert45(!this.completed);
3856
3856
  this.completed = true;
3857
3857
  if (channels.trailers.hasSubscribers) {
3858
3858
  channels.trailers.publish({ request: this, trailers });
@@ -4322,7 +4322,7 @@ var require_connect = __commonJS({
4322
4322
  "use strict";
4323
4323
  init_import_meta_url();
4324
4324
  var net2 = require("net");
4325
- var assert44 = require("assert");
4325
+ var assert45 = require("assert");
4326
4326
  var util3 = require_util();
4327
4327
  var { InvalidArgumentError } = require_errors();
4328
4328
  var tls;
@@ -4371,7 +4371,7 @@ var require_connect = __commonJS({
4371
4371
  }
4372
4372
  servername = servername || options.servername || util3.getServerName(host) || null;
4373
4373
  const sessionKey = servername || hostname2;
4374
- assert44(sessionKey);
4374
+ assert45(sessionKey);
4375
4375
  const session = customSession || sessionCache.get(sessionKey) || null;
4376
4376
  port = port || 443;
4377
4377
  socket = tls.connect({
@@ -4391,7 +4391,7 @@ var require_connect = __commonJS({
4391
4391
  sessionCache.set(sessionKey, session2);
4392
4392
  });
4393
4393
  } else {
4394
- assert44(!httpSocket, "httpSocket can only be sent on TLS update");
4394
+ assert45(!httpSocket, "httpSocket can only be sent on TLS update");
4395
4395
  port = port || 80;
4396
4396
  socket = net2.connect({
4397
4397
  highWaterMark: 64 * 1024,
@@ -5341,14 +5341,14 @@ var require_data_url = __commonJS({
5341
5341
  "../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/web/fetch/data-url.js"(exports2, module3) {
5342
5342
  "use strict";
5343
5343
  init_import_meta_url();
5344
- var assert44 = require("assert");
5344
+ var assert45 = require("assert");
5345
5345
  var encoder = new TextEncoder();
5346
5346
  var HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/;
5347
5347
  var HTTP_WHITESPACE_REGEX = /[\u000A\u000D\u0009\u0020]/;
5348
5348
  var ASCII_WHITESPACE_REPLACE_REGEX = /[\u0009\u000A\u000C\u000D\u0020]/g;
5349
5349
  var HTTP_QUOTED_STRING_TOKENS = /^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;
5350
5350
  function dataURLProcessor(dataURL) {
5351
- assert44(dataURL.protocol === "data:");
5351
+ assert45(dataURL.protocol === "data:");
5352
5352
  let input = URLSerializer(dataURL, true);
5353
5353
  input = input.slice(5);
5354
5354
  const position = { position: 0 };
@@ -5559,7 +5559,7 @@ var require_data_url = __commonJS({
5559
5559
  function collectAnHTTPQuotedString(input, position, extractValue = false) {
5560
5560
  const positionStart = position.position;
5561
5561
  let value = "";
5562
- assert44(input[position.position] === '"');
5562
+ assert45(input[position.position] === '"');
5563
5563
  position.position++;
5564
5564
  while (true) {
5565
5565
  value += collectASequenceOfCodePoints(
@@ -5580,7 +5580,7 @@ var require_data_url = __commonJS({
5580
5580
  value += input[position.position];
5581
5581
  position.position++;
5582
5582
  } else {
5583
- assert44(quoteOrBackslash === '"');
5583
+ assert45(quoteOrBackslash === '"');
5584
5584
  break;
5585
5585
  }
5586
5586
  }
@@ -5591,7 +5591,7 @@ var require_data_url = __commonJS({
5591
5591
  }
5592
5592
  __name(collectAnHTTPQuotedString, "collectAnHTTPQuotedString");
5593
5593
  function serializeAMimeType(mimeType) {
5594
- assert44(mimeType !== "failure");
5594
+ assert45(mimeType !== "failure");
5595
5595
  const { parameters, essence } = mimeType;
5596
5596
  let serialization = essence;
5597
5597
  for (let [name2, value] of parameters.entries()) {
@@ -6195,7 +6195,7 @@ var require_util2 = __commonJS({
6195
6195
  var { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require_data_url();
6196
6196
  var { performance: performance2 } = require("perf_hooks");
6197
6197
  var { ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require_util();
6198
- var assert44 = require("assert");
6198
+ var assert45 = require("assert");
6199
6199
  var { isUint8Array } = require("util/types");
6200
6200
  var { webidl } = require_webidl();
6201
6201
  var supportedHashes = [];
@@ -6406,7 +6406,7 @@ var require_util2 = __commonJS({
6406
6406
  __name(clonePolicyContainer, "clonePolicyContainer");
6407
6407
  function determineRequestsReferrer(request4) {
6408
6408
  const policy = request4.referrerPolicy;
6409
- assert44(policy);
6409
+ assert45(policy);
6410
6410
  let referrerSource = null;
6411
6411
  if (request4.referrer === "client") {
6412
6412
  const globalOrigin = getGlobalOrigin();
@@ -6470,7 +6470,7 @@ var require_util2 = __commonJS({
6470
6470
  }
6471
6471
  __name(determineRequestsReferrer, "determineRequestsReferrer");
6472
6472
  function stripURLForReferrer(url4, originOnly = false) {
6473
- assert44(webidl.is.URL(url4));
6473
+ assert45(webidl.is.URL(url4));
6474
6474
  url4 = new URL(url4);
6475
6475
  if (urlIsLocal(url4)) {
6476
6476
  return "no-referrer";
@@ -6662,7 +6662,7 @@ var require_util2 = __commonJS({
6662
6662
  if (result === void 0) {
6663
6663
  throw new TypeError("Value is not JSON serializable");
6664
6664
  }
6665
- assert44(typeof result === "string");
6665
+ assert45(typeof result === "string");
6666
6666
  return result;
6667
6667
  }
6668
6668
  __name(serializeJavascriptValueToJSONString, "serializeJavascriptValueToJSONString");
@@ -6822,7 +6822,7 @@ var require_util2 = __commonJS({
6822
6822
  __name(readableStreamClose, "readableStreamClose");
6823
6823
  var invalidIsomorphicEncodeValueRegex = /[^\x00-\xFF]/;
6824
6824
  function isomorphicEncode(input) {
6825
- assert44(!invalidIsomorphicEncodeValueRegex.test(input));
6825
+ assert45(!invalidIsomorphicEncodeValueRegex.test(input));
6826
6826
  return input;
6827
6827
  }
6828
6828
  __name(isomorphicEncode, "isomorphicEncode");
@@ -6849,7 +6849,7 @@ var require_util2 = __commonJS({
6849
6849
  }
6850
6850
  __name(readAllBytes, "readAllBytes");
6851
6851
  function urlIsLocal(url4) {
6852
- assert44("protocol" in url4);
6852
+ assert45("protocol" in url4);
6853
6853
  const protocol = url4.protocol;
6854
6854
  return protocol === "about:" || protocol === "blob:" || protocol === "data:";
6855
6855
  }
@@ -6859,7 +6859,7 @@ var require_util2 = __commonJS({
6859
6859
  }
6860
6860
  __name(urlHasHttpsScheme, "urlHasHttpsScheme");
6861
6861
  function urlIsHttpHttpsScheme(url4) {
6862
- assert44("protocol" in url4);
6862
+ assert45("protocol" in url4);
6863
6863
  const protocol = url4.protocol;
6864
6864
  return protocol === "http:" || protocol === "https:";
6865
6865
  }
@@ -7032,7 +7032,7 @@ var require_util2 = __commonJS({
7032
7032
  continue;
7033
7033
  }
7034
7034
  } else {
7035
- assert44(input.charCodeAt(position.position) === 44);
7035
+ assert45(input.charCodeAt(position.position) === 44);
7036
7036
  position.position++;
7037
7037
  }
7038
7038
  }
@@ -7313,7 +7313,7 @@ var require_formdata_parser = __commonJS({
7313
7313
  var { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = require_data_url();
7314
7314
  var { makeEntry } = require_formdata();
7315
7315
  var { webidl } = require_webidl();
7316
- var assert44 = require("assert");
7316
+ var assert45 = require("assert");
7317
7317
  var formDataNameBuffer = Buffer.from('form-data; name="');
7318
7318
  var filenameBuffer = Buffer.from("filename");
7319
7319
  var dd = Buffer.from("--");
@@ -7342,7 +7342,7 @@ var require_formdata_parser = __commonJS({
7342
7342
  }
7343
7343
  __name(validateBoundary, "validateBoundary");
7344
7344
  function multipartFormDataParser(input, mimeType) {
7345
- assert44(mimeType !== "failure" && mimeType.essence === "multipart/form-data");
7345
+ assert45(mimeType !== "failure" && mimeType.essence === "multipart/form-data");
7346
7346
  const boundaryString = mimeType.parameters.get("boundary");
7347
7347
  if (boundaryString === void 0) {
7348
7348
  throw parsingError("missing boundary in content-type header");
@@ -7403,8 +7403,8 @@ var require_formdata_parser = __commonJS({
7403
7403
  } else {
7404
7404
  value = utf8DecodeBytes(Buffer.from(body));
7405
7405
  }
7406
- assert44(webidl.is.USVString(name2));
7407
- assert44(typeof value === "string" && webidl.is.USVString(value) || webidl.is.File(value));
7406
+ assert45(webidl.is.USVString(name2));
7407
+ assert45(typeof value === "string" && webidl.is.USVString(value) || webidl.is.File(value));
7408
7408
  entryList.push(makeEntry(name2, value, filename));
7409
7409
  }
7410
7410
  }
@@ -7523,7 +7523,7 @@ var require_formdata_parser = __commonJS({
7523
7523
  }
7524
7524
  __name(parseMultipartFormDataHeaders, "parseMultipartFormDataHeaders");
7525
7525
  function parseMultipartFormDataName(input, position) {
7526
- assert44(input[position.position - 1] === 34);
7526
+ assert45(input[position.position - 1] === 34);
7527
7527
  let name2 = collectASequenceOfBytes(
7528
7528
  (char) => char !== 10 && char !== 13 && char !== 34,
7529
7529
  input,
@@ -7617,7 +7617,7 @@ var require_body = __commonJS({
7617
7617
  } = require_util2();
7618
7618
  var { FormData: FormData13, setFormDataState } = require_formdata();
7619
7619
  var { webidl } = require_webidl();
7620
- var assert44 = require("assert");
7620
+ var assert45 = require("assert");
7621
7621
  var { isErrored, isDisturbed } = require("stream");
7622
7622
  var { isArrayBuffer: isArrayBuffer3 } = require("util/types");
7623
7623
  var { serializeAMimeType } = require_data_url();
@@ -7660,7 +7660,7 @@ var require_body = __commonJS({
7660
7660
  type: "bytes"
7661
7661
  });
7662
7662
  }
7663
- assert44(webidl.is.ReadableStream(stream2));
7663
+ assert45(webidl.is.ReadableStream(stream2));
7664
7664
  let action = null;
7665
7665
  let source = null;
7666
7666
  let length = null;
@@ -7779,8 +7779,8 @@ Content-Type: ${value.type || "application/octet-stream"}\r
7779
7779
  __name(extractBody, "extractBody");
7780
7780
  function safelyExtractBody(object, keepalive = false) {
7781
7781
  if (webidl.is.ReadableStream(object)) {
7782
- assert44(!util3.isDisturbed(object), "The body has already been consumed.");
7783
- assert44(!object.locked, "The stream is locked.");
7782
+ assert45(!util3.isDisturbed(object), "The body has already been consumed.");
7783
+ assert45(!object.locked, "The stream is locked.");
7784
7784
  }
7785
7785
  return extractBody(object, keepalive);
7786
7786
  }
@@ -7922,7 +7922,7 @@ var require_client_h1 = __commonJS({
7922
7922
  "../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/dispatcher/client-h1.js"(exports2, module3) {
7923
7923
  "use strict";
7924
7924
  init_import_meta_url();
7925
- var assert44 = require("assert");
7925
+ var assert45 = require("assert");
7926
7926
  var util3 = require_util();
7927
7927
  var { channels } = require_diagnostics();
7928
7928
  var timers = require_timers();
@@ -8003,7 +8003,7 @@ var require_client_h1 = __commonJS({
8003
8003
  * @returns {number}
8004
8004
  */
8005
8005
  wasm_on_status: /* @__PURE__ */ __name((p7, at3, len) => {
8006
- assert44(currentParser.ptr === p7);
8006
+ assert45(currentParser.ptr === p7);
8007
8007
  const start = at3 - currentBufferPtr + currentBufferRef.byteOffset;
8008
8008
  return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len));
8009
8009
  }, "wasm_on_status"),
@@ -8012,7 +8012,7 @@ var require_client_h1 = __commonJS({
8012
8012
  * @returns {number}
8013
8013
  */
8014
8014
  wasm_on_message_begin: /* @__PURE__ */ __name((p7) => {
8015
- assert44(currentParser.ptr === p7);
8015
+ assert45(currentParser.ptr === p7);
8016
8016
  return currentParser.onMessageBegin();
8017
8017
  }, "wasm_on_message_begin"),
8018
8018
  /**
@@ -8022,7 +8022,7 @@ var require_client_h1 = __commonJS({
8022
8022
  * @returns {number}
8023
8023
  */
8024
8024
  wasm_on_header_field: /* @__PURE__ */ __name((p7, at3, len) => {
8025
- assert44(currentParser.ptr === p7);
8025
+ assert45(currentParser.ptr === p7);
8026
8026
  const start = at3 - currentBufferPtr + currentBufferRef.byteOffset;
8027
8027
  return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len));
8028
8028
  }, "wasm_on_header_field"),
@@ -8033,7 +8033,7 @@ var require_client_h1 = __commonJS({
8033
8033
  * @returns {number}
8034
8034
  */
8035
8035
  wasm_on_header_value: /* @__PURE__ */ __name((p7, at3, len) => {
8036
- assert44(currentParser.ptr === p7);
8036
+ assert45(currentParser.ptr === p7);
8037
8037
  const start = at3 - currentBufferPtr + currentBufferRef.byteOffset;
8038
8038
  return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len));
8039
8039
  }, "wasm_on_header_value"),
@@ -8045,7 +8045,7 @@ var require_client_h1 = __commonJS({
8045
8045
  * @returns {number}
8046
8046
  */
8047
8047
  wasm_on_headers_complete: /* @__PURE__ */ __name((p7, statusCode, upgrade, shouldKeepAlive) => {
8048
- assert44(currentParser.ptr === p7);
8048
+ assert45(currentParser.ptr === p7);
8049
8049
  return currentParser.onHeadersComplete(statusCode, upgrade === 1, shouldKeepAlive === 1);
8050
8050
  }, "wasm_on_headers_complete"),
8051
8051
  /**
@@ -8055,7 +8055,7 @@ var require_client_h1 = __commonJS({
8055
8055
  * @returns {number}
8056
8056
  */
8057
8057
  wasm_on_body: /* @__PURE__ */ __name((p7, at3, len) => {
8058
- assert44(currentParser.ptr === p7);
8058
+ assert45(currentParser.ptr === p7);
8059
8059
  const start = at3 - currentBufferPtr + currentBufferRef.byteOffset;
8060
8060
  return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len));
8061
8061
  }, "wasm_on_body"),
@@ -8064,7 +8064,7 @@ var require_client_h1 = __commonJS({
8064
8064
  * @returns {number}
8065
8065
  */
8066
8066
  wasm_on_message_complete: /* @__PURE__ */ __name((p7) => {
8067
- assert44(currentParser.ptr === p7);
8067
+ assert45(currentParser.ptr === p7);
8068
8068
  return currentParser.onMessageComplete();
8069
8069
  }, "wasm_on_message_complete")
8070
8070
  }
@@ -8139,10 +8139,10 @@ var require_client_h1 = __commonJS({
8139
8139
  if (this.socket.destroyed || !this.paused) {
8140
8140
  return;
8141
8141
  }
8142
- assert44(this.ptr != null);
8143
- assert44(currentParser === null);
8142
+ assert45(this.ptr != null);
8143
+ assert45(currentParser === null);
8144
8144
  this.llhttp.llhttp_resume(this.ptr);
8145
- assert44(this.timeoutType === TIMEOUT_BODY);
8145
+ assert45(this.timeoutType === TIMEOUT_BODY);
8146
8146
  if (this.timeout) {
8147
8147
  if (this.timeout.refresh) {
8148
8148
  this.timeout.refresh();
@@ -8165,9 +8165,9 @@ var require_client_h1 = __commonJS({
8165
8165
  * @param {Buffer} chunk
8166
8166
  */
8167
8167
  execute(chunk) {
8168
- assert44(currentParser === null);
8169
- assert44(this.ptr != null);
8170
- assert44(!this.paused);
8168
+ assert45(currentParser === null);
8169
+ assert45(this.ptr != null);
8170
+ assert45(!this.paused);
8171
8171
  const { socket, llhttp } = this;
8172
8172
  if (chunk.length > currentBufferSize) {
8173
8173
  if (currentBufferPtr) {
@@ -8211,8 +8211,8 @@ var require_client_h1 = __commonJS({
8211
8211
  }
8212
8212
  }
8213
8213
  destroy() {
8214
- assert44(currentParser === null);
8215
- assert44(this.ptr != null);
8214
+ assert45(currentParser === null);
8215
+ assert45(this.ptr != null);
8216
8216
  this.llhttp.llhttp_free(this.ptr);
8217
8217
  this.ptr = null;
8218
8218
  this.timeout && timers.clearTimeout(this.timeout);
@@ -8298,14 +8298,14 @@ var require_client_h1 = __commonJS({
8298
8298
  */
8299
8299
  onUpgrade(head) {
8300
8300
  const { upgrade, client, socket, headers, statusCode } = this;
8301
- assert44(upgrade);
8302
- assert44(client[kSocket] === socket);
8303
- assert44(!socket.destroyed);
8304
- assert44(!this.paused);
8305
- assert44((headers.length & 1) === 0);
8301
+ assert45(upgrade);
8302
+ assert45(client[kSocket] === socket);
8303
+ assert45(!socket.destroyed);
8304
+ assert45(!this.paused);
8305
+ assert45((headers.length & 1) === 0);
8306
8306
  const request4 = client[kQueue][client[kRunningIdx]];
8307
- assert44(request4);
8308
- assert44(request4.upgrade || request4.method === "CONNECT");
8307
+ assert45(request4);
8308
+ assert45(request4.upgrade || request4.method === "CONNECT");
8309
8309
  this.statusCode = 0;
8310
8310
  this.statusText = "";
8311
8311
  this.shouldKeepAlive = false;
@@ -8343,8 +8343,8 @@ var require_client_h1 = __commonJS({
8343
8343
  if (!request4) {
8344
8344
  return -1;
8345
8345
  }
8346
- assert44(!this.upgrade);
8347
- assert44(this.statusCode < 200);
8346
+ assert45(!this.upgrade);
8347
+ assert45(this.statusCode < 200);
8348
8348
  if (statusCode === 100) {
8349
8349
  util3.destroy(socket, new SocketError("bad response", util3.getSocketInfo(socket)));
8350
8350
  return -1;
@@ -8353,7 +8353,7 @@ var require_client_h1 = __commonJS({
8353
8353
  util3.destroy(socket, new SocketError("bad upgrade", util3.getSocketInfo(socket)));
8354
8354
  return -1;
8355
8355
  }
8356
- assert44(this.timeoutType === TIMEOUT_HEADERS);
8356
+ assert45(this.timeoutType === TIMEOUT_HEADERS);
8357
8357
  this.statusCode = statusCode;
8358
8358
  this.shouldKeepAlive = shouldKeepAlive || // Override llhttp value which does not allow keepAlive for HEAD.
8359
8359
  request4.method === "HEAD" && !socket[kReset2] && this.connection.toLowerCase() === "keep-alive";
@@ -8366,16 +8366,16 @@ var require_client_h1 = __commonJS({
8366
8366
  }
8367
8367
  }
8368
8368
  if (request4.method === "CONNECT") {
8369
- assert44(client[kRunning] === 1);
8369
+ assert45(client[kRunning] === 1);
8370
8370
  this.upgrade = true;
8371
8371
  return 2;
8372
8372
  }
8373
8373
  if (upgrade) {
8374
- assert44(client[kRunning] === 1);
8374
+ assert45(client[kRunning] === 1);
8375
8375
  this.upgrade = true;
8376
8376
  return 2;
8377
8377
  }
8378
- assert44((this.headers.length & 1) === 0);
8378
+ assert45((this.headers.length & 1) === 0);
8379
8379
  this.headers = [];
8380
8380
  this.headersSize = 0;
8381
8381
  if (this.shouldKeepAlive && client[kPipelining]) {
@@ -8422,14 +8422,14 @@ var require_client_h1 = __commonJS({
8422
8422
  return -1;
8423
8423
  }
8424
8424
  const request4 = client[kQueue][client[kRunningIdx]];
8425
- assert44(request4);
8426
- assert44(this.timeoutType === TIMEOUT_BODY);
8425
+ assert45(request4);
8426
+ assert45(this.timeoutType === TIMEOUT_BODY);
8427
8427
  if (this.timeout) {
8428
8428
  if (this.timeout.refresh) {
8429
8429
  this.timeout.refresh();
8430
8430
  }
8431
8431
  }
8432
- assert44(statusCode >= 200);
8432
+ assert45(statusCode >= 200);
8433
8433
  if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
8434
8434
  util3.destroy(socket, new ResponseExceededMaxSizeError());
8435
8435
  return -1;
@@ -8451,10 +8451,10 @@ var require_client_h1 = __commonJS({
8451
8451
  if (upgrade) {
8452
8452
  return 0;
8453
8453
  }
8454
- assert44(statusCode >= 100);
8455
- assert44((this.headers.length & 1) === 0);
8454
+ assert45(statusCode >= 100);
8455
+ assert45((this.headers.length & 1) === 0);
8456
8456
  const request4 = client[kQueue][client[kRunningIdx]];
8457
- assert44(request4);
8457
+ assert45(request4);
8458
8458
  this.statusCode = 0;
8459
8459
  this.statusText = "";
8460
8460
  this.bytesRead = 0;
@@ -8473,7 +8473,7 @@ var require_client_h1 = __commonJS({
8473
8473
  request4.onComplete(headers);
8474
8474
  client[kQueue][client[kRunningIdx]++] = null;
8475
8475
  if (socket[kWriting]) {
8476
- assert44(client[kRunning] === 0);
8476
+ assert45(client[kRunning] === 0);
8477
8477
  util3.destroy(socket, new InformationalError("reset"));
8478
8478
  return constants4.ERROR.PAUSED;
8479
8479
  } else if (!shouldKeepAlive) {
@@ -8494,7 +8494,7 @@ var require_client_h1 = __commonJS({
8494
8494
  const { socket, timeoutType, client, paused } = parser2.deref();
8495
8495
  if (timeoutType === TIMEOUT_HEADERS) {
8496
8496
  if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
8497
- assert44(!paused, "cannot be paused while waiting for headers");
8497
+ assert45(!paused, "cannot be paused while waiting for headers");
8498
8498
  util3.destroy(socket, new HeadersTimeoutError());
8499
8499
  }
8500
8500
  } else if (timeoutType === TIMEOUT_BODY) {
@@ -8502,7 +8502,7 @@ var require_client_h1 = __commonJS({
8502
8502
  util3.destroy(socket, new BodyTimeoutError());
8503
8503
  }
8504
8504
  } else if (timeoutType === TIMEOUT_KEEP_ALIVE) {
8505
- assert44(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]);
8505
+ assert45(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]);
8506
8506
  util3.destroy(socket, new InformationalError("socket idle timeout"));
8507
8507
  }
8508
8508
  }
@@ -8581,7 +8581,7 @@ var require_client_h1 = __commonJS({
8581
8581
  }
8582
8582
  __name(connectH1, "connectH1");
8583
8583
  function onHttpSocketError(err) {
8584
- assert44(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
8584
+ assert45(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
8585
8585
  const parser2 = this[kParser];
8586
8586
  if (err.code === "ECONNRESET" && parser2.statusCode && !parser2.shouldKeepAlive) {
8587
8587
  parser2.onMessageComplete();
@@ -8618,7 +8618,7 @@ var require_client_h1 = __commonJS({
8618
8618
  client[kSocket] = null;
8619
8619
  client[kHTTPContext] = null;
8620
8620
  if (client.destroyed) {
8621
- assert44(client[kPending] === 0);
8621
+ assert45(client[kPending] === 0);
8622
8622
  const requests = client[kQueue].splice(client[kRunningIdx]);
8623
8623
  for (let i6 = 0; i6 < requests.length; i6++) {
8624
8624
  const request4 = requests[i6];
@@ -8630,7 +8630,7 @@ var require_client_h1 = __commonJS({
8630
8630
  util3.errorRequest(client, request4, err);
8631
8631
  }
8632
8632
  client[kPendingIdx] = client[kRunningIdx];
8633
- assert44(client[kRunning] === 0);
8633
+ assert45(client[kRunning] === 0);
8634
8634
  client.emit("disconnect", client[kUrl], [client], err);
8635
8635
  client[kResume]();
8636
8636
  }
@@ -8786,13 +8786,13 @@ upgrade: ${upgrade}\r
8786
8786
  } else if (util3.isIterable(body)) {
8787
8787
  writeIterable(abort, body, client, request4, socket, contentLength, header, expectsPayload);
8788
8788
  } else {
8789
- assert44(false);
8789
+ assert45(false);
8790
8790
  }
8791
8791
  return true;
8792
8792
  }
8793
8793
  __name(writeH1, "writeH1");
8794
8794
  function writeStream(abort, body, client, request4, socket, contentLength, header, expectsPayload) {
8795
- assert44(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
8795
+ assert45(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
8796
8796
  let finished = false;
8797
8797
  const writer = new AsyncWriter({ abort, socket, request: request4, contentLength, client, expectsPayload, header });
8798
8798
  const onData = /* @__PURE__ */ __name(function(chunk) {
@@ -8829,7 +8829,7 @@ upgrade: ${upgrade}\r
8829
8829
  return;
8830
8830
  }
8831
8831
  finished = true;
8832
- assert44(socket.destroyed || socket[kWriting] && client[kRunning] <= 1);
8832
+ assert45(socket.destroyed || socket[kWriting] && client[kRunning] <= 1);
8833
8833
  socket.off("drain", onDrain).off("error", onFinished);
8834
8834
  body.removeListener("data", onData).removeListener("end", onFinished).removeListener("close", onClose);
8835
8835
  if (!err) {
@@ -8869,12 +8869,12 @@ upgrade: ${upgrade}\r
8869
8869
  \r
8870
8870
  `, "latin1");
8871
8871
  } else {
8872
- assert44(contentLength === null, "no body must not have content length");
8872
+ assert45(contentLength === null, "no body must not have content length");
8873
8873
  socket.write(`${header}\r
8874
8874
  `, "latin1");
8875
8875
  }
8876
8876
  } else if (util3.isBuffer(body)) {
8877
- assert44(contentLength === body.byteLength, "buffer body must have content length");
8877
+ assert45(contentLength === body.byteLength, "buffer body must have content length");
8878
8878
  socket.cork();
8879
8879
  socket.write(`${header}content-length: ${contentLength}\r
8880
8880
  \r
@@ -8894,7 +8894,7 @@ upgrade: ${upgrade}\r
8894
8894
  }
8895
8895
  __name(writeBuffer, "writeBuffer");
8896
8896
  async function writeBlob(abort, body, client, request4, socket, contentLength, header, expectsPayload) {
8897
- assert44(contentLength === body.size, "blob body must have content length");
8897
+ assert45(contentLength === body.size, "blob body must have content length");
8898
8898
  try {
8899
8899
  if (contentLength != null && contentLength !== body.size) {
8900
8900
  throw new RequestContentLengthMismatchError();
@@ -8918,7 +8918,7 @@ upgrade: ${upgrade}\r
8918
8918
  }
8919
8919
  __name(writeBlob, "writeBlob");
8920
8920
  async function writeIterable(abort, body, client, request4, socket, contentLength, header, expectsPayload) {
8921
- assert44(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
8921
+ assert45(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
8922
8922
  let callback = null;
8923
8923
  function onDrain() {
8924
8924
  if (callback) {
@@ -8929,7 +8929,7 @@ upgrade: ${upgrade}\r
8929
8929
  }
8930
8930
  __name(onDrain, "onDrain");
8931
8931
  const waitForDrain = /* @__PURE__ */ __name(() => new Promise((resolve25, reject) => {
8932
- assert44(callback === null);
8932
+ assert45(callback === null);
8933
8933
  if (socket[kError]) {
8934
8934
  reject(socket[kError]);
8935
8935
  } else {
@@ -9082,7 +9082,7 @@ ${len.toString(16)}\r
9082
9082
  const { socket, client, abort } = this;
9083
9083
  socket[kWriting] = false;
9084
9084
  if (err) {
9085
- assert44(client[kRunning] <= 1, "pipeline should only contain this request");
9085
+ assert45(client[kRunning] <= 1, "pipeline should only contain this request");
9086
9086
  abort(err);
9087
9087
  }
9088
9088
  }
@@ -9096,7 +9096,7 @@ var require_client_h2 = __commonJS({
9096
9096
  "../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/dispatcher/client-h2.js"(exports2, module3) {
9097
9097
  "use strict";
9098
9098
  init_import_meta_url();
9099
- var assert44 = require("assert");
9099
+ var assert45 = require("assert");
9100
9100
  var { pipeline } = require("stream");
9101
9101
  var util3 = require_util();
9102
9102
  var {
@@ -9226,7 +9226,7 @@ var require_client_h2 = __commonJS({
9226
9226
  }
9227
9227
  __name(resumeH2, "resumeH2");
9228
9228
  function onHttp2SessionError(err) {
9229
- assert44(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
9229
+ assert45(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
9230
9230
  this[kSocket][kError] = err;
9231
9231
  this[kClient][kOnError](err);
9232
9232
  }
@@ -9259,7 +9259,7 @@ var require_client_h2 = __commonJS({
9259
9259
  util3.errorRequest(client, request4, err);
9260
9260
  client[kPendingIdx] = client[kRunningIdx];
9261
9261
  }
9262
- assert44(client[kRunning] === 0);
9262
+ assert45(client[kRunning] === 0);
9263
9263
  client.emit("disconnect", client[kUrl], [client], err);
9264
9264
  client.emit("connectionError", client[kUrl], [client], err);
9265
9265
  client[kResume]();
@@ -9272,7 +9272,7 @@ var require_client_h2 = __commonJS({
9272
9272
  client[kSocket] = null;
9273
9273
  client[kHTTPContext] = null;
9274
9274
  if (client.destroyed) {
9275
- assert44(client[kPending] === 0);
9275
+ assert45(client[kPending] === 0);
9276
9276
  const requests = client[kQueue].splice(client[kRunningIdx]);
9277
9277
  for (let i6 = 0; i6 < requests.length; i6++) {
9278
9278
  const request4 = requests[i6];
@@ -9290,13 +9290,13 @@ var require_client_h2 = __commonJS({
9290
9290
  this[kHTTP2Session].destroy(err);
9291
9291
  }
9292
9292
  client[kPendingIdx] = client[kRunningIdx];
9293
- assert44(client[kRunning] === 0);
9293
+ assert45(client[kRunning] === 0);
9294
9294
  client.emit("disconnect", client[kUrl], [client], err);
9295
9295
  client[kResume]();
9296
9296
  }
9297
9297
  __name(onHttp2SocketClose, "onHttp2SocketClose");
9298
9298
  function onHttp2SocketError(err) {
9299
- assert44(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
9299
+ assert45(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
9300
9300
  this[kError] = err;
9301
9301
  this[kClient][kOnError](err);
9302
9302
  }
@@ -9415,7 +9415,7 @@ var require_client_h2 = __commonJS({
9415
9415
  process.emitWarning(new RequestContentLengthMismatchError());
9416
9416
  }
9417
9417
  if (contentLength != null) {
9418
- assert44(body, "no body must not have content length");
9418
+ assert45(body, "no body must not have content length");
9419
9419
  headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`;
9420
9420
  }
9421
9421
  session.ref();
@@ -9580,7 +9580,7 @@ var require_client_h2 = __commonJS({
9580
9580
  expectsPayload
9581
9581
  );
9582
9582
  } else {
9583
- assert44(false);
9583
+ assert45(false);
9584
9584
  }
9585
9585
  }
9586
9586
  __name(writeBodyH2, "writeBodyH2");
@@ -9589,7 +9589,7 @@ var require_client_h2 = __commonJS({
9589
9589
  function writeBuffer(abort, h2stream, body, client, request4, socket, contentLength, expectsPayload) {
9590
9590
  try {
9591
9591
  if (body != null && util3.isBuffer(body)) {
9592
- assert44(contentLength === body.byteLength, "buffer body must have content length");
9592
+ assert45(contentLength === body.byteLength, "buffer body must have content length");
9593
9593
  h2stream.cork();
9594
9594
  h2stream.write(body);
9595
9595
  h2stream.uncork();
@@ -9607,7 +9607,7 @@ var require_client_h2 = __commonJS({
9607
9607
  }
9608
9608
  __name(writeBuffer, "writeBuffer");
9609
9609
  function writeStream(abort, socket, expectsPayload, h2stream, body, client, request4, contentLength) {
9610
- assert44(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
9610
+ assert45(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
9611
9611
  const pipe = pipeline(
9612
9612
  body,
9613
9613
  h2stream,
@@ -9633,7 +9633,7 @@ var require_client_h2 = __commonJS({
9633
9633
  }
9634
9634
  __name(writeStream, "writeStream");
9635
9635
  async function writeBlob(abort, h2stream, body, client, request4, socket, contentLength, expectsPayload) {
9636
- assert44(contentLength === body.size, "blob body must have content length");
9636
+ assert45(contentLength === body.size, "blob body must have content length");
9637
9637
  try {
9638
9638
  if (contentLength != null && contentLength !== body.size) {
9639
9639
  throw new RequestContentLengthMismatchError();
@@ -9655,7 +9655,7 @@ var require_client_h2 = __commonJS({
9655
9655
  }
9656
9656
  __name(writeBlob, "writeBlob");
9657
9657
  async function writeIterable(abort, h2stream, body, client, request4, socket, contentLength, expectsPayload) {
9658
- assert44(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
9658
+ assert45(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
9659
9659
  let callback = null;
9660
9660
  function onDrain() {
9661
9661
  if (callback) {
@@ -9666,7 +9666,7 @@ var require_client_h2 = __commonJS({
9666
9666
  }
9667
9667
  __name(onDrain, "onDrain");
9668
9668
  const waitForDrain = /* @__PURE__ */ __name(() => new Promise((resolve25, reject) => {
9669
- assert44(callback === null);
9669
+ assert45(callback === null);
9670
9670
  if (socket[kError]) {
9671
9671
  reject(socket[kError]);
9672
9672
  } else {
@@ -9707,7 +9707,7 @@ var require_client = __commonJS({
9707
9707
  "../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/dispatcher/client.js"(exports2, module3) {
9708
9708
  "use strict";
9709
9709
  init_import_meta_url();
9710
- var assert44 = require("assert");
9710
+ var assert45 = require("assert");
9711
9711
  var net2 = require("net");
9712
9712
  var http6 = require("http");
9713
9713
  var util3 = require_util();
@@ -9997,25 +9997,25 @@ var require_client = __commonJS({
9997
9997
  };
9998
9998
  function onError(client, err) {
9999
9999
  if (client[kRunning] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") {
10000
- assert44(client[kPendingIdx] === client[kRunningIdx]);
10000
+ assert45(client[kPendingIdx] === client[kRunningIdx]);
10001
10001
  const requests = client[kQueue].splice(client[kRunningIdx]);
10002
10002
  for (let i6 = 0; i6 < requests.length; i6++) {
10003
10003
  const request4 = requests[i6];
10004
10004
  util3.errorRequest(client, request4, err);
10005
10005
  }
10006
- assert44(client[kSize] === 0);
10006
+ assert45(client[kSize] === 0);
10007
10007
  }
10008
10008
  }
10009
10009
  __name(onError, "onError");
10010
10010
  async function connect(client) {
10011
- assert44(!client[kConnecting]);
10012
- assert44(!client[kHTTPContext]);
10011
+ assert45(!client[kConnecting]);
10012
+ assert45(!client[kHTTPContext]);
10013
10013
  let { host, hostname: hostname2, protocol, port } = client[kUrl];
10014
10014
  if (hostname2[0] === "[") {
10015
10015
  const idx = hostname2.indexOf("]");
10016
- assert44(idx !== -1);
10016
+ assert45(idx !== -1);
10017
10017
  const ip = hostname2.substring(1, idx);
10018
- assert44(net2.isIPv6(ip));
10018
+ assert45(net2.isIPv6(ip));
10019
10019
  hostname2 = ip;
10020
10020
  }
10021
10021
  client[kConnecting] = true;
@@ -10054,7 +10054,7 @@ var require_client = __commonJS({
10054
10054
  util3.destroy(socket.on("error", noop), new ClientDestroyedError());
10055
10055
  return;
10056
10056
  }
10057
- assert44(socket);
10057
+ assert45(socket);
10058
10058
  try {
10059
10059
  client[kHTTPContext] = socket.alpnProtocol === "h2" ? await connectH2(client, socket) : await connectH1(client, socket);
10060
10060
  } catch (err) {
@@ -10103,7 +10103,7 @@ var require_client = __commonJS({
10103
10103
  });
10104
10104
  }
10105
10105
  if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") {
10106
- assert44(client[kRunning] === 0);
10106
+ assert45(client[kRunning] === 0);
10107
10107
  while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
10108
10108
  const request4 = client[kQueue][client[kPendingIdx]++];
10109
10109
  util3.errorRequest(client, request4, err);
@@ -10138,7 +10138,7 @@ var require_client = __commonJS({
10138
10138
  function _resume(client, sync) {
10139
10139
  while (true) {
10140
10140
  if (client.destroyed) {
10141
- assert44(client[kPending] === 0);
10141
+ assert45(client[kPending] === 0);
10142
10142
  return;
10143
10143
  }
10144
10144
  if (client[kClosedResolve] && !client[kSize]) {
@@ -11191,7 +11191,7 @@ var require_retry_handler = __commonJS({
11191
11191
  "../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/handler/retry-handler.js"(exports2, module3) {
11192
11192
  "use strict";
11193
11193
  init_import_meta_url();
11194
- var assert44 = require("assert");
11194
+ var assert45 = require("assert");
11195
11195
  var { kRetryHandlerDefaultRetry } = require_symbols();
11196
11196
  var { RequestRetryError } = require_errors();
11197
11197
  var WrapHandler = require_wrap_handler();
@@ -11379,8 +11379,8 @@ var require_retry_handler = __commonJS({
11379
11379
  });
11380
11380
  }
11381
11381
  const { start, size, end = size ? size - 1 : null } = contentRange;
11382
- assert44(this.start === start, "content-range mismatch");
11383
- assert44(this.end == null || this.end === end, "content-range mismatch");
11382
+ assert45(this.start === start, "content-range mismatch");
11383
+ assert45(this.end == null || this.end === end, "content-range mismatch");
11384
11384
  return;
11385
11385
  }
11386
11386
  if (this.end == null) {
@@ -11397,11 +11397,11 @@ var require_retry_handler = __commonJS({
11397
11397
  return;
11398
11398
  }
11399
11399
  const { start, size, end = size ? size - 1 : null } = range;
11400
- assert44(
11400
+ assert45(
11401
11401
  start != null && Number.isFinite(start),
11402
11402
  "content-range mismatch"
11403
11403
  );
11404
- assert44(end != null && Number.isFinite(end), "invalid content-length");
11404
+ assert45(end != null && Number.isFinite(end), "invalid content-length");
11405
11405
  this.start = start;
11406
11406
  this.end = end;
11407
11407
  }
@@ -11409,8 +11409,8 @@ var require_retry_handler = __commonJS({
11409
11409
  const contentLength = headers["content-length"];
11410
11410
  this.end = contentLength != null ? Number(contentLength) - 1 : null;
11411
11411
  }
11412
- assert44(Number.isFinite(this.start));
11413
- assert44(
11412
+ assert45(Number.isFinite(this.start));
11413
+ assert45(
11414
11414
  this.end == null || Number.isFinite(this.end),
11415
11415
  "invalid content-length"
11416
11416
  );
@@ -11646,7 +11646,7 @@ var require_readable = __commonJS({
11646
11646
  "../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/api/readable.js"(exports2, module3) {
11647
11647
  "use strict";
11648
11648
  init_import_meta_url();
11649
- var assert44 = require("assert");
11649
+ var assert45 = require("assert");
11650
11650
  var { Readable: Readable10 } = require("stream");
11651
11651
  var { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError: AbortError3 } = require_errors();
11652
11652
  var util3 = require_util();
@@ -11843,7 +11843,7 @@ var require_readable = __commonJS({
11843
11843
  this[kBody] = ReadableStreamFrom(this);
11844
11844
  if (this[kConsume]) {
11845
11845
  this[kBody].getReader();
11846
- assert44(this[kBody].locked);
11846
+ assert45(this[kBody].locked);
11847
11847
  }
11848
11848
  }
11849
11849
  return this[kBody];
@@ -11912,7 +11912,7 @@ var require_readable = __commonJS({
11912
11912
  }
11913
11913
  __name(isUnusable, "isUnusable");
11914
11914
  function consume(stream2, type) {
11915
- assert44(!stream2[kConsume]);
11915
+ assert45(!stream2[kConsume]);
11916
11916
  return new Promise((resolve25, reject) => {
11917
11917
  if (isUnusable(stream2)) {
11918
11918
  const rState = stream2._readableState;
@@ -12059,7 +12059,7 @@ var require_api_request = __commonJS({
12059
12059
  "../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/api/api-request.js"(exports2, module3) {
12060
12060
  "use strict";
12061
12061
  init_import_meta_url();
12062
- var assert44 = require("assert");
12062
+ var assert45 = require("assert");
12063
12063
  var { AsyncResource } = require("async_hooks");
12064
12064
  var { Readable: Readable10 } = require_readable();
12065
12065
  var { InvalidArgumentError, RequestAbortedError } = require_errors();
@@ -12130,7 +12130,7 @@ var require_api_request = __commonJS({
12130
12130
  abort(this.reason);
12131
12131
  return;
12132
12132
  }
12133
- assert44(this.callback);
12133
+ assert45(this.callback);
12134
12134
  this.abort = abort;
12135
12135
  this.context = context2;
12136
12136
  }
@@ -12290,7 +12290,7 @@ var require_api_stream = __commonJS({
12290
12290
  "../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/api/api-stream.js"(exports2, module3) {
12291
12291
  "use strict";
12292
12292
  init_import_meta_url();
12293
- var assert44 = require("assert");
12293
+ var assert45 = require("assert");
12294
12294
  var { finished } = require("stream");
12295
12295
  var { AsyncResource } = require("async_hooks");
12296
12296
  var { InvalidArgumentError, InvalidReturnValueError } = require_errors();
@@ -12353,7 +12353,7 @@ var require_api_stream = __commonJS({
12353
12353
  abort(this.reason);
12354
12354
  return;
12355
12355
  }
12356
- assert44(this.callback);
12356
+ assert45(this.callback);
12357
12357
  this.abort = abort;
12358
12358
  this.context = context2;
12359
12359
  }
@@ -12462,7 +12462,7 @@ var require_api_pipeline = __commonJS({
12462
12462
  Duplex: Duplex2,
12463
12463
  PassThrough: PassThrough4
12464
12464
  } = require("stream");
12465
- var assert44 = require("assert");
12465
+ var assert45 = require("assert");
12466
12466
  var { AsyncResource } = require("async_hooks");
12467
12467
  var {
12468
12468
  InvalidArgumentError,
@@ -12586,7 +12586,7 @@ var require_api_pipeline = __commonJS({
12586
12586
  abort(this.reason);
12587
12587
  return;
12588
12588
  }
12589
- assert44(!res, "pipeline cannot be retried");
12589
+ assert45(!res, "pipeline cannot be retried");
12590
12590
  this.abort = abort;
12591
12591
  this.context = context2;
12592
12592
  }
@@ -12672,7 +12672,7 @@ var require_api_upgrade = __commonJS({
12672
12672
  init_import_meta_url();
12673
12673
  var { InvalidArgumentError, SocketError } = require_errors();
12674
12674
  var { AsyncResource } = require("async_hooks");
12675
- var assert44 = require("assert");
12675
+ var assert45 = require("assert");
12676
12676
  var util3 = require_util();
12677
12677
  var { addSignal, removeSignal } = require_abort_signal();
12678
12678
  var UpgradeHandler = class extends AsyncResource {
@@ -12703,7 +12703,7 @@ var require_api_upgrade = __commonJS({
12703
12703
  abort(this.reason);
12704
12704
  return;
12705
12705
  }
12706
- assert44(this.callback);
12706
+ assert45(this.callback);
12707
12707
  this.abort = abort;
12708
12708
  this.context = null;
12709
12709
  }
@@ -12711,7 +12711,7 @@ var require_api_upgrade = __commonJS({
12711
12711
  throw new SocketError("bad upgrade", null);
12712
12712
  }
12713
12713
  onUpgrade(statusCode, rawHeaders, socket) {
12714
- assert44(statusCode === 101);
12714
+ assert45(statusCode === 101);
12715
12715
  const { callback, opaque, context: context2 } = this;
12716
12716
  removeSignal(this);
12717
12717
  this.callback = null;
@@ -12768,7 +12768,7 @@ var require_api_connect = __commonJS({
12768
12768
  "../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/api/api-connect.js"(exports2, module3) {
12769
12769
  "use strict";
12770
12770
  init_import_meta_url();
12771
- var assert44 = require("assert");
12771
+ var assert45 = require("assert");
12772
12772
  var { AsyncResource } = require("async_hooks");
12773
12773
  var { InvalidArgumentError, SocketError } = require_errors();
12774
12774
  var util3 = require_util();
@@ -12800,7 +12800,7 @@ var require_api_connect = __commonJS({
12800
12800
  abort(this.reason);
12801
12801
  return;
12802
12802
  }
12803
- assert44(this.callback);
12803
+ assert45(this.callback);
12804
12804
  this.abort = abort;
12805
12805
  this.context = context2;
12806
12806
  }
@@ -14844,7 +14844,7 @@ var require_decorator_handler = __commonJS({
14844
14844
  "../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/handler/decorator-handler.js"(exports2, module3) {
14845
14845
  "use strict";
14846
14846
  init_import_meta_url();
14847
- var assert44 = require("assert");
14847
+ var assert45 = require("assert");
14848
14848
  var WrapHandler = require_wrap_handler();
14849
14849
  module3.exports = class DecoratorHandler {
14850
14850
  static {
@@ -14864,25 +14864,25 @@ var require_decorator_handler = __commonJS({
14864
14864
  this.#handler.onRequestStart?.(...args);
14865
14865
  }
14866
14866
  onRequestUpgrade(...args) {
14867
- assert44(!this.#onCompleteCalled);
14868
- assert44(!this.#onErrorCalled);
14867
+ assert45(!this.#onCompleteCalled);
14868
+ assert45(!this.#onErrorCalled);
14869
14869
  return this.#handler.onRequestUpgrade?.(...args);
14870
14870
  }
14871
14871
  onResponseStart(...args) {
14872
- assert44(!this.#onCompleteCalled);
14873
- assert44(!this.#onErrorCalled);
14874
- assert44(!this.#onResponseStartCalled);
14872
+ assert45(!this.#onCompleteCalled);
14873
+ assert45(!this.#onErrorCalled);
14874
+ assert45(!this.#onResponseStartCalled);
14875
14875
  this.#onResponseStartCalled = true;
14876
14876
  return this.#handler.onResponseStart?.(...args);
14877
14877
  }
14878
14878
  onResponseData(...args) {
14879
- assert44(!this.#onCompleteCalled);
14880
- assert44(!this.#onErrorCalled);
14879
+ assert45(!this.#onCompleteCalled);
14880
+ assert45(!this.#onErrorCalled);
14881
14881
  return this.#handler.onResponseData?.(...args);
14882
14882
  }
14883
14883
  onResponseEnd(...args) {
14884
- assert44(!this.#onCompleteCalled);
14885
- assert44(!this.#onErrorCalled);
14884
+ assert45(!this.#onCompleteCalled);
14885
+ assert45(!this.#onErrorCalled);
14886
14886
  this.#onCompleteCalled = true;
14887
14887
  return this.#handler.onResponseEnd?.(...args);
14888
14888
  }
@@ -14906,7 +14906,7 @@ var require_redirect_handler = __commonJS({
14906
14906
  init_import_meta_url();
14907
14907
  var util3 = require_util();
14908
14908
  var { kBodyUsed } = require_symbols();
14909
- var assert44 = require("assert");
14909
+ var assert45 = require("assert");
14910
14910
  var { InvalidArgumentError } = require_errors();
14911
14911
  var EE = require("events");
14912
14912
  var redirectableStatusCodes = [300, 301, 302, 303, 307, 308];
@@ -14922,7 +14922,7 @@ var require_redirect_handler = __commonJS({
14922
14922
  this[kBodyUsed] = false;
14923
14923
  }
14924
14924
  async *[Symbol.asyncIterator]() {
14925
- assert44(!this[kBodyUsed], "disturbed");
14925
+ assert45(!this[kBodyUsed], "disturbed");
14926
14926
  this[kBodyUsed] = true;
14927
14927
  yield* this[kBody];
14928
14928
  }
@@ -14952,7 +14952,7 @@ var require_redirect_handler = __commonJS({
14952
14952
  if (util3.isStream(this.opts.body)) {
14953
14953
  if (util3.bodyLength(this.opts.body) === 0) {
14954
14954
  this.opts.body.on("data", function() {
14955
- assert44(false);
14955
+ assert45(false);
14956
14956
  });
14957
14957
  }
14958
14958
  if (typeof this.opts.body.readableDidRead !== "boolean") {
@@ -15059,7 +15059,7 @@ var require_redirect_handler = __commonJS({
15059
15059
  }
15060
15060
  }
15061
15061
  } else {
15062
- assert44(headers == null, "headers must be an object or an array");
15062
+ assert45(headers == null, "headers must be an object or an array");
15063
15063
  }
15064
15064
  return ret;
15065
15065
  }
@@ -16592,7 +16592,7 @@ var require_cache_revalidation_handler = __commonJS({
16592
16592
  "../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/handler/cache-revalidation-handler.js"(exports2, module3) {
16593
16593
  "use strict";
16594
16594
  init_import_meta_url();
16595
- var assert44 = require("assert");
16595
+ var assert45 = require("assert");
16596
16596
  var CacheRevalidationHandler = class {
16597
16597
  static {
16598
16598
  __name(this, "CacheRevalidationHandler");
@@ -16632,7 +16632,7 @@ var require_cache_revalidation_handler = __commonJS({
16632
16632
  this.#handler.onRequestUpgrade?.(controller, statusCode, headers, socket);
16633
16633
  }
16634
16634
  onResponseStart(controller, statusCode, headers, statusMessage) {
16635
- assert44(this.#callback != null);
16635
+ assert45(this.#callback != null);
16636
16636
  this.#successful = statusCode === 304 || this.#allowErrorStatusCodes && statusCode >= 500 && statusCode <= 504;
16637
16637
  this.#callback(this.#successful, this.#context);
16638
16638
  this.#callback = null;
@@ -16683,7 +16683,7 @@ var require_cache2 = __commonJS({
16683
16683
  "../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/interceptor/cache.js"(exports2, module3) {
16684
16684
  "use strict";
16685
16685
  init_import_meta_url();
16686
- var assert44 = require("assert");
16686
+ var assert45 = require("assert");
16687
16687
  var { Readable: Readable10 } = require("stream");
16688
16688
  var util3 = require_util();
16689
16689
  var CacheHandler = require_cache_handler();
@@ -16748,8 +16748,8 @@ var require_cache2 = __commonJS({
16748
16748
  __name(handleUncachedResponse, "handleUncachedResponse");
16749
16749
  function sendCachedValue(handler, opts, result, age, context2, isStale) {
16750
16750
  const stream2 = util3.isStream(result.body) ? result.body : Readable10.from(result.body ?? []);
16751
- assert44(!stream2.destroyed, "stream should not be destroyed");
16752
- assert44(!stream2.readableDidRead, "stream should not be readableDidRead");
16751
+ assert45(!stream2.destroyed, "stream should not be destroyed");
16752
+ assert45(!stream2.readableDidRead, "stream should not be readableDidRead");
16753
16753
  const controller = {
16754
16754
  resume() {
16755
16755
  stream2.resume();
@@ -17308,7 +17308,7 @@ var require_headers = __commonJS({
17308
17308
  isValidHeaderValue
17309
17309
  } = require_util2();
17310
17310
  var { webidl } = require_webidl();
17311
- var assert44 = require("assert");
17311
+ var assert45 = require("assert");
17312
17312
  var util3 = require("util");
17313
17313
  function isHTTPWhiteSpaceCharCode(code) {
17314
17314
  return code === 10 || code === 13 || code === 9 || code === 32;
@@ -17533,11 +17533,11 @@ var require_headers = __commonJS({
17533
17533
  const iterator = this.headersMap[Symbol.iterator]();
17534
17534
  const firstValue = iterator.next().value;
17535
17535
  array[0] = [firstValue[0], firstValue[1].value];
17536
- assert44(firstValue[1].value !== null);
17536
+ assert45(firstValue[1].value !== null);
17537
17537
  for (let i6 = 1, j7 = 0, right2 = 0, left2 = 0, pivot = 0, x7, value; i6 < size; ++i6) {
17538
17538
  value = iterator.next().value;
17539
17539
  x7 = array[i6] = [value[0], value[1].value];
17540
- assert44(x7[1] !== null);
17540
+ assert45(x7[1] !== null);
17541
17541
  left2 = 0;
17542
17542
  right2 = i6;
17543
17543
  while (left2 < right2) {
@@ -17564,7 +17564,7 @@ var require_headers = __commonJS({
17564
17564
  let i6 = 0;
17565
17565
  for (const { 0: name2, 1: { value } } of this.headersMap) {
17566
17566
  array[i6++] = [name2, value];
17567
- assert44(value !== null);
17567
+ assert45(value !== null);
17568
17568
  }
17569
17569
  return array.sort(compareHeaderName);
17570
17570
  }
@@ -17795,7 +17795,7 @@ var require_response = __commonJS({
17795
17795
  var { webidl } = require_webidl();
17796
17796
  var { URLSerializer } = require_data_url();
17797
17797
  var { kConstruct } = require_symbols();
17798
- var assert44 = require("assert");
17798
+ var assert45 = require("assert");
17799
17799
  var { isArrayBuffer: isArrayBuffer3 } = nodeUtil.types;
17800
17800
  var textEncoder = new TextEncoder("utf-8");
17801
17801
  var Response14 = class _Response {
@@ -18059,7 +18059,7 @@ var require_response = __commonJS({
18059
18059
  return p7 in state2 ? state2[p7] : target[p7];
18060
18060
  },
18061
18061
  set(target, p7, value) {
18062
- assert44(!(p7 in state2));
18062
+ assert45(!(p7 in state2));
18063
18063
  target[p7] = value;
18064
18064
  return true;
18065
18065
  }
@@ -18094,12 +18094,12 @@ var require_response = __commonJS({
18094
18094
  body: null
18095
18095
  });
18096
18096
  } else {
18097
- assert44(false);
18097
+ assert45(false);
18098
18098
  }
18099
18099
  }
18100
18100
  __name(filterResponse, "filterResponse");
18101
18101
  function makeAppropriateNetworkError(fetchParams, err = null) {
18102
- assert44(isCancelled(fetchParams));
18102
+ assert45(isCancelled(fetchParams));
18103
18103
  return isAborted2(fetchParams) ? makeNetworkError(Object.assign(new DOMException("The operation was aborted.", "AbortError"), { cause: err })) : makeNetworkError(Object.assign(new DOMException("Request was cancelled."), { cause: err }));
18104
18104
  }
18105
18105
  __name(makeAppropriateNetworkError, "makeAppropriateNetworkError");
@@ -18234,7 +18234,7 @@ var require_request2 = __commonJS({
18234
18234
  var { webidl } = require_webidl();
18235
18235
  var { URLSerializer } = require_data_url();
18236
18236
  var { kConstruct } = require_symbols();
18237
- var assert44 = require("assert");
18237
+ var assert45 = require("assert");
18238
18238
  var { getMaxListeners, setMaxListeners, defaultMaxListeners } = require("events");
18239
18239
  var kAbortController = Symbol("abortController");
18240
18240
  var requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {
@@ -18315,7 +18315,7 @@ var require_request2 = __commonJS({
18315
18315
  request4 = makeRequest({ urlList: [parsedURL] });
18316
18316
  fallbackMode = "cors";
18317
18317
  } else {
18318
- assert44(webidl.is.Request(input));
18318
+ assert45(webidl.is.Request(input));
18319
18319
  request4 = input.#state;
18320
18320
  signal = input.#signal;
18321
18321
  this.#dispatcher = init4.dispatcher || input.#dispatcher;
@@ -19012,7 +19012,7 @@ var require_fetch = __commonJS({
19012
19012
  createInflate,
19013
19013
  extractMimeType
19014
19014
  } = require_util2();
19015
- var assert44 = require("assert");
19015
+ var assert45 = require("assert");
19016
19016
  var { safelyExtractBody, extractBody } = require_body();
19017
19017
  var {
19018
19018
  redirectStatusSet,
@@ -19095,7 +19095,7 @@ var require_fetch = __commonJS({
19095
19095
  requestObject.signal,
19096
19096
  () => {
19097
19097
  locallyAborted = true;
19098
- assert44(controller != null);
19098
+ assert45(controller != null);
19099
19099
  controller.abort(requestObject.signal.reason);
19100
19100
  const realResponse = responseObject?.deref();
19101
19101
  abortFetch(p7, request4, realResponse, requestObject.signal.reason);
@@ -19201,7 +19201,7 @@ var require_fetch = __commonJS({
19201
19201
  dispatcher = getGlobalDispatcher2()
19202
19202
  // undici
19203
19203
  }) {
19204
- assert44(dispatcher);
19204
+ assert45(dispatcher);
19205
19205
  let taskDestination = null;
19206
19206
  let crossOriginIsolatedCapability = false;
19207
19207
  if (request4.client != null) {
@@ -19224,7 +19224,7 @@ var require_fetch = __commonJS({
19224
19224
  taskDestination,
19225
19225
  crossOriginIsolatedCapability
19226
19226
  };
19227
- assert44(!request4.body || request4.body.stream);
19227
+ assert45(!request4.body || request4.body.stream);
19228
19228
  if (request4.window === "client") {
19229
19229
  request4.window = request4.client?.globalObject?.constructor?.name === "Window" ? request4.client : "no-window";
19230
19230
  }
@@ -19314,7 +19314,7 @@ var require_fetch = __commonJS({
19314
19314
  } else if (request4.responseTainting === "opaque") {
19315
19315
  response = filterResponse(response, "opaque");
19316
19316
  } else {
19317
- assert44(false);
19317
+ assert45(false);
19318
19318
  }
19319
19319
  }
19320
19320
  let internalResponse = response.status === 0 ? response : response.internalResponse;
@@ -19548,7 +19548,7 @@ var require_fetch = __commonJS({
19548
19548
  } else if (request4.redirect === "follow") {
19549
19549
  response = await httpRedirectFetch(fetchParams, response);
19550
19550
  } else {
19551
- assert44(false);
19551
+ assert45(false);
19552
19552
  }
19553
19553
  }
19554
19554
  response.timingInfo = timingInfo;
@@ -19602,7 +19602,7 @@ var require_fetch = __commonJS({
19602
19602
  request4.headersList.delete("host", true);
19603
19603
  }
19604
19604
  if (request4.body != null) {
19605
- assert44(request4.body.source != null);
19605
+ assert45(request4.body.source != null);
19606
19606
  request4.body = safelyExtractBody(request4.body.source)[0];
19607
19607
  }
19608
19608
  const timingInfo = fetchParams.timingInfo;
@@ -19737,7 +19737,7 @@ var require_fetch = __commonJS({
19737
19737
  }
19738
19738
  __name(httpNetworkOrCacheFetch, "httpNetworkOrCacheFetch");
19739
19739
  async function httpNetworkFetch(fetchParams, includeCredentials = false, forceNewConnection = false) {
19740
- assert44(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed);
19740
+ assert45(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed);
19741
19741
  fetchParams.controller.connection = {
19742
19742
  abort: null,
19743
19743
  destroyed: false,
@@ -20051,7 +20051,7 @@ var require_util3 = __commonJS({
20051
20051
  "../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/web/cache/util.js"(exports2, module3) {
20052
20052
  "use strict";
20053
20053
  init_import_meta_url();
20054
- var assert44 = require("assert");
20054
+ var assert45 = require("assert");
20055
20055
  var { URLSerializer } = require_data_url();
20056
20056
  var { isValidHeaderName } = require_util2();
20057
20057
  function urlEquals(A4, B4, excludeFragment = false) {
@@ -20061,7 +20061,7 @@ var require_util3 = __commonJS({
20061
20061
  }
20062
20062
  __name(urlEquals, "urlEquals");
20063
20063
  function getFieldValues(header) {
20064
- assert44(header !== null);
20064
+ assert45(header !== null);
20065
20065
  const values = [];
20066
20066
  for (let value of header.split(",")) {
20067
20067
  value = value.trim();
@@ -20084,7 +20084,7 @@ var require_cache3 = __commonJS({
20084
20084
  "../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/web/cache/cache.js"(exports2, module3) {
20085
20085
  "use strict";
20086
20086
  init_import_meta_url();
20087
- var assert44 = require("assert");
20087
+ var assert45 = require("assert");
20088
20088
  var { kConstruct } = require_symbols();
20089
20089
  var { urlEquals, getFieldValues } = require_util3();
20090
20090
  var { kEnumerableProperty, isDisturbed } = require_util();
@@ -20337,7 +20337,7 @@ var require_cache3 = __commonJS({
20337
20337
  return false;
20338
20338
  }
20339
20339
  } else {
20340
- assert44(typeof request4 === "string");
20340
+ assert45(typeof request4 === "string");
20341
20341
  r8 = getRequestState(new Request7(request4));
20342
20342
  }
20343
20343
  const operations = [];
@@ -20448,7 +20448,7 @@ var require_cache3 = __commonJS({
20448
20448
  }
20449
20449
  for (const requestResponse of requestResponses) {
20450
20450
  const idx = cache6.indexOf(requestResponse);
20451
- assert44(idx !== -1);
20451
+ assert45(idx !== -1);
20452
20452
  cache6.splice(idx, 1);
20453
20453
  }
20454
20454
  } else if (operation.type === "put") {
@@ -20480,7 +20480,7 @@ var require_cache3 = __commonJS({
20480
20480
  requestResponses = this.#queryCache(operation.request);
20481
20481
  for (const requestResponse of requestResponses) {
20482
20482
  const idx = cache6.indexOf(requestResponse);
20483
- assert44(idx !== -1);
20483
+ assert45(idx !== -1);
20484
20484
  cache6.splice(idx, 1);
20485
20485
  }
20486
20486
  cache6.push([operation.request, operation.response]);
@@ -20947,7 +20947,7 @@ var require_parse = __commonJS({
20947
20947
  var { maxNameValuePairSize, maxAttributeValueSize } = require_constants4();
20948
20948
  var { isCTLExcludingHtab } = require_util4();
20949
20949
  var { collectASequenceOfCodePointsFast } = require_data_url();
20950
- var assert44 = require("assert");
20950
+ var assert45 = require("assert");
20951
20951
  var { unescape: unescape2 } = require("querystring");
20952
20952
  function parseSetCookie(header) {
20953
20953
  if (isCTLExcludingHtab(header)) {
@@ -20991,7 +20991,7 @@ var require_parse = __commonJS({
20991
20991
  if (unparsedAttributes.length === 0) {
20992
20992
  return cookieAttributeList;
20993
20993
  }
20994
- assert44(unparsedAttributes[0] === ";");
20994
+ assert45(unparsedAttributes[0] === ";");
20995
20995
  unparsedAttributes = unparsedAttributes.slice(1);
20996
20996
  let cookieAv = "";
20997
20997
  if (unparsedAttributes.includes(";")) {
@@ -21878,7 +21878,7 @@ var require_connection = __commonJS({
21878
21878
  var { Headers: Headers7, getHeadersList } = require_headers();
21879
21879
  var { getDecodeSplit } = require_util2();
21880
21880
  var { WebsocketFrameSend } = require_frame();
21881
- var assert44 = require("assert");
21881
+ var assert45 = require("assert");
21882
21882
  var crypto8;
21883
21883
  try {
21884
21884
  crypto8 = require("crypto");
@@ -21979,7 +21979,7 @@ var require_connection = __commonJS({
21979
21979
  if (reason.length !== 0 && code === null) {
21980
21980
  code = 1e3;
21981
21981
  }
21982
- assert44(code === null || Number.isInteger(code));
21982
+ assert45(code === null || Number.isInteger(code));
21983
21983
  if (code === null && reason.length === 0) {
21984
21984
  frame.frameData = emptyBuffer;
21985
21985
  } else if (code !== null && reason === null) {
@@ -22084,7 +22084,7 @@ var require_receiver = __commonJS({
22084
22084
  "use strict";
22085
22085
  init_import_meta_url();
22086
22086
  var { Writable: Writable5 } = require("stream");
22087
- var assert44 = require("assert");
22087
+ var assert45 = require("assert");
22088
22088
  var { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = require_constants5();
22089
22089
  var {
22090
22090
  isValidStatusCode,
@@ -22324,7 +22324,7 @@ var require_receiver = __commonJS({
22324
22324
  return output;
22325
22325
  }
22326
22326
  parseCloseBody(data) {
22327
- assert44(data.length !== 1);
22327
+ assert45(data.length !== 1);
22328
22328
  let code;
22329
22329
  if (data.length >= 2) {
22330
22330
  code = data.readUInt16BE(0);
@@ -33817,7 +33817,7 @@ var require_signal_exit = __commonJS({
33817
33817
  };
33818
33818
  };
33819
33819
  } else {
33820
- assert44 = require("assert");
33820
+ assert45 = require("assert");
33821
33821
  signals = require_signals();
33822
33822
  isWin = /^win/i.test(process11.platform);
33823
33823
  EE = require("events");
@@ -33840,7 +33840,7 @@ var require_signal_exit = __commonJS({
33840
33840
  return function() {
33841
33841
  };
33842
33842
  }
33843
- assert44.equal(typeof cb2, "function", "a callback must be provided for exit handler");
33843
+ assert45.equal(typeof cb2, "function", "a callback must be provided for exit handler");
33844
33844
  if (loaded === false) {
33845
33845
  load();
33846
33846
  }
@@ -33946,7 +33946,7 @@ var require_signal_exit = __commonJS({
33946
33946
  }
33947
33947
  }, "processEmit");
33948
33948
  }
33949
- var assert44;
33949
+ var assert45;
33950
33950
  var signals;
33951
33951
  var isWin;
33952
33952
  var EE;
@@ -93898,7 +93898,7 @@ var name, version;
93898
93898
  var init_package = __esm({
93899
93899
  "package.json"() {
93900
93900
  name = "wrangler";
93901
- version = "4.42.2";
93901
+ version = "4.43.0";
93902
93902
  }
93903
93903
  });
93904
93904
 
@@ -121565,23 +121565,34 @@ async function convertBindingsToCfWorkerInitBindings(inputBindings) {
121565
121565
  worker_loaders: void 0
121566
121566
  };
121567
121567
  const fetchers = {};
121568
- for (const [name2, binding] of Object.entries(inputBindings ?? {})) {
121568
+ const bindingEntries = Array.isArray(inputBindings) ? inputBindings.map((b7) => [b7.name, b7]) : Object.entries(inputBindings ?? {});
121569
+ for (const [name2, binding] of bindingEntries) {
121569
121570
  if (binding.type === "plain_text") {
121570
121571
  bindings.vars ??= {};
121571
- bindings.vars[name2] = binding.value;
121572
+ bindings.vars[name2] = "value" in binding ? binding.value : binding.text;
121572
121573
  } else if (binding.type === "json") {
121573
121574
  bindings.vars ??= {};
121574
- bindings.vars[name2] = binding.value;
121575
+ bindings.vars[name2] = "value" in binding ? binding.value : binding.json;
121575
121576
  } else if (binding.type === "kv_namespace") {
121576
121577
  bindings.kv_namespaces ??= [];
121577
- bindings.kv_namespaces.push({ ...binding, binding: name2 });
121578
+ bindings.kv_namespaces.push({
121579
+ ...omitType(binding),
121580
+ binding: name2,
121581
+ id: "namespace_id" in binding ? binding.namespace_id : binding.id
121582
+ });
121578
121583
  } else if (binding.type === "send_email") {
121579
121584
  bindings.send_email ??= [];
121580
- bindings.send_email.push({ ...binding, name: name2 });
121585
+ bindings.send_email.push({ ...omitType(binding), name: name2 });
121581
121586
  } else if (binding.type === "wasm_module") {
121587
+ if (!("source" in binding)) {
121588
+ continue;
121589
+ }
121582
121590
  bindings.wasm_modules ??= {};
121583
121591
  bindings.wasm_modules[name2] = await getBinaryFileContents(binding.source);
121584
121592
  } else if (binding.type === "text_blob") {
121593
+ if (!("source" in binding)) {
121594
+ continue;
121595
+ }
121585
121596
  bindings.text_blobs ??= {};
121586
121597
  if (typeof binding.source.path === "string") {
121587
121598
  bindings.text_blobs[name2] = binding.source.path;
@@ -121591,72 +121602,97 @@ async function convertBindingsToCfWorkerInitBindings(inputBindings) {
121591
121602
  );
121592
121603
  }
121593
121604
  } else if (binding.type === "data_blob") {
121605
+ if (!("source" in binding)) {
121606
+ continue;
121607
+ }
121594
121608
  bindings.data_blobs ??= {};
121595
121609
  bindings.data_blobs[name2] = await getBinaryFileContents(binding.source);
121596
121610
  } else if (binding.type === "browser") {
121597
- bindings.browser = { ...binding, binding: name2 };
121611
+ bindings.browser = { ...omitType(binding), binding: name2 };
121598
121612
  } else if (binding.type === "ai") {
121599
- bindings.ai = { ...binding, binding: name2 };
121613
+ bindings.ai = { ...omitType(binding), binding: name2 };
121600
121614
  } else if (binding.type === "images") {
121601
- bindings.images = { ...binding, binding: name2 };
121615
+ bindings.images = { ...omitType(binding), binding: name2 };
121602
121616
  } else if (binding.type === "version_metadata") {
121603
121617
  bindings.version_metadata = { binding: name2 };
121604
121618
  } else if (binding.type === "durable_object_namespace") {
121605
121619
  bindings.durable_objects ??= { bindings: [] };
121606
- bindings.durable_objects.bindings.push({ ...binding, name: name2 });
121620
+ bindings.durable_objects.bindings.push({
121621
+ ...omitType(binding),
121622
+ name: name2
121623
+ });
121607
121624
  } else if (binding.type === "queue") {
121608
121625
  bindings.queues ??= [];
121609
- bindings.queues.push({ ...binding, binding: name2 });
121626
+ bindings.queues.push({ ...omitType(binding), binding: name2 });
121610
121627
  } else if (binding.type === "r2_bucket") {
121611
121628
  bindings.r2_buckets ??= [];
121612
- bindings.r2_buckets.push({ ...binding, binding: name2 });
121629
+ bindings.r2_buckets.push({ ...omitType(binding), binding: name2 });
121613
121630
  } else if (binding.type === "d1") {
121614
121631
  bindings.d1_databases ??= [];
121615
- bindings.d1_databases.push({ ...binding, binding: name2 });
121632
+ bindings.d1_databases.push({
121633
+ ...omitType(binding),
121634
+ binding: name2,
121635
+ database_id: "id" in binding ? binding.id : binding.database_id
121636
+ });
121616
121637
  } else if (binding.type === "vectorize") {
121617
121638
  bindings.vectorize ??= [];
121618
- bindings.vectorize.push({ ...binding, binding: name2 });
121639
+ bindings.vectorize.push({ ...omitType(binding), binding: name2 });
121619
121640
  } else if (binding.type === "hyperdrive") {
121620
121641
  bindings.hyperdrive ??= [];
121621
- bindings.hyperdrive.push({ ...binding, binding: name2 });
121642
+ bindings.hyperdrive.push({ ...omitType(binding), binding: name2 });
121622
121643
  } else if (binding.type === "service") {
121623
121644
  bindings.services ??= [];
121624
- bindings.services.push({ ...binding, binding: name2 });
121645
+ bindings.services.push({ ...omitType(binding), binding: name2 });
121625
121646
  } else if (binding.type === "fetcher") {
121626
121647
  fetchers[name2] = binding.fetcher;
121627
121648
  } else if (binding.type === "analytics_engine") {
121628
121649
  bindings.analytics_engine_datasets ??= [];
121629
- bindings.analytics_engine_datasets.push({ ...binding, binding: name2 });
121650
+ bindings.analytics_engine_datasets.push({
121651
+ ...omitType(binding),
121652
+ binding: name2
121653
+ });
121630
121654
  } else if (binding.type === "dispatch_namespace") {
121631
121655
  bindings.dispatch_namespaces ??= [];
121632
- bindings.dispatch_namespaces.push({ ...binding, binding: name2 });
121656
+ const outbound = binding.outbound && "worker" in binding.outbound ? {
121657
+ service: binding.outbound.worker.service,
121658
+ environment: binding.outbound.worker.environment,
121659
+ parameters: binding.outbound.params?.map((p7) => p7.name)
121660
+ } : binding.outbound;
121661
+ bindings.dispatch_namespaces.push({
121662
+ ...omitType(binding),
121663
+ binding: name2,
121664
+ outbound
121665
+ });
121633
121666
  } else if (binding.type === "mtls_certificate") {
121634
121667
  bindings.mtls_certificates ??= [];
121635
- bindings.mtls_certificates.push({ ...binding, binding: name2 });
121668
+ bindings.mtls_certificates.push({ ...omitType(binding), binding: name2 });
121636
121669
  } else if (binding.type === "pipeline") {
121637
121670
  bindings.pipelines ??= [];
121638
- bindings.pipelines.push({ ...binding, binding: name2 });
121671
+ bindings.pipelines.push({ ...omitType(binding), binding: name2 });
121639
121672
  } else if (binding.type === "logfwdr") {
121640
121673
  bindings.logfwdr ??= { bindings: [] };
121641
- bindings.logfwdr.bindings.push({ ...binding, name: name2 });
121674
+ bindings.logfwdr.bindings.push({ ...omitType(binding), name: name2 });
121642
121675
  } else if (binding.type === "workflow") {
121643
121676
  bindings.workflows ??= [];
121644
- bindings.workflows.push({ ...binding, binding: name2 });
121677
+ bindings.workflows.push({ ...omitType(binding), binding: name2 });
121645
121678
  } else if (binding.type === "secrets_store_secret") {
121646
121679
  bindings.secrets_store_secrets ??= [];
121647
- bindings.secrets_store_secrets.push({ ...binding, binding: name2 });
121680
+ bindings.secrets_store_secrets.push({
121681
+ ...omitType(binding),
121682
+ binding: name2
121683
+ });
121648
121684
  } else if (binding.type === "unsafe_hello_world") {
121649
121685
  bindings.unsafe_hello_world ??= [];
121650
- bindings.unsafe_hello_world.push({ ...binding, binding: name2 });
121686
+ bindings.unsafe_hello_world.push({ ...omitType(binding), binding: name2 });
121651
121687
  } else if (binding.type === "ratelimit") {
121652
121688
  bindings.ratelimits ??= [];
121653
- bindings.ratelimits.push({ ...binding, name: name2 });
121689
+ bindings.ratelimits.push({ ...omitType(binding), name: name2 });
121654
121690
  } else if (binding.type === "worker_loader") {
121655
121691
  bindings.worker_loaders ??= [];
121656
- bindings.worker_loaders.push({ ...binding, binding: name2 });
121692
+ bindings.worker_loaders.push({ ...omitType(binding), binding: name2 });
121657
121693
  } else if (binding.type === "vpc_service") {
121658
121694
  bindings.vpc_services ??= [];
121659
- bindings.vpc_services.push({ ...binding, binding: name2 });
121695
+ bindings.vpc_services.push({ ...omitType(binding), binding: name2 });
121660
121696
  } else if (isUnsafeBindingType(binding.type)) {
121661
121697
  bindings.unsafe ??= {
121662
121698
  bindings: [],
@@ -121676,6 +121712,12 @@ async function convertBindingsToCfWorkerInitBindings(inputBindings) {
121676
121712
  function isUnsafeBindingType(type) {
121677
121713
  return type.startsWith("unsafe_");
121678
121714
  }
121715
+ function omitType({
121716
+ type: _5,
121717
+ ...value
121718
+ }) {
121719
+ return value;
121720
+ }
121679
121721
  function extractBindingsOfType(type, bindings) {
121680
121722
  return Object.entries(bindings ?? {}).filter(
121681
121723
  (binding) => binding[1].type === type
@@ -121699,6 +121741,7 @@ var init_utils4 = __esm({
121699
121741
  __name(convertCfWorkerInitBindingsToBindings, "convertCfWorkerInitBindingsToBindings");
121700
121742
  __name(convertBindingsToCfWorkerInitBindings, "convertBindingsToCfWorkerInitBindings");
121701
121743
  __name(isUnsafeBindingType, "isUnsafeBindingType");
121744
+ __name(omitType, "omitType");
121702
121745
  __name(extractBindingsOfType, "extractBindingsOfType");
121703
121746
  }
121704
121747
  });
@@ -127506,7 +127549,7 @@ async function buildAndMaybePush(args, pathToDocker, push2, containerConfig) {
127506
127549
  if (push2) {
127507
127550
  const imageInfo = await dockerImageInspect(pathToDocker, {
127508
127551
  imageTag,
127509
- formatString: "{{ json .RepoDigests }} {{ .Id }}"
127552
+ formatString: "{{ json .RepoDigests }}"
127510
127553
  });
127511
127554
  logger.debug(`'docker image inspect ${imageTag}':`, imageInfo);
127512
127555
  const account = await loadAccount();
@@ -127518,7 +127561,7 @@ async function buildAndMaybePush(args, pathToDocker, push2, containerConfig) {
127518
127561
  });
127519
127562
  await dockerLoginManagedRegistry(pathToDocker);
127520
127563
  try {
127521
- const [digests, imageId] = imageInfo.split(" ");
127564
+ const [digests] = imageInfo.split(" ");
127522
127565
  const parsedDigests = JSON.parse(digests);
127523
127566
  if (!Array.isArray(parsedDigests)) {
127524
127567
  throw new Error(
@@ -127529,13 +127572,17 @@ async function buildAndMaybePush(args, pathToDocker, push2, containerConfig) {
127529
127572
  account.external_account_id,
127530
127573
  imageTag
127531
127574
  ).split(":")[0];
127532
- const [digest, ...rest] = parsedDigests.filter((d7) => {
127575
+ logger.debug("respositoryOnly:", repositoryOnly);
127576
+ const digest = parsedDigests.find((d7) => {
127533
127577
  const resolved = resolveImageName(account.external_account_id, d7);
127578
+ logger.debug(
127579
+ `Comparing ${resolved.split("@")[0]} to ${repositoryOnly}`
127580
+ );
127534
127581
  return typeof d7 === "string" && resolved.split("@")[0] === repositoryOnly;
127535
127582
  });
127536
- if (rest.length > 0) {
127583
+ if (!digest) {
127537
127584
  throw new Error(
127538
- `Expected there to only be 1 valid digests for this repository: ${repositoryOnly} but there were ${rest.length + 1}`
127585
+ `Could not find a digest for the image ${repositoryOnly}. Found digests: ${parsedDigests.join(", ")}`
127539
127586
  );
127540
127587
  }
127541
127588
  const [image, hash] = digest.split("@");
@@ -127544,18 +127591,17 @@ async function buildAndMaybePush(args, pathToDocker, push2, containerConfig) {
127544
127591
  image
127545
127592
  );
127546
127593
  const remoteDigest = `${resolvedImage}@${hash}`;
127594
+ logger.debug(
127595
+ `'docker manifest inspect -v ${resolveImageName(account.external_account_id, remoteDigest)}:`
127596
+ );
127547
127597
  const remoteManifest = runDockerCmdWithOutput(pathToDocker, [
127548
127598
  "manifest",
127549
127599
  "inspect",
127550
127600
  "-v",
127551
- remoteDigest
127601
+ resolveImageName(account.external_account_id, remoteDigest)
127552
127602
  ]);
127553
- logger.debug(
127554
- `'docker manifest inspect -v ${remoteDigest}:`,
127555
- remoteManifest
127556
- );
127557
127603
  const parsedRemoteManifest = JSON.parse(remoteManifest);
127558
- if (parsedRemoteManifest.Descriptor.digest === imageId) {
127604
+ if (parsedRemoteManifest.Descriptor.digest === hash) {
127559
127605
  logger.log("Image already exists remotely, skipping push");
127560
127606
  logger.debug(
127561
127607
  `Untagging built image: ${args.tag} since there was no change.`
@@ -127579,7 +127625,6 @@ async function buildAndMaybePush(args, pathToDocker, push2, containerConfig) {
127579
127625
  );
127580
127626
  await runDockerCmd(pathToDocker, ["tag", imageTag, namespacedImageTag]);
127581
127627
  await runDockerCmd(pathToDocker, ["push", namespacedImageTag]);
127582
- await runDockerCmd(pathToDocker, ["image", "rm", namespacedImageTag]);
127583
127628
  }
127584
127629
  return { newTag: imageTag };
127585
127630
  } catch (error2) {
@@ -138268,7 +138313,26 @@ async function deleteKVBulkKeyValue(complianceConfig, accountId, namespaceId, ke
138268
138313
  logBulkProgress("delete", keys.length, keys.length);
138269
138314
  }
138270
138315
  }
138271
- function getKVNamespaceId({ preview, binding, "namespace-id": namespaceId }, config) {
138316
+ async function getIdFromSettings(config, binding, isLocal2) {
138317
+ if (isLocal2) {
138318
+ return binding;
138319
+ }
138320
+ const accountId = await requireAuth(config);
138321
+ if (!config.name) {
138322
+ throw new UserError2("No Worker name found in config");
138323
+ }
138324
+ const settings = await getSettings(config, accountId, config.name);
138325
+ const existingKV = settings?.bindings.find(
138326
+ (existing) => existing.type === "kv_namespace" && existing.name === binding
138327
+ );
138328
+ if (!existingKV || !("namespace_id" in existingKV)) {
138329
+ throw new UserError2(
138330
+ `No namespace ID found for binding "${binding}". Add one to your wrangler config file or pass it via \`--namespace-id\`.`
138331
+ );
138332
+ }
138333
+ return existingKV.namespace_id;
138334
+ }
138335
+ async function getKVNamespaceId({ preview, binding, "namespace-id": namespaceId }, config, isLocal2) {
138272
138336
  if (namespaceId) {
138273
138337
  return namespaceId;
138274
138338
  }
@@ -138304,13 +138368,20 @@ function getKVNamespaceId({ preview, binding, "namespace-id": namespaceId }, con
138304
138368
  namespaceId = namespace.id;
138305
138369
  return namespaceId;
138306
138370
  } else if (previewIsDefined) {
138371
+ if (getFlag("RESOURCES_PROVISION")) {
138372
+ (0, import_node_assert12.default)(binding);
138373
+ return getIdFromSettings(config, binding, isLocal2);
138374
+ }
138307
138375
  throw new UserError2(
138308
- `No namespace ID found for ${binding}. Add one to your wrangler config file to use a separate namespace for previewing your worker.`
138376
+ `No namespace ID found for ${binding}. Add one to your wrangler config file or pass it via \`--namespace-id\`.`
138309
138377
  );
138310
138378
  }
138311
138379
  const bindingHasOnlyOneId = namespace.id && !namespace.preview_id || !namespace.id && namespace.preview_id;
138312
138380
  if (bindingHasOnlyOneId) {
138313
138381
  namespaceId = namespace.id || namespace.preview_id;
138382
+ } else if (getFlag("RESOURCES_PROVISION") && !namespace.id && !namespace.preview_id) {
138383
+ (0, import_node_assert12.default)(binding);
138384
+ return getIdFromSettings(config, binding, isLocal2);
138314
138385
  } else {
138315
138386
  throw new UserError2(
138316
138387
  `${binding} has both a namespace ID and a preview ID. Specify "--preview" or "--preview false" to avoid writing data to the wrong namespace.`
@@ -138338,19 +138409,23 @@ async function usingLocalNamespace(persistTo, config, namespaceId, closure) {
138338
138409
  await mf.dispose();
138339
138410
  }
138340
138411
  }
138341
- var import_node_buffer2, import_node_url8, import_miniflare9, import_undici4, API_MAX, BATCH_KEY_MAX, BATCH_MAX_ERRORS_WARNINGS, KeyValueKeys, formatNumber;
138412
+ var import_node_assert12, import_node_buffer2, import_node_url8, import_miniflare9, import_undici4, API_MAX, BATCH_KEY_MAX, BATCH_MAX_ERRORS_WARNINGS, KeyValueKeys, formatNumber;
138342
138413
  var init_helpers4 = __esm({
138343
138414
  "src/kv/helpers.ts"() {
138344
138415
  init_import_meta_url();
138416
+ import_node_assert12 = __toESM(require("assert"));
138345
138417
  import_node_buffer2 = require("buffer");
138346
138418
  import_node_url8 = require("url");
138347
138419
  import_miniflare9 = require("miniflare");
138348
138420
  import_undici4 = __toESM(require_undici());
138349
138421
  init_cfetch();
138422
+ init_bindings2();
138350
138423
  init_get_local_persistence_path();
138351
138424
  init_miniflare();
138352
138425
  init_errors();
138426
+ init_experimental_flags();
138353
138427
  init_logger();
138428
+ init_user3();
138354
138429
  API_MAX = 1e4;
138355
138430
  BATCH_KEY_MAX = API_MAX / 10;
138356
138431
  BATCH_MAX_ERRORS_WARNINGS = 12;
@@ -138383,6 +138458,7 @@ var init_helpers4 = __esm({
138383
138458
  __name(getKVBulkKeyValue, "getKVBulkKeyValue");
138384
138459
  __name(putKVBulkKeyValue, "putKVBulkKeyValue");
138385
138460
  __name(deleteKVBulkKeyValue, "deleteKVBulkKeyValue");
138461
+ __name(getIdFromSettings, "getIdFromSettings");
138386
138462
  __name(getKVNamespaceId, "getKVNamespaceId");
138387
138463
  __name(usingLocalNamespace, "usingLocalNamespace");
138388
138464
  }
@@ -138912,7 +138988,7 @@ var init_metrics2 = __esm({
138912
138988
 
138913
138989
  // src/utils/isLegacyEnv.ts
138914
138990
  function isLegacyEnv(config) {
138915
- return config.legacy_env;
138991
+ return "legacy_env" in config ? config.legacy_env : !config.legacy.enableServiceEnvironments;
138916
138992
  }
138917
138993
  var init_isLegacyEnv = __esm({
138918
138994
  "src/utils/isLegacyEnv.ts"() {
@@ -138962,7 +139038,7 @@ function getBindings(config, options) {
138962
139038
  vpc_services: config?.vpc_services
138963
139039
  };
138964
139040
  }
138965
- async function collectPendingResources(complianceConfig, accountId, scriptName, bindings) {
139041
+ async function collectPendingResources(complianceConfig, accountId, scriptName, bindings, requireRemote) {
138966
139042
  let settings;
138967
139043
  try {
138968
139044
  settings = await getSettings(complianceConfig, accountId, scriptName);
@@ -138979,6 +139055,9 @@ async function collectPendingResources(complianceConfig, accountId, scriptName,
138979
139055
  HANDLERS
138980
139056
  )) {
138981
139057
  for (const resource of bindings[resourceType] ?? []) {
139058
+ if (requireRemote && !resource.remote) {
139059
+ continue;
139060
+ }
138982
139061
  const h7 = new HANDLERS[resourceType].Handler(
138983
139062
  resource,
138984
139063
  complianceConfig,
@@ -138997,14 +139076,20 @@ async function collectPendingResources(complianceConfig, accountId, scriptName,
138997
139076
  (a6, b7) => HANDLERS[a6.resourceType].sort - HANDLERS[b7.resourceType].sort
138998
139077
  );
138999
139078
  }
139000
- async function provisionBindings(bindings, accountId, scriptName, autoCreate, config) {
139079
+ async function provisionBindings(bindings, accountId, scriptName, autoCreate, config, requireRemote = false) {
139080
+ const configPath = config.userConfigPath ?? config.configPath;
139001
139081
  const pendingResources = await collectPendingResources(
139002
139082
  config,
139003
139083
  accountId,
139004
139084
  scriptName,
139005
- bindings
139085
+ bindings,
139086
+ requireRemote
139006
139087
  );
139007
139088
  if (pendingResources.length > 0) {
139089
+ (0, import_node_assert13.default)(
139090
+ configPath,
139091
+ "Provisioning resources is not possible without a config file"
139092
+ );
139008
139093
  if (!isLegacyEnv(config)) {
139009
139094
  throw new UserError2(
139010
139095
  "Provisioning resources is not supported with a service environment"
@@ -139029,6 +139114,44 @@ async function provisionBindings(bindings, accountId, scriptName, autoCreate, co
139029
139114
  autoCreate
139030
139115
  );
139031
139116
  }
139117
+ const patch = {};
139118
+ const allChanges = /* @__PURE__ */ new Map();
139119
+ for (const resource of pendingResources) {
139120
+ allChanges.set(resource.binding, resource.handler.binding);
139121
+ }
139122
+ for (const resourceType of Object.keys(
139123
+ HANDLERS
139124
+ )) {
139125
+ for (const binding of bindings[resourceType] ?? []) {
139126
+ patch[resourceType] ??= [];
139127
+ const bindingToWrite = allChanges.has(binding.binding) ? (
139128
+ // Gated by Map.has()
139129
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
139130
+ allChanges.get(binding.binding)
139131
+ ) : binding;
139132
+ patch[resourceType].push(
139133
+ Object.fromEntries(
139134
+ Object.entries(bindingToWrite).filter(
139135
+ // Make sure all the values are JSON serialisable.
139136
+ // Otherwise we end up with "undefined" in the config
139137
+ ([_5, value]) => typeof value === "string"
139138
+ )
139139
+ )
139140
+ );
139141
+ }
139142
+ }
139143
+ if (!isNonInteractiveOrCI()) {
139144
+ try {
139145
+ await experimental_patchConfig(configPath, patch, false);
139146
+ logger.log(
139147
+ "Your Worker was deployed with provisioned resources. We've written the IDs of these resources to your config file, which you can choose to save or discard. Either way future deploys will continue to work."
139148
+ );
139149
+ } catch (e8) {
139150
+ if (!(e8 instanceof PatchConfigError)) {
139151
+ throw e8;
139152
+ }
139153
+ }
139154
+ }
139032
139155
  const resourceCount = pendingResources.reduce(
139033
139156
  (acc, resource) => {
139034
139157
  acc[resource.resourceType] ??= 0;
@@ -139122,17 +139245,19 @@ async function runProvisioningFlow(item, preExisting, friendlyBindingName, scrip
139122
139245
  logger.log(`\u2728 ${item.binding} provisioned \u{1F389}`);
139123
139246
  printDivider();
139124
139247
  }
139125
- var import_node_assert12, INHERIT_SYMBOL, ProvisionResourceHandler, R2Handler, KVHandler, D1Handler, HANDLERS, LOADERS;
139248
+ var import_node_assert13, INHERIT_SYMBOL, ProvisionResourceHandler, R2Handler, KVHandler, D1Handler, HANDLERS, LOADERS;
139126
139249
  var init_bindings2 = __esm({
139127
139250
  "src/deployment-bundle/bindings.ts"() {
139128
139251
  init_import_meta_url();
139129
- import_node_assert12 = __toESM(require("assert"));
139252
+ import_node_assert13 = __toESM(require("assert"));
139130
139253
  init_cfetch();
139254
+ init_patch_config();
139131
139255
  init_create();
139132
139256
  init_list();
139133
139257
  init_utils5();
139134
139258
  init_dialogs();
139135
139259
  init_errors();
139260
+ init_is_interactive();
139136
139261
  init_helpers4();
139137
139262
  init_logger();
139138
139263
  init_metrics2();
@@ -139213,13 +139338,26 @@ var init_bindings2 = __esm({
139213
139338
  constructor(binding, complianceConfig, accountId) {
139214
139339
  super("r2_bucket", binding, "bucket_name", complianceConfig, accountId);
139215
139340
  }
139341
+ /**
139342
+ * Inheriting an R2 binding replaces the id property (bucket_name for R2) with the inheritance symbol.
139343
+ * This works when deploying (and is appropriate for all other binding types), but it means that the
139344
+ * bucket_name for an R2 bucket is not displayed when deploying. As such, only use the inheritance symbol
139345
+ * if the R2 binding has no `bucket_name`.
139346
+ */
139347
+ inherit() {
139348
+ this.binding.bucket_name ??= INHERIT_SYMBOL;
139349
+ }
139350
+ /**
139351
+ * R2 bindings can be inherited if the binding name and jurisdiction match.
139352
+ * Additionally, if the user has specified a bucket_name in config, make sure that matches
139353
+ */
139216
139354
  canInherit(settings) {
139217
139355
  return !!settings?.bindings.find(
139218
- (existing) => existing.type === this.type && existing.name === this.binding.binding && existing.jurisdiction === this.binding.jurisdiction
139356
+ (existing) => existing.type === this.type && existing.name === this.binding.binding && existing.jurisdiction === this.binding.jurisdiction && (this.binding.bucket_name ? this.binding.bucket_name === existing.bucket_name : true)
139219
139357
  );
139220
139358
  }
139221
139359
  async isConnectedToExistingResource() {
139222
- (0, import_node_assert12.default)(typeof this.binding.bucket_name !== "symbol");
139360
+ (0, import_node_assert13.default)(typeof this.binding.bucket_name !== "symbol");
139223
139361
  if (!this.binding.bucket_name) {
139224
139362
  return false;
139225
139363
  }
@@ -139299,7 +139437,7 @@ var init_bindings2 = __esm({
139299
139437
  return false;
139300
139438
  }
139301
139439
  async isConnectedToExistingResource() {
139302
- (0, import_node_assert12.default)(typeof this.binding.database_name !== "symbol");
139440
+ (0, import_node_assert13.default)(typeof this.binding.database_name !== "symbol");
139303
139441
  if (!this.binding.database_name) {
139304
139442
  return false;
139305
139443
  }
@@ -139623,7 +139761,7 @@ function fromMimeType(mimeType) {
139623
139761
  }
139624
139762
  return moduleType;
139625
139763
  }
139626
- function createWorkerUploadForm(worker) {
139764
+ function createWorkerUploadForm(worker, options) {
139627
139765
  const formData = new import_undici6.FormData();
139628
139766
  const {
139629
139767
  main: main2,
@@ -139677,6 +139815,9 @@ function createWorkerUploadForm(worker) {
139677
139815
  }
139678
139816
  });
139679
139817
  bindings.kv_namespaces?.forEach(({ id, binding, raw }) => {
139818
+ if (options?.dryRun) {
139819
+ id ??= INHERIT_SYMBOL;
139820
+ }
139680
139821
  if (id === void 0) {
139681
139822
  throw new UserError2(`${binding} bindings must have an "id" field`);
139682
139823
  }
@@ -139740,6 +139881,9 @@ function createWorkerUploadForm(worker) {
139740
139881
  });
139741
139882
  bindings.r2_buckets?.forEach(
139742
139883
  ({ binding, bucket_name, jurisdiction, raw }) => {
139884
+ if (options?.dryRun) {
139885
+ bucket_name ??= INHERIT_SYMBOL;
139886
+ }
139743
139887
  if (bucket_name === void 0) {
139744
139888
  throw new UserError2(
139745
139889
  `${binding} bindings must have a "bucket_name" field`
@@ -139763,6 +139907,9 @@ function createWorkerUploadForm(worker) {
139763
139907
  );
139764
139908
  bindings.d1_databases?.forEach(
139765
139909
  ({ binding, database_id, database_internal_env, raw }) => {
139910
+ if (options?.dryRun) {
139911
+ database_id ??= INHERIT_SYMBOL;
139912
+ }
139766
139913
  if (database_id === void 0) {
139767
139914
  throw new UserError2(
139768
139915
  `${binding} bindings must have a "database_id" field`
@@ -139979,7 +140126,7 @@ function createWorkerUploadForm(worker) {
139979
140126
  const manifestModuleName = "__STATIC_CONTENT_MANIFEST";
139980
140127
  const hasManifest = modules?.some(({ name: name2 }) => name2 === manifestModuleName);
139981
140128
  if (hasManifest && main2.type === "esm") {
139982
- (0, import_node_assert13.default)(modules !== void 0);
140129
+ (0, import_node_assert14.default)(modules !== void 0);
139983
140130
  const subDirs = new Set(
139984
140131
  modules.map((module3) => import_node_path24.default.posix.dirname(module3.name))
139985
140132
  );
@@ -140105,11 +140252,11 @@ function createWorkerUploadForm(worker) {
140105
140252
  }
140106
140253
  return formData;
140107
140254
  }
140108
- var import_node_assert13, import_node_fs15, import_node_path24, import_undici6, moduleTypeMimeType;
140255
+ var import_node_assert14, import_node_fs15, import_node_path24, import_undici6, moduleTypeMimeType;
140109
140256
  var init_create_worker_upload_form = __esm({
140110
140257
  "src/deployment-bundle/create-worker-upload-form.ts"() {
140111
140258
  init_import_meta_url();
140112
- import_node_assert13 = __toESM(require("assert"));
140259
+ import_node_assert14 = __toESM(require("assert"));
140113
140260
  import_node_fs15 = require("fs");
140114
140261
  import_node_path24 = __toESM(require("path"));
140115
140262
  import_undici6 = __toESM(require_undici());
@@ -140209,7 +140356,7 @@ var init_node_compat = __esm({
140209
140356
  // src/durable.ts
140210
140357
  async function getMigrationsToUpload(scriptName, props) {
140211
140358
  const { config, accountId } = props;
140212
- (0, import_node_assert14.default)(accountId, "Missing accountId");
140359
+ (0, import_node_assert15.default)(accountId, "Missing accountId");
140213
140360
  let migrations;
140214
140361
  if (config.migrations.length > 0) {
140215
140362
  let script;
@@ -140279,11 +140426,11 @@ async function getMigrationsToUpload(scriptName, props) {
140279
140426
  }
140280
140427
  return migrations;
140281
140428
  }
140282
- var import_node_assert14, suppressNotFoundError;
140429
+ var import_node_assert15, suppressNotFoundError;
140283
140430
  var init_durable = __esm({
140284
140431
  "src/durable.ts"() {
140285
140432
  init_import_meta_url();
140286
- import_node_assert14 = __toESM(require("assert"));
140433
+ import_node_assert15 = __toESM(require("assert"));
140287
140434
  init_cfetch();
140288
140435
  init_config5();
140289
140436
  init_logger();
@@ -140487,7 +140634,7 @@ async function syncWorkersSite(complianceConfig, accountId, scriptName, siteAsse
140487
140634
  logger.log("(Note: doing a dry run, not uploading or deleting anything.)");
140488
140635
  return { manifest: void 0, namespace: void 0 };
140489
140636
  }
140490
- (0, import_node_assert15.default)(accountId, "Missing accountId");
140637
+ (0, import_node_assert16.default)(accountId, "Missing accountId");
140491
140638
  const title = `__${scriptName}-workers_sites_assets${preview ? "_preview" : ""}`;
140492
140639
  const { id: namespace } = await createKVNamespaceIfNotAlreadyExisting(
140493
140640
  complianceConfig,
@@ -140705,11 +140852,11 @@ function getSiteAssetPaths(config, assetDirectory, includePatterns = config.site
140705
140852
  return void 0;
140706
140853
  }
140707
140854
  }
140708
- var import_node_assert15, import_promises9, path26, ALWAYS_IGNORE, HIDDEN_FILES_TO_INCLUDE, MAX_DIFF_LINES, MAX_BUCKET_SIZE2, MAX_BUCKET_KEYS, MAX_BATCH_OPERATIONS;
140855
+ var import_node_assert16, import_promises9, path26, ALWAYS_IGNORE, HIDDEN_FILES_TO_INCLUDE, MAX_DIFF_LINES, MAX_BUCKET_SIZE2, MAX_BUCKET_KEYS, MAX_BATCH_OPERATIONS;
140709
140856
  var init_sites2 = __esm({
140710
140857
  "src/sites.ts"() {
140711
140858
  init_import_meta_url();
140712
- import_node_assert15 = __toESM(require("assert"));
140859
+ import_node_assert16 = __toESM(require("assert"));
140713
140860
  import_promises9 = require("fs/promises");
140714
140861
  path26 = __toESM(require("path"));
140715
140862
  init_workers_shared();
@@ -152837,7 +152984,8 @@ function createHandler(def, commandName) {
152837
152984
  MULTIWORKER: false,
152838
152985
  RESOURCES_PROVISION: args.experimentalProvision ?? false,
152839
152986
  REMOTE_BINDINGS: args.experimentalRemoteBindings ?? false,
152840
- DEPLOY_REMOTE_DIFF_CHECK: false
152987
+ DEPLOY_REMOTE_DIFF_CHECK: false,
152988
+ AUTOCREATE_RESOURCES: args.experimentalAutoCreate
152841
152989
  };
152842
152990
  await run(experimentalFlags, () => {
152843
152991
  const config = def.behaviour?.provideConfig ?? true ? readConfig(args, {
@@ -153251,7 +153399,7 @@ async function executeLocally({
153251
153399
  } finally {
153252
153400
  await mf.dispose();
153253
153401
  }
153254
- (0, import_node_assert16.default)(Array.isArray(results));
153402
+ (0, import_node_assert17.default)(Array.isArray(results));
153255
153403
  const allResults = results.map((result) => ({
153256
153404
  results: (result.results ?? []).map(
153257
153405
  (row) => Object.fromEntries(
@@ -153506,12 +153654,12 @@ async function checkForSQLiteBinary(filename) {
153506
153654
  );
153507
153655
  }
153508
153656
  }
153509
- var import_fs16, import_node_assert16, import_node_path25, import_md5_file, import_miniflare12, import_undici8, d1ExecuteCommand;
153657
+ var import_fs16, import_node_assert17, import_node_path25, import_md5_file, import_miniflare12, import_undici8, d1ExecuteCommand;
153510
153658
  var init_execute = __esm({
153511
153659
  "src/d1/execute.ts"() {
153512
153660
  init_import_meta_url();
153513
153661
  import_fs16 = require("fs");
153514
- import_node_assert16 = __toESM(require("assert"));
153662
+ import_node_assert17 = __toESM(require("assert"));
153515
153663
  import_node_path25 = __toESM(require("path"));
153516
153664
  init_interactive();
153517
153665
  init_source();
@@ -155701,11 +155849,11 @@ ${jsonString}
155701
155849
  logger.log("\nProceeding with deployment...\n");
155702
155850
  return args;
155703
155851
  }
155704
- var import_node_assert17, import_node_fs20, import_node_path30, deployCommand;
155852
+ var import_node_assert18, import_node_fs20, import_node_path30, deployCommand;
155705
155853
  var init_deploy4 = __esm({
155706
155854
  "src/deploy/index.ts"() {
155707
155855
  init_import_meta_url();
155708
- import_node_assert17 = __toESM(require("assert"));
155856
+ import_node_assert18 = __toESM(require("assert"));
155709
155857
  import_node_fs20 = require("fs");
155710
155858
  import_node_path30 = __toESM(require("path"));
155711
155859
  init_source();
@@ -155915,13 +156063,6 @@ var init_deploy4 = __esm({
155915
156063
  describe: "Name of a dispatch namespace to deploy the Worker to (Workers for Platforms)",
155916
156064
  type: "string"
155917
156065
  },
155918
- "experimental-auto-create": {
155919
- describe: "Automatically provision draft bindings with new resources",
155920
- type: "boolean",
155921
- default: true,
155922
- hidden: true,
155923
- alias: "x-auto-create"
155924
- },
155925
156066
  "containers-rollout": {
155926
156067
  describe: "Rollout strategy for Containers changes. If set to immediate, it will override `rollout_percentage_steps` if configured and roll out to 100% of instances in one step. ",
155927
156068
  choices: ["immediate", "gradual"]
@@ -155944,7 +156085,8 @@ var init_deploy4 = __esm({
155944
156085
  MULTIWORKER: false,
155945
156086
  RESOURCES_PROVISION: args.experimentalProvision ?? false,
155946
156087
  REMOTE_BINDINGS: args.experimentalRemoteBindings ?? true,
155947
- DEPLOY_REMOTE_DIFF_CHECK: args.experimentalDeployRemoteDiffCheck ?? false
156088
+ DEPLOY_REMOTE_DIFF_CHECK: args.experimentalDeployRemoteDiffCheck ?? false,
156089
+ AUTOCREATE_RESOURCES: args.experimentalAutoCreate
155948
156090
  }), "overrideExperimentalFlags"),
155949
156091
  warnIfMultipleEnvsConfiguredButNoneSpecified: true
155950
156092
  },
@@ -156016,7 +156158,7 @@ var init_deploy4 = __esm({
156016
156158
  );
156017
156159
  }
156018
156160
  if (!args.dryRun) {
156019
- (0, import_node_assert17.default)(accountId, "Missing account ID");
156161
+ (0, import_node_assert18.default)(accountId, "Missing account ID");
156020
156162
  await verifyWorkerMatchesCITag(
156021
156163
  config,
156022
156164
  accountId,
@@ -156295,8 +156437,8 @@ async function runSearch(searchTerm) {
156295
156437
  hitsPerPage: "1",
156296
156438
  getRankingInfo: "0"
156297
156439
  });
156298
- (0, import_node_assert18.default)(id, "Missing Algolia App ID");
156299
- (0, import_node_assert18.default)(key, "Missing Algolia Key");
156440
+ (0, import_node_assert19.default)(id, "Missing Algolia App ID");
156441
+ (0, import_node_assert19.default)(key, "Missing Algolia Key");
156300
156442
  const searchResp = await (0, import_undici10.fetch)(
156301
156443
  `https://${id}-dsn.algolia.net/1/indexes/${index}/query`,
156302
156444
  {
@@ -156325,11 +156467,11 @@ async function runSearch(searchTerm) {
156325
156467
  return;
156326
156468
  }
156327
156469
  }
156328
- var import_node_assert18, import_undici10;
156470
+ var import_node_assert19, import_undici10;
156329
156471
  var init_helpers7 = __esm({
156330
156472
  "src/docs/helpers.ts"() {
156331
156473
  init_import_meta_url();
156332
- import_node_assert18 = __toESM(require("assert"));
156474
+ import_node_assert19 = __toESM(require("assert"));
156333
156475
  import_undici10 = __toESM(require_undici());
156334
156476
  init_logger();
156335
156477
  __name(runSearch, "runSearch");
@@ -157408,13 +157550,12 @@ async function downloadWorker(accountId, workerName) {
157408
157550
  config
157409
157551
  };
157410
157552
  }
157411
- var import_promises13, import_node_path31, import_toml5, init2;
157553
+ var import_promises13, import_node_path31, init2;
157412
157554
  var init_init = __esm({
157413
157555
  "src/init.ts"() {
157414
157556
  init_import_meta_url();
157415
157557
  import_promises13 = require("fs/promises");
157416
157558
  import_node_path31 = __toESM(require("path"));
157417
- import_toml5 = __toESM(require_toml());
157418
157559
  init_execa();
157419
157560
  init_cfetch();
157420
157561
  init_internal();
@@ -157518,8 +157659,8 @@ var init_init = __esm({
157518
157659
  );
157519
157660
  }
157520
157661
  await (0, import_promises13.writeFile)(
157521
- import_node_path31.default.join(creationDir, "wrangler.toml"),
157522
- import_toml5.default.stringify(config)
157662
+ import_node_path31.default.join(creationDir, "wrangler.jsonc"),
157663
+ JSON.stringify(config, null, 2)
157523
157664
  );
157524
157665
  } else {
157525
157666
  logger.log(`\u{1F300} Running ${replacementC3Command}...`);
@@ -157539,11 +157680,11 @@ var init_init = __esm({
157539
157680
  });
157540
157681
 
157541
157682
  // src/kv/index.ts
157542
- var import_node_assert19, import_node_buffer4, import_consumers2, import_node_string_decoder, kvNamespace, kvNamespaceNamespace, kvKeyNamespace, kvBulkNamespace, kvNamespaceCreateCommand, kvNamespaceListCommand, kvNamespaceDeleteCommand, kvNamespaceRenameCommand, kvKeyPutCommand, kvKeyListCommand, kvKeyGetCommand, kvKeyDeleteCommand, kvBulkGetCommand, kvBulkPutCommand, kvBulkDeleteCommand;
157683
+ var import_node_assert20, import_node_buffer4, import_consumers2, import_node_string_decoder, kvNamespace, kvNamespaceNamespace, kvKeyNamespace, kvBulkNamespace, kvNamespaceCreateCommand, kvNamespaceListCommand, kvNamespaceDeleteCommand, kvNamespaceRenameCommand, kvKeyPutCommand, kvKeyListCommand, kvKeyGetCommand, kvKeyDeleteCommand, kvBulkGetCommand, kvBulkPutCommand, kvBulkDeleteCommand;
157543
157684
  var init_kv2 = __esm({
157544
157685
  "src/kv/index.ts"() {
157545
157686
  init_import_meta_url();
157546
- import_node_assert19 = require("assert");
157687
+ import_node_assert20 = require("assert");
157547
157688
  import_node_buffer4 = require("buffer");
157548
157689
  import_consumers2 = require("stream/consumers");
157549
157690
  import_node_string_decoder = require("string_decoder");
@@ -157690,7 +157831,7 @@ var init_kv2 = __esm({
157690
157831
  printResourceLocation("remote");
157691
157832
  let id;
157692
157833
  try {
157693
- id = getKVNamespaceId(args, config);
157834
+ id = await getKVNamespaceId(args, config, false);
157694
157835
  } catch (e8) {
157695
157836
  throw new CommandLineArgsError(
157696
157837
  "Not able to delete namespace.\n" + (e8.message ?? e8)
@@ -157759,7 +157900,7 @@ var init_kv2 = __esm({
157759
157900
  }
157760
157901
  namespaceId = namespace.id;
157761
157902
  }
157762
- (0, import_node_assert19.strict)(namespaceId, "namespaceId should be defined");
157903
+ (0, import_node_assert20.strict)(namespaceId, "namespaceId should be defined");
157763
157904
  logger.log(`Renaming KV namespace ${namespaceId} to "${args.newName}".`);
157764
157905
  const updatedNamespace = await updateKVNamespace(
157765
157906
  config,
@@ -157850,7 +157991,7 @@ var init_kv2 = __esm({
157850
157991
  async handler({ key, ttl, expiration, metadata, ...args }) {
157851
157992
  const localMode = isLocal(args);
157852
157993
  const config = readConfig(args);
157853
- const namespaceId = getKVNamespaceId(args, config);
157994
+ const namespaceId = await getKVNamespaceId(args, config, localMode);
157854
157995
  const value = args.path ? readFileSyncToBuffer(args.path) : (
157855
157996
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
157856
157997
  args.value
@@ -157947,7 +158088,7 @@ var init_kv2 = __esm({
157947
158088
  async handler({ prefix, ...args }) {
157948
158089
  const localMode = isLocal(args);
157949
158090
  const config = readConfig(args);
157950
- const namespaceId = getKVNamespaceId(args, config);
158091
+ const namespaceId = await getKVNamespaceId(args, config, localMode);
157951
158092
  let result;
157952
158093
  let metricEvent;
157953
158094
  if (localMode) {
@@ -158033,7 +158174,7 @@ var init_kv2 = __esm({
158033
158174
  async handler({ key, ...args }) {
158034
158175
  const localMode = isLocal(args);
158035
158176
  const config = readConfig(args);
158036
- const namespaceId = getKVNamespaceId(args, config);
158177
+ const namespaceId = await getKVNamespaceId(args, config, localMode);
158037
158178
  let bufferKVValue;
158038
158179
  let metricEvent;
158039
158180
  if (localMode) {
@@ -158117,7 +158258,7 @@ var init_kv2 = __esm({
158117
158258
  async handler({ key, ...args }) {
158118
158259
  const localMode = isLocal(args);
158119
158260
  const config = readConfig(args);
158120
- const namespaceId = getKVNamespaceId(args, config);
158261
+ const namespaceId = await getKVNamespaceId(args, config, localMode);
158121
158262
  logger.log(`Deleting the key "${key}" on namespace ${namespaceId}.`);
158122
158263
  let metricEvent;
158123
158264
  if (localMode) {
@@ -158186,7 +158327,7 @@ var init_kv2 = __esm({
158186
158327
  async handler({ filename, ...args }) {
158187
158328
  const localMode = isLocal(args);
158188
158329
  const config = readConfig(args);
158189
- const namespaceId = getKVNamespaceId(args, config);
158330
+ const namespaceId = await getKVNamespaceId(args, config, localMode);
158190
158331
  const content = parseJSON(readFileSync6(filename), filename);
158191
158332
  if (!Array.isArray(content)) {
158192
158333
  throw new UserError2(
@@ -158311,7 +158452,7 @@ Expected an array of strings or objects with a "name" key.
158311
158452
  async handler({ filename, ...args }) {
158312
158453
  const localMode = isLocal(args);
158313
158454
  const config = readConfig(args);
158314
- const namespaceId = getKVNamespaceId(args, config);
158455
+ const namespaceId = await getKVNamespaceId(args, config, localMode);
158315
158456
  const content = parseJSON(readFileSync6(filename), filename);
158316
158457
  if (!Array.isArray(content)) {
158317
158458
  throw new UserError2(
@@ -158455,7 +158596,7 @@ interface KeyValue {
158455
158596
  async handler({ filename, ...args }) {
158456
158597
  const localMode = isLocal(args);
158457
158598
  const config = readConfig(args);
158458
- const namespaceId = getKVNamespaceId(args, config);
158599
+ const namespaceId = await getKVNamespaceId(args, config, localMode);
158459
158600
  if (!args.force) {
158460
158601
  const result = await confirm(
158461
158602
  `Are you sure you want to delete all the keys read from "${filename}" from kv-namespace with id "${namespaceId}"?`
@@ -165594,7 +165735,8 @@ ${JSON.stringify(defaultRoutesJSONSpec, null, 2)}`
165594
165735
  MULTIWORKER: Array.isArray(args.config),
165595
165736
  RESOURCES_PROVISION: false,
165596
165737
  REMOTE_BINDINGS: false,
165597
- DEPLOY_REMOTE_DIFF_CHECK: false
165738
+ DEPLOY_REMOTE_DIFF_CHECK: false,
165739
+ AUTOCREATE_RESOURCES: false
165598
165740
  },
165599
165741
  () => startDev({
165600
165742
  script: scriptEntrypoint,
@@ -165661,6 +165803,7 @@ ${JSON.stringify(defaultRoutesJSONSpec, null, 2)}`
165661
165803
  experimentalRemoteBindings: true,
165662
165804
  experimentalVectorizeBindToProd: false,
165663
165805
  experimentalImagesLocalMode: false,
165806
+ experimentalAutoCreate: false,
165664
165807
  enableIpc: true,
165665
165808
  config: Array.isArray(args.config) ? args.config : void 0,
165666
165809
  site: void 0,
@@ -165800,7 +165943,7 @@ async function toEnvironment(deploymentConfig, accountId) {
165800
165943
  return configObj;
165801
165944
  }
165802
165945
  async function writeWranglerToml(toml) {
165803
- let tomlString = import_toml6.default.stringify(toml);
165946
+ let tomlString = import_toml5.default.stringify(toml);
165804
165947
  tomlString = tomlString.split("\n").map((line) => line.trimStart()).join("\n");
165805
165948
  await (0, import_promises24.writeFile)(
165806
165949
  "wrangler.toml",
@@ -165859,13 +166002,13 @@ async function downloadProject(accountId, projectName) {
165859
166002
  }
165860
166003
  };
165861
166004
  }
165862
- var import_fs17, import_promises24, import_toml6, import_miniflare16, pagesDownloadConfigCommand;
166005
+ var import_fs17, import_promises24, import_toml5, import_miniflare16, pagesDownloadConfigCommand;
165863
166006
  var init_download_config = __esm({
165864
166007
  "src/pages/download-config.ts"() {
165865
166008
  init_import_meta_url();
165866
166009
  import_fs17 = require("fs");
165867
166010
  import_promises24 = require("fs/promises");
165868
- import_toml6 = __toESM(require_toml());
166011
+ import_toml5 = __toESM(require_toml());
165869
166012
  init_source();
165870
166013
  import_miniflare16 = require("miniflare");
165871
166014
  init_cfetch();
@@ -199801,7 +199944,7 @@ async function generateR2ServiceToken(accountId, bucketName, pipelineName) {
199801
199944
  const timeoutPromise = (0, import_promises26.setTimeout)(12e4, "timeout", { signal });
199802
199945
  const serverPromise = new Promise((resolve25, reject) => {
199803
199946
  const server = import_node_http2.default.createServer(async (request4, response) => {
199804
- (0, import_node_assert20.default)(request4.url, "This request doesn't have a URL");
199947
+ (0, import_node_assert21.default)(request4.url, "This request doesn't have a URL");
199805
199948
  if (request4.method !== "GET") {
199806
199949
  response.writeHead(405);
199807
199950
  response.end("Method not allowed.");
@@ -199853,11 +199996,11 @@ async function getR2Bucket2(complianceConfig, accountId, name2) {
199853
199996
  `/accounts/${accountId}/r2/buckets/${name2}`
199854
199997
  );
199855
199998
  }
199856
- var import_node_assert20, import_node_http2, import_promises26, import_node_url9;
199999
+ var import_node_assert21, import_node_http2, import_promises26, import_node_url9;
199857
200000
  var init_client7 = __esm({
199858
200001
  "src/pipelines/client.ts"() {
199859
200002
  init_import_meta_url();
199860
- import_node_assert20 = __toESM(require("assert"));
200003
+ import_node_assert21 = __toESM(require("assert"));
199861
200004
  import_node_http2 = __toESM(require("http"));
199862
200005
  import_promises26 = require("timers/promises");
199863
200006
  import_node_url9 = require("url");
@@ -223694,7 +223837,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
223694
223837
  workerBundle = createWorkerUploadForm(worker);
223695
223838
  printBindings({ ...bindings, vars: maskedVars }, config.tail_consumers);
223696
223839
  } else {
223697
- (0, import_node_assert21.default)(accountId, "Missing accountId");
223840
+ (0, import_node_assert22.default)(accountId, "Missing accountId");
223698
223841
  if (getFlag("RESOURCES_PROVISION")) {
223699
223842
  await provisionBindings(
223700
223843
  bindings,
@@ -223875,11 +224018,11 @@ function generatePreviewAlias(scriptName) {
223875
224018
  );
223876
224019
  return truncatedAlias || warnAndExit();
223877
224020
  }
223878
- var import_node_assert21, import_node_child_process7, import_node_crypto12, import_node_fs35, import_node_path53, import_undici20, versionsUploadCommand, MAX_DNS_LABEL_LENGTH, HASH_LENGTH, ALIAS_VALIDATION_REGEX;
224021
+ var import_node_assert22, import_node_child_process7, import_node_crypto12, import_node_fs35, import_node_path53, import_undici20, versionsUploadCommand, MAX_DNS_LABEL_LENGTH, HASH_LENGTH, ALIAS_VALIDATION_REGEX;
223879
224022
  var init_upload5 = __esm({
223880
224023
  "src/versions/upload.ts"() {
223881
224024
  init_import_meta_url();
223882
- import_node_assert21 = __toESM(require("assert"));
224025
+ import_node_assert22 = __toESM(require("assert"));
223883
224026
  import_node_child_process7 = require("child_process");
223884
224027
  import_node_crypto12 = require("crypto");
223885
224028
  import_node_fs35 = require("fs");
@@ -224090,7 +224233,8 @@ var init_upload5 = __esm({
224090
224233
  MULTIWORKER: false,
224091
224234
  RESOURCES_PROVISION: args.experimentalProvision ?? false,
224092
224235
  REMOTE_BINDINGS: args.experimentalRemoteBindings ?? true,
224093
- DEPLOY_REMOTE_DIFF_CHECK: false
224236
+ DEPLOY_REMOTE_DIFF_CHECK: false,
224237
+ AUTOCREATE_RESOURCES: args.experimentalAutoCreate
224094
224238
  }), "overrideExperimentalFlags"),
224095
224239
  warnIfMultipleEnvsConfiguredButNoneSpecified: true
224096
224240
  },
@@ -224153,7 +224297,7 @@ var init_upload5 = __esm({
224153
224297
  }
224154
224298
  const previewAlias = args.previewAlias ?? (getCIGeneratePreviewAlias() === "true" ? generatePreviewAlias(name2) : void 0);
224155
224299
  if (!args.dryRun) {
224156
- (0, import_node_assert21.default)(accountId, "Missing account ID");
224300
+ (0, import_node_assert22.default)(accountId, "Missing account ID");
224157
224301
  await verifyWorkerMatchesCITag(
224158
224302
  config,
224159
224303
  accountId,
@@ -224218,85 +224362,17 @@ var init_upload5 = __esm({
224218
224362
  });
224219
224363
 
224220
224364
  // src/versions/view.ts
224221
- function printBindingAsToml(binding) {
224222
- switch (binding.type) {
224223
- case "ai":
224224
- return `[ai]
224225
- binding = ${binding.name}`;
224226
- case "analytics_engine":
224227
- return `[[analytics_engine_datasets]]
224228
- binding = ${binding.name}` + (binding.dataset ? `
224229
- dataset = ${binding.dataset}` : "");
224230
- case "browser":
224231
- return `[browser]
224232
- binding = "${binding.name}"`;
224233
- case "d1":
224234
- return `[[d1_databases]]
224235
- binding = "${binding.name}"
224236
- database_id = "${binding.id}"`;
224237
- case "dispatch_namespace":
224238
- return `[[dispatch_namespaces]]
224239
- binding = "${binding.name}"
224240
- namespce = "${binding.namespace}"` + (binding.outbound ? `
224241
- outbound = { service = "${binding.outbound.worker.service}"` + (binding.outbound.params ? `, parameters = [${binding.outbound.params.map((param) => param.name).join(", ")}]` : "") + " }" : "");
224242
- case "durable_object_namespace":
224243
- return `[[durable_objects.bindings]]
224244
- name = "${binding.name}"
224245
- class_name = "${binding.class_name}"` + (binding.script_name ? `
224246
- script_name = "${binding.script_name}"` : "");
224247
- case "hyperdrive":
224248
- return `[[hyperdrive]]
224249
- binding = "${binding.name}"
224250
- id = "${binding.id}"`;
224251
- case "kv_namespace":
224252
- return `[[kv_namespaces]]
224253
- binding = "${binding.name}"
224254
- id = "${binding.namespace_id}"`;
224255
- case "mtls_certificate":
224256
- return `[[mtls_certificates]]
224257
- binding = "${binding.name}"
224258
- certificate_id = "${binding.certificate_id}"`;
224259
- case "queue":
224260
- return `[[queues.producers]]
224261
- binding = "${binding.name}"
224262
- queue = "${binding.queue_name}"` + (binding.delivery_delay ? `
224263
- delivery_delay = ${binding.delivery_delay}` : "");
224264
- case "r2_bucket":
224265
- return `[[r2_buckets]]
224266
- binding = "${binding.name}"
224267
- bucket_name = "${binding.bucket_name}"` + (binding.jurisdiction ? `
224268
- jurisdiction = "${binding.jurisdiction}"` : "");
224269
- case "send_email":
224270
- return `[[send_email]]
224271
- name = "${binding.name}"` + (binding.destination_address ? `
224272
- destination_address = "${binding.destination_address}"` : "") + (binding.allowed_destination_addresses ? `
224273
- allowed_destination_addresses = [${binding.allowed_destination_addresses.map((addr) => `"${addr}"`).join(", ")}]` : "") + (binding.allowed_sender_addresses ? `
224274
- allowed_sender_addresses = [${binding.allowed_sender_addresses.map((addr) => `"${addr}"`).join(", ")}]` : "");
224275
- case "service":
224276
- return `[[services]]
224277
- binding = "${binding.name}"
224278
- service = "${binding.name}"` + (binding.entrypoint ? `
224279
- entrypoint = "${binding.entrypoint}"` : "");
224280
- case "vectorize":
224281
- return `[[vectorize]]
224282
- binding = "${binding.name}"
224283
- index_name = "${binding.index_name}"`;
224284
- case "version_metadata":
224285
- return `[version_metadata]
224286
- binding = "${binding.name}"`;
224287
- default:
224288
- return null;
224289
- }
224290
- }
224291
224365
  var BLANK_INPUT5, versionsViewCommand;
224292
224366
  var init_view2 = __esm({
224293
224367
  "src/versions/view.ts"() {
224294
224368
  init_import_meta_url();
224295
224369
  init_cli();
224370
+ init_utils4();
224296
224371
  init_create_command();
224297
224372
  init_errors();
224298
224373
  init_metrics2();
224299
224374
  init_user3();
224375
+ init_print_bindings();
224300
224376
  init_render_labelled_values();
224301
224377
  init_api();
224302
224378
  init_list11();
@@ -224329,7 +224405,7 @@ var init_view2 = __esm({
224329
224405
  }
224330
224406
  },
224331
224407
  positionalArgs: ["version-id"],
224332
- handler: /* @__PURE__ */ __name(async function versionsViewHandler(args, { config }) {
224408
+ async handler(args, { config }) {
224333
224409
  sendMetricsEvent(
224334
224410
  "view worker version",
224335
224411
  {},
@@ -224376,14 +224452,14 @@ var init_view2 = __esm({
224376
224452
  scriptInfo["Compatibility Flags"] = version5.resources.script_runtime.compatibility_flags.join(", ");
224377
224453
  }
224378
224454
  if (Object.keys(scriptInfo).length > 0) {
224379
- logRaw("------------------------------------------------------------");
224455
+ logRaw("");
224380
224456
  logRaw(formatLabelledValues(scriptInfo));
224381
224457
  }
224382
224458
  const secrets = version5.resources.bindings.filter(
224383
224459
  (binding) => binding.type === "secret_text"
224384
224460
  );
224385
224461
  if (secrets.length > 0) {
224386
- logRaw("------------------------- secrets -------------------------");
224462
+ logRaw("Secrets:");
224387
224463
  for (const secret of secrets) {
224388
224464
  logRaw(
224389
224465
  formatLabelledValues({
@@ -224396,31 +224472,12 @@ var init_view2 = __esm({
224396
224472
  (binding) => binding.type !== "secret_text"
224397
224473
  );
224398
224474
  if (bindings.length > 0) {
224399
- logRaw("------------------------- bindings -------------------------");
224400
- const envVars = bindings.filter(
224401
- (binding) => binding.type === "plain_text"
224402
- );
224403
- if (envVars.length > 0) {
224404
- logRaw(
224405
- `[vars]
224406
- ` + // ts is having issues typing from the filter
224407
- envVars.map((envVar) => `${envVar.name} = "${envVar.text}"`).join("\n")
224408
- );
224409
- }
224410
- const restOfBindings = bindings.filter(
224411
- (binding) => binding.type !== "plain_text"
224475
+ printBindings(
224476
+ (await convertBindingsToCfWorkerInitBindings(bindings)).bindings
224412
224477
  );
224413
- for (const binding of restOfBindings) {
224414
- const output = printBindingAsToml(binding);
224415
- if (output !== null) {
224416
- logRaw(output);
224417
- logRaw("");
224418
- }
224419
- }
224420
224478
  }
224421
- }, "versionsViewHandler")
224479
+ }
224422
224480
  });
224423
- __name(printBindingAsToml, "printBindingAsToml");
224424
224481
  }
224425
224482
  });
224426
224483
 
@@ -228578,6 +228635,13 @@ function createCLIParser(argv) {
228578
228635
  type: "boolean",
228579
228636
  hidden: true,
228580
228637
  alias: ["x-provision"]
228638
+ },
228639
+ "experimental-auto-create": {
228640
+ describe: "Automatically provision draft bindings with new resources",
228641
+ type: "boolean",
228642
+ default: true,
228643
+ hidden: true,
228644
+ alias: "x-auto-create"
228581
228645
  }
228582
228646
  };
228583
228647
  const wrangler = yargs_default(argv).strict().showHelpOnFail(false).fail((msg, error2) => {
@@ -229714,7 +229778,7 @@ async function main(argv) {
229714
229778
  if (e8.cause instanceof ApiError) {
229715
229779
  logger.error(e8.cause);
229716
229780
  } else {
229717
- (0, import_node_assert22.default)(isAuthenticationError(e8));
229781
+ (0, import_node_assert23.default)(isAuthenticationError(e8));
229718
229782
  logger.error(e8);
229719
229783
  }
229720
229784
  const envAuth = getAuthFromEnv();
@@ -229828,11 +229892,11 @@ ${tryRunningItIn}${oneOfThese}`
229828
229892
  }
229829
229893
  }
229830
229894
  }
229831
- var import_node_assert22, import_node_path54, import_promises31, import_undici21;
229895
+ var import_node_assert23, import_node_path54, import_promises31, import_undici21;
229832
229896
  var init_src2 = __esm({
229833
229897
  "src/index.ts"() {
229834
229898
  init_import_meta_url();
229835
- import_node_assert22 = __toESM(require("assert"));
229899
+ import_node_assert23 = __toESM(require("assert"));
229836
229900
  import_node_path54 = require("path");
229837
229901
  import_promises31 = require("timers/promises");
229838
229902
  init_cli();
@@ -230743,7 +230807,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
230743
230807
  );
230744
230808
  }
230745
230809
  const scriptName = props.name;
230746
- (0, import_node_assert23.default)(
230810
+ (0, import_node_assert24.default)(
230747
230811
  !config.site || config.site.bucket,
230748
230812
  "A [site] definition requires a `bucket` field with a path to the site's assets directory."
230749
230813
  );
@@ -231008,14 +231072,14 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
231008
231072
  }
231009
231073
  }
231010
231074
  }
231011
- workerBundle = createWorkerUploadForm(worker);
231075
+ workerBundle = createWorkerUploadForm(worker, { dryRun: true });
231012
231076
  printBindings(
231013
231077
  { ...withoutStaticAssets, vars: maskedVars },
231014
231078
  config.tail_consumers,
231015
231079
  { warnIfNoBindings: true }
231016
231080
  );
231017
231081
  } else {
231018
- (0, import_node_assert23.default)(accountId, "Missing accountId");
231082
+ (0, import_node_assert24.default)(accountId, "Missing accountId");
231019
231083
  if (getFlag("RESOURCES_PROVISION")) {
231020
231084
  await provisionBindings(
231021
231085
  bindings,
@@ -231208,7 +231272,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
231208
231272
  return { versionId, workerTag };
231209
231273
  }
231210
231274
  if (normalisedContainerConfig.length) {
231211
- (0, import_node_assert23.default)(versionId && accountId);
231275
+ (0, import_node_assert24.default)(versionId && accountId);
231212
231276
  await deployContainers(config, normalisedContainerConfig, {
231213
231277
  versionId,
231214
231278
  accountId,
@@ -231456,11 +231520,11 @@ function getDeployConfirmFunction(strictMode = false) {
231456
231520
  }
231457
231521
  return confirm;
231458
231522
  }
231459
- var import_node_assert23, import_node_fs36, import_node_path56, import_node_url10, import_undici22, validateRoutes3;
231523
+ var import_node_assert24, import_node_fs36, import_node_path56, import_node_url10, import_undici22, validateRoutes3;
231460
231524
  var init_deploy8 = __esm({
231461
231525
  "src/deploy/deploy.ts"() {
231462
231526
  init_import_meta_url();
231463
- import_node_assert23 = __toESM(require("assert"));
231527
+ import_node_assert24 = __toESM(require("assert"));
231464
231528
  import_node_fs36 = require("fs");
231465
231529
  import_node_path56 = __toESM(require("path"));
231466
231530
  import_node_url10 = require("url");
@@ -231712,11 +231776,11 @@ function errorOnLegacyPagesWorkerJSAsset(file, hasAssetsIgnoreFile) {
231712
231776
  }
231713
231777
  }
231714
231778
  }
231715
- var import_node_assert24, import_node_fs37, import_promises35, path58, import_undici23, BULK_UPLOAD_CONCURRENCY2, MAX_UPLOAD_ATTEMPTS2, MAX_UPLOAD_GATEWAY_ERRORS2, MAX_DIFF_LINES2, syncAssets, buildAssetManifest, NonExistentAssetsDirError, WORKER_JS_FILENAME;
231779
+ var import_node_assert25, import_node_fs37, import_promises35, path58, import_undici23, BULK_UPLOAD_CONCURRENCY2, MAX_UPLOAD_ATTEMPTS2, MAX_UPLOAD_GATEWAY_ERRORS2, MAX_DIFF_LINES2, syncAssets, buildAssetManifest, NonExistentAssetsDirError, WORKER_JS_FILENAME;
231716
231780
  var init_assets5 = __esm({
231717
231781
  "src/assets.ts"() {
231718
231782
  init_import_meta_url();
231719
- import_node_assert24 = __toESM(require("assert"));
231783
+ import_node_assert25 = __toESM(require("assert"));
231720
231784
  import_node_fs37 = require("fs");
231721
231785
  import_promises35 = require("fs/promises");
231722
231786
  path58 = __toESM(require("path"));
@@ -231741,7 +231805,7 @@ var init_assets5 = __esm({
231741
231805
  MAX_UPLOAD_GATEWAY_ERRORS2 = 5;
231742
231806
  MAX_DIFF_LINES2 = 100;
231743
231807
  syncAssets = /* @__PURE__ */ __name(async (complianceConfig, accountId, assetDirectory, scriptName, dispatchNamespace) => {
231744
- (0, import_node_assert24.default)(accountId, "Missing accountId");
231808
+ (0, import_node_assert25.default)(accountId, "Missing accountId");
231745
231809
  logger.info("\u{1F300} Building list of assets...");
231746
231810
  const manifest = await buildAssetManifest(assetDirectory);
231747
231811
  const url4 = dispatchNamespace ? `/accounts/${accountId}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}/assets-upload-session` : `/accounts/${accountId}/workers/scripts/${scriptName}/assets-upload-session`;
@@ -232221,11 +232285,11 @@ function getAssetChangeMessage(eventName, assetPath) {
232221
232285
  }
232222
232286
  return message;
232223
232287
  }
232224
- var import_node_assert25, import_node_events4, import_env2, dev;
232288
+ var import_node_assert26, import_node_events4, import_env2, dev;
232225
232289
  var init_dev2 = __esm({
232226
232290
  "src/dev.ts"() {
232227
232291
  init_import_meta_url();
232228
- import_node_assert25 = __toESM(require("assert"));
232292
+ import_node_assert26 = __toESM(require("assert"));
232229
232293
  import_node_events4 = __toESM(require("events"));
232230
232294
  import_env2 = __toESM(require_dist2());
232231
232295
  init_assets5();
@@ -232246,7 +232310,8 @@ var init_dev2 = __esm({
232246
232310
  MULTIWORKER: Array.isArray(args.config),
232247
232311
  RESOURCES_PROVISION: args.experimentalProvision ?? false,
232248
232312
  REMOTE_BINDINGS: args.local ? false : args.experimentalRemoteBindings ?? true,
232249
- DEPLOY_REMOTE_DIFF_CHECK: false
232313
+ DEPLOY_REMOTE_DIFF_CHECK: false,
232314
+ AUTOCREATE_RESOURCES: args.experimentalAutoCreate
232250
232315
  }), "overrideExperimentalFlags")
232251
232316
  },
232252
232317
  metadata: {
@@ -232493,7 +232558,7 @@ var init_dev2 = __esm({
232493
232558
  },
232494
232559
  async handler(args) {
232495
232560
  const devInstance = await startDev(args);
232496
- (0, import_node_assert25.default)(devInstance.devEnv !== void 0);
232561
+ (0, import_node_assert26.default)(devInstance.devEnv !== void 0);
232497
232562
  await import_node_events4.default.once(devInstance.devEnv, "teardown");
232498
232563
  await Promise.all(devInstance.secondary.map((d7) => d7.teardown()));
232499
232564
  if (devInstance.teardownRegistryPromise) {
@@ -232561,7 +232626,7 @@ function runBuild({
232561
232626
  async function updateBundle() {
232562
232627
  const newAdditionalModules = await getAdditionalModules();
232563
232628
  setBundle((previousBundle) => {
232564
- (0, import_node_assert26.default)(
232629
+ (0, import_node_assert27.default)(
232565
232630
  previousBundle,
232566
232631
  "Rebuild triggered with no previous build available"
232567
232632
  );
@@ -232651,11 +232716,11 @@ function runBuild({
232651
232716
  });
232652
232717
  return () => stopWatching?.();
232653
232718
  }
232654
- var import_node_assert26, import_node_fs38, import_node_path57;
232719
+ var import_node_assert27, import_node_fs38, import_node_path57;
232655
232720
  var init_use_esbuild = __esm({
232656
232721
  "src/dev/use-esbuild.ts"() {
232657
232722
  init_import_meta_url();
232658
- import_node_assert26 = __toESM(require("assert"));
232723
+ import_node_assert27 = __toESM(require("assert"));
232659
232724
  import_node_fs38 = require("fs");
232660
232725
  import_node_path57 = __toESM(require("path"));
232661
232726
  init_esm6();
@@ -233252,7 +233317,7 @@ async function resolveDevConfig(config, input) {
233252
233317
  );
233253
233318
  if (input.dev?.remote) {
233254
233319
  const { accountId } = await auth();
233255
- (0, import_node_assert27.default)(accountId, "Account ID must be provided for remote dev");
233320
+ (0, import_node_assert28.default)(accountId, "Account ID must be provided for remote dev");
233256
233321
  await getZoneIdForPreview(config, { host, routes, accountId });
233257
233322
  }
233258
233323
  const initialIp = input.dev?.server?.hostname ?? config.dev.ip;
@@ -233509,11 +233574,11 @@ If you are trying to develop Pages and Workers together, please use \`wrangler p
233509
233574
  }
233510
233575
  return { config: resolved, printCurrentBindings };
233511
233576
  }
233512
- var import_node_assert27, import_node_path58, import_miniflare22, getInspectorPort, getLocalPort, ConfigController;
233577
+ var import_node_assert28, import_node_path58, import_miniflare22, getInspectorPort, getLocalPort, ConfigController;
233513
233578
  var init_ConfigController = __esm({
233514
233579
  "src/api/startDevWorker/ConfigController.ts"() {
233515
233580
  init_import_meta_url();
233516
- import_node_assert27 = __toESM(require("assert"));
233581
+ import_node_assert28 = __toESM(require("assert"));
233517
233582
  import_node_path58 = __toESM(require("path"));
233518
233583
  init_containers_shared();
233519
233584
  init_esm6();
@@ -233570,7 +233635,7 @@ var init_ConfigController = __esm({
233570
233635
  return;
233571
233636
  }
233572
233637
  logger.debug(`${import_node_path58.default.basename(configPath)} changed...`);
233573
- (0, import_node_assert27.default)(
233638
+ (0, import_node_assert28.default)(
233574
233639
  this.latestInput,
233575
233640
  "Cannot be watching config without having first set an input"
233576
233641
  );
@@ -233596,7 +233661,7 @@ var init_ConfigController = __esm({
233596
233661
  }
233597
233662
  patch(input) {
233598
233663
  logger.debug("patching config");
233599
- (0, import_node_assert27.default)(
233664
+ (0, import_node_assert28.default)(
233600
233665
  this.latestInput,
233601
233666
  "Cannot call updateConfig without previously calling setConfig"
233602
233667
  );
@@ -233763,7 +233828,7 @@ function maybeGetSourceMappingURL(sourcePath) {
233763
233828
  return;
233764
233829
  }
233765
233830
  const sourceMappingURLMatch = source.substring(sourceMappingURLIndex).match(/^\/\/# sourceMappingURL=(.+)/);
233766
- (0, import_node_assert28.default)(sourceMappingURLMatch !== null);
233831
+ (0, import_node_assert29.default)(sourceMappingURLMatch !== null);
233767
233832
  const sourceMappingURLSpecifier = sourceMappingURLMatch[1];
233768
233833
  const sourceURL = (0, import_node_url11.pathToFileURL)(sourcePath);
233769
233834
  try {
@@ -233775,11 +233840,11 @@ function maybeGetSourceMappingURL(sourcePath) {
233775
233840
  } catch {
233776
233841
  }
233777
233842
  }
233778
- var import_node_assert28, import_node_fs39, import_node_path61, import_node_url11, bundleReferencedPathsCache;
233843
+ var import_node_assert29, import_node_fs39, import_node_path61, import_node_url11, bundleReferencedPathsCache;
233779
233844
  var init_bundle_allowed_paths = __esm({
233780
233845
  "src/api/startDevWorker/bundle-allowed-paths.ts"() {
233781
233846
  init_import_meta_url();
233782
- import_node_assert28 = __toESM(require("assert"));
233847
+ import_node_assert29 = __toESM(require("assert"));
233783
233848
  import_node_fs39 = __toESM(require("fs"));
233784
233849
  import_node_path61 = __toESM(require("path"));
233785
233850
  import_node_url11 = require("url");
@@ -252332,11 +252397,11 @@ function didMiniflareOptionsChange(prev, next) {
252332
252397
  }
252333
252398
  return !deepEquality(prev, next);
252334
252399
  }
252335
- var import_node_assert29, import_node_crypto13, import_node_events5, import_node_path62, import_miniflare24, ProxyController, ProxyControllerLogger;
252400
+ var import_node_assert30, import_node_crypto13, import_node_events5, import_node_path62, import_miniflare24, ProxyController, ProxyControllerLogger;
252336
252401
  var init_ProxyController = __esm({
252337
252402
  "src/api/startDevWorker/ProxyController.ts"() {
252338
252403
  init_import_meta_url();
252339
- import_node_assert29 = __toESM(require("assert"));
252404
+ import_node_assert30 = __toESM(require("assert"));
252340
252405
  import_node_crypto13 = require("crypto");
252341
252406
  import_node_events5 = __toESM(require("events"));
252342
252407
  import_node_path62 = __toESM(require("path"));
@@ -252370,7 +252435,7 @@ var init_ProxyController = __esm({
252370
252435
  if (this._torndown) {
252371
252436
  return;
252372
252437
  }
252373
- (0, import_node_assert29.default)(this.latestConfig !== void 0);
252438
+ (0, import_node_assert30.default)(this.latestConfig !== void 0);
252374
252439
  const inVscodeJsDebugTerminal = !!process.env.VSCODE_INSPECTOR_OPTIONS;
252375
252440
  const cert = this.latestConfig.dev?.server?.secure || this.latestConfig.dev.inspector !== false && this.latestConfig.dev?.inspector?.secure ? getHttpsOptions(
252376
252441
  this.latestConfig.dev.server?.httpsKeyPath,
@@ -252494,7 +252559,7 @@ var init_ProxyController = __esm({
252494
252559
  inspectorUrl
252495
252560
  ]);
252496
252561
  }).then(([url4, inspectorUrl]) => {
252497
- (0, import_node_assert29.default)(url4);
252562
+ (0, import_node_assert30.default)(url4);
252498
252563
  this.emitReadyEvent(proxyWorker, url4, inspectorUrl);
252499
252564
  }).catch((error2) => {
252500
252565
  if (this._torndown) {
@@ -252511,7 +252576,7 @@ var init_ProxyController = __esm({
252511
252576
  if (this._torndown) {
252512
252577
  return;
252513
252578
  }
252514
- (0, import_node_assert29.default)(
252579
+ (0, import_node_assert30.default)(
252515
252580
  this.latestConfig?.dev.inspector !== false,
252516
252581
  "Trying to reconnect with inspector proxy worker when inspector is disabled"
252517
252582
  );
@@ -252522,7 +252587,7 @@ var init_ProxyController = __esm({
252522
252587
  this.inspectorProxyWorkerWebSocket = createDeferred();
252523
252588
  let webSocket = null;
252524
252589
  try {
252525
- (0, import_node_assert29.default)(this.proxyWorker);
252590
+ (0, import_node_assert30.default)(this.proxyWorker);
252526
252591
  const inspectorProxyWorkerUrl = await this.proxyWorker.unsafeGetDirectURL(
252527
252592
  "InspectorProxyWorker"
252528
252593
  );
@@ -252541,12 +252606,12 @@ var init_ProxyController = __esm({
252541
252606
  this.emitErrorEvent("Could not connect to InspectorProxyWorker", error2);
252542
252607
  return;
252543
252608
  }
252544
- (0, import_node_assert29.default)(
252609
+ (0, import_node_assert30.default)(
252545
252610
  webSocket,
252546
252611
  "Expected webSocket on response from inspectorProxyWorker"
252547
252612
  );
252548
252613
  webSocket.addEventListener("message", (event) => {
252549
- (0, import_node_assert29.default)(typeof event.data === "string");
252614
+ (0, import_node_assert30.default)(typeof event.data === "string");
252550
252615
  this.onInspectorProxyWorkerMessage(JSON.parse(event.data));
252551
252616
  });
252552
252617
  webSocket.addEventListener("close", () => {
@@ -252601,13 +252666,13 @@ var init_ProxyController = __esm({
252601
252666
  if (this._torndown) {
252602
252667
  return;
252603
252668
  }
252604
- (0, import_node_assert29.default)(
252669
+ (0, import_node_assert30.default)(
252605
252670
  this.latestConfig?.dev.inspector !== false,
252606
252671
  "Trying to send message to inspector proxy worker when inspector is disabled"
252607
252672
  );
252608
252673
  try {
252609
252674
  const websocket = await this.reconnectInspectorProxyWorker();
252610
- (0, import_node_assert29.default)(websocket);
252675
+ (0, import_node_assert30.default)(websocket);
252611
252676
  websocket.send(JSON.stringify(message));
252612
252677
  } catch (cause) {
252613
252678
  if (this._torndown) {
@@ -252675,7 +252740,7 @@ var init_ProxyController = __esm({
252675
252740
  }
252676
252741
  }
252677
252742
  onInspectorProxyWorkerMessage(message) {
252678
- (0, import_node_assert29.default)(
252743
+ (0, import_node_assert30.default)(
252679
252744
  this.latestConfig?.dev.inspector !== false,
252680
252745
  "Trying to handle inspector message when inspector is disabled"
252681
252746
  );
@@ -252701,7 +252766,7 @@ var init_ProxyController = __esm({
252701
252766
  }
252702
252767
  }
252703
252768
  async onInspectorProxyWorkerRequest(message) {
252704
- (0, import_node_assert29.default)(
252769
+ (0, import_node_assert30.default)(
252705
252770
  this.latestConfig?.dev.inspector !== false,
252706
252771
  "Trying to handle inspector request when inspector is disabled"
252707
252772
  );
@@ -252722,8 +252787,8 @@ var init_ProxyController = __esm({
252722
252787
  logger.debug("[InspectorProxyWorker]", ...message.args);
252723
252788
  break;
252724
252789
  case "load-network-resource": {
252725
- (0, import_node_assert29.default)(this.latestConfig !== void 0);
252726
- (0, import_node_assert29.default)(this.latestBundle !== void 0);
252790
+ (0, import_node_assert30.default)(this.latestConfig !== void 0);
252791
+ (0, import_node_assert30.default)(this.latestBundle !== void 0);
252727
252792
  let maybeContents;
252728
252793
  if (message.url.startsWith("wrangler-file:")) {
252729
252794
  maybeContents = maybeHandleNetworkLoadResource(
@@ -252846,18 +252911,20 @@ async function createPreviewSession(complianceConfig, account, ctx, abortSignal)
252846
252911
  abortSignal,
252847
252912
  apiToken
252848
252913
  );
252849
- const switchedExchangeUrl = switchHost(
252850
- exchange_url,
252851
- ctx.host,
252852
- !!ctx.zone
252853
- ).toString();
252914
+ const switchedExchangeUrl = switchHost(exchange_url, ctx.host, !!ctx.zone);
252915
+ const headers = {};
252916
+ const accessToken = await getAccessToken(switchedExchangeUrl.hostname);
252917
+ if (accessToken) {
252918
+ headers.cookie = `CF_Authorization=${accessToken}`;
252919
+ }
252854
252920
  logger.debugWithSanitization(
252855
252921
  "-- START EXCHANGE API REQUEST:",
252856
- ` GET ${switchedExchangeUrl}`
252922
+ ` GET ${switchedExchangeUrl.href}`
252857
252923
  );
252858
252924
  logger.debug("-- END EXCHANGE API REQUEST");
252859
252925
  const exchangeResponse = await (0, import_undici24.fetch)(switchedExchangeUrl, {
252860
- signal: abortSignal
252926
+ signal: abortSignal,
252927
+ headers
252861
252928
  });
252862
252929
  const bodyText = await exchangeResponse.text();
252863
252930
  logger.debug(
@@ -252989,7 +253056,7 @@ var init_create_worker_preview = __esm({
252989
253056
 
252990
253057
  // src/dev/remote.ts
252991
253058
  function handlePreviewSessionUploadError(err, accountId) {
252992
- (0, import_node_assert30.default)(err && typeof err === "object");
253059
+ (0, import_node_assert31.default)(err && typeof err === "object");
252993
253060
  if (!isAbortError(err)) {
252994
253061
  if ("code" in err && err.code === 10049) {
252995
253062
  logger.log("Preview token expired, fetching a new one");
@@ -253001,7 +253068,7 @@ function handlePreviewSessionUploadError(err, accountId) {
253001
253068
  return false;
253002
253069
  }
253003
253070
  function handlePreviewSessionCreationError(err, accountId) {
253004
- (0, import_node_assert30.default)(err && typeof err === "object");
253071
+ (0, import_node_assert31.default)(err && typeof err === "object");
253005
253072
  if ("code" in err && err.code === 10063) {
253006
253073
  logger.error(
253007
253074
  `You need to register a workers.dev subdomain before running the dev command in remote mode. You can either enable local mode by pressing l, or register a workers.dev subdomain here: https://dash.cloudflare.com/${accountId}/workers/onboarding`
@@ -253153,11 +253220,11 @@ function handleUserFriendlyError(error2, accountId) {
253153
253220
  }
253154
253221
  }
253155
253222
  }
253156
- var import_node_assert30, import_node_path63;
253223
+ var import_node_assert31, import_node_path63;
253157
253224
  var init_remote = __esm({
253158
253225
  "src/dev/remote.ts"() {
253159
253226
  init_import_meta_url();
253160
- import_node_assert30 = __toESM(require("assert"));
253227
+ import_node_assert31 = __toESM(require("assert"));
253161
253228
  import_node_path63 = __toESM(require("path"));
253162
253229
  init_assets5();
253163
253230
  init_bundle_reporter();
@@ -253484,7 +253551,7 @@ function createWorkerObject(devEnv) {
253484
253551
  return devEnv.proxy.ready.promise.then((ev) => ev.inspectorUrl);
253485
253552
  },
253486
253553
  get config() {
253487
- (0, import_node_assert31.default)(devEnv.config.latestConfig);
253554
+ (0, import_node_assert32.default)(devEnv.config.latestConfig);
253488
253555
  return devEnv.config.latestConfig;
253489
253556
  },
253490
253557
  async setConfig(config, throwErrors) {
@@ -253499,7 +253566,7 @@ function createWorkerObject(devEnv) {
253499
253566
  return proxyWorker.dispatchFetch(...args);
253500
253567
  },
253501
253568
  async queue(...args) {
253502
- (0, import_node_assert31.default)(
253569
+ (0, import_node_assert32.default)(
253503
253570
  this.config.name,
253504
253571
  "Worker name must be defined to use `Worker.queue()`"
253505
253572
  );
@@ -253508,7 +253575,7 @@ function createWorkerObject(devEnv) {
253508
253575
  return w7.queue(...args);
253509
253576
  },
253510
253577
  async scheduled(...args) {
253511
- (0, import_node_assert31.default)(
253578
+ (0, import_node_assert32.default)(
253512
253579
  this.config.name,
253513
253580
  "Worker name must be defined to use `Worker.scheduled()`"
253514
253581
  );
@@ -253522,11 +253589,11 @@ function createWorkerObject(devEnv) {
253522
253589
  raw: devEnv
253523
253590
  };
253524
253591
  }
253525
- var import_node_assert31, import_node_events6, import_miniflare27, DevEnv;
253592
+ var import_node_assert32, import_node_events6, import_miniflare27, DevEnv;
253526
253593
  var init_DevEnv = __esm({
253527
253594
  "src/api/startDevWorker/DevEnv.ts"() {
253528
253595
  init_import_meta_url();
253529
- import_node_assert31 = __toESM(require("assert"));
253596
+ import_node_assert32 = __toESM(require("assert"));
253530
253597
  import_node_events6 = require("events");
253531
253598
  import_miniflare27 = require("miniflare");
253532
253599
  init_errors();
@@ -253838,17 +253905,17 @@ function getAuthHook(auth, config) {
253838
253905
  }
253839
253906
  function deepStrictEqual(source, target) {
253840
253907
  try {
253841
- import_node_assert32.default.deepStrictEqual(source, target);
253908
+ import_node_assert33.default.deepStrictEqual(source, target);
253842
253909
  return true;
253843
253910
  } catch {
253844
253911
  return false;
253845
253912
  }
253846
253913
  }
253847
- var import_node_assert32;
253914
+ var import_node_assert33;
253848
253915
  var init_remoteBindings = __esm({
253849
253916
  "src/api/remoteBindings/index.ts"() {
253850
253917
  init_import_meta_url();
253851
- import_node_assert32 = __toESM(require("assert"));
253918
+ import_node_assert33 = __toESM(require("assert"));
253852
253919
  init_config5();
253853
253920
  init_misc_variables();
253854
253921
  init_user3();
@@ -253999,11 +254066,11 @@ async function getContainerDevOptions(containersConfig, containerBuildId) {
253999
254066
  }
254000
254067
  return containers2;
254001
254068
  }
254002
- var import_node_assert33, import_node_crypto15, import_promises36, import_miniflare28, LocalRuntimeController;
254069
+ var import_node_assert34, import_node_crypto15, import_promises36, import_miniflare28, LocalRuntimeController;
254003
254070
  var init_LocalRuntimeController = __esm({
254004
254071
  "src/api/startDevWorker/LocalRuntimeController.ts"() {
254005
254072
  init_import_meta_url();
254006
- import_node_assert33 = __toESM(require("assert"));
254073
+ import_node_assert34 = __toESM(require("assert"));
254007
254074
  import_node_crypto15 = require("crypto");
254008
254075
  import_promises36 = require("fs/promises");
254009
254076
  init_containers_shared();
@@ -254078,7 +254145,7 @@ var init_LocalRuntimeController = __esm({
254078
254145
  }
254079
254146
  if (data.config.containers?.length && data.config.dev.enableContainers && this.#currentContainerBuildId !== data.config.dev.containerBuildId) {
254080
254147
  this.dockerPath = data.config.dev?.dockerPath ?? getDockerPath();
254081
- (0, import_node_assert33.default)(
254148
+ (0, import_node_assert34.default)(
254082
254149
  data.config.dev.containerBuildId,
254083
254150
  "Build ID should be set if containers are enabled and defined"
254084
254151
  );
@@ -254208,7 +254275,7 @@ var init_LocalRuntimeController = __esm({
254208
254275
  if (!this.containerImageTagsSeen.size) {
254209
254276
  return;
254210
254277
  }
254211
- (0, import_node_assert33.default)(
254278
+ (0, import_node_assert34.default)(
254212
254279
  this.dockerPath,
254213
254280
  "Docker path should have been set if containers are enabled"
254214
254281
  );
@@ -254273,11 +254340,11 @@ function ensureMatchingSql(options) {
254273
254340
  }
254274
254341
  return options;
254275
254342
  }
254276
- var import_node_assert34, import_node_crypto16, import_miniflare29, MultiworkerRuntimeController;
254343
+ var import_node_assert35, import_node_crypto16, import_miniflare29, MultiworkerRuntimeController;
254277
254344
  var init_MultiworkerRuntimeController = __esm({
254278
254345
  "src/api/startDevWorker/MultiworkerRuntimeController.ts"() {
254279
254346
  init_import_meta_url();
254280
- import_node_assert34 = __toESM(require("assert"));
254347
+ import_node_assert35 = __toESM(require("assert"));
254281
254348
  import_node_crypto16 = require("crypto");
254282
254349
  init_containers_shared();
254283
254350
  init_source();
@@ -254321,7 +254388,7 @@ var init_MultiworkerRuntimeController = __esm({
254321
254388
  }
254322
254389
  #mergedMfOptions() {
254323
254390
  const primary = [...this.#options.values()].find((o6) => o6.primary);
254324
- (0, import_node_assert34.default)(primary !== void 0);
254391
+ (0, import_node_assert35.default)(primary !== void 0);
254325
254392
  const secondary = [...this.#options.values()].filter((o6) => !o6.primary);
254326
254393
  return {
254327
254394
  ...primary.options,
@@ -254357,7 +254424,7 @@ var init_MultiworkerRuntimeController = __esm({
254357
254424
  }
254358
254425
  if (data.config.containers?.length && this.#currentContainerBuildId !== data.config.dev.containerBuildId) {
254359
254426
  logger.log(source_default.dim("\u2394 Preparing container image(s)..."));
254360
- (0, import_node_assert34.default)(
254427
+ (0, import_node_assert35.default)(
254361
254428
  data.config.dev.containerBuildId,
254362
254429
  "Build ID should be set if containers are enabled and defined"
254363
254430
  );
@@ -256969,11 +257036,11 @@ async function generateAssetsFetch(directory, log2) {
256969
257036
  return await generateResponse(request4);
256970
257037
  };
256971
257038
  }
256972
- var import_node_assert35, import_node_fs40, import_node_path66, import_mime3, import_miniflare31, import_undici25, ProxyDispatcher, invalidAssetsFetch;
257039
+ var import_node_assert36, import_node_fs40, import_node_path66, import_mime3, import_miniflare31, import_undici25, ProxyDispatcher, invalidAssetsFetch;
256973
257040
  var init_assets6 = __esm({
256974
257041
  "src/miniflare-cli/assets.ts"() {
256975
257042
  init_import_meta_url();
256976
- import_node_assert35 = __toESM(require("assert"));
257043
+ import_node_assert36 = __toESM(require("assert"));
256977
257044
  import_node_fs40 = require("fs");
256978
257045
  import_node_path66 = require("path");
256979
257046
  init_createMetadataObject();
@@ -257011,12 +257078,12 @@ var init_assets6 = __esm({
257011
257078
  * by the `fetch()` function before calling `dispatcher.dispatch()`.
257012
257079
  */
257013
257080
  static reinstateHostHeader(headers, host) {
257014
- (0, import_node_assert35.default)(headers, "Expected all proxy requests to contain headers.");
257015
- (0, import_node_assert35.default)(
257081
+ (0, import_node_assert36.default)(headers, "Expected all proxy requests to contain headers.");
257082
+ (0, import_node_assert36.default)(
257016
257083
  !Array.isArray(headers),
257017
257084
  "Expected proxy request headers to be a hash object"
257018
257085
  );
257019
- (0, import_node_assert35.default)(
257086
+ (0, import_node_assert36.default)(
257020
257087
  Object.keys(headers).every((h7) => h7.toLowerCase() !== "host"),
257021
257088
  "Expected Host header to have been deleted."
257022
257089
  );
@@ -257050,7 +257117,7 @@ async function startDev(args) {
257050
257117
  unregisterHotKeys?.();
257051
257118
  accountId = await requireAuth(config);
257052
257119
  if (hotkeysDisplayed) {
257053
- (0, import_node_assert36.default)(devEnv !== void 0);
257120
+ (0, import_node_assert37.default)(devEnv !== void 0);
257054
257121
  unregisterHotKeys = registerDevHotKeys(
257055
257122
  Array.isArray(devEnv) ? devEnv : [devEnv],
257056
257123
  args,
@@ -257139,7 +257206,7 @@ async function startDev(args) {
257139
257206
  ...Array.isArray(devEnv) ? devEnv.map((d7) => d7.teardown()) : [devEnv?.teardown()],
257140
257207
  (async () => {
257141
257208
  if (teardownRegistryPromise) {
257142
- (0, import_node_assert36.default)(devEnv === void 0 || !Array.isArray(devEnv));
257209
+ (0, import_node_assert37.default)(devEnv === void 0 || !Array.isArray(devEnv));
257143
257210
  const teardownRegistry = await teardownRegistryPromise;
257144
257211
  await teardownRegistry(devEnv?.config.latestConfig?.name);
257145
257212
  }
@@ -257285,11 +257352,11 @@ function getResolvedSiteAssetPaths(args, configParam) {
257285
257352
  args.siteExclude
257286
257353
  );
257287
257354
  }
257288
- var import_node_assert36, import_node_path67;
257355
+ var import_node_assert37, import_node_path67;
257289
257356
  var init_start_dev = __esm({
257290
257357
  "src/dev/start-dev.ts"() {
257291
257358
  init_import_meta_url();
257292
- import_node_assert36 = __toESM(require("assert"));
257359
+ import_node_assert37 = __toESM(require("assert"));
257293
257360
  import_node_path67 = __toESM(require("path"));
257294
257361
  init_colors();
257295
257362
  init_containers_shared();
@@ -257422,6 +257489,7 @@ unstable_dev()'s behaviour will likely change in future releases`
257422
257489
  logLevel: options?.logLevel ?? defaultLogLevel,
257423
257490
  port: options?.port ?? 0,
257424
257491
  experimentalProvision: void 0,
257492
+ experimentalAutoCreate: false,
257425
257493
  experimentalRemoteBindings: true,
257426
257494
  experimentalVectorizeBindToProd: vectorizeBindToProd ?? false,
257427
257495
  experimentalImagesLocalMode: imagesLocalMode ?? false,
@@ -257437,7 +257505,8 @@ unstable_dev()'s behaviour will likely change in future releases`
257437
257505
  MULTIWORKER: false,
257438
257506
  RESOURCES_PROVISION: false,
257439
257507
  REMOTE_BINDINGS: false,
257440
- DEPLOY_REMOTE_DIFF_CHECK: false
257508
+ DEPLOY_REMOTE_DIFF_CHECK: false,
257509
+ AUTOCREATE_RESOURCES: false
257441
257510
  },
257442
257511
  () => startDev(devOptions)
257443
257512
  );