wrangler 0.0.0-e621d7b3 → 0.0.0-e62b097bb

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.
@@ -6,7 +6,6 @@ import type { DispatchFetch } from 'miniflare';
6
6
  import { Duplex } from 'stream';
7
7
  import { EventEmitter } from 'events';
8
8
  import { EventEmitter as EventEmitter_2 } from 'node:events';
9
- import { IncomingMessage } from 'http';
10
9
  import type { IncomingRequestCfProperties } from '@cloudflare/workers-types/experimental';
11
10
  import { IpcNetConnectOpts } from 'net';
12
11
  import type { Json } from 'miniflare';
@@ -16,12 +15,11 @@ import { Miniflare } from 'miniflare';
16
15
  import type { MiniflareOptions } from 'miniflare';
17
16
  import type { ModuleRule } from 'miniflare';
18
17
  import { Mutex } from 'miniflare';
18
+ import type { NodeJSCompatMode } from 'miniflare';
19
19
  import { Readable } from 'stream';
20
- import { ReadableStream } from 'stream/web';
21
- import type { Request as Request_2 } from 'miniflare';
22
- import { Response as Response_2 } from 'miniflare';
23
- import type { Server } from 'node:http';
24
- import { ServerResponse } from 'http';
20
+ import { ReadableStream as ReadableStream_2 } from 'stream/web';
21
+ import type { Request as Request_3 } from 'miniflare';
22
+ import { Response as Response_3 } from 'miniflare';
25
23
  import { Socket } from 'net';
26
24
  import { TcpNetConnectOpts } from 'net';
27
25
  import { TLSSocket } from 'tls';
@@ -30,6 +28,7 @@ import { UrlObject } from 'url';
30
28
  import { URLSearchParams as URLSearchParams_2 } from 'url';
31
29
  import type { WorkerOptions } from 'miniflare';
32
30
  import { Writable } from 'stream';
31
+ import { z } from 'zod';
33
32
 
34
33
  declare type AbortSignal_2 = unknown;
35
34
 
@@ -72,6 +71,50 @@ declare type ApiCredentials = {
72
71
  authEmail: string;
73
72
  };
74
73
 
74
+ declare type AssetConfig = z.infer<typeof AssetConfigSchema>;
75
+
76
+ declare const AssetConfigSchema: z.ZodObject<{
77
+ html_handling: z.ZodOptional<z.ZodEnum<["auto-trailing-slash", "force-trailing-slash", "drop-trailing-slash", "none"]>>;
78
+ not_found_handling: z.ZodOptional<z.ZodEnum<["single-page-application", "404-page", "none"]>>;
79
+ serve_directly: z.ZodOptional<z.ZodBoolean>;
80
+ run_worker_first: z.ZodOptional<z.ZodBoolean>;
81
+ }, "strip", z.ZodTypeAny, {
82
+ html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
83
+ not_found_handling?: "none" | "single-page-application" | "404-page";
84
+ serve_directly?: boolean;
85
+ run_worker_first?: boolean;
86
+ }, {
87
+ html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
88
+ not_found_handling?: "none" | "single-page-application" | "404-page";
89
+ serve_directly?: boolean;
90
+ run_worker_first?: boolean;
91
+ }>;
92
+
93
+ declare type Assets = {
94
+ /** Absolute path to assets directory */
95
+ directory?: string;
96
+ /** Name of `env` binding property in the User Worker. */
97
+ binding?: string;
98
+ /** How to handle HTML requests. */
99
+ html_handling?: "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash" | "none";
100
+ /** How to handle requests that do not match an asset. */
101
+ not_found_handling?: "single-page-application" | "404-page" | "none";
102
+ /**
103
+ * If true, route every request to the User Worker, whether or not it matches an asset.
104
+ * If false, then respond to requests that match an asset with that asset directly.
105
+ * */
106
+ run_worker_first?: boolean;
107
+ /** Deprecated; Inverse of run_worker_first. Should use run_worker_first instead */
108
+ experimental_serve_directly?: boolean;
109
+ };
110
+
111
+ declare type AssetsOptions = {
112
+ directory: string;
113
+ binding?: string;
114
+ routingConfig: RoutingConfig;
115
+ assetConfig: AssetConfig;
116
+ };
117
+
75
118
  declare type AsyncHook<T extends HookValues, Args extends unknown[] = []> = Hook<T, Args> | Hook<Promise<T>, Args>;
76
119
 
77
120
  declare class BalancedPool extends Dispatcher {
@@ -109,7 +152,7 @@ declare type Binding = {
109
152
  type: "kv_namespace";
110
153
  } & BindingOmit<CfKvNamespace>) | ({
111
154
  type: "send_email";
112
- } & BindingOmit<CfSendEmailBindings>) | {
155
+ } & NameOmit<CfSendEmailBindings>) | {
113
156
  type: "wasm_module";
114
157
  source: BinaryFile;
115
158
  } | {
@@ -119,6 +162,8 @@ declare type Binding = {
119
162
  type: "browser";
120
163
  } | {
121
164
  type: "ai";
165
+ } | {
166
+ type: "images";
122
167
  } | {
123
168
  type: "version_metadata";
124
169
  } | {
@@ -126,36 +171,40 @@ declare type Binding = {
126
171
  source: BinaryFile;
127
172
  } | ({
128
173
  type: "durable_object_namespace";
129
- } & BindingOmit<CfDurableObject>) | ({
174
+ } & NameOmit<CfDurableObject>) | ({
175
+ type: "workflow";
176
+ } & BindingOmit<CfWorkflow>) | ({
130
177
  type: "queue";
131
178
  } & BindingOmit<CfQueue>) | ({
132
179
  type: "r2_bucket";
133
180
  } & BindingOmit<CfR2Bucket>) | ({
134
181
  type: "d1";
135
- } & Omit<CfD1Database, "binding">) | ({
182
+ } & BindingOmit<CfD1Database>) | ({
136
183
  type: "vectorize";
137
- } & Omit<CfVectorize, "binding">) | ({
138
- type: "constellation";
139
- } & Omit<CfConstellation, "binding">) | ({
184
+ } & BindingOmit<CfVectorize>) | ({
140
185
  type: "hyperdrive";
141
- } & Omit<CfHyperdrive, "binding">) | ({
186
+ } & BindingOmit<CfHyperdrive>) | ({
142
187
  type: "service";
143
- } & Omit<CfService, "binding">) | {
188
+ } & BindingOmit<CfService>) | {
144
189
  type: "fetcher";
145
190
  fetcher: ServiceFetch;
146
191
  } | ({
147
192
  type: "analytics_engine";
148
- } & Omit<CfAnalyticsEngineDataset, "binding">) | ({
193
+ } & BindingOmit<CfAnalyticsEngineDataset>) | ({
149
194
  type: "dispatch_namespace";
150
- } & Omit<CfDispatchNamespace, "binding">) | ({
195
+ } & BindingOmit<CfDispatchNamespace>) | ({
151
196
  type: "mtls_certificate";
152
- } & Omit<CfMTlsCertificate, "binding">) | ({
197
+ } & BindingOmit<CfMTlsCertificate>) | ({
198
+ type: "pipeline";
199
+ } & BindingOmit<CfPipeline>) | ({
153
200
  type: "logfwdr";
154
- } & Omit<CfLogfwdrBinding, "name">) | {
201
+ } & NameOmit<CfLogfwdrBinding>) | {
155
202
  type: `unsafe_${string}`;
203
+ } | {
204
+ type: "assets";
156
205
  };
157
206
 
158
- declare type BindingOmit<T> = Omit<T, "binding" | "name">;
207
+ declare type BindingOmit<T> = Omit<T, "binding">;
159
208
 
160
209
  /**
161
210
  * Result of the `getBindingsProxy` utility
@@ -176,7 +225,7 @@ declare type BodyInit =
176
225
  | ArrayBuffer
177
226
  | AsyncIterable<Uint8Array>
178
227
  | Blob_2
179
- | FormData
228
+ | FormData_2
180
229
  | Iterable<Uint8Array>
181
230
  | NodeJS.ArrayBufferView
182
231
  | URLSearchParams_2
@@ -184,12 +233,12 @@ declare type BodyInit =
184
233
  | string
185
234
 
186
235
  declare interface BodyMixin {
187
- readonly body: ReadableStream | null
236
+ readonly body: ReadableStream_2 | null
188
237
  readonly bodyUsed: boolean
189
238
 
190
239
  readonly arrayBuffer: () => Promise<ArrayBuffer>
191
240
  readonly blob: () => Promise<Blob_2>
192
- readonly formData: () => Promise<FormData>
241
+ readonly formData: () => Promise<FormData_2>
193
242
  readonly json: () => Promise<unknown>
194
243
  readonly text: () => Promise<string>
195
244
  }
@@ -309,13 +358,13 @@ declare type BundleStartEvent = {
309
358
  };
310
359
 
311
360
  declare interface Cache {
312
- match (request: RequestInfo, options?: CacheQueryOptions): Promise<Response | undefined>,
313
- matchAll (request?: RequestInfo, options?: CacheQueryOptions): Promise<readonly Response[]>,
361
+ match (request: RequestInfo, options?: CacheQueryOptions): Promise<Response_2 | undefined>,
362
+ matchAll (request?: RequestInfo, options?: CacheQueryOptions): Promise<readonly Response_2[]>,
314
363
  add (request: RequestInfo): Promise<undefined>,
315
364
  addAll (requests: RequestInfo[]): Promise<undefined>,
316
- put (request: RequestInfo, response: Response): Promise<undefined>,
365
+ put (request: RequestInfo, response: Response_2): Promise<undefined>,
317
366
  delete (request: RequestInfo, options?: CacheQueryOptions): Promise<boolean>,
318
- keys (request?: RequestInfo, options?: CacheQueryOptions): Promise<readonly Request[]>
367
+ keys (request?: RequestInfo, options?: CacheQueryOptions): Promise<readonly Request_2[]>
319
368
  }
320
369
 
321
370
  /**
@@ -344,7 +393,7 @@ declare type CacheResponse = any;
344
393
  declare const caches: CacheStorage;
345
394
 
346
395
  declare interface CacheStorage {
347
- match (request: RequestInfo, options?: MultiCacheQueryOptions): Promise<Response | undefined>,
396
+ match (request: RequestInfo, options?: MultiCacheQueryOptions): Promise<Response_2 | undefined>,
348
397
  has (cacheName: string): Promise<boolean>,
349
398
  open (cacheName: string): Promise<Cache>,
350
399
  delete (cacheName: string): Promise<boolean>,
@@ -415,15 +464,10 @@ declare type CfCapnp = {
415
464
  compiled_schema?: never;
416
465
  };
417
466
 
418
- declare interface CfConstellation {
419
- binding: string;
420
- project_id: string;
421
- }
422
-
423
467
  declare interface CfD1Database {
424
468
  binding: string;
425
- database_id: string;
426
- database_name: string;
469
+ database_id?: string | typeof INHERIT_SYMBOL;
470
+ database_name?: string;
427
471
  preview_database_id?: string;
428
472
  database_internal_env?: string;
429
473
  migrations_table?: string;
@@ -461,7 +505,7 @@ declare interface CfHyperdrive {
461
505
  */
462
506
  declare interface CfKvNamespace {
463
507
  binding: string;
464
- id: string;
508
+ id?: string | typeof INHERIT_SYMBOL;
465
509
  }
466
510
 
467
511
  declare interface CfLogfwdrBinding {
@@ -499,7 +543,7 @@ declare interface CfModule {
499
543
  * }
500
544
  * }
501
545
  */
502
- content: string | Buffer;
546
+ content: string | Buffer<ArrayBuffer>;
503
547
  /**
504
548
  * An optional sourcemap for this module if it's of a ESM or CJS type, this will only be present
505
549
  * if we're deploying with sourcemaps enabled. Since we copy extra modules that aren't bundled
@@ -524,6 +568,11 @@ declare interface CfMTlsCertificate {
524
568
  certificate_id: string;
525
569
  }
526
570
 
571
+ declare interface CfPipeline {
572
+ binding: string;
573
+ pipeline: string;
574
+ }
575
+
527
576
  declare interface CfQueue {
528
577
  binding: string;
529
578
  queue_name: string;
@@ -532,7 +581,7 @@ declare interface CfQueue {
532
581
 
533
582
  declare interface CfR2Bucket {
534
583
  binding: string;
535
- bucket_name: string;
584
+ bucket_name?: string | typeof INHERIT_SYMBOL;
536
585
  jurisdiction?: string;
537
586
  }
538
587
 
@@ -601,6 +650,13 @@ declare interface CfWorkerSourceMap {
601
650
  content: string | Buffer;
602
651
  }
603
652
 
653
+ declare interface CfWorkflow {
654
+ name: string;
655
+ class_name: string;
656
+ binding: string;
657
+ script_name?: string;
658
+ }
659
+
604
660
  /**
605
661
  * A basic HTTP/1.1 client, mapped on top a single TCP/TLS connection. Pipelining is disabled by default.
606
662
  */
@@ -713,38 +769,32 @@ declare interface CloseEventInit extends EventInit {
713
769
  * Configuration in wrangler for Cloudchamber
714
770
  */
715
771
  declare type CloudchamberConfig = {
772
+ image?: string;
773
+ location?: string;
716
774
  vcpu?: number;
717
775
  memory?: string;
776
+ ipv4?: boolean;
718
777
  };
719
778
 
720
- /**
721
- * This is the static type definition for the configuration object.
722
- *
723
- * It reflects a normalized and validated version of the configuration that you can write in wrangler.toml,
724
- * and optionally augment with arguments passed directly to wrangler.
725
- *
726
- * For more information about the configuration object, see the
727
- * documentation at https://developers.cloudflare.com/workers/cli-wrangler/configuration
728
- *
729
- * Notes:
730
- *
731
- * - Fields that are only specified in `ConfigFields` and not `Environment` can only appear
732
- * in the top level config and should not appear in any environments.
733
- * - Fields that are specified in `PagesConfigFields` are only relevant for Pages projects
734
- * - All top level fields in config and environments are optional in the wrangler.toml file.
735
- *
736
- * Legend for the annotations:
737
- *
738
- * - `@breaking`: the deprecation/optionality is a breaking change from Wrangler v1.
739
- * - `@todo`: there's more work to be done (with details attached).
740
- */
741
- declare type Config = ConfigFields<DevConfig> & PagesConfigFields & Environment;
779
+ declare interface ComputedFields {
780
+ /** The path to the Wrangler configuration file (if any, and possibly redirected from the user Wrangler configuration) used to create this configuration. */
781
+ configPath: string | undefined;
782
+ /** 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. */
783
+ userConfigPath: string | undefined;
784
+ /**
785
+ * The original top level name for the Worker in the raw configuration.
786
+ *
787
+ * When a raw configuration has been flattened to a single environment the worker name may have been replaced or transformed.
788
+ * It can be useful to know what the top-level name was before the flattening.
789
+ */
790
+ topLevelName: string | undefined;
791
+ }
742
792
 
743
793
  declare class ConfigController extends Controller<ConfigControllerEventMap> {
744
794
  #private;
745
795
  latestInput?: StartDevWorkerInput;
746
796
  latestConfig?: StartDevWorkerOptions;
747
- set(input: StartDevWorkerInput): Promise<StartDevWorkerOptions | undefined>;
797
+ set(input: StartDevWorkerInput, throwErrors?: boolean): Promise<StartDevWorkerOptions | undefined>;
748
798
  patch(input: Partial<StartDevWorkerInput>): Promise<StartDevWorkerOptions | undefined>;
749
799
  teardown(): Promise<void>;
750
800
  emitConfigUpdateEvent(config: StartDevWorkerOptions): void;
@@ -755,7 +805,6 @@ declare type ConfigControllerEventMap = ControllerEventMap & {
755
805
  };
756
806
 
757
807
  declare interface ConfigFields<Dev extends RawDevConfig> {
758
- configPath: string | undefined;
759
808
  /**
760
809
  * A boolean to enable "legacy" style wrangler environments (from Wrangler v1).
761
810
  * These have been superseded by Services, but there may be projects that won't
@@ -784,7 +833,7 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
784
833
  /**
785
834
  * The directory containing your static assets.
786
835
  *
787
- * It must be a path relative to your wrangler.toml file.
836
+ * It must be a path relative to your Wrangler configuration file.
788
837
  * Example: bucket = "./public"
789
838
  *
790
839
  * If there is a `site` field then it must contain this `bucket` field.
@@ -817,10 +866,13 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
817
866
  exclude?: string[];
818
867
  } | undefined;
819
868
  /**
820
- * Serve a folder of static assets with your Worker, without any additional code.
821
- * This can either be a string, or an object with additional config fields.
869
+ * Old behaviour of serving a folder of static assets with your Worker,
870
+ * without any additional code.
871
+ * This can either be a string, or an object with additional config
872
+ * fields.
873
+ * Will be deprecated in the near future in favor of `assets`.
822
874
  */
823
- assets: {
875
+ legacy_assets: {
824
876
  bucket: string;
825
877
  include: string[];
826
878
  exclude: string[];
@@ -859,7 +911,7 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
859
911
  [key: string]: string;
860
912
  } | undefined;
861
913
  /**
862
- * By default, wrangler.toml is the source of truth for your environment configuration, like a terraform file.
914
+ * By default, the Wrangler configuration file is the source of truth for your environment configuration, like a terraform file.
863
915
  *
864
916
  * If you change your vars in the dashboard, wrangler *will* override/delete them on its next deploy.
865
917
  *
@@ -887,6 +939,32 @@ url: string | URL_2 | UrlObject,
887
939
  options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.ConnectOptions, 'origin' | 'path'>
888
940
  ): Promise<Dispatcher.ConnectData>;
889
941
 
942
+ /**
943
+ * Configuration for a container application
944
+ */
945
+ declare type ContainerApp = {
946
+ name: string;
947
+ instances: number;
948
+ scheduling_policy?: "regional" | "moon";
949
+ configuration: {
950
+ image: string;
951
+ labels?: {
952
+ name: string;
953
+ value: string;
954
+ }[];
955
+ secrets?: {
956
+ name: string;
957
+ type: "env";
958
+ secret: string;
959
+ }[];
960
+ };
961
+ constraints?: {
962
+ regions?: string[];
963
+ cities?: string[];
964
+ tier?: number;
965
+ };
966
+ };
967
+
890
968
  declare abstract class Controller<EventMap extends ControllerEventMap = ControllerEventMap> extends TypedEventEmitterImpl<EventMap> {
891
969
  emitErrorEvent(data: ErrorEvent): void;
892
970
  }
@@ -926,7 +1004,7 @@ declare type DeferredPromise<T> = {
926
1004
  };
927
1005
 
928
1006
  declare function deleteCookie (
929
- headers: Headers,
1007
+ headers: Headers_2,
930
1008
  name: string,
931
1009
  attributes?: { name?: string, domain?: string }
932
1010
  ): void
@@ -940,8 +1018,6 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
940
1018
  url: string;
941
1019
  id: string;
942
1020
  environment: "production" | "preview";
943
- project_id: string;
944
- project_name: string;
945
1021
  build_config: {
946
1022
  build_command: string;
947
1023
  destination_dir: string;
@@ -952,6 +1028,8 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
952
1028
  };
953
1029
  created_on: string;
954
1030
  production_branch: string;
1031
+ project_id: string;
1032
+ project_name: string;
955
1033
  deployment_trigger: {
956
1034
  metadata: {
957
1035
  branch: string;
@@ -961,14 +1039,14 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
961
1039
  type: string;
962
1040
  };
963
1041
  latest_stage: {
964
- name: "build" | "deploy" | "queued" | "initialize" | "clone_repo";
965
- status: "active" | "idle" | "canceled" | "success" | "failure" | "skipped";
1042
+ status: "canceled" | "active" | "idle" | "success" | "failure" | "skipped";
1043
+ name: "queued" | "build" | "deploy" | "initialize" | "clone_repo";
966
1044
  started_on: string | null;
967
1045
  ended_on: string | null;
968
1046
  };
969
1047
  stages: {
970
- name: "build" | "deploy" | "queued" | "initialize" | "clone_repo";
971
- status: "active" | "idle" | "canceled" | "success" | "failure" | "skipped";
1048
+ status: "canceled" | "active" | "idle" | "success" | "failure" | "skipped";
1049
+ name: "queued" | "build" | "deploy" | "initialize" | "clone_repo";
972
1050
  started_on: string | null;
973
1051
  ended_on: string | null;
974
1052
  }[];
@@ -976,8 +1054,8 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
976
1054
  modified_on: string;
977
1055
  short_id: string;
978
1056
  build_image_major_version: number;
1057
+ kv_namespaces?: any;
979
1058
  source?: {
980
- type: "github" | "gitlab";
981
1059
  config: {
982
1060
  owner: string;
983
1061
  repo_name: string;
@@ -985,12 +1063,12 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
985
1063
  pr_comments_enabled?: boolean | undefined;
986
1064
  deployments_enabled?: boolean | undefined;
987
1065
  production_deployments_enabled?: boolean | undefined;
988
- preview_deployment_setting?: "none" | "all" | "custom" | undefined;
1066
+ preview_deployment_setting?: "none" | "custom" | "all" | undefined;
989
1067
  preview_branch_includes?: string[] | undefined;
990
1068
  preview_branch_excludes?: string[] | undefined;
991
1069
  };
1070
+ type: "github" | "gitlab";
992
1071
  } | undefined;
993
- kv_namespaces?: any;
994
1072
  env_vars?: any;
995
1073
  durable_object_namespaces?: any;
996
1074
  is_skipped?: boolean | undefined;
@@ -999,6 +1077,30 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
999
1077
  } | undefined;
1000
1078
  }>;
1001
1079
 
1080
+ declare interface DeprecatedConfigFields {
1081
+ /**
1082
+ * The project "type". A holdover from Wrangler v1.x.
1083
+ * Valid values were "webpack", "javascript", and "rust".
1084
+ *
1085
+ * @deprecated DO NOT USE THIS. Most common features now work out of the box with wrangler, including modules, jsx, typescript, etc. If you need anything more, use a custom build.
1086
+ * @breaking
1087
+ */
1088
+ type?: "webpack" | "javascript" | "rust";
1089
+ /**
1090
+ * Path to the webpack config to use when building your worker.
1091
+ * A holdover from Wrangler v1.x, used with `type: "webpack"`.
1092
+ *
1093
+ * @deprecated DO NOT USE THIS. Most common features now work out of the box with wrangler, including modules, jsx, typescript, etc. If you need anything more, use a custom build.
1094
+ * @breaking
1095
+ */
1096
+ webpack_config?: string;
1097
+ /**
1098
+ * Configuration only used by a standalone use of the miniflare binary.
1099
+ * @deprecated
1100
+ */
1101
+ miniflare?: unknown;
1102
+ }
1103
+
1002
1104
  /**
1003
1105
  * Deprecated upload configuration.
1004
1106
  */
@@ -1011,9 +1113,9 @@ declare interface DeprecatedUpload {
1011
1113
  format?: "modules" | "service-worker";
1012
1114
  /**
1013
1115
  * The directory you wish to upload your Worker from,
1014
- * relative to the wrangler.toml file.
1116
+ * relative to the Wrangler configuration file.
1015
1117
  *
1016
- * Defaults to the directory containing the wrangler.toml file.
1118
+ * Defaults to the directory containing the Wrangler configuration file.
1017
1119
  *
1018
1120
  * @deprecated
1019
1121
  */
@@ -1225,7 +1327,7 @@ declare namespace Dispatcher {
1225
1327
  path: string;
1226
1328
  method: HttpMethod;
1227
1329
  /** Default: `null` */
1228
- body?: string | Buffer | Uint8Array | Readable | null | FormData;
1330
+ body?: string | Buffer | Uint8Array | Readable | null | FormData_2;
1229
1331
  /** Default: `null` */
1230
1332
  headers?: IncomingHttpHeaders | string[] | null;
1231
1333
  /** Query string params to be embedded in the request URL. Default: `null` */
@@ -1376,7 +1478,7 @@ declare interface DispatchNamespaceOutbound {
1376
1478
  parameters?: string[];
1377
1479
  }
1378
1480
 
1379
- declare type DOMException = typeof globalThis extends { DOMException: infer T }
1481
+ declare type DOMException_2 = typeof globalThis extends { DOMException: infer T }
1380
1482
  ? T
1381
1483
  : any
1382
1484
 
@@ -1391,6 +1493,25 @@ declare type DurableObjectBindings = {
1391
1493
  environment?: string;
1392
1494
  }[];
1393
1495
 
1496
+ /**
1497
+ * Configuration in wrangler for Durable Object Migrations
1498
+ */
1499
+ declare type DurableObjectMigration = {
1500
+ /** A unique identifier for this migration. */
1501
+ tag: string;
1502
+ /** The new Durable Objects being defined. */
1503
+ new_classes?: string[];
1504
+ /** The new SQLite Durable Objects being defined. */
1505
+ new_sqlite_classes?: string[];
1506
+ /** The Durable Objects being renamed. */
1507
+ renamed_classes?: {
1508
+ from: string;
1509
+ to: string;
1510
+ }[];
1511
+ /** The Durable Objects being removed. */
1512
+ deleted_classes?: string[];
1513
+ };
1514
+
1394
1515
  declare interface EnablePagesAssetsServiceBindingOptions {
1395
1516
  proxyPort?: number;
1396
1517
  directory?: string;
@@ -1404,8 +1525,8 @@ declare interface EnablePagesAssetsServiceBindingOptions {
1404
1525
  declare type Entry = {
1405
1526
  /** A worker's entrypoint */
1406
1527
  file: string;
1407
- /** A worker's directory. Usually where the wrangler.toml file is located */
1408
- directory: string;
1528
+ /** A worker's directory. Usually where the Wrangler configuration file is located */
1529
+ projectRoot: string;
1409
1530
  /** Is this a module worker or a service worker? */
1410
1531
  format: CfScriptFormat;
1411
1532
  /** The directory that contains all of a `--no-bundle` worker's modules. Usually `${directory}/src`. Defaults to path.dirname(file) */
@@ -1414,6 +1535,8 @@ declare type Entry = {
1414
1535
  * A worker's name
1415
1536
  */
1416
1537
  name?: string | undefined;
1538
+ /** Export from a Worker's entrypoint */
1539
+ exports: string[];
1417
1540
  };
1418
1541
 
1419
1542
  /**
@@ -1425,6 +1548,39 @@ declare type Entry = {
1425
1548
  declare interface Environment extends EnvironmentInheritable, EnvironmentNonInheritable {
1426
1549
  }
1427
1550
 
1551
+ /**
1552
+ * The environment configuration properties that have been deprecated.
1553
+ */
1554
+ declare interface EnvironmentDeprecated {
1555
+ /**
1556
+ * The zone ID of the zone you want to deploy to. You can find this
1557
+ * in your domain page on the dashboard.
1558
+ *
1559
+ * @deprecated This is unnecessary since we can deduce this from routes directly.
1560
+ */
1561
+ zone_id?: string;
1562
+ /**
1563
+ * Legacy way of defining KVNamespaces that is no longer supported.
1564
+ *
1565
+ * @deprecated DO NOT USE. This was a legacy bug from Wrangler v1, that we do not want to support.
1566
+ */
1567
+ "kv-namespaces"?: string;
1568
+ /**
1569
+ * A list of services that your Worker should be bound to.
1570
+ *
1571
+ * @default []
1572
+ * @deprecated DO NOT USE. We'd added this to test the new service binding system, but the proper way to test experimental features is to use `unsafe.bindings` configuration.
1573
+ */
1574
+ experimental_services?: {
1575
+ /** The binding name used to refer to the Service */
1576
+ name: string;
1577
+ /** The name of the Service being bound */
1578
+ service: string;
1579
+ /** The Service's environment */
1580
+ environment: string;
1581
+ }[];
1582
+ }
1583
+
1428
1584
  /**
1429
1585
  * The `EnvironmentInheritable` interface declares all the configuration fields for an environment
1430
1586
  * that can be inherited (and overridden) from the top-level environment.
@@ -1457,11 +1613,11 @@ declare interface EnvironmentInheritable {
1457
1613
  compatibility_date: string | undefined;
1458
1614
  /**
1459
1615
  * A list of flags that enable features from upcoming features of
1460
- * the Workers runtime, usually used together with compatibility_flags.
1616
+ * the Workers runtime, usually used together with compatibility_date.
1461
1617
  *
1462
- * More details at https://developers.cloudflare.com/workers/platform/compatibility-dates
1618
+ * More details at https://developers.cloudflare.com/workers/platform/compatibility-flags
1463
1619
  *
1464
- * @default `[]`
1620
+ * @default []
1465
1621
  * @inheritable
1466
1622
  */
1467
1623
  compatibility_flags: string[];
@@ -1499,12 +1655,20 @@ declare interface EnvironmentInheritable {
1499
1655
  * Whether we use <name>.<subdomain>.workers.dev to
1500
1656
  * test and deploy your Worker.
1501
1657
  *
1502
- * // Carmen according to our tests the default is undefined
1503
- * @default `true` (This is a breaking change from Wrangler v1)
1658
+ *
1659
+ * @default true
1504
1660
  * @breaking
1505
1661
  * @inheritable
1506
1662
  */
1507
1663
  workers_dev: boolean | undefined;
1664
+ /**
1665
+ * Whether we use <version>-<name>.<subdomain>.workers.dev to
1666
+ * serve Preview URLs for your Worker.
1667
+ *
1668
+ * @default true
1669
+ * @inheritable
1670
+ */
1671
+ preview_urls: boolean | undefined;
1508
1672
  /**
1509
1673
  * A list of routes that your Worker should be published to.
1510
1674
  * Only one of `routes` or `route` is required.
@@ -1533,14 +1697,14 @@ declare interface EnvironmentInheritable {
1533
1697
  /**
1534
1698
  * The function to use to replace jsx syntax.
1535
1699
  *
1536
- * @default `"React.createElement"`
1700
+ * @default "React.createElement"
1537
1701
  * @inheritable
1538
1702
  */
1539
1703
  jsx_factory: string;
1540
1704
  /**
1541
1705
  * The function to use to replace jsx fragment syntax.
1542
1706
  *
1543
- * @default `"React.Fragment"`
1707
+ * @default "React.Fragment"
1544
1708
  * @inheritable
1545
1709
  */
1546
1710
  jsx_fragment: string;
@@ -1554,19 +1718,7 @@ declare interface EnvironmentInheritable {
1554
1718
  * @default []
1555
1719
  * @inheritable
1556
1720
  */
1557
- migrations: {
1558
- /** A unique identifier for this migration. */
1559
- tag: string;
1560
- /** The new Durable Objects being defined. */
1561
- new_classes?: string[];
1562
- /** The Durable Objects being renamed. */
1563
- renamed_classes?: {
1564
- from: string;
1565
- to: string;
1566
- }[];
1567
- /** The Durable Objects being removed. */
1568
- deleted_classes?: string[];
1569
- }[];
1721
+ migrations: DurableObjectMigration[];
1570
1722
  /**
1571
1723
  * "Cron" definitions to trigger a Worker's "scheduled" function.
1572
1724
  *
@@ -1574,7 +1726,7 @@ declare interface EnvironmentInheritable {
1574
1726
  *
1575
1727
  * More details here https://developers.cloudflare.com/workers/platform/cron-triggers
1576
1728
  *
1577
- * @default `{crons:[]}`
1729
+ * @default {crons:[]}
1578
1730
  * @inheritable
1579
1731
  */
1580
1732
  triggers: {
@@ -1660,7 +1812,7 @@ declare interface EnvironmentInheritable {
1660
1812
  /**
1661
1813
  * List of bindings that you will send to logfwdr
1662
1814
  *
1663
- * @default `{bindings:[]}`
1815
+ * @default {bindings:[]}
1664
1816
  * @inheritable
1665
1817
  */
1666
1818
  logfwdr: {
@@ -1696,7 +1848,40 @@ declare interface EnvironmentInheritable {
1696
1848
  */
1697
1849
  placement: {
1698
1850
  mode: "off" | "smart";
1851
+ hint?: string;
1699
1852
  } | undefined;
1853
+ /**
1854
+ * Specify the directory of static assets to deploy/serve
1855
+ *
1856
+ * More details at https://developers.cloudflare.com/workers/frameworks/
1857
+ *
1858
+ * @inheritable
1859
+ */
1860
+ assets: Assets | undefined;
1861
+ /**
1862
+ * Specify the observability behavior of the Worker.
1863
+ *
1864
+ * @inheritable
1865
+ */
1866
+ observability: Observability | undefined;
1867
+ }
1868
+
1869
+ declare interface EnvironmentMap {
1870
+ /**
1871
+ * The `env` section defines overrides for the configuration for different environments.
1872
+ *
1873
+ * All environment fields can be specified at the top level of the config indicating the default environment settings.
1874
+ *
1875
+ * - Some fields are inherited and overridable in each environment.
1876
+ * - But some are not inherited and must be explicitly specified in every environment, if they are specified at the top level.
1877
+ *
1878
+ * For more information, see the documentation at https://developers.cloudflare.com/workers/cli-wrangler/configuration#environments
1879
+ *
1880
+ * @default {}
1881
+ */
1882
+ env?: {
1883
+ [envName: string]: Unstable_RawEnvironment;
1884
+ };
1700
1885
  }
1701
1886
 
1702
1887
  /**
@@ -1713,7 +1898,7 @@ declare interface EnvironmentNonInheritable {
1713
1898
  * NOTE: This field is not automatically inherited from the top level environment,
1714
1899
  * and so must be specified in every named environment.
1715
1900
  *
1716
- * @default `{}`
1901
+ * @default {}
1717
1902
  * @nonInheritable
1718
1903
  */
1719
1904
  define: Record<string, string>;
@@ -1723,7 +1908,7 @@ declare interface EnvironmentNonInheritable {
1723
1908
  * NOTE: This field is not automatically inherited from the top level environment,
1724
1909
  * and so must be specified in every named environment.
1725
1910
  *
1726
- * @default `{}`
1911
+ * @default {}
1727
1912
  * @nonInheritable
1728
1913
  */
1729
1914
  vars: Record<string, string | Json>;
@@ -1736,22 +1921,47 @@ declare interface EnvironmentNonInheritable {
1736
1921
  * NOTE: This field is not automatically inherited from the top level environment,
1737
1922
  * and so must be specified in every named environment.
1738
1923
  *
1739
- * @default `{bindings:[]}`
1924
+ * @default {bindings:[]}
1740
1925
  * @nonInheritable
1741
1926
  */
1742
1927
  durable_objects: {
1743
1928
  bindings: DurableObjectBindings;
1744
1929
  };
1930
+ /**
1931
+ * A list of workflows that your Worker should be bound to.
1932
+ *
1933
+ * NOTE: This field is not automatically inherited from the top level environment,
1934
+ * and so must be specified in every named environment.
1935
+ *
1936
+ * @default []
1937
+ * @nonInheritable
1938
+ */
1939
+ workflows: WorkflowBinding[];
1745
1940
  /**
1746
1941
  * Cloudchamber configuration
1747
1942
  *
1748
1943
  * NOTE: This field is not automatically inherited from the top level environment,
1749
1944
  * and so must be specified in every named environment.
1750
1945
  *
1751
- * @default `{}`
1946
+ * @default {}
1752
1947
  * @nonInheritable
1753
1948
  */
1754
1949
  cloudchamber: CloudchamberConfig;
1950
+ /**
1951
+ * Container related configuration
1952
+ */
1953
+ containers: {
1954
+ /**
1955
+ * Container app configuration
1956
+ *
1957
+ * NOTE: This field is not automatically inherited from the top level environment,
1958
+ * and so must be specified in every named environment.
1959
+ *
1960
+ * @default {}
1961
+ * @nonInheritable
1962
+ */
1963
+ app: ContainerApp[];
1964
+ };
1755
1965
  /**
1756
1966
  * These specify any Workers KV Namespaces you want to
1757
1967
  * access from inside your Worker.
@@ -1762,14 +1972,14 @@ declare interface EnvironmentNonInheritable {
1762
1972
  * NOTE: This field is not automatically inherited from the top level environment,
1763
1973
  * and so must be specified in every named environment.
1764
1974
  *
1765
- * @default `[]`
1975
+ * @default []
1766
1976
  * @nonInheritable
1767
1977
  */
1768
1978
  kv_namespaces: {
1769
1979
  /** The binding name used to refer to the KV Namespace */
1770
1980
  binding: string;
1771
1981
  /** The ID of the KV namespace */
1772
- id: string;
1982
+ id?: string;
1773
1983
  /** The ID of the KV namespace used during `wrangler dev` */
1774
1984
  preview_id?: string;
1775
1985
  }[];
@@ -1779,7 +1989,7 @@ declare interface EnvironmentNonInheritable {
1779
1989
  * NOTE: This field is not automatically inherited from the top level environment,
1780
1990
  * and so must be specified in every named environment.
1781
1991
  *
1782
- * @default `[]`
1992
+ * @default []
1783
1993
  * @nonInheritable
1784
1994
  */
1785
1995
  send_email: {
@@ -1796,7 +2006,7 @@ declare interface EnvironmentNonInheritable {
1796
2006
  * NOTE: This field is not automatically inherited from the top level environment,
1797
2007
  * and so must be specified in every named environment.
1798
2008
  *
1799
- * @default `{consumers:[],producers:[]}`
2009
+ * @default {consumers:[],producers:[]}
1800
2010
  * @nonInheritable
1801
2011
  */
1802
2012
  queues: {
@@ -1837,14 +2047,14 @@ declare interface EnvironmentNonInheritable {
1837
2047
  * NOTE: This field is not automatically inherited from the top level environment,
1838
2048
  * and so must be specified in every named environment.
1839
2049
  *
1840
- * @default `[]`
2050
+ * @default []
1841
2051
  * @nonInheritable
1842
2052
  */
1843
2053
  r2_buckets: {
1844
2054
  /** The binding name used to refer to the R2 bucket in the Worker. */
1845
2055
  binding: string;
1846
2056
  /** The name of this R2 bucket at the edge. */
1847
- bucket_name: string;
2057
+ bucket_name?: string;
1848
2058
  /** The preview name of this R2 bucket at the edge. */
1849
2059
  preview_bucket_name?: string;
1850
2060
  /** The jurisdiction that the bucket exists in. Default if not present. */
@@ -1856,16 +2066,16 @@ declare interface EnvironmentNonInheritable {
1856
2066
  * NOTE: This field is not automatically inherited from the top level environment,
1857
2067
  * and so must be specified in every named environment.
1858
2068
  *
1859
- * @default `[]`
2069
+ * @default []
1860
2070
  * @nonInheritable
1861
2071
  */
1862
2072
  d1_databases: {
1863
2073
  /** The binding name used to refer to the D1 database in the Worker. */
1864
2074
  binding: string;
1865
2075
  /** The name of this D1 database. */
1866
- database_name: string;
2076
+ database_name?: string;
1867
2077
  /** The UUID of this D1 database (not required). */
1868
- database_id: string;
2078
+ database_id?: string;
1869
2079
  /** The UUID of this D1 database for Wrangler Dev (if specified). */
1870
2080
  preview_database_id?: string;
1871
2081
  /** The name of the migrations table for this D1 database (defaults to 'd1_migrations'). */
@@ -1881,7 +2091,7 @@ declare interface EnvironmentNonInheritable {
1881
2091
  * NOTE: This field is not automatically inherited from the top level environment,
1882
2092
  * and so must be specified in every named environment.
1883
2093
  *
1884
- * @default `[]`
2094
+ * @default []
1885
2095
  * @nonInheritable
1886
2096
  */
1887
2097
  vectorize: {
@@ -1890,28 +2100,13 @@ declare interface EnvironmentNonInheritable {
1890
2100
  /** The name of the index. */
1891
2101
  index_name: string;
1892
2102
  }[];
1893
- /**
1894
- * Specifies Constellation projects that are bound to this Worker environment.
1895
- *
1896
- * NOTE: This field is not automatically inherited from the top level environment,
1897
- * and so must be specified in every named environment.
1898
- *
1899
- * @default `[]`
1900
- * @nonInheritable
1901
- */
1902
- constellation: {
1903
- /** The binding name used to refer to the project in the Worker. */
1904
- binding: string;
1905
- /** The id of the project. */
1906
- project_id: string;
1907
- }[];
1908
2103
  /**
1909
2104
  * Specifies Hyperdrive configs that are bound to this Worker environment.
1910
2105
  *
1911
2106
  * NOTE: This field is not automatically inherited from the top level environment,
1912
2107
  * and so must be specified in every named environment.
1913
2108
  *
1914
- * @default `[]`
2109
+ * @default []
1915
2110
  * @nonInheritable
1916
2111
  */
1917
2112
  hyperdrive: {
@@ -1928,7 +2123,7 @@ declare interface EnvironmentNonInheritable {
1928
2123
  * NOTE: This field is not automatically inherited from the top level environment,
1929
2124
  * and so must be specified in every named environment.
1930
2125
  *
1931
- * @default `[]`
2126
+ * @default []
1932
2127
  * @nonInheritable
1933
2128
  */
1934
2129
  services: {
@@ -1947,7 +2142,7 @@ declare interface EnvironmentNonInheritable {
1947
2142
  * NOTE: This field is not automatically inherited from the top level environment,
1948
2143
  * and so must be specified in every named environment.
1949
2144
  *
1950
- * @default `[]`
2145
+ * @default []
1951
2146
  * @nonInheritable
1952
2147
  */
1953
2148
  analytics_engine_datasets: {
@@ -1962,7 +2157,7 @@ declare interface EnvironmentNonInheritable {
1962
2157
  * NOTE: This field is not automatically inherited from the top level environment,
1963
2158
  * and so must be specified in every named environment.
1964
2159
  *
1965
- * @default `{}`
2160
+ * @default {}
1966
2161
  * @nonInheritable
1967
2162
  */
1968
2163
  browser: {
@@ -1974,13 +2169,25 @@ declare interface EnvironmentNonInheritable {
1974
2169
  * NOTE: This field is not automatically inherited from the top level environment,
1975
2170
  * and so must be specified in every named environment.
1976
2171
  *
1977
- * @default `{}`
2172
+ * @default {}
1978
2173
  * @nonInheritable
1979
2174
  */
1980
2175
  ai: {
1981
2176
  binding: string;
1982
2177
  staging?: boolean;
1983
2178
  } | undefined;
2179
+ /**
2180
+ * Binding to Cloudflare Images
2181
+ *
2182
+ * NOTE: This field is not automatically inherited from the top level environment,
2183
+ * and so must be specified in every named environment.
2184
+ *
2185
+ * @default {}
2186
+ * @nonInheritable
2187
+ */
2188
+ images: {
2189
+ binding: string;
2190
+ } | undefined;
1984
2191
  /**
1985
2192
  * Binding to the Worker Version's metadata
1986
2193
  */
@@ -1993,7 +2200,7 @@ declare interface EnvironmentNonInheritable {
1993
2200
  * NOTE: This field is not automatically inherited from the top level environment,
1994
2201
  * and so must be specified in every named environment.
1995
2202
  *
1996
- * @default `{}`
2203
+ * @default {}
1997
2204
  * @nonInheritable
1998
2205
  */
1999
2206
  unsafe: {
@@ -2033,7 +2240,7 @@ declare interface EnvironmentNonInheritable {
2033
2240
  * NOTE: This field is not automatically inherited from the top level environment,
2034
2241
  * and so must be specified in every named environment.
2035
2242
  *
2036
- * @default `[]`
2243
+ * @default []
2037
2244
  * @nonInheritable
2038
2245
  */
2039
2246
  mtls_certificates: {
@@ -2048,7 +2255,7 @@ declare interface EnvironmentNonInheritable {
2048
2255
  * NOTE: This field is not automatically inherited from the top level environment,
2049
2256
  * and so must be specified in every named environment.
2050
2257
  *
2051
- * @default `[]`
2258
+ * @default []
2052
2259
  * @nonInheritable
2053
2260
  */
2054
2261
  tail_consumers?: TailConsumer[];
@@ -2058,7 +2265,7 @@ declare interface EnvironmentNonInheritable {
2058
2265
  * NOTE: This field is not automatically inherited from the top level environment,
2059
2266
  * and so must be specified in every named environment.
2060
2267
  *
2061
- * @default `[]`
2268
+ * @default []
2062
2269
  * @nonInheritable
2063
2270
  */
2064
2271
  dispatch_namespaces: {
@@ -2069,9 +2276,24 @@ declare interface EnvironmentNonInheritable {
2069
2276
  /** Details about the outbound Worker which will handle outbound requests from your namespace */
2070
2277
  outbound?: DispatchNamespaceOutbound;
2071
2278
  }[];
2279
+ /**
2280
+ * Specifies list of Pipelines bound to this Worker environment
2281
+ *
2282
+ * NOTE: This field is not automatically inherited from the top level environment,
2283
+ * and so must be specified in every named environment.
2284
+ *
2285
+ * @default []
2286
+ * @nonInheritable
2287
+ */
2288
+ pipelines: {
2289
+ /** The binding name used to refer to the bound service. */
2290
+ binding: string;
2291
+ /** Name of the Pipeline to bind */
2292
+ pipeline: string;
2293
+ }[];
2072
2294
  }
2073
2295
 
2074
- declare type ErrorEvent = BaseErrorEvent<"ConfigController" | "BundlerController" | "LocalRuntimeController" | "RemoteRuntimeController" | "ProxyWorker" | "InspectorProxyWorker"> | BaseErrorEvent<"ProxyController", {
2296
+ declare type ErrorEvent = BaseErrorEvent<"ConfigController" | "BundlerController" | "LocalRuntimeController" | "RemoteRuntimeController" | "ProxyWorker" | "InspectorProxyWorker" | "MultiworkerRuntimeController"> | BaseErrorEvent<"ProxyController", {
2075
2297
  config?: StartDevWorkerOptions;
2076
2298
  bundle?: Bundle;
2077
2299
  }> | BaseErrorEvent<"BundlerController", {
@@ -2280,10 +2502,18 @@ declare class ExecutionContext {
2280
2502
  passThroughOnException(): void;
2281
2503
  }
2282
2504
 
2283
- declare function fetch (
2505
+ export declare const experimental_patchConfig: (configPath: string, patch: Unstable_RawConfig, isArrayInsertion?: boolean) => string;
2506
+
2507
+ export declare const experimental_readRawConfig: (args: ReadConfigCommandArgs, options?: ReadConfigOptions) => {
2508
+ rawConfig: Unstable_RawConfig;
2509
+ configPath: string | undefined;
2510
+ userConfigPath: string | undefined;
2511
+ };
2512
+
2513
+ declare function fetch_2 (
2284
2514
  input: RequestInfo,
2285
- init?: RequestInit
2286
- ): Promise<Response>
2515
+ init?: RequestInit_2
2516
+ ): Promise<Response_2>
2287
2517
 
2288
2518
  declare class File extends Blob_2 {
2289
2519
  /**
@@ -2346,7 +2576,7 @@ declare class FileReader {
2346
2576
 
2347
2577
  readonly result: string | ArrayBuffer | null
2348
2578
 
2349
- readonly error: DOMException | null
2579
+ readonly error: DOMException_2 | null
2350
2580
 
2351
2581
  onloadstart: null | ((this: FileReader, event: ProgressEvent) => void)
2352
2582
  onprogress: null | ((this: FileReader, event: ProgressEvent) => void)
@@ -2359,7 +2589,7 @@ declare class FileReader {
2359
2589
  /**
2360
2590
  * Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using fetch().
2361
2591
  */
2362
- declare class FormData {
2592
+ declare class FormData_2 {
2363
2593
  /**
2364
2594
  * Appends a new value onto an existing key inside a FormData object,
2365
2595
  * or adds the key if it does not already exist.
@@ -2424,7 +2654,7 @@ declare class FormData {
2424
2654
  * Executes given callback function for each field of the FormData instance
2425
2655
  */
2426
2656
  forEach: (
2427
- callbackfn: (value: FormDataEntryValue, key: string, iterable: FormData) => void,
2657
+ callbackfn: (value: FormDataEntryValue, key: string, iterable: FormData_2) => void,
2428
2658
  thisArg?: unknown
2429
2659
  ) => void
2430
2660
 
@@ -2460,7 +2690,7 @@ declare class FormData {
2460
2690
  declare type FormDataEntryValue = string | File
2461
2691
 
2462
2692
  /**
2463
- * By reading from a `wrangler.toml` file this function generates proxy binding objects that can be
2693
+ * By reading from a Wrangler configuration file this function generates proxy binding objects that can be
2464
2694
  * used to simulate the interaction with bindings during local development in a Node.js environment
2465
2695
  *
2466
2696
  * @deprecated use `getPlatformProxy` instead
@@ -2473,14 +2703,14 @@ export declare function getBindingsProxy<Bindings = Record<string, unknown>, CfP
2473
2703
  /** Options for the `getBindingsProxy` utility */
2474
2704
  export declare type GetBindingsProxyOptions = GetPlatformProxyOptions;
2475
2705
 
2476
- declare function getCookies (headers: Headers): Record<string, string>
2706
+ declare function getCookies (headers: Headers_2): Record<string, string>
2477
2707
 
2478
2708
  declare function getGlobalDispatcher(): Dispatcher;
2479
2709
 
2480
2710
  declare function getGlobalOrigin(): URL | undefined;
2481
2711
 
2482
2712
  /**
2483
- * By reading from a `wrangler.toml` file this function generates proxy objects that can be
2713
+ * By reading from a Wrangler configuration file this function generates proxy objects that can be
2484
2714
  * used to simulate the interaction with the Cloudflare platform during local development
2485
2715
  * in a Node.js environment
2486
2716
  *
@@ -2500,19 +2730,12 @@ export declare type GetPlatformProxyOptions = {
2500
2730
  /**
2501
2731
  * The path to the config file to use.
2502
2732
  * If no path is specified the default behavior is to search from the
2503
- * current directory up the filesystem for a `wrangler.toml` to use.
2733
+ * current directory up the filesystem for a Wrangler configuration file to use.
2504
2734
  *
2505
2735
  * Note: this field is optional but if a path is specified it must
2506
2736
  * point to a valid file on the filesystem
2507
2737
  */
2508
2738
  configPath?: string;
2509
- /**
2510
- * Flag to indicate the utility to read a json config file (`wrangler.json`)
2511
- * instead of the toml one (`wrangler.toml`)
2512
- *
2513
- * Note: this feature is experimental
2514
- */
2515
- experimentalJsonConfig?: boolean;
2516
2739
  /**
2517
2740
  * Indicates if and where to persist the bindings data, if not present or `true` it defaults to the same location
2518
2741
  * used by wrangler v3: `.wrangler/state/v3` (so that the same data can be easily used by the caller and wrangler).
@@ -2521,17 +2744,11 @@ export declare type GetPlatformProxyOptions = {
2521
2744
  persist?: boolean | {
2522
2745
  path: string;
2523
2746
  };
2524
- /**
2525
- * Use the experimental file-based dev registry for service discovery
2526
- *
2527
- * Note: this feature is experimental
2528
- */
2529
- experimentalRegistry?: boolean;
2530
2747
  };
2531
2748
 
2532
- declare function getSetCookies (headers: Headers): Cookie[]
2749
+ declare function getSetCookies (headers: Headers_2): Cookie[]
2533
2750
 
2534
- declare class Headers implements SpecIterable<[string, string]> {
2751
+ declare class Headers_2 implements SpecIterable<[string, string]> {
2535
2752
  constructor (init?: HeadersInit)
2536
2753
  readonly append: (name: string, value: string) => void
2537
2754
  readonly delete: (name: string) => void
@@ -2540,7 +2757,7 @@ declare class Headers implements SpecIterable<[string, string]> {
2540
2757
  readonly set: (name: string, value: string) => void
2541
2758
  readonly getSetCookie: () => string[]
2542
2759
  readonly forEach: (
2543
- callbackfn: (value: string, key: string, iterable: Headers) => void,
2760
+ callbackfn: (value: string, key: string, iterable: Headers_2) => void,
2544
2761
  thisArg?: unknown
2545
2762
  ) => void
2546
2763
 
@@ -2550,23 +2767,21 @@ declare class Headers implements SpecIterable<[string, string]> {
2550
2767
  readonly [Symbol.iterator]: () => SpecIterator<[string, string]>
2551
2768
  }
2552
2769
 
2553
- declare type HeadersInit = string[][] | Record<string, string | ReadonlyArray<string>> | Headers
2770
+ declare type HeadersInit = string[][] | Record<string, string | ReadonlyArray<string>> | Headers_2
2554
2771
 
2555
2772
  declare type Hook<T extends HookValues, Args extends unknown[] = []> = T | ((...args: Args) => T);
2556
2773
 
2557
2774
  declare type HookValues = string | number | boolean | object | undefined | null;
2558
2775
 
2559
2776
  /**
2560
- * @property terminate Terminates HTTP server.
2777
+ * The header type declaration of `undici`.
2561
2778
  */
2562
- declare type HttpTerminator = {
2563
- readonly terminate: () => Promise<void>;
2564
- };
2779
+ declare type IncomingHttpHeaders = Record<string, string | string[] | undefined>;
2565
2780
 
2566
2781
  /**
2567
- * The header type declaration of `undici`.
2782
+ * A symbol to inherit a binding from the deployed worker.
2568
2783
  */
2569
- declare type IncomingHttpHeaders = Record<string, string | string[] | undefined>;
2784
+ declare const INHERIT_SYMBOL: unique symbol;
2570
2785
 
2571
2786
  declare type InspectorProxyWorkerIncomingWebSocketMessage = {
2572
2787
  type: ReloadStartEvent["type"];
@@ -2597,8 +2812,11 @@ declare interface Interceptable extends Dispatcher {
2597
2812
  }
2598
2813
 
2599
2814
  declare class Logger {
2815
+ #private;
2600
2816
  constructor();
2601
- loggerLevel: "error" | "none" | "warn" | "info" | "log" | "debug";
2817
+ private overrideLoggerLevel?;
2818
+ get loggerLevel(): "log" | "error" | "none" | "debug" | "info" | "warn";
2819
+ set loggerLevel(val: "log" | "error" | "none" | "debug" | "info" | "warn");
2602
2820
  columns: number;
2603
2821
  debug: (...args: unknown[]) => void;
2604
2822
  debugWithSanitization: (label: string, ...args: unknown[]) => void;
@@ -2607,15 +2825,37 @@ declare class Logger {
2607
2825
  warn: (...args: unknown[]) => void;
2608
2826
  error: (...args: unknown[]) => void;
2609
2827
  table<Keys extends string>(data: TableRow<Keys>[]): void;
2828
+ console<M extends Exclude<keyof Console, "Console">>(method: M, ...args: Parameters<Console[M]>): void;
2829
+ static onceHistory: Set<unknown>;
2830
+ get once(): {
2831
+ info: (...args: unknown[]) => void;
2832
+ log: (...args: unknown[]) => void;
2833
+ warn: (...args: unknown[]) => void;
2834
+ error: (...args: unknown[]) => void;
2835
+ };
2836
+ doLogOnce(messageLevel: Exclude<LoggerLevel, "none">, args: unknown[]): void;
2610
2837
  private doLog;
2838
+ static registerBeforeLogHook(callback: (() => void) | undefined): void;
2839
+ static registerAfterLogHook(callback: (() => void) | undefined): void;
2611
2840
  private formatMessage;
2612
2841
  }
2613
2842
 
2843
+ declare const LOGGER_LEVELS: {
2844
+ readonly none: -1;
2845
+ readonly error: 0;
2846
+ readonly warn: 1;
2847
+ readonly info: 2;
2848
+ readonly log: 3;
2849
+ readonly debug: 4;
2850
+ };
2851
+
2852
+ declare type LoggerLevel = keyof typeof LOGGER_LEVELS;
2853
+
2614
2854
  declare type LogLevel = "debug" | "info" | "log" | "warn" | "error" | "none";
2615
2855
 
2616
2856
  declare type MaybePromise<T> = T | Promise<T>;
2617
2857
 
2618
- declare interface MessageEvent<T = any> extends Event_2 {
2858
+ declare interface MessageEvent_2<T = any> extends Event_2 {
2619
2859
  readonly data: T
2620
2860
  readonly lastEventId: string
2621
2861
  readonly origin: string
@@ -2633,9 +2873,9 @@ declare interface MessageEvent<T = any> extends Event_2 {
2633
2873
  ): void;
2634
2874
  }
2635
2875
 
2636
- declare const MessageEvent: {
2637
- prototype: MessageEvent
2638
- new<T>(type: string, eventInitDict?: MessageEventInit<T>): MessageEvent<T>
2876
+ declare const MessageEvent_2: {
2877
+ prototype: MessageEvent_2
2878
+ new<T>(type: string, eventInitDict?: MessageEventInit<T>): MessageEvent_2<T>
2639
2879
  };
2640
2880
 
2641
2881
  declare interface MessageEventInit<T = any> extends EventInit {
@@ -2774,7 +3014,7 @@ declare namespace MockInterceptor {
2774
3014
  origin: string;
2775
3015
  method: string;
2776
3016
  body?: BodyInit | Dispatcher.DispatchOptions['body'];
2777
- headers: Headers | Record<string, string>;
3017
+ headers: Headers_2 | Record<string, string>;
2778
3018
  maxRedirections: number;
2779
3019
  }
2780
3020
 
@@ -2821,31 +3061,38 @@ declare interface MultiCacheQueryOptions extends CacheQueryOptions {
2821
3061
  cacheName?: string
2822
3062
  }
2823
3063
 
2824
- /**
2825
- * Wrangler can provide Node.js compatibility in a number of different modes:
2826
- * - "legacy" - this mode adds compile-time polyfills that are not well maintained and cannot work with workerd runtime builtins.
2827
- * - "v1" - this mode tells the workerd runtime to enable some Node.js builtin libraries (accessible only via `node:...` imports) but no globals.
2828
- * - "v2" - this mode tells the workerd runtime to enable more Node.js builtin libraries (accessible both with and without the `node:` prefix)
2829
- * and also some Node.js globals such as `Buffer`; it also turns on additional compile-time polyfills for those that are not provided by the runtime.
2830
- */
2831
- declare type NodeJSCompatMode = "legacy" | "v1" | "v2" | null;
3064
+ declare type NameOmit<T> = Omit<T, "name">;
2832
3065
 
2833
- declare interface PagesConfigFields {
2834
- /**
2835
- * The directory of static assets to serve.
2836
- *
2837
- * The presence of this field in `wrangler.toml` indicates a Pages project,
2838
- * and will prompt the handling of the configuration file according to the
2839
- * Pages-specific validation rules.
2840
- */
2841
- pages_build_output_dir?: string;
3066
+ declare type NormalizeAndValidateConfigArgs = {
3067
+ name?: string;
3068
+ env?: string;
3069
+ "legacy-env"?: boolean;
3070
+ "dispatch-namespace"?: string;
3071
+ remote?: boolean;
3072
+ localProtocol?: string;
3073
+ upstreamProtocol?: string;
3074
+ script?: string;
3075
+ };
3076
+
3077
+ declare interface Observability {
3078
+ /** If observability is enabled for this Worker */
3079
+ enabled?: boolean;
3080
+ /** The sampling rate */
3081
+ head_sampling_rate?: number;
3082
+ logs?: {
3083
+ enabled?: boolean;
3084
+ /** The sampling rate */
3085
+ head_sampling_rate?: number;
3086
+ /** Set to false to disable invocation logs */
3087
+ invocation_logs?: boolean;
3088
+ };
2842
3089
  }
2843
3090
 
2844
3091
  declare interface PagesConfigFields {
2845
3092
  /**
2846
3093
  * The directory of static assets to serve.
2847
3094
  *
2848
- * The presence of this field in `wrangler.toml` indicates a Pages project,
3095
+ * The presence of this field in a Wrangler configuration file indicates a Pages project,
2849
3096
  * and will prompt the handling of the configuration file according to the
2850
3097
  * Pages-specific validation rules.
2851
3098
  */
@@ -25421,7 +25668,7 @@ declare class ProxyController extends Controller<ProxyControllerEventMap> {
25421
25668
  onReloadComplete(data: ReloadCompleteEvent): void;
25422
25669
  onProxyWorkerMessage(message: ProxyWorkerOutgoingRequestBody): void;
25423
25670
  onInspectorProxyWorkerMessage(message: InspectorProxyWorkerOutgoingWebsocketMessage): void;
25424
- onInspectorProxyWorkerRequest(message: InspectorProxyWorkerOutgoingRequestBody): Promise<Response_2>;
25671
+ onInspectorProxyWorkerRequest(message: InspectorProxyWorkerOutgoingRequestBody): Promise<Response_3>;
25425
25672
  _torndown: boolean;
25426
25673
  teardown(): Promise<void>;
25427
25674
  emitReadyEvent(proxyWorker: Miniflare, url: URL, inspectorUrl: URL): void;
@@ -25464,10 +25711,19 @@ declare type ProxyWorkerOutgoingRequestBody = {
25464
25711
  args: Parameters<typeof console.debug>;
25465
25712
  };
25466
25713
 
25467
- declare type QueueConsumer = NonNullable<Config["queues"]["consumers"]>[number];
25714
+ declare type QueueConsumer = NonNullable<Unstable_Config["queues"]["consumers"]>[number];
25468
25715
 
25469
25716
  declare type RawDevConfig = Partial<DevConfig>;
25470
25717
 
25718
+ declare type ReadConfigCommandArgs = NormalizeAndValidateConfigArgs & {
25719
+ config?: string;
25720
+ script?: string;
25721
+ };
25722
+
25723
+ declare type ReadConfigOptions = ResolveConfigPathOptions & {
25724
+ hideWarnings?: boolean;
25725
+ };
25726
+
25471
25727
  declare type ReadyEvent = {
25472
25728
  type: "ready";
25473
25729
  proxyWorker: Miniflare;
@@ -25505,13 +25761,19 @@ declare type ReloadStartEvent = {
25505
25761
  bundle: Bundle;
25506
25762
  };
25507
25763
 
25508
- declare class Request implements BodyMixin {
25509
- constructor (input: RequestInfo, init?: RequestInit)
25764
+ /** Performs an HTTP request. */
25765
+ declare function request(
25766
+ url: string | URL_2 | UrlObject,
25767
+ options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions, 'origin' | 'path' | 'method'> & Partial<Pick<Dispatcher.RequestOptions, 'method'>>,
25768
+ ): Promise<Dispatcher.ResponseData>;
25769
+
25770
+ declare class Request_2 implements BodyMixin {
25771
+ constructor (input: RequestInfo, init?: RequestInit_2)
25510
25772
 
25511
25773
  readonly cache: RequestCache
25512
25774
  readonly credentials: RequestCredentials
25513
25775
  readonly destination: RequestDestination
25514
- readonly headers: Headers
25776
+ readonly headers: Headers_2
25515
25777
  readonly integrity: string
25516
25778
  readonly method: string
25517
25779
  readonly mode: RequestMode
@@ -25523,24 +25785,18 @@ declare class Request implements BodyMixin {
25523
25785
  readonly signal: AbortSignal
25524
25786
  readonly duplex: RequestDuplex
25525
25787
 
25526
- readonly body: ReadableStream | null
25788
+ readonly body: ReadableStream_2 | null
25527
25789
  readonly bodyUsed: boolean
25528
25790
 
25529
25791
  readonly arrayBuffer: () => Promise<ArrayBuffer>
25530
25792
  readonly blob: () => Promise<Blob_2>
25531
- readonly formData: () => Promise<FormData>
25793
+ readonly formData: () => Promise<FormData_2>
25532
25794
  readonly json: () => Promise<unknown>
25533
25795
  readonly text: () => Promise<string>
25534
25796
 
25535
- readonly clone: () => Request
25797
+ readonly clone: () => Request_2
25536
25798
  }
25537
25799
 
25538
- /** Performs an HTTP request. */
25539
- declare function request(
25540
- url: string | URL_2 | UrlObject,
25541
- options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions, 'origin' | 'path' | 'method'> & Partial<Pick<Dispatcher.RequestOptions, 'method'>>,
25542
- ): Promise<Dispatcher.ResponseData>;
25543
-
25544
25800
  declare type RequestCache =
25545
25801
  | 'default'
25546
25802
  | 'force-cache'
@@ -25573,9 +25829,9 @@ declare type RequestDestination =
25573
25829
 
25574
25830
  declare type RequestDuplex = 'half'
25575
25831
 
25576
- declare type RequestInfo = string | URL_2 | Request
25832
+ declare type RequestInfo = string | URL_2 | Request_2
25577
25833
 
25578
- declare interface RequestInit {
25834
+ declare interface RequestInit_2 {
25579
25835
  method?: string
25580
25836
  keepalive?: boolean
25581
25837
  headers?: HeadersInit
@@ -25596,10 +25852,14 @@ declare type RequestMode = 'cors' | 'navigate' | 'no-cors' | 'same-origin'
25596
25852
 
25597
25853
  declare type RequestRedirect = 'error' | 'follow' | 'manual'
25598
25854
 
25599
- declare class Response implements BodyMixin {
25600
- constructor (body?: BodyInit, init?: ResponseInit)
25855
+ declare type ResolveConfigPathOptions = {
25856
+ useRedirectIfAvailable?: boolean;
25857
+ };
25858
+
25859
+ declare class Response_2 implements BodyMixin {
25860
+ constructor (body?: BodyInit, init?: ResponseInit_2)
25601
25861
 
25602
- readonly headers: Headers
25862
+ readonly headers: Headers_2
25603
25863
  readonly ok: boolean
25604
25864
  readonly status: number
25605
25865
  readonly statusText: string
@@ -25607,23 +25867,23 @@ declare class Response implements BodyMixin {
25607
25867
  readonly url: string
25608
25868
  readonly redirected: boolean
25609
25869
 
25610
- readonly body: ReadableStream | null
25870
+ readonly body: ReadableStream_2 | null
25611
25871
  readonly bodyUsed: boolean
25612
25872
 
25613
25873
  readonly arrayBuffer: () => Promise<ArrayBuffer>
25614
25874
  readonly blob: () => Promise<Blob_2>
25615
- readonly formData: () => Promise<FormData>
25875
+ readonly formData: () => Promise<FormData_2>
25616
25876
  readonly json: () => Promise<unknown>
25617
25877
  readonly text: () => Promise<string>
25618
25878
 
25619
- readonly clone: () => Response
25879
+ readonly clone: () => Response_2
25620
25880
 
25621
- static error (): Response
25622
- static json(data: any, init?: ResponseInit): Response
25623
- static redirect (url: string | URL_2, status: ResponseRedirectStatus): Response
25881
+ static error (): Response_2
25882
+ static json(data: any, init?: ResponseInit_2): Response_2
25883
+ static redirect (url: string | URL_2, status: ResponseRedirectStatus): Response_2
25624
25884
  }
25625
25885
 
25626
- declare interface ResponseInit {
25886
+ declare interface ResponseInit_2 {
25627
25887
  readonly status?: number
25628
25888
  readonly statusText?: string
25629
25889
  readonly headers?: HeadersInit
@@ -25754,6 +26014,25 @@ declare namespace RetryHandler {
25754
26014
 
25755
26015
  declare type Route = SimpleRoute | ZoneIdRoute | ZoneNameRoute | CustomDomainRoute;
25756
26016
 
26017
+ declare type RoutingConfig = z.infer<typeof RoutingConfigSchema>;
26018
+
26019
+ declare const RoutingConfigSchema: z.ZodObject<{
26020
+ has_user_worker: z.ZodOptional<z.ZodBoolean>;
26021
+ invoke_user_worker_ahead_of_assets: z.ZodOptional<z.ZodBoolean>;
26022
+ account_id: z.ZodOptional<z.ZodNumber>;
26023
+ script_id: z.ZodOptional<z.ZodNumber>;
26024
+ }, "strip", z.ZodTypeAny, {
26025
+ has_user_worker?: boolean;
26026
+ invoke_user_worker_ahead_of_assets?: boolean;
26027
+ account_id?: number;
26028
+ script_id?: number;
26029
+ }, {
26030
+ has_user_worker?: boolean;
26031
+ invoke_user_worker_ahead_of_assets?: boolean;
26032
+ account_id?: number;
26033
+ script_id?: number;
26034
+ }>;
26035
+
25757
26036
  /**
25758
26037
  * A bundling resolver rule, defining the modules type for paths that match the specified globs.
25759
26038
  */
@@ -25790,9 +26069,9 @@ declare type SerializedError = {
25790
26069
  cause?: unknown;
25791
26070
  };
25792
26071
 
25793
- declare type ServiceFetch = (request: Request_2) => Promise<Response_2> | Response_2;
26072
+ declare type ServiceFetch = (request: Request_3) => Promise<Response_3> | Response_3;
25794
26073
 
25795
- declare function setCookie (headers: Headers, cookie: Cookie): void
26074
+ declare function setCookie (headers: Headers_2, cookie: Cookie): void
25796
26075
 
25797
26076
  declare function setGlobalDispatcher<DispatcherImplementation extends Dispatcher>(dispatcher: DispatcherImplementation): void;
25798
26077
 
@@ -25830,7 +26109,7 @@ declare interface StartDevWorkerInput {
25830
26109
  name?: string;
25831
26110
  /**
25832
26111
  * The javascript or typescript entry-point of the worker.
25833
- * This is the `main` property of a wrangler.toml.
26112
+ * This is the `main` property of a Wrangler configuration file.
25834
26113
  * You can specify a file path or provide the contents directly.
25835
26114
  */
25836
26115
  entrypoint?: string;
@@ -25843,6 +26122,7 @@ declare interface StartDevWorkerInput {
25843
26122
  env?: string;
25844
26123
  /** The bindings available to the worker. The specified bindind type will be exposed to the worker on the `env` object under the same key. */
25845
26124
  bindings?: Record<string, Binding>;
26125
+ migrations?: DurableObjectMigration[];
25846
26126
  /** The triggers which will cause the worker's exported default handlers to be called. */
25847
26127
  triggers?: Trigger[];
25848
26128
  /**
@@ -25879,7 +26159,7 @@ declare interface StartDevWorkerInput {
25879
26159
  jsxFactory?: string;
25880
26160
  jsxFragment?: string;
25881
26161
  tsconfig?: string;
25882
- nodejsCompatMode?: Hook<NodeJSCompatMode, [Config]>;
26162
+ nodejsCompatMode?: Hook<NodeJSCompatMode, [Unstable_Config]>;
25883
26163
  moduleRoot?: string;
25884
26164
  };
25885
26165
  /** Options applying to the worker's development preview environment. */
@@ -25893,7 +26173,7 @@ declare interface StartDevWorkerInput {
25893
26173
  /** Whether the worker runs on the edge or locally. */
25894
26174
  remote?: boolean;
25895
26175
  /** Cloudflare Account credentials. Can be provided upfront or as a function which will be called only when required. */
25896
- auth?: AsyncHook<CfAccount>;
26176
+ auth?: AsyncHook<CfAccount, [Pick<Unstable_Config, "account_id">]>;
25897
26177
  /** Whether local storage (KV, Durable Objects, R2, D1, etc) is persisted. You can also specify the directory to persist data to. */
25898
26178
  persist?: string;
25899
26179
  /** Controls which logs are logged 🤙. */
@@ -25920,20 +26200,27 @@ declare interface StartDevWorkerInput {
25920
26200
  /** An undici MockAgent to declaratively mock fetch calls to particular resources. */
25921
26201
  mockFetch?: undici.MockAgent;
25922
26202
  /** Describes the registry of other Workers running locally */
25923
- registry?: WorkerRegistry;
26203
+ registry?: WorkerRegistry | null;
25924
26204
  testScheduled?: boolean;
26205
+ /** Whether to use Vectorize mixed mode -- the worker is run locally but accesses to Vectorize are made remotely */
26206
+ bindVectorizeToProd?: boolean;
26207
+ /** Whether to use Images local mode -- this is lower fidelity, but doesn't require network access */
26208
+ imagesLocalMode?: boolean;
26209
+ /** Treat this as the primary worker in a multiworker setup (i.e. the first Worker in Miniflare's options) */
26210
+ multiworkerPrimary?: boolean;
25925
26211
  };
25926
26212
  legacy?: {
25927
- site?: Hook<Config["site"], [Config]>;
25928
- assets?: Hook<Config["assets"], [Config]>;
26213
+ site?: Hook<Unstable_Config["site"], [Unstable_Config]>;
26214
+ legacyAssets?: Hook<Unstable_Config["legacy_assets"], [Unstable_Config]>;
25929
26215
  enableServiceEnvironments?: boolean;
25930
26216
  };
25931
26217
  unsafe?: Omit<CfUnsafe, "bindings">;
26218
+ assets?: string;
25932
26219
  }
25933
26220
 
25934
- declare type StartDevWorkerOptions = StartDevWorkerInput & {
25935
- /** A worker's directory. Usually where the wrangler.toml file is located */
25936
- directory: string;
26221
+ declare type StartDevWorkerOptions = Omit<StartDevWorkerInput, "assets"> & {
26222
+ /** A worker's directory. Usually where the Wrangler configuration file is located */
26223
+ projectRoot: string;
25937
26224
  build: StartDevWorkerInput["build"] & {
25938
26225
  nodejsCompatMode: NodeJSCompatMode;
25939
26226
  format: CfScriptFormat;
@@ -25941,16 +26228,20 @@ declare type StartDevWorkerOptions = StartDevWorkerInput & {
25941
26228
  moduleRules: Rule[];
25942
26229
  define: Record<string, string>;
25943
26230
  additionalModules: CfModule[];
26231
+ exports: string[];
25944
26232
  processEntrypoint: boolean;
25945
26233
  };
25946
26234
  legacy: StartDevWorkerInput["legacy"] & {
25947
- assets?: Config["assets"];
25948
- site?: Config["site"];
26235
+ legacyAssets?: Unstable_Config["legacy_assets"];
26236
+ site?: Unstable_Config["site"];
25949
26237
  };
25950
26238
  dev: StartDevWorkerInput["dev"] & {
25951
26239
  persist: string;
26240
+ auth?: AsyncHook<CfAccount>;
25952
26241
  };
25953
26242
  entrypoint: string;
26243
+ assets?: AssetsOptions;
26244
+ name: string;
25954
26245
  };
25955
26246
 
25956
26247
  /** A faster version of `request`. */
@@ -26029,11 +26320,11 @@ declare namespace Undici {
26029
26320
  var MockPool: MockPool;
26030
26321
  var MockAgent: MockAgent;
26031
26322
  var mockErrors: MockErrors;
26032
- var fetch: fetch;
26033
- var Headers: Headers;
26034
- var Response: Response;
26035
- var Request: Request;
26036
- var FormData: FormData;
26323
+ var fetch: fetch_2;
26324
+ var Headers: Headers_2;
26325
+ var Response: Response_2;
26326
+ var Request: Request_2;
26327
+ var FormData: FormData_2;
26037
26328
  var File: File;
26038
26329
  var FileReader: FileReader;
26039
26330
  var caches: caches;
@@ -26072,7 +26363,7 @@ declare namespace undici {
26072
26363
  getSetCookies,
26073
26364
  setCookie,
26074
26365
  Cookie,
26075
- fetch,
26366
+ fetch_2 as fetch,
26076
26367
  RequestInfo,
26077
26368
  BodyInit,
26078
26369
  BodyMixin,
@@ -26080,20 +26371,20 @@ declare namespace undici {
26080
26371
  SpecIterableIterator,
26081
26372
  SpecIterable,
26082
26373
  HeadersInit,
26083
- Headers,
26374
+ Headers_2 as Headers,
26084
26375
  RequestCache,
26085
26376
  RequestCredentials,
26086
26377
  RequestDestination,
26087
- RequestInit,
26378
+ RequestInit_2 as RequestInit,
26088
26379
  ReferrerPolicy,
26089
26380
  RequestMode,
26090
26381
  RequestRedirect,
26091
26382
  RequestDuplex,
26092
- Request,
26093
- ResponseInit,
26383
+ Request_2 as Request,
26384
+ ResponseInit_2 as ResponseInit,
26094
26385
  ResponseType,
26095
26386
  ResponseRedirectStatus,
26096
- Response,
26387
+ Response_2 as Response,
26097
26388
  BlobPropertyBag,
26098
26389
  FilePropertyBag,
26099
26390
  File,
@@ -26101,7 +26392,7 @@ declare namespace undici {
26101
26392
  ProgressEventInit,
26102
26393
  ProgressEvent,
26103
26394
  FormDataEntryValue,
26104
- FormData,
26395
+ FormData_2 as FormData,
26105
26396
  DiagnosticsChannel,
26106
26397
  BinaryType,
26107
26398
  WebSocketEventMap,
@@ -26109,7 +26400,7 @@ declare namespace undici {
26109
26400
  CloseEventInit,
26110
26401
  CloseEvent,
26111
26402
  MessageEventInit,
26112
- MessageEvent,
26403
+ MessageEvent_2 as MessageEvent,
26113
26404
  WebSocketInit,
26114
26405
  parseMIMEType,
26115
26406
  serializeAMimeType,
@@ -26122,10 +26413,39 @@ declare namespace undici {
26122
26413
  }
26123
26414
  }
26124
26415
 
26416
+ export declare interface Unstable_ASSETSBindingsOptions {
26417
+ log: Logger;
26418
+ proxyPort?: number;
26419
+ directory?: string;
26420
+ }
26421
+
26422
+ /**
26423
+ * This is the static type definition for the configuration object.
26424
+ *
26425
+ * It reflects a normalized and validated version of the configuration that you can write in a Wrangler configuration file,
26426
+ * and optionally augment with arguments passed directly to wrangler.
26427
+ *
26428
+ * For more information about the configuration object, see the
26429
+ * documentation at https://developers.cloudflare.com/workers/cli-wrangler/configuration
26430
+ *
26431
+ * Notes:
26432
+ *
26433
+ * - Fields that are only specified in `ConfigFields` and not `Environment` can only appear
26434
+ * in the top level config and should not appear in any environments.
26435
+ * - Fields that are specified in `PagesConfigFields` are only relevant for Pages projects
26436
+ * - All top level fields in config and environments are optional in the Wrangler configuration file.
26437
+ *
26438
+ * Legend for the annotations:
26439
+ *
26440
+ * - `@breaking`: the deprecation/optionality is a breaking change from Wrangler v1.
26441
+ * - `@todo`: there's more work to be done (with details attached).
26442
+ */
26443
+ export declare type Unstable_Config = ComputedFields & ConfigFields<DevConfig> & PagesConfigFields & Environment;
26444
+
26125
26445
  /**
26126
26446
  * unstable_dev starts a wrangler dev server, and returns a promise that resolves with utility functions to interact with it.
26127
26447
  */
26128
- export declare function unstable_dev(script: string, options?: UnstableDevOptions, apiOptions?: unknown): Promise<UnstableDevWorker>;
26448
+ export declare function unstable_dev(script: string, options?: Unstable_DevOptions, apiOptions?: unknown): Promise<Unstable_DevWorker>;
26129
26449
 
26130
26450
  export declare class unstable_DevEnv extends EventEmitter_2 {
26131
26451
  config: ConfigController;
@@ -26143,37 +26463,7 @@ export declare class unstable_DevEnv extends EventEmitter_2 {
26143
26463
  emitErrorEvent(ev: ErrorEvent): void;
26144
26464
  }
26145
26465
 
26146
- export declare const unstable_generateASSETSBinding: (opts: UnstableASSETSBindingsOptions) => (request: Request_2) => Promise<Response_2>;
26147
-
26148
- export declare function unstable_getMiniflareWorkerOptions(configPath: string, env?: string): {
26149
- workerOptions: SourcelessWorkerOptions;
26150
- define: Record<string, string>;
26151
- main?: string;
26152
- };
26153
-
26154
- export declare const unstable_pages: {
26155
- deploy: typeof deploy;
26156
- };
26157
-
26158
- /**
26159
- * Split an SQLQuery into an array of statements
26160
- */
26161
- export declare function unstable_splitSqlQuery(sql: string): string[];
26162
-
26163
- export declare function unstable_startWorker(options: StartDevWorkerInput): Promise<Worker>;
26164
-
26165
- export declare function unstable_startWorkerRegistryServer(port: number): Promise<{
26166
- server: Server<IncomingMessage, ServerResponse>;
26167
- terminator: HttpTerminator;
26168
- }>;
26169
-
26170
- export declare interface UnstableASSETSBindingsOptions {
26171
- log: Logger;
26172
- proxyPort?: number;
26173
- directory?: string;
26174
- }
26175
-
26176
- export declare interface UnstableDevOptions {
26466
+ export declare interface Unstable_DevOptions {
26177
26467
  config?: string;
26178
26468
  env?: string;
26179
26469
  ip?: string;
@@ -26184,6 +26474,7 @@ export declare interface UnstableDevOptions {
26184
26474
  httpsKeyPath?: string;
26185
26475
  httpsCertPath?: string;
26186
26476
  assets?: string;
26477
+ legacyAssets?: string;
26187
26478
  site?: string;
26188
26479
  siteInclude?: string[];
26189
26480
  siteExclude?: string[];
@@ -26195,7 +26486,7 @@ export declare interface UnstableDevOptions {
26195
26486
  vars?: Record<string, string | Json>;
26196
26487
  kv?: {
26197
26488
  binding: string;
26198
- id: string;
26489
+ id?: string;
26199
26490
  preview_id?: string;
26200
26491
  }[];
26201
26492
  durableObjects?: {
@@ -26212,7 +26503,7 @@ export declare interface UnstableDevOptions {
26212
26503
  }[];
26213
26504
  r2?: {
26214
26505
  binding: string;
26215
- bucket_name: string;
26506
+ bucket_name?: string;
26216
26507
  preview_bucket_name?: string;
26217
26508
  }[];
26218
26509
  ai?: {
@@ -26242,18 +26533,60 @@ export declare interface UnstableDevOptions {
26242
26533
  watch?: boolean;
26243
26534
  devEnv?: boolean;
26244
26535
  fileBasedRegistry?: boolean;
26536
+ vectorizeBindToProd?: boolean;
26537
+ imagesLocalMode?: boolean;
26538
+ enableIpc?: boolean;
26245
26539
  };
26246
26540
  }
26247
26541
 
26248
- export declare interface UnstableDevWorker {
26542
+ export declare interface Unstable_DevWorker {
26249
26543
  port: number;
26250
26544
  address: string;
26251
- proxyData: ProxyData;
26252
26545
  stop: () => Promise<void>;
26253
- fetch: (input?: RequestInfo, init?: RequestInit) => Promise<Response>;
26546
+ fetch: (input?: RequestInfo, init?: RequestInit_2) => Promise<Response_2>;
26254
26547
  waitUntilExit: () => Promise<void>;
26255
26548
  }
26256
26549
 
26550
+ export declare const unstable_generateASSETSBinding: (opts: Unstable_ASSETSBindingsOptions) => (request: Request_3) => Promise<Response_3>;
26551
+
26552
+ export declare function unstable_getMiniflareWorkerOptions(configPath: string, env?: string): Unstable_MiniflareWorkerOptions;
26553
+
26554
+ export declare function unstable_getMiniflareWorkerOptions(config: Unstable_Config, env?: string): Unstable_MiniflareWorkerOptions;
26555
+
26556
+ export declare interface Unstable_MiniflareWorkerOptions {
26557
+ workerOptions: SourcelessWorkerOptions;
26558
+ define: Record<string, string>;
26559
+ main?: string;
26560
+ }
26561
+
26562
+ export declare const unstable_pages: {
26563
+ deploy: typeof deploy;
26564
+ };
26565
+
26566
+ export declare type Unstable_RawConfig = Partial<ConfigFields<RawDevConfig>> & PagesConfigFields & Unstable_RawEnvironment & DeprecatedConfigFields & EnvironmentMap & {
26567
+ $schema?: string;
26568
+ };
26569
+
26570
+ /**
26571
+ * The raw environment configuration that we read from the config file.
26572
+ *
26573
+ * All the properties are optional, and will be replaced with defaults in the configuration that
26574
+ * is used in the rest of the codebase.
26575
+ */
26576
+ export declare type Unstable_RawEnvironment = Partial<Environment> & EnvironmentDeprecated;
26577
+
26578
+ /**
26579
+ * Get the Wrangler configuration; read it from the give `configPath` if available.
26580
+ */
26581
+ export declare function unstable_readConfig(args: ReadConfigCommandArgs, options?: ReadConfigOptions): Unstable_Config;
26582
+
26583
+ /**
26584
+ * Split an SQLQuery into an array of statements
26585
+ */
26586
+ export declare function unstable_splitSqlQuery(sql: string): string[];
26587
+
26588
+ export declare function unstable_startWorker(options: StartDevWorkerInput): Promise<Worker>;
26589
+
26257
26590
  /** Upgrade to a different protocol. */
26258
26591
  declare function upgrade(
26259
26592
  url: string | URL_2 | UrlObject,
@@ -26326,7 +26659,7 @@ declare const WebSocket: {
26326
26659
  declare interface WebSocketEventMap {
26327
26660
  close: CloseEvent
26328
26661
  error: Event_2
26329
- message: MessageEvent
26662
+ message: MessageEvent_2
26330
26663
  open: Event_2
26331
26664
  }
26332
26665
 
@@ -26371,6 +26704,17 @@ declare type WorkerEntrypointsDefinition = Record<"default" | string, {
26371
26704
 
26372
26705
  declare type WorkerRegistry = Record<string, WorkerDefinition>;
26373
26706
 
26707
+ declare type WorkflowBinding = {
26708
+ /** The name of the binding used to refer to the Workflow */
26709
+ binding: string;
26710
+ /** The name of the Workflow */
26711
+ name: string;
26712
+ /** The exported class name of the Workflow */
26713
+ class_name: string;
26714
+ /** The script where the Workflow is defined (if it's external to this Worker) */
26715
+ script_name?: string;
26716
+ };
26717
+
26374
26718
  declare type ZoneIdRoute = {
26375
26719
  pattern: string;
26376
26720
  zone_id: string;