@depup/wrangler 4.114.0-depup.0 → 4.120.0-depup.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -13,18 +13,19 @@ npm install @depup/wrangler
13
13
 
14
14
  | Field | Value |
15
15
  |-------|-------|
16
- | Original | [wrangler](https://www.npmjs.com/package/wrangler) @ 4.114.0 |
17
- | Processed | 2026-07-26 |
16
+ | Original | [wrangler](https://www.npmjs.com/package/wrangler) @ 4.120.0 |
17
+ | Processed | 2026-08-09 |
18
18
  | Smoke test | failed |
19
- | Deps updated | 3 |
19
+ | Deps updated | 4 |
20
20
 
21
21
  ## Dependency Changes
22
22
 
23
23
  | Dependency | From | To |
24
24
  |------------|------|-----|
25
25
  | blake3-wasm | 2.1.5 | ^3.0.0 |
26
+ | esbuild | 0.28.1 | ^0.28.2 |
26
27
  | path-to-regexp | 6.3.0 | ^8.4.2 |
27
- | workerd | 1.20260722.1 | ^1.20260724.1 |
28
+ | workerd | 1.20260801.1 | ^1.20260808.1 |
28
29
 
29
30
  ---
30
31
 
package/changes.json CHANGED
@@ -4,15 +4,19 @@
4
4
  "from": "2.1.5",
5
5
  "to": "^3.0.0"
6
6
  },
7
+ "esbuild": {
8
+ "from": "0.28.1",
9
+ "to": "^0.28.2"
10
+ },
7
11
  "path-to-regexp": {
8
12
  "from": "6.3.0",
9
13
  "to": "^8.4.2"
10
14
  },
11
15
  "workerd": {
12
- "from": "1.20260722.1",
13
- "to": "^1.20260724.1"
16
+ "from": "1.20260801.1",
17
+ "to": "^1.20260808.1"
14
18
  }
15
19
  },
16
- "timestamp": "2026-07-26T01:01:41.709Z",
17
- "totalUpdated": 3
20
+ "timestamp": "2026-08-09T00:37:58.217Z",
21
+ "totalUpdated": 4
18
22
  }
@@ -127,11 +127,17 @@
127
127
  "items": {
128
128
  "type": "string"
129
129
  }
130
+ },
131
+ "events": {
132
+ "type": "array",
133
+ "items": {
134
+ "$ref": "#/definitions/ArtifactsEventTrigger"
135
+ }
130
136
  }
131
137
  },
132
138
  "additionalProperties": false,
133
- "description": "\"Cron\" definitions to trigger a Worker's \"scheduled\" function.\n\nLets you call Workers periodically, much like a cron job.\n\nMore details here https://developers.cloudflare.com/workers/platform/cron-triggers\n\nFor reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers",
134
- "markdownDescription": "\"Cron\" definitions to trigger a Worker's \"scheduled\" function.\n\nLets you call Workers periodically, much like a cron job.\n\nMore details here https://developers.cloudflare.com/workers/platform/cron-triggers\n\nFor reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers",
139
+ "description": "Definitions that trigger a Worker from a schedule or a Cloudflare event.\n\nMore details about cron triggers: https://developers.cloudflare.com/workers/platform/cron-triggers\n\nMore details about Artifacts events: https://developers.cloudflare.com/artifacts/guides/event-subscriptions/\n\nFor reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers",
140
+ "markdownDescription": "Definitions that trigger a Worker from a schedule or a Cloudflare event.\n\nMore details about cron triggers: https://developers.cloudflare.com/workers/platform/cron-triggers\n\nMore details about Artifacts events: https://developers.cloudflare.com/artifacts/guides/event-subscriptions/\n\nFor reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers",
135
141
  "default": {
136
142
  "crons": []
137
143
  }
@@ -678,6 +684,19 @@
678
684
  "type": "boolean",
679
685
  "description": "Whether the R2 bucket should be remote or not in local development",
680
686
  "markdownDescription": "Whether the R2 bucket should be remote or not in local development"
687
+ },
688
+ "local_dev": {
689
+ "type": "object",
690
+ "properties": {
691
+ "experimental_s3_credentials": {
692
+ "$ref": "#/definitions/LocalS3Credentials",
693
+ "description": "EXPERIMENTAL: AWS SigV4 credentials for the local S3-compatible endpoint. When set, the bucket is served at `/cdn-cgi/local/r2/s3/<bucket-name>` during local development. Ignored when the bucket runs remotely.",
694
+ "markdownDescription": "EXPERIMENTAL: AWS SigV4 credentials for the local S3-compatible\nendpoint. When set, the bucket is served at\n`/cdn-cgi/local/r2/s3/<bucket-name>` during local development.\nIgnored when the bucket runs remotely."
695
+ }
696
+ },
697
+ "additionalProperties": false,
698
+ "description": "Settings that only apply to local development",
699
+ "markdownDescription": "Settings that only apply to local development"
681
700
  }
682
701
  },
683
702
  "required": [
@@ -1869,11 +1888,17 @@
1869
1888
  "items": {
1870
1889
  "type": "string"
1871
1890
  }
1891
+ },
1892
+ "events": {
1893
+ "type": "array",
1894
+ "items": {
1895
+ "$ref": "#/definitions/ArtifactsEventTrigger"
1896
+ }
1872
1897
  }
1873
1898
  },
1874
1899
  "additionalProperties": false,
1875
- "description": "\"Cron\" definitions to trigger a Worker's \"scheduled\" function.\n\nLets you call Workers periodically, much like a cron job.\n\nMore details here https://developers.cloudflare.com/workers/platform/cron-triggers\n\nFor reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers",
1876
- "markdownDescription": "\"Cron\" definitions to trigger a Worker's \"scheduled\" function.\n\nLets you call Workers periodically, much like a cron job.\n\nMore details here https://developers.cloudflare.com/workers/platform/cron-triggers\n\nFor reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers",
1900
+ "description": "Definitions that trigger a Worker from a schedule or a Cloudflare event.\n\nMore details about cron triggers: https://developers.cloudflare.com/workers/platform/cron-triggers\n\nMore details about Artifacts events: https://developers.cloudflare.com/artifacts/guides/event-subscriptions/\n\nFor reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers",
1901
+ "markdownDescription": "Definitions that trigger a Worker from a schedule or a Cloudflare event.\n\nMore details about cron triggers: https://developers.cloudflare.com/workers/platform/cron-triggers\n\nMore details about Artifacts events: https://developers.cloudflare.com/artifacts/guides/event-subscriptions/\n\nFor reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers",
1877
1902
  "default": {
1878
1903
  "crons": []
1879
1904
  }
@@ -2420,6 +2445,19 @@
2420
2445
  "type": "boolean",
2421
2446
  "description": "Whether the R2 bucket should be remote or not in local development",
2422
2447
  "markdownDescription": "Whether the R2 bucket should be remote or not in local development"
2448
+ },
2449
+ "local_dev": {
2450
+ "type": "object",
2451
+ "properties": {
2452
+ "experimental_s3_credentials": {
2453
+ "$ref": "#/definitions/LocalS3Credentials",
2454
+ "description": "EXPERIMENTAL: AWS SigV4 credentials for the local S3-compatible endpoint. When set, the bucket is served at `/cdn-cgi/local/r2/s3/<bucket-name>` during local development. Ignored when the bucket runs remotely.",
2455
+ "markdownDescription": "EXPERIMENTAL: AWS SigV4 credentials for the local S3-compatible\nendpoint. When set, the bucket is served at\n`/cdn-cgi/local/r2/s3/<bucket-name>` during local development.\nIgnored when the bucket runs remotely."
2456
+ }
2457
+ },
2458
+ "additionalProperties": false,
2459
+ "description": "Settings that only apply to local development",
2460
+ "markdownDescription": "Settings that only apply to local development"
2423
2461
  }
2424
2462
  },
2425
2463
  "required": [
@@ -3683,6 +3721,65 @@
3683
3721
  ],
3684
3722
  "additionalProperties": false
3685
3723
  },
3724
+ "ArtifactsEventTrigger": {
3725
+ "type": "object",
3726
+ "properties": {
3727
+ "type": {
3728
+ "$ref": "#/definitions/ArtifactsEventType"
3729
+ },
3730
+ "filter": {
3731
+ "type": "object",
3732
+ "properties": {
3733
+ "namespace": {
3734
+ "type": "string"
3735
+ },
3736
+ "repo_name": {
3737
+ "type": "string"
3738
+ }
3739
+ },
3740
+ "additionalProperties": false
3741
+ },
3742
+ "targets": {
3743
+ "type": "array",
3744
+ "items": {
3745
+ "type": "object",
3746
+ "properties": {
3747
+ "type": {
3748
+ "type": "string",
3749
+ "const": "workflow"
3750
+ },
3751
+ "workflow_name": {
3752
+ "type": "string"
3753
+ }
3754
+ },
3755
+ "required": [
3756
+ "type",
3757
+ "workflow_name"
3758
+ ],
3759
+ "additionalProperties": false
3760
+ }
3761
+ }
3762
+ },
3763
+ "required": [
3764
+ "type",
3765
+ "targets"
3766
+ ],
3767
+ "additionalProperties": false
3768
+ },
3769
+ "ArtifactsEventType": {
3770
+ "type": "string",
3771
+ "enum": [
3772
+ "cf.artifacts.repo.created",
3773
+ "cf.artifacts.repo.deleted",
3774
+ "cf.artifacts.repo.forked",
3775
+ "cf.artifacts.repo.imported",
3776
+ "cf.artifacts.repo.pushed",
3777
+ "cf.artifacts.repo.cloned",
3778
+ "cf.artifacts.repo.fetched",
3779
+ "cf.artifacts.repo.token.created",
3780
+ "cf.artifacts.repo.token.revoked"
3781
+ ]
3782
+ },
3686
3783
  "UserLimits": {
3687
3784
  "type": "object",
3688
3785
  "properties": {
@@ -3892,16 +3989,16 @@
3892
3989
  "additionalProperties": false,
3893
3990
  "properties": {
3894
3991
  "logpush": {
3895
- "$ref": "#/definitions/interface-769040647-10591-20713-769040647-0-526802004818536"
3992
+ "$ref": "#/definitions/interface-769040647-10754-20982-769040647-0-539242004818536"
3896
3993
  },
3897
3994
  "observability": {
3898
- "$ref": "#/definitions/interface-769040647-10591-20713-769040647-0-526802004818536"
3995
+ "$ref": "#/definitions/interface-769040647-10754-20982-769040647-0-539242004818536"
3899
3996
  },
3900
3997
  "limits": {
3901
- "$ref": "#/definitions/interface-769040647-10591-20713-769040647-0-526802004818536"
3998
+ "$ref": "#/definitions/interface-769040647-10754-20982-769040647-0-539242004818536"
3902
3999
  },
3903
4000
  "cache": {
3904
- "$ref": "#/definitions/interface-769040647-10591-20713-769040647-0-526802004818536"
4001
+ "$ref": "#/definitions/interface-769040647-10754-20982-769040647-0-539242004818536"
3905
4002
  },
3906
4003
  "define": {
3907
4004
  "type": "object",
@@ -4204,6 +4301,19 @@
4204
4301
  "type": "boolean",
4205
4302
  "description": "Whether the R2 bucket should be remote or not in local development",
4206
4303
  "markdownDescription": "Whether the R2 bucket should be remote or not in local development"
4304
+ },
4305
+ "local_dev": {
4306
+ "type": "object",
4307
+ "properties": {
4308
+ "experimental_s3_credentials": {
4309
+ "$ref": "#/definitions/LocalS3Credentials",
4310
+ "description": "EXPERIMENTAL: AWS SigV4 credentials for the local S3-compatible endpoint. When set, the bucket is served at `/cdn-cgi/local/r2/s3/<bucket-name>` during local development. Ignored when the bucket runs remotely.",
4311
+ "markdownDescription": "EXPERIMENTAL: AWS SigV4 credentials for the local S3-compatible\nendpoint. When set, the bucket is served at\n`/cdn-cgi/local/r2/s3/<bucket-name>` during local development.\nIgnored when the bucket runs remotely."
4312
+ }
4313
+ },
4314
+ "additionalProperties": false,
4315
+ "description": "Settings that only apply to local development",
4316
+ "markdownDescription": "Settings that only apply to local development"
4207
4317
  }
4208
4318
  },
4209
4319
  "required": [
@@ -5160,7 +5270,7 @@
5160
5270
  "description": "Configuration for Worker Previews.\n\nThis defines the settings used when creating Preview deployments. Previews are branches of your Worker's main instance used to test features during feature development outside of production.\n\nThe `previews` block contains any intentionally divergent configuration intended solely for Previews, including:\n- All non-inheritable properties (environment variables and bindings like KV, D1, R2, etc.)\n- Select inheritable properties: `logpush`, `observability`, `limits`, `cache`",
5161
5271
  "markdownDescription": "Configuration for Worker Previews.\n\nThis defines the settings used when creating Preview deployments.\nPreviews are branches of your Worker's main instance used to test features\nduring feature development outside of production.\n\nThe `previews` block contains any intentionally divergent configuration intended solely for Previews, including:\n- All non-inheritable properties (environment variables and bindings like KV, D1, R2, etc.)\n- Select inheritable properties: `logpush`, `observability`, `limits`, `cache`"
5162
5272
  },
5163
- "interface-769040647-10591-20713-769040647-0-526802004818536": {
5273
+ "interface-769040647-10754-20982-769040647-0-539242004818536": {
5164
5274
  "type": "object",
5165
5275
  "properties": {
5166
5276
  "name": {
@@ -5272,11 +5382,17 @@
5272
5382
  "items": {
5273
5383
  "type": "string"
5274
5384
  }
5385
+ },
5386
+ "events": {
5387
+ "type": "array",
5388
+ "items": {
5389
+ "$ref": "#/definitions/ArtifactsEventTrigger"
5390
+ }
5275
5391
  }
5276
5392
  },
5277
5393
  "additionalProperties": false,
5278
- "description": "\"Cron\" definitions to trigger a Worker's \"scheduled\" function.\n\nLets you call Workers periodically, much like a cron job.\n\nMore details here https://developers.cloudflare.com/workers/platform/cron-triggers\n\nFor reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers",
5279
- "markdownDescription": "\"Cron\" definitions to trigger a Worker's \"scheduled\" function.\n\nLets you call Workers periodically, much like a cron job.\n\nMore details here https://developers.cloudflare.com/workers/platform/cron-triggers\n\nFor reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers",
5394
+ "description": "Definitions that trigger a Worker from a schedule or a Cloudflare event.\n\nMore details about cron triggers: https://developers.cloudflare.com/workers/platform/cron-triggers\n\nMore details about Artifacts events: https://developers.cloudflare.com/artifacts/guides/event-subscriptions/\n\nFor reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers",
5395
+ "markdownDescription": "Definitions that trigger a Worker from a schedule or a Cloudflare event.\n\nMore details about cron triggers: https://developers.cloudflare.com/workers/platform/cron-triggers\n\nMore details about Artifacts events: https://developers.cloudflare.com/artifacts/guides/event-subscriptions/\n\nFor reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers",
5280
5396
  "default": {
5281
5397
  "crons": []
5282
5398
  }
@@ -5932,6 +6048,24 @@
5932
6048
  "description": "Configuration for a container application",
5933
6049
  "markdownDescription": "Configuration for a container application"
5934
6050
  },
6051
+ "LocalS3Credentials": {
6052
+ "type": "object",
6053
+ "properties": {
6054
+ "accessKeyId": {
6055
+ "type": "string"
6056
+ },
6057
+ "secretAccessKey": {
6058
+ "type": "string"
6059
+ }
6060
+ },
6061
+ "required": [
6062
+ "accessKeyId",
6063
+ "secretAccessKey"
6064
+ ],
6065
+ "additionalProperties": false,
6066
+ "description": "AWS SigV4 credentials for miniflare's local S3-compatible endpoint",
6067
+ "markdownDescription": "AWS SigV4 credentials for miniflare's local S3-compatible endpoint"
6068
+ },
5935
6069
  "TailConsumer": {
5936
6070
  "type": "object",
5937
6071
  "properties": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depup/wrangler",
3
- "version": "4.114.0-depup.0",
3
+ "version": "4.120.0-depup.0",
4
4
  "description": "Command-line interface for all things Cloudflare Workers (with updated dependencies)",
5
5
  "keywords": [
6
6
  "wrangler",
@@ -70,19 +70,20 @@
70
70
  },
71
71
  "dependencies": {
72
72
  "blake3-wasm": "^3.0.0",
73
- "esbuild": "0.28.1",
73
+ "esbuild": "^0.28.2",
74
74
  "path-to-regexp": "^8.4.2",
75
75
  "unenv": "2.0.0-rc.24",
76
- "workerd": "^1.20260724.1",
76
+ "workerd": "^1.20260808.1",
77
77
  "@cloudflare/kv-asset-handler": "0.5.0",
78
78
  "@cloudflare/unenv-preset": "2.16.1",
79
- "miniflare": "4.20260722.0"
79
+ "miniflare": "5.20260801.1-alpha"
80
80
  },
81
81
  "devDependencies": {
82
82
  "@aws-sdk/client-s3": "^3.721.0",
83
+ "@aws-sdk/s3-request-presigner": "^3.721.0",
83
84
  "@bomb.sh/tab": "^0.0.12",
84
85
  "@cloudflare/types": "6.18.4",
85
- "@cloudflare/workers-types": "^5.20260722.1",
86
+ "@cloudflare/workers-types": "^5.20260801.1",
86
87
  "@cspotcode/source-map-support": "0.8.1",
87
88
  "@netlify/build-info": "^10.5.1",
88
89
  "@sentry/node": "^7.86.0",
@@ -154,7 +155,7 @@
154
155
  "tsdown": "0.16.3",
155
156
  "tsup": "8.3.0",
156
157
  "typescript": "5.8.3",
157
- "undici": "7.28.0",
158
+ "undici": "7.29.0",
158
159
  "vitest": "4.1.0",
159
160
  "vitest-websocket-mock": "^0.4.0",
160
161
  "ws": "8.21.0",
@@ -162,23 +163,25 @@
162
163
  "yaml": "^2.8.1",
163
164
  "yargs": "^17.7.2",
164
165
  "zod": "4.4.3",
165
- "@cloudflare/autoconfig": "0.2.0",
166
+ "@cloudflare/autoconfig": "0.2.5",
167
+ "@cloudflare/build-output-utils": "0.1.0",
168
+ "@cloudflare/cli-shared-helpers": "0.1.21",
166
169
  "@cloudflare/codemod": "1.1.0",
167
- "@cloudflare/cli-shared-helpers": "0.1.16",
168
- "@cloudflare/config": "0.3.0",
169
- "@cloudflare/deploy-helpers": "0.6.1",
170
+ "@cloudflare/config": "0.4.0",
170
171
  "@cloudflare/containers-shared": "0.16.0",
171
- "@cloudflare/pages-shared": "^0.13.160",
172
- "@cloudflare/runtime-types": "0.0.5",
173
- "@cloudflare/remote-bindings": "0.0.2",
174
- "@cloudflare/workers-auth": "0.5.2",
172
+ "@cloudflare/deploy-helpers": "0.6.6",
173
+ "@cloudflare/pages-functions": "0.1.0",
174
+ "@cloudflare/pages-shared": "^0.13.165",
175
+ "@cloudflare/remote-bindings": "0.0.8",
176
+ "@cloudflare/runtime-types": "0.0.10",
177
+ "@cloudflare/workers-auth": "0.6.1",
175
178
  "@cloudflare/workers-shared": "0.19.9",
176
- "@cloudflare/workers-utils": "0.28.0",
177
179
  "@cloudflare/workers-tsconfig": "0.0.0",
178
- "@cloudflare/workflows-shared": "0.12.1"
180
+ "@cloudflare/workers-utils": "0.31.2",
181
+ "@cloudflare/workflows-shared": "0.12.2"
179
182
  },
180
183
  "peerDependencies": {
181
- "@cloudflare/workers-types": "^5.20260722.1"
184
+ "@cloudflare/workers-types": "^5.20260801.1"
182
185
  },
183
186
  "peerDependenciesMeta": {
184
187
  "@cloudflare/workers-types": {
@@ -218,19 +221,23 @@
218
221
  "from": "2.1.5",
219
222
  "to": "^3.0.0"
220
223
  },
224
+ "esbuild": {
225
+ "from": "0.28.1",
226
+ "to": "^0.28.2"
227
+ },
221
228
  "path-to-regexp": {
222
229
  "from": "6.3.0",
223
230
  "to": "^8.4.2"
224
231
  },
225
232
  "workerd": {
226
- "from": "1.20260722.1",
227
- "to": "^1.20260724.1"
233
+ "from": "1.20260801.1",
234
+ "to": "^1.20260808.1"
228
235
  }
229
236
  },
230
- "depsUpdated": 3,
237
+ "depsUpdated": 4,
231
238
  "originalPackage": "wrangler",
232
- "originalVersion": "4.114.0",
233
- "processedAt": "2026-07-26T01:02:06.000Z",
239
+ "originalVersion": "4.120.0",
240
+ "processedAt": "2026-08-09T00:38:26.940Z",
234
241
  "smokeTest": "failed"
235
242
  }
236
243
  }
@@ -2,7 +2,7 @@
2
2
  * Welcome to Cloudflare Workers! This is your first scheduled worker.
3
3
  *
4
4
  * - Run `wrangler dev` in your terminal to start a development server
5
- * - Run `curl "http://localhost:8787/cdn-cgi/handler/scheduled"` to trigger the scheduled event
5
+ * - Run `curl "http://localhost:8787/cdn-cgi/local/scheduled"` to trigger the scheduled event
6
6
  * - Go back to the console to see what your worker has logged
7
7
  * - Update the Cron trigger in wrangler.toml (see https://developers.cloudflare.com/workers/configuration/cron-triggers/)
8
8
  * - Run `wrangler publish --name my-worker` to publish your worker
@@ -2,7 +2,7 @@
2
2
  * Welcome to Cloudflare Workers! This is your first scheduled worker.
3
3
  *
4
4
  * - Run `wrangler dev` in your terminal to start a development server
5
- * - Run `curl "http://localhost:8787/cdn-cgi/handler/scheduled"` to trigger the scheduled event
5
+ * - Run `curl "http://localhost:8787/cdn-cgi/local/scheduled"` to trigger the scheduled event
6
6
  * - Go back to the console to see what your worker has logged
7
7
  * - Update the Cron trigger in wrangler.toml (see https://developers.cloudflare.com/workers/configuration/cron-triggers/)
8
8
  * - Run `wrangler deploy --name my-worker` to deploy your worker
@@ -1,3 +1,5 @@
1
+ // This file is a copy of packages/pages-functions/src/templates/pages-template-worker.ts.
2
+ // Changes here should be reflected there and vice-versa.
1
3
  import { match } from "path-to-regexp";
2
4
 
3
5
  //note: this explicitly does not include the * character, as pages requires this
@@ -132,6 +132,13 @@ export class ProxyWorker implements DurableObject {
132
132
  request.url
133
133
  );
134
134
 
135
+ // rewrite requests to old miniflare paths
136
+ // because wrangler cannot have a breaking change
137
+ userWorkerUrl.pathname = rewriteLegacyMiniflarePath(
138
+ userWorkerUrl.pathname
139
+ );
140
+ innerUrl.pathname = rewriteLegacyMiniflarePath(innerUrl.pathname);
141
+
135
142
  // Preserve client `Accept-Encoding`, rather than using Worker's default
136
143
  // of `Accept-Encoding: br, gzip`
137
144
  const encoding = request.cf?.clientAcceptEncoding;
@@ -238,6 +245,26 @@ export class ProxyWorker implements DurableObject {
238
245
  function isRequestFromProxyController(req: Request, env: Env): boolean {
239
246
  return req.headers.get("Authorization") === env.PROXY_CONTROLLER_AUTH_SECRET;
240
247
  }
248
+
249
+ // Miniflare v5 moved its internal endpoints under `/cdn-cgi/local/` (and
250
+ // `/__cf_local/` for endpoints that must remain reachable over tunnels). These
251
+ // map the pre-v5 paths onto their current equivalents.
252
+ const LEGACY_PATH_REWRITES: readonly [string, string][] = [
253
+ ["/cdn-cgi/handler", "/cdn-cgi/local"],
254
+ ["/cdn-cgi/mf/scheduled", "/cdn-cgi/local/scheduled"],
255
+ ["/cdn-cgi/mf/stream", "/__cf_local/stream"],
256
+ ["/cdn-cgi/mf/imagedelivery", "/__cf_local/imagedelivery"],
257
+ ["/cdn-cgi/explorer", "/cdn-cgi/local/explorer"],
258
+ ];
259
+
260
+ function rewriteLegacyMiniflarePath(pathname: string): string {
261
+ for (const [oldPrefix, newPrefix] of LEGACY_PATH_REWRITES) {
262
+ if (pathname === oldPrefix || pathname.startsWith(`${oldPrefix}/`)) {
263
+ return newPrefix + pathname.slice(oldPrefix.length);
264
+ }
265
+ }
266
+ return pathname;
267
+ }
241
268
  function isHtmlResponse(res: Response): boolean {
242
269
  return res.headers.get("content-type")?.startsWith("text/html") ?? false;
243
270
  }
@@ -122,6 +122,10 @@ var ProxyWorker = class {
122
122
  proxyData.userWorkerInnerUrlOverrides ?? {},
123
123
  request.url
124
124
  );
125
+ userWorkerUrl.pathname = rewriteLegacyMiniflarePath(
126
+ userWorkerUrl.pathname
127
+ );
128
+ innerUrl.pathname = rewriteLegacyMiniflarePath(innerUrl.pathname);
125
129
  const encoding = request.cf?.clientAcceptEncoding;
126
130
  if (encoding !== void 0) headers.set("Accept-Encoding", encoding);
127
131
  rewriteUrlRelatedHeaders(headers, outerUrl, innerUrl);
@@ -180,6 +184,21 @@ var ProxyWorker = class {
180
184
  function isRequestFromProxyController(req, env) {
181
185
  return req.headers.get("Authorization") === env.PROXY_CONTROLLER_AUTH_SECRET;
182
186
  }
187
+ var LEGACY_PATH_REWRITES = [
188
+ ["/cdn-cgi/handler", "/cdn-cgi/local"],
189
+ ["/cdn-cgi/mf/scheduled", "/cdn-cgi/local/scheduled"],
190
+ ["/cdn-cgi/mf/stream", "/__cf_local/stream"],
191
+ ["/cdn-cgi/mf/imagedelivery", "/__cf_local/imagedelivery"],
192
+ ["/cdn-cgi/explorer", "/cdn-cgi/local/explorer"]
193
+ ];
194
+ function rewriteLegacyMiniflarePath(pathname) {
195
+ for (const [oldPrefix, newPrefix] of LEGACY_PATH_REWRITES) {
196
+ if (pathname === oldPrefix || pathname.startsWith(`${oldPrefix}/`)) {
197
+ return newPrefix + pathname.slice(oldPrefix.length);
198
+ }
199
+ }
200
+ return pathname;
201
+ }
183
202
  function isHtmlResponse(res) {
184
203
  return res.headers.get("content-type")?.startsWith("text/html") ?? false;
185
204
  }
@@ -197,13 +197,13 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
197
197
  };
198
198
  };
199
199
  latest_stage: {
200
- status: "skipped" | "active" | "canceled" | "success" | "idle" | "failure";
200
+ status: "success" | "skipped" | "active" | "canceled" | "idle" | "failure";
201
201
  name: "queued" | "build" | "deploy" | "initialize" | "clone_repo";
202
202
  started_on: string | null;
203
203
  ended_on: string | null;
204
204
  };
205
205
  stages: {
206
- status: "skipped" | "active" | "canceled" | "success" | "idle" | "failure";
206
+ status: "success" | "skipped" | "active" | "canceled" | "idle" | "failure";
207
207
  name: "queued" | "build" | "deploy" | "initialize" | "clone_repo";
208
208
  started_on: string | null;
209
209
  ended_on: string | null;
@@ -536,6 +536,11 @@ declare abstract class Controller {
536
536
  protected bus: ControllerBus;
537
537
  constructor(bus: ControllerBus);
538
538
  teardown(): Promise<void>;
539
+ /**
540
+ * Whether `teardown()` has been called, which subclasses should check before
541
+ * starting any new work.
542
+ */
543
+ protected get tearingDown(): boolean;
539
544
  protected emitErrorEvent(event: ErrorEvent): void;
540
545
  }
541
546
  declare abstract class RuntimeController extends Controller {
@@ -816,6 +821,33 @@ type DurableObjectIdentifier = {
816
821
  id: string;
817
822
  name?: never;
818
823
  };
824
+ type FetcherEmailOptions = {
825
+ from: string;
826
+ to: string;
827
+ raw: string | ReadableStream<Uint8Array>;
828
+ };
829
+ type FetcherEmailResult = {
830
+ outcome: "ok" | "exception";
831
+ rejectReason?: string;
832
+ forwards: Array<{
833
+ messageId: string;
834
+ recipient: string;
835
+ headers: [string, string][];
836
+ }>;
837
+ replies: Array<{
838
+ messageId: string;
839
+ sender: string;
840
+ raw: string;
841
+ }>;
842
+ events: Array<{
843
+ type: "forward" | "reply";
844
+ timestamp: string;
845
+ messageId: string;
846
+ } | {
847
+ type: "reject";
848
+ timestamp: string;
849
+ }>;
850
+ };
819
851
  type WorkerDefaultExport = (new (...args: any[]) => Rpc.WorkerEntrypointBranded) | Rpc.WorkerEntrypointBranded | AnyExportedHandler;
820
852
  type WorkerModule = {
821
853
  default: WorkerDefaultExport;
@@ -838,6 +870,19 @@ type WorkerHandle<Env = AnyEnv, Module extends WorkerModule = {
838
870
  * ```
839
871
  */
840
872
  fetch: DispatchFetch;
873
+ /**
874
+ * Dispatches an email event directly to this Worker.
875
+ *
876
+ * @example
877
+ * ```ts
878
+ * const result = await worker.email({
879
+ * from: "sender@example.com",
880
+ * to: "recipient@example.com",
881
+ * raw: "From: sender@example.com\\r\\n...",
882
+ * });
883
+ * ```
884
+ */
885
+ email(options: FetcherEmailOptions): Promise<FetcherEmailResult>;
841
886
  /**
842
887
  * Dispatches a scheduled event directly to this Worker.
843
888
  *
@@ -1168,6 +1213,11 @@ type AssetsOptions = {
1168
1213
  interface Environment extends EnvironmentInheritable, EnvironmentNonInheritable {
1169
1214
  }
1170
1215
  type SimpleRoute = string;
1216
+ /** AWS SigV4 credentials for miniflare's local S3-compatible endpoint */
1217
+ interface LocalS3Credentials {
1218
+ accessKeyId: string;
1219
+ secretAccessKey: string;
1220
+ }
1171
1221
  type ZoneIdRoute = {
1172
1222
  pattern: string;
1173
1223
  zone_id: string;
@@ -1661,11 +1711,11 @@ interface EnvironmentInheritable {
1661
1711
  */
1662
1712
  exports: Exports;
1663
1713
  /**
1664
- * "Cron" definitions to trigger a Worker's "scheduled" function.
1714
+ * Definitions that trigger a Worker from a schedule or a Cloudflare event.
1665
1715
  *
1666
- * Lets you call Workers periodically, much like a cron job.
1716
+ * More details about cron triggers: https://developers.cloudflare.com/workers/platform/cron-triggers
1667
1717
  *
1668
- * More details here https://developers.cloudflare.com/workers/platform/cron-triggers
1718
+ * More details about Artifacts events: https://developers.cloudflare.com/artifacts/guides/event-subscriptions/
1669
1719
  *
1670
1720
  * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
1671
1721
  *
@@ -1673,7 +1723,8 @@ interface EnvironmentInheritable {
1673
1723
  * @inheritable
1674
1724
  */
1675
1725
  triggers: {
1676
- crons: string[] | undefined;
1726
+ crons?: string[];
1727
+ events?: ArtifactsEventTrigger[];
1677
1728
  };
1678
1729
  /**
1679
1730
  * Specify limits for runtime behavior.
@@ -1860,6 +1911,19 @@ type DurableObjectBindings = {
1860
1911
  /** The service environment of the script_name to bind to */
1861
1912
  environment?: string;
1862
1913
  }[];
1914
+ declare const ARTIFACTS_EVENT_TYPES: readonly ["cf.artifacts.repo.created", "cf.artifacts.repo.deleted", "cf.artifacts.repo.forked", "cf.artifacts.repo.imported", "cf.artifacts.repo.pushed", "cf.artifacts.repo.cloned", "cf.artifacts.repo.fetched", "cf.artifacts.repo.token.created", "cf.artifacts.repo.token.revoked"];
1915
+ type ArtifactsEventType = (typeof ARTIFACTS_EVENT_TYPES)[number];
1916
+ type ArtifactsEventTrigger = {
1917
+ type: ArtifactsEventType;
1918
+ filter?: {
1919
+ namespace?: string;
1920
+ repo_name?: string;
1921
+ };
1922
+ targets: {
1923
+ type: "workflow";
1924
+ workflow_name: string;
1925
+ }[];
1926
+ };
1863
1927
  type WorkflowBinding = {
1864
1928
  /** The name of the binding used to refer to the Workflow */
1865
1929
  binding: string;
@@ -2090,6 +2154,16 @@ interface EnvironmentNonInheritable {
2090
2154
  jurisdiction?: string;
2091
2155
  /** Whether the R2 bucket should be remote or not in local development */
2092
2156
  remote?: boolean;
2157
+ /** Settings that only apply to local development */
2158
+ local_dev?: {
2159
+ /**
2160
+ * EXPERIMENTAL: AWS SigV4 credentials for the local S3-compatible
2161
+ * endpoint. When set, the bucket is served at
2162
+ * `/cdn-cgi/local/r2/s3/<bucket-name>` during local development.
2163
+ * Ignored when the bucket runs remotely.
2164
+ */
2165
+ experimental_s3_credentials?: LocalS3Credentials;
2166
+ };
2093
2167
  }[];
2094
2168
  /**
2095
2169
  * Specifies D1 databases that are bound to this Worker environment.