@cloudflare/deploy-helpers 0.10.2 → 0.11.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.
|
@@ -755,7 +755,8 @@ function createWorkerUploadForm(worker, bindings, options) {
|
|
|
755
755
|
// `class_name` or an `exports` entry naming the container by `name`.
|
|
756
756
|
containers: worker.containers === void 0 ? void 0 : worker.containers.map((c) => ({
|
|
757
757
|
...c.name !== void 0 && { name: c.name },
|
|
758
|
-
...c.class_name !== void 0 && { class_name: c.class_name }
|
|
758
|
+
...c.class_name !== void 0 && { class_name: c.class_name },
|
|
759
|
+
...c.images !== void 0 && { images: c.images }
|
|
759
760
|
})),
|
|
760
761
|
...compatibility_date && { compatibility_date },
|
|
761
762
|
...compatibility_flags && {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { createWorkerUploadForm, fromMimeType, moduleTypeMimeType } from './chunk-
|
|
1
|
+
export { createWorkerUploadForm, fromMimeType, moduleTypeMimeType } from './chunk-3G6JZQDH.mjs';
|
|
2
2
|
import './chunk-Q72B4Q5Z.mjs';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { S as SharedDeployVersionsProps, D as DeployProps, W as WorkerBuildResult, V as VersionsUploadProps, T as TriggerProps, a as TriggerDeployment } from './context-nFHuelHB.mjs';
|
|
2
2
|
export { b as DeployHelpersContext, i as initDeployHelpersContext } from './context-nFHuelHB.mjs';
|
|
3
3
|
import * as _cloudflare_workers_utils from '@cloudflare/workers-utils';
|
|
4
|
-
import { CfModule, Config, AssetsOptions, ComplianceConfig, LegacyAssetPaths, Route, ZoneIdRoute, ZoneNameRoute, CustomDomainRoute, CfPlacement, Binding as Binding$1, RawConfig, CfCapnp, CfScriptFormat, ParseError, WorkerMetadataBinding, CfUserLimits, TailConsumer, StreamingTailConsumer, Observability,
|
|
4
|
+
import { CfModule, Config, AssetsOptions, ComplianceConfig, LegacyAssetPaths, Route, ZoneIdRoute, ZoneNameRoute, CustomDomainRoute, CfPlacement, Binding as Binding$1, RawConfig, CfCapnp, CfScriptFormat, ParseError, WorkerMetadataBinding, CfUserLimits, CfWorkerInit, TailConsumer, StreamingTailConsumer, Observability, ExportsReconciliationErrorDetail, ExportsReconciliationResult, StartDevWorkerInput, CacheOptions, PreviewsConfig } from '@cloudflare/workers-utils';
|
|
5
5
|
import { ContainerNormalizedConfig, ImageURIConfig } from '@cloudflare/containers-shared';
|
|
6
6
|
import { FormData } from 'undici';
|
|
7
7
|
export { createWorkerUploadForm, fromMimeType, moduleTypeMimeType } from './create-worker-upload-form.mjs';
|
|
@@ -58,6 +58,18 @@ type DeployCallbacks = {
|
|
|
58
58
|
versionId: string;
|
|
59
59
|
accountId: string;
|
|
60
60
|
scriptName: string;
|
|
61
|
+
dispatchNamespace?: string;
|
|
62
|
+
}) => Promise<void>) | undefined;
|
|
63
|
+
prepareDurableObjectContainerApplications: ((config: Config, args: {
|
|
64
|
+
dryRun: boolean;
|
|
65
|
+
scriptName: string;
|
|
66
|
+
dispatchNamespace?: string;
|
|
67
|
+
}) => Promise<Record<string, Record<string, string>>>) | undefined;
|
|
68
|
+
deployDurableObjectContainerApplications: ((config: Config, args: {
|
|
69
|
+
versionId: string;
|
|
70
|
+
accountId: string;
|
|
71
|
+
scriptName: string;
|
|
72
|
+
dispatchNamespace?: string;
|
|
61
73
|
}) => Promise<void>) | undefined;
|
|
62
74
|
analyseBundle: ((workerBundle: string | FormData) => Promise<Record<string, unknown>>) | undefined;
|
|
63
75
|
};
|
|
@@ -71,7 +83,7 @@ type DeployResult = {
|
|
|
71
83
|
};
|
|
72
84
|
declare function deploy(props: DeployProps, config: Config, buildResult: WorkerBuildResult, callbacks: DeployCallbacks): Promise<DeployResult>;
|
|
73
85
|
|
|
74
|
-
type VersionsUploadCallbacks = Pick<DeployCallbacks, "analyseBundle"
|
|
86
|
+
type VersionsUploadCallbacks = Pick<DeployCallbacks, "analyseBundle"> & Partial<Pick<DeployCallbacks, "prepareDurableObjectContainerApplications" | "deployDurableObjectContainerApplications">>;
|
|
75
87
|
type VersionsUploadResult = {
|
|
76
88
|
versionId: string | null;
|
|
77
89
|
workerTag: string | null;
|
|
@@ -554,6 +566,7 @@ type ApiVersion = {
|
|
|
554
566
|
compatibility_flags?: string[];
|
|
555
567
|
usage_model: "bundled" | "unbound" | "standard";
|
|
556
568
|
limits: CfUserLimits;
|
|
569
|
+
containers?: CfWorkerInit["containers"];
|
|
557
570
|
};
|
|
558
571
|
};
|
|
559
572
|
startup_time_ms?: number;
|
|
@@ -758,6 +771,7 @@ declare function checkRemoteSecretsOverride(config: Config, scriptName: string,
|
|
|
758
771
|
deployErrorMessage: string;
|
|
759
772
|
}>;
|
|
760
773
|
|
|
774
|
+
/** Confirm replacement of the current deployment, preserving the public boolean API. */
|
|
761
775
|
declare function confirmLatestDeploymentOverwrite(config: Config, accountId: string, scriptName: string): Promise<boolean>;
|
|
762
776
|
declare function printVersions(versions: ApiVersion[], traffic: Map<VersionId, Percentage>): void;
|
|
763
777
|
|
|
@@ -942,20 +956,6 @@ type UpdatePreviewRequestParams = Omit<CreatePreviewRequestParams, "name">;
|
|
|
942
956
|
type PreviewRequestOptions = {
|
|
943
957
|
ignoreBaseConfig?: boolean;
|
|
944
958
|
};
|
|
945
|
-
type PreviewDefaults = {
|
|
946
|
-
observability?: Observability;
|
|
947
|
-
logpush?: boolean;
|
|
948
|
-
limits?: CfUserLimits;
|
|
949
|
-
placement?: CfPlacement;
|
|
950
|
-
cache?: CacheOptions;
|
|
951
|
-
tail_consumers?: Array<{
|
|
952
|
-
name: string;
|
|
953
|
-
}>;
|
|
954
|
-
env?: EnvBindings;
|
|
955
|
-
};
|
|
956
|
-
type PreviewDefaultsPatch = Partial<Omit<PreviewDefaults, "env">> & {
|
|
957
|
-
env?: Record<string, Binding | null>;
|
|
958
|
-
};
|
|
959
959
|
type PreviewBaseConfig = {
|
|
960
960
|
observability?: Observability;
|
|
961
961
|
logpush?: boolean;
|
|
@@ -986,8 +986,6 @@ declare function patchPreviewDeployment(config: Config, accountId: string, worke
|
|
|
986
986
|
"workers/message"?: string;
|
|
987
987
|
"workers/tag"?: string;
|
|
988
988
|
}, deploymentIdentifier?: string): Promise<DeploymentResource>;
|
|
989
|
-
declare function getWorkerPreviewDefaults(config: Config, accountId: string, workerName: string): Promise<PreviewDefaults>;
|
|
990
|
-
declare function editWorkerPreviewDefaults(config: Config, accountId: string, workerName: string, previewDefaults: PreviewDefaultsPatch): Promise<PreviewDefaults>;
|
|
991
989
|
declare function getPreviewBaseConfig(config: Config, accountId: string, workerName: string): Promise<PreviewBaseConfig>;
|
|
992
990
|
declare function patchPreviewBaseConfig(config: Config, accountId: string, workerName: string, previewBaseConfig: PreviewBaseConfigPatch): Promise<PreviewBaseConfig>;
|
|
993
991
|
|
|
@@ -1070,7 +1068,6 @@ declare function getPreviewOwnedContainerClassNames(config: Config, previews: Pr
|
|
|
1070
1068
|
*/
|
|
1071
1069
|
declare function previewContainerAppName(parentWorkerName: string, previewSlug: string, className: string): string;
|
|
1072
1070
|
declare function assemblePreviewScriptSettings(config: Config): Record<string, unknown>;
|
|
1073
|
-
declare function assemblePreviewDefaults(config: Config): PreviewDefaults;
|
|
1074
1071
|
|
|
1075
1072
|
type PreviewArgs = {
|
|
1076
1073
|
script?: string;
|
|
@@ -1127,32 +1124,6 @@ declare function formatAlignedRows(rows: Array<[string, string, boolean]>, inden
|
|
|
1127
1124
|
declare function formatBindings(env: Record<string, MergedBinding>, indent?: string, options?: {
|
|
1128
1125
|
showSourceMarker?: boolean;
|
|
1129
1126
|
}): string[];
|
|
1130
|
-
declare function formatPreviewsSettings(workerName: string, previewDefaults: PreviewDefaults): string;
|
|
1131
|
-
|
|
1132
|
-
/**
|
|
1133
|
-
* Deep merge two objects. Source overwrites target.
|
|
1134
|
-
* Arrays are treated as terminal values and replaced wholesale.
|
|
1135
|
-
*/
|
|
1136
|
-
declare function mergeDeep<T>(target: T, source: Partial<T>): T;
|
|
1137
|
-
|
|
1138
|
-
type PreviewSettingsArgs = {
|
|
1139
|
-
json?: boolean;
|
|
1140
|
-
workerName?: string;
|
|
1141
|
-
"worker-name"?: string;
|
|
1142
|
-
};
|
|
1143
|
-
type PreviewSettingsUpdateArgs = {
|
|
1144
|
-
skipConfirmation?: boolean;
|
|
1145
|
-
workerName?: string;
|
|
1146
|
-
"worker-name"?: string;
|
|
1147
|
-
};
|
|
1148
|
-
/**
|
|
1149
|
-
* Fetch and display the current Previews settings for a Worker.
|
|
1150
|
-
*/
|
|
1151
|
-
declare function previewSettingsGet(accountId: string, args: PreviewSettingsArgs, config: Config): Promise<void>;
|
|
1152
|
-
/**
|
|
1153
|
-
* Merge local config with remote Previews settings, diff, confirm, and apply.
|
|
1154
|
-
*/
|
|
1155
|
-
declare function previewSettingsUpdate(accountId: string, args: PreviewSettingsUpdateArgs, config: Config): Promise<void>;
|
|
1156
1127
|
|
|
1157
1128
|
/**
|
|
1158
1129
|
* Remove ANSI escape codes from a string.
|
|
@@ -1194,4 +1165,4 @@ type DrawConnectedChildBoxOptions = {
|
|
|
1194
1165
|
*/
|
|
1195
1166
|
declare function drawConnectedChildBox(contentLines: string[], options?: DrawConnectedChildBoxOptions): string;
|
|
1196
1167
|
|
|
1197
|
-
export { ACTOR_BINDING_DEPENDS_ON_EXPORT_CODE, type ApiDeployment, type ApiVersion, type AssetManifest, type AssetUploadStats, type AssetsUploadResult, type Binding, type BulkInputNullableResult, type BulkInputResult, type BundleSize, type Consumer, type ConsumerSettings, type CreatePreviewDeploymentRequestParams, type CreatePreviewRequestParams, type CustomDomain, type CustomDomainChangeset, type DeployCallbacks, DeployProps, type DeploymentResource, 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, type PackageDependency, type Percentage, type PostQueueBody, type PostQueueResponse, type PostTypedConsumerBody, type PreviewArgs, type PreviewAssetsOptions, type PreviewBaseConfig, type PreviewBaseConfigPatch, type PreviewCallbacks, type
|
|
1168
|
+
export { ACTOR_BINDING_DEPENDS_ON_EXPORT_CODE, type ApiDeployment, type ApiVersion, type AssetManifest, type AssetUploadStats, type AssetsUploadResult, type Binding, type BulkInputNullableResult, type BulkInputResult, type BundleSize, type Consumer, type ConsumerSettings, type CreatePreviewDeploymentRequestParams, type CreatePreviewRequestParams, type CustomDomain, type CustomDomainChangeset, type DeployCallbacks, DeployProps, type DeploymentResource, 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, type PackageDependency, type Percentage, type PostQueueBody, type PostQueueResponse, type PostTypedConsumerBody, type PreviewArgs, type PreviewAssetsOptions, type PreviewBaseConfig, type PreviewBaseConfigPatch, type PreviewCallbacks, type PreviewDeleteArgs, type PreviewDeploymentModule, type PreviewRequestOptions, type PreviewResource, type PreviewResult, type Producer, type ProvisionBindingsResult, type PullRequestMetadata, type PurgeQueueBody, type PurgeQueueResponse, type QueueResponse, type QueueSettings, type RetrieveSourceMapFunction, type RouteObject, type ScriptReference, type Settings, SharedDeployVersionsProps, TriggerDeployment, TriggerProps, type TypedConsumerResponse, type UpdatePreviewRequestParams, type VersionCache, type VersionId, type VersionsUploadCallbacks, 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 Workflow, type WorkflowConflict, type Zone, type ZoneIdCache, addRequiredSecretsInheritBindings, addWorkersSitesBindings, applyServiceAndEnvironmentTags, assemblePreviewScriptSettings, buildAssetManifest, checkRemoteSecretsOverride, checkWorkflowConflicts, collectPackageDependencies, confirmLatestDeploymentOverwrite, createDeployment, createPreview, createPreviewDeployment, createPreviewDeploymentForm, createPreviewParentWorker, createTruncatedAlias, decodeJwtPayload, deletePreview, deletePullConsumer, deleteWorkerConsumer, deploy, deployWfpUserWorker, diagnoseScriptSizeError, diagnoseStartupError, diffJsonObjects, downloadWorkerConfig, drawBox, drawConnectedChildBox, editPreview, ensureQueuesExistByConfig, extractConfigBindings, fetchDeployableVersions, fetchDeploymentVersions, fetchLatestDeployment, fetchLatestDeployments, fetchSecrets, fetchVersion, fetchVersions, fetchWorkerConfig, formatAlignedRows, formatBindings, generatePreviewAlias, getBindingValue, getBranchName, getCommitSha, getConfigPatch, getDeployConfirmFunction, getEdgeKvUploadConcurrency, getHeadCommitMessage, getHeadCommitRef, getMigrationsToUpload, getPreview, getPreviewBaseConfig, getPreviewDeployment, getPreviewOwnedContainerClassNames, getPullRequestMetadata, getQueue, getRemoteConfigDiff, getRepositoryUrl, getSettings, getSize, getSourceMappedStack, getSourceMappedString, getSubdomainValues, getSubdomainValuesAPIMock, getWorkersDevSubdomain, getZoneForRoute, getZoneIdFromHost, handleMissingSecretsError, handleUnsafeCapnp, hasDefinedEnvironments, hashFile, helpIfErrorIsSizeOrScriptStartup, isExportsReconciliationErrorDetails, isJwtExpired, isModifiedDiffValue, isNonDestructive, isWorkerNotFoundError, listConsumers, listQueues, maybeRetrieveFileSourceMap, padToVisibleWidth, parseBulkInputToObject, parseConfigPlacement, patchNonVersionedScriptSettings, patchPreviewBaseConfig, patchPreviewDeployment, postConsumer, preview, previewContainerAppName, previewDelete, printBundleSize, printVersions, provisionBindings, publishCustomDomains, publishRoutes, putConsumer, putConsumerById, renderBindingDependsOnExportError, renderExportsReconciliationError, renderExportsReconciliationSuccess, renderInconsistentExportsAcrossVersionsError, renderRoute, resolveAssetOptions, resolveDoLifecyclePayload, resolveExportsUploadPayload, resolveWorkerName, sanitizeBranchName, shouldUseCIMetadataFallback, stripAnsi, syncAssets, tagsAreEqual, triggersDeploy, updateQueueConsumers, validateEventTriggerTargets, validateFileSecrets, validateNodeCompatMode, validateRoutes, verifyWorkerMatchesCITag, versionsUpload, visibleLength, warnOnErrorUpdatingServiceAndEnvironmentTags, workerNotFoundErrorMessage };
|