wrangler 0.0.0-e0621809 → 0.0.0-e0850ad1

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.
Files changed (299) hide show
  1. package/README.md +10 -12
  2. package/bin/wrangler.js +9 -75
  3. package/package.json +207 -199
  4. package/templates/__tests__/tsconfig.json +1 -1
  5. package/templates/checked-fetch.js +10 -3
  6. package/templates/facade.d.ts +4 -1
  7. package/templates/middleware/common.ts +9 -4
  8. package/templates/middleware/loader-modules.ts +64 -11
  9. package/templates/middleware/loader-sw.ts +2 -7
  10. package/templates/middleware/middleware-d1-beta.d.ts +3 -0
  11. package/templates/middleware/middleware-miniflare3-json-error.ts +1 -0
  12. package/templates/middleware/middleware-multiworker-dev.d.ts +4 -0
  13. package/templates/middleware/middleware-multiworker-dev.ts +59 -0
  14. package/templates/middleware/middleware-serve-static-assets.d.ts +6 -0
  15. package/templates/middleware/middleware-serve-static-assets.ts +56 -0
  16. package/templates/new-worker-scheduled.ts +1 -1
  17. package/templates/new-worker.ts +1 -1
  18. package/templates/pages-dev-util.ts +4 -1
  19. package/templates/pages-shim.ts +0 -3
  20. package/templates/pages-template-plugin.ts +12 -2
  21. package/templates/pages-template-worker.ts +11 -2
  22. package/templates/tsconfig.json +1 -1
  23. package/wrangler-dist/cli.d.ts +252 -128
  24. package/wrangler-dist/cli.js +87556 -88645
  25. package/wrangler-dist/wasm-sync.wasm +0 -0
  26. package/import_meta_url.js +0 -3
  27. package/miniflare-config-stubs/.env.empty +0 -0
  28. package/miniflare-config-stubs/package.empty.json +0 -1
  29. package/miniflare-config-stubs/wrangler.empty.toml +0 -0
  30. package/miniflare-dist/index.mjs +0 -6368
  31. package/src/__tests__/access.test.ts +0 -25
  32. package/src/__tests__/api-dev.test.ts +0 -238
  33. package/src/__tests__/api-devregistry.test.js +0 -64
  34. package/src/__tests__/api.test.ts +0 -80
  35. package/src/__tests__/config-cache-without-cache-dir.test.ts +0 -38
  36. package/src/__tests__/config-cache.test.ts +0 -42
  37. package/src/__tests__/configuration.test.ts +0 -4464
  38. package/src/__tests__/d1/d1.test.ts +0 -82
  39. package/src/__tests__/d1/execute.test.ts +0 -66
  40. package/src/__tests__/d1/migrate.test.ts +0 -157
  41. package/src/__tests__/d1/splitter.test.ts +0 -255
  42. package/src/__tests__/delete.test.ts +0 -272
  43. package/src/__tests__/deployments.test.ts +0 -369
  44. package/src/__tests__/dev.test.tsx +0 -1617
  45. package/src/__tests__/generate.test.ts +0 -238
  46. package/src/__tests__/get-host-from-url.test.ts +0 -16
  47. package/src/__tests__/guess-worker-format.test.ts +0 -120
  48. package/src/__tests__/helpers/clipboardy-mock.js +0 -4
  49. package/src/__tests__/helpers/cmd-shim.d.ts +0 -11
  50. package/src/__tests__/helpers/end-event-loop.ts +0 -6
  51. package/src/__tests__/helpers/mock-account-id.ts +0 -48
  52. package/src/__tests__/helpers/mock-auth-domain.ts +0 -20
  53. package/src/__tests__/helpers/mock-bin.ts +0 -36
  54. package/src/__tests__/helpers/mock-console.ts +0 -112
  55. package/src/__tests__/helpers/mock-dialogs.ts +0 -139
  56. package/src/__tests__/helpers/mock-get-pages-upload-token.ts +0 -25
  57. package/src/__tests__/helpers/mock-get-zone-from-host.ts +0 -11
  58. package/src/__tests__/helpers/mock-http-server.ts +0 -46
  59. package/src/__tests__/helpers/mock-istty.ts +0 -74
  60. package/src/__tests__/helpers/mock-known-routes.ts +0 -12
  61. package/src/__tests__/helpers/mock-kv.ts +0 -46
  62. package/src/__tests__/helpers/mock-oauth-flow.ts +0 -263
  63. package/src/__tests__/helpers/mock-process.ts +0 -34
  64. package/src/__tests__/helpers/mock-set-timeout.ts +0 -16
  65. package/src/__tests__/helpers/mock-stdin.ts +0 -108
  66. package/src/__tests__/helpers/mock-web-socket.ts +0 -29
  67. package/src/__tests__/helpers/msw/blob-worker.cjs +0 -19
  68. package/src/__tests__/helpers/msw/handlers/access.ts +0 -13
  69. package/src/__tests__/helpers/msw/handlers/deployments.ts +0 -160
  70. package/src/__tests__/helpers/msw/handlers/namespaces.ts +0 -81
  71. package/src/__tests__/helpers/msw/handlers/oauth.ts +0 -31
  72. package/src/__tests__/helpers/msw/handlers/r2.ts +0 -60
  73. package/src/__tests__/helpers/msw/handlers/script.ts +0 -56
  74. package/src/__tests__/helpers/msw/handlers/user.ts +0 -52
  75. package/src/__tests__/helpers/msw/handlers/zones.ts +0 -20
  76. package/src/__tests__/helpers/msw/index.ts +0 -52
  77. package/src/__tests__/helpers/msw/read-file-sync.js +0 -61
  78. package/src/__tests__/helpers/run-in-tmp.ts +0 -38
  79. package/src/__tests__/helpers/run-wrangler.ts +0 -16
  80. package/src/__tests__/helpers/string-dynamic-values-matcher.ts +0 -28
  81. package/src/__tests__/helpers/worker-scripts/child-wrangler.toml +0 -1
  82. package/src/__tests__/helpers/worker-scripts/hello-world-worker.js +0 -5
  83. package/src/__tests__/helpers/worker-scripts/hello-world-wrangler.toml +0 -1
  84. package/src/__tests__/helpers/worker-scripts/parent-worker.js +0 -11
  85. package/src/__tests__/helpers/worker-scripts/parent-wrangler.toml +0 -5
  86. package/src/__tests__/helpers/write-worker-source.ts +0 -31
  87. package/src/__tests__/helpers/write-wrangler-toml.ts +0 -17
  88. package/src/__tests__/https-options.test.ts +0 -163
  89. package/src/__tests__/index.test.ts +0 -280
  90. package/src/__tests__/init.test.ts +0 -3196
  91. package/src/__tests__/jest.setup.ts +0 -179
  92. package/src/__tests__/kv.test.ts +0 -1799
  93. package/src/__tests__/logger.test.ts +0 -141
  94. package/src/__tests__/logout.test.ts +0 -47
  95. package/src/__tests__/metrics.test.ts +0 -493
  96. package/src/__tests__/middleware.scheduled.test.ts +0 -145
  97. package/src/__tests__/middleware.test.ts +0 -816
  98. package/src/__tests__/mtls-certificates.test.ts +0 -588
  99. package/src/__tests__/package-manager.test.ts +0 -353
  100. package/src/__tests__/pages/deployment-list.test.ts +0 -80
  101. package/src/__tests__/pages/functions-build.test.ts +0 -452
  102. package/src/__tests__/pages/pages.test.ts +0 -81
  103. package/src/__tests__/pages/project-create.test.ts +0 -63
  104. package/src/__tests__/pages/project-list.test.ts +0 -110
  105. package/src/__tests__/pages/project-upload.test.ts +0 -500
  106. package/src/__tests__/pages/publish.test.ts +0 -2820
  107. package/src/__tests__/pages-deployment-tail.test.ts +0 -955
  108. package/src/__tests__/parse.test.ts +0 -436
  109. package/src/__tests__/paths.test.ts +0 -39
  110. package/src/__tests__/publish.test.ts +0 -8423
  111. package/src/__tests__/pubsub.test.ts +0 -496
  112. package/src/__tests__/queues.test.ts +0 -532
  113. package/src/__tests__/r2.test.ts +0 -374
  114. package/src/__tests__/route.test.ts +0 -45
  115. package/src/__tests__/secret.test.ts +0 -693
  116. package/src/__tests__/tail.test.ts +0 -958
  117. package/src/__tests__/test-old-node-version.js +0 -31
  118. package/src/__tests__/tsconfig-sanity.ts +0 -12
  119. package/src/__tests__/tsconfig.json +0 -8
  120. package/src/__tests__/tsconfig.tsbuildinfo +0 -1
  121. package/src/__tests__/type-generation.test.ts +0 -234
  122. package/src/__tests__/user.test.ts +0 -118
  123. package/src/__tests__/utils-collectKeyValues.test.ts +0 -47
  124. package/src/__tests__/validate-dev-props.test.ts +0 -56
  125. package/src/__tests__/version.test.ts +0 -35
  126. package/src/__tests__/whoami.test.tsx +0 -172
  127. package/src/__tests__/worker-namespace.test.ts +0 -340
  128. package/src/abort.d.ts +0 -3
  129. package/src/api/dev.ts +0 -327
  130. package/src/api/index.ts +0 -11
  131. package/src/api/mtls-certificate.ts +0 -148
  132. package/src/api/pages/create-worker-bundle-contents.ts +0 -75
  133. package/src/api/pages/index.ts +0 -5
  134. package/src/api/pages/publish.tsx +0 -355
  135. package/src/bundle-reporter.ts +0 -68
  136. package/src/bundle.ts +0 -904
  137. package/src/cfetch/index.ts +0 -158
  138. package/src/cfetch/internal.ts +0 -258
  139. package/src/cli.ts +0 -28
  140. package/src/config/README.md +0 -107
  141. package/src/config/config.ts +0 -282
  142. package/src/config/diagnostics.ts +0 -80
  143. package/src/config/environment.ts +0 -594
  144. package/src/config/index.ts +0 -385
  145. package/src/config/validation-helpers.ts +0 -597
  146. package/src/config/validation.ts +0 -2254
  147. package/src/config-cache.ts +0 -85
  148. package/src/create-worker-preview.ts +0 -293
  149. package/src/create-worker-upload-form.ts +0 -342
  150. package/src/d1/backups.tsx +0 -219
  151. package/src/d1/constants.ts +0 -2
  152. package/src/d1/create.tsx +0 -68
  153. package/src/d1/delete.ts +0 -53
  154. package/src/d1/execute.tsx +0 -357
  155. package/src/d1/formatTimeAgo.ts +0 -14
  156. package/src/d1/index.ts +0 -100
  157. package/src/d1/list.tsx +0 -60
  158. package/src/d1/migrations/apply.tsx +0 -212
  159. package/src/d1/migrations/create.tsx +0 -79
  160. package/src/d1/migrations/helpers.ts +0 -172
  161. package/src/d1/migrations/index.ts +0 -3
  162. package/src/d1/migrations/list.tsx +0 -95
  163. package/src/d1/migrations/options.ts +0 -23
  164. package/src/d1/options.ts +0 -22
  165. package/src/d1/splitter.ts +0 -161
  166. package/src/d1/types.ts +0 -25
  167. package/src/d1/utils.ts +0 -49
  168. package/src/delete.ts +0 -100
  169. package/src/deployments.ts +0 -368
  170. package/src/deprecated/index.ts +0 -144
  171. package/src/dev/dev-vars.ts +0 -39
  172. package/src/dev/dev.tsx +0 -600
  173. package/src/dev/get-local-persistence-path.ts +0 -31
  174. package/src/dev/local.tsx +0 -920
  175. package/src/dev/remote.tsx +0 -632
  176. package/src/dev/start-server.ts +0 -540
  177. package/src/dev/use-esbuild.ts +0 -209
  178. package/src/dev/validate-dev-props.ts +0 -40
  179. package/src/dev-registry.ts +0 -201
  180. package/src/dev.tsx +0 -928
  181. package/src/dialogs.ts +0 -136
  182. package/src/dispatch-namespace.ts +0 -211
  183. package/src/docs/index.ts +0 -97
  184. package/src/durable.ts +0 -102
  185. package/src/entry.ts +0 -327
  186. package/src/environment-variables/factory.ts +0 -88
  187. package/src/environment-variables/misc-variables.ts +0 -30
  188. package/src/errors.ts +0 -11
  189. package/src/generate/index.ts +0 -298
  190. package/src/git-client.ts +0 -135
  191. package/src/global-wrangler-config-path.ts +0 -26
  192. package/src/https-options.ts +0 -127
  193. package/src/index.ts +0 -758
  194. package/src/init.ts +0 -1032
  195. package/src/inspect.ts +0 -782
  196. package/src/intl-polyfill.d.ts +0 -139
  197. package/src/is-ci.ts +0 -14
  198. package/src/is-interactive.ts +0 -16
  199. package/src/jest.d.ts +0 -4
  200. package/src/kv/helpers.ts +0 -430
  201. package/src/kv/index.ts +0 -594
  202. package/src/logger.ts +0 -104
  203. package/src/metrics/index.ts +0 -5
  204. package/src/metrics/metrics-config.ts +0 -239
  205. package/src/metrics/metrics-dispatcher.ts +0 -96
  206. package/src/metrics/metrics-usage-headers.ts +0 -24
  207. package/src/metrics/send-event.ts +0 -99
  208. package/src/miniflare-cli/README.md +0 -30
  209. package/src/miniflare-cli/assets.ts +0 -251
  210. package/src/miniflare-cli/index.ts +0 -210
  211. package/src/miniflare-cli/request-context.ts +0 -40
  212. package/src/miniflare-cli/tsconfig.json +0 -9
  213. package/src/miniflare-cli/tsconfig.tsbuildinfo +0 -1
  214. package/src/miniflare-cli/types.ts +0 -11
  215. package/src/module-collection.ts +0 -267
  216. package/src/mtls-certificate/cli.ts +0 -155
  217. package/src/open-in-browser.ts +0 -17
  218. package/src/package-manager.ts +0 -219
  219. package/src/pages/build.ts +0 -410
  220. package/src/pages/buildFunctions.ts +0 -140
  221. package/src/pages/constants.ts +0 -18
  222. package/src/pages/deployment-tails.ts +0 -281
  223. package/src/pages/deployments.tsx +0 -84
  224. package/src/pages/dev.ts +0 -716
  225. package/src/pages/errors.ts +0 -67
  226. package/src/pages/functions/buildPlugin.ts +0 -112
  227. package/src/pages/functions/buildWorker.ts +0 -297
  228. package/src/pages/functions/filepath-routing.test.ts +0 -234
  229. package/src/pages/functions/filepath-routing.ts +0 -189
  230. package/src/pages/functions/identifiers.ts +0 -78
  231. package/src/pages/functions/routes-consolidation.test.ts +0 -250
  232. package/src/pages/functions/routes-consolidation.ts +0 -73
  233. package/src/pages/functions/routes-transformation.test.ts +0 -282
  234. package/src/pages/functions/routes-transformation.ts +0 -115
  235. package/src/pages/functions/routes-validation.test.ts +0 -403
  236. package/src/pages/functions/routes-validation.ts +0 -202
  237. package/src/pages/functions/routes.ts +0 -151
  238. package/src/pages/functions/tsconfig.json +0 -8
  239. package/src/pages/functions/tsconfig.tsbuildinfo +0 -1
  240. package/src/pages/functions.ts +0 -86
  241. package/src/pages/hash.ts +0 -13
  242. package/src/pages/index.ts +0 -102
  243. package/src/pages/projects.tsx +0 -159
  244. package/src/pages/prompt-select-project.tsx +0 -31
  245. package/src/pages/publish.tsx +0 -267
  246. package/src/pages/types.ts +0 -46
  247. package/src/pages/upload.tsx +0 -469
  248. package/src/pages/utils.ts +0 -23
  249. package/src/parse.ts +0 -308
  250. package/src/paths.ts +0 -71
  251. package/src/proxy.ts +0 -694
  252. package/src/publish/index.ts +0 -274
  253. package/src/publish/publish.ts +0 -1065
  254. package/src/pubsub/index.ts +0 -286
  255. package/src/pubsub/pubsub-commands.ts +0 -623
  256. package/src/queues/cli/commands/consumer/add.ts +0 -71
  257. package/src/queues/cli/commands/consumer/index.ts +0 -19
  258. package/src/queues/cli/commands/consumer/remove.ts +0 -31
  259. package/src/queues/cli/commands/create.ts +0 -25
  260. package/src/queues/cli/commands/delete.ts +0 -26
  261. package/src/queues/cli/commands/index.ts +0 -35
  262. package/src/queues/cli/commands/list.ts +0 -25
  263. package/src/queues/client.ts +0 -136
  264. package/src/queues/utils.ts +0 -18
  265. package/src/r2/constants.ts +0 -4
  266. package/src/r2/helpers.ts +0 -132
  267. package/src/r2/index.ts +0 -289
  268. package/src/routes.ts +0 -140
  269. package/src/secret/index.ts +0 -375
  270. package/src/selfsigned.d.ts +0 -29
  271. package/src/sites.ts +0 -372
  272. package/src/tail/createTail.ts +0 -406
  273. package/src/tail/filters.ts +0 -277
  274. package/src/tail/index.ts +0 -211
  275. package/src/tail/printing.ts +0 -122
  276. package/src/tsconfig-sanity.ts +0 -16
  277. package/src/type-generation.ts +0 -181
  278. package/src/update-check.ts +0 -19
  279. package/src/user/access.ts +0 -68
  280. package/src/user/auth-variables.ts +0 -113
  281. package/src/user/choose-account.tsx +0 -39
  282. package/src/user/generate-auth-url.ts +0 -33
  283. package/src/user/generate-random-state.ts +0 -16
  284. package/src/user/index.ts +0 -2
  285. package/src/user/user.ts +0 -1233
  286. package/src/utils/collectKeyValues.ts +0 -14
  287. package/src/utils/render.ts +0 -93
  288. package/src/whoami.ts +0 -135
  289. package/src/worker.ts +0 -264
  290. package/src/yargs-types.ts +0 -37
  291. package/src/zones.ts +0 -191
  292. package/templates/__tests__/tsconfig.tsbuildinfo +0 -1
  293. package/templates/d1-beta-facade.js +0 -244
  294. package/templates/first-party-worker-module-facade.ts +0 -19
  295. package/templates/format-dev-errors.ts +0 -34
  296. package/templates/serve-static-assets.ts +0 -66
  297. package/templates/service-bindings-module-facade.js +0 -55
  298. package/templates/service-bindings-sw-facade.js +0 -42
  299. package/templates/tsconfig.tsbuildinfo +0 -1
@@ -5,11 +5,12 @@ import { ConnectionOptions } from 'tls';
5
5
  import { Duplex } from 'stream';
6
6
  import { EventEmitter } from 'events';
7
7
  import { IpcNetConnectOpts } from 'net';
8
+ import type { Json } from 'miniflare';
8
9
  import { Readable } from 'stream';
9
- import { ReadableStream } from 'stream/web';
10
- import { Socket } from 'net';
10
+ import { ReadableStream as ReadableStream_2 } from 'stream/web';
11
+ import { Socket as Socket_2 } from 'net';
11
12
  import { TcpNetConnectOpts } from 'net';
12
- import { TlsOptions } from 'tls';
13
+ import { TlsOptions as TlsOptions_2 } from 'tls';
13
14
  import { TLSSocket } from 'tls';
14
15
  import { URL as URL_2 } from 'url';
15
16
  import { URLSearchParams as URLSearchParams_2 } from 'url';
@@ -22,11 +23,11 @@ declare interface BlobPropertyBag {
22
23
  endings?: 'native' | 'transparent'
23
24
  }
24
25
 
25
- declare type BodyInit =
26
+ declare type BodyInit_2 =
26
27
  | ArrayBuffer
27
28
  | AsyncIterable<Uint8Array>
28
29
  | Blob_2
29
- | FormData
30
+ | FormData_2
30
31
  | Iterable<Uint8Array>
31
32
  | NodeJS.ArrayBufferView
32
33
  | URLSearchParams_2
@@ -34,12 +35,12 @@ declare type BodyInit =
34
35
  | string
35
36
 
36
37
  declare interface BodyMixin {
37
- readonly body: ReadableStream | null
38
+ readonly body: ReadableStream_2 | null
38
39
  readonly bodyUsed: boolean
39
40
 
40
41
  readonly arrayBuffer: () => Promise<ArrayBuffer>
41
42
  readonly blob: () => Promise<Blob_2>
42
- readonly formData: () => Promise<FormData>
43
+ readonly formData: () => Promise<FormData_2>
43
44
  readonly json: () => Promise<unknown>
44
45
  readonly text: () => Promise<string>
45
46
  }
@@ -120,16 +121,16 @@ declare namespace buildConnector {
120
121
  port: string
121
122
  servername?: string
122
123
  localAddress?: string | null
123
- httpSocket?: Socket
124
+ httpSocket?: Socket_2
124
125
  }
125
126
 
126
127
  type Callback = (...args: CallbackArgs) => void
127
- type CallbackArgs = [null, Socket | TLSSocket] | [Error, null]
128
+ type CallbackArgs = [null, Socket_2 | TLSSocket] | [Error, null]
128
129
 
129
130
  type connector = connectorAsync | connectorSync
130
131
 
131
132
  interface connectorSync {
132
- (options: buildConnector.Options): Socket | TLSSocket
133
+ (options: buildConnector.Options): Socket_2 | TLSSocket
133
134
  }
134
135
 
135
136
  interface connectorAsync {
@@ -137,6 +138,50 @@ declare namespace buildConnector {
137
138
  }
138
139
  }
139
140
 
141
+ /**
142
+ * An imported module.
143
+ */
144
+ declare interface CfModule {
145
+ /**
146
+ * The module name.
147
+ *
148
+ * @example
149
+ * './src/index.js'
150
+ */
151
+ name: string;
152
+ /**
153
+ * The absolute path of the module on disk, or `undefined` if this is a
154
+ * virtual module. Used as the source URL for this module, so source maps are
155
+ * correctly resolved.
156
+ *
157
+ * @example
158
+ * '/path/to/src/index.js'
159
+ */
160
+ filePath: string | undefined;
161
+ /**
162
+ * The module content, usually JavaScript or WASM code.
163
+ *
164
+ * @example
165
+ * export default {
166
+ * async fetch(request) {
167
+ * return new Response('Ok')
168
+ * }
169
+ * }
170
+ */
171
+ content: string | Buffer;
172
+ /**
173
+ * The module type.
174
+ *
175
+ * If absent, will default to the main module's type.
176
+ */
177
+ type?: CfModuleType;
178
+ }
179
+
180
+ /**
181
+ * A module type.
182
+ */
183
+ declare type CfModuleType = "esm" | "commonjs" | "compiled-wasm" | "text" | "buffer";
184
+
140
185
  /** A basic HTTP/1.1 client, mapped on top a single TCP/TLS connection. Pipelining is disabled by default. */
141
186
  declare class Client extends Dispatcher {
142
187
  constructor(url: string | URL_2, options?: Client.Options);
@@ -169,7 +214,7 @@ declare namespace Client {
169
214
  /** If `true`, an error is thrown when the request content-length header doesn't match the length of the request body. Default: `true`. */
170
215
  strictContentLength?: boolean;
171
216
  /** @deprecated use the connect option instead */
172
- tls?: TlsOptions | null;
217
+ tls?: TlsOptions_2 | null;
173
218
  /** */
174
219
  maxRequestsPerClient?: number;
175
220
  /** Max response body size in bytes, -1 is disabled */
@@ -208,6 +253,74 @@ declare type CustomDomainRoute = {
208
253
 
209
254
  export declare function deleteMTlsCertificate(accountId: string, certificateId: string): Promise<unknown>;
210
255
 
256
+ /**
257
+ * Publish a directory to an account/project.
258
+ * NOTE: You will need the `CLOUDFLARE_API_KEY` environment
259
+ * variable set
260
+ */
261
+ declare function deploy({ directory, accountId, projectName, branch, skipCaching, commitMessage, commitHash, commitDirty, functionsDirectory: customFunctionsDirectory, bundle, }: PagesDeployOptions): Promise<{
262
+ url: string;
263
+ environment: "production" | "preview";
264
+ id: string;
265
+ project_id: string;
266
+ project_name: string;
267
+ build_config: {
268
+ build_command: string;
269
+ destination_dir: string;
270
+ root_dir: string;
271
+ web_analytics_tag?: string | undefined;
272
+ web_analytics_token?: string | undefined;
273
+ fast_builds?: boolean | undefined;
274
+ };
275
+ created_on: string;
276
+ production_branch: string;
277
+ deployment_trigger: {
278
+ type: string;
279
+ metadata: {
280
+ branch: string;
281
+ commit_hash: string;
282
+ commit_message: string;
283
+ };
284
+ };
285
+ latest_stage: {
286
+ name: "build" | "deploy" | "queued" | "initialize" | "clone_repo";
287
+ status: "active" | "idle" | "canceled" | "success" | "failure" | "skipped";
288
+ started_on: string | null;
289
+ ended_on: string | null;
290
+ };
291
+ stages: {
292
+ name: "build" | "deploy" | "queued" | "initialize" | "clone_repo";
293
+ status: "active" | "idle" | "canceled" | "success" | "failure" | "skipped";
294
+ started_on: string | null;
295
+ ended_on: string | null;
296
+ }[];
297
+ aliases: string[];
298
+ modified_on: string;
299
+ short_id: string;
300
+ build_image_major_version: number;
301
+ kv_namespaces?: any;
302
+ source?: {
303
+ type: "github" | "gitlab";
304
+ config: {
305
+ owner: string;
306
+ repo_name: string;
307
+ production_branch?: string | undefined;
308
+ pr_comments_enabled?: boolean | undefined;
309
+ deployments_enabled?: boolean | undefined;
310
+ production_deployments_enabled?: boolean | undefined;
311
+ preview_deployment_setting?: "none" | "all" | "custom" | undefined;
312
+ preview_branch_includes?: string[] | undefined;
313
+ preview_branch_excludes?: string[] | undefined;
314
+ };
315
+ } | undefined;
316
+ env_vars?: any;
317
+ durable_object_namespaces?: any;
318
+ is_skipped?: boolean | undefined;
319
+ files?: {
320
+ [x: string]: string | undefined;
321
+ } | undefined;
322
+ }>;
323
+
211
324
  /**
212
325
  * Deprecated upload configuration.
213
326
  */
@@ -326,7 +439,7 @@ declare namespace Dispatcher {
326
439
  path: string;
327
440
  method: HttpMethod;
328
441
  /** Default: `null` */
329
- body?: string | Buffer | Uint8Array | Readable | null | FormData;
442
+ body?: string | Buffer | Uint8Array | Readable | null | FormData_2;
330
443
  /** Default: `null` */
331
444
  headers?: IncomingHttpHeaders | string[] | null;
332
445
  /** Query string params to be embedded in the request URL. Default: `null` */
@@ -464,6 +577,15 @@ declare namespace Dispatcher {
464
577
  }
465
578
  }
466
579
 
580
+ declare interface DispatchNamespaceOutbound {
581
+ /** Name of the service handling the outbound requests */
582
+ service: string;
583
+ /** (Optional) Name of the environment handling the outbound requests. */
584
+ environment?: string;
585
+ /** (Optional) List of parameter names, for sending context from your dispatch worker to the outbound handler */
586
+ parameters?: string[];
587
+ }
588
+
467
589
  declare type DurableObjectBindings = {
468
590
  /** The name of the binding used to refer to the Durable Object */
469
591
  name: string;
@@ -532,6 +654,11 @@ declare interface EnvironmentInheritable {
532
654
  * The entrypoint/path to the JavaScript file that will be executed.
533
655
  */
534
656
  main: string | undefined;
657
+ /**
658
+ * The directory in which module rules should be evaluated in a `--no-bundle` worker
659
+ * This defaults to dirname(main) when left undefined
660
+ */
661
+ base_dir: string | undefined;
535
662
  /**
536
663
  * Whether we use <name>.<subdomain>.workers.dev to
537
664
  * test and deploy your worker.
@@ -634,7 +761,7 @@ declare interface EnvironmentInheritable {
634
761
  upload?: DeprecatedUpload;
635
762
  };
636
763
  /**
637
- * Skip internal build steps and directly publish script
764
+ * Skip internal build steps and directly deploy script
638
765
  * @inheritable
639
766
  */
640
767
  no_bundle: boolean | undefined;
@@ -662,6 +789,8 @@ declare interface EnvironmentInheritable {
662
789
  binding: string;
663
790
  /** The namespace to bind to. */
664
791
  namespace: string;
792
+ /** Details about the outbound worker which will handle outbound requests from your namespace */
793
+ outbound?: DispatchNamespaceOutbound;
665
794
  }[];
666
795
  /**
667
796
  * Designates this worker as an internal-only "first-party" worker.
@@ -675,15 +804,12 @@ declare interface EnvironmentInheritable {
675
804
  */
676
805
  zone_id?: string;
677
806
  /**
678
- * Specify a compiled capnp schema to use
679
- * Then add a binding per field in the top level message that you will send to logfwdr
807
+ * List of bindings that you will send to logfwdr
680
808
  *
681
- * @default `{schema:undefined,bindings:[]}`
809
+ * @default `{bindings:[]}`
682
810
  * @inheritable
683
811
  */
684
812
  logfwdr: {
685
- /** capnp schema filename */
686
- schema: string | undefined;
687
813
  bindings: {
688
814
  /** The binding name used to refer to logfwdr */
689
815
  name: string;
@@ -702,6 +828,14 @@ declare interface EnvironmentInheritable {
702
828
  * @inheritable
703
829
  */
704
830
  logpush: boolean | undefined;
831
+ /**
832
+ * Specify how the worker should be located to minimize round-trip time.
833
+ *
834
+ * More details: https://developers.cloudflare.com/workers/platform/smart-placement/
835
+ */
836
+ placement: {
837
+ mode: "off" | "smart";
838
+ } | undefined;
705
839
  }
706
840
 
707
841
  /**
@@ -731,9 +865,7 @@ declare interface EnvironmentNonInheritable {
731
865
  * @default `{}`
732
866
  * @nonInheritable
733
867
  */
734
- vars: {
735
- [key: string]: unknown;
736
- };
868
+ vars: Record<string, string | Json>;
737
869
  /**
738
870
  * A list of durable objects that your worker should be bound to.
739
871
  *
@@ -770,6 +902,23 @@ declare interface EnvironmentNonInheritable {
770
902
  /** The ID of the KV namespace used during `wrangler dev` */
771
903
  preview_id?: string;
772
904
  }[];
905
+ /**
906
+ * These specify bindings to send email from inside your Worker.
907
+ *
908
+ * NOTE: This field is not automatically inherited from the top level environment,
909
+ * and so must be specified in every named environment.
910
+ *
911
+ * @default `[]`
912
+ * @nonInheritable
913
+ */
914
+ send_email: {
915
+ /** The binding name used to refer to the this binding */
916
+ name: string;
917
+ /** If this binding should be restricted to a specific verified address */
918
+ destination_address?: string;
919
+ /** If this binding should be restricted to a set of verified addresses */
920
+ allowed_destination_addresses?: string[];
921
+ }[];
773
922
  /**
774
923
  * Specifies Queues that are bound to this Worker environment.
775
924
  *
@@ -819,6 +968,8 @@ declare interface EnvironmentNonInheritable {
819
968
  bucket_name: string;
820
969
  /** The preview name of this R2 bucket at the edge. */
821
970
  preview_bucket_name?: string;
971
+ /** The jurisdiction that the bucket exists in. Default if not present. */
972
+ jurisdiction?: string;
822
973
  }[];
823
974
  /**
824
975
  * Specifies D1 databases that are bound to this Worker environment.
@@ -845,6 +996,21 @@ declare interface EnvironmentNonInheritable {
845
996
  /** Internal use only. */
846
997
  database_internal_env?: string;
847
998
  }[];
999
+ /**
1000
+ * Specifies Constellation projects that are bound to this Worker environment.
1001
+ *
1002
+ * NOTE: This field is not automatically inherited from the top level environment,
1003
+ * and so must be specified in every named environment.
1004
+ *
1005
+ * @default `[]`
1006
+ * @nonInheritable
1007
+ */
1008
+ constellation: {
1009
+ /** The binding name used to refer to the project in the worker. */
1010
+ binding: string;
1011
+ /** The id of the project. */
1012
+ project_id: string;
1013
+ }[];
848
1014
  /**
849
1015
  * Specifies service bindings (worker-to-worker) that are bound to this Worker environment.
850
1016
  *
@@ -877,6 +1043,12 @@ declare interface EnvironmentNonInheritable {
877
1043
  /** The name of this dataset to write to. */
878
1044
  dataset?: string;
879
1045
  }[];
1046
+ /**
1047
+ * A browser that will be usable from the worker.
1048
+ */
1049
+ browser: {
1050
+ binding: string;
1051
+ } | undefined;
880
1052
  /**
881
1053
  * "Unsafe" tables for features that aren't directly supported by wrangler.
882
1054
  *
@@ -903,6 +1075,18 @@ declare interface EnvironmentNonInheritable {
903
1075
  metadata?: {
904
1076
  [key: string]: string;
905
1077
  };
1078
+ /**
1079
+ * Used for internal capnp uploads for the Workers runtime
1080
+ */
1081
+ capnp?: {
1082
+ base_path: string;
1083
+ source_schemas: string[];
1084
+ compiled_schema?: never;
1085
+ } | {
1086
+ base_path?: never;
1087
+ source_schemas?: never;
1088
+ compiled_schema: string;
1089
+ };
906
1090
  };
907
1091
  mtls_certificates: {
908
1092
  /** The binding name used to refer to the certificate in the worker */
@@ -910,6 +1094,7 @@ declare interface EnvironmentNonInheritable {
910
1094
  /** The uuid of the uploaded mTLS certificate */
911
1095
  certificate_id: string;
912
1096
  }[];
1097
+ tail_consumers?: TailConsumer[];
913
1098
  }
914
1099
 
915
1100
  declare namespace Errors {
@@ -1027,7 +1212,7 @@ declare namespace Errors {
1027
1212
  }
1028
1213
  }
1029
1214
 
1030
- declare class File extends Blob_2 {
1215
+ declare class File_2 extends Blob_2 {
1031
1216
  /**
1032
1217
  * Creates a new File instance.
1033
1218
  *
@@ -1060,7 +1245,7 @@ declare interface FilePropertyBag extends BlobPropertyBag {
1060
1245
  /**
1061
1246
  * Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using fetch().
1062
1247
  */
1063
- declare class FormData {
1248
+ declare class FormData_2 {
1064
1249
  /**
1065
1250
  * Appends a new value onto an existing key inside a FormData object,
1066
1251
  * or adds the key if it does not already exist.
@@ -1125,7 +1310,7 @@ declare class FormData {
1125
1310
  * Executes given callback function for each field of the FormData instance
1126
1311
  */
1127
1312
  forEach: (
1128
- callbackfn: (value: FormDataEntryValue, key: string, iterable: FormData) => void,
1313
+ callbackfn: (value: FormDataEntryValue, key: string, iterable: FormData_2) => void,
1129
1314
  thisArg?: unknown
1130
1315
  ) => void
1131
1316
 
@@ -1158,7 +1343,7 @@ declare class FormData {
1158
1343
  /**
1159
1344
  * A `string` or `File` that represents a single value from a set of `FormData` key-value pairs.
1160
1345
  */
1161
- declare type FormDataEntryValue = string | File
1346
+ declare type FormDataEntryValue = string | File_2
1162
1347
 
1163
1348
  /**
1164
1349
  * fetches an mTLS certificate from the account mTLS certificate store by ID
@@ -1170,8 +1355,8 @@ export declare function getMTlsCertificate(accountId: string, id: string): Promi
1170
1355
  */
1171
1356
  export declare function getMTlsCertificateByName(accountId: string, name: string): Promise<MTlsCertificateResponse>;
1172
1357
 
1173
- declare class Headers implements SpecIterable<[string, string]> {
1174
- constructor (init?: HeadersInit)
1358
+ declare class Headers_2 implements SpecIterable<[string, string]> {
1359
+ constructor (init?: HeadersInit_2)
1175
1360
  readonly append: (name: string, value: string) => void
1176
1361
  readonly delete: (name: string) => void
1177
1362
  readonly get: (name: string) => string | null
@@ -1179,7 +1364,7 @@ declare class Headers implements SpecIterable<[string, string]> {
1179
1364
  readonly set: (name: string, value: string) => void
1180
1365
  readonly getSetCookie: () => string[]
1181
1366
  readonly forEach: (
1182
- callbackfn: (value: string, key: string, iterable: Headers) => void,
1367
+ callbackfn: (value: string, key: string, iterable: Headers_2) => void,
1183
1368
  thisArg?: unknown
1184
1369
  ) => void
1185
1370
 
@@ -1189,7 +1374,7 @@ declare class Headers implements SpecIterable<[string, string]> {
1189
1374
  readonly [Symbol.iterator]: () => SpecIterator<[string, string]>
1190
1375
  }
1191
1376
 
1192
- declare type HeadersInit = string[][] | Record<string, string | ReadonlyArray<string>> | Headers
1377
+ declare type HeadersInit_2 = string[][] | Record<string, string | ReadonlyArray<string>> | Headers_2
1193
1378
 
1194
1379
  /**
1195
1380
  * The header type declaration of `undici`.
@@ -1241,9 +1426,9 @@ declare interface MTlsCertificateUploadDetails {
1241
1426
  name?: string;
1242
1427
  }
1243
1428
 
1244
- declare interface PagesPublishOptions {
1429
+ declare interface PagesDeployOptions {
1245
1430
  /**
1246
- * Path to static assets to publish to Pages
1431
+ * Path to static assets to deploy to Pages
1247
1432
  */
1248
1433
  directory: string;
1249
1434
  /**
@@ -1284,79 +1469,11 @@ declare interface PagesPublishOptions {
1284
1469
  functionsDirectory?: string;
1285
1470
  /**
1286
1471
  * Whether to run bundling on `_worker.js` before deploying.
1287
- * Default: false
1472
+ * Default: true
1288
1473
  */
1289
1474
  bundle?: boolean;
1290
1475
  }
1291
1476
 
1292
- /**
1293
- * Publish a directory to an account/project.
1294
- * NOTE: You will need the `CLOUDFLARE_API_KEY` environment
1295
- * variable set
1296
- */
1297
- declare function publish({ directory, accountId, projectName, branch, skipCaching, commitMessage, commitHash, commitDirty, functionsDirectory: customFunctionsDirectory, bundle, }: PagesPublishOptions): Promise<{
1298
- environment: "production" | "preview";
1299
- id: string;
1300
- url: string;
1301
- project_name: string;
1302
- build_config: {
1303
- build_command: string;
1304
- destination_dir: string;
1305
- root_dir: string;
1306
- web_analytics_tag?: string | undefined;
1307
- web_analytics_token?: string | undefined;
1308
- fast_builds?: boolean | undefined;
1309
- };
1310
- created_on: string;
1311
- production_branch: string;
1312
- project_id: string;
1313
- deployment_trigger: {
1314
- type: string;
1315
- metadata: {
1316
- branch: string;
1317
- commit_hash: string;
1318
- commit_message: string;
1319
- };
1320
- };
1321
- latest_stage: {
1322
- name: "build" | "queued" | "initialize" | "clone_repo" | "deploy";
1323
- status: "active" | "canceled" | "success" | "idle" | "failure" | "skipped";
1324
- started_on: string | null;
1325
- ended_on: string | null;
1326
- };
1327
- stages: {
1328
- name: "build" | "queued" | "initialize" | "clone_repo" | "deploy";
1329
- status: "active" | "canceled" | "success" | "idle" | "failure" | "skipped";
1330
- started_on: string | null;
1331
- ended_on: string | null;
1332
- }[];
1333
- aliases: string[];
1334
- modified_on: string;
1335
- short_id: string;
1336
- build_image_major_version: number;
1337
- kv_namespaces?: any;
1338
- source?: {
1339
- type: "github" | "gitlab";
1340
- config: {
1341
- owner: string;
1342
- repo_name: string;
1343
- production_branch?: string | undefined;
1344
- pr_comments_enabled?: boolean | undefined;
1345
- deployments_enabled?: boolean | undefined;
1346
- production_deployments_enabled?: boolean | undefined;
1347
- preview_deployment_setting?: "none" | "all" | "custom" | undefined;
1348
- preview_branch_includes?: string[] | undefined;
1349
- preview_branch_excludes?: string[] | undefined;
1350
- };
1351
- } | undefined;
1352
- env_vars?: any;
1353
- durable_object_namespaces?: any;
1354
- is_skipped?: boolean | undefined;
1355
- files?: {
1356
- [x: string]: string | undefined;
1357
- } | undefined;
1358
- }>;
1359
-
1360
1477
  declare type ReferrerPolicy =
1361
1478
  | ''
1362
1479
  | 'no-referrer'
@@ -1368,13 +1485,13 @@ declare type ReferrerPolicy =
1368
1485
  | 'strict-origin-when-cross-origin'
1369
1486
  | 'unsafe-url';
1370
1487
 
1371
- declare class Request implements BodyMixin {
1372
- constructor (input: RequestInfo, init?: RequestInit)
1488
+ declare class Request_2 implements BodyMixin {
1489
+ constructor (input: RequestInfo_2, init?: RequestInit_2)
1373
1490
 
1374
1491
  readonly cache: RequestCache
1375
1492
  readonly credentials: RequestCredentials
1376
1493
  readonly destination: RequestDestination
1377
- readonly headers: Headers
1494
+ readonly headers: Headers_2
1378
1495
  readonly integrity: string
1379
1496
  readonly method: string
1380
1497
  readonly mode: RequestMode
@@ -1386,16 +1503,16 @@ declare class Request implements BodyMixin {
1386
1503
  readonly signal: AbortSignal
1387
1504
  readonly duplex: RequestDuplex
1388
1505
 
1389
- readonly body: ReadableStream | null
1506
+ readonly body: ReadableStream_2 | null
1390
1507
  readonly bodyUsed: boolean
1391
1508
 
1392
1509
  readonly arrayBuffer: () => Promise<ArrayBuffer>
1393
1510
  readonly blob: () => Promise<Blob_2>
1394
- readonly formData: () => Promise<FormData>
1511
+ readonly formData: () => Promise<FormData_2>
1395
1512
  readonly json: () => Promise<unknown>
1396
1513
  readonly text: () => Promise<string>
1397
1514
 
1398
- readonly clone: () => Request
1515
+ readonly clone: () => Request_2
1399
1516
  }
1400
1517
 
1401
1518
  declare type RequestCache =
@@ -1430,13 +1547,13 @@ declare type RequestDestination =
1430
1547
 
1431
1548
  declare type RequestDuplex = 'half'
1432
1549
 
1433
- declare type RequestInfo = string | URL_2 | Request
1550
+ declare type RequestInfo_2 = string | URL_2 | Request_2
1434
1551
 
1435
- declare interface RequestInit {
1552
+ declare interface RequestInit_2 {
1436
1553
  method?: string
1437
1554
  keepalive?: boolean
1438
- headers?: HeadersInit
1439
- body?: BodyInit
1555
+ headers?: HeadersInit_2
1556
+ body?: BodyInit_2
1440
1557
  redirect?: RequestRedirect
1441
1558
  integrity?: string
1442
1559
  signal?: AbortSignal
@@ -1453,10 +1570,10 @@ declare type RequestMode = 'cors' | 'navigate' | 'no-cors' | 'same-origin'
1453
1570
 
1454
1571
  declare type RequestRedirect = 'error' | 'follow' | 'manual'
1455
1572
 
1456
- declare class Response implements BodyMixin {
1457
- constructor (body?: BodyInit, init?: ResponseInit)
1573
+ declare class Response_2 implements BodyMixin {
1574
+ constructor (body?: BodyInit_2, init?: ResponseInit_2)
1458
1575
 
1459
- readonly headers: Headers
1576
+ readonly headers: Headers_2
1460
1577
  readonly ok: boolean
1461
1578
  readonly status: number
1462
1579
  readonly statusText: string
@@ -1464,26 +1581,26 @@ declare class Response implements BodyMixin {
1464
1581
  readonly url: string
1465
1582
  readonly redirected: boolean
1466
1583
 
1467
- readonly body: ReadableStream | null
1584
+ readonly body: ReadableStream_2 | null
1468
1585
  readonly bodyUsed: boolean
1469
1586
 
1470
1587
  readonly arrayBuffer: () => Promise<ArrayBuffer>
1471
1588
  readonly blob: () => Promise<Blob_2>
1472
- readonly formData: () => Promise<FormData>
1589
+ readonly formData: () => Promise<FormData_2>
1473
1590
  readonly json: () => Promise<unknown>
1474
1591
  readonly text: () => Promise<string>
1475
1592
 
1476
- readonly clone: () => Response
1593
+ readonly clone: () => Response_2
1477
1594
 
1478
- static error (): Response
1479
- static json(data: any, init?: ResponseInit): Response
1480
- static redirect (url: string | URL_2, status: ResponseRedirectStatus): Response
1595
+ static error (): Response_2
1596
+ static json(data: any, init?: ResponseInit_2): Response_2
1597
+ static redirect (url: string | URL_2, status: ResponseRedirectStatus): Response_2
1481
1598
  }
1482
1599
 
1483
- declare interface ResponseInit {
1600
+ declare interface ResponseInit_2 {
1484
1601
  readonly status?: number
1485
1602
  readonly statusText?: string
1486
- readonly headers?: HeadersInit
1603
+ readonly headers?: HeadersInit_2
1487
1604
  }
1488
1605
 
1489
1606
  declare type ResponseRedirectStatus = 301 | 302 | 303 | 307 | 308
@@ -1521,13 +1638,20 @@ declare interface SpecIterator<T, TReturn = any, TNext = undefined> {
1521
1638
  next(...args: [] | [TNext]): IteratorResult<T, TReturn>;
1522
1639
  }
1523
1640
 
1641
+ declare type TailConsumer = {
1642
+ /** The name of the service tail events will be forwarded to. */
1643
+ service: string;
1644
+ /** (Optional) The environt of the service. */
1645
+ environment?: string;
1646
+ };
1647
+
1524
1648
  /**
1525
1649
  * unstable_dev starts a wrangler dev server, and returns a promise that resolves with utility functions to interact with it.
1526
1650
  */
1527
1651
  export declare function unstable_dev(script: string, options?: UnstableDevOptions, apiOptions?: unknown): Promise<UnstableDevWorker>;
1528
1652
 
1529
1653
  export declare const unstable_pages: {
1530
- publish: typeof publish;
1654
+ deploy: typeof deploy;
1531
1655
  };
1532
1656
 
1533
1657
  export declare interface UnstableDevOptions {
@@ -1547,9 +1671,7 @@ export declare interface UnstableDevOptions {
1547
1671
  compatibilityFlags?: string[];
1548
1672
  persist?: boolean;
1549
1673
  persistTo?: string;
1550
- vars?: {
1551
- [key: string]: unknown;
1552
- };
1674
+ vars?: Record<string, string | Json>;
1553
1675
  kv?: {
1554
1676
  binding: string;
1555
1677
  id: string;
@@ -1566,17 +1688,19 @@ export declare interface UnstableDevOptions {
1566
1688
  bucket_name: string;
1567
1689
  preview_bucket_name?: string;
1568
1690
  }[];
1691
+ moduleRoot?: string;
1692
+ rules?: Rule[];
1569
1693
  logLevel?: "none" | "info" | "error" | "log" | "warn" | "debug";
1570
1694
  inspect?: boolean;
1571
1695
  local?: boolean;
1572
1696
  accountId?: string;
1573
1697
  experimental?: {
1698
+ processEntrypoint?: boolean;
1699
+ additionalModules?: CfModule[];
1574
1700
  d1Databases?: Environment["d1_databases"];
1575
1701
  disableExperimentalWarning?: boolean;
1576
1702
  disableDevRegistry?: boolean;
1577
1703
  enablePagesAssetsServiceBinding?: EnablePagesAssetsServiceBindingOptions;
1578
- experimentalLocal?: boolean;
1579
- experimentalLocalRemoteKv?: boolean;
1580
1704
  forceLocal?: boolean;
1581
1705
  liveReload?: boolean;
1582
1706
  showInteractiveDevSession?: boolean;
@@ -1590,7 +1714,7 @@ export declare interface UnstableDevWorker {
1590
1714
  port: number;
1591
1715
  address: string;
1592
1716
  stop: () => Promise<void>;
1593
- fetch: (input?: RequestInfo, init?: RequestInit) => Promise<Response>;
1717
+ fetch: (input?: RequestInfo_2, init?: RequestInit_2) => Promise<Response_2>;
1594
1718
  waitUntilExit: () => Promise<void>;
1595
1719
  }
1596
1720