@cloudflare/config 0.5.0 → 0.7.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
|
|
1
|
+
import { $ as R2Binding, A as triggers, B as D1Binding, C as exports, D as QueueConsumerTrigger, E as FetchTrigger, F as AnalyticsEngineDatasetBinding, G as ImagesBinding, H as DurableObjectBinding, I as ArtifactsBinding, J as LogfwdrBinding, K as JsonBinding, L as AssetsBinding, M as AiBinding, N as AiSearchBinding, O as ScheduledTrigger, P as AiSearchNamespaceBinding, Q as QueueBinding, R as Bindings, S as WorkerEntrypointExportOptions, St as bindings, T as EmailTrigger, U as FlagshipBinding, V as DispatchNamespaceBinding, W as HyperdriveBinding, X as MtlsCertificateBinding, Y as MediaBinding, Z as PipelineBinding, _ as DurableObjectExpectingTransferExport, _t as VpcServiceBinding, a as InferMainModule, at as TextBinding, b as Exports, bt as WorkerLoaderBinding, c as WorkerConfigExport, ct as TypedKvBinding, d as SettingsConfig, dt as TypedWorkerBinding, et as RateLimitBinding, f as WorkerConfig, ft as TypedWorkflowBinding, g as DurableObjectDeletedExport, gt as VpcNetworkBinding, h as DurableObjectCreatedExport, ht as VersionMetadataBinding, i as InferEnv, it as StreamBinding, j as AgentMemoryBinding, k as Triggers, l as WorkerConfigInput, lt as TypedPipelineBinding, m as resolveExportDefinition, mt as VectorizeBinding, n as defineSettings, nt as SecretsStoreSecretBinding, o as UnwrapConfig, ot as TypedAiBinding, p as ConfigContext, pt as UnsafeBinding, q as KvBinding, r as InferDurableNamespaces, rt as SendEmailBinding, s as TypedWorkerDefinition, st as TypedDurableObjectBinding, t as SettingsConfigInput, tt as SecretBinding, u as defineWorker, ut as TypedQueueBinding, v as DurableObjectRenamedExport, vt as WebSearchBinding, w as ConnectTrigger, x as WorkerEntrypointExport, xt as WorkflowBinding, y as DurableObjectTransferredExport, yt as WorkerBinding, z as BrowserBinding } from "./public-CCrtkZee.mjs";
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
import { RawConfig } from "@cloudflare/workers-utils";
|
|
4
4
|
|
|
@@ -50,6 +50,16 @@ declare const R2BindingSchema: z.ZodObject<{
|
|
|
50
50
|
name: z.ZodOptional<z.ZodString>;
|
|
51
51
|
jurisdiction: z.ZodOptional<z.ZodString>;
|
|
52
52
|
remote: z.ZodOptional<z.ZodBoolean>;
|
|
53
|
+
localDev: z.ZodOptional<z.ZodObject<{
|
|
54
|
+
experimentalS3Credentials: z.ZodOptional<z.ZodObject<{
|
|
55
|
+
accessKeyId: z.ZodString;
|
|
56
|
+
secretAccessKey: z.ZodString;
|
|
57
|
+
}, z.core.$strip>>;
|
|
58
|
+
}, z.core.$strict>>;
|
|
59
|
+
}, z.core.$strict>;
|
|
60
|
+
declare const AnalyticsEngineDatasetBindingSchema: z.ZodObject<{
|
|
61
|
+
type: z.ZodLiteral<"analytics-engine-dataset">;
|
|
62
|
+
name: z.ZodOptional<z.ZodString>;
|
|
53
63
|
}, z.core.$strict>;
|
|
54
64
|
declare const FlagshipBindingSchema: z.ZodObject<{
|
|
55
65
|
type: z.ZodLiteral<"flagship">;
|
|
@@ -154,6 +164,12 @@ declare const KnownBindingSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
154
164
|
name: z.ZodOptional<z.ZodString>;
|
|
155
165
|
jurisdiction: z.ZodOptional<z.ZodString>;
|
|
156
166
|
remote: z.ZodOptional<z.ZodBoolean>;
|
|
167
|
+
localDev: z.ZodOptional<z.ZodObject<{
|
|
168
|
+
experimentalS3Credentials: z.ZodOptional<z.ZodObject<{
|
|
169
|
+
accessKeyId: z.ZodString;
|
|
170
|
+
secretAccessKey: z.ZodString;
|
|
171
|
+
}, z.core.$strip>>;
|
|
172
|
+
}, z.core.$strict>>;
|
|
157
173
|
}, z.core.$strict>, z.ZodObject<{
|
|
158
174
|
type: z.ZodLiteral<"secret">;
|
|
159
175
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -222,6 +238,7 @@ declare const DurableObjectCreatedExportSchema: z.ZodObject<{
|
|
|
222
238
|
sqlite: "sqlite";
|
|
223
239
|
"legacy-kv": "legacy-kv";
|
|
224
240
|
}>;
|
|
241
|
+
container: z.ZodOptional<z.ZodString>;
|
|
225
242
|
}, z.core.$strict>;
|
|
226
243
|
declare const DurableObjectDeletedExportSchema: z.ZodObject<{
|
|
227
244
|
type: z.ZodLiteral<"durable-object">;
|
|
@@ -245,6 +262,7 @@ declare const DurableObjectExpectingTransferExportSchema: z.ZodObject<{
|
|
|
245
262
|
"legacy-kv": "legacy-kv";
|
|
246
263
|
}>;
|
|
247
264
|
transferFrom: z.ZodString;
|
|
265
|
+
container: z.ZodOptional<z.ZodString>;
|
|
248
266
|
}, z.core.$strict>;
|
|
249
267
|
declare const WorkerEntrypointExportSchema: z.ZodObject<{
|
|
250
268
|
type: z.ZodLiteral<"worker">;
|
|
@@ -255,10 +273,12 @@ declare const WorkerEntrypointExportSchema: z.ZodObject<{
|
|
|
255
273
|
declare const ExportSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
256
274
|
type: z.ZodLiteral<"durable-object">;
|
|
257
275
|
state: z.ZodOptional<z.ZodLiteral<"created">>;
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
276
|
+
container: z.ZodOptional<z.ZodString>;
|
|
277
|
+
storage: z.ZodLiteral<"sqlite">;
|
|
278
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
279
|
+
type: z.ZodLiteral<"durable-object">;
|
|
280
|
+
state: z.ZodOptional<z.ZodLiteral<"created">>;
|
|
281
|
+
storage: z.ZodLiteral<"legacy-kv">;
|
|
262
282
|
}, z.core.$strict>, z.ZodObject<{
|
|
263
283
|
type: z.ZodLiteral<"durable-object">;
|
|
264
284
|
state: z.ZodLiteral<"deleted">;
|
|
@@ -273,11 +293,14 @@ declare const ExportSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
273
293
|
}, z.core.$strict>, z.ZodObject<{
|
|
274
294
|
type: z.ZodLiteral<"durable-object">;
|
|
275
295
|
state: z.ZodLiteral<"expecting-transfer">;
|
|
276
|
-
storage: z.ZodEnum<{
|
|
277
|
-
sqlite: "sqlite";
|
|
278
|
-
"legacy-kv": "legacy-kv";
|
|
279
|
-
}>;
|
|
280
296
|
transferFrom: z.ZodString;
|
|
297
|
+
container: z.ZodOptional<z.ZodString>;
|
|
298
|
+
storage: z.ZodLiteral<"sqlite">;
|
|
299
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
300
|
+
type: z.ZodLiteral<"durable-object">;
|
|
301
|
+
state: z.ZodLiteral<"expecting-transfer">;
|
|
302
|
+
transferFrom: z.ZodString;
|
|
303
|
+
storage: z.ZodLiteral<"legacy-kv">;
|
|
281
304
|
}, z.core.$strict>, z.ZodObject<{
|
|
282
305
|
type: z.ZodLiteral<"worker">;
|
|
283
306
|
cache: z.ZodOptional<z.ZodObject<{
|
|
@@ -333,6 +356,13 @@ declare const InputWorkerSchema: z.ZodObject<{
|
|
|
333
356
|
}, z.core.$strict>, z.ZodObject<{
|
|
334
357
|
type: z.ZodLiteral<"scheduled">;
|
|
335
358
|
schedule: z.ZodString;
|
|
359
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
360
|
+
type: z.ZodLiteral<"connect">;
|
|
361
|
+
protocol: z.ZodEnum<{
|
|
362
|
+
tcp: "tcp";
|
|
363
|
+
}>;
|
|
364
|
+
port: z.ZodNumber;
|
|
365
|
+
address: z.ZodOptional<z.ZodString>;
|
|
336
366
|
}, z.core.$strict>], "type">>>;
|
|
337
367
|
tailConsumers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
338
368
|
workerName: z.ZodString;
|
|
@@ -399,10 +429,12 @@ declare const InputWorkerSchema: z.ZodObject<{
|
|
|
399
429
|
exports: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
400
430
|
type: z.ZodLiteral<"durable-object">;
|
|
401
431
|
state: z.ZodOptional<z.ZodLiteral<"created">>;
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
432
|
+
container: z.ZodOptional<z.ZodString>;
|
|
433
|
+
storage: z.ZodLiteral<"sqlite">;
|
|
434
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
435
|
+
type: z.ZodLiteral<"durable-object">;
|
|
436
|
+
state: z.ZodOptional<z.ZodLiteral<"created">>;
|
|
437
|
+
storage: z.ZodLiteral<"legacy-kv">;
|
|
406
438
|
}, z.core.$strict>, z.ZodObject<{
|
|
407
439
|
type: z.ZodLiteral<"durable-object">;
|
|
408
440
|
state: z.ZodLiteral<"deleted">;
|
|
@@ -417,11 +449,14 @@ declare const InputWorkerSchema: z.ZodObject<{
|
|
|
417
449
|
}, z.core.$strict>, z.ZodObject<{
|
|
418
450
|
type: z.ZodLiteral<"durable-object">;
|
|
419
451
|
state: z.ZodLiteral<"expecting-transfer">;
|
|
420
|
-
storage: z.ZodEnum<{
|
|
421
|
-
sqlite: "sqlite";
|
|
422
|
-
"legacy-kv": "legacy-kv";
|
|
423
|
-
}>;
|
|
424
452
|
transferFrom: z.ZodString;
|
|
453
|
+
container: z.ZodOptional<z.ZodString>;
|
|
454
|
+
storage: z.ZodLiteral<"sqlite">;
|
|
455
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
456
|
+
type: z.ZodLiteral<"durable-object">;
|
|
457
|
+
state: z.ZodLiteral<"expecting-transfer">;
|
|
458
|
+
transferFrom: z.ZodString;
|
|
459
|
+
storage: z.ZodLiteral<"legacy-kv">;
|
|
425
460
|
}, z.core.$strict>, z.ZodObject<{
|
|
426
461
|
type: z.ZodLiteral<"worker">;
|
|
427
462
|
cache: z.ZodOptional<z.ZodObject<{
|
|
@@ -495,6 +530,13 @@ declare const ConfigExportsSchema: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUn
|
|
|
495
530
|
}, z.core.$strict>, z.ZodObject<{
|
|
496
531
|
type: z.ZodLiteral<"scheduled">;
|
|
497
532
|
schedule: z.ZodString;
|
|
533
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
534
|
+
type: z.ZodLiteral<"connect">;
|
|
535
|
+
protocol: z.ZodEnum<{
|
|
536
|
+
tcp: "tcp";
|
|
537
|
+
}>;
|
|
538
|
+
port: z.ZodNumber;
|
|
539
|
+
address: z.ZodOptional<z.ZodString>;
|
|
498
540
|
}, z.core.$strict>], "type">>>;
|
|
499
541
|
tailConsumers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
500
542
|
workerName: z.ZodString;
|
|
@@ -561,10 +603,12 @@ declare const ConfigExportsSchema: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUn
|
|
|
561
603
|
exports: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
562
604
|
type: z.ZodLiteral<"durable-object">;
|
|
563
605
|
state: z.ZodOptional<z.ZodLiteral<"created">>;
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
606
|
+
container: z.ZodOptional<z.ZodString>;
|
|
607
|
+
storage: z.ZodLiteral<"sqlite">;
|
|
608
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
609
|
+
type: z.ZodLiteral<"durable-object">;
|
|
610
|
+
state: z.ZodOptional<z.ZodLiteral<"created">>;
|
|
611
|
+
storage: z.ZodLiteral<"legacy-kv">;
|
|
568
612
|
}, z.core.$strict>, z.ZodObject<{
|
|
569
613
|
type: z.ZodLiteral<"durable-object">;
|
|
570
614
|
state: z.ZodLiteral<"deleted">;
|
|
@@ -579,11 +623,14 @@ declare const ConfigExportsSchema: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUn
|
|
|
579
623
|
}, z.core.$strict>, z.ZodObject<{
|
|
580
624
|
type: z.ZodLiteral<"durable-object">;
|
|
581
625
|
state: z.ZodLiteral<"expecting-transfer">;
|
|
582
|
-
storage: z.ZodEnum<{
|
|
583
|
-
sqlite: "sqlite";
|
|
584
|
-
"legacy-kv": "legacy-kv";
|
|
585
|
-
}>;
|
|
586
626
|
transferFrom: z.ZodString;
|
|
627
|
+
container: z.ZodOptional<z.ZodString>;
|
|
628
|
+
storage: z.ZodLiteral<"sqlite">;
|
|
629
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
630
|
+
type: z.ZodLiteral<"durable-object">;
|
|
631
|
+
state: z.ZodLiteral<"expecting-transfer">;
|
|
632
|
+
transferFrom: z.ZodString;
|
|
633
|
+
storage: z.ZodLiteral<"legacy-kv">;
|
|
587
634
|
}, z.core.$strict>, z.ZodObject<{
|
|
588
635
|
type: z.ZodLiteral<"worker">;
|
|
589
636
|
cache: z.ZodOptional<z.ZodObject<{
|
|
@@ -661,6 +708,13 @@ declare const OutputWorkerSchema: z.ZodObject<{
|
|
|
661
708
|
}, z.core.$strict>, z.ZodObject<{
|
|
662
709
|
type: z.ZodLiteral<"scheduled">;
|
|
663
710
|
schedule: z.ZodString;
|
|
711
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
712
|
+
type: z.ZodLiteral<"connect">;
|
|
713
|
+
protocol: z.ZodEnum<{
|
|
714
|
+
tcp: "tcp";
|
|
715
|
+
}>;
|
|
716
|
+
port: z.ZodNumber;
|
|
717
|
+
address: z.ZodOptional<z.ZodString>;
|
|
664
718
|
}, z.core.$strict>], "type">>>;
|
|
665
719
|
tailConsumers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
666
720
|
workerName: z.ZodString;
|
|
@@ -727,10 +781,12 @@ declare const OutputWorkerSchema: z.ZodObject<{
|
|
|
727
781
|
exports: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
728
782
|
type: z.ZodLiteral<"durable-object">;
|
|
729
783
|
state: z.ZodOptional<z.ZodLiteral<"created">>;
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
784
|
+
container: z.ZodOptional<z.ZodString>;
|
|
785
|
+
storage: z.ZodLiteral<"sqlite">;
|
|
786
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
787
|
+
type: z.ZodLiteral<"durable-object">;
|
|
788
|
+
state: z.ZodOptional<z.ZodLiteral<"created">>;
|
|
789
|
+
storage: z.ZodLiteral<"legacy-kv">;
|
|
734
790
|
}, z.core.$strict>, z.ZodObject<{
|
|
735
791
|
type: z.ZodLiteral<"durable-object">;
|
|
736
792
|
state: z.ZodLiteral<"deleted">;
|
|
@@ -745,11 +801,14 @@ declare const OutputWorkerSchema: z.ZodObject<{
|
|
|
745
801
|
}, z.core.$strict>, z.ZodObject<{
|
|
746
802
|
type: z.ZodLiteral<"durable-object">;
|
|
747
803
|
state: z.ZodLiteral<"expecting-transfer">;
|
|
748
|
-
storage: z.ZodEnum<{
|
|
749
|
-
sqlite: "sqlite";
|
|
750
|
-
"legacy-kv": "legacy-kv";
|
|
751
|
-
}>;
|
|
752
804
|
transferFrom: z.ZodString;
|
|
805
|
+
container: z.ZodOptional<z.ZodString>;
|
|
806
|
+
storage: z.ZodLiteral<"sqlite">;
|
|
807
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
808
|
+
type: z.ZodLiteral<"durable-object">;
|
|
809
|
+
state: z.ZodLiteral<"expecting-transfer">;
|
|
810
|
+
transferFrom: z.ZodString;
|
|
811
|
+
storage: z.ZodLiteral<"legacy-kv">;
|
|
753
812
|
}, z.core.$strict>, z.ZodObject<{
|
|
754
813
|
type: z.ZodLiteral<"worker">;
|
|
755
814
|
cache: z.ZodOptional<z.ZodObject<{
|
|
@@ -902,4 +961,4 @@ declare function loadAndValidateConfig(configPath: string, ctx: ConfigContext, o
|
|
|
902
961
|
include?: string[];
|
|
903
962
|
}): Promise<LoadAndValidateConfigResult>;
|
|
904
963
|
//#endregion
|
|
905
|
-
export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, ArtifactsBinding, AssetsBinding, AssetsSchema, BindingSchema, Bindings, BrowserBinding, BrowserBindingSchema, ConfigContext, ConfigExportsSchema, 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, InputWorkerSchema, JsonBinding, KVBindingSchema, KnownBindingSchema, KvBinding, type LoadAndValidateConfigResult, type LoadConfigResult, LogfwdrBinding, MediaBinding, type ModuleType, ModuleTypeSchema, MtlsCertificateBinding, OutputWorkerSchema, type ParsedConfigExports, type ParsedInputWorkerConfig, type ParsedOutputWorkerConfig, type ParsedSettingsConfig, PipelineBinding, QueueBinding, QueueBindingSchema, QueueConsumerTrigger, R2Binding, R2BindingSchema, RateLimitBinding, ScheduledTrigger, SecretBinding, SecretsStoreSecretBinding, SendEmailBinding, SettingsConfig, SettingsConfigInput, SettingsSchema, StreamBinding, TailConsumerSchema, TextBinding, Triggers, TypedAiBinding, TypedDurableObjectBinding, TypedKvBinding, TypedPipelineBinding, TypedQueueBinding, TypedWorkerBinding, TypedWorkerDefinition, TypedWorkflowBinding, UnsafeBinding, UnsafeBindingSchema, UnwrapConfig, VectorizeBinding, VersionMetadataBinding, VpcNetworkBinding, VpcServiceBinding, WebSearchBinding, WorkerBinding, WorkerBindingSchema, WorkerConfig, WorkerConfigExport, WorkerConfigInput, WorkerEntrypointExport, WorkerEntrypointExportOptions, WorkerEntrypointExportSchema, WorkerLoaderBinding, WorkflowBinding, bindings, convertToWranglerConfig, defineSettings, defineWorker, exports, generateTypes, loadAndValidateConfig, loadConfig, registerConfigHooks, resolveExportDefinition, triggers, validateSingletonBindings };
|
|
964
|
+
export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, AnalyticsEngineDatasetBindingSchema, ArtifactsBinding, AssetsBinding, AssetsSchema, BindingSchema, Bindings, BrowserBinding, BrowserBindingSchema, ConfigContext, ConfigExportsSchema, 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, InputWorkerSchema, JsonBinding, KVBindingSchema, KnownBindingSchema, KvBinding, type LoadAndValidateConfigResult, type LoadConfigResult, LogfwdrBinding, MediaBinding, type ModuleType, ModuleTypeSchema, MtlsCertificateBinding, OutputWorkerSchema, type ParsedConfigExports, type ParsedInputWorkerConfig, type ParsedOutputWorkerConfig, type ParsedSettingsConfig, PipelineBinding, QueueBinding, QueueBindingSchema, QueueConsumerTrigger, R2Binding, R2BindingSchema, RateLimitBinding, ScheduledTrigger, SecretBinding, SecretsStoreSecretBinding, SendEmailBinding, SettingsConfig, SettingsConfigInput, SettingsSchema, StreamBinding, TailConsumerSchema, TextBinding, Triggers, TypedAiBinding, TypedDurableObjectBinding, TypedKvBinding, TypedPipelineBinding, TypedQueueBinding, TypedWorkerBinding, TypedWorkerDefinition, TypedWorkflowBinding, UnsafeBinding, UnsafeBindingSchema, UnwrapConfig, VectorizeBinding, VersionMetadataBinding, VpcNetworkBinding, VpcServiceBinding, WebSearchBinding, WorkerBinding, WorkerBindingSchema, WorkerConfig, WorkerConfigExport, WorkerConfigInput, WorkerEntrypointExport, WorkerEntrypointExportOptions, WorkerEntrypointExportSchema, WorkerLoaderBinding, WorkflowBinding, bindings, convertToWranglerConfig, defineSettings, defineWorker, exports, generateTypes, loadAndValidateConfig, loadConfig, registerConfigHooks, resolveExportDefinition, triggers, validateSingletonBindings };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as triggers, i as exports$1, n as defineWorker, o as bindings, r as resolveExportDefinition, t as defineSettings } from "./public-
|
|
1
|
+
import { a as triggers, i as exports$1, n as defineWorker, o as bindings, r as resolveExportDefinition, t as defineSettings } from "./public-BwQqexwo.mjs";
|
|
2
2
|
import * as nodeModule from "node:module";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
@@ -60,7 +60,15 @@ const R2BindingSchema = z.strictObject({
|
|
|
60
60
|
type: z.literal("r2"),
|
|
61
61
|
name: z.string().optional(),
|
|
62
62
|
jurisdiction: z.string().optional(),
|
|
63
|
-
remote: z.boolean().optional()
|
|
63
|
+
remote: z.boolean().optional(),
|
|
64
|
+
localDev: z.strictObject({ experimentalS3Credentials: z.object({
|
|
65
|
+
accessKeyId: z.string(),
|
|
66
|
+
secretAccessKey: z.string()
|
|
67
|
+
}).optional() }).optional()
|
|
68
|
+
});
|
|
69
|
+
const AnalyticsEngineDatasetBindingSchema = z.strictObject({
|
|
70
|
+
type: z.literal("analytics-engine-dataset"),
|
|
71
|
+
name: z.string().optional()
|
|
64
72
|
});
|
|
65
73
|
const FlagshipBindingSchema = z.strictObject({
|
|
66
74
|
type: z.literal("flagship"),
|
|
@@ -92,10 +100,7 @@ const KnownBindingSchema = z.discriminatedUnion("type", [
|
|
|
92
100
|
namespace: z.string(),
|
|
93
101
|
remote: z.boolean().optional()
|
|
94
102
|
}),
|
|
95
|
-
|
|
96
|
-
type: z.literal("analytics-engine-dataset"),
|
|
97
|
-
name: z.string().optional()
|
|
98
|
-
}),
|
|
103
|
+
AnalyticsEngineDatasetBindingSchema,
|
|
99
104
|
z.strictObject({
|
|
100
105
|
type: z.literal("artifacts"),
|
|
101
106
|
namespace: z.string(),
|
|
@@ -266,7 +271,8 @@ const EnvSchema = z.record(z.string(), BindingSchema).superRefine(validateSingle
|
|
|
266
271
|
const DurableObjectCreatedExportSchema = z.strictObject({
|
|
267
272
|
type: z.literal("durable-object"),
|
|
268
273
|
state: z.literal("created").optional(),
|
|
269
|
-
storage: z.enum(["sqlite", "legacy-kv"])
|
|
274
|
+
storage: z.enum(["sqlite", "legacy-kv"]),
|
|
275
|
+
container: z.string().optional()
|
|
270
276
|
});
|
|
271
277
|
const DurableObjectDeletedExportSchema = z.strictObject({
|
|
272
278
|
type: z.literal("durable-object"),
|
|
@@ -286,18 +292,25 @@ const DurableObjectExpectingTransferExportSchema = z.strictObject({
|
|
|
286
292
|
type: z.literal("durable-object"),
|
|
287
293
|
state: z.literal("expecting-transfer"),
|
|
288
294
|
storage: z.enum(["sqlite", "legacy-kv"]),
|
|
289
|
-
transferFrom: z.string()
|
|
295
|
+
transferFrom: z.string(),
|
|
296
|
+
container: z.string().optional()
|
|
290
297
|
});
|
|
291
298
|
const WorkerEntrypointExportSchema = z.strictObject({
|
|
292
299
|
type: z.literal("worker"),
|
|
293
300
|
cache: z.strictObject({ enabled: z.boolean() }).optional()
|
|
294
301
|
});
|
|
302
|
+
const DurableObjectCreatedSqliteExportSchema = DurableObjectCreatedExportSchema.extend({ storage: z.literal("sqlite") });
|
|
303
|
+
const DurableObjectCreatedLegacyKvExportSchema = DurableObjectCreatedExportSchema.omit({ container: true }).extend({ storage: z.literal("legacy-kv") });
|
|
304
|
+
const DurableObjectExpectingTransferSqliteExportSchema = DurableObjectExpectingTransferExportSchema.extend({ storage: z.literal("sqlite") });
|
|
305
|
+
const DurableObjectExpectingTransferLegacyKvExportSchema = DurableObjectExpectingTransferExportSchema.omit({ container: true }).extend({ storage: z.literal("legacy-kv") });
|
|
295
306
|
const ExportSchema = z.union([
|
|
296
|
-
|
|
307
|
+
DurableObjectCreatedSqliteExportSchema,
|
|
308
|
+
DurableObjectCreatedLegacyKvExportSchema,
|
|
297
309
|
DurableObjectDeletedExportSchema,
|
|
298
310
|
DurableObjectRenamedExportSchema,
|
|
299
311
|
DurableObjectTransferredExportSchema,
|
|
300
|
-
|
|
312
|
+
DurableObjectExpectingTransferSqliteExportSchema,
|
|
313
|
+
DurableObjectExpectingTransferLegacyKvExportSchema,
|
|
301
314
|
WorkerEntrypointExportSchema
|
|
302
315
|
]);
|
|
303
316
|
const LimitsSchema = z.strictObject({
|
|
@@ -367,6 +380,12 @@ const TriggerSchema = z.discriminatedUnion("type", [
|
|
|
367
380
|
z.strictObject({
|
|
368
381
|
type: z.literal("scheduled"),
|
|
369
382
|
schedule: z.string()
|
|
383
|
+
}),
|
|
384
|
+
z.strictObject({
|
|
385
|
+
type: z.literal("connect"),
|
|
386
|
+
protocol: z.enum(["tcp"]),
|
|
387
|
+
port: z.number(),
|
|
388
|
+
address: z.string().optional()
|
|
370
389
|
})
|
|
371
390
|
]);
|
|
372
391
|
const UnsafeSchema = z.strictObject({
|
|
@@ -559,17 +578,54 @@ var __name = (target, value) => __defProp(target, "name", {
|
|
|
559
578
|
});
|
|
560
579
|
|
|
561
580
|
//#endregion
|
|
562
|
-
//#region ../workers-utils/dist/chunk-
|
|
563
|
-
function
|
|
581
|
+
//#region ../workers-utils/dist/chunk-QFKPUV4H.mjs
|
|
582
|
+
function hasKnownExportType(entry) {
|
|
583
|
+
const type = entry?.type;
|
|
584
|
+
return type === "durable-object" || type === "worker";
|
|
585
|
+
}
|
|
586
|
+
__name(hasKnownExportType, "hasKnownExportType");
|
|
587
|
+
function partitionExports(exports$1$1) {
|
|
564
588
|
const partitioned = {
|
|
565
589
|
"durable-object": {},
|
|
566
590
|
worker: {}
|
|
567
591
|
};
|
|
568
|
-
if (exports$
|
|
569
|
-
for (const [name, entry] of Object.entries(exports$
|
|
592
|
+
if (exports$1$1 === void 0) return partitioned;
|
|
593
|
+
for (const [name, entry] of Object.entries(exports$1$1)) {
|
|
594
|
+
if (!hasKnownExportType(entry)) continue;
|
|
595
|
+
partitioned[entry.type][name] = entry;
|
|
596
|
+
}
|
|
570
597
|
return partitioned;
|
|
571
598
|
}
|
|
572
599
|
__name(partitionExports, "partitionExports");
|
|
600
|
+
function getDurableObjectExports(exports$1$1) {
|
|
601
|
+
return partitionExports(exports$1$1)["durable-object"];
|
|
602
|
+
}
|
|
603
|
+
__name(getDurableObjectExports, "getDurableObjectExports");
|
|
604
|
+
function hasDurableObjectExports(exports$1$1) {
|
|
605
|
+
return Object.keys(getDurableObjectExports(exports$1$1)).length > 0;
|
|
606
|
+
}
|
|
607
|
+
__name(hasDurableObjectExports, "hasDurableObjectExports");
|
|
608
|
+
function getContainerNameToClassNameMap(exports$1$1) {
|
|
609
|
+
const containerNameToClassName = /* @__PURE__ */ new Map();
|
|
610
|
+
for (const [className, entry] of Object.entries(getDurableObjectExports(exports$1$1))) if ("container" in entry && typeof entry.container === "string" && !containerNameToClassName.has(entry.container)) containerNameToClassName.set(entry.container, className);
|
|
611
|
+
return containerNameToClassName;
|
|
612
|
+
}
|
|
613
|
+
__name(getContainerNameToClassNameMap, "getContainerNameToClassNameMap");
|
|
614
|
+
function resolveContainerClassName(container, exports$1$1) {
|
|
615
|
+
if (container.class_name !== void 0) return container.class_name;
|
|
616
|
+
if (container.name === void 0) return;
|
|
617
|
+
return getContainerNameToClassNameMap(exports$1$1).get(container.name);
|
|
618
|
+
}
|
|
619
|
+
__name(resolveContainerClassName, "resolveContainerClassName");
|
|
620
|
+
function getContainerDurableObjectClassNames(containers, exports$1$1) {
|
|
621
|
+
const classNames = /* @__PURE__ */ new Set();
|
|
622
|
+
for (const container of containers ?? []) {
|
|
623
|
+
const className = resolveContainerClassName(container, exports$1$1);
|
|
624
|
+
if (className !== void 0) classNames.add(className);
|
|
625
|
+
}
|
|
626
|
+
return classNames;
|
|
627
|
+
}
|
|
628
|
+
__name(getContainerDurableObjectClassNames, "getContainerDurableObjectClassNames");
|
|
573
629
|
var UserError = class extends Error {
|
|
574
630
|
static {
|
|
575
631
|
__name(this, "UserError");
|
|
@@ -3303,14 +3359,17 @@ function convertBindingsAndAssets(config, result) {
|
|
|
3303
3359
|
simple: binding.simple
|
|
3304
3360
|
});
|
|
3305
3361
|
break;
|
|
3306
|
-
case "r2":
|
|
3362
|
+
case "r2": {
|
|
3363
|
+
const experimentalS3Credentials = binding.localDev?.experimentalS3Credentials;
|
|
3307
3364
|
r2Buckets.push(omitUndefined({
|
|
3308
3365
|
binding: name,
|
|
3309
3366
|
bucket_name: binding.name,
|
|
3310
3367
|
jurisdiction: binding.jurisdiction,
|
|
3311
|
-
remote: binding.remote
|
|
3368
|
+
remote: binding.remote,
|
|
3369
|
+
local_dev: experimentalS3Credentials === void 0 ? void 0 : { experimental_s3_credentials: experimentalS3Credentials }
|
|
3312
3370
|
}));
|
|
3313
3371
|
break;
|
|
3372
|
+
}
|
|
3314
3373
|
case "secret":
|
|
3315
3374
|
secretsRequired.push(name);
|
|
3316
3375
|
break;
|
|
@@ -3450,7 +3509,8 @@ function convertExports(config, result) {
|
|
|
3450
3509
|
case "created":
|
|
3451
3510
|
converted[exportName] = {
|
|
3452
3511
|
type: "durable-object",
|
|
3453
|
-
storage: value.storage
|
|
3512
|
+
storage: value.storage,
|
|
3513
|
+
...value.storage === "sqlite" && value.container !== void 0 && { container: value.container }
|
|
3454
3514
|
};
|
|
3455
3515
|
break;
|
|
3456
3516
|
case "deleted":
|
|
@@ -3478,7 +3538,8 @@ function convertExports(config, result) {
|
|
|
3478
3538
|
type: "durable-object",
|
|
3479
3539
|
state: "expecting-transfer",
|
|
3480
3540
|
storage: value.storage,
|
|
3481
|
-
transfer_from: value.transferFrom
|
|
3541
|
+
transfer_from: value.transferFrom,
|
|
3542
|
+
...value.storage === "sqlite" && value.container !== void 0 && { container: value.container }
|
|
3482
3543
|
};
|
|
3483
3544
|
break;
|
|
3484
3545
|
}
|
|
@@ -3492,6 +3553,7 @@ function convertTriggers(config, result) {
|
|
|
3492
3553
|
const crons = [];
|
|
3493
3554
|
const routes = result.routes ? [...result.routes] : [];
|
|
3494
3555
|
const queueConsumers = result.queues?.consumers ? [...result.queues.consumers] : [];
|
|
3556
|
+
const connectHandlers = result.connect ? [...result.connect] : [];
|
|
3495
3557
|
let addresses;
|
|
3496
3558
|
for (const trigger of triggers$1) switch (trigger.type) {
|
|
3497
3559
|
case "email":
|
|
@@ -3524,6 +3586,13 @@ function convertTriggers(config, result) {
|
|
|
3524
3586
|
visibility_timeout_ms: trigger.visibilityTimeoutMs
|
|
3525
3587
|
}));
|
|
3526
3588
|
break;
|
|
3589
|
+
case "connect":
|
|
3590
|
+
connectHandlers.push(omitUndefined({
|
|
3591
|
+
protocol: trigger.protocol,
|
|
3592
|
+
port: trigger.port,
|
|
3593
|
+
address: trigger.address
|
|
3594
|
+
}));
|
|
3595
|
+
break;
|
|
3527
3596
|
}
|
|
3528
3597
|
if (crons.length) result.triggers = { crons };
|
|
3529
3598
|
if (routes.length) result.routes = routes;
|
|
@@ -3531,6 +3600,7 @@ function convertTriggers(config, result) {
|
|
|
3531
3600
|
...result.queues ?? {},
|
|
3532
3601
|
consumers: queueConsumers
|
|
3533
3602
|
};
|
|
3603
|
+
if (connectHandlers.length) result.connect = connectHandlers;
|
|
3534
3604
|
if (addresses !== void 0) result.addresses = addresses;
|
|
3535
3605
|
}
|
|
3536
3606
|
function convertDomains(config, result) {
|
|
@@ -3706,4 +3776,4 @@ async function loadAndValidateConfig(configPath, ctx, options) {
|
|
|
3706
3776
|
}
|
|
3707
3777
|
|
|
3708
3778
|
//#endregion
|
|
3709
|
-
export { AssetsSchema, BindingSchema, BrowserBindingSchema, ConfigExportsSchema, D1BindingSchema, DurableObjectCreatedExportSchema, DurableObjectDeletedExportSchema, DurableObjectExpectingTransferExportSchema, DurableObjectRenamedExportSchema, DurableObjectTransferredExportSchema, ExportSchema, FlagshipBindingSchema, HyperdriveBindingSchema, InputWorkerSchema, KVBindingSchema, KnownBindingSchema, ModuleTypeSchema, OutputWorkerSchema, QueueBindingSchema, R2BindingSchema, SettingsSchema, TailConsumerSchema, UnsafeBindingSchema, WorkerBindingSchema, WorkerEntrypointExportSchema, bindings, convertToWranglerConfig, defineSettings, defineWorker, exports$1 as exports, generateTypes, loadAndValidateConfig, loadConfig, registerConfigHooks, resolveExportDefinition, triggers, validateSingletonBindings };
|
|
3779
|
+
export { AnalyticsEngineDatasetBindingSchema, AssetsSchema, BindingSchema, BrowserBindingSchema, ConfigExportsSchema, D1BindingSchema, DurableObjectCreatedExportSchema, DurableObjectDeletedExportSchema, DurableObjectExpectingTransferExportSchema, DurableObjectRenamedExportSchema, DurableObjectTransferredExportSchema, ExportSchema, FlagshipBindingSchema, HyperdriveBindingSchema, InputWorkerSchema, KVBindingSchema, KnownBindingSchema, ModuleTypeSchema, OutputWorkerSchema, QueueBindingSchema, R2BindingSchema, SettingsSchema, TailConsumerSchema, UnsafeBindingSchema, WorkerBindingSchema, WorkerEntrypointExportSchema, bindings, convertToWranglerConfig, defineSettings, defineWorker, exports$1 as exports, generateTypes, loadAndValidateConfig, loadConfig, registerConfigHooks, resolveExportDefinition, triggers, validateSingletonBindings };
|
|
@@ -146,6 +146,7 @@ const bindings = {
|
|
|
146
146
|
* triggers.scheduled({ schedule: "0 * * * *" }),
|
|
147
147
|
* triggers.scheduled({ schedule: "30 0 * * *" }),
|
|
148
148
|
* triggers.email({ addresses: ["support@example.com"] }),
|
|
149
|
+
* triggers.connect({ protocol: "tcp", port: 5432 }),
|
|
149
150
|
* ],
|
|
150
151
|
* });
|
|
151
152
|
* ```
|
|
@@ -166,6 +167,10 @@ const triggers = {
|
|
|
166
167
|
email: (options) => ({
|
|
167
168
|
type: "email",
|
|
168
169
|
...options
|
|
170
|
+
}),
|
|
171
|
+
connect: (options) => ({
|
|
172
|
+
type: "connect",
|
|
173
|
+
...options
|
|
169
174
|
})
|
|
170
175
|
};
|
|
171
176
|
|
|
@@ -193,6 +198,7 @@ function worker(options = {}) {
|
|
|
193
198
|
* export default defineWorker({
|
|
194
199
|
* exports: {
|
|
195
200
|
* MyDurableObject: exports.durableObject({ storage: "sqlite" }),
|
|
201
|
+
* MyContainerDO: exports.durableObject({ storage: "sqlite", container: "my-container" }),
|
|
196
202
|
* OldClass: exports.durableObject({ state: "deleted" }),
|
|
197
203
|
* OldName: exports.durableObject({ state: "renamed", renamedTo: "NewName" }),
|
|
198
204
|
* Outgoing: exports.durableObject({ state: "transferred", transferredTo: "target-worker" }),
|
|
@@ -323,6 +323,14 @@ interface R2BindingOptions {
|
|
|
323
323
|
jurisdiction?: string;
|
|
324
324
|
/** Whether the R2 bucket should be remote or not in local development. */
|
|
325
325
|
remote?: boolean;
|
|
326
|
+
/** Settings that only apply to local development. */
|
|
327
|
+
localDev?: {
|
|
328
|
+
/** EXPERIMENTAL: credentials for the local S3-compatible endpoint. */
|
|
329
|
+
experimentalS3Credentials?: {
|
|
330
|
+
accessKeyId: string;
|
|
331
|
+
secretAccessKey: string;
|
|
332
|
+
};
|
|
333
|
+
};
|
|
326
334
|
}
|
|
327
335
|
/**
|
|
328
336
|
* Binding to an R2 bucket.
|
|
@@ -524,8 +532,6 @@ interface WorkflowBindingOptions {
|
|
|
524
532
|
workerName: string;
|
|
525
533
|
/** The exported class name of the Workflow. */
|
|
526
534
|
exportName: string;
|
|
527
|
-
/** Whether the Workflow binding should be remote or not in local development. */
|
|
528
|
-
remote?: boolean;
|
|
529
535
|
}
|
|
530
536
|
/**
|
|
531
537
|
* Binding to a Workflow. `workerName` is the name of the Worker that defines
|
|
@@ -804,11 +810,27 @@ interface EmailTriggerOptions {
|
|
|
804
810
|
interface EmailTrigger extends EmailTriggerOptions {
|
|
805
811
|
type: "email";
|
|
806
812
|
}
|
|
813
|
+
interface ConnectTriggerOptions {
|
|
814
|
+
/** The transport protocol to listen for. */
|
|
815
|
+
protocol: "tcp";
|
|
816
|
+
/** The port to listen on. */
|
|
817
|
+
port: number;
|
|
818
|
+
/** The address to bind to. Defaults to `127.0.0.1`. */
|
|
819
|
+
address?: string;
|
|
820
|
+
}
|
|
821
|
+
/**
|
|
822
|
+
* Connect trigger — invokes this Worker's `connect(socket, env, ctx)`
|
|
823
|
+
* handler for raw socket connections received on the configured
|
|
824
|
+
* protocol/port.
|
|
825
|
+
*/
|
|
826
|
+
interface ConnectTrigger extends ConnectTriggerOptions {
|
|
827
|
+
type: "connect";
|
|
828
|
+
}
|
|
807
829
|
/**
|
|
808
|
-
* Event triggers — fetch routes, queue consumers, cron schedules,
|
|
809
|
-
* Routing addresses — that invoke this Worker.
|
|
810
|
-
* `triggers.fetch(...)`, `triggers.queue(...)`,
|
|
811
|
-
* `triggers.email(...)`.
|
|
830
|
+
* Event triggers — fetch routes, queue consumers, cron schedules, Email
|
|
831
|
+
* Routing addresses, and raw sockets — that invoke this Worker.
|
|
832
|
+
* Construct entries with `triggers.fetch(...)`, `triggers.queue(...)`,
|
|
833
|
+
* `triggers.scheduled(...)`, `triggers.email(...)`, or `triggers.connect(...)`.
|
|
812
834
|
*
|
|
813
835
|
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
|
|
814
836
|
*/
|
|
@@ -837,6 +859,12 @@ interface Triggers {
|
|
|
837
859
|
* addresses.
|
|
838
860
|
*/
|
|
839
861
|
email(options: EmailTriggerOptions): EmailTrigger;
|
|
862
|
+
/**
|
|
863
|
+
* Connect trigger — invokes this Worker's `connect(socket, env, ctx)`
|
|
864
|
+
* handler for raw socket connections received on the configured
|
|
865
|
+
* protocol/port.
|
|
866
|
+
*/
|
|
867
|
+
connect(options: ConnectTriggerOptions): ConnectTrigger;
|
|
840
868
|
}
|
|
841
869
|
/**
|
|
842
870
|
* Triggers builder for configuring event triggers.
|
|
@@ -852,6 +880,7 @@ interface Triggers {
|
|
|
852
880
|
* triggers.scheduled({ schedule: "0 * * * *" }),
|
|
853
881
|
* triggers.scheduled({ schedule: "30 0 * * *" }),
|
|
854
882
|
* triggers.email({ addresses: ["support@example.com"] }),
|
|
883
|
+
* triggers.connect({ protocol: "tcp", port: 5432 }),
|
|
855
884
|
* ],
|
|
856
885
|
* });
|
|
857
886
|
* ```
|
|
@@ -859,6 +888,27 @@ interface Triggers {
|
|
|
859
888
|
declare const triggers: Triggers;
|
|
860
889
|
//#endregion
|
|
861
890
|
//#region src/exports.d.ts
|
|
891
|
+
/**
|
|
892
|
+
* Storage backend for the Durable Object.
|
|
893
|
+
*
|
|
894
|
+
* Containers are only supported on the SQLite storage engine, so `container` is
|
|
895
|
+
* only offered alongside `storage: "sqlite"`.
|
|
896
|
+
*/
|
|
897
|
+
type DurableObjectStorageOptions = {
|
|
898
|
+
/**
|
|
899
|
+
* Selects the SQLite-backed storage engine (recommended for new
|
|
900
|
+
* classes).
|
|
901
|
+
*/
|
|
902
|
+
storage: "sqlite";
|
|
903
|
+
/**
|
|
904
|
+
* Attach a container to this Durable Object, by container name. The
|
|
905
|
+
* name must match an entry in the top level `containers` array.
|
|
906
|
+
*/
|
|
907
|
+
container?: string;
|
|
908
|
+
} | {
|
|
909
|
+
/** Selects the legacy key-value storage engine. */
|
|
910
|
+
storage: "legacy-kv";
|
|
911
|
+
};
|
|
862
912
|
/**
|
|
863
913
|
* Declares a provisioned Durable Object class exported from this Worker.
|
|
864
914
|
*
|
|
@@ -867,17 +917,9 @@ declare const triggers: Triggers;
|
|
|
867
917
|
*
|
|
868
918
|
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
|
|
869
919
|
*/
|
|
870
|
-
|
|
920
|
+
type DurableObjectCreatedExportOptions = {
|
|
871
921
|
state?: "created";
|
|
872
|
-
|
|
873
|
-
* Storage backend for the Durable Object.
|
|
874
|
-
*
|
|
875
|
-
* - `"sqlite"`: selects the SQLite-backed storage engine
|
|
876
|
-
* (recommended for new classes).
|
|
877
|
-
* - `"legacy-kv"`: selects the legacy key-value storage engine.
|
|
878
|
-
*/
|
|
879
|
-
storage: "sqlite" | "legacy-kv";
|
|
880
|
-
}
|
|
922
|
+
} & DurableObjectStorageOptions;
|
|
881
923
|
/**
|
|
882
924
|
* Retire a provisioned Durable Object namespace whose class has
|
|
883
925
|
* been removed from code.
|
|
@@ -917,17 +959,16 @@ interface DurableObjectTransferredExportOptions {
|
|
|
917
959
|
* Prepare to receive cross-Worker Durable Object transfer.
|
|
918
960
|
* Once the source Worker's `transferred` export is deployed, this entry becomes a normal live `durable-object` export.
|
|
919
961
|
*/
|
|
920
|
-
|
|
962
|
+
type DurableObjectExpectingTransferExportOptions = {
|
|
921
963
|
state: "expecting-transfer";
|
|
922
|
-
storage: "sqlite" | "legacy-kv";
|
|
923
964
|
/**
|
|
924
965
|
* The source Worker for the two-phase cross-Worker transfer.
|
|
925
966
|
*/
|
|
926
967
|
transferFrom: string;
|
|
927
|
-
}
|
|
928
|
-
|
|
968
|
+
} & DurableObjectStorageOptions;
|
|
969
|
+
type DurableObjectCreatedExport = DurableObjectCreatedExportOptions & {
|
|
929
970
|
type: "durable-object";
|
|
930
|
-
}
|
|
971
|
+
};
|
|
931
972
|
interface DurableObjectDeletedExport extends DurableObjectDeletedExportOptions {
|
|
932
973
|
type: "durable-object";
|
|
933
974
|
}
|
|
@@ -937,9 +978,9 @@ interface DurableObjectRenamedExport extends DurableObjectRenamedExportOptions {
|
|
|
937
978
|
interface DurableObjectTransferredExport extends DurableObjectTransferredExportOptions {
|
|
938
979
|
type: "durable-object";
|
|
939
980
|
}
|
|
940
|
-
|
|
981
|
+
type DurableObjectExpectingTransferExport = DurableObjectExpectingTransferExportOptions & {
|
|
941
982
|
type: "durable-object";
|
|
942
|
-
}
|
|
983
|
+
};
|
|
943
984
|
type DurableObjectExportOptions = DurableObjectCreatedExportOptions | DurableObjectDeletedExportOptions | DurableObjectRenamedExportOptions | DurableObjectTransferredExportOptions | DurableObjectExpectingTransferExportOptions;
|
|
944
985
|
type DurableObjectExports = DurableObjectCreatedExport | DurableObjectDeletedExport | DurableObjectRenamedExport | DurableObjectTransferredExport | DurableObjectExpectingTransferExport;
|
|
945
986
|
interface WorkerEntrypointExportOptions {
|
|
@@ -996,6 +1037,7 @@ interface Exports {
|
|
|
996
1037
|
* export default defineWorker({
|
|
997
1038
|
* exports: {
|
|
998
1039
|
* MyDurableObject: exports.durableObject({ storage: "sqlite" }),
|
|
1040
|
+
* MyContainerDO: exports.durableObject({ storage: "sqlite", container: "my-container" }),
|
|
999
1041
|
* OldClass: exports.durableObject({ state: "deleted" }),
|
|
1000
1042
|
* OldName: exports.durableObject({ state: "renamed", renamedTo: "NewName" }),
|
|
1001
1043
|
* Outgoing: exports.durableObject({ state: "transferred", transferredTo: "target-worker" }),
|
|
@@ -1040,7 +1082,7 @@ type Binding = AgentMemoryBinding | AiBinding | AiSearchBinding | AiSearchNamesp
|
|
|
1040
1082
|
/**
|
|
1041
1083
|
* Union of all trigger definitions accepted in `triggers`.
|
|
1042
1084
|
*/
|
|
1043
|
-
type Trigger = EmailTrigger | FetchTrigger | QueueConsumerTrigger | ScheduledTrigger;
|
|
1085
|
+
type Trigger = ConnectTrigger | EmailTrigger | FetchTrigger | QueueConsumerTrigger | ScheduledTrigger;
|
|
1044
1086
|
/**
|
|
1045
1087
|
* Union of all export definitions accepted in `exports`. Worker entries
|
|
1046
1088
|
* configure WorkerEntrypoint exports. Durable Object entries configure live
|
|
@@ -1121,10 +1163,11 @@ interface WorkerConfig {
|
|
|
1121
1163
|
*/
|
|
1122
1164
|
domains?: string[];
|
|
1123
1165
|
/**
|
|
1124
|
-
* Event triggers — fetch routes, queue consumers, cron schedules,
|
|
1125
|
-
* Routing addresses
|
|
1126
|
-
*
|
|
1127
|
-
* `triggers.
|
|
1166
|
+
* Event triggers — fetch routes, queue consumers, cron schedules, Email
|
|
1167
|
+
* Routing addresses, and raw sockets — that invoke this Worker.
|
|
1168
|
+
* Construct entries with `triggers.fetch(...)`, `triggers.queue(...)`,
|
|
1169
|
+
* `triggers.scheduled(...)`, `triggers.email(...)`, or
|
|
1170
|
+
* `triggers.connect(...)`.
|
|
1128
1171
|
*
|
|
1129
1172
|
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
|
|
1130
1173
|
*/
|
|
@@ -1610,4 +1653,4 @@ declare function defineSettings(config: ConfigInput<SettingsConfigInput>): {
|
|
|
1610
1653
|
};
|
|
1611
1654
|
};
|
|
1612
1655
|
//#endregion
|
|
1613
|
-
export {
|
|
1656
|
+
export { R2Binding as $, triggers as A, D1Binding as B, exports as C, QueueConsumerTrigger as D, FetchTrigger as E, AnalyticsEngineDatasetBinding as F, ImagesBinding$1 as G, DurableObjectBinding as H, ArtifactsBinding as I, LogfwdrBinding as J, JsonBinding as K, AssetsBinding as L, AiBinding as M, AiSearchBinding as N, ScheduledTrigger as O, AiSearchNamespaceBinding as P, QueueBinding as Q, Bindings as R, WorkerEntrypointExportOptions as S, bindings as St, EmailTrigger as T, FlagshipBinding as U, DispatchNamespaceBinding as V, HyperdriveBinding as W, MtlsCertificateBinding as X, MediaBinding$1 as Y, PipelineBinding as Z, DurableObjectExpectingTransferExport as _, VpcServiceBinding as _t, InferMainModule as a, TextBinding as at, Exports as b, WorkerLoaderBinding as bt, WorkerConfigExport as c, TypedKvBinding as ct, SettingsConfig as d, TypedWorkerBinding as dt, RateLimitBinding as et, WorkerConfig as f, TypedWorkflowBinding as ft, DurableObjectDeletedExport as g, VpcNetworkBinding as gt, DurableObjectCreatedExport as h, VersionMetadataBinding as ht, InferEnv as i, StreamBinding$1 as it, AgentMemoryBinding as j, Triggers as k, WorkerConfigInput as l, TypedPipelineBinding as lt, resolveExportDefinition as m, VectorizeBinding as mt, defineSettings as n, SecretsStoreSecretBinding as nt, UnwrapConfig as o, TypedAiBinding as ot, ConfigContext as p, UnsafeBinding as pt, KvBinding as q, InferDurableNamespaces as r, SendEmailBinding as rt, TypedWorkerDefinition as s, TypedDurableObjectBinding as st, SettingsConfigInput as t, SecretBinding as tt, defineWorker as u, TypedQueueBinding as ut, DurableObjectRenamedExport as v, WebSearchBinding as vt, ConnectTrigger as w, WorkerEntrypointExport as x, WorkflowBinding as xt, DurableObjectTransferredExport as y, WorkerBinding as yt, BrowserBinding as z };
|
package/dist/public.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, ArtifactsBinding, AssetsBinding, Bindings, BrowserBinding, ConfigContext, D1Binding, DispatchNamespaceBinding, DurableObjectBinding, DurableObjectCreatedExport, DurableObjectDeletedExport, DurableObjectExpectingTransferExport, DurableObjectRenamedExport, DurableObjectTransferredExport, EmailTrigger, Exports, FetchTrigger, FlagshipBinding, HyperdriveBinding, ImagesBinding, InferDurableNamespaces, InferEnv, InferMainModule, JsonBinding, KvBinding, LogfwdrBinding, MediaBinding, MtlsCertificateBinding, PipelineBinding, QueueBinding, QueueConsumerTrigger, R2Binding, RateLimitBinding, ScheduledTrigger, SecretBinding, SecretsStoreSecretBinding, SendEmailBinding, SettingsConfig, SettingsConfigInput, StreamBinding, TextBinding, Triggers, TypedAiBinding, TypedDurableObjectBinding, TypedKvBinding, TypedPipelineBinding, TypedQueueBinding, TypedWorkerBinding, TypedWorkerDefinition, TypedWorkflowBinding, UnsafeBinding, UnwrapConfig, VectorizeBinding, VersionMetadataBinding, VpcNetworkBinding, VpcServiceBinding, WebSearchBinding, WorkerBinding, WorkerConfig, WorkerConfigExport, WorkerConfigInput, WorkerEntrypointExport, WorkerEntrypointExportOptions, WorkerLoaderBinding, WorkflowBinding, bindings, defineSettings, defineWorker, exports, triggers };
|
|
1
|
+
import { $ as R2Binding, A as triggers, B as D1Binding, C as exports, D as QueueConsumerTrigger, E as FetchTrigger, F as AnalyticsEngineDatasetBinding, G as ImagesBinding, H as DurableObjectBinding, I as ArtifactsBinding, J as LogfwdrBinding, K as JsonBinding, L as AssetsBinding, M as AiBinding, N as AiSearchBinding, O as ScheduledTrigger, P as AiSearchNamespaceBinding, Q as QueueBinding, R as Bindings, S as WorkerEntrypointExportOptions, St as bindings, T as EmailTrigger, U as FlagshipBinding, V as DispatchNamespaceBinding, W as HyperdriveBinding, X as MtlsCertificateBinding, Y as MediaBinding, Z as PipelineBinding, _ as DurableObjectExpectingTransferExport, _t as VpcServiceBinding, a as InferMainModule, at as TextBinding, b as Exports, bt as WorkerLoaderBinding, c as WorkerConfigExport, ct as TypedKvBinding, d as SettingsConfig, dt as TypedWorkerBinding, et as RateLimitBinding, f as WorkerConfig, ft as TypedWorkflowBinding, g as DurableObjectDeletedExport, gt as VpcNetworkBinding, h as DurableObjectCreatedExport, ht as VersionMetadataBinding, i as InferEnv, it as StreamBinding, j as AgentMemoryBinding, k as Triggers, l as WorkerConfigInput, lt as TypedPipelineBinding, mt as VectorizeBinding, n as defineSettings, nt as SecretsStoreSecretBinding, o as UnwrapConfig, ot as TypedAiBinding, p as ConfigContext, pt as UnsafeBinding, q as KvBinding, r as InferDurableNamespaces, rt as SendEmailBinding, s as TypedWorkerDefinition, st as TypedDurableObjectBinding, t as SettingsConfigInput, tt as SecretBinding, u as defineWorker, ut as TypedQueueBinding, v as DurableObjectRenamedExport, vt as WebSearchBinding, w as ConnectTrigger, x as WorkerEntrypointExport, xt as WorkflowBinding, y as DurableObjectTransferredExport, yt as WorkerBinding, z as BrowserBinding } from "./public-CCrtkZee.mjs";
|
|
2
|
+
export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, ArtifactsBinding, AssetsBinding, Bindings, BrowserBinding, ConfigContext, ConnectTrigger, D1Binding, DispatchNamespaceBinding, DurableObjectBinding, DurableObjectCreatedExport, DurableObjectDeletedExport, DurableObjectExpectingTransferExport, DurableObjectRenamedExport, DurableObjectTransferredExport, EmailTrigger, Exports, FetchTrigger, FlagshipBinding, HyperdriveBinding, ImagesBinding, InferDurableNamespaces, InferEnv, InferMainModule, JsonBinding, KvBinding, LogfwdrBinding, MediaBinding, MtlsCertificateBinding, PipelineBinding, QueueBinding, QueueConsumerTrigger, R2Binding, RateLimitBinding, ScheduledTrigger, SecretBinding, SecretsStoreSecretBinding, SendEmailBinding, SettingsConfig, SettingsConfigInput, StreamBinding, TextBinding, Triggers, TypedAiBinding, TypedDurableObjectBinding, TypedKvBinding, TypedPipelineBinding, TypedQueueBinding, TypedWorkerBinding, TypedWorkerDefinition, TypedWorkflowBinding, UnsafeBinding, UnwrapConfig, VectorizeBinding, VersionMetadataBinding, VpcNetworkBinding, VpcServiceBinding, WebSearchBinding, WorkerBinding, WorkerConfig, WorkerConfigExport, WorkerConfigInput, WorkerEntrypointExport, WorkerEntrypointExportOptions, WorkerLoaderBinding, WorkflowBinding, bindings, defineSettings, defineWorker, exports, triggers };
|
package/dist/public.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as triggers, i as exports, n as defineWorker, o as bindings, t as defineSettings } from "./public-
|
|
1
|
+
import { a as triggers, i as exports, n as defineWorker, o as bindings, t as defineSettings } from "./public-BwQqexwo.mjs";
|
|
2
2
|
|
|
3
3
|
export { bindings, defineSettings, defineWorker, exports, triggers };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Definitions and utilities for configuring Cloudflare Workers and related products. This is not yet stable enough for external use — APIs may change without notice.",
|
|
5
5
|
"homepage": "https://github.com/cloudflare/workers-sdk/tree/main/packages/config#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
"zod": "4.4.3"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@cloudflare/workers-types": "^5.
|
|
34
|
+
"@cloudflare/workers-types": "^5.20260820.1",
|
|
35
35
|
"ts-dedent": "^2.2.0",
|
|
36
36
|
"tsdown": "0.16.3",
|
|
37
37
|
"typescript": "5.8.3",
|
|
38
38
|
"vitest": "4.1.0",
|
|
39
39
|
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
40
|
-
"@cloudflare/workers-utils": "0.
|
|
40
|
+
"@cloudflare/workers-utils": "0.34.0"
|
|
41
41
|
},
|
|
42
42
|
"workers-sdk": {
|
|
43
43
|
"prerelease": true
|