@cloudflare/config 0.18.0 → 0.19.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-X5O6jFLp.mjs";
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
import { RawConfig } from "@cloudflare/workers-utils";
|
|
4
4
|
|
|
@@ -555,9 +555,9 @@ declare const WorkflowExportSchema: z.ZodObject<{
|
|
|
555
555
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
556
556
|
}, z.core.$strict>>;
|
|
557
557
|
schedules: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
558
|
+
defaultRetention: z.ZodOptional<z.ZodObject<{
|
|
559
|
+
successRetention: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
560
|
+
errorRetention: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
561
561
|
}, z.core.$strict>>;
|
|
562
562
|
}, z.core.$strict>;
|
|
563
563
|
declare const ExportSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -606,9 +606,9 @@ declare const ExportSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
606
606
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
607
607
|
}, z.core.$strict>>;
|
|
608
608
|
schedules: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
609
|
+
defaultRetention: z.ZodOptional<z.ZodObject<{
|
|
610
|
+
successRetention: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
611
|
+
errorRetention: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
612
612
|
}, z.core.$strict>>;
|
|
613
613
|
}, z.core.$strict>]>;
|
|
614
614
|
declare const TailConsumerSchema: z.ZodObject<{
|
|
@@ -784,9 +784,9 @@ declare const InputWorkerSchema: z.ZodObject<{
|
|
|
784
784
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
785
785
|
}, z.core.$strict>>;
|
|
786
786
|
schedules: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
787
|
+
defaultRetention: z.ZodOptional<z.ZodObject<{
|
|
788
|
+
successRetention: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
789
|
+
errorRetention: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
790
790
|
}, z.core.$strict>>;
|
|
791
791
|
}, z.core.$strict>]>>>;
|
|
792
792
|
entrypoint: z.ZodOptional<z.ZodString>;
|
|
@@ -971,9 +971,9 @@ declare const InputConfigSchema: z.ZodObject<{
|
|
|
971
971
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
972
972
|
}, z.core.$strict>>;
|
|
973
973
|
schedules: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
974
|
+
defaultRetention: z.ZodOptional<z.ZodObject<{
|
|
975
|
+
successRetention: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
976
|
+
errorRetention: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
977
977
|
}, z.core.$strict>>;
|
|
978
978
|
}, z.core.$strict>]>>>;
|
|
979
979
|
entrypoint: z.ZodOptional<z.ZodString>;
|
|
@@ -1275,9 +1275,9 @@ declare const OutputWorkerSchema: z.ZodObject<{
|
|
|
1275
1275
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
1276
1276
|
}, z.core.$strict>>;
|
|
1277
1277
|
schedules: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1278
|
+
defaultRetention: z.ZodOptional<z.ZodObject<{
|
|
1279
|
+
successRetention: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
1280
|
+
errorRetention: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
1281
1281
|
}, z.core.$strict>>;
|
|
1282
1282
|
}, z.core.$strict>]>>>;
|
|
1283
1283
|
manifest: z.ZodOptional<z.ZodObject<{
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { a as triggers, i as exports$1, n as defineContainer, o as bindings, r as defineWorker, t as defineConfig } from "./public-CvUXcSEm.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";
|
|
@@ -427,9 +428,9 @@ const WorkflowExportSchema = z.strictObject({
|
|
|
427
428
|
limits: z.strictObject({ steps: z.number().int().min(1).optional() }).optional(),
|
|
428
429
|
concurrency: z.strictObject({ limit: z.number().int().min(1).optional() }).optional(),
|
|
429
430
|
schedules: z.union([z.string().min(1), z.array(z.string().min(1)).min(1)]).optional(),
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
431
|
+
defaultRetention: z.strictObject({
|
|
432
|
+
successRetention: WorkflowRetentionSchema.optional(),
|
|
433
|
+
errorRetention: WorkflowRetentionSchema.optional()
|
|
433
434
|
}).optional()
|
|
434
435
|
});
|
|
435
436
|
const DurableObjectCreatedSqliteExportSchema = DurableObjectCreatedExportSchema.extend({ storage: z.literal("sqlite") });
|
|
@@ -715,7 +716,8 @@ function generateTypes({ configPath, packageName = "@cloudflare/config" }) {
|
|
|
715
716
|
}
|
|
716
717
|
|
|
717
718
|
//#endregion
|
|
718
|
-
//#region ../workers-utils/dist/chunk-
|
|
719
|
+
//#region ../workers-utils/dist/chunk-U6NEESU5.mjs
|
|
720
|
+
const require$1 = createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
|
|
719
721
|
var __defProp = Object.defineProperty;
|
|
720
722
|
var __name = (target, value) => __defProp(target, "name", {
|
|
721
723
|
value,
|
|
@@ -723,7 +725,8 @@ var __name = (target, value) => __defProp(target, "name", {
|
|
|
723
725
|
});
|
|
724
726
|
|
|
725
727
|
//#endregion
|
|
726
|
-
//#region ../workers-utils/dist/chunk-
|
|
728
|
+
//#region ../workers-utils/dist/chunk-OWPFSLY6.mjs
|
|
729
|
+
createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
|
|
727
730
|
var UserError = class extends Error {
|
|
728
731
|
static {
|
|
729
732
|
__name(this, "UserError");
|
|
@@ -1254,10 +1257,21 @@ function convertExports(config, result) {
|
|
|
1254
1257
|
const converted = {};
|
|
1255
1258
|
const unknownExports = {};
|
|
1256
1259
|
for (const [exportName, value] of Object.entries(exports$2)) {
|
|
1257
|
-
if (value.type === "worker"
|
|
1260
|
+
if (value.type === "worker") {
|
|
1258
1261
|
converted[exportName] = value;
|
|
1259
1262
|
continue;
|
|
1260
1263
|
}
|
|
1264
|
+
if (value.type === "workflow") {
|
|
1265
|
+
const { defaultRetention,...workflow } = value;
|
|
1266
|
+
converted[exportName] = {
|
|
1267
|
+
...workflow,
|
|
1268
|
+
...defaultRetention !== void 0 && { default_retention: {
|
|
1269
|
+
...defaultRetention.successRetention !== void 0 && { success_retention: defaultRetention.successRetention },
|
|
1270
|
+
...defaultRetention.errorRetention !== void 0 && { error_retention: defaultRetention.errorRetention }
|
|
1271
|
+
} }
|
|
1272
|
+
};
|
|
1273
|
+
continue;
|
|
1274
|
+
}
|
|
1261
1275
|
if (value.type !== "durable-object") {
|
|
1262
1276
|
unknownExports[exportName] = value;
|
|
1263
1277
|
continue;
|
|
@@ -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 {
|
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-X5O6jFLp.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.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.20260925.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
|