@cloudflare/deploy-helpers 0.27.2 → 0.29.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 CHANGED
@@ -1,114 +1,120 @@
1
- import { S as SharedDeployVersionsProps, D as DeployProps, C as ContainerlessConfig, W as WorkerBuildResult, V as VersionsUploadProps, T as TriggerProps, a as TriggerDeployment, B as BuiltDurableObjectContainerImage } from './context-BY_xpg-t.mjs';
2
- export { b as ContainerDeployConfig, c as DeployHelpersContext, i as initDeployHelpersContext } from './context-BY_xpg-t.mjs';
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, CfWorkerInit, TailConsumer, StreamingTailConsumer, Observability, ResolvedDurableObjectContainerApp, DurableObjectContainerApp, ExportsReconciliationErrorDetail, ExportsReconciliationResult, StartDevWorkerInput, Json, CacheOptions, PreviewsConfig } from '@cloudflare/workers-utils';
5
- import { FormData } from 'undici';
6
- export { createWorkerUploadForm, fromMimeType, moduleTypeMimeType } from './create-worker-upload-form.mjs';
7
- import { Options } from '@cspotcode/source-map-support';
8
- import Protocol from 'devtools-protocol';
9
- import { NodeJSCompatMode } from '@cloudflare/workers-utils/node-compat';
10
- import { ParsedBuildOutputWorkerConfig, ParsedBuildOutputRootConfig, ParsedBuildOutputContainerConfig } from '@cloudflare/config';
11
- import { ContainerNormalizedConfig } from '@cloudflare/containers-shared';
12
-
1
+ import { createWorkerUploadForm, fromMimeType, moduleTypeMimeType } from "./create-worker-upload-form.mjs";
2
+ import { _ as TriggerProps, d as ContainerDeployConfig, f as ContainerlessConfig, g as TriggerDeployment, h as SharedDeployVersionsProps, m as DeployProps, o as initDeployHelpersContext, p as DeployHelpersContext, u as BuiltDurableObjectContainerImage, v as VersionsUploadProps, y as WorkerBuildResult } from "./context-B9S8CBD7.mjs";
3
+ import { ContainerNormalizedConfig } from "@cloudflare/containers-shared";
4
+ import { AssetsOptions, Binding as Binding$1, CfCapnp, CfModule, CfPlacement, CfScriptFormat, CfUserLimits, CfWorkerInit, ComplianceConfig, ExportsReconciliationErrorDetail, ExportsReconciliationResult, Json, LegacyAssetPaths, ParseError, StartDevWorkerInput, WorkerMetadataBinding } from "@cloudflare/workers-utils";
5
+ import { CacheOptions, Config, CustomDomainRoute, DurableObjectContainerApp, NonDirectoryAssetsDirError, NonExistentAssetsDirError, Observability, PreviewsConfig, RawConfig, ResolvedDurableObjectContainerApp, Route, StreamingTailConsumer, TailConsumer, ZoneIdRoute, ZoneNameRoute, getAssetsOptions as getAssetsOptions$1, validateAssetsOptions } from "@cloudflare/workers-utils/config";
6
+ import { FormData } from "undici";
7
+ import { createFileHasher } from "@cloudflare/workers-utils/asset-hash";
8
+ import { NodeJSCompatMode } from "@cloudflare/workers-utils/node-compat";
9
+ import { ParsedBuildOutputContainerConfig, ParsedBuildOutputRootConfig, ParsedBuildOutputWorkerConfig } from "@cloudflare/config";
10
+ import Protocol$1 from "devtools-protocol";
11
+ //#region src/deploy/helpers/bundle-reporter.d.ts
13
12
  interface BundleSize {
14
- size: number;
15
- gzipSize: number;
13
+ size: number;
14
+ gzipSize: number;
16
15
  }
17
16
  declare function getSize(modules: Pick<CfModule, "content">[]): Promise<BundleSize>;
18
17
  declare function printBundleSize({ size, gzipSize }: BundleSize): void;
19
-
18
+ //#endregion
19
+ //#region src/deploy/helpers/assets.d.ts
20
20
  type AssetManifest = {
21
- [path: string]: {
22
- hash: string;
23
- size: number;
24
- };
21
+ [path: string]: {
22
+ hash: string;
23
+ size: number;
24
+ };
25
25
  };
26
26
  type AssetUploadStats = {
27
- assetUploadDurationMs: number;
28
- assetUploadIsBulk: boolean;
29
- assetUploadFileCount: number;
30
- assetUploadTotalBytes: number;
27
+ assetUploadDurationMs: number;
28
+ assetUploadIsBulk: boolean;
29
+ assetUploadFileCount: number;
30
+ assetUploadTotalBytes: number;
31
31
  };
32
32
  type AssetsUploadResult = {
33
- jwt: string;
34
- assetUploadStats: AssetUploadStats;
33
+ jwt: string;
34
+ assetUploadStats: AssetUploadStats;
35
35
  };
36
36
  declare const syncAssets: (complianceConfig: ComplianceConfig, accountId: string | undefined, assetDirectory: string, scriptName: string, dispatchNamespace?: string) => Promise<AssetsUploadResult>;
37
37
  declare function getEdgeKvUploadConcurrency(jwt: string): number;
38
38
  declare const buildAssetManifest: (dir: string) => Promise<AssetManifest>;
39
- declare function resolveAssetOptions({ assetsDir, main }: Pick<SharedDeployVersionsProps, "assetsDir" | "main">, config: Config): AssetsOptions | undefined;
40
-
39
+ /** Resolve asset options using the deployment caller's logger. */
40
+ declare function resolveAssetOptions(props: Pick<SharedDeployVersionsProps, "assetsDir" | "main">, config: Config): AssetsOptions | undefined;
41
+ /** Validate and resolve asset options using the deployment caller's logger. */
42
+ declare function getAssetsOptions(options: Parameters<typeof getAssetsOptions$1>[0]): AssetsOptions | undefined;
43
+ //#endregion
44
+ //#region src/deploy/deploy.d.ts
41
45
  /**
42
46
  * Consumer-specific values and integrations injected into `deploy()`.
43
47
  */
44
48
  type DeployOptions = {
45
- deployCommand: string;
46
- versionsDeployCommand: string;
47
- d1ListCommand: string;
48
- d1DeleteCommand: string;
49
- queueCreateCommand: (queueName: string) => string;
50
- secretPutCommand: string;
51
- workersDevConfigFieldName: string;
52
- workersDevConfigAssignment: (value: boolean) => string;
53
- previewUrlsConfigFieldName: string;
54
- previewUrlsConfigAssignment: (value: boolean) => string;
55
- configFileName: string;
56
- observabilityTargetPercentageField: string;
57
- observabilityTargetCountField: string;
58
- syncWorkersSite: ((complianceConfig: ComplianceConfig, accountId: string | undefined, scriptName: string, siteAssets: LegacyAssetPaths | undefined, preview: boolean, dryRun: boolean | undefined, oldAssetTTL: number | undefined) => Promise<{
59
- manifest: {
60
- [filePath: string]: string;
61
- } | undefined;
62
- namespace: string | undefined;
63
- }>) | undefined;
64
- /**
65
- * @deprecated Startup profiling is provided by deploy-helpers automatically.
66
- */
67
- analyseBundle?: (workerBundle: string | FormData) => Promise<Record<string, unknown>>;
49
+ deployCommand: string;
50
+ versionsDeployCommand: string;
51
+ d1ListCommand: string;
52
+ d1DeleteCommand: string;
53
+ queueCreateCommand: (queueName: string) => string;
54
+ secretPutCommand: string;
55
+ workersDevConfigFieldName: string;
56
+ workersDevConfigAssignment: (value: boolean) => string;
57
+ previewUrlsConfigFieldName: string;
58
+ previewUrlsConfigAssignment: (value: boolean) => string;
59
+ configFileName: string;
60
+ observabilityTargetPercentageField: string;
61
+ observabilityTargetCountField: string;
62
+ syncWorkersSite: ((complianceConfig: ComplianceConfig, accountId: string | undefined, scriptName: string, siteAssets: LegacyAssetPaths | undefined, preview: boolean, dryRun: boolean | undefined, oldAssetTTL: number | undefined) => Promise<{
63
+ manifest: {
64
+ [filePath: string]: string;
65
+ } | undefined;
66
+ namespace: string | undefined;
67
+ }>) | undefined;
68
+ /**
69
+ * @deprecated Startup profiling is provided by deploy-helpers automatically.
70
+ */
71
+ analyseBundle?: (workerBundle: string | FormData) => Promise<Record<string, unknown>>;
68
72
  };
69
73
  type DeployResult = {
70
- sourceMapSize?: number;
71
- versionId: string | null;
72
- workerTag: string | null;
73
- assetUploadStats?: AssetUploadStats;
74
- targets?: string[];
75
- bundleSize?: BundleSize;
74
+ sourceMapSize?: number;
75
+ versionId: string | null;
76
+ workerTag: string | null;
77
+ assetUploadStats?: AssetUploadStats;
78
+ targets?: string[];
79
+ bundleSize?: BundleSize;
76
80
  };
77
81
  declare function deploy(props: DeployProps, config: ContainerlessConfig, buildResult: WorkerBuildResult, options: DeployOptions): Promise<DeployResult>;
78
-
82
+ //#endregion
83
+ //#region src/deploy/versions-upload.d.ts
79
84
  type VersionsUploadOptions = {
80
- deployCommand: string;
81
- versionsUploadCommand: string;
82
- versionsDeployCommand: string;
83
- triggersDeployCommand: string;
84
- d1ListCommand: string;
85
- d1DeleteCommand: string;
86
- queueCreateCommand: (queueName: string) => string;
87
- versionsSecretPutCommand: string;
88
- /**
89
- * @deprecated Startup profiling is provided by deploy-helpers automatically.
90
- */
91
- analyseBundle?: (workerBundle: string | FormData) => Promise<Record<string, unknown>>;
85
+ deployCommand: string;
86
+ versionsUploadCommand: string;
87
+ versionsDeployCommand: string;
88
+ triggersDeployCommand: string;
89
+ d1ListCommand: string;
90
+ d1DeleteCommand: string;
91
+ queueCreateCommand: (queueName: string) => string;
92
+ versionsSecretPutCommand: string;
93
+ /**
94
+ * @deprecated Startup profiling is provided by deploy-helpers automatically.
95
+ */
96
+ analyseBundle?: (workerBundle: string | FormData) => Promise<Record<string, unknown>>;
92
97
  };
93
98
  type VersionsUploadResult = {
94
- versionId: string | null;
95
- workerTag: string | null;
96
- assetUploadStats?: AssetUploadStats;
97
- versionPreviewUrl?: string | undefined;
98
- versionPreviewAliasUrl?: string | undefined;
99
- bundleSize?: BundleSize;
99
+ versionId: string | null;
100
+ workerTag: string | null;
101
+ assetUploadStats?: AssetUploadStats;
102
+ versionPreviewUrl?: string | undefined;
103
+ versionPreviewAliasUrl?: string | undefined;
104
+ bundleSize?: BundleSize;
100
105
  };
101
106
  declare function versionsUpload(props: VersionsUploadProps, config: ContainerlessConfig, buildResult: WorkerBuildResult, options: VersionsUploadOptions): Promise<VersionsUploadResult>;
102
-
107
+ //#endregion
108
+ //#region src/triggers/deploy.d.ts
103
109
  declare const PREVIEW_DOMAIN_PROVISIONING_NOTE = "Note: DNS and TLS certificate provisioning for Preview domains may continue after this deploy. If a new Preview URL does not work immediately, wait a few minutes and retry.";
104
110
  declare function triggersDeploy(props: TriggerProps): Promise<string[] | void>;
105
111
  declare function getSubdomainValues(config_workers_dev: boolean | undefined, config_preview_urls: boolean | undefined, routes: Route[]): {
106
- workers_dev: boolean;
107
- preview_urls?: boolean;
112
+ workers_dev: boolean;
113
+ preview_urls?: boolean;
108
114
  };
109
115
  declare function getSubdomainValuesAPIMock(config_workers_dev: boolean | undefined, config_preview_urls: boolean | undefined, routes: Route[]): {
110
- workers_dev: boolean;
111
- preview_urls: boolean;
116
+ workers_dev: boolean;
117
+ preview_urls: boolean;
112
118
  };
113
119
  /**
114
120
  * Renders the warning shown when the configured workers.dev state differs from
@@ -120,20 +126,21 @@ declare function getSubdomainValuesAPIMock(config_workers_dev: boolean | undefin
120
126
  */
121
127
  declare function renderWorkersDevDefaultWarning(beforeEnabled: boolean, afterEnabled: boolean, configFile: string, workersDevConfigFieldName: string, workersDevConfigAssignment: (value: boolean) => string): string;
122
128
  declare function validateEventTriggerTargets(config: Config, scriptName: string): void;
123
-
129
+ //#endregion
130
+ //#region src/triggers/subdomain.d.ts
124
131
  type WorkersDevSubdomainRegistrationContext = "workers_dev" | "workflows";
125
132
  type GetWorkersDevSubdomainOptions = {
126
- abortSignal?: AbortSignal | undefined;
127
- autoRegisterSubdomain?: string | undefined;
128
- configPath?: string | undefined;
129
- registrationContext?: WorkersDevSubdomainRegistrationContext | undefined;
133
+ abortSignal?: AbortSignal | undefined;
134
+ autoRegisterSubdomain?: string | undefined;
135
+ configPath?: string | undefined;
136
+ registrationContext?: WorkersDevSubdomainRegistrationContext | undefined;
130
137
  };
131
138
  type WorkerSubdomain = {
132
- enabled: boolean;
133
- previews_enabled: boolean;
134
- url?: string;
135
- /** Includes the leading "-" separator. */
136
- preview_url_suffix?: string;
139
+ enabled: boolean;
140
+ previews_enabled: boolean;
141
+ url?: string;
142
+ /** Includes the leading "-" separator. */
143
+ preview_url_suffix?: string;
137
144
  };
138
145
  /**
139
146
  * Gets the <user-subdomain>.(fed.)workers.dev URL for the given account.
@@ -149,15 +156,16 @@ declare function getWorkersDevSubdomain(complianceConfig: ComplianceConfig, acco
149
156
  declare function getWorkersDevSubdomainIfAccessible(complianceConfig: ComplianceConfig, accountId: string, options?: GetWorkersDevSubdomainOptions): Promise<string | undefined>;
150
157
  /** Gets the Worker-scoped subdomain configuration and routable URLs. */
151
158
  declare function getWorkerSubdomain(complianceConfig: ComplianceConfig, accountId: string, workerName: string): Promise<WorkerSubdomain>;
152
-
159
+ //#endregion
160
+ //#region src/triggers/zones.d.ts
153
161
  interface Zone {
154
- id: string;
155
- host: string;
162
+ id: string;
163
+ host: string;
156
164
  }
157
165
  type ZoneIdCache = Map<string, Promise<string | null>>;
158
166
  declare function getZoneForRoute(complianceConfig: ComplianceConfig, from: {
159
- route: Route;
160
- accountId: string;
167
+ route: Route;
168
+ accountId: string;
161
169
  }, zoneIdCache?: ZoneIdCache): Promise<Zone | undefined>;
162
170
  /**
163
171
  * Given something that resembles a host, try to infer a zone id from it.
@@ -167,117 +175,119 @@ declare function getZoneForRoute(complianceConfig: ComplianceConfig, from: {
167
175
  * lopping off subdomains until we get a hit from the API.
168
176
  */
169
177
  declare function getZoneIdFromHost(complianceConfig: ComplianceConfig, from: {
170
- host: string;
171
- accountId: string;
178
+ host: string;
179
+ accountId: string;
172
180
  }, zoneIdCache?: ZoneIdCache): Promise<string>;
173
-
181
+ //#endregion
182
+ //#region src/triggers/publish-routes.d.ts
174
183
  type RouteObject = ZoneIdRoute | ZoneNameRoute | CustomDomainRoute;
175
184
  type CustomDomain = {
176
- id: string;
177
- zone_id: string;
178
- zone_name: string;
179
- hostname: string;
180
- service: string;
181
- environment: string;
182
- enabled: boolean;
183
- previews_enabled: boolean;
185
+ id: string;
186
+ zone_id: string;
187
+ zone_name: string;
188
+ hostname: string;
189
+ service: string;
190
+ environment: string;
191
+ enabled: boolean;
192
+ previews_enabled: boolean;
184
193
  };
185
194
  type UpdatedCustomDomain = CustomDomain & {
186
- modified: boolean;
195
+ modified: boolean;
187
196
  };
188
197
  type ConflictingCustomDomain = CustomDomain & {
189
- external_dns_record_id?: string | null;
190
- external_cert_id?: string;
198
+ external_dns_record_id?: string | null;
199
+ external_cert_id?: string;
191
200
  };
192
201
  type CustomDomainChangeset = {
193
- added: CustomDomain[];
194
- removed: CustomDomain[];
195
- updated: UpdatedCustomDomain[];
196
- conflicting: ConflictingCustomDomain[];
202
+ added: CustomDomain[];
203
+ removed: CustomDomain[];
204
+ updated: UpdatedCustomDomain[];
205
+ conflicting: ConflictingCustomDomain[];
197
206
  };
198
207
  declare function renderRoute(route: Route): string;
199
208
  /**
200
209
  * Associate the newly deployed Worker with the given routes.
201
210
  */
202
- declare function publishRoutes(complianceConfig: ComplianceConfig, routes: Route[], { workerUrl, scriptName, accountId, }: {
203
- workerUrl: string;
204
- scriptName: string;
205
- accountId: string;
211
+ declare function publishRoutes(complianceConfig: ComplianceConfig, routes: Route[], { workerUrl, scriptName, accountId }: {
212
+ workerUrl: string;
213
+ scriptName: string;
214
+ accountId: string;
206
215
  }): Promise<string[]>;
207
216
  declare function publishCustomDomains(complianceConfig: ComplianceConfig, workerUrl: string, accountId: string, scriptName: string, domains: Array<RouteObject>): Promise<TriggerDeployment>;
208
-
217
+ //#endregion
218
+ //#region src/triggers/queue-consumers.d.ts
209
219
  type QueueJurisdiction = "eu" | "us" | "fedramp";
210
220
  interface PostQueueBody {
211
- queue_name: string;
212
- jurisdiction?: QueueJurisdiction;
213
- settings?: QueueSettings;
221
+ queue_name: string;
222
+ jurisdiction?: QueueJurisdiction;
223
+ settings?: QueueSettings;
214
224
  }
215
225
  interface QueueSettings {
216
- delivery_delay?: number;
217
- delivery_paused?: boolean;
218
- message_retention_period?: number;
226
+ delivery_delay?: number;
227
+ delivery_paused?: boolean;
228
+ message_retention_period?: number;
219
229
  }
220
230
  interface PostQueueResponse {
221
- queue_id: string;
222
- queue_name: string;
223
- settings?: QueueSettings;
224
- created_on: string;
225
- modified_on: string;
231
+ queue_id: string;
232
+ queue_name: string;
233
+ settings?: QueueSettings;
234
+ created_on: string;
235
+ modified_on: string;
226
236
  }
227
237
  interface QueueResponse {
228
- queue_id: string;
229
- queue_name: string;
230
- jurisdiction?: QueueJurisdiction;
231
- created_on: string;
232
- modified_on: string;
233
- producers: Producer[];
234
- producers_total_count: number;
235
- consumers: Consumer[];
236
- consumers_total_count: number;
237
- settings?: QueueSettings;
238
+ queue_id: string;
239
+ queue_name: string;
240
+ jurisdiction?: QueueJurisdiction;
241
+ created_on: string;
242
+ modified_on: string;
243
+ producers: Producer[];
244
+ producers_total_count: number;
245
+ consumers: Consumer[];
246
+ consumers_total_count: number;
247
+ settings?: QueueSettings;
238
248
  }
239
249
  interface ScriptReference {
240
- namespace?: string;
241
- script?: string;
242
- service?: string;
243
- environment?: string;
250
+ namespace?: string;
251
+ script?: string;
252
+ service?: string;
253
+ environment?: string;
244
254
  }
245
255
  type Producer = ScriptReference & {
246
- type: string;
247
- bucket_name?: string;
256
+ type: string;
257
+ bucket_name?: string;
248
258
  };
249
259
  type Consumer = ScriptReference & {
250
- dead_letter_queue?: string;
251
- settings: ConsumerSettings;
252
- consumer_id: string;
253
- bucket_name?: string;
254
- type: string;
260
+ dead_letter_queue?: string;
261
+ settings: ConsumerSettings;
262
+ consumer_id: string;
263
+ bucket_name?: string;
264
+ type: string;
255
265
  };
256
266
  interface TypedConsumerResponse extends Consumer {
257
- queue_name: string;
258
- created_on: string;
267
+ queue_name: string;
268
+ created_on: string;
259
269
  }
260
270
  interface PostTypedConsumerBody {
261
- type: string;
262
- script_name?: string;
263
- environment_name?: string;
264
- settings: ConsumerSettings;
265
- dead_letter_queue?: string;
271
+ type: string;
272
+ script_name?: string;
273
+ environment_name?: string;
274
+ settings: ConsumerSettings;
275
+ dead_letter_queue?: string;
266
276
  }
267
277
  interface ConsumerSettings {
268
- batch_size?: number;
269
- max_retries?: number;
270
- max_wait_time_ms?: number;
271
- max_concurrency?: number | null;
272
- visibility_timeout_ms?: number;
273
- retry_delay?: number;
278
+ batch_size?: number;
279
+ max_retries?: number;
280
+ max_wait_time_ms?: number;
281
+ max_concurrency?: number | null;
282
+ visibility_timeout_ms?: number;
283
+ retry_delay?: number;
274
284
  }
275
285
  interface PurgeQueueBody {
276
- delete_messages_permanently: boolean;
286
+ delete_messages_permanently: boolean;
277
287
  }
278
288
  interface PurgeQueueResponse {
279
- started_at: string;
280
- complete: boolean;
289
+ started_at: string;
290
+ complete: boolean;
281
291
  }
282
292
  declare function listQueues(complianceConfig: ComplianceConfig, accountId: string, page?: number, name?: string): Promise<QueueResponse[]>;
283
293
  declare function getQueue(complianceConfig: ComplianceConfig, accountId: string, queueName: string, queueCreateCommand?: (queueName: string) => string): Promise<QueueResponse>;
@@ -289,12 +299,14 @@ declare function listConsumers(complianceConfig: ComplianceConfig, accountId: st
289
299
  declare function deleteWorkerConsumer(complianceConfig: ComplianceConfig, accountId: string, queueName: string, scriptName: string, envName: string | undefined, queueCreateCommand?: (queueName: string) => string): Promise<void>;
290
300
  declare function updateQueueConsumers(complianceConfig: ComplianceConfig, accountId: string, scriptName: string, config: Config, queueCreateCommand: (queueName: string) => string): Promise<Promise<TriggerDeployment>[]>;
291
301
  declare function ensureQueuesExistByConfig(config: Config, accountId: string, includeProducers?: boolean, scriptName?: string, queueCreateCommand?: (queueName: string) => string): Promise<void>;
292
-
302
+ //#endregion
303
+ //#region src/deploy/helpers/placement.d.ts
293
304
  /**
294
305
  * Parse placement out of a Config
295
306
  */
296
307
  declare function parseConfigPlacement(placement: Config["placement"]): CfPlacement | undefined;
297
-
308
+ //#endregion
309
+ //#region src/deploy/helpers/worker-not-found-error.d.ts
298
310
  /**
299
311
  This is the error code from the Cloudflare API signaling that a worker could not be found on the target account
300
312
  */
@@ -314,7 +326,8 @@ declare const workerNotFoundErrorMessage = "This Worker does not exist on your a
314
326
  * @returns true if the object represents an error from the Cloudflare API caused by a not found worker, false otherwise
315
327
  */
316
328
  declare function isWorkerNotFoundError(error: unknown): boolean;
317
-
329
+ //#endregion
330
+ //#region src/deploy/helpers/error-codes.d.ts
318
331
  /**
319
332
  * Cloudflare API error codes used by deploy-helpers.
320
333
  */
@@ -353,21 +366,22 @@ declare const ACTOR_BINDING_DEPENDS_ON_EXPORT_CODE = 100406;
353
366
  declare const WORKFLOW_CRON_REQUIRES_PAID_PLAN_CODE = 10208;
354
367
  /** Workflows API code for `workflow.jurisdiction_immutable`. */
355
368
  declare const WORKFLOW_JURISDICTION_IMMUTABLE_CODE = 10209;
356
-
369
+ //#endregion
370
+ //#region src/deploy/helpers/secrets-validation.d.ts
357
371
  type SecretsValidationOptions = {
358
- type: "deploy";
359
- workerExists: boolean;
360
- secretPutCommand: string;
361
- uploadCommand: string;
372
+ type: "deploy";
373
+ workerExists: boolean;
374
+ secretPutCommand: string;
375
+ uploadCommand: string;
362
376
  } | {
363
- type: "upload";
377
+ type: "upload";
364
378
  };
365
379
  type MissingSecretsOptions = Exclude<SecretsValidationOptions, {
366
- type: "upload";
380
+ type: "upload";
367
381
  }> | {
368
- type: "upload";
369
- secretPutCommand: string;
370
- uploadCommand: string;
382
+ type: "upload";
383
+ secretPutCommand: string;
384
+ uploadCommand: string;
371
385
  };
372
386
  /**
373
387
  * When `secrets.required` is defined in config, validate the secrets exist on the Worker.
@@ -385,9 +399,10 @@ declare function addRequiredSecretsInheritBindings(config: Config, bindings: Rec
385
399
  * error in response.errors, which maps to individual err.notes entries.
386
400
  */
387
401
  declare function handleMissingSecretsError(err: unknown, config: Config, options: MissingSecretsOptions): void;
388
-
402
+ //#endregion
403
+ //#region src/deploy/helpers/diff-json.d.ts
389
404
  type JsonLike = string | number | boolean | null | JsonLike[] | undefined | {
390
- [id: string]: JsonLike;
405
+ [id: string]: JsonLike;
391
406
  };
392
407
  /**
393
408
  * Given two objects A and B that are Json serializable this function computes the difference between them
@@ -425,22 +440,23 @@ declare function isNonDestructive(diff: JsonLike): boolean;
425
440
  * @returns True if the value represents a value modified, false otherwise
426
441
  */
427
442
  declare function isModifiedDiffValue<T extends JsonLike>(value: unknown): value is {
428
- __old: T;
429
- __new: T;
443
+ __old: T;
444
+ __new: T;
430
445
  };
431
-
446
+ //#endregion
447
+ //#region src/deploy/helpers/config-diffs.d.ts
432
448
  /**
433
449
  * Object representing the difference of two configuration objects.
434
450
  */
435
451
  type ConfigDiff = {
436
- /** The actual (raw) computed diff of the two objects */
437
- diff: Record<string, JsonLike> | null;
438
- /**
439
- * Flag indicating whether the difference includes some destructive changes.
440
- *
441
- * In other words, if the second config is not applying any change or only adding options, such diff is considered non destructive, on the other hand if the config is removing or modifying values it is considered destructive instead.
442
- */
443
- nonDestructive: boolean;
452
+ /** The actual (raw) computed diff of the two objects */
453
+ diff: Record<string, JsonLike> | null;
454
+ /**
455
+ * Flag indicating whether the difference includes some destructive changes.
456
+ *
457
+ * In other words, if the second config is not applying any change or only adding options, such diff is considered non destructive, on the other hand if the config is removing or modifying values it is considered destructive instead.
458
+ */
459
+ nonDestructive: boolean;
444
460
  };
445
461
  /**
446
462
  * Computes the difference between a remote representation of a Worker's config and a local configuration.
@@ -461,27 +477,28 @@ declare function getRemoteConfigDiff(remoteConfig: RawConfig, localResolvedConfi
461
477
  * @returns The patch object to pass to `experimental_patchConfig` to revert the changes
462
478
  */
463
479
  declare function getConfigPatch(configDiff: {
464
- diff: Record<string, JsonLike> | null;
465
- nonDestructive: boolean;
480
+ diff: Record<string, JsonLike> | null;
481
+ nonDestructive: boolean;
466
482
  }["diff"], targetEnvironment?: string | undefined): RawConfig;
467
-
483
+ //#endregion
484
+ //#region src/deploy/helpers/parse-bulk-input.d.ts
468
485
  type DotEnvParser = (contents: string) => Record<string, string>;
469
486
  declare function validateFileSecrets(content: unknown, jsonFilePath: string): content is Record<string, string | null>;
470
487
  /** Error thrown when no input is provided to parseBulkInputToObject */
471
488
  declare class NoInputError extends Error {
472
- constructor();
489
+ constructor();
473
490
  }
474
491
  /** Result from parsing bulk secret input without nullable values, including metadata for analytics */
475
492
  type BulkInputResult = {
476
- content: Record<string, string>;
477
- secretSource: "file" | "stdin";
478
- secretFormat: "json" | "dotenv";
493
+ content: Record<string, string>;
494
+ secretSource: "file" | "stdin";
495
+ secretFormat: "json" | "dotenv";
479
496
  };
480
497
  /** Result from parsing bulk secret input with nullable values, including metadata for analytics */
481
498
  type BulkInputNullableResult = {
482
- content: Record<string, string | null>;
483
- secretSource: "file" | "stdin";
484
- secretFormat: "json" | "dotenv";
499
+ content: Record<string, string | null>;
500
+ secretSource: "file" | "stdin";
501
+ secretFormat: "json" | "dotenv";
485
502
  };
486
503
  /**
487
504
  * Parses JSON or dotenv secrets from a file or stdin, excluding null values.
@@ -495,26 +512,31 @@ type BulkInputNullableResult = {
495
512
  declare function parseBulkInputToObject(input?: string, includeNull?: false, parseDotEnv?: DotEnvParser): Promise<BulkInputResult | undefined>;
496
513
  /** Override for callers that need nullable */
497
514
  declare function parseBulkInputToObject(input?: string, includeNull?: true, parseDotEnv?: DotEnvParser): Promise<BulkInputNullableResult | undefined>;
498
-
515
+ //#endregion
516
+ //#region src/deploy/helpers/capnp.d.ts
499
517
  declare function handleUnsafeCapnp(capnp: CfCapnp): Buffer;
500
-
518
+ //#endregion
519
+ //#region src/deploy/helpers/workers-sites-bindings.d.ts
501
520
  /**
502
521
  * Inject bindings into the Worker to support Workers Sites. These are injected at the last minute so that
503
522
  * they don't display in the output of `printBindings()`
504
523
  */
505
524
  declare function addWorkersSitesBindings(bindings: Record<string, Binding$1>, namespace: string | undefined, manifest: {
506
- [filePath: string]: string;
525
+ [filePath: string]: string;
507
526
  } | undefined, format: CfScriptFormat): {
508
- [x: string]: Binding$1;
527
+ [x: string]: Binding$1;
509
528
  };
510
-
529
+ //#endregion
530
+ //#region src/deploy/helpers/deploy-wfp.d.ts
511
531
  declare function deployWfpUserWorker(dispatchNamespace: string, versionId: string | null): void;
512
-
532
+ //#endregion
533
+ //#region src/deploy/helpers/deploy-confirm.d.ts
513
534
  declare function getDeployConfirmFunction(options: {
514
- strictMode?: boolean;
515
- strictModeAbortMessage?: string;
535
+ strictMode?: boolean;
536
+ strictModeAbortMessage?: string;
516
537
  }): (text: string) => Promise<boolean>;
517
-
538
+ //#endregion
539
+ //#region src/deploy/helpers/preview-alias.d.ts
518
540
  /**
519
541
  * Sanitizes a branch name to create a valid DNS label alias.
520
542
  * Converts to lowercase, replaces invalid chars with dashes, removes consecutive dashes.
@@ -531,12 +553,66 @@ declare function createTruncatedAlias(branchName: string, sanitizedAlias: string
531
553
  * Returns undefined if not in a git directory or requirements cannot be met.
532
554
  */
533
555
  declare function generatePreviewAlias(scriptName: string): string | undefined;
534
-
556
+ //#endregion
557
+ //#region ../../node_modules/.pnpm/@cspotcode+source-map-support@0.8.1/node_modules/@cspotcode/source-map-support/source-map-support.d.ts
558
+ // Type definitions for source-map-support 0.5
559
+ // Project: https://github.com/evanw/node-source-map-support
560
+ // Definitions by: Bart van der Schoor <https://github.com/Bartvds>
561
+ // Jason Cheatham <https://github.com/jason0x43>
562
+ // Alcedo Nathaniel De Guzman Jr <https://github.com/natealcedo>
563
+ // Griffin Yourick <https://github.com/tough-griff>
564
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
565
+ interface RawSourceMap {
566
+ version: 3;
567
+ sources: string[];
568
+ names: string[];
569
+ sourceRoot?: string;
570
+ sourcesContent?: string[];
571
+ mappings: string;
572
+ file: string;
573
+ }
574
+ /**
575
+ * Output of retrieveSourceMap().
576
+ * From source-map-support:
577
+ * The map field may be either a string or the parsed JSON object (i.e.,
578
+ * it must be a valid argument to the SourceMapConsumer constructor).
579
+ */
580
+ interface UrlAndMap {
581
+ url: string;
582
+ map: string | RawSourceMap;
583
+ }
584
+ /**
585
+ * Options to install().
586
+ */
587
+ interface Options {
588
+ handleUncaughtExceptions?: boolean | undefined;
589
+ hookRequire?: boolean | undefined;
590
+ emptyCacheBetweenOperations?: boolean | undefined;
591
+ environment?: 'auto' | 'browser' | 'node' | undefined;
592
+ overrideRetrieveFile?: boolean | undefined;
593
+ overrideRetrieveSourceMap?: boolean | undefined;
594
+ retrieveFile?(path: string): string;
595
+ retrieveSourceMap?(source: string): UrlAndMap | null;
596
+ /**
597
+ * Set false to disable redirection of require / import `source-map-support` to `@cspotcode/source-map-support`
598
+ */
599
+ redirectConflictingLibrary?: boolean;
600
+ /**
601
+ * Callback will be called every time we redirect due to `redirectConflictingLibrary`
602
+ * This allows consumers to log helpful warnings if they choose.
603
+ * @param parent NodeJS.Module which made the require() or require.resolve() call
604
+ * @param options options object internally passed to node's `_resolveFilename` hook
605
+ */
606
+ onConflictingLibraryRedirect?: (request: string, parent: any, isMain: boolean, options: any, redirectedRequest: string) => void;
607
+ }
608
+ //#endregion
609
+ //#region src/deploy/helpers/sourcemap.d.ts
535
610
  type RetrieveSourceMapFunction = NonNullable<Options["retrieveSourceMap"]>;
536
611
  declare function maybeRetrieveFileSourceMap(filePath?: string): ReturnType<RetrieveSourceMapFunction>;
537
- declare function getSourceMappedStack(details: Protocol.Runtime.ExceptionDetails): string;
612
+ declare function getSourceMappedStack(details: Protocol$1.Runtime.ExceptionDetails): string;
538
613
  declare function getSourceMappedString(value: string, retrieveSourceMap?: RetrieveSourceMapFunction): string;
539
-
614
+ //#endregion
615
+ //#region src/deploy/helpers/node-compat.d.ts
540
616
  /**
541
617
  * Computes and validates the Node.js compatibility mode we are running.
542
618
  *
@@ -548,89 +624,94 @@ declare function getSourceMappedString(value: string, retrieveSourceMap?: Retrie
548
624
  * @param compatibilityFlags The compatibility flags
549
625
  * @param noBundle Whether to skip internal build steps and directly deploy script
550
626
  *
551
- */ declare function validateNodeCompatMode(compatibilityDateStr: string | undefined, // Default to some arbitrary old date
552
- compatibilityFlags: string[], { noBundle, }: {
553
- noBundle?: boolean;
627
+ */ declare function validateNodeCompatMode(compatibilityDateStr: string | undefined // Default to some arbitrary old date
628
+ , compatibilityFlags: string[], { noBundle }: {
629
+ noBundle?: boolean;
554
630
  }): NodeJSCompatMode;
555
-
631
+ //#endregion
632
+ //#region src/deploy/helpers/validate-routes.d.ts
556
633
  declare const validateRoutes: (routes: Route[], assets: AssetsOptions | undefined, workersDevEnabled?: boolean) => void;
557
-
634
+ //#endregion
635
+ //#region src/deploy/helpers/environments.d.ts
558
636
  declare function hasDefinedEnvironments(config: Config): boolean;
559
637
  declare function applyServiceAndEnvironmentTags(config: Config, tags: string[]): string[];
560
638
  declare function warnOnErrorUpdatingServiceAndEnvironmentTags(): void;
561
639
  declare function tagsAreEqual(a: string[], b: string[]): boolean;
562
-
640
+ //#endregion
641
+ //#region src/deploy/helpers/friendly-validator-errors.d.ts
563
642
  type AnalyseBundle = (bundle: FormData | string) => Promise<unknown>;
564
643
  declare function helpIfErrorIsSizeOrScriptStartup(err: unknown, dependencies: {
565
- [path: string]: {
566
- bytesInOutput: number;
567
- };
644
+ [path: string]: {
645
+ bytesInOutput: number;
646
+ };
568
647
  }, workerBundle: FormData | string, projectRoot: string | undefined, analyseBundle?: AnalyseBundle): Promise<string | null>;
569
648
  /**
570
649
  * Returns a formatted error message that describes the script size error.
571
650
  * It includes the largest dependencies if available.
572
651
  */
573
652
  declare function diagnoseScriptSizeError(err: ParseError, dependencies: {
574
- [path: string]: {
575
- bytesInOutput: number;
576
- };
653
+ [path: string]: {
654
+ bytesInOutput: number;
655
+ };
577
656
  }): string;
578
657
  /**
579
658
  * Returns a formatted error message that describes the startup error.
580
659
  * If profiling is successful, it will include a link to the generated CPU profile.
581
660
  */
582
661
  declare function diagnoseStartupError(err: ParseError, workerBundle: FormData | string, projectRoot: string | undefined, analyseBundle?: AnalyseBundle): Promise<string>;
583
-
662
+ //#endregion
663
+ //#region src/deploy/helpers/versions-types.d.ts
584
664
  type Percentage = number;
585
665
  type UUID = string;
586
666
  type VersionId = UUID;
587
667
  type ApiDeployment = {
588
- id: string;
589
- source: "api" | string;
590
- strategy: "percentage" | string;
591
- author_email: string;
592
- annotations?: Record<string, string>;
593
- created_on: string;
594
- versions: Array<{
595
- version_id: VersionId;
596
- percentage: Percentage;
597
- }>;
668
+ id: string;
669
+ source: "api" | string;
670
+ strategy: "percentage" | string;
671
+ author_email: string;
672
+ annotations?: Record<string, string>;
673
+ created_on: string;
674
+ versions: Array<{
675
+ version_id: VersionId;
676
+ percentage: Percentage;
677
+ }>;
598
678
  };
599
679
  type ApiVersion = {
600
- id: VersionId;
601
- number: number;
602
- metadata: {
603
- created_on: string;
604
- modified_on: string;
605
- source: "api" | string;
606
- author_id: string;
607
- author_email: string;
608
- };
609
- annotations?: {
610
- "workers/triggered_by"?: "upload" | string;
611
- "workers/message"?: string;
612
- "workers/tag"?: string;
680
+ id: VersionId;
681
+ number: number;
682
+ metadata: {
683
+ created_on: string;
684
+ modified_on: string;
685
+ source: "api" | string;
686
+ author_id: string;
687
+ author_email: string;
688
+ };
689
+ annotations?: {
690
+ "workers/triggered_by"?: "upload" | string;
691
+ "workers/message"?: string;
692
+ "workers/tag"?: string;
693
+ };
694
+ resources: {
695
+ bindings: WorkerMetadataBinding[];
696
+ script: {
697
+ etag: string;
698
+ handlers: string[] | null;
699
+ placement_mode?: "smart";
700
+ last_deployed_from: string;
613
701
  };
614
- resources: {
615
- bindings: WorkerMetadataBinding[];
616
- script: {
617
- etag: string;
618
- handlers: string[] | null;
619
- placement_mode?: "smart";
620
- last_deployed_from: string;
621
- };
622
- script_runtime: {
623
- compatibility_date?: string;
624
- compatibility_flags?: string[];
625
- usage_model: "bundled" | "unbound" | "standard";
626
- limits: CfUserLimits;
627
- containers?: CfWorkerInit["containers"];
628
- };
702
+ script_runtime: {
703
+ compatibility_date?: string;
704
+ compatibility_flags?: string[];
705
+ usage_model: "bundled" | "unbound" | "standard";
706
+ limits: CfUserLimits;
707
+ containers?: CfWorkerInit["containers"];
629
708
  };
630
- startup_time_ms?: number;
709
+ };
710
+ startup_time_ms?: number;
631
711
  };
632
712
  type VersionCache = Map<VersionId, ApiVersion>;
633
-
713
+ //#endregion
714
+ //#region src/deploy/helpers/versions-api.d.ts
634
715
  declare function fetchVersion(complianceConfig: ComplianceConfig, accountId: string, workerName: string, versionId: VersionId, versionCache: VersionCache | undefined): Promise<ApiVersion>;
635
716
  declare function fetchVersions(complianceConfig: ComplianceConfig, accountId: string, workerName: string, versionCache: VersionCache | undefined, versionIds: VersionId[]): Promise<ApiVersion[]>;
636
717
  declare function fetchLatestDeployments(complianceConfig: ComplianceConfig, accountId: string, workerName: string): Promise<ApiDeployment[]>;
@@ -638,153 +719,157 @@ declare function fetchLatestDeployment(complianceConfig: ComplianceConfig, accou
638
719
  declare function fetchDeploymentVersions(complianceConfig: ComplianceConfig, accountId: string, workerName: string, deployment: ApiDeployment | undefined, versionCache: VersionCache): Promise<[ApiVersion[], Map<VersionId, Percentage>]>;
639
720
  declare function fetchDeployableVersions(complianceConfig: ComplianceConfig, accountId: string, workerName: string, versionCache: VersionCache): Promise<ApiVersion[]>;
640
721
  declare function createDeployment(complianceConfig: ComplianceConfig, accountId: string, workerName: string, versionTraffic: Map<VersionId, Percentage>, message: string | undefined, force: boolean | undefined, codeUpdateStrategy?: unknown): Promise<{
641
- id: string;
722
+ id: string;
642
723
  }>;
643
724
  type NonVersionedScriptSettings = {
644
- logpush: boolean;
645
- tags: string[] | null;
646
- tail_consumers: TailConsumer[];
647
- streaming_tail_consumers: StreamingTailConsumer[];
648
- observability: Observability;
725
+ logpush: boolean;
726
+ tags: string[] | null;
727
+ tail_consumers: TailConsumer[];
728
+ streaming_tail_consumers: StreamingTailConsumer[];
729
+ observability: Observability;
649
730
  };
650
731
  declare function patchNonVersionedScriptSettings(complianceConfig: ComplianceConfig, accountId: string, workerName: string, settings: Partial<NonVersionedScriptSettings>): Promise<Partial<NonVersionedScriptSettings>>;
651
-
732
+ //#endregion
733
+ //#region src/deploy/helpers/check-workflow-conflicts.d.ts
652
734
  type Workflow = {
653
- name: string;
654
- id: string;
655
- created_on: string;
656
- modified_on: string;
657
- script_name: string;
658
- class_name: string;
659
- jurisdiction?: string;
735
+ name: string;
736
+ id: string;
737
+ created_on: string;
738
+ modified_on: string;
739
+ script_name: string;
740
+ class_name: string;
741
+ jurisdiction?: string;
660
742
  };
661
743
  interface WorkflowConflict {
662
- name: string;
663
- currentOwner: string;
744
+ name: string;
745
+ currentOwner: string;
664
746
  }
665
747
  declare const WORKFLOW_NOT_FOUND_CODE = 10200;
666
748
  declare function checkWorkflowConflicts(config: Config, accountId: string, scriptName: string): Promise<{
667
- hasConflicts: false;
749
+ hasConflicts: false;
668
750
  } | {
669
- hasConflicts: true;
670
- conflicts: WorkflowConflict[];
671
- message: string;
751
+ hasConflicts: true;
752
+ conflicts: WorkflowConflict[];
753
+ message: string;
672
754
  }>;
673
-
755
+ //#endregion
756
+ //#region src/deploy/helpers/download-worker-config.d.ts
674
757
  type CustomDomainsRes = {
675
- id: string;
676
- zone_id: string;
677
- zone_name: string;
678
- hostname: string;
679
- service: string;
680
- environment: string;
681
- cert_id: string;
682
- enabled: boolean;
683
- previews_enabled: boolean;
758
+ id: string;
759
+ zone_id: string;
760
+ zone_name: string;
761
+ hostname: string;
762
+ service: string;
763
+ environment: string;
764
+ cert_id: string;
765
+ enabled: boolean;
766
+ previews_enabled: boolean;
684
767
  }[];
685
768
  type WorkerSubdomainRes = {
686
- enabled: boolean;
687
- previews_enabled: boolean;
769
+ enabled: boolean;
770
+ previews_enabled: boolean;
688
771
  };
689
772
  type CronTriggersRes = {
690
- schedules: {
691
- cron: string;
692
- created_on: Date;
693
- modified_on: Date;
694
- }[];
773
+ schedules: {
774
+ cron: string;
775
+ created_on: Date;
776
+ modified_on: Date;
777
+ }[];
695
778
  };
696
779
  type RoutesRes = {
697
- id: string;
698
- pattern: string;
699
- zone_name: string;
700
- script: string;
780
+ id: string;
781
+ pattern: string;
782
+ zone_name: string;
783
+ script: string;
701
784
  }[];
702
785
  /**
703
786
  * Downloads the information required to construct a Wrangler config file for a Worker from the API.
704
787
  */
705
788
  declare function fetchWorkerConfig(complianceConfig: ComplianceConfig, accountId: string, workerName: string, environment: string, fetchRoutes: boolean, fetchCustomDomains: boolean): Promise<{
706
- bindings: _cloudflare_workers_utils.WorkerMetadataBinding[];
707
- routes: RoutesRes;
708
- customDomains: CustomDomainsRes;
709
- subdomainStatus: WorkerSubdomainRes;
710
- serviceEnvMetadata: {
711
- environment: string;
712
- created_on: string;
713
- modified_on: string;
714
- script: {
715
- id: string;
716
- tag: string;
717
- tags: string[];
718
- etag: string;
719
- handlers: string[];
720
- modified_on: string;
721
- created_on: string;
722
- migration_tag: string;
723
- usage_model: "bundled" | "unbound";
724
- limits: {
725
- cpu_ms: number;
726
- subrequests: number;
727
- };
728
- compatibility_date: string;
729
- compatibility_flags: string[];
730
- last_deployed_from?: "wrangler" | "dash" | "api";
731
- placement_mode?: "smart";
732
- tail_consumers?: _cloudflare_workers_utils.TailConsumer[];
733
- observability?: _cloudflare_workers_utils.Observability;
734
- };
789
+ bindings: import("@cloudflare/workers-utils").WorkerMetadataBinding[];
790
+ routes: RoutesRes;
791
+ customDomains: CustomDomainsRes;
792
+ subdomainStatus: WorkerSubdomainRes;
793
+ serviceEnvMetadata: {
794
+ environment: string;
795
+ created_on: string;
796
+ modified_on: string;
797
+ script: {
798
+ id: string;
799
+ tag: string;
800
+ tags: string[];
801
+ etag: string;
802
+ handlers: string[];
803
+ modified_on: string;
804
+ created_on: string;
805
+ migration_tag: string;
806
+ usage_model: "bundled" | "unbound";
807
+ limits: {
808
+ cpu_ms: number;
809
+ subrequests: number;
810
+ };
811
+ compatibility_date: string;
812
+ compatibility_flags: string[];
813
+ last_deployed_from?: "wrangler" | "dash" | "api";
814
+ placement_mode?: "smart";
815
+ tail_consumers?: import("@cloudflare/workers-utils/config").TailConsumer[];
816
+ observability?: import("@cloudflare/workers-utils/config").Observability;
735
817
  };
736
- cronTriggers: CronTriggersRes;
818
+ };
819
+ cronTriggers: CronTriggersRes;
737
820
  }>;
738
821
  /**
739
822
  * Downloads all the remote information we can gather for a worker and from them generates a raw configuration object that
740
823
  * approximates what a wrangler config object for the worker was/would have been.
741
824
  */
742
825
  declare function downloadWorkerConfig(complianceConfig: ComplianceConfig, workerName: string, environment: string, entrypoint: string, accountId: string, fetchRoutes: boolean, fetchCustomDomains: boolean): Promise<RawConfig>;
743
-
826
+ //#endregion
827
+ //#region src/deploy/helpers/durable.d.ts
744
828
  /**
745
829
  * For a given Worker + migrations config, figure out which migrations
746
830
  * to upload based on the current migration tag of the deployed Worker.
747
831
  */
748
832
  declare function getMigrationsToUpload(scriptName: string, props: {
749
- accountId: string | undefined;
750
- config: Config;
751
- dispatchNamespace: string | undefined;
833
+ accountId: string | undefined;
834
+ config: Config;
835
+ dispatchNamespace: string | undefined;
752
836
  }): Promise<CfWorkerInit["migrations"]>;
753
837
  /**
754
838
  * Resolve which Durable Object lifecycle payload to send with the upload.
755
839
  */
756
840
  declare function resolveDoLifecyclePayload(props: {
757
- scriptName: string;
758
- isDryRun: boolean | undefined;
759
- accountId: string | undefined;
760
- config: Config;
761
- dispatchNamespace: string | undefined;
841
+ scriptName: string;
842
+ isDryRun: boolean | undefined;
843
+ accountId: string | undefined;
844
+ config: Config;
845
+ dispatchNamespace: string | undefined;
762
846
  }): Promise<{
763
- migrations: CfWorkerInit["migrations"];
764
- exports: CfWorkerInit["exports"];
847
+ migrations: CfWorkerInit["migrations"];
848
+ exports: CfWorkerInit["exports"];
765
849
  }>;
766
-
850
+ //#endregion
851
+ //#region src/deploy/helpers/durable-object-container-applications.d.ts
767
852
  type DeployDurableObjectContainerApplicationsArgs = {
768
- dispatchNamespace?: string;
769
- versionId: string;
770
- accountId: string;
771
- scriptName: string;
772
- /** Version uploads may initialize a missing application, but never update one. */
773
- updateExisting?: boolean;
853
+ dispatchNamespace?: string;
854
+ versionId: string;
855
+ accountId: string;
856
+ scriptName: string;
857
+ /** Version uploads may initialize a missing application, but never update one. */
858
+ updateExisting?: boolean;
774
859
  };
775
860
  type PrepareDurableObjectContainerApplicationsArgs = {
776
- accountId: string | undefined;
777
- dispatchNamespace?: string;
778
- dryRun: boolean;
779
- scriptName: string;
780
- /** Version uploads cannot initialize applications without named images. */
781
- requireExistingImageLessApplications?: boolean;
782
- deployCommand?: string;
783
- versionsUploadCommand?: string;
861
+ accountId: string | undefined;
862
+ dispatchNamespace?: string;
863
+ dryRun: boolean;
864
+ scriptName: string;
865
+ /** Version uploads cannot initialize applications without named images. */
866
+ requireExistingImageLessApplications?: boolean;
867
+ deployCommand?: string;
868
+ versionsUploadCommand?: string;
784
869
  };
785
870
  type DurableObjectContainerApplication = Pick<ResolvedDurableObjectContainerApp, "class_name" | "name">;
786
871
  type VersionedDurableObjectContainerApplication = DurableObjectContainerApplication & {
787
- namespaceId?: string;
872
+ namespaceId?: string;
788
873
  };
789
874
  type PreparedContainerImages = Record<string, Record<string, string>>;
790
875
  declare function createDurableObjectContainerApplication(application: DurableObjectContainerApplication, namespaceId: string): Promise<void>;
@@ -803,18 +888,18 @@ declare function getVersionedDurableObjectContainerApplications(versions: ApiVer
803
888
  * These versions carry no managed-policy discriminator, so versions deploy
804
889
  * cannot initialize their applications. A normal deploy must provision them first.
805
890
  */
806
- declare function validateImageLessContainerApplicationsForUpload(config: ContainerlessConfig, containers: DurableObjectContainerApp[], { accountId, scriptName, deployCommand, versionsUploadCommand, }: {
807
- accountId: string;
808
- scriptName: string;
809
- deployCommand: string;
810
- versionsUploadCommand: string;
891
+ declare function validateImageLessContainerApplicationsForUpload(config: ContainerlessConfig, containers: DurableObjectContainerApp[], { accountId, scriptName, deployCommand, versionsUploadCommand }: {
892
+ accountId: string;
893
+ scriptName: string;
894
+ deployCommand: string;
895
+ versionsUploadCommand: string;
811
896
  }): Promise<void>;
812
897
  /** Resolve every versioned application's namespace without creating applications. */
813
- declare function resolveVersionedDurableObjectContainerApplications(config: Config, { applications, accountId, scriptName, allowMissingNamespaces, }: {
814
- applications: VersionedDurableObjectContainerApplication[];
815
- accountId: string;
816
- scriptName: string;
817
- allowMissingNamespaces?: boolean;
898
+ declare function resolveVersionedDurableObjectContainerApplications(config: Config, { applications, accountId, scriptName, allowMissingNamespaces }: {
899
+ applications: VersionedDurableObjectContainerApplication[];
900
+ accountId: string;
901
+ scriptName: string;
902
+ allowMissingNamespaces?: boolean;
818
903
  }): Promise<VersionedDurableObjectContainerApplication[]>;
819
904
  /**
820
905
  * Ensure selected versions have applications after every namespace is resolved.
@@ -823,12 +908,12 @@ declare function resolveVersionedDurableObjectContainerApplications(config: Conf
823
908
  * defaults, so rolling back a Worker never rolls back application-wide settings.
824
909
  */
825
910
  declare function deployVersionedDurableObjectContainerApplications(config: Config, args: {
826
- applications: VersionedDurableObjectContainerApplication[];
827
- accountId: string;
828
- scriptName: string;
911
+ applications: VersionedDurableObjectContainerApplication[];
912
+ accountId: string;
913
+ scriptName: string;
829
914
  }): Promise<void>;
830
915
  /** Validate managed classes and prepare their named images before Worker upload. */
831
- declare function prepareDurableObjectContainerApplications(config: ContainerlessConfig, durableObjectContainerConfig: DurableObjectContainerApp[], builtImages: BuiltDurableObjectContainerImage[], { accountId, dryRun, scriptName, dispatchNamespace, requireExistingImageLessApplications, deployCommand, versionsUploadCommand, }: PrepareDurableObjectContainerApplicationsArgs): Promise<PreparedContainerImages>;
916
+ declare function prepareDurableObjectContainerApplications(config: ContainerlessConfig, durableObjectContainerConfig: DurableObjectContainerApp[], builtImages: BuiltDurableObjectContainerImage[], { accountId, dryRun, scriptName, dispatchNamespace, requireExistingImageLessApplications, deployCommand, versionsUploadCommand }: PrepareDurableObjectContainerApplicationsArgs): Promise<PreparedContainerImages>;
832
917
  /**
833
918
  * Apply explicit application settings after an uploaded Worker's namespaces exist.
834
919
  *
@@ -836,15 +921,17 @@ declare function prepareDurableObjectContainerApplications(config: Containerless
836
921
  * applications and patch supplied changes; `updateExisting: false` makes version
837
922
  * uploads create-only. Omitted settings and root Worker observability are ignored.
838
923
  */
839
- declare function deployDurableObjectContainerApplications(config: ContainerlessConfig, durableObjectContainerConfig: DurableObjectContainerApp[], { versionId, accountId, scriptName, dispatchNamespace, updateExisting, }: DeployDurableObjectContainerApplicationsArgs): Promise<void>;
840
-
924
+ declare function deployDurableObjectContainerApplications(config: ContainerlessConfig, durableObjectContainerConfig: DurableObjectContainerApp[], { versionId, accountId, scriptName, dispatchNamespace, updateExisting }: DeployDurableObjectContainerApplicationsArgs): Promise<void>;
925
+ //#endregion
926
+ //#region src/deploy/helpers/exports.d.ts
841
927
  type ResolveExportsUploadPayloadProps = Parameters<typeof resolveDoLifecyclePayload>[0];
842
928
  declare function resolveExportsUploadPayload(props: ResolveExportsUploadPayloadProps): Promise<{
843
- migrations: CfWorkerInit["migrations"];
844
- exports: CfWorkerInit["exports"];
845
- headers: Record<string, string> | undefined;
929
+ migrations: CfWorkerInit["migrations"];
930
+ exports: CfWorkerInit["exports"];
931
+ headers: Record<string, string> | undefined;
846
932
  }>;
847
-
933
+ //#endregion
934
+ //#region src/deploy/helpers/exports-reconciliation.d.ts
848
935
  /**
849
936
  * Render the success-side `exports_reconciliation` envelope to the logger.
850
937
  * Emits nothing when the result has no entries to report (so a re-deploy
@@ -867,7 +954,8 @@ declare function renderExportsReconciliationError(details: ExportsReconciliation
867
954
  * Validate the array shape so the renderer can rely on the typed fields.
868
955
  */
869
956
  declare function isExportsReconciliationErrorDetails(value: unknown): value is ExportsReconciliationErrorDetail[];
870
-
957
+ //#endregion
958
+ //#region src/deploy/helpers/inconsistent-exports.d.ts
871
959
  /**
872
960
  * Build the user-facing error message for EWC code 100405
873
961
  * (inconsistent declarative DO `exports` across versions in a
@@ -881,7 +969,8 @@ declare function isExportsReconciliationErrorDetails(value: unknown): value is E
881
969
  * @returns The server message followed by consumer-specific recovery guidance.
882
970
  */
883
971
  declare function renderInconsistentExportsAcrossVersionsError(serverMessage: string, versionsDeployAt100Command: string): string;
884
-
972
+ //#endregion
973
+ //#region src/deploy/helpers/binding-depends-on-export.d.ts
885
974
  /**
886
975
  * Build the user-facing error message for EWC code 100406
887
976
  * (an actor binding references a Durable Object class declared in `exports`
@@ -894,40 +983,43 @@ declare function renderInconsistentExportsAcrossVersionsError(serverMessage: str
894
983
  * only used in the unlikely event the server sends an empty message.
895
984
  */
896
985
  declare function renderBindingDependsOnExportError(serverMessage: string): string;
897
-
986
+ //#endregion
987
+ //#region src/deploy/helpers/match-tag.d.ts
898
988
  declare function verifyWorkerMatchesCITag(complianceConfig: ComplianceConfig, accountId: string, workerName: string, configPath: string | undefined): Promise<void>;
899
-
989
+ //#endregion
990
+ //#region src/deploy/helpers/check-remote-secrets-override.d.ts
900
991
  declare function fetchSecrets(config: Config, scriptName: string, accountId: string): Promise<{
901
- name: string;
902
- type: string;
992
+ name: string;
993
+ type: string;
903
994
  }[]>;
904
995
  declare function checkRemoteSecretsOverride(config: Config, scriptName: string, accountId: string): Promise<{
905
- override: false;
996
+ override: false;
906
997
  } | {
907
- override: true;
908
- deployErrorMessage: string;
998
+ override: true;
999
+ deployErrorMessage: string;
909
1000
  }>;
910
-
1001
+ //#endregion
1002
+ //#region src/deploy/helpers/confirm-latest-deployment-overwrite.d.ts
911
1003
  /** Confirm replacement of the current deployment, preserving the public boolean API. */
912
1004
  declare function confirmLatestDeploymentOverwrite(config: Config, accountId: string, scriptName: string, deployCommand: string, versionsDeployCommand: string): Promise<boolean>;
913
1005
  declare function printVersions(versions: ApiVersion[], traffic: Map<VersionId, Percentage>): void;
914
-
915
- declare const hashFile: (filepath: string) => string;
916
-
1006
+ //#endregion
1007
+ //#region src/deploy/helpers/jwt.d.ts
917
1008
  declare const decodeJwtPayload: (token: string) => any;
918
1009
  declare const isJwtExpired: (token: string) => boolean | undefined;
919
-
1010
+ //#endregion
1011
+ //#region src/deploy/helpers/package-dependencies.d.ts
920
1012
  /**
921
1013
  * A single npm package dependency entry, matching the upload API schema
922
1014
  * see: https://developers.cloudflare.com/api/resources/workers/subresources/scripts/methods/update.
923
1015
  */
924
1016
  type PackageDependency = {
925
- /** The npm package name, e.g. "lodash" or "@cloudflare/workers-types". */
926
- name: string;
927
- /** The version constraint as written in package.json, e.g. "^4.17.21". */
928
- packageJsonVersion: string;
929
- /** The exact version resolved and installed by the package manager, e.g. "4.17.22". */
930
- installedVersion: string;
1017
+ /** The npm package name, e.g. "lodash" or "@cloudflare/workers-types". */
1018
+ name: string;
1019
+ /** The version constraint as written in package.json, e.g. "^4.17.21". */
1020
+ packageJsonVersion: string;
1021
+ /** The exact version resolved and installed by the package manager, e.g. "4.17.22". */
1022
+ installedVersion: string;
931
1023
  };
932
1024
  /**
933
1025
  * Collects npm package dependency metadata from the project's package.json.
@@ -949,17 +1041,18 @@ type PackageDependency = {
949
1041
  * cannot be read or no valid dependencies are found
950
1042
  */
951
1043
  declare function collectPackageDependencies(projectPath: string, excludePackages?: string[]): Promise<PackageDependency[] | undefined>;
952
-
1044
+ //#endregion
1045
+ //#region src/deploy/helpers/provision-bindings.d.ts
953
1046
  type Settings = {
954
- bindings: Array<WorkerMetadataBinding>;
1047
+ bindings: Array<WorkerMetadataBinding>;
955
1048
  };
956
1049
  type ProvisionBindingsResult = {
957
- warnOnSkippedProvisioning: () => void;
1050
+ warnOnSkippedProvisioning: () => void;
958
1051
  };
959
1052
  declare function provisionBindings(bindings: StartDevWorkerInput["bindings"], accountId: string, scriptName: string, autoCreate: boolean, config: Config, options: {
960
- skipConfigWriteback?: boolean;
961
- d1ListCommand: string;
962
- d1DeleteCommand: string;
1053
+ skipConfigWriteback?: boolean;
1054
+ d1ListCommand: string;
1055
+ d1DeleteCommand: string;
963
1056
  }): Promise<ProvisionBindingsResult>;
964
1057
  declare function getSettings(complianceConfig: ComplianceConfig, accountId: string, scriptName: string): Promise<Settings>;
965
1058
  /**
@@ -969,161 +1062,162 @@ declare function getSettings(complianceConfig: ComplianceConfig, accountId: stri
969
1062
  * @returns Consumer-specific database listing and deletion guidance.
970
1063
  */
971
1064
  declare function renderD1DatabaseLimitError(accountId: string, d1ListCommand: string, d1DeleteCommand: string): string;
972
-
1065
+ //#endregion
1066
+ //#region src/preview/api.d.ts
973
1067
  interface Binding {
974
- type: string;
975
- text?: string;
976
- json?: Json;
977
- namespace_id?: string;
978
- workflow_name?: string;
979
- destination_address?: string;
980
- allowed_destination_addresses?: string[];
981
- allowed_sender_addresses?: string[];
982
- queue_name?: string;
983
- delivery_delay?: number;
984
- database_id?: string;
985
- database_name?: string;
986
- bucket_name?: string;
987
- jurisdiction?: string;
988
- index_name?: string;
989
- instance_name?: string;
990
- id?: string;
991
- service?: string;
992
- environment?: string;
993
- props?: Record<string, unknown>;
994
- cross_account_grant?: string;
995
- dataset?: string;
996
- namespace?: string;
997
- outbound?: {
998
- worker: {
999
- service: string;
1000
- environment?: string;
1001
- };
1002
- params?: Array<{
1003
- name: string;
1004
- }>;
1005
- };
1006
- certificate_id?: string;
1007
- pipeline?: string;
1008
- stream?: string;
1009
- store_id?: string;
1010
- secret_name?: string;
1011
- simple?: {
1012
- limit: number;
1013
- period: 10 | 60;
1068
+ type: string;
1069
+ text?: string;
1070
+ json?: Json;
1071
+ namespace_id?: string;
1072
+ workflow_name?: string;
1073
+ destination_address?: string;
1074
+ allowed_destination_addresses?: string[];
1075
+ allowed_sender_addresses?: string[];
1076
+ queue_name?: string;
1077
+ delivery_delay?: number;
1078
+ database_id?: string;
1079
+ database_name?: string;
1080
+ bucket_name?: string;
1081
+ jurisdiction?: string;
1082
+ index_name?: string;
1083
+ instance_name?: string;
1084
+ id?: string;
1085
+ service?: string;
1086
+ environment?: string;
1087
+ props?: Record<string, unknown>;
1088
+ cross_account_grant?: string;
1089
+ dataset?: string;
1090
+ namespace?: string;
1091
+ outbound?: {
1092
+ worker: {
1093
+ service: string;
1094
+ environment?: string;
1014
1095
  };
1015
- service_id?: string;
1016
- tunnel_id?: string;
1017
- network_id?: string;
1018
- destination?: string;
1019
- staging?: boolean;
1020
- enable_timer?: boolean;
1021
- app_id?: string;
1022
- entrypoint?: string;
1023
- class_name?: string;
1024
- script_name?: string;
1096
+ params?: Array<{
1097
+ name: string;
1098
+ }>;
1099
+ };
1100
+ certificate_id?: string;
1101
+ pipeline?: string;
1102
+ stream?: string;
1103
+ store_id?: string;
1104
+ secret_name?: string;
1105
+ simple?: {
1106
+ limit: number;
1107
+ period: 10 | 60;
1108
+ };
1109
+ service_id?: string;
1110
+ tunnel_id?: string;
1111
+ network_id?: string;
1112
+ destination?: string;
1113
+ staging?: boolean;
1114
+ enable_timer?: boolean;
1115
+ app_id?: string;
1116
+ entrypoint?: string;
1117
+ class_name?: string;
1118
+ script_name?: string;
1025
1119
  }
1026
1120
  type EnvBindings = Record<string, Binding>;
1027
1121
  interface PreviewResource {
1028
- id: string;
1122
+ id: string;
1123
+ name: string;
1124
+ slug: string;
1125
+ urls?: string[];
1126
+ tags?: string[];
1127
+ observability?: Observability;
1128
+ logpush?: boolean;
1129
+ tail_consumers?: Array<{
1029
1130
  name: string;
1030
- slug: string;
1031
- urls?: string[];
1032
- tags?: string[];
1033
- observability?: Observability;
1034
- logpush?: boolean;
1035
- tail_consumers?: Array<{
1036
- name: string;
1037
- }>;
1038
- created_on: string;
1039
- updated_on: string;
1131
+ }>;
1132
+ created_on: string;
1133
+ updated_on: string;
1040
1134
  }
1041
1135
  interface DeploymentResource {
1042
- id: string;
1043
- preview_id: string;
1044
- preview_name: string;
1045
- migration_tag?: string;
1046
- urls?: string[];
1047
- compatibility_date?: string;
1048
- compatibility_flags?: string[];
1049
- limits?: CfUserLimits;
1050
- placement?: CfPlacement;
1051
- cache?: CacheOptions;
1052
- annotations?: {
1053
- "workers/commit_sha"?: string;
1054
- "workers/message"?: string;
1055
- "workers/pull_request_number"?: string;
1056
- "workers/pull_request_title"?: string;
1057
- "workers/pull_request_url"?: string;
1058
- "workers/repository_url"?: string;
1059
- "workers/tag"?: string;
1060
- };
1061
- env?: EnvBindings;
1062
- created_on: string;
1136
+ id: string;
1137
+ preview_id: string;
1138
+ preview_name: string;
1139
+ migration_tag?: string;
1140
+ urls?: string[];
1141
+ compatibility_date?: string;
1142
+ compatibility_flags?: string[];
1143
+ limits?: CfUserLimits;
1144
+ placement?: CfPlacement;
1145
+ cache?: CacheOptions;
1146
+ annotations?: {
1147
+ "workers/commit_sha"?: string;
1148
+ "workers/message"?: string;
1149
+ "workers/pull_request_number"?: string;
1150
+ "workers/pull_request_title"?: string;
1151
+ "workers/pull_request_url"?: string;
1152
+ "workers/repository_url"?: string;
1153
+ "workers/tag"?: string;
1154
+ };
1155
+ env?: EnvBindings;
1156
+ created_on: string;
1063
1157
  }
1064
1158
  type PreviewDeploymentModule = {
1065
- name: string;
1066
- content_type: string;
1067
- content: string | Uint8Array;
1159
+ name: string;
1160
+ content_type: string;
1161
+ content: string | Uint8Array;
1068
1162
  };
1069
1163
  type CreatePreviewDeploymentRequestParams = {
1070
- main_module?: string;
1071
- modules?: PreviewDeploymentModule[];
1072
- assets?: {
1073
- jwt: string;
1074
- config: {
1075
- html_handling?: string;
1076
- not_found_handling?: string;
1077
- base_path?: string;
1078
- run_worker_first?: string[] | boolean;
1079
- };
1080
- };
1081
- compatibility_date?: string;
1082
- compatibility_flags?: string[];
1083
- exports?: CfWorkerInit["exports"];
1084
- annotations?: {
1085
- "workers/commit_sha"?: string;
1086
- "workers/message"?: string;
1087
- "workers/pull_request_number"?: string;
1088
- "workers/pull_request_title"?: string;
1089
- "workers/pull_request_url"?: string;
1090
- "workers/repository_url"?: string;
1091
- "workers/tag"?: string;
1164
+ main_module?: string;
1165
+ modules?: PreviewDeploymentModule[];
1166
+ assets?: {
1167
+ jwt: string;
1168
+ config: {
1169
+ html_handling?: string;
1170
+ not_found_handling?: string;
1171
+ base_path?: string;
1172
+ run_worker_first?: string[] | boolean;
1092
1173
  };
1093
- migrations?: CfWorkerInit["migrations"];
1094
- limits?: CfUserLimits;
1095
- placement?: CfPlacement | null;
1096
- cache?: CacheOptions;
1097
- env?: EnvBindings;
1098
- containers?: Array<{
1099
- class_name: string;
1100
- }>;
1174
+ };
1175
+ compatibility_date?: string;
1176
+ compatibility_flags?: string[];
1177
+ exports?: CfWorkerInit["exports"];
1178
+ annotations?: {
1179
+ "workers/commit_sha"?: string;
1180
+ "workers/message"?: string;
1181
+ "workers/pull_request_number"?: string;
1182
+ "workers/pull_request_title"?: string;
1183
+ "workers/pull_request_url"?: string;
1184
+ "workers/repository_url"?: string;
1185
+ "workers/tag"?: string;
1186
+ };
1187
+ migrations?: CfWorkerInit["migrations"];
1188
+ limits?: CfUserLimits;
1189
+ placement?: CfPlacement | null;
1190
+ cache?: CacheOptions;
1191
+ env?: EnvBindings;
1192
+ containers?: Array<{
1193
+ class_name: string;
1194
+ }>;
1101
1195
  };
1102
1196
  type CreatePreviewRequestParams = {
1197
+ name: string;
1198
+ observability?: Observability;
1199
+ logpush?: boolean;
1200
+ tail_consumers?: Array<{
1103
1201
  name: string;
1104
- observability?: Observability;
1105
- logpush?: boolean;
1106
- tail_consumers?: Array<{
1107
- name: string;
1108
- }>;
1202
+ }>;
1109
1203
  };
1110
1204
  type UpdatePreviewRequestParams = Omit<CreatePreviewRequestParams, "name">;
1111
1205
  type PreviewRequestOptions = {
1112
- ignoreBaseConfig?: boolean;
1206
+ ignoreBaseConfig?: boolean;
1113
1207
  };
1114
1208
  type PreviewBaseConfig = {
1115
- observability?: Observability;
1116
- logpush?: boolean;
1117
- limits?: CfUserLimits;
1118
- placement?: CfPlacement;
1119
- cache?: CacheOptions;
1120
- tail_consumers?: Array<{
1121
- name: string;
1122
- }>;
1123
- env?: EnvBindings;
1209
+ observability?: Observability;
1210
+ logpush?: boolean;
1211
+ limits?: CfUserLimits;
1212
+ placement?: CfPlacement;
1213
+ cache?: CacheOptions;
1214
+ tail_consumers?: Array<{
1215
+ name: string;
1216
+ }>;
1217
+ env?: EnvBindings;
1124
1218
  };
1125
1219
  type PreviewBaseConfigPatch = Partial<Omit<PreviewBaseConfig, "env">> & {
1126
- env?: Record<string, Binding | null>;
1220
+ env?: Record<string, Binding | null>;
1127
1221
  };
1128
1222
  /** Create an undeployed Worker that can own Preview resources. */
1129
1223
  declare function createPreviewParentWorker(config: Config, accountId: string, workerName: string, workersDevEnabled: boolean, previewsEnabled: boolean): Promise<void>;
@@ -1138,12 +1232,13 @@ declare function getPreviewDeployment(config: Config, accountId: string, workerN
1138
1232
  declare function createPreviewDeploymentForm(request: Partial<CreatePreviewDeploymentRequestParams>): FormData;
1139
1233
  declare function createPreviewDeployment(config: Config, accountId: string, workerName: string, previewIdentifier: string, request: Partial<CreatePreviewDeploymentRequestParams>): Promise<DeploymentResource>;
1140
1234
  declare function patchPreviewDeployment(config: Config, accountId: string, workerName: string, previewIdentifier: string, env: Record<string, Binding | null>, annotations?: {
1141
- "workers/message"?: string;
1142
- "workers/tag"?: string;
1235
+ "workers/message"?: string;
1236
+ "workers/tag"?: string;
1143
1237
  }, deploymentIdentifier?: string): Promise<DeploymentResource>;
1144
1238
  declare function getPreviewBaseConfig(config: Config, accountId: string, workerName: string): Promise<PreviewBaseConfig>;
1145
1239
  declare function patchPreviewBaseConfig(config: Config, accountId: string, workerName: string, previewBaseConfig: PreviewBaseConfigPatch): Promise<PreviewBaseConfig>;
1146
-
1240
+ //#endregion
1241
+ //#region src/preview/shared.d.ts
1147
1242
  declare function getBranchName(): string | undefined;
1148
1243
  declare function shouldUseCIMetadataFallback(): boolean;
1149
1244
  declare function getHeadCommitRef(): string | undefined;
@@ -1173,9 +1268,9 @@ declare function getRepositoryUrl(): string | undefined;
1173
1268
  * provider exposes.
1174
1269
  */
1175
1270
  type PullRequestMetadata = {
1176
- number?: string;
1177
- url?: string;
1178
- title?: string;
1271
+ number?: string;
1272
+ url?: string;
1273
+ title?: string;
1179
1274
  };
1180
1275
  /**
1181
1276
  * Detects the pull/merge request associated with the current CI run, trying
@@ -1186,8 +1281,8 @@ type PullRequestMetadata = {
1186
1281
  */
1187
1282
  declare function getPullRequestMetadata(): PullRequestMetadata | undefined;
1188
1283
  declare function resolveWorkerName(args: {
1189
- workerName?: string;
1190
- "worker-name"?: string;
1284
+ workerName?: string;
1285
+ "worker-name"?: string;
1191
1286
  }, config: Config): string;
1192
1287
  /**
1193
1288
  * Get a human-readable display value for a binding.
@@ -1225,71 +1320,72 @@ declare function getPreviewOwnedContainerClassNames(config: Config, previews: Pr
1225
1320
  */
1226
1321
  declare function previewContainerAppName(parentWorkerName: string, previewSlug: string, className: string): string;
1227
1322
  declare function assemblePreviewScriptSettings(config: Config): UpdatePreviewRequestParams;
1228
-
1323
+ //#endregion
1324
+ //#region src/preview/preview.d.ts
1229
1325
  type PreviewArgs = {
1230
- script?: string;
1231
- name?: string;
1232
- tag?: string;
1233
- message?: string;
1234
- json?: boolean;
1235
- ignoreBaseConfig: boolean;
1236
- workerName?: string;
1237
- "worker-name"?: string;
1238
- secretsFile?: string;
1239
- /** Parsed `--var` args. CLI-only vars; config vars flow separately via `extractConfigBindings(config)`. */
1240
- cliVars?: Record<string, string>;
1326
+ script?: string;
1327
+ name?: string;
1328
+ tag?: string;
1329
+ message?: string;
1330
+ json?: boolean;
1331
+ ignoreBaseConfig: boolean;
1332
+ workerName?: string;
1333
+ "worker-name"?: string;
1334
+ secretsFile?: string;
1335
+ /** Parsed `--var` args. CLI-only vars; config vars flow separately via `extractConfigBindings(config)`. */
1336
+ cliVars?: Record<string, string>;
1241
1337
  };
1242
1338
  type PreviewAssetsOptions = {
1243
- directory: string;
1244
- assetConfig: {
1245
- html_handling?: string;
1246
- not_found_handling?: string;
1247
- base_path?: string;
1248
- };
1249
- run_worker_first?: string[] | boolean;
1250
- _headers?: string;
1251
- _redirects?: string;
1339
+ directory: string;
1340
+ assetConfig: {
1341
+ html_handling?: string;
1342
+ not_found_handling?: string;
1343
+ base_path?: string;
1344
+ };
1345
+ run_worker_first?: string[] | boolean;
1346
+ _headers?: string;
1347
+ _redirects?: string;
1252
1348
  };
1253
1349
  type PreviewDeleteArgs = {
1254
- name?: string;
1255
- skipConfirmation?: boolean;
1256
- workerName?: string;
1257
- "worker-name"?: string;
1350
+ name?: string;
1351
+ skipConfirmation?: boolean;
1352
+ workerName?: string;
1353
+ "worker-name"?: string;
1258
1354
  };
1259
1355
  type PreviewResult = {
1260
- preview: PreviewResource;
1261
- deployment: DeploymentResource;
1262
- isNewPreview: boolean;
1356
+ preview: PreviewResource;
1357
+ deployment: DeploymentResource;
1358
+ isNewPreview: boolean;
1263
1359
  };
1264
1360
  type PreviewBuildOutputRootConfig = ParsedBuildOutputRootConfig & {
1265
- buildContext: ParsedBuildOutputRootConfig["buildContext"] & {
1266
- isPreview: true;
1267
- };
1361
+ buildContext: ParsedBuildOutputRootConfig["buildContext"] & {
1362
+ isPreview: true;
1363
+ };
1268
1364
  };
1269
1365
  type PreviewBuildOutput = {
1270
- workerConfig: ParsedBuildOutputWorkerConfig;
1271
- rootConfig: PreviewBuildOutputRootConfig;
1272
- buildResult?: WorkerBuildResult;
1273
- assets?: Pick<PreviewAssetsOptions, "directory" | "_headers" | "_redirects">;
1274
- containers?: ParsedBuildOutputContainerConfig[];
1366
+ workerConfig: ParsedBuildOutputWorkerConfig;
1367
+ rootConfig: PreviewBuildOutputRootConfig;
1368
+ buildResult?: WorkerBuildResult;
1369
+ assets?: Pick<PreviewAssetsOptions, "directory" | "_headers" | "_redirects">;
1370
+ containers?: ParsedBuildOutputContainerConfig[];
1275
1371
  };
1276
1372
  /** Verify that Build Output was produced with Preview configuration. */
1277
1373
  declare function assertPreviewBuildOutputRootConfig(rootConfig: ParsedBuildOutputRootConfig | undefined): asserts rootConfig is PreviewBuildOutputRootConfig;
1278
1374
  type PreviewOptions = {
1279
- deployCommand?: string;
1280
- previewCommand?: string;
1281
- productionBindingsExpectedInPreview?: Record<string, {
1282
- type: string;
1283
- }>;
1284
- getNormalizedContainerOptions: ((config: Config, args: {
1285
- containersRollout?: "gradual" | "immediate" | "none";
1286
- dryRun?: boolean;
1287
- }) => Promise<ContainerNormalizedConfig[]>) | undefined;
1288
- deployPreviewContainers: ((scopedConfig: Config, normalisedContainerConfig: ContainerNormalizedConfig[], deployment: DeploymentResource, accountId: string, options: {
1289
- quiet: boolean;
1290
- localImageReferences?: Map<string, string>;
1291
- }) => Promise<void>) | undefined;
1292
- verifyContainersScope?: (scopedConfig: Config) => Promise<void>;
1375
+ deployCommand?: string;
1376
+ previewCommand?: string;
1377
+ productionBindingsExpectedInPreview?: Record<string, {
1378
+ type: string;
1379
+ }>;
1380
+ getNormalizedContainerOptions: ((config: Config, args: {
1381
+ containersRollout?: "gradual" | "immediate" | "none";
1382
+ dryRun?: boolean;
1383
+ }) => Promise<ContainerNormalizedConfig[]>) | undefined;
1384
+ deployPreviewContainers: ((scopedConfig: Config, normalisedContainerConfig: ContainerNormalizedConfig[], deployment: DeploymentResource, accountId: string, options: {
1385
+ quiet: boolean;
1386
+ localImageReferences?: Map<string, string>;
1387
+ }) => Promise<void>) | undefined;
1388
+ verifyContainersScope?: (scopedConfig: Config) => Promise<void>;
1293
1389
  };
1294
1390
  declare const NO_ACTIVE_PREVIEW_URLS_MESSAGE = "Note: This Preview deployment has no active URLs.";
1295
1391
  declare function formatNoActivePreviewUrlsMessage(config: Config, deployCommand?: string, previewCommand?: string): string;
@@ -1311,23 +1407,25 @@ declare function preview(accountId: string, args: PreviewArgs, config: Config, b
1311
1407
  * Upload a Preview from resolved Build Output configuration.
1312
1408
  *
1313
1409
  * @param accountId Account that owns the parent Worker.
1314
- * @param args Preview name and deployment annotations.
1410
+ * @param args Preview name, deployment annotations, and secrets file.
1315
1411
  * @param buildOutput Exact configuration and artifacts emitted by the build.
1316
1412
  */
1317
- declare function previewBuildOutput(accountId: string, args: Pick<PreviewArgs, "name" | "tag" | "message" | "json">, buildOutput: PreviewBuildOutput, options?: PreviewOptions): Promise<PreviewResult>;
1413
+ declare function previewBuildOutput(accountId: string, args: Pick<PreviewArgs, "name" | "tag" | "message" | "json" | "secretsFile">, buildOutput: PreviewBuildOutput, options?: PreviewOptions): Promise<PreviewResult>;
1318
1414
  /**
1319
1415
  * Delete a preview and all its deployments.
1320
1416
  */
1321
1417
  declare function previewDelete(accountId: string, args: PreviewDeleteArgs, config: Config): Promise<void>;
1322
-
1418
+ //#endregion
1419
+ //#region src/preview/format.d.ts
1323
1420
  type MergedBinding = Binding & {
1324
- fromConfig: boolean;
1421
+ fromConfig: boolean;
1325
1422
  };
1326
1423
  declare function formatAlignedRows(rows: Array<[string, string, boolean]>, indent?: string): string[];
1327
1424
  declare function formatBindings(env: Record<string, MergedBinding>, indent?: string, options?: {
1328
- showSourceMarker?: boolean;
1425
+ showSourceMarker?: boolean;
1329
1426
  }): string[];
1330
-
1427
+ //#endregion
1428
+ //#region src/preview/box.d.ts
1331
1429
  /**
1332
1430
  * Remove ANSI escape codes from a string.
1333
1431
  */
@@ -1342,8 +1440,8 @@ declare function visibleLength(str: string): number;
1342
1440
  */
1343
1441
  declare function padToVisibleWidth(str: string, width: number): string;
1344
1442
  type DrawBoxOptions = {
1345
- footerLines?: string[];
1346
- connectToChild?: boolean;
1443
+ footerLines?: string[];
1444
+ connectToChild?: boolean;
1347
1445
  };
1348
1446
  /**
1349
1447
  * Draw a standalone box around the provided lines.
@@ -1354,9 +1452,9 @@ type DrawBoxOptions = {
1354
1452
  */
1355
1453
  declare function drawBox(contentLines: string[], options?: DrawBoxOptions): string;
1356
1454
  type DrawConnectedChildBoxOptions = {
1357
- indent?: string;
1358
- footerLines?: string[];
1359
- connectorLineIndex?: number;
1455
+ indent?: string;
1456
+ footerLines?: string[];
1457
+ connectorLineIndex?: number;
1360
1458
  };
1361
1459
  /**
1362
1460
  * Draw a child box that visually connects to an upstream parent box.
@@ -1367,5 +1465,5 @@ type DrawConnectedChildBoxOptions = {
1367
1465
  * - `connectorLineIndex`: line index where the horizontal connector joins the box
1368
1466
  */
1369
1467
  declare function drawConnectedChildBox(contentLines: string[], options?: DrawConnectedChildBoxOptions): string;
1370
-
1371
- 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 };
1468
+ //#endregion
1469
+ export { ACTOR_BINDING_DEPENDS_ON_EXPORT_CODE, ApiDeployment, ApiVersion, AssetManifest, AssetUploadStats, AssetsUploadResult, Binding, BuiltDurableObjectContainerImage, BulkInputNullableResult, BulkInputResult, BundleSize, Consumer, ConsumerSettings, ContainerDeployConfig, ContainerlessConfig, CreatePreviewDeploymentRequestParams, CreatePreviewRequestParams, CustomDomain, CustomDomainChangeset, DeployHelpersContext, type DeployOptions, DeployProps, DeploymentResource, DurableObjectContainerApplication, EXPORTS_RECONCILIATION_ERROR_CODE, EnvBindings, INCONSISTENT_EXPORTS_ACROSS_VERSIONS_CODE, INVALID_INHERIT_BINDING_CODE, JsonLike, NO_ACTIVE_PREVIEW_URLS_MESSAGE, NoInputError, NonDirectoryAssetsDirError, NonExistentAssetsDirError, NonVersionedScriptSettings, PREVIEW_DOMAIN_PROVISIONING_NOTE, PackageDependency, Percentage, PostQueueBody, PostQueueResponse, PostTypedConsumerBody, PreparedContainerImages, PreviewArgs, PreviewAssetsOptions, PreviewBaseConfig, PreviewBaseConfigPatch, PreviewBuildOutput, PreviewBuildOutputRootConfig, PreviewDeleteArgs, PreviewDeploymentModule, PreviewOptions, PreviewRequestOptions, PreviewResource, PreviewResult, Producer, ProvisionBindingsResult, PullRequestMetadata, PurgeQueueBody, PurgeQueueResponse, QueueJurisdiction, QueueResponse, QueueSettings, RetrieveSourceMapFunction, RouteObject, ScriptReference, Settings, SharedDeployVersionsProps, TriggerDeployment, TriggerProps, TypedConsumerResponse, UpdatePreviewRequestParams, VersionCache, VersionId, 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, WorkerSubdomain, Workflow, WorkflowConflict, Zone, ZoneIdCache, addRequiredSecretsInheritBindings, addWorkersSitesBindings, applyServiceAndEnvironmentTags, assemblePreviewScriptSettings, assertPreviewBuildOutputRootConfig, buildAssetManifest, checkRemoteSecretsOverride, checkWorkflowConflicts, collectPackageDependencies, confirmLatestDeploymentOverwrite, createDeployment, createDurableObjectContainerApplication, createFileHasher, createPreview, createPreviewDeployment, createPreviewDeploymentForm, createPreviewParentWorker, createTruncatedAlias, createWorkerUploadForm, 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, fromMimeType, generatePreviewAlias, getAssetsOptions, 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, helpIfErrorIsSizeOrScriptStartup, initDeployHelpersContext, isExportsReconciliationErrorDetails, isJwtExpired, isModifiedDiffValue, isNonDestructive, isWorkerNotFoundError, listConsumers, listQueues, maybeRetrieveFileSourceMap, moduleTypeMimeType, 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, validateAssetsOptions, validateEventTriggerTargets, validateFileSecrets, validateImageLessContainerApplicationsForUpload, validateNodeCompatMode, validateRoutes, verifyWorkerMatchesCITag, versionsUpload, visibleLength, warnOnErrorUpdatingServiceAndEnvironmentTags, workerNotFoundErrorMessage };