wrangler 4.52.0 → 4.53.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.
@@ -1,6 +1,6 @@
1
- import { Rule, CfModule, Environment, CfScriptFormat, CfModuleType, Config, CfKvNamespace, CfSendEmailBindings, CfBrowserBinding, CfAIBinding, CfImagesBinding, CfDurableObject, CfWorkflow, CfQueue, CfR2Bucket, CfD1Database, CfVectorize, CfHyperdrive, CfService, CfAnalyticsEngineDataset, CfDispatchNamespace, CfMTlsCertificate, CfPipeline, CfSecretsStoreSecrets, CfLogfwdrBinding, CfHelloWorld, CfRateLimit, CfWorkerLoader, CfVpcService, CfMediaBinding, DurableObjectMigration, ContainerApp, ZoneIdRoute, ZoneNameRoute, CustomDomainRoute, CfTailConsumer, ContainerEngine, CfUnsafe, ConfigBindingOptions, NormalizeAndValidateConfigArgs, ResolveConfigPathOptions, RawConfig, PackageJSON, ParseError, ComplianceConfig, UserError, FatalError } from '@cloudflare/workers-utils';
2
- export { ConfigBindingOptions as Experimental_ConfigBindingOptions, Config as Unstable_Config, RawConfig as Unstable_RawConfig, RawEnvironment as Unstable_RawEnvironment, experimental_patchConfig, experimental_readRawConfig, defaultWranglerConfig as unstable_defaultWranglerConfig } from '@cloudflare/workers-utils';
3
- import { Json, Request, Response as Response$1, NodeJSCompatMode, DispatchFetch, Miniflare, WorkerRegistry, MiniflareOptions, Mutex, WorkerOptions, ModuleRule, RemoteProxyConnectionString } from 'miniflare';
1
+ import { Rule as Rule$1, CfModule, Environment as Environment$1, CfScriptFormat, CfModuleType, Config as Config$1, CfKvNamespace, CfSendEmailBindings, CfBrowserBinding, CfAIBinding, CfImagesBinding, CfDurableObject, CfWorkflow, CfQueue, CfR2Bucket, CfD1Database, CfVectorize, CfHyperdrive, CfService, CfAnalyticsEngineDataset, CfDispatchNamespace, CfMTlsCertificate, CfPipeline, CfSecretsStoreSecrets, CfLogfwdrBinding, CfHelloWorld, CfRateLimit, CfWorkerLoader, CfVpcService, CfMediaBinding, DurableObjectMigration as DurableObjectMigration$1, ContainerApp as ContainerApp$1, ZoneIdRoute as ZoneIdRoute$1, ZoneNameRoute as ZoneNameRoute$1, CustomDomainRoute as CustomDomainRoute$1, CfTailConsumer, ContainerEngine as ContainerEngine$1, CfUnsafe, ConfigBindingOptions, NormalizeAndValidateConfigArgs, ResolveConfigPathOptions, RawConfig as RawConfig$1, PackageJSON, ParseError, ComplianceConfig, UserError, FatalError } from '@cloudflare/workers-utils';
2
+ export { ConfigBindingOptions as Experimental_ConfigBindingOptions, experimental_patchConfig, experimental_readRawConfig, defaultWranglerConfig as unstable_defaultWranglerConfig } from '@cloudflare/workers-utils';
3
+ import { Json as Json$1, Request, Response as Response$1, NodeJSCompatMode, DispatchFetch, Miniflare, WorkerRegistry, MiniflareOptions, Mutex, WorkerOptions, ModuleRule, RemoteProxyConnectionString } from 'miniflare';
4
4
  import * as undici from 'undici';
5
5
  import { RequestInfo, RequestInit, Response, FormData } from 'undici';
6
6
  import { RouterConfig, AssetConfig } from '@cloudflare/workers-shared';
@@ -37,7 +37,7 @@ interface Unstable_DevOptions {
37
37
  compatibilityFlags?: string[];
38
38
  persist?: boolean;
39
39
  persistTo?: string;
40
- vars?: Record<string, string | Json>;
40
+ vars?: Record<string, string | Json$1>;
41
41
  kv?: {
42
42
  binding: string;
43
43
  id?: string;
@@ -70,7 +70,7 @@ interface Unstable_DevOptions {
70
70
  binding: string;
71
71
  };
72
72
  moduleRoot?: string;
73
- rules?: Rule[];
73
+ rules?: Rule$1[];
74
74
  logLevel?: "none" | "info" | "error" | "log" | "warn" | "debug";
75
75
  inspect?: boolean;
76
76
  local?: boolean;
@@ -78,7 +78,7 @@ interface Unstable_DevOptions {
78
78
  experimental?: {
79
79
  processEntrypoint?: boolean;
80
80
  additionalModules?: CfModule[];
81
- d1Databases?: Environment["d1_databases"];
81
+ d1Databases?: Environment$1["d1_databases"];
82
82
  disableExperimentalWarning?: boolean;
83
83
  disableDevRegistry?: boolean;
84
84
  enablePagesAssetsServiceBinding?: EnablePagesAssetsServiceBindingOptions;
@@ -363,7 +363,7 @@ interface StartDevWorkerInput {
363
363
  /** The compatibility flags for the workerd runtime. */
364
364
  compatibilityFlags?: string[];
365
365
  /** Specify the compliance region mode of the Worker. */
366
- complianceRegion?: Config["compliance_region"];
366
+ complianceRegion?: Config$1["compliance_region"];
367
367
  /** Configuration for Python modules. */
368
368
  pythonModules?: {
369
369
  /** A list of glob patterns to exclude files from the python_modules directory when bundling. */
@@ -379,8 +379,8 @@ interface StartDevWorkerInput {
379
379
  envFiles?: string[];
380
380
  /** The bindings available to the worker. The specified bindind type will be exposed to the worker on the `env` object under the same key. */
381
381
  bindings?: Record<string, Binding>;
382
- migrations?: DurableObjectMigration[];
383
- containers?: ContainerApp[];
382
+ migrations?: DurableObjectMigration$1[];
383
+ containers?: ContainerApp$1[];
384
384
  /** The triggers which will cause the worker's exported default handlers to be called. */
385
385
  triggers?: Trigger[];
386
386
  tailConsumers?: CfTailConsumer[];
@@ -400,7 +400,7 @@ interface StartDevWorkerInput {
400
400
  findAdditionalModules?: boolean;
401
401
  processEntrypoint?: boolean;
402
402
  /** Specifies types of modules matched by globs. */
403
- moduleRules?: Rule[];
403
+ moduleRules?: Rule$1[];
404
404
  /** Replace global identifiers with constant expressions, e.g. { debug: 'true', version: '"1.0.0"' }. Only takes effect if bundle: true. */
405
405
  define?: Record<string, string>;
406
406
  /** Alias modules */
@@ -421,7 +421,7 @@ interface StartDevWorkerInput {
421
421
  jsxFactory?: string;
422
422
  jsxFragment?: string;
423
423
  tsconfig?: string;
424
- nodejsCompatMode?: Hook<NodeJSCompatMode, [Config]>;
424
+ nodejsCompatMode?: Hook<NodeJSCompatMode, [Config$1]>;
425
425
  moduleRoot?: string;
426
426
  };
427
427
  /** Options applying to the worker's development preview environment. */
@@ -439,7 +439,7 @@ interface StartDevWorkerInput {
439
439
  */
440
440
  remote?: boolean | "minimal";
441
441
  /** Cloudflare Account credentials. Can be provided upfront or as a function which will be called only when required. */
442
- auth?: AsyncHook<CfAccount, [Pick<Config, "account_id">]>;
442
+ auth?: AsyncHook<CfAccount, [Pick<Config$1, "account_id">]>;
443
443
  /** Whether local storage (KV, Durable Objects, R2, D1, etc) is persisted. You can also specify the directory to persist data to. */
444
444
  persist?: string;
445
445
  /** Controls which logs are logged 🤙. */
@@ -476,10 +476,10 @@ interface StartDevWorkerInput {
476
476
  /** Path to the docker executable. Defaults to 'docker' */
477
477
  dockerPath?: string;
478
478
  /** Options for the container engine */
479
- containerEngine?: ContainerEngine;
479
+ containerEngine?: ContainerEngine$1;
480
480
  };
481
481
  legacy?: {
482
- site?: Hook<Config["site"], [Config]>;
482
+ site?: Hook<Config$1["site"], [Config$1]>;
483
483
  useServiceEnvironments?: boolean;
484
484
  };
485
485
  unsafe?: Omit<CfUnsafe, "bindings">;
@@ -495,14 +495,14 @@ type StartDevWorkerOptions = Omit<StartDevWorkerInput, "assets" | "containers">
495
495
  nodejsCompatMode: NodeJSCompatMode;
496
496
  format: CfScriptFormat;
497
497
  moduleRoot: string;
498
- moduleRules: Rule[];
498
+ moduleRules: Rule$1[];
499
499
  define: Record<string, string>;
500
500
  additionalModules: CfModule[];
501
501
  exports: string[];
502
502
  processEntrypoint: boolean;
503
503
  };
504
504
  legacy: StartDevWorkerInput["legacy"] & {
505
- site?: Config["site"];
505
+ site?: Config$1["site"];
506
506
  };
507
507
  dev: StartDevWorkerInput["dev"] & {
508
508
  persist: string;
@@ -512,7 +512,7 @@ type StartDevWorkerOptions = Omit<StartDevWorkerInput, "assets" | "containers">
512
512
  assets?: AssetsOptions;
513
513
  containers?: ContainerNormalizedConfig[];
514
514
  name: string;
515
- complianceRegion: Config["compliance_region"];
515
+ complianceRegion: Config$1["compliance_region"];
516
516
  };
517
517
  type HookValues = string | number | boolean | object | undefined | null;
518
518
  type Hook<T extends HookValues, Args extends unknown[] = []> = T | ((...args: Args) => T);
@@ -526,7 +526,7 @@ type File<Contents = string, Path = string> = {
526
526
  path?: Path;
527
527
  };
528
528
  type BinaryFile = File<Uint8Array>;
529
- type QueueConsumer = NonNullable<Config["queues"]["consumers"]>[number];
529
+ type QueueConsumer = NonNullable<Config$1["queues"]["consumers"]>[number];
530
530
  type Trigger = {
531
531
  type: "workers.dev";
532
532
  } | {
@@ -534,11 +534,11 @@ type Trigger = {
534
534
  pattern: string;
535
535
  } | ({
536
536
  type: "route";
537
- } & ZoneIdRoute) | ({
537
+ } & ZoneIdRoute$1) | ({
538
538
  type: "route";
539
- } & ZoneNameRoute) | ({
539
+ } & ZoneNameRoute$1) | ({
540
540
  type: "route";
541
- } & CustomDomainRoute) | {
541
+ } & CustomDomainRoute$1) | {
542
542
  type: "cron";
543
543
  cron: string;
544
544
  } | ({
@@ -551,7 +551,7 @@ type Binding = {
551
551
  value: string;
552
552
  } | {
553
553
  type: "json";
554
- value: Json;
554
+ value: Json$1;
555
555
  } | ({
556
556
  type: "kv_namespace";
557
557
  } & BindingOmit<CfKvNamespace>) | ({
@@ -838,9 +838,9 @@ type ReadConfigOptions = ResolveConfigPathOptions & {
838
838
  /**
839
839
  * Get the Wrangler configuration; read it from the give `configPath` if available.
840
840
  */
841
- declare function readConfig(args: ReadConfigCommandArgs, options?: ReadConfigOptions): Config;
841
+ declare function readConfig(args: ReadConfigCommandArgs, options?: ReadConfigOptions): Config$1;
842
842
 
843
- declare function getDurableObjectClassNameToUseSQLiteMap(migrations: Config["migrations"] | undefined): Map<string, boolean>;
843
+ declare function getDurableObjectClassNameToUseSQLiteMap(migrations: Config$1["migrations"] | undefined): Map<string, boolean>;
844
844
 
845
845
  /**
846
846
  * Note about this file:
@@ -889,99 +889,1603 @@ declare class ExecutionContext {
889
889
  props: any;
890
890
  }
891
891
 
892
- /**
893
- * Get the Worker `vars` bindings for a `wrangler dev` instance of a Worker.
894
- *
895
- * The `vars` bindings can be specified in the Wrangler configuration file.
896
- * But "secret" `vars` are usually only provided at the server -
897
- * either by creating them in the Dashboard UI, or using the `wrangler secret` command.
898
- *
899
- * It is useful during development, to provide these types of variable locally.
900
- * When running `wrangler dev` we will look for a file called `.dev.vars`, situated
901
- * next to the User's Wrangler configuration file (or in the current working directory if there is no
902
- * Wrangler configuration). If the `--env <env>` option is set, we'll first look for
903
- * `.dev.vars.<env>`.
904
- *
905
- * If there are no `.dev.vars*` file, (and CLOUDFLARE_LOAD_DEV_VARS_FROM_DOT_ENV is not "false")
906
- * we will look for `.env*` files in the same directory.
907
- * If the `envFiles` option is set, we'll look for the `.env` files at those paths instead of the defaults.
908
- *
909
- * Any values in these files (all formatted like `.env` files) will add to or override `vars`
910
- * bindings provided in the Wrangler configuration file.
911
- *
912
- * @param configPath - The path to the Wrangler configuration file, if defined.
913
- * @param envFiles - An array of paths to .env files to load; if `undefined` the default .env files will be used (see `getDefaultEnvFiles()`).
914
- * The `envFiles` paths are resolved against the directory of the Wrangler configuration file, if there is one, otherwise against the current working directory.
915
- * @param vars - The existing `vars` bindings from the Wrangler configuration.
916
- * @param env - The specific environment name (e.g., "staging") or `undefined` if no specific environment is set.
917
- * @param silent - If true, will not log any messages about the loaded .dev.vars files or .env files.
918
- * @returns The merged `vars` bindings, including those loaded from `.dev.vars` or `.env` files.
919
- */
920
- declare function getVarsForDev(configPath: string | undefined, envFiles: string[] | undefined, vars: Config["vars"], env: string | undefined, silent?: boolean): Config["vars"];
892
+ type Json = string | number | boolean | null | Json[] | {
893
+ [id: string]: Json;
894
+ };
921
895
 
922
896
  /**
923
- * Returns the compatibility date to use in development.
924
- *
925
- * When no compatibility date is configured, uses the installed Workers runtime's latest supported date.
897
+ * The `Environment` interface declares all the configuration fields that
898
+ * can be specified for an environment.
926
899
  *
927
- * @param config wrangler configuration
928
- * @param compatibilityDate configured compatibility date
929
- * @returns the compatibility date to use in development
900
+ * This could be the top-level default environment, or a specific named environment.
930
901
  */
931
- declare function getDevCompatibilityDate(config: Config | undefined, compatibilityDate?: string | undefined): string;
932
-
933
- type ConfigurationOptions = {
934
- outputDir: string;
935
- projectPath: string;
936
- workerName: string;
937
- dryRun: boolean;
902
+ interface Environment extends EnvironmentInheritable, EnvironmentNonInheritable {
903
+ }
904
+ type SimpleRoute = string;
905
+ type ZoneIdRoute = {
906
+ pattern: string;
907
+ zone_id: string;
908
+ custom_domain?: boolean;
938
909
  };
939
- type ConfigurationResults = {
940
- wranglerConfig: RawConfig;
910
+ type ZoneNameRoute = {
911
+ pattern: string;
912
+ zone_name: string;
913
+ custom_domain?: boolean;
941
914
  };
942
- declare abstract class Framework {
915
+ type CustomDomainRoute = {
916
+ pattern: string;
917
+ custom_domain: boolean;
918
+ };
919
+ type Route = SimpleRoute | ZoneIdRoute | ZoneNameRoute | CustomDomainRoute;
920
+ /**
921
+ * Configuration in wrangler for Cloudchamber
922
+ */
923
+ type CloudchamberConfig = {
924
+ image?: string;
925
+ location?: string;
926
+ instance_type?: "dev" | "basic" | "standard" | "lite" | "standard-1" | "standard-2" | "standard-3" | "standard-4";
927
+ vcpu?: number;
928
+ memory?: string;
929
+ ipv4?: boolean;
930
+ };
931
+ type UnsafeBinding = {
932
+ /**
933
+ * The name of the binding provided to the Worker
934
+ */
943
935
  name: string;
944
- constructor(name?: string);
945
- preview?: string;
946
- deploy?: string;
947
- typegen?: string;
948
- /** Some frameworks (i.e. Nuxt) don't need additional configuration */
949
- get configured(): boolean;
950
- abstract configure(options: ConfigurationOptions): Promise<ConfigurationResults> | ConfigurationResults;
951
- configurationDescription?: string;
952
- }
953
-
954
- type AutoConfigDetails = {
955
- /** The name of the worker */
956
- workerName: string;
957
- /** The path to the project (defaults to cwd) */
958
- projectPath: string;
959
- /** The content of the project's package.json file (if any) */
960
- packageJson?: PackageJSON;
961
- /** Whether the project is already configured (no autoconfig required) */
962
- configured: boolean;
963
- /** Details about the detected framework (if any) */
964
- framework?: Framework;
965
- /** The build command used to build the project (if any) */
966
- buildCommand?: string;
967
- /** The output directory (if no framework is used, points to the raw asset files) */
968
- outputDir?: string;
936
+ /**
937
+ * The 'type' of the unsafe binding.
938
+ */
939
+ type: string;
940
+ dev?: {
941
+ plugin: {
942
+ /**
943
+ * Package is the bare specifier of the package that exposes plugins to integrate into Miniflare via a named `plugins` export.
944
+ * @example "@cloudflare/my-external-miniflare-plugin"
945
+ */
946
+ package: string;
947
+ /**
948
+ * Plugin is the name of the plugin exposed by the package.
949
+ * @example "MY_UNSAFE_PLUGIN"
950
+ */
951
+ name: string;
952
+ };
953
+ /**
954
+ * Optional mapping of unsafe bindings names to options provided for the plugin.
955
+ */
956
+ options?: Record<string, unknown>;
957
+ };
958
+ [key: string]: unknown;
969
959
  };
970
- type AutoConfigOptions = {
971
- /** Whether to run autoconfig without actually applying any filesystem modification (default: false) */
972
- dryRun?: boolean;
960
+ /**
961
+ * Configuration for a container application
962
+ */
963
+ type ContainerApp = {
973
964
  /**
974
- * Whether the build command should be run (default: true)
965
+ * Name of the application
966
+ * @optional Defaults to `worker_name-class_name` if not specified.
967
+ */
968
+ name?: string;
969
+ /**
970
+ * Number of application instances
971
+ * @deprecated
972
+ * @hidden
973
+ */
974
+ instances?: number;
975
+ /**
976
+ * Number of maximum application instances.
977
+ * @optional
978
+ */
979
+ max_instances?: number;
980
+ /**
981
+ * The path to a Dockerfile, or an image URI for the Cloudflare registry.
982
+ */
983
+ image: string;
984
+ /**
985
+ * Build context of the application.
986
+ * @optional - defaults to the directory of `image`.
987
+ */
988
+ image_build_context?: string;
989
+ /**
990
+ * Image variables available to the image at build-time only.
991
+ * For runtime env vars, refer to https://developers.cloudflare.com/containers/examples/env-vars-and-secrets/
992
+ * @optional
993
+ */
994
+ image_vars?: Record<string, string>;
995
+ /**
996
+ * The class name of the Durable Object the container is connected to.
997
+ */
998
+ class_name: string;
999
+ /**
1000
+ * The scheduling policy of the application
1001
+ * @optional
1002
+ * @default "default"
1003
+ */
1004
+ scheduling_policy?: "default" | "moon" | "regional";
1005
+ /**
1006
+ * The instance type to be used for the container.
1007
+ * Select from one of the following named instance types:
1008
+ * - lite: 1/16 vCPU, 256 MiB memory, and 2 GB disk
1009
+ * - basic: 1/4 vCPU, 1 GiB memory, and 4 GB disk
1010
+ * - standard-1: 1/2 vCPU, 4 GiB memory, and 8 GB disk
1011
+ * - standard-2: 1 vCPU, 6 GiB memory, and 12 GB disk
1012
+ * - standard-3: 2 vCPU, 8 GiB memory, and 16 GB disk
1013
+ * - standard-4: 4 vCPU, 12 GiB memory, and 20 GB disk
1014
+ * - dev: 1/16 vCPU, 256 MiB memory, and 2 GB disk (deprecated, use "lite" instead)
1015
+ * - standard: 1 vCPU, 4 GiB memory, and 4 GB disk (deprecated, use "standard-1" instead)
975
1016
  *
976
- * Note: When `dryRun` is `true` the build command is never run.
1017
+ * Customers on an enterprise plan have the additional option to set custom limits.
1018
+ *
1019
+ * @optional
1020
+ * @default "dev"
977
1021
  */
978
- runBuild?: boolean;
1022
+ instance_type?: "dev" | "basic" | "standard" | "lite" | "standard-1" | "standard-2" | "standard-3" | "standard-4" | {
1023
+ /** @defaults to 0.0625 (1/16 vCPU) */
1024
+ vcpu?: number;
1025
+ /** @defaults to 256 MiB */
1026
+ memory_mib?: number;
1027
+ /** @defaults to 2 GB */
1028
+ disk_mb?: number;
1029
+ };
979
1030
  /**
980
- * Whether the confirmation prompts should be skipped (default: false)
1031
+ * @deprecated Use top level `containers` fields instead.
1032
+ * `configuration.image` should be `image`
1033
+ * limits should be set via `instance_type`
1034
+ * @hidden
1035
+ */
1036
+ configuration?: {
1037
+ image?: string;
1038
+ labels?: {
1039
+ name: string;
1040
+ value: string;
1041
+ }[];
1042
+ secrets?: {
1043
+ name: string;
1044
+ type: "env";
1045
+ secret: string;
1046
+ }[];
1047
+ disk?: {
1048
+ size_mb: number;
1049
+ };
1050
+ vcpu?: number;
1051
+ memory_mib?: number;
1052
+ };
1053
+ /**
1054
+ * Scheduling constraints
1055
+ * @hidden
1056
+ */
1057
+ constraints?: {
1058
+ regions?: string[];
1059
+ cities?: string[];
1060
+ tier?: number;
1061
+ };
1062
+ /**
1063
+ * Scheduling affinities
1064
+ * @hidden
1065
+ */
1066
+ affinities?: {
1067
+ colocation?: "datacenter";
1068
+ hardware_generation?: "highest-overall-performance";
1069
+ };
1070
+ /**
1071
+ * @deprecated use the `class_name` field instead.
1072
+ * @hidden
1073
+ */
1074
+ durable_objects?: {
1075
+ namespace_id: string;
1076
+ };
1077
+ /**
1078
+ * Configures what percentage of instances should be updated at each step of a rollout.
1079
+ * You can specify this as a single number, or an array of numbers.
981
1080
  *
982
- * Note: When `dryRun` is `true` the the confirmation prompts are always skipped.
1081
+ * If this is a single number, each step will progress by that percentage.
1082
+ * The options are 5, 10, 20, 25, 50 or 100.
1083
+ *
1084
+ * If this is an array, each step specifies the cumulative rollout progress.
1085
+ * The final step must be 100.
1086
+ *
1087
+ * This can be overridden adhoc by deploying with the `--containers-rollout=immediate` flag,
1088
+ * which will roll out to 100% of instances in one step.
1089
+ *
1090
+ * @optional
1091
+ * @default [10,100]
1092
+ * */
1093
+ rollout_step_percentage?: number | number[];
1094
+ /**
1095
+ * How a rollout should be created. It supports the following modes:
1096
+ * - full_auto: The container application will be rolled out fully automatically.
1097
+ * - none: The container application won't have a roll out or update.
1098
+ * - manual: The container application will be rollout fully by manually actioning progress steps.
1099
+ * @optional
1100
+ * @default "full_auto"
1101
+ * @hidden
983
1102
  */
984
- skipConfirmations?: boolean;
1103
+ rollout_kind?: "full_auto" | "none" | "full_manual";
1104
+ /**
1105
+ * Configures the grace period (in seconds) for active instances before being shutdown during a rollout.
1106
+ * @optional
1107
+ * @default 0
1108
+ */
1109
+ rollout_active_grace_period?: number;
1110
+ /**
1111
+ * Directly passed to the API without wrangler-side validation or transformation.
1112
+ * @hidden
1113
+ */
1114
+ unsafe?: Record<string, unknown>;
1115
+ };
1116
+ /**
1117
+ * Configuration in wrangler for Durable Object Migrations
1118
+ */
1119
+ type DurableObjectMigration = {
1120
+ /** A unique identifier for this migration. */
1121
+ tag: string;
1122
+ /** The new Durable Objects being defined. */
1123
+ new_classes?: string[];
1124
+ /** The new SQLite Durable Objects being defined. */
1125
+ new_sqlite_classes?: string[];
1126
+ /** The Durable Objects being renamed. */
1127
+ renamed_classes?: {
1128
+ from: string;
1129
+ to: string;
1130
+ }[];
1131
+ /** The Durable Objects being removed. */
1132
+ deleted_classes?: string[];
1133
+ };
1134
+ /**
1135
+ * The `EnvironmentInheritable` interface declares all the configuration fields for an environment
1136
+ * that can be inherited (and overridden) from the top-level environment.
1137
+ */
1138
+ interface EnvironmentInheritable {
1139
+ /**
1140
+ * The name of your Worker. Alphanumeric + dashes only.
1141
+ *
1142
+ * @inheritable
1143
+ */
1144
+ name: string | undefined;
1145
+ /**
1146
+ * This is the ID of the account associated with your zone.
1147
+ * You might have more than one account, so make sure to use
1148
+ * the ID of the account associated with the zone/route you
1149
+ * provide, if you provide one. It can also be specified through
1150
+ * the CLOUDFLARE_ACCOUNT_ID environment variable.
1151
+ *
1152
+ * @inheritable
1153
+ */
1154
+ account_id: string | undefined;
1155
+ /**
1156
+ * A date in the form yyyy-mm-dd, which will be used to determine
1157
+ * which version of the Workers runtime is used.
1158
+ *
1159
+ * More details at https://developers.cloudflare.com/workers/configuration/compatibility-dates
1160
+ *
1161
+ * @inheritable
1162
+ */
1163
+ compatibility_date: string | undefined;
1164
+ /**
1165
+ * A list of flags that enable features from upcoming features of
1166
+ * the Workers runtime, usually used together with compatibility_date.
1167
+ *
1168
+ * More details at https://developers.cloudflare.com/workers/configuration/compatibility-flags/
1169
+ *
1170
+ * @default []
1171
+ * @inheritable
1172
+ */
1173
+ compatibility_flags: string[];
1174
+ /**
1175
+ * The entrypoint/path to the JavaScript file that will be executed.
1176
+ *
1177
+ * @inheritable
1178
+ */
1179
+ main: string | undefined;
1180
+ /**
1181
+ * If true then Wrangler will traverse the file tree below `base_dir`;
1182
+ * Any files that match `rules` will be included in the deployed Worker.
1183
+ * Defaults to true if `no_bundle` is true, otherwise false.
1184
+ *
1185
+ * @inheritable
1186
+ */
1187
+ find_additional_modules: boolean | undefined;
1188
+ /**
1189
+ * Determines whether Wrangler will preserve bundled file names.
1190
+ * Defaults to false.
1191
+ * If left unset, files will be named using the pattern ${fileHash}-${basename},
1192
+ * for example, `34de60b44167af5c5a709e62a4e20c4f18c9e3b6-favicon.ico`.
1193
+ *
1194
+ * @inheritable
1195
+ */
1196
+ preserve_file_names: boolean | undefined;
1197
+ /**
1198
+ * The directory in which module rules should be evaluated when including additional files into a Worker deployment.
1199
+ * This defaults to the directory containing the `main` entry point of the Worker if not specified.
1200
+ *
1201
+ * @inheritable
1202
+ */
1203
+ base_dir: string | undefined;
1204
+ /**
1205
+ * Whether we use <name>.<subdomain>.workers.dev to
1206
+ * test and deploy your Worker.
1207
+ *
1208
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workersdev
1209
+ *
1210
+ * @default true
1211
+ * @breaking
1212
+ * @inheritable
1213
+ */
1214
+ workers_dev: boolean | undefined;
1215
+ /**
1216
+ * Whether we use <version>-<name>.<subdomain>.workers.dev to
1217
+ * serve Preview URLs for your Worker.
1218
+ *
1219
+ * @default false
1220
+ * @inheritable
1221
+ */
1222
+ preview_urls: boolean | undefined;
1223
+ /**
1224
+ * A list of routes that your Worker should be published to.
1225
+ * Only one of `routes` or `route` is required.
1226
+ *
1227
+ * Only required when workers_dev is false, and there's no scheduled Worker (see `triggers`)
1228
+ *
1229
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
1230
+ *
1231
+ * @inheritable
1232
+ */
1233
+ routes: Route[] | undefined;
1234
+ /**
1235
+ * A route that your Worker should be published to. Literally
1236
+ * the same as routes, but only one.
1237
+ * Only one of `routes` or `route` is required.
1238
+ *
1239
+ * Only required when workers_dev is false, and there's no scheduled Worker
1240
+ *
1241
+ * @inheritable
1242
+ */
1243
+ route: Route | undefined;
1244
+ /**
1245
+ * Path to a custom tsconfig
1246
+ *
1247
+ * @inheritable
1248
+ */
1249
+ tsconfig: string | undefined;
1250
+ /**
1251
+ * The function to use to replace jsx syntax.
1252
+ *
1253
+ * @default "React.createElement"
1254
+ * @inheritable
1255
+ */
1256
+ jsx_factory: string;
1257
+ /**
1258
+ * The function to use to replace jsx fragment syntax.
1259
+ *
1260
+ * @default "React.Fragment"
1261
+ * @inheritable
1262
+ */
1263
+ jsx_fragment: string;
1264
+ /**
1265
+ * A list of migrations that should be uploaded with your Worker.
1266
+ *
1267
+ * These define changes in your Durable Object declarations.
1268
+ *
1269
+ * More details at https://developers.cloudflare.com/workers/learning/using-durable-objects#configuring-durable-object-classes-with-migrations
1270
+ *
1271
+ * @default []
1272
+ * @inheritable
1273
+ */
1274
+ migrations: DurableObjectMigration[];
1275
+ /**
1276
+ * "Cron" definitions to trigger a Worker's "scheduled" function.
1277
+ *
1278
+ * Lets you call Workers periodically, much like a cron job.
1279
+ *
1280
+ * More details here https://developers.cloudflare.com/workers/platform/cron-triggers
1281
+ *
1282
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
1283
+ *
1284
+ * @default {crons: undefined}
1285
+ * @inheritable
1286
+ */
1287
+ triggers: {
1288
+ crons: string[] | undefined;
1289
+ };
1290
+ /**
1291
+ * Specify limits for runtime behavior.
1292
+ * Only supported for the "standard" Usage Model
1293
+ *
1294
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#limits
1295
+ *
1296
+ * @inheritable
1297
+ */
1298
+ limits: UserLimits | undefined;
1299
+ /**
1300
+ * An ordered list of rules that define which modules to import,
1301
+ * and what type to import them as. You will need to specify rules
1302
+ * to use Text, Data, and CompiledWasm modules, or when you wish to
1303
+ * have a .js file be treated as an ESModule instead of CommonJS.
1304
+ *
1305
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#bundling
1306
+ *
1307
+ * @inheritable
1308
+ */
1309
+ rules: Rule[];
1310
+ /**
1311
+ * Configures a custom build step to be run by Wrangler when building your Worker.
1312
+ *
1313
+ * Refer to the [custom builds documentation](https://developers.cloudflare.com/workers/cli-wrangler/configuration#build)
1314
+ * for more details.
1315
+ *
1316
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#custom-builds
1317
+ *
1318
+ * @default {watch_dir:"./src"}
1319
+ */
1320
+ build: {
1321
+ /** The command used to build your Worker. On Linux and macOS, the command is executed in the `sh` shell and the `cmd` shell for Windows. The `&&` and `||` shell operators may be used. */
1322
+ command?: string;
1323
+ /** The directory in which the command is executed. */
1324
+ cwd?: string;
1325
+ /** The directory to watch for changes while using wrangler dev, defaults to the current working directory */
1326
+ watch_dir?: string | string[];
1327
+ };
1328
+ /**
1329
+ * Skip internal build steps and directly deploy script
1330
+ * @inheritable
1331
+ */
1332
+ no_bundle: boolean | undefined;
1333
+ /**
1334
+ * Minify the script before uploading.
1335
+ * @inheritable
1336
+ */
1337
+ minify: boolean | undefined;
1338
+ /**
1339
+ * Set the `name` property to the original name for functions and classes renamed during minification.
1340
+ *
1341
+ * See https://esbuild.github.io/api/#keep-names
1342
+ *
1343
+ * @default true
1344
+ * @inheritable
1345
+ */
1346
+ keep_names: boolean | undefined;
1347
+ /**
1348
+ * Designates this Worker as an internal-only "first-party" Worker.
1349
+ *
1350
+ * @inheritable
1351
+ */
1352
+ first_party_worker: boolean | undefined;
1353
+ /**
1354
+ * List of bindings that you will send to logfwdr
1355
+ *
1356
+ * @default {bindings:[]}
1357
+ * @inheritable
1358
+ */
1359
+ logfwdr: {
1360
+ bindings: {
1361
+ /** The binding name used to refer to logfwdr */
1362
+ name: string;
1363
+ /** The destination for this logged message */
1364
+ destination: string;
1365
+ }[];
1366
+ };
1367
+ /**
1368
+ * Send Trace Events from this Worker to Workers Logpush.
1369
+ *
1370
+ * This will not configure a corresponding Logpush job automatically.
1371
+ *
1372
+ * For more information about Workers Logpush, see:
1373
+ * https://blog.cloudflare.com/logpush-for-workers/
1374
+ *
1375
+ * @inheritable
1376
+ */
1377
+ logpush: boolean | undefined;
1378
+ /**
1379
+ * Include source maps when uploading this worker.
1380
+ *
1381
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#source-maps
1382
+ *
1383
+ * @inheritable
1384
+ */
1385
+ upload_source_maps: boolean | undefined;
1386
+ /**
1387
+ * Specify how the Worker should be located to minimize round-trip time.
1388
+ *
1389
+ * More details: https://developers.cloudflare.com/workers/platform/smart-placement/
1390
+ *
1391
+ * @inheritable
1392
+ */
1393
+ placement: {
1394
+ mode: "off" | "smart";
1395
+ hint?: string;
1396
+ } | {
1397
+ mode?: "targeted";
1398
+ region: string;
1399
+ } | {
1400
+ mode?: "targeted";
1401
+ host: string;
1402
+ } | {
1403
+ mode?: "targeted";
1404
+ hostname: string;
1405
+ } | undefined;
1406
+ /**
1407
+ * Specify the directory of static assets to deploy/serve
1408
+ *
1409
+ * More details at https://developers.cloudflare.com/workers/frameworks/
1410
+ *
1411
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
1412
+ *
1413
+ * @inheritable
1414
+ */
1415
+ assets: Assets | undefined;
1416
+ /**
1417
+ * Specify the observability behavior of the Worker.
1418
+ *
1419
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#observability
1420
+ *
1421
+ * @inheritable
1422
+ */
1423
+ observability: Observability | undefined;
1424
+ /**
1425
+ * Specify the compliance region mode of the Worker.
1426
+ *
1427
+ * Although if the user does not specify a compliance region, the default is `public`,
1428
+ * it can be set to `undefined` in configuration to delegate to the CLOUDFLARE_COMPLIANCE_REGION environment variable.
1429
+ */
1430
+ compliance_region: "public" | "fedramp_high" | undefined;
1431
+ /**
1432
+ * Configuration for Python modules.
1433
+ *
1434
+ * @inheritable
1435
+ */
1436
+ python_modules: {
1437
+ /**
1438
+ * A list of glob patterns to exclude files from the python_modules directory when bundling.
1439
+ *
1440
+ * Patterns are relative to the python_modules directory and use glob syntax.
1441
+ *
1442
+ * @default ["**\*.pyc"]
1443
+ */
1444
+ exclude: string[];
1445
+ };
1446
+ }
1447
+ type DurableObjectBindings = {
1448
+ /** The name of the binding used to refer to the Durable Object */
1449
+ name: string;
1450
+ /** The exported class name of the Durable Object */
1451
+ class_name: string;
1452
+ /** The script where the Durable Object is defined (if it's external to this Worker) */
1453
+ script_name?: string;
1454
+ /** The service environment of the script_name to bind to */
1455
+ environment?: string;
1456
+ }[];
1457
+ type WorkflowBinding = {
1458
+ /** The name of the binding used to refer to the Workflow */
1459
+ binding: string;
1460
+ /** The name of the Workflow */
1461
+ name: string;
1462
+ /** The exported class name of the Workflow */
1463
+ class_name: string;
1464
+ /** The script where the Workflow is defined (if it's external to this Worker) */
1465
+ script_name?: string;
1466
+ /** Whether the Workflow should be remote or not in local development */
1467
+ remote?: boolean;
1468
+ };
1469
+ /**
1470
+ * The `EnvironmentNonInheritable` interface declares all the configuration fields for an environment
1471
+ * that cannot be inherited from the top-level environment, and must be defined specifically.
1472
+ *
1473
+ * If any of these fields are defined at the top-level then they should also be specifically defined
1474
+ * for each named environment.
1475
+ */
1476
+ interface EnvironmentNonInheritable {
1477
+ /**
1478
+ * A map of values to substitute when deploying your Worker.
1479
+ *
1480
+ * NOTE: This field is not automatically inherited from the top level environment,
1481
+ * and so must be specified in every named environment.
1482
+ *
1483
+ * @default {}
1484
+ * @nonInheritable
1485
+ */
1486
+ define: Record<string, string>;
1487
+ /**
1488
+ * A map of environment variables to set when deploying your Worker.
1489
+ *
1490
+ * NOTE: This field is not automatically inherited from the top level environment,
1491
+ * and so must be specified in every named environment.
1492
+ *
1493
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
1494
+ *
1495
+ * @default {}
1496
+ * @nonInheritable
1497
+ */
1498
+ vars: Record<string, string | Json>;
1499
+ /**
1500
+ * A list of durable objects that your Worker should be bound to.
1501
+ *
1502
+ * For more information about Durable Objects, see the documentation at
1503
+ * https://developers.cloudflare.com/workers/learning/using-durable-objects
1504
+ *
1505
+ * NOTE: This field is not automatically inherited from the top level environment,
1506
+ * and so must be specified in every named environment.
1507
+ *
1508
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
1509
+ *
1510
+ * @default {bindings:[]}
1511
+ * @nonInheritable
1512
+ */
1513
+ durable_objects: {
1514
+ bindings: DurableObjectBindings;
1515
+ };
1516
+ /**
1517
+ * A list of workflows that your Worker should be bound to.
1518
+ *
1519
+ * NOTE: This field is not automatically inherited from the top level environment,
1520
+ * and so must be specified in every named environment.
1521
+ *
1522
+ * @default []
1523
+ * @nonInheritable
1524
+ */
1525
+ workflows: WorkflowBinding[];
1526
+ /**
1527
+ * Cloudchamber configuration
1528
+ *
1529
+ * NOTE: This field is not automatically inherited from the top level environment,
1530
+ * and so must be specified in every named environment.
1531
+ *
1532
+ * @default {}
1533
+ * @nonInheritable
1534
+ */
1535
+ cloudchamber: CloudchamberConfig;
1536
+ /**
1537
+ * Container related configuration
1538
+ *
1539
+ * NOTE: This field is not automatically inherited from the top level environment,
1540
+ * and so must be specified in every named environment.
1541
+ *
1542
+ * @default []
1543
+ * @nonInheritable
1544
+ */
1545
+ containers?: ContainerApp[];
1546
+ /**
1547
+ * These specify any Workers KV Namespaces you want to
1548
+ * access from inside your Worker.
1549
+ *
1550
+ * To learn more about KV Namespaces,
1551
+ * see the documentation at https://developers.cloudflare.com/workers/learning/how-kv-works
1552
+ *
1553
+ * NOTE: This field is not automatically inherited from the top level environment,
1554
+ * and so must be specified in every named environment.
1555
+ *
1556
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
1557
+ *
1558
+ * @default []
1559
+ * @nonInheritable
1560
+ */
1561
+ kv_namespaces: {
1562
+ /** The binding name used to refer to the KV Namespace */
1563
+ binding: string;
1564
+ /** The ID of the KV namespace */
1565
+ id?: string;
1566
+ /** The ID of the KV namespace used during `wrangler dev` */
1567
+ preview_id?: string;
1568
+ /** Whether the KV namespace should be remote or not in local development */
1569
+ remote?: boolean;
1570
+ }[];
1571
+ /**
1572
+ * These specify bindings to send email from inside your Worker.
1573
+ *
1574
+ * NOTE: This field is not automatically inherited from the top level environment,
1575
+ * and so must be specified in every named environment.
1576
+ *
1577
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#email-bindings
1578
+ *
1579
+ * @default []
1580
+ * @nonInheritable
1581
+ */
1582
+ send_email: {
1583
+ /** The binding name used to refer to the this binding */
1584
+ name: string;
1585
+ /** If this binding should be restricted to a specific verified address */
1586
+ destination_address?: string;
1587
+ /** If this binding should be restricted to a set of verified addresses */
1588
+ allowed_destination_addresses?: string[];
1589
+ /** If this binding should be restricted to a set of sender addresses */
1590
+ allowed_sender_addresses?: string[];
1591
+ /** Whether the binding should be remote or not in local development */
1592
+ remote?: boolean;
1593
+ }[];
1594
+ /**
1595
+ * Specifies Queues that are bound to this Worker environment.
1596
+ *
1597
+ * NOTE: This field is not automatically inherited from the top level environment,
1598
+ * and so must be specified in every named environment.
1599
+ *
1600
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
1601
+ *
1602
+ * @default {consumers:[],producers:[]}
1603
+ * @nonInheritable
1604
+ */
1605
+ queues: {
1606
+ /** Producer bindings */
1607
+ producers?: {
1608
+ /** The binding name used to refer to the Queue in the Worker. */
1609
+ binding: string;
1610
+ /** The name of this Queue. */
1611
+ queue: string;
1612
+ /** The number of seconds to wait before delivering a message */
1613
+ delivery_delay?: number;
1614
+ /** Whether the Queue producer should be remote or not in local development */
1615
+ remote?: boolean;
1616
+ }[];
1617
+ /** Consumer configuration */
1618
+ consumers?: {
1619
+ /** The name of the queue from which this consumer should consume. */
1620
+ queue: string;
1621
+ /** The consumer type, e.g., worker, http-pull, r2-bucket, etc. Default is worker. */
1622
+ type?: string;
1623
+ /** The maximum number of messages per batch */
1624
+ max_batch_size?: number;
1625
+ /** The maximum number of seconds to wait to fill a batch with messages. */
1626
+ max_batch_timeout?: number;
1627
+ /** The maximum number of retries for each message. */
1628
+ max_retries?: number;
1629
+ /** The queue to send messages that failed to be consumed. */
1630
+ dead_letter_queue?: string;
1631
+ /** The maximum number of concurrent consumer Worker invocations. Leaving this unset will allow your consumer to scale to the maximum concurrency needed to keep up with the message backlog. */
1632
+ max_concurrency?: number | null;
1633
+ /** The number of milliseconds to wait for pulled messages to become visible again */
1634
+ visibility_timeout_ms?: number;
1635
+ /** The number of seconds to wait before retrying a message */
1636
+ retry_delay?: number;
1637
+ }[];
1638
+ };
1639
+ /**
1640
+ * Specifies R2 buckets that are bound to this Worker environment.
1641
+ *
1642
+ * NOTE: This field is not automatically inherited from the top level environment,
1643
+ * and so must be specified in every named environment.
1644
+ *
1645
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
1646
+ *
1647
+ * @default []
1648
+ * @nonInheritable
1649
+ */
1650
+ r2_buckets: {
1651
+ /** The binding name used to refer to the R2 bucket in the Worker. */
1652
+ binding: string;
1653
+ /** The name of this R2 bucket at the edge. */
1654
+ bucket_name?: string;
1655
+ /** The preview name of this R2 bucket at the edge. */
1656
+ preview_bucket_name?: string;
1657
+ /** The jurisdiction that the bucket exists in. Default if not present. */
1658
+ jurisdiction?: string;
1659
+ /** Whether the R2 bucket should be remote or not in local development */
1660
+ remote?: boolean;
1661
+ }[];
1662
+ /**
1663
+ * Specifies D1 databases that are bound to this Worker environment.
1664
+ *
1665
+ * NOTE: This field is not automatically inherited from the top level environment,
1666
+ * and so must be specified in every named environment.
1667
+ *
1668
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
1669
+ *
1670
+ * @default []
1671
+ * @nonInheritable
1672
+ */
1673
+ d1_databases: {
1674
+ /** The binding name used to refer to the D1 database in the Worker. */
1675
+ binding: string;
1676
+ /** The name of this D1 database. */
1677
+ database_name?: string;
1678
+ /** The UUID of this D1 database (not required). */
1679
+ database_id?: string;
1680
+ /** The UUID of this D1 database for Wrangler Dev (if specified). */
1681
+ preview_database_id?: string;
1682
+ /** The name of the migrations table for this D1 database (defaults to 'd1_migrations'). */
1683
+ migrations_table?: string;
1684
+ /** The path to the directory of migrations for this D1 database (defaults to './migrations'). */
1685
+ migrations_dir?: string;
1686
+ /** Internal use only. */
1687
+ database_internal_env?: string;
1688
+ /** Whether the D1 database should be remote or not in local development */
1689
+ remote?: boolean;
1690
+ }[];
1691
+ /**
1692
+ * Specifies Vectorize indexes that are bound to this Worker environment.
1693
+ *
1694
+ * NOTE: This field is not automatically inherited from the top level environment,
1695
+ * and so must be specified in every named environment.
1696
+ *
1697
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
1698
+ *
1699
+ * @default []
1700
+ * @nonInheritable
1701
+ */
1702
+ vectorize: {
1703
+ /** The binding name used to refer to the Vectorize index in the Worker. */
1704
+ binding: string;
1705
+ /** The name of the index. */
1706
+ index_name: string;
1707
+ /** Whether the Vectorize index should be remote or not in local development */
1708
+ remote?: boolean;
1709
+ }[];
1710
+ /**
1711
+ * Specifies Hyperdrive configs that are bound to this Worker environment.
1712
+ *
1713
+ * NOTE: This field is not automatically inherited from the top level environment,
1714
+ * and so must be specified in every named environment.
1715
+ *
1716
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
1717
+ *
1718
+ * @default []
1719
+ * @nonInheritable
1720
+ */
1721
+ hyperdrive: {
1722
+ /** The binding name used to refer to the project in the Worker. */
1723
+ binding: string;
1724
+ /** The id of the database. */
1725
+ id: string;
1726
+ /** The local database connection string for `wrangler dev` */
1727
+ localConnectionString?: string;
1728
+ }[];
1729
+ /**
1730
+ * Specifies service bindings (Worker-to-Worker) that are bound to this Worker environment.
1731
+ *
1732
+ * NOTE: This field is not automatically inherited from the top level environment,
1733
+ * and so must be specified in every named environment.
1734
+ *
1735
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
1736
+ *
1737
+ * @default []
1738
+ * @nonInheritable
1739
+ */
1740
+ services: {
1741
+ /** The binding name used to refer to the bound service. */
1742
+ binding: string;
1743
+ /**
1744
+ * The name of the service.
1745
+ * To bind to a worker in a specific environment,
1746
+ * you should use the format `<worker_name>-<environment_name>`.
1747
+ */
1748
+ service: string;
1749
+ /**
1750
+ * @hidden
1751
+ * @deprecated you should use `service: <worker_name>-<environment_name>` instead.
1752
+ * This refers to the deprecated concept of 'service environments'.
1753
+ * The environment of the service (e.g. production, staging, etc).
1754
+ */
1755
+ environment?: string;
1756
+ /** Optionally, the entrypoint (named export) of the service to bind to. */
1757
+ entrypoint?: string;
1758
+ /** Optional properties that will be made available to the service via ctx.props. */
1759
+ props?: Record<string, unknown>;
1760
+ /** Whether the service binding should be remote or not in local development */
1761
+ remote?: boolean;
1762
+ }[] | undefined;
1763
+ /**
1764
+ * Specifies analytics engine datasets that are bound to this Worker environment.
1765
+ *
1766
+ * NOTE: This field is not automatically inherited from the top level environment,
1767
+ * and so must be specified in every named environment.
1768
+ *
1769
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets
1770
+ *
1771
+ * @default []
1772
+ * @nonInheritable
1773
+ */
1774
+ analytics_engine_datasets: {
1775
+ /** The binding name used to refer to the dataset in the Worker. */
1776
+ binding: string;
1777
+ /** The name of this dataset to write to. */
1778
+ dataset?: string;
1779
+ }[];
1780
+ /**
1781
+ * A browser that will be usable from the Worker.
1782
+ *
1783
+ * NOTE: This field is not automatically inherited from the top level environment,
1784
+ * and so must be specified in every named environment.
1785
+ *
1786
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering
1787
+ *
1788
+ * @default {}
1789
+ * @nonInheritable
1790
+ */
1791
+ browser: {
1792
+ binding: string;
1793
+ /** Whether the Browser binding should be remote or not in local development */
1794
+ remote?: boolean;
1795
+ } | undefined;
1796
+ /**
1797
+ * Binding to the AI project.
1798
+ *
1799
+ * NOTE: This field is not automatically inherited from the top level environment,
1800
+ * and so must be specified in every named environment.
1801
+ *
1802
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
1803
+ *
1804
+ * @default {}
1805
+ * @nonInheritable
1806
+ */
1807
+ ai: {
1808
+ binding: string;
1809
+ staging?: boolean;
1810
+ /** Whether the AI binding should be remote or not in local development */
1811
+ remote?: boolean;
1812
+ } | undefined;
1813
+ /**
1814
+ * Binding to Cloudflare Images
1815
+ *
1816
+ * NOTE: This field is not automatically inherited from the top level environment,
1817
+ * and so must be specified in every named environment.
1818
+ *
1819
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#images
1820
+ *
1821
+ * @default {}
1822
+ * @nonInheritable
1823
+ */
1824
+ images: {
1825
+ binding: string;
1826
+ /** Whether the Images binding should be remote or not in local development */
1827
+ remote?: boolean;
1828
+ } | undefined;
1829
+ /**
1830
+ * Binding to Cloudflare Media Transformations
1831
+ *
1832
+ * NOTE: This field is not automatically inherited from the top level environment,
1833
+ * and so must be specified in every named environment.
1834
+ *
1835
+ * @default {}
1836
+ * @nonInheritable
1837
+ */
1838
+ media: {
1839
+ binding: string;
1840
+ /** Whether the Media binding should be remote or not */
1841
+ remote?: boolean;
1842
+ } | undefined;
1843
+ /**
1844
+ * Binding to the Worker Version's metadata
1845
+ */
1846
+ version_metadata: {
1847
+ binding: string;
1848
+ } | undefined;
1849
+ /**
1850
+ * "Unsafe" tables for features that aren't directly supported by wrangler.
1851
+ *
1852
+ * NOTE: This field is not automatically inherited from the top level environment,
1853
+ * and so must be specified in every named environment.
1854
+ *
1855
+ * @default {}
1856
+ * @nonInheritable
1857
+ */
1858
+ unsafe: {
1859
+ /**
1860
+ * A set of bindings that should be put into a Worker's upload metadata without changes. These
1861
+ * can be used to implement bindings for features that haven't released and aren't supported
1862
+ * directly by wrangler or miniflare.
1863
+ */
1864
+ bindings?: UnsafeBinding[];
1865
+ /**
1866
+ * Arbitrary key/value pairs that will be included in the uploaded metadata. Values specified
1867
+ * here will always be applied to metadata last, so can add new or override existing fields.
1868
+ */
1869
+ metadata?: {
1870
+ [key: string]: unknown;
1871
+ };
1872
+ /**
1873
+ * Used for internal capnp uploads for the Workers runtime
1874
+ */
1875
+ capnp?: {
1876
+ base_path: string;
1877
+ source_schemas: string[];
1878
+ compiled_schema?: never;
1879
+ } | {
1880
+ base_path?: never;
1881
+ source_schemas?: never;
1882
+ compiled_schema: string;
1883
+ };
1884
+ };
1885
+ /**
1886
+ * Specifies a list of mTLS certificates that are bound to this Worker environment.
1887
+ *
1888
+ * NOTE: This field is not automatically inherited from the top level environment,
1889
+ * and so must be specified in every named environment.
1890
+ *
1891
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates
1892
+ *
1893
+ * @default []
1894
+ * @nonInheritable
1895
+ */
1896
+ mtls_certificates: {
1897
+ /** The binding name used to refer to the certificate in the Worker */
1898
+ binding: string;
1899
+ /** The uuid of the uploaded mTLS certificate */
1900
+ certificate_id: string;
1901
+ /** Whether the mtls fetcher should be remote or not in local development */
1902
+ remote?: boolean;
1903
+ }[];
1904
+ /**
1905
+ * Specifies a list of Tail Workers that are bound to this Worker environment
1906
+ *
1907
+ * NOTE: This field is not automatically inherited from the top level environment,
1908
+ * and so must be specified in every named environment.
1909
+ *
1910
+ * @default []
1911
+ * @nonInheritable
1912
+ */
1913
+ tail_consumers?: TailConsumer[];
1914
+ /**
1915
+ * Specifies a list of Streaming Tail Workers that are bound to this Worker environment
1916
+ *
1917
+ * NOTE: This field is not automatically inherited from the top level environment,
1918
+ * and so must be specified in every named environment.
1919
+ *
1920
+ * @default []
1921
+ * @nonInheritable
1922
+ */
1923
+ streaming_tail_consumers?: StreamingTailConsumer[];
1924
+ /**
1925
+ * Specifies namespace bindings that are bound to this Worker environment.
1926
+ *
1927
+ * NOTE: This field is not automatically inherited from the top level environment,
1928
+ * and so must be specified in every named environment.
1929
+ *
1930
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms
1931
+ *
1932
+ * @default []
1933
+ * @nonInheritable
1934
+ */
1935
+ dispatch_namespaces: {
1936
+ /** The binding name used to refer to the bound service. */
1937
+ binding: string;
1938
+ /** The namespace to bind to. */
1939
+ namespace: string;
1940
+ /** Details about the outbound Worker which will handle outbound requests from your namespace */
1941
+ outbound?: DispatchNamespaceOutbound;
1942
+ /** Whether the Dispatch Namespace should be remote or not in local development */
1943
+ remote?: boolean;
1944
+ }[];
1945
+ /**
1946
+ * Specifies list of Pipelines bound to this Worker environment
1947
+ *
1948
+ * NOTE: This field is not automatically inherited from the top level environment,
1949
+ * and so must be specified in every named environment.
1950
+ *
1951
+ * @default []
1952
+ * @nonInheritable
1953
+ */
1954
+ pipelines: {
1955
+ /** The binding name used to refer to the bound service. */
1956
+ binding: string;
1957
+ /** Name of the Pipeline to bind */
1958
+ pipeline: string;
1959
+ /** Whether the pipeline should be remote or not in local development */
1960
+ remote?: boolean;
1961
+ }[];
1962
+ /**
1963
+ * Specifies Secret Store bindings that are bound to this Worker environment.
1964
+ *
1965
+ * NOTE: This field is not automatically inherited from the top level environment,
1966
+ * and so must be specified in every named environment.
1967
+ *
1968
+ * @default []
1969
+ * @nonInheritable
1970
+ */
1971
+ secrets_store_secrets: {
1972
+ /** The binding name used to refer to the bound service. */
1973
+ binding: string;
1974
+ /** Id of the secret store */
1975
+ store_id: string;
1976
+ /** Name of the secret */
1977
+ secret_name: string;
1978
+ }[];
1979
+ /**
1980
+ * **DO NOT USE**. Hello World Binding Config to serve as an explanatory example.
1981
+ *
1982
+ * NOTE: This field is not automatically inherited from the top level environment,
1983
+ * and so must be specified in every named environment.
1984
+ *
1985
+ * @default []
1986
+ * @nonInheritable
1987
+ */
1988
+ unsafe_hello_world: {
1989
+ /** The binding name used to refer to the bound service. */
1990
+ binding: string;
1991
+ /** Whether the timer is enabled */
1992
+ enable_timer?: boolean;
1993
+ }[];
1994
+ /**
1995
+ * Specifies rate limit bindings that are bound to this Worker environment.
1996
+ *
1997
+ * NOTE: This field is not automatically inherited from the top level environment,
1998
+ * and so must be specified in every named environment.
1999
+ *
2000
+ * @default []
2001
+ * @nonInheritable
2002
+ */
2003
+ ratelimits: {
2004
+ /** The binding name used to refer to the rate limiter in the Worker. */
2005
+ name: string;
2006
+ /** The namespace ID for this rate limiter. */
2007
+ namespace_id: string;
2008
+ /** Simple rate limiting configuration. */
2009
+ simple: {
2010
+ /** The maximum number of requests allowed in the time period. */
2011
+ limit: number;
2012
+ /** The time period in seconds (10 for ten seconds, 60 for one minute). */
2013
+ period: 10 | 60;
2014
+ };
2015
+ }[];
2016
+ /**
2017
+ * Specifies Worker Loader bindings that are bound to this Worker environment.
2018
+ *
2019
+ * NOTE: This field is not automatically inherited from the top level environment,
2020
+ * and so must be specified in every named environment.
2021
+ *
2022
+ * @default []
2023
+ * @nonInheritable
2024
+ */
2025
+ worker_loaders: {
2026
+ /** The binding name used to refer to the Worker Loader in the Worker. */
2027
+ binding: string;
2028
+ }[];
2029
+ /**
2030
+ * Specifies VPC services that are bound to this Worker environment.
2031
+ *
2032
+ * NOTE: This field is not automatically inherited from the top level environment,
2033
+ * and so must be specified in every named environment.
2034
+ *
2035
+ * @default []
2036
+ * @nonInheritable
2037
+ */
2038
+ vpc_services: {
2039
+ /** The binding name used to refer to the VPC service in the Worker. */
2040
+ binding: string;
2041
+ /** The service ID of the VPC connectivity service. */
2042
+ service_id: string;
2043
+ /** Whether the VPC service is remote or not */
2044
+ remote?: boolean;
2045
+ }[];
2046
+ }
2047
+ /**
2048
+ * The raw environment configuration that we read from the config file.
2049
+ *
2050
+ * All the properties are optional, and will be replaced with defaults in the configuration that
2051
+ * is used in the rest of the codebase.
2052
+ */
2053
+ type RawEnvironment = Partial<Environment>;
2054
+ /**
2055
+ * A bundling resolver rule, defining the modules type for paths that match the specified globs.
2056
+ */
2057
+ type Rule = {
2058
+ type: ConfigModuleRuleType;
2059
+ globs: string[];
2060
+ fallthrough?: boolean;
2061
+ };
2062
+ /**
2063
+ * The possible types for a `Rule`.
2064
+ */
2065
+ type ConfigModuleRuleType = "ESModule" | "CommonJS" | "CompiledWasm" | "Text" | "Data" | "PythonModule" | "PythonRequirement";
2066
+ type TailConsumer = {
2067
+ /** The name of the service tail events will be forwarded to. */
2068
+ service: string;
2069
+ /** (Optional) The environment of the service. */
2070
+ environment?: string;
2071
+ };
2072
+ type StreamingTailConsumer = {
2073
+ /** The name of the service streaming tail events will be forwarded to. */
2074
+ service: string;
2075
+ };
2076
+ interface DispatchNamespaceOutbound {
2077
+ /** Name of the service handling the outbound requests */
2078
+ service: string;
2079
+ /** (Optional) Name of the environment handling the outbound requests. */
2080
+ environment?: string;
2081
+ /** (Optional) List of parameter names, for sending context from your dispatch Worker to the outbound handler */
2082
+ parameters?: string[];
2083
+ }
2084
+ interface UserLimits {
2085
+ /** Maximum allowed CPU time for a Worker's invocation in milliseconds */
2086
+ cpu_ms: number;
2087
+ }
2088
+ type Assets = {
2089
+ /** Absolute path to assets directory */
2090
+ directory?: string;
2091
+ /** Name of `env` binding property in the User Worker. */
2092
+ binding?: string;
2093
+ /** How to handle HTML requests. */
2094
+ html_handling?: "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash" | "none";
2095
+ /** How to handle requests that do not match an asset. */
2096
+ not_found_handling?: "single-page-application" | "404-page" | "none";
2097
+ /**
2098
+ * Matches will be routed to the User Worker, and matches to negative rules will go to the Asset Worker.
2099
+ *
2100
+ * Can also be `true`, indicating that every request should be routed to the User Worker.
2101
+ */
2102
+ run_worker_first?: string[] | boolean;
2103
+ };
2104
+ interface Observability {
2105
+ /** If observability is enabled for this Worker */
2106
+ enabled?: boolean;
2107
+ /** The sampling rate */
2108
+ head_sampling_rate?: number;
2109
+ logs?: {
2110
+ enabled?: boolean;
2111
+ /** The sampling rate */
2112
+ head_sampling_rate?: number;
2113
+ /** Set to false to disable invocation logs */
2114
+ invocation_logs?: boolean;
2115
+ /**
2116
+ * If logs should be persisted to the Cloudflare observability platform where they can be queried in the dashboard.
2117
+ *
2118
+ * @default true
2119
+ */
2120
+ persist?: boolean;
2121
+ /**
2122
+ * What destinations logs emitted from the Worker should be sent to.
2123
+ *
2124
+ * @default []
2125
+ */
2126
+ destinations?: string[];
2127
+ };
2128
+ traces?: {
2129
+ enabled?: boolean;
2130
+ /** The sampling rate */
2131
+ head_sampling_rate?: number;
2132
+ /**
2133
+ * If traces should be persisted to the Cloudflare observability platform where they can be queried in the dashboard.
2134
+ *
2135
+ * @default true
2136
+ */
2137
+ persist?: boolean;
2138
+ /**
2139
+ * What destinations traces emitted from the Worker should be sent to.
2140
+ *
2141
+ * @default []
2142
+ */
2143
+ destinations?: string[];
2144
+ };
2145
+ }
2146
+ type DockerConfiguration = {
2147
+ /** Socket used by miniflare to communicate with Docker */
2148
+ socketPath: string;
2149
+ };
2150
+ type ContainerEngine = {
2151
+ localDocker: DockerConfiguration;
2152
+ } | string;
2153
+
2154
+ /**
2155
+ * This is the static type definition for the configuration object.
2156
+ *
2157
+ * It reflects a normalized and validated version of the configuration that you can write in a Wrangler configuration file,
2158
+ * and optionally augment with arguments passed directly to wrangler.
2159
+ *
2160
+ * For more information about the configuration object, see the
2161
+ * documentation at https://developers.cloudflare.com/workers/cli-wrangler/configuration
2162
+ *
2163
+ * Notes:
2164
+ *
2165
+ * - Fields that are only specified in `ConfigFields` and not `Environment` can only appear
2166
+ * in the top level config and should not appear in any environments.
2167
+ * - Fields that are specified in `PagesConfigFields` are only relevant for Pages projects
2168
+ * - All top level fields in config and environments are optional in the Wrangler configuration file.
2169
+ *
2170
+ * Legend for the annotations:
2171
+ *
2172
+ * - `@breaking`: the deprecation/optionality is a breaking change from Wrangler v1.
2173
+ * - `@todo`: there's more work to be done (with details attached).
2174
+ */
2175
+ type Config = ComputedFields & ConfigFields<DevConfig> & PagesConfigFields & Environment;
2176
+ type RawConfig = Partial<ConfigFields<RawDevConfig>> & PagesConfigFields & RawEnvironment & EnvironmentMap & {
2177
+ $schema?: string;
2178
+ };
2179
+ interface ComputedFields {
2180
+ /** The path to the Wrangler configuration file (if any, and possibly redirected from the user Wrangler configuration) used to create this configuration. */
2181
+ configPath: string | undefined;
2182
+ /** The path to the user's Wrangler configuration file (if any), which may have been redirected to another file that used to create this configuration. */
2183
+ userConfigPath: string | undefined;
2184
+ /**
2185
+ * The original top level name for the Worker in the raw configuration.
2186
+ *
2187
+ * When a raw configuration has been flattened to a single environment the worker name may have been replaced or transformed.
2188
+ * It can be useful to know what the top-level name was before the flattening.
2189
+ */
2190
+ topLevelName: string | undefined;
2191
+ /** A list of environment names declared in the raw configuration. */
2192
+ definedEnvironments: string[] | undefined;
2193
+ /** The name of the environment being targeted. */
2194
+ targetEnvironment: string | undefined;
2195
+ }
2196
+ interface ConfigFields<Dev extends RawDevConfig> {
2197
+ /**
2198
+ * A boolean to enable "legacy" style wrangler environments (from Wrangler v1).
2199
+ * These have been superseded by Services, but there may be projects that won't
2200
+ * (or can't) use them. If you're using a legacy environment, you can set this
2201
+ * to `true` to enable it.
2202
+ */
2203
+ legacy_env: boolean;
2204
+ /**
2205
+ * Whether Wrangler should send usage metrics to Cloudflare for this project.
2206
+ *
2207
+ * When defined this will override any user settings.
2208
+ * Otherwise, Wrangler will use the user's preference.
2209
+ */
2210
+ send_metrics: boolean | undefined;
2211
+ /**
2212
+ * Options to configure the development server that your worker will use.
2213
+ *
2214
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#local-development-settings
2215
+ */
2216
+ dev: Dev;
2217
+ /**
2218
+ * The definition of a Worker Site, a feature that lets you upload
2219
+ * static assets with your Worker.
2220
+ *
2221
+ * More details at https://developers.cloudflare.com/workers/platform/sites
2222
+ *
2223
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-sites
2224
+ */
2225
+ site: {
2226
+ /**
2227
+ * The directory containing your static assets.
2228
+ *
2229
+ * It must be a path relative to your Wrangler configuration file.
2230
+ * Example: bucket = "./public"
2231
+ *
2232
+ * If there is a `site` field then it must contain this `bucket` field.
2233
+ */
2234
+ bucket: string;
2235
+ /**
2236
+ * The location of your Worker script.
2237
+ *
2238
+ * @deprecated DO NOT use this (it's a holdover from Wrangler v1.x). Either use the top level `main` field, or pass the path to your entry file as a command line argument.
2239
+ * @breaking
2240
+ */
2241
+ "entry-point"?: string;
2242
+ /**
2243
+ * An exclusive list of .gitignore-style patterns that match file
2244
+ * or directory names from your bucket location. Only matched
2245
+ * items will be uploaded. Example: include = ["upload_dir"]
2246
+ *
2247
+ * @optional
2248
+ * @default []
2249
+ */
2250
+ include?: string[];
2251
+ /**
2252
+ * A list of .gitignore-style patterns that match files or
2253
+ * directories in your bucket that should be excluded from
2254
+ * uploads. Example: exclude = ["ignore_dir"]
2255
+ *
2256
+ * @optional
2257
+ * @default []
2258
+ */
2259
+ exclude?: string[];
2260
+ } | undefined;
2261
+ /**
2262
+ * A list of wasm modules that your worker should be bound to. This is
2263
+ * the "legacy" way of binding to a wasm module. ES module workers should
2264
+ * do proper module imports.
2265
+ */
2266
+ wasm_modules: {
2267
+ [key: string]: string;
2268
+ } | undefined;
2269
+ /**
2270
+ * A list of text files that your worker should be bound to. This is
2271
+ * the "legacy" way of binding to a text file. ES module workers should
2272
+ * do proper module imports.
2273
+ */
2274
+ text_blobs: {
2275
+ [key: string]: string;
2276
+ } | undefined;
2277
+ /**
2278
+ * A list of data files that your worker should be bound to. This is
2279
+ * the "legacy" way of binding to a data file. ES module workers should
2280
+ * do proper module imports.
2281
+ */
2282
+ data_blobs: {
2283
+ [key: string]: string;
2284
+ } | undefined;
2285
+ /**
2286
+ * A map of module aliases. Lets you swap out a module for any others.
2287
+ * Corresponds with esbuild's `alias` config
2288
+ *
2289
+ * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#module-aliasing
2290
+ */
2291
+ alias: {
2292
+ [key: string]: string;
2293
+ } | undefined;
2294
+ /**
2295
+ * By default, the Wrangler configuration file is the source of truth for your environment configuration, like a terraform file.
2296
+ *
2297
+ * If you change your vars in the dashboard, wrangler *will* override/delete them on its next deploy.
2298
+ *
2299
+ * If you want to keep your dashboard vars when wrangler deploys, set this field to true.
2300
+ *
2301
+ * @default false
2302
+ * @nonInheritable
2303
+ */
2304
+ keep_vars?: boolean;
2305
+ }
2306
+ interface PagesConfigFields {
2307
+ /**
2308
+ * The directory of static assets to serve.
2309
+ *
2310
+ * The presence of this field in a Wrangler configuration file indicates a Pages project,
2311
+ * and will prompt the handling of the configuration file according to the
2312
+ * Pages-specific validation rules.
2313
+ */
2314
+ pages_build_output_dir?: string;
2315
+ }
2316
+ interface DevConfig {
2317
+ /**
2318
+ * IP address for the local dev server to listen on,
2319
+ *
2320
+ * @default localhost
2321
+ */
2322
+ ip: string;
2323
+ /**
2324
+ * Port for the local dev server to listen on
2325
+ *
2326
+ * @default 8787
2327
+ */
2328
+ port: number | undefined;
2329
+ /**
2330
+ * Port for the local dev server's inspector to listen on
2331
+ *
2332
+ * @default 9229
2333
+ */
2334
+ inspector_port: number | undefined;
2335
+ /**
2336
+ * Protocol that local wrangler dev server listens to requests on.
2337
+ *
2338
+ * @default http
2339
+ */
2340
+ local_protocol: "http" | "https";
2341
+ /**
2342
+ * Protocol that wrangler dev forwards requests on
2343
+ *
2344
+ * Setting this to `http` is not currently implemented for remote mode.
2345
+ * See https://github.com/cloudflare/workers-sdk/issues/583
2346
+ *
2347
+ * @default https
2348
+ */
2349
+ upstream_protocol: "https" | "http";
2350
+ /**
2351
+ * Host to forward requests to, defaults to the host of the first route of project
2352
+ */
2353
+ host: string | undefined;
2354
+ /**
2355
+ * When developing, whether to build and connect to containers. This requires a Docker daemon to be running.
2356
+ * Defaults to `true`.
2357
+ *
2358
+ * @default true
2359
+ */
2360
+ enable_containers: boolean;
2361
+ /**
2362
+ * Either the Docker unix socket i.e. `unix:///var/run/docker.sock` or a full configuration.
2363
+ * Note that windows is only supported via WSL at the moment
2364
+ */
2365
+ container_engine: ContainerEngine | undefined;
2366
+ }
2367
+ type RawDevConfig = Partial<DevConfig>;
2368
+ interface EnvironmentMap {
2369
+ /**
2370
+ * The `env` section defines overrides for the configuration for different environments.
2371
+ *
2372
+ * All environment fields can be specified at the top level of the config indicating the default environment settings.
2373
+ *
2374
+ * - Some fields are inherited and overridable in each environment.
2375
+ * - But some are not inherited and must be explicitly specified in every environment, if they are specified at the top level.
2376
+ *
2377
+ * For more information, see the documentation at https://developers.cloudflare.com/workers/cli-wrangler/configuration#environments
2378
+ *
2379
+ * @default {}
2380
+ */
2381
+ env?: {
2382
+ [envName: string]: RawEnvironment;
2383
+ };
2384
+ }
2385
+
2386
+ /**
2387
+ * Get the Worker `vars` bindings for a `wrangler dev` instance of a Worker.
2388
+ *
2389
+ * The `vars` bindings can be specified in the Wrangler configuration file.
2390
+ * But "secret" `vars` are usually only provided at the server -
2391
+ * either by creating them in the Dashboard UI, or using the `wrangler secret` command.
2392
+ *
2393
+ * It is useful during development, to provide these types of variable locally.
2394
+ * When running `wrangler dev` we will look for a file called `.dev.vars`, situated
2395
+ * next to the User's Wrangler configuration file (or in the current working directory if there is no
2396
+ * Wrangler configuration). If the `--env <env>` option is set, we'll first look for
2397
+ * `.dev.vars.<env>`.
2398
+ *
2399
+ * If there are no `.dev.vars*` file, (and CLOUDFLARE_LOAD_DEV_VARS_FROM_DOT_ENV is not "false")
2400
+ * we will look for `.env*` files in the same directory.
2401
+ * If the `envFiles` option is set, we'll look for the `.env` files at those paths instead of the defaults.
2402
+ *
2403
+ * Any values in these files (all formatted like `.env` files) will add to or override `vars`
2404
+ * bindings provided in the Wrangler configuration file.
2405
+ *
2406
+ * @param configPath - The path to the Wrangler configuration file, if defined.
2407
+ * @param envFiles - An array of paths to .env files to load; if `undefined` the default .env files will be used (see `getDefaultEnvFiles()`).
2408
+ * The `envFiles` paths are resolved against the directory of the Wrangler configuration file, if there is one, otherwise against the current working directory.
2409
+ * @param vars - The existing `vars` bindings from the Wrangler configuration.
2410
+ * @param env - The specific environment name (e.g., "staging") or `undefined` if no specific environment is set.
2411
+ * @param silent - If true, will not log any messages about the loaded .dev.vars files or .env files.
2412
+ * @returns The merged `vars` bindings, including those loaded from `.dev.vars` or `.env` files.
2413
+ */
2414
+ declare function getVarsForDev(configPath: string | undefined, envFiles: string[] | undefined, vars: Config$1["vars"], env: string | undefined, silent?: boolean): Config$1["vars"];
2415
+
2416
+ /**
2417
+ * Returns the compatibility date to use in development.
2418
+ *
2419
+ * When no compatibility date is configured, uses the installed Workers runtime's latest supported date.
2420
+ *
2421
+ * @param config wrangler configuration
2422
+ * @param compatibilityDate configured compatibility date
2423
+ * @returns the compatibility date to use in development
2424
+ */
2425
+ declare function getDevCompatibilityDate(config: Config$1 | undefined, compatibilityDate?: string | undefined): string;
2426
+
2427
+ type ConfigurationOptions = {
2428
+ outputDir: string;
2429
+ projectPath: string;
2430
+ workerName: string;
2431
+ dryRun: boolean;
2432
+ };
2433
+ type PackageJsonScriptsOverrides = {
2434
+ preview?: string;
2435
+ deploy?: string;
2436
+ typegen?: string;
2437
+ };
2438
+ type ConfigurationResults = {
2439
+ wranglerConfig: RawConfig$1;
2440
+ packageJsonScriptsOverrides?: PackageJsonScriptsOverrides;
2441
+ };
2442
+ declare abstract class Framework {
2443
+ name: string;
2444
+ constructor(name?: string);
2445
+ /** Some frameworks (i.e. Nuxt) don't need additional configuration */
2446
+ get configured(): boolean;
2447
+ abstract configure(options: ConfigurationOptions): Promise<ConfigurationResults> | ConfigurationResults;
2448
+ configurationDescription?: string;
2449
+ }
2450
+
2451
+ type AutoConfigDetails = {
2452
+ /** The name of the worker */
2453
+ workerName: string;
2454
+ /** The path to the project (defaults to cwd) */
2455
+ projectPath: string;
2456
+ /** The content of the project's package.json file (if any) */
2457
+ packageJson?: PackageJSON;
2458
+ /** Whether the project is already configured (no autoconfig required) */
2459
+ configured: boolean;
2460
+ /** Details about the detected framework (if any) */
2461
+ framework?: Framework;
2462
+ /** The build command used to build the project (if any) */
2463
+ buildCommand?: string;
2464
+ /** The output directory (if no framework is used, points to the raw asset files) */
2465
+ outputDir?: string;
2466
+ };
2467
+ type AutoConfigOptions = {
2468
+ /** Whether to run autoconfig without actually applying any filesystem modification (default: false) */
2469
+ dryRun?: boolean;
2470
+ /**
2471
+ * Whether the build command should be run (default: true)
2472
+ *
2473
+ * Note: When `dryRun` is `true` the build command is never run.
2474
+ */
2475
+ runBuild?: boolean;
2476
+ /**
2477
+ * Whether the confirmation prompts should be skipped (default: false)
2478
+ *
2479
+ * Note: When `dryRun` is `true` the the confirmation prompts are always skipped.
2480
+ */
2481
+ skipConfirmations?: boolean;
2482
+ };
2483
+ type AutoConfigSummary = {
2484
+ scripts: Record<string, string>;
2485
+ wranglerInstall: boolean;
2486
+ wranglerConfig: RawConfig$1;
2487
+ frameworkConfiguration?: string;
2488
+ outputDir: string;
985
2489
  };
986
2490
 
987
2491
  /**
@@ -1000,7 +2504,7 @@ type AutoConfigOptions = {
1000
2504
  declare function getWorkerNameFromProject(projectPath: string): string;
1001
2505
  declare function getDetailsForAutoConfig({ projectPath, wranglerConfig, }?: {
1002
2506
  projectPath?: string;
1003
- wranglerConfig?: Config;
2507
+ wranglerConfig?: Config$1;
1004
2508
  }): Promise<AutoConfigDetails>;
1005
2509
 
1006
2510
  /**
@@ -1114,7 +2618,7 @@ type StartRemoteProxySessionOptions = {
1114
2618
  workerName?: string;
1115
2619
  auth?: NonNullable<StartDevWorkerInput["dev"]>["auth"];
1116
2620
  /** If running in a non-public compliance region, set this here. */
1117
- complianceRegion?: Config["compliance_region"];
2621
+ complianceRegion?: Config$1["compliance_region"];
1118
2622
  };
1119
2623
  declare function startRemoteProxySession(bindings: StartDevWorkerInput["bindings"], options?: StartRemoteProxySessionOptions): Promise<RemoteProxySession>;
1120
2624
  type RemoteProxySession = Pick<Worker, "ready" | "dispose"> & {
@@ -1134,9 +2638,9 @@ type WorkerConfigObject = {
1134
2638
  /** The Worker's bindings */
1135
2639
  bindings: NonNullable<StartDevWorkerInput["bindings"]>;
1136
2640
  /** If running in a non-public compliance region, set this here. */
1137
- complianceRegion?: Config["compliance_region"];
2641
+ complianceRegion?: Config$1["compliance_region"];
1138
2642
  /** Id of the account owning the worker */
1139
- account_id?: Config["account_id"];
2643
+ account_id?: Config$1["account_id"];
1140
2644
  };
1141
2645
  /**
1142
2646
  * Utility for potentially starting or updating a remote proxy session.
@@ -1209,7 +2713,7 @@ declare class Logger {
1209
2713
  */
1210
2714
  declare function splitSqlQuery(sql: string): string[];
1211
2715
 
1212
- declare function runAutoConfig(autoConfigDetails: AutoConfigDetails, autoConfigOptions?: AutoConfigOptions): Promise<void>;
2716
+ declare function runAutoConfig(autoConfigDetails: AutoConfigDetails, autoConfigOptions?: AutoConfigOptions): Promise<AutoConfigSummary>;
1213
2717
 
1214
2718
  /**
1215
2719
  * Make a fetch request, and extract the `result` from the JSON response.
@@ -1306,7 +2810,7 @@ type HandlerContext = {
1306
2810
  /**
1307
2811
  * The wrangler config file read from disk and parsed.
1308
2812
  */
1309
- config: Config;
2813
+ config: Config$1;
1310
2814
  /**
1311
2815
  * The logger instance provided to the command implementor as a convenience.
1312
2816
  */
@@ -1528,4 +3032,4 @@ interface Unstable_ASSETSBindingsOptions {
1528
3032
  }
1529
3033
  declare const generateASSETSBinding: (opts: Unstable_ASSETSBindingsOptions) => (request: Request) => Promise<Response$1>;
1530
3034
 
1531
- export { type Binding, type GetPlatformProxyOptions, type PlatformProxy, type RemoteProxySession, type SourcelessWorkerOptions, type StartRemoteProxySessionOptions, type Unstable_ASSETSBindingsOptions, type Unstable_DevOptions, type Unstable_DevWorker, type Unstable_MiniflareWorkerOptions, Framework as experimental_AutoConfigFramework, getDetailsForAutoConfig as experimental_getDetailsForAutoConfig, experimental_getWranglerCommands, runAutoConfig as experimental_runAutoConfig, getPlatformProxy, maybeStartOrUpdateRemoteProxySession, startRemoteProxySession, DevEnv as unstable_DevEnv, convertConfigBindingsToStartWorkerBindings as unstable_convertConfigBindingsToStartWorkerBindings, unstable_dev, generateASSETSBinding as unstable_generateASSETSBinding, getDevCompatibilityDate as unstable_getDevCompatibilityDate, getDurableObjectClassNameToUseSQLiteMap as unstable_getDurableObjectClassNameToUseSQLiteMap, unstable_getMiniflareWorkerOptions, getVarsForDev as unstable_getVarsForDev, getWorkerNameFromProject as unstable_getWorkerNameFromProject, unstable_pages, readConfig as unstable_readConfig, splitSqlQuery as unstable_splitSqlQuery, startWorker as unstable_startWorker };
3035
+ export { type Binding, type GetPlatformProxyOptions, type PlatformProxy, type RemoteProxySession, type SourcelessWorkerOptions, type StartRemoteProxySessionOptions, type Unstable_ASSETSBindingsOptions, type Config as Unstable_Config, type Unstable_DevOptions, type Unstable_DevWorker, type Unstable_MiniflareWorkerOptions, type RawConfig as Unstable_RawConfig, type RawEnvironment as Unstable_RawEnvironment, Framework as experimental_AutoConfigFramework, getDetailsForAutoConfig as experimental_getDetailsForAutoConfig, experimental_getWranglerCommands, runAutoConfig as experimental_runAutoConfig, getPlatformProxy, maybeStartOrUpdateRemoteProxySession, startRemoteProxySession, DevEnv as unstable_DevEnv, convertConfigBindingsToStartWorkerBindings as unstable_convertConfigBindingsToStartWorkerBindings, unstable_dev, generateASSETSBinding as unstable_generateASSETSBinding, getDevCompatibilityDate as unstable_getDevCompatibilityDate, getDurableObjectClassNameToUseSQLiteMap as unstable_getDurableObjectClassNameToUseSQLiteMap, unstable_getMiniflareWorkerOptions, getVarsForDev as unstable_getVarsForDev, getWorkerNameFromProject as unstable_getWorkerNameFromProject, unstable_pages, readConfig as unstable_readConfig, splitSqlQuery as unstable_splitSqlQuery, startWorker as unstable_startWorker };