@cloudflare/config 0.19.0 → 0.21.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,4 +1,4 @@
1
- import { $ as Settings, A as TextBinding, B as WorkerBinding, C as QueueBinding, D as SecretsStoreSecretBinding, E as SecretBinding, F as UnsafeBinding, G as ContainerDefinition, H as WorkflowBinding, I as VectorizeBinding, J as defineConfig, K as WorkerDefinition, L as VersionMetadataBinding, M as TypedKvBinding, N as TypedPipelineBinding, O as SendEmailBinding, P as TypedQueueBinding, Q as ContainerConfig, R as VpcNetworkBinding, S as PipelineBinding, St as exports, T as RateLimitBinding, U as bindings, V as WorkerLoaderBinding, W as ConfigContext, X as defineWorker, Y as defineContainer, Z as CloudflareConfig, _ as JsonBinding, _t as Exports, a as AnalyticsEngineDatasetBinding, at as ScheduledTrigger, b as MediaBinding, bt as WorkflowExport, c as BindingDevOptions, ct as InferDurableNamespaces, d as D1Binding, dt as UnwrapConfig, et as WorkerConfig, f as DispatchNamespaceBinding, ft as DurableObjectCreatedExport, g as ImagesBinding, gt as DurableObjectTransferredExport, h as HyperdriveBinding, ht as DurableObjectRenamedExport, i as AiSearchNamespaceBinding, it as QueueConsumerTrigger, j as TypedAiBinding, k as StreamBinding, l as Bindings, lt as InferEnv, m as FlagshipBinding, mt as DurableObjectExpectingTransferExport, n as AiBinding, nt as EmailTrigger, o as ArtifactsBinding, ot as Triggers, p as DurableObjectBinding, pt as DurableObjectDeletedExport, q as WorkerReference, r as AiSearchBinding, rt as FetchTrigger, s as AssetsBinding, st as triggers, t as AgentMemoryBinding, tt as ConnectTrigger, u as BrowserBinding, ut as InferMainModule, v as KvBinding, vt as WorkerEntrypointExport, w as R2Binding, x as MtlsCertificateBinding, xt as WorkflowExportOptions, y as LogfwdrBinding, yt as WorkerEntrypointExportOptions, z as VpcServiceBinding } from "./public-X5O6jFLp.mjs";
1
+ import { $ as Settings, A as TextBinding, B as WorkerBinding, C as QueueBinding, D as SecretsStoreSecretBinding, E as SecretBinding, F as UnsafeBinding, G as ContainerDefinition, H as WorkflowBinding, I as VectorizeBinding, J as defineConfig, K as WorkerDefinition, L as VersionMetadataBinding, M as TypedKvBinding, N as TypedPipelineBinding, O as SendEmailBinding, P as TypedQueueBinding, Q as ContainerConfig, R as VpcNetworkBinding, S as PipelineBinding, St as exports, T as RateLimitBinding, U as bindings, V as WorkerLoaderBinding, W as ConfigContext, X as defineWorker, Y as defineContainer, Z as CloudflareConfig, _ as JsonBinding, _t as Exports, a as AnalyticsEngineDatasetBinding, at as ScheduledTrigger, b as MediaBinding, bt as WorkflowExport, c as BindingDevOptions, ct as InferDurableNamespaces, d as D1Binding, dt as UnwrapConfig, et as WorkerConfig, f as DispatchNamespaceBinding, ft as DurableObjectCreatedExport, g as ImagesBinding, gt as DurableObjectTransferredExport, h as HyperdriveBinding, ht as DurableObjectRenamedExport, i as AiSearchNamespaceBinding, it as QueueConsumerTrigger, j as TypedAiBinding, k as StreamBinding, l as Bindings, lt as InferEnv, m as FlagshipBinding, mt as DurableObjectExpectingTransferExport, n as AiBinding, nt as EmailTrigger, o as ArtifactsBinding, ot as Triggers, p as DurableObjectBinding, pt as DurableObjectDeletedExport, q as WorkerReference, r as AiSearchBinding, rt as FetchTrigger, s as AssetsBinding, st as triggers, t as AgentMemoryBinding, tt as ConnectTrigger, u as BrowserBinding, ut as InferMainModule, v as KvBinding, vt as WorkerEntrypointExport, w as R2Binding, x as MtlsCertificateBinding, xt as WorkflowExportOptions, y as LogfwdrBinding, yt as WorkerEntrypointExportOptions, z as VpcServiceBinding } from "./public-u2AoxvhN.mjs";
2
2
  import * as z from "zod";
3
3
  import { RawConfig } from "@cloudflare/workers-utils";
4
4
 
@@ -32,6 +32,12 @@ declare const WorkerBindingSchema: z.ZodObject<{
32
32
  remote: z.ZodOptional<z.ZodBoolean>;
33
33
  }, z.core.$strict>>;
34
34
  }, z.core.$strict>;
35
+ declare const WorkflowBindingSchema: z.ZodObject<{
36
+ type: z.ZodLiteral<"workflow">;
37
+ name: z.ZodString;
38
+ worker: z.ZodString;
39
+ exportName: z.ZodString;
40
+ }, z.core.$strict>;
35
41
  declare const D1BindingSchema: z.ZodObject<{
36
42
  type: z.ZodLiteral<"d1">;
37
43
  name: z.ZodOptional<z.ZodString>;
@@ -299,6 +305,11 @@ declare const KnownBindingSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
299
305
  }, z.core.$strict>>;
300
306
  }, z.core.$strict>, z.ZodObject<{
301
307
  type: z.ZodLiteral<"worker-loader">;
308
+ }, z.core.$strict>, z.ZodObject<{
309
+ type: z.ZodLiteral<"workflow">;
310
+ name: z.ZodString;
311
+ worker: z.ZodString;
312
+ exportName: z.ZodString;
302
313
  }, z.core.$strict>], "type">;
303
314
  declare const UnsafeBindingSchema: z.ZodObject<{
304
315
  type: z.ZodTemplateLiteral<`unsafe:${string}`>;
@@ -323,6 +334,14 @@ declare function validateSingletonBindings(env: Record<string, {
323
334
  declare const InputContainerSchema: z.ZodUnion<readonly [z.ZodObject<{
324
335
  name: z.ZodString;
325
336
  unsafe: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
337
+ ssh: z.ZodOptional<z.ZodObject<{
338
+ enabled: z.ZodBoolean;
339
+ port: z.ZodOptional<z.ZodNumber>;
340
+ }, z.core.$strict>>;
341
+ authorizedKeys: z.ZodOptional<z.ZodArray<z.ZodObject<{
342
+ name: z.ZodString;
343
+ publicKey: z.ZodString;
344
+ }, z.core.$strict>>>;
326
345
  observability: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
327
346
  enabled: z.ZodOptional<z.ZodBoolean>;
328
347
  logs: z.ZodOptional<z.ZodObject<{
@@ -353,14 +372,6 @@ declare const InputContainerSchema: z.ZodUnion<readonly [z.ZodObject<{
353
372
  default: "default";
354
373
  regional: "regional";
355
374
  }>>;
356
- ssh: z.ZodOptional<z.ZodObject<{
357
- enabled: z.ZodBoolean;
358
- port: z.ZodOptional<z.ZodNumber>;
359
- }, z.core.$strict>>;
360
- authorizedKeys: z.ZodOptional<z.ZodArray<z.ZodObject<{
361
- name: z.ZodString;
362
- publicKey: z.ZodString;
363
- }, z.core.$strict>>>;
364
375
  constraints: z.ZodOptional<z.ZodObject<{
365
376
  regions: z.ZodOptional<z.ZodArray<z.ZodEnum<{
366
377
  ENAM: "ENAM";
@@ -397,6 +408,14 @@ declare const InputContainerSchema: z.ZodUnion<readonly [z.ZodObject<{
397
408
  }, z.core.$strict>, z.ZodObject<{
398
409
  name: z.ZodString;
399
410
  unsafe: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
411
+ ssh: z.ZodOptional<z.ZodObject<{
412
+ enabled: z.ZodBoolean;
413
+ port: z.ZodOptional<z.ZodNumber>;
414
+ }, z.core.$strict>>;
415
+ authorizedKeys: z.ZodOptional<z.ZodArray<z.ZodObject<{
416
+ name: z.ZodString;
417
+ publicKey: z.ZodString;
418
+ }, z.core.$strict>>>;
400
419
  schedulingPolicy: z.ZodLiteral<"durable-object">;
401
420
  observability: z.ZodOptional<z.ZodObject<{
402
421
  enabled: z.ZodOptional<z.ZodBoolean>;
@@ -420,6 +439,14 @@ type ParsedInputContainerConfig = z.output<typeof InputContainerSchema>;
420
439
  declare const OutputContainerSchema: z.ZodUnion<readonly [z.ZodObject<{
421
440
  name: z.ZodString;
422
441
  unsafe: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
442
+ ssh: z.ZodOptional<z.ZodObject<{
443
+ enabled: z.ZodBoolean;
444
+ port: z.ZodOptional<z.ZodNumber>;
445
+ }, z.core.$strict>>;
446
+ authorizedKeys: z.ZodOptional<z.ZodArray<z.ZodObject<{
447
+ name: z.ZodString;
448
+ publicKey: z.ZodString;
449
+ }, z.core.$strict>>>;
423
450
  observability: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
424
451
  enabled: z.ZodOptional<z.ZodBoolean>;
425
452
  logs: z.ZodOptional<z.ZodObject<{
@@ -450,14 +477,6 @@ declare const OutputContainerSchema: z.ZodUnion<readonly [z.ZodObject<{
450
477
  default: "default";
451
478
  regional: "regional";
452
479
  }>>;
453
- ssh: z.ZodOptional<z.ZodObject<{
454
- enabled: z.ZodBoolean;
455
- port: z.ZodOptional<z.ZodNumber>;
456
- }, z.core.$strict>>;
457
- authorizedKeys: z.ZodOptional<z.ZodArray<z.ZodObject<{
458
- name: z.ZodString;
459
- publicKey: z.ZodString;
460
- }, z.core.$strict>>>;
461
480
  constraints: z.ZodOptional<z.ZodObject<{
462
481
  regions: z.ZodOptional<z.ZodArray<z.ZodEnum<{
463
482
  ENAM: "ENAM";
@@ -492,6 +511,14 @@ declare const OutputContainerSchema: z.ZodUnion<readonly [z.ZodObject<{
492
511
  }, z.core.$strict>, z.ZodObject<{
493
512
  name: z.ZodString;
494
513
  unsafe: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
514
+ ssh: z.ZodOptional<z.ZodObject<{
515
+ enabled: z.ZodBoolean;
516
+ port: z.ZodOptional<z.ZodNumber>;
517
+ }, z.core.$strict>>;
518
+ authorizedKeys: z.ZodOptional<z.ZodArray<z.ZodObject<{
519
+ name: z.ZodString;
520
+ publicKey: z.ZodString;
521
+ }, z.core.$strict>>>;
495
522
  schedulingPolicy: z.ZodLiteral<"durable-object">;
496
523
  observability: z.ZodOptional<z.ZodObject<{
497
524
  enabled: z.ZodOptional<z.ZodBoolean>;
@@ -981,6 +1008,14 @@ declare const InputConfigSchema: z.ZodObject<{
981
1008
  containers: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
982
1009
  name: z.ZodString;
983
1010
  unsafe: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1011
+ ssh: z.ZodOptional<z.ZodObject<{
1012
+ enabled: z.ZodBoolean;
1013
+ port: z.ZodOptional<z.ZodNumber>;
1014
+ }, z.core.$strict>>;
1015
+ authorizedKeys: z.ZodOptional<z.ZodArray<z.ZodObject<{
1016
+ name: z.ZodString;
1017
+ publicKey: z.ZodString;
1018
+ }, z.core.$strict>>>;
984
1019
  observability: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
985
1020
  enabled: z.ZodOptional<z.ZodBoolean>;
986
1021
  logs: z.ZodOptional<z.ZodObject<{
@@ -1011,14 +1046,6 @@ declare const InputConfigSchema: z.ZodObject<{
1011
1046
  default: "default";
1012
1047
  regional: "regional";
1013
1048
  }>>;
1014
- ssh: z.ZodOptional<z.ZodObject<{
1015
- enabled: z.ZodBoolean;
1016
- port: z.ZodOptional<z.ZodNumber>;
1017
- }, z.core.$strict>>;
1018
- authorizedKeys: z.ZodOptional<z.ZodArray<z.ZodObject<{
1019
- name: z.ZodString;
1020
- publicKey: z.ZodString;
1021
- }, z.core.$strict>>>;
1022
1049
  constraints: z.ZodOptional<z.ZodObject<{
1023
1050
  regions: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1024
1051
  ENAM: "ENAM";
@@ -1055,6 +1082,14 @@ declare const InputConfigSchema: z.ZodObject<{
1055
1082
  }, z.core.$strict>, z.ZodObject<{
1056
1083
  name: z.ZodString;
1057
1084
  unsafe: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1085
+ ssh: z.ZodOptional<z.ZodObject<{
1086
+ enabled: z.ZodBoolean;
1087
+ port: z.ZodOptional<z.ZodNumber>;
1088
+ }, z.core.$strict>>;
1089
+ authorizedKeys: z.ZodOptional<z.ZodArray<z.ZodObject<{
1090
+ name: z.ZodString;
1091
+ publicKey: z.ZodString;
1092
+ }, z.core.$strict>>>;
1058
1093
  schedulingPolicy: z.ZodLiteral<"durable-object">;
1059
1094
  observability: z.ZodOptional<z.ZodObject<{
1060
1095
  enabled: z.ZodOptional<z.ZodBoolean>;
@@ -1311,10 +1346,8 @@ interface GenerateTypesOptions {
1311
1346
  * Package name used in the inline `import("<packageName>")` type expressions
1312
1347
  * for `InferEnv`/`InferDurableNamespaces`/`InferMainModule`/`UnwrapConfig`.
1313
1348
  *
1314
- * Defaults to `"@cloudflare/config"`. Integrations that bundle
1315
- * `@cloudflare/config` (e.g. `@cloudflare/vite-plugin`) should pass their
1316
- * own re-export path here so users don't need to depend on
1317
- * `@cloudflare/config` directly.
1349
+ * Defaults to `"@cloudflare/config"`. Integrations should pass the public
1350
+ * `cf/config` package used to author `cloudflare.config.ts` files.
1318
1351
  */
1319
1352
  packageName?: string;
1320
1353
  }
@@ -1425,4 +1458,4 @@ declare function loadAndParseConfig(configPath: string, ctx: ConfigContext): Pro
1425
1458
  /** Load and parse only account settings from the default export. */
1426
1459
  declare function loadAndParseConfigSettings(configPath: string, ctx: ConfigContext): Promise<LoadAndParseConfigSettingsResult>;
1427
1460
  //#endregion
1428
- export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, AnalyticsEngineDatasetBindingSchema, ArtifactsBinding, AssetsBinding, AssetsSchema, BindingDevOptions, BindingSchema, Bindings, BrowserBinding, BrowserBindingSchema, CloudflareConfig, ConfigContext, type ConfigParseResult, type ConfigSettingsParseResult, ConnectTrigger, ContainerConfig, ContainerDefinition, D1Binding, D1BindingSchema, DispatchNamespaceBinding, DurableObjectBinding, DurableObjectCreatedExport, DurableObjectCreatedExportSchema, DurableObjectDeletedExport, DurableObjectDeletedExportSchema, DurableObjectExpectingTransferExport, DurableObjectExpectingTransferExportSchema, DurableObjectRenamedExport, DurableObjectRenamedExportSchema, DurableObjectTransferredExport, DurableObjectTransferredExportSchema, EmailTrigger, ExportSchema, Exports, FetchTrigger, FlagshipBinding, FlagshipBindingSchema, HyperdriveBinding, HyperdriveBindingSchema, ImagesBinding, InferDurableNamespaces, InferEnv, InferMainModule, InputConfigSchema, InputContainerSchema, InputSettingsSchema, type InputWorkerConfig, InputWorkerSchema, JsonBinding, KVBindingSchema, KnownBindingSchema, KvBinding, type LoadAndParseConfigResult, type LoadAndParseConfigSettingsResult, type LoadConfigResult, LogfwdrBinding, MediaBinding, type ModuleType, ModuleTypeSchema, MtlsCertificateBinding, OutputContainerSchema, OutputRootConfigSchema, OutputWorkerSchema, type ParsedInputConfig, type ParsedInputContainerConfig, type ParsedInputSettingsConfig, type ParsedInputWorkerConfig, type ParsedOutputContainerConfig, type ParsedOutputRootConfig, type ParsedOutputWorkerConfig, PipelineBinding, QueueBinding, QueueBindingSchema, QueueConsumerTrigger, R2Binding, R2BindingSchema, RateLimitBinding, ScheduledTrigger, SecretBinding, SecretsStoreSecretBinding, SendEmailBinding, Settings, StreamBinding, TailConsumerSchema, TextBinding, Triggers, TypedAiBinding, TypedKvBinding, TypedPipelineBinding, TypedQueueBinding, UnsafeBinding, UnsafeBindingSchema, UnwrapConfig, VectorizeBinding, VersionMetadataBinding, VpcNetworkBinding, VpcServiceBinding, WorkerBinding, WorkerBindingSchema, WorkerConfig, WorkerDefinition, WorkerEntrypointExport, WorkerEntrypointExportOptions, WorkerEntrypointExportSchema, WorkerLoaderBinding, WorkerReference, WorkflowBinding, WorkflowExport, WorkflowExportOptions, WorkflowExportSchema, bindings, convertToWranglerConfig, defineConfig, defineContainer, defineWorker, exports, generateTypes, loadAndParseConfig, loadAndParseConfigSettings, loadConfig, registerConfigHooks, resolveAndParseConfig, resolveAndParseConfigSettings, triggers, validateSingletonBindings };
1461
+ export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, AnalyticsEngineDatasetBindingSchema, ArtifactsBinding, AssetsBinding, AssetsSchema, BindingDevOptions, BindingSchema, Bindings, BrowserBinding, BrowserBindingSchema, CloudflareConfig, ConfigContext, type ConfigParseResult, type ConfigSettingsParseResult, ConnectTrigger, ContainerConfig, ContainerDefinition, D1Binding, D1BindingSchema, DispatchNamespaceBinding, DurableObjectBinding, DurableObjectCreatedExport, DurableObjectCreatedExportSchema, DurableObjectDeletedExport, DurableObjectDeletedExportSchema, DurableObjectExpectingTransferExport, DurableObjectExpectingTransferExportSchema, DurableObjectRenamedExport, DurableObjectRenamedExportSchema, DurableObjectTransferredExport, DurableObjectTransferredExportSchema, EmailTrigger, ExportSchema, Exports, FetchTrigger, FlagshipBinding, FlagshipBindingSchema, HyperdriveBinding, HyperdriveBindingSchema, ImagesBinding, InferDurableNamespaces, InferEnv, InferMainModule, InputConfigSchema, InputContainerSchema, InputSettingsSchema, type InputWorkerConfig, InputWorkerSchema, JsonBinding, KVBindingSchema, KnownBindingSchema, KvBinding, type LoadAndParseConfigResult, type LoadAndParseConfigSettingsResult, type LoadConfigResult, LogfwdrBinding, MediaBinding, type ModuleType, ModuleTypeSchema, MtlsCertificateBinding, OutputContainerSchema, OutputRootConfigSchema, OutputWorkerSchema, type ParsedInputConfig, type ParsedInputContainerConfig, type ParsedInputSettingsConfig, type ParsedInputWorkerConfig, type ParsedOutputContainerConfig, type ParsedOutputRootConfig, type ParsedOutputWorkerConfig, PipelineBinding, QueueBinding, QueueBindingSchema, QueueConsumerTrigger, R2Binding, R2BindingSchema, RateLimitBinding, ScheduledTrigger, SecretBinding, SecretsStoreSecretBinding, SendEmailBinding, Settings, StreamBinding, TailConsumerSchema, TextBinding, Triggers, TypedAiBinding, TypedKvBinding, TypedPipelineBinding, TypedQueueBinding, UnsafeBinding, UnsafeBindingSchema, UnwrapConfig, VectorizeBinding, VersionMetadataBinding, VpcNetworkBinding, VpcServiceBinding, WorkerBinding, WorkerBindingSchema, WorkerConfig, WorkerDefinition, WorkerEntrypointExport, WorkerEntrypointExportOptions, WorkerEntrypointExportSchema, WorkerLoaderBinding, WorkerReference, WorkflowBinding, WorkflowBindingSchema, WorkflowExport, WorkflowExportOptions, WorkflowExportSchema, bindings, convertToWranglerConfig, defineConfig, defineContainer, defineWorker, exports, generateTypes, loadAndParseConfig, loadAndParseConfigSettings, loadConfig, registerConfigHooks, resolveAndParseConfig, resolveAndParseConfigSettings, triggers, validateSingletonBindings };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as triggers, i as exports$1, n as defineContainer, o as bindings, r as defineWorker, t as defineConfig } from "./public-CvUXcSEm.mjs";
1
+ import { a as triggers, i as exports$1, n as defineContainer, o as bindings, r as defineWorker, t as defineConfig } from "./public-srUjWEOA.mjs";
2
2
  import * as nodeModule from "node:module";
3
3
  import { createRequire } from "node:module";
4
4
  import * as z from "zod";
@@ -39,6 +39,12 @@ const WorkerBindingSchema = z.strictObject({
39
39
  props: z.record(z.string(), z.unknown()).optional(),
40
40
  dev: RemoteBindingDevSchema.optional()
41
41
  });
42
+ const WorkflowBindingSchema = z.strictObject({
43
+ type: z.literal("workflow"),
44
+ name: z.string(),
45
+ worker: z.string(),
46
+ exportName: z.string()
47
+ });
42
48
  const D1BindingSchema = z.strictObject({
43
49
  type: z.literal("d1"),
44
50
  name: z.string().optional(),
@@ -203,7 +209,8 @@ const KnownBindingSchema = z.discriminatedUnion("type", [
203
209
  return value.tunnelId !== void 0 && value.networkId !== void 0 ? `"vpc-network" bindings must specify exactly one of "tunnelId" or "networkId", not both` : `"vpc-network" bindings must specify either "tunnelId" or "networkId"`;
204
210
  } }),
205
211
  WorkerBindingSchema,
206
- z.strictObject({ type: z.literal("worker-loader") })
212
+ z.strictObject({ type: z.literal("worker-loader") }),
213
+ WorkflowBindingSchema
207
214
  ]);
208
215
  const UnsafeBindingSchema = z.looseObject({
209
216
  type: z.templateLiteral(["unsafe:", z.string().min(1)]),
@@ -326,7 +333,15 @@ const ContainerObservabilityBaseSchema = z.strictObject({
326
333
  const StandardContainerObservabilitySchema = z.union([ContainerObservabilityBaseSchema.extend({ targetInstancePercentage: z.number().min(0).max(100).optional() }), ContainerObservabilityBaseSchema.extend({ targetInstanceCount: z.number().int().nonnegative().optional() })]);
327
334
  const BaseContainerSchema = z.strictObject({
328
335
  name: z.string().min(1),
329
- unsafe: z.record(z.string(), z.unknown()).optional()
336
+ unsafe: z.record(z.string(), z.unknown()).optional(),
337
+ ssh: z.strictObject({
338
+ enabled: z.boolean(),
339
+ port: z.number().int().min(1).max(65535).optional()
340
+ }).optional(),
341
+ authorizedKeys: z.array(z.strictObject({
342
+ name: z.string(),
343
+ publicKey: z.string()
344
+ })).optional()
330
345
  });
331
346
  const StandardContainerBaseSchema = BaseContainerSchema.extend({
332
347
  observability: StandardContainerObservabilitySchema.optional(),
@@ -344,14 +359,6 @@ const StandardContainerBaseSchema = BaseContainerSchema.extend({
344
359
  diskMb: z.number().nonnegative().optional()
345
360
  })]).optional(),
346
361
  schedulingPolicy: z.enum(["default", "regional"]).optional(),
347
- ssh: z.strictObject({
348
- enabled: z.boolean(),
349
- port: z.number().int().min(1).max(65535).optional()
350
- }).optional(),
351
- authorizedKeys: z.array(z.strictObject({
352
- name: z.string(),
353
- publicKey: z.string()
354
- })).optional(),
355
362
  constraints: z.strictObject({
356
363
  regions: z.array(z.enum([
357
364
  "ENAM",
@@ -818,6 +825,11 @@ function convertContainer(container) {
818
825
  const converted = { name: container.name };
819
826
  if (container.observability !== void 0) converted.observability = convertContainerObservability(container.observability);
820
827
  if (container.unsafe !== void 0) converted.unsafe = container.unsafe;
828
+ if (container.ssh !== void 0) converted.ssh = container.ssh;
829
+ if (container.authorizedKeys !== void 0) converted.authorized_keys = container.authorizedKeys.map(({ name, publicKey }) => ({
830
+ name,
831
+ public_key: publicKey
832
+ }));
821
833
  if (container.schedulingPolicy === "durable-object") {
822
834
  converted.scheduling_policy = "durable_object";
823
835
  if (container.images !== void 0) converted.images = Object.fromEntries(Object.entries(container.images).map(([name, image]) => [name, convertDurableObjectContainerImage(image)]));
@@ -838,11 +850,6 @@ function convertContainer(container) {
838
850
  converted.instance_type = instanceType;
839
851
  }
840
852
  if (container.schedulingPolicy !== void 0) converted.scheduling_policy = container.schedulingPolicy;
841
- if (container.ssh !== void 0) converted.ssh = container.ssh;
842
- if (container.authorizedKeys !== void 0) converted.authorized_keys = container.authorizedKeys.map(({ name, publicKey }) => ({
843
- name,
844
- public_key: publicKey
845
- }));
846
853
  if (container.constraints !== void 0) converted.constraints = container.constraints;
847
854
  if (container.rollout !== void 0) {
848
855
  if (container.rollout.kind !== void 0) converted.rollout_kind = ROLLOUT_KIND_MAP[container.rollout.kind];
@@ -1206,6 +1213,14 @@ function convertBindingsAndAssets(config, result) {
1206
1213
  case "worker-loader":
1207
1214
  workerLoaders.push({ binding: name });
1208
1215
  break;
1216
+ case "workflow":
1217
+ workflows.push({
1218
+ binding: name,
1219
+ name: binding.name,
1220
+ class_name: binding.exportName,
1221
+ script_name: binding.worker
1222
+ });
1223
+ break;
1209
1224
  }
1210
1225
  }
1211
1226
  if (kvNamespaces.length) result.kv_namespaces = kvNamespaces;
@@ -1737,4 +1752,4 @@ async function loadAndParseConfigSettings(configPath, ctx) {
1737
1752
  }
1738
1753
 
1739
1754
  //#endregion
1740
- export { AnalyticsEngineDatasetBindingSchema, AssetsSchema, BindingSchema, BrowserBindingSchema, D1BindingSchema, DurableObjectCreatedExportSchema, DurableObjectDeletedExportSchema, DurableObjectExpectingTransferExportSchema, DurableObjectRenamedExportSchema, DurableObjectTransferredExportSchema, ExportSchema, FlagshipBindingSchema, HyperdriveBindingSchema, InputConfigSchema, InputContainerSchema, InputSettingsSchema, InputWorkerSchema, KVBindingSchema, KnownBindingSchema, ModuleTypeSchema, OutputContainerSchema, OutputRootConfigSchema, OutputWorkerSchema, QueueBindingSchema, R2BindingSchema, TailConsumerSchema, UnsafeBindingSchema, WorkerBindingSchema, WorkerEntrypointExportSchema, WorkflowExportSchema, bindings, convertToWranglerConfig, defineConfig, defineContainer, defineWorker, exports$1 as exports, generateTypes, loadAndParseConfig, loadAndParseConfigSettings, loadConfig, registerConfigHooks, resolveAndParseConfig, resolveAndParseConfigSettings, triggers, validateSingletonBindings };
1755
+ export { AnalyticsEngineDatasetBindingSchema, AssetsSchema, BindingSchema, BrowserBindingSchema, D1BindingSchema, DurableObjectCreatedExportSchema, DurableObjectDeletedExportSchema, DurableObjectExpectingTransferExportSchema, DurableObjectRenamedExportSchema, DurableObjectTransferredExportSchema, ExportSchema, FlagshipBindingSchema, HyperdriveBindingSchema, InputConfigSchema, InputContainerSchema, InputSettingsSchema, InputWorkerSchema, KVBindingSchema, KnownBindingSchema, ModuleTypeSchema, OutputContainerSchema, OutputRootConfigSchema, OutputWorkerSchema, QueueBindingSchema, R2BindingSchema, TailConsumerSchema, UnsafeBindingSchema, WorkerBindingSchema, WorkerEntrypointExportSchema, WorkflowBindingSchema, WorkflowExportSchema, bindings, convertToWranglerConfig, defineConfig, defineContainer, defineWorker, exports$1 as exports, generateTypes, loadAndParseConfig, loadAndParseConfigSettings, loadConfig, registerConfigHooks, resolveAndParseConfig, resolveAndParseConfigSettings, triggers, validateSingletonBindings };
@@ -123,7 +123,11 @@ const bindings = {
123
123
  type: "worker",
124
124
  ...options
125
125
  }),
126
- workerLoader: () => ({ type: "worker-loader" })
126
+ workerLoader: () => ({ type: "worker-loader" }),
127
+ workflow: (options) => ({
128
+ type: "workflow",
129
+ ...options
130
+ })
127
131
  };
128
132
 
129
133
  //#endregion
@@ -610,7 +610,7 @@ interface CloudflareConfig extends Settings {
610
610
  /**
611
611
  * Union of all binding definitions accepted in `env`.
612
612
  */
613
- type Binding = AgentMemoryBinding | AiBinding | AiSearchBinding | AiSearchNamespaceBinding | AnalyticsEngineDatasetBinding | ArtifactsBinding | AssetsBinding | BrowserBinding | D1Binding | DispatchNamespaceBinding | DurableObjectBinding | FlagshipBinding | HyperdriveBinding | ImagesBinding$1 | JsonBinding | KvBinding | LogfwdrBinding | MediaBinding$1 | MtlsCertificateBinding | PipelineBinding | QueueBinding | R2Binding | RateLimitBinding | SecretBinding | SecretsStoreSecretBinding | SendEmailBinding | StreamBinding$1 | TextBinding | UnsafeBinding | VectorizeBinding | VersionMetadataBinding | VpcNetworkBinding | VpcServiceBinding | WorkerBinding | WorkerLoaderBinding;
613
+ type Binding = AgentMemoryBinding | AiBinding | AiSearchBinding | AiSearchNamespaceBinding | AnalyticsEngineDatasetBinding | ArtifactsBinding | AssetsBinding | BrowserBinding | D1Binding | DispatchNamespaceBinding | DurableObjectBinding | FlagshipBinding | HyperdriveBinding | ImagesBinding$1 | JsonBinding | KvBinding | LogfwdrBinding | MediaBinding$1 | MtlsCertificateBinding | PipelineBinding | QueueBinding | R2Binding | RateLimitBinding | SecretBinding | SecretsStoreSecretBinding | SendEmailBinding | StreamBinding$1 | TextBinding | UnsafeBinding | VectorizeBinding | VersionMetadataBinding | VpcNetworkBinding | VpcServiceBinding | WorkerBinding | WorkerLoaderBinding | WorkflowBinding;
614
614
  /**
615
615
  * Union of all trigger definitions accepted in `triggers`.
616
616
  */
@@ -677,6 +677,26 @@ interface BaseContainerConfig {
677
677
  * @hidden
678
678
  */
679
679
  unsafe?: Record<string, unknown>;
680
+ ssh?: {
681
+ /**
682
+ * If enabled, users with write access to the Container application can
683
+ * connect to it over SSH.
684
+ *
685
+ * @default true
686
+ */
687
+ enabled: boolean;
688
+ /**
689
+ * Port that the SSH service is running on.
690
+ *
691
+ * @default 22
692
+ */
693
+ port?: number;
694
+ };
695
+ /** SSH public keys to put in the Container's authorized_keys file. */
696
+ authorizedKeys?: Array<{
697
+ name: string;
698
+ publicKey: string;
699
+ }>;
680
700
  }
681
701
  /** A Container application managed with a standard scheduling policy. */
682
702
  interface StandardContainerConfig extends BaseContainerConfig {
@@ -720,26 +740,6 @@ interface StandardContainerConfig extends BaseContainerConfig {
720
740
  * @default "default"
721
741
  */
722
742
  schedulingPolicy?: "default" | "regional";
723
- ssh?: {
724
- /**
725
- * If enabled, users with write access to the Container application can
726
- * connect to it over SSH.
727
- *
728
- * @default false
729
- */
730
- enabled: boolean;
731
- /**
732
- * Port that the SSH service is running on.
733
- *
734
- * @default 22
735
- */
736
- port?: number;
737
- };
738
- /** SSH public keys to put in the Container's authorized_keys file. */
739
- authorizedKeys?: Array<{
740
- name: string;
741
- publicKey: string;
742
- }>;
743
743
  /** Scheduling constraints for Container placement. */
744
744
  constraints?: {
745
745
  /** Limit Container placement to specific geographic regions. */
@@ -1086,6 +1086,11 @@ interface ConfigContext {
1086
1086
  * another context before they are used.
1087
1087
  */
1088
1088
  type ConfigInput<T$1> = T$1 | Promise<T$1> | ((ctx: ConfigContext) => T$1 | Promise<T$1>);
1089
+ /** Recursively apply declared config properties without expanding open records. */
1090
+ type ContextualProperties<TInput extends object, TConfig> = TInput extends readonly unknown[] ? TConfig extends readonly (infer TElement)[] ? { [K in keyof TInput]: ContextualConfig<TInput[K], TElement> } : TConfig : string extends keyof TConfig ? TConfig : { [K in keyof TConfig]: K extends keyof TInput ? ContextualConfig<TInput[K], TConfig[K]> : TConfig[K] };
1091
+ type ContextualConfig<TInput, TConfig> = TInput extends Promise<infer TValue> ? Promise<ContextualConfig<TValue, TConfig>> : TInput extends ((ctx: ConfigContext) => infer TResult) ? (ctx: ConfigContext) => ContextualConfig<TResult, TConfig> : TConfig extends unknown ? TInput extends TConfig ? TInput & (TInput extends object ? ContextualProperties<TInput, TConfig> : TConfig) : never : never;
1092
+ /** Create a type-safe identity helper for a configuration value or factory. */
1093
+
1089
1094
  type ContainerDefinition<T$1 extends ContainerConfig = ContainerConfig> = ConfigInput<T$1>;
1090
1095
  type WorkerDefinition<T$1 extends WorkerConfig = WorkerConfig> = ConfigInput<T$1>;
1091
1096
  /** A Worker name, value, promise, or context-aware factory. */
@@ -1105,7 +1110,7 @@ type WorkerReference = string | WorkerDefinition;
1105
1110
  * });
1106
1111
  * ```
1107
1112
  */
1108
- declare const defineConfig: <const TInput extends ConfigInput<CloudflareConfig>>(config: TInput) => TInput;
1113
+ declare const defineConfig: <const TInput extends ConfigInput<CloudflareConfig>>(config: TInput & ContextualConfig<TInput, CloudflareConfig>) => TInput;
1109
1114
  /**
1110
1115
  * Define a Container.
1111
1116
  *
@@ -1119,7 +1124,7 @@ declare const defineConfig: <const TInput extends ConfigInput<CloudflareConfig>>
1119
1124
  * });
1120
1125
  * ```
1121
1126
  */
1122
- declare const defineContainer: <const TInput extends ConfigInput<ContainerConfig>>(config: TInput) => TInput;
1127
+ declare const defineContainer: <const TInput extends ConfigInput<ContainerConfig>>(config: TInput & ContextualConfig<TInput, ContainerConfig>) => TInput;
1123
1128
  /**
1124
1129
  * Define a Worker.
1125
1130
  *
@@ -1133,7 +1138,7 @@ declare const defineContainer: <const TInput extends ConfigInput<ContainerConfig
1133
1138
  * });
1134
1139
  * ```
1135
1140
  */
1136
- declare const defineWorker: <const TInput extends ConfigInput<WorkerConfig>>(config: TInput) => TInput;
1141
+ declare const defineWorker: <const TInput extends ConfigInput<WorkerConfig>>(config: TInput & ContextualConfig<TInput, WorkerConfig>) => TInput;
1137
1142
  //#endregion
1138
1143
  //#region src/utils.d.ts
1139
1144
  /**
@@ -1647,15 +1652,17 @@ interface WorkerLoaderBinding {
1647
1652
  type: "worker-loader";
1648
1653
  }
1649
1654
  interface WorkflowBindingOptions<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends WorkflowExportName<TWorker$1> = WorkflowExportName<TWorker$1>> {
1655
+ /** The name of the Workflow. */
1656
+ name: string;
1650
1657
  /** The name or config of the Worker that defines the Workflow. */
1651
1658
  worker: TWorker$1;
1652
1659
  /** The exported class name of the Workflow. */
1653
1660
  exportName: TExportName$1;
1654
1661
  }
1655
1662
  /**
1656
- * Binding to a Workflow. `worker` is the name or config of the Worker that
1657
- * defines the Workflow; `exportName` is the exported `WorkflowEntrypoint`
1658
- * class name.
1663
+ * Binding to a Workflow. `name` identifies the Workflow, `worker` is the name
1664
+ * or config of the Worker that defines it, and `exportName` is the exported
1665
+ * `WorkflowEntrypoint` class name.
1659
1666
  */
1660
1667
  interface WorkflowBinding<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends WorkflowExportName<TWorker$1> = WorkflowExportName<TWorker$1>> extends WorkflowBindingOptions<TWorker$1, TExportName$1> {
1661
1668
  type: "workflow";
@@ -1825,6 +1832,12 @@ interface Bindings {
1825
1832
  worker<TWorker$1 extends WorkerReference, TExportName$1 extends WorkerEntrypointExportName<TWorker$1> | undefined = undefined>(options: WorkerBindingOptions<TWorker$1, TExportName$1>): WorkerBinding<TWorker$1, NoInfer<TExportName$1>>;
1826
1833
  /** Binding to a Worker Loader. */
1827
1834
  workerLoader(): WorkerLoaderBinding;
1835
+ /**
1836
+ * Create a Workflow binding.
1837
+ * `worker` may be a Worker config reference or a Worker name.
1838
+ * `exportName` must be a valid `WorkflowEntrypoint` export for the given Worker.
1839
+ */
1840
+ workflow<TWorker$1 extends WorkerReference, TExportName$1 extends WorkflowExportName<TWorker$1>>(options: WorkflowBindingOptions<TWorker$1, TExportName$1>): WorkflowBinding<TWorker$1, NoInfer<TExportName$1>>;
1828
1841
  }
1829
1842
  declare const bindings: Bindings;
1830
1843
  //#endregion
package/dist/public.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as Settings, A as TextBinding, B as WorkerBinding, C as QueueBinding, D as SecretsStoreSecretBinding, E as SecretBinding, F as UnsafeBinding, G as ContainerDefinition, H as WorkflowBinding, I as VectorizeBinding, J as defineConfig, K as WorkerDefinition, L as VersionMetadataBinding, M as TypedKvBinding, N as TypedPipelineBinding, O as SendEmailBinding, P as TypedQueueBinding, Q as ContainerConfig, R as VpcNetworkBinding, S as PipelineBinding, St as exports, T as RateLimitBinding, U as bindings, V as WorkerLoaderBinding, W as ConfigContext, X as defineWorker, Y as defineContainer, Z as CloudflareConfig, _ as JsonBinding, _t as Exports, a as AnalyticsEngineDatasetBinding, at as ScheduledTrigger, b as MediaBinding, bt as WorkflowExport, c as BindingDevOptions, ct as InferDurableNamespaces, d as D1Binding, dt as UnwrapConfig, et as WorkerConfig, f as DispatchNamespaceBinding, ft as DurableObjectCreatedExport, g as ImagesBinding, gt as DurableObjectTransferredExport, h as HyperdriveBinding, ht as DurableObjectRenamedExport, i as AiSearchNamespaceBinding, it as QueueConsumerTrigger, j as TypedAiBinding, k as StreamBinding, l as Bindings, lt as InferEnv, m as FlagshipBinding, mt as DurableObjectExpectingTransferExport, n as AiBinding, nt as EmailTrigger, o as ArtifactsBinding, ot as Triggers, p as DurableObjectBinding, pt as DurableObjectDeletedExport, q as WorkerReference, r as AiSearchBinding, rt as FetchTrigger, s as AssetsBinding, st as triggers, t as AgentMemoryBinding, tt as ConnectTrigger, u as BrowserBinding, ut as InferMainModule, v as KvBinding, vt as WorkerEntrypointExport, w as R2Binding, x as MtlsCertificateBinding, xt as WorkflowExportOptions, y as LogfwdrBinding, yt as WorkerEntrypointExportOptions, z as VpcServiceBinding } from "./public-X5O6jFLp.mjs";
1
+ import { $ as Settings, A as TextBinding, B as WorkerBinding, C as QueueBinding, D as SecretsStoreSecretBinding, E as SecretBinding, F as UnsafeBinding, G as ContainerDefinition, H as WorkflowBinding, I as VectorizeBinding, J as defineConfig, K as WorkerDefinition, L as VersionMetadataBinding, M as TypedKvBinding, N as TypedPipelineBinding, O as SendEmailBinding, P as TypedQueueBinding, Q as ContainerConfig, R as VpcNetworkBinding, S as PipelineBinding, St as exports, T as RateLimitBinding, U as bindings, V as WorkerLoaderBinding, W as ConfigContext, X as defineWorker, Y as defineContainer, Z as CloudflareConfig, _ as JsonBinding, _t as Exports, a as AnalyticsEngineDatasetBinding, at as ScheduledTrigger, b as MediaBinding, bt as WorkflowExport, c as BindingDevOptions, ct as InferDurableNamespaces, d as D1Binding, dt as UnwrapConfig, et as WorkerConfig, f as DispatchNamespaceBinding, ft as DurableObjectCreatedExport, g as ImagesBinding, gt as DurableObjectTransferredExport, h as HyperdriveBinding, ht as DurableObjectRenamedExport, i as AiSearchNamespaceBinding, it as QueueConsumerTrigger, j as TypedAiBinding, k as StreamBinding, l as Bindings, lt as InferEnv, m as FlagshipBinding, mt as DurableObjectExpectingTransferExport, n as AiBinding, nt as EmailTrigger, o as ArtifactsBinding, ot as Triggers, p as DurableObjectBinding, pt as DurableObjectDeletedExport, q as WorkerReference, r as AiSearchBinding, rt as FetchTrigger, s as AssetsBinding, st as triggers, t as AgentMemoryBinding, tt as ConnectTrigger, u as BrowserBinding, ut as InferMainModule, v as KvBinding, vt as WorkerEntrypointExport, w as R2Binding, x as MtlsCertificateBinding, xt as WorkflowExportOptions, y as LogfwdrBinding, yt as WorkerEntrypointExportOptions, z as VpcServiceBinding } from "./public-u2AoxvhN.mjs";
2
2
  export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, ArtifactsBinding, AssetsBinding, BindingDevOptions, Bindings, BrowserBinding, CloudflareConfig, ConfigContext, ConnectTrigger, ContainerConfig, ContainerDefinition, D1Binding, DispatchNamespaceBinding, DurableObjectBinding, DurableObjectCreatedExport, DurableObjectDeletedExport, DurableObjectExpectingTransferExport, DurableObjectRenamedExport, DurableObjectTransferredExport, EmailTrigger, Exports, FetchTrigger, FlagshipBinding, HyperdriveBinding, ImagesBinding, InferDurableNamespaces, InferEnv, InferMainModule, JsonBinding, KvBinding, LogfwdrBinding, MediaBinding, MtlsCertificateBinding, PipelineBinding, QueueBinding, QueueConsumerTrigger, R2Binding, RateLimitBinding, ScheduledTrigger, SecretBinding, SecretsStoreSecretBinding, SendEmailBinding, Settings, StreamBinding, TextBinding, Triggers, TypedAiBinding, TypedKvBinding, TypedPipelineBinding, TypedQueueBinding, UnsafeBinding, UnwrapConfig, VectorizeBinding, VersionMetadataBinding, VpcNetworkBinding, VpcServiceBinding, WorkerBinding, WorkerConfig, WorkerDefinition, WorkerEntrypointExport, WorkerEntrypointExportOptions, WorkerLoaderBinding, WorkerReference, WorkflowBinding, WorkflowExport, WorkflowExportOptions, bindings, defineConfig, defineContainer, defineWorker, exports, triggers };
package/dist/public.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { a as triggers, i as exports, n as defineContainer, o as bindings, r as defineWorker, t as defineConfig } from "./public-CvUXcSEm.mjs";
1
+ import { a as triggers, i as exports, n as defineContainer, o as bindings, r as defineWorker, t as defineConfig } from "./public-srUjWEOA.mjs";
2
2
 
3
3
  export { bindings, defineConfig, defineContainer, defineWorker, exports, triggers };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudflare/config",
3
- "version": "0.19.0",
3
+ "version": "0.21.0",
4
4
  "description": "Definitions and utilities for configuring Cloudflare Workers and related products. This is not yet stable enough for external use — APIs may change without notice.",
5
5
  "homepage": "https://github.com/cloudflare/workers-sdk/tree/main/packages/config#readme",
6
6
  "bugs": {
@@ -31,7 +31,7 @@
31
31
  "zod": "4.4.3"
32
32
  },
33
33
  "devDependencies": {
34
- "@cloudflare/workers-types": "^5.20260925.1",
34
+ "@cloudflare/workers-types": "^5.20260926.1",
35
35
  "ts-dedent": "^2.2.0",
36
36
  "tsdown": "0.16.3",
37
37
  "typescript": "5.8.3",