@cloudflare/config 0.9.0 → 0.11.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 +23 -175
- package/dist/index.mjs +111 -2463
- package/dist/{public-CN_InYwn.d.mts → public-E85Be_2R.d.mts} +1298 -1365
- package/dist/{public-BwQqexwo.mjs → public-bN7EDGtD.mjs} +19 -48
- package/dist/public.d.mts +2 -2
- package/dist/public.mjs +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as WorkerConfig, A as SecretsStoreSecretBinding, B as VersionMetadataBinding, C as MediaBinding, D as R2Binding, E as QueueBinding, F as TypedKvBinding, G as WorkerLoaderBinding, H as VpcServiceBinding, I as TypedPipelineBinding, J as bindings, K as WorkerReference, L as TypedQueueBinding, M as StreamBinding, N as TextBinding, O as RateLimitBinding, P as TypedAiBinding, Q as SettingsConfig, R as UnsafeBinding, S as LogfwdrBinding, T as PipelineBinding, U as WebSearchBinding, V as VpcNetworkBinding, W as WorkerBinding, X as WorkerConfigInput, Y as WorkerConfigExport, Z as defineWorker, _ as FlagshipBinding, _t as InferDurableNamespaces, a as AiBinding, at as Triggers, b as JsonBinding, bt as UnwrapConfig, 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 ConfigContext, 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 WorkflowBinding, 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 InferEnv, w as MtlsCertificateBinding, x as KvBinding, y as ImagesBinding, yt as InferMainModule, z as VectorizeBinding } from "./public-E85Be_2R.mjs";
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
import { RawConfig } from "@cloudflare/workers-utils";
|
|
4
4
|
|
|
@@ -486,6 +486,7 @@ declare const InputWorkerSchema: z.ZodObject<{
|
|
|
486
486
|
observability: z.ZodOptional<z.ZodObject<{
|
|
487
487
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
488
488
|
headSamplingRate: z.ZodOptional<z.ZodNumber>;
|
|
489
|
+
redactQueryString: z.ZodOptional<z.ZodBoolean>;
|
|
489
490
|
logs: z.ZodOptional<z.ZodObject<{
|
|
490
491
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
491
492
|
headSamplingRate: z.ZodOptional<z.ZodNumber>;
|
|
@@ -587,176 +588,6 @@ declare const OutputSettingsSchema: z.ZodObject<{
|
|
|
587
588
|
mode: z.ZodOptional<z.ZodString>;
|
|
588
589
|
}, z.core.$strict>;
|
|
589
590
|
type ParsedOutputSettingsConfig = z.output<typeof OutputSettingsSchema>;
|
|
590
|
-
/**
|
|
591
|
-
* Schema for the resolved config exports, keyed by export
|
|
592
|
-
* name. Each value is discriminated on its `type` field. Reserves the
|
|
593
|
-
* `settings` export name exclusively for settings configs: a `settings`
|
|
594
|
-
* config must live on the `settings` export, and the `settings` export
|
|
595
|
-
* may only hold a `settings` config.
|
|
596
|
-
*/
|
|
597
|
-
declare const ConfigExportsSchema: z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodObject<{
|
|
598
|
-
settings: z.ZodOptional<z.ZodObject<{
|
|
599
|
-
type: z.ZodLiteral<"settings">;
|
|
600
|
-
accountId: z.ZodOptional<z.ZodString>;
|
|
601
|
-
complianceRegion: z.ZodOptional<z.ZodEnum<{
|
|
602
|
-
public: "public";
|
|
603
|
-
"fedramp-high": "fedramp-high";
|
|
604
|
-
}>>;
|
|
605
|
-
}, z.core.$strict>>;
|
|
606
|
-
}, z.core.$catchall<z.ZodObject<{
|
|
607
|
-
type: z.ZodLiteral<"worker">;
|
|
608
|
-
name: z.ZodString;
|
|
609
|
-
compatibilityDate: z.ZodString;
|
|
610
|
-
compatibilityFlags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
611
|
-
assets: z.ZodOptional<z.ZodObject<{
|
|
612
|
-
htmlHandling: z.ZodOptional<z.ZodEnum<{
|
|
613
|
-
"auto-trailing-slash": "auto-trailing-slash";
|
|
614
|
-
"drop-trailing-slash": "drop-trailing-slash";
|
|
615
|
-
"force-trailing-slash": "force-trailing-slash";
|
|
616
|
-
none: "none";
|
|
617
|
-
}>>;
|
|
618
|
-
notFoundHandling: z.ZodOptional<z.ZodEnum<{
|
|
619
|
-
none: "none";
|
|
620
|
-
"single-page-application": "single-page-application";
|
|
621
|
-
"404-page": "404-page";
|
|
622
|
-
}>>;
|
|
623
|
-
runWorkerFirst: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodBoolean]>>;
|
|
624
|
-
}, z.core.$strict>>;
|
|
625
|
-
domains: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
626
|
-
triggers: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
627
|
-
type: z.ZodLiteral<"email">;
|
|
628
|
-
addresses: z.ZodArray<z.ZodString>;
|
|
629
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
630
|
-
type: z.ZodLiteral<"fetch">;
|
|
631
|
-
pattern: z.ZodString;
|
|
632
|
-
zone: z.ZodOptional<z.ZodString>;
|
|
633
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
634
|
-
type: z.ZodLiteral<"queue">;
|
|
635
|
-
name: z.ZodString;
|
|
636
|
-
deadLetterQueue: z.ZodOptional<z.ZodString>;
|
|
637
|
-
maxBatchSize: z.ZodOptional<z.ZodNumber>;
|
|
638
|
-
maxBatchTimeout: z.ZodOptional<z.ZodNumber>;
|
|
639
|
-
maxConcurrency: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
640
|
-
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
641
|
-
retryDelay: z.ZodOptional<z.ZodNumber>;
|
|
642
|
-
visibilityTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
643
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
644
|
-
type: z.ZodLiteral<"scheduled">;
|
|
645
|
-
schedule: z.ZodString;
|
|
646
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
647
|
-
type: z.ZodLiteral<"connect">;
|
|
648
|
-
protocol: z.ZodEnum<{
|
|
649
|
-
tcp: "tcp";
|
|
650
|
-
}>;
|
|
651
|
-
port: z.ZodNumber;
|
|
652
|
-
address: z.ZodOptional<z.ZodString>;
|
|
653
|
-
}, z.core.$strict>], "type">>>;
|
|
654
|
-
tailConsumers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
655
|
-
worker: z.ZodString;
|
|
656
|
-
streaming: z.ZodOptional<z.ZodBoolean>;
|
|
657
|
-
}, z.core.$strict>>>;
|
|
658
|
-
cache: z.ZodOptional<z.ZodObject<{
|
|
659
|
-
enabled: z.ZodBoolean;
|
|
660
|
-
crossVersionCache: z.ZodOptional<z.ZodBoolean>;
|
|
661
|
-
}, z.core.$strict>>;
|
|
662
|
-
placement: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
663
|
-
mode: z.ZodEnum<{
|
|
664
|
-
off: "off";
|
|
665
|
-
smart: "smart";
|
|
666
|
-
}>;
|
|
667
|
-
hint: z.ZodOptional<z.ZodString>;
|
|
668
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
669
|
-
mode: z.ZodOptional<z.ZodLiteral<"targeted">>;
|
|
670
|
-
region: z.ZodString;
|
|
671
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
672
|
-
mode: z.ZodOptional<z.ZodLiteral<"targeted">>;
|
|
673
|
-
host: z.ZodString;
|
|
674
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
675
|
-
mode: z.ZodOptional<z.ZodLiteral<"targeted">>;
|
|
676
|
-
hostname: z.ZodString;
|
|
677
|
-
}, z.core.$strict>]>>;
|
|
678
|
-
limits: z.ZodOptional<z.ZodObject<{
|
|
679
|
-
cpuMs: z.ZodOptional<z.ZodNumber>;
|
|
680
|
-
subrequests: z.ZodOptional<z.ZodNumber>;
|
|
681
|
-
}, z.core.$strict>>;
|
|
682
|
-
logpush: z.ZodOptional<z.ZodBoolean>;
|
|
683
|
-
observability: z.ZodOptional<z.ZodObject<{
|
|
684
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
685
|
-
headSamplingRate: z.ZodOptional<z.ZodNumber>;
|
|
686
|
-
logs: z.ZodOptional<z.ZodObject<{
|
|
687
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
688
|
-
headSamplingRate: z.ZodOptional<z.ZodNumber>;
|
|
689
|
-
invocationLogs: z.ZodOptional<z.ZodBoolean>;
|
|
690
|
-
persist: z.ZodOptional<z.ZodBoolean>;
|
|
691
|
-
destinations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
692
|
-
}, z.core.$strict>>;
|
|
693
|
-
traces: z.ZodOptional<z.ZodObject<{
|
|
694
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
695
|
-
headSamplingRate: z.ZodOptional<z.ZodNumber>;
|
|
696
|
-
persist: z.ZodOptional<z.ZodBoolean>;
|
|
697
|
-
destinations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
698
|
-
}, z.core.$strict>>;
|
|
699
|
-
}, z.core.$strict>>;
|
|
700
|
-
workersDev: z.ZodOptional<z.ZodBoolean>;
|
|
701
|
-
previewUrls: z.ZodOptional<z.ZodBoolean>;
|
|
702
|
-
firstPartyWorker: z.ZodOptional<z.ZodBoolean>;
|
|
703
|
-
unsafe: z.ZodOptional<z.ZodObject<{
|
|
704
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
705
|
-
capnp: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
706
|
-
basePath: z.ZodString;
|
|
707
|
-
sourceSchemas: z.ZodArray<z.ZodString>;
|
|
708
|
-
compiledSchema: z.ZodOptional<z.ZodNever>;
|
|
709
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
710
|
-
basePath: z.ZodOptional<z.ZodNever>;
|
|
711
|
-
sourceSchemas: z.ZodOptional<z.ZodNever>;
|
|
712
|
-
compiledSchema: z.ZodString;
|
|
713
|
-
}, z.core.$strict>]>>;
|
|
714
|
-
}, z.core.$strict>>;
|
|
715
|
-
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<BindingOutput, BindingInput, z.core.$ZodTypeInternals<BindingOutput, BindingInput>>>>;
|
|
716
|
-
exports: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
717
|
-
type: z.ZodLiteral<"durable-object">;
|
|
718
|
-
state: z.ZodOptional<z.ZodLiteral<"created">>;
|
|
719
|
-
container: z.ZodOptional<z.ZodString>;
|
|
720
|
-
storage: z.ZodLiteral<"sqlite">;
|
|
721
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
722
|
-
type: z.ZodLiteral<"durable-object">;
|
|
723
|
-
state: z.ZodOptional<z.ZodLiteral<"created">>;
|
|
724
|
-
storage: z.ZodLiteral<"legacy-kv">;
|
|
725
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
726
|
-
type: z.ZodLiteral<"durable-object">;
|
|
727
|
-
state: z.ZodLiteral<"deleted">;
|
|
728
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
729
|
-
type: z.ZodLiteral<"durable-object">;
|
|
730
|
-
state: z.ZodLiteral<"renamed">;
|
|
731
|
-
renamedTo: z.ZodString;
|
|
732
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
733
|
-
type: z.ZodLiteral<"durable-object">;
|
|
734
|
-
state: z.ZodLiteral<"transferred">;
|
|
735
|
-
transferredTo: z.ZodString;
|
|
736
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
737
|
-
type: z.ZodLiteral<"durable-object">;
|
|
738
|
-
state: z.ZodLiteral<"expecting-transfer">;
|
|
739
|
-
transferFrom: z.ZodString;
|
|
740
|
-
container: z.ZodOptional<z.ZodString>;
|
|
741
|
-
storage: z.ZodLiteral<"sqlite">;
|
|
742
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
743
|
-
type: z.ZodLiteral<"durable-object">;
|
|
744
|
-
state: z.ZodLiteral<"expecting-transfer">;
|
|
745
|
-
transferFrom: z.ZodString;
|
|
746
|
-
storage: z.ZodLiteral<"legacy-kv">;
|
|
747
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
748
|
-
type: z.ZodLiteral<"worker">;
|
|
749
|
-
cache: z.ZodOptional<z.ZodObject<{
|
|
750
|
-
enabled: z.ZodBoolean;
|
|
751
|
-
}, z.core.$strict>>;
|
|
752
|
-
}, z.core.$strict>]>>>;
|
|
753
|
-
entrypoint: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
754
|
-
default: z.ZodString;
|
|
755
|
-
}, z.core.$strict>]>, z.ZodTransform<string, string | {
|
|
756
|
-
default: string;
|
|
757
|
-
}>>>;
|
|
758
|
-
}, z.core.$strict>>>>;
|
|
759
|
-
type ParsedConfigExports = z.output<typeof ConfigExportsSchema>;
|
|
760
591
|
declare const ModuleTypeSchema: z.ZodEnum<{
|
|
761
592
|
json: "json";
|
|
762
593
|
text: "text";
|
|
@@ -854,6 +685,7 @@ declare const OutputWorkerSchema: z.ZodObject<{
|
|
|
854
685
|
observability: z.ZodOptional<z.ZodObject<{
|
|
855
686
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
856
687
|
headSamplingRate: z.ZodOptional<z.ZodNumber>;
|
|
688
|
+
redactQueryString: z.ZodOptional<z.ZodBoolean>;
|
|
857
689
|
logs: z.ZodOptional<z.ZodObject<{
|
|
858
690
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
859
691
|
headSamplingRate: z.ZodOptional<z.ZodNumber>;
|
|
@@ -922,6 +754,10 @@ declare const OutputWorkerSchema: z.ZodObject<{
|
|
|
922
754
|
}, z.core.$strict>>;
|
|
923
755
|
}, z.core.$strict>]>>>;
|
|
924
756
|
manifest: z.ZodOptional<z.ZodObject<{
|
|
757
|
+
type: z.ZodEnum<{
|
|
758
|
+
partial: "partial";
|
|
759
|
+
complete: "complete";
|
|
760
|
+
}>;
|
|
925
761
|
mainModule: z.ZodString;
|
|
926
762
|
modules: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
927
763
|
type: z.ZodEnum<{
|
|
@@ -1051,20 +887,32 @@ interface LoadConfigResult {
|
|
|
1051
887
|
declare function registerConfigHooks(): () => void;
|
|
1052
888
|
//#endregion
|
|
1053
889
|
//#region src/config-loader.d.ts
|
|
890
|
+
type ParsedConfigExports = {
|
|
891
|
+
settings?: ParsedInputSettingsConfig;
|
|
892
|
+
} & Record<string, ParsedInputWorkerConfig>;
|
|
893
|
+
type ConfigParseResult = z.ZodSafeParseSuccess<ParsedConfigExports> | z.ZodSafeParseError<unknown>;
|
|
1054
894
|
interface LoadAndValidateConfigResult {
|
|
1055
895
|
/**
|
|
1056
|
-
* Zod result for the
|
|
896
|
+
* Zod result for the parsed exports record, keyed by JS export name.
|
|
1057
897
|
* Consumers format `result.error` themselves.
|
|
1058
898
|
*/
|
|
1059
|
-
result:
|
|
899
|
+
result: ConfigParseResult;
|
|
1060
900
|
/** Transitive deps imported while resolving the config (node_modules excluded). */
|
|
1061
901
|
dependencies: Set<string>;
|
|
1062
902
|
}
|
|
1063
903
|
/**
|
|
1064
|
-
*
|
|
904
|
+
* Resolve and validate loaded `cloudflare.config.ts` exports.
|
|
905
|
+
*
|
|
906
|
+
* Config inputs are resolved once by identity. Top-level Worker exports are
|
|
907
|
+
* also parsed once by identity; unexported references are resolved only far
|
|
908
|
+
* enough to replace the reference with the Worker's name.
|
|
909
|
+
*/
|
|
910
|
+
declare function resolveAndValidateConfigExports(exports: Record<string, unknown>, ctx: ConfigContext): Promise<ConfigParseResult>;
|
|
911
|
+
/**
|
|
912
|
+
* Load a `cloudflare.config.ts`, resolve all exports, and validate them.
|
|
1065
913
|
*/
|
|
1066
914
|
declare function loadAndValidateConfig(configPath: string, ctx: ConfigContext, options?: {
|
|
1067
915
|
include?: string[];
|
|
1068
916
|
}): Promise<LoadAndValidateConfigResult>;
|
|
1069
917
|
//#endregion
|
|
1070
|
-
export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, AnalyticsEngineDatasetBindingSchema, ArtifactsBinding, AssetsBinding, AssetsSchema, BindingDevOptions, BindingSchema, Bindings, BrowserBinding, BrowserBindingSchema, ConfigContext,
|
|
918
|
+
export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, AnalyticsEngineDatasetBindingSchema, ArtifactsBinding, AssetsBinding, AssetsSchema, BindingDevOptions, BindingSchema, Bindings, BrowserBinding, BrowserBindingSchema, ConfigContext, type ConfigParseResult, ConnectTrigger, 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, InputSettingsSchema, InputWorkerSchema, JsonBinding, KVBindingSchema, KnownBindingSchema, KvBinding, type LoadAndValidateConfigResult, type LoadConfigResult, LogfwdrBinding, MediaBinding, type ModuleType, ModuleTypeSchema, MtlsCertificateBinding, OutputSettingsSchema, OutputWorkerSchema, type ParsedConfigExports, type ParsedInputSettingsConfig, type ParsedInputWorkerConfig, 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, WebSearchBinding, WorkerBinding, WorkerBindingSchema, WorkerConfig, WorkerConfigExport, WorkerConfigInput, WorkerEntrypointExport, WorkerEntrypointExportOptions, WorkerEntrypointExportSchema, WorkerLoaderBinding, WorkerReference, WorkflowBinding, bindings, convertToWranglerConfig, defineSettings, defineWorker, exports, generateTypes, loadAndValidateConfig, loadConfig, registerConfigHooks, resolveAndValidateConfigExports, triggers, validateSingletonBindings };
|