-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathenvironment.ts
More file actions
1498 lines (1373 loc) · 41.7 KB
/
environment.ts
File metadata and controls
1498 lines (1373 loc) · 41.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import type { Json } from "../types";
/**
* The `Environment` interface declares all the configuration fields that
* can be specified for an environment.
*
* This could be the top-level default environment, or a specific named environment.
*/
export interface Environment
extends EnvironmentInheritable,
EnvironmentNonInheritable {}
type SimpleRoute = string;
export type ZoneIdRoute = {
pattern: string;
zone_id: string;
custom_domain?: boolean;
};
export type ZoneNameRoute = {
pattern: string;
zone_name: string;
custom_domain?: boolean;
};
export type CustomDomainRoute = { pattern: string; custom_domain: boolean };
export type Route =
| SimpleRoute
| ZoneIdRoute
| ZoneNameRoute
| CustomDomainRoute;
/**
* Configuration in wrangler for Cloudchamber
*/
export type CloudchamberConfig = {
image?: string;
location?: string;
instance_type?:
| "dev"
| "basic"
| "standard"
| "lite"
| "standard-1"
| "standard-2"
| "standard-3"
| "standard-4";
vcpu?: number;
memory?: string;
ipv4?: boolean;
};
type UnsafeBinding = {
/**
* The name of the binding provided to the Worker
*/
name: string;
/**
* The 'type' of the unsafe binding.
*/
type: string;
dev?: {
plugin: {
/**
* Package is the bare specifier of the package that exposes plugins to integrate into Miniflare via a named `plugins` export.
* @example "@cloudflare/my-external-miniflare-plugin"
*/
package: string;
/**
* Plugin is the name of the plugin exposed by the package.
* @example "MY_UNSAFE_PLUGIN"
*/
name: string;
};
/**
* Optional mapping of unsafe bindings names to options provided for the plugin.
*/
options?: Record<string, unknown>;
};
[key: string]: unknown;
};
/**
* Configuration for a container application
*/
export type ContainerApp = {
// TODO: fill out the entire type
/**
* Name of the application
* @optional Defaults to `worker_name-class_name` if not specified.
*/
name?: string;
// not used when deploying container with wrangler deploy
/**
* Number of application instances
* @deprecated
* @hidden
*/
instances?: number;
/**
* Number of maximum application instances.
* @optional
*/
max_instances?: number;
/**
* The path to a Dockerfile, or an image URI for the Cloudflare registry.
*/
image: string;
/**
* Build context of the application.
* @optional - defaults to the directory of `image`.
*/
image_build_context?: string;
/**
* Image variables available to the image at build-time only.
* For runtime env vars, refer to https://developers.cloudflare.com/containers/examples/env-vars-and-secrets/
* @optional
*/
image_vars?: Record<string, string>;
/**
* The class name of the Durable Object the container is connected to.
*/
class_name: string;
/**
* The scheduling policy of the application
* @optional
* @default "default"
*/
scheduling_policy?: "default" | "moon" | "regional";
/**
* The instance type to be used for the container.
* Select from one of the following named instance types:
* - lite: 1/16 vCPU, 256 MiB memory, and 2 GB disk
* - basic: 1/4 vCPU, 1 GiB memory, and 4 GB disk
* - standard-1: 1/2 vCPU, 4 GiB memory, and 8 GB disk
* - standard-2: 1 vCPU, 6 GiB memory, and 12 GB disk
* - standard-3: 2 vCPU, 8 GiB memory, and 16 GB disk
* - standard-4: 4 vCPU, 12 GiB memory, and 20 GB disk
* - dev: 1/16 vCPU, 256 MiB memory, and 2 GB disk (deprecated, use "lite" instead)
* - standard: 1 vCPU, 4 GiB memory, and 4 GB disk (deprecated, use "standard-1" instead)
*
* Customers on an enterprise plan have the additional option to set custom limits.
*
* @optional
* @default "dev"
*/
instance_type?:
| "dev"
| "basic"
| "standard"
| "lite"
| "standard-1"
| "standard-2"
| "standard-3"
| "standard-4"
| {
/** @defaults to 0.0625 (1/16 vCPU) */
vcpu?: number;
/** @defaults to 256 MiB */
memory_mib?: number;
/** @defaults to 2 GB */
disk_mb?: number;
};
wrangler_ssh?: {
/**
* If enabled, those with write access to a container will be able to SSH into it through Wrangler.
* @default false
*/
enabled: boolean;
/**
* Port that the SSH service is running on
* @defaults to 22
*/
port?: number;
};
/**
* SSH public keys to put in the container's authorized_keys file.
*/
authorized_keys?: { name: string; public_key: string }[];
/**
* Trusted user CA keys to put in the container's trusted_user_ca_keys file.
*/
trusted_user_ca_keys?: { name?: string; public_key: string }[];
/**
* @deprecated Use top level `containers` fields instead.
* `configuration.image` should be `image`
* limits should be set via `instance_type`
* @hidden
*/
configuration?: {
image?: string;
// not used when deploying container with wrangler deploy
labels?: { name: string; value: string }[];
// not used when deploying container with wrangler deploy
secrets?: { name: string; type: "env"; secret: string }[];
disk?: { size_mb: number };
vcpu?: number;
memory_mib?: number;
};
/**
* Scheduling constraints
* @hidden
*/
constraints?: {
regions?: string[];
cities?: string[];
/**
* @deprecated Use `tiers` instead
*/
tier?: number;
tiers?: number[];
};
/**
* Scheduling affinities
* @hidden
*/
affinities?: {
colocation?: "datacenter";
hardware_generation?: "highest-overall-performance";
};
// not used when deploying container with wrangler deploy
/**
* @deprecated use the `class_name` field instead.
* @hidden
*/
durable_objects?: {
namespace_id: string;
};
/**
* Configures what percentage of instances should be updated at each step of a rollout.
* You can specify this as a single number, or an array of numbers.
*
* If this is a single number, each step will progress by that percentage.
* The options are 5, 10, 20, 25, 50 or 100.
*
* If this is an array, each step specifies the cumulative rollout progress.
* The final step must be 100.
*
* This can be overridden adhoc by deploying with the `--containers-rollout=immediate` flag,
* which will roll out to 100% of instances in one step.
*
* @optional
* @default [10,100]
* */
rollout_step_percentage?: number | number[];
/**
* How a rollout should be created. It supports the following modes:
* - full_auto: The container application will be rolled out fully automatically.
* - none: The container application won't have a roll out or update.
* - manual: The container application will be rollout fully by manually actioning progress steps.
* @optional
* @default "full_auto"
* @hidden
*/
rollout_kind?: "full_auto" | "none" | "full_manual";
/**
* Configures the grace period (in seconds) for active instances before being shutdown during a rollout.
* @optional
* @default 0
*/
rollout_active_grace_period?: number;
/**
* Directly passed to the API without wrangler-side validation or transformation.
* @hidden
*/
unsafe?: Record<string, unknown>;
};
/**
* Configuration in wrangler for Durable Object Migrations
*/
export type DurableObjectMigration = {
/** A unique identifier for this migration. */
tag: string;
/** The new Durable Objects being defined. */
new_classes?: string[];
/** The new SQLite Durable Objects being defined. */
new_sqlite_classes?: string[];
/** The Durable Objects being renamed. */
renamed_classes?: {
from: string;
to: string;
}[];
/** The Durable Objects being removed. */
deleted_classes?: string[];
};
/**
* The `EnvironmentInheritable` interface declares all the configuration fields for an environment
* that can be inherited (and overridden) from the top-level environment.
*/
interface EnvironmentInheritable {
/**
* The name of your Worker. Alphanumeric + dashes only.
*
* @inheritable
*/
name: string | undefined;
/**
* This is the ID of the account associated with your zone.
* You might have more than one account, so make sure to use
* the ID of the account associated with the zone/route you
* provide, if you provide one. It can also be specified through
* the CLOUDFLARE_ACCOUNT_ID environment variable.
*
* @inheritable
*/
account_id: string | undefined;
/**
* A date in the form yyyy-mm-dd, which will be used to determine
* which version of the Workers runtime is used.
*
* More details at https://developers.cloudflare.com/workers/configuration/compatibility-dates
*
* @inheritable
*/
compatibility_date: string | undefined;
/**
* A list of flags that enable features from upcoming features of
* the Workers runtime, usually used together with compatibility_date.
*
* More details at https://developers.cloudflare.com/workers/configuration/compatibility-flags/
*
* @default []
* @inheritable
*/
compatibility_flags: string[];
/**
* The entrypoint/path to the JavaScript file that will be executed.
*
* @inheritable
*/
main: string | undefined;
/**
* If true then Wrangler will traverse the file tree below `base_dir`;
* Any files that match `rules` will be included in the deployed Worker.
* Defaults to true if `no_bundle` is true, otherwise false.
*
* @inheritable
*/
find_additional_modules: boolean | undefined;
/**
* Determines whether Wrangler will preserve bundled file names.
* Defaults to false.
* If left unset, files will be named using the pattern ${fileHash}-${basename},
* for example, `34de60b44167af5c5a709e62a4e20c4f18c9e3b6-favicon.ico`.
*
* @inheritable
*/
preserve_file_names: boolean | undefined;
/**
* The directory in which module rules should be evaluated when including additional files into a Worker deployment.
* This defaults to the directory containing the `main` entry point of the Worker if not specified.
*
* @inheritable
*/
base_dir: string | undefined;
// Carmen according to our tests the default is undefined
// warning: you must force "workers_dev: true" in tests to match expected behavior
/**
* Whether we use <name>.<subdomain>.workers.dev to
* test and deploy your Worker.
*
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workersdev
*
* @default true
* @breaking
* @inheritable
*/
workers_dev: boolean | undefined;
/**
* Whether we use <version>-<name>.<subdomain>.workers.dev to
* serve Preview URLs for your Worker.
*
* @default false
* @inheritable
*/
preview_urls: boolean | undefined;
/**
* A list of routes that your Worker should be published to.
* Only one of `routes` or `route` is required.
*
* Only required when workers_dev is false, and there's no scheduled Worker (see `triggers`)
*
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
*
* @inheritable
*/
routes: Route[] | undefined;
/**
* A route that your Worker should be published to. Literally
* the same as routes, but only one.
* Only one of `routes` or `route` is required.
*
* Only required when workers_dev is false, and there's no scheduled Worker
*
* @inheritable
*/
route: Route | undefined;
/**
* Path to a custom tsconfig
*
* @inheritable
*/
tsconfig: string | undefined;
/**
* The function to use to replace jsx syntax.
*
* @default "React.createElement"
* @inheritable
*/
jsx_factory: string;
/**
* The function to use to replace jsx fragment syntax.
*
* @default "React.Fragment"
* @inheritable
*/
jsx_fragment: string;
/**
* A list of migrations that should be uploaded with your Worker.
*
* These define changes in your Durable Object declarations.
*
* More details at https://developers.cloudflare.com/workers/learning/using-durable-objects#configuring-durable-object-classes-with-migrations
*
* @default []
* @inheritable
*/
migrations: DurableObjectMigration[];
/**
* "Cron" definitions to trigger a Worker's "scheduled" function.
*
* Lets you call Workers periodically, much like a cron job.
*
* More details here https://developers.cloudflare.com/workers/platform/cron-triggers
*
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
*
* @default {crons:[]}
* @inheritable
*/
triggers: { crons: string[] | undefined };
/**
* Specify limits for runtime behavior.
* Only supported for the "standard" Usage Model
*
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#limits
*
* @inheritable
*/
limits: UserLimits | undefined;
/**
* An ordered list of rules that define which modules to import,
* and what type to import them as. You will need to specify rules
* to use Text, Data, and CompiledWasm modules, or when you wish to
* have a .js file be treated as an ESModule instead of CommonJS.
*
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#bundling
*
* @inheritable
*/
rules: Rule[];
/**
* Configures a custom build step to be run by Wrangler when building your Worker.
*
* Refer to the [custom builds documentation](https://developers.cloudflare.com/workers/cli-wrangler/configuration#build)
* for more details.
*
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#custom-builds
*
* @default {watch_dir:"./src"}
*/
build: {
/** 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. */
command?: string;
/** The directory in which the command is executed. */
cwd?: string;
/** The directory to watch for changes while using wrangler dev, defaults to the current working directory */
watch_dir?: string | string[];
};
/**
* Skip internal build steps and directly deploy script
* @inheritable
*/
no_bundle: boolean | undefined;
/**
* Minify the script before uploading.
* @inheritable
*/
minify: boolean | undefined;
/**
* Set the `name` property to the original name for functions and classes renamed during minification.
*
* See https://esbuild.github.io/api/#keep-names
*
* @default true
* @inheritable
*/
keep_names: boolean | undefined;
/**
* Designates this Worker as an internal-only "first-party" Worker.
*
* @inheritable
*/
first_party_worker: boolean | undefined;
/**
* List of bindings that you will send to logfwdr
*
* @default {bindings:[]}
* @inheritable
*/
logfwdr: {
bindings: {
/** The binding name used to refer to logfwdr */
name: string;
/** The destination for this logged message */
destination: string;
}[];
};
/**
* Send Trace Events from this Worker to Workers Logpush.
*
* This will not configure a corresponding Logpush job automatically.
*
* For more information about Workers Logpush, see:
* https://blog.cloudflare.com/logpush-for-workers/
*
* @inheritable
*/
logpush: boolean | undefined;
/**
* Include source maps when uploading this worker.
*
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#source-maps
*
* @inheritable
*/
upload_source_maps: boolean | undefined;
/**
* Specify how the Worker should be located to minimize round-trip time.
*
* More details: https://developers.cloudflare.com/workers/platform/smart-placement/
*
* @inheritable
*/
placement:
| { mode: "off" | "smart"; hint?: string }
| { mode?: "targeted"; region: string }
| { mode?: "targeted"; host: string }
| { mode?: "targeted"; hostname: string }
| undefined;
/**
* Specify the directory of static assets to deploy/serve
*
* More details at https://developers.cloudflare.com/workers/frameworks/
*
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
*
* @inheritable
*/
assets: Assets | undefined;
/**
* Specify the observability behavior of the Worker.
*
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#observability
*
* @inheritable
*/
observability: Observability | undefined;
/**
* Specify the cache behavior of the Worker.
*
* @inheritable
* @hidden
*/
cache: CacheOptions | undefined;
/**
* Specify the compliance region mode of the Worker.
*
* Although if the user does not specify a compliance region, the default is `public`,
* it can be set to `undefined` in configuration to delegate to the CLOUDFLARE_COMPLIANCE_REGION environment variable.
*/
compliance_region: "public" | "fedramp_high" | undefined;
/**
* Configuration for Python modules.
*
* @inheritable
*/
python_modules: {
/**
* A list of glob patterns to exclude files from the python_modules directory when bundling.
*
* Patterns are relative to the python_modules directory and use glob syntax.
*
* @default ["**\*.pyc"]
*/
exclude: string[];
};
}
export type DurableObjectBindings = {
/** The name of the binding used to refer to the Durable Object */
name: string;
/** The exported class name of the Durable Object */
class_name: string;
/** The script where the Durable Object is defined (if it's external to this Worker) */
script_name?: string;
/** The service environment of the script_name to bind to */
environment?: string;
}[];
export type WorkflowBinding = {
/** The name of the binding used to refer to the Workflow */
binding: string;
/** The name of the Workflow */
name: string;
/** The exported class name of the Workflow */
class_name: string;
/** The script where the Workflow is defined (if it's external to this Worker) */
script_name?: string;
/** Whether the Workflow should be remote or not in local development */
remote?: boolean;
/** Optional limits for the Workflow */
limits?: {
/** Maximum number of steps a Workflow instance can execute */
steps?: number;
};
};
/**
* The `EnvironmentNonInheritable` interface declares all the configuration fields for an environment
* that cannot be inherited from the top-level environment, and must be defined specifically.
*
* If any of these fields are defined at the top-level then they should also be specifically defined
* for each named environment.
*/
export interface EnvironmentNonInheritable {
/**
* A map of values to substitute when deploying your Worker.
*
* NOTE: This field is not automatically inherited from the top level environment,
* and so must be specified in every named environment.
*
* @default {}
* @nonInheritable
*/
define: Record<string, string>;
/**
* A map of environment variables to set when deploying your Worker.
*
* NOTE: This field is not automatically inherited from the top level environment,
* and so must be specified in every named environment.
*
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
*
* @default {}
* @nonInheritable
*/
vars: Record<string, string | Json>;
/**
* Secrets configuration (experimental).
*
* NOTE: This field is not automatically inherited from the top level environment,
* and so must be specified in every named environment.
*
* @nonInheritable
*/
secrets?: {
/**
* List of secret names that are required by your Worker.
* When defined, this property:
* - Replaces .dev.vars/.env/process.env inference for type generation
* - Enables local dev validation with warnings for missing secrets
*/
required?: string[];
};
/**
* A list of durable objects that your Worker should be bound to.
*
* For more information about Durable Objects, see the documentation at
* https://developers.cloudflare.com/workers/learning/using-durable-objects
*
* NOTE: This field is not automatically inherited from the top level environment,
* and so must be specified in every named environment.
*
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
*
* @default {bindings:[]}
* @nonInheritable
*/
durable_objects: {
bindings: DurableObjectBindings;
};
/**
* A list of workflows that your Worker should be bound to.
*
* NOTE: This field is not automatically inherited from the top level environment,
* and so must be specified in every named environment.
*
* @default []
* @nonInheritable
*/
workflows: WorkflowBinding[];
/**
* Cloudchamber configuration
*
* NOTE: This field is not automatically inherited from the top level environment,
* and so must be specified in every named environment.
*
* @default {}
* @nonInheritable
*/
cloudchamber: CloudchamberConfig;
/**
* Container related configuration
*
* NOTE: This field is not automatically inherited from the top level environment,
* and so must be specified in every named environment.
*
* @default []
* @nonInheritable
*/
containers?: ContainerApp[];
/**
* These specify any Workers KV Namespaces you want to
* access from inside your Worker.
*
* To learn more about KV Namespaces,
* see the documentation at https://developers.cloudflare.com/workers/learning/how-kv-works
*
* NOTE: This field is not automatically inherited from the top level environment,
* and so must be specified in every named environment.
*
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
*
* @default []
* @nonInheritable
*/
kv_namespaces: {
/** The binding name used to refer to the KV Namespace */
binding: string;
/** The ID of the KV namespace */
id?: string;
/** The ID of the KV namespace used during `wrangler dev` */
preview_id?: string;
/** Whether the KV namespace should be remote or not in local development */
remote?: boolean;
}[];
/**
* These specify bindings to send email from inside your Worker.
*
* NOTE: This field is not automatically inherited from the top level environment,
* and so must be specified in every named environment.
*
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#email-bindings
*
* @default []
* @nonInheritable
*/
send_email: {
/** The binding name used to refer to the this binding */
name: string;
/** If this binding should be restricted to a specific verified address */
destination_address?: string;
/** If this binding should be restricted to a set of verified addresses */
allowed_destination_addresses?: string[];
/** If this binding should be restricted to a set of sender addresses */
allowed_sender_addresses?: string[];
/** Whether the binding should be remote or not in local development */
remote?: boolean;
}[];
/**
* Specifies Queues that are bound to this Worker environment.
*
* NOTE: This field is not automatically inherited from the top level environment,
* and so must be specified in every named environment.
*
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
*
* @default {consumers:[],producers:[]}
* @nonInheritable
*/
queues: {
/** Producer bindings */
producers?: {
/** The binding name used to refer to the Queue in the Worker. */
binding: string;
/** The name of this Queue. */
queue: string;
/** The number of seconds to wait before delivering a message */
delivery_delay?: number;
/** Whether the Queue producer should be remote or not in local development */
remote?: boolean;
}[];
/** Consumer configuration */
consumers?: {
/** The name of the queue from which this consumer should consume. */
queue: string;
/** The consumer type, e.g., worker, http-pull, r2-bucket, etc. Default is worker. */
type?: string;
/** The maximum number of messages per batch */
max_batch_size?: number;
/** The maximum number of seconds to wait to fill a batch with messages. */
max_batch_timeout?: number;
/** The maximum number of retries for each message. */
max_retries?: number;
/** The queue to send messages that failed to be consumed. */
dead_letter_queue?: string;
/** 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. */
max_concurrency?: number | null;
/** The number of milliseconds to wait for pulled messages to become visible again */
visibility_timeout_ms?: number;
/** The number of seconds to wait before retrying a message */
retry_delay?: number;
}[];
};
/**
* Specifies R2 buckets that are bound to this Worker environment.
*
* NOTE: This field is not automatically inherited from the top level environment,
* and so must be specified in every named environment.
*
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
*
* @default []
* @nonInheritable
*/
r2_buckets: {
/** The binding name used to refer to the R2 bucket in the Worker. */
binding: string;
/** The name of this R2 bucket at the edge. */
bucket_name?: string;
/** The preview name of this R2 bucket at the edge. */
preview_bucket_name?: string;
/** The jurisdiction that the bucket exists in. Default if not present. */
jurisdiction?: string;
/** Whether the R2 bucket should be remote or not in local development */
remote?: boolean;
}[];
/**
* Specifies D1 databases that are bound to this Worker environment.
*
* NOTE: This field is not automatically inherited from the top level environment,
* and so must be specified in every named environment.
*
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
*
* @default []
* @nonInheritable
*/
d1_databases: {
/** The binding name used to refer to the D1 database in the Worker. */
binding: string;
/** The name of this D1 database. */
database_name?: string;
/** The UUID of this D1 database (not required). */
database_id?: string;
/** The UUID of this D1 database for Wrangler Dev (if specified). */
preview_database_id?: string;
/** The name of the migrations table for this D1 database (defaults to 'd1_migrations'). */
migrations_table?: string;
/** The path to the directory of migrations for this D1 database (defaults to './migrations'). */
migrations_dir?: string;
/** Internal use only. */
database_internal_env?: string;
/** Whether the D1 database should be remote or not in local development */
remote?: boolean;
}[];
/**
* Specifies Vectorize indexes that are bound to this Worker environment.
*
* NOTE: This field is not automatically inherited from the top level environment,
* and so must be specified in every named environment.
*
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
*
* @default []
* @nonInheritable
*/
vectorize: {
/** The binding name used to refer to the Vectorize index in the Worker. */
binding: string;
/** The name of the index. */
index_name: string;
/** Whether the Vectorize index should be remote or not in local development */
remote?: boolean;
}[];
/**
* Specifies Hyperdrive configs that are bound to this Worker environment.
*
* NOTE: This field is not automatically inherited from the top level environment,
* and so must be specified in every named environment.
*
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
*
* @default []
* @nonInheritable
*/
hyperdrive: {
/** The binding name used to refer to the project in the Worker. */
binding: string;
/** The id of the database. */
id: string;
/** The local database connection string for `wrangler dev` */
localConnectionString?: string;
}[];
/**
* Specifies service bindings (Worker-to-Worker) that are bound to this Worker environment.
*
* NOTE: This field is not automatically inherited from the top level environment,
* and so must be specified in every named environment.
*
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
*
* @default []
* @nonInheritable
*/
services:
| {
/** The binding name used to refer to the bound service. */