wrangler 0.0.0-e61dba50 → 0.0.0-e640ed9d
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 +1 -1
- package/bin/wrangler.js +0 -28
- package/config-schema.json +2947 -0
- package/package.json +30 -58
- package/templates/checked-fetch.js +1 -1
- package/templates/facade.d.ts +7 -5
- package/templates/gitignore +0 -5
- package/templates/middleware/loader-modules.ts +92 -94
- package/templates/middleware/middleware-ensure-req-body-drained.ts +18 -0
- package/templates/middleware/middleware-miniflare3-json-error.ts +0 -1
- package/templates/pages-template-plugin.ts +2 -2
- package/templates/pages-template-worker.ts +1 -1
- package/templates/startDevWorker/InspectorProxyWorker.ts +4 -1
- package/templates/startDevWorker/ProxyWorker.ts +117 -35
- package/wrangler-dist/InspectorProxyWorker.js.map +1 -1
- package/wrangler-dist/ProxyWorker.js +78 -24
- package/wrangler-dist/ProxyWorker.js.map +1 -1
- package/wrangler-dist/cli.d.ts +703 -338
- package/wrangler-dist/cli.js +48154 -9209
- package/Cloudflare_CA.pem +0 -18
- package/templates/middleware/middleware-d1-beta.d.ts +0 -3
- package/templates/middleware/middleware-multiworker-dev.d.ts +0 -4
- package/templates/middleware/middleware-multiworker-dev.ts +0 -68
package/wrangler-dist/cli.d.ts
CHANGED
|
@@ -6,24 +6,30 @@ import type { DispatchFetch } from 'miniflare';
|
|
|
6
6
|
import { Duplex } from 'stream';
|
|
7
7
|
import { EventEmitter } from 'events';
|
|
8
8
|
import { EventEmitter as EventEmitter_2 } from 'node:events';
|
|
9
|
+
import { IncomingMessage } from 'http';
|
|
10
|
+
import type { IncomingRequestCfProperties } from '@cloudflare/workers-types/experimental';
|
|
9
11
|
import { IpcNetConnectOpts } from 'net';
|
|
10
12
|
import type { Json } from 'miniflare';
|
|
11
13
|
import type { MessagePort as MessagePort_2 } from 'worker_threads';
|
|
12
14
|
import type { Metafile } from 'esbuild';
|
|
13
15
|
import { Miniflare } from 'miniflare';
|
|
14
16
|
import type { MiniflareOptions } from 'miniflare';
|
|
17
|
+
import type { ModuleRule as ModuleRule_2 } from 'miniflare';
|
|
15
18
|
import { Mutex } from 'miniflare';
|
|
16
19
|
import { Readable } from 'stream';
|
|
17
|
-
import { ReadableStream
|
|
18
|
-
import type { Request as
|
|
19
|
-
import { Response as
|
|
20
|
-
import {
|
|
20
|
+
import { ReadableStream } from 'stream/web';
|
|
21
|
+
import type { Request as Request_2 } from 'miniflare';
|
|
22
|
+
import { Response as Response_2 } from 'miniflare';
|
|
23
|
+
import type { Server } from 'node:http';
|
|
24
|
+
import { ServerResponse } from 'http';
|
|
25
|
+
import { Socket } from 'net';
|
|
21
26
|
import { TcpNetConnectOpts } from 'net';
|
|
22
27
|
import { TLSSocket } from 'tls';
|
|
23
28
|
import { URL as URL_2 } from 'url';
|
|
24
29
|
import { UrlObject } from 'url';
|
|
25
30
|
import { URLSearchParams as URLSearchParams_2 } from 'url';
|
|
26
|
-
import { WebSocket as
|
|
31
|
+
import { WebSocket as WebSocket_2 } from 'miniflare';
|
|
32
|
+
import type { WorkerOptions } from 'miniflare';
|
|
27
33
|
import { Writable } from 'stream';
|
|
28
34
|
|
|
29
35
|
declare type AbortSignal_2 = unknown;
|
|
@@ -88,71 +94,76 @@ declare type BaseErrorEvent<Source = string, Data = undefined> = {
|
|
|
88
94
|
data: Data;
|
|
89
95
|
};
|
|
90
96
|
|
|
97
|
+
declare type BinaryFile = File_2<Uint8Array>;
|
|
98
|
+
|
|
91
99
|
declare type BinaryType = 'blob' | 'arraybuffer'
|
|
92
100
|
|
|
93
101
|
declare type Binding = {
|
|
94
|
-
type: "
|
|
95
|
-
|
|
102
|
+
type: "plain_text";
|
|
103
|
+
value: string;
|
|
96
104
|
} | {
|
|
97
|
-
type: "
|
|
98
|
-
|
|
105
|
+
type: "json";
|
|
106
|
+
value: Json;
|
|
107
|
+
} | ({
|
|
108
|
+
type: "kv_namespace";
|
|
109
|
+
} & BindingOmit<CfKvNamespace>) | ({
|
|
110
|
+
type: "send_email";
|
|
111
|
+
} & BindingOmit<CfSendEmailBindings>) | {
|
|
112
|
+
type: "wasm_module";
|
|
113
|
+
source: BinaryFile;
|
|
99
114
|
} | {
|
|
100
|
-
type: "
|
|
101
|
-
|
|
102
|
-
binding: string;
|
|
103
|
-
/** The name of this D1 database. */
|
|
104
|
-
database_name: string;
|
|
105
|
-
/** The UUID of this D1 database (not required). */
|
|
106
|
-
database_id: string;
|
|
107
|
-
/** The UUID of this D1 database for Wrangler Dev (if specified). */
|
|
108
|
-
preview_database_id?: string;
|
|
109
|
-
/** The name of the migrations table for this D1 database (defaults to 'd1_migrations'). */
|
|
110
|
-
migrations_table?: string;
|
|
111
|
-
/** The path to the directory of migrations for this D1 database (defaults to './migrations'). */
|
|
112
|
-
migrations_dir?: string;
|
|
113
|
-
/** Internal use only. */
|
|
114
|
-
database_internal_env?: string;
|
|
115
|
+
type: "text_blob";
|
|
116
|
+
source: File_2;
|
|
115
117
|
} | {
|
|
116
|
-
type: "
|
|
117
|
-
className: string;
|
|
118
|
-
service?: ServiceDesignator;
|
|
118
|
+
type: "browser";
|
|
119
119
|
} | {
|
|
120
|
-
type: "
|
|
121
|
-
service: ServiceDesignator | ServiceFetch;
|
|
120
|
+
type: "ai";
|
|
122
121
|
} | {
|
|
123
|
-
type: "
|
|
124
|
-
name: string;
|
|
122
|
+
type: "version_metadata";
|
|
125
123
|
} | {
|
|
124
|
+
type: "data_blob";
|
|
125
|
+
source: BinaryFile;
|
|
126
|
+
} | ({
|
|
127
|
+
type: "durable_object_namespace";
|
|
128
|
+
} & BindingOmit<CfDurableObject>) | ({
|
|
129
|
+
type: "queue";
|
|
130
|
+
} & BindingOmit<CfQueue>) | ({
|
|
131
|
+
type: "r2_bucket";
|
|
132
|
+
} & BindingOmit<CfR2Bucket>) | ({
|
|
133
|
+
type: "d1";
|
|
134
|
+
} & Omit<CfD1Database, "binding">) | ({
|
|
135
|
+
type: "vectorize";
|
|
136
|
+
} & Omit<CfVectorize, "binding">) | ({
|
|
126
137
|
type: "constellation";
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
} | {
|
|
132
|
-
type:
|
|
133
|
-
|
|
138
|
+
} & Omit<CfConstellation, "binding">) | ({
|
|
139
|
+
type: "hyperdrive";
|
|
140
|
+
} & Omit<CfHyperdrive, "binding">) | ({
|
|
141
|
+
type: "service";
|
|
142
|
+
} & Omit<CfService, "binding">) | {
|
|
143
|
+
type: "fetcher";
|
|
144
|
+
fetcher: ServiceFetch;
|
|
145
|
+
} | ({
|
|
146
|
+
type: "analytics_engine";
|
|
147
|
+
} & Omit<CfAnalyticsEngineDataset, "binding">) | ({
|
|
148
|
+
type: "dispatch_namespace";
|
|
149
|
+
} & Omit<CfDispatchNamespace, "binding">) | ({
|
|
150
|
+
type: "mtls_certificate";
|
|
151
|
+
} & Omit<CfMTlsCertificate, "binding">) | ({
|
|
152
|
+
type: "logfwdr";
|
|
153
|
+
} & Omit<CfLogfwdrBinding, "name">) | {
|
|
154
|
+
type: `unsafe_${string}`;
|
|
134
155
|
};
|
|
135
156
|
|
|
157
|
+
declare type BindingOmit<T> = Omit<T, "binding" | "name">;
|
|
158
|
+
|
|
136
159
|
/**
|
|
137
160
|
* Result of the `getBindingsProxy` utility
|
|
138
161
|
*/
|
|
139
|
-
export declare type BindingsProxy<Bindings = Record<string, unknown
|
|
162
|
+
export declare type BindingsProxy<Bindings = Record<string, unknown>, CfProperties extends Record<string, unknown> = IncomingRequestCfProperties> = Omit<PlatformProxy<Bindings, CfProperties>, "env"> & {
|
|
140
163
|
/**
|
|
141
164
|
* Object containing the various proxies
|
|
142
165
|
*/
|
|
143
166
|
bindings: Bindings;
|
|
144
|
-
/**
|
|
145
|
-
* Mock of the context object that Workers received in their request handler, all the object's methods are no-op
|
|
146
|
-
*/
|
|
147
|
-
ctx: ExecutionContext_2;
|
|
148
|
-
/**
|
|
149
|
-
* Caches object emulating the Workers Cache runtime API
|
|
150
|
-
*/
|
|
151
|
-
caches: CacheStorage_3;
|
|
152
|
-
/**
|
|
153
|
-
* Function used to dispose of the child process providing the bindings implementation
|
|
154
|
-
*/
|
|
155
|
-
dispose: () => Promise<void>;
|
|
156
167
|
};
|
|
157
168
|
|
|
158
169
|
declare interface BlobPropertyBag {
|
|
@@ -160,11 +171,11 @@ declare interface BlobPropertyBag {
|
|
|
160
171
|
endings?: 'native' | 'transparent'
|
|
161
172
|
}
|
|
162
173
|
|
|
163
|
-
declare type
|
|
174
|
+
declare type BodyInit =
|
|
164
175
|
| ArrayBuffer
|
|
165
176
|
| AsyncIterable<Uint8Array>
|
|
166
177
|
| Blob_2
|
|
167
|
-
|
|
|
178
|
+
| FormData
|
|
168
179
|
| Iterable<Uint8Array>
|
|
169
180
|
| NodeJS.ArrayBufferView
|
|
170
181
|
| URLSearchParams_2
|
|
@@ -172,12 +183,12 @@ declare type BodyInit_2 =
|
|
|
172
183
|
| string
|
|
173
184
|
|
|
174
185
|
declare interface BodyMixin {
|
|
175
|
-
readonly body:
|
|
186
|
+
readonly body: ReadableStream | null
|
|
176
187
|
readonly bodyUsed: boolean
|
|
177
188
|
|
|
178
189
|
readonly arrayBuffer: () => Promise<ArrayBuffer>
|
|
179
190
|
readonly blob: () => Promise<Blob_2>
|
|
180
|
-
readonly formData: () => Promise<
|
|
191
|
+
readonly formData: () => Promise<FormData>
|
|
181
192
|
readonly json: () => Promise<unknown>
|
|
182
193
|
readonly text: () => Promise<string>
|
|
183
194
|
}
|
|
@@ -259,85 +270,88 @@ declare namespace buildConnector {
|
|
|
259
270
|
port: string
|
|
260
271
|
servername?: string
|
|
261
272
|
localAddress?: string | null
|
|
262
|
-
httpSocket?:
|
|
273
|
+
httpSocket?: Socket
|
|
263
274
|
}
|
|
264
275
|
|
|
265
276
|
type Callback = (...args: CallbackArgs) => void
|
|
266
|
-
type CallbackArgs = [null,
|
|
277
|
+
type CallbackArgs = [null, Socket | TLSSocket] | [Error, null]
|
|
267
278
|
|
|
268
279
|
interface connector {
|
|
269
280
|
(options: buildConnector.Options, callback: buildConnector.Callback): void
|
|
270
281
|
}
|
|
271
282
|
}
|
|
272
283
|
|
|
284
|
+
declare type Bundle = EsbuildBundle;
|
|
285
|
+
|
|
273
286
|
declare type BundleCompleteEvent = {
|
|
274
287
|
type: "bundleComplete";
|
|
275
288
|
config: StartDevWorkerOptions;
|
|
276
|
-
bundle:
|
|
289
|
+
bundle: Bundle;
|
|
277
290
|
};
|
|
278
291
|
|
|
279
|
-
declare class BundlerController extends Controller {
|
|
292
|
+
declare class BundlerController extends Controller<BundlerControllerEventMap> {
|
|
280
293
|
onConfigUpdate(_: ConfigUpdateEvent): void;
|
|
281
294
|
teardown(): Promise<void>;
|
|
282
295
|
emitBundleStartEvent(data: BundleStartEvent): void;
|
|
283
296
|
emitBundleCompletetEvent(data: BundleCompleteEvent): void;
|
|
284
|
-
on(event: "bundleStart", listener: (_: BundleStartEvent) => void): this;
|
|
285
|
-
on(event: "bundleComplete", listener: (_: BundleCompleteEvent) => void): this;
|
|
286
|
-
on(event: "error", listener: (_: ErrorEvent_2) => void): this;
|
|
287
|
-
once: typeof BundlerController.on;
|
|
288
297
|
}
|
|
289
298
|
|
|
299
|
+
declare type BundlerControllerEventMap = ControllerEventMap & {
|
|
300
|
+
bundleStart: [BundleStartEvent];
|
|
301
|
+
bundleComplete: [BundleCompleteEvent];
|
|
302
|
+
};
|
|
303
|
+
|
|
290
304
|
declare type BundleStartEvent = {
|
|
291
305
|
type: "bundleStart";
|
|
292
306
|
config: StartDevWorkerOptions;
|
|
293
307
|
};
|
|
294
308
|
|
|
295
|
-
declare interface
|
|
296
|
-
match (request:
|
|
297
|
-
matchAll (request?:
|
|
298
|
-
add (request:
|
|
299
|
-
addAll (requests:
|
|
300
|
-
put (request:
|
|
301
|
-
delete (request:
|
|
302
|
-
keys (request?:
|
|
309
|
+
declare interface Cache {
|
|
310
|
+
match (request: RequestInfo, options?: CacheQueryOptions): Promise<Response | undefined>,
|
|
311
|
+
matchAll (request?: RequestInfo, options?: CacheQueryOptions): Promise<readonly Response[]>,
|
|
312
|
+
add (request: RequestInfo): Promise<undefined>,
|
|
313
|
+
addAll (requests: RequestInfo[]): Promise<undefined>,
|
|
314
|
+
put (request: RequestInfo, response: Response): Promise<undefined>,
|
|
315
|
+
delete (request: RequestInfo, options?: CacheQueryOptions): Promise<boolean>,
|
|
316
|
+
keys (request?: RequestInfo, options?: CacheQueryOptions): Promise<readonly Request[]>
|
|
303
317
|
}
|
|
304
318
|
|
|
305
319
|
/**
|
|
306
320
|
* No-op implementation of Cache
|
|
307
321
|
*/
|
|
308
|
-
declare class
|
|
309
|
-
delete(request: CacheRequest, options?:
|
|
310
|
-
match(request: CacheRequest, options?:
|
|
322
|
+
declare class Cache_2 {
|
|
323
|
+
delete(request: CacheRequest, options?: CacheQueryOptions_2): Promise<boolean>;
|
|
324
|
+
match(request: CacheRequest, options?: CacheQueryOptions_2): Promise<CacheResponse | undefined>;
|
|
311
325
|
put(request: CacheRequest, response: CacheResponse): Promise<void>;
|
|
312
326
|
}
|
|
313
327
|
|
|
314
|
-
declare interface
|
|
328
|
+
declare interface CacheQueryOptions {
|
|
315
329
|
ignoreSearch?: boolean,
|
|
316
330
|
ignoreMethod?: boolean,
|
|
317
331
|
ignoreVary?: boolean
|
|
318
332
|
}
|
|
319
333
|
|
|
320
|
-
declare type
|
|
334
|
+
declare type CacheQueryOptions_2 = {
|
|
321
335
|
ignoreMethod?: boolean;
|
|
322
336
|
};
|
|
323
337
|
|
|
324
|
-
declare type CacheRequest =
|
|
338
|
+
declare type CacheRequest = any;
|
|
325
339
|
|
|
326
|
-
declare type CacheResponse =
|
|
340
|
+
declare type CacheResponse = any;
|
|
327
341
|
|
|
328
|
-
declare const
|
|
342
|
+
declare const caches: CacheStorage;
|
|
329
343
|
|
|
330
|
-
declare interface
|
|
331
|
-
match (request:
|
|
344
|
+
declare interface CacheStorage {
|
|
345
|
+
match (request: RequestInfo, options?: MultiCacheQueryOptions): Promise<Response | undefined>,
|
|
332
346
|
has (cacheName: string): Promise<boolean>,
|
|
333
|
-
open (cacheName: string): Promise<
|
|
347
|
+
open (cacheName: string): Promise<Cache>,
|
|
334
348
|
delete (cacheName: string): Promise<boolean>,
|
|
335
349
|
keys (): Promise<string[]>
|
|
336
350
|
}
|
|
337
351
|
|
|
338
|
-
declare const
|
|
339
|
-
prototype:
|
|
340
|
-
new():
|
|
352
|
+
declare const CacheStorage: {
|
|
353
|
+
prototype: CacheStorage
|
|
354
|
+
new(): CacheStorage
|
|
341
355
|
};
|
|
342
356
|
|
|
343
357
|
/**
|
|
@@ -348,7 +362,7 @@ declare const CacheStorage_2: {
|
|
|
348
362
|
*
|
|
349
363
|
* We are not using miniflare's implementation because that would require the user to provide
|
|
350
364
|
* miniflare-specific Request objects and they would receive back miniflare-specific Response
|
|
351
|
-
* objects, this (in particular the Request part) is not really suitable for `
|
|
365
|
+
* objects, this (in particular the Request part) is not really suitable for `getPlatformProxy`
|
|
352
366
|
* as people would ideally interact with their bindings in a very production-like manner and
|
|
353
367
|
* requiring them to deal with miniflare-specific classes defeats a bit the purpose of the utility.
|
|
354
368
|
*
|
|
@@ -362,9 +376,10 @@ declare const CacheStorage_2: {
|
|
|
362
376
|
/**
|
|
363
377
|
* No-op implementation of CacheStorage
|
|
364
378
|
*/
|
|
365
|
-
declare class
|
|
366
|
-
|
|
367
|
-
|
|
379
|
+
declare class CacheStorage_2 {
|
|
380
|
+
constructor();
|
|
381
|
+
open(cacheName: string): Promise<Cache_2>;
|
|
382
|
+
get default(): Cache_2;
|
|
368
383
|
}
|
|
369
384
|
|
|
370
385
|
/**
|
|
@@ -383,6 +398,36 @@ declare interface CfAccount {
|
|
|
383
398
|
accountId: string;
|
|
384
399
|
}
|
|
385
400
|
|
|
401
|
+
declare interface CfAnalyticsEngineDataset {
|
|
402
|
+
binding: string;
|
|
403
|
+
dataset?: string;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
declare interface CfConstellation {
|
|
407
|
+
binding: string;
|
|
408
|
+
project_id: string;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
declare interface CfD1Database {
|
|
412
|
+
binding: string;
|
|
413
|
+
database_id: string;
|
|
414
|
+
database_name?: string;
|
|
415
|
+
preview_database_id?: string;
|
|
416
|
+
database_internal_env?: string;
|
|
417
|
+
migrations_table?: string;
|
|
418
|
+
migrations_dir?: string;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
declare interface CfDispatchNamespace {
|
|
422
|
+
binding: string;
|
|
423
|
+
namespace: string;
|
|
424
|
+
outbound?: {
|
|
425
|
+
service: string;
|
|
426
|
+
environment?: string;
|
|
427
|
+
parameters?: string[];
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
|
|
386
431
|
/**
|
|
387
432
|
* A Durable Object.
|
|
388
433
|
*/
|
|
@@ -393,6 +438,25 @@ declare interface CfDurableObject {
|
|
|
393
438
|
environment?: string;
|
|
394
439
|
}
|
|
395
440
|
|
|
441
|
+
declare interface CfHyperdrive {
|
|
442
|
+
binding: string;
|
|
443
|
+
id: string;
|
|
444
|
+
localConnectionString?: string;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* A KV namespace.
|
|
449
|
+
*/
|
|
450
|
+
declare interface CfKvNamespace {
|
|
451
|
+
binding: string;
|
|
452
|
+
id: string;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
declare interface CfLogfwdrBinding {
|
|
456
|
+
name: string;
|
|
457
|
+
destination: string;
|
|
458
|
+
}
|
|
459
|
+
|
|
396
460
|
/**
|
|
397
461
|
* An imported module.
|
|
398
462
|
*/
|
|
@@ -435,13 +499,51 @@ declare interface CfModule {
|
|
|
435
499
|
/**
|
|
436
500
|
* A module type.
|
|
437
501
|
*/
|
|
438
|
-
declare type CfModuleType = "esm" | "commonjs" | "compiled-wasm" | "text" | "buffer";
|
|
502
|
+
declare type CfModuleType = "esm" | "commonjs" | "compiled-wasm" | "text" | "buffer" | "python" | "python-requirement" | "nodejs-compat-module";
|
|
503
|
+
|
|
504
|
+
declare interface CfMTlsCertificate {
|
|
505
|
+
binding: string;
|
|
506
|
+
certificate_id: string;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
declare interface CfQueue {
|
|
510
|
+
binding: string;
|
|
511
|
+
queue_name: string;
|
|
512
|
+
delivery_delay?: number;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
declare interface CfR2Bucket {
|
|
516
|
+
binding: string;
|
|
517
|
+
bucket_name: string;
|
|
518
|
+
jurisdiction?: string;
|
|
519
|
+
}
|
|
439
520
|
|
|
440
521
|
/**
|
|
441
522
|
* The type of Worker
|
|
442
523
|
*/
|
|
443
524
|
declare type CfScriptFormat = "modules" | "service-worker";
|
|
444
525
|
|
|
526
|
+
/**
|
|
527
|
+
* A binding to send email.
|
|
528
|
+
*/
|
|
529
|
+
declare interface CfSendEmailBindings {
|
|
530
|
+
name: string;
|
|
531
|
+
destination_address?: string;
|
|
532
|
+
allowed_destination_addresses?: string[];
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
declare interface CfService {
|
|
536
|
+
binding: string;
|
|
537
|
+
service: string;
|
|
538
|
+
environment?: string;
|
|
539
|
+
entrypoint?: string;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
declare interface CfVectorize {
|
|
543
|
+
binding: string;
|
|
544
|
+
index_name: string;
|
|
545
|
+
}
|
|
546
|
+
|
|
445
547
|
/**
|
|
446
548
|
* A basic HTTP/1.1 client, mapped on top a single TCP/TLS connection. Pipelining is disabled by default.
|
|
447
549
|
*/
|
|
@@ -533,18 +635,18 @@ declare namespace Client {
|
|
|
533
635
|
}
|
|
534
636
|
}
|
|
535
637
|
|
|
536
|
-
declare interface
|
|
638
|
+
declare interface CloseEvent extends Event_2 {
|
|
537
639
|
readonly code: number
|
|
538
640
|
readonly reason: string
|
|
539
641
|
readonly wasClean: boolean
|
|
540
642
|
}
|
|
541
643
|
|
|
542
|
-
declare const
|
|
543
|
-
prototype:
|
|
544
|
-
new (type: string, eventInitDict?:
|
|
644
|
+
declare const CloseEvent: {
|
|
645
|
+
prototype: CloseEvent
|
|
646
|
+
new (type: string, eventInitDict?: CloseEventInit): CloseEvent
|
|
545
647
|
};
|
|
546
648
|
|
|
547
|
-
declare interface
|
|
649
|
+
declare interface CloseEventInit extends EventInit {
|
|
548
650
|
code?: number
|
|
549
651
|
reason?: string
|
|
550
652
|
wasClean?: boolean
|
|
@@ -558,17 +660,41 @@ declare type CloudchamberConfig = {
|
|
|
558
660
|
memory?: string;
|
|
559
661
|
};
|
|
560
662
|
|
|
561
|
-
|
|
663
|
+
/**
|
|
664
|
+
* This is the static type definition for the configuration object.
|
|
665
|
+
*
|
|
666
|
+
* It reflects a normalized and validated version of the configuration that you can write in wrangler.toml,
|
|
667
|
+
* and optionally augment with arguments passed directly to wrangler.
|
|
668
|
+
*
|
|
669
|
+
* For more information about the configuration object, see the
|
|
670
|
+
* documentation at https://developers.cloudflare.com/workers/cli-wrangler/configuration
|
|
671
|
+
*
|
|
672
|
+
* Notes:
|
|
673
|
+
*
|
|
674
|
+
* - Fields that are only specified in `ConfigFields` and not `Environment` can only appear
|
|
675
|
+
* in the top level config and should not appear in any environments.
|
|
676
|
+
* - Fields that are specified in `PagesConfigFields` are only relevant for Pages projects
|
|
677
|
+
* - All top level fields in config and environments are optional in the wrangler.toml file.
|
|
678
|
+
*
|
|
679
|
+
* Legend for the annotations:
|
|
680
|
+
*
|
|
681
|
+
* - `@breaking`: the deprecation/optionality is a breaking change from Wrangler v1.
|
|
682
|
+
* - `@todo`: there's more work to be done (with details attached).
|
|
683
|
+
*/
|
|
684
|
+
declare type Config = ConfigFields<DevConfig> & PagesConfigFields & Environment;
|
|
685
|
+
|
|
686
|
+
declare class ConfigController extends Controller<ConfigControllerEventMap> {
|
|
562
687
|
config?: StartDevWorkerOptions;
|
|
563
688
|
setOptions(_: StartDevWorkerOptions): void;
|
|
564
689
|
updateOptions(_: Partial<StartDevWorkerOptions>): void;
|
|
565
690
|
teardown(): Promise<void>;
|
|
566
691
|
emitConfigUpdateEvent(data: ConfigUpdateEvent): void;
|
|
567
|
-
on(event: "configUpdate", listener: (_: ConfigUpdateEvent) => void): this;
|
|
568
|
-
on(event: "error", listener: (_: ErrorEvent_2) => void): this;
|
|
569
|
-
once: typeof ConfigController.on;
|
|
570
692
|
}
|
|
571
693
|
|
|
694
|
+
declare type ConfigControllerEventMap = ControllerEventMap & {
|
|
695
|
+
configUpdate: [ConfigUpdateEvent];
|
|
696
|
+
};
|
|
697
|
+
|
|
572
698
|
declare interface ConfigFields<Dev extends RawDevConfig> {
|
|
573
699
|
configPath: string | undefined;
|
|
574
700
|
/**
|
|
@@ -596,7 +722,7 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
|
|
|
596
722
|
*
|
|
597
723
|
* More details at https://developers.cloudflare.com/workers/learning/using-durable-objects#configuring-durable-object-classes-with-migrations
|
|
598
724
|
*
|
|
599
|
-
* @default
|
|
725
|
+
* @default []
|
|
600
726
|
*/
|
|
601
727
|
migrations: {
|
|
602
728
|
/** A unique identifier for this migration. */
|
|
@@ -640,7 +766,7 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
|
|
|
640
766
|
* items will be uploaded. Example: include = ["upload_dir"]
|
|
641
767
|
*
|
|
642
768
|
* @optional
|
|
643
|
-
* @default
|
|
769
|
+
* @default []
|
|
644
770
|
*/
|
|
645
771
|
include?: string[];
|
|
646
772
|
/**
|
|
@@ -649,7 +775,7 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
|
|
|
649
775
|
* uploads. Example: exclude = ["ignore_dir"]
|
|
650
776
|
*
|
|
651
777
|
* @optional
|
|
652
|
-
* @default
|
|
778
|
+
* @default []
|
|
653
779
|
*/
|
|
654
780
|
exclude?: string[];
|
|
655
781
|
} | undefined;
|
|
@@ -663,7 +789,7 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
|
|
|
663
789
|
exclude: string[];
|
|
664
790
|
browser_TTL: number | undefined;
|
|
665
791
|
serve_single_page_app: boolean;
|
|
666
|
-
} | undefined;
|
|
792
|
+
} | string | undefined;
|
|
667
793
|
/**
|
|
668
794
|
* A list of wasm modules that your worker should be bound to. This is
|
|
669
795
|
* the "legacy" way of binding to a wasm module. ES module workers should
|
|
@@ -704,7 +830,7 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
|
|
|
704
830
|
/**
|
|
705
831
|
* The possible types for a `Rule`.
|
|
706
832
|
*/
|
|
707
|
-
declare type ConfigModuleRuleType = "ESModule" | "CommonJS" | "CompiledWasm" | "Text" | "Data";
|
|
833
|
+
declare type ConfigModuleRuleType = "ESModule" | "CommonJS" | "CompiledWasm" | "Text" | "Data" | "PythonModule" | "PythonRequirement" | "NodeJsCompatModule";
|
|
708
834
|
|
|
709
835
|
declare type ConfigUpdateEvent = {
|
|
710
836
|
type: "configUpdate";
|
|
@@ -717,9 +843,14 @@ url: string | URL_2 | UrlObject,
|
|
|
717
843
|
options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.ConnectOptions, 'origin' | 'path'>
|
|
718
844
|
): Promise<Dispatcher.ConnectData>;
|
|
719
845
|
|
|
720
|
-
declare abstract class Controller extends
|
|
846
|
+
declare abstract class Controller<EventMap extends ControllerEventMap = ControllerEventMap> extends TypedEventEmitterImpl<EventMap> {
|
|
847
|
+
emitErrorEvent(data: ErrorEvent): void;
|
|
721
848
|
}
|
|
722
849
|
|
|
850
|
+
declare type ControllerEventMap = {
|
|
851
|
+
error: [ErrorEvent];
|
|
852
|
+
};
|
|
853
|
+
|
|
723
854
|
declare interface Cookie {
|
|
724
855
|
name: string
|
|
725
856
|
value: string
|
|
@@ -751,7 +882,7 @@ declare type DeferredPromise<T> = {
|
|
|
751
882
|
};
|
|
752
883
|
|
|
753
884
|
declare function deleteCookie (
|
|
754
|
-
headers:
|
|
885
|
+
headers: Headers,
|
|
755
886
|
name: string,
|
|
756
887
|
attributes?: { name?: string, domain?: string }
|
|
757
888
|
): void
|
|
@@ -761,10 +892,10 @@ attributes?: { name?: string, domain?: string }
|
|
|
761
892
|
* NOTE: You will need the `CLOUDFLARE_API_KEY` environment
|
|
762
893
|
* variable set
|
|
763
894
|
*/
|
|
764
|
-
declare function deploy({ directory, accountId, projectName, branch, skipCaching, commitMessage, commitHash, commitDirty, functionsDirectory: customFunctionsDirectory, bundle, }: PagesDeployOptions): Promise<{
|
|
895
|
+
declare function deploy({ directory, accountId, projectName, branch, skipCaching, commitMessage, commitHash, commitDirty, functionsDirectory: customFunctionsDirectory, bundle, args, }: PagesDeployOptions): Promise<{
|
|
765
896
|
url: string;
|
|
766
|
-
environment: "production" | "preview";
|
|
767
897
|
id: string;
|
|
898
|
+
environment: "production" | "preview";
|
|
768
899
|
project_id: string;
|
|
769
900
|
project_name: string;
|
|
770
901
|
build_config: {
|
|
@@ -803,7 +934,6 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
|
|
|
803
934
|
build_image_major_version: number;
|
|
804
935
|
kv_namespaces?: any;
|
|
805
936
|
source?: {
|
|
806
|
-
type: "github" | "gitlab";
|
|
807
937
|
config: {
|
|
808
938
|
owner: string;
|
|
809
939
|
repo_name: string;
|
|
@@ -815,6 +945,7 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
|
|
|
815
945
|
preview_branch_includes?: string[] | undefined;
|
|
816
946
|
preview_branch_excludes?: string[] | undefined;
|
|
817
947
|
};
|
|
948
|
+
type: "github" | "gitlab";
|
|
818
949
|
} | undefined;
|
|
819
950
|
env_vars?: any;
|
|
820
951
|
durable_object_namespaces?: any;
|
|
@@ -859,7 +990,7 @@ declare interface DeprecatedUpload {
|
|
|
859
990
|
*/
|
|
860
991
|
format?: "modules" | "service-worker";
|
|
861
992
|
/**
|
|
862
|
-
* The directory you wish to upload your
|
|
993
|
+
* The directory you wish to upload your Worker from,
|
|
863
994
|
* relative to the wrangler.toml file.
|
|
864
995
|
*
|
|
865
996
|
* Defaults to the directory containing the wrangler.toml file.
|
|
@@ -883,25 +1014,25 @@ declare interface DevConfig {
|
|
|
883
1014
|
/**
|
|
884
1015
|
* IP address for the local dev server to listen on,
|
|
885
1016
|
*
|
|
886
|
-
* @default
|
|
1017
|
+
* @default localhost
|
|
887
1018
|
*/
|
|
888
1019
|
ip: string;
|
|
889
1020
|
/**
|
|
890
1021
|
* Port for the local dev server to listen on
|
|
891
1022
|
*
|
|
892
|
-
* @default
|
|
1023
|
+
* @default 8787
|
|
893
1024
|
*/
|
|
894
1025
|
port: number | undefined;
|
|
895
1026
|
/**
|
|
896
1027
|
* Port for the local dev server's inspector to listen on
|
|
897
1028
|
*
|
|
898
|
-
* @default
|
|
1029
|
+
* @default 9229
|
|
899
1030
|
*/
|
|
900
1031
|
inspector_port: number | undefined;
|
|
901
1032
|
/**
|
|
902
1033
|
* Protocol that local wrangler dev server listens to requests on.
|
|
903
1034
|
*
|
|
904
|
-
* @default
|
|
1035
|
+
* @default http
|
|
905
1036
|
*/
|
|
906
1037
|
local_protocol: "http" | "https";
|
|
907
1038
|
/**
|
|
@@ -910,7 +1041,7 @@ declare interface DevConfig {
|
|
|
910
1041
|
* Setting this to `http` is not currently implemented for remote mode.
|
|
911
1042
|
* See https://github.com/cloudflare/workers-sdk/issues/583
|
|
912
1043
|
*
|
|
913
|
-
* @default
|
|
1044
|
+
* @default https
|
|
914
1045
|
*/
|
|
915
1046
|
upstream_protocol: "https" | "http";
|
|
916
1047
|
/**
|
|
@@ -979,20 +1110,20 @@ declare namespace DiagnosticsChannel {
|
|
|
979
1110
|
interface ClientSendHeadersMessage {
|
|
980
1111
|
request: Request;
|
|
981
1112
|
headers: string;
|
|
982
|
-
socket:
|
|
1113
|
+
socket: Socket;
|
|
983
1114
|
}
|
|
984
1115
|
interface ClientBeforeConnectMessage {
|
|
985
1116
|
connectParams: ConnectParams;
|
|
986
1117
|
connector: Connector;
|
|
987
1118
|
}
|
|
988
1119
|
interface ClientConnectedMessage {
|
|
989
|
-
socket:
|
|
1120
|
+
socket: Socket;
|
|
990
1121
|
connectParams: ConnectParams;
|
|
991
1122
|
connector: Connector;
|
|
992
1123
|
}
|
|
993
1124
|
interface ClientConnectErrorMessage {
|
|
994
1125
|
error: Error;
|
|
995
|
-
socket:
|
|
1126
|
+
socket: Socket;
|
|
996
1127
|
connectParams: ConnectParams;
|
|
997
1128
|
connector: Connector;
|
|
998
1129
|
}
|
|
@@ -1085,7 +1216,7 @@ declare namespace Dispatcher {
|
|
|
1085
1216
|
path: string;
|
|
1086
1217
|
method: HttpMethod;
|
|
1087
1218
|
/** Default: `null` */
|
|
1088
|
-
body?: string | Buffer | Uint8Array | Readable | null |
|
|
1219
|
+
body?: string | Buffer | Uint8Array | Readable | null | FormData;
|
|
1089
1220
|
/** Default: `null` */
|
|
1090
1221
|
headers?: IncomingHttpHeaders | string[] | null;
|
|
1091
1222
|
/** Query string params to be embedded in the request URL. Default: `null` */
|
|
@@ -1232,11 +1363,11 @@ declare interface DispatchNamespaceOutbound {
|
|
|
1232
1363
|
service: string;
|
|
1233
1364
|
/** (Optional) Name of the environment handling the outbound requests. */
|
|
1234
1365
|
environment?: string;
|
|
1235
|
-
/** (Optional) List of parameter names, for sending context from your dispatch
|
|
1366
|
+
/** (Optional) List of parameter names, for sending context from your dispatch Worker to the outbound handler */
|
|
1236
1367
|
parameters?: string[];
|
|
1237
1368
|
}
|
|
1238
1369
|
|
|
1239
|
-
declare type
|
|
1370
|
+
declare type DOMException = typeof globalThis extends { DOMException: infer T }
|
|
1240
1371
|
? T
|
|
1241
1372
|
: any
|
|
1242
1373
|
|
|
@@ -1245,7 +1376,7 @@ declare type DurableObjectBindings = {
|
|
|
1245
1376
|
name: string;
|
|
1246
1377
|
/** The exported class name of the Durable Object */
|
|
1247
1378
|
class_name: string;
|
|
1248
|
-
/** The script where the Durable Object is defined (if it's external to this
|
|
1379
|
+
/** The script where the Durable Object is defined (if it's external to this Worker) */
|
|
1249
1380
|
script_name?: string;
|
|
1250
1381
|
/** The service environment of the script_name to bind to */
|
|
1251
1382
|
environment?: string;
|
|
@@ -1303,7 +1434,7 @@ declare interface EnvironmentDeprecated {
|
|
|
1303
1434
|
*/
|
|
1304
1435
|
"kv-namespaces"?: string;
|
|
1305
1436
|
/**
|
|
1306
|
-
* A list of services that your
|
|
1437
|
+
* A list of services that your Worker should be bound to.
|
|
1307
1438
|
*
|
|
1308
1439
|
* @default `[]`
|
|
1309
1440
|
* @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.
|
|
@@ -1324,7 +1455,7 @@ declare interface EnvironmentDeprecated {
|
|
|
1324
1455
|
*/
|
|
1325
1456
|
declare interface EnvironmentInheritable {
|
|
1326
1457
|
/**
|
|
1327
|
-
* The name of your
|
|
1458
|
+
* The name of your Worker. Alphanumeric + dashes only.
|
|
1328
1459
|
*
|
|
1329
1460
|
* @inheritable
|
|
1330
1461
|
*/
|
|
@@ -1354,58 +1485,73 @@ declare interface EnvironmentInheritable {
|
|
|
1354
1485
|
*
|
|
1355
1486
|
* More details at https://developers.cloudflare.com/workers/platform/compatibility-dates
|
|
1356
1487
|
*
|
|
1488
|
+
* @default `[]`
|
|
1357
1489
|
* @inheritable
|
|
1358
1490
|
*/
|
|
1359
1491
|
compatibility_flags: string[];
|
|
1360
1492
|
/**
|
|
1361
1493
|
* The entrypoint/path to the JavaScript file that will be executed.
|
|
1494
|
+
*
|
|
1495
|
+
* @inheritable
|
|
1362
1496
|
*/
|
|
1363
1497
|
main: string | undefined;
|
|
1364
1498
|
/**
|
|
1365
1499
|
* If true then Wrangler will traverse the file tree below `base_dir`;
|
|
1366
|
-
* Any files that match `rules` will be included in the deployed
|
|
1500
|
+
* Any files that match `rules` will be included in the deployed Worker.
|
|
1367
1501
|
* Defaults to true if `no_bundle` is true, otherwise false.
|
|
1368
1502
|
*
|
|
1369
1503
|
* @inheritable
|
|
1370
1504
|
*/
|
|
1371
1505
|
find_additional_modules: boolean | undefined;
|
|
1372
1506
|
/**
|
|
1373
|
-
*
|
|
1374
|
-
*
|
|
1507
|
+
* Determines whether Wrangler will preserve bundled file names.
|
|
1508
|
+
* Defaults to false.
|
|
1509
|
+
* If left unset, files will be named using the pattern ${fileHash}-${basename},
|
|
1510
|
+
* for example, `34de60b44167af5c5a709e62a4e20c4f18c9e3b6-favicon.ico`.
|
|
1511
|
+
*
|
|
1512
|
+
* @inheritable
|
|
1513
|
+
*/
|
|
1514
|
+
preserve_file_names: boolean | undefined;
|
|
1515
|
+
/**
|
|
1516
|
+
* The directory in which module rules should be evaluated when including additional files into a Worker deployment.
|
|
1517
|
+
* This defaults to the directory containing the `main` entry point of the Worker if not specified.
|
|
1375
1518
|
*
|
|
1376
1519
|
* @inheritable
|
|
1377
1520
|
*/
|
|
1378
1521
|
base_dir: string | undefined;
|
|
1379
1522
|
/**
|
|
1380
1523
|
* Whether we use <name>.<subdomain>.workers.dev to
|
|
1381
|
-
* test and deploy your
|
|
1524
|
+
* test and deploy your Worker.
|
|
1382
1525
|
*
|
|
1526
|
+
* // Carmen according to our tests the default is undefined
|
|
1383
1527
|
* @default `true` (This is a breaking change from Wrangler v1)
|
|
1384
1528
|
* @breaking
|
|
1385
1529
|
* @inheritable
|
|
1386
1530
|
*/
|
|
1387
1531
|
workers_dev: boolean | undefined;
|
|
1388
1532
|
/**
|
|
1389
|
-
* A list of routes that your
|
|
1533
|
+
* A list of routes that your Worker should be published to.
|
|
1390
1534
|
* Only one of `routes` or `route` is required.
|
|
1391
1535
|
*
|
|
1392
|
-
* Only required when workers_dev is false, and there's no scheduled
|
|
1536
|
+
* Only required when workers_dev is false, and there's no scheduled Worker (see `triggers`)
|
|
1393
1537
|
*
|
|
1394
1538
|
* @inheritable
|
|
1395
1539
|
*/
|
|
1396
1540
|
routes: Route[] | undefined;
|
|
1397
1541
|
/**
|
|
1398
|
-
* A route that your
|
|
1542
|
+
* A route that your Worker should be published to. Literally
|
|
1399
1543
|
* the same as routes, but only one.
|
|
1400
1544
|
* Only one of `routes` or `route` is required.
|
|
1401
1545
|
*
|
|
1402
|
-
* Only required when workers_dev is false, and there's no scheduled
|
|
1546
|
+
* Only required when workers_dev is false, and there's no scheduled Worker
|
|
1403
1547
|
*
|
|
1404
1548
|
* @inheritable
|
|
1405
1549
|
*/
|
|
1406
1550
|
route: Route | undefined;
|
|
1407
1551
|
/**
|
|
1408
1552
|
* Path to a custom tsconfig
|
|
1553
|
+
*
|
|
1554
|
+
* @inheritable
|
|
1409
1555
|
*/
|
|
1410
1556
|
tsconfig: string | undefined;
|
|
1411
1557
|
/**
|
|
@@ -1423,9 +1569,9 @@ declare interface EnvironmentInheritable {
|
|
|
1423
1569
|
*/
|
|
1424
1570
|
jsx_fragment: string;
|
|
1425
1571
|
/**
|
|
1426
|
-
* "Cron" definitions to trigger a
|
|
1572
|
+
* "Cron" definitions to trigger a Worker's "scheduled" function.
|
|
1427
1573
|
*
|
|
1428
|
-
* Lets you call
|
|
1574
|
+
* Lets you call Workers periodically, much like a cron job.
|
|
1429
1575
|
*
|
|
1430
1576
|
* More details here https://developers.cloudflare.com/workers/platform/cron-triggers
|
|
1431
1577
|
*
|
|
@@ -1469,7 +1615,7 @@ declare interface EnvironmentInheritable {
|
|
|
1469
1615
|
* Refer to the [custom builds documentation](https://developers.cloudflare.com/workers/cli-wrangler/configuration#build)
|
|
1470
1616
|
* for more details.
|
|
1471
1617
|
*
|
|
1472
|
-
* @default {}
|
|
1618
|
+
* @default {watch_dir:"./src"}
|
|
1473
1619
|
*/
|
|
1474
1620
|
build: {
|
|
1475
1621
|
/** The command used to build your Worker. On Linux and macOS, the command is executed in the `sh` shell and the `cmd` shell for Windows. The `&&` and `||` shell operators may be used. */
|
|
@@ -1500,24 +1646,9 @@ declare interface EnvironmentInheritable {
|
|
|
1500
1646
|
*/
|
|
1501
1647
|
node_compat: boolean | undefined;
|
|
1502
1648
|
/**
|
|
1503
|
-
*
|
|
1649
|
+
* Designates this Worker as an internal-only "first-party" Worker.
|
|
1504
1650
|
*
|
|
1505
|
-
*
|
|
1506
|
-
* and so must be specified in every named environment.
|
|
1507
|
-
*
|
|
1508
|
-
* @default `[]`
|
|
1509
|
-
* @nonInheritable
|
|
1510
|
-
*/
|
|
1511
|
-
dispatch_namespaces: {
|
|
1512
|
-
/** The binding name used to refer to the bound service. */
|
|
1513
|
-
binding: string;
|
|
1514
|
-
/** The namespace to bind to. */
|
|
1515
|
-
namespace: string;
|
|
1516
|
-
/** Details about the outbound worker which will handle outbound requests from your namespace */
|
|
1517
|
-
outbound?: DispatchNamespaceOutbound;
|
|
1518
|
-
}[];
|
|
1519
|
-
/**
|
|
1520
|
-
* Designates this worker as an internal-only "first-party" worker.
|
|
1651
|
+
* @inheritable
|
|
1521
1652
|
*/
|
|
1522
1653
|
first_party_worker: boolean | undefined;
|
|
1523
1654
|
/**
|
|
@@ -1542,7 +1673,7 @@ declare interface EnvironmentInheritable {
|
|
|
1542
1673
|
}[];
|
|
1543
1674
|
};
|
|
1544
1675
|
/**
|
|
1545
|
-
* Send Trace Events from this
|
|
1676
|
+
* Send Trace Events from this Worker to Workers Logpush.
|
|
1546
1677
|
*
|
|
1547
1678
|
* This will not configure a corresponding Logpush job automatically.
|
|
1548
1679
|
*
|
|
@@ -1553,9 +1684,16 @@ declare interface EnvironmentInheritable {
|
|
|
1553
1684
|
*/
|
|
1554
1685
|
logpush: boolean | undefined;
|
|
1555
1686
|
/**
|
|
1556
|
-
*
|
|
1687
|
+
* Include source maps when uploading this worker.
|
|
1688
|
+
* @inheritable
|
|
1689
|
+
*/
|
|
1690
|
+
upload_source_maps: boolean | undefined;
|
|
1691
|
+
/**
|
|
1692
|
+
* Specify how the Worker should be located to minimize round-trip time.
|
|
1557
1693
|
*
|
|
1558
1694
|
* More details: https://developers.cloudflare.com/workers/platform/smart-placement/
|
|
1695
|
+
*
|
|
1696
|
+
* @inheritable
|
|
1559
1697
|
*/
|
|
1560
1698
|
placement: {
|
|
1561
1699
|
mode: "off" | "smart";
|
|
@@ -1573,7 +1711,7 @@ declare interface EnvironmentMap {
|
|
|
1573
1711
|
*
|
|
1574
1712
|
* For more information, see the documentation at https://developers.cloudflare.com/workers/cli-wrangler/configuration#environments
|
|
1575
1713
|
*
|
|
1576
|
-
* @default
|
|
1714
|
+
* @default {}
|
|
1577
1715
|
*/
|
|
1578
1716
|
env?: {
|
|
1579
1717
|
[envName: string]: RawEnvironment;
|
|
@@ -1589,7 +1727,7 @@ declare interface EnvironmentMap {
|
|
|
1589
1727
|
*/
|
|
1590
1728
|
declare interface EnvironmentNonInheritable {
|
|
1591
1729
|
/**
|
|
1592
|
-
* A map of values to substitute when deploying your
|
|
1730
|
+
* A map of values to substitute when deploying your Worker.
|
|
1593
1731
|
*
|
|
1594
1732
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1595
1733
|
* and so must be specified in every named environment.
|
|
@@ -1599,7 +1737,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1599
1737
|
*/
|
|
1600
1738
|
define: Record<string, string>;
|
|
1601
1739
|
/**
|
|
1602
|
-
* A map of environment variables to set when deploying your
|
|
1740
|
+
* A map of environment variables to set when deploying your Worker.
|
|
1603
1741
|
*
|
|
1604
1742
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1605
1743
|
* and so must be specified in every named environment.
|
|
@@ -1609,7 +1747,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1609
1747
|
*/
|
|
1610
1748
|
vars: Record<string, string | Json>;
|
|
1611
1749
|
/**
|
|
1612
|
-
* A list of durable objects that your
|
|
1750
|
+
* A list of durable objects that your Worker should be bound to.
|
|
1613
1751
|
*
|
|
1614
1752
|
* For more information about Durable Objects, see the documentation at
|
|
1615
1753
|
* https://developers.cloudflare.com/workers/learning/using-durable-objects
|
|
@@ -1677,21 +1815,25 @@ declare interface EnvironmentNonInheritable {
|
|
|
1677
1815
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1678
1816
|
* and so must be specified in every named environment.
|
|
1679
1817
|
*
|
|
1680
|
-
* @default `{}`
|
|
1818
|
+
* @default `{consumers:[],producers:[]}`
|
|
1681
1819
|
* @nonInheritable
|
|
1682
1820
|
*/
|
|
1683
1821
|
queues: {
|
|
1684
1822
|
/** Producer bindings */
|
|
1685
1823
|
producers?: {
|
|
1686
|
-
/** The binding name used to refer to the Queue in the
|
|
1824
|
+
/** The binding name used to refer to the Queue in the Worker. */
|
|
1687
1825
|
binding: string;
|
|
1688
1826
|
/** The name of this Queue. */
|
|
1689
1827
|
queue: string;
|
|
1828
|
+
/** The number of seconds to wait before delivering a message */
|
|
1829
|
+
delivery_delay?: number;
|
|
1690
1830
|
}[];
|
|
1691
1831
|
/** Consumer configuration */
|
|
1692
1832
|
consumers?: {
|
|
1693
|
-
/** The name of the queue from which this
|
|
1833
|
+
/** The name of the queue from which this consumer should consume. */
|
|
1694
1834
|
queue: string;
|
|
1835
|
+
/** The consumer type, e.g., worker, http-pull, r2-bucket, etc. Default is worker. */
|
|
1836
|
+
type?: string;
|
|
1695
1837
|
/** The maximum number of messages per batch */
|
|
1696
1838
|
max_batch_size?: number;
|
|
1697
1839
|
/** The maximum number of seconds to wait to fill a batch with messages. */
|
|
@@ -1702,6 +1844,10 @@ declare interface EnvironmentNonInheritable {
|
|
|
1702
1844
|
dead_letter_queue?: string;
|
|
1703
1845
|
/** The maximum number of concurrent consumer Worker invocations. Leaving this unset will allow your consumer to scale to the maximum concurrency needed to keep up with the message backlog. */
|
|
1704
1846
|
max_concurrency?: number | null;
|
|
1847
|
+
/** The number of milliseconds to wait for pulled messages to become visible again */
|
|
1848
|
+
visibility_timeout_ms?: number;
|
|
1849
|
+
/** The number of seconds to wait before retrying a message */
|
|
1850
|
+
retry_delay?: number;
|
|
1705
1851
|
}[];
|
|
1706
1852
|
};
|
|
1707
1853
|
/**
|
|
@@ -1714,7 +1860,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1714
1860
|
* @nonInheritable
|
|
1715
1861
|
*/
|
|
1716
1862
|
r2_buckets: {
|
|
1717
|
-
/** The binding name used to refer to the R2 bucket in the
|
|
1863
|
+
/** The binding name used to refer to the R2 bucket in the Worker. */
|
|
1718
1864
|
binding: string;
|
|
1719
1865
|
/** The name of this R2 bucket at the edge. */
|
|
1720
1866
|
bucket_name: string;
|
|
@@ -1733,7 +1879,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1733
1879
|
* @nonInheritable
|
|
1734
1880
|
*/
|
|
1735
1881
|
d1_databases: {
|
|
1736
|
-
/** The binding name used to refer to the D1 database in the
|
|
1882
|
+
/** The binding name used to refer to the D1 database in the Worker. */
|
|
1737
1883
|
binding: string;
|
|
1738
1884
|
/** The name of this D1 database. */
|
|
1739
1885
|
database_name: string;
|
|
@@ -1758,7 +1904,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1758
1904
|
* @nonInheritable
|
|
1759
1905
|
*/
|
|
1760
1906
|
vectorize: {
|
|
1761
|
-
/** The binding name used to refer to the Vectorize index in the
|
|
1907
|
+
/** The binding name used to refer to the Vectorize index in the Worker. */
|
|
1762
1908
|
binding: string;
|
|
1763
1909
|
/** The name of the index. */
|
|
1764
1910
|
index_name: string;
|
|
@@ -1773,7 +1919,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1773
1919
|
* @nonInheritable
|
|
1774
1920
|
*/
|
|
1775
1921
|
constellation: {
|
|
1776
|
-
/** The binding name used to refer to the project in the
|
|
1922
|
+
/** The binding name used to refer to the project in the Worker. */
|
|
1777
1923
|
binding: string;
|
|
1778
1924
|
/** The id of the project. */
|
|
1779
1925
|
project_id: string;
|
|
@@ -1788,7 +1934,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1788
1934
|
* @nonInheritable
|
|
1789
1935
|
*/
|
|
1790
1936
|
hyperdrive: {
|
|
1791
|
-
/** The binding name used to refer to the project in the
|
|
1937
|
+
/** The binding name used to refer to the project in the Worker. */
|
|
1792
1938
|
binding: string;
|
|
1793
1939
|
/** The id of the database. */
|
|
1794
1940
|
id: string;
|
|
@@ -1796,7 +1942,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1796
1942
|
localConnectionString?: string;
|
|
1797
1943
|
}[];
|
|
1798
1944
|
/**
|
|
1799
|
-
* Specifies service bindings (
|
|
1945
|
+
* Specifies service bindings (Worker-to-Worker) that are bound to this Worker environment.
|
|
1800
1946
|
*
|
|
1801
1947
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1802
1948
|
* and so must be specified in every named environment.
|
|
@@ -1811,6 +1957,8 @@ declare interface EnvironmentNonInheritable {
|
|
|
1811
1957
|
service: string;
|
|
1812
1958
|
/** The environment of the service (e.g. production, staging, etc). */
|
|
1813
1959
|
environment?: string;
|
|
1960
|
+
/** Optionally, the entrypoint (named export) of the service to bind to. */
|
|
1961
|
+
entrypoint?: string;
|
|
1814
1962
|
}[] | undefined;
|
|
1815
1963
|
/**
|
|
1816
1964
|
* Specifies analytics engine datasets that are bound to this Worker environment.
|
|
@@ -1822,22 +1970,41 @@ declare interface EnvironmentNonInheritable {
|
|
|
1822
1970
|
* @nonInheritable
|
|
1823
1971
|
*/
|
|
1824
1972
|
analytics_engine_datasets: {
|
|
1825
|
-
/** The binding name used to refer to the dataset in the
|
|
1973
|
+
/** The binding name used to refer to the dataset in the Worker. */
|
|
1826
1974
|
binding: string;
|
|
1827
1975
|
/** The name of this dataset to write to. */
|
|
1828
1976
|
dataset?: string;
|
|
1829
1977
|
}[];
|
|
1830
1978
|
/**
|
|
1831
|
-
* A browser that will be usable from the
|
|
1979
|
+
* A browser that will be usable from the Worker.
|
|
1980
|
+
*
|
|
1981
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1982
|
+
* and so must be specified in every named environment.
|
|
1983
|
+
*
|
|
1984
|
+
* @default `{}`
|
|
1985
|
+
* @nonInheritable
|
|
1832
1986
|
*/
|
|
1833
1987
|
browser: {
|
|
1834
1988
|
binding: string;
|
|
1835
1989
|
} | undefined;
|
|
1836
1990
|
/**
|
|
1837
1991
|
* Binding to the AI project.
|
|
1992
|
+
*
|
|
1993
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1994
|
+
* and so must be specified in every named environment.
|
|
1995
|
+
*
|
|
1996
|
+
* @default `{}`
|
|
1997
|
+
* @nonInheritable
|
|
1838
1998
|
*/
|
|
1839
1999
|
ai: {
|
|
1840
2000
|
binding: string;
|
|
2001
|
+
staging?: boolean;
|
|
2002
|
+
} | undefined;
|
|
2003
|
+
/**
|
|
2004
|
+
* Binding to the Worker Version's metadata
|
|
2005
|
+
*/
|
|
2006
|
+
version_metadata: {
|
|
2007
|
+
binding: string;
|
|
1841
2008
|
} | undefined;
|
|
1842
2009
|
/**
|
|
1843
2010
|
* "Unsafe" tables for features that aren't directly supported by wrangler.
|
|
@@ -1845,6 +2012,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1845
2012
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1846
2013
|
* and so must be specified in every named environment.
|
|
1847
2014
|
*
|
|
2015
|
+
* @default `{}`
|
|
1848
2016
|
* @nonInheritable
|
|
1849
2017
|
*/
|
|
1850
2018
|
unsafe: {
|
|
@@ -1878,18 +2046,53 @@ declare interface EnvironmentNonInheritable {
|
|
|
1878
2046
|
compiled_schema: string;
|
|
1879
2047
|
};
|
|
1880
2048
|
};
|
|
2049
|
+
/**
|
|
2050
|
+
* Specifies a list of mTLS certificates that are bound to this Worker environment.
|
|
2051
|
+
*
|
|
2052
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2053
|
+
* and so must be specified in every named environment.
|
|
2054
|
+
*
|
|
2055
|
+
* @default `[]`
|
|
2056
|
+
* @nonInheritable
|
|
2057
|
+
*/
|
|
1881
2058
|
mtls_certificates: {
|
|
1882
|
-
/** The binding name used to refer to the certificate in the
|
|
2059
|
+
/** The binding name used to refer to the certificate in the Worker */
|
|
1883
2060
|
binding: string;
|
|
1884
2061
|
/** The uuid of the uploaded mTLS certificate */
|
|
1885
2062
|
certificate_id: string;
|
|
1886
2063
|
}[];
|
|
2064
|
+
/**
|
|
2065
|
+
* Specifies a list of Tail Workers that are bound to this Worker environment
|
|
2066
|
+
*
|
|
2067
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2068
|
+
* and so must be specified in every named environment.
|
|
2069
|
+
*
|
|
2070
|
+
* @default `[]`
|
|
2071
|
+
* @nonInheritable
|
|
2072
|
+
*/
|
|
1887
2073
|
tail_consumers?: TailConsumer[];
|
|
2074
|
+
/**
|
|
2075
|
+
* Specifies namespace bindings that are bound to this Worker environment.
|
|
2076
|
+
*
|
|
2077
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2078
|
+
* and so must be specified in every named environment.
|
|
2079
|
+
*
|
|
2080
|
+
* @default `[]`
|
|
2081
|
+
* @nonInheritable
|
|
2082
|
+
*/
|
|
2083
|
+
dispatch_namespaces: {
|
|
2084
|
+
/** The binding name used to refer to the bound service. */
|
|
2085
|
+
binding: string;
|
|
2086
|
+
/** The namespace to bind to. */
|
|
2087
|
+
namespace: string;
|
|
2088
|
+
/** Details about the outbound Worker which will handle outbound requests from your namespace */
|
|
2089
|
+
outbound?: DispatchNamespaceOutbound;
|
|
2090
|
+
}[];
|
|
1888
2091
|
}
|
|
1889
2092
|
|
|
1890
|
-
declare type
|
|
2093
|
+
declare type ErrorEvent = BaseErrorEvent<"ConfigController" | "BundlerController" | "LocalRuntimeController" | "RemoteRuntimeController" | "ProxyWorker" | "InspectorProxyWorker"> | BaseErrorEvent<"ProxyController", {
|
|
1891
2094
|
config?: StartDevWorkerOptions;
|
|
1892
|
-
bundle?:
|
|
2095
|
+
bundle?: Bundle;
|
|
1893
2096
|
}>;
|
|
1894
2097
|
|
|
1895
2098
|
declare namespace Errors {
|
|
@@ -2019,6 +2222,7 @@ declare namespace Errors {
|
|
|
2019
2222
|
declare type EsbuildBundle = {
|
|
2020
2223
|
id: number;
|
|
2021
2224
|
path: string;
|
|
2225
|
+
entrypointSource: string;
|
|
2022
2226
|
entry: Entry;
|
|
2023
2227
|
type: CfModuleType;
|
|
2024
2228
|
modules: CfModule[];
|
|
@@ -2049,17 +2253,17 @@ declare type Event_2 = typeof globalThis extends { Event: infer T }
|
|
|
2049
2253
|
readonly type: string
|
|
2050
2254
|
}
|
|
2051
2255
|
|
|
2052
|
-
declare interface
|
|
2256
|
+
declare interface EventInit {
|
|
2053
2257
|
bubbles?: boolean
|
|
2054
2258
|
cancelable?: boolean
|
|
2055
2259
|
composed?: boolean
|
|
2056
2260
|
}
|
|
2057
2261
|
|
|
2058
|
-
declare interface
|
|
2262
|
+
declare interface EventListener {
|
|
2059
2263
|
(evt: Event_2): void
|
|
2060
2264
|
}
|
|
2061
2265
|
|
|
2062
|
-
declare interface
|
|
2266
|
+
declare interface EventListenerObject {
|
|
2063
2267
|
handleEvent (object: Event_2): void
|
|
2064
2268
|
}
|
|
2065
2269
|
|
|
@@ -2067,7 +2271,7 @@ declare interface EventListenerOptions {
|
|
|
2067
2271
|
capture?: boolean
|
|
2068
2272
|
}
|
|
2069
2273
|
|
|
2070
|
-
declare type
|
|
2274
|
+
declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject
|
|
2071
2275
|
|
|
2072
2276
|
declare type _EventMethods = keyof ProtocolMapping.Events;
|
|
2073
2277
|
|
|
@@ -2087,17 +2291,17 @@ declare type EventTarget_2 = typeof globalThis extends { EventTarget: infer T }
|
|
|
2087
2291
|
): void
|
|
2088
2292
|
}
|
|
2089
2293
|
|
|
2090
|
-
declare class
|
|
2294
|
+
declare class ExecutionContext {
|
|
2091
2295
|
waitUntil(promise: Promise<any>): void;
|
|
2092
2296
|
passThroughOnException(): void;
|
|
2093
2297
|
}
|
|
2094
2298
|
|
|
2095
|
-
declare function
|
|
2096
|
-
input:
|
|
2097
|
-
init?:
|
|
2098
|
-
): Promise<
|
|
2299
|
+
declare function fetch (
|
|
2300
|
+
input: RequestInfo,
|
|
2301
|
+
init?: RequestInit
|
|
2302
|
+
): Promise<Response>
|
|
2099
2303
|
|
|
2100
|
-
declare class
|
|
2304
|
+
declare class File extends Blob_2 {
|
|
2101
2305
|
/**
|
|
2102
2306
|
* Creates a new File instance.
|
|
2103
2307
|
*
|
|
@@ -2120,7 +2324,7 @@ declare class File_2 extends Blob_2 {
|
|
|
2120
2324
|
readonly [Symbol.toStringTag]: string
|
|
2121
2325
|
}
|
|
2122
2326
|
|
|
2123
|
-
declare type
|
|
2327
|
+
declare type File_2<Contents = string> = {
|
|
2124
2328
|
path: string;
|
|
2125
2329
|
} | {
|
|
2126
2330
|
contents: Contents;
|
|
@@ -2158,7 +2362,7 @@ declare class FileReader {
|
|
|
2158
2362
|
|
|
2159
2363
|
readonly result: string | ArrayBuffer | null
|
|
2160
2364
|
|
|
2161
|
-
readonly error:
|
|
2365
|
+
readonly error: DOMException | null
|
|
2162
2366
|
|
|
2163
2367
|
onloadstart: null | ((this: FileReader, event: ProgressEvent) => void)
|
|
2164
2368
|
onprogress: null | ((this: FileReader, event: ProgressEvent) => void)
|
|
@@ -2171,7 +2375,7 @@ declare class FileReader {
|
|
|
2171
2375
|
/**
|
|
2172
2376
|
* 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().
|
|
2173
2377
|
*/
|
|
2174
|
-
declare class
|
|
2378
|
+
declare class FormData {
|
|
2175
2379
|
/**
|
|
2176
2380
|
* Appends a new value onto an existing key inside a FormData object,
|
|
2177
2381
|
* or adds the key if it does not already exist.
|
|
@@ -2236,7 +2440,7 @@ declare class FormData_2 {
|
|
|
2236
2440
|
* Executes given callback function for each field of the FormData instance
|
|
2237
2441
|
*/
|
|
2238
2442
|
forEach: (
|
|
2239
|
-
callbackfn: (value: FormDataEntryValue, key: string, iterable:
|
|
2443
|
+
callbackfn: (value: FormDataEntryValue, key: string, iterable: FormData) => void,
|
|
2240
2444
|
thisArg?: unknown
|
|
2241
2445
|
) => void
|
|
2242
2446
|
|
|
@@ -2269,21 +2473,46 @@ declare class FormData_2 {
|
|
|
2269
2473
|
/**
|
|
2270
2474
|
* A `string` or `File` that represents a single value from a set of `FormData` key-value pairs.
|
|
2271
2475
|
*/
|
|
2272
|
-
declare type FormDataEntryValue = string |
|
|
2476
|
+
declare type FormDataEntryValue = string | File
|
|
2273
2477
|
|
|
2274
2478
|
/**
|
|
2275
2479
|
* By reading from a `wrangler.toml` file this function generates proxy binding objects that can be
|
|
2276
2480
|
* used to simulate the interaction with bindings during local development in a Node.js environment
|
|
2277
2481
|
*
|
|
2482
|
+
* @deprecated use `getPlatformProxy` instead
|
|
2483
|
+
*
|
|
2484
|
+
* @param options The various options that can tweak this function's behavior
|
|
2485
|
+
* @returns An Object containing the generated proxies alongside other related utilities
|
|
2486
|
+
*/
|
|
2487
|
+
export declare function getBindingsProxy<Bindings = Record<string, unknown>, CfProperties extends Record<string, unknown> = IncomingRequestCfProperties>(options?: GetBindingsProxyOptions): Promise<BindingsProxy<Bindings, CfProperties>>;
|
|
2488
|
+
|
|
2489
|
+
/** Options for the `getBindingsProxy` utility */
|
|
2490
|
+
export declare type GetBindingsProxyOptions = GetPlatformProxyOptions;
|
|
2491
|
+
|
|
2492
|
+
declare function getCookies (headers: Headers): Record<string, string>
|
|
2493
|
+
|
|
2494
|
+
declare function getGlobalDispatcher(): Dispatcher;
|
|
2495
|
+
|
|
2496
|
+
declare function getGlobalOrigin(): URL | undefined;
|
|
2497
|
+
|
|
2498
|
+
/**
|
|
2499
|
+
* By reading from a `wrangler.toml` file this function generates proxy objects that can be
|
|
2500
|
+
* used to simulate the interaction with the Cloudflare platform during local development
|
|
2501
|
+
* in a Node.js environment
|
|
2502
|
+
*
|
|
2278
2503
|
* @param options The various options that can tweak this function's behavior
|
|
2279
2504
|
* @returns An Object containing the generated proxies alongside other related utilities
|
|
2280
2505
|
*/
|
|
2281
|
-
export declare function
|
|
2506
|
+
export declare function getPlatformProxy<Env = Record<string, unknown>, CfProperties extends Record<string, unknown> = IncomingRequestCfProperties>(options?: GetPlatformProxyOptions): Promise<PlatformProxy<Env, CfProperties>>;
|
|
2282
2507
|
|
|
2283
2508
|
/**
|
|
2284
|
-
* Options for the `
|
|
2509
|
+
* Options for the `getPlatformProxy` utility
|
|
2285
2510
|
*/
|
|
2286
|
-
export declare type
|
|
2511
|
+
export declare type GetPlatformProxyOptions = {
|
|
2512
|
+
/**
|
|
2513
|
+
* The name of the environment to use
|
|
2514
|
+
*/
|
|
2515
|
+
environment?: string;
|
|
2287
2516
|
/**
|
|
2288
2517
|
* The path to the config object to use (default `wrangler.toml`)
|
|
2289
2518
|
*/
|
|
@@ -2305,16 +2534,10 @@ export declare type GetBindingsProxyOptions = {
|
|
|
2305
2534
|
};
|
|
2306
2535
|
};
|
|
2307
2536
|
|
|
2308
|
-
declare function
|
|
2309
|
-
|
|
2310
|
-
declare function getGlobalDispatcher(): Dispatcher;
|
|
2311
|
-
|
|
2312
|
-
declare function getGlobalOrigin(): URL | undefined;
|
|
2313
|
-
|
|
2314
|
-
declare function getSetCookies (headers: Headers_2): Cookie[]
|
|
2537
|
+
declare function getSetCookies (headers: Headers): Cookie[]
|
|
2315
2538
|
|
|
2316
|
-
declare class
|
|
2317
|
-
constructor (init?:
|
|
2539
|
+
declare class Headers implements SpecIterable<[string, string]> {
|
|
2540
|
+
constructor (init?: HeadersInit)
|
|
2318
2541
|
readonly append: (name: string, value: string) => void
|
|
2319
2542
|
readonly delete: (name: string) => void
|
|
2320
2543
|
readonly get: (name: string) => string | null
|
|
@@ -2322,7 +2545,7 @@ declare class Headers_2 implements SpecIterable<[string, string]> {
|
|
|
2322
2545
|
readonly set: (name: string, value: string) => void
|
|
2323
2546
|
readonly getSetCookie: () => string[]
|
|
2324
2547
|
readonly forEach: (
|
|
2325
|
-
callbackfn: (value: string, key: string, iterable:
|
|
2548
|
+
callbackfn: (value: string, key: string, iterable: Headers) => void,
|
|
2326
2549
|
thisArg?: unknown
|
|
2327
2550
|
) => void
|
|
2328
2551
|
|
|
@@ -2332,9 +2555,16 @@ declare class Headers_2 implements SpecIterable<[string, string]> {
|
|
|
2332
2555
|
readonly [Symbol.iterator]: () => SpecIterator<[string, string]>
|
|
2333
2556
|
}
|
|
2334
2557
|
|
|
2335
|
-
declare type
|
|
2558
|
+
declare type HeadersInit = string[][] | Record<string, string | ReadonlyArray<string>> | Headers
|
|
2336
2559
|
|
|
2337
|
-
declare type Hook<T
|
|
2560
|
+
declare type Hook<T extends string | number | object> = T | Promise<T> | (() => T | Promise<T>);
|
|
2561
|
+
|
|
2562
|
+
/**
|
|
2563
|
+
* @property terminate Terminates HTTP server.
|
|
2564
|
+
*/
|
|
2565
|
+
declare type HttpTerminator = {
|
|
2566
|
+
readonly terminate: () => Promise<void>;
|
|
2567
|
+
};
|
|
2338
2568
|
|
|
2339
2569
|
/**
|
|
2340
2570
|
* The header type declaration of `undici`.
|
|
@@ -2369,11 +2599,26 @@ declare interface Interceptable extends Dispatcher {
|
|
|
2369
2599
|
intercept(options: MockInterceptor.Options): MockInterceptor;
|
|
2370
2600
|
}
|
|
2371
2601
|
|
|
2602
|
+
declare class Logger {
|
|
2603
|
+
constructor();
|
|
2604
|
+
loggerLevel: "none" | "error" | "warn" | "info" | "log" | "debug";
|
|
2605
|
+
columns: number;
|
|
2606
|
+
debug: (...args: unknown[]) => void;
|
|
2607
|
+
debugWithSanitization: (label: string, ...args: unknown[]) => void;
|
|
2608
|
+
info: (...args: unknown[]) => void;
|
|
2609
|
+
log: (...args: unknown[]) => void;
|
|
2610
|
+
warn: (...args: unknown[]) => void;
|
|
2611
|
+
error: (...args: unknown[]) => void;
|
|
2612
|
+
table<Keys extends string>(data: TableRow<Keys>[]): void;
|
|
2613
|
+
private doLog;
|
|
2614
|
+
private formatMessage;
|
|
2615
|
+
}
|
|
2616
|
+
|
|
2372
2617
|
declare type LogLevel = "debug" | "info" | "log" | "warn" | "error" | "none";
|
|
2373
2618
|
|
|
2374
2619
|
declare type MaybePromise<T> = T | Promise<T>;
|
|
2375
2620
|
|
|
2376
|
-
declare interface
|
|
2621
|
+
declare interface MessageEvent<T = any> extends Event_2 {
|
|
2377
2622
|
readonly data: T
|
|
2378
2623
|
readonly lastEventId: string
|
|
2379
2624
|
readonly origin: string
|
|
@@ -2391,12 +2636,12 @@ declare interface MessageEvent_2<T = any> extends Event_2 {
|
|
|
2391
2636
|
): void;
|
|
2392
2637
|
}
|
|
2393
2638
|
|
|
2394
|
-
declare const
|
|
2395
|
-
prototype:
|
|
2396
|
-
new<T>(type: string, eventInitDict?:
|
|
2639
|
+
declare const MessageEvent: {
|
|
2640
|
+
prototype: MessageEvent
|
|
2641
|
+
new<T>(type: string, eventInitDict?: MessageEventInit<T>): MessageEvent<T>
|
|
2397
2642
|
};
|
|
2398
2643
|
|
|
2399
|
-
declare interface
|
|
2644
|
+
declare interface MessageEventInit<T = any> extends EventInit {
|
|
2400
2645
|
data?: T
|
|
2401
2646
|
lastEventId?: string
|
|
2402
2647
|
origin?: string
|
|
@@ -2529,8 +2774,8 @@ declare namespace MockInterceptor {
|
|
|
2529
2774
|
path: string;
|
|
2530
2775
|
origin: string;
|
|
2531
2776
|
method: string;
|
|
2532
|
-
body?:
|
|
2533
|
-
headers:
|
|
2777
|
+
body?: BodyInit | Dispatcher.DispatchOptions['body'];
|
|
2778
|
+
headers: Headers | Record<string, string>;
|
|
2534
2779
|
maxRedirections: number;
|
|
2535
2780
|
}
|
|
2536
2781
|
|
|
@@ -2574,15 +2819,37 @@ declare class MockScope<TData extends object = object> {
|
|
|
2574
2819
|
}
|
|
2575
2820
|
|
|
2576
2821
|
declare interface ModuleRule {
|
|
2577
|
-
type: "ESModule" | "CommonJS" | "
|
|
2822
|
+
type: "ESModule" | "CommonJS" | "NodeJsCompatModule" | "CompiledWasm" | "Text" | "Data";
|
|
2578
2823
|
include?: string[];
|
|
2579
2824
|
fallthrough?: boolean;
|
|
2580
2825
|
}
|
|
2581
2826
|
|
|
2582
|
-
declare interface MultiCacheQueryOptions extends
|
|
2827
|
+
declare interface MultiCacheQueryOptions extends CacheQueryOptions {
|
|
2583
2828
|
cacheName?: string
|
|
2584
2829
|
}
|
|
2585
2830
|
|
|
2831
|
+
declare interface PagesConfigFields {
|
|
2832
|
+
/**
|
|
2833
|
+
* The directory of static assets to serve.
|
|
2834
|
+
*
|
|
2835
|
+
* The presence of this field in `wrangler.toml` indicates a Pages project,
|
|
2836
|
+
* and will prompt the handling of the configuration file according to the
|
|
2837
|
+
* Pages-specific validation rules.
|
|
2838
|
+
*/
|
|
2839
|
+
pages_build_output_dir?: string;
|
|
2840
|
+
}
|
|
2841
|
+
|
|
2842
|
+
declare interface PagesConfigFields {
|
|
2843
|
+
/**
|
|
2844
|
+
* The directory of static assets to serve.
|
|
2845
|
+
*
|
|
2846
|
+
* The presence of this field in `wrangler.toml` indicates a Pages project,
|
|
2847
|
+
* and will prompt the handling of the configuration file according to the
|
|
2848
|
+
* Pages-specific validation rules.
|
|
2849
|
+
*/
|
|
2850
|
+
pages_build_output_dir?: string;
|
|
2851
|
+
}
|
|
2852
|
+
|
|
2586
2853
|
declare interface PagesDeployOptions {
|
|
2587
2854
|
/**
|
|
2588
2855
|
* Path to static assets to deploy to Pages
|
|
@@ -2629,6 +2896,10 @@ declare interface PagesDeployOptions {
|
|
|
2629
2896
|
* Default: true
|
|
2630
2897
|
*/
|
|
2631
2898
|
bundle?: boolean;
|
|
2899
|
+
/**
|
|
2900
|
+
* Command line args passed to the `pages deploy` cmd
|
|
2901
|
+
*/
|
|
2902
|
+
args?: Record<string, unknown>;
|
|
2632
2903
|
}
|
|
2633
2904
|
|
|
2634
2905
|
declare type _Params<ParamsArray extends [unknown?]> = ParamsArray extends [infer P] ? P : undefined;
|
|
@@ -2655,6 +2926,32 @@ options: { dispatcher?: Dispatcher } & Omit<Dispatcher.PipelineOptions, 'origin'
|
|
|
2655
2926
|
handler: Dispatcher.PipelineHandler
|
|
2656
2927
|
): Duplex;
|
|
2657
2928
|
|
|
2929
|
+
/**
|
|
2930
|
+
* Result of the `getPlatformProxy` utility
|
|
2931
|
+
*/
|
|
2932
|
+
export declare type PlatformProxy<Env = Record<string, unknown>, CfProperties extends Record<string, unknown> = IncomingRequestCfProperties> = {
|
|
2933
|
+
/**
|
|
2934
|
+
* Environment object containing the various Cloudflare bindings
|
|
2935
|
+
*/
|
|
2936
|
+
env: Env;
|
|
2937
|
+
/**
|
|
2938
|
+
* Mock of the context object that Workers received in their request handler, all the object's methods are no-op
|
|
2939
|
+
*/
|
|
2940
|
+
cf: CfProperties;
|
|
2941
|
+
/**
|
|
2942
|
+
* Mock of the context object that Workers received in their request handler, all the object's methods are no-op
|
|
2943
|
+
*/
|
|
2944
|
+
ctx: ExecutionContext;
|
|
2945
|
+
/**
|
|
2946
|
+
* Caches object emulating the Workers Cache runtime API
|
|
2947
|
+
*/
|
|
2948
|
+
caches: CacheStorage_2;
|
|
2949
|
+
/**
|
|
2950
|
+
* Function used to dispose of the child process providing the bindings implementation
|
|
2951
|
+
*/
|
|
2952
|
+
dispose: () => Promise<void>;
|
|
2953
|
+
};
|
|
2954
|
+
|
|
2658
2955
|
declare class Pool extends Dispatcher {
|
|
2659
2956
|
constructor(url: string | URL_2, options?: Pool.Options)
|
|
2660
2957
|
/** `true` after `pool.close()` has been called. */
|
|
@@ -2708,7 +3005,7 @@ declare class ProgressEvent {
|
|
|
2708
3005
|
readonly total: number
|
|
2709
3006
|
}
|
|
2710
3007
|
|
|
2711
|
-
declare interface ProgressEventInit extends
|
|
3008
|
+
declare interface ProgressEventInit extends EventInit {
|
|
2712
3009
|
lengthComputable?: boolean
|
|
2713
3010
|
loaded?: number
|
|
2714
3011
|
total?: number
|
|
@@ -22978,16 +23275,16 @@ declare namespace ProxyAgent {
|
|
|
22978
23275
|
}
|
|
22979
23276
|
}
|
|
22980
23277
|
|
|
22981
|
-
declare class ProxyController extends
|
|
23278
|
+
declare class ProxyController extends Controller<ProxyControllerEventMap> {
|
|
22982
23279
|
ready: DeferredPromise<ReadyEvent>;
|
|
22983
23280
|
proxyWorker?: Miniflare;
|
|
22984
23281
|
proxyWorkerOptions?: MiniflareOptions;
|
|
22985
|
-
inspectorProxyWorkerWebSocket?: DeferredPromise<
|
|
23282
|
+
inspectorProxyWorkerWebSocket?: DeferredPromise<WebSocket_2>;
|
|
22986
23283
|
protected latestConfig?: StartDevWorkerOptions;
|
|
22987
23284
|
protected latestBundle?: EsbuildBundle;
|
|
22988
23285
|
secret: `${string}-${string}-${string}-${string}-${string}`;
|
|
22989
23286
|
protected createProxyWorker(): void;
|
|
22990
|
-
reconnectInspectorProxyWorker(): Promise<
|
|
23287
|
+
reconnectInspectorProxyWorker(): Promise<WebSocket_2 | undefined>;
|
|
22991
23288
|
runtimeMessageMutex: Mutex;
|
|
22992
23289
|
sendMessageToProxyWorker(message: ProxyWorkerIncomingRequestBody, retries?: number): Promise<void>;
|
|
22993
23290
|
sendMessageToInspectorProxyWorker(message: InspectorProxyWorkerIncomingWebSocketMessage, retries?: number): Promise<void>;
|
|
@@ -22997,26 +23294,29 @@ declare class ProxyController extends EventEmitter_2 {
|
|
|
22997
23294
|
onReloadComplete(data: ReloadCompleteEvent): void;
|
|
22998
23295
|
onProxyWorkerMessage(message: ProxyWorkerOutgoingRequestBody): void;
|
|
22999
23296
|
onInspectorProxyWorkerMessage(message: InspectorProxyWorkerOutgoingWebsocketMessage): void;
|
|
23000
|
-
onInspectorProxyWorkerRequest(message: InspectorProxyWorkerOutgoingRequestBody): Promise<
|
|
23297
|
+
onInspectorProxyWorkerRequest(message: InspectorProxyWorkerOutgoingRequestBody): Promise<Response_2>;
|
|
23001
23298
|
_torndown: boolean;
|
|
23002
23299
|
teardown(): Promise<void>;
|
|
23003
23300
|
emitReadyEvent(proxyWorker: Miniflare): void;
|
|
23004
23301
|
emitPreviewTokenExpiredEvent(proxyData: ProxyData): void;
|
|
23005
|
-
emitErrorEvent(
|
|
23006
|
-
|
|
23007
|
-
on(event: "previewTokenExpired", listener: (_: PreviewTokenExpiredEvent) => void): this;
|
|
23008
|
-
on(event: "error", listener: (_: ErrorEvent_2) => void): this;
|
|
23009
|
-
once: typeof ProxyController.on;
|
|
23302
|
+
emitErrorEvent(data: ErrorEvent): void;
|
|
23303
|
+
emitErrorEvent(reason: string, cause?: Error | SerializedError): void;
|
|
23010
23304
|
}
|
|
23011
23305
|
|
|
23306
|
+
declare type ProxyControllerEventMap = ControllerEventMap & {
|
|
23307
|
+
ready: [ReadyEvent];
|
|
23308
|
+
previewTokenExpired: [PreviewTokenExpiredEvent];
|
|
23309
|
+
};
|
|
23310
|
+
|
|
23012
23311
|
declare type ProxyData = {
|
|
23013
23312
|
userWorkerUrl: UrlOriginParts;
|
|
23014
23313
|
userWorkerInspectorUrl: UrlOriginAndPathnameParts;
|
|
23015
23314
|
userWorkerInnerUrlOverrides: Partial<UrlOriginParts>;
|
|
23016
|
-
headers: Record<string, string
|
|
23315
|
+
headers: Record<string, string>;
|
|
23017
23316
|
liveReload?: boolean;
|
|
23018
23317
|
proxyLogsToController?: boolean;
|
|
23019
23318
|
internalDurableObjects?: CfDurableObject[];
|
|
23319
|
+
entrypointAddresses: WorkerEntrypointsDefinition | undefined;
|
|
23020
23320
|
};
|
|
23021
23321
|
|
|
23022
23322
|
declare type ProxyWorkerIncomingRequestBody = {
|
|
@@ -23037,7 +23337,11 @@ declare type ProxyWorkerOutgoingRequestBody = {
|
|
|
23037
23337
|
args: Parameters<typeof console.debug>;
|
|
23038
23338
|
};
|
|
23039
23339
|
|
|
23040
|
-
declare type
|
|
23340
|
+
declare type QueueConsumer = NonNullable<Config["queues"]["consumers"]>[number];
|
|
23341
|
+
|
|
23342
|
+
declare type RawConfig = Partial<ConfigFields<RawDevConfig>> & PagesConfigFields & RawEnvironment & DeprecatedConfigFields & EnvironmentMap & {
|
|
23343
|
+
$schema?: string;
|
|
23344
|
+
};
|
|
23041
23345
|
|
|
23042
23346
|
declare type RawDevConfig = Partial<DevConfig>;
|
|
23043
23347
|
|
|
@@ -23074,29 +23378,23 @@ declare type ReferrerPolicy =
|
|
|
23074
23378
|
declare type ReloadCompleteEvent = {
|
|
23075
23379
|
type: "reloadComplete";
|
|
23076
23380
|
config: StartDevWorkerOptions;
|
|
23077
|
-
bundle:
|
|
23381
|
+
bundle: Bundle;
|
|
23078
23382
|
proxyData: ProxyData;
|
|
23079
23383
|
};
|
|
23080
23384
|
|
|
23081
23385
|
declare type ReloadStartEvent = {
|
|
23082
23386
|
type: "reloadStart";
|
|
23083
23387
|
config: StartDevWorkerOptions;
|
|
23084
|
-
bundle:
|
|
23388
|
+
bundle: Bundle;
|
|
23085
23389
|
};
|
|
23086
23390
|
|
|
23087
|
-
|
|
23088
|
-
|
|
23089
|
-
url: string | URL_2 | UrlObject,
|
|
23090
|
-
options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions, 'origin' | 'path' | 'method'> & Partial<Pick<Dispatcher.RequestOptions, 'method'>>,
|
|
23091
|
-
): Promise<Dispatcher.ResponseData>;
|
|
23092
|
-
|
|
23093
|
-
declare class Request_2 implements BodyMixin {
|
|
23094
|
-
constructor (input: RequestInfo_2, init?: RequestInit_2)
|
|
23391
|
+
declare class Request implements BodyMixin {
|
|
23392
|
+
constructor (input: RequestInfo, init?: RequestInit)
|
|
23095
23393
|
|
|
23096
23394
|
readonly cache: RequestCache
|
|
23097
23395
|
readonly credentials: RequestCredentials
|
|
23098
23396
|
readonly destination: RequestDestination
|
|
23099
|
-
readonly headers:
|
|
23397
|
+
readonly headers: Headers
|
|
23100
23398
|
readonly integrity: string
|
|
23101
23399
|
readonly method: string
|
|
23102
23400
|
readonly mode: RequestMode
|
|
@@ -23108,18 +23406,24 @@ declare class Request_2 implements BodyMixin {
|
|
|
23108
23406
|
readonly signal: AbortSignal
|
|
23109
23407
|
readonly duplex: RequestDuplex
|
|
23110
23408
|
|
|
23111
|
-
readonly body:
|
|
23409
|
+
readonly body: ReadableStream | null
|
|
23112
23410
|
readonly bodyUsed: boolean
|
|
23113
23411
|
|
|
23114
23412
|
readonly arrayBuffer: () => Promise<ArrayBuffer>
|
|
23115
23413
|
readonly blob: () => Promise<Blob_2>
|
|
23116
|
-
readonly formData: () => Promise<
|
|
23414
|
+
readonly formData: () => Promise<FormData>
|
|
23117
23415
|
readonly json: () => Promise<unknown>
|
|
23118
23416
|
readonly text: () => Promise<string>
|
|
23119
23417
|
|
|
23120
|
-
readonly clone: () =>
|
|
23418
|
+
readonly clone: () => Request
|
|
23121
23419
|
}
|
|
23122
23420
|
|
|
23421
|
+
/** Performs an HTTP request. */
|
|
23422
|
+
declare function request(
|
|
23423
|
+
url: string | URL_2 | UrlObject,
|
|
23424
|
+
options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions, 'origin' | 'path' | 'method'> & Partial<Pick<Dispatcher.RequestOptions, 'method'>>,
|
|
23425
|
+
): Promise<Dispatcher.ResponseData>;
|
|
23426
|
+
|
|
23123
23427
|
declare type RequestCache =
|
|
23124
23428
|
| 'default'
|
|
23125
23429
|
| 'force-cache'
|
|
@@ -23152,13 +23456,13 @@ declare type RequestDestination =
|
|
|
23152
23456
|
|
|
23153
23457
|
declare type RequestDuplex = 'half'
|
|
23154
23458
|
|
|
23155
|
-
declare type
|
|
23459
|
+
declare type RequestInfo = string | URL_2 | Request
|
|
23156
23460
|
|
|
23157
|
-
declare interface
|
|
23461
|
+
declare interface RequestInit {
|
|
23158
23462
|
method?: string
|
|
23159
23463
|
keepalive?: boolean
|
|
23160
|
-
headers?:
|
|
23161
|
-
body?:
|
|
23464
|
+
headers?: HeadersInit
|
|
23465
|
+
body?: BodyInit
|
|
23162
23466
|
redirect?: RequestRedirect
|
|
23163
23467
|
integrity?: string
|
|
23164
23468
|
signal?: AbortSignal | null
|
|
@@ -23175,10 +23479,10 @@ declare type RequestMode = 'cors' | 'navigate' | 'no-cors' | 'same-origin'
|
|
|
23175
23479
|
|
|
23176
23480
|
declare type RequestRedirect = 'error' | 'follow' | 'manual'
|
|
23177
23481
|
|
|
23178
|
-
declare class
|
|
23179
|
-
constructor (body?:
|
|
23482
|
+
declare class Response implements BodyMixin {
|
|
23483
|
+
constructor (body?: BodyInit, init?: ResponseInit)
|
|
23180
23484
|
|
|
23181
|
-
readonly headers:
|
|
23485
|
+
readonly headers: Headers
|
|
23182
23486
|
readonly ok: boolean
|
|
23183
23487
|
readonly status: number
|
|
23184
23488
|
readonly statusText: string
|
|
@@ -23186,26 +23490,26 @@ declare class Response_2 implements BodyMixin {
|
|
|
23186
23490
|
readonly url: string
|
|
23187
23491
|
readonly redirected: boolean
|
|
23188
23492
|
|
|
23189
|
-
readonly body:
|
|
23493
|
+
readonly body: ReadableStream | null
|
|
23190
23494
|
readonly bodyUsed: boolean
|
|
23191
23495
|
|
|
23192
23496
|
readonly arrayBuffer: () => Promise<ArrayBuffer>
|
|
23193
23497
|
readonly blob: () => Promise<Blob_2>
|
|
23194
|
-
readonly formData: () => Promise<
|
|
23498
|
+
readonly formData: () => Promise<FormData>
|
|
23195
23499
|
readonly json: () => Promise<unknown>
|
|
23196
23500
|
readonly text: () => Promise<string>
|
|
23197
23501
|
|
|
23198
|
-
readonly clone: () =>
|
|
23502
|
+
readonly clone: () => Response
|
|
23199
23503
|
|
|
23200
|
-
static error ():
|
|
23201
|
-
static json(data: any, init?:
|
|
23202
|
-
static redirect (url: string | URL_2, status: ResponseRedirectStatus):
|
|
23504
|
+
static error (): Response
|
|
23505
|
+
static json(data: any, init?: ResponseInit): Response
|
|
23506
|
+
static redirect (url: string | URL_2, status: ResponseRedirectStatus): Response
|
|
23203
23507
|
}
|
|
23204
23508
|
|
|
23205
|
-
declare interface
|
|
23509
|
+
declare interface ResponseInit {
|
|
23206
23510
|
readonly status?: number
|
|
23207
23511
|
readonly statusText?: string
|
|
23208
|
-
readonly headers?:
|
|
23512
|
+
readonly headers?: HeadersInit
|
|
23209
23513
|
}
|
|
23210
23514
|
|
|
23211
23515
|
declare type ResponseRedirectStatus = 301 | 302 | 303 | 307 | 308
|
|
@@ -23342,19 +23646,20 @@ declare type Rule = {
|
|
|
23342
23646
|
fallthrough?: boolean;
|
|
23343
23647
|
};
|
|
23344
23648
|
|
|
23345
|
-
declare abstract class RuntimeController extends Controller {
|
|
23649
|
+
declare abstract class RuntimeController extends Controller<RuntimeControllerEventMap> {
|
|
23346
23650
|
abstract onBundleStart(_: BundleStartEvent): void;
|
|
23347
23651
|
abstract onBundleComplete(_: BundleCompleteEvent): void;
|
|
23348
23652
|
abstract onPreviewTokenExpired(_: PreviewTokenExpiredEvent): void;
|
|
23349
23653
|
abstract teardown(): Promise<void>;
|
|
23350
23654
|
abstract emitReloadStartEvent(data: ReloadStartEvent): void;
|
|
23351
|
-
abstract
|
|
23352
|
-
on(event: "reloadStart", listener: (_: ReloadStartEvent) => void): this;
|
|
23353
|
-
on(event: "reloadComplete", listener: (_: ReloadCompleteEvent) => void): this;
|
|
23354
|
-
on(event: "error", listener: (_: ErrorEvent_2) => void): this;
|
|
23355
|
-
once: typeof RuntimeController.on;
|
|
23655
|
+
abstract emitReloadCompleteEvent(data: ReloadCompleteEvent): void;
|
|
23356
23656
|
}
|
|
23357
23657
|
|
|
23658
|
+
declare type RuntimeControllerEventMap = ControllerEventMap & {
|
|
23659
|
+
reloadStart: [ReloadStartEvent];
|
|
23660
|
+
reloadComplete: [ReloadCompleteEvent];
|
|
23661
|
+
};
|
|
23662
|
+
|
|
23358
23663
|
/**
|
|
23359
23664
|
* Convert a MIMEType object to a string.
|
|
23360
23665
|
* @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type
|
|
@@ -23368,14 +23673,9 @@ declare type SerializedError = {
|
|
|
23368
23673
|
cause?: unknown;
|
|
23369
23674
|
};
|
|
23370
23675
|
|
|
23371
|
-
declare
|
|
23372
|
-
name: string;
|
|
23373
|
-
env?: string;
|
|
23374
|
-
}
|
|
23375
|
-
|
|
23376
|
-
declare type ServiceFetch = (request: Request_3) => Promise<Response_3>;
|
|
23676
|
+
declare type ServiceFetch = (request: Request_2) => Promise<Response_2> | Response_2;
|
|
23377
23677
|
|
|
23378
|
-
declare function setCookie (headers:
|
|
23678
|
+
declare function setCookie (headers: Headers, cookie: Cookie): void
|
|
23379
23679
|
|
|
23380
23680
|
declare function setGlobalDispatcher<DispatcherImplementation extends Dispatcher>(dispatcher: DispatcherImplementation): void;
|
|
23381
23681
|
|
|
@@ -23383,6 +23683,10 @@ declare function setGlobalOrigin(origin: string | URL | undefined): void;
|
|
|
23383
23683
|
|
|
23384
23684
|
declare type SimpleRoute = string;
|
|
23385
23685
|
|
|
23686
|
+
export declare type SourcelessWorkerOptions = Omit<WorkerOptions, "script" | "scriptPath" | "modules" | "modulesRoot"> & {
|
|
23687
|
+
modulesRules?: ModuleRule_2[];
|
|
23688
|
+
};
|
|
23689
|
+
|
|
23386
23690
|
/**
|
|
23387
23691
|
* Information about Wrangler's bundling process that needs passed through
|
|
23388
23692
|
* for DevTools sourcemap transformation
|
|
@@ -23406,15 +23710,15 @@ declare interface SpecIterator<T, TReturn = any, TNext = undefined> {
|
|
|
23406
23710
|
|
|
23407
23711
|
declare interface StartDevWorkerOptions {
|
|
23408
23712
|
/** The name of the worker. */
|
|
23409
|
-
name
|
|
23713
|
+
name?: string;
|
|
23410
23714
|
/**
|
|
23411
23715
|
* The javascript or typescript entry-point of the worker.
|
|
23412
23716
|
* This is the `main` property of a wrangler.toml.
|
|
23413
23717
|
* You can specify a file path or provide the contents directly.
|
|
23414
23718
|
*/
|
|
23415
|
-
script:
|
|
23719
|
+
script: File_2<string>;
|
|
23416
23720
|
/** The configuration of the worker. */
|
|
23417
|
-
config?:
|
|
23721
|
+
config?: File_2<string | RawConfig> & {
|
|
23418
23722
|
env?: string;
|
|
23419
23723
|
};
|
|
23420
23724
|
/** The compatibility date for the workerd runtime. */
|
|
@@ -23478,6 +23782,8 @@ declare interface StartDevWorkerOptions {
|
|
|
23478
23782
|
hostname?: string;
|
|
23479
23783
|
port?: number;
|
|
23480
23784
|
secure?: boolean;
|
|
23785
|
+
httpsKeyPath?: string;
|
|
23786
|
+
httpsCertPath?: string;
|
|
23481
23787
|
};
|
|
23482
23788
|
/** Controls what request.url looks like inside the worker. */
|
|
23483
23789
|
urlOverrides?: {
|
|
@@ -23488,6 +23794,8 @@ declare interface StartDevWorkerOptions {
|
|
|
23488
23794
|
outboundService?: ServiceFetch;
|
|
23489
23795
|
/** An undici MockAgent to declaratively mock fetch calls to particular resources. */
|
|
23490
23796
|
mockFetch?: undici.MockAgent;
|
|
23797
|
+
/** Gets a fetcher to a specific worker, used for multi-worker development */
|
|
23798
|
+
getRegisteredWorker?(name: string): WorkerDefinition | undefined;
|
|
23491
23799
|
};
|
|
23492
23800
|
}
|
|
23493
23801
|
|
|
@@ -23498,6 +23806,8 @@ options: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions, 'origin'
|
|
|
23498
23806
|
factory: Dispatcher.StreamFactory
|
|
23499
23807
|
): Promise<Dispatcher.StreamData>;
|
|
23500
23808
|
|
|
23809
|
+
declare type TableRow<Keys extends string> = Record<Keys, string>;
|
|
23810
|
+
|
|
23501
23811
|
declare type TailConsumer = {
|
|
23502
23812
|
/** The name of the service tail events will be forwarded to. */
|
|
23503
23813
|
service: string;
|
|
@@ -23510,30 +23820,35 @@ declare type Trigger = {
|
|
|
23510
23820
|
} | {
|
|
23511
23821
|
type: "route";
|
|
23512
23822
|
pattern: string;
|
|
23513
|
-
|
|
23514
|
-
} | {
|
|
23823
|
+
} | ({
|
|
23515
23824
|
type: "route";
|
|
23516
|
-
|
|
23517
|
-
zoneId: string;
|
|
23518
|
-
customDomain?: true;
|
|
23519
|
-
zoneName?: never;
|
|
23520
|
-
} | {
|
|
23825
|
+
} & ZoneIdRoute) | ({
|
|
23521
23826
|
type: "route";
|
|
23522
|
-
|
|
23523
|
-
|
|
23524
|
-
|
|
23525
|
-
|
|
23526
|
-
|
|
23527
|
-
|
|
23528
|
-
schedule: string;
|
|
23529
|
-
} | {
|
|
23827
|
+
} & ZoneNameRoute) | ({
|
|
23828
|
+
type: "route";
|
|
23829
|
+
} & CustomDomainRoute) | {
|
|
23830
|
+
type: "cron";
|
|
23831
|
+
cron: string;
|
|
23832
|
+
} | ({
|
|
23530
23833
|
type: "queue-consumer";
|
|
23531
|
-
|
|
23532
|
-
|
|
23533
|
-
|
|
23534
|
-
|
|
23535
|
-
|
|
23536
|
-
|
|
23834
|
+
} & QueueConsumer);
|
|
23835
|
+
|
|
23836
|
+
declare interface TypedEventEmitter<EventMap extends Record<string | symbol, unknown[]>> extends EventEmitter_2 {
|
|
23837
|
+
addListener<Name extends keyof EventMap>(eventName: Name, listener: (...args: EventMap[Name]) => void): this;
|
|
23838
|
+
on<Name extends keyof EventMap>(eventName: Name, listener: (...args: EventMap[Name]) => void): this;
|
|
23839
|
+
once<Name extends keyof EventMap>(eventName: Name, listener: (...args: EventMap[Name]) => void): this;
|
|
23840
|
+
removeListener<Name extends keyof EventMap>(eventName: Name, listener: (...args: EventMap[Name]) => void): this;
|
|
23841
|
+
off<Name extends keyof EventMap>(eventName: Name, listener: (...args: EventMap[Name]) => void): this;
|
|
23842
|
+
removeAllListeners(event?: keyof EventMap): this;
|
|
23843
|
+
listeners<Name extends keyof EventMap>(eventName: Name): ((...args: EventMap[Name]) => void)[];
|
|
23844
|
+
rawListeners<Name extends keyof EventMap>(eventName: Name): ((...args: EventMap[Name]) => void)[];
|
|
23845
|
+
emit<Name extends keyof EventMap>(eventName: Name, ...args: EventMap[Name]): boolean;
|
|
23846
|
+
listenerCount<Name extends keyof EventMap>(eventName: Name, listener?: (...args: EventMap[Name]) => void): number;
|
|
23847
|
+
prependListener<Name extends keyof EventMap>(eventName: Name, listener: (...args: EventMap[Name]) => void): this;
|
|
23848
|
+
prependOnceListener<Name extends keyof EventMap>(eventName: Name, listener: (...args: EventMap[Name]) => void): this;
|
|
23849
|
+
}
|
|
23850
|
+
|
|
23851
|
+
declare const TypedEventEmitterImpl: new <EventMap extends Record<string | symbol, unknown[]>>() => TypedEventEmitter<EventMap>;
|
|
23537
23852
|
|
|
23538
23853
|
declare namespace Undici {
|
|
23539
23854
|
var Dispatcher: Dispatcher
|
|
@@ -23558,14 +23873,14 @@ declare namespace Undici {
|
|
|
23558
23873
|
var MockPool: MockPool;
|
|
23559
23874
|
var MockAgent: MockAgent;
|
|
23560
23875
|
var mockErrors: MockErrors;
|
|
23561
|
-
var fetch:
|
|
23562
|
-
var Headers:
|
|
23563
|
-
var Response:
|
|
23564
|
-
var Request:
|
|
23565
|
-
var FormData:
|
|
23566
|
-
var File:
|
|
23876
|
+
var fetch: fetch;
|
|
23877
|
+
var Headers: Headers;
|
|
23878
|
+
var Response: Response;
|
|
23879
|
+
var Request: Request;
|
|
23880
|
+
var FormData: FormData;
|
|
23881
|
+
var File: File;
|
|
23567
23882
|
var FileReader: FileReader;
|
|
23568
|
-
var caches:
|
|
23883
|
+
var caches: caches;
|
|
23569
23884
|
}
|
|
23570
23885
|
|
|
23571
23886
|
declare namespace undici {
|
|
@@ -23601,53 +23916,53 @@ declare namespace undici {
|
|
|
23601
23916
|
getSetCookies,
|
|
23602
23917
|
setCookie,
|
|
23603
23918
|
Cookie,
|
|
23604
|
-
|
|
23605
|
-
|
|
23606
|
-
|
|
23919
|
+
fetch,
|
|
23920
|
+
RequestInfo,
|
|
23921
|
+
BodyInit,
|
|
23607
23922
|
BodyMixin,
|
|
23608
23923
|
SpecIterator,
|
|
23609
23924
|
SpecIterableIterator,
|
|
23610
23925
|
SpecIterable,
|
|
23611
|
-
|
|
23612
|
-
|
|
23926
|
+
HeadersInit,
|
|
23927
|
+
Headers,
|
|
23613
23928
|
RequestCache,
|
|
23614
23929
|
RequestCredentials,
|
|
23615
23930
|
RequestDestination,
|
|
23616
|
-
|
|
23931
|
+
RequestInit,
|
|
23617
23932
|
ReferrerPolicy,
|
|
23618
23933
|
RequestMode,
|
|
23619
23934
|
RequestRedirect,
|
|
23620
23935
|
RequestDuplex,
|
|
23621
|
-
|
|
23622
|
-
|
|
23936
|
+
Request,
|
|
23937
|
+
ResponseInit,
|
|
23623
23938
|
ResponseType,
|
|
23624
23939
|
ResponseRedirectStatus,
|
|
23625
|
-
|
|
23940
|
+
Response,
|
|
23626
23941
|
BlobPropertyBag,
|
|
23627
23942
|
FilePropertyBag,
|
|
23628
|
-
|
|
23943
|
+
File,
|
|
23629
23944
|
FileReader,
|
|
23630
23945
|
ProgressEventInit,
|
|
23631
23946
|
ProgressEvent,
|
|
23632
23947
|
FormDataEntryValue,
|
|
23633
|
-
|
|
23948
|
+
FormData,
|
|
23634
23949
|
DiagnosticsChannel,
|
|
23635
23950
|
BinaryType,
|
|
23636
|
-
|
|
23637
|
-
|
|
23638
|
-
|
|
23639
|
-
|
|
23640
|
-
|
|
23641
|
-
|
|
23951
|
+
WebSocketEventMap,
|
|
23952
|
+
WebSocket,
|
|
23953
|
+
CloseEventInit,
|
|
23954
|
+
CloseEvent,
|
|
23955
|
+
MessageEventInit,
|
|
23956
|
+
MessageEvent,
|
|
23642
23957
|
WebSocketInit,
|
|
23643
23958
|
parseMIMEType,
|
|
23644
23959
|
serializeAMimeType,
|
|
23645
23960
|
MIMEType,
|
|
23646
|
-
|
|
23647
|
-
|
|
23648
|
-
|
|
23961
|
+
CacheStorage,
|
|
23962
|
+
Cache,
|
|
23963
|
+
CacheQueryOptions,
|
|
23649
23964
|
MultiCacheQueryOptions,
|
|
23650
|
-
|
|
23965
|
+
caches
|
|
23651
23966
|
}
|
|
23652
23967
|
}
|
|
23653
23968
|
|
|
@@ -23672,13 +23987,37 @@ export declare class unstable_DevEnv extends EventEmitter_2 {
|
|
|
23672
23987
|
proxy?: ProxyController | undefined;
|
|
23673
23988
|
});
|
|
23674
23989
|
teardown(): Promise<void>;
|
|
23675
|
-
emitErrorEvent(ev:
|
|
23990
|
+
emitErrorEvent(ev: ErrorEvent): void;
|
|
23676
23991
|
}
|
|
23677
23992
|
|
|
23993
|
+
export declare const unstable_generateASSETSBinding: (opts: UnstableASSETSBindingsOptions) => (request: Request_2) => Promise<Response_2>;
|
|
23994
|
+
|
|
23995
|
+
export declare function unstable_getMiniflareWorkerOptions(configPath: string, environment?: string): {
|
|
23996
|
+
workerOptions: SourcelessWorkerOptions;
|
|
23997
|
+
define: Record<string, string>;
|
|
23998
|
+
main?: string;
|
|
23999
|
+
};
|
|
24000
|
+
|
|
23678
24001
|
export declare const unstable_pages: {
|
|
23679
24002
|
deploy: typeof deploy;
|
|
23680
24003
|
};
|
|
23681
24004
|
|
|
24005
|
+
/**
|
|
24006
|
+
* Split an SQLQuery into an array of statements
|
|
24007
|
+
*/
|
|
24008
|
+
export declare function unstable_splitSqlQuery(sql: string): string[];
|
|
24009
|
+
|
|
24010
|
+
export declare function unstable_startWorkerRegistryServer(port: number): Promise<{
|
|
24011
|
+
server: Server<IncomingMessage, ServerResponse>;
|
|
24012
|
+
terminator: HttpTerminator;
|
|
24013
|
+
}>;
|
|
24014
|
+
|
|
24015
|
+
export declare interface UnstableASSETSBindingsOptions {
|
|
24016
|
+
log: Logger;
|
|
24017
|
+
proxyPort?: number;
|
|
24018
|
+
directory?: string;
|
|
24019
|
+
}
|
|
24020
|
+
|
|
23682
24021
|
export declare interface UnstableDevOptions {
|
|
23683
24022
|
config?: string;
|
|
23684
24023
|
env?: string;
|
|
@@ -23687,6 +24026,8 @@ export declare interface UnstableDevOptions {
|
|
|
23687
24026
|
bundle?: boolean;
|
|
23688
24027
|
inspectorPort?: number;
|
|
23689
24028
|
localProtocol?: "http" | "https";
|
|
24029
|
+
httpsKeyPath?: string;
|
|
24030
|
+
httpsCertPath?: string;
|
|
23690
24031
|
assets?: string;
|
|
23691
24032
|
site?: string;
|
|
23692
24033
|
siteInclude?: string[];
|
|
@@ -23712,6 +24053,7 @@ export declare interface UnstableDevOptions {
|
|
|
23712
24053
|
binding: string;
|
|
23713
24054
|
service: string;
|
|
23714
24055
|
environment?: string | undefined;
|
|
24056
|
+
entrypoint?: string | undefined;
|
|
23715
24057
|
}[];
|
|
23716
24058
|
r2?: {
|
|
23717
24059
|
binding: string;
|
|
@@ -23721,6 +24063,9 @@ export declare interface UnstableDevOptions {
|
|
|
23721
24063
|
ai?: {
|
|
23722
24064
|
binding: string;
|
|
23723
24065
|
};
|
|
24066
|
+
version_metadata?: {
|
|
24067
|
+
binding: string;
|
|
24068
|
+
};
|
|
23724
24069
|
moduleRoot?: string;
|
|
23725
24070
|
rules?: Rule[];
|
|
23726
24071
|
logLevel?: "none" | "info" | "error" | "log" | "warn" | "debug";
|
|
@@ -23749,7 +24094,7 @@ export declare interface UnstableDevWorker {
|
|
|
23749
24094
|
address: string;
|
|
23750
24095
|
proxyData: ProxyData;
|
|
23751
24096
|
stop: () => Promise<void>;
|
|
23752
|
-
fetch: (input?:
|
|
24097
|
+
fetch: (input?: RequestInfo, init?: RequestInit) => Promise<Response>;
|
|
23753
24098
|
waitUntilExit: () => Promise<void>;
|
|
23754
24099
|
}
|
|
23755
24100
|
|
|
@@ -23764,20 +24109,20 @@ declare type UrlOriginAndPathnameParts = Pick<URL, "protocol" | "hostname" | "po
|
|
|
23764
24109
|
declare type UrlOriginParts = Pick<URL, "protocol" | "hostname" | "port">;
|
|
23765
24110
|
|
|
23766
24111
|
declare interface UserLimits {
|
|
23767
|
-
/** Maximum allowed CPU time for a
|
|
24112
|
+
/** Maximum allowed CPU time for a Worker's invocation in milliseconds */
|
|
23768
24113
|
cpu_ms: number;
|
|
23769
24114
|
}
|
|
23770
24115
|
|
|
23771
|
-
declare interface
|
|
24116
|
+
declare interface WebSocket extends EventTarget_2 {
|
|
23772
24117
|
binaryType: BinaryType
|
|
23773
24118
|
|
|
23774
24119
|
readonly bufferedAmount: number
|
|
23775
24120
|
readonly extensions: string
|
|
23776
24121
|
|
|
23777
|
-
onclose: ((this:
|
|
23778
|
-
onerror: ((this:
|
|
23779
|
-
onmessage: ((this:
|
|
23780
|
-
onopen: ((this:
|
|
24122
|
+
onclose: ((this: WebSocket, ev: WebSocketEventMap['close']) => any) | null
|
|
24123
|
+
onerror: ((this: WebSocket, ev: WebSocketEventMap['error']) => any) | null
|
|
24124
|
+
onmessage: ((this: WebSocket, ev: WebSocketEventMap['message']) => any) | null
|
|
24125
|
+
onopen: ((this: WebSocket, ev: WebSocketEventMap['open']) => any) | null
|
|
23781
24126
|
|
|
23782
24127
|
readonly protocol: string
|
|
23783
24128
|
readonly readyState: number
|
|
@@ -23791,50 +24136,70 @@ declare interface WebSocket_2 extends EventTarget_2 {
|
|
|
23791
24136
|
readonly CONNECTING: number
|
|
23792
24137
|
readonly OPEN: number
|
|
23793
24138
|
|
|
23794
|
-
addEventListener<K extends keyof
|
|
24139
|
+
addEventListener<K extends keyof WebSocketEventMap>(
|
|
23795
24140
|
type: K,
|
|
23796
|
-
listener: (this:
|
|
24141
|
+
listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any,
|
|
23797
24142
|
options?: boolean | AddEventListenerOptions
|
|
23798
24143
|
): void
|
|
23799
24144
|
addEventListener(
|
|
23800
24145
|
type: string,
|
|
23801
|
-
listener:
|
|
24146
|
+
listener: EventListenerOrEventListenerObject,
|
|
23802
24147
|
options?: boolean | AddEventListenerOptions
|
|
23803
24148
|
): void
|
|
23804
|
-
removeEventListener<K extends keyof
|
|
24149
|
+
removeEventListener<K extends keyof WebSocketEventMap>(
|
|
23805
24150
|
type: K,
|
|
23806
|
-
listener: (this:
|
|
24151
|
+
listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any,
|
|
23807
24152
|
options?: boolean | EventListenerOptions
|
|
23808
24153
|
): void
|
|
23809
24154
|
removeEventListener(
|
|
23810
24155
|
type: string,
|
|
23811
|
-
listener:
|
|
24156
|
+
listener: EventListenerOrEventListenerObject,
|
|
23812
24157
|
options?: boolean | EventListenerOptions
|
|
23813
24158
|
): void
|
|
23814
24159
|
}
|
|
23815
24160
|
|
|
23816
|
-
declare const
|
|
23817
|
-
prototype:
|
|
23818
|
-
new (url: string | URL, protocols?: string | string[] | WebSocketInit):
|
|
24161
|
+
declare const WebSocket: {
|
|
24162
|
+
prototype: WebSocket
|
|
24163
|
+
new (url: string | URL, protocols?: string | string[] | WebSocketInit): WebSocket
|
|
23819
24164
|
readonly CLOSED: number
|
|
23820
24165
|
readonly CLOSING: number
|
|
23821
24166
|
readonly CONNECTING: number
|
|
23822
24167
|
readonly OPEN: number
|
|
23823
24168
|
};
|
|
23824
24169
|
|
|
23825
|
-
declare interface
|
|
23826
|
-
close:
|
|
24170
|
+
declare interface WebSocketEventMap {
|
|
24171
|
+
close: CloseEvent
|
|
23827
24172
|
error: Event_2
|
|
23828
|
-
message:
|
|
24173
|
+
message: MessageEvent
|
|
23829
24174
|
open: Event_2
|
|
23830
24175
|
}
|
|
23831
24176
|
|
|
23832
24177
|
declare interface WebSocketInit {
|
|
23833
24178
|
protocols?: string | string[],
|
|
23834
24179
|
dispatcher?: Dispatcher,
|
|
23835
|
-
headers?:
|
|
24180
|
+
headers?: HeadersInit
|
|
23836
24181
|
}
|
|
23837
24182
|
|
|
24183
|
+
declare type WorkerDefinition = {
|
|
24184
|
+
port: number | undefined;
|
|
24185
|
+
protocol: "http" | "https" | undefined;
|
|
24186
|
+
host: string | undefined;
|
|
24187
|
+
mode: "local" | "remote";
|
|
24188
|
+
headers?: Record<string, string>;
|
|
24189
|
+
entrypointAddresses?: WorkerEntrypointsDefinition;
|
|
24190
|
+
durableObjects: {
|
|
24191
|
+
name: string;
|
|
24192
|
+
className: string;
|
|
24193
|
+
}[];
|
|
24194
|
+
durableObjectsHost?: string;
|
|
24195
|
+
durableObjectsPort?: number;
|
|
24196
|
+
};
|
|
24197
|
+
|
|
24198
|
+
declare type WorkerEntrypointsDefinition = Record<"default" | string, {
|
|
24199
|
+
host: string;
|
|
24200
|
+
port: number;
|
|
24201
|
+
} | undefined>;
|
|
24202
|
+
|
|
23838
24203
|
declare type ZoneIdRoute = {
|
|
23839
24204
|
pattern: string;
|
|
23840
24205
|
zone_id: string;
|