wrangler 4.45.1 → 4.45.2

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,7 +1,8 @@
1
- import { Json, Request, Response as Response$1, DispatchFetch, NodeJSCompatMode, Miniflare, WorkerRegistry, MiniflareOptions, Mutex, WorkerOptions, ModuleRule, RemoteProxyConnectionString } from 'miniflare';
1
+ import { Rule, CfModule, Environment, Config, CfScriptFormat, CfModuleType, 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, ParseError, 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 } from '@cloudflare/workers-utils';
3
+ import { Json, Request, Response as Response$1, NodeJSCompatMode, DispatchFetch, Miniflare, WorkerRegistry, MiniflareOptions, Mutex, WorkerOptions, ModuleRule, RemoteProxyConnectionString } from 'miniflare';
2
4
  import * as undici from 'undici';
3
5
  import { RequestInfo, RequestInit, Response, FormData } from 'undici';
4
- import { CamelCaseKey, Argv, PositionalOptions, Options, ArgumentsCamelCase, InferredOptionTypes, Alias } from 'yargs';
5
6
  import { RouterConfig, AssetConfig } from '@cloudflare/workers-shared';
6
7
  import { Metafile } from 'esbuild';
7
8
  import { EventEmitter } from 'node:events';
@@ -9,1822 +10,9 @@ import Protocol from 'devtools-protocol/types/protocol-mapping';
9
10
  import { ContainerNormalizedConfig } from '@cloudflare/containers-shared';
10
11
  import { IncomingRequestCfProperties } from '@cloudflare/workers-types/experimental';
11
12
  import { URLSearchParams } from 'node:url';
13
+ import { Argv, PositionalOptions, Options, CamelCaseKey, ArgumentsCamelCase, InferredOptionTypes, Alias } from 'yargs';
12
14
  import Cloudflare from 'cloudflare';
13
15
 
14
- /**
15
- * The `Environment` interface declares all the configuration fields that
16
- * can be specified for an environment.
17
- *
18
- * This could be the top-level default environment, or a specific named environment.
19
- */
20
- interface Environment extends EnvironmentInheritable, EnvironmentNonInheritable {
21
- }
22
- type SimpleRoute = string;
23
- type ZoneIdRoute = {
24
- pattern: string;
25
- zone_id: string;
26
- custom_domain?: boolean;
27
- };
28
- type ZoneNameRoute = {
29
- pattern: string;
30
- zone_name: string;
31
- custom_domain?: boolean;
32
- };
33
- type CustomDomainRoute = {
34
- pattern: string;
35
- custom_domain: boolean;
36
- };
37
- type Route = SimpleRoute | ZoneIdRoute | ZoneNameRoute | CustomDomainRoute;
38
- /**
39
- * Configuration in wrangler for Cloudchamber
40
- */
41
- type CloudchamberConfig = {
42
- image?: string;
43
- location?: string;
44
- instance_type?: "dev" | "basic" | "standard" | "lite" | "standard-1" | "standard-2" | "standard-3" | "standard-4";
45
- vcpu?: number;
46
- memory?: string;
47
- ipv4?: boolean;
48
- };
49
- type UnsafeBinding = {
50
- /**
51
- * The name of the binding provided to the Worker
52
- */
53
- name: string;
54
- /**
55
- * The 'type' of the unsafe binding.
56
- */
57
- type: string;
58
- dev?: {
59
- plugin: {
60
- /**
61
- * Package is the bare specifier of the package that exposes plugins to integrate into Miniflare via a named `plugins` export.
62
- * @example "@cloudflare/my-external-miniflare-plugin"
63
- */
64
- package: string;
65
- /**
66
- * Plugin is the name of the plugin exposed by the package.
67
- * @example "MY_UNSAFE_PLUGIN"
68
- */
69
- name: string;
70
- };
71
- /**
72
- * Optional mapping of unsafe bindings names to options provided for the plugin.
73
- */
74
- options?: Record<string, unknown>;
75
- };
76
- [key: string]: unknown;
77
- };
78
- /**
79
- * Configuration for a container application
80
- */
81
- type ContainerApp = {
82
- /**
83
- * Name of the application
84
- * @optional Defaults to `worker_name-class_name` if not specified.
85
- */
86
- name?: string;
87
- /**
88
- * Number of application instances
89
- * @deprecated
90
- * @hidden
91
- */
92
- instances?: number;
93
- /**
94
- * Number of maximum application instances.
95
- * @optional
96
- */
97
- max_instances?: number;
98
- /**
99
- * The path to a Dockerfile, or an image URI for the Cloudflare registry.
100
- */
101
- image: string;
102
- /**
103
- * Build context of the application.
104
- * @optional - defaults to the directory of `image`.
105
- */
106
- image_build_context?: string;
107
- /**
108
- * Image variables available to the image at build-time only.
109
- * For runtime env vars, refer to https://developers.cloudflare.com/containers/examples/env-vars-and-secrets/
110
- * @optional
111
- */
112
- image_vars?: Record<string, string>;
113
- /**
114
- * The class name of the Durable Object the container is connected to.
115
- */
116
- class_name: string;
117
- /**
118
- * The scheduling policy of the application
119
- * @optional
120
- * @default "default"
121
- */
122
- scheduling_policy?: "default" | "moon" | "regional";
123
- /**
124
- * The instance type to be used for the container.
125
- * Select from one of the following named instance types:
126
- * - lite: 1/16 vCPU, 256 MiB memory, and 2 GB disk
127
- * - basic: 1/4 vCPU, 1 GiB memory, and 4 GB disk
128
- * - standard-1: 1/2 vCPU, 4 GiB memory, and 8 GB disk
129
- * - standard-2: 1 vCPU, 6 GiB memory, and 12 GB disk
130
- * - standard-3: 2 vCPU, 8 GiB memory, and 16 GB disk
131
- * - standard-4: 4 vCPU, 12 GiB memory, and 20 GB disk
132
- * - dev: 1/16 vCPU, 256 MiB memory, and 2 GB disk (deprecated, use "lite" instead)
133
- * - standard: 1 vCPU, 4 GiB memory, and 4 GB disk (deprecated, use "standard-1" instead)
134
- *
135
- * Customers on an enterprise plan have the additional option to set custom limits.
136
- *
137
- * @optional
138
- * @default "dev"
139
- */
140
- instance_type?: "dev" | "basic" | "standard" | "lite" | "standard-1" | "standard-2" | "standard-3" | "standard-4" | {
141
- /** @defaults to 0.0625 (1/16 vCPU) */
142
- vcpu?: number;
143
- /** @defaults to 256 MiB */
144
- memory_mib?: number;
145
- /** @defaults to 2 GB */
146
- disk_mb?: number;
147
- };
148
- /**
149
- * @deprecated Use top level `containers` fields instead.
150
- * `configuration.image` should be `image`
151
- * limits should be set via `instance_type`
152
- * @hidden
153
- */
154
- configuration?: {
155
- image?: string;
156
- labels?: {
157
- name: string;
158
- value: string;
159
- }[];
160
- secrets?: {
161
- name: string;
162
- type: "env";
163
- secret: string;
164
- }[];
165
- disk?: {
166
- size_mb: number;
167
- };
168
- vcpu?: number;
169
- memory_mib?: number;
170
- };
171
- /**
172
- * Scheduling constraints
173
- * @hidden
174
- */
175
- constraints?: {
176
- regions?: string[];
177
- cities?: string[];
178
- tier?: number;
179
- };
180
- /**
181
- * Scheduling affinities
182
- * @hidden
183
- */
184
- affinities?: {
185
- colocation?: "datacenter";
186
- hardware_generation?: "highest-overall-performance";
187
- };
188
- /**
189
- * @deprecated use the `class_name` field instead.
190
- * @hidden
191
- */
192
- durable_objects?: {
193
- namespace_id: string;
194
- };
195
- /**
196
- * Configures what percentage of instances should be updated at each step of a rollout.
197
- * You can specify this as a single number, or an array of numbers.
198
- *
199
- * If this is a single number, each step will progress by that percentage.
200
- * The options are 5, 10, 20, 25, 50 or 100.
201
- *
202
- * If this is an array, each step specifies the cumulative rollout progress.
203
- * The final step must be 100.
204
- *
205
- * This can be overridden adhoc by deploying with the `--containers-rollout=immediate` flag,
206
- * which will roll out to 100% of instances in one step.
207
- *
208
- * @optional
209
- * @default [10,100]
210
- * */
211
- rollout_step_percentage?: number | number[];
212
- /**
213
- * How a rollout should be created. It supports the following modes:
214
- * - full_auto: The container application will be rolled out fully automatically.
215
- * - none: The container application won't have a roll out or update.
216
- * - manual: The container application will be rollout fully by manually actioning progress steps.
217
- * @optional
218
- * @default "full_auto"
219
- * @hidden
220
- */
221
- rollout_kind?: "full_auto" | "none" | "full_manual";
222
- /**
223
- * Configures the grace period (in seconds) for active instances before being shutdown during a rollout.
224
- * @optional
225
- * @default 0
226
- */
227
- rollout_active_grace_period?: number;
228
- };
229
- /**
230
- * Configuration in wrangler for Durable Object Migrations
231
- */
232
- type DurableObjectMigration = {
233
- /** A unique identifier for this migration. */
234
- tag: string;
235
- /** The new Durable Objects being defined. */
236
- new_classes?: string[];
237
- /** The new SQLite Durable Objects being defined. */
238
- new_sqlite_classes?: string[];
239
- /** The Durable Objects being renamed. */
240
- renamed_classes?: {
241
- from: string;
242
- to: string;
243
- }[];
244
- /** The Durable Objects being removed. */
245
- deleted_classes?: string[];
246
- };
247
- /**
248
- * The `EnvironmentInheritable` interface declares all the configuration fields for an environment
249
- * that can be inherited (and overridden) from the top-level environment.
250
- */
251
- interface EnvironmentInheritable {
252
- /**
253
- * The name of your Worker. Alphanumeric + dashes only.
254
- *
255
- * @inheritable
256
- */
257
- name: string | undefined;
258
- /**
259
- * This is the ID of the account associated with your zone.
260
- * You might have more than one account, so make sure to use
261
- * the ID of the account associated with the zone/route you
262
- * provide, if you provide one. It can also be specified through
263
- * the CLOUDFLARE_ACCOUNT_ID environment variable.
264
- *
265
- * @inheritable
266
- */
267
- account_id: string | undefined;
268
- /**
269
- * A date in the form yyyy-mm-dd, which will be used to determine
270
- * which version of the Workers runtime is used.
271
- *
272
- * More details at https://developers.cloudflare.com/workers/configuration/compatibility-dates
273
- *
274
- * @inheritable
275
- */
276
- compatibility_date: string | undefined;
277
- /**
278
- * A list of flags that enable features from upcoming features of
279
- * the Workers runtime, usually used together with compatibility_date.
280
- *
281
- * More details at https://developers.cloudflare.com/workers/configuration/compatibility-flags/
282
- *
283
- * @default []
284
- * @inheritable
285
- */
286
- compatibility_flags: string[];
287
- /**
288
- * The entrypoint/path to the JavaScript file that will be executed.
289
- *
290
- * @inheritable
291
- */
292
- main: string | undefined;
293
- /**
294
- * If true then Wrangler will traverse the file tree below `base_dir`;
295
- * Any files that match `rules` will be included in the deployed Worker.
296
- * Defaults to true if `no_bundle` is true, otherwise false.
297
- *
298
- * @inheritable
299
- */
300
- find_additional_modules: boolean | undefined;
301
- /**
302
- * Determines whether Wrangler will preserve bundled file names.
303
- * Defaults to false.
304
- * If left unset, files will be named using the pattern ${fileHash}-${basename},
305
- * for example, `34de60b44167af5c5a709e62a4e20c4f18c9e3b6-favicon.ico`.
306
- *
307
- * @inheritable
308
- */
309
- preserve_file_names: boolean | undefined;
310
- /**
311
- * The directory in which module rules should be evaluated when including additional files into a Worker deployment.
312
- * This defaults to the directory containing the `main` entry point of the Worker if not specified.
313
- *
314
- * @inheritable
315
- */
316
- base_dir: string | undefined;
317
- /**
318
- * Whether we use <name>.<subdomain>.workers.dev to
319
- * test and deploy your Worker.
320
- *
321
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workersdev
322
- *
323
- * @default true
324
- * @breaking
325
- * @inheritable
326
- */
327
- workers_dev: boolean | undefined;
328
- /**
329
- * Whether we use <version>-<name>.<subdomain>.workers.dev to
330
- * serve Preview URLs for your Worker.
331
- *
332
- * @default false
333
- * @inheritable
334
- */
335
- preview_urls: boolean | undefined;
336
- /**
337
- * A list of routes that your Worker should be published to.
338
- * Only one of `routes` or `route` is required.
339
- *
340
- * Only required when workers_dev is false, and there's no scheduled Worker (see `triggers`)
341
- *
342
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
343
- *
344
- * @inheritable
345
- */
346
- routes: Route[] | undefined;
347
- /**
348
- * A route that your Worker should be published to. Literally
349
- * the same as routes, but only one.
350
- * Only one of `routes` or `route` is required.
351
- *
352
- * Only required when workers_dev is false, and there's no scheduled Worker
353
- *
354
- * @inheritable
355
- */
356
- route: Route | undefined;
357
- /**
358
- * Path to a custom tsconfig
359
- *
360
- * @inheritable
361
- */
362
- tsconfig: string | undefined;
363
- /**
364
- * The function to use to replace jsx syntax.
365
- *
366
- * @default "React.createElement"
367
- * @inheritable
368
- */
369
- jsx_factory: string;
370
- /**
371
- * The function to use to replace jsx fragment syntax.
372
- *
373
- * @default "React.Fragment"
374
- * @inheritable
375
- */
376
- jsx_fragment: string;
377
- /**
378
- * A list of migrations that should be uploaded with your Worker.
379
- *
380
- * These define changes in your Durable Object declarations.
381
- *
382
- * More details at https://developers.cloudflare.com/workers/learning/using-durable-objects#configuring-durable-object-classes-with-migrations
383
- *
384
- * @default []
385
- * @inheritable
386
- */
387
- migrations: DurableObjectMigration[];
388
- /**
389
- * "Cron" definitions to trigger a Worker's "scheduled" function.
390
- *
391
- * Lets you call Workers periodically, much like a cron job.
392
- *
393
- * More details here https://developers.cloudflare.com/workers/platform/cron-triggers
394
- *
395
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
396
- *
397
- * @default {crons: undefined}
398
- * @inheritable
399
- */
400
- triggers: {
401
- crons: string[] | undefined;
402
- };
403
- /**
404
- * Specify limits for runtime behavior.
405
- * Only supported for the "standard" Usage Model
406
- *
407
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#limits
408
- *
409
- * @inheritable
410
- */
411
- limits: UserLimits | undefined;
412
- /**
413
- * An ordered list of rules that define which modules to import,
414
- * and what type to import them as. You will need to specify rules
415
- * to use Text, Data, and CompiledWasm modules, or when you wish to
416
- * have a .js file be treated as an ESModule instead of CommonJS.
417
- *
418
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#bundling
419
- *
420
- * @inheritable
421
- */
422
- rules: Rule[];
423
- /**
424
- * Configures a custom build step to be run by Wrangler when building your Worker.
425
- *
426
- * Refer to the [custom builds documentation](https://developers.cloudflare.com/workers/cli-wrangler/configuration#build)
427
- * for more details.
428
- *
429
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#custom-builds
430
- *
431
- * @default {watch_dir:"./src"}
432
- */
433
- build: {
434
- /** 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. */
435
- command?: string;
436
- /** The directory in which the command is executed. */
437
- cwd?: string;
438
- /** The directory to watch for changes while using wrangler dev, defaults to the current working directory */
439
- watch_dir?: string | string[];
440
- };
441
- /**
442
- * Skip internal build steps and directly deploy script
443
- * @inheritable
444
- */
445
- no_bundle: boolean | undefined;
446
- /**
447
- * Minify the script before uploading.
448
- * @inheritable
449
- */
450
- minify: boolean | undefined;
451
- /**
452
- * Set the `name` property to the original name for functions and classes renamed during minification.
453
- *
454
- * See https://esbuild.github.io/api/#keep-names
455
- *
456
- * @default true
457
- * @inheritable
458
- */
459
- keep_names: boolean | undefined;
460
- /**
461
- * Designates this Worker as an internal-only "first-party" Worker.
462
- *
463
- * @inheritable
464
- */
465
- first_party_worker: boolean | undefined;
466
- /**
467
- * List of bindings that you will send to logfwdr
468
- *
469
- * @default {bindings:[]}
470
- * @inheritable
471
- */
472
- logfwdr: {
473
- bindings: {
474
- /** The binding name used to refer to logfwdr */
475
- name: string;
476
- /** The destination for this logged message */
477
- destination: string;
478
- }[];
479
- };
480
- /**
481
- * Send Trace Events from this Worker to Workers Logpush.
482
- *
483
- * This will not configure a corresponding Logpush job automatically.
484
- *
485
- * For more information about Workers Logpush, see:
486
- * https://blog.cloudflare.com/logpush-for-workers/
487
- *
488
- * @inheritable
489
- */
490
- logpush: boolean | undefined;
491
- /**
492
- * Include source maps when uploading this worker.
493
- *
494
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#source-maps
495
- *
496
- * @inheritable
497
- */
498
- upload_source_maps: boolean | undefined;
499
- /**
500
- * Specify how the Worker should be located to minimize round-trip time.
501
- *
502
- * More details: https://developers.cloudflare.com/workers/platform/smart-placement/
503
- *
504
- * @inheritable
505
- */
506
- placement: {
507
- mode: "off" | "smart";
508
- hint?: string;
509
- } | undefined;
510
- /**
511
- * Specify the directory of static assets to deploy/serve
512
- *
513
- * More details at https://developers.cloudflare.com/workers/frameworks/
514
- *
515
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
516
- *
517
- * @inheritable
518
- */
519
- assets: Assets | undefined;
520
- /**
521
- * Specify the observability behavior of the Worker.
522
- *
523
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#observability
524
- *
525
- * @inheritable
526
- */
527
- observability: Observability | undefined;
528
- /**
529
- * Specify the compliance region mode of the Worker.
530
- *
531
- * Although if the user does not specify a compliance region, the default is `public`,
532
- * it can be set to `undefined` in configuration to delegate to the CLOUDFLARE_COMPLIANCE_REGION environment variable.
533
- */
534
- compliance_region: "public" | "fedramp_high" | undefined;
535
- /**
536
- * Configuration for Python modules.
537
- *
538
- * @inheritable
539
- */
540
- python_modules: {
541
- /**
542
- * A list of glob patterns to exclude files from the python_modules directory when bundling.
543
- *
544
- * Patterns are relative to the python_modules directory and use glob syntax.
545
- *
546
- * @default ["**\*.pyc"]
547
- */
548
- exclude: string[];
549
- };
550
- }
551
- type DurableObjectBindings = {
552
- /** The name of the binding used to refer to the Durable Object */
553
- name: string;
554
- /** The exported class name of the Durable Object */
555
- class_name: string;
556
- /** The script where the Durable Object is defined (if it's external to this Worker) */
557
- script_name?: string;
558
- /** The service environment of the script_name to bind to */
559
- environment?: string;
560
- }[];
561
- type WorkflowBinding = {
562
- /** The name of the binding used to refer to the Workflow */
563
- binding: string;
564
- /** The name of the Workflow */
565
- name: string;
566
- /** The exported class name of the Workflow */
567
- class_name: string;
568
- /** The script where the Workflow is defined (if it's external to this Worker) */
569
- script_name?: string;
570
- /** Whether the Workflow should be remote or not in local development */
571
- remote?: boolean;
572
- };
573
- /**
574
- * The `EnvironmentNonInheritable` interface declares all the configuration fields for an environment
575
- * that cannot be inherited from the top-level environment, and must be defined specifically.
576
- *
577
- * If any of these fields are defined at the top-level then they should also be specifically defined
578
- * for each named environment.
579
- */
580
- interface EnvironmentNonInheritable {
581
- /**
582
- * A map of values to substitute when deploying your Worker.
583
- *
584
- * NOTE: This field is not automatically inherited from the top level environment,
585
- * and so must be specified in every named environment.
586
- *
587
- * @default {}
588
- * @nonInheritable
589
- */
590
- define: Record<string, string>;
591
- /**
592
- * A map of environment variables to set when deploying your Worker.
593
- *
594
- * NOTE: This field is not automatically inherited from the top level environment,
595
- * and so must be specified in every named environment.
596
- *
597
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
598
- *
599
- * @default {}
600
- * @nonInheritable
601
- */
602
- vars: Record<string, string | Json>;
603
- /**
604
- * A list of durable objects that your Worker should be bound to.
605
- *
606
- * For more information about Durable Objects, see the documentation at
607
- * https://developers.cloudflare.com/workers/learning/using-durable-objects
608
- *
609
- * NOTE: This field is not automatically inherited from the top level environment,
610
- * and so must be specified in every named environment.
611
- *
612
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
613
- *
614
- * @default {bindings:[]}
615
- * @nonInheritable
616
- */
617
- durable_objects: {
618
- bindings: DurableObjectBindings;
619
- };
620
- /**
621
- * A list of workflows that your Worker should be bound to.
622
- *
623
- * NOTE: This field is not automatically inherited from the top level environment,
624
- * and so must be specified in every named environment.
625
- *
626
- * @default []
627
- * @nonInheritable
628
- */
629
- workflows: WorkflowBinding[];
630
- /**
631
- * Cloudchamber configuration
632
- *
633
- * NOTE: This field is not automatically inherited from the top level environment,
634
- * and so must be specified in every named environment.
635
- *
636
- * @default {}
637
- * @nonInheritable
638
- */
639
- cloudchamber: CloudchamberConfig;
640
- /**
641
- * Container related configuration
642
- *
643
- * NOTE: This field is not automatically inherited from the top level environment,
644
- * and so must be specified in every named environment.
645
- *
646
- * @default []
647
- * @nonInheritable
648
- */
649
- containers?: ContainerApp[];
650
- /**
651
- * These specify any Workers KV Namespaces you want to
652
- * access from inside your Worker.
653
- *
654
- * To learn more about KV Namespaces,
655
- * see the documentation at https://developers.cloudflare.com/workers/learning/how-kv-works
656
- *
657
- * NOTE: This field is not automatically inherited from the top level environment,
658
- * and so must be specified in every named environment.
659
- *
660
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
661
- *
662
- * @default []
663
- * @nonInheritable
664
- */
665
- kv_namespaces: {
666
- /** The binding name used to refer to the KV Namespace */
667
- binding: string;
668
- /** The ID of the KV namespace */
669
- id?: string;
670
- /** The ID of the KV namespace used during `wrangler dev` */
671
- preview_id?: string;
672
- /** Whether the KV namespace should be remote or not in local development */
673
- remote?: boolean;
674
- }[];
675
- /**
676
- * These specify bindings to send email from inside your Worker.
677
- *
678
- * NOTE: This field is not automatically inherited from the top level environment,
679
- * and so must be specified in every named environment.
680
- *
681
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#email-bindings
682
- *
683
- * @default []
684
- * @nonInheritable
685
- */
686
- send_email: {
687
- /** The binding name used to refer to the this binding */
688
- name: string;
689
- /** If this binding should be restricted to a specific verified address */
690
- destination_address?: string;
691
- /** If this binding should be restricted to a set of verified addresses */
692
- allowed_destination_addresses?: string[];
693
- /** If this binding should be restricted to a set of sender addresses */
694
- allowed_sender_addresses?: string[];
695
- /** Whether the binding should be remote or not in local development */
696
- remote?: boolean;
697
- }[];
698
- /**
699
- * Specifies Queues that are bound to this Worker environment.
700
- *
701
- * NOTE: This field is not automatically inherited from the top level environment,
702
- * and so must be specified in every named environment.
703
- *
704
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
705
- *
706
- * @default {consumers:[],producers:[]}
707
- * @nonInheritable
708
- */
709
- queues: {
710
- /** Producer bindings */
711
- producers?: {
712
- /** The binding name used to refer to the Queue in the Worker. */
713
- binding: string;
714
- /** The name of this Queue. */
715
- queue: string;
716
- /** The number of seconds to wait before delivering a message */
717
- delivery_delay?: number;
718
- /** Whether the Queue producer should be remote or not in local development */
719
- remote?: boolean;
720
- }[];
721
- /** Consumer configuration */
722
- consumers?: {
723
- /** The name of the queue from which this consumer should consume. */
724
- queue: string;
725
- /** The consumer type, e.g., worker, http-pull, r2-bucket, etc. Default is worker. */
726
- type?: string;
727
- /** The maximum number of messages per batch */
728
- max_batch_size?: number;
729
- /** The maximum number of seconds to wait to fill a batch with messages. */
730
- max_batch_timeout?: number;
731
- /** The maximum number of retries for each message. */
732
- max_retries?: number;
733
- /** The queue to send messages that failed to be consumed. */
734
- dead_letter_queue?: string;
735
- /** 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. */
736
- max_concurrency?: number | null;
737
- /** The number of milliseconds to wait for pulled messages to become visible again */
738
- visibility_timeout_ms?: number;
739
- /** The number of seconds to wait before retrying a message */
740
- retry_delay?: number;
741
- }[];
742
- };
743
- /**
744
- * Specifies R2 buckets that are bound to this Worker environment.
745
- *
746
- * NOTE: This field is not automatically inherited from the top level environment,
747
- * and so must be specified in every named environment.
748
- *
749
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
750
- *
751
- * @default []
752
- * @nonInheritable
753
- */
754
- r2_buckets: {
755
- /** The binding name used to refer to the R2 bucket in the Worker. */
756
- binding: string;
757
- /** The name of this R2 bucket at the edge. */
758
- bucket_name?: string;
759
- /** The preview name of this R2 bucket at the edge. */
760
- preview_bucket_name?: string;
761
- /** The jurisdiction that the bucket exists in. Default if not present. */
762
- jurisdiction?: string;
763
- /** Whether the R2 bucket should be remote or not in local development */
764
- remote?: boolean;
765
- }[];
766
- /**
767
- * Specifies D1 databases that are bound to this Worker environment.
768
- *
769
- * NOTE: This field is not automatically inherited from the top level environment,
770
- * and so must be specified in every named environment.
771
- *
772
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
773
- *
774
- * @default []
775
- * @nonInheritable
776
- */
777
- d1_databases: {
778
- /** The binding name used to refer to the D1 database in the Worker. */
779
- binding: string;
780
- /** The name of this D1 database. */
781
- database_name?: string;
782
- /** The UUID of this D1 database (not required). */
783
- database_id?: string;
784
- /** The UUID of this D1 database for Wrangler Dev (if specified). */
785
- preview_database_id?: string;
786
- /** The name of the migrations table for this D1 database (defaults to 'd1_migrations'). */
787
- migrations_table?: string;
788
- /** The path to the directory of migrations for this D1 database (defaults to './migrations'). */
789
- migrations_dir?: string;
790
- /** Internal use only. */
791
- database_internal_env?: string;
792
- /** Whether the D1 database should be remote or not in local development */
793
- remote?: boolean;
794
- }[];
795
- /**
796
- * Specifies Vectorize indexes that are bound to this Worker environment.
797
- *
798
- * NOTE: This field is not automatically inherited from the top level environment,
799
- * and so must be specified in every named environment.
800
- *
801
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
802
- *
803
- * @default []
804
- * @nonInheritable
805
- */
806
- vectorize: {
807
- /** The binding name used to refer to the Vectorize index in the Worker. */
808
- binding: string;
809
- /** The name of the index. */
810
- index_name: string;
811
- /** Whether the Vectorize index should be remote or not in local development */
812
- remote?: boolean;
813
- }[];
814
- /**
815
- * Specifies Hyperdrive configs that are bound to this Worker environment.
816
- *
817
- * NOTE: This field is not automatically inherited from the top level environment,
818
- * and so must be specified in every named environment.
819
- *
820
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
821
- *
822
- * @default []
823
- * @nonInheritable
824
- */
825
- hyperdrive: {
826
- /** The binding name used to refer to the project in the Worker. */
827
- binding: string;
828
- /** The id of the database. */
829
- id: string;
830
- /** The local database connection string for `wrangler dev` */
831
- localConnectionString?: string;
832
- }[];
833
- /**
834
- * Specifies service bindings (Worker-to-Worker) that are bound to this Worker environment.
835
- *
836
- * NOTE: This field is not automatically inherited from the top level environment,
837
- * and so must be specified in every named environment.
838
- *
839
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
840
- *
841
- * @default []
842
- * @nonInheritable
843
- */
844
- services: {
845
- /** The binding name used to refer to the bound service. */
846
- binding: string;
847
- /**
848
- * The name of the service.
849
- * To bind to a worker in a specific environment,
850
- * you should use the format `<worker_name>-<environment_name>`.
851
- */
852
- service: string;
853
- /**
854
- * @hidden
855
- * @deprecated you should use `service: <worker_name>-<environment_name>` instead.
856
- * This refers to the deprecated concept of 'service environments'.
857
- * The environment of the service (e.g. production, staging, etc).
858
- */
859
- environment?: string;
860
- /** Optionally, the entrypoint (named export) of the service to bind to. */
861
- entrypoint?: string;
862
- /** Optional properties that will be made available to the service via ctx.props. */
863
- props?: Record<string, unknown>;
864
- /** Whether the service binding should be remote or not in local development */
865
- remote?: boolean;
866
- }[] | undefined;
867
- /**
868
- * Specifies analytics engine datasets that are bound to this Worker environment.
869
- *
870
- * NOTE: This field is not automatically inherited from the top level environment,
871
- * and so must be specified in every named environment.
872
- *
873
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets
874
- *
875
- * @default []
876
- * @nonInheritable
877
- */
878
- analytics_engine_datasets: {
879
- /** The binding name used to refer to the dataset in the Worker. */
880
- binding: string;
881
- /** The name of this dataset to write to. */
882
- dataset?: string;
883
- }[];
884
- /**
885
- * A browser that will be usable from the Worker.
886
- *
887
- * NOTE: This field is not automatically inherited from the top level environment,
888
- * and so must be specified in every named environment.
889
- *
890
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering
891
- *
892
- * @default {}
893
- * @nonInheritable
894
- */
895
- browser: {
896
- binding: string;
897
- /** Whether the Browser binding should be remote or not in local development */
898
- remote?: boolean;
899
- } | undefined;
900
- /**
901
- * Binding to the AI project.
902
- *
903
- * NOTE: This field is not automatically inherited from the top level environment,
904
- * and so must be specified in every named environment.
905
- *
906
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
907
- *
908
- * @default {}
909
- * @nonInheritable
910
- */
911
- ai: {
912
- binding: string;
913
- staging?: boolean;
914
- /** Whether the AI binding should be remote or not in local development */
915
- remote?: boolean;
916
- } | undefined;
917
- /**
918
- * Binding to Cloudflare Images
919
- *
920
- * NOTE: This field is not automatically inherited from the top level environment,
921
- * and so must be specified in every named environment.
922
- *
923
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#images
924
- *
925
- * @default {}
926
- * @nonInheritable
927
- */
928
- images: {
929
- binding: string;
930
- /** Whether the Images binding should be remote or not in local development */
931
- remote?: boolean;
932
- } | undefined;
933
- /**
934
- * Binding to Cloudflare Media Transformations
935
- *
936
- * NOTE: This field is not automatically inherited from the top level environment,
937
- * and so must be specified in every named environment.
938
- *
939
- * @default {}
940
- * @nonInheritable
941
- */
942
- media: {
943
- binding: string;
944
- /** Whether the Media binding should be remote or not */
945
- remote?: boolean;
946
- } | undefined;
947
- /**
948
- * Binding to the Worker Version's metadata
949
- */
950
- version_metadata: {
951
- binding: string;
952
- } | undefined;
953
- /**
954
- * "Unsafe" tables for features that aren't directly supported by wrangler.
955
- *
956
- * NOTE: This field is not automatically inherited from the top level environment,
957
- * and so must be specified in every named environment.
958
- *
959
- * @default {}
960
- * @nonInheritable
961
- */
962
- unsafe: {
963
- /**
964
- * A set of bindings that should be put into a Worker's upload metadata without changes. These
965
- * can be used to implement bindings for features that haven't released and aren't supported
966
- * directly by wrangler or miniflare.
967
- */
968
- bindings?: UnsafeBinding[];
969
- /**
970
- * Arbitrary key/value pairs that will be included in the uploaded metadata. Values specified
971
- * here will always be applied to metadata last, so can add new or override existing fields.
972
- */
973
- metadata?: {
974
- [key: string]: unknown;
975
- };
976
- /**
977
- * Used for internal capnp uploads for the Workers runtime
978
- */
979
- capnp?: {
980
- base_path: string;
981
- source_schemas: string[];
982
- compiled_schema?: never;
983
- } | {
984
- base_path?: never;
985
- source_schemas?: never;
986
- compiled_schema: string;
987
- };
988
- };
989
- /**
990
- * Specifies a list of mTLS certificates that are bound to this Worker environment.
991
- *
992
- * NOTE: This field is not automatically inherited from the top level environment,
993
- * and so must be specified in every named environment.
994
- *
995
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates
996
- *
997
- * @default []
998
- * @nonInheritable
999
- */
1000
- mtls_certificates: {
1001
- /** The binding name used to refer to the certificate in the Worker */
1002
- binding: string;
1003
- /** The uuid of the uploaded mTLS certificate */
1004
- certificate_id: string;
1005
- /** Whether the mtls fetcher should be remote or not in local development */
1006
- remote?: boolean;
1007
- }[];
1008
- /**
1009
- * Specifies a list of Tail Workers that are bound to this Worker environment
1010
- *
1011
- * NOTE: This field is not automatically inherited from the top level environment,
1012
- * and so must be specified in every named environment.
1013
- *
1014
- * @default []
1015
- * @nonInheritable
1016
- */
1017
- tail_consumers?: TailConsumer[];
1018
- /**
1019
- * Specifies namespace bindings that are bound to this Worker environment.
1020
- *
1021
- * NOTE: This field is not automatically inherited from the top level environment,
1022
- * and so must be specified in every named environment.
1023
- *
1024
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms
1025
- *
1026
- * @default []
1027
- * @nonInheritable
1028
- */
1029
- dispatch_namespaces: {
1030
- /** The binding name used to refer to the bound service. */
1031
- binding: string;
1032
- /** The namespace to bind to. */
1033
- namespace: string;
1034
- /** Details about the outbound Worker which will handle outbound requests from your namespace */
1035
- outbound?: DispatchNamespaceOutbound;
1036
- /** Whether the Dispatch Namespace should be remote or not in local development */
1037
- remote?: boolean;
1038
- }[];
1039
- /**
1040
- * Specifies list of Pipelines bound to this Worker environment
1041
- *
1042
- * NOTE: This field is not automatically inherited from the top level environment,
1043
- * and so must be specified in every named environment.
1044
- *
1045
- * @default []
1046
- * @nonInheritable
1047
- */
1048
- pipelines: {
1049
- /** The binding name used to refer to the bound service. */
1050
- binding: string;
1051
- /** Name of the Pipeline to bind */
1052
- pipeline: string;
1053
- /** Whether the pipeline should be remote or not in local development */
1054
- remote?: boolean;
1055
- }[];
1056
- /**
1057
- * Specifies Secret Store bindings that are bound to this Worker environment.
1058
- *
1059
- * NOTE: This field is not automatically inherited from the top level environment,
1060
- * and so must be specified in every named environment.
1061
- *
1062
- * @default []
1063
- * @nonInheritable
1064
- */
1065
- secrets_store_secrets: {
1066
- /** The binding name used to refer to the bound service. */
1067
- binding: string;
1068
- /** Id of the secret store */
1069
- store_id: string;
1070
- /** Name of the secret */
1071
- secret_name: string;
1072
- }[];
1073
- /**
1074
- * **DO NOT USE**. Hello World Binding Config to serve as an explanatory example.
1075
- *
1076
- * NOTE: This field is not automatically inherited from the top level environment,
1077
- * and so must be specified in every named environment.
1078
- *
1079
- * @default []
1080
- * @nonInheritable
1081
- */
1082
- unsafe_hello_world: {
1083
- /** The binding name used to refer to the bound service. */
1084
- binding: string;
1085
- /** Whether the timer is enabled */
1086
- enable_timer?: boolean;
1087
- }[];
1088
- /**
1089
- * Specifies rate limit bindings that are bound to this Worker environment.
1090
- *
1091
- * NOTE: This field is not automatically inherited from the top level environment,
1092
- * and so must be specified in every named environment.
1093
- *
1094
- * @default []
1095
- * @nonInheritable
1096
- */
1097
- ratelimits: {
1098
- /** The binding name used to refer to the rate limiter in the Worker. */
1099
- name: string;
1100
- /** The namespace ID for this rate limiter. */
1101
- namespace_id: string;
1102
- /** Simple rate limiting configuration. */
1103
- simple: {
1104
- /** The maximum number of requests allowed in the time period. */
1105
- limit: number;
1106
- /** The time period in seconds (10 for ten seconds, 60 for one minute). */
1107
- period: 10 | 60;
1108
- };
1109
- }[];
1110
- /**
1111
- * Specifies Worker Loader bindings that are bound to this Worker environment.
1112
- *
1113
- * NOTE: This field is not automatically inherited from the top level environment,
1114
- * and so must be specified in every named environment.
1115
- *
1116
- * @default []
1117
- * @nonInheritable
1118
- */
1119
- worker_loaders: {
1120
- /** The binding name used to refer to the Worker Loader in the Worker. */
1121
- binding: string;
1122
- }[];
1123
- /**
1124
- * Specifies VPC services that are bound to this Worker environment.
1125
- *
1126
- * NOTE: This field is not automatically inherited from the top level environment,
1127
- * and so must be specified in every named environment.
1128
- *
1129
- * @default []
1130
- * @nonInheritable
1131
- */
1132
- vpc_services: {
1133
- /** The binding name used to refer to the VPC service in the Worker. */
1134
- binding: string;
1135
- /** The service ID of the VPC connectivity service. */
1136
- service_id: string;
1137
- /** Whether the VPC service is remote or not */
1138
- remote?: boolean;
1139
- }[];
1140
- }
1141
- /**
1142
- * The raw environment configuration that we read from the config file.
1143
- *
1144
- * All the properties are optional, and will be replaced with defaults in the configuration that
1145
- * is used in the rest of the codebase.
1146
- */
1147
- type RawEnvironment = Partial<Environment>;
1148
- /**
1149
- * A bundling resolver rule, defining the modules type for paths that match the specified globs.
1150
- */
1151
- type Rule = {
1152
- type: ConfigModuleRuleType;
1153
- globs: string[];
1154
- fallthrough?: boolean;
1155
- };
1156
- /**
1157
- * The possible types for a `Rule`.
1158
- */
1159
- type ConfigModuleRuleType = "ESModule" | "CommonJS" | "CompiledWasm" | "Text" | "Data" | "PythonModule" | "PythonRequirement";
1160
- type TailConsumer = {
1161
- /** The name of the service tail events will be forwarded to. */
1162
- service: string;
1163
- /** (Optional) The environment of the service. */
1164
- environment?: string;
1165
- };
1166
- interface DispatchNamespaceOutbound {
1167
- /** Name of the service handling the outbound requests */
1168
- service: string;
1169
- /** (Optional) Name of the environment handling the outbound requests. */
1170
- environment?: string;
1171
- /** (Optional) List of parameter names, for sending context from your dispatch Worker to the outbound handler */
1172
- parameters?: string[];
1173
- }
1174
- interface UserLimits {
1175
- /** Maximum allowed CPU time for a Worker's invocation in milliseconds */
1176
- cpu_ms: number;
1177
- }
1178
- type Assets = {
1179
- /** Absolute path to assets directory */
1180
- directory?: string;
1181
- /** Name of `env` binding property in the User Worker. */
1182
- binding?: string;
1183
- /** How to handle HTML requests. */
1184
- html_handling?: "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash" | "none";
1185
- /** How to handle requests that do not match an asset. */
1186
- not_found_handling?: "single-page-application" | "404-page" | "none";
1187
- /**
1188
- * Matches will be routed to the User Worker, and matches to negative rules will go to the Asset Worker.
1189
- *
1190
- * Can also be `true`, indicating that every request should be routed to the User Worker.
1191
- */
1192
- run_worker_first?: string[] | boolean;
1193
- };
1194
- interface Observability {
1195
- /** If observability is enabled for this Worker */
1196
- enabled?: boolean;
1197
- /** The sampling rate */
1198
- head_sampling_rate?: number;
1199
- logs?: {
1200
- enabled?: boolean;
1201
- /** The sampling rate */
1202
- head_sampling_rate?: number;
1203
- /** Set to false to disable invocation logs */
1204
- invocation_logs?: boolean;
1205
- /**
1206
- * If logs should be persisted to the Cloudflare observability platform where they can be queried in the dashboard.
1207
- *
1208
- * @default true
1209
- */
1210
- persist?: boolean;
1211
- /**
1212
- * What destinations logs emitted from the Worker should be sent to.
1213
- *
1214
- * @default []
1215
- */
1216
- destinations?: string[];
1217
- };
1218
- traces?: {
1219
- enabled?: boolean;
1220
- /** The sampling rate */
1221
- head_sampling_rate?: number;
1222
- /**
1223
- * If traces should be persisted to the Cloudflare observability platform where they can be queried in the dashboard.
1224
- *
1225
- * @default true
1226
- */
1227
- persist?: boolean;
1228
- /**
1229
- * What destinations traces emitted from the Worker should be sent to.
1230
- *
1231
- * @default []
1232
- */
1233
- destinations?: string[];
1234
- };
1235
- }
1236
- type DockerConfiguration = {
1237
- /** Socket used by miniflare to communicate with Docker */
1238
- socketPath: string;
1239
- };
1240
- type ContainerEngine = {
1241
- localDocker: DockerConfiguration;
1242
- } | string;
1243
-
1244
- /**
1245
- * The compliance region to use for the API requests.
1246
- */
1247
- type ComplianceConfig = Partial<Pick<Config, "compliance_region">>;
1248
-
1249
- /**
1250
- * A symbol to inherit a binding from the deployed worker.
1251
- */
1252
- declare const INHERIT_SYMBOL: unique symbol;
1253
-
1254
- /**
1255
- * The type of Worker
1256
- */
1257
- type CfScriptFormat = "modules" | "service-worker";
1258
- /**
1259
- * A module type.
1260
- */
1261
- type CfModuleType = "esm" | "commonjs" | "compiled-wasm" | "text" | "buffer" | "python" | "python-requirement";
1262
- /**
1263
- * An imported module.
1264
- */
1265
- interface CfModule {
1266
- /**
1267
- * The module name.
1268
- *
1269
- * @example
1270
- * './src/index.js'
1271
- */
1272
- name: string;
1273
- /**
1274
- * The absolute path of the module on disk, or `undefined` if this is a
1275
- * virtual module. Used as the source URL for this module, so source maps are
1276
- * correctly resolved.
1277
- *
1278
- * @example
1279
- * '/path/to/src/index.js'
1280
- */
1281
- filePath: string | undefined;
1282
- /**
1283
- * The module content, usually JavaScript or WASM code.
1284
- *
1285
- * @example
1286
- * export default {
1287
- * async fetch(request) {
1288
- * return new Response('Ok')
1289
- * }
1290
- * }
1291
- */
1292
- content: string | Buffer<ArrayBuffer>;
1293
- /**
1294
- * An optional sourcemap for this module if it's of a ESM or CJS type, this will only be present
1295
- * if we're deploying with sourcemaps enabled. Since we copy extra modules that aren't bundled
1296
- * we need to also copy the relevant sourcemaps into the final out directory.
1297
- */
1298
- sourceMap?: CfWorkerSourceMap;
1299
- /**
1300
- * The module type.
1301
- *
1302
- * If absent, will default to the main module's type.
1303
- */
1304
- type?: CfModuleType;
1305
- }
1306
- /**
1307
- * A KV namespace.
1308
- */
1309
- interface CfKvNamespace {
1310
- binding: string;
1311
- id?: string | typeof INHERIT_SYMBOL;
1312
- remote?: boolean;
1313
- raw?: boolean;
1314
- }
1315
- /**
1316
- * A binding to send email.
1317
- */
1318
- type CfSendEmailBindings = {
1319
- name: string;
1320
- remote?: boolean;
1321
- } & ({
1322
- destination_address?: string;
1323
- } | {
1324
- allowed_destination_addresses?: string[];
1325
- } | {
1326
- allowed_sender_addresses?: string[];
1327
- });
1328
- /**
1329
- * A binding to a browser
1330
- */
1331
- interface CfBrowserBinding {
1332
- binding: string;
1333
- raw?: boolean;
1334
- remote?: boolean;
1335
- }
1336
- /**
1337
- * A binding to the AI project
1338
- */
1339
- interface CfAIBinding {
1340
- binding: string;
1341
- staging?: boolean;
1342
- remote?: boolean;
1343
- raw?: boolean;
1344
- }
1345
- /**
1346
- * A binding to Cloudflare Images
1347
- */
1348
- interface CfImagesBinding {
1349
- binding: string;
1350
- raw?: boolean;
1351
- remote?: boolean;
1352
- }
1353
- /**
1354
- * A binding to Cloudflare Media Transformations
1355
- */
1356
- interface CfMediaBinding {
1357
- binding: string;
1358
- remote?: boolean;
1359
- }
1360
- /**
1361
- * A Durable Object.
1362
- */
1363
- interface CfDurableObject {
1364
- name: string;
1365
- class_name: string;
1366
- script_name?: string;
1367
- environment?: string;
1368
- }
1369
- interface CfWorkflow {
1370
- name: string;
1371
- class_name: string;
1372
- binding: string;
1373
- script_name?: string;
1374
- remote?: boolean;
1375
- raw?: boolean;
1376
- }
1377
- interface CfQueue {
1378
- binding: string;
1379
- queue_name: string;
1380
- delivery_delay?: number;
1381
- remote?: boolean;
1382
- raw?: boolean;
1383
- }
1384
- interface CfR2Bucket {
1385
- binding: string;
1386
- bucket_name?: string | typeof INHERIT_SYMBOL;
1387
- jurisdiction?: string;
1388
- remote?: boolean;
1389
- raw?: boolean;
1390
- }
1391
- interface CfD1Database {
1392
- binding: string;
1393
- database_id?: string | typeof INHERIT_SYMBOL;
1394
- database_name?: string;
1395
- preview_database_id?: string;
1396
- database_internal_env?: string;
1397
- migrations_table?: string;
1398
- migrations_dir?: string;
1399
- remote?: boolean;
1400
- raw?: boolean;
1401
- }
1402
- interface CfVectorize {
1403
- binding: string;
1404
- index_name: string;
1405
- raw?: boolean;
1406
- remote?: boolean;
1407
- }
1408
- interface CfSecretsStoreSecrets {
1409
- binding: string;
1410
- store_id: string;
1411
- secret_name: string;
1412
- }
1413
- interface CfHelloWorld {
1414
- binding: string;
1415
- enable_timer?: boolean;
1416
- }
1417
- interface CfWorkerLoader {
1418
- binding: string;
1419
- }
1420
- interface CfRateLimit {
1421
- name: string;
1422
- namespace_id: string;
1423
- simple: {
1424
- limit: number;
1425
- period: 10 | 60;
1426
- };
1427
- }
1428
- interface CfHyperdrive {
1429
- binding: string;
1430
- id: string;
1431
- localConnectionString?: string;
1432
- }
1433
- interface CfService {
1434
- binding: string;
1435
- service: string;
1436
- environment?: string;
1437
- entrypoint?: string;
1438
- props?: Record<string, unknown>;
1439
- remote?: boolean;
1440
- }
1441
- interface CfVpcService {
1442
- binding: string;
1443
- service_id: string;
1444
- remote?: boolean;
1445
- }
1446
- interface CfAnalyticsEngineDataset {
1447
- binding: string;
1448
- dataset?: string;
1449
- }
1450
- interface CfDispatchNamespace {
1451
- binding: string;
1452
- namespace: string;
1453
- outbound?: {
1454
- service: string;
1455
- environment?: string;
1456
- parameters?: string[];
1457
- };
1458
- remote?: boolean;
1459
- }
1460
- interface CfMTlsCertificate {
1461
- binding: string;
1462
- certificate_id: string;
1463
- remote?: boolean;
1464
- }
1465
- interface CfLogfwdrBinding {
1466
- name: string;
1467
- destination: string;
1468
- }
1469
- interface CfPipeline {
1470
- binding: string;
1471
- pipeline: string;
1472
- remote?: boolean;
1473
- }
1474
- interface CfUnsafeBinding {
1475
- name: string;
1476
- type: string;
1477
- dev?: {
1478
- plugin: {
1479
- /**
1480
- * Package is the bare specifier of the package that exposes plugins to integrate into Miniflare via a named `plugins` export.
1481
- * @example "@cloudflare/my-external-miniflare-plugin"
1482
- */
1483
- package: string;
1484
- /**
1485
- * Plugin is the name of the plugin exposed by the package.
1486
- * @example "my-unsafe-plugin"
1487
- */
1488
- name: string;
1489
- };
1490
- /**
1491
- * dev-only options to pass to the plugin.
1492
- */
1493
- options?: Record<string, unknown>;
1494
- };
1495
- }
1496
- type CfUnsafeMetadata = Record<string, unknown>;
1497
- type CfCapnp = {
1498
- base_path?: never;
1499
- source_schemas?: never;
1500
- compiled_schema: string;
1501
- } | {
1502
- base_path: string;
1503
- source_schemas: string[];
1504
- compiled_schema?: never;
1505
- };
1506
- interface CfUnsafe {
1507
- bindings: CfUnsafeBinding[] | undefined;
1508
- metadata: CfUnsafeMetadata | undefined;
1509
- capnp: CfCapnp | undefined;
1510
- }
1511
- interface CfTailConsumer {
1512
- service: string;
1513
- environment?: string;
1514
- }
1515
- interface CfWorkerSourceMap {
1516
- /**
1517
- * The name of the source map.
1518
- *
1519
- * @example
1520
- * 'out.js.map'
1521
- */
1522
- name: string;
1523
- /**
1524
- * The content of the source map, which is a JSON object described by the v3
1525
- * spec.
1526
- *
1527
- * @example
1528
- * {
1529
- * "version" : 3,
1530
- * "file": "out.js",
1531
- * "sourceRoot": "",
1532
- * "sources": ["foo.js", "bar.js"],
1533
- * "sourcesContent": [null, null],
1534
- * "names": ["src", "maps", "are", "fun"],
1535
- * "mappings": "A,AAAB;;ABCDE;"
1536
- * }
1537
- */
1538
- content: string | Buffer;
1539
- }
1540
-
1541
- /**
1542
- * This is the static type definition for the configuration object.
1543
- *
1544
- * It reflects a normalized and validated version of the configuration that you can write in a Wrangler configuration file,
1545
- * and optionally augment with arguments passed directly to wrangler.
1546
- *
1547
- * For more information about the configuration object, see the
1548
- * documentation at https://developers.cloudflare.com/workers/cli-wrangler/configuration
1549
- *
1550
- * Notes:
1551
- *
1552
- * - Fields that are only specified in `ConfigFields` and not `Environment` can only appear
1553
- * in the top level config and should not appear in any environments.
1554
- * - Fields that are specified in `PagesConfigFields` are only relevant for Pages projects
1555
- * - All top level fields in config and environments are optional in the Wrangler configuration file.
1556
- *
1557
- * Legend for the annotations:
1558
- *
1559
- * - `@breaking`: the deprecation/optionality is a breaking change from Wrangler v1.
1560
- * - `@todo`: there's more work to be done (with details attached).
1561
- */
1562
- type Config = ComputedFields & ConfigFields<DevConfig> & PagesConfigFields & Environment;
1563
- type RawConfig = Partial<ConfigFields<RawDevConfig>> & PagesConfigFields & RawEnvironment & EnvironmentMap & {
1564
- $schema?: string;
1565
- };
1566
- interface ComputedFields {
1567
- /** The path to the Wrangler configuration file (if any, and possibly redirected from the user Wrangler configuration) used to create this configuration. */
1568
- configPath: string | undefined;
1569
- /** 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. */
1570
- userConfigPath: string | undefined;
1571
- /**
1572
- * The original top level name for the Worker in the raw configuration.
1573
- *
1574
- * When a raw configuration has been flattened to a single environment the worker name may have been replaced or transformed.
1575
- * It can be useful to know what the top-level name was before the flattening.
1576
- */
1577
- topLevelName: string | undefined;
1578
- /** A list of environment names declared in the raw configuration. */
1579
- definedEnvironments: string[] | undefined;
1580
- /** The name of the environment being targeted. */
1581
- targetEnvironment: string | undefined;
1582
- }
1583
- interface ConfigFields<Dev extends RawDevConfig> {
1584
- /**
1585
- * A boolean to enable "legacy" style wrangler environments (from Wrangler v1).
1586
- * These have been superseded by Services, but there may be projects that won't
1587
- * (or can't) use them. If you're using a legacy environment, you can set this
1588
- * to `true` to enable it.
1589
- */
1590
- legacy_env: boolean;
1591
- /**
1592
- * Whether Wrangler should send usage metrics to Cloudflare for this project.
1593
- *
1594
- * When defined this will override any user settings.
1595
- * Otherwise, Wrangler will use the user's preference.
1596
- */
1597
- send_metrics: boolean | undefined;
1598
- /**
1599
- * Options to configure the development server that your worker will use.
1600
- *
1601
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#local-development-settings
1602
- */
1603
- dev: Dev;
1604
- /**
1605
- * The definition of a Worker Site, a feature that lets you upload
1606
- * static assets with your Worker.
1607
- *
1608
- * More details at https://developers.cloudflare.com/workers/platform/sites
1609
- *
1610
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-sites
1611
- */
1612
- site: {
1613
- /**
1614
- * The directory containing your static assets.
1615
- *
1616
- * It must be a path relative to your Wrangler configuration file.
1617
- * Example: bucket = "./public"
1618
- *
1619
- * If there is a `site` field then it must contain this `bucket` field.
1620
- */
1621
- bucket: string;
1622
- /**
1623
- * The location of your Worker script.
1624
- *
1625
- * @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.
1626
- * @breaking
1627
- */
1628
- "entry-point"?: string;
1629
- /**
1630
- * An exclusive list of .gitignore-style patterns that match file
1631
- * or directory names from your bucket location. Only matched
1632
- * items will be uploaded. Example: include = ["upload_dir"]
1633
- *
1634
- * @optional
1635
- * @default []
1636
- */
1637
- include?: string[];
1638
- /**
1639
- * A list of .gitignore-style patterns that match files or
1640
- * directories in your bucket that should be excluded from
1641
- * uploads. Example: exclude = ["ignore_dir"]
1642
- *
1643
- * @optional
1644
- * @default []
1645
- */
1646
- exclude?: string[];
1647
- } | undefined;
1648
- /**
1649
- * A list of wasm modules that your worker should be bound to. This is
1650
- * the "legacy" way of binding to a wasm module. ES module workers should
1651
- * do proper module imports.
1652
- */
1653
- wasm_modules: {
1654
- [key: string]: string;
1655
- } | undefined;
1656
- /**
1657
- * A list of text files that your worker should be bound to. This is
1658
- * the "legacy" way of binding to a text file. ES module workers should
1659
- * do proper module imports.
1660
- */
1661
- text_blobs: {
1662
- [key: string]: string;
1663
- } | undefined;
1664
- /**
1665
- * A list of data files that your worker should be bound to. This is
1666
- * the "legacy" way of binding to a data file. ES module workers should
1667
- * do proper module imports.
1668
- */
1669
- data_blobs: {
1670
- [key: string]: string;
1671
- } | undefined;
1672
- /**
1673
- * A map of module aliases. Lets you swap out a module for any others.
1674
- * Corresponds with esbuild's `alias` config
1675
- *
1676
- * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#module-aliasing
1677
- */
1678
- alias: {
1679
- [key: string]: string;
1680
- } | undefined;
1681
- /**
1682
- * By default, the Wrangler configuration file is the source of truth for your environment configuration, like a terraform file.
1683
- *
1684
- * If you change your vars in the dashboard, wrangler *will* override/delete them on its next deploy.
1685
- *
1686
- * If you want to keep your dashboard vars when wrangler deploys, set this field to true.
1687
- *
1688
- * @default false
1689
- * @nonInheritable
1690
- */
1691
- keep_vars?: boolean;
1692
- }
1693
- interface PagesConfigFields {
1694
- /**
1695
- * The directory of static assets to serve.
1696
- *
1697
- * The presence of this field in a Wrangler configuration file indicates a Pages project,
1698
- * and will prompt the handling of the configuration file according to the
1699
- * Pages-specific validation rules.
1700
- */
1701
- pages_build_output_dir?: string;
1702
- }
1703
- interface DevConfig {
1704
- /**
1705
- * IP address for the local dev server to listen on,
1706
- *
1707
- * @default localhost
1708
- */
1709
- ip: string;
1710
- /**
1711
- * Port for the local dev server to listen on
1712
- *
1713
- * @default 8787
1714
- */
1715
- port: number | undefined;
1716
- /**
1717
- * Port for the local dev server's inspector to listen on
1718
- *
1719
- * @default 9229
1720
- */
1721
- inspector_port: number | undefined;
1722
- /**
1723
- * Protocol that local wrangler dev server listens to requests on.
1724
- *
1725
- * @default http
1726
- */
1727
- local_protocol: "http" | "https";
1728
- /**
1729
- * Protocol that wrangler dev forwards requests on
1730
- *
1731
- * Setting this to `http` is not currently implemented for remote mode.
1732
- * See https://github.com/cloudflare/workers-sdk/issues/583
1733
- *
1734
- * @default https
1735
- */
1736
- upstream_protocol: "https" | "http";
1737
- /**
1738
- * Host to forward requests to, defaults to the host of the first route of project
1739
- */
1740
- host: string | undefined;
1741
- /**
1742
- * When developing, whether to build and connect to containers. This requires a Docker daemon to be running.
1743
- * Defaults to `true`.
1744
- *
1745
- * @default true
1746
- */
1747
- enable_containers: boolean;
1748
- /**
1749
- * Either the Docker unix socket i.e. `unix:///var/run/docker.sock` or a full configuration.
1750
- * Note that windows is only supported via WSL at the moment
1751
- */
1752
- container_engine: ContainerEngine | undefined;
1753
- }
1754
- type RawDevConfig = Partial<DevConfig>;
1755
- interface EnvironmentMap {
1756
- /**
1757
- * The `env` section defines overrides for the configuration for different environments.
1758
- *
1759
- * All environment fields can be specified at the top level of the config indicating the default environment settings.
1760
- *
1761
- * - Some fields are inherited and overridable in each environment.
1762
- * - But some are not inherited and must be explicitly specified in every environment, if they are specified at the top level.
1763
- *
1764
- * For more information, see the documentation at https://developers.cloudflare.com/workers/cli-wrangler/configuration#environments
1765
- *
1766
- * @default {}
1767
- */
1768
- env?: {
1769
- [envName: string]: RawEnvironment;
1770
- };
1771
- }
1772
- type OnlyCamelCase<T = Record<string, never>> = {
1773
- [key in keyof T as CamelCaseKey<key>]: T[key];
1774
- };
1775
-
1776
- /**
1777
- * Yargs options included in every wrangler command.
1778
- */
1779
- interface CommonYargsOptions {
1780
- v: boolean | undefined;
1781
- cwd: string | undefined;
1782
- config: string | undefined;
1783
- env: string | undefined;
1784
- "env-file": string[] | undefined;
1785
- "experimental-provision": boolean | undefined;
1786
- "experimental-auto-create": boolean;
1787
- }
1788
- type CommonYargsArgv = Argv<CommonYargsOptions>;
1789
- type RemoveIndex<T> = {
1790
- [K in keyof T as string extends K ? never : number extends K ? never : K]: T[K];
1791
- };
1792
-
1793
- type ResolveConfigPathOptions = {
1794
- useRedirectIfAvailable?: boolean;
1795
- };
1796
-
1797
- type NormalizeAndValidateConfigArgs = {
1798
- name?: string;
1799
- env?: string;
1800
- "legacy-env"?: boolean;
1801
- "dispatch-namespace"?: string;
1802
- remote?: boolean;
1803
- localProtocol?: string;
1804
- upstreamProtocol?: string;
1805
- script?: string;
1806
- enableContainers?: boolean;
1807
- };
1808
-
1809
- type ReadConfigCommandArgs = NormalizeAndValidateConfigArgs & {
1810
- config?: string;
1811
- script?: string;
1812
- };
1813
- type ReadConfigOptions = ResolveConfigPathOptions & {
1814
- hideWarnings?: boolean;
1815
- preserveOriginalMain?: boolean;
1816
- };
1817
- type ConfigBindingOptions = Pick<Config, "ai" | "browser" | "d1_databases" | "dispatch_namespaces" | "durable_objects" | "queues" | "r2_buckets" | "services" | "kv_namespaces" | "mtls_certificates" | "vectorize" | "workflows" | "vpc_services">;
1818
- /**
1819
- * Get the Wrangler configuration; read it from the give `configPath` if available.
1820
- */
1821
- declare function readConfig(args: ReadConfigCommandArgs, options?: ReadConfigOptions): Config;
1822
- declare const experimental_readRawConfig: (args: ReadConfigCommandArgs, options?: ReadConfigOptions) => {
1823
- rawConfig: RawConfig;
1824
- configPath: string | undefined;
1825
- userConfigPath: string | undefined;
1826
- };
1827
-
1828
16
  interface EnablePagesAssetsServiceBindingOptions {
1829
17
  proxyPort?: number;
1830
18
  directory?: string;
@@ -1998,22 +186,22 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
1998
186
  project_id: string;
1999
187
  project_name: string;
2000
188
  deployment_trigger: {
189
+ type: string;
2001
190
  metadata: {
2002
191
  branch: string;
2003
192
  commit_hash: string;
2004
193
  commit_message: string;
2005
194
  };
2006
- type: string;
2007
195
  };
2008
196
  latest_stage: {
2009
- name: "build" | "queued" | "deploy" | "initialize" | "clone_repo";
2010
197
  status: "canceled" | "active" | "idle" | "success" | "failure" | "skipped";
198
+ name: "build" | "queued" | "deploy" | "initialize" | "clone_repo";
2011
199
  started_on: string | null;
2012
200
  ended_on: string | null;
2013
201
  };
2014
202
  stages: {
2015
- name: "build" | "queued" | "deploy" | "initialize" | "clone_repo";
2016
203
  status: "canceled" | "active" | "idle" | "success" | "failure" | "skipped";
204
+ name: "build" | "queued" | "deploy" | "initialize" | "clone_repo";
2017
205
  started_on: string | null;
2018
206
  ended_on: string | null;
2019
207
  }[];
@@ -2031,7 +219,7 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
2031
219
  pr_comments_enabled?: boolean | undefined;
2032
220
  deployments_enabled?: boolean | undefined;
2033
221
  production_deployments_enabled?: boolean | undefined;
2034
- preview_deployment_setting?: "none" | "custom" | "all" | undefined;
222
+ preview_deployment_setting?: "custom" | "none" | "all" | undefined;
2035
223
  preview_branch_includes?: string[] | undefined;
2036
224
  preview_branch_excludes?: string[] | undefined;
2037
225
  };
@@ -2050,6 +238,11 @@ declare const unstable_pages: {
2050
238
  deploy: typeof deploy;
2051
239
  };
2052
240
 
241
+ /**
242
+ * The compliance region to use for the API requests.
243
+ */
244
+ type ComplianceConfig = Partial<Pick<Config, "compliance_region">>;
245
+
2053
246
  type _Params<ParamsArray extends [unknown?]> = ParamsArray extends [infer P] ? P : undefined;
2054
247
  type _EventMethods = keyof Protocol.Events;
2055
248
  type DevToolsEvent<Method extends _EventMethods> = Method extends unknown ? {
@@ -2057,29 +250,6 @@ type DevToolsEvent<Method extends _EventMethods> = Method extends unknown ? {
2057
250
  params: _Params<Protocol.Events[Method]>;
2058
251
  } : never;
2059
252
 
2060
- /**
2061
- * This is used to provide telemetry with a sanitised error
2062
- * message that could not have any user-identifying information.
2063
- * Set to `true` to duplicate `message`.
2064
- * */
2065
- type TelemetryMessage = {
2066
- telemetryMessage?: string | true;
2067
- };
2068
- /**
2069
- * Base class for errors where the user has done something wrong. These are not
2070
- * reported to Sentry. API errors are intentionally *not* `UserError`s, and are
2071
- * reported to Sentry. This will help us understand which API errors need better
2072
- * messaging.
2073
- */
2074
- declare class UserError extends Error {
2075
- telemetryMessage: string | undefined;
2076
- constructor(message?: string | undefined, options?: (ErrorOptions & TelemetryMessage) | undefined);
2077
- }
2078
- declare class FatalError extends UserError {
2079
- readonly code?: number | undefined;
2080
- constructor(message?: string, code?: number | undefined, options?: TelemetryMessage);
2081
- }
2082
-
2083
253
  type AssetsOptions = {
2084
254
  directory: string;
2085
255
  binding?: string;
@@ -2353,13 +523,13 @@ type Hook<T extends HookValues, Args extends unknown[] = []> = T | ((...args: Ar
2353
523
  type AsyncHook<T extends HookValues, Args extends unknown[] = []> = Hook<T, Args> | Hook<Promise<T>, Args>;
2354
524
  type Bundle = EsbuildBundle;
2355
525
  type LogLevel = "debug" | "info" | "log" | "warn" | "error" | "none";
2356
- type File$1<Contents = string, Path = string> = {
526
+ type File<Contents = string, Path = string> = {
2357
527
  path: Path;
2358
528
  } | {
2359
529
  contents: Contents;
2360
530
  path?: Path;
2361
531
  };
2362
- type BinaryFile = File$1<Uint8Array>;
532
+ type BinaryFile = File<Uint8Array>;
2363
533
  type QueueConsumer = NonNullable<Config["queues"]["consumers"]>[number];
2364
534
  type Trigger = {
2365
535
  type: "workers.dev";
@@ -2395,7 +565,7 @@ type Binding = {
2395
565
  source: BinaryFile;
2396
566
  } | {
2397
567
  type: "text_blob";
2398
- source: File$1;
568
+ source: File;
2399
569
  } | ({
2400
570
  type: "browser";
2401
571
  } & BindingOmit<CfBrowserBinding>) | ({
@@ -2670,6 +840,19 @@ declare class DevEnv extends EventEmitter {
2670
840
 
2671
841
  declare function startWorker(options: StartDevWorkerInput): Promise<Worker>;
2672
842
 
843
+ type ReadConfigCommandArgs = NormalizeAndValidateConfigArgs & {
844
+ config?: string;
845
+ script?: string;
846
+ };
847
+ type ReadConfigOptions = ResolveConfigPathOptions & {
848
+ hideWarnings?: boolean;
849
+ preserveOriginalMain?: boolean;
850
+ };
851
+ /**
852
+ * Get the Wrangler configuration; read it from the give `configPath` if available.
853
+ */
854
+ declare function readConfig(args: ReadConfigCommandArgs, options?: ReadConfigOptions): Config;
855
+
2673
856
  /**
2674
857
  * Note about this file:
2675
858
  *
@@ -2896,34 +1079,6 @@ declare function maybeStartOrUpdateRemoteProxySession(wranglerOrWorkerConfigObje
2896
1079
  remoteBindings: Record<string, Binding>;
2897
1080
  } | null>;
2898
1081
 
2899
- type Message = {
2900
- text: string;
2901
- location?: Location;
2902
- notes?: Message[];
2903
- kind?: "warning" | "error";
2904
- } & TelemetryMessage;
2905
- type Location = File & {
2906
- line: number;
2907
- column: number;
2908
- length?: number;
2909
- lineText?: string;
2910
- suggestion?: string;
2911
- };
2912
- type File = {
2913
- file?: string;
2914
- fileText?: string;
2915
- };
2916
- /**
2917
- * An error that's thrown when something fails to parse.
2918
- */
2919
- declare class ParseError extends UserError implements Message {
2920
- readonly text: string;
2921
- readonly notes: Message[];
2922
- readonly location?: Location;
2923
- readonly kind: "warning" | "error";
2924
- constructor({ text, notes, location, kind, telemetryMessage }: Message);
2925
- }
2926
-
2927
1082
  declare const LOGGER_LEVELS: {
2928
1083
  readonly none: -1;
2929
1084
  readonly error: 0;
@@ -2939,8 +1094,8 @@ declare class Logger {
2939
1094
  constructor();
2940
1095
  private overrideLoggerLevel?;
2941
1096
  private onceHistory;
2942
- get loggerLevel(): "none" | "debug" | "error" | "info" | "log" | "warn";
2943
- set loggerLevel(val: "none" | "debug" | "error" | "info" | "log" | "warn");
1097
+ get loggerLevel(): "debug" | "error" | "none" | "info" | "log" | "warn";
1098
+ set loggerLevel(val: "debug" | "error" | "none" | "info" | "log" | "warn");
2944
1099
  resetLoggerLevel(): void;
2945
1100
  columns: number;
2946
1101
  json: (data: unknown) => void;
@@ -2975,17 +1130,6 @@ declare class Logger {
2975
1130
  */
2976
1131
  declare function splitSqlQuery(sql: string): string[];
2977
1132
 
2978
- declare const experimental_patchConfig: (configPath: string,
2979
- /**
2980
- * if you want to add something new, e.g. a binding, you can just provide that {kv_namespace:[{binding:"KV"}]}
2981
- * and set isArrayInsertion = true
2982
- *
2983
- * if you want to edit or delete existing array elements, you have to provide the whole array
2984
- * e.g. {kv_namespace:[{binding:"KV", id:"new-id"}, {binding:"KV2", id:"untouched"}]}
2985
- * and set isArrayInsertion = false
2986
- */
2987
- patch: RawConfig, isArrayInsertion?: boolean) => string;
2988
-
2989
1133
  /**
2990
1134
  * Make a fetch request, and extract the `result` from the JSON response.
2991
1135
  */
@@ -2998,6 +1142,23 @@ type ExperimentalFlags = {
2998
1142
  AUTOCREATE_RESOURCES: boolean;
2999
1143
  };
3000
1144
 
1145
+ /**
1146
+ * Yargs options included in every wrangler command.
1147
+ */
1148
+ interface CommonYargsOptions {
1149
+ v: boolean | undefined;
1150
+ cwd: string | undefined;
1151
+ config: string | undefined;
1152
+ env: string | undefined;
1153
+ "env-file": string[] | undefined;
1154
+ "experimental-provision": boolean | undefined;
1155
+ "experimental-auto-create": boolean;
1156
+ }
1157
+ type CommonYargsArgv = Argv<CommonYargsOptions>;
1158
+ type RemoveIndex<T> = {
1159
+ [K in keyof T as string extends K ? never : number extends K ? never : K]: T[K];
1160
+ };
1161
+
3001
1162
  // Team names from https://wiki.cfdata.org/display/EW/Developer+Platform+Components+and+Pillar+Ownership
3002
1163
  type Teams =
3003
1164
  | "Workers: Onboarding & Integrations"
@@ -3047,6 +1208,9 @@ type ArgDefinition = Omit<PositionalOptions, "type"> & Pick<Options, "hidden" |
3047
1208
  type NamedArgDefinitions = {
3048
1209
  [key: string]: ArgDefinition;
3049
1210
  };
1211
+ type OnlyCamelCase<T = Record<string, never>> = {
1212
+ [key in keyof T as CamelCaseKey<key>]: T[key];
1213
+ };
3050
1214
  type HandlerArgs<Args extends NamedArgDefinitions> = DeepFlatten<OnlyCamelCase<RemoveIndex<ArgumentsCamelCase<CommonYargsOptions & InferredOptionTypes<Args> & Alias<Args>>>>>;
3051
1215
  type HandlerContext = {
3052
1216
  /**
@@ -3274,4 +1438,4 @@ interface Unstable_ASSETSBindingsOptions {
3274
1438
  }
3275
1439
  declare const generateASSETSBinding: (opts: Unstable_ASSETSBindingsOptions) => (request: Request) => Promise<Response$1>;
3276
1440
 
3277
- export { type Binding, type ConfigBindingOptions as Experimental_ConfigBindingOptions, 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, experimental_getWranglerCommands, experimental_patchConfig, experimental_readRawConfig, getPlatformProxy, maybeStartOrUpdateRemoteProxySession, startRemoteProxySession, DevEnv as unstable_DevEnv, convertConfigBindingsToStartWorkerBindings as unstable_convertConfigBindingsToStartWorkerBindings, unstable_dev, generateASSETSBinding as unstable_generateASSETSBinding, unstable_getMiniflareWorkerOptions, getVarsForDev as unstable_getVarsForDev, unstable_pages, readConfig as unstable_readConfig, splitSqlQuery as unstable_splitSqlQuery, startWorker as unstable_startWorker };
1441
+ 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, experimental_getWranglerCommands, getPlatformProxy, maybeStartOrUpdateRemoteProxySession, startRemoteProxySession, DevEnv as unstable_DevEnv, convertConfigBindingsToStartWorkerBindings as unstable_convertConfigBindingsToStartWorkerBindings, unstable_dev, generateASSETSBinding as unstable_generateASSETSBinding, unstable_getMiniflareWorkerOptions, getVarsForDev as unstable_getVarsForDev, unstable_pages, readConfig as unstable_readConfig, splitSqlQuery as unstable_splitSqlQuery, startWorker as unstable_startWorker };