@cloudflare/config 0.6.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<{
|
|
@@ -340,6 +356,13 @@ declare const InputWorkerSchema: z.ZodObject<{
|
|
|
340
356
|
}, z.core.$strict>, z.ZodObject<{
|
|
341
357
|
type: z.ZodLiteral<"scheduled">;
|
|
342
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>;
|
|
343
366
|
}, z.core.$strict>], "type">>>;
|
|
344
367
|
tailConsumers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
345
368
|
workerName: z.ZodString;
|
|
@@ -507,6 +530,13 @@ declare const ConfigExportsSchema: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUn
|
|
|
507
530
|
}, z.core.$strict>, z.ZodObject<{
|
|
508
531
|
type: z.ZodLiteral<"scheduled">;
|
|
509
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>;
|
|
510
540
|
}, z.core.$strict>], "type">>>;
|
|
511
541
|
tailConsumers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
512
542
|
workerName: z.ZodString;
|
|
@@ -678,6 +708,13 @@ declare const OutputWorkerSchema: z.ZodObject<{
|
|
|
678
708
|
}, z.core.$strict>, z.ZodObject<{
|
|
679
709
|
type: z.ZodLiteral<"scheduled">;
|
|
680
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>;
|
|
681
718
|
}, z.core.$strict>], "type">>>;
|
|
682
719
|
tailConsumers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
683
720
|
workerName: z.ZodString;
|
|
@@ -924,4 +961,4 @@ declare function loadAndValidateConfig(configPath: string, ctx: ConfigContext, o
|
|
|
924
961
|
include?: string[];
|
|
925
962
|
}): Promise<LoadAndValidateConfigResult>;
|
|
926
963
|
//#endregion
|
|
927
|
-
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(),
|
|
@@ -375,6 +380,12 @@ const TriggerSchema = z.discriminatedUnion("type", [
|
|
|
375
380
|
z.strictObject({
|
|
376
381
|
type: z.literal("scheduled"),
|
|
377
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()
|
|
378
389
|
})
|
|
379
390
|
]);
|
|
380
391
|
const UnsafeSchema = z.strictObject({
|
|
@@ -573,43 +584,43 @@ function hasKnownExportType(entry) {
|
|
|
573
584
|
return type === "durable-object" || type === "worker";
|
|
574
585
|
}
|
|
575
586
|
__name(hasKnownExportType, "hasKnownExportType");
|
|
576
|
-
function partitionExports(exports$
|
|
587
|
+
function partitionExports(exports$1$1) {
|
|
577
588
|
const partitioned = {
|
|
578
589
|
"durable-object": {},
|
|
579
590
|
worker: {}
|
|
580
591
|
};
|
|
581
|
-
if (exports$
|
|
582
|
-
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)) {
|
|
583
594
|
if (!hasKnownExportType(entry)) continue;
|
|
584
595
|
partitioned[entry.type][name] = entry;
|
|
585
596
|
}
|
|
586
597
|
return partitioned;
|
|
587
598
|
}
|
|
588
599
|
__name(partitionExports, "partitionExports");
|
|
589
|
-
function getDurableObjectExports(exports$
|
|
590
|
-
return partitionExports(exports$
|
|
600
|
+
function getDurableObjectExports(exports$1$1) {
|
|
601
|
+
return partitionExports(exports$1$1)["durable-object"];
|
|
591
602
|
}
|
|
592
603
|
__name(getDurableObjectExports, "getDurableObjectExports");
|
|
593
|
-
function hasDurableObjectExports(exports$
|
|
594
|
-
return Object.keys(getDurableObjectExports(exports$
|
|
604
|
+
function hasDurableObjectExports(exports$1$1) {
|
|
605
|
+
return Object.keys(getDurableObjectExports(exports$1$1)).length > 0;
|
|
595
606
|
}
|
|
596
607
|
__name(hasDurableObjectExports, "hasDurableObjectExports");
|
|
597
|
-
function getContainerNameToClassNameMap(exports$
|
|
608
|
+
function getContainerNameToClassNameMap(exports$1$1) {
|
|
598
609
|
const containerNameToClassName = /* @__PURE__ */ new Map();
|
|
599
|
-
for (const [className, entry] of Object.entries(getDurableObjectExports(exports$
|
|
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);
|
|
600
611
|
return containerNameToClassName;
|
|
601
612
|
}
|
|
602
613
|
__name(getContainerNameToClassNameMap, "getContainerNameToClassNameMap");
|
|
603
|
-
function resolveContainerClassName(container, exports$
|
|
614
|
+
function resolveContainerClassName(container, exports$1$1) {
|
|
604
615
|
if (container.class_name !== void 0) return container.class_name;
|
|
605
616
|
if (container.name === void 0) return;
|
|
606
|
-
return getContainerNameToClassNameMap(exports$
|
|
617
|
+
return getContainerNameToClassNameMap(exports$1$1).get(container.name);
|
|
607
618
|
}
|
|
608
619
|
__name(resolveContainerClassName, "resolveContainerClassName");
|
|
609
|
-
function getContainerDurableObjectClassNames(containers, exports$
|
|
620
|
+
function getContainerDurableObjectClassNames(containers, exports$1$1) {
|
|
610
621
|
const classNames = /* @__PURE__ */ new Set();
|
|
611
622
|
for (const container of containers ?? []) {
|
|
612
|
-
const className = resolveContainerClassName(container, exports$
|
|
623
|
+
const className = resolveContainerClassName(container, exports$1$1);
|
|
613
624
|
if (className !== void 0) classNames.add(className);
|
|
614
625
|
}
|
|
615
626
|
return classNames;
|
|
@@ -3348,14 +3359,17 @@ function convertBindingsAndAssets(config, result) {
|
|
|
3348
3359
|
simple: binding.simple
|
|
3349
3360
|
});
|
|
3350
3361
|
break;
|
|
3351
|
-
case "r2":
|
|
3362
|
+
case "r2": {
|
|
3363
|
+
const experimentalS3Credentials = binding.localDev?.experimentalS3Credentials;
|
|
3352
3364
|
r2Buckets.push(omitUndefined({
|
|
3353
3365
|
binding: name,
|
|
3354
3366
|
bucket_name: binding.name,
|
|
3355
3367
|
jurisdiction: binding.jurisdiction,
|
|
3356
|
-
remote: binding.remote
|
|
3368
|
+
remote: binding.remote,
|
|
3369
|
+
local_dev: experimentalS3Credentials === void 0 ? void 0 : { experimental_s3_credentials: experimentalS3Credentials }
|
|
3357
3370
|
}));
|
|
3358
3371
|
break;
|
|
3372
|
+
}
|
|
3359
3373
|
case "secret":
|
|
3360
3374
|
secretsRequired.push(name);
|
|
3361
3375
|
break;
|
|
@@ -3539,6 +3553,7 @@ function convertTriggers(config, result) {
|
|
|
3539
3553
|
const crons = [];
|
|
3540
3554
|
const routes = result.routes ? [...result.routes] : [];
|
|
3541
3555
|
const queueConsumers = result.queues?.consumers ? [...result.queues.consumers] : [];
|
|
3556
|
+
const connectHandlers = result.connect ? [...result.connect] : [];
|
|
3542
3557
|
let addresses;
|
|
3543
3558
|
for (const trigger of triggers$1) switch (trigger.type) {
|
|
3544
3559
|
case "email":
|
|
@@ -3571,6 +3586,13 @@ function convertTriggers(config, result) {
|
|
|
3571
3586
|
visibility_timeout_ms: trigger.visibilityTimeoutMs
|
|
3572
3587
|
}));
|
|
3573
3588
|
break;
|
|
3589
|
+
case "connect":
|
|
3590
|
+
connectHandlers.push(omitUndefined({
|
|
3591
|
+
protocol: trigger.protocol,
|
|
3592
|
+
port: trigger.port,
|
|
3593
|
+
address: trigger.address
|
|
3594
|
+
}));
|
|
3595
|
+
break;
|
|
3574
3596
|
}
|
|
3575
3597
|
if (crons.length) result.triggers = { crons };
|
|
3576
3598
|
if (routes.length) result.routes = routes;
|
|
@@ -3578,6 +3600,7 @@ function convertTriggers(config, result) {
|
|
|
3578
3600
|
...result.queues ?? {},
|
|
3579
3601
|
consumers: queueConsumers
|
|
3580
3602
|
};
|
|
3603
|
+
if (connectHandlers.length) result.connect = connectHandlers;
|
|
3581
3604
|
if (addresses !== void 0) result.addresses = addresses;
|
|
3582
3605
|
}
|
|
3583
3606
|
function convertDomains(config, result) {
|
|
@@ -3753,4 +3776,4 @@ async function loadAndValidateConfig(configPath, ctx, options) {
|
|
|
3753
3776
|
}
|
|
3754
3777
|
|
|
3755
3778
|
//#endregion
|
|
3756
|
-
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
|
|
|
@@ -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
|
+
}
|
|
807
821
|
/**
|
|
808
|
-
*
|
|
809
|
-
*
|
|
810
|
-
*
|
|
811
|
-
|
|
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
|
+
}
|
|
829
|
+
/**
|
|
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
|
* ```
|
|
@@ -1053,7 +1082,7 @@ type Binding = AgentMemoryBinding | AiBinding | AiSearchBinding | AiSearchNamesp
|
|
|
1053
1082
|
/**
|
|
1054
1083
|
* Union of all trigger definitions accepted in `triggers`.
|
|
1055
1084
|
*/
|
|
1056
|
-
type Trigger = EmailTrigger | FetchTrigger | QueueConsumerTrigger | ScheduledTrigger;
|
|
1085
|
+
type Trigger = ConnectTrigger | EmailTrigger | FetchTrigger | QueueConsumerTrigger | ScheduledTrigger;
|
|
1057
1086
|
/**
|
|
1058
1087
|
* Union of all export definitions accepted in `exports`. Worker entries
|
|
1059
1088
|
* configure WorkerEntrypoint exports. Durable Object entries configure live
|
|
@@ -1134,10 +1163,11 @@ interface WorkerConfig {
|
|
|
1134
1163
|
*/
|
|
1135
1164
|
domains?: string[];
|
|
1136
1165
|
/**
|
|
1137
|
-
* Event triggers — fetch routes, queue consumers, cron schedules,
|
|
1138
|
-
* Routing addresses
|
|
1139
|
-
*
|
|
1140
|
-
* `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(...)`.
|
|
1141
1171
|
*
|
|
1142
1172
|
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
|
|
1143
1173
|
*/
|
|
@@ -1623,4 +1653,4 @@ declare function defineSettings(config: ConfigInput<SettingsConfigInput>): {
|
|
|
1623
1653
|
};
|
|
1624
1654
|
};
|
|
1625
1655
|
//#endregion
|
|
1626
|
-
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
|
-
"@cloudflare/workers-
|
|
40
|
-
"@cloudflare/workers-
|
|
39
|
+
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
40
|
+
"@cloudflare/workers-utils": "0.34.0"
|
|
41
41
|
},
|
|
42
42
|
"workers-sdk": {
|
|
43
43
|
"prerelease": true
|