wrangler 4.1.0 → 4.2.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.
@@ -15588,8 +15588,8 @@ var require_util6 = __commonJS({
15588
15588
  }
15589
15589
  }
15590
15590
  __name(validateCookiePath, "validateCookiePath");
15591
- function validateCookieDomain(domain3) {
15592
- if (domain3.startsWith("-") || domain3.endsWith(".") || domain3.endsWith("-")) {
15591
+ function validateCookieDomain(domain4) {
15592
+ if (domain4.startsWith("-") || domain4.endsWith(".") || domain4.endsWith("-")) {
15593
15593
  throw new Error("Invalid cookie domain");
15594
15594
  }
15595
15595
  }
@@ -29673,18 +29673,18 @@ var require_async = __commonJS({
29673
29673
  ];
29674
29674
  }, "defaultPaths");
29675
29675
  var defaultIsFile = /* @__PURE__ */ __name(function isFile(file, cb2) {
29676
- fs23.stat(file, function(err, stat8) {
29676
+ fs23.stat(file, function(err, stat9) {
29677
29677
  if (!err) {
29678
- return cb2(null, stat8.isFile() || stat8.isFIFO());
29678
+ return cb2(null, stat9.isFile() || stat9.isFIFO());
29679
29679
  }
29680
29680
  if (err.code === "ENOENT" || err.code === "ENOTDIR") return cb2(null, false);
29681
29681
  return cb2(err);
29682
29682
  });
29683
29683
  }, "isFile");
29684
29684
  var defaultIsDir = /* @__PURE__ */ __name(function isDirectory2(dir, cb2) {
29685
- fs23.stat(dir, function(err, stat8) {
29685
+ fs23.stat(dir, function(err, stat9) {
29686
29686
  if (!err) {
29687
- return cb2(null, stat8.isDirectory());
29687
+ return cb2(null, stat9.isDirectory());
29688
29688
  }
29689
29689
  if (err.code === "ENOENT" || err.code === "ENOTDIR") return cb2(null, false);
29690
29690
  return cb2(err);
@@ -30176,21 +30176,21 @@ var require_sync = __commonJS({
30176
30176
  }, "defaultPaths");
30177
30177
  var defaultIsFile = /* @__PURE__ */ __name(function isFile(file) {
30178
30178
  try {
30179
- var stat8 = fs23.statSync(file, { throwIfNoEntry: false });
30179
+ var stat9 = fs23.statSync(file, { throwIfNoEntry: false });
30180
30180
  } catch (e7) {
30181
30181
  if (e7 && (e7.code === "ENOENT" || e7.code === "ENOTDIR")) return false;
30182
30182
  throw e7;
30183
30183
  }
30184
- return !!stat8 && (stat8.isFile() || stat8.isFIFO());
30184
+ return !!stat9 && (stat9.isFile() || stat9.isFIFO());
30185
30185
  }, "isFile");
30186
30186
  var defaultIsDir = /* @__PURE__ */ __name(function isDirectory2(dir) {
30187
30187
  try {
30188
- var stat8 = fs23.statSync(dir, { throwIfNoEntry: false });
30188
+ var stat9 = fs23.statSync(dir, { throwIfNoEntry: false });
30189
30189
  } catch (e7) {
30190
30190
  if (e7 && (e7.code === "ENOENT" || e7.code === "ENOTDIR")) return false;
30191
30191
  throw e7;
30192
30192
  }
30193
- return !!stat8 && stat8.isDirectory();
30193
+ return !!stat9 && stat9.isDirectory();
30194
30194
  }, "isDirectory");
30195
30195
  var defaultRealpathSync = /* @__PURE__ */ __name(function realpathSync4(x6) {
30196
30196
  try {
@@ -53578,16 +53578,16 @@ var require_windows = __commonJS({
53578
53578
  return false;
53579
53579
  }
53580
53580
  __name(checkPathExt, "checkPathExt");
53581
- function checkStat(stat8, path69, options32) {
53582
- if (!stat8.isSymbolicLink() && !stat8.isFile()) {
53581
+ function checkStat(stat9, path69, options32) {
53582
+ if (!stat9.isSymbolicLink() && !stat9.isFile()) {
53583
53583
  return false;
53584
53584
  }
53585
53585
  return checkPathExt(path69, options32);
53586
53586
  }
53587
53587
  __name(checkStat, "checkStat");
53588
53588
  function isexe(path69, options32, cb2) {
53589
- fs23.stat(path69, function(er, stat8) {
53590
- cb2(er, er ? false : checkStat(stat8, path69, options32));
53589
+ fs23.stat(path69, function(er, stat9) {
53590
+ cb2(er, er ? false : checkStat(stat9, path69, options32));
53591
53591
  });
53592
53592
  }
53593
53593
  __name(isexe, "isexe");
@@ -53606,8 +53606,8 @@ var require_mode = __commonJS({
53606
53606
  isexe.sync = sync;
53607
53607
  var fs23 = require("fs");
53608
53608
  function isexe(path69, options32, cb2) {
53609
- fs23.stat(path69, function(er, stat8) {
53610
- cb2(er, er ? false : checkStat(stat8, options32));
53609
+ fs23.stat(path69, function(er, stat9) {
53610
+ cb2(er, er ? false : checkStat(stat9, options32));
53611
53611
  });
53612
53612
  }
53613
53613
  __name(isexe, "isexe");
@@ -53615,14 +53615,14 @@ var require_mode = __commonJS({
53615
53615
  return checkStat(fs23.statSync(path69), options32);
53616
53616
  }
53617
53617
  __name(sync, "sync");
53618
- function checkStat(stat8, options32) {
53619
- return stat8.isFile() && checkMode(stat8, options32);
53618
+ function checkStat(stat9, options32) {
53619
+ return stat9.isFile() && checkMode(stat9, options32);
53620
53620
  }
53621
53621
  __name(checkStat, "checkStat");
53622
- function checkMode(stat8, options32) {
53623
- var mod = stat8.mode;
53624
- var uid = stat8.uid;
53625
- var gid = stat8.gid;
53622
+ function checkMode(stat9, options32) {
53623
+ var mod = stat9.mode;
53624
+ var uid = stat9.uid;
53625
+ var gid = stat9.gid;
53626
53626
  var myUid = options32.uid !== void 0 ? options32.uid : process.getuid && process.getuid();
53627
53627
  var myGid = options32.gid !== void 0 ? options32.gid : process.getgid && process.getgid();
53628
53628
  var u5 = parseInt("100", 8);
@@ -56650,12 +56650,12 @@ function defaultOptions() {
56650
56650
  highWaterMark: 4096
56651
56651
  };
56652
56652
  }
56653
- var import_fs10, import_promises23, import_stream3, import_path14, RECURSIVE_ERROR_CODE, NORMAL_FLOW_ERRORS, FILE_TYPE, DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE, ALL_TYPES, DIR_TYPES, FILE_TYPES, isNormalFlowError, wantBigintFsStats, emptyFn, normalizeFilter, ReaddirpStream, readdirp;
56653
+ var import_fs10, import_promises24, import_stream3, import_path14, RECURSIVE_ERROR_CODE, NORMAL_FLOW_ERRORS, FILE_TYPE, DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE, ALL_TYPES, DIR_TYPES, FILE_TYPES, isNormalFlowError, wantBigintFsStats, emptyFn, normalizeFilter, ReaddirpStream, readdirp;
56654
56654
  var init_esm = __esm({
56655
56655
  "../../node_modules/.pnpm/readdirp@4.0.1/node_modules/readdirp/esm/index.js"() {
56656
56656
  init_import_meta_url();
56657
56657
  import_fs10 = require("fs");
56658
- import_promises23 = require("fs/promises");
56658
+ import_promises24 = require("fs/promises");
56659
56659
  import_stream3 = require("stream");
56660
56660
  import_path14 = require("path");
56661
56661
  __name(defaultOptions, "defaultOptions");
@@ -56772,7 +56772,7 @@ var init_esm = __esm({
56772
56772
  async _exploreDir(path69, depth) {
56773
56773
  let files;
56774
56774
  try {
56775
- files = await (0, import_promises23.readdir)(path69, this._rdOptions);
56775
+ files = await (0, import_promises24.readdir)(path69, this._rdOptions);
56776
56776
  } catch (error2) {
56777
56777
  this._onError(error2);
56778
56778
  }
@@ -56810,7 +56810,7 @@ var init_esm = __esm({
56810
56810
  if (stats && stats.isSymbolicLink()) {
56811
56811
  const full = entry.fullPath;
56812
56812
  try {
56813
- const entryRealPath = await (0, import_promises23.realpath)(full);
56813
+ const entryRealPath = await (0, import_promises24.realpath)(full);
56814
56814
  const entryRealPathStats = (0, import_fs10.lstatSync)(entryRealPath);
56815
56815
  if (entryRealPathStats.isFile()) {
56816
56816
  return "file";
@@ -56872,12 +56872,12 @@ function createFsWatchInstance(path69, options32, listener, errHandler, emitRaw)
56872
56872
  return void 0;
56873
56873
  }
56874
56874
  }
56875
- var import_fs11, import_promises24, sysPath, import_os4, STR_DATA, STR_END, STR_CLOSE, EMPTY_FN, pl, isWindows2, isMacos, isLinux, isIBMi, EVENTS, EV, THROTTLE_MODE_WATCH, statMethods, KEY_LISTENERS, KEY_ERR, KEY_RAW, HANDLER_KEYS, binaryExtensions, isBinaryPath, foreach, addAndConvert, clearItem, delFromSet, isEmptySet, FsWatchInstances, fsWatchBroadcast, setFsWatchListener, FsWatchFileInstances, setFsWatchFileListener, NodeFsHandler;
56875
+ var import_fs11, import_promises25, sysPath, import_os4, STR_DATA, STR_END, STR_CLOSE, EMPTY_FN, pl, isWindows2, isMacos, isLinux, isIBMi, EVENTS, EV, THROTTLE_MODE_WATCH, statMethods, KEY_LISTENERS, KEY_ERR, KEY_RAW, HANDLER_KEYS, binaryExtensions, isBinaryPath, foreach, addAndConvert, clearItem, delFromSet, isEmptySet, FsWatchInstances, fsWatchBroadcast, setFsWatchListener, FsWatchFileInstances, setFsWatchFileListener, NodeFsHandler;
56876
56876
  var init_handler = __esm({
56877
56877
  "../../node_modules/.pnpm/chokidar@4.0.1/node_modules/chokidar/esm/handler.js"() {
56878
56878
  init_import_meta_url();
56879
56879
  import_fs11 = require("fs");
56880
- import_promises24 = require("fs/promises");
56880
+ import_promises25 = require("fs/promises");
56881
56881
  sysPath = __toESM(require("path"), 1);
56882
56882
  import_os4 = require("os");
56883
56883
  STR_DATA = "data";
@@ -56903,7 +56903,7 @@ var init_handler = __esm({
56903
56903
  };
56904
56904
  EV = EVENTS;
56905
56905
  THROTTLE_MODE_WATCH = "watch";
56906
- statMethods = { lstat: import_promises24.lstat, stat: import_promises24.stat };
56906
+ statMethods = { lstat: import_promises25.lstat, stat: import_promises25.stat };
56907
56907
  KEY_LISTENERS = "listeners";
56908
56908
  KEY_ERR = "errHandlers";
56909
56909
  KEY_RAW = "rawEmitters";
@@ -57244,7 +57244,7 @@ var init_handler = __esm({
57244
57244
  cont.watcherUnusable = true;
57245
57245
  if (isWindows2 && error2.code === "EPERM") {
57246
57246
  try {
57247
- const fd = await (0, import_promises24.open)(path69, "r");
57247
+ const fd = await (0, import_promises25.open)(path69, "r");
57248
57248
  await fd.close();
57249
57249
  broadcastErr(error2);
57250
57250
  } catch (err) {
@@ -57376,7 +57376,7 @@ var init_handler = __esm({
57376
57376
  return;
57377
57377
  if (!newStats || newStats.mtimeMs === 0) {
57378
57378
  try {
57379
- const newStats2 = await (0, import_promises24.stat)(file);
57379
+ const newStats2 = await (0, import_promises25.stat)(file);
57380
57380
  if (this.fsw.closed)
57381
57381
  return;
57382
57382
  const at2 = newStats2.atimeMs;
@@ -57431,7 +57431,7 @@ var init_handler = __esm({
57431
57431
  this.fsw._incrReadyCount();
57432
57432
  let linkPath;
57433
57433
  try {
57434
- linkPath = await (0, import_promises24.realpath)(path69);
57434
+ linkPath = await (0, import_promises25.realpath)(path69);
57435
57435
  } catch (e7) {
57436
57436
  this.fsw._emitReady();
57437
57437
  return true;
@@ -57579,7 +57579,7 @@ var init_handler = __esm({
57579
57579
  let closer;
57580
57580
  if (stats.isDirectory()) {
57581
57581
  const absPath = sysPath.resolve(path69);
57582
- const targetPath = follow ? await (0, import_promises24.realpath)(path69) : path69;
57582
+ const targetPath = follow ? await (0, import_promises25.realpath)(path69) : path69;
57583
57583
  if (this.fsw.closed)
57584
57584
  return;
57585
57585
  closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
@@ -57589,7 +57589,7 @@ var init_handler = __esm({
57589
57589
  this.fsw._symlinkPaths.set(absPath, targetPath);
57590
57590
  }
57591
57591
  } else if (stats.isSymbolicLink()) {
57592
- const targetPath = follow ? await (0, import_promises24.realpath)(path69) : path69;
57592
+ const targetPath = follow ? await (0, import_promises25.realpath)(path69) : path69;
57593
57593
  if (this.fsw.closed)
57594
57594
  return;
57595
57595
  const parent = sysPath.dirname(wh.watchPath);
@@ -57689,12 +57689,12 @@ function watch(paths, options32 = {}) {
57689
57689
  watcher.add(paths);
57690
57690
  return watcher;
57691
57691
  }
57692
- var import_fs12, import_promises25, import_events4, sysPath2, SLASH, SLASH_SLASH, ONE_DOT, TWO_DOTS, STRING_TYPE, BACK_SLASH_RE, DOUBLE_SLASH_RE, DOT_RE, REPLACER_RE, isMatcherObject, unifyPaths, toUnix, normalizePathToUnix, normalizeIgnored, getAbsolutePath, EMPTY_SET, DirEntry, STAT_METHOD_F, STAT_METHOD_L, WatchHelper, FSWatcher;
57692
+ var import_fs12, import_promises26, import_events4, sysPath2, SLASH, SLASH_SLASH, ONE_DOT, TWO_DOTS, STRING_TYPE, BACK_SLASH_RE, DOUBLE_SLASH_RE, DOT_RE, REPLACER_RE, isMatcherObject, unifyPaths, toUnix, normalizePathToUnix, normalizeIgnored, getAbsolutePath, EMPTY_SET, DirEntry, STAT_METHOD_F, STAT_METHOD_L, WatchHelper, FSWatcher;
57693
57693
  var init_esm2 = __esm({
57694
57694
  "../../node_modules/.pnpm/chokidar@4.0.1/node_modules/chokidar/esm/index.js"() {
57695
57695
  init_import_meta_url();
57696
57696
  import_fs12 = require("fs");
57697
- import_promises25 = require("fs/promises");
57697
+ import_promises26 = require("fs/promises");
57698
57698
  import_events4 = require("events");
57699
57699
  sysPath2 = __toESM(require("path"), 1);
57700
57700
  init_esm();
@@ -57775,7 +57775,7 @@ var init_esm2 = __esm({
57775
57775
  return;
57776
57776
  const dir = this.path;
57777
57777
  try {
57778
- await (0, import_promises25.readdir)(dir);
57778
+ await (0, import_promises26.readdir)(dir);
57779
57779
  } catch (err) {
57780
57780
  if (this._removeWatcher) {
57781
57781
  this._removeWatcher(sysPath2.dirname(dir), sysPath2.basename(dir));
@@ -58106,7 +58106,7 @@ var init_esm2 = __esm({
58106
58106
  const fullPath = opts.cwd ? sysPath2.join(opts.cwd, path69) : path69;
58107
58107
  let stats2;
58108
58108
  try {
58109
- stats2 = await (0, import_promises25.stat)(fullPath);
58109
+ stats2 = await (0, import_promises26.stat)(fullPath);
58110
58110
  } catch (err) {
58111
58111
  }
58112
58112
  if (!stats2 || this.closed)
@@ -58234,8 +58234,8 @@ var init_esm2 = __esm({
58234
58234
  }
58235
58235
  return this._userIgnored(path69, stats);
58236
58236
  }
58237
- _isntIgnored(path69, stat8) {
58238
- return !this._isIgnored(path69, stat8);
58237
+ _isntIgnored(path69, stat9) {
58238
+ return !this._isIgnored(path69, stat9);
58239
58239
  }
58240
58240
  /**
58241
58241
  * Provides a set of common helpers and properties relating to symlink handling.
@@ -69377,14 +69377,14 @@ var init_retry_wrapper = __esm({
69377
69377
  });
69378
69378
 
69379
69379
  // ../../node_modules/.pnpm/@aws-sdk+credential-provider-http@3.716.0/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/fromHttp.js
69380
- var import_promises27, AWS_CONTAINER_CREDENTIALS_RELATIVE_URI, DEFAULT_LINK_LOCAL_HOST, AWS_CONTAINER_CREDENTIALS_FULL_URI, AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE, AWS_CONTAINER_AUTHORIZATION_TOKEN, fromHttp;
69380
+ var import_promises28, AWS_CONTAINER_CREDENTIALS_RELATIVE_URI, DEFAULT_LINK_LOCAL_HOST, AWS_CONTAINER_CREDENTIALS_FULL_URI, AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE, AWS_CONTAINER_AUTHORIZATION_TOKEN, fromHttp;
69381
69381
  var init_fromHttp = __esm({
69382
69382
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-http@3.716.0/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/fromHttp.js"() {
69383
69383
  init_import_meta_url();
69384
69384
  init_client2();
69385
69385
  init_dist_es11();
69386
69386
  init_dist_es16();
69387
- import_promises27 = __toESM(require("fs/promises"));
69387
+ import_promises28 = __toESM(require("fs/promises"));
69388
69388
  init_checkUrl();
69389
69389
  init_requestHelpers();
69390
69390
  init_retry_wrapper();
@@ -69428,7 +69428,7 @@ Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI
69428
69428
  if (token) {
69429
69429
  request4.headers.Authorization = token;
69430
69430
  } else if (tokenFile) {
69431
- request4.headers.Authorization = (await import_promises27.default.readFile(tokenFile)).toString();
69431
+ request4.headers.Authorization = (await import_promises28.default.readFile(tokenFile)).toString();
69432
69432
  }
69433
69433
  try {
69434
69434
  const result = await requestHandler.handle(request4);
@@ -81177,7 +81177,7 @@ var import_undici3 = __toESM(require_undici());
81177
81177
 
81178
81178
  // package.json
81179
81179
  var name = "wrangler";
81180
- var version = "4.1.0";
81180
+ var version = "4.2.0";
81181
81181
 
81182
81182
  // src/environment-variables/misc-variables.ts
81183
81183
  init_import_meta_url();
@@ -83598,7 +83598,7 @@ function checkType(type) {
83598
83598
  throw new Error(`Invalid type specified: ${type}`);
83599
83599
  }
83600
83600
  __name(checkType, "checkType");
83601
- var matchType = /* @__PURE__ */ __name((type, stat8) => type === void 0 || stat8[typeMappings[type]](), "matchType");
83601
+ var matchType = /* @__PURE__ */ __name((type, stat9) => type === void 0 || stat9[typeMappings[type]](), "matchType");
83602
83602
  var toPath = /* @__PURE__ */ __name((urlOrPath) => urlOrPath instanceof URL ? (0, import_node_url.fileURLToPath)(urlOrPath) : urlOrPath, "toPath");
83603
83603
  function locatePathSync(paths, {
83604
83604
  cwd: cwd2 = import_node_process2.default.cwd(),
@@ -83610,8 +83610,8 @@ function locatePathSync(paths, {
83610
83610
  const statFunction = allowSymlinks ? import_node_fs3.default.statSync : import_node_fs3.default.lstatSync;
83611
83611
  for (const path_ of paths) {
83612
83612
  try {
83613
- const stat8 = statFunction(import_node_path6.default.resolve(cwd2, path_));
83614
- if (matchType(type, stat8)) {
83613
+ const stat9 = statFunction(import_node_path6.default.resolve(cwd2, path_));
83614
+ if (matchType(type, stat9)) {
83615
83615
  return path_;
83616
83616
  }
83617
83617
  } catch {
@@ -85513,7 +85513,7 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
85513
85513
  envName,
85514
85514
  "containers",
85515
85515
  validateContainerAppConfig,
85516
- { app: [] }
85516
+ void 0
85517
85517
  ),
85518
85518
  send_email: notInheritable(
85519
85519
  diagnostics,
@@ -86335,52 +86335,45 @@ Please add a binding for "${configBindingName}" to "env.${envName}.${field}.bind
86335
86335
  }, "validateBindingArray");
86336
86336
  var validateContainerAppConfig = /* @__PURE__ */ __name((diagnostics, _field, value) => {
86337
86337
  if (!value) {
86338
- diagnostics.errors.push(
86339
- `"containers" should be an object, but got a falsy value`
86340
- );
86341
- return false;
86338
+ return true;
86342
86339
  }
86343
86340
  if (typeof value !== "object") {
86344
86341
  diagnostics.errors.push(
86345
- `"containers" should be an object, but got ${typeof value}`
86346
- );
86347
- return false;
86348
- }
86349
- if (Array.isArray(value)) {
86350
- diagnostics.errors.push(
86351
- `"containers" should be an object, but got an array`
86342
+ `"containers" should be an object, but got ${JSON.stringify(value)}`
86352
86343
  );
86353
86344
  return false;
86354
86345
  }
86355
- if (!("app" in value)) {
86356
- return true;
86357
- }
86358
- value = value.app;
86359
86346
  if (!Array.isArray(value)) {
86360
86347
  diagnostics.errors.push(
86361
- `"containers.app" should be an array, but got ${JSON.stringify(value)}`
86348
+ `"containers" should be an array, but got ${JSON.stringify(value)}`
86362
86349
  );
86363
86350
  return false;
86364
86351
  }
86365
86352
  for (const containerApp of value) {
86366
86353
  const containerAppOptional = containerApp;
86367
- if (!isRequiredProperty(containerAppOptional, "instances", "number")) {
86368
- diagnostics.errors.push(
86369
- `"containers.app.instances" should be defined and an integer`
86370
- );
86371
- }
86372
86354
  if (!isRequiredProperty(containerAppOptional, "name", "string")) {
86373
86355
  diagnostics.errors.push(
86374
- `"containers.app.name" should be defined and a string`
86356
+ `"containers.name" should be defined and a string`
86375
86357
  );
86376
86358
  }
86359
+ if ("image" in containerAppOptional && containerAppOptional.image !== void 0) {
86360
+ if (containerAppOptional.configuration?.image !== void 0) {
86361
+ diagnostics.errors.push(
86362
+ `"containers.image" and "containers.configuration.image" can't be defined at the same time`
86363
+ );
86364
+ return false;
86365
+ }
86366
+ containerAppOptional.configuration ??= {
86367
+ image: containerAppOptional.image
86368
+ };
86369
+ containerAppOptional.configuration.image = containerAppOptional.image;
86370
+ delete containerAppOptional["image"];
86371
+ }
86377
86372
  if (!("configuration" in containerAppOptional)) {
86378
- diagnostics.errors.push(
86379
- `"containers.app.configuration" should be defined`
86380
- );
86373
+ diagnostics.errors.push(`"containers.configuration" should be defined`);
86381
86374
  } else if (Array.isArray(containerAppOptional.configuration)) {
86382
86375
  diagnostics.errors.push(
86383
- `"containers.app.configuration" is defined as an array, it should be an object`
86376
+ `"containers.configuration" is defined as an array, it should be an object`
86384
86377
  );
86385
86378
  } else if (!isRequiredProperty(
86386
86379
  containerAppOptional.configuration,
@@ -86388,7 +86381,7 @@ var validateContainerAppConfig = /* @__PURE__ */ __name((diagnostics, _field, va
86388
86381
  "string"
86389
86382
  )) {
86390
86383
  diagnostics.errors.push(
86391
- `"containers.app.configuration.image" should be defined and a string`
86384
+ `"containers.image" should be defined and a string`
86392
86385
  );
86393
86386
  }
86394
86387
  }
@@ -87399,7 +87392,7 @@ var defaultWranglerConfig = {
87399
87392
  /** NON-INHERITABLE ENVIRONMENT FIELDS **/
87400
87393
  define: {},
87401
87394
  cloudchamber: {},
87402
- containers: { app: [] },
87395
+ containers: void 0,
87403
87396
  send_email: [],
87404
87397
  browser: void 0,
87405
87398
  unsafe: {},
@@ -89825,45 +89818,45 @@ var import_child_process = require("child_process");
89825
89818
  var import_undici = __toESM(require_undici());
89826
89819
  var cache = {};
89827
89820
  var usesAccessCache = /* @__PURE__ */ new Map();
89828
- async function domainUsesAccess(domain3) {
89829
- logger.debug("Checking if domain has Access enabled:", domain3);
89830
- if (usesAccessCache.has(domain3)) {
89821
+ async function domainUsesAccess(domain4) {
89822
+ logger.debug("Checking if domain has Access enabled:", domain4);
89823
+ if (usesAccessCache.has(domain4)) {
89831
89824
  logger.debug(
89832
89825
  "Using cached Access switch for:",
89833
- domain3,
89834
- usesAccessCache.get(domain3)
89826
+ domain4,
89827
+ usesAccessCache.get(domain4)
89835
89828
  );
89836
- return usesAccessCache.get(domain3);
89829
+ return usesAccessCache.get(domain4);
89837
89830
  }
89838
- logger.debug("Access switch not cached for:", domain3);
89831
+ logger.debug("Access switch not cached for:", domain4);
89839
89832
  try {
89840
89833
  const controller = new AbortController();
89841
89834
  const cancel3 = setTimeout(() => {
89842
89835
  controller.abort();
89843
89836
  }, 1e3);
89844
- const output = await (0, import_undici.fetch)(`https://${domain3}`, {
89837
+ const output = await (0, import_undici.fetch)(`https://${domain4}`, {
89845
89838
  redirect: "manual",
89846
89839
  signal: controller.signal
89847
89840
  });
89848
89841
  clearTimeout(cancel3);
89849
89842
  const usesAccess = !!(output.status === 302 && output.headers.get("location")?.includes("cloudflareaccess.com"));
89850
- logger.debug("Caching access switch for:", domain3);
89851
- usesAccessCache.set(domain3, usesAccess);
89843
+ logger.debug("Caching access switch for:", domain4);
89844
+ usesAccessCache.set(domain4, usesAccess);
89852
89845
  return usesAccess;
89853
89846
  } catch (e7) {
89854
- usesAccessCache.set(domain3, false);
89847
+ usesAccessCache.set(domain4, false);
89855
89848
  return false;
89856
89849
  }
89857
89850
  }
89858
89851
  __name(domainUsesAccess, "domainUsesAccess");
89859
- async function getAccessToken(domain3) {
89860
- if (!await domainUsesAccess(domain3)) {
89852
+ async function getAccessToken(domain4) {
89853
+ if (!await domainUsesAccess(domain4)) {
89861
89854
  return void 0;
89862
89855
  }
89863
- if (cache[domain3]) {
89864
- return cache[domain3];
89856
+ if (cache[domain4]) {
89857
+ return cache[domain4];
89865
89858
  }
89866
- const output = (0, import_child_process.spawnSync)("cloudflared", ["access", "login", domain3]);
89859
+ const output = (0, import_child_process.spawnSync)("cloudflared", ["access", "login", domain4]);
89867
89860
  if (output.error) {
89868
89861
  throw new UserError(
89869
89862
  "To use Wrangler with Cloudflare Access, please install `cloudflared` from https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/installation"
@@ -89872,7 +89865,7 @@ async function getAccessToken(domain3) {
89872
89865
  const stringOutput = output.stdout.toString();
89873
89866
  const matches = stringOutput.match(/fetched your token:\n\n(.*)/m);
89874
89867
  if (matches && matches.length >= 2) {
89875
- cache[domain3] = matches[1];
89868
+ cache[domain4] = matches[1];
89876
89869
  return matches[1];
89877
89870
  }
89878
89871
  throw new Error("Failed to authenticate with Cloudflare Access");
@@ -94742,7 +94735,7 @@ var NoOpProxyController = class extends ProxyController {
94742
94735
  init_import_meta_url();
94743
94736
  var import_node_assert24 = __toESM(require("node:assert"));
94744
94737
  var import_node_fs31 = require("node:fs");
94745
- var import_promises36 = require("node:fs/promises");
94738
+ var import_promises37 = require("node:fs/promises");
94746
94739
  var path62 = __toESM(require("node:path"));
94747
94740
 
94748
94741
  // ../workers-shared/index.ts
@@ -104079,6 +104072,7 @@ function createWorkerUploadForm(worker) {
104079
104072
  const metadata = {
104080
104073
  ...main2.type !== "commonjs" ? { main_module: main2.name } : { body_part: main2.name },
104081
104074
  bindings: metadataBindings,
104075
+ containers: worker.containers === void 0 ? void 0 : worker.containers.map((c6) => ({ class_name: c6.class_name })),
104082
104076
  ...compatibility_date && { compatibility_date },
104083
104077
  ...compatibility_flags && {
104084
104078
  compatibility_flags
@@ -105164,22 +105158,22 @@ __name(triggersDeploy, "triggersDeploy");
105164
105158
 
105165
105159
  // src/utils/friendly-validator-errors.ts
105166
105160
  init_import_meta_url();
105167
- var import_promises35 = require("node:fs/promises");
105161
+ var import_promises36 = require("node:fs/promises");
105168
105162
  var import_node_path58 = __toESM(require("node:path"));
105169
105163
 
105170
105164
  // src/check/commands.ts
105171
105165
  init_import_meta_url();
105172
105166
  var import_crypto6 = require("crypto");
105173
- var import_promises33 = require("fs/promises");
105167
+ var import_promises34 = require("fs/promises");
105174
105168
  var import_node_events4 = __toESM(require("node:events"));
105175
- var import_promises34 = require("node:fs/promises");
105169
+ var import_promises35 = require("node:fs/promises");
105176
105170
  var import_path23 = __toESM(require("path"));
105177
105171
  var import_miniflare22 = require("miniflare");
105178
105172
 
105179
105173
  // src/index.ts
105180
105174
  init_import_meta_url();
105181
105175
  var import_node_os7 = __toESM(require("node:os"));
105182
- var import_promises32 = require("node:timers/promises");
105176
+ var import_promises33 = require("node:timers/promises");
105183
105177
  var import_undici20 = __toESM(require_undici());
105184
105178
 
105185
105179
  // ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/index.mjs
@@ -110166,12 +110160,12 @@ var ImageRegistriesService = class {
110166
110160
  * @returns AccountRegistryToken Credentials with 'pull' or 'push' permissions to access the registry
110167
110161
  * @throws ApiError
110168
110162
  */
110169
- static generateImageRegistryCredentials(domain3, requestBody) {
110163
+ static generateImageRegistryCredentials(domain4, requestBody) {
110170
110164
  return request(OpenAPI, {
110171
110165
  method: "POST",
110172
110166
  url: "/registries/{domain}/credentials",
110173
110167
  path: {
110174
- domain: domain3
110168
+ domain: domain4
110175
110169
  },
110176
110170
  body: requestBody,
110177
110171
  mediaType: "application/json",
@@ -110190,12 +110184,12 @@ var ImageRegistriesService = class {
110190
110184
  * @returns EmptyResponse The image registry is deleted
110191
110185
  * @throws ApiError
110192
110186
  */
110193
- static deleteImageRegistry(domain3) {
110187
+ static deleteImageRegistry(domain4) {
110194
110188
  return request(OpenAPI, {
110195
110189
  method: "DELETE",
110196
110190
  url: "/registries/{domain}",
110197
110191
  path: {
110198
- domain: domain3
110192
+ domain: domain4
110199
110193
  },
110200
110194
  errors: {
110201
110195
  404: `The image registry does not exist`,
@@ -110438,8 +110432,8 @@ var imageRe = (() => {
110438
110432
  const alphaNumeric = "[a-z0-9]+";
110439
110433
  const separator = "(?:\\.|_|__|-+)";
110440
110434
  const port = ":[0-9]+";
110441
- const domain3 = `${alphaNumeric}(?:${separator}${alphaNumeric})*`;
110442
- const name2 = `(?:${domain3}(?:${port})?/)?(?:${domain3}/)*(?:${domain3})`;
110435
+ const domain4 = `${alphaNumeric}(?:${separator}${alphaNumeric})*`;
110436
+ const name2 = `(?:${domain4}(?:${port})?/)?(?:${domain4}/)*(?:${domain4})`;
110443
110437
  const tag = ":([a-zA-Z0-9_][a-zA-Z0-9._-]{0,127})";
110444
110438
  const digest = "@(sha256:[A-Fa-f0-9]+)";
110445
110439
  const reference = `(?:${tag}(?:${digest})?|${digest})`;
@@ -111081,7 +111075,7 @@ function applicationToCreateApplication(application) {
111081
111075
  __name(applicationToCreateApplication, "applicationToCreateApplication");
111082
111076
  function containerAppToCreateApplication(containerApp, skipDefaults = false) {
111083
111077
  const configuration = containerApp.configuration;
111084
- return {
111078
+ const app = {
111085
111079
  ...containerApp,
111086
111080
  configuration,
111087
111081
  scheduling_policy: containerApp.scheduling_policy ?? "regional" /* REGIONAL */,
@@ -111095,6 +111089,9 @@ function containerAppToCreateApplication(containerApp, skipDefaults = false) {
111095
111089
  )
111096
111090
  }
111097
111091
  };
111092
+ delete app["class_name"];
111093
+ delete app["image"];
111094
+ return app;
111098
111095
  }
111099
111096
  __name(containerAppToCreateApplication, "containerAppToCreateApplication");
111100
111097
  function isNumber(c6) {
@@ -111233,21 +111230,20 @@ async function applyCommand(args, config) {
111233
111230
  "Deploy a container application",
111234
111231
  "deploy changes to your application"
111235
111232
  );
111236
- if (config.containers.app.length === 0) {
111233
+ config.containers ??= [];
111234
+ if (config.containers.length === 0) {
111237
111235
  endSection(
111238
111236
  "You don't have any container applications defined in your wrangler.toml",
111239
111237
  "You can set the following configuration in your wrangler.toml"
111240
111238
  );
111241
111239
  const configuration = {
111242
- configuration: {
111243
- image: "docker.io/cloudflare/hello-world:1.0"
111244
- },
111240
+ image: "docker.io/cloudflare/hello-world:1.0",
111245
111241
  instances: 2,
111246
111242
  name: config.name ?? "my-containers-application"
111247
111243
  };
111248
111244
  const endConfig = args.env !== void 0 ? {
111249
- env: { [args.env]: { containers: { app: [configuration] } } }
111250
- } : { containers: { app: [configuration] } };
111245
+ env: { [args.env]: { containers: [configuration] } }
111246
+ } : { containers: [configuration] };
111251
111247
  formatConfigSnippet(endConfig, config.configPath).split("\n").forEach((el) => {
111252
111248
  printLine(el, " ", logRaw);
111253
111249
  });
@@ -111263,7 +111259,7 @@ async function applyCommand(args, config) {
111263
111259
  }
111264
111260
  const actions = [];
111265
111261
  log(dim("Container application changes\n"));
111266
- for (const appConfigNoDefaults of config.containers.app) {
111262
+ for (const appConfigNoDefaults of config.containers) {
111267
111263
  const appConfig = containerAppToCreateApplication(
111268
111264
  appConfigNoDefaults,
111269
111265
  args.skipDefaults
@@ -111274,18 +111270,16 @@ async function applyCommand(args, config) {
111274
111270
  stripUndefined(applicationToCreateApplication(application))
111275
111271
  );
111276
111272
  const prev = formatConfigSnippet(
111277
- { containers: { app: [prevApp] } },
111273
+ { containers: [prevApp] },
111278
111274
  config.configPath
111279
111275
  );
111280
111276
  const now = formatConfigSnippet(
111281
111277
  {
111282
- containers: {
111283
- app: [
111284
- sortObjectRecursive(
111285
- appConfig
111286
- )
111287
- ]
111288
- }
111278
+ containers: [
111279
+ sortObjectRecursive(
111280
+ appConfig
111281
+ )
111282
+ ]
111289
111283
  },
111290
111284
  config.configPath
111291
111285
  );
@@ -111365,15 +111359,16 @@ async function applyCommand(args, config) {
111365
111359
  }
111366
111360
  updateStatus(bold.underline(green.underline("NEW")) + ` ${appConfig.name}`);
111367
111361
  const s5 = formatConfigSnippet(
111368
- { containers: { app: [appConfig] } },
111362
+ { containers: [appConfig] },
111369
111363
  config.configPath
111370
111364
  );
111371
111365
  s5.split("\n").map((line) => line.trim()).forEach((el) => {
111372
111366
  printLine(el, " ");
111373
111367
  });
111368
+ const configToPush = { ...appConfig };
111374
111369
  actions.push({
111375
111370
  action: "create",
111376
- application: appConfig
111371
+ application: configToPush
111377
111372
  });
111378
111373
  }
111379
111374
  if (actions.length == 0) {
@@ -111474,6 +111469,7 @@ __name(applyCommand, "applyCommand");
111474
111469
  // src/cloudchamber/build.ts
111475
111470
  init_import_meta_url();
111476
111471
  var import_child_process2 = require("child_process");
111472
+ var import_promises10 = require("fs/promises");
111477
111473
  var domain = "registry.cloudchamber.cfdata.org";
111478
111474
  async function dockerLoginManagedRegistry(options32) {
111479
111475
  const dockerPath = options32.pathToDocker ?? "docker";
@@ -111517,17 +111513,18 @@ async function constructBuildCommand(options32) {
111517
111513
  return defaultBuildCommand;
111518
111514
  }
111519
111515
  __name(constructBuildCommand, "constructBuildCommand");
111520
- async function dockerBuild(options32) {
111521
- const buildCmd = options32.buildCmd.split(" ").slice(1);
111522
- const buildExec = options32.buildCmd.split(" ").shift();
111523
- const child = (0, import_child_process2.spawn)(String(buildExec), buildCmd, { stdio: "inherit" }).on(
111524
- "error",
111525
- (err) => {
111526
- throw err;
111527
- }
111528
- );
111529
- await new Promise((resolve24) => {
111530
- child.on("close", resolve24);
111516
+ function dockerBuild(options32) {
111517
+ return new Promise((resolve24, reject) => {
111518
+ const buildCmd = options32.buildCmd.split(" ").slice(1);
111519
+ const buildExec = options32.buildCmd.split(" ").shift();
111520
+ const child = (0, import_child_process2.spawn)(String(buildExec), buildCmd, { stdio: "inherit" });
111521
+ child.on("exit", (code) => {
111522
+ if (code === 0) {
111523
+ resolve24();
111524
+ } else {
111525
+ reject(new Error(`Build exited with code: ${code}`));
111526
+ }
111527
+ });
111531
111528
  });
111532
111529
  }
111533
111530
  __name(dockerBuild, "dockerBuild");
@@ -111597,13 +111594,28 @@ function pushYargs(yargs) {
111597
111594
  }).positional("TAG", { type: "string", demandOption: true });
111598
111595
  }
111599
111596
  __name(pushYargs, "pushYargs");
111597
+ async function isDir(path69) {
111598
+ const stats = await (0, import_promises10.stat)(path69);
111599
+ return await stats.isDirectory();
111600
+ }
111601
+ __name(isDir, "isDir");
111600
111602
  async function buildCommand(args, _4) {
111603
+ try {
111604
+ const dir = await isDir(args.PATH);
111605
+ if (!dir) {
111606
+ logRaw(`PATH must be a directory`);
111607
+ return;
111608
+ }
111609
+ } catch (error2) {
111610
+ logRaw(`Error when checking ${args.PATH}: ${error2}`);
111611
+ return;
111612
+ }
111601
111613
  try {
111602
111614
  await constructBuildCommand({
111603
111615
  imageTag: args.tag,
111604
111616
  pathToDockerfile: args.PATH,
111605
111617
  pathToDocker: args.pathToDocker
111606
- }).then(async (bc2) => dockerBuild({ buildCmd: bc2 })).then(async () => {
111618
+ }).then((bc2) => dockerBuild({ buildCmd: bc2 })).then(async () => {
111607
111619
  if (args.push) {
111608
111620
  await dockerLoginManagedRegistry({
111609
111621
  pathToDocker: args.pathToDocker
@@ -111616,7 +111628,7 @@ async function buildCommand(args, _4) {
111616
111628
  if (error2 instanceof Error) {
111617
111629
  logRaw(error2.message);
111618
111630
  } else {
111619
- logRaw("An unknown error occurred");
111631
+ logRaw("Unknown error");
111620
111632
  }
111621
111633
  }
111622
111634
  }
@@ -112079,7 +112091,7 @@ __name(getNetworkInput, "getNetworkInput");
112079
112091
 
112080
112092
  // src/cloudchamber/ssh/ssh.ts
112081
112093
  init_import_meta_url();
112082
- var import_promises10 = require("fs/promises");
112094
+ var import_promises11 = require("fs/promises");
112083
112095
  var import_os3 = require("os");
112084
112096
  var import_process4 = require("process");
112085
112097
 
@@ -112143,7 +112155,7 @@ function createSSHPublicKeyOptionalYargs(yargs) {
112143
112155
  __name(createSSHPublicKeyOptionalYargs, "createSSHPublicKeyOptionalYargs");
112144
112156
  async function retrieveSSHKey(sshKeyPath, { json } = { json: false }) {
112145
112157
  try {
112146
- const file = (await (0, import_promises10.readFile)(sshKeyPath)).toString();
112158
+ const file = (await (0, import_promises11.readFile)(sshKeyPath)).toString();
112147
112159
  validatePublicSSHKeyCLI(file, { json });
112148
112160
  return file;
112149
112161
  } catch (err) {
@@ -112224,10 +112236,10 @@ async function tryToRetrieveAllDefaultSSHKeyPaths() {
112224
112236
  const path69 = `${HOME}/.ssh`;
112225
112237
  const paths = [];
112226
112238
  try {
112227
- const dirList = await (0, import_promises10.readdir)(path69);
112239
+ const dirList = await (0, import_promises11.readdir)(path69);
112228
112240
  for (const file of dirList) {
112229
112241
  if (file.endsWith(".pub")) {
112230
- const s5 = await (0, import_promises10.stat)(`${path69}/${file}`);
112242
+ const s5 = await (0, import_promises11.stat)(`${path69}/${file}`);
112231
112243
  if (s5.isFile()) {
112232
112244
  paths.push(`${path69}/${file}`);
112233
112245
  }
@@ -112269,7 +112281,7 @@ async function shouldPromptForNewSSHKeyAppear(keys = void 0) {
112269
112281
  }
112270
112282
  let foundValidSSHKeyThatDontExist = false;
112271
112283
  for (const defaultSSHKeyPath of defaultSSHKeyPaths) {
112272
- const file = (await (0, import_promises10.readFile)(defaultSSHKeyPath)).toString().trim();
112284
+ const file = (await (0, import_promises11.readFile)(defaultSSHKeyPath)).toString().trim();
112273
112285
  try {
112274
112286
  validateSSHKey(file);
112275
112287
  } catch {
@@ -113131,7 +113143,7 @@ public_key: ${dim(
113131
113143
  __name(handleListImageRegistriesCommand, "handleListImageRegistriesCommand");
113132
113144
  async function handleConfigureImageRegistryCommand(args, _config) {
113133
113145
  startSection("Configure a Docker registry in Cloudflare");
113134
- const domain3 = await processArgument({ domain: args.domain }, "domain", {
113146
+ const domain4 = await processArgument({ domain: args.domain }, "domain", {
113135
113147
  type: "text",
113136
113148
  question: "What is the domain of your registry?",
113137
113149
  validate: /* @__PURE__ */ __name((text) => {
@@ -113153,7 +113165,7 @@ async function handleConfigureImageRegistryCommand(args, _config) {
113153
113165
  const [registry, err] = await wrap2(
113154
113166
  promiseSpinner(
113155
113167
  ImageRegistriesService.createImageRegistry({
113156
- domain: domain3,
113168
+ domain: domain4,
113157
113169
  is_public: isPublic
113158
113170
  })
113159
113171
  )
@@ -113185,6 +113197,199 @@ async function handleConfigureImageRegistryCommand(args, _config) {
113185
113197
  }
113186
113198
  __name(handleConfigureImageRegistryCommand, "handleConfigureImageRegistryCommand");
113187
113199
 
113200
+ // src/cloudchamber/images/list.ts
113201
+ init_import_meta_url();
113202
+ var domain2 = "registry.cloudchamber.cfdata.org";
113203
+ var imagesCommand = /* @__PURE__ */ __name((yargs) => {
113204
+ return yargs.command(
113205
+ "list",
113206
+ "perform operations on images in your cloudchamber registry",
113207
+ (args) => listImagesYargs(args),
113208
+ (args) => handleFailure(async (_args, config) => {
113209
+ await handleListImagesCommand(args, config);
113210
+ })(args)
113211
+ ).command(
113212
+ "delete [image]",
113213
+ "remove an image from your cloudchamber registry",
113214
+ (args) => deleteImageYargs(args),
113215
+ (args) => handleFailure(async (_args, config) => {
113216
+ await handleDeleteImageCommand(args, config);
113217
+ })(args)
113218
+ );
113219
+ }, "imagesCommand");
113220
+ function deleteImageYargs(yargs) {
113221
+ return yargs.positional("image", {
113222
+ type: "string",
113223
+ description: "image to delete",
113224
+ demandOption: true
113225
+ });
113226
+ }
113227
+ __name(deleteImageYargs, "deleteImageYargs");
113228
+ function listImagesYargs(yargs) {
113229
+ return yargs.option("filter", {
113230
+ type: "string",
113231
+ description: "Regex to filter results"
113232
+ });
113233
+ }
113234
+ __name(listImagesYargs, "listImagesYargs");
113235
+ async function handleDeleteImageCommand(args, _config) {
113236
+ try {
113237
+ if (!args.image.includes(":")) {
113238
+ throw new Error(`Must provide a tag to delete`);
113239
+ }
113240
+ return await promiseSpinner(
113241
+ getCreds().then(async (creds) => {
113242
+ const url4 = new URL(`https://${domain2}`);
113243
+ const baseUrl = `${url4.protocol}//${url4.host}`;
113244
+ const [image, tag] = args.image.split(":");
113245
+ await deleteTag(baseUrl, image, tag, creds);
113246
+ const gcUrl = `${baseUrl}/v2/gc/layers`;
113247
+ const gcResponse = await fetch(gcUrl, {
113248
+ method: "PUT",
113249
+ headers: {
113250
+ Authorization: `Basic ${creds}`,
113251
+ "Content-Type": "application/json"
113252
+ }
113253
+ });
113254
+ if (!gcResponse.ok) {
113255
+ throw new Error(
113256
+ `Failed to delete image ${args.image}: ${gcResponse.status} ${gcResponse.statusText}`
113257
+ );
113258
+ }
113259
+ await logger.log(`Deleted tag: ${args.image}`);
113260
+ }),
113261
+ { message: "Deleting", json: args.json }
113262
+ );
113263
+ } catch (error2) {
113264
+ logger.log(`Error when removing image: ${error2}`);
113265
+ }
113266
+ }
113267
+ __name(handleDeleteImageCommand, "handleDeleteImageCommand");
113268
+ async function handleListImagesCommand(args, _config) {
113269
+ try {
113270
+ return await promiseSpinner(
113271
+ getCreds().then(async (creds) => {
113272
+ const repos = await listRepos(creds);
113273
+ const tags = [];
113274
+ for (const repo of repos) {
113275
+ const stripped = repo.replace(/^\/+/, "");
113276
+ const regex2 = new RegExp(args.filter ?? "");
113277
+ if (regex2.test(stripped)) {
113278
+ const repoTags = await listTags(stripped, creds);
113279
+ tags.push({ name: stripped, tags: repoTags });
113280
+ }
113281
+ }
113282
+ await ListTags(tags, false, args.json);
113283
+ }),
113284
+ { message: "Listing", json: args.json }
113285
+ );
113286
+ } catch (error2) {
113287
+ logger.log(`Error listing images: ${error2}`);
113288
+ }
113289
+ }
113290
+ __name(handleListImagesCommand, "handleListImagesCommand");
113291
+ async function ListTags(responses, digests = false, json = false) {
113292
+ if (!digests) {
113293
+ responses = responses.map((resp) => {
113294
+ return {
113295
+ name: resp.name,
113296
+ tags: resp.tags.filter((t7) => !t7.startsWith("sha256"))
113297
+ };
113298
+ });
113299
+ }
113300
+ responses = responses.filter((resp) => {
113301
+ return resp.tags !== void 0 && resp.tags.length != 0;
113302
+ });
113303
+ if (json) {
113304
+ logger.log(JSON.stringify(responses, null, 2));
113305
+ } else {
113306
+ const rows = responses.map((resp) => {
113307
+ return {
113308
+ REPOSITORY: resp.name,
113309
+ TAG: resp.tags.join(" ")
113310
+ };
113311
+ }).flat();
113312
+ logger.table(rows);
113313
+ }
113314
+ }
113315
+ __name(ListTags, "ListTags");
113316
+ async function listTags(repo, creds) {
113317
+ const url4 = new URL(`https://${domain2}`);
113318
+ const baseUrl = `${url4.protocol}//${url4.host}`;
113319
+ const tagsUrl = `${baseUrl}/v2/${repo}/tags/list`;
113320
+ const tagsResponse = await fetch(tagsUrl, {
113321
+ method: "GET",
113322
+ headers: {
113323
+ Authorization: `Basic ${creds}`
113324
+ }
113325
+ });
113326
+ const tagsData = await tagsResponse.json();
113327
+ return tagsData.tags || [];
113328
+ }
113329
+ __name(listTags, "listTags");
113330
+ async function listRepos(creds) {
113331
+ const url4 = new URL(`https://${domain2}`);
113332
+ const catalogUrl = `${url4.protocol}//${url4.host}/v2/_catalog`;
113333
+ const response = await fetch(catalogUrl, {
113334
+ method: "GET",
113335
+ headers: {
113336
+ Authorization: `Basic ${creds}`
113337
+ }
113338
+ });
113339
+ if (!response.ok) {
113340
+ console.log(JSON.stringify(response));
113341
+ throw new Error(
113342
+ `Failed to fetch repository catalog: ${response.status} ${response.statusText}`
113343
+ );
113344
+ }
113345
+ const data = await response.json();
113346
+ return data.repositories || [];
113347
+ }
113348
+ __name(listRepos, "listRepos");
113349
+ async function deleteTag(baseUrl, image, tag, creds) {
113350
+ const manifestAcceptHeader = "application/vnd.oci.image.manifest.v1+json, application/vnd.docker.distribution.manifest.v2+json";
113351
+ const manifestUrl = `${baseUrl}/v2/${image}/manifests/${tag}`;
113352
+ const headResponse = await fetch(manifestUrl, {
113353
+ method: "HEAD",
113354
+ headers: {
113355
+ Authorization: `Basic ${creds}`,
113356
+ Accept: manifestAcceptHeader
113357
+ }
113358
+ });
113359
+ if (!headResponse.ok) {
113360
+ throw new Error(
113361
+ `failed to retrieve tag info for ${tag}: ${headResponse.status} ${headResponse.statusText}`
113362
+ );
113363
+ }
113364
+ const digest = headResponse.headers.get("Docker-Content-Digest");
113365
+ if (!digest) {
113366
+ throw new Error(`Digest not found for tag "${tag}".`);
113367
+ }
113368
+ const deleteUrl = `${baseUrl}/v2/${image}/manifests/${tag}`;
113369
+ const deleteResponse = await fetch(deleteUrl, {
113370
+ method: "DELETE",
113371
+ headers: {
113372
+ Authorization: `Basic ${creds}`,
113373
+ Accept: manifestAcceptHeader
113374
+ }
113375
+ });
113376
+ if (!deleteResponse.ok) {
113377
+ throw new Error(
113378
+ `Failed to delete tag "${tag}" (digest: ${digest}): ${deleteResponse.status} ${deleteResponse.statusText}`
113379
+ );
113380
+ }
113381
+ }
113382
+ __name(deleteTag, "deleteTag");
113383
+ async function getCreds() {
113384
+ return await ImageRegistriesService.generateImageRegistryCredentials(domain2, {
113385
+ expiration_minutes: 5,
113386
+ permissions: ["pull", "push"]
113387
+ }).then(async (credentials) => {
113388
+ return Buffer.from(`v1:${credentials.password}`).toString("base64");
113389
+ });
113390
+ }
113391
+ __name(getCreds, "getCreds");
113392
+
113188
113393
  // src/cloudchamber/list.ts
113189
113394
  init_import_meta_url();
113190
113395
  function listDeploymentsYargs(args) {
@@ -113593,6 +113798,10 @@ var cloudchamber = /* @__PURE__ */ __name((yargs, subHelp) => {
113593
113798
  "push a tagged image to a Cloudflare managed registry, which is automatically integrated with your account",
113594
113799
  (args) => pushYargs(args),
113595
113800
  (args) => handleFailure(pushCommand)(args)
113801
+ ).command(
113802
+ "images",
113803
+ "perform operations on images in your clouchamber registry",
113804
+ (args) => imagesCommand(args).command(subHelp)
113596
113805
  );
113597
113806
  }, "cloudchamber");
113598
113807
 
@@ -114779,7 +114988,7 @@ __name(checkForSQLiteBinary, "checkForSQLiteBinary");
114779
114988
 
114780
114989
  // src/d1/export.ts
114781
114990
  init_import_meta_url();
114782
- var import_promises11 = __toESM(require("node:fs/promises"));
114991
+ var import_promises12 = __toESM(require("node:fs/promises"));
114783
114992
  var import_node_path29 = __toESM(require("node:path"));
114784
114993
  var import_miniflare18 = require("miniflare");
114785
114994
  var import_undici10 = __toESM(require_undici());
@@ -114860,7 +115069,7 @@ async function exportLocal(config, name2, output, tables, noSchema, noData) {
114860
115069
  logger.log(`\u{1F300} Exporting SQL to ${output}...`);
114861
115070
  try {
114862
115071
  const dump = await db.prepare(`PRAGMA miniflare_d1_export(?,?,?);`).bind(noSchema, noData, ...tables).raw();
114863
- await import_promises11.default.writeFile(output, dump[0].join("\n"));
115072
+ await import_promises12.default.writeFile(output, dump[0].join("\n"));
114864
115073
  } catch (e7) {
114865
115074
  throw new UserError(e7.message);
114866
115075
  } finally {
@@ -114905,7 +115114,7 @@ async function exportRemotely(config, name2, output, tables, noSchema, noData) {
114905
115114
  `There was an error while downloading from the presigned URL with status code: ${contents.status}`
114906
115115
  );
114907
115116
  }
114908
- await import_promises11.default.writeFile(output, contents.body || "");
115117
+ await import_promises12.default.writeFile(output, contents.body || "");
114909
115118
  }
114910
115119
  });
114911
115120
  logger.log(`\u{1F300} Downloaded to ${output} successfully!`);
@@ -117521,7 +117730,7 @@ __name(getMtlsFromArgs, "getMtlsFromArgs");
117521
117730
 
117522
117731
  // src/init.ts
117523
117732
  init_import_meta_url();
117524
- var import_promises12 = require("node:fs/promises");
117733
+ var import_promises13 = require("node:fs/promises");
117525
117734
  var import_node_path35 = __toESM(require("node:path"));
117526
117735
  var import_toml4 = __toESM(require_toml());
117527
117736
 
@@ -117625,9 +117834,9 @@ async function initHandler(args) {
117625
117834
  throw err;
117626
117835
  }
117627
117836
  const creationDir = import_node_path35.default.join(process.cwd(), args.fromDash);
117628
- await (0, import_promises12.mkdir)(creationDir, { recursive: true });
117837
+ await (0, import_promises13.mkdir)(creationDir, { recursive: true });
117629
117838
  const { modules, config } = await downloadWorker(accountId, args.fromDash);
117630
- await (0, import_promises12.mkdir)(import_node_path35.default.join(creationDir, "./src"), {
117839
+ await (0, import_promises13.mkdir)(import_node_path35.default.join(creationDir, "./src"), {
117631
117840
  recursive: true
117632
117841
  });
117633
117842
  config.main = `src/${config.main}`;
@@ -117637,12 +117846,12 @@ async function initHandler(args) {
117637
117846
  files.map(async (file) => {
117638
117847
  const filepath = import_node_path35.default.join(creationDir, `./src/${file.name}`);
117639
117848
  const directory = (0, import_node_path35.dirname)(filepath);
117640
- await (0, import_promises12.mkdir)(directory, { recursive: true });
117641
- await (0, import_promises12.writeFile)(filepath, file.stream());
117849
+ await (0, import_promises13.mkdir)(directory, { recursive: true });
117850
+ await (0, import_promises13.writeFile)(filepath, file.stream());
117642
117851
  })
117643
117852
  );
117644
117853
  }
117645
- await (0, import_promises12.writeFile)(
117854
+ await (0, import_promises13.writeFile)(
117646
117855
  import_node_path35.default.join(creationDir, "wrangler.toml"),
117647
117856
  import_toml4.default.stringify(config)
117648
117857
  );
@@ -118987,7 +119196,7 @@ init_import_meta_url();
118987
119196
  init_import_meta_url();
118988
119197
  var import_node_crypto11 = require("node:crypto");
118989
119198
  var import_node_fs20 = require("node:fs");
118990
- var import_promises17 = require("node:fs/promises");
119199
+ var import_promises18 = require("node:fs/promises");
118991
119200
  var import_node_path44 = __toESM(require("node:path"));
118992
119201
 
118993
119202
  // src/api/pages/create-worker-bundle-contents.ts
@@ -119044,7 +119253,7 @@ var import_node_path43 = require("node:path");
119044
119253
 
119045
119254
  // src/pages/functions/buildPlugin.ts
119046
119255
  init_import_meta_url();
119047
- var import_promises14 = require("node:fs/promises");
119256
+ var import_promises15 = require("node:fs/promises");
119048
119257
  var import_node_path39 = require("node:path");
119049
119258
 
119050
119259
  // src/pages/utils.ts
@@ -119110,7 +119319,7 @@ __name(debounce, "debounce");
119110
119319
  // src/pages/functions/buildWorker.ts
119111
119320
  init_import_meta_url();
119112
119321
  var import_node_crypto10 = __toESM(require("node:crypto"));
119113
- var import_promises13 = require("node:fs/promises");
119322
+ var import_promises14 = require("node:fs/promises");
119114
119323
  var import_node_path38 = require("node:path");
119115
119324
  var import_esbuild3 = require("esbuild");
119116
119325
  function buildWorkerFromFunctions({
@@ -119391,8 +119600,8 @@ function assetsPlugin(buildOutputDirectory) {
119391
119600
  args.resolveDir,
119392
119601
  args.path.slice("assets:".length)
119393
119602
  );
119394
- const exists = await (0, import_promises13.access)(directory).then(() => true).catch(() => false);
119395
- const isDirectory2 = exists && (await (0, import_promises13.lstat)(directory)).isDirectory();
119603
+ const exists = await (0, import_promises14.access)(directory).then(() => true).catch(() => false);
119604
+ const isDirectory2 = exists && (await (0, import_promises14.lstat)(directory)).isDirectory();
119396
119605
  if (!isDirectory2) {
119397
119606
  return {
119398
119607
  errors: [
@@ -119421,11 +119630,11 @@ function assetsPlugin(buildOutputDirectory) {
119421
119630
  "pages-plugins",
119422
119631
  identifier
119423
119632
  );
119424
- await (0, import_promises13.rm)(staticAssetsOutputDirectory, {
119633
+ await (0, import_promises14.rm)(staticAssetsOutputDirectory, {
119425
119634
  force: true,
119426
119635
  recursive: true
119427
119636
  });
119428
- await (0, import_promises13.cp)(args.path, staticAssetsOutputDirectory, {
119637
+ await (0, import_promises14.cp)(args.path, staticAssetsOutputDirectory, {
119429
119638
  force: true,
119430
119639
  recursive: true
119431
119640
  });
@@ -119504,8 +119713,8 @@ function buildPluginFromFunctions({
119504
119713
  args.resolveDir,
119505
119714
  args.path.slice("assets:".length)
119506
119715
  );
119507
- const exists = await (0, import_promises14.access)(directory).then(() => true).catch(() => false);
119508
- const isDirectory2 = exists && (await (0, import_promises14.lstat)(directory)).isDirectory();
119716
+ const exists = await (0, import_promises15.access)(directory).then(() => true).catch(() => false);
119717
+ const isDirectory2 = exists && (await (0, import_promises15.lstat)(directory)).isDirectory();
119509
119718
  if (!isDirectory2) {
119510
119719
  return {
119511
119720
  errors: [
@@ -119555,7 +119764,7 @@ __name(buildPluginFromFunctions, "buildPluginFromFunctions");
119555
119764
 
119556
119765
  // src/pages/functions/filepath-routing.ts
119557
119766
  init_import_meta_url();
119558
- var import_promises15 = __toESM(require("node:fs/promises"));
119767
+ var import_promises16 = __toESM(require("node:fs/promises"));
119559
119768
  var import_node_path40 = __toESM(require("node:path"));
119560
119769
  var import_esbuild4 = require("esbuild");
119561
119770
  async function generateConfigFromFileTree({
@@ -119687,7 +119896,7 @@ async function forEachFile(baseDir, fn) {
119687
119896
  const returnValues = [];
119688
119897
  while (isNotEmpty(searchPaths)) {
119689
119898
  const cwd2 = searchPaths.shift();
119690
- const dir = await import_promises15.default.readdir(cwd2, { withFileTypes: true });
119899
+ const dir = await import_promises16.default.readdir(cwd2, { withFileTypes: true });
119691
119900
  for (const entry of dir) {
119692
119901
  const pathname = import_node_path40.default.join(cwd2, entry.name);
119693
119902
  if (entry.isDirectory()) {
@@ -119732,7 +119941,7 @@ __name(convertSimpleParams, "convertSimpleParams");
119732
119941
 
119733
119942
  // src/pages/functions/routes.ts
119734
119943
  init_import_meta_url();
119735
- var import_promises16 = __toESM(require("node:fs/promises"));
119944
+ var import_promises17 = __toESM(require("node:fs/promises"));
119736
119945
  var import_node_path41 = __toESM(require("node:path"));
119737
119946
 
119738
119947
  // src/pages/functions/identifiers.ts
@@ -119810,7 +120019,7 @@ async function writeRoutesModule({
119810
120019
  }) {
119811
120020
  const { importMap, routes } = parseConfig(config, srcDir);
119812
120021
  const routesModule = generateRoutesModule(importMap, routes);
119813
- await import_promises16.default.writeFile(outfile, routesModule);
120022
+ await import_promises17.default.writeFile(outfile, routesModule);
119814
120023
  return outfile;
119815
120024
  }
119816
120025
  __name(writeRoutesModule, "writeRoutesModule");
@@ -120355,7 +120564,7 @@ async function maybeReadPagesConfig(args) {
120355
120564
  });
120356
120565
  return {
120357
120566
  ...config,
120358
- hash: (0, import_node_crypto11.createHash)("sha256").update(await (0, import_promises17.readFile)(configPath)).digest("hex")
120567
+ hash: (0, import_node_crypto11.createHash)("sha256").update(await (0, import_promises18.readFile)(configPath)).digest("hex")
120359
120568
  };
120360
120569
  } catch (e7) {
120361
120570
  if (e7 instanceof FatalError && e7.code === EXIT_CODE_INVALID_PAGES_CONFIG) {
@@ -120562,26 +120771,26 @@ var Handler9 = /* @__PURE__ */ __name(async (args) => {
120562
120771
  // src/pages/deploy.ts
120563
120772
  init_import_meta_url();
120564
120773
  var import_node_child_process4 = require("node:child_process");
120565
- var import_promises21 = require("node:fs/promises");
120774
+ var import_promises22 = require("node:fs/promises");
120566
120775
  var import_node_path50 = __toESM(require("node:path"));
120567
120776
 
120568
120777
  // src/api/pages/deploy.ts
120569
120778
  init_import_meta_url();
120570
120779
  var import_node_crypto12 = require("node:crypto");
120571
120780
  var import_node_fs23 = require("node:fs");
120572
- var import_promises20 = require("node:fs/promises");
120781
+ var import_promises21 = require("node:fs/promises");
120573
120782
  var import_node_path49 = __toESM(require("node:path"));
120574
120783
  var import_node_process11 = require("node:process");
120575
120784
  var import_undici13 = __toESM(require_undici());
120576
120785
 
120577
120786
  // src/pages/upload.ts
120578
120787
  init_import_meta_url();
120579
- var import_promises19 = require("node:fs/promises");
120788
+ var import_promises20 = require("node:fs/promises");
120580
120789
  var import_node_path48 = require("node:path");
120581
120790
 
120582
120791
  // src/pages/validate.ts
120583
120792
  init_import_meta_url();
120584
- var import_promises18 = require("node:fs/promises");
120793
+ var import_promises19 = require("node:fs/promises");
120585
120794
  var import_node_path47 = require("node:path");
120586
120795
  var import_mime2 = __toESM(require_mime());
120587
120796
  var import_minimatch = __toESM(require_minimatch());
@@ -120615,12 +120824,12 @@ var validate = /* @__PURE__ */ __name(async (args) => {
120615
120824
  ].map((pattern) => new import_minimatch.Minimatch(pattern));
120616
120825
  const directory = (0, import_node_path47.resolve)(args.directory);
120617
120826
  const walk = /* @__PURE__ */ __name(async (dir, fileMap2 = /* @__PURE__ */ new Map(), startingDir = dir) => {
120618
- const files = await (0, import_promises18.readdir)(dir);
120827
+ const files = await (0, import_promises19.readdir)(dir);
120619
120828
  await Promise.all(
120620
120829
  files.map(async (file) => {
120621
120830
  const filepath = (0, import_node_path47.join)(dir, file);
120622
120831
  const relativeFilepath = (0, import_node_path47.relative)(startingDir, filepath);
120623
- const filestat = await (0, import_promises18.stat)(filepath);
120832
+ const filestat = await (0, import_promises19.stat)(filepath);
120624
120833
  for (const minimatch of IGNORE_LIST) {
120625
120834
  if (minimatch.match(relativeFilepath)) {
120626
120835
  return;
@@ -120702,8 +120911,8 @@ var Handler11 = /* @__PURE__ */ __name(async ({
120702
120911
  skipCaching: skipCaching ?? false
120703
120912
  });
120704
120913
  if (outputManifestPath) {
120705
- await (0, import_promises19.mkdir)((0, import_node_path48.dirname)(outputManifestPath), { recursive: true });
120706
- await (0, import_promises19.writeFile)(outputManifestPath, JSON.stringify(manifest));
120914
+ await (0, import_promises20.mkdir)((0, import_node_path48.dirname)(outputManifestPath), { recursive: true });
120915
+ await (0, import_promises20.writeFile)(outputManifestPath, JSON.stringify(manifest));
120707
120916
  }
120708
120917
  logger.log(`\u2728 Upload complete!`);
120709
120918
  }, "Handler");
@@ -120792,7 +121001,7 @@ var upload = /* @__PURE__ */ __name(async (args) => {
120792
121001
  const payload = await Promise.all(
120793
121002
  bucket.files.map(async (file) => ({
120794
121003
  key: file.hash,
120795
- value: (await (0, import_promises19.readFile)(file.path)).toString("base64"),
121004
+ value: (await (0, import_promises20.readFile)(file.path)).toString("base64"),
120796
121005
  metadata: {
120797
121006
  contentType: file.contentType
120798
121007
  },
@@ -121101,7 +121310,7 @@ async function deploy2({
121101
121310
  );
121102
121311
  }
121103
121312
  if (config !== void 0 && config.configPath !== void 0 && config.pages_build_output_dir) {
121104
- const configHash = (0, import_node_crypto12.createHash)("sha256").update(await (0, import_promises20.readFile)(config.configPath)).digest("hex");
121313
+ const configHash = (0, import_node_crypto12.createHash)("sha256").update(await (0, import_promises21.readFile)(config.configPath)).digest("hex");
121105
121314
  const outputDir = import_node_path49.default.relative(
121106
121315
  process.cwd(),
121107
121316
  config.pages_build_output_dir
@@ -121829,7 +122038,7 @@ To silence this warning, pass in --commit-dirty=true`
121829
122038
  if (failureMessage.includes("Script startup exceeded CPU time limit")) {
121830
122039
  const workerBundle = formData.get("_worker.bundle");
121831
122040
  const filePath = import_node_path50.default.join(getPagesTmpDir(), "_worker.bundle");
121832
- await (0, import_promises21.writeFile)(filePath, workerBundle.stream());
122041
+ await (0, import_promises22.writeFile)(filePath, workerBundle.stream());
121833
122042
  await handleStartupError(filePath, getPagesProjectRoot());
121834
122043
  }
121835
122044
  throw new FatalError(
@@ -121878,7 +122087,7 @@ __name(promptSelectExistingOrNewProject, "promptSelectExistingOrNewProject");
121878
122087
 
121879
122088
  // src/pages/deployment-tails.ts
121880
122089
  init_import_meta_url();
121881
- var import_promises22 = require("node:timers/promises");
122090
+ var import_promises23 = require("node:timers/promises");
121882
122091
  var import_signal_exit5 = __toESM(require_signal_exit());
121883
122092
 
121884
122093
  // src/tail/createTail.ts
@@ -122397,10 +122606,10 @@ async function Handler13({
122397
122606
  while (tail.readyState !== tail.OPEN) {
122398
122607
  switch (tail.readyState) {
122399
122608
  case tail.CONNECTING:
122400
- await (0, import_promises22.setTimeout)(100);
122609
+ await (0, import_promises23.setTimeout)(100);
122401
122610
  break;
122402
122611
  case tail.CLOSING:
122403
- await (0, import_promises22.setTimeout)(100);
122612
+ await (0, import_promises23.setTimeout)(100);
122404
122613
  break;
122405
122614
  case tail.CLOSED:
122406
122615
  sendMetricsEvent("end log stream", {
@@ -123404,7 +123613,7 @@ __name(getBindingsFromArgs, "getBindingsFromArgs");
123404
123613
  // src/pages/download-config.ts
123405
123614
  init_import_meta_url();
123406
123615
  var import_fs13 = require("fs");
123407
- var import_promises26 = require("node:fs/promises");
123616
+ var import_promises27 = require("node:fs/promises");
123408
123617
  var import_toml5 = __toESM(require_toml());
123409
123618
  var import_miniflare19 = require("miniflare");
123410
123619
  async function toEnvironment(deploymentConfig, accountId) {
@@ -123517,7 +123726,7 @@ __name(toEnvironment, "toEnvironment");
123517
123726
  async function writeWranglerToml(toml) {
123518
123727
  let tomlString = import_toml5.default.stringify(toml);
123519
123728
  tomlString = tomlString.split("\n").map((line) => line.trimStart()).join("\n");
123520
- await (0, import_promises26.writeFile)(
123729
+ await (0, import_promises27.writeFile)(
123521
123730
  "wrangler.toml",
123522
123731
  `# Generated by Wrangler on ${/* @__PURE__ */ new Date()}
123523
123732
  ${tomlString}`
@@ -124531,7 +124740,7 @@ __name(pages, "pages");
124531
124740
 
124532
124741
  // src/pipelines/index.ts
124533
124742
  init_import_meta_url();
124534
- var import_promises29 = require("node:timers/promises");
124743
+ var import_promises30 = require("node:timers/promises");
124535
124744
 
124536
124745
  // ../../node_modules/.pnpm/@aws-sdk+client-s3@3.721.0/node_modules/@aws-sdk/client-s3/dist-es/S3Client.js
124537
124746
  init_import_meta_url();
@@ -128267,14 +128476,14 @@ init_import_meta_url();
128267
128476
  init_import_meta_url();
128268
128477
  var import_node_assert21 = __toESM(require("node:assert"));
128269
128478
  var import_node_http2 = __toESM(require("node:http"));
128270
- var import_promises28 = require("node:timers/promises");
128479
+ var import_promises29 = require("node:timers/promises");
128271
128480
  var API_HEADERS = {
128272
128481
  "Content-Type": "application/json"
128273
128482
  };
128274
128483
  async function generateR2ServiceToken(accountId, bucketName, pipelineName) {
128275
128484
  const controller = new AbortController();
128276
128485
  const signal = controller.signal;
128277
- const timeoutPromise = (0, import_promises28.setTimeout)(12e4, "timeout", { signal });
128486
+ const timeoutPromise = (0, import_promises29.setTimeout)(12e4, "timeout", { signal });
128278
128487
  const serverPromise = new Promise((resolve24, reject) => {
128279
128488
  const server = import_node_http2.default.createServer(async (request4, response) => {
128280
128489
  (0, import_node_assert21.default)(request4.url, "This request doesn't have a URL");
@@ -128947,7 +129156,7 @@ async function verifyBucketAccess(r22, bucketName) {
128947
129156
  if (attempt === MAX_ATTEMPTS2) {
128948
129157
  throw error2;
128949
129158
  }
128950
- await (0, import_promises29.setTimeout)(DELAY_MS);
129159
+ await (0, import_promises30.setTimeout)(DELAY_MS);
128951
129160
  }
128952
129161
  }
128953
129162
  }
@@ -130712,15 +130921,15 @@ var r2BucketDomainGetCommand = createCommand({
130712
130921
  type: "string"
130713
130922
  }
130714
130923
  },
130715
- async handler({ bucket, domain: domain3, jurisdiction }, { config }) {
130924
+ async handler({ bucket, domain: domain4, jurisdiction }, { config }) {
130716
130925
  const accountId = await requireAuth(config);
130717
130926
  logger.log(
130718
- `Retrieving custom domain '${domain3}' connected to bucket '${bucket}'...`
130927
+ `Retrieving custom domain '${domain4}' connected to bucket '${bucket}'...`
130719
130928
  );
130720
130929
  const domainResponse = await getCustomDomain(
130721
130930
  accountId,
130722
130931
  bucket,
130723
- domain3,
130932
+ domain4,
130724
130933
  jurisdiction
130725
130934
  );
130726
130935
  const tableOutput = tableFromCustomDomainListResponse([domainResponse]);
@@ -130809,7 +131018,7 @@ var r2BucketDomainAddCommand = createCommand({
130809
131018
  const accountId = await requireAuth(config);
130810
131019
  const {
130811
131020
  bucket,
130812
- domain: domain3,
131021
+ domain: domain4,
130813
131022
  zoneId,
130814
131023
  minTls = "1.0",
130815
131024
  jurisdiction,
@@ -130817,25 +131026,25 @@ var r2BucketDomainAddCommand = createCommand({
130817
131026
  } = args;
130818
131027
  if (!force) {
130819
131028
  const confirmedAdd = await confirm(
130820
- `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}'`
131029
+ `Are you sure you want to add the custom domain '${domain4}' to bucket '${bucket}'? The contents of your bucket will be made publicly available at 'https://${domain4}'`
130821
131030
  );
130822
131031
  if (!confirmedAdd) {
130823
131032
  logger.log("Add cancelled.");
130824
131033
  return;
130825
131034
  }
130826
131035
  }
130827
- logger.log(`Connecting custom domain '${domain3}' to bucket '${bucket}'...`);
131036
+ logger.log(`Connecting custom domain '${domain4}' to bucket '${bucket}'...`);
130828
131037
  await attachCustomDomainToBucket(
130829
131038
  accountId,
130830
131039
  bucket,
130831
131040
  {
130832
- domain: domain3,
131041
+ domain: domain4,
130833
131042
  zoneId,
130834
131043
  minTLS: minTls
130835
131044
  },
130836
131045
  jurisdiction
130837
131046
  );
130838
- logger.log(`\u2728 Custom domain '${domain3}' connected successfully.`);
131047
+ logger.log(`\u2728 Custom domain '${domain4}' connected successfully.`);
130839
131048
  }
130840
131049
  });
130841
131050
  var r2BucketDomainRemoveCommand = createCommand({
@@ -130871,19 +131080,19 @@ var r2BucketDomainRemoveCommand = createCommand({
130871
131080
  },
130872
131081
  async handler(args, { config }) {
130873
131082
  const accountId = await requireAuth(config);
130874
- const { bucket, domain: domain3, jurisdiction, force } = args;
131083
+ const { bucket, domain: domain4, jurisdiction, force } = args;
130875
131084
  if (!force) {
130876
131085
  const confirmedRemoval = await confirm(
130877
- `Are you sure you want to remove the custom domain '${domain3}' from bucket '${bucket}'? Your bucket will no longer be available from 'https://${domain3}'`
131086
+ `Are you sure you want to remove the custom domain '${domain4}' from bucket '${bucket}'? Your bucket will no longer be available from 'https://${domain4}'`
130878
131087
  );
130879
131088
  if (!confirmedRemoval) {
130880
131089
  logger.log("Removal cancelled.");
130881
131090
  return;
130882
131091
  }
130883
131092
  }
130884
- logger.log(`Removing custom domain '${domain3}' from bucket '${bucket}'...`);
130885
- await removeCustomDomainFromBucket(accountId, bucket, domain3, jurisdiction);
130886
- logger.log(`Custom domain '${domain3}' removed successfully.`);
131093
+ logger.log(`Removing custom domain '${domain4}' from bucket '${bucket}'...`);
131094
+ await removeCustomDomainFromBucket(accountId, bucket, domain4, jurisdiction);
131095
+ logger.log(`Custom domain '${domain4}' removed successfully.`);
130887
131096
  }
130888
131097
  });
130889
131098
  var r2BucketDomainUpdateCommand = createCommand({
@@ -130918,19 +131127,19 @@ var r2BucketDomainUpdateCommand = createCommand({
130918
131127
  },
130919
131128
  async handler(args, { config }) {
130920
131129
  const accountId = await requireAuth(config);
130921
- const { bucket, domain: domain3, minTls, jurisdiction } = args;
130922
- logger.log(`Updating custom domain '${domain3}' for bucket '${bucket}'...`);
131130
+ const { bucket, domain: domain4, minTls, jurisdiction } = args;
131131
+ logger.log(`Updating custom domain '${domain4}' for bucket '${bucket}'...`);
130923
131132
  await configureCustomDomainSettings(
130924
131133
  accountId,
130925
131134
  bucket,
130926
- domain3,
131135
+ domain4,
130927
131136
  {
130928
- domain: domain3,
131137
+ domain: domain4,
130929
131138
  minTLS: minTls
130930
131139
  },
130931
131140
  jurisdiction
130932
131141
  );
130933
- logger.log(`\u2728 Custom domain '${domain3}' updated successfully.`);
131142
+ logger.log(`\u2728 Custom domain '${domain4}' updated successfully.`);
130934
131143
  }
130935
131144
  });
130936
131145
 
@@ -139673,9 +139882,9 @@ var NODE_VERSION = parseSemver(process.versions.node);
139673
139882
 
139674
139883
  // ../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/async/domain.js
139675
139884
  init_import_meta_url();
139676
- var domain2 = __toESM(require("domain"));
139885
+ var domain3 = __toESM(require("domain"));
139677
139886
  function getActiveDomain() {
139678
- return domain2.active;
139887
+ return domain3.active;
139679
139888
  }
139680
139889
  __name(getActiveDomain, "getActiveDomain");
139681
139890
  function getCurrentHub2() {
@@ -139698,7 +139907,7 @@ function runWithAsyncContext2(callback, options32) {
139698
139907
  if (activeDomain && _optionalChain([options32, "optionalAccess", (_4) => _4.reuseExisting])) {
139699
139908
  return callback();
139700
139909
  }
139701
- const local = domain2.create();
139910
+ const local = domain3.create();
139702
139911
  const parentHub = activeDomain ? getHubFromCarrier(activeDomain) : void 0;
139703
139912
  const newHub = createNewHub(parentHub);
139704
139913
  setHubOnCarrier(local, newHub);
@@ -141800,7 +142009,7 @@ __name(closeSentry, "closeSentry");
141800
142009
 
141801
142010
  // src/tail/index.ts
141802
142011
  init_import_meta_url();
141803
- var import_promises30 = require("node:timers/promises");
142012
+ var import_promises31 = require("node:timers/promises");
141804
142013
  var import_signal_exit6 = __toESM(require_signal_exit());
141805
142014
  var tailCommand = createCommand({
141806
142015
  metadata: {
@@ -141933,10 +142142,10 @@ var tailCommand = createCommand({
141933
142142
  while (tail.readyState !== tail.OPEN) {
141934
142143
  switch (tail.readyState) {
141935
142144
  case tail.CONNECTING:
141936
- await (0, import_promises30.setTimeout)(100);
142145
+ await (0, import_promises31.setTimeout)(100);
141937
142146
  break;
141938
142147
  case tail.CLOSING:
141939
- await (0, import_promises30.setTimeout)(100);
142148
+ await (0, import_promises31.setTimeout)(100);
141940
142149
  break;
141941
142150
  case tail.CLOSED:
141942
142151
  sendMetricsEvent("end log stream", {
@@ -142104,7 +142313,7 @@ __name(isProcessEnvPopulated, "isProcessEnvPopulated");
142104
142313
  // src/type-generation/runtime/index.ts
142105
142314
  init_import_meta_url();
142106
142315
  var import_fs22 = require("fs");
142107
- var import_promises31 = require("fs/promises");
142316
+ var import_promises32 = require("fs/promises");
142108
142317
  var import_miniflare20 = require("miniflare");
142109
142318
  var import_workerd = require("workerd");
142110
142319
  var DEFAULT_OUTFILE_RELATIVE_PATH = "worker-configuration.d.ts";
@@ -142117,7 +142326,7 @@ async function generateRuntimeTypes({
142117
142326
  }
142118
142327
  const header = `// Runtime types generated with workerd@${import_workerd.version} ${compatibility_date} ${compatibility_flags.sort().join(",")}`;
142119
142328
  try {
142120
- const lines = (await (0, import_promises31.readFile)(outFile, "utf8")).split("\n");
142329
+ const lines = (await (0, import_promises32.readFile)(outFile, "utf8")).split("\n");
142121
142330
  const existingHeader = lines.find(
142122
142331
  (line) => line.startsWith("// Runtime types generated with workerd@")
142123
142332
  );
@@ -148726,7 +148935,7 @@ ${tryRunningItIn}${oneOfThese}`
148726
148935
  const controller = new AbortController();
148727
148936
  await Promise.race([
148728
148937
  Promise.allSettled(dispatcher?.requests ?? []),
148729
- (0, import_promises32.setTimeout)(1e3, void 0, controller)
148938
+ (0, import_promises33.setTimeout)(1e3, void 0, controller)
148730
148939
  // Ensure we don't hang indefinitely
148731
148940
  ]).then(() => controller.abort());
148732
148941
  } catch (e7) {
@@ -148790,7 +148999,7 @@ async function checkStartupHandler({
148790
148999
  startMessage: "Analysing",
148791
149000
  endMessage: source_default.green("Startup phase analysed")
148792
149001
  });
148793
- await (0, import_promises34.writeFile)(outfile, JSON.stringify(await cpuProfileResult));
149002
+ await (0, import_promises35.writeFile)(outfile, JSON.stringify(await cpuProfileResult));
148794
149003
  log(
148795
149004
  `CPU Profile written to ${outfile}. Load it into the Chrome DevTools profiler (or directly in VSCode) to view a flamegraph.`
148796
149005
  );
@@ -148869,7 +149078,7 @@ async function convertWorkerBundleToModules(workerBundle) {
148869
149078
  }
148870
149079
  __name(convertWorkerBundleToModules, "convertWorkerBundleToModules");
148871
149080
  async function parseFormDataFromFile(file) {
148872
- const bundle = await (0, import_promises33.readFile)(file);
149081
+ const bundle = await (0, import_promises34.readFile)(file);
148873
149082
  const firstLine = bundle.findIndex((v7) => v7 === 10);
148874
149083
  const boundary = Uint8Array.prototype.slice.call(bundle, 2, firstLine).toString();
148875
149084
  return await new Response(bundle, {
@@ -148967,7 +149176,7 @@ async function handleStartupError(workerBundle, projectRoot) {
148967
149176
  projectRoot ?? process.cwd(),
148968
149177
  import_node_path58.default.join(tmpDir.path, `worker.cpuprofile`)
148969
149178
  );
148970
- await (0, import_promises35.writeFile)(profile, JSON.stringify(cpuProfile));
149179
+ await (0, import_promises36.writeFile)(profile, JSON.stringify(cpuProfile));
148971
149180
  throw new UserError(esm_default2`
148972
149181
  Your Worker failed validation because it exceeded startup limits.
148973
149182
  To ensure fast responses, there are constraints on Worker startup, such as how much CPU it can use, or how long it can take. Your Worker has hit one of these startup limits. Try reducing the amount of work done during startup (outside the event handler), either by removing code or relocating it inside the event handler.
@@ -149096,18 +149305,18 @@ async function publishCustomDomains(workerUrl, accountId, domains) {
149096
149305
  }
149097
149306
  );
149098
149307
  const updatesRequired = changeset.updated.filter(
149099
- (domain3) => domain3.modified
149308
+ (domain4) => domain4.modified
149100
149309
  );
149101
149310
  if (updatesRequired.length > 0) {
149102
149311
  const existing = await Promise.all(
149103
149312
  updatesRequired.map(
149104
- (domain3) => fetchResult(
149105
- `/accounts/${accountId}/workers/domains/records/${domain3.id}`
149313
+ (domain4) => fetchResult(
149314
+ `/accounts/${accountId}/workers/domains/records/${domain4.id}`
149106
149315
  )
149107
149316
  )
149108
149317
  );
149109
149318
  const existingRendered = existing.map(
149110
- (domain3) => ` \u2022 ${domain3.hostname} (used as a domain for "${domain3.service}")`
149319
+ (domain4) => ` \u2022 ${domain4.hostname} (used as a domain for "${domain4.service}")`
149111
149320
  ).join("\n");
149112
149321
  const message = `Custom Domains already exist for these domains:
149113
149322
  ${existingRendered}
@@ -149118,7 +149327,7 @@ Update them to point to this script instead?`;
149118
149327
  config.override_existing_origin = true;
149119
149328
  }
149120
149329
  if (changeset.conflicting.length > 0) {
149121
- const conflicitingRendered = changeset.conflicting.map((domain3) => ` \u2022 ${domain3.hostname}`).join("\n");
149330
+ const conflicitingRendered = changeset.conflicting.map((domain4) => ` \u2022 ${domain4.hostname}`).join("\n");
149122
149331
  const message = `You already have DNS records that conflict for these Custom Domains:
149123
149332
  ${conflicitingRendered}
149124
149333
  Update them to point to this script instead?`;
@@ -149135,7 +149344,7 @@ Update them to point to this script instead?`;
149135
149344
  "Content-Type": "application/json"
149136
149345
  }
149137
149346
  });
149138
- return domains.map((domain3) => renderRoute(domain3));
149347
+ return domains.map((domain4) => renderRoute(domain4));
149139
149348
  }
149140
149349
  __name(publishCustomDomains, "publishCustomDomains");
149141
149350
  async function deploy(props) {
@@ -149390,6 +149599,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
149390
149599
  bindings,
149391
149600
  migrations,
149392
149601
  modules,
149602
+ containers: config.containers ?? void 0,
149393
149603
  sourceMaps: uploadSourceMaps ? loadSourceMaps(main2, modules, bundle) : void 0,
149394
149604
  compatibility_date: props.compatibilityDate ?? config.compatibility_date,
149395
149605
  compatibility_flags: compatibilityFlags,
@@ -149428,7 +149638,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
149428
149638
  maskedVars[key] = "(hidden)";
149429
149639
  }
149430
149640
  }
149431
- const canUseNewVersionsDeploymentsApi = workerExists && props.dispatchNamespace === void 0 && prod && format9 === "modules" && migrations === void 0 && !config.first_party_worker;
149641
+ const canUseNewVersionsDeploymentsApi = workerExists && props.dispatchNamespace === void 0 && prod && format9 === "modules" && migrations === void 0 && !config.first_party_worker && config.containers === void 0;
149432
149642
  let workerBundle;
149433
149643
  if (props.dryRun) {
149434
149644
  workerBundle = createWorkerUploadForm(worker);
@@ -149908,7 +150118,7 @@ var syncAssets = /* @__PURE__ */ __name(async (accountId, assetDirectory, script
149908
150118
  payload.append(
149909
150119
  manifestEntry[1].hash,
149910
150120
  new import_undici22.File(
149911
- [(await (0, import_promises36.readFile)(absFilePath)).toString("base64")],
150121
+ [(await (0, import_promises37.readFile)(absFilePath)).toString("base64")],
149912
150122
  manifestEntry[1].hash,
149913
150123
  {
149914
150124
  // Most formdata body encoders (incl. undici's) will override with "application/octet-stream" if you use a falsy value here
@@ -150000,7 +150210,7 @@ Assets already uploaded have been saved, so the next attempt will automatically
150000
150210
  return completionJwt;
150001
150211
  }, "syncAssets");
150002
150212
  var buildAssetManifest = /* @__PURE__ */ __name(async (dir) => {
150003
- const files = await (0, import_promises36.readdir)(dir, { recursive: true });
150213
+ const files = await (0, import_promises37.readdir)(dir, { recursive: true });
150004
150214
  const manifest = {};
150005
150215
  let counter = 0;
150006
150216
  const { assetsIgnoreFunction, assetsIgnoreFilePresent } = await createAssetsIgnoreFunction(dir);
@@ -150011,7 +150221,7 @@ var buildAssetManifest = /* @__PURE__ */ __name(async (dir) => {
150011
150221
  return;
150012
150222
  }
150013
150223
  const filepath = path62.join(dir, relativeFilepath);
150014
- const filestat = await (0, import_promises36.stat)(filepath);
150224
+ const filestat = await (0, import_promises37.stat)(filepath);
150015
150225
  if (filestat.isSymbolicLink() || filestat.isDirectory()) {
150016
150226
  return;
150017
150227
  } else {
@@ -150183,7 +150393,7 @@ init_import_meta_url();
150183
150393
  // src/dev-registry/file-registry.ts
150184
150394
  init_import_meta_url();
150185
150395
  var import_node_fs32 = require("node:fs");
150186
- var import_promises37 = require("node:fs/promises");
150396
+ var import_promises38 = require("node:fs/promises");
150187
150397
  var import_node_path60 = __toESM(require("node:path"));
150188
150398
  var util3 = __toESM(require("node:util"));
150189
150399
  init_esm2();
@@ -150255,8 +150465,8 @@ async function registerWorker(name2, definition) {
150255
150465
  if (existingHeartbeat) {
150256
150466
  clearInterval(existingHeartbeat);
150257
150467
  }
150258
- await (0, import_promises37.mkdir)(DEV_REGISTRY_PATH, { recursive: true });
150259
- await (0, import_promises37.writeFile)(
150468
+ await (0, import_promises38.mkdir)(DEV_REGISTRY_PATH, { recursive: true });
150469
+ await (0, import_promises38.writeFile)(
150260
150470
  import_node_path60.default.join(DEV_REGISTRY_PATH, name2),
150261
150471
  // We don't currently do anything with the stored Wrangler version,
150262
150472
  // but if we need to make breaking changes to this format in the future
@@ -150279,7 +150489,7 @@ async function getRegisteredWorkers() {
150279
150489
  __name(getRegisteredWorkers, "getRegisteredWorkers");
150280
150490
  async function unregisterWorker(name2) {
150281
150491
  try {
150282
- await (0, import_promises37.unlink)(import_node_path60.default.join(DEV_REGISTRY_PATH, name2));
150492
+ await (0, import_promises38.unlink)(import_node_path60.default.join(DEV_REGISTRY_PATH, name2));
150283
150493
  const existingHeartbeat = heartbeats.get(name2);
150284
150494
  if (existingHeartbeat) {
150285
150495
  clearInterval(existingHeartbeat);
@@ -150291,17 +150501,17 @@ async function unregisterWorker(name2) {
150291
150501
  }
150292
150502
  __name(unregisterWorker, "unregisterWorker");
150293
150503
  async function loadWorkerDefinitions() {
150294
- await (0, import_promises37.mkdir)(DEV_REGISTRY_PATH, { recursive: true });
150504
+ await (0, import_promises38.mkdir)(DEV_REGISTRY_PATH, { recursive: true });
150295
150505
  globalWorkers ??= {};
150296
150506
  const newWorkers = /* @__PURE__ */ new Set();
150297
- const workerDefinitions = await (0, import_promises37.readdir)(DEV_REGISTRY_PATH);
150507
+ const workerDefinitions = await (0, import_promises38.readdir)(DEV_REGISTRY_PATH);
150298
150508
  for (const workerName of workerDefinitions) {
150299
150509
  try {
150300
- const file = await (0, import_promises37.readFile)(
150510
+ const file = await (0, import_promises38.readFile)(
150301
150511
  import_node_path60.default.join(DEV_REGISTRY_PATH, workerName),
150302
150512
  "utf8"
150303
150513
  );
150304
- const stats = await (0, import_promises37.stat)(import_node_path60.default.join(DEV_REGISTRY_PATH, workerName));
150514
+ const stats = await (0, import_promises38.stat)(import_node_path60.default.join(DEV_REGISTRY_PATH, workerName));
150305
150515
  if (stats.mtime.getTime() < Date.now() - 6e5) {
150306
150516
  await unregisterWorker(workerName);
150307
150517
  } else {
@@ -153753,4 +153963,3 @@ yargs-parser/build/lib/index.js:
153753
153963
  * SPDX-License-Identifier: ISC
153754
153964
  *)
153755
153965
  */
153756
- //# sourceMappingURL=cli.js.map