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