@cloudflare/config 0.23.0 → 0.24.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 defineConfig, A as RateLimitBinding, B as UnsafeBinding, C as KvBinding, Ct as WorkerEntrypointExport, D as PipelineBinding, Dt as exports, E as MtlsCertificateBinding, Et as WorkflowExportOptions, F as TextBinding, G as WorkerBinding, H as VersionMetadataBinding, I as TypedAiBinding, J as bindings, K as WorkerLoaderBinding, L as TypedKvBinding, M as SecretsStoreSecretBinding, N as SendEmailBinding, O as QueueBinding, P as StreamBinding, Q as WorkerReference, R as TypedPipelineBinding, S as K2Record, St as Exports, T as MediaBinding, Tt as WorkflowExport, U as VpcNetworkBinding, V as VectorizeBinding, W as VpcServiceBinding, X as ContainerDefinition, Y as ConfigContext, Z as WorkerDefinition, _ as ImagesBinding, _t as DurableObjectCreatedExport, a as AnalyticsEngineDatasetBinding, at as WorkerConfig, b as K2ProduceResult, bt as DurableObjectRenamedExport, c as AssetsBinding, ct as FetchTrigger, d as BrowserBinding, dt as Triggers, et as defineContainer, f as D1Binding, ft as triggers, g as HyperdriveBinding, gt as UnwrapConfig, h as FlagshipBinding, ht as InferMainModule, i as AiSearchNamespaceBinding, it as Settings, j as SecretBinding, k as R2Binding, l as BindingDevOptions, lt as QueueConsumerTrigger, m as DurableObjectBinding, mt as InferEnv, n as AiBinding, nt as CloudflareConfig, o as AnalyticsSQLBinding, ot as ConnectTrigger, p as DispatchNamespaceBinding, pt as InferDurableNamespaces, q as WorkflowBinding, r as AiSearchBinding, rt as ContainerConfig, s as ArtifactsBinding, st as EmailTrigger, t as AgentMemoryBinding, tt as defineWorker, u as Bindings, ut as ScheduledTrigger, v as JsonBinding, vt as DurableObjectDeletedExport, w as LogfwdrBinding, wt as WorkerEntrypointExportOptions, x as K2Producer, xt as DurableObjectTransferredExport, y as K2Binding, yt as DurableObjectExpectingTransferExport, z as TypedQueueBinding } from "./public-
|
|
1
|
+
import { $ as defineConfig, A as RateLimitBinding, B as UnsafeBinding, C as KvBinding, Ct as WorkerEntrypointExport, D as PipelineBinding, Dt as exports, E as MtlsCertificateBinding, Et as WorkflowExportOptions, F as TextBinding, G as WorkerBinding, H as VersionMetadataBinding, I as TypedAiBinding, J as bindings, K as WorkerLoaderBinding, L as TypedKvBinding, M as SecretsStoreSecretBinding, N as SendEmailBinding, O as QueueBinding, P as StreamBinding, Q as WorkerReference, R as TypedPipelineBinding, S as K2Record, St as Exports, T as MediaBinding, Tt as WorkflowExport, U as VpcNetworkBinding, V as VectorizeBinding, W as VpcServiceBinding, X as ContainerDefinition, Y as ConfigContext, Z as WorkerDefinition, _ as ImagesBinding, _t as DurableObjectCreatedExport, a as AnalyticsEngineDatasetBinding, at as WorkerConfig, b as K2ProduceResult, bt as DurableObjectRenamedExport, c as AssetsBinding, ct as FetchTrigger, d as BrowserBinding, dt as Triggers, et as defineContainer, f as D1Binding, ft as triggers, g as HyperdriveBinding, gt as UnwrapConfig, h as FlagshipBinding, ht as InferMainModule, i as AiSearchNamespaceBinding, it as Settings, j as SecretBinding, k as R2Binding, l as BindingDevOptions, lt as QueueConsumerTrigger, m as DurableObjectBinding, mt as InferEnv, n as AiBinding, nt as CloudflareConfig, o as AnalyticsSQLBinding, ot as ConnectTrigger, p as DispatchNamespaceBinding, pt as InferDurableNamespaces, q as WorkflowBinding, r as AiSearchBinding, rt as ContainerConfig, s as ArtifactsBinding, st as EmailTrigger, t as AgentMemoryBinding, tt as defineWorker, u as Bindings, ut as ScheduledTrigger, v as JsonBinding, vt as DurableObjectDeletedExport, w as LogfwdrBinding, wt as WorkerEntrypointExportOptions, x as K2Producer, xt as DurableObjectTransferredExport, y as K2Binding, yt as DurableObjectExpectingTransferExport, z as TypedQueueBinding } from "./public-QtVVYn2k.mjs";
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
import { RawConfig } from "@cloudflare/workers-utils";
|
|
4
4
|
|
|
@@ -15,6 +15,7 @@ declare const AssetsSchema: z.ZodObject<{
|
|
|
15
15
|
"single-page-application": "single-page-application";
|
|
16
16
|
"404-page": "404-page";
|
|
17
17
|
}>>;
|
|
18
|
+
basePath: z.ZodOptional<z.ZodString>;
|
|
18
19
|
runWorkerFirst: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodBoolean]>>;
|
|
19
20
|
}, z.core.$strict>;
|
|
20
21
|
declare const BrowserBindingSchema: z.ZodObject<{
|
|
@@ -682,6 +683,7 @@ declare const InputWorkerSchema: z.ZodObject<{
|
|
|
682
683
|
"single-page-application": "single-page-application";
|
|
683
684
|
"404-page": "404-page";
|
|
684
685
|
}>>;
|
|
686
|
+
basePath: z.ZodOptional<z.ZodString>;
|
|
685
687
|
runWorkerFirst: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodBoolean]>>;
|
|
686
688
|
}, z.core.$strict>>;
|
|
687
689
|
domains: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -869,6 +871,7 @@ declare const InputConfigSchema: z.ZodObject<{
|
|
|
869
871
|
"single-page-application": "single-page-application";
|
|
870
872
|
"404-page": "404-page";
|
|
871
873
|
}>>;
|
|
874
|
+
basePath: z.ZodOptional<z.ZodString>;
|
|
872
875
|
runWorkerFirst: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodBoolean]>>;
|
|
873
876
|
}, z.core.$strict>>;
|
|
874
877
|
domains: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -1182,6 +1185,7 @@ declare const OutputWorkerSchema: z.ZodObject<{
|
|
|
1182
1185
|
"single-page-application": "single-page-application";
|
|
1183
1186
|
"404-page": "404-page";
|
|
1184
1187
|
}>>;
|
|
1188
|
+
basePath: z.ZodOptional<z.ZodString>;
|
|
1185
1189
|
runWorkerFirst: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodBoolean]>>;
|
|
1186
1190
|
}, z.core.$strict>>;
|
|
1187
1191
|
domains: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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-C9y9q2FF.mjs";
|
|
2
2
|
import * as nodeModule from "node:module";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import * as z from "zod";
|
|
@@ -26,6 +26,7 @@ const AssetsSchema = z.strictObject({
|
|
|
26
26
|
"404-page",
|
|
27
27
|
"none"
|
|
28
28
|
]).optional(),
|
|
29
|
+
basePath: z.string().optional(),
|
|
29
30
|
runWorkerFirst: z.union([z.array(z.string()), z.boolean()]).optional()
|
|
30
31
|
});
|
|
31
32
|
const BrowserBindingSchema = z.strictObject({
|
|
@@ -1292,6 +1293,7 @@ function convertBindingsAndAssets(config, result) {
|
|
|
1292
1293
|
if (assetsBindingName !== void 0) assets.binding = assetsBindingName;
|
|
1293
1294
|
if (config.assets?.htmlHandling !== void 0) assets.html_handling = config.assets.htmlHandling;
|
|
1294
1295
|
if (config.assets?.notFoundHandling !== void 0) assets.not_found_handling = config.assets.notFoundHandling;
|
|
1296
|
+
if (config.assets?.basePath !== void 0) assets.base_path = config.assets.basePath;
|
|
1295
1297
|
if (config.assets?.runWorkerFirst !== void 0) assets.run_worker_first = config.assets.runWorkerFirst;
|
|
1296
1298
|
result.assets = assets;
|
|
1297
1299
|
}
|
|
@@ -29,6 +29,10 @@ const bindings = {
|
|
|
29
29
|
type: "browser",
|
|
30
30
|
...options
|
|
31
31
|
}),
|
|
32
|
+
analytics: (options) => ({
|
|
33
|
+
type: "analytics",
|
|
34
|
+
...options
|
|
35
|
+
}),
|
|
32
36
|
d1: (options) => ({
|
|
33
37
|
type: "d1",
|
|
34
38
|
...options
|
|
@@ -115,10 +119,6 @@ const bindings = {
|
|
|
115
119
|
...options
|
|
116
120
|
}),
|
|
117
121
|
versionMetadata: () => ({ type: "version-metadata" }),
|
|
118
|
-
analyticsSQL: (options) => ({
|
|
119
|
-
type: "analytics",
|
|
120
|
-
...options
|
|
121
|
-
}),
|
|
122
122
|
vpcService: (options) => ({
|
|
123
123
|
type: "vpc-service",
|
|
124
124
|
...options
|
|
@@ -864,6 +864,10 @@ interface WorkerConfig {
|
|
|
864
864
|
htmlHandling?: "auto-trailing-slash" | "drop-trailing-slash" | "force-trailing-slash" | "none";
|
|
865
865
|
/** How to handle requests that do not match an asset. */
|
|
866
866
|
notFoundHandling?: "single-page-application" | "404-page" | "none";
|
|
867
|
+
/**
|
|
868
|
+
* The public URL prefix under which the application is served.
|
|
869
|
+
*/
|
|
870
|
+
basePath?: string;
|
|
867
871
|
/**
|
|
868
872
|
* Matches will be routed to the User Worker, and matches to negative rules will go to the Asset Worker.
|
|
869
873
|
*
|
|
@@ -1766,8 +1770,8 @@ interface Bindings {
|
|
|
1766
1770
|
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering
|
|
1767
1771
|
*/
|
|
1768
1772
|
browser(options?: BrowserBindingOptions): BrowserBinding;
|
|
1769
|
-
/** An Analytics
|
|
1770
|
-
|
|
1773
|
+
/** An Analytics binding. */
|
|
1774
|
+
analytics(options?: AnalyticsSQLBindingOptions): AnalyticsSQLBinding$1;
|
|
1771
1775
|
/**
|
|
1772
1776
|
* Binding to a D1 database.
|
|
1773
1777
|
*
|
package/dist/public.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as defineConfig, A as RateLimitBinding, B as UnsafeBinding, C as KvBinding, Ct as WorkerEntrypointExport, D as PipelineBinding, Dt as exports, E as MtlsCertificateBinding, Et as WorkflowExportOptions, F as TextBinding, G as WorkerBinding, H as VersionMetadataBinding, I as TypedAiBinding, J as bindings, K as WorkerLoaderBinding, L as TypedKvBinding, M as SecretsStoreSecretBinding, N as SendEmailBinding, O as QueueBinding, P as StreamBinding, Q as WorkerReference, R as TypedPipelineBinding, S as K2Record, St as Exports, T as MediaBinding, Tt as WorkflowExport, U as VpcNetworkBinding, V as VectorizeBinding, W as VpcServiceBinding, X as ContainerDefinition, Y as ConfigContext, Z as WorkerDefinition, _ as ImagesBinding, _t as DurableObjectCreatedExport, a as AnalyticsEngineDatasetBinding, at as WorkerConfig, b as K2ProduceResult, bt as DurableObjectRenamedExport, c as AssetsBinding, ct as FetchTrigger, d as BrowserBinding, dt as Triggers, et as defineContainer, f as D1Binding, ft as triggers, g as HyperdriveBinding, gt as UnwrapConfig, h as FlagshipBinding, ht as InferMainModule, i as AiSearchNamespaceBinding, it as Settings, j as SecretBinding, k as R2Binding, l as BindingDevOptions, lt as QueueConsumerTrigger, m as DurableObjectBinding, mt as InferEnv, n as AiBinding, nt as CloudflareConfig, o as AnalyticsSQLBinding, ot as ConnectTrigger, p as DispatchNamespaceBinding, pt as InferDurableNamespaces, q as WorkflowBinding, r as AiSearchBinding, rt as ContainerConfig, s as ArtifactsBinding, st as EmailTrigger, t as AgentMemoryBinding, tt as defineWorker, u as Bindings, ut as ScheduledTrigger, v as JsonBinding, vt as DurableObjectDeletedExport, w as LogfwdrBinding, wt as WorkerEntrypointExportOptions, x as K2Producer, xt as DurableObjectTransferredExport, y as K2Binding, yt as DurableObjectExpectingTransferExport, z as TypedQueueBinding } from "./public-
|
|
1
|
+
import { $ as defineConfig, A as RateLimitBinding, B as UnsafeBinding, C as KvBinding, Ct as WorkerEntrypointExport, D as PipelineBinding, Dt as exports, E as MtlsCertificateBinding, Et as WorkflowExportOptions, F as TextBinding, G as WorkerBinding, H as VersionMetadataBinding, I as TypedAiBinding, J as bindings, K as WorkerLoaderBinding, L as TypedKvBinding, M as SecretsStoreSecretBinding, N as SendEmailBinding, O as QueueBinding, P as StreamBinding, Q as WorkerReference, R as TypedPipelineBinding, S as K2Record, St as Exports, T as MediaBinding, Tt as WorkflowExport, U as VpcNetworkBinding, V as VectorizeBinding, W as VpcServiceBinding, X as ContainerDefinition, Y as ConfigContext, Z as WorkerDefinition, _ as ImagesBinding, _t as DurableObjectCreatedExport, a as AnalyticsEngineDatasetBinding, at as WorkerConfig, b as K2ProduceResult, bt as DurableObjectRenamedExport, c as AssetsBinding, ct as FetchTrigger, d as BrowserBinding, dt as Triggers, et as defineContainer, f as D1Binding, ft as triggers, g as HyperdriveBinding, gt as UnwrapConfig, h as FlagshipBinding, ht as InferMainModule, i as AiSearchNamespaceBinding, it as Settings, j as SecretBinding, k as R2Binding, l as BindingDevOptions, lt as QueueConsumerTrigger, m as DurableObjectBinding, mt as InferEnv, n as AiBinding, nt as CloudflareConfig, o as AnalyticsSQLBinding, ot as ConnectTrigger, p as DispatchNamespaceBinding, pt as InferDurableNamespaces, q as WorkflowBinding, r as AiSearchBinding, rt as ContainerConfig, s as ArtifactsBinding, st as EmailTrigger, t as AgentMemoryBinding, tt as defineWorker, u as Bindings, ut as ScheduledTrigger, v as JsonBinding, vt as DurableObjectDeletedExport, w as LogfwdrBinding, wt as WorkerEntrypointExportOptions, x as K2Producer, xt as DurableObjectTransferredExport, y as K2Binding, yt as DurableObjectExpectingTransferExport, z as TypedQueueBinding } from "./public-QtVVYn2k.mjs";
|
|
2
2
|
export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, AnalyticsSQLBinding, 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, K2Binding, K2ProduceResult, K2Producer, K2Record, 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-C9y9q2FF.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.24.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.20261006.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.47.0"
|
|
41
41
|
},
|
|
42
42
|
"workers-sdk": {
|
|
43
43
|
"prerelease": true
|