@cloudflare/deploy-helpers 0.11.0 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -3,17 +3,15 @@ export { initDeployHelpersContext } from './chunk-Z4LB73IF.mjs';
3
3
  import { createWorkerUploadForm, moduleTypeMimeType } from './chunk-3G6JZQDH.mjs';
4
4
  export { createWorkerUploadForm, fromMimeType, handleUnsafeCapnp, moduleTypeMimeType } from './chunk-3G6JZQDH.mjs';
5
5
  import { __commonJS, __name, __require, __toESM, __export } from './chunk-Q72B4Q5Z.mjs';
6
- import assert4 from 'node:assert';
6
+ import assert5 from 'node:assert';
7
7
  import { readFileSync, mkdirSync, writeFileSync, createReadStream } from 'node:fs';
8
8
  import * as path from 'node:path';
9
9
  import path__default, { resolve, isAbsolute, sep, extname } from 'node:path';
10
10
  import url2, { URLSearchParams as URLSearchParams$1 } from 'node:url';
11
11
  import * as cli from '@cloudflare/cli-shared-helpers';
12
- import { cancel } from '@cloudflare/cli-shared-helpers';
13
- import { UserError as UserError$1 } from '@cloudflare/workers-utils/errors';
14
- import { execSync, spawn } from 'node:child_process';
15
- import '@cloudflare/workers-utils/compliance';
16
- import { INHERIT_SYMBOL, APIError, UserError, getEnvironmentVariableFactory, isNonInteractiveOrCI, getHostFromRoute, retryOnAPIFailure, ParseError, getComplianceRegionSubdomain, configFileName, formatTime, getSubdomainMixedStateCheckDisabled, LOGGER_LEVELS, getDurableObjectContainerApps, CONTAINER_IMAGES_BINDING, isDurableObjectContainerApp, SERVICE_TAG_PREFIX, ENVIRONMENT_TAG_PREFIX, getDurableObjectExports, partitionExports, getWranglerTmpDir, parsePackageJSON, getInstalledPackageVersion, FatalError, readFileSync as readFileSync$1, parseJSON, printBindings, experimental_readRawConfig, experimental_patchConfig, PatchConfigError, COMPLIANCE_REGION_CONFIG_UNKNOWN, constructWranglerConfig, getCIMatchTag, formatConfigSnippet, DEFAULT_COMPAT_DATE, writeOutput, getBindings, hasDurableObjectExports, getDockerPath, parseNonHyphenedUuid, getWorkersCIBranchName, getCIOverrideName, getBindingTypeFriendlyName } from '@cloudflare/workers-utils';
12
+ import { updateStatus, cancel } from '@cloudflare/cli-shared-helpers';
13
+ import { SchedulingPolicy, ApplicationsService, listDurableObjects, resolveImageName, buildAndMaybePush, ContainerImagePreparationsService, ContainerImagePreparationStatus, createDurableObjectNamespaceResolver, initContainersSharedContext, pushBuiltContainerImage, deployContainers, verifyDockerInstalled } from '@cloudflare/containers-shared';
14
+ import { INHERIT_SYMBOL, APIError, UserError, getEnvironmentVariableFactory, isNonInteractiveOrCI, getHostFromRoute, retryOnAPIFailure, ParseError, getComplianceRegionSubdomain, configFileName, formatTime, getSubdomainMixedStateCheckDisabled, LOGGER_LEVELS, getDurableObjectContainerApps, CONTAINER_IMAGES_BINDING, isDurableObjectContainerApp, getDockerPath, validateDurableObjectContainerApplications, getDurableObjectClassNameToUseSQLiteMap, SERVICE_TAG_PREFIX, ENVIRONMENT_TAG_PREFIX, getDurableObjectExports, partitionExports, getWranglerTmpDir, parsePackageJSON, getInstalledPackageVersion, FatalError, readFileSync as readFileSync$1, parseJSON, printBindings, experimental_readRawConfig, experimental_patchConfig, PatchConfigError, COMPLIANCE_REGION_CONFIG_UNKNOWN, constructWranglerConfig, getCIMatchTag, formatConfigSnippet, DEFAULT_COMPAT_DATE, writeOutput, getBindings, hasDurableObjectExports, parseNonHyphenedUuid, getWorkersCIBranchName, getCIOverrideName, getBindingTypeFriendlyName } from '@cloudflare/workers-utils';
17
15
  import { Response, FormData } from 'undici';
18
16
  import chalk6 from 'chalk';
19
17
  import PQueue from 'p-queue';
@@ -25,9 +23,11 @@ import { Blob } from 'node:buffer';
25
23
  import { gzipSync } from 'node:zlib';
26
24
  import { brandColor, white, gray, bold, yellow, dim, red, blue } from '@cloudflare/cli-shared-helpers/colors';
27
25
  import { isDeepStrictEqual } from 'node:util';
26
+ import { setTimeout as setTimeout$1 } from 'node:timers/promises';
28
27
  import readline from 'node:readline';
29
28
  import { parse as parse$1 } from 'dotenv';
30
29
  import { getFreshSourceMapSupport, getNodeCompat } from 'miniflare';
30
+ import { execSync } from 'node:child_process';
31
31
  import { createHash } from 'node:crypto';
32
32
 
33
33
  // ../../node_modules/.pnpm/ignore@5.3.1/node_modules/ignore/index.js
@@ -257,17 +257,17 @@ var require_ignore = __commonJS({
257
257
  var throwError = /* @__PURE__ */ __name((message, Ctor) => {
258
258
  throw new Ctor(message);
259
259
  }, "throwError");
260
- var checkPath = /* @__PURE__ */ __name((path9, originalPath, doThrow) => {
261
- if (!isString(path9)) {
260
+ var checkPath = /* @__PURE__ */ __name((path10, originalPath, doThrow) => {
261
+ if (!isString(path10)) {
262
262
  return doThrow(
263
263
  `path must be a string, but got \`${originalPath}\``,
264
264
  TypeError
265
265
  );
266
266
  }
267
- if (!path9) {
267
+ if (!path10) {
268
268
  return doThrow(`path must not be empty`, TypeError);
269
269
  }
270
- if (checkPath.isNotRelative(path9)) {
270
+ if (checkPath.isNotRelative(path10)) {
271
271
  const r = "`path.relative()`d";
272
272
  return doThrow(
273
273
  `path should be a ${r} string, but got "${originalPath}"`,
@@ -276,7 +276,7 @@ var require_ignore = __commonJS({
276
276
  }
277
277
  return true;
278
278
  }, "checkPath");
279
- var isNotRelative = /* @__PURE__ */ __name((path9) => REGEX_TEST_INVALID_PATH.test(path9), "isNotRelative");
279
+ var isNotRelative = /* @__PURE__ */ __name((path10) => REGEX_TEST_INVALID_PATH.test(path10), "isNotRelative");
280
280
  checkPath.isNotRelative = isNotRelative;
281
281
  checkPath.convert = (p) => p;
282
282
  var Ignore = class {
@@ -338,7 +338,7 @@ var require_ignore = __commonJS({
338
338
  // setting `checkUnignored` to `false` could reduce additional
339
339
  // path matching.
340
340
  // @returns {TestResult} true if a file is ignored
341
- _testOne(path9, checkUnignored) {
341
+ _testOne(path10, checkUnignored) {
342
342
  let ignored = false;
343
343
  let unignored = false;
344
344
  this._rules.forEach((rule) => {
@@ -346,7 +346,7 @@ var require_ignore = __commonJS({
346
346
  if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
347
347
  return;
348
348
  }
349
- const matched = rule.regex.test(path9);
349
+ const matched = rule.regex.test(path10);
350
350
  if (matched) {
351
351
  ignored = !negative;
352
352
  unignored = negative;
@@ -359,24 +359,24 @@ var require_ignore = __commonJS({
359
359
  }
360
360
  // @returns {TestResult}
361
361
  _test(originalPath, cache, checkUnignored, slices) {
362
- const path9 = originalPath && checkPath.convert(originalPath);
362
+ const path10 = originalPath && checkPath.convert(originalPath);
363
363
  checkPath(
364
- path9,
364
+ path10,
365
365
  originalPath,
366
366
  this._allowRelativePaths ? RETURN_FALSE : throwError
367
367
  );
368
- return this._t(path9, cache, checkUnignored, slices);
368
+ return this._t(path10, cache, checkUnignored, slices);
369
369
  }
370
- _t(path9, cache, checkUnignored, slices) {
371
- if (path9 in cache) {
372
- return cache[path9];
370
+ _t(path10, cache, checkUnignored, slices) {
371
+ if (path10 in cache) {
372
+ return cache[path10];
373
373
  }
374
374
  if (!slices) {
375
- slices = path9.split(SLASH);
375
+ slices = path10.split(SLASH);
376
376
  }
377
377
  slices.pop();
378
378
  if (!slices.length) {
379
- return cache[path9] = this._testOne(path9, checkUnignored);
379
+ return cache[path10] = this._testOne(path10, checkUnignored);
380
380
  }
381
381
  const parent = this._t(
382
382
  slices.join(SLASH) + SLASH,
@@ -384,24 +384,24 @@ var require_ignore = __commonJS({
384
384
  checkUnignored,
385
385
  slices
386
386
  );
387
- return cache[path9] = parent.ignored ? parent : this._testOne(path9, checkUnignored);
387
+ return cache[path10] = parent.ignored ? parent : this._testOne(path10, checkUnignored);
388
388
  }
389
- ignores(path9) {
390
- return this._test(path9, this._ignoreCache, false).ignored;
389
+ ignores(path10) {
390
+ return this._test(path10, this._ignoreCache, false).ignored;
391
391
  }
392
392
  createFilter() {
393
- return (path9) => !this.ignores(path9);
393
+ return (path10) => !this.ignores(path10);
394
394
  }
395
395
  filter(paths) {
396
396
  return makeArray(paths).filter(this.createFilter());
397
397
  }
398
398
  // @returns {TestResult}
399
- test(path9) {
400
- return this._test(path9, this._testCache, true);
399
+ test(path10) {
400
+ return this._test(path10, this._testCache, true);
401
401
  }
402
402
  };
403
403
  var factory = /* @__PURE__ */ __name((options) => new Ignore(options), "factory");
404
- var isPathValid = /* @__PURE__ */ __name((path9) => checkPath(path9 && checkPath.convert(path9), path9, RETURN_FALSE), "isPathValid");
404
+ var isPathValid = /* @__PURE__ */ __name((path10) => checkPath(path10 && checkPath.convert(path10), path10, RETURN_FALSE), "isPathValid");
405
405
  factory.isPathValid = isPathValid;
406
406
  factory.default = factory;
407
407
  module.exports = factory;
@@ -412,7 +412,7 @@ var require_ignore = __commonJS({
412
412
  const makePosix = /* @__PURE__ */ __name((str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/"), "makePosix");
413
413
  checkPath.convert = makePosix;
414
414
  const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
415
- checkPath.isNotRelative = (path9) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path9) || isNotRelative(path9);
415
+ checkPath.isNotRelative = (path10) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path10) || isNotRelative(path10);
416
416
  }
417
417
  }
418
418
  });
@@ -704,10 +704,10 @@ var require_heap2 = __commonJS({
704
704
  var require_difflib = __commonJS({
705
705
  "../../node_modules/.pnpm/@ewoudenberg+difflib@0.1.0/node_modules/@ewoudenberg/difflib/lib/difflib.js"(exports$1) {
706
706
  (function() {
707
- var Differ, Heap, IS_CHARACTER_JUNK, IS_LINE_JUNK, SequenceMatcher, _any2, _arrayCmp, _calculateRatio, _countLeading, _formatRangeContext, _formatRangeUnified, _has, assert11, contextDiff, floor, getCloseMatches, max, min, ndiff, restore, unifiedDiff, indexOf = [].indexOf;
707
+ var Differ, Heap, IS_CHARACTER_JUNK, IS_LINE_JUNK, SequenceMatcher, _any2, _arrayCmp, _calculateRatio, _countLeading, _formatRangeContext, _formatRangeUnified, _has, assert12, contextDiff, floor, getCloseMatches, max, min, ndiff, restore, unifiedDiff, indexOf = [].indexOf;
708
708
  ({ floor, max, min } = Math);
709
709
  Heap = require_heap2();
710
- assert11 = __require("assert");
710
+ assert12 = __require("assert");
711
711
  _calculateRatio = /* @__PURE__ */ __name(function(matches, length) {
712
712
  if (length) {
713
713
  return 2 * matches / length;
@@ -1278,7 +1278,7 @@ var require_difflib = __commonJS({
1278
1278
  }
1279
1279
  _plainReplace(a, alo, ahi, b, blo, bhi) {
1280
1280
  var first, g, l, len, len1, line, lines, m, ref, second;
1281
- assert11(alo < ahi && blo < bhi);
1281
+ assert12(alo < ahi && blo < bhi);
1282
1282
  if (bhi - blo < ahi - alo) {
1283
1283
  first = this._dump("+", b, blo, bhi);
1284
1284
  second = this._dump("-", a, alo, ahi);
@@ -2746,296 +2746,6 @@ var require_lib = __commonJS({
2746
2746
  }
2747
2747
  });
2748
2748
 
2749
- // ../containers-shared/src/client/models/ApplicationRollout.ts
2750
- var ApplicationRollout;
2751
- ((ApplicationRollout2) => {
2752
- ((kind2) => {
2753
- kind2["FULL_AUTO"] = "full_auto";
2754
- kind2["FULL_MANUAL"] = "full_manual";
2755
- kind2["DURABLE_OBJECTS_AUTO"] = "durable_objects_auto";
2756
- })(ApplicationRollout2.kind || (ApplicationRollout2.kind = {}));
2757
- ((strategy2) => {
2758
- strategy2["ROLLING"] = "rolling";
2759
- })(ApplicationRollout2.strategy || (ApplicationRollout2.strategy = {}));
2760
- ((status2) => {
2761
- status2["PENDING"] = "pending";
2762
- status2["PROGRESSING"] = "progressing";
2763
- status2["COMPLETED"] = "completed";
2764
- status2["REVERTED"] = "reverted";
2765
- status2["REPLACED"] = "replaced";
2766
- })(ApplicationRollout2.status || (ApplicationRollout2.status = {}));
2767
- })(ApplicationRollout || (ApplicationRollout = {}));
2768
-
2769
- // ../containers-shared/src/client/models/BadRequestWithCodeError.ts
2770
- var BadRequestWithCodeError;
2771
- ((BadRequestWithCodeError2) => {
2772
- ((error52) => {
2773
- error52["VALIDATE_INPUT"] = "VALIDATE_INPUT";
2774
- })(BadRequestWithCodeError2.error || (BadRequestWithCodeError2.error = {}));
2775
- })(BadRequestWithCodeError || (BadRequestWithCodeError = {}));
2776
-
2777
- // ../containers-shared/src/client/models/CreateApplicationRolloutRequest.ts
2778
- var CreateApplicationRolloutRequest;
2779
- ((CreateApplicationRolloutRequest2) => {
2780
- ((strategy2) => {
2781
- strategy2["ROLLING"] = "rolling";
2782
- })(CreateApplicationRolloutRequest2.strategy || (CreateApplicationRolloutRequest2.strategy = {}));
2783
- ((step_percentage2) => {
2784
- step_percentage2[step_percentage2["_5"] = 5] = "_5";
2785
- step_percentage2[step_percentage2["_10"] = 10] = "_10";
2786
- step_percentage2[step_percentage2["_20"] = 20] = "_20";
2787
- step_percentage2[step_percentage2["_25"] = 25] = "_25";
2788
- step_percentage2[step_percentage2["_50"] = 50] = "_50";
2789
- step_percentage2[step_percentage2["_100"] = 100] = "_100";
2790
- })(CreateApplicationRolloutRequest2.step_percentage || (CreateApplicationRolloutRequest2.step_percentage = {}));
2791
- ((kind2) => {
2792
- kind2["FULL_AUTO"] = "full_auto";
2793
- kind2["FULL_MANUAL"] = "full_manual";
2794
- })(CreateApplicationRolloutRequest2.kind || (CreateApplicationRolloutRequest2.kind = {}));
2795
- })(CreateApplicationRolloutRequest || (CreateApplicationRolloutRequest = {}));
2796
-
2797
- // ../containers-shared/src/client/models/DeploymentNotFoundError.ts
2798
- var DeploymentNotFoundError;
2799
- ((DeploymentNotFoundError2) => {
2800
- ((error52) => {
2801
- error52["DEPLOYMENT_NOT_FOUND"] = "DEPLOYMENT_NOT_FOUND";
2802
- })(DeploymentNotFoundError2.error || (DeploymentNotFoundError2.error = {}));
2803
- })(DeploymentNotFoundError || (DeploymentNotFoundError = {}));
2804
-
2805
- // ../containers-shared/src/client/models/ImageRegistryAlreadyExistsError.ts
2806
- var ImageRegistryAlreadyExistsError;
2807
- ((ImageRegistryAlreadyExistsError2) => {
2808
- ((error52) => {
2809
- error52["IMAGE_REGISTRY_ALREADY_EXISTS"] = "IMAGE_REGISTRY_ALREADY_EXISTS";
2810
- })(ImageRegistryAlreadyExistsError2.error || (ImageRegistryAlreadyExistsError2.error = {}));
2811
- })(ImageRegistryAlreadyExistsError || (ImageRegistryAlreadyExistsError = {}));
2812
-
2813
- // ../containers-shared/src/client/models/ImageRegistryIsPublic.ts
2814
- var ImageRegistryIsPublic;
2815
- ((ImageRegistryIsPublic2) => {
2816
- ((error52) => {
2817
- error52["IMAGE_REGISTRY_IS_PUBLIC"] = "IMAGE_REGISTRY_IS_PUBLIC";
2818
- })(ImageRegistryIsPublic2.error || (ImageRegistryIsPublic2.error = {}));
2819
- })(ImageRegistryIsPublic || (ImageRegistryIsPublic = {}));
2820
-
2821
- // ../containers-shared/src/client/models/ImageRegistryNotAllowedError.ts
2822
- var ImageRegistryNotAllowedError;
2823
- ((ImageRegistryNotAllowedError2) => {
2824
- ((error52) => {
2825
- error52["IMAGE_REGISTRY_NOT_ALLOWED"] = "IMAGE_REGISTRY_NOT_ALLOWED";
2826
- })(ImageRegistryNotAllowedError2.error || (ImageRegistryNotAllowedError2.error = {}));
2827
- })(ImageRegistryNotAllowedError || (ImageRegistryNotAllowedError = {}));
2828
-
2829
- // ../containers-shared/src/client/models/ImageRegistryNotFoundError.ts
2830
- var ImageRegistryNotFoundError;
2831
- ((ImageRegistryNotFoundError2) => {
2832
- ((error52) => {
2833
- error52["IMAGE_REGISTRY_NOT_FOUND"] = "IMAGE_REGISTRY_NOT_FOUND";
2834
- })(ImageRegistryNotFoundError2.error || (ImageRegistryNotFoundError2.error = {}));
2835
- })(ImageRegistryNotFoundError || (ImageRegistryNotFoundError = {}));
2836
-
2837
- // ../containers-shared/src/client/models/ImageRegistryProtocolAlreadyExists.ts
2838
- var ImageRegistryProtocolAlreadyExists;
2839
- ((ImageRegistryProtocolAlreadyExists2) => {
2840
- ((error52) => {
2841
- error52["IMAGE_REGISTRY_PROTOCOL_ALREADY_EXISTS"] = "IMAGE_REGISTRY_PROTOCOL_ALREADY_EXISTS";
2842
- })(ImageRegistryProtocolAlreadyExists2.error || (ImageRegistryProtocolAlreadyExists2.error = {}));
2843
- })(ImageRegistryProtocolAlreadyExists || (ImageRegistryProtocolAlreadyExists = {}));
2844
-
2845
- // ../containers-shared/src/client/models/ImageRegistryProtocolIsReferencedError.ts
2846
- var ImageRegistryProtocolIsReferencedError;
2847
- ((ImageRegistryProtocolIsReferencedError2) => {
2848
- ((error52) => {
2849
- error52["IMAGE_REGISTRY_PROTO_IS_REFERENCED"] = "IMAGE_REGISTRY_PROTO_IS_REFERENCED";
2850
- })(ImageRegistryProtocolIsReferencedError2.error || (ImageRegistryProtocolIsReferencedError2.error = {}));
2851
- })(ImageRegistryProtocolIsReferencedError || (ImageRegistryProtocolIsReferencedError = {}));
2852
-
2853
- // ../containers-shared/src/client/models/ImageRegistryProtocolNotFound.ts
2854
- var ImageRegistryProtocolNotFound;
2855
- ((ImageRegistryProtocolNotFound2) => {
2856
- ((error52) => {
2857
- error52["IMAGE_REGISTRY_PROTOCOL_NOT_FOUND"] = "IMAGE_REGISTRY_PROTOCOL_NOT_FOUND";
2858
- })(ImageRegistryProtocolNotFound2.error || (ImageRegistryProtocolNotFound2.error = {}));
2859
- })(ImageRegistryProtocolNotFound || (ImageRegistryProtocolNotFound = {}));
2860
-
2861
- // ../containers-shared/src/client/models/ProvisionerConfiguration.ts
2862
- var ProvisionerConfiguration;
2863
- ((ProvisionerConfiguration2) => {
2864
- ((type2) => {
2865
- type2["NONE"] = "none";
2866
- type2["CLOUDINIT"] = "cloudinit";
2867
- })(ProvisionerConfiguration2.type || (ProvisionerConfiguration2.type = {}));
2868
- })(ProvisionerConfiguration || (ProvisionerConfiguration = {}));
2869
-
2870
- // ../containers-shared/src/client/models/RolloutStep.ts
2871
- var RolloutStep;
2872
- ((RolloutStep2) => {
2873
- ((status2) => {
2874
- status2["PENDING"] = "pending";
2875
- status2["PROGRESSING"] = "progressing";
2876
- status2["REVERTING"] = "reverting";
2877
- status2["COMPLETED"] = "completed";
2878
- status2["REVERTED"] = "reverted";
2879
- })(RolloutStep2.status || (RolloutStep2.status = {}));
2880
- })(RolloutStep || (RolloutStep = {}));
2881
-
2882
- // ../containers-shared/src/client/models/SecretNameAlreadyExists.ts
2883
- var SecretNameAlreadyExists;
2884
- ((SecretNameAlreadyExists2) => {
2885
- ((error52) => {
2886
- error52["SECRET_NAME_ALREADY_EXISTS"] = "SECRET_NAME_ALREADY_EXISTS";
2887
- })(SecretNameAlreadyExists2.error || (SecretNameAlreadyExists2.error = {}));
2888
- })(SecretNameAlreadyExists || (SecretNameAlreadyExists = {}));
2889
-
2890
- // ../containers-shared/src/client/models/SecretNotFound.ts
2891
- var SecretNotFound;
2892
- ((SecretNotFound2) => {
2893
- ((error52) => {
2894
- error52["SECRET_NAME_NOT_FOUND"] = "SECRET_NAME_NOT_FOUND";
2895
- })(SecretNotFound2.error || (SecretNotFound2.error = {}));
2896
- })(SecretNotFound || (SecretNotFound = {}));
2897
-
2898
- // ../containers-shared/src/client/models/SSHPublicKeyNotFoundError.ts
2899
- var SSHPublicKeyNotFoundError;
2900
- ((SSHPublicKeyNotFoundError2) => {
2901
- ((error52) => {
2902
- error52["SSH_PUBLIC_KEY_NOT_FOUND"] = "SSH_PUBLIC_KEY_NOT_FOUND";
2903
- })(SSHPublicKeyNotFoundError2.error || (SSHPublicKeyNotFoundError2.error = {}));
2904
- })(SSHPublicKeyNotFoundError || (SSHPublicKeyNotFoundError = {}));
2905
-
2906
- // ../containers-shared/src/client/models/UpdateApplicationRolloutRequest.ts
2907
- var UpdateApplicationRolloutRequest;
2908
- ((UpdateApplicationRolloutRequest2) => {
2909
- ((action2) => {
2910
- action2["NEXT"] = "next";
2911
- action2["PREVIOUS"] = "previous";
2912
- action2["REVERT"] = "revert";
2913
- })(UpdateApplicationRolloutRequest2.action || (UpdateApplicationRolloutRequest2.action = {}));
2914
- })(UpdateApplicationRolloutRequest || (UpdateApplicationRolloutRequest = {}));
2915
-
2916
- // ../containers-shared/src/utils.ts
2917
- var runDockerCmd = /* @__PURE__ */ __name((dockerPath, args, stdio) => {
2918
- let aborted2 = false;
2919
- let resolve2;
2920
- let reject;
2921
- const ready = new Promise((res, rej) => {
2922
- resolve2 = res;
2923
- reject = rej;
2924
- });
2925
- const child = spawn(dockerPath, args, {
2926
- stdio: stdio ?? "inherit",
2927
- // We need to set detached to true so that the child process
2928
- // will control all of its child processes and we can kill
2929
- // all of them in case we need to abort the build process.
2930
- // On Windows, detached: true opens a new console window per child
2931
- // process, so we only set it on non-Windows platforms.
2932
- detached: process.platform !== "win32",
2933
- // Prevent child processes from opening visible console windows on Windows.
2934
- // This is a no-op on non-Windows platforms.
2935
- windowsHide: true
2936
- });
2937
- let errorHandled = false;
2938
- child.on("close", (code) => {
2939
- if (code === 0 || aborted2) {
2940
- resolve2({ aborted: aborted2 });
2941
- } else if (!errorHandled) {
2942
- errorHandled = true;
2943
- reject(
2944
- new UserError$1(`Docker command exited with code: ${code}`, {
2945
- telemetryMessage: false
2946
- })
2947
- );
2948
- }
2949
- });
2950
- child.on("error", (err) => {
2951
- if (!errorHandled) {
2952
- errorHandled = true;
2953
- reject(
2954
- new UserError$1(`Docker command failed: ${err.message}`, {
2955
- telemetryMessage: false
2956
- })
2957
- );
2958
- }
2959
- });
2960
- return {
2961
- abort: /* @__PURE__ */ __name(() => {
2962
- aborted2 = true;
2963
- child.unref();
2964
- if (child.pid !== void 0) {
2965
- if (process.platform === "win32") {
2966
- child.kill();
2967
- } else {
2968
- process.kill(-child.pid);
2969
- }
2970
- }
2971
- }, "abort"),
2972
- ready,
2973
- then: /* @__PURE__ */ __name(async (onResolve, onReject) => ready.then(onResolve).catch(onReject), "then")
2974
- };
2975
- }, "runDockerCmd");
2976
- var isDockerRunning = /* @__PURE__ */ __name(async (dockerPath) => {
2977
- try {
2978
- await runDockerCmd(dockerPath, ["info"], ["inherit", "pipe", "pipe"]);
2979
- } catch {
2980
- return false;
2981
- }
2982
- return true;
2983
- }, "isDockerRunning");
2984
- var verifyDockerInstalled = /* @__PURE__ */ __name(async ({
2985
- dockerPath,
2986
- operation,
2987
- imageNoun,
2988
- hint
2989
- }) => {
2990
- const dockerIsRunning = await isDockerRunning(dockerPath);
2991
- if (!dockerIsRunning) {
2992
- throw new UserError$1(
2993
- getFailedToRunDockerErrorMessage({
2994
- operation,
2995
- imageNoun,
2996
- hint
2997
- }),
2998
- {
2999
- telemetryMessage: false
3000
- }
3001
- );
3002
- }
3003
- }, "verifyDockerInstalled");
3004
- function getFailedToRunDockerErrorMessage({
3005
- operation,
3006
- imageNoun,
3007
- hint
3008
- }) {
3009
- const beforeOperation = operation ? ` before ${operation}` : "";
3010
- const headline = `The Docker CLI is needed to build ${imageNoun}${beforeOperation} but could not be launched.`;
3011
- let daemonHint;
3012
- if (process.platform === "darwin") {
3013
- daemonHint = "open the Docker Desktop app or run `open -a Docker`";
3014
- } else if (process.platform === "win32") {
3015
- daemonHint = "open the Docker Desktop app";
3016
- } else {
3017
- daemonHint = "run `sudo systemctl start docker`";
3018
- }
3019
- const steps = `To fix this, try the following:
3020
- - If Docker is not installed, download it from https://docs.docker.com/get-started/get-docker/
3021
- - If Docker is installed but the daemon is not running,
3022
- ${daemonHint}.
3023
- - If you use an alternative Docker-compatible CLI (e.g. Podman),
3024
- set the WRANGLER_DOCKER_BIN environment variable to its path and DOCKER_HOST to its socket.`;
3025
- const alternatives = "Note: Other container tooling that is compatible with the Docker CLI and engine may work, but is not yet guaranteed to do so.";
3026
- let message = `${headline}
3027
- ${steps}
3028
-
3029
- ${alternatives}`;
3030
- if (hint) {
3031
- message += `
3032
-
3033
- ${hint}`;
3034
- }
3035
- return message;
3036
- }
3037
- __name(getFailedToRunDockerErrorMessage, "getFailedToRunDockerErrorMessage");
3038
-
3039
2749
  // src/deploy/helpers/error-codes.ts
3040
2750
  var INVALID_INHERIT_BINDING_CODE = 10057;
3041
2751
  var EXPORTS_RECONCILIATION_ERROR_CODE = 100402;
@@ -3263,14 +2973,14 @@ async function resolveOwnerWorkerTag(config2, accountId, scriptName) {
3263
2973
  }
3264
2974
  }
3265
2975
  __name(resolveOwnerWorkerTag, "resolveOwnerWorkerTag");
3266
- async function fetchEmailRoutingPlan(config2, accountId, request2) {
2976
+ async function fetchEmailRoutingPlan(config2, accountId, request) {
3267
2977
  const deadline = Date.now() + PLAN_RETRY_TIMEOUT_MS;
3268
2978
  for (; ; ) {
3269
2979
  try {
3270
2980
  return await fetchResult(
3271
2981
  config2,
3272
2982
  `/accounts/${accountId}/email/routing/rules/plan`,
3273
- postJson(request2)
2983
+ postJson(request)
3274
2984
  );
3275
2985
  } catch (e) {
3276
2986
  const isWorkerNotFound = e instanceof APIError && e.code === PLAN_RETRY_WORKER_NOT_FOUND_CODE;
@@ -3288,8 +2998,8 @@ async function fetchEmailRoutingPlan(config2, accountId, request2) {
3288
2998
  }
3289
2999
  }
3290
3000
  __name(fetchEmailRoutingPlan, "fetchEmailRoutingPlan");
3291
- function putJson(config2, path9, body) {
3292
- return fetchResult(config2, path9, {
3001
+ function putJson(config2, path10, body) {
3002
+ return fetchResult(config2, path10, {
3293
3003
  method: "PUT",
3294
3004
  headers: { "Content-Type": "application/json" },
3295
3005
  body: JSON.stringify(body)
@@ -3358,12 +3068,12 @@ async function applyEmailRoutingAddresses({
3358
3068
  return;
3359
3069
  }
3360
3070
  const ownerWorkerTag = workerTag ?? await resolveOwnerWorkerTag(config2, accountId, scriptName);
3361
- const request2 = buildEmailRoutingPlanRequest(
3071
+ const request = buildEmailRoutingPlanRequest(
3362
3072
  addresses,
3363
3073
  scriptName,
3364
3074
  ownerWorkerTag
3365
3075
  );
3366
- const plan = await fetchEmailRoutingPlan(config2, accountId, request2);
3076
+ const plan = await fetchEmailRoutingPlan(config2, accountId, request);
3367
3077
  if (!planHasChanges(plan)) {
3368
3078
  logger.log("Email Routing rules are up to date.");
3369
3079
  return;
@@ -3527,7 +3237,9 @@ function renderRoute(route) {
3527
3237
  if (isCustomDomain) {
3528
3238
  const flags = [];
3529
3239
  if ("enabled" in route && route.enabled !== void 0) {
3530
- flags.push(route.enabled ? "enabled" : "disabled");
3240
+ flags.push(
3241
+ route.enabled ? "production: enabled" : "production: disabled"
3242
+ );
3531
3243
  }
3532
3244
  if ("previews_enabled" in route && route.previews_enabled !== void 0) {
3533
3245
  flags.push(
@@ -3667,7 +3379,7 @@ async function publishRoutesFallback(complianceConfig, routes, { scriptName, acc
3667
3379
  return deployedRoutes;
3668
3380
  }
3669
3381
  __name(publishRoutesFallback, "publishRoutesFallback");
3670
- async function publishCustomDomains(complianceConfig, workerUrl, accountId, domains) {
3382
+ async function publishCustomDomains(complianceConfig, workerUrl, accountId, scriptName, domains) {
3671
3383
  const options = {
3672
3384
  override_scope: true,
3673
3385
  override_existing_origin: false,
@@ -3682,9 +3394,53 @@ async function publishCustomDomains(complianceConfig, workerUrl, accountId, doma
3682
3394
  previews_enabled: "previews_enabled" in domainRoute ? domainRoute.previews_enabled : void 0
3683
3395
  };
3684
3396
  });
3397
+ let changeset;
3398
+ try {
3399
+ changeset = await fetchResult(
3400
+ complianceConfig,
3401
+ `${workerUrl}/domains/changeset?replace_state=true`,
3402
+ {
3403
+ method: "POST",
3404
+ body: JSON.stringify(origins),
3405
+ headers: {
3406
+ "Content-Type": "application/json"
3407
+ }
3408
+ }
3409
+ );
3410
+ } catch (error51) {
3411
+ if (process.stdout.isTTY) {
3412
+ throw error51;
3413
+ }
3414
+ changeset = { added: [], removed: [], updated: [], conflicting: [] };
3415
+ }
3416
+ const updatesRequired = changeset.updated.filter((domain2) => domain2.modified);
3417
+ const previewUpdates = updatesRequired.filter(
3418
+ (domain2) => domain2.previews_enabled === true
3419
+ );
3420
+ const fetchExistingDomain = /* @__PURE__ */ __name((domain2) => fetchResult(
3421
+ complianceConfig,
3422
+ `/accounts/${accountId}/workers/domains/records/${domain2.id}`
3423
+ ), "fetchExistingDomain");
3424
+ let existing;
3425
+ if (process.stdout.isTTY) {
3426
+ existing = await Promise.all(updatesRequired.map(fetchExistingDomain));
3427
+ } else {
3428
+ const results = await Promise.allSettled(
3429
+ previewUpdates.map(fetchExistingDomain)
3430
+ );
3431
+ existing = results.flatMap(
3432
+ (result) => result.status === "fulfilled" ? [result.value] : []
3433
+ );
3434
+ }
3435
+ const existingById = new Map(existing.map((domain2) => [domain2.id, domain2]));
3436
+ const changed = changeset.added.some((domain2) => domain2.previews_enabled === true) || previewUpdates.some((domain2) => {
3437
+ const existingDomain = existingById.get(domain2.id);
3438
+ return existingDomain !== void 0 && (existingDomain.service !== scriptName || existingDomain.previews_enabled !== true);
3439
+ });
3685
3440
  const fail = /* @__PURE__ */ __name(() => {
3686
3441
  return {
3687
3442
  targets: [],
3443
+ changed,
3688
3444
  error: new UserError(
3689
3445
  domains.length > 1 ? `Publishing to ${domains.length} Custom Domains was skipped, fix conflicts and try again` : `Publishing to Custom Domain "${domains[0].pattern}" was skipped, fix conflict and try again`,
3690
3446
  { telemetryMessage: "deploy custom domains skipped" }
@@ -3695,37 +3451,20 @@ async function publishCustomDomains(complianceConfig, workerUrl, accountId, doma
3695
3451
  options.override_existing_origin = true;
3696
3452
  options.override_existing_dns_record = true;
3697
3453
  } else {
3698
- const changeset = await fetchResult(
3699
- complianceConfig,
3700
- `${workerUrl}/domains/changeset?replace_state=true`,
3701
- {
3702
- method: "POST",
3703
- body: JSON.stringify(origins),
3704
- headers: {
3705
- "Content-Type": "application/json"
3706
- }
3707
- }
3708
- );
3709
- const updatesRequired = changeset.updated.filter(
3710
- (domain2) => domain2.modified
3711
- );
3712
3454
  if (updatesRequired.length > 0) {
3713
- const existing = await Promise.all(
3714
- updatesRequired.map(
3715
- (domain2) => fetchResult(
3716
- complianceConfig,
3717
- `/accounts/${accountId}/workers/domains/records/${domain2.id}`
3718
- )
3719
- )
3455
+ const existingForOtherWorkers = existing.filter(
3456
+ (domain2) => domain2.service !== scriptName
3720
3457
  );
3721
- const existingRendered = existing.map(
3722
- (domain2) => ` \u2022 ${domain2.hostname} (used as a domain for "${domain2.service}")`
3723
- ).join("\n");
3724
- const message = `Custom Domains already exist for these domains:
3458
+ if (existingForOtherWorkers.length > 0) {
3459
+ const existingRendered = existingForOtherWorkers.map(
3460
+ (domain2) => ` \u2022 ${domain2.hostname} (used as a domain for "${domain2.service}")`
3461
+ ).join("\n");
3462
+ const message = `Custom Domains already exist for these domains:
3725
3463
  ${existingRendered}
3726
3464
  Update them to point to this script instead?`;
3727
- if (!await confirm(message)) {
3728
- return fail();
3465
+ if (!await confirm(message)) {
3466
+ return fail();
3467
+ }
3729
3468
  }
3730
3469
  options.override_existing_origin = true;
3731
3470
  }
@@ -3747,7 +3486,7 @@ Update them to point to this script instead?`;
3747
3486
  "Content-Type": "application/json"
3748
3487
  }
3749
3488
  });
3750
- return { targets: domains.map((domain2) => renderRoute(domain2)) };
3489
+ return { targets: domains.map((domain2) => renderRoute(domain2)), changed };
3751
3490
  }
3752
3491
  __name(publishCustomDomains, "publishCustomDomains");
3753
3492
  async function listQueues(complianceConfig, accountId, page, name) {
@@ -4217,6 +3956,7 @@ async function registerSubdomain(complianceConfig, accountId, configPath, regist
4217
3956
  __name(registerSubdomain, "registerSubdomain");
4218
3957
 
4219
3958
  // src/triggers/deploy.ts
3959
+ var PREVIEW_DOMAIN_PROVISIONING_NOTE = "Note: DNS and TLS certificate provisioning for Preview domains may continue after this deploy. If a new Preview URL does not work immediately, wait a few minutes and retry.";
4220
3960
  async function triggersDeploy(props) {
4221
3961
  const { config: config2, scriptName, routes, crons } = props;
4222
3962
  if (props.validated !== true) {
@@ -4227,7 +3967,7 @@ async function triggersDeploy(props) {
4227
3967
  return;
4228
3968
  }
4229
3969
  const { accountId } = props;
4230
- assert4(accountId);
3970
+ assert5(accountId);
4231
3971
  if (props.validated !== true) {
4232
3972
  await ensureQueuesExistByConfig(config2, accountId, true, scriptName);
4233
3973
  }
@@ -4348,6 +4088,7 @@ ${dashLink}`, {
4348
4088
  config2,
4349
4089
  workerUrl,
4350
4090
  accountId,
4091
+ scriptName,
4351
4092
  customDomainsOnly
4352
4093
  ).then(
4353
4094
  (result) => ({ ...result, category: "Custom domains" }),
@@ -4573,6 +4314,14 @@ ${dashLink}`, {
4573
4314
  } else {
4574
4315
  logger.log("No targets deployed for", workerName, formatTime(deployMs));
4575
4316
  }
4317
+ const customDomainDeployment = completedDeployments.find(
4318
+ (deployment) => deployment.category === "Custom domains"
4319
+ );
4320
+ if (customDomainsOnly.some(
4321
+ (domain2) => "previews_enabled" in domain2 && domain2.previews_enabled === true
4322
+ ) && customDomainDeployment !== void 0 && customDomainDeployment.changed === true && customDomainDeployment.error === void 0) {
4323
+ logger.log(PREVIEW_DOMAIN_PROVISIONING_NOTE);
4324
+ }
4576
4325
  const failedDeployments = completedDeployments.filter(
4577
4326
  (deployment) => deployment.error !== void 0
4578
4327
  );
@@ -6028,12 +5777,12 @@ var Mime = class {
6028
5777
  }
6029
5778
  return this;
6030
5779
  }
6031
- getType(path9) {
6032
- if (typeof path9 !== "string")
5780
+ getType(path10) {
5781
+ if (typeof path10 !== "string")
6033
5782
  return null;
6034
- const last = path9.replace(/^.*[/\\]/s, "").toLowerCase();
5783
+ const last = path10.replace(/^.*[/\\]/s, "").toLowerCase();
6035
5784
  const ext = last.replace(/^.*\./s, "").toLowerCase();
6036
- const hasPath = last.length < path9.length;
5785
+ const hasPath = last.length < path10.length;
6037
5786
  const hasDot = ext.length < last.length - 1;
6038
5787
  if (!hasDot && hasPath)
6039
5788
  return null;
@@ -6164,7 +5913,7 @@ var MAX_UPLOAD_ATTEMPTS = 5;
6164
5913
  var MAX_UPLOAD_GATEWAY_ERRORS = 5;
6165
5914
  var MAX_DIFF_LINES = 100;
6166
5915
  var syncAssets = /* @__PURE__ */ __name(async (complianceConfig, accountId, assetDirectory, scriptName, dispatchNamespace) => {
6167
- assert4(accountId, "Missing accountId");
5916
+ assert5(accountId, "Missing accountId");
6168
5917
  logger.info("\u{1F300} Building list of assets...");
6169
5918
  const manifest = await buildAssetManifest(assetDirectory);
6170
5919
  const url3 = dispatchNamespace ? `/accounts/${accountId}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}/assets-upload-session` : `/accounts/${accountId}/workers/scripts/${scriptName}/assets-upload-session`;
@@ -6914,6 +6663,344 @@ function deployWfpUserWorker(dispatchNamespace, versionId) {
6914
6663
  logger.log("Current Version ID:", versionId);
6915
6664
  }
6916
6665
  __name(deployWfpUserWorker, "deployWfpUserWorker");
6666
+ var IMAGE_PREPARATION_POLL_INTERVAL_MS = 2e3;
6667
+ var IMAGE_PREPARATION_TIMEOUT_MS = 15 * 6e4;
6668
+ function isRegistryImage(image) {
6669
+ return typeof image.image === "string";
6670
+ }
6671
+ __name(isRegistryImage, "isRegistryImage");
6672
+ function toCreateApplicationRequest({ name }, namespaceId) {
6673
+ return {
6674
+ name,
6675
+ scheduling_policy: SchedulingPolicy.DURABLE_OBJECT,
6676
+ durable_objects: { namespace_id: namespaceId }
6677
+ };
6678
+ }
6679
+ __name(toCreateApplicationRequest, "toCreateApplicationRequest");
6680
+ async function createDurableObjectContainerApplication(application, namespaceId) {
6681
+ await ApplicationsService.createApplication(
6682
+ toCreateApplicationRequest(application, namespaceId)
6683
+ );
6684
+ }
6685
+ __name(createDurableObjectContainerApplication, "createDurableObjectContainerApplication");
6686
+ function getContainerImageClasses(version2) {
6687
+ const binding = version2.resources.bindings.find(
6688
+ (candidate) => candidate.name === CONTAINER_IMAGES_BINDING
6689
+ );
6690
+ if (binding === void 0) {
6691
+ return void 0;
6692
+ }
6693
+ if (binding.type !== "json" || typeof binding.json !== "object" || binding.json === null || Array.isArray(binding.json)) {
6694
+ throw new UserError(
6695
+ `Worker Version ${version2.id} has invalid ${CONTAINER_IMAGES_BINDING} metadata.`,
6696
+ {
6697
+ telemetryMessage: "versions deploy invalid durable object container image binding"
6698
+ }
6699
+ );
6700
+ }
6701
+ return new Set(Object.keys(binding.json));
6702
+ }
6703
+ __name(getContainerImageClasses, "getContainerImageClasses");
6704
+ function getNamespaceId(version2, scriptName, className) {
6705
+ const binding = version2.resources.bindings.find(
6706
+ (candidate) => candidate.type === "durable_object_namespace" && candidate.class_name === className && (candidate.script_name === void 0 || candidate.script_name === scriptName)
6707
+ );
6708
+ return binding?.type === "durable_object_namespace" ? binding.namespace_id : void 0;
6709
+ }
6710
+ __name(getNamespaceId, "getNamespaceId");
6711
+ function getDurableObjectContainerApplicationsFromVersion(version2, scriptName) {
6712
+ const containerClasses = getContainerImageClasses(version2);
6713
+ if (containerClasses === void 0) {
6714
+ return [];
6715
+ }
6716
+ const containers = version2.resources.script_runtime.containers ?? [];
6717
+ return [...containerClasses].sort().map((className) => {
6718
+ const matchingContainers = containers.filter(
6719
+ (container2) => container2.class_name === className
6720
+ );
6721
+ const [container] = matchingContainers;
6722
+ if (matchingContainers.length !== 1 || container?.name === void 0) {
6723
+ throw new UserError(
6724
+ `Worker Version ${version2.id} has invalid Durable Object-managed Container metadata for class "${className}".`,
6725
+ {
6726
+ telemetryMessage: "versions deploy invalid durable object container metadata"
6727
+ }
6728
+ );
6729
+ }
6730
+ return {
6731
+ class_name: className,
6732
+ name: container.name,
6733
+ namespaceId: getNamespaceId(version2, scriptName, className)
6734
+ };
6735
+ });
6736
+ }
6737
+ __name(getDurableObjectContainerApplicationsFromVersion, "getDurableObjectContainerApplicationsFromVersion");
6738
+ function getVersionedDurableObjectContainerApplications(versions, scriptName) {
6739
+ const applicationsByVersion = versions.map(
6740
+ (version2) => getDurableObjectContainerApplicationsFromVersion(version2, scriptName)
6741
+ );
6742
+ const [firstApplications = []] = applicationsByVersion;
6743
+ const expectedDefinition = JSON.stringify(
6744
+ firstApplications.map(({ class_name, name }) => ({ class_name, name }))
6745
+ );
6746
+ for (let index = 1; index < applicationsByVersion.length; index++) {
6747
+ const applications = applicationsByVersion[index] ?? [];
6748
+ const definition = JSON.stringify(
6749
+ applications.map(({ class_name, name }) => ({ class_name, name }))
6750
+ );
6751
+ if (definition !== expectedDefinition) {
6752
+ throw new UserError(
6753
+ "All Worker Versions in a multi-version deployment must declare identical Durable Object-managed Container applications.",
6754
+ {
6755
+ telemetryMessage: "versions deploy inconsistent durable object container applications"
6756
+ }
6757
+ );
6758
+ }
6759
+ }
6760
+ return firstApplications.map((application, applicationIndex) => {
6761
+ const namespaceIds = new Set(
6762
+ applicationsByVersion.map((applications) => applications[applicationIndex]?.namespaceId).filter((namespaceId) => Boolean(namespaceId))
6763
+ );
6764
+ if (namespaceIds.size > 1) {
6765
+ throw new UserError(
6766
+ "All Worker Versions in a multi-version deployment must reference the same Durable Object namespaces for their Container applications.",
6767
+ {
6768
+ telemetryMessage: "versions deploy inconsistent durable object container namespaces"
6769
+ }
6770
+ );
6771
+ }
6772
+ return {
6773
+ ...application,
6774
+ namespaceId: namespaceIds.values().next().value
6775
+ };
6776
+ });
6777
+ }
6778
+ __name(getVersionedDurableObjectContainerApplications, "getVersionedDurableObjectContainerApplications");
6779
+ async function resolveVersionedDurableObjectContainerApplications(config2, {
6780
+ applications,
6781
+ accountId,
6782
+ scriptName,
6783
+ allowMissingNamespaces = false
6784
+ }) {
6785
+ if (applications.length === 0) {
6786
+ return [];
6787
+ }
6788
+ const namespaces = applications.some(
6789
+ (application) => application.namespaceId === void 0
6790
+ ) ? await listDurableObjects(config2, accountId) : [];
6791
+ return applications.map((application) => {
6792
+ const namespaceId = application.namespaceId ?? namespaces.find(
6793
+ (namespace) => namespace.class === application.class_name && namespace.script === scriptName && namespace.preview === void 0 && namespace.dispatch_namespace === void 0
6794
+ )?.id;
6795
+ if (namespaceId === void 0) {
6796
+ if (allowMissingNamespaces) {
6797
+ return application;
6798
+ }
6799
+ throw new UserError(
6800
+ `Could not deploy Durable Object-managed Container application "${application.name}" because class "${application.class_name}" has no namespace after the Worker Version was deployed.`,
6801
+ {
6802
+ telemetryMessage: "versions deploy durable object container namespace missing"
6803
+ }
6804
+ );
6805
+ }
6806
+ return { ...application, namespaceId };
6807
+ });
6808
+ }
6809
+ __name(resolveVersionedDurableObjectContainerApplications, "resolveVersionedDurableObjectContainerApplications");
6810
+ async function deployVersionedDurableObjectContainerApplications(config2, args) {
6811
+ if (args.applications.length === 0) {
6812
+ return;
6813
+ }
6814
+ const applications = await resolveVersionedDurableObjectContainerApplications(
6815
+ config2,
6816
+ args
6817
+ );
6818
+ for (const application of applications) {
6819
+ if (application.namespaceId !== void 0) {
6820
+ await createDurableObjectContainerApplication(
6821
+ application,
6822
+ application.namespaceId
6823
+ );
6824
+ }
6825
+ }
6826
+ }
6827
+ __name(deployVersionedDurableObjectContainerApplications, "deployVersionedDurableObjectContainerApplications");
6828
+ function buildTag(scriptName, className, imageName) {
6829
+ const repository = `${scriptName}-${className}-${imageName}`.toLowerCase().replace(/[^a-z0-9._-]+/g, "-").replace(/^-+|-+$/g, "");
6830
+ return `${repository}:wrangler-${Date.now().toString(36)}`;
6831
+ }
6832
+ __name(buildTag, "buildTag");
6833
+ async function buildOrResolveImage(config2, container, imageName, imageConfig, scriptName, dryRun, accountId) {
6834
+ if (isRegistryImage(imageConfig)) {
6835
+ if (dryRun) {
6836
+ return imageConfig.image;
6837
+ }
6838
+ assert5(accountId, "Expected accountId to resolve container image name");
6839
+ return resolveImageName(accountId, imageConfig.image, config2);
6840
+ }
6841
+ const baseDir = config2.configPath ? path__default.dirname(config2.configPath) : process.cwd();
6842
+ const dockerfile = path__default.resolve(baseDir, imageConfig.dockerfile);
6843
+ const tag = buildTag(scriptName, container.class_name, imageName);
6844
+ logger.log("Building image", tag);
6845
+ const imageRef = await buildAndMaybePush(
6846
+ {
6847
+ tag,
6848
+ pathToDockerfile: dockerfile,
6849
+ buildContext: path__default.dirname(dockerfile),
6850
+ platform: "linux/amd64"
6851
+ },
6852
+ getDockerPath(),
6853
+ !dryRun,
6854
+ void 0,
6855
+ true,
6856
+ config2
6857
+ );
6858
+ return "remoteDigest" in imageRef ? imageRef.remoteDigest : imageRef.newTag;
6859
+ }
6860
+ __name(buildOrResolveImage, "buildOrResolveImage");
6861
+ async function waitForImagePreparation(image) {
6862
+ const deadline = Date.now() + IMAGE_PREPARATION_TIMEOUT_MS;
6863
+ while (Date.now() < deadline) {
6864
+ const preparation = await ContainerImagePreparationsService.prepareContainerImage({ image });
6865
+ switch (preparation.status) {
6866
+ case ContainerImagePreparationStatus.READY:
6867
+ return;
6868
+ case ContainerImagePreparationStatus.ERROR:
6869
+ throw new UserError(
6870
+ preparation.reason ?? "Container image preparation failed",
6871
+ {
6872
+ telemetryMessage: "durable object container image preparation failed"
6873
+ }
6874
+ );
6875
+ case ContainerImagePreparationStatus.PENDING:
6876
+ await setTimeout$1(IMAGE_PREPARATION_POLL_INTERVAL_MS);
6877
+ break;
6878
+ default:
6879
+ throw new UserError(
6880
+ `Container image preparation returned an unsupported status: ${String(preparation.status)}`,
6881
+ {
6882
+ telemetryMessage: "durable object container image preparation unsupported status"
6883
+ }
6884
+ );
6885
+ }
6886
+ }
6887
+ throw new UserError(
6888
+ "Timed out while preparing the container image on Cloudflare's network.",
6889
+ {
6890
+ telemetryMessage: "durable object container image preparation timed out"
6891
+ }
6892
+ );
6893
+ }
6894
+ __name(waitForImagePreparation, "waitForImagePreparation");
6895
+ async function prepareDurableObjectContainerApplications(config2, {
6896
+ accountId,
6897
+ dryRun,
6898
+ scriptName,
6899
+ dispatchNamespace
6900
+ }) {
6901
+ validateDurableObjectContainerApplications(config2);
6902
+ if (!dryRun) {
6903
+ assert5(accountId, "Expected accountId to prepare container applications");
6904
+ const storageByClass = getDurableObjectClassNameToUseSQLiteMap(
6905
+ config2.migrations,
6906
+ config2.exports
6907
+ );
6908
+ const unknownStorage = getDurableObjectContainerApps(
6909
+ config2.containers
6910
+ ).filter(
6911
+ (container) => storageByClass.get(container.class_name) === void 0
6912
+ );
6913
+ if (unknownStorage.length > 0) {
6914
+ const namespaces = await listDurableObjects(config2, accountId);
6915
+ for (const container of unknownStorage) {
6916
+ if (namespaces.some(
6917
+ (namespace) => namespace.class === container.class_name && namespace.script === scriptName && namespace.preview === void 0 && namespace.dispatch_namespace === dispatchNamespace && namespace.use_sqlite === false
6918
+ )) {
6919
+ throw new UserError(
6920
+ `The container ${container.name} references Durable Object class ${container.class_name}, which uses the legacy KV storage backend. Durable Object-managed Containers require SQLite-backed Durable Objects.`,
6921
+ {
6922
+ telemetryMessage: "durable object container class uses legacy storage"
6923
+ }
6924
+ );
6925
+ }
6926
+ }
6927
+ }
6928
+ }
6929
+ const containers = getDurableObjectContainerApps(config2.containers).filter(
6930
+ (container) => Object.keys(container.images ?? {}).length > 0
6931
+ );
6932
+ if (containers.length === 0) {
6933
+ return {};
6934
+ }
6935
+ const imagesByClass = [];
6936
+ const preparedImages = /* @__PURE__ */ new Map();
6937
+ for (const container of containers) {
6938
+ const classImages = [];
6939
+ for (const [imageName, imageConfig] of Object.entries(
6940
+ container.images ?? {}
6941
+ )) {
6942
+ const source = isRegistryImage(imageConfig) ? `image:${imageConfig.image}` : `dockerfile:${path__default.resolve(
6943
+ config2.configPath ? path__default.dirname(config2.configPath) : process.cwd(),
6944
+ imageConfig.dockerfile
6945
+ )}`;
6946
+ let image = preparedImages.get(source);
6947
+ if (image === void 0) {
6948
+ image = await buildOrResolveImage(
6949
+ config2,
6950
+ container,
6951
+ imageName,
6952
+ imageConfig,
6953
+ scriptName,
6954
+ dryRun,
6955
+ accountId
6956
+ );
6957
+ if (!dryRun) {
6958
+ const imageLine = ` ${image}`;
6959
+ updateStatus(
6960
+ `Preparing ${imageName} for Cloudflare Containers
6961
+ ${imageLine}`
6962
+ );
6963
+ await waitForImagePreparation(image);
6964
+ updateStatus(`${imageName} is ready to run
6965
+ ${imageLine}`);
6966
+ }
6967
+ preparedImages.set(source, image);
6968
+ }
6969
+ classImages.push([imageName, image]);
6970
+ }
6971
+ imagesByClass.push([container.class_name, Object.fromEntries(classImages)]);
6972
+ }
6973
+ return Object.fromEntries(imagesByClass);
6974
+ }
6975
+ __name(prepareDurableObjectContainerApplications, "prepareDurableObjectContainerApplications");
6976
+ async function deployDurableObjectContainerApplications(config2, {
6977
+ versionId,
6978
+ accountId,
6979
+ scriptName,
6980
+ dispatchNamespace
6981
+ }) {
6982
+ const containers = getDurableObjectContainerApps(config2.containers);
6983
+ if (containers.length === 0) {
6984
+ return;
6985
+ }
6986
+ const resolveNamespaceId = createDurableObjectNamespaceResolver(config2, {
6987
+ versionId,
6988
+ accountId,
6989
+ scriptName,
6990
+ dispatchNamespace
6991
+ });
6992
+ const applications = [];
6993
+ for (const container of containers) {
6994
+ applications.push({
6995
+ container,
6996
+ namespaceId: await resolveNamespaceId(container.class_name)
6997
+ });
6998
+ }
6999
+ for (const { container, namespaceId } of applications) {
7000
+ await createDurableObjectContainerApplication(container, namespaceId);
7001
+ }
7002
+ }
7003
+ __name(deployDurableObjectContainerApplications, "deployDurableObjectContainerApplications");
6917
7004
  function hasDefinedEnvironments(config2) {
6918
7005
  return Boolean(config2.definedEnvironments?.length);
6919
7006
  }
@@ -6953,7 +7040,7 @@ function tagsAreEqual(a, b) {
6953
7040
  __name(tagsAreEqual, "tagsAreEqual");
6954
7041
  async function getMigrationsToUpload(scriptName, props) {
6955
7042
  const { config: config2, accountId } = props;
6956
- assert4(accountId, "Missing accountId");
7043
+ assert5(accountId, "Missing accountId");
6957
7044
  let migrations;
6958
7045
  if (config2.migrations.length > 0) {
6959
7046
  let script;
@@ -7560,7 +7647,7 @@ var R2Handler = class extends ProvisionResourceHandler {
7560
7647
  );
7561
7648
  }
7562
7649
  async isConnectedToExistingResource() {
7563
- assert4(typeof this.binding.bucket_name !== "symbol");
7650
+ assert5(typeof this.binding.bucket_name !== "symbol");
7564
7651
  if (!this.binding.bucket_name) {
7565
7652
  return false;
7566
7653
  }
@@ -7607,7 +7694,7 @@ var AISearchNamespaceHandler = class extends ProvisionResourceHandler {
7607
7694
  );
7608
7695
  }
7609
7696
  async isConnectedToExistingResource() {
7610
- assert4(typeof this.binding.namespace !== "symbol");
7697
+ assert5(typeof this.binding.namespace !== "symbol");
7611
7698
  if (!this.binding.namespace) {
7612
7699
  return false;
7613
7700
  }
@@ -7650,7 +7737,7 @@ var AgentMemoryNamespaceHandler = class extends ProvisionResourceHandler {
7650
7737
  );
7651
7738
  }
7652
7739
  async isConnectedToExistingResource() {
7653
- assert4(typeof this.binding.namespace !== "symbol");
7740
+ assert5(typeof this.binding.namespace !== "symbol");
7654
7741
  if (!this.binding.namespace) {
7655
7742
  return false;
7656
7743
  }
@@ -7705,7 +7792,7 @@ var QueueHandler = class extends ProvisionResourceHandler {
7705
7792
  return true;
7706
7793
  }
7707
7794
  async isConnectedToExistingResource() {
7708
- assert4(typeof this.binding.queue_name !== "symbol");
7795
+ assert5(typeof this.binding.queue_name !== "symbol");
7709
7796
  if (!this.binding.queue_name) {
7710
7797
  return false;
7711
7798
  }
@@ -7761,7 +7848,7 @@ var DispatchNamespaceHandler = class extends ProvisionResourceHandler {
7761
7848
  return true;
7762
7849
  }
7763
7850
  async isConnectedToExistingResource() {
7764
- assert4(typeof this.binding.namespace !== "symbol");
7851
+ assert5(typeof this.binding.namespace !== "symbol");
7765
7852
  if (!this.binding.namespace) {
7766
7853
  return false;
7767
7854
  }
@@ -7886,7 +7973,7 @@ var D1Handler = class extends ProvisionResourceHandler {
7886
7973
  return false;
7887
7974
  }
7888
7975
  async isConnectedToExistingResource() {
7889
- assert4(typeof this.binding.database_name !== "symbol");
7976
+ assert5(typeof this.binding.database_name !== "symbol");
7890
7977
  if (!this.binding.database_name) {
7891
7978
  return false;
7892
7979
  }
@@ -8271,7 +8358,7 @@ async function provisionBindings(bindings, accountId, scriptName, autoCreate, co
8271
8358
  const configPath = config2.userConfigPath ?? config2.configPath;
8272
8359
  const { pendingResources, skippedProvisioning } = await collectPendingResources(config2, accountId, scriptName, bindings);
8273
8360
  if (pendingResources.length > 0) {
8274
- assert4(
8361
+ assert5(
8275
8362
  configPath,
8276
8363
  "Provisioning resources is not possible without a config file"
8277
8364
  );
@@ -9368,7 +9455,7 @@ __export(util_exports, {
9368
9455
  NUMBER_FORMAT_RANGES: () => NUMBER_FORMAT_RANGES,
9369
9456
  aborted: () => aborted,
9370
9457
  allowsEval: () => allowsEval,
9371
- assert: () => assert5,
9458
+ assert: () => assert6,
9372
9459
  assertEqual: () => assertEqual,
9373
9460
  assertIs: () => assertIs,
9374
9461
  assertNever: () => assertNever,
@@ -9442,9 +9529,9 @@ function assertNever(_x) {
9442
9529
  throw new Error("Unexpected value in exhaustive check");
9443
9530
  }
9444
9531
  __name(assertNever, "assertNever");
9445
- function assert5(_) {
9532
+ function assert6(_) {
9446
9533
  }
9447
- __name(assert5, "assert");
9534
+ __name(assert6, "assert");
9448
9535
  function getEnumValues(entries) {
9449
9536
  const numericValues = Object.values(entries).filter((v) => typeof v === "number");
9450
9537
  const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
@@ -9542,10 +9629,10 @@ function cloneDef(schema) {
9542
9629
  return mergeDefs(schema._zod.def);
9543
9630
  }
9544
9631
  __name(cloneDef, "cloneDef");
9545
- function getElementAtPath(obj, path9) {
9546
- if (!path9)
9632
+ function getElementAtPath(obj, path10) {
9633
+ if (!path10)
9547
9634
  return obj;
9548
- return path9.reduce((acc, key) => acc?.[key], obj);
9635
+ return path10.reduce((acc, key) => acc?.[key], obj);
9549
9636
  }
9550
9637
  __name(getElementAtPath, "getElementAtPath");
9551
9638
  function promiseAllObject(promisesObj) {
@@ -9978,11 +10065,11 @@ function explicitlyAborted(x, startIndex = 0) {
9978
10065
  return false;
9979
10066
  }
9980
10067
  __name(explicitlyAborted, "explicitlyAborted");
9981
- function prefixIssues(path9, issues) {
10068
+ function prefixIssues(path10, issues) {
9982
10069
  return issues.map((iss) => {
9983
10070
  var _a3;
9984
10071
  (_a3 = iss).path ?? (_a3.path = []);
9985
- iss.path.unshift(path9);
10072
+ iss.path.unshift(path10);
9986
10073
  return iss;
9987
10074
  });
9988
10075
  }
@@ -10147,16 +10234,16 @@ function flattenError(error51, mapper = (issue2) => issue2.message) {
10147
10234
  __name(flattenError, "flattenError");
10148
10235
  function formatError(error51, mapper = (issue2) => issue2.message) {
10149
10236
  const fieldErrors = { _errors: [] };
10150
- const processError = /* @__PURE__ */ __name((error52, path9 = []) => {
10237
+ const processError = /* @__PURE__ */ __name((error52, path10 = []) => {
10151
10238
  for (const issue2 of error52.issues) {
10152
10239
  if (issue2.code === "invalid_union" && issue2.errors.length) {
10153
- issue2.errors.map((issues) => processError({ issues }, [...path9, ...issue2.path]));
10240
+ issue2.errors.map((issues) => processError({ issues }, [...path10, ...issue2.path]));
10154
10241
  } else if (issue2.code === "invalid_key") {
10155
- processError({ issues: issue2.issues }, [...path9, ...issue2.path]);
10242
+ processError({ issues: issue2.issues }, [...path10, ...issue2.path]);
10156
10243
  } else if (issue2.code === "invalid_element") {
10157
- processError({ issues: issue2.issues }, [...path9, ...issue2.path]);
10244
+ processError({ issues: issue2.issues }, [...path10, ...issue2.path]);
10158
10245
  } else {
10159
- const fullpath = [...path9, ...issue2.path];
10246
+ const fullpath = [...path10, ...issue2.path];
10160
10247
  if (fullpath.length === 0) {
10161
10248
  fieldErrors._errors.push(mapper(issue2));
10162
10249
  } else {
@@ -10184,17 +10271,17 @@ function formatError(error51, mapper = (issue2) => issue2.message) {
10184
10271
  __name(formatError, "formatError");
10185
10272
  function treeifyError(error51, mapper = (issue2) => issue2.message) {
10186
10273
  const result = { errors: [] };
10187
- const processError = /* @__PURE__ */ __name((error52, path9 = []) => {
10274
+ const processError = /* @__PURE__ */ __name((error52, path10 = []) => {
10188
10275
  var _a3, _b;
10189
10276
  for (const issue2 of error52.issues) {
10190
10277
  if (issue2.code === "invalid_union" && issue2.errors.length) {
10191
- issue2.errors.map((issues) => processError({ issues }, [...path9, ...issue2.path]));
10278
+ issue2.errors.map((issues) => processError({ issues }, [...path10, ...issue2.path]));
10192
10279
  } else if (issue2.code === "invalid_key") {
10193
- processError({ issues: issue2.issues }, [...path9, ...issue2.path]);
10280
+ processError({ issues: issue2.issues }, [...path10, ...issue2.path]);
10194
10281
  } else if (issue2.code === "invalid_element") {
10195
- processError({ issues: issue2.issues }, [...path9, ...issue2.path]);
10282
+ processError({ issues: issue2.issues }, [...path10, ...issue2.path]);
10196
10283
  } else {
10197
- const fullpath = [...path9, ...issue2.path];
10284
+ const fullpath = [...path10, ...issue2.path];
10198
10285
  if (fullpath.length === 0) {
10199
10286
  result.errors.push(mapper(issue2));
10200
10287
  continue;
@@ -10227,8 +10314,8 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
10227
10314
  __name(treeifyError, "treeifyError");
10228
10315
  function toDotPath(_path) {
10229
10316
  const segs = [];
10230
- const path9 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
10231
- for (const seg of path9) {
10317
+ const path10 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
10318
+ for (const seg of path10) {
10232
10319
  if (typeof seg === "number")
10233
10320
  segs.push(`[${seg}]`);
10234
10321
  else if (typeof seg === "symbol")
@@ -23284,13 +23371,13 @@ function resolveRef(ref, ctx) {
23284
23371
  if (!ref.startsWith("#")) {
23285
23372
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
23286
23373
  }
23287
- const path9 = ref.slice(1).split("/").filter(Boolean);
23288
- if (path9.length === 0) {
23374
+ const path10 = ref.slice(1).split("/").filter(Boolean);
23375
+ if (path10.length === 0) {
23289
23376
  return ctx.rootSchema;
23290
23377
  }
23291
23378
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
23292
- if (path9[0] === defsKey) {
23293
- const key = path9[1];
23379
+ if (path10[0] === defsKey) {
23380
+ const key = path10[1];
23294
23381
  if (!key || !ctx.defs[key]) {
23295
23382
  throw new Error(`Reference not found: ${ref}`);
23296
23383
  }
@@ -23820,12 +23907,12 @@ function getSourceMappingPrepareStackTrace(retrieveSourceMap) {
23820
23907
  // Make sure we're using fresh copies of files each time we source map
23821
23908
  emptyCacheBetweenOperations: true,
23822
23909
  // Allow retriever to be overridden at prepare stack trace time
23823
- retrieveSourceMap(path9) {
23824
- return retrieveSourceMapOverride?.(path9) ?? null;
23910
+ retrieveSourceMap(path10) {
23911
+ return retrieveSourceMapOverride?.(path10) ?? null;
23825
23912
  }
23826
23913
  });
23827
23914
  sourceMappingPrepareStackTrace = Error.prepareStackTrace;
23828
- assert4(sourceMappingPrepareStackTrace !== void 0);
23915
+ assert5(sourceMappingPrepareStackTrace !== void 0);
23829
23916
  Error.prepareStackTrace = originalPrepareStackTrace;
23830
23917
  return sourceMappingPrepareStackTrace;
23831
23918
  }
@@ -23887,7 +23974,7 @@ function getSourceMappedString(value, retrieveSourceMap) {
23887
23974
  }
23888
23975
  const callSiteLine = callSiteLines[i][0];
23889
23976
  const callSiteAtIndex = callSiteLine.indexOf("at");
23890
- assert4(callSiteAtIndex !== -1);
23977
+ assert5(callSiteAtIndex !== -1);
23891
23978
  const callSiteLineLeftPad = callSiteLine.substring(0, callSiteAtIndex);
23892
23979
  value = value.replace(
23893
23980
  callSiteLine,
@@ -24607,10 +24694,10 @@ function populateConfigPatch(diff, patchObj, targetEnvironment) {
24607
24694
  return;
24608
24695
  }
24609
24696
  if (Array.isArray(diff)) {
24610
- assert4(Array.isArray(patchObj));
24697
+ assert5(Array.isArray(patchObj));
24611
24698
  return populateConfigPatchArray(diff, patchObj);
24612
24699
  }
24613
- assert4(!Array.isArray(patchObj));
24700
+ assert5(!Array.isArray(patchObj));
24614
24701
  return populateConfigPatchObject(diff, patchObj, targetEnvironment);
24615
24702
  }
24616
24703
  __name(populateConfigPatch, "populateConfigPatch");
@@ -24944,7 +25031,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
24944
25031
  if (props.command === "deploy") {
24945
25032
  validateEventTriggerTargets(config2, name);
24946
25033
  validateRoutes(props.routes, props.assetsOptions);
24947
- assert4(
25034
+ assert5(
24948
25035
  !config2.site || config2.site.bucket,
24949
25036
  "A [site] definition requires a `bucket` field with a path to the site's assets directory."
24950
25037
  );
@@ -25185,7 +25272,9 @@ async function deployWorker(props, config2, buildResult, callbacks) {
25185
25272
  }
25186
25273
  }
25187
25274
  const isDryRun = props.dryRun;
25188
- const normalisedContainerConfig = callbacks.getNormalizedContainerOptions ? await callbacks.getNormalizedContainerOptions(config2, props) : [];
25275
+ const normalisedContainerConfig = props.normalisedContainerConfig;
25276
+ const builtContainerDeployments = props.builtContainerDeployments;
25277
+ const shouldDeployContainers = normalisedContainerConfig.length > 0 && props.containersRollout !== "none";
25189
25278
  const {
25190
25279
  modules,
25191
25280
  dependencies,
@@ -25195,7 +25284,8 @@ async function deployWorker(props, config2, buildResult, callbacks) {
25195
25284
  sourceMaps
25196
25285
  } = buildResult;
25197
25286
  const skipContainerChanges = props.containersRollout === "none";
25198
- const preparedContainerImages = skipContainerChanges ? void 0 : await callbacks.prepareDurableObjectContainerApplications?.(config2, {
25287
+ const preparedContainerImages = skipContainerChanges ? void 0 : await prepareDurableObjectContainerApplications(config2, {
25288
+ accountId,
25199
25289
  dryRun: Boolean(isDryRun),
25200
25290
  scriptName,
25201
25291
  dispatchNamespace: props.dispatchNamespace
@@ -25332,33 +25422,7 @@ async function deployWorker(props, config2, buildResult, callbacks) {
25332
25422
  containerMetadata === void 0;
25333
25423
  let workerBundle;
25334
25424
  const dockerPath = getDockerPath();
25335
- if (normalisedContainerConfig.length && props.containersRollout !== "none") {
25336
- const containersWithDockerfile = normalisedContainerConfig.filter(
25337
- (container) => "dockerfile" in container
25338
- );
25339
- if (containersWithDockerfile.length > 0) {
25340
- await verifyDockerInstalled({
25341
- dockerPath,
25342
- operation: `deploying${isDryRun ? " (even in dry-run mode)" : ""}`,
25343
- imageNoun: containersWithDockerfile.length !== 1 ? "the configured images" : "the configured image",
25344
- hint: "If you cannot run Docker locally, you can still deploy your Worker by passing --containers-rollout=none. This will not deploy or update your Container."
25345
- });
25346
- }
25347
- }
25348
25425
  if (isDryRun) {
25349
- if (normalisedContainerConfig.length) {
25350
- for (const container of normalisedContainerConfig) {
25351
- if ("dockerfile" in container && props.containersRollout !== "none" && callbacks.buildContainer) {
25352
- await callbacks.buildContainer(
25353
- container,
25354
- workerTag ?? "worker-tag",
25355
- isDryRun,
25356
- dockerPath,
25357
- false
25358
- );
25359
- }
25360
- }
25361
- }
25362
25426
  workerBundle = createWorkerUploadForm(
25363
25427
  worker,
25364
25428
  addWorkersSitesBindings(
@@ -25381,7 +25445,7 @@ async function deployWorker(props, config2, buildResult, callbacks) {
25381
25445
  unsafeMetadata: config2.unsafe?.metadata
25382
25446
  });
25383
25447
  } else {
25384
- assert4(accountId, "Missing accountId");
25448
+ assert5(accountId, "Missing accountId");
25385
25449
  let provisionBindingsResult;
25386
25450
  if (assetsOptions?.routerConfig.has_user_worker === false) {
25387
25451
  logger.debug("skipping provisioning on assets-only project");
@@ -25603,19 +25667,47 @@ async function deployWorker(props, config2, buildResult, callbacks) {
25603
25667
  }
25604
25668
  const uploadMs = Date.now() - start;
25605
25669
  logger.log("Uploaded", workerName, formatTime(uploadMs));
25606
- if (normalisedContainerConfig.length && props.containersRollout !== "none" && callbacks.deployContainers) {
25607
- assert4(versionId && accountId);
25608
- await callbacks.deployContainers(config2, normalisedContainerConfig, {
25670
+ if (shouldDeployContainers) {
25671
+ assert5(versionId && accountId);
25672
+ initContainersSharedContext({ logger, fetchPagedListResult, fetchResult });
25673
+ const containerDeployments = [];
25674
+ for (const container of normalisedContainerConfig) {
25675
+ if ("dockerfile" in container) {
25676
+ const builtContainerDeployment = builtContainerDeployments.find(
25677
+ (deployment) => deployment.container === container
25678
+ );
25679
+ assert5(
25680
+ builtContainerDeployment,
25681
+ "Expected container image to be built before upload"
25682
+ );
25683
+ containerDeployments.push({
25684
+ container,
25685
+ imageRef: await pushBuiltContainerImage(
25686
+ builtContainerDeployment.builtImage,
25687
+ versionId,
25688
+ dockerPath,
25689
+ accountId,
25690
+ config2
25691
+ )
25692
+ });
25693
+ } else {
25694
+ containerDeployments.push({
25695
+ container,
25696
+ imageRef: { newTag: container.image_uri }
25697
+ });
25698
+ }
25699
+ }
25700
+ await deployContainers(config2, containerDeployments, {
25609
25701
  versionId,
25610
25702
  accountId,
25611
25703
  scriptName,
25612
25704
  dispatchNamespace: props.dispatchNamespace
25613
25705
  });
25614
25706
  }
25615
- if (!skipContainerChanges && getDurableObjectContainerApps(config2.containers).length > 0 && callbacks.deployDurableObjectContainerApplications) {
25616
- assert4(versionId && accountId);
25707
+ if (!skipContainerChanges && getDurableObjectContainerApps(config2.containers).length > 0) {
25708
+ assert5(versionId && accountId);
25617
25709
  try {
25618
- await callbacks.deployDurableObjectContainerApplications(config2, {
25710
+ await deployDurableObjectContainerApplications(config2, {
25619
25711
  versionId,
25620
25712
  accountId,
25621
25713
  scriptName,
@@ -25635,7 +25727,7 @@ async function deployWorker(props, config2, buildResult, callbacks) {
25635
25727
  deployWfpUserWorker(props.dispatchNamespace, versionId);
25636
25728
  return { versionId, workerTag, assetUploadStats, bundleSize };
25637
25729
  }
25638
- assert4(accountId);
25730
+ assert5(accountId);
25639
25731
  const targets = await triggersDeploy({
25640
25732
  config: config2,
25641
25733
  accountId,
@@ -25742,7 +25834,8 @@ async function uploadWorkerVersion(props, config2, buildResult, callbacks) {
25742
25834
  { telemetryMessage: "versions upload pending durable object migration" }
25743
25835
  );
25744
25836
  }
25745
- const preparedContainerImages = await callbacks.prepareDurableObjectContainerApplications?.(config2, {
25837
+ const preparedContainerImages = await prepareDurableObjectContainerApplications(config2, {
25838
+ accountId,
25746
25839
  dryRun: Boolean(props.dryRun),
25747
25840
  scriptName
25748
25841
  });
@@ -25829,7 +25922,7 @@ async function uploadWorkerVersion(props, config2, buildResult, callbacks) {
25829
25922
  unsafeMetadata: config2.unsafe?.metadata
25830
25923
  });
25831
25924
  } else {
25832
- assert4(accountId, "Missing accountId");
25925
+ assert5(accountId, "Missing accountId");
25833
25926
  let provisionBindingsResult;
25834
25927
  if (assetsOptions?.routerConfig.has_user_worker === false) {
25835
25928
  logger.debug("skipping provisioning on assets-only project");
@@ -25943,10 +26036,10 @@ async function uploadWorkerVersion(props, config2, buildResult, callbacks) {
25943
26036
  logger.log(`--dry-run: exiting now.`);
25944
26037
  return { versionId, workerTag, bundleSize };
25945
26038
  }
25946
- assert4(accountId);
25947
- if (!hasDurableObjectExports(config2.exports) && getDurableObjectContainerApps(config2.containers).length > 0 && callbacks.deployDurableObjectContainerApplications) {
25948
- assert4(versionId);
25949
- await callbacks.deployDurableObjectContainerApplications(config2, {
26039
+ assert5(accountId);
26040
+ if (!hasDurableObjectExports(config2.exports) && getDurableObjectContainerApps(config2.containers).length > 0) {
26041
+ assert5(versionId);
26042
+ await deployDurableObjectContainerApplications(config2, {
25950
26043
  versionId,
25951
26044
  accountId,
25952
26045
  scriptName
@@ -26130,7 +26223,7 @@ async function getPreview(config2, accountId, workerName, previewIdentifier) {
26130
26223
  );
26131
26224
  }
26132
26225
  __name(getPreview, "getPreview");
26133
- async function createPreview(config2, accountId, workerName, request2, options) {
26226
+ async function createPreview(config2, accountId, workerName, request, options) {
26134
26227
  const queryParams = options?.ignoreBaseConfig ? new URLSearchParams({ ignore_base_config: "true" }) : void 0;
26135
26228
  return fetchResult(
26136
26229
  config2,
@@ -26138,13 +26231,13 @@ async function createPreview(config2, accountId, workerName, request2, options)
26138
26231
  {
26139
26232
  method: "POST",
26140
26233
  headers: { "Content-Type": "application/json" },
26141
- body: JSON.stringify(request2)
26234
+ body: JSON.stringify(request)
26142
26235
  },
26143
26236
  queryParams
26144
26237
  );
26145
26238
  }
26146
26239
  __name(createPreview, "createPreview");
26147
- async function editPreview(config2, accountId, workerName, previewIdentifier, request2) {
26240
+ async function editPreview(config2, accountId, workerName, previewIdentifier, request) {
26148
26241
  return fetchResult(
26149
26242
  config2,
26150
26243
  `/accounts/${accountId}/workers/workers/${workerName}/previews/${encodeURIComponent(
@@ -26153,7 +26246,7 @@ async function editPreview(config2, accountId, workerName, previewIdentifier, re
26153
26246
  {
26154
26247
  method: "PATCH",
26155
26248
  headers: { "Content-Type": "application/json" },
26156
- body: JSON.stringify(request2)
26249
+ body: JSON.stringify(request)
26157
26250
  }
26158
26251
  );
26159
26252
  }
@@ -26179,8 +26272,8 @@ async function getPreviewDeployment(config2, accountId, workerName, previewIdent
26179
26272
  );
26180
26273
  }
26181
26274
  __name(getPreviewDeployment, "getPreviewDeployment");
26182
- function createPreviewDeploymentForm(request2) {
26183
- const { modules, ...metadata } = request2;
26275
+ function createPreviewDeploymentForm(request) {
26276
+ const { modules, ...metadata } = request;
26184
26277
  const formData = new FormData();
26185
26278
  formData.set("metadata", JSON.stringify(metadata));
26186
26279
  for (const module of modules ?? []) {
@@ -26192,7 +26285,7 @@ function createPreviewDeploymentForm(request2) {
26192
26285
  return formData;
26193
26286
  }
26194
26287
  __name(createPreviewDeploymentForm, "createPreviewDeploymentForm");
26195
- async function createPreviewDeployment(config2, accountId, workerName, previewIdentifier, request2) {
26288
+ async function createPreviewDeployment(config2, accountId, workerName, previewIdentifier, request) {
26196
26289
  return fetchResult(
26197
26290
  config2,
26198
26291
  `/accounts/${accountId}/workers/workers/${workerName}/previews/${encodeURIComponent(
@@ -26201,7 +26294,7 @@ async function createPreviewDeployment(config2, accountId, workerName, previewId
26201
26294
  {
26202
26295
  method: "POST",
26203
26296
  // Let undici set Content-Type with the generated multipart boundary.
26204
- body: createPreviewDeploymentForm(request2)
26297
+ body: createPreviewDeploymentForm(request)
26205
26298
  }
26206
26299
  );
26207
26300
  }
@@ -26802,7 +26895,107 @@ async function prepareContainersForPreview(config2, workerName, previewSlug, cal
26802
26895
  return { scopedContainerConfig, normalisedContainerConfig };
26803
26896
  }
26804
26897
  __name(prepareContainersForPreview, "prepareContainersForPreview");
26805
- var NO_ACTIVE_PREVIEW_URLS_MESSAGE = "Note: This Preview deployment has no active URLs. To get one, enable Preview Deployments on workers.dev or a custom domain. See https://developers.cloudflare.com/workers/previews/custom-domains/ for more information";
26898
+ var NO_ACTIVE_PREVIEW_URLS_MESSAGE = "Note: This Preview deployment has no active URLs.";
26899
+ function isCustomDomainRoute(route) {
26900
+ return typeof route === "object" && route.custom_domain === true;
26901
+ }
26902
+ __name(isCustomDomainRoute, "isCustomDomainRoute");
26903
+ function formatPreviewConfigUpdate(config2, update) {
26904
+ const configPath = config2.userConfigPath ?? config2.configPath;
26905
+ if (!config2.targetEnvironment) {
26906
+ return formatConfigSnippet(update, configPath).trimEnd();
26907
+ }
26908
+ return formatConfigSnippet(
26909
+ { env: { [config2.targetEnvironment]: update } },
26910
+ configPath
26911
+ ).trimEnd();
26912
+ }
26913
+ __name(formatPreviewConfigUpdate, "formatPreviewConfigUpdate");
26914
+ function formatNoActivePreviewUrlsMessage(config2) {
26915
+ const customDomainRouteEntries = (config2.routes ?? []).filter(isCustomDomainRoute).map((route) => ({ route, singular: false }));
26916
+ if (config2.route && isCustomDomainRoute(config2.route)) {
26917
+ customDomainRouteEntries.push({ route: config2.route, singular: true });
26918
+ }
26919
+ const customDomainRouteEntry = customDomainRouteEntries.find(
26920
+ ({ route }) => route.previews_enabled === true
26921
+ ) ?? customDomainRouteEntries[0];
26922
+ const customDomainRoute = customDomainRouteEntry?.route;
26923
+ const customDomain = customDomainRoute?.pattern ?? "previews.example.com";
26924
+ const configPath = config2.userConfigPath ?? config2.configPath;
26925
+ const configName = configFileName(configPath);
26926
+ const workersDevConfig = formatPreviewConfigUpdate(config2, {
26927
+ preview_urls: true
26928
+ });
26929
+ const customDomainRouteConfig = {
26930
+ ...customDomainRoute ?? {
26931
+ pattern: customDomain,
26932
+ custom_domain: true,
26933
+ enabled: false
26934
+ },
26935
+ previews_enabled: true
26936
+ };
26937
+ let customDomainConfigUpdate;
26938
+ if (customDomainRouteEntry?.singular) {
26939
+ customDomainConfigUpdate = { route: customDomainRouteConfig };
26940
+ } else if (customDomainRoute) {
26941
+ customDomainConfigUpdate = {
26942
+ routes: (config2.routes ?? []).map(
26943
+ (route) => route === customDomainRoute ? customDomainRouteConfig : route
26944
+ )
26945
+ };
26946
+ } else {
26947
+ const routes = config2.routes ?? (config2.route ? [config2.route] : []);
26948
+ customDomainConfigUpdate = {
26949
+ routes: [...routes, customDomainRouteConfig]
26950
+ };
26951
+ }
26952
+ const customDomainConfig = formatPreviewConfigUpdate(
26953
+ config2,
26954
+ customDomainConfigUpdate
26955
+ );
26956
+ let productionStatus = "disabled";
26957
+ if (customDomainRoute?.enabled === true) {
26958
+ productionStatus = "enabled";
26959
+ } else if (customDomainRoute?.enabled === void 0 && customDomainRoute) {
26960
+ productionStatus = "enabled (default)";
26961
+ }
26962
+ const workersDevAlreadyConfigured = config2.preview_urls === true;
26963
+ const customDomainAlreadyConfigured = customDomainRoute?.previews_enabled === true;
26964
+ const cautionText = workersDevAlreadyConfigured && customDomainAlreadyConfigured ? "Caution: `wrangler deploy` publishes the code in your current checkout to the deployed Worker. If you have already made this change, confirm it was applied by running `wrangler deploy` from a clean checkout of your production branch. Then return to your feature branch and run `wrangler preview` again." : "Caution: `wrangler deploy` publishes the code in your current checkout to the deployed Worker, not only these settings. If you use Git, commit the configuration change and run `wrangler deploy` from a clean checkout of your production branch. Then return to your feature branch and run `wrangler preview` again.";
26965
+ let workersDevInstruction = `Add this to your ${configName}:`;
26966
+ if (config2.preview_urls === true) {
26967
+ workersDevInstruction = `Your ${configName} already contains:`;
26968
+ } else if (config2.preview_urls === false) {
26969
+ workersDevInstruction = `Update this in your ${configName}:`;
26970
+ }
26971
+ let customDomainInstruction = `Add or update this route in your ${configName}:`;
26972
+ if (customDomainRoute?.previews_enabled === true) {
26973
+ customDomainInstruction = `Your ${configName} already contains:`;
26974
+ } else if (customDomainRoute === void 0 && config2.route !== void 0) {
26975
+ customDomainInstruction = `Replace \`route\` with this in your ${configName}:`;
26976
+ }
26977
+ return [
26978
+ NO_ACTIVE_PREVIEW_URLS_MESSAGE,
26979
+ "",
26980
+ "For a Workers.dev URL such as:",
26981
+ " https://<preview-name>-<worker>.<subdomain>.workers.dev",
26982
+ workersDevInstruction,
26983
+ workersDevConfig,
26984
+ "",
26985
+ "For a custom-domain URL such as:",
26986
+ ` https://<preview-name>.${customDomain}`,
26987
+ customDomainInstruction,
26988
+ customDomainConfig,
26989
+ "Resulting route behavior:",
26990
+ ` Production: ${productionStatus}`,
26991
+ " Previews: enabled",
26992
+ "",
26993
+ cautionText,
26994
+ "",
26995
+ "See https://developers.cloudflare.com/workers/previews/custom-domains/ for more information."
26996
+ ].join("\n");
26997
+ }
26998
+ __name(formatNoActivePreviewUrlsMessage, "formatNoActivePreviewUrlsMessage");
26806
26999
  function getPreviewMigrationsToUpload(workerName, config2, currentMigrationTag) {
26807
27000
  if (config2.migrations.length === 0) {
26808
27001
  return void 0;
@@ -26884,13 +27077,13 @@ function buildResultToDeploymentModules(buildResult, assetFiles) {
26884
27077
  __name(buildResultToDeploymentModules, "buildResultToDeploymentModules");
26885
27078
  async function assemblePreviewDeploymentSettings(config2, buildResult, accountId, workerName, previewIdentifier, options) {
26886
27079
  const previews = config2.previews;
26887
- const request2 = {};
27080
+ const request = {};
26888
27081
  const deploymentModules = buildResultToDeploymentModules(buildResult, {
26889
27082
  _headers: options.assetsOptions?._headers,
26890
27083
  _redirects: options.assetsOptions?._redirects
26891
27084
  });
26892
- request2.main_module = deploymentModules.main_module;
26893
- request2.modules = deploymentModules.modules;
27085
+ request.main_module = deploymentModules.main_module;
27086
+ request.modules = deploymentModules.modules;
26894
27087
  if (options.assetsOptions) {
26895
27088
  const assetsUploadResult = await syncAssets(
26896
27089
  config2,
@@ -26898,7 +27091,7 @@ async function assemblePreviewDeploymentSettings(config2, buildResult, accountId
26898
27091
  options.assetsOptions.directory,
26899
27092
  workerName
26900
27093
  );
26901
- request2.assets = {
27094
+ request.assets = {
26902
27095
  jwt: assetsUploadResult.jwt,
26903
27096
  config: {
26904
27097
  html_handling: options.assetsOptions.assetConfig.html_handling,
@@ -26908,16 +27101,16 @@ async function assemblePreviewDeploymentSettings(config2, buildResult, accountId
26908
27101
  };
26909
27102
  }
26910
27103
  if (config2.compatibility_date) {
26911
- request2.compatibility_date = config2.compatibility_date;
27104
+ request.compatibility_date = config2.compatibility_date;
26912
27105
  }
26913
27106
  if (config2.compatibility_flags && config2.compatibility_flags.length > 0) {
26914
- request2.compatibility_flags = config2.compatibility_flags;
27107
+ request.compatibility_flags = config2.compatibility_flags;
26915
27108
  }
26916
27109
  const repositoryUrl = options.repositoryUrl;
26917
27110
  const pullRequest = options.pullRequest;
26918
27111
  const commitSha = options.commitSha;
26919
27112
  if (options.message || options.tag || repositoryUrl || pullRequest || commitSha) {
26920
- request2.annotations = {
27113
+ request.annotations = {
26921
27114
  ...commitSha && { "workers/commit_sha": commitSha },
26922
27115
  ...options.message && { "workers/message": options.message },
26923
27116
  ...pullRequest?.number && {
@@ -26953,21 +27146,21 @@ async function assemblePreviewDeploymentSettings(config2, buildResult, accountId
26953
27146
  latestDeploymentMigrationTag
26954
27147
  );
26955
27148
  if (migrations) {
26956
- request2.migrations = migrations;
27149
+ request.migrations = migrations;
26957
27150
  }
26958
27151
  }
26959
27152
  if (previews?.limits !== void 0) {
26960
- request2.limits = previews.limits;
27153
+ request.limits = previews.limits;
26961
27154
  } else if (config2.limits !== void 0) {
26962
- request2.limits = config2.limits;
27155
+ request.limits = config2.limits;
26963
27156
  }
26964
27157
  if (previews?.cache !== void 0) {
26965
- request2.cache = previews.cache;
27158
+ request.cache = previews.cache;
26966
27159
  } else if (config2.cache !== void 0) {
26967
- request2.cache = config2.cache;
27160
+ request.cache = config2.cache;
26968
27161
  }
26969
27162
  if (config2.placement) {
26970
- request2.placement = parseConfigPlacement(config2);
27163
+ request.placement = parseConfigPlacement(config2);
26971
27164
  }
26972
27165
  const previewContainers = previews?.containers ?? [];
26973
27166
  if (previewContainers.length > 0) {
@@ -26976,14 +27169,14 @@ async function assemblePreviewDeploymentSettings(config2, buildResult, accountId
26976
27169
  ({ class_name }) => class_name !== void 0 && ownedDOClasses.has(class_name) ? [{ class_name }] : []
26977
27170
  );
26978
27171
  if (containers.length > 0) {
26979
- request2.containers = containers;
27172
+ request.containers = containers;
26980
27173
  }
26981
27174
  }
26982
27175
  const env = extractConfigBindings(config2);
26983
27176
  if (Object.keys(env).length > 0) {
26984
- request2.env = env;
27177
+ request.env = env;
26985
27178
  }
26986
- return request2;
27179
+ return request;
26987
27180
  }
26988
27181
  __name(assemblePreviewDeploymentSettings, "assemblePreviewDeploymentSettings");
26989
27182
  function formatUrlLines(label, urls) {
@@ -27000,7 +27193,7 @@ function formatUrlLines(label, urls) {
27000
27193
  ];
27001
27194
  }
27002
27195
  __name(formatUrlLines, "formatUrlLines");
27003
- function formatPreviewDeploymentSummary(previewResource, deployment, isNew, pullRequest) {
27196
+ function formatPreviewDeploymentSummary(config2, previewResource, deployment, isNew, pullRequest) {
27004
27197
  const statusLabel = isNew ? chalk6.green("(new)") : chalk6.dim("(updated)");
27005
27198
  const pullRequestUrl = deployment.annotations?.["workers/pull_request_url"] ?? pullRequest?.url;
27006
27199
  const pullRequestNumber = deployment.annotations?.["workers/pull_request_number"] ?? pullRequest?.number;
@@ -27014,7 +27207,7 @@ function formatPreviewDeploymentSummary(previewResource, deployment, isNew, pull
27014
27207
  ...pullRequestUrl || pullRequestNumber ? [
27015
27208
  `${chalk6.bold("Pull Request:")} ${pullRequestUrl ?? `#${pullRequestNumber}`}`
27016
27209
  ] : [],
27017
- ...hasActiveUrls ? [] : [NO_ACTIVE_PREVIEW_URLS_MESSAGE]
27210
+ ...hasActiveUrls ? [] : [formatNoActivePreviewUrlsMessage(config2)]
27018
27211
  ].join("\n");
27019
27212
  }
27020
27213
  __name(formatPreviewDeploymentSummary, "formatPreviewDeploymentSummary");
@@ -27185,6 +27378,7 @@ async function preview(accountId, args, config2, buildResult, assetsOptions, cal
27185
27378
  } else {
27186
27379
  logger.log(
27187
27380
  formatPreviewDeploymentSummary(
27381
+ config2,
27188
27382
  previewResource,
27189
27383
  deployment,
27190
27384
  isNewPreview,
@@ -27387,4 +27581,4 @@ __name(formatBindings, "formatBindings");
27387
27581
  * THE SOFTWARE.
27388
27582
  */
27389
27583
 
27390
- export { ACTOR_BINDING_DEPENDS_ON_EXPORT_CODE, EXPORTS_RECONCILIATION_ERROR_CODE, INCONSISTENT_EXPORTS_ACROSS_VERSIONS_CODE, INVALID_INHERIT_BINDING_CODE, NO_ACTIVE_PREVIEW_URLS_MESSAGE, NoInputError, WORKER_LEGACY_ENVIRONMENT_NOT_FOUND_ERR_CODE, WORKER_NOT_FOUND_ERR_CODE, WORKFLOW_CRON_REQUIRES_PAID_PLAN_CODE, WORKFLOW_NOT_FOUND_CODE, addRequiredSecretsInheritBindings, addWorkersSitesBindings, applyServiceAndEnvironmentTags, assemblePreviewScriptSettings, buildAssetManifest, checkRemoteSecretsOverride, checkWorkflowConflicts, collectPackageDependencies, confirmLatestDeploymentOverwrite, createDeployment, createPreview, createPreviewDeployment, createPreviewDeploymentForm, createPreviewParentWorker, createTruncatedAlias, decodeJwtPayload, deletePreview, deletePullConsumer, deleteWorkerConsumer, deploy, deployWfpUserWorker, diagnoseScriptSizeError, diagnoseStartupError, diffJsonObjects, downloadWorkerConfig, drawBox, drawConnectedChildBox, editPreview, ensureQueuesExistByConfig, extractConfigBindings, fetchDeployableVersions, fetchDeploymentVersions, fetchLatestDeployment, fetchLatestDeployments, fetchSecrets, fetchVersion, fetchVersions, fetchWorkerConfig, formatAlignedRows, formatBindings, generatePreviewAlias, getBindingValue, getBranchName2 as getBranchName, getCommitSha, getConfigPatch, getDeployConfirmFunction, getEdgeKvUploadConcurrency, getHeadCommitMessage, getHeadCommitRef, getMigrationsToUpload, getPreview, getPreviewBaseConfig, getPreviewDeployment, getPreviewOwnedContainerClassNames, getPullRequestMetadata, getQueue, getRemoteConfigDiff, getRepositoryUrl, getSettings, getSize, getSourceMappedStack, getSourceMappedString, getSubdomainValues, getSubdomainValuesAPIMock, getWorkersDevSubdomain, getZoneForRoute, getZoneIdFromHost, handleMissingSecretsError, hasDefinedEnvironments, hashFile, helpIfErrorIsSizeOrScriptStartup, isExportsReconciliationErrorDetails, isJwtExpired, isModifiedDiffValue, isNonDestructive, isWorkerNotFoundError, listConsumers, listQueues, maybeRetrieveFileSourceMap, padToVisibleWidth, parseBulkInputToObject, parseConfigPlacement, patchNonVersionedScriptSettings, patchPreviewBaseConfig, patchPreviewDeployment, postConsumer, preview, previewContainerAppName, previewDelete, printBundleSize, printVersions, provisionBindings, publishCustomDomains, publishRoutes, putConsumer, putConsumerById, renderBindingDependsOnExportError, renderExportsReconciliationError, renderExportsReconciliationSuccess, renderInconsistentExportsAcrossVersionsError, renderRoute, resolveAssetOptions, resolveDoLifecyclePayload, resolveExportsUploadPayload, resolveWorkerName, sanitizeBranchName, shouldUseCIMetadataFallback, stripAnsi, syncAssets, tagsAreEqual, triggersDeploy, updateQueueConsumers, validateEventTriggerTargets, validateFileSecrets, validateNodeCompatMode, validateRoutes, verifyWorkerMatchesCITag, versionsUpload, visibleLength, warnOnErrorUpdatingServiceAndEnvironmentTags, workerNotFoundErrorMessage };
27584
+ export { ACTOR_BINDING_DEPENDS_ON_EXPORT_CODE, EXPORTS_RECONCILIATION_ERROR_CODE, INCONSISTENT_EXPORTS_ACROSS_VERSIONS_CODE, INVALID_INHERIT_BINDING_CODE, NO_ACTIVE_PREVIEW_URLS_MESSAGE, NoInputError, PREVIEW_DOMAIN_PROVISIONING_NOTE, WORKER_LEGACY_ENVIRONMENT_NOT_FOUND_ERR_CODE, WORKER_NOT_FOUND_ERR_CODE, WORKFLOW_CRON_REQUIRES_PAID_PLAN_CODE, WORKFLOW_NOT_FOUND_CODE, addRequiredSecretsInheritBindings, addWorkersSitesBindings, applyServiceAndEnvironmentTags, assemblePreviewScriptSettings, buildAssetManifest, checkRemoteSecretsOverride, checkWorkflowConflicts, collectPackageDependencies, confirmLatestDeploymentOverwrite, createDeployment, createDurableObjectContainerApplication, createPreview, createPreviewDeployment, createPreviewDeploymentForm, createPreviewParentWorker, createTruncatedAlias, decodeJwtPayload, deletePreview, deletePullConsumer, deleteWorkerConsumer, deploy, deployDurableObjectContainerApplications, deployVersionedDurableObjectContainerApplications, deployWfpUserWorker, diagnoseScriptSizeError, diagnoseStartupError, diffJsonObjects, downloadWorkerConfig, drawBox, drawConnectedChildBox, editPreview, ensureQueuesExistByConfig, extractConfigBindings, fetchDeployableVersions, fetchDeploymentVersions, fetchLatestDeployment, fetchLatestDeployments, fetchSecrets, fetchVersion, fetchVersions, fetchWorkerConfig, formatAlignedRows, formatBindings, formatNoActivePreviewUrlsMessage, generatePreviewAlias, getBindingValue, getBranchName2 as getBranchName, getCommitSha, getConfigPatch, getDeployConfirmFunction, getEdgeKvUploadConcurrency, getHeadCommitMessage, getHeadCommitRef, getMigrationsToUpload, getPreview, getPreviewBaseConfig, getPreviewDeployment, getPreviewOwnedContainerClassNames, getPullRequestMetadata, getQueue, getRemoteConfigDiff, getRepositoryUrl, getSettings, getSize, getSourceMappedStack, getSourceMappedString, getSubdomainValues, getSubdomainValuesAPIMock, getVersionedDurableObjectContainerApplications, getWorkersDevSubdomain, getZoneForRoute, getZoneIdFromHost, handleMissingSecretsError, hasDefinedEnvironments, hashFile, helpIfErrorIsSizeOrScriptStartup, isExportsReconciliationErrorDetails, isJwtExpired, isModifiedDiffValue, isNonDestructive, isWorkerNotFoundError, listConsumers, listQueues, maybeRetrieveFileSourceMap, padToVisibleWidth, parseBulkInputToObject, parseConfigPlacement, patchNonVersionedScriptSettings, patchPreviewBaseConfig, patchPreviewDeployment, postConsumer, prepareDurableObjectContainerApplications, preview, previewContainerAppName, previewDelete, printBundleSize, printVersions, provisionBindings, publishCustomDomains, publishRoutes, putConsumer, putConsumerById, renderBindingDependsOnExportError, renderExportsReconciliationError, renderExportsReconciliationSuccess, renderInconsistentExportsAcrossVersionsError, renderRoute, resolveAssetOptions, resolveDoLifecyclePayload, resolveExportsUploadPayload, resolveVersionedDurableObjectContainerApplications, resolveWorkerName, sanitizeBranchName, shouldUseCIMetadataFallback, stripAnsi, syncAssets, tagsAreEqual, triggersDeploy, updateQueueConsumers, validateEventTriggerTargets, validateFileSecrets, validateNodeCompatMode, validateRoutes, verifyWorkerMatchesCITag, versionsUpload, visibleLength, warnOnErrorUpdatingServiceAndEnvironmentTags, workerNotFoundErrorMessage };