wrangler 0.0.0-ecdfabed0 → 0.0.0-ecef68635

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.
@@ -2,6 +2,39 @@
2
2
  "$ref": "#/definitions/RawConfig",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "definitions": {
5
+ "Assets": {
6
+ "additionalProperties": false,
7
+ "properties": {
8
+ "binding": {
9
+ "type": "string"
10
+ },
11
+ "directory": {
12
+ "description": "Absolute path to assets directory",
13
+ "type": "string"
14
+ },
15
+ "html_handling": {
16
+ "enum": [
17
+ "auto-trailing-slash",
18
+ "force-trailing-slash",
19
+ "drop-trailing-slash",
20
+ "none"
21
+ ],
22
+ "type": "string"
23
+ },
24
+ "not_found_handling": {
25
+ "enum": [
26
+ "single-page-application",
27
+ "404-page",
28
+ "none"
29
+ ],
30
+ "type": "string"
31
+ }
32
+ },
33
+ "required": [
34
+ "directory"
35
+ ],
36
+ "type": "object"
37
+ },
5
38
  "CloudchamberConfig": {
6
39
  "additionalProperties": false,
7
40
  "description": "Configuration in wrangler for Cloudchamber",
@@ -137,6 +170,61 @@
137
170
  },
138
171
  "type": "array"
139
172
  },
173
+ "DurableObjectMigration": {
174
+ "additionalProperties": false,
175
+ "description": "Configuration in wrangler for Durable Object Migrations",
176
+ "properties": {
177
+ "deleted_classes": {
178
+ "description": "The Durable Objects being removed.",
179
+ "items": {
180
+ "type": "string"
181
+ },
182
+ "type": "array"
183
+ },
184
+ "new_classes": {
185
+ "description": "The new Durable Objects being defined.",
186
+ "items": {
187
+ "type": "string"
188
+ },
189
+ "type": "array"
190
+ },
191
+ "new_sqlite_classes": {
192
+ "description": "The new SQLite Durable Objects being defined.",
193
+ "items": {
194
+ "type": "string"
195
+ },
196
+ "type": "array"
197
+ },
198
+ "renamed_classes": {
199
+ "description": "The Durable Objects being renamed.",
200
+ "items": {
201
+ "additionalProperties": false,
202
+ "properties": {
203
+ "from": {
204
+ "type": "string"
205
+ },
206
+ "to": {
207
+ "type": "string"
208
+ }
209
+ },
210
+ "required": [
211
+ "from",
212
+ "to"
213
+ ],
214
+ "type": "object"
215
+ },
216
+ "type": "array"
217
+ },
218
+ "tag": {
219
+ "description": "A unique identifier for this migration.",
220
+ "type": "string"
221
+ }
222
+ },
223
+ "required": [
224
+ "tag"
225
+ ],
226
+ "type": "object"
227
+ },
140
228
  "Environment": {
141
229
  "additionalProperties": false,
142
230
  "description": "The `Environment` interface declares all the configuration fields that can be specified for an environment.\n\nThis could be the top-level default environment, or a specific named environment.",
@@ -184,6 +272,10 @@
184
272
  },
185
273
  "type": "array"
186
274
  },
275
+ "assets": {
276
+ "$ref": "#/definitions/Assets",
277
+ "description": "Specify the directory of static assets to deploy/serve\n\nMore details at https://developers.cloudflare.com/workers/frameworks/"
278
+ },
187
279
  "base_dir": {
188
280
  "description": "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.",
189
281
  "type": "string"
@@ -349,10 +441,6 @@
349
441
  ],
350
442
  "type": "object"
351
443
  },
352
- "experimental_assets": {
353
- "$ref": "#/definitions/ExperimentalAssets",
354
- "description": "Specify the directory of static assets to deploy/serve"
355
- },
356
444
  "find_additional_modules": {
357
445
  "description": "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.",
358
446
  "type": "boolean"
@@ -473,58 +561,7 @@
473
561
  "default": [],
474
562
  "description": "A list of migrations that should be uploaded with your Worker.\n\nThese define changes in your Durable Object declarations.\n\nMore details at https://developers.cloudflare.com/workers/learning/using-durable-objects#configuring-durable-object-classes-with-migrations",
475
563
  "items": {
476
- "additionalProperties": false,
477
- "properties": {
478
- "deleted_classes": {
479
- "description": "The Durable Objects being removed.",
480
- "items": {
481
- "type": "string"
482
- },
483
- "type": "array"
484
- },
485
- "new_classes": {
486
- "description": "The new Durable Objects being defined.",
487
- "items": {
488
- "type": "string"
489
- },
490
- "type": "array"
491
- },
492
- "new_sqlite_classes": {
493
- "description": "The new SQLite Durable Objects being defined.",
494
- "items": {
495
- "type": "string"
496
- },
497
- "type": "array"
498
- },
499
- "renamed_classes": {
500
- "description": "The Durable Objects being renamed.",
501
- "items": {
502
- "additionalProperties": false,
503
- "properties": {
504
- "from": {
505
- "type": "string"
506
- },
507
- "to": {
508
- "type": "string"
509
- }
510
- },
511
- "required": [
512
- "from",
513
- "to"
514
- ],
515
- "type": "object"
516
- },
517
- "type": "array"
518
- },
519
- "tag": {
520
- "description": "A unique identifier for this migration.",
521
- "type": "string"
522
- }
523
- },
524
- "required": [
525
- "tag"
526
- ],
527
- "type": "object"
564
+ "$ref": "#/definitions/DurableObjectMigration"
528
565
  },
529
566
  "type": "array"
530
567
  },
@@ -567,10 +604,40 @@
567
604
  "description": "Add polyfills for node builtin modules and globals",
568
605
  "type": "boolean"
569
606
  },
607
+ "observability": {
608
+ "$ref": "#/definitions/Observability",
609
+ "description": "Specify the observability behavior of the Worker."
610
+ },
611
+ "pipelines": {
612
+ "default": "`[]`",
613
+ "description": "Specifies list of Pipelines bound to this Worker environment\n\nNOTE: This field is not automatically inherited from the top level environment, and so must be specified in every named environment.",
614
+ "items": {
615
+ "additionalProperties": false,
616
+ "properties": {
617
+ "binding": {
618
+ "description": "The binding name used to refer to the bound service.",
619
+ "type": "string"
620
+ },
621
+ "pipeline": {
622
+ "description": "Name of the Pipeline to bind",
623
+ "type": "string"
624
+ }
625
+ },
626
+ "required": [
627
+ "binding",
628
+ "pipeline"
629
+ ],
630
+ "type": "object"
631
+ },
632
+ "type": "array"
633
+ },
570
634
  "placement": {
571
635
  "additionalProperties": false,
572
636
  "description": "Specify how the Worker should be located to minimize round-trip time.\n\nMore details: https://developers.cloudflare.com/workers/platform/smart-placement/",
573
637
  "properties": {
638
+ "hint": {
639
+ "type": "string"
640
+ },
574
641
  "mode": {
575
642
  "enum": [
576
643
  "off",
@@ -970,6 +1037,7 @@
970
1037
  "logfwdr",
971
1038
  "migrations",
972
1039
  "mtls_certificates",
1040
+ "pipelines",
973
1041
  "queues",
974
1042
  "r2_buckets",
975
1043
  "rules",
@@ -981,22 +1049,6 @@
981
1049
  ],
982
1050
  "type": "object"
983
1051
  },
984
- "ExperimentalAssets": {
985
- "additionalProperties": false,
986
- "properties": {
987
- "binding": {
988
- "type": "string"
989
- },
990
- "directory": {
991
- "description": "Absolute path to assets directory",
992
- "type": "string"
993
- }
994
- },
995
- "required": [
996
- "directory"
997
- ],
998
- "type": "object"
999
- },
1000
1052
  "Json": {
1001
1053
  "anyOf": [
1002
1054
  {
@@ -1019,6 +1071,23 @@
1019
1071
  "Literal": {
1020
1072
  "$ref": "#/definitions/TypeOf%3CZodUnion%3C%5Bdef-class-1315922706-6501-8772-1315922706-0-54395%2Cdef-class-1315922706-9299-10989-1315922706-0-54395%2Cdef-class-1315922706-12937-13365-1315922706-0-54395%2Cdef-class-1315922706-15083-15273-1315922706-0-54395%5D%3E%3E"
1021
1073
  },
1074
+ "Observability": {
1075
+ "additionalProperties": false,
1076
+ "properties": {
1077
+ "enabled": {
1078
+ "description": "If observability is enabled for this Worker",
1079
+ "type": "boolean"
1080
+ },
1081
+ "head_sampling_rate": {
1082
+ "description": "The sampling rate",
1083
+ "type": "number"
1084
+ }
1085
+ },
1086
+ "required": [
1087
+ "enabled"
1088
+ ],
1089
+ "type": "object"
1090
+ },
1022
1091
  "RawConfig": {
1023
1092
  "additionalProperties": false,
1024
1093
  "properties": {
@@ -1076,45 +1145,8 @@
1076
1145
  "type": "array"
1077
1146
  },
1078
1147
  "assets": {
1079
- "anyOf": [
1080
- {
1081
- "additionalProperties": false,
1082
- "properties": {
1083
- "browser_TTL": {
1084
- "type": "number"
1085
- },
1086
- "bucket": {
1087
- "type": "string"
1088
- },
1089
- "exclude": {
1090
- "items": {
1091
- "type": "string"
1092
- },
1093
- "type": "array"
1094
- },
1095
- "include": {
1096
- "items": {
1097
- "type": "string"
1098
- },
1099
- "type": "array"
1100
- },
1101
- "serve_single_page_app": {
1102
- "type": "boolean"
1103
- }
1104
- },
1105
- "required": [
1106
- "bucket",
1107
- "include",
1108
- "exclude",
1109
- "serve_single_page_app"
1110
- ],
1111
- "type": "object"
1112
- },
1113
- {
1114
- "type": "string"
1115
- }
1116
- ],
1117
- "description": "Serve a folder of static assets with your Worker, without any additional code. This can either be a string, or an object with additional config fields. Only one of assets and legacy_assets can be used."
1148
+ "$ref": "#/definitions/Assets",
1149
+ "description": "Specify the directory of static assets to deploy/serve\n\nMore details at https://developers.cloudflare.com/workers/frameworks/"
1118
1150
  },
1119
1151
  "base_dir": {
1120
1152
  "description": "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.",
@@ -1303,10 +1335,6 @@
1303
1335
  "description": "The `env` section defines overrides for the configuration for different environments.\n\nAll environment fields can be specified at the top level of the config indicating the default environment settings.\n\n- Some fields are inherited and overridable in each environment.\n- But some are not inherited and must be explicitly specified in every environment, if they are specified at the top level.\n\nFor more information, see the documentation at https://developers.cloudflare.com/workers/cli-wrangler/configuration#environments",
1304
1336
  "type": "object"
1305
1337
  },
1306
- "experimental_assets": {
1307
- "$ref": "#/definitions/ExperimentalAssets",
1308
- "description": "Specify the directory of static assets to deploy/serve"
1309
- },
1310
1338
  "experimental_services": {
1311
1339
  "default": "`[]`",
1312
1340
  "deprecated": "DO NOT USE. We'd added this to test the new service binding system, but the proper way to test experimental features is to use `unsafe.bindings` configuration.",
@@ -1457,7 +1485,7 @@
1457
1485
  "type": "string"
1458
1486
  }
1459
1487
  ],
1460
- "description": "Serve a folder of static assets with your Worker, without any additional code. This can either be a string, or an object with additional config fields. Only one of assets and legacy_assets can be used."
1488
+ "description": "Old behaviour of serving a folder of static assets with your Worker, without any additional code. This can either be a string, or an object with additional config fields. Will be deprecated in the near future in favor of `assets`."
1461
1489
  },
1462
1490
  "legacy_env": {
1463
1491
  "description": "A boolean to enable \"legacy\" style wrangler environments (from Wrangler v1). These have been superseded by Services, but there may be projects that won't (or can't) use them. If you're using a legacy environment, you can set this to `true` to enable it.",
@@ -1511,58 +1539,7 @@
1511
1539
  "default": [],
1512
1540
  "description": "A list of migrations that should be uploaded with your Worker.\n\nThese define changes in your Durable Object declarations.\n\nMore details at https://developers.cloudflare.com/workers/learning/using-durable-objects#configuring-durable-object-classes-with-migrations",
1513
1541
  "items": {
1514
- "additionalProperties": false,
1515
- "properties": {
1516
- "deleted_classes": {
1517
- "description": "The Durable Objects being removed.",
1518
- "items": {
1519
- "type": "string"
1520
- },
1521
- "type": "array"
1522
- },
1523
- "new_classes": {
1524
- "description": "The new Durable Objects being defined.",
1525
- "items": {
1526
- "type": "string"
1527
- },
1528
- "type": "array"
1529
- },
1530
- "new_sqlite_classes": {
1531
- "description": "The new SQLite Durable Objects being defined.",
1532
- "items": {
1533
- "type": "string"
1534
- },
1535
- "type": "array"
1536
- },
1537
- "renamed_classes": {
1538
- "description": "The Durable Objects being renamed.",
1539
- "items": {
1540
- "additionalProperties": false,
1541
- "properties": {
1542
- "from": {
1543
- "type": "string"
1544
- },
1545
- "to": {
1546
- "type": "string"
1547
- }
1548
- },
1549
- "required": [
1550
- "from",
1551
- "to"
1552
- ],
1553
- "type": "object"
1554
- },
1555
- "type": "array"
1556
- },
1557
- "tag": {
1558
- "description": "A unique identifier for this migration.",
1559
- "type": "string"
1560
- }
1561
- },
1562
- "required": [
1563
- "tag"
1564
- ],
1565
- "type": "object"
1542
+ "$ref": "#/definitions/DurableObjectMigration"
1566
1543
  },
1567
1544
  "type": "array"
1568
1545
  },
@@ -1609,14 +1586,44 @@
1609
1586
  "description": "Add polyfills for node builtin modules and globals",
1610
1587
  "type": "boolean"
1611
1588
  },
1589
+ "observability": {
1590
+ "$ref": "#/definitions/Observability",
1591
+ "description": "Specify the observability behavior of the Worker."
1592
+ },
1612
1593
  "pages_build_output_dir": {
1613
1594
  "description": "The directory of static assets to serve.\n\nThe presence of this field in `wrangler.toml` indicates a Pages project, and will prompt the handling of the configuration file according to the Pages-specific validation rules.",
1614
1595
  "type": "string"
1615
1596
  },
1597
+ "pipelines": {
1598
+ "default": "`[]`",
1599
+ "description": "Specifies list of Pipelines bound to this Worker environment\n\nNOTE: This field is not automatically inherited from the top level environment, and so must be specified in every named environment.",
1600
+ "items": {
1601
+ "additionalProperties": false,
1602
+ "properties": {
1603
+ "binding": {
1604
+ "description": "The binding name used to refer to the bound service.",
1605
+ "type": "string"
1606
+ },
1607
+ "pipeline": {
1608
+ "description": "Name of the Pipeline to bind",
1609
+ "type": "string"
1610
+ }
1611
+ },
1612
+ "required": [
1613
+ "binding",
1614
+ "pipeline"
1615
+ ],
1616
+ "type": "object"
1617
+ },
1618
+ "type": "array"
1619
+ },
1616
1620
  "placement": {
1617
1621
  "additionalProperties": false,
1618
1622
  "description": "Specify how the Worker should be located to minimize round-trip time.\n\nMore details: https://developers.cloudflare.com/workers/platform/smart-placement/",
1619
1623
  "properties": {
1624
+ "hint": {
1625
+ "type": "string"
1626
+ },
1620
1627
  "mode": {
1621
1628
  "enum": [
1622
1629
  "off",
@@ -2160,6 +2167,10 @@
2160
2167
  },
2161
2168
  "type": "array"
2162
2169
  },
2170
+ "assets": {
2171
+ "$ref": "#/definitions/Assets",
2172
+ "description": "Specify the directory of static assets to deploy/serve\n\nMore details at https://developers.cloudflare.com/workers/frameworks/"
2173
+ },
2163
2174
  "base_dir": {
2164
2175
  "description": "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.",
2165
2176
  "type": "string"
@@ -2325,10 +2336,6 @@
2325
2336
  ],
2326
2337
  "type": "object"
2327
2338
  },
2328
- "experimental_assets": {
2329
- "$ref": "#/definitions/ExperimentalAssets",
2330
- "description": "Specify the directory of static assets to deploy/serve"
2331
- },
2332
2339
  "experimental_services": {
2333
2340
  "default": "`[]`",
2334
2341
  "deprecated": "DO NOT USE. We'd added this to test the new service binding system, but the proper way to test experimental features is to use `unsafe.bindings` configuration.",
@@ -2483,58 +2490,7 @@
2483
2490
  "default": [],
2484
2491
  "description": "A list of migrations that should be uploaded with your Worker.\n\nThese define changes in your Durable Object declarations.\n\nMore details at https://developers.cloudflare.com/workers/learning/using-durable-objects#configuring-durable-object-classes-with-migrations",
2485
2492
  "items": {
2486
- "additionalProperties": false,
2487
- "properties": {
2488
- "deleted_classes": {
2489
- "description": "The Durable Objects being removed.",
2490
- "items": {
2491
- "type": "string"
2492
- },
2493
- "type": "array"
2494
- },
2495
- "new_classes": {
2496
- "description": "The new Durable Objects being defined.",
2497
- "items": {
2498
- "type": "string"
2499
- },
2500
- "type": "array"
2501
- },
2502
- "new_sqlite_classes": {
2503
- "description": "The new SQLite Durable Objects being defined.",
2504
- "items": {
2505
- "type": "string"
2506
- },
2507
- "type": "array"
2508
- },
2509
- "renamed_classes": {
2510
- "description": "The Durable Objects being renamed.",
2511
- "items": {
2512
- "additionalProperties": false,
2513
- "properties": {
2514
- "from": {
2515
- "type": "string"
2516
- },
2517
- "to": {
2518
- "type": "string"
2519
- }
2520
- },
2521
- "required": [
2522
- "from",
2523
- "to"
2524
- ],
2525
- "type": "object"
2526
- },
2527
- "type": "array"
2528
- },
2529
- "tag": {
2530
- "description": "A unique identifier for this migration.",
2531
- "type": "string"
2532
- }
2533
- },
2534
- "required": [
2535
- "tag"
2536
- ],
2537
- "type": "object"
2493
+ "$ref": "#/definitions/DurableObjectMigration"
2538
2494
  },
2539
2495
  "type": "array"
2540
2496
  },
@@ -2577,10 +2533,40 @@
2577
2533
  "description": "Add polyfills for node builtin modules and globals",
2578
2534
  "type": "boolean"
2579
2535
  },
2536
+ "observability": {
2537
+ "$ref": "#/definitions/Observability",
2538
+ "description": "Specify the observability behavior of the Worker."
2539
+ },
2540
+ "pipelines": {
2541
+ "default": "`[]`",
2542
+ "description": "Specifies list of Pipelines bound to this Worker environment\n\nNOTE: This field is not automatically inherited from the top level environment, and so must be specified in every named environment.",
2543
+ "items": {
2544
+ "additionalProperties": false,
2545
+ "properties": {
2546
+ "binding": {
2547
+ "description": "The binding name used to refer to the bound service.",
2548
+ "type": "string"
2549
+ },
2550
+ "pipeline": {
2551
+ "description": "Name of the Pipeline to bind",
2552
+ "type": "string"
2553
+ }
2554
+ },
2555
+ "required": [
2556
+ "binding",
2557
+ "pipeline"
2558
+ ],
2559
+ "type": "object"
2560
+ },
2561
+ "type": "array"
2562
+ },
2580
2563
  "placement": {
2581
2564
  "additionalProperties": false,
2582
2565
  "description": "Specify how the Worker should be located to minimize round-trip time.\n\nMore details: https://developers.cloudflare.com/workers/platform/smart-placement/",
2583
2566
  "properties": {
2567
+ "hint": {
2568
+ "type": "string"
2569
+ },
2584
2570
  "mode": {
2585
2571
  "enum": [
2586
2572
  "off",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wrangler",
3
- "version": "0.0.0-ecdfabed0",
3
+ "version": "0.0.0-ecef68635",
4
4
  "description": "Command-line interface for all things Cloudflare Workers",
5
5
  "keywords": [
6
6
  "wrangler",
@@ -54,24 +54,23 @@
54
54
  "@esbuild-plugins/node-modules-polyfill": "^0.2.2",
55
55
  "blake3-wasm": "^2.1.5",
56
56
  "chokidar": "^3.5.3",
57
- "date-fns": "^3.6.0",
58
57
  "esbuild": "0.17.19",
59
58
  "nanoid": "^3.3.3",
60
- "path-to-regexp": "^6.2.0",
59
+ "path-to-regexp": "^6.3.0",
61
60
  "resolve": "^1.22.8",
62
61
  "resolve.exports": "^2.0.2",
63
62
  "selfsigned": "^2.0.1",
64
63
  "source-map": "^0.6.1",
65
- "unenv": "npm:unenv-nightly@2.0.0-1724863496.70db6f1",
66
- "workerd": "1.20240821.1",
64
+ "unenv": "npm:unenv-nightly@2.0.0-20240919-125358-9a64854",
65
+ "workerd": "1.20240925.0",
67
66
  "xxhash-wasm": "^1.0.1",
68
67
  "@cloudflare/kv-asset-handler": "0.3.4",
69
- "miniflare": "0.0.0-ecdfabed0",
70
- "@cloudflare/workers-shared": "0.0.0-ecdfabed0"
68
+ "@cloudflare/workers-shared": "0.0.0-ecef68635",
69
+ "miniflare": "0.0.0-ecef68635"
71
70
  },
72
71
  "devDependencies": {
73
72
  "@cloudflare/types": "^6.18.4",
74
- "@cloudflare/workers-types": "^4.20240821.1",
73
+ "@cloudflare/workers-types": "^4.20240925.0",
75
74
  "@cspotcode/source-map-support": "0.8.1",
76
75
  "@iarna/toml": "^3.0.0",
77
76
  "@microsoft/api-extractor": "^7.47.0",
@@ -146,7 +145,7 @@
146
145
  "ts-json-schema-generator": "^1.5.0",
147
146
  "undici": "^5.28.4",
148
147
  "update-check": "^1.5.4",
149
- "vitest": "^1.6.0",
148
+ "vitest": "~2.1.1",
150
149
  "vitest-websocket-mock": "^0.3.0",
151
150
  "ws": "^8.17.1",
152
151
  "xdg-app-paths": "^8.3.0",
@@ -154,11 +153,11 @@
154
153
  "yoga-layout": "file:../../vendor/yoga-layout-2.0.0-beta.1.tgz",
155
154
  "@cloudflare/cli": "1.1.1",
156
155
  "@cloudflare/eslint-config-worker": "1.1.0",
157
- "@cloudflare/pages-shared": "^0.11.54",
158
- "@cloudflare/workers-tsconfig": "0.0.0"
156
+ "@cloudflare/workers-tsconfig": "0.0.0",
157
+ "@cloudflare/pages-shared": "^0.11.63"
159
158
  },
160
159
  "peerDependencies": {
161
- "@cloudflare/workers-types": "^4.20240821.1"
160
+ "@cloudflare/workers-types": "^4.20240925.0"
162
161
  },
163
162
  "peerDependenciesMeta": {
164
163
  "@cloudflare/workers-types": {
@@ -0,0 +1,3 @@
1
+ declare module "config:middleware/mock-analytics-engine" {
2
+ export const bindings: string[];
3
+ }
@@ -0,0 +1,30 @@
1
+ /// <reference path="middleware-mock-analytics-engine.d.ts"/>
2
+
3
+ import { bindings } from "config:middleware/mock-analytics-engine";
4
+ import type { Middleware } from "./common";
5
+
6
+ const bindingsEnv = Object.fromEntries(
7
+ bindings.map((binding) => [
8
+ binding,
9
+ {
10
+ writeDataPoint() {
11
+ // no op in dev
12
+ },
13
+ },
14
+ ])
15
+ ) satisfies Record<string, AnalyticsEngineDataset>;
16
+
17
+ const analyticsEngine: Middleware = async (
18
+ request,
19
+ env,
20
+ _ctx,
21
+ middlewareCtx
22
+ ) => {
23
+ // we're going to directly modify env so it maintains referential equality
24
+ for (const binding of bindings) {
25
+ env[binding] ??= bindingsEnv[binding];
26
+ }
27
+ return await middlewareCtx.next(request, env);
28
+ };
29
+
30
+ export default analyticsEngine;