wrangler 3.107.2 → 3.107.3

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.
@@ -15468,8 +15468,8 @@ var require_util6 = __commonJS({
15468
15468
  }
15469
15469
  }
15470
15470
  __name(validateCookiePath, "validateCookiePath");
15471
- function validateCookieDomain(domain2) {
15472
- if (domain2.startsWith("-") || domain2.endsWith(".") || domain2.endsWith("-")) {
15471
+ function validateCookieDomain(domain3) {
15472
+ if (domain3.startsWith("-") || domain3.endsWith(".") || domain3.endsWith("-")) {
15473
15473
  throw new Error("Invalid cookie domain");
15474
15474
  }
15475
15475
  }
@@ -33614,13 +33614,13 @@ var require_extension = __commonJS({
33614
33614
  "use strict";
33615
33615
  init_import_meta_url();
33616
33616
  var { tokenChars } = require_validation();
33617
- function push(dest, name2, elem) {
33617
+ function push2(dest, name2, elem) {
33618
33618
  if (dest[name2] === void 0)
33619
33619
  dest[name2] = [elem];
33620
33620
  else
33621
33621
  dest[name2].push(elem);
33622
33622
  }
33623
- __name(push, "push");
33623
+ __name(push2, "push");
33624
33624
  function parse8(header) {
33625
33625
  const offers = /* @__PURE__ */ Object.create(null);
33626
33626
  let params = /* @__PURE__ */ Object.create(null);
@@ -33650,7 +33650,7 @@ var require_extension = __commonJS({
33650
33650
  end = i5;
33651
33651
  const name2 = header.slice(start, end);
33652
33652
  if (code === 44) {
33653
- push(offers, name2, params);
33653
+ push2(offers, name2, params);
33654
33654
  params = /* @__PURE__ */ Object.create(null);
33655
33655
  } else {
33656
33656
  extensionName = name2;
@@ -33672,9 +33672,9 @@ var require_extension = __commonJS({
33672
33672
  }
33673
33673
  if (end === -1)
33674
33674
  end = i5;
33675
- push(params, header.slice(start, end), true);
33675
+ push2(params, header.slice(start, end), true);
33676
33676
  if (code === 44) {
33677
- push(offers, extensionName, params);
33677
+ push2(offers, extensionName, params);
33678
33678
  params = /* @__PURE__ */ Object.create(null);
33679
33679
  extensionName = void 0;
33680
33680
  }
@@ -33726,9 +33726,9 @@ var require_extension = __commonJS({
33726
33726
  value = value.replace(/\\/g, "");
33727
33727
  mustUnescape = false;
33728
33728
  }
33729
- push(params, paramName, value);
33729
+ push2(params, paramName, value);
33730
33730
  if (code === 44) {
33731
- push(offers, extensionName, params);
33731
+ push2(offers, extensionName, params);
33732
33732
  params = /* @__PURE__ */ Object.create(null);
33733
33733
  extensionName = void 0;
33734
33734
  }
@@ -33746,16 +33746,16 @@ var require_extension = __commonJS({
33746
33746
  end = i5;
33747
33747
  const token = header.slice(start, end);
33748
33748
  if (extensionName === void 0) {
33749
- push(offers, token, params);
33749
+ push2(offers, token, params);
33750
33750
  } else {
33751
33751
  if (paramName === void 0) {
33752
- push(params, token, true);
33752
+ push2(params, token, true);
33753
33753
  } else if (mustUnescape) {
33754
- push(params, paramName, token.replace(/\\/g, ""));
33754
+ push2(params, paramName, token.replace(/\\/g, ""));
33755
33755
  } else {
33756
- push(params, paramName, token);
33756
+ push2(params, paramName, token);
33757
33757
  }
33758
- push(offers, extensionName, params);
33758
+ push2(offers, extensionName, params);
33759
33759
  }
33760
33760
  return offers;
33761
33761
  }
@@ -54594,13 +54594,13 @@ var require_cross_spawn = __commonJS({
54594
54594
  var cp3 = require("child_process");
54595
54595
  var parse8 = require_parse3();
54596
54596
  var enoent = require_enoent();
54597
- function spawn2(command2, args, options30) {
54597
+ function spawn3(command2, args, options30) {
54598
54598
  const parsed = parse8(command2, args, options30);
54599
54599
  const spawned = cp3.spawn(parsed.command, parsed.args, parsed.options);
54600
54600
  enoent.hookChildProcess(spawned, parsed);
54601
54601
  return spawned;
54602
54602
  }
54603
- __name(spawn2, "spawn");
54603
+ __name(spawn3, "spawn");
54604
54604
  function spawnSync3(command2, args, options30) {
54605
54605
  const parsed = parse8(command2, args, options30);
54606
54606
  const result = cp3.spawnSync(parsed.command, parsed.args, parsed.options);
@@ -54608,8 +54608,8 @@ var require_cross_spawn = __commonJS({
54608
54608
  return result;
54609
54609
  }
54610
54610
  __name(spawnSync3, "spawnSync");
54611
- module3.exports = spawn2;
54612
- module3.exports.spawn = spawn2;
54611
+ module3.exports = spawn3;
54612
+ module3.exports.spawn = spawn3;
54613
54613
  module3.exports.sync = spawnSync3;
54614
54614
  module3.exports._parse = parse8;
54615
54615
  module3.exports._enoent = enoent;
@@ -59664,7 +59664,7 @@ var require_parse4 = __commonJS({
59664
59664
  state2[type]--;
59665
59665
  stack.pop();
59666
59666
  }, "decrement");
59667
- const push = /* @__PURE__ */ __name((tok) => {
59667
+ const push2 = /* @__PURE__ */ __name((tok) => {
59668
59668
  if (prev.type === "globstar") {
59669
59669
  const isBrace = state2.braces > 0 && (tok.type === "comma" || tok.type === "brace");
59670
59670
  const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
@@ -59697,8 +59697,8 @@ var require_parse4 = __commonJS({
59697
59697
  token.output = state2.output;
59698
59698
  const output = (opts.capture ? "(" : "") + token.open;
59699
59699
  increment2("parens");
59700
- push({ type, value: value2, output: state2.output ? "" : ONE_CHAR });
59701
- push({ type: "paren", extglob: true, value: advance(), output });
59700
+ push2({ type, value: value2, output: state2.output ? "" : ONE_CHAR });
59701
+ push2({ type: "paren", extglob: true, value: advance(), output });
59702
59702
  extglobs.push(token);
59703
59703
  }, "extglobOpen");
59704
59704
  const extglobClose = /* @__PURE__ */ __name((token) => {
@@ -59720,7 +59720,7 @@ var require_parse4 = __commonJS({
59720
59720
  state2.negatedExtglob = true;
59721
59721
  }
59722
59722
  }
59723
- push({ type: "paren", extglob: true, value, output });
59723
+ push2({ type: "paren", extglob: true, value, output });
59724
59724
  decrement("parens");
59725
59725
  }, "extglobClose");
59726
59726
  if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
@@ -59781,7 +59781,7 @@ var require_parse4 = __commonJS({
59781
59781
  }
59782
59782
  if (!next) {
59783
59783
  value += "\\";
59784
- push({ type: "text", value });
59784
+ push2({ type: "text", value });
59785
59785
  continue;
59786
59786
  }
59787
59787
  const match2 = /^\\+/.exec(remaining());
@@ -59799,7 +59799,7 @@ var require_parse4 = __commonJS({
59799
59799
  value += advance();
59800
59800
  }
59801
59801
  if (state2.brackets === 0) {
59802
- push({ type: "text", value });
59802
+ push2({ type: "text", value });
59803
59803
  continue;
59804
59804
  }
59805
59805
  }
@@ -59847,13 +59847,13 @@ var require_parse4 = __commonJS({
59847
59847
  if (value === '"') {
59848
59848
  state2.quotes = state2.quotes === 1 ? 0 : 1;
59849
59849
  if (opts.keepQuotes === true) {
59850
- push({ type: "text", value });
59850
+ push2({ type: "text", value });
59851
59851
  }
59852
59852
  continue;
59853
59853
  }
59854
59854
  if (value === "(") {
59855
59855
  increment2("parens");
59856
- push({ type: "paren", value });
59856
+ push2({ type: "paren", value });
59857
59857
  continue;
59858
59858
  }
59859
59859
  if (value === ")") {
@@ -59865,7 +59865,7 @@ var require_parse4 = __commonJS({
59865
59865
  extglobClose(extglobs.pop());
59866
59866
  continue;
59867
59867
  }
59868
- push({ type: "paren", value, output: state2.parens ? ")" : "\\)" });
59868
+ push2({ type: "paren", value, output: state2.parens ? ")" : "\\)" });
59869
59869
  decrement("parens");
59870
59870
  continue;
59871
59871
  }
@@ -59878,19 +59878,19 @@ var require_parse4 = __commonJS({
59878
59878
  } else {
59879
59879
  increment2("brackets");
59880
59880
  }
59881
- push({ type: "bracket", value });
59881
+ push2({ type: "bracket", value });
59882
59882
  continue;
59883
59883
  }
59884
59884
  if (value === "]") {
59885
59885
  if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
59886
- push({ type: "text", value, output: `\\${value}` });
59886
+ push2({ type: "text", value, output: `\\${value}` });
59887
59887
  continue;
59888
59888
  }
59889
59889
  if (state2.brackets === 0) {
59890
59890
  if (opts.strictBrackets === true) {
59891
59891
  throw new SyntaxError(syntaxError("opening", "["));
59892
59892
  }
59893
- push({ type: "text", value, output: `\\${value}` });
59893
+ push2({ type: "text", value, output: `\\${value}` });
59894
59894
  continue;
59895
59895
  }
59896
59896
  decrement("brackets");
@@ -59924,13 +59924,13 @@ var require_parse4 = __commonJS({
59924
59924
  tokensIndex: state2.tokens.length
59925
59925
  };
59926
59926
  braces.push(open4);
59927
- push(open4);
59927
+ push2(open4);
59928
59928
  continue;
59929
59929
  }
59930
59930
  if (value === "}") {
59931
59931
  const brace = braces[braces.length - 1];
59932
59932
  if (opts.nobrace === true || !brace) {
59933
- push({ type: "text", value, output: value });
59933
+ push2({ type: "text", value, output: value });
59934
59934
  continue;
59935
59935
  }
59936
59936
  let output = ")";
@@ -59959,7 +59959,7 @@ var require_parse4 = __commonJS({
59959
59959
  state2.output += t7.output || t7.value;
59960
59960
  }
59961
59961
  }
59962
- push({ type: "brace", value, output });
59962
+ push2({ type: "brace", value, output });
59963
59963
  decrement("braces");
59964
59964
  braces.pop();
59965
59965
  continue;
@@ -59968,7 +59968,7 @@ var require_parse4 = __commonJS({
59968
59968
  if (extglobs.length > 0) {
59969
59969
  extglobs[extglobs.length - 1].conditions++;
59970
59970
  }
59971
- push({ type: "text", value });
59971
+ push2({ type: "text", value });
59972
59972
  continue;
59973
59973
  }
59974
59974
  if (value === ",") {
@@ -59978,7 +59978,7 @@ var require_parse4 = __commonJS({
59978
59978
  brace.comma = true;
59979
59979
  output = "|";
59980
59980
  }
59981
- push({ type: "comma", value, output });
59981
+ push2({ type: "comma", value, output });
59982
59982
  continue;
59983
59983
  }
59984
59984
  if (value === "/") {
@@ -59990,7 +59990,7 @@ var require_parse4 = __commonJS({
59990
59990
  prev = bos;
59991
59991
  continue;
59992
59992
  }
59993
- push({ type: "slash", value, output: SLASH_LITERAL });
59993
+ push2({ type: "slash", value, output: SLASH_LITERAL });
59994
59994
  continue;
59995
59995
  }
59996
59996
  if (value === ".") {
@@ -60005,10 +60005,10 @@ var require_parse4 = __commonJS({
60005
60005
  continue;
60006
60006
  }
60007
60007
  if (state2.braces + state2.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
60008
- push({ type: "text", value, output: DOT_LITERAL });
60008
+ push2({ type: "text", value, output: DOT_LITERAL });
60009
60009
  continue;
60010
60010
  }
60011
- push({ type: "dot", value, output: DOT_LITERAL });
60011
+ push2({ type: "dot", value, output: DOT_LITERAL });
60012
60012
  continue;
60013
60013
  }
60014
60014
  if (value === "?") {
@@ -60026,14 +60026,14 @@ var require_parse4 = __commonJS({
60026
60026
  if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) {
60027
60027
  output = `\\${value}`;
60028
60028
  }
60029
- push({ type: "text", value, output });
60029
+ push2({ type: "text", value, output });
60030
60030
  continue;
60031
60031
  }
60032
60032
  if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
60033
- push({ type: "qmark", value, output: QMARK_NO_DOT });
60033
+ push2({ type: "qmark", value, output: QMARK_NO_DOT });
60034
60034
  continue;
60035
60035
  }
60036
- push({ type: "qmark", value, output: QMARK });
60036
+ push2({ type: "qmark", value, output: QMARK });
60037
60037
  continue;
60038
60038
  }
60039
60039
  if (value === "!") {
@@ -60054,22 +60054,22 @@ var require_parse4 = __commonJS({
60054
60054
  continue;
60055
60055
  }
60056
60056
  if (prev && prev.value === "(" || opts.regex === false) {
60057
- push({ type: "plus", value, output: PLUS_LITERAL });
60057
+ push2({ type: "plus", value, output: PLUS_LITERAL });
60058
60058
  continue;
60059
60059
  }
60060
60060
  if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state2.parens > 0) {
60061
- push({ type: "plus", value });
60061
+ push2({ type: "plus", value });
60062
60062
  continue;
60063
60063
  }
60064
- push({ type: "plus", value: PLUS_LITERAL });
60064
+ push2({ type: "plus", value: PLUS_LITERAL });
60065
60065
  continue;
60066
60066
  }
60067
60067
  if (value === "@") {
60068
60068
  if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
60069
- push({ type: "at", extglob: true, value, output: "" });
60069
+ push2({ type: "at", extglob: true, value, output: "" });
60070
60070
  continue;
60071
60071
  }
60072
- push({ type: "text", value });
60072
+ push2({ type: "text", value });
60073
60073
  continue;
60074
60074
  }
60075
60075
  if (value !== "*") {
@@ -60081,7 +60081,7 @@ var require_parse4 = __commonJS({
60081
60081
  value += match2[0];
60082
60082
  state2.index += match2[0].length;
60083
60083
  }
60084
- push({ type: "text", value });
60084
+ push2({ type: "text", value });
60085
60085
  continue;
60086
60086
  }
60087
60087
  if (prev && (prev.type === "globstar" || prev.star === true)) {
@@ -60109,13 +60109,13 @@ var require_parse4 = __commonJS({
60109
60109
  const isStart = prior.type === "slash" || prior.type === "bos";
60110
60110
  const afterStar = before && (before.type === "star" || before.type === "globstar");
60111
60111
  if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
60112
- push({ type: "star", value, output: "" });
60112
+ push2({ type: "star", value, output: "" });
60113
60113
  continue;
60114
60114
  }
60115
60115
  const isBrace = state2.braces > 0 && (prior.type === "comma" || prior.type === "brace");
60116
60116
  const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
60117
60117
  if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
60118
- push({ type: "star", value, output: "" });
60118
+ push2({ type: "star", value, output: "" });
60119
60119
  continue;
60120
60120
  }
60121
60121
  while (rest.slice(0, 3) === "/**") {
@@ -60156,7 +60156,7 @@ var require_parse4 = __commonJS({
60156
60156
  state2.output += prior.output + prev.output;
60157
60157
  state2.globstar = true;
60158
60158
  consume(value + advance());
60159
- push({ type: "slash", value: "/", output: "" });
60159
+ push2({ type: "slash", value: "/", output: "" });
60160
60160
  continue;
60161
60161
  }
60162
60162
  if (prior.type === "bos" && rest[0] === "/") {
@@ -60166,7 +60166,7 @@ var require_parse4 = __commonJS({
60166
60166
  state2.output = prev.output;
60167
60167
  state2.globstar = true;
60168
60168
  consume(value + advance());
60169
- push({ type: "slash", value: "/", output: "" });
60169
+ push2({ type: "slash", value: "/", output: "" });
60170
60170
  continue;
60171
60171
  }
60172
60172
  state2.output = state2.output.slice(0, -prev.output.length);
@@ -60184,12 +60184,12 @@ var require_parse4 = __commonJS({
60184
60184
  if (prev.type === "bos" || prev.type === "slash") {
60185
60185
  token.output = nodot + token.output;
60186
60186
  }
60187
- push(token);
60187
+ push2(token);
60188
60188
  continue;
60189
60189
  }
60190
60190
  if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
60191
60191
  token.output = value;
60192
- push(token);
60192
+ push2(token);
60193
60193
  continue;
60194
60194
  }
60195
60195
  if (state2.index === state2.start || prev.type === "slash" || prev.type === "dot") {
@@ -60208,7 +60208,7 @@ var require_parse4 = __commonJS({
60208
60208
  prev.output += ONE_CHAR;
60209
60209
  }
60210
60210
  }
60211
- push(token);
60211
+ push2(token);
60212
60212
  }
60213
60213
  while (state2.brackets > 0) {
60214
60214
  if (opts.strictBrackets === true)
@@ -60229,7 +60229,7 @@ var require_parse4 = __commonJS({
60229
60229
  decrement("braces");
60230
60230
  }
60231
60231
  if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) {
60232
- push({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` });
60232
+ push2({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` });
60233
60233
  }
60234
60234
  if (state2.backtrack === true) {
60235
60235
  state2.output = "";
@@ -73467,7 +73467,7 @@ Make sure "${service}" is mounted so Miniflare knows where to find it.`);
73467
73467
  })
73468
73468
  ], BindingsPlugin.prototype, "serviceBindings", 2);
73469
73469
  var import_assert32 = __toModule(require("assert"));
73470
- var import_child_process4 = __toModule(require("child_process"));
73470
+ var import_child_process5 = __toModule(require("child_process"));
73471
73471
  var import_path32 = __toModule(require("path"));
73472
73472
  var import_shared9 = __toModule(require_src3());
73473
73473
  var BuildError = /* @__PURE__ */ __name(class extends import_shared9.MiniflareError {
@@ -73481,11 +73481,11 @@ Make sure "${service}" is mounted so Miniflare knows where to find it.`);
73481
73481
  this.assignOptions(options30);
73482
73482
  }
73483
73483
  beforeSetup() {
73484
- const buildCommand = this.buildCommand;
73485
- if (!buildCommand)
73484
+ const buildCommand2 = this.buildCommand;
73485
+ if (!buildCommand2)
73486
73486
  return {};
73487
73487
  return new Promise((resolve24, reject) => {
73488
- const build5 = import_child_process4.default.spawn(buildCommand, {
73488
+ const build5 = import_child_process5.default.spawn(buildCommand2, {
73489
73489
  cwd: this.buildBasePath ? import_path32.default.resolve(this.ctx.rootPath, this.buildBasePath) : this.ctx.rootPath,
73490
73490
  shell: true,
73491
73491
  stdio: "inherit",
@@ -94969,12 +94969,12 @@ var init_getValidatedProcessCredentials = __esm({
94969
94969
  });
94970
94970
 
94971
94971
  // ../../node_modules/.pnpm/@aws-sdk+credential-provider-process@3.716.0/node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js
94972
- var import_child_process2, import_util14, resolveProcessCredentials;
94972
+ var import_child_process3, import_util14, resolveProcessCredentials;
94973
94973
  var init_resolveProcessCredentials = __esm({
94974
94974
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-process@3.716.0/node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js"() {
94975
94975
  init_import_meta_url();
94976
94976
  init_dist_es16();
94977
- import_child_process2 = require("child_process");
94977
+ import_child_process3 = require("child_process");
94978
94978
  import_util14 = require("util");
94979
94979
  init_getValidatedProcessCredentials();
94980
94980
  resolveProcessCredentials = /* @__PURE__ */ __name(async (profileName, profiles, logger4) => {
@@ -94982,7 +94982,7 @@ var init_resolveProcessCredentials = __esm({
94982
94982
  if (profiles[profileName]) {
94983
94983
  const credentialProcess = profile["credential_process"];
94984
94984
  if (credentialProcess !== void 0) {
94985
- const execPromise = (0, import_util14.promisify)(import_child_process2.exec);
94985
+ const execPromise = (0, import_util14.promisify)(import_child_process3.exec);
94986
94986
  try {
94987
94987
  const { stdout: stdout2 } = await execPromise(credentialProcess);
94988
94988
  let data;
@@ -98108,7 +98108,7 @@ var import_undici3 = __toESM(require_undici());
98108
98108
 
98109
98109
  // package.json
98110
98110
  var name = "wrangler";
98111
- var version = "3.107.2";
98111
+ var version = "3.107.3";
98112
98112
 
98113
98113
  // src/environment-variables/misc-variables.ts
98114
98114
  init_import_meta_url();
@@ -107020,45 +107020,45 @@ var import_child_process = require("child_process");
107020
107020
  var import_undici = __toESM(require_undici());
107021
107021
  var cache = {};
107022
107022
  var usesAccessCache = /* @__PURE__ */ new Map();
107023
- async function domainUsesAccess(domain2) {
107024
- logger.debug("Checking if domain has Access enabled:", domain2);
107025
- if (usesAccessCache.has(domain2)) {
107023
+ async function domainUsesAccess(domain3) {
107024
+ logger.debug("Checking if domain has Access enabled:", domain3);
107025
+ if (usesAccessCache.has(domain3)) {
107026
107026
  logger.debug(
107027
107027
  "Using cached Access switch for:",
107028
- domain2,
107029
- usesAccessCache.get(domain2)
107028
+ domain3,
107029
+ usesAccessCache.get(domain3)
107030
107030
  );
107031
- return usesAccessCache.get(domain2);
107031
+ return usesAccessCache.get(domain3);
107032
107032
  }
107033
- logger.debug("Access switch not cached for:", domain2);
107033
+ logger.debug("Access switch not cached for:", domain3);
107034
107034
  try {
107035
107035
  const controller = new AbortController();
107036
107036
  const cancel3 = setTimeout(() => {
107037
107037
  controller.abort();
107038
107038
  }, 1e3);
107039
- const output = await (0, import_undici.fetch)(`https://${domain2}`, {
107039
+ const output = await (0, import_undici.fetch)(`https://${domain3}`, {
107040
107040
  redirect: "manual",
107041
107041
  signal: controller.signal
107042
107042
  });
107043
107043
  clearTimeout(cancel3);
107044
107044
  const usesAccess = !!(output.status === 302 && output.headers.get("location")?.includes("cloudflareaccess.com"));
107045
- logger.debug("Caching access switch for:", domain2);
107046
- usesAccessCache.set(domain2, usesAccess);
107045
+ logger.debug("Caching access switch for:", domain3);
107046
+ usesAccessCache.set(domain3, usesAccess);
107047
107047
  return usesAccess;
107048
107048
  } catch (e7) {
107049
- usesAccessCache.set(domain2, false);
107049
+ usesAccessCache.set(domain3, false);
107050
107050
  return false;
107051
107051
  }
107052
107052
  }
107053
107053
  __name(domainUsesAccess, "domainUsesAccess");
107054
- async function getAccessToken(domain2) {
107055
- if (!await domainUsesAccess(domain2)) {
107054
+ async function getAccessToken(domain3) {
107055
+ if (!await domainUsesAccess(domain3)) {
107056
107056
  return void 0;
107057
107057
  }
107058
- if (cache[domain2]) {
107059
- return cache[domain2];
107058
+ if (cache[domain3]) {
107059
+ return cache[domain3];
107060
107060
  }
107061
- const output = (0, import_child_process.spawnSync)("cloudflared", ["access", "login", domain2]);
107061
+ const output = (0, import_child_process.spawnSync)("cloudflared", ["access", "login", domain3]);
107062
107062
  if (output.error) {
107063
107063
  throw new UserError(
107064
107064
  "To use Wrangler with Cloudflare Access, please install `cloudflared` from https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/installation"
@@ -107067,7 +107067,7 @@ async function getAccessToken(domain2) {
107067
107067
  const stringOutput = output.stdout.toString();
107068
107068
  const matches = stringOutput.match(/fetched your token:\n\n(.*)/m);
107069
107069
  if (matches && matches.length >= 2) {
107070
- cache[domain2] = matches[1];
107070
+ cache[domain3] = matches[1];
107071
107071
  return matches[1];
107072
107072
  }
107073
107073
  throw new Error("Failed to authenticate with Cloudflare Access");
@@ -121848,18 +121848,18 @@ async function publishCustomDomains(workerUrl, accountId, domains) {
121848
121848
  }
121849
121849
  );
121850
121850
  const updatesRequired = changeset.updated.filter(
121851
- (domain2) => domain2.modified
121851
+ (domain3) => domain3.modified
121852
121852
  );
121853
121853
  if (updatesRequired.length > 0) {
121854
121854
  const existing = await Promise.all(
121855
121855
  updatesRequired.map(
121856
- (domain2) => fetchResult(
121857
- `/accounts/${accountId}/workers/domains/records/${domain2.id}`
121856
+ (domain3) => fetchResult(
121857
+ `/accounts/${accountId}/workers/domains/records/${domain3.id}`
121858
121858
  )
121859
121859
  )
121860
121860
  );
121861
121861
  const existingRendered = existing.map(
121862
- (domain2) => ` \u2022 ${domain2.hostname} (used as a domain for "${domain2.service}")`
121862
+ (domain3) => ` \u2022 ${domain3.hostname} (used as a domain for "${domain3.service}")`
121863
121863
  ).join("\n");
121864
121864
  const message = `Custom Domains already exist for these domains:
121865
121865
  ${existingRendered}
@@ -121870,7 +121870,7 @@ Update them to point to this script instead?`;
121870
121870
  config.override_existing_origin = true;
121871
121871
  }
121872
121872
  if (changeset.conflicting.length > 0) {
121873
- const conflicitingRendered = changeset.conflicting.map((domain2) => ` \u2022 ${domain2.hostname}`).join("\n");
121873
+ const conflicitingRendered = changeset.conflicting.map((domain3) => ` \u2022 ${domain3.hostname}`).join("\n");
121874
121874
  const message = `You already have DNS records that conflict for these Custom Domains:
121875
121875
  ${conflicitingRendered}
121876
121876
  Update them to point to this script instead?`;
@@ -121887,7 +121887,7 @@ Update them to point to this script instead?`;
121887
121887
  "Content-Type": "application/json"
121888
121888
  }
121889
121889
  });
121890
- return domains.map((domain2) => renderRoute(domain2));
121890
+ return domains.map((domain3) => renderRoute(domain3));
121891
121891
  }
121892
121892
  __name(publishCustomDomains, "publishCustomDomains");
121893
121893
  async function deploy(props) {
@@ -133453,12 +133453,12 @@ var ImageRegistriesService = class {
133453
133453
  * @returns AccountRegistryToken Credentials with 'pull' or 'push' permissions to access the registry
133454
133454
  * @throws ApiError
133455
133455
  */
133456
- static generateImageRegistryCredentials(domain2, requestBody) {
133456
+ static generateImageRegistryCredentials(domain3, requestBody) {
133457
133457
  return request(OpenAPI, {
133458
133458
  method: "POST",
133459
133459
  url: "/registries/{domain}/credentials",
133460
133460
  path: {
133461
- domain: domain2
133461
+ domain: domain3
133462
133462
  },
133463
133463
  body: requestBody,
133464
133464
  mediaType: "application/json",
@@ -133477,12 +133477,12 @@ var ImageRegistriesService = class {
133477
133477
  * @returns EmptyResponse The image registry is deleted
133478
133478
  * @throws ApiError
133479
133479
  */
133480
- static deleteImageRegistry(domain2) {
133480
+ static deleteImageRegistry(domain3) {
133481
133481
  return request(OpenAPI, {
133482
133482
  method: "DELETE",
133483
133483
  url: "/registries/{domain}",
133484
133484
  path: {
133485
- domain: domain2
133485
+ domain: domain3
133486
133486
  },
133487
133487
  errors: {
133488
133488
  404: `The image registry does not exist`,
@@ -133722,8 +133722,8 @@ var imageRe = (() => {
133722
133722
  const alphaNumeric = "[a-z0-9]+";
133723
133723
  const separator = "(?:\\.|_|__|-+)";
133724
133724
  const port = ":[0-9]+";
133725
- const domain2 = `${alphaNumeric}(?:${separator}${alphaNumeric})*`;
133726
- const name2 = `(?:${domain2}(?:${port})?/)?(?:${domain2}/)*(?:${domain2})`;
133725
+ const domain3 = `${alphaNumeric}(?:${separator}${alphaNumeric})*`;
133726
+ const name2 = `(?:${domain3}(?:${port})?/)?(?:${domain3}/)*(?:${domain3})`;
133727
133727
  const tag = ":([a-zA-Z0-9_][a-zA-Z0-9._-]{0,127})";
133728
133728
  const digest = "@(sha256:[A-Fa-f0-9]+)";
133729
133729
  const reference = `(?:${tag}(?:${digest})?|${digest})`;
@@ -134753,6 +134753,173 @@ ${formatError(err)}`
134753
134753
  }
134754
134754
  __name(applyCommand, "applyCommand");
134755
134755
 
134756
+ // src/cloudchamber/build.ts
134757
+ init_import_meta_url();
134758
+ var import_child_process2 = require("child_process");
134759
+ var domain = "registry.cloudchamber.cfdata.org";
134760
+ async function dockerLoginManagedRegistry(options30) {
134761
+ const dockerPath = options30.pathToDocker ?? "docker";
134762
+ const expirationMinutes = 15;
134763
+ await ImageRegistriesService.generateImageRegistryCredentials(domain, {
134764
+ expiration_minutes: expirationMinutes,
134765
+ permissions: ["push"]
134766
+ }).then(async (credentials) => {
134767
+ const child = (0, import_child_process2.spawn)(
134768
+ dockerPath,
134769
+ ["login", "--password-stdin", "--username", "v1", domain],
134770
+ { stdio: ["pipe", "inherit", "inherit"] }
134771
+ ).on("error", (err) => {
134772
+ throw err;
134773
+ });
134774
+ child.stdin.write(credentials.password);
134775
+ child.stdin.end();
134776
+ await new Promise((resolve24) => {
134777
+ child.on("close", resolve24);
134778
+ });
134779
+ });
134780
+ }
134781
+ __name(dockerLoginManagedRegistry, "dockerLoginManagedRegistry");
134782
+ async function constructBuildCommand(options30) {
134783
+ if (typeof options30.pathToDockerfile !== "undefined" && options30.pathToDockerfile !== "" && (typeof options30.imageTag === "undefined" || options30.imageTag === "")) {
134784
+ throw new Error("must provide an image tag if providing a docker file");
134785
+ }
134786
+ const dockerFilePath = options30.pathToDockerfile;
134787
+ const dockerPath = options30.pathToDocker ?? "docker";
134788
+ const imageTag = domain + "/" + options30.imageTag;
134789
+ const platform3 = options30.platform ? options30.platform : "linux/amd64";
134790
+ const defaultBuildCommand = [
134791
+ dockerPath,
134792
+ "build",
134793
+ "-t",
134794
+ imageTag,
134795
+ "--platform",
134796
+ platform3,
134797
+ dockerFilePath
134798
+ ].join(" ");
134799
+ return defaultBuildCommand;
134800
+ }
134801
+ __name(constructBuildCommand, "constructBuildCommand");
134802
+ async function dockerBuild(options30) {
134803
+ const buildCmd = options30.buildCmd.split(" ").slice(1);
134804
+ const buildExec = options30.buildCmd.split(" ").shift();
134805
+ const child = (0, import_child_process2.spawn)(String(buildExec), buildCmd, { stdio: "inherit" }).on(
134806
+ "error",
134807
+ (err) => {
134808
+ throw err;
134809
+ }
134810
+ );
134811
+ await new Promise((resolve24) => {
134812
+ child.on("close", resolve24);
134813
+ });
134814
+ }
134815
+ __name(dockerBuild, "dockerBuild");
134816
+ async function tagImage(original, newTag, dockerPath) {
134817
+ const child = (0, import_child_process2.spawn)(dockerPath, ["tag", original, newTag]).on(
134818
+ "error",
134819
+ (err) => {
134820
+ throw err;
134821
+ }
134822
+ );
134823
+ await new Promise((resolve24) => {
134824
+ child.on("close", resolve24);
134825
+ });
134826
+ }
134827
+ __name(tagImage, "tagImage");
134828
+ async function push(options30) {
134829
+ if (typeof options30.imageTag === "undefined") {
134830
+ throw new Error("Must provide an image tag when pushing");
134831
+ }
134832
+ const imageTag = domain + "/" + options30.imageTag;
134833
+ const dockerPath = options30.pathToDocker ?? "docker";
134834
+ await tagImage(options30.imageTag, imageTag, dockerPath);
134835
+ const child = (0, import_child_process2.spawn)(dockerPath, ["image", "push", imageTag], {
134836
+ stdio: "inherit"
134837
+ }).on("error", (err) => {
134838
+ throw err;
134839
+ });
134840
+ await new Promise((resolve24) => {
134841
+ child.on("close", resolve24);
134842
+ });
134843
+ }
134844
+ __name(push, "push");
134845
+ function buildYargs(yargs) {
134846
+ return yargs.positional("PATH", {
134847
+ type: "string",
134848
+ describe: "Path for the directory containing the Dockerfile to build",
134849
+ demandOption: true
134850
+ }).option("tag", {
134851
+ alias: "t",
134852
+ type: "string",
134853
+ demandOption: true,
134854
+ describe: 'Name and optionally a tag (format: "name:tag")'
134855
+ }).option("path-to-docker", {
134856
+ type: "string",
134857
+ default: "docker",
134858
+ describe: "Path to your docker binary if it's not on $PATH",
134859
+ demandOption: false
134860
+ }).option("push", {
134861
+ alias: "p",
134862
+ type: "boolean",
134863
+ describe: "Push the built image to Cloudflare's managed registry",
134864
+ default: false
134865
+ }).option("platform", {
134866
+ type: "string",
134867
+ default: "linux/amd64",
134868
+ describe: "Platform to build for. Defaults to the architecture support by Workers (linux/amd64)",
134869
+ demandOption: false
134870
+ });
134871
+ }
134872
+ __name(buildYargs, "buildYargs");
134873
+ function pushYargs(yargs) {
134874
+ return yargs.option("path-to-docker", {
134875
+ type: "string",
134876
+ default: "docker",
134877
+ describe: "Path to your docker binary if it's not on $PATH",
134878
+ demandOption: false
134879
+ }).positional("TAG", { type: "string", demandOption: true });
134880
+ }
134881
+ __name(pushYargs, "pushYargs");
134882
+ async function buildCommand(args, _4) {
134883
+ try {
134884
+ await constructBuildCommand({
134885
+ imageTag: args.tag,
134886
+ pathToDockerfile: args.PATH,
134887
+ pathToDocker: args.pathToDocker
134888
+ }).then(async (bc2) => dockerBuild({ buildCmd: bc2 })).then(async () => {
134889
+ if (args.push) {
134890
+ await dockerLoginManagedRegistry({
134891
+ pathToDocker: args.pathToDocker
134892
+ }).then(async () => {
134893
+ await push({ imageTag: args.tag });
134894
+ });
134895
+ }
134896
+ });
134897
+ } catch (error2) {
134898
+ if (error2 instanceof Error) {
134899
+ logRaw(error2.message);
134900
+ } else {
134901
+ logRaw("An unknown error occurred");
134902
+ }
134903
+ }
134904
+ }
134905
+ __name(buildCommand, "buildCommand");
134906
+ async function pushCommand(args, _4) {
134907
+ try {
134908
+ await dockerLoginManagedRegistry({
134909
+ pathToDocker: args.pathToDocker
134910
+ }).then(async () => {
134911
+ await push({ imageTag: args.TAG });
134912
+ });
134913
+ } catch (error2) {
134914
+ if (error2 instanceof Error) {
134915
+ logRaw(error2.message);
134916
+ } else {
134917
+ logRaw("An unknown error occurred");
134918
+ }
134919
+ }
134920
+ }
134921
+ __name(pushCommand, "pushCommand");
134922
+
134756
134923
  // src/cloudchamber/create.ts
134757
134924
  init_import_meta_url();
134758
134925
 
@@ -136204,7 +136371,7 @@ public_key: ${dim(
136204
136371
  __name(handleListImageRegistriesCommand, "handleListImageRegistriesCommand");
136205
136372
  async function handleConfigureImageRegistryCommand(args, _config) {
136206
136373
  startSection("Configure a Docker registry in Cloudflare");
136207
- const domain2 = await processArgument({ domain: args.domain }, "domain", {
136374
+ const domain3 = await processArgument({ domain: args.domain }, "domain", {
136208
136375
  type: "text",
136209
136376
  question: "What is the domain of your registry?",
136210
136377
  validate: (text) => {
@@ -136226,7 +136393,7 @@ async function handleConfigureImageRegistryCommand(args, _config) {
136226
136393
  const [registry, err] = await wrap2(
136227
136394
  promiseSpinner(
136228
136395
  ImageRegistriesService.createImageRegistry({
136229
- domain: domain2,
136396
+ domain: domain3,
136230
136397
  is_public: isPublic
136231
136398
  })
136232
136399
  )
@@ -136656,6 +136823,16 @@ var cloudchamber = /* @__PURE__ */ __name((yargs, subHelp) => {
136656
136823
  "apply the changes in the container applications to deploy",
136657
136824
  (args) => applyCommandOptionalYargs(args),
136658
136825
  (args) => handleFailure(applyCommand)(args)
136826
+ ).command(
136827
+ "build [PATH]",
136828
+ "build a dockerfile",
136829
+ (args) => buildYargs(args),
136830
+ (args) => handleFailure(buildCommand)(args)
136831
+ ).command(
136832
+ "push [TAG]",
136833
+ "push a tagged image to a Cloudflare managed registry, which is automatically integrated with your account",
136834
+ (args) => pushYargs(args),
136835
+ (args) => handleFailure(pushCommand)(args)
136659
136836
  );
136660
136837
  }, "cloudchamber");
136661
136838
 
@@ -154975,15 +155152,15 @@ var r2BucketDomainGetCommand = createCommand({
154975
155152
  type: "string"
154976
155153
  }
154977
155154
  },
154978
- async handler({ bucket, domain: domain2, jurisdiction }, { config }) {
155155
+ async handler({ bucket, domain: domain3, jurisdiction }, { config }) {
154979
155156
  const accountId = await requireAuth(config);
154980
155157
  logger.log(
154981
- `Retrieving custom domain '${domain2}' connected to bucket '${bucket}'...`
155158
+ `Retrieving custom domain '${domain3}' connected to bucket '${bucket}'...`
154982
155159
  );
154983
155160
  const domainResponse = await getCustomDomain(
154984
155161
  accountId,
154985
155162
  bucket,
154986
- domain2,
155163
+ domain3,
154987
155164
  jurisdiction
154988
155165
  );
154989
155166
  const tableOutput = tableFromCustomDomainListResponse([domainResponse]);
@@ -155072,7 +155249,7 @@ var r2BucketDomainAddCommand = createCommand({
155072
155249
  const accountId = await requireAuth(config);
155073
155250
  const {
155074
155251
  bucket,
155075
- domain: domain2,
155252
+ domain: domain3,
155076
155253
  zoneId,
155077
155254
  minTls = "1.0",
155078
155255
  jurisdiction,
@@ -155080,25 +155257,25 @@ var r2BucketDomainAddCommand = createCommand({
155080
155257
  } = args;
155081
155258
  if (!force) {
155082
155259
  const confirmedAdd = await confirm(
155083
- `Are you sure you want to add the custom domain '${domain2}' to bucket '${bucket}'? The contents of your bucket will be made publicly available at 'https://${domain2}'`
155260
+ `Are you sure you want to add the custom domain '${domain3}' to bucket '${bucket}'? The contents of your bucket will be made publicly available at 'https://${domain3}'`
155084
155261
  );
155085
155262
  if (!confirmedAdd) {
155086
155263
  logger.log("Add cancelled.");
155087
155264
  return;
155088
155265
  }
155089
155266
  }
155090
- logger.log(`Connecting custom domain '${domain2}' to bucket '${bucket}'...`);
155267
+ logger.log(`Connecting custom domain '${domain3}' to bucket '${bucket}'...`);
155091
155268
  await attachCustomDomainToBucket(
155092
155269
  accountId,
155093
155270
  bucket,
155094
155271
  {
155095
- domain: domain2,
155272
+ domain: domain3,
155096
155273
  zoneId,
155097
155274
  minTLS: minTls
155098
155275
  },
155099
155276
  jurisdiction
155100
155277
  );
155101
- logger.log(`\u2728 Custom domain '${domain2}' connected successfully.`);
155278
+ logger.log(`\u2728 Custom domain '${domain3}' connected successfully.`);
155102
155279
  }
155103
155280
  });
155104
155281
  var r2BucketDomainRemoveCommand = createCommand({
@@ -155134,19 +155311,19 @@ var r2BucketDomainRemoveCommand = createCommand({
155134
155311
  },
155135
155312
  async handler(args, { config }) {
155136
155313
  const accountId = await requireAuth(config);
155137
- const { bucket, domain: domain2, jurisdiction, force } = args;
155314
+ const { bucket, domain: domain3, jurisdiction, force } = args;
155138
155315
  if (!force) {
155139
155316
  const confirmedRemoval = await confirm(
155140
- `Are you sure you want to remove the custom domain '${domain2}' from bucket '${bucket}'? Your bucket will no longer be available from 'https://${domain2}'`
155317
+ `Are you sure you want to remove the custom domain '${domain3}' from bucket '${bucket}'? Your bucket will no longer be available from 'https://${domain3}'`
155141
155318
  );
155142
155319
  if (!confirmedRemoval) {
155143
155320
  logger.log("Removal cancelled.");
155144
155321
  return;
155145
155322
  }
155146
155323
  }
155147
- logger.log(`Removing custom domain '${domain2}' from bucket '${bucket}'...`);
155148
- await removeCustomDomainFromBucket(accountId, bucket, domain2, jurisdiction);
155149
- logger.log(`Custom domain '${domain2}' removed successfully.`);
155324
+ logger.log(`Removing custom domain '${domain3}' from bucket '${bucket}'...`);
155325
+ await removeCustomDomainFromBucket(accountId, bucket, domain3, jurisdiction);
155326
+ logger.log(`Custom domain '${domain3}' removed successfully.`);
155150
155327
  }
155151
155328
  });
155152
155329
  var r2BucketDomainUpdateCommand = createCommand({
@@ -155181,19 +155358,19 @@ var r2BucketDomainUpdateCommand = createCommand({
155181
155358
  },
155182
155359
  async handler(args, { config }) {
155183
155360
  const accountId = await requireAuth(config);
155184
- const { bucket, domain: domain2, minTls, jurisdiction } = args;
155185
- logger.log(`Updating custom domain '${domain2}' for bucket '${bucket}'...`);
155361
+ const { bucket, domain: domain3, minTls, jurisdiction } = args;
155362
+ logger.log(`Updating custom domain '${domain3}' for bucket '${bucket}'...`);
155186
155363
  await configureCustomDomainSettings(
155187
155364
  accountId,
155188
155365
  bucket,
155189
- domain2,
155366
+ domain3,
155190
155367
  {
155191
- domain: domain2,
155368
+ domain: domain3,
155192
155369
  minTLS: minTls
155193
155370
  },
155194
155371
  jurisdiction
155195
155372
  );
155196
- logger.log(`\u2728 Custom domain '${domain2}' updated successfully.`);
155373
+ logger.log(`\u2728 Custom domain '${domain3}' updated successfully.`);
155197
155374
  }
155198
155375
  });
155199
155376
 
@@ -163551,9 +163728,9 @@ var NODE_VERSION = parseSemver(process.versions.node);
163551
163728
 
163552
163729
  // ../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/async/domain.js
163553
163730
  init_import_meta_url();
163554
- var domain = __toESM(require("domain"));
163731
+ var domain2 = __toESM(require("domain"));
163555
163732
  function getActiveDomain() {
163556
- return domain.active;
163733
+ return domain2.active;
163557
163734
  }
163558
163735
  __name(getActiveDomain, "getActiveDomain");
163559
163736
  function getCurrentHub2() {
@@ -163576,7 +163753,7 @@ function runWithAsyncContext2(callback, options30) {
163576
163753
  if (activeDomain && _optionalChain([options30, "optionalAccess", (_4) => _4.reuseExisting])) {
163577
163754
  return callback();
163578
163755
  }
163579
- const local = domain.create();
163756
+ const local = domain2.create();
163580
163757
  const parentHub = activeDomain ? getHubFromCarrier(activeDomain) : void 0;
163581
163758
  const newHub = createNewHub(parentHub);
163582
163759
  setHubOnCarrier(local, newHub);
@@ -164427,7 +164604,7 @@ __name(_readSourceFile, "_readSourceFile");
164427
164604
 
164428
164605
  // ../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/integrations/context.js
164429
164606
  init_import_meta_url();
164430
- var import_child_process3 = require("child_process");
164607
+ var import_child_process4 = require("child_process");
164431
164608
  var import_fs22 = require("fs");
164432
164609
  var os11 = __toESM(require("os"));
164433
164610
  var import_path23 = require("path");
@@ -164633,7 +164810,7 @@ async function getDarwinInfo() {
164633
164810
  };
164634
164811
  try {
164635
164812
  const output = await new Promise((resolve24, reject) => {
164636
- (0, import_child_process3.execFile)("/usr/bin/sw_vers", (error2, stdout2) => {
164813
+ (0, import_child_process4.execFile)("/usr/bin/sw_vers", (error2, stdout2) => {
164637
164814
  if (error2) {
164638
164815
  reject(error2);
164639
164816
  return;
@@ -172088,3 +172265,4 @@ yargs-parser/build/lib/index.js:
172088
172265
  * SPDX-License-Identifier: ISC
172089
172266
  *)
172090
172267
  */
172268
+ //# sourceMappingURL=cli.js.map