@cloudflare/deploy-helpers 0.22.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +6 -3
- package/dist/index.mjs +85 -24
- package/dist/metafile-esm.json +1 -1
- package/package.json +7 -7
package/dist/index.d.mts
CHANGED
|
@@ -351,6 +351,8 @@ declare const INCONSISTENT_EXPORTS_ACROSS_VERSIONS_CODE = 100405;
|
|
|
351
351
|
declare const ACTOR_BINDING_DEPENDS_ON_EXPORT_CODE = 100406;
|
|
352
352
|
/** Workflows API code for `workflow.cron_requires_paid_plan`. */
|
|
353
353
|
declare const WORKFLOW_CRON_REQUIRES_PAID_PLAN_CODE = 10208;
|
|
354
|
+
/** Workflows API code for `workflow.jurisdiction_immutable`. */
|
|
355
|
+
declare const WORKFLOW_JURISDICTION_IMMUTABLE_CODE = 10209;
|
|
354
356
|
|
|
355
357
|
type SecretsValidationOptions = {
|
|
356
358
|
type: "deploy";
|
|
@@ -644,6 +646,7 @@ type Workflow = {
|
|
|
644
646
|
modified_on: string;
|
|
645
647
|
script_name: string;
|
|
646
648
|
class_name: string;
|
|
649
|
+
jurisdiction?: string;
|
|
647
650
|
};
|
|
648
651
|
interface WorkflowConflict {
|
|
649
652
|
name: string;
|
|
@@ -689,7 +692,7 @@ type RoutesRes = {
|
|
|
689
692
|
/**
|
|
690
693
|
* Downloads all information required to construct a Wrangler config file for a Worker from the API
|
|
691
694
|
*/
|
|
692
|
-
declare function fetchWorkerConfig(accountId: string, workerName: string, environment: string): Promise<{
|
|
695
|
+
declare function fetchWorkerConfig(complianceConfig: ComplianceConfig, accountId: string, workerName: string, environment: string): Promise<{
|
|
693
696
|
bindings: _cloudflare_workers_utils.WorkerMetadataBinding[];
|
|
694
697
|
routes: RoutesRes;
|
|
695
698
|
customDomains: CustomDomainsRes;
|
|
@@ -726,7 +729,7 @@ declare function fetchWorkerConfig(accountId: string, workerName: string, enviro
|
|
|
726
729
|
* Downloads all the remote information we can gather for a worker and from them generates a raw configuration object that
|
|
727
730
|
* approximates what a wrangler config object for the worker was/would have been.
|
|
728
731
|
*/
|
|
729
|
-
declare function downloadWorkerConfig(workerName: string, environment: string, entrypoint: string, accountId: string): Promise<RawConfig>;
|
|
732
|
+
declare function downloadWorkerConfig(complianceConfig: ComplianceConfig, workerName: string, environment: string, entrypoint: string, accountId: string): Promise<RawConfig>;
|
|
730
733
|
|
|
731
734
|
/**
|
|
732
735
|
* For a given Worker + migrations config, figure out which migrations
|
|
@@ -1353,4 +1356,4 @@ type DrawConnectedChildBoxOptions = {
|
|
|
1353
1356
|
*/
|
|
1354
1357
|
declare function drawConnectedChildBox(contentLines: string[], options?: DrawConnectedChildBoxOptions): string;
|
|
1355
1358
|
|
|
1356
|
-
export { ACTOR_BINDING_DEPENDS_ON_EXPORT_CODE, type ApiDeployment, type ApiVersion, type AssetManifest, type AssetUploadStats, type AssetsUploadResult, type Binding, BuiltDurableObjectContainerImage, type BulkInputNullableResult, type BulkInputResult, type BundleSize, type Consumer, type ConsumerSettings, ContainerlessConfig, type CreatePreviewDeploymentRequestParams, type CreatePreviewRequestParams, type CustomDomain, type CustomDomainChangeset, type DeployOptions, DeployProps, type DeploymentResource, type DurableObjectContainerApplication, EXPORTS_RECONCILIATION_ERROR_CODE, type EnvBindings, INCONSISTENT_EXPORTS_ACROSS_VERSIONS_CODE, INVALID_INHERIT_BINDING_CODE, type JsonLike, NO_ACTIVE_PREVIEW_URLS_MESSAGE, NoInputError, type NonVersionedScriptSettings, PREVIEW_DOMAIN_PROVISIONING_NOTE, type PackageDependency, type Percentage, type PostQueueBody, type PostQueueResponse, type PostTypedConsumerBody, type PreparedContainerImages, type PreviewArgs, type PreviewAssetsOptions, type PreviewBaseConfig, type PreviewBaseConfigPatch, type PreviewBuildOutput, type PreviewBuildOutputRootConfig, type PreviewDeleteArgs, type PreviewDeploymentModule, type PreviewOptions, type PreviewRequestOptions, type PreviewResource, type PreviewResult, type Producer, type ProvisionBindingsResult, type PullRequestMetadata, type PurgeQueueBody, type PurgeQueueResponse, type QueueJurisdiction, type QueueResponse, type QueueSettings, type RetrieveSourceMapFunction, type RouteObject, type ScriptReference, type Settings, SharedDeployVersionsProps, TriggerDeployment, TriggerProps, type TypedConsumerResponse, type UpdatePreviewRequestParams, type VersionCache, type VersionId, type VersionedDurableObjectContainerApplication, type VersionsUploadOptions, VersionsUploadProps, WORKER_LEGACY_ENVIRONMENT_NOT_FOUND_ERR_CODE, WORKER_NOT_FOUND_ERR_CODE, WORKFLOW_CRON_REQUIRES_PAID_PLAN_CODE, WORKFLOW_NOT_FOUND_CODE, WorkerBuildResult, type WorkerSubdomain, type Workflow, type WorkflowConflict, type Zone, type ZoneIdCache, addRequiredSecretsInheritBindings, addWorkersSitesBindings, applyServiceAndEnvironmentTags, assemblePreviewScriptSettings, assertPreviewBuildOutputRootConfig, buildAssetManifest, checkRemoteSecretsOverride, checkWorkflowConflicts, collectPackageDependencies, confirmLatestDeploymentOverwrite, createDeployment, createDurableObjectContainerApplication, createPreview, createPreviewDeployment, createPreviewDeploymentForm, createPreviewParentWorker, createTruncatedAlias, decodeJwtPayload, deletePreview, deletePullConsumer, deleteWorkerConsumer, deploy, deployDurableObjectContainerApplications, deployVersionedDurableObjectContainerApplications, deployWfpUserWorker, diagnoseScriptSizeError, diagnoseStartupError, diffJsonObjects, downloadWorkerConfig, drawBox, drawConnectedChildBox, editPreview, ensureQueuesExistByConfig, extractBuildOutputBindings, extractConfigBindings, fetchDeployableVersions, fetchDeploymentVersions, fetchLatestDeployment, fetchLatestDeployments, fetchSecrets, fetchVersion, fetchVersions, fetchWorkerConfig, formatAlignedRows, formatBindings, formatNoActivePreviewUrlsMessage, generatePreviewAlias, getBindingValue, getBranchName, getCommitSha, getConfigPatch, getDeployConfirmFunction, getEdgeKvUploadConcurrency, getHeadCommitMessage, getHeadCommitRef, getMigrationsToUpload, getPreview, getPreviewBaseConfig, getPreviewDeployment, getPreviewOwnedContainerClassNames, getPullRequestMetadata, getQueue, getRemoteConfigDiff, getRepositoryUrl, getSettings, getSize, getSourceMappedStack, getSourceMappedString, getSubdomainValues, getSubdomainValuesAPIMock, getVersionedDurableObjectContainerApplications, getWorkerSubdomain, getWorkersDevSubdomain, getWorkersDevSubdomainIfAccessible, getZoneForRoute, getZoneIdFromHost, handleMissingSecretsError, handleUnsafeCapnp, hasDefinedEnvironments, hashFile, helpIfErrorIsSizeOrScriptStartup, isExportsReconciliationErrorDetails, isJwtExpired, isModifiedDiffValue, isNonDestructive, isWorkerNotFoundError, listConsumers, listQueues, maybeRetrieveFileSourceMap, padToVisibleWidth, parseBulkInputToObject, parseConfigPlacement, patchNonVersionedScriptSettings, patchPreviewBaseConfig, patchPreviewDeployment, postConsumer, prepareDurableObjectContainerApplications, preview, previewBuildOutput, previewContainerAppName, previewDelete, printBundleSize, printVersions, provisionBindings, publishCustomDomains, publishRoutes, putConsumer, putConsumerById, renderBindingDependsOnExportError, renderD1DatabaseLimitError, renderExportsReconciliationError, renderExportsReconciliationSuccess, renderInconsistentExportsAcrossVersionsError, renderRoute, renderWorkersDevDefaultWarning, resolveAssetOptions, resolveDoLifecyclePayload, resolveExportsUploadPayload, resolveVersionedDurableObjectContainerApplications, resolveWorkerName, sanitizeBranchName, shouldUseCIMetadataFallback, stripAnsi, syncAssets, tagsAreEqual, triggersDeploy, updateQueueConsumers, validateEventTriggerTargets, validateFileSecrets, validateImageLessContainerApplicationsForUpload, validateNodeCompatMode, validateRoutes, verifyWorkerMatchesCITag, versionsUpload, visibleLength, warnOnErrorUpdatingServiceAndEnvironmentTags, workerNotFoundErrorMessage };
|
|
1359
|
+
export { ACTOR_BINDING_DEPENDS_ON_EXPORT_CODE, type ApiDeployment, type ApiVersion, type AssetManifest, type AssetUploadStats, type AssetsUploadResult, type Binding, BuiltDurableObjectContainerImage, type BulkInputNullableResult, type BulkInputResult, type BundleSize, type Consumer, type ConsumerSettings, ContainerlessConfig, type CreatePreviewDeploymentRequestParams, type CreatePreviewRequestParams, type CustomDomain, type CustomDomainChangeset, type DeployOptions, DeployProps, type DeploymentResource, type DurableObjectContainerApplication, EXPORTS_RECONCILIATION_ERROR_CODE, type EnvBindings, INCONSISTENT_EXPORTS_ACROSS_VERSIONS_CODE, INVALID_INHERIT_BINDING_CODE, type JsonLike, NO_ACTIVE_PREVIEW_URLS_MESSAGE, NoInputError, type NonVersionedScriptSettings, PREVIEW_DOMAIN_PROVISIONING_NOTE, type PackageDependency, type Percentage, type PostQueueBody, type PostQueueResponse, type PostTypedConsumerBody, type PreparedContainerImages, type PreviewArgs, type PreviewAssetsOptions, type PreviewBaseConfig, type PreviewBaseConfigPatch, type PreviewBuildOutput, type PreviewBuildOutputRootConfig, type PreviewDeleteArgs, type PreviewDeploymentModule, type PreviewOptions, type PreviewRequestOptions, type PreviewResource, type PreviewResult, type Producer, type ProvisionBindingsResult, type PullRequestMetadata, type PurgeQueueBody, type PurgeQueueResponse, type QueueJurisdiction, type QueueResponse, type QueueSettings, type RetrieveSourceMapFunction, type RouteObject, type ScriptReference, type Settings, SharedDeployVersionsProps, TriggerDeployment, TriggerProps, type TypedConsumerResponse, type UpdatePreviewRequestParams, type VersionCache, type VersionId, type VersionedDurableObjectContainerApplication, type VersionsUploadOptions, VersionsUploadProps, WORKER_LEGACY_ENVIRONMENT_NOT_FOUND_ERR_CODE, WORKER_NOT_FOUND_ERR_CODE, WORKFLOW_CRON_REQUIRES_PAID_PLAN_CODE, WORKFLOW_JURISDICTION_IMMUTABLE_CODE, WORKFLOW_NOT_FOUND_CODE, WorkerBuildResult, type WorkerSubdomain, type Workflow, type WorkflowConflict, type Zone, type ZoneIdCache, addRequiredSecretsInheritBindings, addWorkersSitesBindings, applyServiceAndEnvironmentTags, assemblePreviewScriptSettings, assertPreviewBuildOutputRootConfig, buildAssetManifest, checkRemoteSecretsOverride, checkWorkflowConflicts, collectPackageDependencies, confirmLatestDeploymentOverwrite, createDeployment, createDurableObjectContainerApplication, createPreview, createPreviewDeployment, createPreviewDeploymentForm, createPreviewParentWorker, createTruncatedAlias, decodeJwtPayload, deletePreview, deletePullConsumer, deleteWorkerConsumer, deploy, deployDurableObjectContainerApplications, deployVersionedDurableObjectContainerApplications, deployWfpUserWorker, diagnoseScriptSizeError, diagnoseStartupError, diffJsonObjects, downloadWorkerConfig, drawBox, drawConnectedChildBox, editPreview, ensureQueuesExistByConfig, extractBuildOutputBindings, extractConfigBindings, fetchDeployableVersions, fetchDeploymentVersions, fetchLatestDeployment, fetchLatestDeployments, fetchSecrets, fetchVersion, fetchVersions, fetchWorkerConfig, formatAlignedRows, formatBindings, formatNoActivePreviewUrlsMessage, generatePreviewAlias, getBindingValue, getBranchName, getCommitSha, getConfigPatch, getDeployConfirmFunction, getEdgeKvUploadConcurrency, getHeadCommitMessage, getHeadCommitRef, getMigrationsToUpload, getPreview, getPreviewBaseConfig, getPreviewDeployment, getPreviewOwnedContainerClassNames, getPullRequestMetadata, getQueue, getRemoteConfigDiff, getRepositoryUrl, getSettings, getSize, getSourceMappedStack, getSourceMappedString, getSubdomainValues, getSubdomainValuesAPIMock, getVersionedDurableObjectContainerApplications, getWorkerSubdomain, getWorkersDevSubdomain, getWorkersDevSubdomainIfAccessible, getZoneForRoute, getZoneIdFromHost, handleMissingSecretsError, handleUnsafeCapnp, hasDefinedEnvironments, hashFile, helpIfErrorIsSizeOrScriptStartup, isExportsReconciliationErrorDetails, isJwtExpired, isModifiedDiffValue, isNonDestructive, isWorkerNotFoundError, listConsumers, listQueues, maybeRetrieveFileSourceMap, padToVisibleWidth, parseBulkInputToObject, parseConfigPlacement, patchNonVersionedScriptSettings, patchPreviewBaseConfig, patchPreviewDeployment, postConsumer, prepareDurableObjectContainerApplications, preview, previewBuildOutput, previewContainerAppName, previewDelete, printBundleSize, printVersions, provisionBindings, publishCustomDomains, publishRoutes, putConsumer, putConsumerById, renderBindingDependsOnExportError, renderD1DatabaseLimitError, renderExportsReconciliationError, renderExportsReconciliationSuccess, renderInconsistentExportsAcrossVersionsError, renderRoute, renderWorkersDevDefaultWarning, resolveAssetOptions, resolveDoLifecyclePayload, resolveExportsUploadPayload, resolveVersionedDurableObjectContainerApplications, resolveWorkerName, sanitizeBranchName, shouldUseCIMetadataFallback, stripAnsi, syncAssets, tagsAreEqual, triggersDeploy, updateQueueConsumers, validateEventTriggerTargets, validateFileSecrets, validateImageLessContainerApplicationsForUpload, validateNodeCompatMode, validateRoutes, verifyWorkerMatchesCITag, versionsUpload, visibleLength, warnOnErrorUpdatingServiceAndEnvironmentTags, workerNotFoundErrorMessage };
|
package/dist/index.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import url2, { URLSearchParams as URLSearchParams$1 } from 'node:url';
|
|
|
12
12
|
import * as cli from '@cloudflare/cli-shared-helpers';
|
|
13
13
|
import { updateStatus, cancel } from '@cloudflare/cli-shared-helpers';
|
|
14
14
|
import { SchedulingPolicy, ApplicationsService, listDurableObjects, ApiError, resolveImageName, pushImageIfChanged, ContainerImagePreparationsService, ContainerImagePreparationStatus, createDurableObjectNamespaceResolver, initContainersSharedContext, pushBuiltContainerImage, deployContainers, verifyDockerInstalled } from '@cloudflare/containers-shared';
|
|
15
|
-
import { INHERIT_SYMBOL, APIError, UserError, getEnvironmentVariableFactory, partitionExports, isNonInteractiveOrCI, getHostFromRoute, retryOnAPIFailure, ParseError, getComplianceRegionSubdomain, configFileName, formatTime, getSubdomainMixedStateCheckDisabled, LOGGER_LEVELS, getResolvedDurableObjectContainerApps, isDurableObjectContainerApp, getDockerPath, validateDurableObjectContainerApplications, getDurableObjectClassNameToUseSQLiteMap, SERVICE_TAG_PREFIX, ENVIRONMENT_TAG_PREFIX, getDurableObjectExports, getWranglerTmpDir, parsePackageJSON, getInstalledPackageVersion, FatalError, readFileSync as readFileSync$1, parseJSON, experimental_readRawConfig, experimental_patchConfig, printBindings, PatchConfigError,
|
|
15
|
+
import { INHERIT_SYMBOL, APIError, UserError, getEnvironmentVariableFactory, partitionExports, isNonInteractiveOrCI, getHostFromRoute, retryOnAPIFailure, ParseError, getComplianceRegionSubdomain, configFileName, formatTime, getSubdomainMixedStateCheckDisabled, LOGGER_LEVELS, getResolvedDurableObjectContainerApps, isDurableObjectContainerApp, getDockerPath, validateDurableObjectContainerApplications, getDurableObjectClassNameToUseSQLiteMap, SERVICE_TAG_PREFIX, ENVIRONMENT_TAG_PREFIX, getDurableObjectExports, getWranglerTmpDir, parsePackageJSON, getInstalledPackageVersion, FatalError, readFileSync as readFileSync$1, parseJSON, experimental_readRawConfig, experimental_patchConfig, printBindings, PatchConfigError, constructWranglerConfig, getCIMatchTag, formatConfigSnippet, DEFAULT_COMPAT_DATE, writeOutput, getDurableObjectContainerApps, getBindings, hasDurableObjectExports, parseNonHyphenedUuid, getWorkersCIBranchName, getCIOverrideName, isLiveDurableObjectExport, getBindingTypeFriendlyName, defaultWranglerConfig } from '@cloudflare/workers-utils';
|
|
16
16
|
import { Response, FormData } from 'undici';
|
|
17
17
|
import chalk6 from 'chalk';
|
|
18
18
|
import PQueue4 from 'p-queue';
|
|
@@ -2756,6 +2756,7 @@ var EXPORTS_RECONCILIATION_ERROR_CODE = 100402;
|
|
|
2756
2756
|
var INCONSISTENT_EXPORTS_ACROSS_VERSIONS_CODE = 100405;
|
|
2757
2757
|
var ACTOR_BINDING_DEPENDS_ON_EXPORT_CODE = 100406;
|
|
2758
2758
|
var WORKFLOW_CRON_REQUIRES_PAID_PLAN_CODE = 10208;
|
|
2759
|
+
var WORKFLOW_JURISDICTION_IMMUTABLE_CODE = 10209;
|
|
2759
2760
|
function isWorkflowDefinedInThisScript(workflow, scriptName) {
|
|
2760
2761
|
return workflow.script_name === void 0 || workflow.script_name === scriptName;
|
|
2761
2762
|
}
|
|
@@ -2777,7 +2778,8 @@ function getWorkflowsOwnedByScript(config2, scriptName) {
|
|
|
2777
2778
|
limits: binding?.limits ?? workflowExport.limits,
|
|
2778
2779
|
concurrency: binding?.concurrency ?? workflowExport.concurrency,
|
|
2779
2780
|
schedules: binding?.schedules ?? workflowExport.schedules,
|
|
2780
|
-
default_retention: binding?.default_retention ?? workflowExport.default_retention
|
|
2781
|
+
default_retention: binding?.default_retention ?? workflowExport.default_retention,
|
|
2782
|
+
jurisdiction: binding?.jurisdiction ?? workflowExport.jurisdiction
|
|
2781
2783
|
});
|
|
2782
2784
|
}
|
|
2783
2785
|
return [...owned.values()];
|
|
@@ -2814,7 +2816,8 @@ function validateOwnedWorkflowDeclarations(config2, scriptName) {
|
|
|
2814
2816
|
"limits",
|
|
2815
2817
|
"concurrency",
|
|
2816
2818
|
"schedules",
|
|
2817
|
-
"default_retention"
|
|
2819
|
+
"default_retention",
|
|
2820
|
+
"jurisdiction"
|
|
2818
2821
|
]) {
|
|
2819
2822
|
const bindingValue = workflow[key];
|
|
2820
2823
|
const exportValue = workflowExport[key];
|
|
@@ -4340,6 +4343,14 @@ ${dashLink}`, {
|
|
|
4340
4343
|
}
|
|
4341
4344
|
);
|
|
4342
4345
|
}
|
|
4346
|
+
if (workflow.jurisdiction) {
|
|
4347
|
+
throw new UserError(
|
|
4348
|
+
`Workflow "${workflow.name}" has "jurisdiction" configured but references external script "${workflow.script_name}". Configure jurisdiction on the worker that defines the workflow.`,
|
|
4349
|
+
{
|
|
4350
|
+
telemetryMessage: "triggers deploy workflow jurisdiction external script"
|
|
4351
|
+
}
|
|
4352
|
+
);
|
|
4353
|
+
}
|
|
4343
4354
|
}
|
|
4344
4355
|
}
|
|
4345
4356
|
for (const workflow of ownedWorkflows) {
|
|
@@ -4362,6 +4373,9 @@ ${dashLink}`, {
|
|
|
4362
4373
|
},
|
|
4363
4374
|
...workflow.default_retention && {
|
|
4364
4375
|
default_retention: workflow.default_retention
|
|
4376
|
+
},
|
|
4377
|
+
...workflow.jurisdiction && {
|
|
4378
|
+
jurisdiction: workflow.jurisdiction
|
|
4365
4379
|
}
|
|
4366
4380
|
}),
|
|
4367
4381
|
headers: {
|
|
@@ -4388,6 +4402,20 @@ ${dashLink}`, {
|
|
|
4388
4402
|
)
|
|
4389
4403
|
};
|
|
4390
4404
|
}
|
|
4405
|
+
if (error62 instanceof APIError && error62.code === WORKFLOW_JURISDICTION_IMMUTABLE_CODE && workflow.jurisdiction) {
|
|
4406
|
+
error62.preventReport();
|
|
4407
|
+
return {
|
|
4408
|
+
category: "Workflows",
|
|
4409
|
+
targets: [],
|
|
4410
|
+
error: new UserError(
|
|
4411
|
+
`Workflow "${workflow.name}" already exists with a different jurisdiction, and a Workflow's jurisdiction cannot be changed after it is created. Give the Workflow a new name, or delete the existing Workflow first, which also deletes its instances.`,
|
|
4412
|
+
{
|
|
4413
|
+
cause: error62,
|
|
4414
|
+
telemetryMessage: "triggers deploy workflow jurisdiction immutable"
|
|
4415
|
+
}
|
|
4416
|
+
)
|
|
4417
|
+
};
|
|
4418
|
+
}
|
|
4391
4419
|
return {
|
|
4392
4420
|
category: "Workflows",
|
|
4393
4421
|
resource: `Workflow "${workflow.name}"`,
|
|
@@ -30178,16 +30206,27 @@ async function checkWorkflowConflicts(config2, accountId, scriptName) {
|
|
|
30178
30206
|
return { hasConflicts: false };
|
|
30179
30207
|
}
|
|
30180
30208
|
const workflowChecks = await Promise.all(
|
|
30181
|
-
workflowsToDeploy.map(async (workflow) => {
|
|
30182
|
-
|
|
30183
|
-
|
|
30184
|
-
|
|
30185
|
-
}
|
|
30186
|
-
return null;
|
|
30187
|
-
})
|
|
30209
|
+
workflowsToDeploy.map(async (workflow) => ({
|
|
30210
|
+
workflow,
|
|
30211
|
+
existing: await getWorkflow(config2, accountId, workflow.name)
|
|
30212
|
+
}))
|
|
30188
30213
|
);
|
|
30189
|
-
const
|
|
30190
|
-
(
|
|
30214
|
+
const jurisdictionChanges = workflowChecks.flatMap(
|
|
30215
|
+
({ workflow, existing }) => existing !== null && workflow.jurisdiction !== void 0 && existing.jurisdiction !== workflow.jurisdiction ? [
|
|
30216
|
+
` - "${workflow.name}" (${existing.jurisdiction ? `has jurisdiction "${existing.jurisdiction}"` : "has no jurisdiction"}, configured "${workflow.jurisdiction}")`
|
|
30217
|
+
] : []
|
|
30218
|
+
);
|
|
30219
|
+
if (jurisdictionChanges.length > 0) {
|
|
30220
|
+
throw new UserError(
|
|
30221
|
+
`The following Workflow(s) already exist with a different jurisdiction:
|
|
30222
|
+
${jurisdictionChanges.join("\n")}
|
|
30223
|
+
|
|
30224
|
+
A Workflow's jurisdiction is set when it is created and cannot be changed. To use a different jurisdiction, rename the Workflow(s) in your ${configFileName(config2.configPath, config2.userConfigPath)}, or delete the existing Workflow(s) first, which also deletes their instances.`,
|
|
30225
|
+
{ telemetryMessage: "deploy workflow jurisdiction changed" }
|
|
30226
|
+
);
|
|
30227
|
+
}
|
|
30228
|
+
const conflicts = workflowChecks.flatMap(
|
|
30229
|
+
({ workflow, existing }) => existing && existing.script_name !== scriptName ? [{ name: workflow.name, currentOwner: existing.script_name }] : []
|
|
30191
30230
|
);
|
|
30192
30231
|
if (conflicts.length === 0) {
|
|
30193
30232
|
return { hasConflicts: false };
|
|
@@ -30309,8 +30348,12 @@ function getRemoteConfigDiff(remoteConfig, localResolvedConfig) {
|
|
|
30309
30348
|
normalizedLocalConfig
|
|
30310
30349
|
);
|
|
30311
30350
|
const diff = diffJsonObjects(
|
|
30312
|
-
|
|
30313
|
-
|
|
30351
|
+
omitUndefinedProperties(
|
|
30352
|
+
normalizedRemoteConfig
|
|
30353
|
+
),
|
|
30354
|
+
omitUndefinedProperties(
|
|
30355
|
+
normalizedLocalConfig
|
|
30356
|
+
)
|
|
30314
30357
|
);
|
|
30315
30358
|
return {
|
|
30316
30359
|
diff,
|
|
@@ -30318,6 +30361,18 @@ function getRemoteConfigDiff(remoteConfig, localResolvedConfig) {
|
|
|
30318
30361
|
};
|
|
30319
30362
|
}
|
|
30320
30363
|
__name(getRemoteConfigDiff, "getRemoteConfigDiff");
|
|
30364
|
+
function omitUndefinedProperties(value) {
|
|
30365
|
+
if (Array.isArray(value)) {
|
|
30366
|
+
return value.map(omitUndefinedProperties);
|
|
30367
|
+
}
|
|
30368
|
+
if (value === null || typeof value !== "object") {
|
|
30369
|
+
return value;
|
|
30370
|
+
}
|
|
30371
|
+
return Object.fromEntries(
|
|
30372
|
+
Object.entries(value).filter(([, fieldValue]) => fieldValue !== void 0).map(([key, fieldValue]) => [key, omitUndefinedProperties(fieldValue)])
|
|
30373
|
+
);
|
|
30374
|
+
}
|
|
30375
|
+
__name(omitUndefinedProperties, "omitUndefinedProperties");
|
|
30321
30376
|
function normalizeLocalResolvedConfigAsRemote(localResolvedConfig) {
|
|
30322
30377
|
const subdomainValues = getSubdomainValuesAPIMock(
|
|
30323
30378
|
localResolvedConfig.workers_dev,
|
|
@@ -30751,7 +30806,7 @@ function getDeployConfirmFunction(options) {
|
|
|
30751
30806
|
return confirm;
|
|
30752
30807
|
}
|
|
30753
30808
|
__name(getDeployConfirmFunction, "getDeployConfirmFunction");
|
|
30754
|
-
async function fetchWorkerConfig(accountId, workerName, environment) {
|
|
30809
|
+
async function fetchWorkerConfig(complianceConfig, accountId, workerName, environment) {
|
|
30755
30810
|
const [
|
|
30756
30811
|
bindings,
|
|
30757
30812
|
routes,
|
|
@@ -30761,27 +30816,27 @@ async function fetchWorkerConfig(accountId, workerName, environment) {
|
|
|
30761
30816
|
cronTriggers
|
|
30762
30817
|
] = await Promise.all([
|
|
30763
30818
|
fetchResult(
|
|
30764
|
-
|
|
30819
|
+
complianceConfig,
|
|
30765
30820
|
`/accounts/${accountId}/workers/services/${workerName}/environments/${environment}/bindings`
|
|
30766
30821
|
),
|
|
30767
30822
|
fetchResult(
|
|
30768
|
-
|
|
30823
|
+
complianceConfig,
|
|
30769
30824
|
`/accounts/${accountId}/workers/services/${workerName}/environments/${environment}/routes?show_zonename=true`
|
|
30770
30825
|
),
|
|
30771
30826
|
fetchResult(
|
|
30772
|
-
|
|
30827
|
+
complianceConfig,
|
|
30773
30828
|
`/accounts/${accountId}/workers/domains/records?page=0&per_page=5&service=${workerName}&environment=${environment}`
|
|
30774
30829
|
),
|
|
30775
30830
|
fetchResult(
|
|
30776
|
-
|
|
30831
|
+
complianceConfig,
|
|
30777
30832
|
`/accounts/${accountId}/workers/services/${workerName}/environments/${environment}/subdomain`
|
|
30778
30833
|
),
|
|
30779
30834
|
fetchResult(
|
|
30780
|
-
|
|
30835
|
+
complianceConfig,
|
|
30781
30836
|
`/accounts/${accountId}/workers/services/${workerName}/environments/${environment}`
|
|
30782
30837
|
),
|
|
30783
30838
|
fetchResult(
|
|
30784
|
-
|
|
30839
|
+
complianceConfig,
|
|
30785
30840
|
`/accounts/${accountId}/workers/scripts/${workerName}/schedules`
|
|
30786
30841
|
)
|
|
30787
30842
|
]).catch((e) => {
|
|
@@ -30800,7 +30855,7 @@ async function fetchWorkerConfig(accountId, workerName, environment) {
|
|
|
30800
30855
|
};
|
|
30801
30856
|
}
|
|
30802
30857
|
__name(fetchWorkerConfig, "fetchWorkerConfig");
|
|
30803
|
-
async function downloadWorkerConfig(workerName, environment, entrypoint, accountId) {
|
|
30858
|
+
async function downloadWorkerConfig(complianceConfig, workerName, environment, entrypoint, accountId) {
|
|
30804
30859
|
const {
|
|
30805
30860
|
bindings,
|
|
30806
30861
|
routes,
|
|
@@ -30808,7 +30863,12 @@ async function downloadWorkerConfig(workerName, environment, entrypoint, account
|
|
|
30808
30863
|
subdomainStatus,
|
|
30809
30864
|
serviceEnvMetadata,
|
|
30810
30865
|
cronTriggers
|
|
30811
|
-
} = await fetchWorkerConfig(
|
|
30866
|
+
} = await fetchWorkerConfig(
|
|
30867
|
+
complianceConfig,
|
|
30868
|
+
accountId,
|
|
30869
|
+
workerName,
|
|
30870
|
+
environment
|
|
30871
|
+
);
|
|
30812
30872
|
return constructWranglerConfig({
|
|
30813
30873
|
name: workerName,
|
|
30814
30874
|
entrypoint,
|
|
@@ -31146,6 +31206,7 @@ async function preUploadApiChecks(props, config2, queueCreateCommand) {
|
|
|
31146
31206
|
}
|
|
31147
31207
|
if (script.last_deployed_from === "dash") {
|
|
31148
31208
|
const remoteWorkerConfig = await downloadWorkerConfig(
|
|
31209
|
+
config2,
|
|
31149
31210
|
name,
|
|
31150
31211
|
serviceMetaData.default_environment.environment,
|
|
31151
31212
|
props.entry.file,
|
|
@@ -34099,4 +34160,4 @@ __name(formatBindings, "formatBindings");
|
|
|
34099
34160
|
* THE SOFTWARE.
|
|
34100
34161
|
*/
|
|
34101
34162
|
|
|
34102
|
-
export { ACTOR_BINDING_DEPENDS_ON_EXPORT_CODE, EXPORTS_RECONCILIATION_ERROR_CODE, INCONSISTENT_EXPORTS_ACROSS_VERSIONS_CODE, INVALID_INHERIT_BINDING_CODE, NO_ACTIVE_PREVIEW_URLS_MESSAGE, NoInputError, PREVIEW_DOMAIN_PROVISIONING_NOTE, WORKER_LEGACY_ENVIRONMENT_NOT_FOUND_ERR_CODE, WORKER_NOT_FOUND_ERR_CODE, WORKFLOW_CRON_REQUIRES_PAID_PLAN_CODE, WORKFLOW_NOT_FOUND_CODE, addRequiredSecretsInheritBindings, addWorkersSitesBindings, applyServiceAndEnvironmentTags, assemblePreviewScriptSettings, assertPreviewBuildOutputRootConfig, buildAssetManifest, checkRemoteSecretsOverride, checkWorkflowConflicts, collectPackageDependencies, confirmLatestDeploymentOverwrite, createDeployment, createDurableObjectContainerApplication, createPreview, createPreviewDeployment, createPreviewDeploymentForm, createPreviewParentWorker, createTruncatedAlias, decodeJwtPayload, deletePreview, deletePullConsumer, deleteWorkerConsumer, deploy, deployDurableObjectContainerApplications, deployVersionedDurableObjectContainerApplications, deployWfpUserWorker, diagnoseScriptSizeError, diagnoseStartupError, diffJsonObjects, downloadWorkerConfig, drawBox, drawConnectedChildBox, editPreview, ensureQueuesExistByConfig, extractBuildOutputBindings, extractConfigBindings, fetchDeployableVersions, fetchDeploymentVersions, fetchLatestDeployment, fetchLatestDeployments, fetchSecrets, fetchVersion, fetchVersions, fetchWorkerConfig, formatAlignedRows, formatBindings, formatNoActivePreviewUrlsMessage, generatePreviewAlias, getBindingValue, getBranchName2 as getBranchName, getCommitSha, getConfigPatch, getDeployConfirmFunction, getEdgeKvUploadConcurrency, getHeadCommitMessage, getHeadCommitRef, getMigrationsToUpload, getPreview, getPreviewBaseConfig, getPreviewDeployment, getPreviewOwnedContainerClassNames, getPullRequestMetadata, getQueue, getRemoteConfigDiff, getRepositoryUrl, getSettings, getSize, getSourceMappedStack, getSourceMappedString, getSubdomainValues, getSubdomainValuesAPIMock, getVersionedDurableObjectContainerApplications, getWorkerSubdomain, getWorkersDevSubdomain, getWorkersDevSubdomainIfAccessible, getZoneForRoute, getZoneIdFromHost, handleMissingSecretsError, hasDefinedEnvironments, hashFile, helpIfErrorIsSizeOrScriptStartup, isExportsReconciliationErrorDetails, isJwtExpired, isModifiedDiffValue, isNonDestructive, isWorkerNotFoundError, listConsumers, listQueues, maybeRetrieveFileSourceMap, padToVisibleWidth, parseBulkInputToObject, parseConfigPlacement, patchNonVersionedScriptSettings, patchPreviewBaseConfig, patchPreviewDeployment, postConsumer, prepareDurableObjectContainerApplications, preview, previewBuildOutput, previewContainerAppName, previewDelete, printBundleSize, printVersions, provisionBindings, publishCustomDomains, publishRoutes, putConsumer, putConsumerById, renderBindingDependsOnExportError, renderD1DatabaseLimitError, renderExportsReconciliationError, renderExportsReconciliationSuccess, renderInconsistentExportsAcrossVersionsError, renderRoute, renderWorkersDevDefaultWarning, resolveAssetOptions, resolveDoLifecyclePayload, resolveExportsUploadPayload, resolveVersionedDurableObjectContainerApplications, resolveWorkerName, sanitizeBranchName, shouldUseCIMetadataFallback, stripAnsi, syncAssets, tagsAreEqual, triggersDeploy, updateQueueConsumers, validateEventTriggerTargets, validateFileSecrets, validateImageLessContainerApplicationsForUpload, validateNodeCompatMode, validateRoutes, verifyWorkerMatchesCITag, versionsUpload, visibleLength, warnOnErrorUpdatingServiceAndEnvironmentTags, workerNotFoundErrorMessage };
|
|
34163
|
+
export { ACTOR_BINDING_DEPENDS_ON_EXPORT_CODE, EXPORTS_RECONCILIATION_ERROR_CODE, INCONSISTENT_EXPORTS_ACROSS_VERSIONS_CODE, INVALID_INHERIT_BINDING_CODE, NO_ACTIVE_PREVIEW_URLS_MESSAGE, NoInputError, PREVIEW_DOMAIN_PROVISIONING_NOTE, WORKER_LEGACY_ENVIRONMENT_NOT_FOUND_ERR_CODE, WORKER_NOT_FOUND_ERR_CODE, WORKFLOW_CRON_REQUIRES_PAID_PLAN_CODE, WORKFLOW_JURISDICTION_IMMUTABLE_CODE, WORKFLOW_NOT_FOUND_CODE, addRequiredSecretsInheritBindings, addWorkersSitesBindings, applyServiceAndEnvironmentTags, assemblePreviewScriptSettings, assertPreviewBuildOutputRootConfig, buildAssetManifest, checkRemoteSecretsOverride, checkWorkflowConflicts, collectPackageDependencies, confirmLatestDeploymentOverwrite, createDeployment, createDurableObjectContainerApplication, createPreview, createPreviewDeployment, createPreviewDeploymentForm, createPreviewParentWorker, createTruncatedAlias, decodeJwtPayload, deletePreview, deletePullConsumer, deleteWorkerConsumer, deploy, deployDurableObjectContainerApplications, deployVersionedDurableObjectContainerApplications, deployWfpUserWorker, diagnoseScriptSizeError, diagnoseStartupError, diffJsonObjects, downloadWorkerConfig, drawBox, drawConnectedChildBox, editPreview, ensureQueuesExistByConfig, extractBuildOutputBindings, extractConfigBindings, fetchDeployableVersions, fetchDeploymentVersions, fetchLatestDeployment, fetchLatestDeployments, fetchSecrets, fetchVersion, fetchVersions, fetchWorkerConfig, formatAlignedRows, formatBindings, formatNoActivePreviewUrlsMessage, generatePreviewAlias, getBindingValue, getBranchName2 as getBranchName, getCommitSha, getConfigPatch, getDeployConfirmFunction, getEdgeKvUploadConcurrency, getHeadCommitMessage, getHeadCommitRef, getMigrationsToUpload, getPreview, getPreviewBaseConfig, getPreviewDeployment, getPreviewOwnedContainerClassNames, getPullRequestMetadata, getQueue, getRemoteConfigDiff, getRepositoryUrl, getSettings, getSize, getSourceMappedStack, getSourceMappedString, getSubdomainValues, getSubdomainValuesAPIMock, getVersionedDurableObjectContainerApplications, getWorkerSubdomain, getWorkersDevSubdomain, getWorkersDevSubdomainIfAccessible, getZoneForRoute, getZoneIdFromHost, handleMissingSecretsError, hasDefinedEnvironments, hashFile, helpIfErrorIsSizeOrScriptStartup, isExportsReconciliationErrorDetails, isJwtExpired, isModifiedDiffValue, isNonDestructive, isWorkerNotFoundError, listConsumers, listQueues, maybeRetrieveFileSourceMap, padToVisibleWidth, parseBulkInputToObject, parseConfigPlacement, patchNonVersionedScriptSettings, patchPreviewBaseConfig, patchPreviewDeployment, postConsumer, prepareDurableObjectContainerApplications, preview, previewBuildOutput, previewContainerAppName, previewDelete, printBundleSize, printVersions, provisionBindings, publishCustomDomains, publishRoutes, putConsumer, putConsumerById, renderBindingDependsOnExportError, renderD1DatabaseLimitError, renderExportsReconciliationError, renderExportsReconciliationSuccess, renderInconsistentExportsAcrossVersionsError, renderRoute, renderWorkersDevDefaultWarning, resolveAssetOptions, resolveDoLifecyclePayload, resolveExportsUploadPayload, resolveVersionedDurableObjectContainerApplications, resolveWorkerName, sanitizeBranchName, shouldUseCIMetadataFallback, stripAnsi, syncAssets, tagsAreEqual, triggersDeploy, updateQueueConsumers, validateEventTriggerTargets, validateFileSecrets, validateImageLessContainerApplicationsForUpload, validateNodeCompatMode, validateRoutes, verifyWorkerMatchesCITag, versionsUpload, visibleLength, warnOnErrorUpdatingServiceAndEnvironmentTags, workerNotFoundErrorMessage };
|