wrangler 4.151.1 → 4.151.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +13 -13
- package/wrangler-dist/cli.js +422 -240
package/wrangler-dist/cli.js
CHANGED
|
@@ -32928,7 +32928,7 @@ var DEFAULT_COMPAT_DATE;
|
|
|
32928
32928
|
var init_default_compat_date = __esm({
|
|
32929
32929
|
"../workers-utils/src/default-compat-date.ts"() {
|
|
32930
32930
|
init_import_meta_url();
|
|
32931
|
-
DEFAULT_COMPAT_DATE = "2026-10-
|
|
32931
|
+
DEFAULT_COMPAT_DATE = "2026-10-19";
|
|
32932
32932
|
}
|
|
32933
32933
|
});
|
|
32934
32934
|
|
|
@@ -63787,58 +63787,6 @@ var init_tunnel = __esm({
|
|
|
63787
63787
|
__name(createTunnelStartupError, "createTunnelStartupError");
|
|
63788
63788
|
}
|
|
63789
63789
|
});
|
|
63790
|
-
|
|
63791
|
-
// ../workers-utils/src/cli-presentation.ts
|
|
63792
|
-
function resolveCliPresentation(overrides) {
|
|
63793
|
-
return {
|
|
63794
|
-
cliName: overrides?.cliName ?? WRANGLER_CLI_PRESENTATION.cliName,
|
|
63795
|
-
displayName: overrides?.displayName ?? WRANGLER_CLI_PRESENTATION.displayName,
|
|
63796
|
-
displayConfigFileName: overrides?.displayConfigFileName ?? WRANGLER_CLI_PRESENTATION.displayConfigFileName,
|
|
63797
|
-
configFieldAssignmentSeparator: overrides?.configFieldAssignmentSeparator ?? WRANGLER_CLI_PRESENTATION.configFieldAssignmentSeparator,
|
|
63798
|
-
commands: {
|
|
63799
|
-
...WRANGLER_COMMANDS,
|
|
63800
|
-
...overrides?.commands
|
|
63801
|
-
},
|
|
63802
|
-
configFields: {
|
|
63803
|
-
...WRANGLER_CONFIG_FIELDS,
|
|
63804
|
-
...overrides?.configFields
|
|
63805
|
-
}
|
|
63806
|
-
};
|
|
63807
|
-
}
|
|
63808
|
-
var WRANGLER_COMMANDS, WRANGLER_CONFIG_FIELDS, WRANGLER_CLI_PRESENTATION;
|
|
63809
|
-
var init_cli_presentation = __esm({
|
|
63810
|
-
"../workers-utils/src/cli-presentation.ts"() {
|
|
63811
|
-
init_import_meta_url();
|
|
63812
|
-
WRANGLER_COMMANDS = {
|
|
63813
|
-
deploy: "wrangler deploy",
|
|
63814
|
-
preview: "wrangler preview",
|
|
63815
|
-
versionsUpload: "wrangler versions upload",
|
|
63816
|
-
versionsDeploy: "wrangler versions deploy",
|
|
63817
|
-
versionsDeployAt: /* @__PURE__ */ __name((n10) => `wrangler versions deploy <new-version-id>@${n10}%`, "versionsDeployAt"),
|
|
63818
|
-
triggersDeploy: "wrangler triggers deploy",
|
|
63819
|
-
d1List: "wrangler d1 list",
|
|
63820
|
-
d1Delete: "wrangler d1 delete",
|
|
63821
|
-
queuesCreate: "wrangler queues create",
|
|
63822
|
-
secretPut: "wrangler secret put",
|
|
63823
|
-
versionsSecretPut: "wrangler versions secret put",
|
|
63824
|
-
containerRegistryConfigure: "wrangler containers registries configure"
|
|
63825
|
-
};
|
|
63826
|
-
WRANGLER_CONFIG_FIELDS = {
|
|
63827
|
-
workersDev: "workers_dev",
|
|
63828
|
-
containerObservabilityTargetPercentage: "target_instance_percentage",
|
|
63829
|
-
containerObservabilityTargetCount: "target_instance_count"
|
|
63830
|
-
};
|
|
63831
|
-
WRANGLER_CLI_PRESENTATION = {
|
|
63832
|
-
cliName: "wrangler",
|
|
63833
|
-
displayName: "Wrangler",
|
|
63834
|
-
displayConfigFileName: "Wrangler config file",
|
|
63835
|
-
configFieldAssignmentSeparator: " = ",
|
|
63836
|
-
commands: WRANGLER_COMMANDS,
|
|
63837
|
-
configFields: WRANGLER_CONFIG_FIELDS
|
|
63838
|
-
};
|
|
63839
|
-
__name(resolveCliPresentation, "resolveCliPresentation");
|
|
63840
|
-
}
|
|
63841
|
-
});
|
|
63842
63790
|
async function fetchLatestNpmVersion(name2, version7) {
|
|
63843
63791
|
const distTag = version7.startsWith("0.0.0") ? "beta" : "latest";
|
|
63844
63792
|
let latest;
|
|
@@ -65919,7 +65867,6 @@ var init_src = __esm({
|
|
|
65919
65867
|
init_wrangler_tmp_dir();
|
|
65920
65868
|
init_tunnel();
|
|
65921
65869
|
init_cloudflared();
|
|
65922
|
-
init_cli_presentation();
|
|
65923
65870
|
init_cfetch();
|
|
65924
65871
|
init_update_check();
|
|
65925
65872
|
init_logger();
|
|
@@ -67705,7 +67652,6 @@ var init_esm2 = __esm({
|
|
|
67705
67652
|
|
|
67706
67653
|
// ../deploy-helpers/src/shared/context.ts
|
|
67707
67654
|
function initDeployHelpersContext(ctx) {
|
|
67708
|
-
cliPresentation = resolveCliPresentation(ctx.cliPresentation);
|
|
67709
67655
|
logger = ctx.logger;
|
|
67710
67656
|
fetchResult = ctx.fetchResult;
|
|
67711
67657
|
fetchListResult = ctx.fetchListResult;
|
|
@@ -67715,12 +67661,10 @@ function initDeployHelpersContext(ctx) {
|
|
|
67715
67661
|
prompt = ctx.prompt;
|
|
67716
67662
|
select = ctx.select;
|
|
67717
67663
|
}
|
|
67718
|
-
var logger, fetchResult, fetchListResult, fetchPagedListResult, confirm, prompt, select
|
|
67664
|
+
var logger, fetchResult, fetchListResult, fetchPagedListResult, confirm, prompt, select;
|
|
67719
67665
|
var init_context = __esm({
|
|
67720
67666
|
"../deploy-helpers/src/shared/context.ts"() {
|
|
67721
67667
|
init_import_meta_url();
|
|
67722
|
-
init_src();
|
|
67723
|
-
cliPresentation = resolveCliPresentation();
|
|
67724
67668
|
__name(initDeployHelpersContext, "initDeployHelpersContext");
|
|
67725
67669
|
}
|
|
67726
67670
|
});
|
|
@@ -67730,7 +67674,7 @@ var name, version2;
|
|
|
67730
67674
|
var init_package = __esm({
|
|
67731
67675
|
"package.json"() {
|
|
67732
67676
|
name = "wrangler";
|
|
67733
|
-
version2 = "4.151.
|
|
67677
|
+
version2 = "4.151.2";
|
|
67734
67678
|
}
|
|
67735
67679
|
});
|
|
67736
67680
|
|
|
@@ -144815,7 +144759,6 @@ ${grayBar} ${msg}`);
|
|
|
144815
144759
|
}
|
|
144816
144760
|
});
|
|
144817
144761
|
function initContainersSharedContext(ctx) {
|
|
144818
|
-
cliPresentation2 = resolveCliPresentation(ctx.cliPresentation);
|
|
144819
144762
|
logger3 = ctx.logger;
|
|
144820
144763
|
fetchResult3 = ctx.fetchResult;
|
|
144821
144764
|
if (ctx.fetchPagedListResult !== void 0) {
|
|
@@ -145009,7 +144952,7 @@ async function pullEgressInterceptorImage(dockerPath) {
|
|
|
145009
144952
|
}
|
|
145010
144953
|
await runDockerCmd(dockerPath, args);
|
|
145011
144954
|
}
|
|
145012
|
-
async function pullImage(dockerPath, options, logger22, complianceConfig) {
|
|
144955
|
+
async function pullImage(dockerPath, options, logger22, complianceConfig, registryConfigureCommand2) {
|
|
145013
144956
|
const domain3 = new URL(`http://${options.image_uri}`).hostname;
|
|
145014
144957
|
const isExternalRegistry = domain3 !== getCloudflareContainerRegistry2(complianceConfig);
|
|
145015
144958
|
try {
|
|
@@ -145020,7 +144963,7 @@ async function pullImage(dockerPath, options, logger22, complianceConfig) {
|
|
|
145020
144963
|
}
|
|
145021
144964
|
logger22?.warn(
|
|
145022
144965
|
`Unable to retrieve configured registry credentials from Cloudflare.
|
|
145023
|
-
Unless this is a public image, you will need to run \`${
|
|
144966
|
+
Unless this is a public image, you will need to run \`${registryConfigureCommand2}\` before deploying.
|
|
145024
144967
|
Attempting to pull image anyway...`
|
|
145025
144968
|
);
|
|
145026
144969
|
}
|
|
@@ -145066,7 +145009,7 @@ async function prepareContainerImagesForDev(args) {
|
|
|
145066
145009
|
dockerPath,
|
|
145067
145010
|
operation: "running dev",
|
|
145068
145011
|
imageNoun: containerOptions.length !== 1 ? "the configured images" : "the configured image",
|
|
145069
|
-
hint: `To suppress this error if you do not intend on triggering any container instances, set dev.enable_containers to false in your ${
|
|
145012
|
+
hint: `To suppress this error if you do not intend on triggering any container instances, set dev.enable_containers to false in your ${args.configFileName} or pass --enable-containers=false.`
|
|
145070
145013
|
});
|
|
145071
145014
|
for (const options of containerOptions) {
|
|
145072
145015
|
if ("dockerfile" in options) {
|
|
@@ -145097,7 +145040,8 @@ async function prepareContainerImagesForDev(args) {
|
|
|
145097
145040
|
dockerPath,
|
|
145098
145041
|
options,
|
|
145099
145042
|
args.logger,
|
|
145100
|
-
args.complianceConfig
|
|
145043
|
+
args.complianceConfig,
|
|
145044
|
+
args.registryConfigureCommand
|
|
145101
145045
|
);
|
|
145102
145046
|
onContainerImagePreparationStart({
|
|
145103
145047
|
containerOptions: options,
|
|
@@ -146202,7 +146146,12 @@ async function promiseSpinner(promise2, {
|
|
|
146202
146146
|
stop();
|
|
146203
146147
|
return t14;
|
|
146204
146148
|
}
|
|
146205
|
-
function createDurableObjectNamespaceResolver(config2, {
|
|
146149
|
+
function createDurableObjectNamespaceResolver(config2, {
|
|
146150
|
+
versionId,
|
|
146151
|
+
accountId,
|
|
146152
|
+
scriptName,
|
|
146153
|
+
dispatchNamespace
|
|
146154
|
+
}) {
|
|
146206
146155
|
const boundDOs = new Set(
|
|
146207
146156
|
config2.durable_objects.bindings.map((binding) => binding.class_name)
|
|
146208
146157
|
);
|
|
@@ -146244,7 +146193,15 @@ function createDurableObjectNamespaceResolver(config2, { versionId, accountId, s
|
|
|
146244
146193
|
return targetDurableObject.id;
|
|
146245
146194
|
};
|
|
146246
146195
|
}
|
|
146247
|
-
async function deployContainers(config2, containerDeployments, {
|
|
146196
|
+
async function deployContainers(config2, containerDeployments, {
|
|
146197
|
+
versionId,
|
|
146198
|
+
accountId,
|
|
146199
|
+
scriptName,
|
|
146200
|
+
dispatchNamespace,
|
|
146201
|
+
configFileName: configFileName2,
|
|
146202
|
+
observabilityTargetPercentageField,
|
|
146203
|
+
observabilityTargetCountField
|
|
146204
|
+
}) {
|
|
146248
146205
|
const resolveNamespaceId = createDurableObjectNamespaceResolver(config2, {
|
|
146249
146206
|
versionId,
|
|
146250
146207
|
accountId,
|
|
@@ -146256,7 +146213,10 @@ async function deployContainers(config2, containerDeployments, { versionId, acco
|
|
|
146256
146213
|
await apply(
|
|
146257
146214
|
{
|
|
146258
146215
|
imageRef,
|
|
146259
|
-
durable_object_namespace_id: namespaceId
|
|
146216
|
+
durable_object_namespace_id: namespaceId,
|
|
146217
|
+
configFileName: configFileName2,
|
|
146218
|
+
observabilityTargetPercentageField,
|
|
146219
|
+
observabilityTargetCountField
|
|
146260
146220
|
},
|
|
146261
146221
|
container,
|
|
146262
146222
|
config2,
|
|
@@ -146431,7 +146391,7 @@ function buildApplicationObservabilityPatch(observability, writeTarget, prevApp)
|
|
|
146431
146391
|
}
|
|
146432
146392
|
return nextTopLevelObservability !== void 0 ? { observability: nextTopLevelObservability } : {};
|
|
146433
146393
|
}
|
|
146434
|
-
function assertCanUseApplicationObservabilityTargeting(prevApp, containerConfig) {
|
|
146394
|
+
function assertCanUseApplicationObservabilityTargeting(prevApp, containerConfig, options) {
|
|
146435
146395
|
if (!hasTopLevelOnlyObservabilityFields(containerConfig.observability)) {
|
|
146436
146396
|
return;
|
|
146437
146397
|
}
|
|
@@ -146439,7 +146399,7 @@ function assertCanUseApplicationObservabilityTargeting(prevApp, containerConfig)
|
|
|
146439
146399
|
return;
|
|
146440
146400
|
}
|
|
146441
146401
|
throw new UserError(
|
|
146442
|
-
`Application-level observability targeting cannot be enabled for container ${containerConfig.name} while it still uses legacy rollout-based observability. Set containers[].observability.enabled = false in your ${
|
|
146402
|
+
`Application-level observability targeting cannot be enabled for container ${containerConfig.name} while it still uses legacy rollout-based observability. Set containers[].observability.enabled = false in your ${options.configFileName} and deploy once, then deploy again with ${options.observabilityTargetPercentageField} or ${options.observabilityTargetCountField}.`,
|
|
146443
146403
|
{
|
|
146444
146404
|
telemetryMessage: "containers deploy observability migration blocked"
|
|
146445
146405
|
}
|
|
@@ -146572,7 +146532,11 @@ async function apply(args, containerConfig, config2, accountId) {
|
|
|
146572
146532
|
}
|
|
146573
146533
|
const observabilityWriteTarget = selectObservabilityWriteTarget(prevApp);
|
|
146574
146534
|
if (prevApp !== void 0) {
|
|
146575
|
-
assertCanUseApplicationObservabilityTargeting(
|
|
146535
|
+
assertCanUseApplicationObservabilityTargeting(
|
|
146536
|
+
prevApp,
|
|
146537
|
+
containerConfig,
|
|
146538
|
+
args
|
|
146539
|
+
);
|
|
146576
146540
|
}
|
|
146577
146541
|
const appConfig = stripUndefined(
|
|
146578
146542
|
mergeIfUnsafe(
|
|
@@ -146968,7 +146932,7 @@ function indexContainersByName(containers) {
|
|
|
146968
146932
|
}
|
|
146969
146933
|
return containersByName;
|
|
146970
146934
|
}
|
|
146971
|
-
async function sshCommand(sshArgs) {
|
|
146935
|
+
async function sshCommand(sshArgs, userAgent) {
|
|
146972
146936
|
const useStdio = shouldUseStdio(sshArgs);
|
|
146973
146937
|
let sshResponse;
|
|
146974
146938
|
try {
|
|
@@ -146990,7 +146954,7 @@ async function sshCommand(sshArgs) {
|
|
|
146990
146954
|
const ws = new import_websocket.default(sshResponse.url, {
|
|
146991
146955
|
headers: {
|
|
146992
146956
|
authorization: `Bearer ${sshResponse.token}`,
|
|
146993
|
-
"user-agent":
|
|
146957
|
+
"user-agent": userAgent
|
|
146994
146958
|
}
|
|
146995
146959
|
});
|
|
146996
146960
|
ws.binaryType = "arraybuffer";
|
|
@@ -147418,18 +147382,18 @@ async function getCreds(permissions, complianceConfig) {
|
|
|
147418
147382
|
function isValidImageTag(value) {
|
|
147419
147383
|
return IMAGE_TAG_REGEXP.test(value);
|
|
147420
147384
|
}
|
|
147421
|
-
var require$13, __create2, __defProp5, __getOwnPropDesc2, __getOwnPropNames3, __getProtoOf2, __hasOwnProp2, __name5, __require2, __commonJS3, __copyProps2, __toESM2, require_constants7, require_buffer_util, require_limiter, require_permessage_deflate2, require_validation, require_receiver2, require_sender2, require_event_target, require_extension, require_websocket2, require_stream, require_subprotocol, require_websocket_server, ApiError, CancelError2, CancelablePromise, OpenAPI, isDefined, isString2, isStringWithValue, isBlob3, isErrorResponse, base643, getQueryString, getUrl, getFormData, resolve10, getHeaders2, getRequestBody, isResponseSchemaV4, parseResponseSchemaV4, sendRequest, getResponseHeader, getResponseBody, catchErrorCodes, executeRequest, buildApiResult, request, requestPaginated, debugLogRequest, debugLogResponse, ApplicationRollout, AssignIPv4, AssignIPv6, BadRequestWithCodeError, ContainerImagePreparationStatus, CreateApplicationRolloutRequest, DeploymentMutationError, DeploymentNotFoundError, ExternalRegistryKind, ImageRegistryAlreadyExistsError, ImageRegistryIsPublic, ImageRegistryNotAllowedError, ImageRegistryNotFoundError, ImageRegistryProtocolAlreadyExists, ImageRegistryProtocolIsReferencedError, ImageRegistryProtocolNotFound, InstanceType, ProvisionerConfiguration, RolloutStep, SchedulingPolicy, SecretNameAlreadyExists, SecretNotFound, SSHPublicKeyNotFoundError, UpdateApplicationRolloutRequest, AccountService, ApplicationsService, ContainerImagePreparationsService, DeploymentsService, ImageRegistriesService, PlacementsService, RolloutsService, SshPublicKeysService, noop, logger3, fetchResult3, fetchPagedListResult3,
|
|
147385
|
+
var require$13, __create2, __defProp5, __getOwnPropDesc2, __getOwnPropNames3, __getProtoOf2, __hasOwnProp2, __name5, __require2, __commonJS3, __copyProps2, __toESM2, require_constants7, require_buffer_util, require_limiter, require_permessage_deflate2, require_validation, require_receiver2, require_sender2, require_event_target, require_extension, require_websocket2, require_stream, require_subprotocol, require_websocket_server, ApiError, CancelError2, CancelablePromise, OpenAPI, isDefined, isString2, isStringWithValue, isBlob3, isErrorResponse, base643, getQueryString, getUrl, getFormData, resolve10, getHeaders2, getRequestBody, isResponseSchemaV4, parseResponseSchemaV4, sendRequest, getResponseHeader, getResponseBody, catchErrorCodes, executeRequest, buildApiResult, request, requestPaginated, debugLogRequest, debugLogResponse, ApplicationRollout, AssignIPv4, AssignIPv6, BadRequestWithCodeError, ContainerImagePreparationStatus, CreateApplicationRolloutRequest, DeploymentMutationError, DeploymentNotFoundError, ExternalRegistryKind, ImageRegistryAlreadyExistsError, ImageRegistryIsPublic, ImageRegistryNotAllowedError, ImageRegistryNotFoundError, ImageRegistryProtocolAlreadyExists, ImageRegistryProtocolIsReferencedError, ImageRegistryProtocolNotFound, InstanceType, ProvisionerConfiguration, RolloutStep, SchedulingPolicy, SecretNameAlreadyExists, SecretNotFound, SSHPublicKeyNotFoundError, UpdateApplicationRolloutRequest, AccountService, ApplicationsService, ContainerImagePreparationsService, DeploymentsService, ImageRegistriesService, PlacementsService, RolloutsService, SshPublicKeysService, noop, logger3, fetchResult3, fetchPagedListResult3, getCloudflareRegistryWithAccountNamespace, MF_DEV_CONTAINER_PREFIX, getDevContainerImageName, runDockerCmd, runDockerCmdWithOutput, isDockerRunning, verifyDockerInstalled, cleanupContainers, getContainerIdsFromImage, DEFAULT_CONTAINER_EGRESS_INTERCEPTOR_IMAGE, getAndValidateRegistryType, MB, MiB, instanceTypes, LEGACY_TO_CANONICAL, MAX_DOCKER_REPOSITORY_NAME_LENGTH, DIGEST_SUFFIX_REGEXP, DIGEST_VALUE_REGEXP, TAG_SUFFIX_REGEXP, BUILD_OUTPUT_IMAGE_NAMESPACE, DOCKER_REPOSITORY_NAME_LENGTH, Diff, doAction, configRolloutStepsToAPI, MAX_DOCKER_REPOSITORY_NAME_LENGTH2, MAX_NAMED_IMAGE_SLUG_LENGTH, IMAGE_ID_HASH_LENGTH, import_websocket, containersSshOptions, MAX_REPOSITORY_LENGTH, REPOSITORY_COMPONENT_REGEXP, TAG_REGEXP, IMAGE_TAG_REGEXP;
|
|
147422
147386
|
var init_dist9 = __esm({
|
|
147423
147387
|
"../containers-shared/dist/index.mjs"() {
|
|
147424
147388
|
init_import_meta_url();
|
|
147425
147389
|
init_docker_path();
|
|
147426
147390
|
init_errors();
|
|
147427
147391
|
init_fs_helpers();
|
|
147428
|
-
init_src();
|
|
147429
147392
|
init_compliance();
|
|
147430
147393
|
init_dist4();
|
|
147431
147394
|
init_dist5();
|
|
147432
147395
|
init_colors();
|
|
147396
|
+
init_src();
|
|
147433
147397
|
init_interactive();
|
|
147434
147398
|
require$13 = nodeModule.createRequire(import_meta_url || (typeof __filename === "string" ? __filename : "/"));
|
|
147435
147399
|
__create2 = Object.create;
|
|
@@ -153427,7 +153391,6 @@ var init_dist9 = __esm({
|
|
|
153427
153391
|
fetchPagedListResult3 = /* @__PURE__ */ __name5(() => {
|
|
153428
153392
|
throw new Error("initContainersSharedContext() must be called first");
|
|
153429
153393
|
}, "fetchPagedListResult");
|
|
153430
|
-
cliPresentation2 = resolveCliPresentation();
|
|
153431
153394
|
__name(initContainersSharedContext, "initContainersSharedContext");
|
|
153432
153395
|
__name5(initContainersSharedContext, "initContainersSharedContext");
|
|
153433
153396
|
getCloudflareRegistryWithAccountNamespace = /* @__PURE__ */ __name5((accountID, tag, complianceConfig) => {
|
|
@@ -163847,7 +163810,7 @@ function describeConflictOwner(remote) {
|
|
|
163847
163810
|
if (remote.source === "wrangler") {
|
|
163848
163811
|
return remote.owner_worker_name ? `owned by worker "${remote.owner_worker_name}"` : "owned by another Worker";
|
|
163849
163812
|
}
|
|
163850
|
-
return
|
|
163813
|
+
return "managed outside this deployment";
|
|
163851
163814
|
}
|
|
163852
163815
|
function renderEmailRoutingPlan(plan, workerName) {
|
|
163853
163816
|
const lines = [];
|
|
@@ -163908,7 +163871,6 @@ var init_email_routing_plan = __esm({
|
|
|
163908
163871
|
"../deploy-helpers/src/triggers/email-routing-plan.ts"() {
|
|
163909
163872
|
init_import_meta_url();
|
|
163910
163873
|
init_source();
|
|
163911
|
-
init_context();
|
|
163912
163874
|
__name(isCatchAllAddress, "isCatchAllAddress");
|
|
163913
163875
|
__name(ruleShapeForTarget, "ruleShapeForTarget");
|
|
163914
163876
|
__name(buildEmailRoutingPlanRequest, "buildEmailRoutingPlanRequest");
|
|
@@ -164566,18 +164528,24 @@ async function listQueues(complianceConfig, accountId, page, name2) {
|
|
|
164566
164528
|
params
|
|
164567
164529
|
);
|
|
164568
164530
|
}
|
|
164569
|
-
async function getQueue(complianceConfig, accountId, queueName) {
|
|
164531
|
+
async function getQueue(complianceConfig, accountId, queueName, queueCreateCommand2) {
|
|
164570
164532
|
const queues = await listQueues(complianceConfig, accountId, 1, queueName);
|
|
164571
164533
|
if (queues.length === 0) {
|
|
164534
|
+
const createQueueGuidance = queueCreateCommand2 ? ` To create it, run: ${queueCreateCommand2(queueName)}` : "";
|
|
164572
164535
|
throw new UserError(
|
|
164573
|
-
`Queue "${queueName}" does not exist
|
|
164536
|
+
`Queue "${queueName}" does not exist.${createQueueGuidance}`,
|
|
164574
164537
|
{ telemetryMessage: "queues lookup missing queue" }
|
|
164575
164538
|
);
|
|
164576
164539
|
}
|
|
164577
164540
|
return queues[0];
|
|
164578
164541
|
}
|
|
164579
|
-
async function postConsumer(complianceConfig, accountId, queueName, body) {
|
|
164580
|
-
const queue = await getQueue(
|
|
164542
|
+
async function postConsumer(complianceConfig, accountId, queueName, body, queueCreateCommand2) {
|
|
164543
|
+
const queue = await getQueue(
|
|
164544
|
+
complianceConfig,
|
|
164545
|
+
accountId,
|
|
164546
|
+
queueName,
|
|
164547
|
+
queueCreateCommand2
|
|
164548
|
+
);
|
|
164581
164549
|
return postConsumerById(complianceConfig, accountId, queue.queue_id, body);
|
|
164582
164550
|
}
|
|
164583
164551
|
async function postConsumerById(config2, accountId, queueId, body) {
|
|
@@ -164600,8 +164568,13 @@ async function putConsumerById(complianceConfig, accountId, queueId, consumerId,
|
|
|
164600
164568
|
}
|
|
164601
164569
|
);
|
|
164602
164570
|
}
|
|
164603
|
-
async function putConsumer(complianceConfig, accountId, queueName, scriptName, envName, body) {
|
|
164604
|
-
const queue = await getQueue(
|
|
164571
|
+
async function putConsumer(complianceConfig, accountId, queueName, scriptName, envName, body, queueCreateCommand2) {
|
|
164572
|
+
const queue = await getQueue(
|
|
164573
|
+
complianceConfig,
|
|
164574
|
+
accountId,
|
|
164575
|
+
queueName,
|
|
164576
|
+
queueCreateCommand2
|
|
164577
|
+
);
|
|
164605
164578
|
const targetConsumer = await resolveWorkerConsumerByName(
|
|
164606
164579
|
complianceConfig,
|
|
164607
164580
|
accountId,
|
|
@@ -164672,8 +164645,13 @@ async function deleteConsumerById(complianceConfig, accountId, queueId, consumer
|
|
|
164672
164645
|
}
|
|
164673
164646
|
);
|
|
164674
164647
|
}
|
|
164675
|
-
async function deletePullConsumer(complianceConfig, accountId, queueName) {
|
|
164676
|
-
const queue = await getQueue(
|
|
164648
|
+
async function deletePullConsumer(complianceConfig, accountId, queueName, queueCreateCommand2) {
|
|
164649
|
+
const queue = await getQueue(
|
|
164650
|
+
complianceConfig,
|
|
164651
|
+
accountId,
|
|
164652
|
+
queueName,
|
|
164653
|
+
queueCreateCommand2
|
|
164654
|
+
);
|
|
164677
164655
|
const consumer = queue.consumers[0];
|
|
164678
164656
|
if (consumer?.type !== "http_pull") {
|
|
164679
164657
|
throw new UserError(`No http_pull consumer exists for queue ${queueName}`, {
|
|
@@ -164687,12 +164665,22 @@ async function deletePullConsumer(complianceConfig, accountId, queueName) {
|
|
|
164687
164665
|
consumer.consumer_id
|
|
164688
164666
|
);
|
|
164689
164667
|
}
|
|
164690
|
-
async function listConsumers(complianceConfig, accountId, queueName) {
|
|
164691
|
-
const queue = await getQueue(
|
|
164668
|
+
async function listConsumers(complianceConfig, accountId, queueName, queueCreateCommand2) {
|
|
164669
|
+
const queue = await getQueue(
|
|
164670
|
+
complianceConfig,
|
|
164671
|
+
accountId,
|
|
164672
|
+
queueName,
|
|
164673
|
+
queueCreateCommand2
|
|
164674
|
+
);
|
|
164692
164675
|
return queue.consumers;
|
|
164693
164676
|
}
|
|
164694
|
-
async function deleteWorkerConsumer(complianceConfig, accountId, queueName, scriptName, envName) {
|
|
164695
|
-
const queue = await getQueue(
|
|
164677
|
+
async function deleteWorkerConsumer(complianceConfig, accountId, queueName, scriptName, envName, queueCreateCommand2) {
|
|
164678
|
+
const queue = await getQueue(
|
|
164679
|
+
complianceConfig,
|
|
164680
|
+
accountId,
|
|
164681
|
+
queueName,
|
|
164682
|
+
queueCreateCommand2
|
|
164683
|
+
);
|
|
164696
164684
|
const targetConsumer = await resolveWorkerConsumerByName(
|
|
164697
164685
|
complianceConfig,
|
|
164698
164686
|
accountId,
|
|
@@ -164707,11 +164695,16 @@ async function deleteWorkerConsumer(complianceConfig, accountId, queueName, scri
|
|
|
164707
164695
|
targetConsumer.consumer_id
|
|
164708
164696
|
);
|
|
164709
164697
|
}
|
|
164710
|
-
async function updateQueueConsumers(complianceConfig, accountId, scriptName, config2) {
|
|
164698
|
+
async function updateQueueConsumers(complianceConfig, accountId, scriptName, config2, queueCreateCommand2) {
|
|
164711
164699
|
const consumers = config2.queues.consumers || [];
|
|
164712
164700
|
const updateConsumers = [];
|
|
164713
164701
|
for (const consumer of consumers) {
|
|
164714
|
-
const queue = await getQueue(
|
|
164702
|
+
const queue = await getQueue(
|
|
164703
|
+
complianceConfig,
|
|
164704
|
+
accountId,
|
|
164705
|
+
consumer.queue,
|
|
164706
|
+
queueCreateCommand2
|
|
164707
|
+
);
|
|
164715
164708
|
const body = {
|
|
164716
164709
|
type: "worker",
|
|
164717
164710
|
dead_letter_queue: consumer.dead_letter_queue,
|
|
@@ -164736,7 +164729,8 @@ async function updateQueueConsumers(complianceConfig, accountId, scriptName, con
|
|
|
164736
164729
|
consumer.queue,
|
|
164737
164730
|
scriptName,
|
|
164738
164731
|
envName,
|
|
164739
|
-
body
|
|
164732
|
+
body,
|
|
164733
|
+
queueCreateCommand2
|
|
164740
164734
|
).then(
|
|
164741
164735
|
() => ({ targets: [`Consumer for ${consumer.queue}`] }),
|
|
164742
164736
|
(error64) => ({ targets: [], error: error64 })
|
|
@@ -164745,7 +164739,13 @@ async function updateQueueConsumers(complianceConfig, accountId, scriptName, con
|
|
|
164745
164739
|
continue;
|
|
164746
164740
|
}
|
|
164747
164741
|
updateConsumers.push(
|
|
164748
|
-
postConsumer(
|
|
164742
|
+
postConsumer(
|
|
164743
|
+
complianceConfig,
|
|
164744
|
+
accountId,
|
|
164745
|
+
consumer.queue,
|
|
164746
|
+
body,
|
|
164747
|
+
queueCreateCommand2
|
|
164748
|
+
).then(
|
|
164749
164749
|
() => ({
|
|
164750
164750
|
targets: [`Consumer for ${consumer.queue}`]
|
|
164751
164751
|
}),
|
|
@@ -164755,7 +164755,7 @@ async function updateQueueConsumers(complianceConfig, accountId, scriptName, con
|
|
|
164755
164755
|
}
|
|
164756
164756
|
return updateConsumers;
|
|
164757
164757
|
}
|
|
164758
|
-
async function ensureQueuesExistByConfig(config2, accountId, includeProducers = true, scriptName) {
|
|
164758
|
+
async function ensureQueuesExistByConfig(config2, accountId, includeProducers = true, scriptName, queueCreateCommand2) {
|
|
164759
164759
|
const producerNames = (config2.queues.producers || []).flatMap((producer) => {
|
|
164760
164760
|
if (producer.queue) {
|
|
164761
164761
|
return [producer.queue];
|
|
@@ -164786,8 +164786,9 @@ async function ensureQueuesExistByConfig(config2, accountId, includeProducers =
|
|
|
164786
164786
|
const queueSet = new Set(existingQueues);
|
|
164787
164787
|
for (const queue of queueNames) {
|
|
164788
164788
|
if (!queueSet.has(queue)) {
|
|
164789
|
+
const createQueueGuidance = queueCreateCommand2 ? ` To create it, run: ${queueCreateCommand2(queue)}` : "";
|
|
164789
164790
|
throw new UserError(
|
|
164790
|
-
`Queue "${queue}" does not exist
|
|
164791
|
+
`Queue "${queue}" does not exist.${createQueueGuidance}`,
|
|
164791
164792
|
{ telemetryMessage: "queues config missing queue" }
|
|
164792
164793
|
);
|
|
164793
164794
|
}
|
|
@@ -164983,7 +164984,7 @@ async function registerSubdomain(complianceConfig, accountId, configPath, regist
|
|
|
164983
164984
|
if (subdomainAvailabilityCheckError.code === 10032) ; else if (subdomainAvailabilityCheckError.code === 10031) {
|
|
164984
164985
|
if (automaticSubdomain) {
|
|
164985
164986
|
throw new UserError(
|
|
164986
|
-
|
|
164987
|
+
`Could not automatically register "${potentialName}" as your workers.dev subdomain because the name is unavailable. Register a different subdomain at https://dash.cloudflare.com/${accountId}/workers/onboarding.`,
|
|
164987
164988
|
{
|
|
164988
164989
|
telemetryMessage: "workers dev automatic registration name unavailable"
|
|
164989
164990
|
}
|
|
@@ -164996,7 +164997,7 @@ async function registerSubdomain(complianceConfig, accountId, configPath, regist
|
|
|
164996
164997
|
} else {
|
|
164997
164998
|
if (automaticSubdomain) {
|
|
164998
164999
|
throw new UserError(
|
|
164999
|
-
|
|
165000
|
+
`Could not verify whether "${potentialName}" is available as your \`workers.dev\` subdomain. Register a subdomain at https://dash.cloudflare.com/${accountId}/workers/onboarding.`,
|
|
165000
165001
|
{
|
|
165001
165002
|
telemetryMessage: "workers dev automatic registration availability check failed"
|
|
165002
165003
|
}
|
|
@@ -165035,7 +165036,7 @@ async function registerSubdomain(complianceConfig, accountId, configPath, regist
|
|
|
165035
165036
|
const subdomainCreationError = err;
|
|
165036
165037
|
if (automaticSubdomain) {
|
|
165037
165038
|
throw new UserError(
|
|
165038
|
-
|
|
165039
|
+
`Could not automatically register "${potentialName}" as your \`workers.dev\` subdomain. Register a subdomain at https://dash.cloudflare.com/${accountId}/workers/onboarding.`,
|
|
165039
165040
|
{
|
|
165040
165041
|
telemetryMessage: "workers dev automatic registration creation failed"
|
|
165041
165042
|
}
|
|
@@ -165094,7 +165095,13 @@ async function triggersDeploy(props) {
|
|
|
165094
165095
|
const { accountId } = props;
|
|
165095
165096
|
assert38__default.default(accountId);
|
|
165096
165097
|
if (props.validated !== true) {
|
|
165097
|
-
await ensureQueuesExistByConfig(
|
|
165098
|
+
await ensureQueuesExistByConfig(
|
|
165099
|
+
config2,
|
|
165100
|
+
accountId,
|
|
165101
|
+
true,
|
|
165102
|
+
scriptName,
|
|
165103
|
+
props.queueCreateCommand
|
|
165104
|
+
);
|
|
165098
165105
|
}
|
|
165099
165106
|
const routesOnly = [];
|
|
165100
165107
|
const customDomainsOnly = [];
|
|
@@ -165248,7 +165255,8 @@ ${dashLink}`, {
|
|
|
165248
165255
|
config2,
|
|
165249
165256
|
accountId,
|
|
165250
165257
|
scriptName,
|
|
165251
|
-
config2
|
|
165258
|
+
config2,
|
|
165259
|
+
props.queueCreateCommand
|
|
165252
165260
|
);
|
|
165253
165261
|
deployments.push(
|
|
165254
165262
|
...consumerUpdates.map(
|
|
@@ -165525,9 +165533,8 @@ function getSubdomainValuesAPIMock(config_workers_dev, config_preview_urls, rout
|
|
|
165525
165533
|
preview_urls
|
|
165526
165534
|
};
|
|
165527
165535
|
}
|
|
165528
|
-
function renderWorkersDevDefaultWarning(beforeEnabled, afterEnabled) {
|
|
165529
|
-
const
|
|
165530
|
-
const workersDevAssignment = `${workersDevField}${cliPresentation.configFieldAssignmentSeparator}${beforeEnabled}`;
|
|
165536
|
+
function renderWorkersDevDefaultWarning(beforeEnabled, afterEnabled, configFile, workersDevConfigFieldName, workersDevConfigAssignment) {
|
|
165537
|
+
const workersDevAssignment = workersDevConfigAssignment(beforeEnabled);
|
|
165531
165538
|
const status2 = /* @__PURE__ */ __name((enabled, past) => {
|
|
165532
165539
|
if (past) {
|
|
165533
165540
|
return enabled ? "enabled" : "disabled";
|
|
@@ -165536,11 +165543,11 @@ function renderWorkersDevDefaultWarning(beforeEnabled, afterEnabled) {
|
|
|
165536
165543
|
}
|
|
165537
165544
|
}, "status");
|
|
165538
165545
|
return [
|
|
165539
|
-
`Because '${
|
|
165540
|
-
`To override this setting, you can ${status2(beforeEnabled, false)} workers.dev by explicitly setting '${workersDevAssignment}' in your ${
|
|
165546
|
+
`Because '${workersDevConfigFieldName}' is not in your ${configFile}, it will be ${status2(afterEnabled, true)} for this deployment by default.`,
|
|
165547
|
+
`To override this setting, you can ${status2(beforeEnabled, false)} workers.dev by explicitly setting '${workersDevAssignment}' in your ${configFile}.`
|
|
165541
165548
|
].join("\n");
|
|
165542
165549
|
}
|
|
165543
|
-
async function validateSubdomainMixedState(scriptName, before, after, previewURLSuffix, firstDeploy) {
|
|
165550
|
+
async function validateSubdomainMixedState(scriptName, before, after, previewURLSuffix, firstDeploy, configFile, previewUrlsConfigAssignment) {
|
|
165544
165551
|
const changed = after.workers_dev !== before.workers_dev || after.preview_urls !== before.preview_urls;
|
|
165545
165552
|
if (!changed) {
|
|
165546
165553
|
return after;
|
|
@@ -165565,7 +165572,7 @@ async function validateSubdomainMixedState(scriptName, before, after, previewURL
|
|
|
165565
165572
|
"Preview URLs will automatically generate a unique, shareable link for each new version which will be accessible at:",
|
|
165566
165573
|
` ${previewUrl}`,
|
|
165567
165574
|
"",
|
|
165568
|
-
`To prevent this Worker from being unintentionally public, you may want to disable the Preview URLs as well by setting
|
|
165575
|
+
`To prevent this Worker from being unintentionally public, you may want to disable the Preview URLs as well by setting \`${previewUrlsConfigAssignment(false)}\` in your ${configFile}.`
|
|
165569
165576
|
].join("\n")
|
|
165570
165577
|
);
|
|
165571
165578
|
}
|
|
@@ -165576,7 +165583,7 @@ async function validateSubdomainMixedState(scriptName, before, after, previewURL
|
|
|
165576
165583
|
"Preview URLs will automatically generate a unique, shareable link for each new version which will be accessible at:",
|
|
165577
165584
|
` ${previewUrl}`,
|
|
165578
165585
|
"",
|
|
165579
|
-
`You may want to enable the Preview URLs as well by setting
|
|
165586
|
+
`You may want to enable the Preview URLs as well by setting \`${previewUrlsConfigAssignment(true)}\` in your ${configFile}.`
|
|
165580
165587
|
].join("\n")
|
|
165581
165588
|
);
|
|
165582
165589
|
}
|
|
@@ -165584,6 +165591,10 @@ async function validateSubdomainMixedState(scriptName, before, after, previewURL
|
|
|
165584
165591
|
}
|
|
165585
165592
|
async function subdomainDeploy(props, accountId, scriptName, workerUrl, routes, deployments, firstDeploy) {
|
|
165586
165593
|
const { config: config2 } = props;
|
|
165594
|
+
const displayConfigFileName = configFileName(
|
|
165595
|
+
config2.configPath,
|
|
165596
|
+
config2.userConfigPath
|
|
165597
|
+
);
|
|
165587
165598
|
const { workers_dev: wantWorkersDev, preview_urls: wantPreviews } = getSubdomainValues(config2.workers_dev, config2.preview_urls, routes);
|
|
165588
165599
|
const before = await getWorkerSubdomain(config2, accountId, scriptName);
|
|
165589
165600
|
if (wantWorkersDev) {
|
|
@@ -165611,7 +165622,15 @@ async function subdomainDeploy(props, accountId, scriptName, workerUrl, routes,
|
|
|
165611
165622
|
logger
|
|
165612
165623
|
);
|
|
165613
165624
|
if (!firstDeploy && config2.workers_dev == void 0 && after.enabled !== before.enabled) {
|
|
165614
|
-
logger.warn(
|
|
165625
|
+
logger.warn(
|
|
165626
|
+
renderWorkersDevDefaultWarning(
|
|
165627
|
+
before.enabled,
|
|
165628
|
+
after.enabled,
|
|
165629
|
+
displayConfigFileName,
|
|
165630
|
+
props.workersDevConfigFieldName,
|
|
165631
|
+
props.workersDevConfigAssignment
|
|
165632
|
+
)
|
|
165633
|
+
);
|
|
165615
165634
|
}
|
|
165616
165635
|
if (!firstDeploy && config2.preview_urls == void 0 && after.previews_enabled !== before.previews_enabled) {
|
|
165617
165636
|
const status2 = /* @__PURE__ */ __name((enabled, past) => {
|
|
@@ -165623,8 +165642,8 @@ async function subdomainDeploy(props, accountId, scriptName, workerUrl, routes,
|
|
|
165623
165642
|
}, "status");
|
|
165624
165643
|
logger.warn(
|
|
165625
165644
|
[
|
|
165626
|
-
`Because your 'workers.dev' route is ${status2(after.enabled, true)} and your '
|
|
165627
|
-
`To override this setting, you can ${status2(before.previews_enabled, false)} Preview URLs by explicitly setting '
|
|
165645
|
+
`Because your 'workers.dev' route is ${status2(after.enabled, true)} and your '${props.previewUrlsConfigFieldName}' setting is not in your ${displayConfigFileName}, Preview URLs will be ${status2(after.previews_enabled, true)} for this deployment by default.`,
|
|
165646
|
+
`To override this setting, you can ${status2(before.previews_enabled, false)} Preview URLs by explicitly setting '${props.previewUrlsConfigAssignment(before.previews_enabled)}' in your ${displayConfigFileName}.`
|
|
165628
165647
|
].join("\n")
|
|
165629
165648
|
);
|
|
165630
165649
|
}
|
|
@@ -165633,7 +165652,9 @@ async function subdomainDeploy(props, accountId, scriptName, workerUrl, routes,
|
|
|
165633
165652
|
{ workers_dev: before.enabled, preview_urls: before.previews_enabled },
|
|
165634
165653
|
{ workers_dev: after.enabled, preview_urls: after.previews_enabled },
|
|
165635
165654
|
before.preview_url_suffix,
|
|
165636
|
-
firstDeploy
|
|
165655
|
+
firstDeploy,
|
|
165656
|
+
displayConfigFileName,
|
|
165657
|
+
props.previewUrlsConfigAssignment
|
|
165637
165658
|
);
|
|
165638
165659
|
return {
|
|
165639
165660
|
wantWorkersDev,
|
|
@@ -168374,13 +168395,13 @@ var init_versions_api = __esm({
|
|
|
168374
168395
|
});
|
|
168375
168396
|
|
|
168376
168397
|
// ../deploy-helpers/src/deploy/helpers/confirm-latest-deployment-overwrite.ts
|
|
168377
|
-
async function confirmLatestDeploymentOverwriteAndGetLatest(config2, accountId, scriptName) {
|
|
168398
|
+
async function confirmLatestDeploymentOverwriteAndGetLatest(config2, accountId, scriptName, deployCommand2, versionsDeployCommand2) {
|
|
168378
168399
|
try {
|
|
168379
168400
|
const latest = await fetchLatestDeployment(config2, accountId, scriptName);
|
|
168380
168401
|
if (latest && latest.versions.length >= 2) {
|
|
168381
168402
|
const versionCache = /* @__PURE__ */ new Map();
|
|
168382
168403
|
warn(
|
|
168383
|
-
`Your last deployment has multiple versions. To progress that deployment use "${
|
|
168404
|
+
`Your last deployment has multiple versions. To progress that deployment use "${versionsDeployCommand2}" instead.`,
|
|
168384
168405
|
{ shape: shapes.corners.tl, newlineBefore: false }
|
|
168385
168406
|
);
|
|
168386
168407
|
newline();
|
|
@@ -168394,7 +168415,7 @@ async function confirmLatestDeploymentOverwriteAndGetLatest(config2, accountId,
|
|
|
168394
168415
|
);
|
|
168395
168416
|
const confirmed = await inputPrompt({
|
|
168396
168417
|
type: "confirm",
|
|
168397
|
-
question: `"${
|
|
168418
|
+
question: `"${deployCommand2}" will upload a new version and deploy it globally immediately.
|
|
168398
168419
|
Are you sure you want to continue?`,
|
|
168399
168420
|
label: "",
|
|
168400
168421
|
defaultValue: isNonInteractiveOrCI(),
|
|
@@ -168446,7 +168467,6 @@ var init_confirm_latest_deployment_overwrite = __esm({
|
|
|
168446
168467
|
init_colors();
|
|
168447
168468
|
init_interactive();
|
|
168448
168469
|
init_src();
|
|
168449
|
-
init_context();
|
|
168450
168470
|
init_versions_api();
|
|
168451
168471
|
init_worker_not_found_error();
|
|
168452
168472
|
BLANK_INPUT = "-";
|
|
@@ -169539,7 +169559,12 @@ function validateApplicationIdentity(application, namespaceId, existing) {
|
|
|
169539
169559
|
);
|
|
169540
169560
|
}
|
|
169541
169561
|
}
|
|
169542
|
-
async function validateImageLessContainerApplicationsForUpload(config2, containers, {
|
|
169562
|
+
async function validateImageLessContainerApplicationsForUpload(config2, containers, {
|
|
169563
|
+
accountId,
|
|
169564
|
+
scriptName,
|
|
169565
|
+
deployCommand: deployCommand2,
|
|
169566
|
+
versionsUploadCommand: versionsUploadCommand2
|
|
169567
|
+
}) {
|
|
169543
169568
|
const imageLessContainers = getResolvedDurableObjectContainerApps(
|
|
169544
169569
|
containers,
|
|
169545
169570
|
config2.exports
|
|
@@ -169564,7 +169589,7 @@ async function validateImageLessContainerApplicationsForUpload(config2, containe
|
|
|
169564
169589
|
}
|
|
169565
169590
|
if (namespace === void 0 || existing === void 0) {
|
|
169566
169591
|
throw new UserError(
|
|
169567
|
-
`Container "${container.name}" has no named images and has not been provisioned. Run \`${
|
|
169592
|
+
`Container "${container.name}" has no named images and has not been provisioned. Run \`${deployCommand2}\` to create its Durable Object-managed application before using \`${versionsUploadCommand2}\`, or configure at least one named image.`,
|
|
169568
169593
|
{
|
|
169569
169594
|
telemetryMessage: "versions upload image less container application missing"
|
|
169570
169595
|
}
|
|
@@ -169733,12 +169758,14 @@ async function prepareDurableObjectContainerApplications(config2, durableObjectC
|
|
|
169733
169758
|
dryRun,
|
|
169734
169759
|
scriptName,
|
|
169735
169760
|
dispatchNamespace,
|
|
169736
|
-
requireExistingImageLessApplications = false
|
|
169761
|
+
requireExistingImageLessApplications = false,
|
|
169762
|
+
deployCommand: deployCommand2,
|
|
169763
|
+
versionsUploadCommand: versionsUploadCommand2
|
|
169737
169764
|
}) {
|
|
169738
169765
|
validateDurableObjectContainerApplications(
|
|
169739
169766
|
config2,
|
|
169740
169767
|
durableObjectContainerConfig,
|
|
169741
|
-
|
|
169768
|
+
configFileName(config2.configPath, config2.userConfigPath)
|
|
169742
169769
|
);
|
|
169743
169770
|
const managedContainers = getResolvedDurableObjectContainerApps(
|
|
169744
169771
|
durableObjectContainerConfig,
|
|
@@ -169771,10 +169798,15 @@ async function prepareDurableObjectContainerApplications(config2, durableObjectC
|
|
|
169771
169798
|
}
|
|
169772
169799
|
if (!dryRun && requireExistingImageLessApplications) {
|
|
169773
169800
|
assert38__default.default(accountId);
|
|
169801
|
+
assert38__default.default(deployCommand2, "Expected deploy command for versions upload");
|
|
169802
|
+
assert38__default.default(
|
|
169803
|
+
versionsUploadCommand2,
|
|
169804
|
+
"Expected versions upload command for versions upload"
|
|
169805
|
+
);
|
|
169774
169806
|
await validateImageLessContainerApplicationsForUpload(
|
|
169775
169807
|
config2,
|
|
169776
169808
|
durableObjectContainerConfig,
|
|
169777
|
-
{ accountId, scriptName }
|
|
169809
|
+
{ accountId, scriptName, deployCommand: deployCommand2, versionsUploadCommand: versionsUploadCommand2 }
|
|
169778
169810
|
);
|
|
169779
169811
|
}
|
|
169780
169812
|
const containers = managedContainers.filter(
|
|
@@ -169863,7 +169895,6 @@ var init_durable_object_container_applications = __esm({
|
|
|
169863
169895
|
init_dist5();
|
|
169864
169896
|
init_dist9();
|
|
169865
169897
|
init_src();
|
|
169866
|
-
init_context();
|
|
169867
169898
|
IMAGE_PREPARATION_POLL_INTERVAL_MS = 2e3;
|
|
169868
169899
|
IMAGE_PREPARATION_TIMEOUT_MS = 15 * 6e4;
|
|
169869
169900
|
__name(getApplicationSettings, "getApplicationSettings");
|
|
@@ -169897,7 +169928,7 @@ function applyServiceAndEnvironmentTags(config2, tags) {
|
|
|
169897
169928
|
const shouldApplyTags = hasDefinedEnvironments(config2);
|
|
169898
169929
|
if (shouldApplyTags && !serviceName) {
|
|
169899
169930
|
logger.warn(
|
|
169900
|
-
`No top-level \`name\` has been defined in your ${
|
|
169931
|
+
`No top-level \`name\` has been defined in your ${configFileName(config2.configPath, config2.userConfigPath)}. Add a top-level \`name\` to group this Worker together with its sibling environments in the Cloudflare dashboard.`
|
|
169901
169932
|
);
|
|
169902
169933
|
}
|
|
169903
169934
|
const serviceTag = shouldApplyTags && serviceName ? `${SERVICE_TAG_PREFIX}${serviceName}` : null;
|
|
@@ -175313,12 +175344,19 @@ function inheritIfNoConfiguredResourceIdentifier(handler) {
|
|
|
175313
175344
|
function isProvisionableBinding(binding) {
|
|
175314
175345
|
return binding.type in HANDLERS;
|
|
175315
175346
|
}
|
|
175316
|
-
function createHandler(bindingName, binding, complianceConfig, accountId) {
|
|
175347
|
+
function createHandler(bindingName, binding, complianceConfig, accountId, d1ListCommand2, d1DeleteCommand2) {
|
|
175317
175348
|
switch (binding.type) {
|
|
175318
175349
|
case "kv_namespace":
|
|
175319
175350
|
return new KVHandler(bindingName, binding, complianceConfig, accountId);
|
|
175320
175351
|
case "d1":
|
|
175321
|
-
return new D1Handler(
|
|
175352
|
+
return new D1Handler(
|
|
175353
|
+
bindingName,
|
|
175354
|
+
binding,
|
|
175355
|
+
complianceConfig,
|
|
175356
|
+
accountId,
|
|
175357
|
+
d1ListCommand2,
|
|
175358
|
+
d1DeleteCommand2
|
|
175359
|
+
);
|
|
175322
175360
|
case "r2_bucket":
|
|
175323
175361
|
return new R2Handler(bindingName, binding, complianceConfig, accountId);
|
|
175324
175362
|
case "ai_search_namespace":
|
|
@@ -175378,7 +175416,7 @@ function toConfigBinding(bindingName, binding) {
|
|
|
175378
175416
|
return HANDLERS.flagship.toConfig(bindingName, binding);
|
|
175379
175417
|
}
|
|
175380
175418
|
}
|
|
175381
|
-
async function collectPendingResources(complianceConfig, accountId, scriptName, bindings) {
|
|
175419
|
+
async function collectPendingResources(complianceConfig, accountId, scriptName, bindings, d1ListCommand2, d1DeleteCommand2) {
|
|
175382
175420
|
let settings;
|
|
175383
175421
|
try {
|
|
175384
175422
|
settings = await getSettings(complianceConfig, accountId, scriptName);
|
|
@@ -175396,7 +175434,9 @@ async function collectPendingResources(complianceConfig, accountId, scriptName,
|
|
|
175396
175434
|
bindingName,
|
|
175397
175435
|
binding,
|
|
175398
175436
|
complianceConfig,
|
|
175399
|
-
accountId
|
|
175437
|
+
accountId,
|
|
175438
|
+
d1ListCommand2,
|
|
175439
|
+
d1DeleteCommand2
|
|
175400
175440
|
);
|
|
175401
175441
|
const resource = {
|
|
175402
175442
|
binding: bindingName,
|
|
@@ -175431,7 +175471,14 @@ async function collectPendingResources(complianceConfig, accountId, scriptName,
|
|
|
175431
175471
|
}
|
|
175432
175472
|
async function provisionBindings(bindings, accountId, scriptName, autoCreate, config2, options) {
|
|
175433
175473
|
const configPath = config2.userConfigPath ?? config2.configPath;
|
|
175434
|
-
const { pendingResources, resolvedResources, skippedProvisioning } = await collectPendingResources(
|
|
175474
|
+
const { pendingResources, resolvedResources, skippedProvisioning } = await collectPendingResources(
|
|
175475
|
+
config2,
|
|
175476
|
+
accountId,
|
|
175477
|
+
scriptName,
|
|
175478
|
+
bindings,
|
|
175479
|
+
options.d1ListCommand,
|
|
175480
|
+
options.d1DeleteCommand
|
|
175481
|
+
);
|
|
175435
175482
|
if (pendingResources.length > 0) {
|
|
175436
175483
|
assert38__default.default(
|
|
175437
175484
|
configPath,
|
|
@@ -175661,7 +175708,7 @@ async function listFlagshipApps(complianceConfig, accountId) {
|
|
|
175661
175708
|
`/accounts/${accountId}/flagship/apps`
|
|
175662
175709
|
);
|
|
175663
175710
|
}
|
|
175664
|
-
async function createD1Database(complianceConfig, accountId, name2) {
|
|
175711
|
+
async function createD1Database(complianceConfig, accountId, name2, d1ListCommand2, d1DeleteCommand2) {
|
|
175665
175712
|
try {
|
|
175666
175713
|
return await fetchResult(
|
|
175667
175714
|
complianceConfig,
|
|
@@ -175682,14 +175729,17 @@ async function createD1Database(complianceConfig, accountId, name2) {
|
|
|
175682
175729
|
});
|
|
175683
175730
|
}
|
|
175684
175731
|
if (errorCode === 7406) {
|
|
175685
|
-
throw new UserError(
|
|
175686
|
-
|
|
175687
|
-
|
|
175732
|
+
throw new UserError(
|
|
175733
|
+
renderD1DatabaseLimitError(accountId, d1ListCommand2, d1DeleteCommand2),
|
|
175734
|
+
{
|
|
175735
|
+
telemetryMessage: "d1 create database limit reached"
|
|
175736
|
+
}
|
|
175737
|
+
);
|
|
175688
175738
|
}
|
|
175689
175739
|
throw e11;
|
|
175690
175740
|
}
|
|
175691
175741
|
}
|
|
175692
|
-
function renderD1DatabaseLimitError(accountId) {
|
|
175742
|
+
function renderD1DatabaseLimitError(accountId, d1ListCommand2, d1DeleteCommand2) {
|
|
175693
175743
|
return esm_default`
|
|
175694
175744
|
You have reached the maximum number of D1 databases for your account.
|
|
175695
175745
|
|
|
@@ -175700,8 +175750,8 @@ function renderD1DatabaseLimitError(accountId) {
|
|
|
175700
175750
|
https://developers.cloudflare.com/d1/
|
|
175701
175751
|
|
|
175702
175752
|
Or free up space:
|
|
175703
|
-
To list your existing databases, run: ${
|
|
175704
|
-
To delete a database, run: ${
|
|
175753
|
+
To list your existing databases, run: ${d1ListCommand2}
|
|
175754
|
+
To delete a database, run: ${d1DeleteCommand2}
|
|
175705
175755
|
`;
|
|
175706
175756
|
}
|
|
175707
175757
|
async function listDatabases(complianceConfig, accountId, limitCalls = false, pageSize = 10) {
|
|
@@ -176225,6 +176275,18 @@ var init_provision_bindings = __esm({
|
|
|
176225
176275
|
}
|
|
176226
176276
|
};
|
|
176227
176277
|
D1Handler = class extends ProvisionResourceHandler {
|
|
176278
|
+
constructor(bindingName, binding, complianceConfig, accountId, d1ListCommand2, d1DeleteCommand2) {
|
|
176279
|
+
super(
|
|
176280
|
+
"d1",
|
|
176281
|
+
bindingName,
|
|
176282
|
+
binding,
|
|
176283
|
+
"database_id",
|
|
176284
|
+
complianceConfig,
|
|
176285
|
+
accountId
|
|
176286
|
+
);
|
|
176287
|
+
this.d1ListCommand = d1ListCommand2;
|
|
176288
|
+
this.d1DeleteCommand = d1DeleteCommand2;
|
|
176289
|
+
}
|
|
176228
176290
|
static {
|
|
176229
176291
|
__name(this, "D1Handler");
|
|
176230
176292
|
}
|
|
@@ -176235,20 +176297,12 @@ var init_provision_bindings = __esm({
|
|
|
176235
176297
|
const db = await createD1Database(
|
|
176236
176298
|
this.complianceConfig,
|
|
176237
176299
|
this.accountId,
|
|
176238
|
-
name2
|
|
176300
|
+
name2,
|
|
176301
|
+
this.d1ListCommand,
|
|
176302
|
+
this.d1DeleteCommand
|
|
176239
176303
|
);
|
|
176240
176304
|
return db.uuid;
|
|
176241
176305
|
}
|
|
176242
|
-
constructor(bindingName, binding, complianceConfig, accountId) {
|
|
176243
|
-
super(
|
|
176244
|
-
"d1",
|
|
176245
|
-
bindingName,
|
|
176246
|
-
binding,
|
|
176247
|
-
"database_id",
|
|
176248
|
-
complianceConfig,
|
|
176249
|
-
accountId
|
|
176250
|
-
);
|
|
176251
|
-
}
|
|
176252
176306
|
async canInherit(settings) {
|
|
176253
176307
|
const maybeInherited = settings?.bindings.find(
|
|
176254
176308
|
(existing) => existing.type === this.type && existing.name === this.bindingName
|
|
@@ -176501,9 +176555,9 @@ function addRequiredSecretsInheritBindings(config2, bindings, options) {
|
|
|
176501
176555
|
if (options.type === "deploy" && !options.workerExists) {
|
|
176502
176556
|
throw new UserError(
|
|
176503
176557
|
`The following required secrets have not been set: ${inheritedSecrets.join(", ")}
|
|
176504
|
-
This Worker does not exist yet, so secrets cannot be set in advance with \`${
|
|
176558
|
+
This Worker does not exist yet, so secrets cannot be set in advance with \`${options.secretPutCommand}\`.
|
|
176505
176559
|
To deploy a new Worker with secrets, supply them via a secrets file:
|
|
176506
|
-
${
|
|
176560
|
+
${options.uploadCommand} --secrets-file <path-to-file>
|
|
176507
176561
|
where the file contains lines in the format \`SECRET_NAME=value\` (or JSON).
|
|
176508
176562
|
See https://developers.cloudflare.com/workers/configuration/secrets/#secrets-on-deployed-workers for more information.`,
|
|
176509
176563
|
{ telemetryMessage: "required secrets missing before first deploy" }
|
|
@@ -176520,12 +176574,11 @@ function handleMissingSecretsError(err, config2, options) {
|
|
|
176520
176574
|
const missingSecretNames = err.notes.map((note) => note.text.match(/^inherit binding '(.+?)' is invalid/)).filter((match4) => match4 !== null).map((match4) => match4[1]).filter((secretName) => config2.secrets?.required?.includes(secretName));
|
|
176521
176575
|
if (missingSecretNames.length > 0) {
|
|
176522
176576
|
err.preventReport();
|
|
176523
|
-
const
|
|
176524
|
-
const secretsFileCommand = `${options.type === "deploy" ? cliPresentation.commands.deploy : cliPresentation.commands.versionsUpload} --secrets-file <path-to-file>`;
|
|
176577
|
+
const secretsFileCommand = `${options.uploadCommand} --secrets-file <path-to-file>`;
|
|
176525
176578
|
const action = options.type === "deploy" ? "deploying" : "uploading";
|
|
176526
176579
|
throw new UserError(
|
|
176527
176580
|
`The following required secrets have not been set: ${missingSecretNames.join(", ")}
|
|
176528
|
-
Use \`${
|
|
176581
|
+
Use \`${options.secretPutCommand} <NAME>\` to set secrets before ${action},
|
|
176529
176582
|
or supply them when ${action} with \`${secretsFileCommand}\`.
|
|
176530
176583
|
See https://developers.cloudflare.com/workers/configuration/secrets/#secrets-on-deployed-workers for more information.`,
|
|
176531
176584
|
{ telemetryMessage: "required secrets missing during upload or deploy" }
|
|
@@ -176536,7 +176589,6 @@ var init_secrets_validation = __esm({
|
|
|
176536
176589
|
"../deploy-helpers/src/deploy/helpers/secrets-validation.ts"() {
|
|
176537
176590
|
init_import_meta_url();
|
|
176538
176591
|
init_src();
|
|
176539
|
-
init_context();
|
|
176540
176592
|
init_error_codes();
|
|
176541
176593
|
__name(addRequiredSecretsInheritBindings, "addRequiredSecretsInheritBindings");
|
|
176542
176594
|
__name(handleMissingSecretsError, "handleMissingSecretsError");
|
|
@@ -177427,7 +177479,7 @@ async function checkWorkflowConflicts(config2, accountId, scriptName) {
|
|
|
177427
177479
|
const message = `The following workflow(s) already exist and belong to different workers:
|
|
177428
177480
|
${conflictList}
|
|
177429
177481
|
|
|
177430
|
-
Deploying will reassign these workflows to "${scriptName}". Workflow names must be unique per account. If this reassignment is unintended, rename the workflow(s) in your ${
|
|
177482
|
+
Deploying will reassign these workflows to "${scriptName}". Workflow names must be unique per account. If this reassignment is unintended, rename the workflow(s) in your ${configFileName(config2.configPath, config2.userConfigPath)}.`;
|
|
177431
177483
|
return { hasConflicts: true, conflicts, message };
|
|
177432
177484
|
}
|
|
177433
177485
|
var WORKFLOW_NOT_FOUND_CODE;
|
|
@@ -177435,6 +177487,7 @@ var init_check_workflow_conflicts = __esm({
|
|
|
177435
177487
|
"../deploy-helpers/src/deploy/helpers/check-workflow-conflicts.ts"() {
|
|
177436
177488
|
init_import_meta_url();
|
|
177437
177489
|
init_src();
|
|
177490
|
+
init_src();
|
|
177438
177491
|
init_context();
|
|
177439
177492
|
init_owned_workflows();
|
|
177440
177493
|
WORKFLOW_NOT_FOUND_CODE = 10200;
|
|
@@ -180490,7 +180543,7 @@ async function verifyWorkerMatchesCITag(complianceConfig, accountId, workerName,
|
|
|
180490
180543
|
);
|
|
180491
180544
|
} else {
|
|
180492
180545
|
throw new FatalError(
|
|
180493
|
-
|
|
180546
|
+
"The Worker name could not be validated against what is expected by the build system. Please retry the build. If the problem persists, please contact support.",
|
|
180494
180547
|
{ telemetryMessage: "ci match tag validation failed" }
|
|
180495
180548
|
);
|
|
180496
180549
|
}
|
|
@@ -180740,7 +180793,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
180740
180793
|
}
|
|
180741
180794
|
return { ...props, name: name2 };
|
|
180742
180795
|
}
|
|
180743
|
-
async function preUploadApiChecks(props, config2) {
|
|
180796
|
+
async function preUploadApiChecks(props, config2, queueCreateCommand2) {
|
|
180744
180797
|
const { accountId, name: name2 } = props;
|
|
180745
180798
|
if (props.dryRun || !accountId || !name2) {
|
|
180746
180799
|
return {
|
|
@@ -180780,7 +180833,7 @@ async function preUploadApiChecks(props, config2) {
|
|
|
180780
180833
|
tags = script.tags ?? tags;
|
|
180781
180834
|
if (props.command === "deploy" && props.failIfWorkerNameTaken) {
|
|
180782
180835
|
throw new UserError(
|
|
180783
|
-
`A Worker named "${name2}" already exists in your account. This deploy could not confirm that it should update that Worker, so it stopped instead of overwriting it. To update the existing Worker, add a ${
|
|
180836
|
+
`A Worker named "${name2}" already exists in your account. This deploy could not confirm that it should update that Worker, so it stopped instead of overwriting it. To update the existing Worker, add a ${configFileName(config2.configPath, config2.userConfigPath)} that names "${name2}"; to deploy separately, use a different name.`,
|
|
180784
180837
|
{ telemetryMessage: "deploy unverified worker name already exists" }
|
|
180785
180838
|
);
|
|
180786
180839
|
}
|
|
@@ -180873,7 +180926,8 @@ Edits that have been made via the script API will be overridden by your local co
|
|
|
180873
180926
|
config2,
|
|
180874
180927
|
accountId,
|
|
180875
180928
|
!props.resourcesProvision,
|
|
180876
|
-
name2
|
|
180929
|
+
name2,
|
|
180930
|
+
queueCreateCommand2
|
|
180877
180931
|
);
|
|
180878
180932
|
const wantsWorkersDev = props.command === "deploy" && props.dispatchNamespace === void 0 && getSubdomainValues(config2.workers_dev, config2.preview_urls, props.routes).workers_dev;
|
|
180879
180933
|
if (!workerExists && wantsWorkersDev) {
|
|
@@ -180929,8 +180983,8 @@ var init_workers_sites_bindings = __esm({
|
|
|
180929
180983
|
__name(addWorkersSitesBindings, "addWorkersSitesBindings");
|
|
180930
180984
|
}
|
|
180931
180985
|
});
|
|
180932
|
-
async function deploy(props, config2, buildResult,
|
|
180933
|
-
const result = await deployWorker(props, config2, buildResult,
|
|
180986
|
+
async function deploy(props, config2, buildResult, options) {
|
|
180987
|
+
const result = await deployWorker(props, config2, buildResult, options);
|
|
180934
180988
|
writeOutput({
|
|
180935
180989
|
type: "deploy",
|
|
180936
180990
|
version: 1,
|
|
@@ -180947,13 +181001,14 @@ async function deploy(props, config2, buildResult, callbacks) {
|
|
|
180947
181001
|
});
|
|
180948
181002
|
return result;
|
|
180949
181003
|
}
|
|
180950
|
-
async function deployWorker(props, config2, buildResult,
|
|
181004
|
+
async function deployWorker(props, config2, buildResult, options) {
|
|
180951
181005
|
const { entry, compatibilityDate, compatibilityFlags, keepVars, accountId } = props;
|
|
180952
181006
|
const assetsOptions = resolveAssetOptions(props, config2);
|
|
180953
181007
|
const { name: name2 } = validateWorkerProps({ ...props, assetsOptions }, config2);
|
|
180954
181008
|
const { workerTag, tags, workerExists, aborted: aborted2 } = await preUploadApiChecks(
|
|
180955
181009
|
props,
|
|
180956
|
-
config2
|
|
181010
|
+
config2,
|
|
181011
|
+
options.queueCreateCommand
|
|
180957
181012
|
);
|
|
180958
181013
|
if (aborted2) {
|
|
180959
181014
|
return { versionId: null, workerTag };
|
|
@@ -180970,7 +181025,9 @@ async function deployWorker(props, config2, buildResult, callbacks) {
|
|
|
180970
181025
|
const confirmation = await confirmLatestDeploymentOverwriteAndGetLatest(
|
|
180971
181026
|
config2,
|
|
180972
181027
|
accountId,
|
|
180973
|
-
scriptName
|
|
181028
|
+
scriptName,
|
|
181029
|
+
options.deployCommand,
|
|
181030
|
+
options.versionsDeployCommand
|
|
180974
181031
|
);
|
|
180975
181032
|
latestDeployment = confirmation.latestDeployment;
|
|
180976
181033
|
if (!confirmation.confirmed) {
|
|
@@ -181039,7 +181096,7 @@ async function deployWorker(props, config2, buildResult, callbacks) {
|
|
|
181039
181096
|
if (assetsOptions && isDryRun) {
|
|
181040
181097
|
await buildAssetManifest(assetsOptions.directory);
|
|
181041
181098
|
}
|
|
181042
|
-
const workersSitesAssets =
|
|
181099
|
+
const workersSitesAssets = options.syncWorkersSite ? await options.syncWorkersSite(
|
|
181043
181100
|
config2,
|
|
181044
181101
|
accountId,
|
|
181045
181102
|
scriptName,
|
|
@@ -181071,7 +181128,9 @@ async function deployWorker(props, config2, buildResult, callbacks) {
|
|
|
181071
181128
|
}
|
|
181072
181129
|
addRequiredSecretsInheritBindings(config2, bindings, {
|
|
181073
181130
|
type: "deploy",
|
|
181074
|
-
workerExists
|
|
181131
|
+
workerExists,
|
|
181132
|
+
secretPutCommand: options.secretPutCommand,
|
|
181133
|
+
uploadCommand: options.deployCommand
|
|
181075
181134
|
});
|
|
181076
181135
|
if (workersSitesAssets.manifest) {
|
|
181077
181136
|
modules.push({
|
|
@@ -181175,7 +181234,9 @@ async function deployWorker(props, config2, buildResult, callbacks) {
|
|
|
181175
181234
|
props.experimentalAutoCreate,
|
|
181176
181235
|
config2,
|
|
181177
181236
|
{
|
|
181178
|
-
skipConfigWriteback: props.skipProvisioningConfigWriteback
|
|
181237
|
+
skipConfigWriteback: props.skipProvisioningConfigWriteback,
|
|
181238
|
+
d1ListCommand: options.d1ListCommand,
|
|
181239
|
+
d1DeleteCommand: options.d1DeleteCommand
|
|
181179
181240
|
}
|
|
181180
181241
|
);
|
|
181181
181242
|
}
|
|
@@ -181341,18 +181402,21 @@ async function deployWorker(props, config2, buildResult, callbacks) {
|
|
|
181341
181402
|
workerBundle,
|
|
181342
181403
|
projectRoot,
|
|
181343
181404
|
// eslint-disable-next-line @typescript-eslint/no-deprecated -- compatibility callback for existing deploy-helpers consumers
|
|
181344
|
-
|
|
181405
|
+
options.analyseBundle
|
|
181345
181406
|
);
|
|
181346
181407
|
if (message !== null) {
|
|
181347
181408
|
logger.error(message);
|
|
181348
181409
|
}
|
|
181349
181410
|
handleMissingSecretsError(err, config2, {
|
|
181350
|
-
type: "deploy"
|
|
181411
|
+
type: "deploy",
|
|
181412
|
+
secretPutCommand: options.secretPutCommand,
|
|
181413
|
+
uploadCommand: options.deployCommand
|
|
181414
|
+
});
|
|
181351
181415
|
if (err instanceof APIError && "code" in err && err.code === 10021 && err.notes.length > 0) {
|
|
181352
181416
|
err.preventReport();
|
|
181353
181417
|
if (err.notes[0].text === "binding DB of type d1 must have a valid `id` specified [code: 10021]") {
|
|
181354
181418
|
throw new UserError(
|
|
181355
|
-
`You must use a real database in the database_id configuration. You can find your databases using '${
|
|
181419
|
+
`You must use a real database in the database_id configuration. You can find your databases using '${options.d1ListCommand}', or read how to develop locally with D1 here: https://developers.cloudflare.com/d1/configuration/local-development`,
|
|
181356
181420
|
{ telemetryMessage: "deploy d1 database binding invalid id" }
|
|
181357
181421
|
);
|
|
181358
181422
|
}
|
|
@@ -181392,7 +181456,6 @@ async function deployWorker(props, config2, buildResult, callbacks) {
|
|
|
181392
181456
|
if (shouldDeployContainers) {
|
|
181393
181457
|
assert38__default.default(versionId && accountId);
|
|
181394
181458
|
initContainersSharedContext({
|
|
181395
|
-
cliPresentation,
|
|
181396
181459
|
logger,
|
|
181397
181460
|
fetchPagedListResult,
|
|
181398
181461
|
fetchResult
|
|
@@ -181431,7 +181494,10 @@ async function deployWorker(props, config2, buildResult, callbacks) {
|
|
|
181431
181494
|
versionId,
|
|
181432
181495
|
accountId,
|
|
181433
181496
|
scriptName,
|
|
181434
|
-
dispatchNamespace: props.dispatchNamespace
|
|
181497
|
+
dispatchNamespace: props.dispatchNamespace,
|
|
181498
|
+
configFileName: options.configFileName,
|
|
181499
|
+
observabilityTargetPercentageField: options.observabilityTargetPercentageField,
|
|
181500
|
+
observabilityTargetCountField: options.observabilityTargetCountField
|
|
181435
181501
|
}
|
|
181436
181502
|
);
|
|
181437
181503
|
}
|
|
@@ -181450,7 +181516,7 @@ async function deployWorker(props, config2, buildResult, callbacks) {
|
|
|
181450
181516
|
);
|
|
181451
181517
|
} catch (error64) {
|
|
181452
181518
|
throw new UserError(
|
|
181453
|
-
`The Worker version was deployed, but
|
|
181519
|
+
`The Worker version was deployed, but its Durable Object-managed Container application settings were not fully applied. Re-run the same \`${options.deployCommand}\` command to retry and finish deployment.`,
|
|
181454
181520
|
{
|
|
181455
181521
|
telemetryMessage: "deploy durable object container application creation failed after deployment",
|
|
181456
181522
|
cause: error64
|
|
@@ -181472,7 +181538,12 @@ async function deployWorker(props, config2, buildResult, callbacks) {
|
|
|
181472
181538
|
firstDeploy: !workerExists,
|
|
181473
181539
|
routes: props.routes,
|
|
181474
181540
|
validated: true,
|
|
181475
|
-
dryRun: false
|
|
181541
|
+
dryRun: false,
|
|
181542
|
+
queueCreateCommand: options.queueCreateCommand,
|
|
181543
|
+
workersDevConfigFieldName: options.workersDevConfigFieldName,
|
|
181544
|
+
workersDevConfigAssignment: options.workersDevConfigAssignment,
|
|
181545
|
+
previewUrlsConfigFieldName: options.previewUrlsConfigFieldName,
|
|
181546
|
+
previewUrlsConfigAssignment: options.previewUrlsConfigAssignment
|
|
181476
181547
|
});
|
|
181477
181548
|
logger.log("Current Version ID:", versionId);
|
|
181478
181549
|
return {
|
|
@@ -181534,13 +181605,8 @@ var init_binding_depends_on_export = __esm({
|
|
|
181534
181605
|
__name(renderBindingDependsOnExportError, "renderBindingDependsOnExportError");
|
|
181535
181606
|
}
|
|
181536
181607
|
});
|
|
181537
|
-
async function versionsUpload(props, config2, buildResult,
|
|
181538
|
-
const result = await uploadWorkerVersion(
|
|
181539
|
-
props,
|
|
181540
|
-
config2,
|
|
181541
|
-
buildResult,
|
|
181542
|
-
callbacks
|
|
181543
|
-
);
|
|
181608
|
+
async function versionsUpload(props, config2, buildResult, options) {
|
|
181609
|
+
const result = await uploadWorkerVersion(props, config2, buildResult, options);
|
|
181544
181610
|
writeOutput({
|
|
181545
181611
|
type: "version-upload",
|
|
181546
181612
|
version: 1,
|
|
@@ -181558,11 +181624,15 @@ async function versionsUpload(props, config2, buildResult, callbacks = {}) {
|
|
|
181558
181624
|
});
|
|
181559
181625
|
return result;
|
|
181560
181626
|
}
|
|
181561
|
-
async function uploadWorkerVersion(props, config2, buildResult,
|
|
181627
|
+
async function uploadWorkerVersion(props, config2, buildResult, options) {
|
|
181562
181628
|
const { entry, compatibilityDate, compatibilityFlags, keepVars, accountId } = props;
|
|
181563
181629
|
const assetsOptions = resolveAssetOptions(props, config2);
|
|
181564
181630
|
const { name: name2 } = validateWorkerProps(props, config2);
|
|
181565
|
-
const { workerTag, tags, aborted: aborted2 } = await preUploadApiChecks(
|
|
181631
|
+
const { workerTag, tags, aborted: aborted2 } = await preUploadApiChecks(
|
|
181632
|
+
props,
|
|
181633
|
+
config2,
|
|
181634
|
+
options.queueCreateCommand
|
|
181635
|
+
);
|
|
181566
181636
|
if (aborted2) {
|
|
181567
181637
|
return { versionId: null, workerTag };
|
|
181568
181638
|
}
|
|
@@ -181598,7 +181668,7 @@ async function uploadWorkerVersion(props, config2, buildResult, callbacks) {
|
|
|
181598
181668
|
});
|
|
181599
181669
|
if (migrations !== void 0) {
|
|
181600
181670
|
throw new UserError(
|
|
181601
|
-
`This Worker has a pending Durable Object migration, which cannot be applied by \`${
|
|
181671
|
+
`This Worker has a pending Durable Object migration, which cannot be applied by \`${options.versionsUploadCommand}\`. Durable Object migrations must be applied with \`${options.deployCommand}\`. Run \`${options.deployCommand}\` to apply the migration, then retry \`${options.versionsUploadCommand}\`.`,
|
|
181602
181672
|
{ telemetryMessage: "versions upload pending durable object migration" }
|
|
181603
181673
|
);
|
|
181604
181674
|
}
|
|
@@ -181613,7 +181683,9 @@ async function uploadWorkerVersion(props, config2, buildResult, callbacks) {
|
|
|
181613
181683
|
accountId,
|
|
181614
181684
|
dryRun: Boolean(props.dryRun),
|
|
181615
181685
|
scriptName,
|
|
181616
|
-
requireExistingImageLessApplications: true
|
|
181686
|
+
requireExistingImageLessApplications: true,
|
|
181687
|
+
deployCommand: options.deployCommand,
|
|
181688
|
+
versionsUploadCommand: options.versionsUploadCommand
|
|
181617
181689
|
}
|
|
181618
181690
|
);
|
|
181619
181691
|
const assetsUploadResult = assetsOptions && !props.dryRun ? await syncAssets(config2, accountId, assetsOptions.directory, scriptName) : void 0;
|
|
@@ -181710,7 +181782,9 @@ async function uploadWorkerVersion(props, config2, buildResult, callbacks) {
|
|
|
181710
181782
|
props.experimentalAutoCreate,
|
|
181711
181783
|
config2,
|
|
181712
181784
|
{
|
|
181713
|
-
skipConfigWriteback: props.skipProvisioningConfigWriteback
|
|
181785
|
+
skipConfigWriteback: props.skipProvisioningConfigWriteback,
|
|
181786
|
+
d1ListCommand: options.d1ListCommand,
|
|
181787
|
+
d1DeleteCommand: options.d1DeleteCommand
|
|
181714
181788
|
}
|
|
181715
181789
|
);
|
|
181716
181790
|
}
|
|
@@ -181765,12 +181839,16 @@ async function uploadWorkerVersion(props, config2, buildResult, callbacks) {
|
|
|
181765
181839
|
workerBundle,
|
|
181766
181840
|
projectRoot,
|
|
181767
181841
|
// eslint-disable-next-line @typescript-eslint/no-deprecated -- compatibility callback for existing deploy-helpers consumers
|
|
181768
|
-
|
|
181842
|
+
options.analyseBundle
|
|
181769
181843
|
);
|
|
181770
181844
|
if (message) {
|
|
181771
181845
|
logger.error(message);
|
|
181772
181846
|
}
|
|
181773
|
-
handleMissingSecretsError(err, config2, {
|
|
181847
|
+
handleMissingSecretsError(err, config2, {
|
|
181848
|
+
type: "upload",
|
|
181849
|
+
secretPutCommand: options.versionsSecretPutCommand,
|
|
181850
|
+
uploadCommand: options.versionsUploadCommand
|
|
181851
|
+
});
|
|
181774
181852
|
if (err instanceof ParseError && "code" in err && err.code === 10021 && err.notes.length > 0) {
|
|
181775
181853
|
const maybeNameToFilePath = /* @__PURE__ */ __name((moduleName) => {
|
|
181776
181854
|
if (bundleType === "commonjs") {
|
|
@@ -181850,8 +181928,8 @@ async function uploadWorkerVersion(props, config2, buildResult, callbacks) {
|
|
|
181850
181928
|
}
|
|
181851
181929
|
}
|
|
181852
181930
|
}
|
|
181853
|
-
const cmdVersionsDeploy = blue(
|
|
181854
|
-
const cmdTriggersDeploy = blue(
|
|
181931
|
+
const cmdVersionsDeploy = blue(options.versionsDeployCommand);
|
|
181932
|
+
const cmdTriggersDeploy = blue(options.triggersDeployCommand);
|
|
181855
181933
|
logger.info(
|
|
181856
181934
|
gray(`
|
|
181857
181935
|
To deploy this version to production traffic use the command ${cmdVersionsDeploy}
|
|
@@ -182037,7 +182115,7 @@ function validateNodeCompatMode(compatibilityDateStr = "2000-01-01", compatibili
|
|
|
182037
182115
|
}
|
|
182038
182116
|
if (noBundle && hasNodejsCompatV2Flag) {
|
|
182039
182117
|
logger.warn(
|
|
182040
|
-
|
|
182118
|
+
"`nodejs_compat_v2` compatibility flag and `--no-bundle` can't be used together. If you want to polyfill Node.js built-ins while disabling bundling, please polyfill as part of your own bundling process."
|
|
182041
182119
|
);
|
|
182042
182120
|
}
|
|
182043
182121
|
return mode;
|
|
@@ -182059,7 +182137,7 @@ var init_versions_types = __esm({
|
|
|
182059
182137
|
});
|
|
182060
182138
|
|
|
182061
182139
|
// ../deploy-helpers/src/deploy/helpers/inconsistent-exports.ts
|
|
182062
|
-
function renderInconsistentExportsAcrossVersionsError(serverMessage) {
|
|
182140
|
+
function renderInconsistentExportsAcrossVersionsError(serverMessage, versionsDeployAt100Command) {
|
|
182063
182141
|
return [
|
|
182064
182142
|
serverMessage,
|
|
182065
182143
|
"",
|
|
@@ -182067,7 +182145,7 @@ function renderInconsistentExportsAcrossVersionsError(serverMessage) {
|
|
|
182067
182145
|
"",
|
|
182068
182146
|
"What to do:",
|
|
182069
182147
|
" 1. Deploy the version that changes `exports` at 100% first:",
|
|
182070
|
-
` ${
|
|
182148
|
+
` ${versionsDeployAt100Command}`,
|
|
182071
182149
|
" 2. Once that deploy is stable, run your percentage-split deploy.",
|
|
182072
182150
|
"",
|
|
182073
182151
|
"Learn more: https://developers.cloudflare.com/workers/configuration/versions-and-deployments/gradual-deployments/#gradual-deployments-for-durable-objects"
|
|
@@ -182076,7 +182154,6 @@ function renderInconsistentExportsAcrossVersionsError(serverMessage) {
|
|
|
182076
182154
|
var init_inconsistent_exports = __esm({
|
|
182077
182155
|
"../deploy-helpers/src/deploy/helpers/inconsistent-exports.ts"() {
|
|
182078
182156
|
init_import_meta_url();
|
|
182079
|
-
init_context();
|
|
182080
182157
|
__name(renderInconsistentExportsAcrossVersionsError, "renderInconsistentExportsAcrossVersionsError");
|
|
182081
182158
|
}
|
|
182082
182159
|
});
|
|
@@ -182836,9 +182913,9 @@ function getPreviewExports(exports$1) {
|
|
|
182836
182913
|
}
|
|
182837
182914
|
return previewExports;
|
|
182838
182915
|
}
|
|
182839
|
-
async function prepareContainersForPreview(config2, workerName, previewSlug,
|
|
182916
|
+
async function prepareContainersForPreview(config2, workerName, previewSlug, options, localImageReferences) {
|
|
182840
182917
|
const previewContainers = config2.previews?.containers ?? [];
|
|
182841
|
-
if (previewContainers.length === 0 || !
|
|
182918
|
+
if (previewContainers.length === 0 || !options.getNormalizedContainerOptions) {
|
|
182842
182919
|
return { scopedContainerConfig: void 0, normalisedContainerConfig: [] };
|
|
182843
182920
|
}
|
|
182844
182921
|
const scopedContainerConfig = buildPreviewContainerConfig(
|
|
@@ -182850,9 +182927,12 @@ async function prepareContainersForPreview(config2, workerName, previewSlug, cal
|
|
|
182850
182927
|
if (!scopedContainerConfig) {
|
|
182851
182928
|
return { scopedContainerConfig: void 0, normalisedContainerConfig: [] };
|
|
182852
182929
|
}
|
|
182853
|
-
const normalisedContainerConfig = await
|
|
182854
|
-
|
|
182855
|
-
|
|
182930
|
+
const normalisedContainerConfig = await options.getNormalizedContainerOptions(
|
|
182931
|
+
scopedContainerConfig,
|
|
182932
|
+
{
|
|
182933
|
+
dryRun: false
|
|
182934
|
+
}
|
|
182935
|
+
);
|
|
182856
182936
|
const containersNeedingDocker = normalisedContainerConfig.filter(
|
|
182857
182937
|
(container) => "dockerfile" in container
|
|
182858
182938
|
);
|
|
@@ -182864,8 +182944,8 @@ async function prepareContainersForPreview(config2, workerName, previewSlug, cal
|
|
|
182864
182944
|
hint: 'If you cannot run Docker locally, set "image" to a prebuilt registry image instead of a Dockerfile path for the affected entries in "previews.containers".'
|
|
182865
182945
|
});
|
|
182866
182946
|
}
|
|
182867
|
-
if (
|
|
182868
|
-
await
|
|
182947
|
+
if (options.verifyContainersScope) {
|
|
182948
|
+
await options.verifyContainersScope(scopedContainerConfig);
|
|
182869
182949
|
}
|
|
182870
182950
|
return { scopedContainerConfig, normalisedContainerConfig };
|
|
182871
182951
|
}
|
|
@@ -182882,7 +182962,7 @@ function formatPreviewConfigUpdate(config2, update) {
|
|
|
182882
182962
|
configPath
|
|
182883
182963
|
).trimEnd();
|
|
182884
182964
|
}
|
|
182885
|
-
function formatNoActivePreviewUrlsMessage(config2) {
|
|
182965
|
+
function formatNoActivePreviewUrlsMessage(config2, deployCommand2 = "your deploy command", previewCommand2 = "the preview command") {
|
|
182886
182966
|
const customDomainRouteEntries = (config2.routes ?? []).filter(isCustomDomainRoute).map((route) => ({ route, singular: false }));
|
|
182887
182967
|
if (config2.route && isCustomDomainRoute(config2.route)) {
|
|
182888
182968
|
customDomainRouteEntries.push({ route: config2.route, singular: true });
|
|
@@ -182932,7 +183012,7 @@ function formatNoActivePreviewUrlsMessage(config2) {
|
|
|
182932
183012
|
}
|
|
182933
183013
|
const workersDevAlreadyConfigured = config2.preview_urls === true;
|
|
182934
183014
|
const customDomainAlreadyConfigured = customDomainRoute?.previews_enabled === true;
|
|
182935
|
-
const cautionText = workersDevAlreadyConfigured && customDomainAlreadyConfigured ? `Caution: \`${
|
|
183015
|
+
const cautionText = workersDevAlreadyConfigured && customDomainAlreadyConfigured ? `Caution: \`${deployCommand2}\` publishes the code in your current checkout to the deployed Worker. If you have already made this change, confirm it was applied by running \`${deployCommand2}\` from a clean checkout of your production branch. Then return to your feature branch and run \`${previewCommand2}\` again.` : `Caution: \`${deployCommand2}\` 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 \`${deployCommand2}\` from a clean checkout of your production branch. Then return to your feature branch and run \`${previewCommand2}\` again.`;
|
|
182936
183016
|
let workersDevInstruction = `Add this to your ${configName}:`;
|
|
182937
183017
|
if (config2.preview_urls === true) {
|
|
182938
183018
|
workersDevInstruction = `Your ${configName} already contains:`;
|
|
@@ -183183,7 +183263,7 @@ function formatUrlLines(label, urls) {
|
|
|
183183
183263
|
...urls.map((url4) => ` ${source_default.underline(url4)}`)
|
|
183184
183264
|
];
|
|
183185
183265
|
}
|
|
183186
|
-
function formatPreviewDeploymentSummary(config2, previewResource, deployment, isNew, pullRequest) {
|
|
183266
|
+
function formatPreviewDeploymentSummary(config2, previewResource, deployment, isNew, pullRequest, deployCommand2, previewCommand2) {
|
|
183187
183267
|
const statusLabel = isNew ? source_default.green("(new)") : source_default.dim("(updated)");
|
|
183188
183268
|
const pullRequestUrl = deployment.annotations?.["workers/pull_request_url"] ?? pullRequest?.url;
|
|
183189
183269
|
const pullRequestNumber = deployment.annotations?.["workers/pull_request_number"] ?? pullRequest?.number;
|
|
@@ -183195,7 +183275,13 @@ function formatPreviewDeploymentSummary(config2, previewResource, deployment, is
|
|
|
183195
183275
|
`${source_default.bold("Pull Request:")} ${pullRequestUrl ?? `#${pullRequestNumber}`}`
|
|
183196
183276
|
] : [],
|
|
183197
183277
|
...formatUrlLines("Unique Deployment", deployment.urls),
|
|
183198
|
-
...hasActiveUrls ? [] : [
|
|
183278
|
+
...hasActiveUrls ? [] : [
|
|
183279
|
+
formatNoActivePreviewUrlsMessage(
|
|
183280
|
+
config2,
|
|
183281
|
+
deployCommand2,
|
|
183282
|
+
previewCommand2
|
|
183283
|
+
)
|
|
183284
|
+
]
|
|
183199
183285
|
].join("\n");
|
|
183200
183286
|
}
|
|
183201
183287
|
function getPreviewCustomDomainHostnames(config2) {
|
|
@@ -183225,7 +183311,7 @@ function previewUrlMatchesCustomDomain(url4, customDomains) {
|
|
|
183225
183311
|
return false;
|
|
183226
183312
|
}
|
|
183227
183313
|
}
|
|
183228
|
-
function logMissingCustomDomainPreviewUrlsWarning(config2, previewResource, deployment) {
|
|
183314
|
+
function logMissingCustomDomainPreviewUrlsWarning(config2, previewResource, deployment, deployCommand2 = "your deploy command", previewCommand2 = "the preview command") {
|
|
183229
183315
|
const customDomains = getPreviewCustomDomainHostnames(config2);
|
|
183230
183316
|
const urls = [...previewResource.urls ?? [], ...deployment.urls ?? []];
|
|
183231
183317
|
if (customDomains.length === 0 || urls.length === 0 || urls.some((url4) => previewUrlMatchesCustomDomain(url4, customDomains))) {
|
|
@@ -183233,7 +183319,7 @@ function logMissingCustomDomainPreviewUrlsWarning(config2, previewResource, depl
|
|
|
183233
183319
|
}
|
|
183234
183320
|
logger.log("");
|
|
183235
183321
|
logger.warn(
|
|
183236
|
-
`Custom domain Preview URLs are configured, but none are active for this Preview. If you
|
|
183322
|
+
`Custom domain Preview URLs are configured, but none are active for this Preview. If you enabled Preview URLs after your last deployment, run \`${deployCommand2}\` once to publish the custom domain Preview route, then run \`${previewCommand2}\` again. If you already deployed with that setting, the custom domain may still be provisioning.`
|
|
183237
183323
|
);
|
|
183238
183324
|
}
|
|
183239
183325
|
function logMissingPreviewsBindingsWarning(productionBindingsExpectedInPreview, remotePreviewDefaultBindings, localPreviewBindings) {
|
|
@@ -183289,7 +183375,7 @@ async function provisionParentWorker(config2, accountId, workerName, json2) {
|
|
|
183289
183375
|
preview_urls ?? workers_dev
|
|
183290
183376
|
);
|
|
183291
183377
|
}
|
|
183292
|
-
async function runPreview(accountId, args, config2, buildResult, assetsOptions,
|
|
183378
|
+
async function runPreview(accountId, args, config2, buildResult, assetsOptions, options, workerName, replaceTailConsumersAfterCreate = false, localImageReferences = /* @__PURE__ */ new Map()) {
|
|
183293
183379
|
let secrets;
|
|
183294
183380
|
if (args.secretsFile) {
|
|
183295
183381
|
secrets = (await parseBulkInputToObject(args.secretsFile))?.content;
|
|
@@ -183368,7 +183454,7 @@ async function runPreview(accountId, args, config2, buildResult, assetsOptions,
|
|
|
183368
183454
|
config2,
|
|
183369
183455
|
workerName,
|
|
183370
183456
|
previewResource.slug,
|
|
183371
|
-
|
|
183457
|
+
options,
|
|
183372
183458
|
localImageReferences
|
|
183373
183459
|
);
|
|
183374
183460
|
const deploymentRequest = await assemblePreviewDeploymentSettings(
|
|
@@ -183401,9 +183487,9 @@ async function runPreview(accountId, args, config2, buildResult, assetsOptions,
|
|
|
183401
183487
|
delete binding.text;
|
|
183402
183488
|
}
|
|
183403
183489
|
}
|
|
183404
|
-
if (normalisedContainerConfig.length > 0 && scopedContainerConfig &&
|
|
183490
|
+
if (normalisedContainerConfig.length > 0 && scopedContainerConfig && options.deployPreviewContainers) {
|
|
183405
183491
|
try {
|
|
183406
|
-
await
|
|
183492
|
+
await options.deployPreviewContainers(
|
|
183407
183493
|
scopedContainerConfig,
|
|
183408
183494
|
normalisedContainerConfig,
|
|
183409
183495
|
deployment,
|
|
@@ -183422,7 +183508,7 @@ async function runPreview(accountId, args, config2, buildResult, assetsOptions,
|
|
|
183422
183508
|
JSON.stringify({ preview: previewResource, deployment }, null, 2)
|
|
183423
183509
|
);
|
|
183424
183510
|
} else {
|
|
183425
|
-
const productionBindingsExpectedInPreview =
|
|
183511
|
+
const productionBindingsExpectedInPreview = options.productionBindingsExpectedInPreview ?? {};
|
|
183426
183512
|
if (Object.keys(productionBindingsExpectedInPreview).length > 0) {
|
|
183427
183513
|
const previewBaseConfig = await getPreviewBaseConfig(
|
|
183428
183514
|
config2,
|
|
@@ -183441,25 +183527,29 @@ async function runPreview(accountId, args, config2, buildResult, assetsOptions,
|
|
|
183441
183527
|
previewResource,
|
|
183442
183528
|
deployment,
|
|
183443
183529
|
isNewPreview,
|
|
183444
|
-
pullRequest
|
|
183530
|
+
pullRequest,
|
|
183531
|
+
options.deployCommand,
|
|
183532
|
+
options.previewCommand
|
|
183445
183533
|
)
|
|
183446
183534
|
);
|
|
183447
183535
|
logMissingCustomDomainPreviewUrlsWarning(
|
|
183448
183536
|
config2,
|
|
183449
183537
|
previewResource,
|
|
183450
|
-
deployment
|
|
183538
|
+
deployment,
|
|
183539
|
+
options.deployCommand,
|
|
183540
|
+
options.previewCommand
|
|
183451
183541
|
);
|
|
183452
183542
|
}
|
|
183453
183543
|
return { preview: previewResource, deployment, isNewPreview };
|
|
183454
183544
|
}
|
|
183455
|
-
async function preview(accountId, args, config2, buildResult, assetsOptions,
|
|
183545
|
+
async function preview(accountId, args, config2, buildResult, assetsOptions, options) {
|
|
183456
183546
|
return runPreview(
|
|
183457
183547
|
accountId,
|
|
183458
183548
|
args,
|
|
183459
183549
|
config2,
|
|
183460
183550
|
buildResult,
|
|
183461
183551
|
assetsOptions,
|
|
183462
|
-
|
|
183552
|
+
options,
|
|
183463
183553
|
resolveWorkerName(args, config2)
|
|
183464
183554
|
);
|
|
183465
183555
|
}
|
|
@@ -185948,7 +186038,7 @@ var init_dist14 = __esm({
|
|
|
185948
186038
|
init_wrapper();
|
|
185949
186039
|
init_create_worker_upload_form();
|
|
185950
186040
|
import_undici14 = __toESM(require_undici(), 1);
|
|
185951
|
-
version3 = "0.0.
|
|
186041
|
+
version3 = "0.0.50";
|
|
185952
186042
|
NoDefaultValueProvided2 = class extends UserError {
|
|
185953
186043
|
static {
|
|
185954
186044
|
__name(this, "NoDefaultValueProvided");
|
|
@@ -202398,12 +202488,18 @@ var init_ssh = __esm({
|
|
|
202398
202488
|
positionalArgs: ["ID"],
|
|
202399
202489
|
async handler(args, { config: config2 }) {
|
|
202400
202490
|
await fillOpenAPIConfiguration(config2, containersScope);
|
|
202401
|
-
initContainersSharedContext({
|
|
202402
|
-
|
|
202403
|
-
|
|
202404
|
-
id: args.ID,
|
|
202405
|
-
command: args._.slice(2).map(String)
|
|
202491
|
+
initContainersSharedContext({
|
|
202492
|
+
logger: logger2,
|
|
202493
|
+
fetchResult: fetchResult2
|
|
202406
202494
|
});
|
|
202495
|
+
await sshCommand(
|
|
202496
|
+
{
|
|
202497
|
+
...args,
|
|
202498
|
+
id: args.ID,
|
|
202499
|
+
command: args._.slice(2).map(String)
|
|
202500
|
+
},
|
|
202501
|
+
"wrangler"
|
|
202502
|
+
);
|
|
202407
202503
|
}
|
|
202408
202504
|
});
|
|
202409
202505
|
}
|
|
@@ -204021,7 +204117,10 @@ var init_build = __esm({
|
|
|
204021
204117
|
},
|
|
204022
204118
|
positionalArgs: ["PATH"],
|
|
204023
204119
|
async handler(args, { config: config2 }) {
|
|
204024
|
-
initContainersSharedContext({
|
|
204120
|
+
initContainersSharedContext({
|
|
204121
|
+
logger: logger2,
|
|
204122
|
+
fetchResult: fetchResult2
|
|
204123
|
+
});
|
|
204025
204124
|
await fillOpenAPIConfiguration(config2, containersScope);
|
|
204026
204125
|
await buildCommand(args, config2);
|
|
204027
204126
|
}
|
|
@@ -204049,7 +204148,10 @@ var init_build = __esm({
|
|
|
204049
204148
|
},
|
|
204050
204149
|
positionalArgs: ["TAG"],
|
|
204051
204150
|
async handler(args, { config: config2 }) {
|
|
204052
|
-
initContainersSharedContext({
|
|
204151
|
+
initContainersSharedContext({
|
|
204152
|
+
logger: logger2,
|
|
204153
|
+
fetchResult: fetchResult2
|
|
204154
|
+
});
|
|
204053
204155
|
await fillOpenAPIConfiguration(config2, containersScope);
|
|
204054
204156
|
await pushCommand(args, await getOrSelectAccountId(config2), config2);
|
|
204055
204157
|
}
|
|
@@ -220618,7 +220720,10 @@ async function writeBuildOutput({
|
|
|
220618
220720
|
buildResult,
|
|
220619
220721
|
assetsOptions
|
|
220620
220722
|
});
|
|
220621
|
-
initContainersSharedContext({
|
|
220723
|
+
initContainersSharedContext({
|
|
220724
|
+
logger: logger2,
|
|
220725
|
+
fetchResult: fetchResult2
|
|
220726
|
+
});
|
|
220622
220727
|
const pathToDocker = getDockerPath();
|
|
220623
220728
|
await buildAndWriteContainerOutput({
|
|
220624
220729
|
containers: parsedConfig.containers,
|
|
@@ -223790,7 +223895,10 @@ var init_build3 = __esm({
|
|
|
223790
223895
|
},
|
|
223791
223896
|
positionalArgs: ["PATH"],
|
|
223792
223897
|
async handler(args, { config: config2 }) {
|
|
223793
|
-
initContainersSharedContext({
|
|
223898
|
+
initContainersSharedContext({
|
|
223899
|
+
logger: logger2,
|
|
223900
|
+
fetchResult: fetchResult2
|
|
223901
|
+
});
|
|
223794
223902
|
await fillOpenAPIConfiguration(config2, cloudchamberScope);
|
|
223795
223903
|
await buildCommand(
|
|
223796
223904
|
args,
|
|
@@ -223819,7 +223927,10 @@ var init_build3 = __esm({
|
|
|
223819
223927
|
},
|
|
223820
223928
|
positionalArgs: ["TAG"],
|
|
223821
223929
|
async handler(args, { config: config2 }) {
|
|
223822
|
-
initContainersSharedContext({
|
|
223930
|
+
initContainersSharedContext({
|
|
223931
|
+
logger: logger2,
|
|
223932
|
+
fetchResult: fetchResult2
|
|
223933
|
+
});
|
|
223823
223934
|
await fillOpenAPIConfiguration(config2, cloudchamberScope);
|
|
223824
223935
|
await pushCommand(
|
|
223825
223936
|
args,
|
|
@@ -296215,6 +296326,22 @@ async function runDeployCommandHandler(args, {
|
|
|
296215
296326
|
config2,
|
|
296216
296327
|
buildResult,
|
|
296217
296328
|
{
|
|
296329
|
+
deployCommand: "wrangler deploy",
|
|
296330
|
+
versionsDeployCommand: "wrangler versions deploy",
|
|
296331
|
+
d1ListCommand: "wrangler d1 list",
|
|
296332
|
+
d1DeleteCommand: "wrangler d1 delete <database-name>",
|
|
296333
|
+
queueCreateCommand: /* @__PURE__ */ __name((queueName) => `wrangler queues create ${queueName}`, "queueCreateCommand"),
|
|
296334
|
+
secretPutCommand: "wrangler secret put",
|
|
296335
|
+
workersDevConfigFieldName: "workers_dev",
|
|
296336
|
+
workersDevConfigAssignment: /* @__PURE__ */ __name((value) => `workers_dev = ${value}`, "workersDevConfigAssignment"),
|
|
296337
|
+
previewUrlsConfigFieldName: "preview_urls",
|
|
296338
|
+
previewUrlsConfigAssignment: /* @__PURE__ */ __name((value) => `preview_urls = ${value}`, "previewUrlsConfigAssignment"),
|
|
296339
|
+
configFileName: configFileName(
|
|
296340
|
+
config2.configPath,
|
|
296341
|
+
config2.userConfigPath
|
|
296342
|
+
),
|
|
296343
|
+
observabilityTargetPercentageField: "target_instance_percentage",
|
|
296344
|
+
observabilityTargetCountField: "target_instance_count",
|
|
296218
296345
|
syncWorkersSite
|
|
296219
296346
|
}
|
|
296220
296347
|
);
|
|
@@ -348212,7 +348339,11 @@ async function deployPreviewContainers(scopedConfig, normalisedContainerConfig,
|
|
|
348212
348339
|
}
|
|
348213
348340
|
}
|
|
348214
348341
|
async function applyPreviewContainers(scopedConfig, normalisedContainerConfig, deployment, accountId, localImageReferences) {
|
|
348215
|
-
initContainersSharedContext({
|
|
348342
|
+
initContainersSharedContext({
|
|
348343
|
+
logger: logger2,
|
|
348344
|
+
fetchPagedListResult: fetchPagedListResult2,
|
|
348345
|
+
fetchResult: fetchResult2
|
|
348346
|
+
});
|
|
348216
348347
|
await fillOpenAPIConfiguration(scopedConfig, containersScope);
|
|
348217
348348
|
const dockerPath = getDockerPath();
|
|
348218
348349
|
const classNameToNamespaceId = /* @__PURE__ */ new Map();
|
|
@@ -348268,7 +348399,13 @@ async function applyPreviewContainers(scopedConfig, normalisedContainerConfig, d
|
|
|
348268
348399
|
imageRef = { newTag: container.image_uri };
|
|
348269
348400
|
}
|
|
348270
348401
|
await apply(
|
|
348271
|
-
{
|
|
348402
|
+
{
|
|
348403
|
+
imageRef,
|
|
348404
|
+
durable_object_namespace_id: namespaceId,
|
|
348405
|
+
configFileName: "Wrangler config",
|
|
348406
|
+
observabilityTargetPercentageField: "target_instance_percentage",
|
|
348407
|
+
observabilityTargetCountField: "target_instance_count"
|
|
348408
|
+
},
|
|
348272
348409
|
container,
|
|
348273
348410
|
scopedConfig,
|
|
348274
348411
|
accountId
|
|
@@ -349257,6 +349394,8 @@ var init_preview3 = __esm({
|
|
|
349257
349394
|
buildResult,
|
|
349258
349395
|
assetsOptions,
|
|
349259
349396
|
{
|
|
349397
|
+
deployCommand: "wrangler deploy",
|
|
349398
|
+
previewCommand: "wrangler preview",
|
|
349260
349399
|
productionBindingsExpectedInPreview,
|
|
349261
349400
|
getNormalizedContainerOptions,
|
|
349262
349401
|
deployPreviewContainers,
|
|
@@ -349373,7 +349512,7 @@ var init_bulk3 = __esm({
|
|
|
349373
349512
|
logger2.log(
|
|
349374
349513
|
`\u2728 Success! Created Preview deployment ${deployment.id} with ${created.length} created and ${deleted.length} deleted secrets.` + (liveUrls.length > 0 ? `
|
|
349375
349514
|
\u27A1\uFE0F Your Preview "${previewName}" is now live at ${liveUrls.map((url4) => source_default.bold.underline(url4)).join(", ")}` : `
|
|
349376
|
-
${formatNoActivePreviewUrlsMessage(config2)}`)
|
|
349515
|
+
${formatNoActivePreviewUrlsMessage(config2, "wrangler deploy", "wrangler preview")}`)
|
|
349377
349516
|
);
|
|
349378
349517
|
}, "previewSecretBulkHandler")
|
|
349379
349518
|
});
|
|
@@ -349465,7 +349604,7 @@ var init_delete18 = __esm({
|
|
|
349465
349604
|
logger2.log(
|
|
349466
349605
|
`\u2728 Success! Created Preview deployment ${deployment.id} with deleted secret ${args.key}.` + (liveUrls.length > 0 ? `
|
|
349467
349606
|
\u27A1\uFE0F Your Preview "${previewName}" is now live at ${liveUrls.map((url4) => source_default.bold.underline(url4)).join(", ")}` : `
|
|
349468
|
-
${formatNoActivePreviewUrlsMessage(config2)}`)
|
|
349607
|
+
${formatNoActivePreviewUrlsMessage(config2, "wrangler deploy", "wrangler preview")}`)
|
|
349469
349608
|
);
|
|
349470
349609
|
}
|
|
349471
349610
|
}, "previewSecretDeleteHandler")
|
|
@@ -349670,7 +349809,7 @@ var init_put2 = __esm({
|
|
|
349670
349809
|
logger2.log(
|
|
349671
349810
|
`\u2728 Success! Created Preview deployment ${deployment.id} with secret ${args.key}.` + (liveUrls.length > 0 ? `
|
|
349672
349811
|
\u27A1\uFE0F Your Preview "${previewName}" is now live at ${liveUrls.map((url4) => source_default.bold.underline(url4)).join(", ")}` : `
|
|
349673
|
-
${formatNoActivePreviewUrlsMessage(config2)}`)
|
|
349812
|
+
${formatNoActivePreviewUrlsMessage(config2, "wrangler deploy", "wrangler preview")}`)
|
|
349674
349813
|
);
|
|
349675
349814
|
}, "previewSecretPutHandler")
|
|
349676
349815
|
});
|
|
@@ -349725,6 +349864,9 @@ var init_http_pull = __esm({
|
|
|
349725
349864
|
});
|
|
349726
349865
|
}
|
|
349727
349866
|
});
|
|
349867
|
+
function queueCreateCommand(queueName) {
|
|
349868
|
+
return `wrangler queues create ${queueName}`;
|
|
349869
|
+
}
|
|
349728
349870
|
async function createQueue(config2, body) {
|
|
349729
349871
|
const accountId = await requireAuth(config2);
|
|
349730
349872
|
return fetchResult2(config2, queuesUrl2(accountId), {
|
|
@@ -349755,22 +349897,33 @@ async function listQueues2(config2, page, name2) {
|
|
|
349755
349897
|
}
|
|
349756
349898
|
async function getQueue2(config2, queueName) {
|
|
349757
349899
|
const accountId = await requireAuth(config2);
|
|
349758
|
-
return getQueue(config2, accountId, queueName);
|
|
349900
|
+
return getQueue(config2, accountId, queueName, queueCreateCommand);
|
|
349759
349901
|
}
|
|
349760
349902
|
async function getQueueById(config2, accountId, queueId) {
|
|
349761
349903
|
return fetchResult2(config2, queuesUrl2(accountId, queueId), {});
|
|
349762
349904
|
}
|
|
349763
349905
|
async function postConsumer2(config2, queueName, body) {
|
|
349764
349906
|
const accountId = await requireAuth(config2);
|
|
349765
|
-
return postConsumer(
|
|
349907
|
+
return postConsumer(
|
|
349908
|
+
config2,
|
|
349909
|
+
accountId,
|
|
349910
|
+
queueName,
|
|
349911
|
+
body,
|
|
349912
|
+
queueCreateCommand
|
|
349913
|
+
);
|
|
349766
349914
|
}
|
|
349767
349915
|
async function deletePullConsumer2(config2, queueName) {
|
|
349768
349916
|
const accountId = await requireAuth(config2);
|
|
349769
|
-
return deletePullConsumer(
|
|
349917
|
+
return deletePullConsumer(
|
|
349918
|
+
config2,
|
|
349919
|
+
accountId,
|
|
349920
|
+
queueName,
|
|
349921
|
+
queueCreateCommand
|
|
349922
|
+
);
|
|
349770
349923
|
}
|
|
349771
349924
|
async function listConsumers2(config2, queueName) {
|
|
349772
349925
|
const accountId = await requireAuth(config2);
|
|
349773
|
-
return listConsumers(config2, accountId, queueName);
|
|
349926
|
+
return listConsumers(config2, accountId, queueName, queueCreateCommand);
|
|
349774
349927
|
}
|
|
349775
349928
|
async function deleteWorkerConsumer2(config2, queueName, scriptName, envName) {
|
|
349776
349929
|
const accountId = await requireAuth(config2);
|
|
@@ -349779,7 +349932,8 @@ async function deleteWorkerConsumer2(config2, queueName, scriptName, envName) {
|
|
|
349779
349932
|
accountId,
|
|
349780
349933
|
queueName,
|
|
349781
349934
|
scriptName,
|
|
349782
|
-
envName
|
|
349935
|
+
envName,
|
|
349936
|
+
queueCreateCommand
|
|
349783
349937
|
);
|
|
349784
349938
|
}
|
|
349785
349939
|
async function purgeQueue(config2, queueName) {
|
|
@@ -349880,6 +350034,7 @@ var init_client14 = __esm({
|
|
|
349880
350034
|
}
|
|
349881
350035
|
return url4;
|
|
349882
350036
|
}, "queuesUrl");
|
|
350037
|
+
__name(queueCreateCommand, "queueCreateCommand");
|
|
349883
350038
|
__name(createQueue, "createQueue");
|
|
349884
350039
|
__name(updateQueue, "updateQueue");
|
|
349885
350040
|
__name(deleteQueue, "deleteQueue");
|
|
@@ -355950,6 +356105,11 @@ var init_triggers = __esm({
|
|
|
355950
356105
|
firstDeploy: false,
|
|
355951
356106
|
dryRun: args.dryRun,
|
|
355952
356107
|
validated: false,
|
|
356108
|
+
queueCreateCommand: /* @__PURE__ */ __name((queueName) => `wrangler queues create ${queueName}`, "queueCreateCommand"),
|
|
356109
|
+
workersDevConfigFieldName: "workers_dev",
|
|
356110
|
+
workersDevConfigAssignment: /* @__PURE__ */ __name((value) => `workers_dev = ${value}`, "workersDevConfigAssignment"),
|
|
356111
|
+
previewUrlsConfigFieldName: "preview_urls",
|
|
356112
|
+
previewUrlsConfigAssignment: /* @__PURE__ */ __name((value) => `preview_urls = ${value}`, "previewUrlsConfigAssignment"),
|
|
355953
356113
|
...props
|
|
355954
356114
|
});
|
|
355955
356115
|
}
|
|
@@ -360200,7 +360360,10 @@ var init_deploy6 = __esm({
|
|
|
360200
360360
|
""
|
|
360201
360361
|
).trim() ?? "All versions in a multi-version deployment must declare identical `exports`.";
|
|
360202
360362
|
throw new UserError(
|
|
360203
|
-
renderInconsistentExportsAcrossVersionsError(
|
|
360363
|
+
renderInconsistentExportsAcrossVersionsError(
|
|
360364
|
+
serverMessage,
|
|
360365
|
+
"wrangler versions deploy <new-version-id>@100%"
|
|
360366
|
+
),
|
|
360204
360367
|
{
|
|
360205
360368
|
telemetryMessage: "versions deploy inconsistent exports across versions"
|
|
360206
360369
|
}
|
|
@@ -361390,7 +361553,17 @@ var init_upload5 = __esm({
|
|
|
361390
361553
|
const { assetUploadStats: uploadStats } = await versionsUpload(
|
|
361391
361554
|
props,
|
|
361392
361555
|
config2,
|
|
361393
|
-
buildResult
|
|
361556
|
+
buildResult,
|
|
361557
|
+
{
|
|
361558
|
+
deployCommand: "wrangler deploy",
|
|
361559
|
+
versionsUploadCommand: "wrangler versions upload",
|
|
361560
|
+
versionsDeployCommand: "wrangler versions deploy",
|
|
361561
|
+
triggersDeployCommand: "wrangler triggers deploy",
|
|
361562
|
+
d1ListCommand: "wrangler d1 list",
|
|
361563
|
+
d1DeleteCommand: "wrangler d1 delete <database-name>",
|
|
361564
|
+
queueCreateCommand: /* @__PURE__ */ __name((queueName) => `wrangler queues create ${queueName}`, "queueCreateCommand"),
|
|
361565
|
+
versionsSecretPutCommand: "wrangler versions secret put"
|
|
361566
|
+
}
|
|
361394
361567
|
);
|
|
361395
361568
|
assetUploadStats = uploadStats;
|
|
361396
361569
|
} finally {
|
|
@@ -367086,7 +367259,10 @@ function createCLIParser(argv) {
|
|
|
367086
367259
|
registry2.registerNamespace("versions");
|
|
367087
367260
|
registry2.define([
|
|
367088
367261
|
{ command: "wrangler triggers", definition: triggersNamespace },
|
|
367089
|
-
{
|
|
367262
|
+
{
|
|
367263
|
+
command: "wrangler triggers deploy",
|
|
367264
|
+
definition: triggersDeployCommand
|
|
367265
|
+
}
|
|
367090
367266
|
]);
|
|
367091
367267
|
registry2.registerNamespace("triggers");
|
|
367092
367268
|
registry2.define([{ command: "wrangler delete", definition: deleteCommand3 }]);
|
|
@@ -367179,7 +367355,10 @@ function createCLIParser(argv) {
|
|
|
367179
367355
|
registry2.define([
|
|
367180
367356
|
{ command: "wrangler queues", definition: queuesNamespace },
|
|
367181
367357
|
{ command: "wrangler queues list", definition: queuesListCommand },
|
|
367182
|
-
{
|
|
367358
|
+
{
|
|
367359
|
+
command: "wrangler queues create",
|
|
367360
|
+
definition: queuesCreateCommand
|
|
367361
|
+
},
|
|
367183
367362
|
{ command: "wrangler queues update", definition: queuesUpdateCommand },
|
|
367184
367363
|
{ command: "wrangler queues delete", definition: queuesDeleteCommand },
|
|
367185
367364
|
{ command: "wrangler queues info", definition: queuesInfoCommand },
|
|
@@ -370697,6 +370876,7 @@ var init_LocalRuntimeController = __esm({
|
|
|
370697
370876
|
async prepareContainerImages(data, previousState) {
|
|
370698
370877
|
const nextState = {
|
|
370699
370878
|
dockerPath: data.config.dev.dockerPath ?? getDockerPath(),
|
|
370879
|
+
configFileName: configFileName(data.config.config),
|
|
370700
370880
|
complianceRegion: data.config.complianceRegion,
|
|
370701
370881
|
hasContainers: Boolean(
|
|
370702
370882
|
data.config.dev.enableContainers && data.config.containerDevPlan !== void 0
|
|
@@ -370726,7 +370906,9 @@ var init_LocalRuntimeController = __esm({
|
|
|
370726
370906
|
logger: logger2,
|
|
370727
370907
|
complianceConfig: {
|
|
370728
370908
|
compliance_region: nextState.complianceRegion
|
|
370729
|
-
}
|
|
370909
|
+
},
|
|
370910
|
+
configFileName: nextState.configFileName,
|
|
370911
|
+
registryConfigureCommand: "wrangler containers registries configure"
|
|
370730
370912
|
});
|
|
370731
370913
|
if (this.containerBeingBuilt) {
|
|
370732
370914
|
this.containerBeingBuilt.abortRequested = false;
|