@cloudflare/config 0.22.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-DFY8wDEh.mjs";
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<{
@@ -404,6 +405,7 @@ declare const InputContainerSchema: z.ZodUnion<readonly [z.ZodObject<{
404
405
  jurisdiction: z.ZodOptional<z.ZodEnum<{
405
406
  eu: "eu";
406
407
  fedramp: "fedramp";
408
+ us: "us";
407
409
  }>>;
408
410
  }, z.core.$strict>>;
409
411
  rollout: z.ZodOptional<z.ZodObject<{
@@ -509,6 +511,7 @@ declare const OutputContainerSchema: z.ZodUnion<readonly [z.ZodObject<{
509
511
  jurisdiction: z.ZodOptional<z.ZodEnum<{
510
512
  eu: "eu";
511
513
  fedramp: "fedramp";
514
+ us: "us";
512
515
  }>>;
513
516
  }, z.core.$strict>>;
514
517
  rollout: z.ZodOptional<z.ZodObject<{
@@ -680,6 +683,7 @@ declare const InputWorkerSchema: z.ZodObject<{
680
683
  "single-page-application": "single-page-application";
681
684
  "404-page": "404-page";
682
685
  }>>;
686
+ basePath: z.ZodOptional<z.ZodString>;
683
687
  runWorkerFirst: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodBoolean]>>;
684
688
  }, z.core.$strict>>;
685
689
  domains: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -867,6 +871,7 @@ declare const InputConfigSchema: z.ZodObject<{
867
871
  "single-page-application": "single-page-application";
868
872
  "404-page": "404-page";
869
873
  }>>;
874
+ basePath: z.ZodOptional<z.ZodString>;
870
875
  runWorkerFirst: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodBoolean]>>;
871
876
  }, z.core.$strict>>;
872
877
  domains: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -1078,6 +1083,7 @@ declare const InputConfigSchema: z.ZodObject<{
1078
1083
  jurisdiction: z.ZodOptional<z.ZodEnum<{
1079
1084
  eu: "eu";
1080
1085
  fedramp: "fedramp";
1086
+ us: "us";
1081
1087
  }>>;
1082
1088
  }, z.core.$strict>>;
1083
1089
  rollout: z.ZodOptional<z.ZodObject<{
@@ -1179,6 +1185,7 @@ declare const OutputWorkerSchema: z.ZodObject<{
1179
1185
  "single-page-application": "single-page-application";
1180
1186
  "404-page": "404-page";
1181
1187
  }>>;
1188
+ basePath: z.ZodOptional<z.ZodString>;
1182
1189
  runWorkerFirst: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodBoolean]>>;
1183
1190
  }, z.core.$strict>>;
1184
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-D1wKrJ5f.mjs";
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({
@@ -382,7 +383,11 @@ const StandardContainerBaseSchema = BaseContainerSchema.extend({
382
383
  "OC",
383
384
  "AFR"
384
385
  ])).optional(),
385
- jurisdiction: z.enum(["eu", "fedramp"]).optional()
386
+ jurisdiction: z.enum([
387
+ "eu",
388
+ "fedramp",
389
+ "us"
390
+ ]).optional()
386
391
  }).optional(),
387
392
  rollout: z.strictObject({
388
393
  kind: z.enum([
@@ -1288,6 +1293,7 @@ function convertBindingsAndAssets(config, result) {
1288
1293
  if (assetsBindingName !== void 0) assets.binding = assetsBindingName;
1289
1294
  if (config.assets?.htmlHandling !== void 0) assets.html_handling = config.assets.htmlHandling;
1290
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;
1291
1297
  if (config.assets?.runWorkerFirst !== void 0) assets.run_worker_first = config.assets.runWorkerFirst;
1292
1298
  result.assets = assets;
1293
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
@@ -755,7 +755,7 @@ interface StandardContainerConfig extends BaseContainerConfig {
755
755
  /** Limit Container placement to specific geographic regions. */
756
756
  regions?: Array<"ENAM" | "WNAM" | "EEUR" | "WEUR" | "APAC" | "SAM" | "ME" | "OC" | "AFR">;
757
757
  /** Restrict Containers to compliance boundaries. */
758
- jurisdiction?: "eu" | "fedramp";
758
+ jurisdiction?: "eu" | "fedramp" | "us";
759
759
  };
760
760
  rollout?: {
761
761
  /**
@@ -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 SQL binding. */
1770
- analyticsSQL(options?: AnalyticsSQLBindingOptions): AnalyticsSQLBinding$1;
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-DFY8wDEh.mjs";
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-D1wKrJ5f.mjs";
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.22.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.20260930.2",
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.45.0"
40
+ "@cloudflare/workers-utils": "0.47.0"
41
41
  },
42
42
  "workers-sdk": {
43
43
  "prerelease": true