@cloudflare/config 0.15.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 +309 -87
- package/dist/index.mjs +133 -226
- package/dist/{public-Dyr8BJqf.mjs → public-BMg6-Hxh.mjs} +65 -47
- package/dist/{public-CFsFemEv.d.mts → public-fVh2BrM5.d.mts} +280 -307
- package/dist/public.d.mts +2 -2
- package/dist/public.mjs +2 -2
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
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,11 +317,10 @@ declare function validateSingletonBindings(env: Record<string, {
|
|
|
317
317
|
type: string;
|
|
318
318
|
}>, ctx: z.RefinementCtx): void;
|
|
319
319
|
/**
|
|
320
|
-
* Input Container schema —
|
|
321
|
-
* Container
|
|
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;
|
|
326
325
|
unsafe: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
327
326
|
observability: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -396,7 +395,6 @@ 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
399
|
unsafe: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
402
400
|
schedulingPolicy: z.ZodLiteral<"durable-object">;
|
|
@@ -416,12 +414,10 @@ declare const InputContainerSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
416
414
|
}, z.core.$strict>]>;
|
|
417
415
|
type ParsedInputContainerConfig = z.output<typeof InputContainerSchema>;
|
|
418
416
|
/**
|
|
419
|
-
* Output Container schema —
|
|
420
|
-
* Specification, after any Dockerfile has been built into a local
|
|
421
|
-
* 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.
|
|
422
419
|
*/
|
|
423
420
|
declare const OutputContainerSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
424
|
-
type: z.ZodLiteral<"container">;
|
|
425
421
|
name: z.ZodString;
|
|
426
422
|
unsafe: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
427
423
|
observability: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -494,7 +490,6 @@ declare const OutputContainerSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
494
490
|
localReference: z.ZodString;
|
|
495
491
|
}, z.core.$strict>]>;
|
|
496
492
|
}, z.core.$strict>, z.ZodObject<{
|
|
497
|
-
type: z.ZodLiteral<"container">;
|
|
498
493
|
name: z.ZodString;
|
|
499
494
|
unsafe: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
500
495
|
schedulingPolicy: z.ZodLiteral<"durable-object">;
|
|
@@ -592,12 +587,11 @@ declare const TailConsumerSchema: z.ZodObject<{
|
|
|
592
587
|
streaming: z.ZodOptional<z.ZodBoolean>;
|
|
593
588
|
}, z.core.$strict>;
|
|
594
589
|
/**
|
|
595
|
-
* Input Worker schema —
|
|
596
|
-
* files
|
|
597
|
-
*
|
|
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.
|
|
598
593
|
*/
|
|
599
594
|
declare const InputWorkerSchema: z.ZodObject<{
|
|
600
|
-
type: z.ZodLiteral<"worker">;
|
|
601
595
|
name: z.ZodString;
|
|
602
596
|
compatibilityDate: z.ZodString;
|
|
603
597
|
compatibilityFlags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -755,33 +749,291 @@ declare const InputWorkerSchema: z.ZodObject<{
|
|
|
755
749
|
}, z.core.$strict>;
|
|
756
750
|
type ParsedInputWorkerConfig = z.output<typeof InputWorkerSchema>;
|
|
757
751
|
/**
|
|
758
|
-
* Input settings schema —
|
|
759
|
-
* `cloudflare.config.ts`.
|
|
752
|
+
* Input settings schema — parses the account settings at the top level of
|
|
753
|
+
* `cloudflare.config.ts`.
|
|
760
754
|
*/
|
|
761
755
|
declare const InputSettingsSchema: z.ZodObject<{
|
|
762
|
-
type: z.ZodLiteral<"settings">;
|
|
763
756
|
accountId: z.ZodOptional<z.ZodString>;
|
|
764
757
|
complianceRegion: z.ZodOptional<z.ZodEnum<{
|
|
765
758
|
public: "public";
|
|
766
759
|
"fedramp-high": "fedramp-high";
|
|
767
760
|
}>>;
|
|
768
|
-
}, z.core.$
|
|
761
|
+
}, z.core.$strip>;
|
|
769
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>;
|
|
770
1020
|
/**
|
|
771
|
-
*
|
|
772
|
-
*
|
|
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`.
|
|
773
1024
|
*/
|
|
774
|
-
declare const
|
|
775
|
-
|
|
1025
|
+
declare const OutputRootConfigSchema: z.ZodObject<{
|
|
1026
|
+
buildContext: z.ZodObject<{
|
|
1027
|
+
isPreview: z.ZodBoolean;
|
|
1028
|
+
mode: z.ZodOptional<z.ZodString>;
|
|
1029
|
+
}, z.core.$strict>;
|
|
776
1030
|
accountId: z.ZodOptional<z.ZodString>;
|
|
777
1031
|
complianceRegion: z.ZodOptional<z.ZodEnum<{
|
|
778
1032
|
public: "public";
|
|
779
1033
|
"fedramp-high": "fedramp-high";
|
|
780
1034
|
}>>;
|
|
781
|
-
isPreview: z.ZodOptional<z.ZodBoolean>;
|
|
782
|
-
mode: z.ZodOptional<z.ZodString>;
|
|
783
1035
|
}, z.core.$strict>;
|
|
784
|
-
type
|
|
1036
|
+
type ParsedOutputRootConfig = z.output<typeof OutputRootConfigSchema>;
|
|
785
1037
|
declare const ModuleTypeSchema: z.ZodEnum<{
|
|
786
1038
|
json: "json";
|
|
787
1039
|
text: "text";
|
|
@@ -795,12 +1047,11 @@ declare const ModuleTypeSchema: z.ZodEnum<{
|
|
|
795
1047
|
}>;
|
|
796
1048
|
type ModuleType = z.output<typeof ModuleTypeSchema>;
|
|
797
1049
|
/**
|
|
798
|
-
* Output Worker schema — the shape of the Worker's `config.json` in the
|
|
799
|
-
* Build Output Specification. Adds an optional `manifest` field to the
|
|
800
|
-
*
|
|
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.
|
|
801
1053
|
*/
|
|
802
1054
|
declare const OutputWorkerSchema: z.ZodObject<{
|
|
803
|
-
type: z.ZodLiteral<"worker">;
|
|
804
1055
|
name: z.ZodString;
|
|
805
1056
|
compatibilityDate: z.ZodString;
|
|
806
1057
|
compatibilityFlags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -1012,18 +1263,13 @@ declare function generateTypes({
|
|
|
1012
1263
|
/**
|
|
1013
1264
|
* Convert a parsed `@cloudflare/config` config into a Wrangler `RawConfig`.
|
|
1014
1265
|
*
|
|
1015
|
-
* The caller is responsible for
|
|
1016
|
-
*
|
|
1017
|
-
* passing them in.
|
|
1266
|
+
* The caller is responsible for resolving any function/promise wrappers and
|
|
1267
|
+
* parsing the configuration before passing it in.
|
|
1018
1268
|
*
|
|
1019
|
-
* @param
|
|
1020
|
-
* @param settingsConfig The optional parsed settings config, whose fields
|
|
1021
|
-
* are merged onto the result.
|
|
1022
|
-
* @param containerExports The parsed Container exports to include in the
|
|
1023
|
-
* result.
|
|
1269
|
+
* @param config The parsed configuration.
|
|
1024
1270
|
* @returns The corresponding Wrangler `RawConfig`.
|
|
1025
1271
|
*/
|
|
1026
|
-
declare function convertToWranglerConfig(
|
|
1272
|
+
declare function convertToWranglerConfig(config: ParsedInputConfig): RawConfig;
|
|
1027
1273
|
//#endregion
|
|
1028
1274
|
//#region src/load.d.ts
|
|
1029
1275
|
/**
|
|
@@ -1036,28 +1282,18 @@ declare function convertToWranglerConfig(workerConfig: ParsedInputWorkerConfig,
|
|
|
1036
1282
|
* See https://github.com/sxzz/import-without-cache for the original code.
|
|
1037
1283
|
*/
|
|
1038
1284
|
/**
|
|
1039
|
-
* Dynamically import a
|
|
1285
|
+
* Dynamically import a Cloudflare config file from disk.
|
|
1040
1286
|
*
|
|
1041
|
-
* Returns
|
|
1042
|
-
*
|
|
1043
|
-
* are responsible for unwrapping function/promise/definition wrappers around
|
|
1044
|
-
* each export and validating them.
|
|
1287
|
+
* Returns the module's default export plus the set of file paths imported
|
|
1288
|
+
* during resolution.
|
|
1045
1289
|
*
|
|
1046
1290
|
* @param configPath Filesystem path to the config file. Relative paths are
|
|
1047
1291
|
* resolved against `process.cwd()`.
|
|
1048
|
-
* @param options.include When provided, only exports whose names are listed
|
|
1049
|
-
* survive into the returned `exports` map. Filtering happens before any
|
|
1050
|
-
* resolution or validation.
|
|
1051
1292
|
*/
|
|
1052
|
-
declare function loadConfig(configPath: string
|
|
1053
|
-
include?: string[];
|
|
1054
|
-
}): Promise<LoadConfigResult>;
|
|
1293
|
+
declare function loadConfig(configPath: string): Promise<LoadConfigResult>;
|
|
1055
1294
|
interface LoadConfigResult {
|
|
1056
|
-
/**
|
|
1057
|
-
|
|
1058
|
-
* `default`). Filtered by `options.include` when provided.
|
|
1059
|
-
*/
|
|
1060
|
-
exports: Record<string, unknown>;
|
|
1295
|
+
/** The default export of the config module. */
|
|
1296
|
+
config: unknown;
|
|
1061
1297
|
/**
|
|
1062
1298
|
* Absolute file paths imported while resolving the config.
|
|
1063
1299
|
* `cf-worker` entrypoints are NOT included — they are
|
|
@@ -1087,41 +1323,27 @@ interface LoadConfigResult {
|
|
|
1087
1323
|
declare function registerConfigHooks(): () => void;
|
|
1088
1324
|
//#endregion
|
|
1089
1325
|
//#region src/config-loader.d.ts
|
|
1090
|
-
type
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
/**
|
|
1095
|
-
* Selects the Container exports from a validated project configuration.
|
|
1096
|
-
*
|
|
1097
|
-
* @param config - Validated exports keyed by their JavaScript export names.
|
|
1098
|
-
* @returns Container configurations keyed by those same export names.
|
|
1099
|
-
*/
|
|
1100
|
-
declare function getContainerConfigExports(config: ParsedConfigExports): Record<string, ParsedInputContainerConfig>;
|
|
1101
|
-
type ConfigParseResult = z.ZodSafeParseSuccess<ParsedConfigExports> | z.ZodSafeParseError<unknown>;
|
|
1102
|
-
interface LoadAndValidateConfigResult {
|
|
1103
|
-
/**
|
|
1104
|
-
* Zod result for the parsed exports record, keyed by JS export name.
|
|
1105
|
-
* Consumers format `result.error` themselves.
|
|
1106
|
-
*/
|
|
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. */
|
|
1107
1330
|
result: ConfigParseResult;
|
|
1108
1331
|
/** Transitive deps imported while resolving the config (node_modules excluded). */
|
|
1109
1332
|
dependencies: Set<string>;
|
|
1110
1333
|
}
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
}): 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>;
|
|
1126
1348
|
//#endregion
|
|
1127
|
-
export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, AnalyticsEngineDatasetBindingSchema, ArtifactsBinding, AssetsBinding, AssetsSchema, BindingDevOptions, BindingSchema, Bindings, BrowserBinding, BrowserBindingSchema, ConfigContext, type ConfigParseResult, ConnectTrigger, ContainerConfig,
|
|
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 };
|