@cloudflare/deploy-helpers 0.2.0 → 0.2.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/dist/{chunk-NAAB7FBS.mjs → chunk-N72KNDFF.mjs} +3 -1
- package/dist/{context-CBAALoQ9.d.mts → context-B0DMfM9r.d.mts} +15 -1
- package/dist/context.d.mts +1 -1
- package/dist/context.mjs +1 -1
- package/dist/index.d.mts +13 -6
- package/dist/index.mjs +4928 -1410
- package/dist/metafile-esm.json +1 -1
- package/package.json +7 -7
|
@@ -39,6 +39,7 @@ var fetchPagedListResult;
|
|
|
39
39
|
var fetchKVGetValue;
|
|
40
40
|
var confirm;
|
|
41
41
|
var prompt;
|
|
42
|
+
var select;
|
|
42
43
|
var isNonInteractiveOrCI;
|
|
43
44
|
function initDeployHelpersContext(ctx) {
|
|
44
45
|
logger = ctx.logger;
|
|
@@ -48,8 +49,9 @@ function initDeployHelpersContext(ctx) {
|
|
|
48
49
|
fetchKVGetValue = ctx.fetchKVGetValue;
|
|
49
50
|
confirm = ctx.confirm;
|
|
50
51
|
prompt = ctx.prompt;
|
|
52
|
+
select = ctx.select;
|
|
51
53
|
isNonInteractiveOrCI = ctx.isNonInteractiveOrCI;
|
|
52
54
|
}
|
|
53
55
|
__name(initDeployHelpersContext, "initDeployHelpersContext");
|
|
54
56
|
|
|
55
|
-
export { __commonJS, __name, __require, __toESM, confirm, fetchKVGetValue, fetchListResult, fetchPagedListResult, fetchResult, initDeployHelpersContext, isNonInteractiveOrCI, logger, prompt };
|
|
57
|
+
export { __commonJS, __name, __require, __toESM, confirm, fetchKVGetValue, fetchListResult, fetchPagedListResult, fetchResult, initDeployHelpersContext, isNonInteractiveOrCI, logger, prompt, select };
|
|
@@ -17,6 +17,15 @@ type DeployHelpersContext = {
|
|
|
17
17
|
prompt: (text: string, options?: {
|
|
18
18
|
defaultValue?: string;
|
|
19
19
|
}) => Promise<string>;
|
|
20
|
+
select: <Values extends string>(text: string, options: {
|
|
21
|
+
choices: {
|
|
22
|
+
title: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
value: Values;
|
|
25
|
+
}[];
|
|
26
|
+
defaultOption?: number;
|
|
27
|
+
fallbackOption?: number;
|
|
28
|
+
}) => Promise<Values>;
|
|
20
29
|
isNonInteractiveOrCI: () => boolean;
|
|
21
30
|
};
|
|
22
31
|
/**
|
|
@@ -78,6 +87,10 @@ type SharedDeployVersionsProps = {
|
|
|
78
87
|
sendMetrics: boolean;
|
|
79
88
|
/** Resolved from getFlag("RESOURCES_PROVISION"). Controls whether bindings are auto-provisioned before upload. */
|
|
80
89
|
resourcesProvision: boolean;
|
|
90
|
+
/** Controls whether provisioned resource IDs are written back to the config file. */
|
|
91
|
+
skipProvisioningConfigWriteback: boolean;
|
|
92
|
+
/** temporary hack - cf is not yet a recognised deploy source, so any deploys from cf comes back normalised to 'api'*/
|
|
93
|
+
skipLastDeployedFromApiCheck: boolean;
|
|
81
94
|
};
|
|
82
95
|
type DeployProps = SharedDeployVersionsProps & {
|
|
83
96
|
/** Discriminant for DeployProps vs VersionsUploadProps */
|
|
@@ -149,6 +162,7 @@ declare let fetchPagedListResult: FetchPagedListResultFetcher;
|
|
|
149
162
|
declare let fetchKVGetValue: FetchKVGetValueFetcher;
|
|
150
163
|
declare let confirm: DeployHelpersContext["confirm"];
|
|
151
164
|
declare let prompt: DeployHelpersContext["prompt"];
|
|
165
|
+
declare let select: DeployHelpersContext["select"];
|
|
152
166
|
declare let isNonInteractiveOrCI: () => boolean;
|
|
153
167
|
/**
|
|
154
168
|
* Set the global context for deploy-helpers. Must be called once at
|
|
@@ -156,4 +170,4 @@ declare let isNonInteractiveOrCI: () => boolean;
|
|
|
156
170
|
*/
|
|
157
171
|
declare function initDeployHelpersContext(ctx: DeployHelpersContext): void;
|
|
158
172
|
|
|
159
|
-
export { type DeployProps as D, type SharedDeployVersionsProps as S, type TriggerProps as T, type VersionsUploadProps as V, type WorkerBuildResult as W, type TriggerDeployment as a, type DeployHelpersContext as b, fetchListResult as c, fetchPagedListResult as d, fetchKVGetValue as e, fetchResult as f, confirm as g, isNonInteractiveOrCI as h, initDeployHelpersContext as i, logger as l, prompt as p };
|
|
173
|
+
export { type DeployProps as D, type SharedDeployVersionsProps as S, type TriggerProps as T, type VersionsUploadProps as V, type WorkerBuildResult as W, type TriggerDeployment as a, type DeployHelpersContext as b, fetchListResult as c, fetchPagedListResult as d, fetchKVGetValue as e, fetchResult as f, confirm as g, isNonInteractiveOrCI as h, initDeployHelpersContext as i, logger as l, prompt as p, select as s };
|
package/dist/context.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { g as confirm, e as fetchKVGetValue, c as fetchListResult, d as fetchPagedListResult, f as fetchResult, i as initDeployHelpersContext, h as isNonInteractiveOrCI, l as logger, p as prompt } from './context-
|
|
1
|
+
export { g as confirm, e as fetchKVGetValue, c as fetchListResult, d as fetchPagedListResult, f as fetchResult, i as initDeployHelpersContext, h as isNonInteractiveOrCI, l as logger, p as prompt, s as select } from './context-B0DMfM9r.mjs';
|
|
2
2
|
import '@cloudflare/workers-utils';
|
package/dist/context.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { confirm, fetchKVGetValue, fetchListResult, fetchPagedListResult, fetchResult, initDeployHelpersContext, isNonInteractiveOrCI, logger, prompt } from './chunk-
|
|
1
|
+
export { confirm, fetchKVGetValue, fetchListResult, fetchPagedListResult, fetchResult, initDeployHelpersContext, isNonInteractiveOrCI, logger, prompt, select } from './chunk-N72KNDFF.mjs';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { D as DeployProps, W as WorkerBuildResult, V as VersionsUploadProps, T as TriggerProps, a as TriggerDeployment, S as SharedDeployVersionsProps } from './context-
|
|
2
|
-
export { b as DeployHelpersContext, i as initDeployHelpersContext } from './context-
|
|
1
|
+
import { D as DeployProps, W as WorkerBuildResult, V as VersionsUploadProps, T as TriggerProps, a as TriggerDeployment, S as SharedDeployVersionsProps } from './context-B0DMfM9r.mjs';
|
|
2
|
+
export { b as DeployHelpersContext, i as initDeployHelpersContext } from './context-B0DMfM9r.mjs';
|
|
3
3
|
export { InputWorkerSchema, ModuleType, OutputWorkerSchema, ParsedInputWorkerConfig, ParsedOutputWorkerConfig, convertToWranglerConfig } from '@cloudflare/config';
|
|
4
4
|
import { ContainerNormalizedConfig, ImageURIConfig } from '@cloudflare/containers-shared';
|
|
5
5
|
import * as _cloudflare_workers_utils from '@cloudflare/workers-utils';
|
|
6
|
-
import { Config, ComplianceConfig, LegacyAssetPaths,
|
|
6
|
+
import { Config, ComplianceConfig, LegacyAssetPaths, Route, ZoneIdRoute, ZoneNameRoute, CustomDomainRoute, CfPlacement, Binding, RawConfig, ConfigBindingFieldName, CfCapnp, CfModuleType, CfWorkerInit, CfScriptFormat, CfModule, AssetsOptions, ParseError, WorkerMetadataBinding, CfUserLimits, TailConsumer, StreamingTailConsumer, Observability, StartDevWorkerInput, CfTailConsumer, ContainerApp } from '@cloudflare/workers-utils';
|
|
7
7
|
import { FormData } from 'undici';
|
|
8
8
|
import { Options } from '@cspotcode/source-map-support';
|
|
9
9
|
import Protocol from 'devtools-protocol';
|
|
@@ -21,7 +21,6 @@ type DeployCallbacks = {
|
|
|
21
21
|
} | undefined;
|
|
22
22
|
namespace: string | undefined;
|
|
23
23
|
}>) | undefined;
|
|
24
|
-
provisionBindings: ((bindings: Record<string, Binding>, accountId: string, scriptName: string, autoCreate: boolean, config: Config, requireRemote?: boolean) => Promise<void>) | undefined;
|
|
25
24
|
getNormalizedContainerOptions: ((config: Config, args: {
|
|
26
25
|
containersRollout?: "gradual" | "immediate" | "none";
|
|
27
26
|
dryRun?: boolean;
|
|
@@ -41,7 +40,7 @@ declare function deploy(props: DeployProps, config: Config, buildResult: WorkerB
|
|
|
41
40
|
targets?: string[];
|
|
42
41
|
}>;
|
|
43
42
|
|
|
44
|
-
type VersionsUploadCallbacks = Pick<DeployCallbacks, "
|
|
43
|
+
type VersionsUploadCallbacks = Pick<DeployCallbacks, "analyseBundle">;
|
|
45
44
|
declare function versionsUpload(props: VersionsUploadProps, config: Config, buildResult: WorkerBuildResult, callbacks: VersionsUploadCallbacks): Promise<{
|
|
46
45
|
versionId: string | null;
|
|
47
46
|
workerTag: string | null;
|
|
@@ -739,4 +738,12 @@ declare const hashFile: (filepath: string) => string;
|
|
|
739
738
|
|
|
740
739
|
declare const isJwtExpired: (token: string) => boolean | undefined;
|
|
741
740
|
|
|
742
|
-
|
|
741
|
+
type Settings = {
|
|
742
|
+
bindings: Array<WorkerMetadataBinding>;
|
|
743
|
+
};
|
|
744
|
+
declare function provisionBindings(bindings: StartDevWorkerInput["bindings"], accountId: string, scriptName: string, autoCreate: boolean, config: Config, options: {
|
|
745
|
+
skipConfigWriteback?: boolean;
|
|
746
|
+
}): Promise<void>;
|
|
747
|
+
declare function getSettings(complianceConfig: ComplianceConfig, accountId: string, scriptName: string): Promise<Settings>;
|
|
748
|
+
|
|
749
|
+
export { type ApiDeployment, type ApiVersion, type AssetManifest, type BulkInputNullableResult, type BulkInputResult, type Consumer, type ConsumerSettings, type CustomDomain, type CustomDomainChangeset, type DeployCallbacks, DeployProps, INVALID_INHERIT_BINDING_CODE, type JsonLike, NoInputError, type NonVersionedScriptSettings, type Percentage, type PostQueueBody, type PostQueueResponse, type PostTypedConsumerBody, type Producer, type PurgeQueueBody, type PurgeQueueResponse, type QueueResponse, type QueueSettings, type RetrieveSourceMapFunction, type RouteObject, type ScriptReference, type Settings, SharedDeployVersionsProps, TriggerDeployment, TriggerProps, type TypedConsumerResponse, type VersionCache, type VersionId, type VersionsUploadCallbacks, VersionsUploadProps, WORKER_LEGACY_ENVIRONMENT_NOT_FOUND_ERR_CODE, WORKER_NOT_FOUND_ERR_CODE, WORKFLOW_NOT_FOUND_CODE, WorkerBuildResult, type Workflow, type WorkflowConflict, type Zone, type ZoneIdCache, addRequiredSecretsInheritBindings, addWorkersSitesBindings, applyServiceAndEnvironmentTags, buildAssetManifest, checkRemoteSecretsOverride, checkWorkflowConflicts, confirmLatestDeploymentOverwrite, convertConfigToBindings, createDeployment, createTruncatedAlias, createWorkerUploadForm, deletePullConsumer, deleteWorkerConsumer, deploy, deployWfpUserWorker, diagnoseScriptSizeError, diagnoseStartupError, diffJsonObjects, downloadWorkerConfig, ensureQueuesExistByConfig, extractBindingsOfType, fetchDeployableVersions, fetchDeploymentVersions, fetchLatestDeployment, fetchLatestDeployments, fetchSecrets, fetchVersion, fetchVersions, fetchWorkerConfig, fromMimeType, generatePreviewAlias, getBindings, getBranchName, getConfigPatch, getDeployConfirmFunction, getMigrationsToUpload, getQueue, getRemoteConfigDiff, getSettings, getSourceMappedStack, getSourceMappedString, getSubdomainValues, getSubdomainValuesAPIMock, getWorkersDevSubdomain, getZoneForRoute, getZoneIdFromHost, handleMissingSecretsError, handleUnsafeCapnp, hasDefinedEnvironments, hashFile, helpIfErrorIsSizeOrScriptStartup, isJwtExpired, isModifiedDiffValue, isNonDestructive, isUnsafeBindingType, isWorkerNotFoundError, listConsumers, listQueues, maybeRetrieveFileSourceMap, moduleTypeMimeType, parseBulkInputToObject, parseConfigPlacement, patchNonVersionedScriptSettings, postConsumer, printBindings, printBundleSize, printVersions, provisionBindings, publishCustomDomains, publishRoutes, putConsumer, putConsumerById, renderRoute, resolveAssetOptions, sanitizeBranchName, syncAssets, tagsAreEqual, triggersDeploy, updateQueueConsumers, useServiceEnvironments, validateFileSecrets, validateNodeCompatMode, validateRoutes, verifyWorkerMatchesCITag, versionsUpload, warnOnErrorUpdatingServiceAndEnvironmentTags, warnOrError, workerNotFoundErrorMessage };
|