@cloudflare/config 0.14.0 → 0.16.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 WorkerConfig, A as SecretsStoreSecretBinding, B as VersionMetadataBinding, C as MediaBinding, Ct as UnwrapConfig, D as R2Binding, E as QueueBinding, F as TypedKvBinding, G as WorkerReference, H as VpcServiceBinding, I as TypedPipelineBinding, J as WorkerConfigExport, K as WorkflowBinding, L as TypedQueueBinding, M as StreamBinding, N as TextBinding, O as RateLimitBinding, P as TypedAiBinding, Q as SettingsConfig, R as UnsafeBinding, S as LogfwdrBinding, St as InferMainModule, T as PipelineBinding, U as WorkerBinding, V as VpcNetworkBinding, W as WorkerLoaderBinding, X as defineWorker, Y as WorkerConfigInput, Z as ContainerConfig, _ as FlagshipBinding, _t as ContainerConfigInput, a as AiBinding, at as Triggers, b as JsonBinding, bt as InferDurableNamespaces, c as AnalyticsEngineDatasetBinding, ct as DurableObjectDeletedExport, d as BindingDevOptions, dt as DurableObjectTransferredExport, et as ConnectTrigger, f as Bindings, ft as Exports, g as DurableObjectBinding, gt as ContainerConfigExport, h as DispatchNamespaceBinding, ht as exports, i as AgentMemoryBinding, it as ScheduledTrigger, j as SendEmailBinding, k as SecretBinding, l as ArtifactsBinding, lt as DurableObjectExpectingTransferExport, m as D1Binding, mt as WorkerEntrypointExportOptions, n as SettingsConfigInput, nt as FetchTrigger, o as AiSearchBinding, ot as triggers, p as BrowserBinding, pt as WorkerEntrypointExport, q as bindings, r as defineSettings, rt as QueueConsumerTrigger, s as AiSearchNamespaceBinding, st as DurableObjectCreatedExport, t as SettingsConfigExport, tt as EmailTrigger, u as AssetsBinding, ut as DurableObjectRenamedExport, v as HyperdriveBinding, vt as defineContainer, w as MtlsCertificateBinding, x as KvBinding, xt as InferEnv, y as ImagesBinding, yt as ConfigContext, z as VectorizeBinding } from "./public-Mr8YPLNL.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, 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 exports, 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, y as LogfwdrBinding, yt as WorkerEntrypointExportOptions, z as VpcServiceBinding } from "./public-fVh2BrM5.mjs";
2
2
  import * as z from "zod";
3
3
  import { RawConfig } from "@cloudflare/workers-utils";
4
4
 
@@ -317,12 +317,12 @@ declare function validateSingletonBindings(env: Record<string, {
317
317
  type: string;
318
318
  }>, ctx: z.RefinementCtx): void;
319
319
  /**
320
- * Input Container schema — validates user-authored `cloudflare.config.ts`
321
- * Container exports. Dockerfiles are built by the consuming build tool.
320
+ * Input Container schema — parses user-authored `cloudflare.config.ts`
321
+ * Container objects. Dockerfiles are built by the consuming build tool.
322
322
  */
323
323
  declare const InputContainerSchema: z.ZodUnion<readonly [z.ZodObject<{
324
- type: z.ZodLiteral<"container">;
325
324
  name: z.ZodString;
325
+ unsafe: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
326
326
  observability: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
327
327
  enabled: z.ZodOptional<z.ZodBoolean>;
328
328
  logs: z.ZodOptional<z.ZodObject<{
@@ -336,7 +336,6 @@ declare const InputContainerSchema: z.ZodUnion<readonly [z.ZodObject<{
336
336
  }, z.core.$strict>>;
337
337
  targetInstanceCount: z.ZodOptional<z.ZodNumber>;
338
338
  }, z.core.$strict>]>>;
339
- unsafe: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
340
339
  maxInstances: z.ZodDefault<z.ZodNumber>;
341
340
  instanceType: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
342
341
  basic: "basic";
@@ -396,23 +395,15 @@ declare const InputContainerSchema: z.ZodUnion<readonly [z.ZodObject<{
396
395
  reference: z.ZodString;
397
396
  }, z.core.$strict>]>;
398
397
  }, z.core.$strict>, z.ZodObject<{
399
- type: z.ZodLiteral<"container">;
400
398
  name: z.ZodString;
401
- observability: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
402
- enabled: z.ZodOptional<z.ZodBoolean>;
403
- logs: z.ZodOptional<z.ZodObject<{
404
- enabled: z.ZodOptional<z.ZodBoolean>;
405
- }, z.core.$strict>>;
406
- targetInstancePercentage: z.ZodOptional<z.ZodNumber>;
407
- }, z.core.$strict>, z.ZodObject<{
399
+ unsafe: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
400
+ schedulingPolicy: z.ZodLiteral<"durable-object">;
401
+ observability: z.ZodOptional<z.ZodObject<{
408
402
  enabled: z.ZodOptional<z.ZodBoolean>;
409
403
  logs: z.ZodOptional<z.ZodObject<{
410
404
  enabled: z.ZodOptional<z.ZodBoolean>;
411
405
  }, z.core.$strict>>;
412
- targetInstanceCount: z.ZodOptional<z.ZodNumber>;
413
- }, z.core.$strict>]>>;
414
- unsafe: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
415
- schedulingPolicy: z.ZodLiteral<"durable-object">;
406
+ }, z.core.$strict>>;
416
407
  images: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
417
408
  dockerfile: z.ZodString;
418
409
  buildContext: z.ZodOptional<z.ZodString>;
@@ -423,13 +414,12 @@ declare const InputContainerSchema: z.ZodUnion<readonly [z.ZodObject<{
423
414
  }, z.core.$strict>]>;
424
415
  type ParsedInputContainerConfig = z.output<typeof InputContainerSchema>;
425
416
  /**
426
- * Output Container schema — validates Container configs in the Build Output
427
- * Specification, after any Dockerfile has been built into a local or remote
428
- * image reference.
417
+ * Output Container schema — parses `container.config.json` files in the Build
418
+ * Output Specification, after any Dockerfile has been built into a local image reference.
429
419
  */
430
420
  declare const OutputContainerSchema: z.ZodUnion<readonly [z.ZodObject<{
431
- type: z.ZodLiteral<"container">;
432
421
  name: z.ZodString;
422
+ unsafe: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
433
423
  observability: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
434
424
  enabled: z.ZodOptional<z.ZodBoolean>;
435
425
  logs: z.ZodOptional<z.ZodObject<{
@@ -443,7 +433,6 @@ declare const OutputContainerSchema: z.ZodUnion<readonly [z.ZodObject<{
443
433
  }, z.core.$strict>>;
444
434
  targetInstanceCount: z.ZodOptional<z.ZodNumber>;
445
435
  }, z.core.$strict>]>>;
446
- unsafe: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
447
436
  maxInstances: z.ZodDefault<z.ZodNumber>;
448
437
  instanceType: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
449
438
  basic: "basic";
@@ -501,23 +490,15 @@ declare const OutputContainerSchema: z.ZodUnion<readonly [z.ZodObject<{
501
490
  localReference: z.ZodString;
502
491
  }, z.core.$strict>]>;
503
492
  }, z.core.$strict>, z.ZodObject<{
504
- type: z.ZodLiteral<"container">;
505
493
  name: z.ZodString;
506
- observability: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
507
- enabled: z.ZodOptional<z.ZodBoolean>;
508
- logs: z.ZodOptional<z.ZodObject<{
509
- enabled: z.ZodOptional<z.ZodBoolean>;
510
- }, z.core.$strict>>;
511
- targetInstancePercentage: z.ZodOptional<z.ZodNumber>;
512
- }, z.core.$strict>, z.ZodObject<{
494
+ unsafe: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
495
+ schedulingPolicy: z.ZodLiteral<"durable-object">;
496
+ observability: z.ZodOptional<z.ZodObject<{
513
497
  enabled: z.ZodOptional<z.ZodBoolean>;
514
498
  logs: z.ZodOptional<z.ZodObject<{
515
499
  enabled: z.ZodOptional<z.ZodBoolean>;
516
500
  }, z.core.$strict>>;
517
- targetInstanceCount: z.ZodOptional<z.ZodNumber>;
518
- }, z.core.$strict>]>>;
519
- unsafe: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
520
- schedulingPolicy: z.ZodLiteral<"durable-object">;
501
+ }, z.core.$strict>>;
521
502
  images: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
522
503
  reference: z.ZodString;
523
504
  }, z.core.$strict>, z.ZodObject<{
@@ -606,12 +587,11 @@ declare const TailConsumerSchema: z.ZodObject<{
606
587
  streaming: z.ZodOptional<z.ZodBoolean>;
607
588
  }, z.core.$strict>;
608
589
  /**
609
- * Input Worker schema — the shape that user-authored `cloudflare.config.ts`
610
- * files are validated against. Adds an optional `entrypoint` field to the
611
- * base schema.
590
+ * Input Worker schema — parses Worker definitions from user-authored
591
+ * `cloudflare.config.ts` files. Adds an optional `entrypoint` field to the base
592
+ * schema.
612
593
  */
613
594
  declare const InputWorkerSchema: z.ZodObject<{
614
- type: z.ZodLiteral<"worker">;
615
595
  name: z.ZodString;
616
596
  compatibilityDate: z.ZodString;
617
597
  compatibilityFlags: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -769,32 +749,291 @@ declare const InputWorkerSchema: z.ZodObject<{
769
749
  }, z.core.$strict>;
770
750
  type ParsedInputWorkerConfig = z.output<typeof InputWorkerSchema>;
771
751
  /**
772
- * Input settings schema — validates the named `settings` export of a
773
- * `cloudflare.config.ts`. Holds account/deployment settings shared by the other exports.
752
+ * Input settings schema — parses the account settings at the top level of
753
+ * `cloudflare.config.ts`.
774
754
  */
775
755
  declare const InputSettingsSchema: z.ZodObject<{
776
- type: z.ZodLiteral<"settings">;
777
756
  accountId: z.ZodOptional<z.ZodString>;
778
757
  complianceRegion: z.ZodOptional<z.ZodEnum<{
779
758
  public: "public";
780
759
  "fedramp-high": "fedramp-high";
781
760
  }>>;
782
- }, z.core.$strict>;
761
+ }, z.core.$strip>;
783
762
  type ParsedInputSettingsConfig = z.output<typeof InputSettingsSchema>;
763
+ /** The resolved, user-authored project configuration. */
764
+ declare const InputConfigSchema: z.ZodObject<{
765
+ worker: z.ZodOptional<z.ZodObject<{
766
+ name: z.ZodString;
767
+ compatibilityDate: z.ZodString;
768
+ compatibilityFlags: z.ZodOptional<z.ZodArray<z.ZodString>>;
769
+ assets: z.ZodOptional<z.ZodObject<{
770
+ htmlHandling: z.ZodOptional<z.ZodEnum<{
771
+ "auto-trailing-slash": "auto-trailing-slash";
772
+ "drop-trailing-slash": "drop-trailing-slash";
773
+ "force-trailing-slash": "force-trailing-slash";
774
+ none: "none";
775
+ }>>;
776
+ notFoundHandling: z.ZodOptional<z.ZodEnum<{
777
+ none: "none";
778
+ "single-page-application": "single-page-application";
779
+ "404-page": "404-page";
780
+ }>>;
781
+ runWorkerFirst: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodBoolean]>>;
782
+ }, z.core.$strict>>;
783
+ domains: z.ZodOptional<z.ZodArray<z.ZodString>>;
784
+ triggers: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
785
+ type: z.ZodLiteral<"email">;
786
+ addresses: z.ZodArray<z.ZodString>;
787
+ }, z.core.$strict>, z.ZodObject<{
788
+ type: z.ZodLiteral<"fetch">;
789
+ pattern: z.ZodString;
790
+ zone: z.ZodOptional<z.ZodString>;
791
+ }, z.core.$strict>, z.ZodObject<{
792
+ type: z.ZodLiteral<"queue">;
793
+ name: z.ZodString;
794
+ deadLetterQueue: z.ZodOptional<z.ZodString>;
795
+ maxBatchSize: z.ZodOptional<z.ZodNumber>;
796
+ maxBatchTimeout: z.ZodOptional<z.ZodNumber>;
797
+ maxConcurrency: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
798
+ maxRetries: z.ZodOptional<z.ZodNumber>;
799
+ retryDelay: z.ZodOptional<z.ZodNumber>;
800
+ visibilityTimeoutMs: z.ZodOptional<z.ZodNumber>;
801
+ }, z.core.$strict>, z.ZodObject<{
802
+ type: z.ZodLiteral<"scheduled">;
803
+ schedule: z.ZodString;
804
+ }, z.core.$strict>, z.ZodObject<{
805
+ type: z.ZodLiteral<"connect">;
806
+ protocol: z.ZodEnum<{
807
+ tcp: "tcp";
808
+ }>;
809
+ port: z.ZodNumber;
810
+ address: z.ZodOptional<z.ZodString>;
811
+ }, z.core.$strict>], "type">>>;
812
+ tailConsumers: z.ZodOptional<z.ZodArray<z.ZodObject<{
813
+ worker: z.ZodString;
814
+ streaming: z.ZodOptional<z.ZodBoolean>;
815
+ }, z.core.$strict>>>;
816
+ cache: z.ZodOptional<z.ZodObject<{
817
+ enabled: z.ZodBoolean;
818
+ crossVersionCache: z.ZodOptional<z.ZodBoolean>;
819
+ }, z.core.$strict>>;
820
+ placement: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
821
+ mode: z.ZodEnum<{
822
+ off: "off";
823
+ smart: "smart";
824
+ }>;
825
+ hint: z.ZodOptional<z.ZodString>;
826
+ }, z.core.$strict>, z.ZodObject<{
827
+ mode: z.ZodOptional<z.ZodLiteral<"targeted">>;
828
+ region: z.ZodString;
829
+ }, z.core.$strict>, z.ZodObject<{
830
+ mode: z.ZodOptional<z.ZodLiteral<"targeted">>;
831
+ host: z.ZodString;
832
+ }, z.core.$strict>, z.ZodObject<{
833
+ mode: z.ZodOptional<z.ZodLiteral<"targeted">>;
834
+ hostname: z.ZodString;
835
+ }, z.core.$strict>]>>;
836
+ limits: z.ZodOptional<z.ZodObject<{
837
+ cpuMs: z.ZodOptional<z.ZodNumber>;
838
+ subrequests: z.ZodOptional<z.ZodNumber>;
839
+ }, z.core.$strict>>;
840
+ logpush: z.ZodOptional<z.ZodBoolean>;
841
+ observability: z.ZodOptional<z.ZodObject<{
842
+ enabled: z.ZodOptional<z.ZodBoolean>;
843
+ headSamplingRate: z.ZodOptional<z.ZodNumber>;
844
+ redactQueryString: z.ZodOptional<z.ZodBoolean>;
845
+ issues: z.ZodOptional<z.ZodObject<{
846
+ enabled: z.ZodOptional<z.ZodBoolean>;
847
+ }, z.core.$strict>>;
848
+ logs: z.ZodOptional<z.ZodObject<{
849
+ enabled: z.ZodOptional<z.ZodBoolean>;
850
+ headSamplingRate: z.ZodOptional<z.ZodNumber>;
851
+ invocationLogs: z.ZodOptional<z.ZodBoolean>;
852
+ persist: z.ZodOptional<z.ZodBoolean>;
853
+ destinations: z.ZodOptional<z.ZodArray<z.ZodString>>;
854
+ }, z.core.$strict>>;
855
+ traces: z.ZodOptional<z.ZodObject<{
856
+ enabled: z.ZodOptional<z.ZodBoolean>;
857
+ headSamplingRate: z.ZodOptional<z.ZodNumber>;
858
+ persist: z.ZodOptional<z.ZodBoolean>;
859
+ destinations: z.ZodOptional<z.ZodArray<z.ZodString>>;
860
+ }, z.core.$strict>>;
861
+ }, z.core.$strict>>;
862
+ workersDev: z.ZodOptional<z.ZodBoolean>;
863
+ previewUrls: z.ZodOptional<z.ZodBoolean>;
864
+ firstPartyWorker: z.ZodOptional<z.ZodBoolean>;
865
+ unsafe: z.ZodOptional<z.ZodObject<{
866
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
867
+ capnp: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
868
+ basePath: z.ZodString;
869
+ sourceSchemas: z.ZodArray<z.ZodString>;
870
+ compiledSchema: z.ZodOptional<z.ZodNever>;
871
+ }, z.core.$strict>, z.ZodObject<{
872
+ basePath: z.ZodOptional<z.ZodNever>;
873
+ sourceSchemas: z.ZodOptional<z.ZodNever>;
874
+ compiledSchema: z.ZodString;
875
+ }, z.core.$strict>]>>;
876
+ }, z.core.$strict>>;
877
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<BindingOutput, BindingInput, z.core.$ZodTypeInternals<BindingOutput, BindingInput>>>>;
878
+ exports: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
879
+ type: z.ZodLiteral<"durable-object">;
880
+ state: z.ZodOptional<z.ZodLiteral<"created">>;
881
+ container: z.ZodOptional<z.ZodString>;
882
+ storage: z.ZodLiteral<"sqlite">;
883
+ }, z.core.$strict>, z.ZodObject<{
884
+ type: z.ZodLiteral<"durable-object">;
885
+ state: z.ZodOptional<z.ZodLiteral<"created">>;
886
+ storage: z.ZodLiteral<"legacy-kv">;
887
+ }, z.core.$strict>, z.ZodObject<{
888
+ type: z.ZodLiteral<"durable-object">;
889
+ state: z.ZodLiteral<"deleted">;
890
+ }, z.core.$strict>, z.ZodObject<{
891
+ type: z.ZodLiteral<"durable-object">;
892
+ state: z.ZodLiteral<"renamed">;
893
+ renamedTo: z.ZodString;
894
+ }, z.core.$strict>, z.ZodObject<{
895
+ type: z.ZodLiteral<"durable-object">;
896
+ state: z.ZodLiteral<"transferred">;
897
+ transferredTo: z.ZodString;
898
+ }, z.core.$strict>, z.ZodObject<{
899
+ type: z.ZodLiteral<"durable-object">;
900
+ state: z.ZodLiteral<"expecting-transfer">;
901
+ transferFrom: z.ZodString;
902
+ container: z.ZodOptional<z.ZodString>;
903
+ storage: z.ZodLiteral<"sqlite">;
904
+ }, z.core.$strict>, z.ZodObject<{
905
+ type: z.ZodLiteral<"durable-object">;
906
+ state: z.ZodLiteral<"expecting-transfer">;
907
+ transferFrom: z.ZodString;
908
+ storage: z.ZodLiteral<"legacy-kv">;
909
+ }, z.core.$strict>, z.ZodObject<{
910
+ type: z.ZodLiteral<"worker">;
911
+ cache: z.ZodOptional<z.ZodObject<{
912
+ enabled: z.ZodBoolean;
913
+ }, z.core.$strict>>;
914
+ }, z.core.$strict>]>>>;
915
+ entrypoint: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
916
+ default: z.ZodString;
917
+ }, z.core.$strict>]>, z.ZodTransform<string, string | {
918
+ default: string;
919
+ }>>>;
920
+ }, z.core.$strict>>;
921
+ containers: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
922
+ name: z.ZodString;
923
+ unsafe: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
924
+ observability: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
925
+ enabled: z.ZodOptional<z.ZodBoolean>;
926
+ logs: z.ZodOptional<z.ZodObject<{
927
+ enabled: z.ZodOptional<z.ZodBoolean>;
928
+ }, z.core.$strict>>;
929
+ targetInstancePercentage: z.ZodOptional<z.ZodNumber>;
930
+ }, z.core.$strict>, z.ZodObject<{
931
+ enabled: z.ZodOptional<z.ZodBoolean>;
932
+ logs: z.ZodOptional<z.ZodObject<{
933
+ enabled: z.ZodOptional<z.ZodBoolean>;
934
+ }, z.core.$strict>>;
935
+ targetInstanceCount: z.ZodOptional<z.ZodNumber>;
936
+ }, z.core.$strict>]>>;
937
+ maxInstances: z.ZodDefault<z.ZodNumber>;
938
+ instanceType: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
939
+ basic: "basic";
940
+ lite: "lite";
941
+ "standard-1": "standard-1";
942
+ "standard-2": "standard-2";
943
+ "standard-3": "standard-3";
944
+ "standard-4": "standard-4";
945
+ }>, z.ZodObject<{
946
+ vcpu: z.ZodOptional<z.ZodNumber>;
947
+ memoryMib: z.ZodOptional<z.ZodNumber>;
948
+ diskMb: z.ZodOptional<z.ZodNumber>;
949
+ }, z.core.$strict>]>>;
950
+ schedulingPolicy: z.ZodOptional<z.ZodEnum<{
951
+ default: "default";
952
+ regional: "regional";
953
+ }>>;
954
+ ssh: z.ZodOptional<z.ZodObject<{
955
+ enabled: z.ZodBoolean;
956
+ port: z.ZodOptional<z.ZodNumber>;
957
+ }, z.core.$strict>>;
958
+ authorizedKeys: z.ZodOptional<z.ZodArray<z.ZodObject<{
959
+ name: z.ZodString;
960
+ publicKey: z.ZodString;
961
+ }, z.core.$strict>>>;
962
+ constraints: z.ZodOptional<z.ZodObject<{
963
+ regions: z.ZodOptional<z.ZodArray<z.ZodEnum<{
964
+ ENAM: "ENAM";
965
+ WNAM: "WNAM";
966
+ EEUR: "EEUR";
967
+ WEUR: "WEUR";
968
+ APAC: "APAC";
969
+ SAM: "SAM";
970
+ ME: "ME";
971
+ OC: "OC";
972
+ AFR: "AFR";
973
+ }>>>;
974
+ jurisdiction: z.ZodOptional<z.ZodEnum<{
975
+ eu: "eu";
976
+ fedramp: "fedramp";
977
+ }>>;
978
+ }, z.core.$strict>>;
979
+ rollout: z.ZodOptional<z.ZodObject<{
980
+ kind: z.ZodOptional<z.ZodEnum<{
981
+ none: "none";
982
+ "full-auto": "full-auto";
983
+ "full-manual": "full-manual";
984
+ }>>;
985
+ stepPercentage: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>;
986
+ activeGracePeriod: z.ZodOptional<z.ZodNumber>;
987
+ }, z.core.$strict>>;
988
+ image: z.ZodUnion<readonly [z.ZodObject<{
989
+ dockerfile: z.ZodString;
990
+ buildContext: z.ZodOptional<z.ZodString>;
991
+ buildVars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
992
+ }, z.core.$strict>, z.ZodObject<{
993
+ reference: z.ZodString;
994
+ }, z.core.$strict>]>;
995
+ }, z.core.$strict>, z.ZodObject<{
996
+ name: z.ZodString;
997
+ unsafe: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
998
+ schedulingPolicy: z.ZodLiteral<"durable-object">;
999
+ observability: z.ZodOptional<z.ZodObject<{
1000
+ enabled: z.ZodOptional<z.ZodBoolean>;
1001
+ logs: z.ZodOptional<z.ZodObject<{
1002
+ enabled: z.ZodOptional<z.ZodBoolean>;
1003
+ }, z.core.$strict>>;
1004
+ }, z.core.$strict>>;
1005
+ images: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
1006
+ dockerfile: z.ZodString;
1007
+ buildContext: z.ZodOptional<z.ZodString>;
1008
+ buildVars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1009
+ }, z.core.$strict>, z.ZodObject<{
1010
+ reference: z.ZodString;
1011
+ }, z.core.$strict>]>>>;
1012
+ }, z.core.$strict>]>>>;
1013
+ accountId: z.ZodOptional<z.ZodString>;
1014
+ complianceRegion: z.ZodOptional<z.ZodEnum<{
1015
+ public: "public";
1016
+ "fedramp-high": "fedramp-high";
1017
+ }>>;
1018
+ }, z.core.$strict>;
1019
+ type ParsedInputConfig = z.output<typeof InputConfigSchema>;
784
1020
  /**
785
- * Output settings schema — the shape of the top-level `config.json` in the
786
- * Build Output Specification. Adds the `mode` the build was produced in.
1021
+ * The shape of the root `config.json` in the Build Output Specification.
1022
+ * Account settings remain at the top level while build context is grouped
1023
+ * under `buildContext`.
787
1024
  */
788
- declare const OutputSettingsSchema: z.ZodObject<{
789
- type: z.ZodLiteral<"settings">;
1025
+ declare const OutputRootConfigSchema: z.ZodObject<{
1026
+ buildContext: z.ZodObject<{
1027
+ isPreview: z.ZodBoolean;
1028
+ mode: z.ZodOptional<z.ZodString>;
1029
+ }, z.core.$strict>;
790
1030
  accountId: z.ZodOptional<z.ZodString>;
791
1031
  complianceRegion: z.ZodOptional<z.ZodEnum<{
792
1032
  public: "public";
793
1033
  "fedramp-high": "fedramp-high";
794
1034
  }>>;
795
- mode: z.ZodOptional<z.ZodString>;
796
1035
  }, z.core.$strict>;
797
- type ParsedOutputSettingsConfig = z.output<typeof OutputSettingsSchema>;
1036
+ type ParsedOutputRootConfig = z.output<typeof OutputRootConfigSchema>;
798
1037
  declare const ModuleTypeSchema: z.ZodEnum<{
799
1038
  json: "json";
800
1039
  text: "text";
@@ -808,12 +1047,11 @@ declare const ModuleTypeSchema: z.ZodEnum<{
808
1047
  }>;
809
1048
  type ModuleType = z.output<typeof ModuleTypeSchema>;
810
1049
  /**
811
- * Output Worker schema — the shape of the Worker's `config.json` in the
812
- * Build Output Specification. Adds an optional `manifest` field to the
813
- * base schema.
1050
+ * Output Worker schema — the shape of the Worker's `worker.config.json` in the
1051
+ * Build Output Specification. Adds an optional `manifest` field to the base
1052
+ * schema.
814
1053
  */
815
1054
  declare const OutputWorkerSchema: z.ZodObject<{
816
- type: z.ZodLiteral<"worker">;
817
1055
  name: z.ZodString;
818
1056
  compatibilityDate: z.ZodString;
819
1057
  compatibilityFlags: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -1025,18 +1263,13 @@ declare function generateTypes({
1025
1263
  /**
1026
1264
  * Convert a parsed `@cloudflare/config` config into a Wrangler `RawConfig`.
1027
1265
  *
1028
- * The caller is responsible for unwrapping any function/promise wrappers and
1029
- * validating the configs against their corresponding input schemas before
1030
- * passing them in.
1266
+ * The caller is responsible for resolving any function/promise wrappers and
1267
+ * parsing the configuration before passing it in.
1031
1268
  *
1032
- * @param workerConfig The parsed (post-validation) Worker config.
1033
- * @param settingsConfig The optional parsed settings config, whose fields
1034
- * are merged onto the result.
1035
- * @param containerExports The parsed Container exports to include in the
1036
- * result.
1269
+ * @param config The parsed configuration.
1037
1270
  * @returns The corresponding Wrangler `RawConfig`.
1038
1271
  */
1039
- declare function convertToWranglerConfig(workerConfig: ParsedInputWorkerConfig, settingsConfig?: ParsedInputSettingsConfig, containerExports?: ParsedInputContainerConfig[]): RawConfig;
1272
+ declare function convertToWranglerConfig(config: ParsedInputConfig): RawConfig;
1040
1273
  //#endregion
1041
1274
  //#region src/load.d.ts
1042
1275
  /**
@@ -1049,28 +1282,18 @@ declare function convertToWranglerConfig(workerConfig: ParsedInputWorkerConfig,
1049
1282
  * See https://github.com/sxzz/import-without-cache for the original code.
1050
1283
  */
1051
1284
  /**
1052
- * Dynamically import a worker config file from disk.
1285
+ * Dynamically import a Cloudflare config file from disk.
1053
1286
  *
1054
- * Returns all of the module's exports (keyed by export name, including
1055
- * `default`), plus the set of file paths imported during resolution. Callers
1056
- * are responsible for unwrapping function/promise/definition wrappers around
1057
- * each export and validating them.
1287
+ * Returns the module's default export plus the set of file paths imported
1288
+ * during resolution.
1058
1289
  *
1059
1290
  * @param configPath Filesystem path to the config file. Relative paths are
1060
1291
  * resolved against `process.cwd()`.
1061
- * @param options.include When provided, only exports whose names are listed
1062
- * survive into the returned `exports` map. Filtering happens before any
1063
- * resolution or validation.
1064
1292
  */
1065
- declare function loadConfig(configPath: string, options?: {
1066
- include?: string[];
1067
- }): Promise<LoadConfigResult>;
1293
+ declare function loadConfig(configPath: string): Promise<LoadConfigResult>;
1068
1294
  interface LoadConfigResult {
1069
- /**
1070
- * All exports of the config module, keyed by export name (including
1071
- * `default`). Filtered by `options.include` when provided.
1072
- */
1073
- exports: Record<string, unknown>;
1295
+ /** The default export of the config module. */
1296
+ config: unknown;
1074
1297
  /**
1075
1298
  * Absolute file paths imported while resolving the config.
1076
1299
  * `cf-worker` entrypoints are NOT included — they are
@@ -1100,34 +1323,27 @@ interface LoadConfigResult {
1100
1323
  declare function registerConfigHooks(): () => void;
1101
1324
  //#endregion
1102
1325
  //#region src/config-loader.d.ts
1103
- type ParsedConfigExports = {
1104
- default?: ParsedInputWorkerConfig;
1105
- settings?: ParsedInputSettingsConfig;
1106
- } & Record<string, ParsedInputContainerConfig | ParsedInputWorkerConfig>;
1107
- type ConfigParseResult = z.ZodSafeParseSuccess<ParsedConfigExports> | z.ZodSafeParseError<unknown>;
1108
- interface LoadAndValidateConfigResult {
1109
- /**
1110
- * Zod result for the parsed exports record, keyed by JS export name.
1111
- * Consumers format `result.error` themselves.
1112
- */
1326
+ type ConfigParseResult = z.ZodSafeParseSuccess<ParsedInputConfig> | z.ZodSafeParseError<unknown>;
1327
+ type ConfigSettingsParseResult = z.ZodSafeParseSuccess<ParsedInputSettingsConfig> | z.ZodSafeParseError<unknown>;
1328
+ interface LoadAndParseConfigResult {
1329
+ /** Zod result for the parsed configuration. */
1113
1330
  result: ConfigParseResult;
1114
1331
  /** Transitive deps imported while resolving the config (node_modules excluded). */
1115
1332
  dependencies: Set<string>;
1116
1333
  }
1117
- /**
1118
- * Resolve and validate loaded `cloudflare.config.ts` exports.
1119
- *
1120
- * Config inputs are resolved once by identity. Top-level Worker and Container
1121
- * exports are also parsed once by identity. References are resolved only far
1122
- * enough to replace them with resource names, then Container links are
1123
- * validated across the exported resources.
1124
- */
1125
- declare function resolveAndValidateConfigExports(exports: Record<string, unknown>, ctx: ConfigContext): Promise<ConfigParseResult>;
1126
- /**
1127
- * Load a `cloudflare.config.ts`, resolve all exports, and validate them.
1128
- */
1129
- declare function loadAndValidateConfig(configPath: string, ctx: ConfigContext, options?: {
1130
- include?: string[];
1131
- }): Promise<LoadAndValidateConfigResult>;
1334
+ interface LoadAndParseConfigSettingsResult {
1335
+ /** Zod result containing only account and compliance settings. */
1336
+ result: ConfigSettingsParseResult;
1337
+ /** Transitive deps imported while resolving the config (node_modules excluded). */
1338
+ dependencies: Set<string>;
1339
+ }
1340
+ /** Resolve and parse the default configuration export. */
1341
+ declare function resolveAndParseConfig(input: unknown, ctx: ConfigContext): Promise<ConfigParseResult>;
1342
+ /** Resolve and parse only the account settings in a configuration definition. */
1343
+ declare function resolveAndParseConfigSettings(input: unknown, ctx: ConfigContext): Promise<ConfigSettingsParseResult>;
1344
+ /** Load and parse `cloudflare.config.ts`'s default export. */
1345
+ declare function loadAndParseConfig(configPath: string, ctx: ConfigContext): Promise<LoadAndParseConfigResult>;
1346
+ /** Load and parse only account settings from the default export. */
1347
+ declare function loadAndParseConfigSettings(configPath: string, ctx: ConfigContext): Promise<LoadAndParseConfigSettingsResult>;
1132
1348
  //#endregion
1133
- export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, AnalyticsEngineDatasetBindingSchema, ArtifactsBinding, AssetsBinding, AssetsSchema, BindingDevOptions, BindingSchema, Bindings, BrowserBinding, BrowserBindingSchema, ConfigContext, type ConfigParseResult, ConnectTrigger, ContainerConfig, ContainerConfigExport, ContainerConfigInput, 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, InputContainerSchema, InputSettingsSchema, InputWorkerSchema, JsonBinding, KVBindingSchema, KnownBindingSchema, KvBinding, type LoadAndValidateConfigResult, type LoadConfigResult, LogfwdrBinding, MediaBinding, type ModuleType, ModuleTypeSchema, MtlsCertificateBinding, OutputContainerSchema, OutputSettingsSchema, OutputWorkerSchema, type ParsedConfigExports, type ParsedInputContainerConfig, type ParsedInputSettingsConfig, type ParsedInputWorkerConfig, type ParsedOutputContainerConfig, type ParsedOutputSettingsConfig, type ParsedOutputWorkerConfig, PipelineBinding, QueueBinding, QueueBindingSchema, QueueConsumerTrigger, R2Binding, R2BindingSchema, RateLimitBinding, ScheduledTrigger, SecretBinding, SecretsStoreSecretBinding, SendEmailBinding, SettingsConfig, SettingsConfigExport, SettingsConfigInput, StreamBinding, TailConsumerSchema, TextBinding, Triggers, TypedAiBinding, TypedKvBinding, TypedPipelineBinding, TypedQueueBinding, UnsafeBinding, UnsafeBindingSchema, UnwrapConfig, VectorizeBinding, VersionMetadataBinding, VpcNetworkBinding, VpcServiceBinding, WorkerBinding, WorkerBindingSchema, WorkerConfig, WorkerConfigExport, WorkerConfigInput, WorkerEntrypointExport, WorkerEntrypointExportOptions, WorkerEntrypointExportSchema, WorkerLoaderBinding, WorkerReference, WorkflowBinding, bindings, convertToWranglerConfig, defineContainer, defineSettings, defineWorker, exports, generateTypes, loadAndValidateConfig, loadConfig, registerConfigHooks, resolveAndValidateConfigExports, triggers, validateSingletonBindings };
1349
+ 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, 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, bindings, convertToWranglerConfig, defineConfig, defineContainer, defineWorker, exports, generateTypes, loadAndParseConfig, loadAndParseConfigSettings, loadConfig, registerConfigHooks, resolveAndParseConfig, resolveAndParseConfigSettings, triggers, validateSingletonBindings };