@cloudflare/config 0.18.0 → 0.20.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 Settings, A as TextBinding, B as WorkerBinding, C as QueueBinding, D as SecretsStoreSecretBinding, E as SecretBinding, F as UnsafeBinding, G as ContainerDefinition, H as WorkflowBinding, I as VectorizeBinding, J as defineConfig, K as WorkerDefinition, L as VersionMetadataBinding, M as TypedKvBinding, N as TypedPipelineBinding, O as SendEmailBinding, P as TypedQueueBinding, Q as ContainerConfig, R as VpcNetworkBinding, S as PipelineBinding, St as exports, T as RateLimitBinding, U as bindings, V as WorkerLoaderBinding, W as ConfigContext, X as defineWorker, Y as defineContainer, Z as CloudflareConfig, _ as JsonBinding, _t as Exports, a as AnalyticsEngineDatasetBinding, at as ScheduledTrigger, b as MediaBinding, bt as WorkflowExport, c as BindingDevOptions, ct as InferDurableNamespaces, d as D1Binding, dt as UnwrapConfig, et as WorkerConfig, f as DispatchNamespaceBinding, ft as DurableObjectCreatedExport, g as ImagesBinding, gt as DurableObjectTransferredExport, h as HyperdriveBinding, ht as DurableObjectRenamedExport, i as AiSearchNamespaceBinding, it as QueueConsumerTrigger, j as TypedAiBinding, k as StreamBinding, l as Bindings, lt as InferEnv, m as FlagshipBinding, mt as DurableObjectExpectingTransferExport, n as AiBinding, nt as EmailTrigger, o as ArtifactsBinding, ot as Triggers, p as DurableObjectBinding, pt as DurableObjectDeletedExport, q as WorkerReference, r as AiSearchBinding, rt as FetchTrigger, s as AssetsBinding, st as triggers, t as AgentMemoryBinding, tt as ConnectTrigger, u as BrowserBinding, ut as InferMainModule, v as KvBinding, vt as WorkerEntrypointExport, w as R2Binding, x as MtlsCertificateBinding, xt as WorkflowExportOptions, y as LogfwdrBinding, yt as WorkerEntrypointExportOptions, z as VpcServiceBinding } from "./public-
|
|
1
|
+
import { $ as Settings, A as TextBinding, B as WorkerBinding, C as QueueBinding, D as SecretsStoreSecretBinding, E as SecretBinding, F as UnsafeBinding, G as ContainerDefinition, H as WorkflowBinding, I as VectorizeBinding, J as defineConfig, K as WorkerDefinition, L as VersionMetadataBinding, M as TypedKvBinding, N as TypedPipelineBinding, O as SendEmailBinding, P as TypedQueueBinding, Q as ContainerConfig, R as VpcNetworkBinding, S as PipelineBinding, St as exports, T as RateLimitBinding, U as bindings, V as WorkerLoaderBinding, W as ConfigContext, X as defineWorker, Y as defineContainer, Z as CloudflareConfig, _ as JsonBinding, _t as Exports, a as AnalyticsEngineDatasetBinding, at as ScheduledTrigger, b as MediaBinding, bt as WorkflowExport, c as BindingDevOptions, ct as InferDurableNamespaces, d as D1Binding, dt as UnwrapConfig, et as WorkerConfig, f as DispatchNamespaceBinding, ft as DurableObjectCreatedExport, g as ImagesBinding, gt as DurableObjectTransferredExport, h as HyperdriveBinding, ht as DurableObjectRenamedExport, i as AiSearchNamespaceBinding, it as QueueConsumerTrigger, j as TypedAiBinding, k as StreamBinding, l as Bindings, lt as InferEnv, m as FlagshipBinding, mt as DurableObjectExpectingTransferExport, n as AiBinding, nt as EmailTrigger, o as ArtifactsBinding, ot as Triggers, p as DurableObjectBinding, pt as DurableObjectDeletedExport, q as WorkerReference, r as AiSearchBinding, rt as FetchTrigger, s as AssetsBinding, st as triggers, t as AgentMemoryBinding, tt as ConnectTrigger, u as BrowserBinding, ut as InferMainModule, v as KvBinding, vt as WorkerEntrypointExport, w as R2Binding, x as MtlsCertificateBinding, xt as WorkflowExportOptions, y as LogfwdrBinding, yt as WorkerEntrypointExportOptions, z as VpcServiceBinding } from "./public-DA8eKvPJ.mjs";
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
import { RawConfig } from "@cloudflare/workers-utils";
|
|
4
4
|
|
|
@@ -32,6 +32,12 @@ declare const WorkerBindingSchema: z.ZodObject<{
|
|
|
32
32
|
remote: z.ZodOptional<z.ZodBoolean>;
|
|
33
33
|
}, z.core.$strict>>;
|
|
34
34
|
}, z.core.$strict>;
|
|
35
|
+
declare const WorkflowBindingSchema: z.ZodObject<{
|
|
36
|
+
type: z.ZodLiteral<"workflow">;
|
|
37
|
+
name: z.ZodString;
|
|
38
|
+
worker: z.ZodString;
|
|
39
|
+
exportName: z.ZodString;
|
|
40
|
+
}, z.core.$strict>;
|
|
35
41
|
declare const D1BindingSchema: z.ZodObject<{
|
|
36
42
|
type: z.ZodLiteral<"d1">;
|
|
37
43
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -299,6 +305,11 @@ declare const KnownBindingSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
299
305
|
}, z.core.$strict>>;
|
|
300
306
|
}, z.core.$strict>, z.ZodObject<{
|
|
301
307
|
type: z.ZodLiteral<"worker-loader">;
|
|
308
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
309
|
+
type: z.ZodLiteral<"workflow">;
|
|
310
|
+
name: z.ZodString;
|
|
311
|
+
worker: z.ZodString;
|
|
312
|
+
exportName: z.ZodString;
|
|
302
313
|
}, z.core.$strict>], "type">;
|
|
303
314
|
declare const UnsafeBindingSchema: z.ZodObject<{
|
|
304
315
|
type: z.ZodTemplateLiteral<`unsafe:${string}`>;
|
|
@@ -555,9 +566,9 @@ declare const WorkflowExportSchema: z.ZodObject<{
|
|
|
555
566
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
556
567
|
}, z.core.$strict>>;
|
|
557
568
|
schedules: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
569
|
+
defaultRetention: z.ZodOptional<z.ZodObject<{
|
|
570
|
+
successRetention: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
571
|
+
errorRetention: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
561
572
|
}, z.core.$strict>>;
|
|
562
573
|
}, z.core.$strict>;
|
|
563
574
|
declare const ExportSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -606,9 +617,9 @@ declare const ExportSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
606
617
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
607
618
|
}, z.core.$strict>>;
|
|
608
619
|
schedules: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
620
|
+
defaultRetention: z.ZodOptional<z.ZodObject<{
|
|
621
|
+
successRetention: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
622
|
+
errorRetention: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
612
623
|
}, z.core.$strict>>;
|
|
613
624
|
}, z.core.$strict>]>;
|
|
614
625
|
declare const TailConsumerSchema: z.ZodObject<{
|
|
@@ -784,9 +795,9 @@ declare const InputWorkerSchema: z.ZodObject<{
|
|
|
784
795
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
785
796
|
}, z.core.$strict>>;
|
|
786
797
|
schedules: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
798
|
+
defaultRetention: z.ZodOptional<z.ZodObject<{
|
|
799
|
+
successRetention: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
800
|
+
errorRetention: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
790
801
|
}, z.core.$strict>>;
|
|
791
802
|
}, z.core.$strict>]>>>;
|
|
792
803
|
entrypoint: z.ZodOptional<z.ZodString>;
|
|
@@ -971,9 +982,9 @@ declare const InputConfigSchema: z.ZodObject<{
|
|
|
971
982
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
972
983
|
}, z.core.$strict>>;
|
|
973
984
|
schedules: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
985
|
+
defaultRetention: z.ZodOptional<z.ZodObject<{
|
|
986
|
+
successRetention: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
987
|
+
errorRetention: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
977
988
|
}, z.core.$strict>>;
|
|
978
989
|
}, z.core.$strict>]>>>;
|
|
979
990
|
entrypoint: z.ZodOptional<z.ZodString>;
|
|
@@ -1275,9 +1286,9 @@ declare const OutputWorkerSchema: z.ZodObject<{
|
|
|
1275
1286
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
1276
1287
|
}, z.core.$strict>>;
|
|
1277
1288
|
schedules: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1289
|
+
defaultRetention: z.ZodOptional<z.ZodObject<{
|
|
1290
|
+
successRetention: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
1291
|
+
errorRetention: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
1281
1292
|
}, z.core.$strict>>;
|
|
1282
1293
|
}, z.core.$strict>]>>>;
|
|
1283
1294
|
manifest: z.ZodOptional<z.ZodObject<{
|
|
@@ -1425,4 +1436,4 @@ declare function loadAndParseConfig(configPath: string, ctx: ConfigContext): Pro
|
|
|
1425
1436
|
/** Load and parse only account settings from the default export. */
|
|
1426
1437
|
declare function loadAndParseConfigSettings(configPath: string, ctx: ConfigContext): Promise<LoadAndParseConfigSettingsResult>;
|
|
1427
1438
|
//#endregion
|
|
1428
|
-
export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, AnalyticsEngineDatasetBindingSchema, ArtifactsBinding, AssetsBinding, AssetsSchema, BindingDevOptions, BindingSchema, Bindings, BrowserBinding, BrowserBindingSchema, CloudflareConfig, ConfigContext, type ConfigParseResult, type ConfigSettingsParseResult, ConnectTrigger, ContainerConfig, ContainerDefinition, D1Binding, D1BindingSchema, DispatchNamespaceBinding, DurableObjectBinding, DurableObjectCreatedExport, DurableObjectCreatedExportSchema, DurableObjectDeletedExport, DurableObjectDeletedExportSchema, DurableObjectExpectingTransferExport, DurableObjectExpectingTransferExportSchema, DurableObjectRenamedExport, DurableObjectRenamedExportSchema, DurableObjectTransferredExport, DurableObjectTransferredExportSchema, EmailTrigger, ExportSchema, Exports, FetchTrigger, FlagshipBinding, FlagshipBindingSchema, HyperdriveBinding, HyperdriveBindingSchema, ImagesBinding, InferDurableNamespaces, InferEnv, InferMainModule, InputConfigSchema, InputContainerSchema, InputSettingsSchema, type InputWorkerConfig, InputWorkerSchema, JsonBinding, KVBindingSchema, KnownBindingSchema, KvBinding, type LoadAndParseConfigResult, type LoadAndParseConfigSettingsResult, type LoadConfigResult, LogfwdrBinding, MediaBinding, type ModuleType, ModuleTypeSchema, MtlsCertificateBinding, OutputContainerSchema, OutputRootConfigSchema, OutputWorkerSchema, type ParsedInputConfig, type ParsedInputContainerConfig, type ParsedInputSettingsConfig, type ParsedInputWorkerConfig, type ParsedOutputContainerConfig, type ParsedOutputRootConfig, type ParsedOutputWorkerConfig, PipelineBinding, QueueBinding, QueueBindingSchema, QueueConsumerTrigger, R2Binding, R2BindingSchema, RateLimitBinding, ScheduledTrigger, SecretBinding, SecretsStoreSecretBinding, SendEmailBinding, Settings, StreamBinding, TailConsumerSchema, TextBinding, Triggers, TypedAiBinding, TypedKvBinding, TypedPipelineBinding, TypedQueueBinding, UnsafeBinding, UnsafeBindingSchema, UnwrapConfig, VectorizeBinding, VersionMetadataBinding, VpcNetworkBinding, VpcServiceBinding, WorkerBinding, WorkerBindingSchema, WorkerConfig, WorkerDefinition, WorkerEntrypointExport, WorkerEntrypointExportOptions, WorkerEntrypointExportSchema, WorkerLoaderBinding, WorkerReference, WorkflowBinding, WorkflowExport, WorkflowExportOptions, WorkflowExportSchema, bindings, convertToWranglerConfig, defineConfig, defineContainer, defineWorker, exports, generateTypes, loadAndParseConfig, loadAndParseConfigSettings, loadConfig, registerConfigHooks, resolveAndParseConfig, resolveAndParseConfigSettings, triggers, validateSingletonBindings };
|
|
1439
|
+
export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, AnalyticsEngineDatasetBindingSchema, ArtifactsBinding, AssetsBinding, AssetsSchema, BindingDevOptions, BindingSchema, Bindings, BrowserBinding, BrowserBindingSchema, CloudflareConfig, ConfigContext, type ConfigParseResult, type ConfigSettingsParseResult, ConnectTrigger, ContainerConfig, ContainerDefinition, D1Binding, D1BindingSchema, DispatchNamespaceBinding, DurableObjectBinding, DurableObjectCreatedExport, DurableObjectCreatedExportSchema, DurableObjectDeletedExport, DurableObjectDeletedExportSchema, DurableObjectExpectingTransferExport, DurableObjectExpectingTransferExportSchema, DurableObjectRenamedExport, DurableObjectRenamedExportSchema, DurableObjectTransferredExport, DurableObjectTransferredExportSchema, EmailTrigger, ExportSchema, Exports, FetchTrigger, FlagshipBinding, FlagshipBindingSchema, HyperdriveBinding, HyperdriveBindingSchema, ImagesBinding, InferDurableNamespaces, InferEnv, InferMainModule, InputConfigSchema, InputContainerSchema, InputSettingsSchema, type InputWorkerConfig, InputWorkerSchema, JsonBinding, KVBindingSchema, KnownBindingSchema, KvBinding, type LoadAndParseConfigResult, type LoadAndParseConfigSettingsResult, type LoadConfigResult, LogfwdrBinding, MediaBinding, type ModuleType, ModuleTypeSchema, MtlsCertificateBinding, OutputContainerSchema, OutputRootConfigSchema, OutputWorkerSchema, type ParsedInputConfig, type ParsedInputContainerConfig, type ParsedInputSettingsConfig, type ParsedInputWorkerConfig, type ParsedOutputContainerConfig, type ParsedOutputRootConfig, type ParsedOutputWorkerConfig, PipelineBinding, QueueBinding, QueueBindingSchema, QueueConsumerTrigger, R2Binding, R2BindingSchema, RateLimitBinding, ScheduledTrigger, SecretBinding, SecretsStoreSecretBinding, SendEmailBinding, Settings, StreamBinding, TailConsumerSchema, TextBinding, Triggers, TypedAiBinding, TypedKvBinding, TypedPipelineBinding, TypedQueueBinding, UnsafeBinding, UnsafeBindingSchema, UnwrapConfig, VectorizeBinding, VersionMetadataBinding, VpcNetworkBinding, VpcServiceBinding, WorkerBinding, WorkerBindingSchema, WorkerConfig, WorkerDefinition, WorkerEntrypointExport, WorkerEntrypointExportOptions, WorkerEntrypointExportSchema, WorkerLoaderBinding, WorkerReference, WorkflowBinding, WorkflowBindingSchema, WorkflowExport, WorkflowExportOptions, WorkflowExportSchema, bindings, convertToWranglerConfig, defineConfig, defineContainer, defineWorker, exports, generateTypes, loadAndParseConfig, loadAndParseConfigSettings, loadConfig, registerConfigHooks, resolveAndParseConfig, resolveAndParseConfigSettings, triggers, validateSingletonBindings };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { a as triggers, i as exports$1, n as defineContainer, o as bindings, r as defineWorker, t as defineConfig } from "./public-
|
|
1
|
+
import { a as triggers, i as exports$1, n as defineContainer, o as bindings, r as defineWorker, t as defineConfig } from "./public-srUjWEOA.mjs";
|
|
2
2
|
import * as nodeModule from "node:module";
|
|
3
|
+
import { createRequire } from "node:module";
|
|
3
4
|
import * as z from "zod";
|
|
4
5
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
5
6
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -38,6 +39,12 @@ const WorkerBindingSchema = z.strictObject({
|
|
|
38
39
|
props: z.record(z.string(), z.unknown()).optional(),
|
|
39
40
|
dev: RemoteBindingDevSchema.optional()
|
|
40
41
|
});
|
|
42
|
+
const WorkflowBindingSchema = z.strictObject({
|
|
43
|
+
type: z.literal("workflow"),
|
|
44
|
+
name: z.string(),
|
|
45
|
+
worker: z.string(),
|
|
46
|
+
exportName: z.string()
|
|
47
|
+
});
|
|
41
48
|
const D1BindingSchema = z.strictObject({
|
|
42
49
|
type: z.literal("d1"),
|
|
43
50
|
name: z.string().optional(),
|
|
@@ -202,7 +209,8 @@ const KnownBindingSchema = z.discriminatedUnion("type", [
|
|
|
202
209
|
return value.tunnelId !== void 0 && value.networkId !== void 0 ? `"vpc-network" bindings must specify exactly one of "tunnelId" or "networkId", not both` : `"vpc-network" bindings must specify either "tunnelId" or "networkId"`;
|
|
203
210
|
} }),
|
|
204
211
|
WorkerBindingSchema,
|
|
205
|
-
z.strictObject({ type: z.literal("worker-loader") })
|
|
212
|
+
z.strictObject({ type: z.literal("worker-loader") }),
|
|
213
|
+
WorkflowBindingSchema
|
|
206
214
|
]);
|
|
207
215
|
const UnsafeBindingSchema = z.looseObject({
|
|
208
216
|
type: z.templateLiteral(["unsafe:", z.string().min(1)]),
|
|
@@ -427,9 +435,9 @@ const WorkflowExportSchema = z.strictObject({
|
|
|
427
435
|
limits: z.strictObject({ steps: z.number().int().min(1).optional() }).optional(),
|
|
428
436
|
concurrency: z.strictObject({ limit: z.number().int().min(1).optional() }).optional(),
|
|
429
437
|
schedules: z.union([z.string().min(1), z.array(z.string().min(1)).min(1)]).optional(),
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
438
|
+
defaultRetention: z.strictObject({
|
|
439
|
+
successRetention: WorkflowRetentionSchema.optional(),
|
|
440
|
+
errorRetention: WorkflowRetentionSchema.optional()
|
|
433
441
|
}).optional()
|
|
434
442
|
});
|
|
435
443
|
const DurableObjectCreatedSqliteExportSchema = DurableObjectCreatedExportSchema.extend({ storage: z.literal("sqlite") });
|
|
@@ -715,7 +723,8 @@ function generateTypes({ configPath, packageName = "@cloudflare/config" }) {
|
|
|
715
723
|
}
|
|
716
724
|
|
|
717
725
|
//#endregion
|
|
718
|
-
//#region ../workers-utils/dist/chunk-
|
|
726
|
+
//#region ../workers-utils/dist/chunk-U6NEESU5.mjs
|
|
727
|
+
const require$1 = createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
|
|
719
728
|
var __defProp = Object.defineProperty;
|
|
720
729
|
var __name = (target, value) => __defProp(target, "name", {
|
|
721
730
|
value,
|
|
@@ -723,7 +732,8 @@ var __name = (target, value) => __defProp(target, "name", {
|
|
|
723
732
|
});
|
|
724
733
|
|
|
725
734
|
//#endregion
|
|
726
|
-
//#region ../workers-utils/dist/chunk-
|
|
735
|
+
//#region ../workers-utils/dist/chunk-OWPFSLY6.mjs
|
|
736
|
+
createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
|
|
727
737
|
var UserError = class extends Error {
|
|
728
738
|
static {
|
|
729
739
|
__name(this, "UserError");
|
|
@@ -1203,6 +1213,14 @@ function convertBindingsAndAssets(config, result) {
|
|
|
1203
1213
|
case "worker-loader":
|
|
1204
1214
|
workerLoaders.push({ binding: name });
|
|
1205
1215
|
break;
|
|
1216
|
+
case "workflow":
|
|
1217
|
+
workflows.push({
|
|
1218
|
+
binding: name,
|
|
1219
|
+
name: binding.name,
|
|
1220
|
+
class_name: binding.exportName,
|
|
1221
|
+
script_name: binding.worker
|
|
1222
|
+
});
|
|
1223
|
+
break;
|
|
1206
1224
|
}
|
|
1207
1225
|
}
|
|
1208
1226
|
if (kvNamespaces.length) result.kv_namespaces = kvNamespaces;
|
|
@@ -1254,10 +1272,21 @@ function convertExports(config, result) {
|
|
|
1254
1272
|
const converted = {};
|
|
1255
1273
|
const unknownExports = {};
|
|
1256
1274
|
for (const [exportName, value] of Object.entries(exports$2)) {
|
|
1257
|
-
if (value.type === "worker"
|
|
1275
|
+
if (value.type === "worker") {
|
|
1258
1276
|
converted[exportName] = value;
|
|
1259
1277
|
continue;
|
|
1260
1278
|
}
|
|
1279
|
+
if (value.type === "workflow") {
|
|
1280
|
+
const { defaultRetention,...workflow } = value;
|
|
1281
|
+
converted[exportName] = {
|
|
1282
|
+
...workflow,
|
|
1283
|
+
...defaultRetention !== void 0 && { default_retention: {
|
|
1284
|
+
...defaultRetention.successRetention !== void 0 && { success_retention: defaultRetention.successRetention },
|
|
1285
|
+
...defaultRetention.errorRetention !== void 0 && { error_retention: defaultRetention.errorRetention }
|
|
1286
|
+
} }
|
|
1287
|
+
};
|
|
1288
|
+
continue;
|
|
1289
|
+
}
|
|
1261
1290
|
if (value.type !== "durable-object") {
|
|
1262
1291
|
unknownExports[exportName] = value;
|
|
1263
1292
|
continue;
|
|
@@ -1723,4 +1752,4 @@ async function loadAndParseConfigSettings(configPath, ctx) {
|
|
|
1723
1752
|
}
|
|
1724
1753
|
|
|
1725
1754
|
//#endregion
|
|
1726
|
-
export { AnalyticsEngineDatasetBindingSchema, AssetsSchema, BindingSchema, BrowserBindingSchema, D1BindingSchema, DurableObjectCreatedExportSchema, DurableObjectDeletedExportSchema, DurableObjectExpectingTransferExportSchema, DurableObjectRenamedExportSchema, DurableObjectTransferredExportSchema, ExportSchema, FlagshipBindingSchema, HyperdriveBindingSchema, InputConfigSchema, InputContainerSchema, InputSettingsSchema, InputWorkerSchema, KVBindingSchema, KnownBindingSchema, ModuleTypeSchema, OutputContainerSchema, OutputRootConfigSchema, OutputWorkerSchema, QueueBindingSchema, R2BindingSchema, TailConsumerSchema, UnsafeBindingSchema, WorkerBindingSchema, WorkerEntrypointExportSchema, WorkflowExportSchema, bindings, convertToWranglerConfig, defineConfig, defineContainer, defineWorker, exports$1 as exports, generateTypes, loadAndParseConfig, loadAndParseConfigSettings, loadConfig, registerConfigHooks, resolveAndParseConfig, resolveAndParseConfigSettings, triggers, validateSingletonBindings };
|
|
1755
|
+
export { AnalyticsEngineDatasetBindingSchema, AssetsSchema, BindingSchema, BrowserBindingSchema, D1BindingSchema, DurableObjectCreatedExportSchema, DurableObjectDeletedExportSchema, DurableObjectExpectingTransferExportSchema, DurableObjectRenamedExportSchema, DurableObjectTransferredExportSchema, ExportSchema, FlagshipBindingSchema, HyperdriveBindingSchema, InputConfigSchema, InputContainerSchema, InputSettingsSchema, InputWorkerSchema, KVBindingSchema, KnownBindingSchema, ModuleTypeSchema, OutputContainerSchema, OutputRootConfigSchema, OutputWorkerSchema, QueueBindingSchema, R2BindingSchema, TailConsumerSchema, UnsafeBindingSchema, WorkerBindingSchema, WorkerEntrypointExportSchema, WorkflowBindingSchema, WorkflowExportSchema, bindings, convertToWranglerConfig, defineConfig, defineContainer, defineWorker, exports$1 as exports, generateTypes, loadAndParseConfig, loadAndParseConfigSettings, loadConfig, registerConfigHooks, resolveAndParseConfig, resolveAndParseConfigSettings, triggers, validateSingletonBindings };
|
|
@@ -126,11 +126,11 @@ interface WorkflowExportOptions {
|
|
|
126
126
|
* does not set its own retention. Accepts milliseconds or a duration string
|
|
127
127
|
* such as `"3 days"`.
|
|
128
128
|
*/
|
|
129
|
-
|
|
129
|
+
defaultRetention?: {
|
|
130
130
|
/** How long to retain instances that completed successfully or were terminated. */
|
|
131
|
-
|
|
131
|
+
successRetention?: number | string;
|
|
132
132
|
/** How long to retain errored instances. */
|
|
133
|
-
|
|
133
|
+
errorRetention?: number | string;
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
136
|
interface WorkflowExport extends WorkflowExportOptions {
|
|
@@ -610,7 +610,7 @@ interface CloudflareConfig extends Settings {
|
|
|
610
610
|
/**
|
|
611
611
|
* Union of all binding definitions accepted in `env`.
|
|
612
612
|
*/
|
|
613
|
-
type Binding = AgentMemoryBinding | AiBinding | AiSearchBinding | AiSearchNamespaceBinding | AnalyticsEngineDatasetBinding | ArtifactsBinding | AssetsBinding | BrowserBinding | D1Binding | DispatchNamespaceBinding | DurableObjectBinding | FlagshipBinding | HyperdriveBinding | ImagesBinding$1 | JsonBinding | KvBinding | LogfwdrBinding | MediaBinding$1 | MtlsCertificateBinding | PipelineBinding | QueueBinding | R2Binding | RateLimitBinding | SecretBinding | SecretsStoreSecretBinding | SendEmailBinding | StreamBinding$1 | TextBinding | UnsafeBinding | VectorizeBinding | VersionMetadataBinding | VpcNetworkBinding | VpcServiceBinding | WorkerBinding | WorkerLoaderBinding;
|
|
613
|
+
type Binding = AgentMemoryBinding | AiBinding | AiSearchBinding | AiSearchNamespaceBinding | AnalyticsEngineDatasetBinding | ArtifactsBinding | AssetsBinding | BrowserBinding | D1Binding | DispatchNamespaceBinding | DurableObjectBinding | FlagshipBinding | HyperdriveBinding | ImagesBinding$1 | JsonBinding | KvBinding | LogfwdrBinding | MediaBinding$1 | MtlsCertificateBinding | PipelineBinding | QueueBinding | R2Binding | RateLimitBinding | SecretBinding | SecretsStoreSecretBinding | SendEmailBinding | StreamBinding$1 | TextBinding | UnsafeBinding | VectorizeBinding | VersionMetadataBinding | VpcNetworkBinding | VpcServiceBinding | WorkerBinding | WorkerLoaderBinding | WorkflowBinding;
|
|
614
614
|
/**
|
|
615
615
|
* Union of all trigger definitions accepted in `triggers`.
|
|
616
616
|
*/
|
|
@@ -1086,6 +1086,11 @@ interface ConfigContext {
|
|
|
1086
1086
|
* another context before they are used.
|
|
1087
1087
|
*/
|
|
1088
1088
|
type ConfigInput<T$1> = T$1 | Promise<T$1> | ((ctx: ConfigContext) => T$1 | Promise<T$1>);
|
|
1089
|
+
/** Recursively apply declared config properties without expanding open records. */
|
|
1090
|
+
type ContextualProperties<TInput extends object, TConfig> = TInput extends readonly unknown[] ? TConfig extends readonly (infer TElement)[] ? { [K in keyof TInput]: ContextualConfig<TInput[K], TElement> } : TConfig : string extends keyof TConfig ? TConfig : { [K in keyof TConfig]: K extends keyof TInput ? ContextualConfig<TInput[K], TConfig[K]> : TConfig[K] };
|
|
1091
|
+
type ContextualConfig<TInput, TConfig> = TInput extends Promise<infer TValue> ? Promise<ContextualConfig<TValue, TConfig>> : TInput extends ((ctx: ConfigContext) => infer TResult) ? (ctx: ConfigContext) => ContextualConfig<TResult, TConfig> : TConfig extends unknown ? TInput extends TConfig ? TInput & (TInput extends object ? ContextualProperties<TInput, TConfig> : TConfig) : never : never;
|
|
1092
|
+
/** Create a type-safe identity helper for a configuration value or factory. */
|
|
1093
|
+
|
|
1089
1094
|
type ContainerDefinition<T$1 extends ContainerConfig = ContainerConfig> = ConfigInput<T$1>;
|
|
1090
1095
|
type WorkerDefinition<T$1 extends WorkerConfig = WorkerConfig> = ConfigInput<T$1>;
|
|
1091
1096
|
/** A Worker name, value, promise, or context-aware factory. */
|
|
@@ -1105,7 +1110,7 @@ type WorkerReference = string | WorkerDefinition;
|
|
|
1105
1110
|
* });
|
|
1106
1111
|
* ```
|
|
1107
1112
|
*/
|
|
1108
|
-
declare const defineConfig: <const TInput extends ConfigInput<CloudflareConfig>>(config: TInput) => TInput;
|
|
1113
|
+
declare const defineConfig: <const TInput extends ConfigInput<CloudflareConfig>>(config: TInput & ContextualConfig<TInput, CloudflareConfig>) => TInput;
|
|
1109
1114
|
/**
|
|
1110
1115
|
* Define a Container.
|
|
1111
1116
|
*
|
|
@@ -1119,7 +1124,7 @@ declare const defineConfig: <const TInput extends ConfigInput<CloudflareConfig>>
|
|
|
1119
1124
|
* });
|
|
1120
1125
|
* ```
|
|
1121
1126
|
*/
|
|
1122
|
-
declare const defineContainer: <const TInput extends ConfigInput<ContainerConfig>>(config: TInput) => TInput;
|
|
1127
|
+
declare const defineContainer: <const TInput extends ConfigInput<ContainerConfig>>(config: TInput & ContextualConfig<TInput, ContainerConfig>) => TInput;
|
|
1123
1128
|
/**
|
|
1124
1129
|
* Define a Worker.
|
|
1125
1130
|
*
|
|
@@ -1133,7 +1138,7 @@ declare const defineContainer: <const TInput extends ConfigInput<ContainerConfig
|
|
|
1133
1138
|
* });
|
|
1134
1139
|
* ```
|
|
1135
1140
|
*/
|
|
1136
|
-
declare const defineWorker: <const TInput extends ConfigInput<WorkerConfig>>(config: TInput) => TInput;
|
|
1141
|
+
declare const defineWorker: <const TInput extends ConfigInput<WorkerConfig>>(config: TInput & ContextualConfig<TInput, WorkerConfig>) => TInput;
|
|
1137
1142
|
//#endregion
|
|
1138
1143
|
//#region src/utils.d.ts
|
|
1139
1144
|
/**
|
|
@@ -1647,15 +1652,17 @@ interface WorkerLoaderBinding {
|
|
|
1647
1652
|
type: "worker-loader";
|
|
1648
1653
|
}
|
|
1649
1654
|
interface WorkflowBindingOptions<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends WorkflowExportName<TWorker$1> = WorkflowExportName<TWorker$1>> {
|
|
1655
|
+
/** The name of the Workflow. */
|
|
1656
|
+
name: string;
|
|
1650
1657
|
/** The name or config of the Worker that defines the Workflow. */
|
|
1651
1658
|
worker: TWorker$1;
|
|
1652
1659
|
/** The exported class name of the Workflow. */
|
|
1653
1660
|
exportName: TExportName$1;
|
|
1654
1661
|
}
|
|
1655
1662
|
/**
|
|
1656
|
-
* Binding to a Workflow. `
|
|
1657
|
-
*
|
|
1658
|
-
* class name.
|
|
1663
|
+
* Binding to a Workflow. `name` identifies the Workflow, `worker` is the name
|
|
1664
|
+
* or config of the Worker that defines it, and `exportName` is the exported
|
|
1665
|
+
* `WorkflowEntrypoint` class name.
|
|
1659
1666
|
*/
|
|
1660
1667
|
interface WorkflowBinding<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends WorkflowExportName<TWorker$1> = WorkflowExportName<TWorker$1>> extends WorkflowBindingOptions<TWorker$1, TExportName$1> {
|
|
1661
1668
|
type: "workflow";
|
|
@@ -1825,6 +1832,12 @@ interface Bindings {
|
|
|
1825
1832
|
worker<TWorker$1 extends WorkerReference, TExportName$1 extends WorkerEntrypointExportName<TWorker$1> | undefined = undefined>(options: WorkerBindingOptions<TWorker$1, TExportName$1>): WorkerBinding<TWorker$1, NoInfer<TExportName$1>>;
|
|
1826
1833
|
/** Binding to a Worker Loader. */
|
|
1827
1834
|
workerLoader(): WorkerLoaderBinding;
|
|
1835
|
+
/**
|
|
1836
|
+
* Create a Workflow binding.
|
|
1837
|
+
* `worker` may be a Worker config reference or a Worker name.
|
|
1838
|
+
* `exportName` must be a valid `WorkflowEntrypoint` export for the given Worker.
|
|
1839
|
+
*/
|
|
1840
|
+
workflow<TWorker$1 extends WorkerReference, TExportName$1 extends WorkflowExportName<TWorker$1>>(options: WorkflowBindingOptions<TWorker$1, TExportName$1>): WorkflowBinding<TWorker$1, NoInfer<TExportName$1>>;
|
|
1828
1841
|
}
|
|
1829
1842
|
declare const bindings: Bindings;
|
|
1830
1843
|
//#endregion
|
|
@@ -123,7 +123,11 @@ const bindings = {
|
|
|
123
123
|
type: "worker",
|
|
124
124
|
...options
|
|
125
125
|
}),
|
|
126
|
-
workerLoader: () => ({ type: "worker-loader" })
|
|
126
|
+
workerLoader: () => ({ type: "worker-loader" }),
|
|
127
|
+
workflow: (options) => ({
|
|
128
|
+
type: "workflow",
|
|
129
|
+
...options
|
|
130
|
+
})
|
|
127
131
|
};
|
|
128
132
|
|
|
129
133
|
//#endregion
|
package/dist/public.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as Settings, A as TextBinding, B as WorkerBinding, C as QueueBinding, D as SecretsStoreSecretBinding, E as SecretBinding, F as UnsafeBinding, G as ContainerDefinition, H as WorkflowBinding, I as VectorizeBinding, J as defineConfig, K as WorkerDefinition, L as VersionMetadataBinding, M as TypedKvBinding, N as TypedPipelineBinding, O as SendEmailBinding, P as TypedQueueBinding, Q as ContainerConfig, R as VpcNetworkBinding, S as PipelineBinding, St as exports, T as RateLimitBinding, U as bindings, V as WorkerLoaderBinding, W as ConfigContext, X as defineWorker, Y as defineContainer, Z as CloudflareConfig, _ as JsonBinding, _t as Exports, a as AnalyticsEngineDatasetBinding, at as ScheduledTrigger, b as MediaBinding, bt as WorkflowExport, c as BindingDevOptions, ct as InferDurableNamespaces, d as D1Binding, dt as UnwrapConfig, et as WorkerConfig, f as DispatchNamespaceBinding, ft as DurableObjectCreatedExport, g as ImagesBinding, gt as DurableObjectTransferredExport, h as HyperdriveBinding, ht as DurableObjectRenamedExport, i as AiSearchNamespaceBinding, it as QueueConsumerTrigger, j as TypedAiBinding, k as StreamBinding, l as Bindings, lt as InferEnv, m as FlagshipBinding, mt as DurableObjectExpectingTransferExport, n as AiBinding, nt as EmailTrigger, o as ArtifactsBinding, ot as Triggers, p as DurableObjectBinding, pt as DurableObjectDeletedExport, q as WorkerReference, r as AiSearchBinding, rt as FetchTrigger, s as AssetsBinding, st as triggers, t as AgentMemoryBinding, tt as ConnectTrigger, u as BrowserBinding, ut as InferMainModule, v as KvBinding, vt as WorkerEntrypointExport, w as R2Binding, x as MtlsCertificateBinding, xt as WorkflowExportOptions, y as LogfwdrBinding, yt as WorkerEntrypointExportOptions, z as VpcServiceBinding } from "./public-
|
|
1
|
+
import { $ as Settings, A as TextBinding, B as WorkerBinding, C as QueueBinding, D as SecretsStoreSecretBinding, E as SecretBinding, F as UnsafeBinding, G as ContainerDefinition, H as WorkflowBinding, I as VectorizeBinding, J as defineConfig, K as WorkerDefinition, L as VersionMetadataBinding, M as TypedKvBinding, N as TypedPipelineBinding, O as SendEmailBinding, P as TypedQueueBinding, Q as ContainerConfig, R as VpcNetworkBinding, S as PipelineBinding, St as exports, T as RateLimitBinding, U as bindings, V as WorkerLoaderBinding, W as ConfigContext, X as defineWorker, Y as defineContainer, Z as CloudflareConfig, _ as JsonBinding, _t as Exports, a as AnalyticsEngineDatasetBinding, at as ScheduledTrigger, b as MediaBinding, bt as WorkflowExport, c as BindingDevOptions, ct as InferDurableNamespaces, d as D1Binding, dt as UnwrapConfig, et as WorkerConfig, f as DispatchNamespaceBinding, ft as DurableObjectCreatedExport, g as ImagesBinding, gt as DurableObjectTransferredExport, h as HyperdriveBinding, ht as DurableObjectRenamedExport, i as AiSearchNamespaceBinding, it as QueueConsumerTrigger, j as TypedAiBinding, k as StreamBinding, l as Bindings, lt as InferEnv, m as FlagshipBinding, mt as DurableObjectExpectingTransferExport, n as AiBinding, nt as EmailTrigger, o as ArtifactsBinding, ot as Triggers, p as DurableObjectBinding, pt as DurableObjectDeletedExport, q as WorkerReference, r as AiSearchBinding, rt as FetchTrigger, s as AssetsBinding, st as triggers, t as AgentMemoryBinding, tt as ConnectTrigger, u as BrowserBinding, ut as InferMainModule, v as KvBinding, vt as WorkerEntrypointExport, w as R2Binding, x as MtlsCertificateBinding, xt as WorkflowExportOptions, y as LogfwdrBinding, yt as WorkerEntrypointExportOptions, z as VpcServiceBinding } from "./public-DA8eKvPJ.mjs";
|
|
2
2
|
export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, ArtifactsBinding, AssetsBinding, BindingDevOptions, Bindings, BrowserBinding, CloudflareConfig, ConfigContext, ConnectTrigger, ContainerConfig, ContainerDefinition, 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, Settings, StreamBinding, TextBinding, Triggers, TypedAiBinding, TypedKvBinding, TypedPipelineBinding, TypedQueueBinding, UnsafeBinding, UnwrapConfig, VectorizeBinding, VersionMetadataBinding, VpcNetworkBinding, VpcServiceBinding, WorkerBinding, WorkerConfig, WorkerDefinition, WorkerEntrypointExport, WorkerEntrypointExportOptions, WorkerLoaderBinding, WorkerReference, WorkflowBinding, WorkflowExport, WorkflowExportOptions, bindings, defineConfig, defineContainer, defineWorker, exports, triggers };
|
package/dist/public.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as triggers, i as exports, n as defineContainer, o as bindings, r as defineWorker, t as defineConfig } from "./public-
|
|
1
|
+
import { a as triggers, i as exports, n as defineContainer, o as bindings, r as defineWorker, t as defineConfig } from "./public-srUjWEOA.mjs";
|
|
2
2
|
|
|
3
3
|
export { bindings, defineConfig, defineContainer, defineWorker, exports, triggers };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.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.20260926.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.44.0"
|
|
41
41
|
},
|
|
42
42
|
"workers-sdk": {
|
|
43
43
|
"prerelease": true
|