@cloudflare/config 0.15.0 → 0.17.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 +307 -92
- package/dist/index.mjs +141 -227
- 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 +4 -4
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
|
-
* base schema.
|
|
590
|
+
* Input Worker schema — parses Worker definitions from user-authored
|
|
591
|
+
* `cloudflare.config.ts` files. Adds an optional string `entrypoint` field to
|
|
592
|
+
* the base 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>>;
|
|
@@ -747,41 +741,292 @@ declare const InputWorkerSchema: z.ZodObject<{
|
|
|
747
741
|
enabled: z.ZodBoolean;
|
|
748
742
|
}, z.core.$strict>>;
|
|
749
743
|
}, z.core.$strict>]>>>;
|
|
750
|
-
entrypoint: z.ZodOptional<z.
|
|
751
|
-
default: z.ZodString;
|
|
752
|
-
}, z.core.$strict>]>, z.ZodTransform<string, string | {
|
|
753
|
-
default: string;
|
|
754
|
-
}>>>;
|
|
744
|
+
entrypoint: z.ZodOptional<z.ZodString>;
|
|
755
745
|
}, z.core.$strict>;
|
|
746
|
+
type InputWorkerConfig = z.input<typeof InputWorkerSchema>;
|
|
756
747
|
type ParsedInputWorkerConfig = z.output<typeof InputWorkerSchema>;
|
|
757
748
|
/**
|
|
758
|
-
* Input settings schema —
|
|
759
|
-
* `cloudflare.config.ts`.
|
|
749
|
+
* Input settings schema — parses the account settings at the top level of
|
|
750
|
+
* `cloudflare.config.ts`.
|
|
760
751
|
*/
|
|
761
752
|
declare const InputSettingsSchema: z.ZodObject<{
|
|
762
|
-
type: z.ZodLiteral<"settings">;
|
|
763
753
|
accountId: z.ZodOptional<z.ZodString>;
|
|
764
754
|
complianceRegion: z.ZodOptional<z.ZodEnum<{
|
|
765
755
|
public: "public";
|
|
766
756
|
"fedramp-high": "fedramp-high";
|
|
767
757
|
}>>;
|
|
768
|
-
}, z.core.$
|
|
758
|
+
}, z.core.$strip>;
|
|
769
759
|
type ParsedInputSettingsConfig = z.output<typeof InputSettingsSchema>;
|
|
760
|
+
/** The resolved, user-authored project configuration. */
|
|
761
|
+
declare const InputConfigSchema: z.ZodObject<{
|
|
762
|
+
worker: z.ZodOptional<z.ZodObject<{
|
|
763
|
+
name: z.ZodString;
|
|
764
|
+
compatibilityDate: z.ZodString;
|
|
765
|
+
compatibilityFlags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
766
|
+
assets: z.ZodOptional<z.ZodObject<{
|
|
767
|
+
htmlHandling: z.ZodOptional<z.ZodEnum<{
|
|
768
|
+
"auto-trailing-slash": "auto-trailing-slash";
|
|
769
|
+
"drop-trailing-slash": "drop-trailing-slash";
|
|
770
|
+
"force-trailing-slash": "force-trailing-slash";
|
|
771
|
+
none: "none";
|
|
772
|
+
}>>;
|
|
773
|
+
notFoundHandling: z.ZodOptional<z.ZodEnum<{
|
|
774
|
+
none: "none";
|
|
775
|
+
"single-page-application": "single-page-application";
|
|
776
|
+
"404-page": "404-page";
|
|
777
|
+
}>>;
|
|
778
|
+
runWorkerFirst: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodBoolean]>>;
|
|
779
|
+
}, z.core.$strict>>;
|
|
780
|
+
domains: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
781
|
+
triggers: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
782
|
+
type: z.ZodLiteral<"email">;
|
|
783
|
+
addresses: z.ZodArray<z.ZodString>;
|
|
784
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
785
|
+
type: z.ZodLiteral<"fetch">;
|
|
786
|
+
pattern: z.ZodString;
|
|
787
|
+
zone: z.ZodOptional<z.ZodString>;
|
|
788
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
789
|
+
type: z.ZodLiteral<"queue">;
|
|
790
|
+
name: z.ZodString;
|
|
791
|
+
deadLetterQueue: z.ZodOptional<z.ZodString>;
|
|
792
|
+
maxBatchSize: z.ZodOptional<z.ZodNumber>;
|
|
793
|
+
maxBatchTimeout: z.ZodOptional<z.ZodNumber>;
|
|
794
|
+
maxConcurrency: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
795
|
+
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
796
|
+
retryDelay: z.ZodOptional<z.ZodNumber>;
|
|
797
|
+
visibilityTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
798
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
799
|
+
type: z.ZodLiteral<"scheduled">;
|
|
800
|
+
schedule: z.ZodString;
|
|
801
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
802
|
+
type: z.ZodLiteral<"connect">;
|
|
803
|
+
protocol: z.ZodEnum<{
|
|
804
|
+
tcp: "tcp";
|
|
805
|
+
}>;
|
|
806
|
+
port: z.ZodNumber;
|
|
807
|
+
address: z.ZodOptional<z.ZodString>;
|
|
808
|
+
}, z.core.$strict>], "type">>>;
|
|
809
|
+
tailConsumers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
810
|
+
worker: z.ZodString;
|
|
811
|
+
streaming: z.ZodOptional<z.ZodBoolean>;
|
|
812
|
+
}, z.core.$strict>>>;
|
|
813
|
+
cache: z.ZodOptional<z.ZodObject<{
|
|
814
|
+
enabled: z.ZodBoolean;
|
|
815
|
+
crossVersionCache: z.ZodOptional<z.ZodBoolean>;
|
|
816
|
+
}, z.core.$strict>>;
|
|
817
|
+
placement: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
818
|
+
mode: z.ZodEnum<{
|
|
819
|
+
off: "off";
|
|
820
|
+
smart: "smart";
|
|
821
|
+
}>;
|
|
822
|
+
hint: z.ZodOptional<z.ZodString>;
|
|
823
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
824
|
+
mode: z.ZodOptional<z.ZodLiteral<"targeted">>;
|
|
825
|
+
region: z.ZodString;
|
|
826
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
827
|
+
mode: z.ZodOptional<z.ZodLiteral<"targeted">>;
|
|
828
|
+
host: z.ZodString;
|
|
829
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
830
|
+
mode: z.ZodOptional<z.ZodLiteral<"targeted">>;
|
|
831
|
+
hostname: z.ZodString;
|
|
832
|
+
}, z.core.$strict>]>>;
|
|
833
|
+
limits: z.ZodOptional<z.ZodObject<{
|
|
834
|
+
cpuMs: z.ZodOptional<z.ZodNumber>;
|
|
835
|
+
subrequests: z.ZodOptional<z.ZodNumber>;
|
|
836
|
+
}, z.core.$strict>>;
|
|
837
|
+
logpush: z.ZodOptional<z.ZodBoolean>;
|
|
838
|
+
observability: z.ZodOptional<z.ZodObject<{
|
|
839
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
840
|
+
headSamplingRate: z.ZodOptional<z.ZodNumber>;
|
|
841
|
+
redactQueryString: z.ZodOptional<z.ZodBoolean>;
|
|
842
|
+
issues: z.ZodOptional<z.ZodObject<{
|
|
843
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
844
|
+
}, z.core.$strict>>;
|
|
845
|
+
logs: z.ZodOptional<z.ZodObject<{
|
|
846
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
847
|
+
headSamplingRate: z.ZodOptional<z.ZodNumber>;
|
|
848
|
+
invocationLogs: z.ZodOptional<z.ZodBoolean>;
|
|
849
|
+
persist: z.ZodOptional<z.ZodBoolean>;
|
|
850
|
+
destinations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
851
|
+
}, z.core.$strict>>;
|
|
852
|
+
traces: z.ZodOptional<z.ZodObject<{
|
|
853
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
854
|
+
headSamplingRate: z.ZodOptional<z.ZodNumber>;
|
|
855
|
+
persist: z.ZodOptional<z.ZodBoolean>;
|
|
856
|
+
destinations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
857
|
+
}, z.core.$strict>>;
|
|
858
|
+
}, z.core.$strict>>;
|
|
859
|
+
workersDev: z.ZodOptional<z.ZodBoolean>;
|
|
860
|
+
previewUrls: z.ZodOptional<z.ZodBoolean>;
|
|
861
|
+
firstPartyWorker: z.ZodOptional<z.ZodBoolean>;
|
|
862
|
+
unsafe: z.ZodOptional<z.ZodObject<{
|
|
863
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
864
|
+
capnp: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
865
|
+
basePath: z.ZodString;
|
|
866
|
+
sourceSchemas: z.ZodArray<z.ZodString>;
|
|
867
|
+
compiledSchema: z.ZodOptional<z.ZodNever>;
|
|
868
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
869
|
+
basePath: z.ZodOptional<z.ZodNever>;
|
|
870
|
+
sourceSchemas: z.ZodOptional<z.ZodNever>;
|
|
871
|
+
compiledSchema: z.ZodString;
|
|
872
|
+
}, z.core.$strict>]>>;
|
|
873
|
+
}, z.core.$strict>>;
|
|
874
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<BindingOutput, BindingInput, z.core.$ZodTypeInternals<BindingOutput, BindingInput>>>>;
|
|
875
|
+
exports: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
876
|
+
type: z.ZodLiteral<"durable-object">;
|
|
877
|
+
state: z.ZodOptional<z.ZodLiteral<"created">>;
|
|
878
|
+
container: z.ZodOptional<z.ZodString>;
|
|
879
|
+
storage: z.ZodLiteral<"sqlite">;
|
|
880
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
881
|
+
type: z.ZodLiteral<"durable-object">;
|
|
882
|
+
state: z.ZodOptional<z.ZodLiteral<"created">>;
|
|
883
|
+
storage: z.ZodLiteral<"legacy-kv">;
|
|
884
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
885
|
+
type: z.ZodLiteral<"durable-object">;
|
|
886
|
+
state: z.ZodLiteral<"deleted">;
|
|
887
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
888
|
+
type: z.ZodLiteral<"durable-object">;
|
|
889
|
+
state: z.ZodLiteral<"renamed">;
|
|
890
|
+
renamedTo: z.ZodString;
|
|
891
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
892
|
+
type: z.ZodLiteral<"durable-object">;
|
|
893
|
+
state: z.ZodLiteral<"transferred">;
|
|
894
|
+
transferredTo: z.ZodString;
|
|
895
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
896
|
+
type: z.ZodLiteral<"durable-object">;
|
|
897
|
+
state: z.ZodLiteral<"expecting-transfer">;
|
|
898
|
+
transferFrom: z.ZodString;
|
|
899
|
+
container: z.ZodOptional<z.ZodString>;
|
|
900
|
+
storage: z.ZodLiteral<"sqlite">;
|
|
901
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
902
|
+
type: z.ZodLiteral<"durable-object">;
|
|
903
|
+
state: z.ZodLiteral<"expecting-transfer">;
|
|
904
|
+
transferFrom: z.ZodString;
|
|
905
|
+
storage: z.ZodLiteral<"legacy-kv">;
|
|
906
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
907
|
+
type: z.ZodLiteral<"worker">;
|
|
908
|
+
cache: z.ZodOptional<z.ZodObject<{
|
|
909
|
+
enabled: z.ZodBoolean;
|
|
910
|
+
}, z.core.$strict>>;
|
|
911
|
+
}, z.core.$strict>]>>>;
|
|
912
|
+
entrypoint: z.ZodOptional<z.ZodString>;
|
|
913
|
+
}, z.core.$strict>>;
|
|
914
|
+
containers: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
915
|
+
name: z.ZodString;
|
|
916
|
+
unsafe: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
917
|
+
observability: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
918
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
919
|
+
logs: z.ZodOptional<z.ZodObject<{
|
|
920
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
921
|
+
}, z.core.$strict>>;
|
|
922
|
+
targetInstancePercentage: z.ZodOptional<z.ZodNumber>;
|
|
923
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
924
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
925
|
+
logs: z.ZodOptional<z.ZodObject<{
|
|
926
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
927
|
+
}, z.core.$strict>>;
|
|
928
|
+
targetInstanceCount: z.ZodOptional<z.ZodNumber>;
|
|
929
|
+
}, z.core.$strict>]>>;
|
|
930
|
+
maxInstances: z.ZodDefault<z.ZodNumber>;
|
|
931
|
+
instanceType: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
932
|
+
basic: "basic";
|
|
933
|
+
lite: "lite";
|
|
934
|
+
"standard-1": "standard-1";
|
|
935
|
+
"standard-2": "standard-2";
|
|
936
|
+
"standard-3": "standard-3";
|
|
937
|
+
"standard-4": "standard-4";
|
|
938
|
+
}>, z.ZodObject<{
|
|
939
|
+
vcpu: z.ZodOptional<z.ZodNumber>;
|
|
940
|
+
memoryMib: z.ZodOptional<z.ZodNumber>;
|
|
941
|
+
diskMb: z.ZodOptional<z.ZodNumber>;
|
|
942
|
+
}, z.core.$strict>]>>;
|
|
943
|
+
schedulingPolicy: z.ZodOptional<z.ZodEnum<{
|
|
944
|
+
default: "default";
|
|
945
|
+
regional: "regional";
|
|
946
|
+
}>>;
|
|
947
|
+
ssh: z.ZodOptional<z.ZodObject<{
|
|
948
|
+
enabled: z.ZodBoolean;
|
|
949
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
950
|
+
}, z.core.$strict>>;
|
|
951
|
+
authorizedKeys: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
952
|
+
name: z.ZodString;
|
|
953
|
+
publicKey: z.ZodString;
|
|
954
|
+
}, z.core.$strict>>>;
|
|
955
|
+
constraints: z.ZodOptional<z.ZodObject<{
|
|
956
|
+
regions: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
957
|
+
ENAM: "ENAM";
|
|
958
|
+
WNAM: "WNAM";
|
|
959
|
+
EEUR: "EEUR";
|
|
960
|
+
WEUR: "WEUR";
|
|
961
|
+
APAC: "APAC";
|
|
962
|
+
SAM: "SAM";
|
|
963
|
+
ME: "ME";
|
|
964
|
+
OC: "OC";
|
|
965
|
+
AFR: "AFR";
|
|
966
|
+
}>>>;
|
|
967
|
+
jurisdiction: z.ZodOptional<z.ZodEnum<{
|
|
968
|
+
eu: "eu";
|
|
969
|
+
fedramp: "fedramp";
|
|
970
|
+
}>>;
|
|
971
|
+
}, z.core.$strict>>;
|
|
972
|
+
rollout: z.ZodOptional<z.ZodObject<{
|
|
973
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
974
|
+
none: "none";
|
|
975
|
+
"full-auto": "full-auto";
|
|
976
|
+
"full-manual": "full-manual";
|
|
977
|
+
}>>;
|
|
978
|
+
stepPercentage: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>;
|
|
979
|
+
activeGracePeriod: z.ZodOptional<z.ZodNumber>;
|
|
980
|
+
}, z.core.$strict>>;
|
|
981
|
+
image: z.ZodUnion<readonly [z.ZodObject<{
|
|
982
|
+
dockerfile: z.ZodString;
|
|
983
|
+
buildContext: z.ZodOptional<z.ZodString>;
|
|
984
|
+
buildVars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
985
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
986
|
+
reference: z.ZodString;
|
|
987
|
+
}, z.core.$strict>]>;
|
|
988
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
989
|
+
name: z.ZodString;
|
|
990
|
+
unsafe: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
991
|
+
schedulingPolicy: z.ZodLiteral<"durable-object">;
|
|
992
|
+
observability: z.ZodOptional<z.ZodObject<{
|
|
993
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
994
|
+
logs: z.ZodOptional<z.ZodObject<{
|
|
995
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
996
|
+
}, z.core.$strict>>;
|
|
997
|
+
}, z.core.$strict>>;
|
|
998
|
+
images: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
999
|
+
dockerfile: z.ZodString;
|
|
1000
|
+
buildContext: z.ZodOptional<z.ZodString>;
|
|
1001
|
+
buildVars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1002
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1003
|
+
reference: z.ZodString;
|
|
1004
|
+
}, z.core.$strict>]>>>;
|
|
1005
|
+
}, z.core.$strict>]>>>;
|
|
1006
|
+
accountId: z.ZodOptional<z.ZodString>;
|
|
1007
|
+
complianceRegion: z.ZodOptional<z.ZodEnum<{
|
|
1008
|
+
public: "public";
|
|
1009
|
+
"fedramp-high": "fedramp-high";
|
|
1010
|
+
}>>;
|
|
1011
|
+
}, z.core.$strict>;
|
|
1012
|
+
type ParsedInputConfig = z.output<typeof InputConfigSchema>;
|
|
770
1013
|
/**
|
|
771
|
-
*
|
|
772
|
-
*
|
|
1014
|
+
* The shape of the root `config.json` in the Build Output Specification.
|
|
1015
|
+
* Account settings remain at the top level while build context is grouped
|
|
1016
|
+
* under `buildContext`.
|
|
773
1017
|
*/
|
|
774
|
-
declare const
|
|
775
|
-
|
|
1018
|
+
declare const OutputRootConfigSchema: z.ZodObject<{
|
|
1019
|
+
buildContext: z.ZodObject<{
|
|
1020
|
+
isPreview: z.ZodBoolean;
|
|
1021
|
+
mode: z.ZodOptional<z.ZodString>;
|
|
1022
|
+
}, z.core.$strict>;
|
|
776
1023
|
accountId: z.ZodOptional<z.ZodString>;
|
|
777
1024
|
complianceRegion: z.ZodOptional<z.ZodEnum<{
|
|
778
1025
|
public: "public";
|
|
779
1026
|
"fedramp-high": "fedramp-high";
|
|
780
1027
|
}>>;
|
|
781
|
-
isPreview: z.ZodOptional<z.ZodBoolean>;
|
|
782
|
-
mode: z.ZodOptional<z.ZodString>;
|
|
783
1028
|
}, z.core.$strict>;
|
|
784
|
-
type
|
|
1029
|
+
type ParsedOutputRootConfig = z.output<typeof OutputRootConfigSchema>;
|
|
785
1030
|
declare const ModuleTypeSchema: z.ZodEnum<{
|
|
786
1031
|
json: "json";
|
|
787
1032
|
text: "text";
|
|
@@ -795,12 +1040,11 @@ declare const ModuleTypeSchema: z.ZodEnum<{
|
|
|
795
1040
|
}>;
|
|
796
1041
|
type ModuleType = z.output<typeof ModuleTypeSchema>;
|
|
797
1042
|
/**
|
|
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
|
-
*
|
|
1043
|
+
* Output Worker schema — the shape of the Worker's `worker.config.json` in the
|
|
1044
|
+
* Build Output Specification. Adds an optional `manifest` field to the base
|
|
1045
|
+
* schema.
|
|
801
1046
|
*/
|
|
802
1047
|
declare const OutputWorkerSchema: z.ZodObject<{
|
|
803
|
-
type: z.ZodLiteral<"worker">;
|
|
804
1048
|
name: z.ZodString;
|
|
805
1049
|
compatibilityDate: z.ZodString;
|
|
806
1050
|
compatibilityFlags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -1012,18 +1256,13 @@ declare function generateTypes({
|
|
|
1012
1256
|
/**
|
|
1013
1257
|
* Convert a parsed `@cloudflare/config` config into a Wrangler `RawConfig`.
|
|
1014
1258
|
*
|
|
1015
|
-
* The caller is responsible for
|
|
1016
|
-
*
|
|
1017
|
-
* passing them in.
|
|
1259
|
+
* The caller is responsible for resolving any function/promise wrappers and
|
|
1260
|
+
* parsing the configuration before passing it in.
|
|
1018
1261
|
*
|
|
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.
|
|
1262
|
+
* @param config The parsed configuration.
|
|
1024
1263
|
* @returns The corresponding Wrangler `RawConfig`.
|
|
1025
1264
|
*/
|
|
1026
|
-
declare function convertToWranglerConfig(
|
|
1265
|
+
declare function convertToWranglerConfig(config: ParsedInputConfig): RawConfig;
|
|
1027
1266
|
//#endregion
|
|
1028
1267
|
//#region src/load.d.ts
|
|
1029
1268
|
/**
|
|
@@ -1036,28 +1275,18 @@ declare function convertToWranglerConfig(workerConfig: ParsedInputWorkerConfig,
|
|
|
1036
1275
|
* See https://github.com/sxzz/import-without-cache for the original code.
|
|
1037
1276
|
*/
|
|
1038
1277
|
/**
|
|
1039
|
-
* Dynamically import a
|
|
1278
|
+
* Dynamically import a Cloudflare config file from disk.
|
|
1040
1279
|
*
|
|
1041
|
-
* Returns
|
|
1042
|
-
*
|
|
1043
|
-
* are responsible for unwrapping function/promise/definition wrappers around
|
|
1044
|
-
* each export and validating them.
|
|
1280
|
+
* Returns the module's default export plus the set of file paths imported
|
|
1281
|
+
* during resolution.
|
|
1045
1282
|
*
|
|
1046
1283
|
* @param configPath Filesystem path to the config file. Relative paths are
|
|
1047
1284
|
* 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
1285
|
*/
|
|
1052
|
-
declare function loadConfig(configPath: string
|
|
1053
|
-
include?: string[];
|
|
1054
|
-
}): Promise<LoadConfigResult>;
|
|
1286
|
+
declare function loadConfig(configPath: string): Promise<LoadConfigResult>;
|
|
1055
1287
|
interface LoadConfigResult {
|
|
1056
|
-
/**
|
|
1057
|
-
|
|
1058
|
-
* `default`). Filtered by `options.include` when provided.
|
|
1059
|
-
*/
|
|
1060
|
-
exports: Record<string, unknown>;
|
|
1288
|
+
/** The default export of the config module. */
|
|
1289
|
+
config: unknown;
|
|
1061
1290
|
/**
|
|
1062
1291
|
* Absolute file paths imported while resolving the config.
|
|
1063
1292
|
* `cf-worker` entrypoints are NOT included — they are
|
|
@@ -1087,41 +1316,27 @@ interface LoadConfigResult {
|
|
|
1087
1316
|
declare function registerConfigHooks(): () => void;
|
|
1088
1317
|
//#endregion
|
|
1089
1318
|
//#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
|
-
*/
|
|
1319
|
+
type ConfigParseResult = z.ZodSafeParseSuccess<ParsedInputConfig> | z.ZodSafeParseError<unknown>;
|
|
1320
|
+
type ConfigSettingsParseResult = z.ZodSafeParseSuccess<ParsedInputSettingsConfig> | z.ZodSafeParseError<unknown>;
|
|
1321
|
+
interface LoadAndParseConfigResult {
|
|
1322
|
+
/** Zod result for the parsed configuration. */
|
|
1107
1323
|
result: ConfigParseResult;
|
|
1108
1324
|
/** Transitive deps imported while resolving the config (node_modules excluded). */
|
|
1109
1325
|
dependencies: Set<string>;
|
|
1110
1326
|
}
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
}): Promise<LoadAndValidateConfigResult>;
|
|
1327
|
+
interface LoadAndParseConfigSettingsResult {
|
|
1328
|
+
/** Zod result containing only account and compliance settings. */
|
|
1329
|
+
result: ConfigSettingsParseResult;
|
|
1330
|
+
/** Transitive deps imported while resolving the config (node_modules excluded). */
|
|
1331
|
+
dependencies: Set<string>;
|
|
1332
|
+
}
|
|
1333
|
+
/** Resolve and parse the default configuration export. */
|
|
1334
|
+
declare function resolveAndParseConfig(input: unknown, ctx: ConfigContext): Promise<ConfigParseResult>;
|
|
1335
|
+
/** Resolve and parse only the account settings in a configuration definition. */
|
|
1336
|
+
declare function resolveAndParseConfigSettings(input: unknown, ctx: ConfigContext): Promise<ConfigSettingsParseResult>;
|
|
1337
|
+
/** Load and parse `cloudflare.config.ts`'s default export. */
|
|
1338
|
+
declare function loadAndParseConfig(configPath: string, ctx: ConfigContext): Promise<LoadAndParseConfigResult>;
|
|
1339
|
+
/** Load and parse only account settings from the default export. */
|
|
1340
|
+
declare function loadAndParseConfigSettings(configPath: string, ctx: ConfigContext): Promise<LoadAndParseConfigSettingsResult>;
|
|
1126
1341
|
//#endregion
|
|
1127
|
-
export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, AnalyticsEngineDatasetBindingSchema, ArtifactsBinding, AssetsBinding, AssetsSchema, BindingDevOptions, BindingSchema, Bindings, BrowserBinding, BrowserBindingSchema, ConfigContext, type ConfigParseResult, ConnectTrigger, ContainerConfig,
|
|
1342
|
+
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, bindings, convertToWranglerConfig, defineConfig, defineContainer, defineWorker, exports, generateTypes, loadAndParseConfig, loadAndParseConfigSettings, loadConfig, registerConfigHooks, resolveAndParseConfig, resolveAndParseConfigSettings, triggers, validateSingletonBindings };
|