wrangler 0.0.0-e11e1691 → 0.0.0-e144f63f
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 +26 -59
- package/templates/checked-fetch.js +1 -1
- package/templates/facade.d.ts +7 -5
- package/templates/middleware/loader-modules.ts +92 -94
- package/templates/middleware/middleware-ensure-req-body-drained.ts +0 -1
- 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 +9 -1
- package/wrangler-dist/InspectorProxyWorker.js.map +1 -1
- package/wrangler-dist/ProxyWorker.js +3 -0
- package/wrangler-dist/ProxyWorker.js.map +1 -1
- package/wrangler-dist/cli.d.ts +645 -241
- package/wrangler-dist/cli.js +45676 -9181
- 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,6 +6,7 @@ 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';
|
|
9
10
|
import type { IncomingRequestCfProperties } from '@cloudflare/workers-types/experimental';
|
|
10
11
|
import { IpcNetConnectOpts } from 'net';
|
|
11
12
|
import type { Json } from 'miniflare';
|
|
@@ -19,6 +20,8 @@ import { Readable } from 'stream';
|
|
|
19
20
|
import { ReadableStream } from 'stream/web';
|
|
20
21
|
import type { Request as Request_2 } from 'miniflare';
|
|
21
22
|
import { Response as Response_2 } from 'miniflare';
|
|
23
|
+
import type { Server } from 'node:http';
|
|
24
|
+
import { ServerResponse } from 'http';
|
|
22
25
|
import { Socket } from 'net';
|
|
23
26
|
import { TcpNetConnectOpts } from 'net';
|
|
24
27
|
import { TLSSocket } from 'tls';
|
|
@@ -91,51 +94,68 @@ declare type BaseErrorEvent<Source = string, Data = undefined> = {
|
|
|
91
94
|
data: Data;
|
|
92
95
|
};
|
|
93
96
|
|
|
97
|
+
declare type BinaryFile = File_2<Uint8Array>;
|
|
98
|
+
|
|
94
99
|
declare type BinaryType = 'blob' | 'arraybuffer'
|
|
95
100
|
|
|
96
101
|
declare type Binding = {
|
|
97
|
-
type: "
|
|
98
|
-
|
|
102
|
+
type: "plain_text";
|
|
103
|
+
value: string;
|
|
99
104
|
} | {
|
|
100
|
-
type: "
|
|
101
|
-
|
|
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;
|
|
102
114
|
} | {
|
|
103
|
-
type: "
|
|
104
|
-
|
|
105
|
-
binding: string;
|
|
106
|
-
/** The name of this D1 database. */
|
|
107
|
-
database_name: string;
|
|
108
|
-
/** The UUID of this D1 database (not required). */
|
|
109
|
-
database_id: string;
|
|
110
|
-
/** The UUID of this D1 database for Wrangler Dev (if specified). */
|
|
111
|
-
preview_database_id?: string;
|
|
112
|
-
/** The name of the migrations table for this D1 database (defaults to 'd1_migrations'). */
|
|
113
|
-
migrations_table?: string;
|
|
114
|
-
/** The path to the directory of migrations for this D1 database (defaults to './migrations'). */
|
|
115
|
-
migrations_dir?: string;
|
|
116
|
-
/** Internal use only. */
|
|
117
|
-
database_internal_env?: string;
|
|
115
|
+
type: "text_blob";
|
|
116
|
+
source: File_2;
|
|
118
117
|
} | {
|
|
119
|
-
type: "
|
|
120
|
-
className: string;
|
|
121
|
-
service?: ServiceDesignator;
|
|
118
|
+
type: "browser";
|
|
122
119
|
} | {
|
|
123
|
-
type: "
|
|
124
|
-
service: ServiceDesignator | ServiceFetch;
|
|
120
|
+
type: "ai";
|
|
125
121
|
} | {
|
|
126
|
-
type: "
|
|
127
|
-
name: string;
|
|
122
|
+
type: "version_metadata";
|
|
128
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">) | ({
|
|
129
137
|
type: "constellation";
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
} | {
|
|
135
|
-
type:
|
|
136
|
-
|
|
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}`;
|
|
137
155
|
};
|
|
138
156
|
|
|
157
|
+
declare type BindingOmit<T> = Omit<T, "binding" | "name">;
|
|
158
|
+
|
|
139
159
|
/**
|
|
140
160
|
* Result of the `getBindingsProxy` utility
|
|
141
161
|
*/
|
|
@@ -261,23 +281,26 @@ declare namespace buildConnector {
|
|
|
261
281
|
}
|
|
262
282
|
}
|
|
263
283
|
|
|
284
|
+
declare type Bundle = EsbuildBundle;
|
|
285
|
+
|
|
264
286
|
declare type BundleCompleteEvent = {
|
|
265
287
|
type: "bundleComplete";
|
|
266
288
|
config: StartDevWorkerOptions;
|
|
267
|
-
bundle:
|
|
289
|
+
bundle: Bundle;
|
|
268
290
|
};
|
|
269
291
|
|
|
270
|
-
declare class BundlerController extends Controller {
|
|
292
|
+
declare class BundlerController extends Controller<BundlerControllerEventMap> {
|
|
271
293
|
onConfigUpdate(_: ConfigUpdateEvent): void;
|
|
272
294
|
teardown(): Promise<void>;
|
|
273
295
|
emitBundleStartEvent(data: BundleStartEvent): void;
|
|
274
296
|
emitBundleCompletetEvent(data: BundleCompleteEvent): void;
|
|
275
|
-
on(event: "bundleStart", listener: (_: BundleStartEvent) => void): this;
|
|
276
|
-
on(event: "bundleComplete", listener: (_: BundleCompleteEvent) => void): this;
|
|
277
|
-
on(event: "error", listener: (_: ErrorEvent) => void): this;
|
|
278
|
-
once: typeof BundlerController.on;
|
|
279
297
|
}
|
|
280
298
|
|
|
299
|
+
declare type BundlerControllerEventMap = ControllerEventMap & {
|
|
300
|
+
bundleStart: [BundleStartEvent];
|
|
301
|
+
bundleComplete: [BundleCompleteEvent];
|
|
302
|
+
};
|
|
303
|
+
|
|
281
304
|
declare type BundleStartEvent = {
|
|
282
305
|
type: "bundleStart";
|
|
283
306
|
config: StartDevWorkerOptions;
|
|
@@ -375,6 +398,68 @@ declare interface CfAccount {
|
|
|
375
398
|
accountId: string;
|
|
376
399
|
}
|
|
377
400
|
|
|
401
|
+
/**
|
|
402
|
+
* A binding to the AI project
|
|
403
|
+
*/
|
|
404
|
+
declare interface CfAIBinding {
|
|
405
|
+
binding: string;
|
|
406
|
+
staging?: boolean;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
declare interface CfAnalyticsEngineDataset {
|
|
410
|
+
binding: string;
|
|
411
|
+
dataset?: string;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* A binding to a browser
|
|
416
|
+
*/
|
|
417
|
+
declare interface CfBrowserBinding {
|
|
418
|
+
binding: string;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
declare type CfCapnp = {
|
|
422
|
+
base_path?: never;
|
|
423
|
+
source_schemas?: never;
|
|
424
|
+
compiled_schema: string;
|
|
425
|
+
} | {
|
|
426
|
+
base_path: string;
|
|
427
|
+
source_schemas: string[];
|
|
428
|
+
compiled_schema?: never;
|
|
429
|
+
};
|
|
430
|
+
|
|
431
|
+
declare interface CfConstellation {
|
|
432
|
+
binding: string;
|
|
433
|
+
project_id: string;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
declare interface CfD1Database {
|
|
437
|
+
binding: string;
|
|
438
|
+
database_id: string;
|
|
439
|
+
database_name?: string;
|
|
440
|
+
preview_database_id?: string;
|
|
441
|
+
database_internal_env?: string;
|
|
442
|
+
migrations_table?: string;
|
|
443
|
+
migrations_dir?: string;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* A binding to a data blob (in service-worker format)
|
|
448
|
+
*/
|
|
449
|
+
declare interface CfDataBlobBindings {
|
|
450
|
+
[key: string]: string | Uint8Array;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
declare interface CfDispatchNamespace {
|
|
454
|
+
binding: string;
|
|
455
|
+
namespace: string;
|
|
456
|
+
outbound?: {
|
|
457
|
+
service: string;
|
|
458
|
+
environment?: string;
|
|
459
|
+
parameters?: string[];
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
|
|
378
463
|
/**
|
|
379
464
|
* A Durable Object.
|
|
380
465
|
*/
|
|
@@ -385,6 +470,42 @@ declare interface CfDurableObject {
|
|
|
385
470
|
environment?: string;
|
|
386
471
|
}
|
|
387
472
|
|
|
473
|
+
declare interface CfDurableObjectMigrations {
|
|
474
|
+
old_tag?: string;
|
|
475
|
+
new_tag: string;
|
|
476
|
+
steps: {
|
|
477
|
+
new_classes?: string[];
|
|
478
|
+
renamed_classes?: {
|
|
479
|
+
from: string;
|
|
480
|
+
to: string;
|
|
481
|
+
}[];
|
|
482
|
+
deleted_classes?: string[];
|
|
483
|
+
}[];
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
declare interface CfHyperdrive {
|
|
487
|
+
binding: string;
|
|
488
|
+
id: string;
|
|
489
|
+
localConnectionString?: string;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* A KV namespace.
|
|
494
|
+
*/
|
|
495
|
+
declare interface CfKvNamespace {
|
|
496
|
+
binding: string;
|
|
497
|
+
id: string;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
declare interface CfLogfwdr {
|
|
501
|
+
bindings: CfLogfwdrBinding[];
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
declare interface CfLogfwdrBinding {
|
|
505
|
+
name: string;
|
|
506
|
+
destination: string;
|
|
507
|
+
}
|
|
508
|
+
|
|
388
509
|
/**
|
|
389
510
|
* An imported module.
|
|
390
511
|
*/
|
|
@@ -416,6 +537,12 @@ declare interface CfModule {
|
|
|
416
537
|
* }
|
|
417
538
|
*/
|
|
418
539
|
content: string | Buffer;
|
|
540
|
+
/**
|
|
541
|
+
* An optional sourcemap for this module if it's of a ESM or CJS type, this will only be present
|
|
542
|
+
* if we're deploying with sourcemaps enabled. Since we copy extra modules that aren't bundled
|
|
543
|
+
* we need to also copy the relevant sourcemaps into the final out directory.
|
|
544
|
+
*/
|
|
545
|
+
sourceMap?: CfWorkerSourceMap;
|
|
419
546
|
/**
|
|
420
547
|
* The module type.
|
|
421
548
|
*
|
|
@@ -427,13 +554,193 @@ declare interface CfModule {
|
|
|
427
554
|
/**
|
|
428
555
|
* A module type.
|
|
429
556
|
*/
|
|
430
|
-
declare type CfModuleType = "esm" | "commonjs" | "compiled-wasm" | "text" | "buffer" | "python" | "python-requirement";
|
|
557
|
+
declare type CfModuleType = "esm" | "commonjs" | "compiled-wasm" | "text" | "buffer" | "python" | "python-requirement" | "nodejs-compat-module";
|
|
558
|
+
|
|
559
|
+
declare interface CfMTlsCertificate {
|
|
560
|
+
binding: string;
|
|
561
|
+
certificate_id: string;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
declare interface CfPlacement {
|
|
565
|
+
mode: "smart";
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
declare interface CfQueue {
|
|
569
|
+
binding: string;
|
|
570
|
+
queue_name: string;
|
|
571
|
+
delivery_delay?: number;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
declare interface CfR2Bucket {
|
|
575
|
+
binding: string;
|
|
576
|
+
bucket_name: string;
|
|
577
|
+
jurisdiction?: string;
|
|
578
|
+
}
|
|
431
579
|
|
|
432
580
|
/**
|
|
433
581
|
* The type of Worker
|
|
434
582
|
*/
|
|
435
583
|
declare type CfScriptFormat = "modules" | "service-worker";
|
|
436
584
|
|
|
585
|
+
/**
|
|
586
|
+
* A binding to send email.
|
|
587
|
+
*/
|
|
588
|
+
declare interface CfSendEmailBindings {
|
|
589
|
+
name: string;
|
|
590
|
+
destination_address?: string;
|
|
591
|
+
allowed_destination_addresses?: string[];
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
declare interface CfService {
|
|
595
|
+
binding: string;
|
|
596
|
+
service: string;
|
|
597
|
+
environment?: string;
|
|
598
|
+
entrypoint?: string;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
declare interface CfTailConsumer {
|
|
602
|
+
service: string;
|
|
603
|
+
environment?: string;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* A binding to a text blob (in service-worker format)
|
|
608
|
+
*/
|
|
609
|
+
declare interface CfTextBlobBindings {
|
|
610
|
+
[key: string]: string;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
declare interface CfUnsafe {
|
|
614
|
+
bindings: CfUnsafeBinding[] | undefined;
|
|
615
|
+
metadata: CfUnsafeMetadata | undefined;
|
|
616
|
+
capnp: CfCapnp | undefined;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
declare interface CfUnsafeBinding {
|
|
620
|
+
name: string;
|
|
621
|
+
type: string;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
declare type CfUnsafeMetadata = Record<string, unknown>;
|
|
625
|
+
|
|
626
|
+
declare interface CfUserLimits {
|
|
627
|
+
cpu_ms?: number;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* A map of variable names to values.
|
|
632
|
+
*/
|
|
633
|
+
declare interface CfVars {
|
|
634
|
+
[key: string]: string | Json;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
declare interface CfVectorize {
|
|
638
|
+
binding: string;
|
|
639
|
+
index_name: string;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
/**
|
|
643
|
+
* A binding to the Worker Version's metadata
|
|
644
|
+
*/
|
|
645
|
+
declare interface CfVersionMetadataBinding {
|
|
646
|
+
binding: string;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* A binding to a wasm module (in service-worker format)
|
|
651
|
+
*/
|
|
652
|
+
declare interface CfWasmModuleBindings {
|
|
653
|
+
[key: string]: string | Uint8Array;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
/**
|
|
657
|
+
* Options for creating a `CfWorker`.
|
|
658
|
+
*/
|
|
659
|
+
declare interface CfWorkerInit {
|
|
660
|
+
/**
|
|
661
|
+
* The name of the worker.
|
|
662
|
+
*/
|
|
663
|
+
name: string | undefined;
|
|
664
|
+
/**
|
|
665
|
+
* The entrypoint module.
|
|
666
|
+
*/
|
|
667
|
+
main: CfModule;
|
|
668
|
+
/**
|
|
669
|
+
* The list of additional modules.
|
|
670
|
+
*/
|
|
671
|
+
modules: CfModule[] | undefined;
|
|
672
|
+
/**
|
|
673
|
+
* The list of source maps to include on upload.
|
|
674
|
+
*/
|
|
675
|
+
sourceMaps: CfWorkerSourceMap[] | undefined;
|
|
676
|
+
/**
|
|
677
|
+
* All the bindings
|
|
678
|
+
*/
|
|
679
|
+
bindings: {
|
|
680
|
+
vars: CfVars | undefined;
|
|
681
|
+
kv_namespaces: CfKvNamespace[] | undefined;
|
|
682
|
+
send_email: CfSendEmailBindings[] | undefined;
|
|
683
|
+
wasm_modules: CfWasmModuleBindings | undefined;
|
|
684
|
+
text_blobs: CfTextBlobBindings | undefined;
|
|
685
|
+
browser: CfBrowserBinding | undefined;
|
|
686
|
+
ai: CfAIBinding | undefined;
|
|
687
|
+
version_metadata: CfVersionMetadataBinding | undefined;
|
|
688
|
+
data_blobs: CfDataBlobBindings | undefined;
|
|
689
|
+
durable_objects: {
|
|
690
|
+
bindings: CfDurableObject[];
|
|
691
|
+
} | undefined;
|
|
692
|
+
queues: CfQueue[] | undefined;
|
|
693
|
+
r2_buckets: CfR2Bucket[] | undefined;
|
|
694
|
+
d1_databases: CfD1Database[] | undefined;
|
|
695
|
+
vectorize: CfVectorize[] | undefined;
|
|
696
|
+
constellation: CfConstellation[] | undefined;
|
|
697
|
+
hyperdrive: CfHyperdrive[] | undefined;
|
|
698
|
+
services: CfService[] | undefined;
|
|
699
|
+
analytics_engine_datasets: CfAnalyticsEngineDataset[] | undefined;
|
|
700
|
+
dispatch_namespaces: CfDispatchNamespace[] | undefined;
|
|
701
|
+
mtls_certificates: CfMTlsCertificate[] | undefined;
|
|
702
|
+
logfwdr: CfLogfwdr | undefined;
|
|
703
|
+
unsafe: CfUnsafe | undefined;
|
|
704
|
+
};
|
|
705
|
+
migrations: CfDurableObjectMigrations | undefined;
|
|
706
|
+
compatibility_date: string | undefined;
|
|
707
|
+
compatibility_flags: string[] | undefined;
|
|
708
|
+
usage_model: "bundled" | "unbound" | undefined;
|
|
709
|
+
keepVars: boolean | undefined;
|
|
710
|
+
keepSecrets: boolean | undefined;
|
|
711
|
+
logpush: boolean | undefined;
|
|
712
|
+
placement: CfPlacement | undefined;
|
|
713
|
+
tail_consumers: CfTailConsumer[] | undefined;
|
|
714
|
+
limits: CfUserLimits | undefined;
|
|
715
|
+
annotations?: Record<string, string | undefined>;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
declare interface CfWorkerSourceMap {
|
|
719
|
+
/**
|
|
720
|
+
* The name of the source map.
|
|
721
|
+
*
|
|
722
|
+
* @example
|
|
723
|
+
* 'out.js.map'
|
|
724
|
+
*/
|
|
725
|
+
name: string;
|
|
726
|
+
/**
|
|
727
|
+
* The content of the source map, which is a JSON object described by the v3
|
|
728
|
+
* spec.
|
|
729
|
+
*
|
|
730
|
+
* @example
|
|
731
|
+
* {
|
|
732
|
+
* "version" : 3,
|
|
733
|
+
* "file": "out.js",
|
|
734
|
+
* "sourceRoot": "",
|
|
735
|
+
* "sources": ["foo.js", "bar.js"],
|
|
736
|
+
* "sourcesContent": [null, null],
|
|
737
|
+
* "names": ["src", "maps", "are", "fun"],
|
|
738
|
+
* "mappings": "A,AAAB;;ABCDE;"
|
|
739
|
+
* }
|
|
740
|
+
*/
|
|
741
|
+
content: string | Buffer;
|
|
742
|
+
}
|
|
743
|
+
|
|
437
744
|
/**
|
|
438
745
|
* A basic HTTP/1.1 client, mapped on top a single TCP/TLS connection. Pipelining is disabled by default.
|
|
439
746
|
*/
|
|
@@ -550,17 +857,41 @@ declare type CloudchamberConfig = {
|
|
|
550
857
|
memory?: string;
|
|
551
858
|
};
|
|
552
859
|
|
|
553
|
-
|
|
860
|
+
/**
|
|
861
|
+
* This is the static type definition for the configuration object.
|
|
862
|
+
*
|
|
863
|
+
* It reflects a normalized and validated version of the configuration that you can write in wrangler.toml,
|
|
864
|
+
* and optionally augment with arguments passed directly to wrangler.
|
|
865
|
+
*
|
|
866
|
+
* For more information about the configuration object, see the
|
|
867
|
+
* documentation at https://developers.cloudflare.com/workers/cli-wrangler/configuration
|
|
868
|
+
*
|
|
869
|
+
* Notes:
|
|
870
|
+
*
|
|
871
|
+
* - Fields that are only specified in `ConfigFields` and not `Environment` can only appear
|
|
872
|
+
* in the top level config and should not appear in any environments.
|
|
873
|
+
* - Fields that are specified in `PagesConfigFields` are only relevant for Pages projects
|
|
874
|
+
* - All top level fields in config and environments are optional in the wrangler.toml file.
|
|
875
|
+
*
|
|
876
|
+
* Legend for the annotations:
|
|
877
|
+
*
|
|
878
|
+
* - `@breaking`: the deprecation/optionality is a breaking change from Wrangler v1.
|
|
879
|
+
* - `@todo`: there's more work to be done (with details attached).
|
|
880
|
+
*/
|
|
881
|
+
declare type Config = ConfigFields<DevConfig> & PagesConfigFields & Environment;
|
|
882
|
+
|
|
883
|
+
declare class ConfigController extends Controller<ConfigControllerEventMap> {
|
|
554
884
|
config?: StartDevWorkerOptions;
|
|
555
885
|
setOptions(_: StartDevWorkerOptions): void;
|
|
556
886
|
updateOptions(_: Partial<StartDevWorkerOptions>): void;
|
|
557
887
|
teardown(): Promise<void>;
|
|
558
888
|
emitConfigUpdateEvent(data: ConfigUpdateEvent): void;
|
|
559
|
-
on(event: "configUpdate", listener: (_: ConfigUpdateEvent) => void): this;
|
|
560
|
-
on(event: "error", listener: (_: ErrorEvent) => void): this;
|
|
561
|
-
once: typeof ConfigController.on;
|
|
562
889
|
}
|
|
563
890
|
|
|
891
|
+
declare type ConfigControllerEventMap = ControllerEventMap & {
|
|
892
|
+
configUpdate: [ConfigUpdateEvent];
|
|
893
|
+
};
|
|
894
|
+
|
|
564
895
|
declare interface ConfigFields<Dev extends RawDevConfig> {
|
|
565
896
|
configPath: string | undefined;
|
|
566
897
|
/**
|
|
@@ -588,7 +919,7 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
|
|
|
588
919
|
*
|
|
589
920
|
* More details at https://developers.cloudflare.com/workers/learning/using-durable-objects#configuring-durable-object-classes-with-migrations
|
|
590
921
|
*
|
|
591
|
-
* @default
|
|
922
|
+
* @default []
|
|
592
923
|
*/
|
|
593
924
|
migrations: {
|
|
594
925
|
/** A unique identifier for this migration. */
|
|
@@ -632,7 +963,7 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
|
|
|
632
963
|
* items will be uploaded. Example: include = ["upload_dir"]
|
|
633
964
|
*
|
|
634
965
|
* @optional
|
|
635
|
-
* @default
|
|
966
|
+
* @default []
|
|
636
967
|
*/
|
|
637
968
|
include?: string[];
|
|
638
969
|
/**
|
|
@@ -641,7 +972,7 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
|
|
|
641
972
|
* uploads. Example: exclude = ["ignore_dir"]
|
|
642
973
|
*
|
|
643
974
|
* @optional
|
|
644
|
-
* @default
|
|
975
|
+
* @default []
|
|
645
976
|
*/
|
|
646
977
|
exclude?: string[];
|
|
647
978
|
} | undefined;
|
|
@@ -655,7 +986,7 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
|
|
|
655
986
|
exclude: string[];
|
|
656
987
|
browser_TTL: number | undefined;
|
|
657
988
|
serve_single_page_app: boolean;
|
|
658
|
-
} | undefined;
|
|
989
|
+
} | string | undefined;
|
|
659
990
|
/**
|
|
660
991
|
* A list of wasm modules that your worker should be bound to. This is
|
|
661
992
|
* the "legacy" way of binding to a wasm module. ES module workers should
|
|
@@ -696,7 +1027,7 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
|
|
|
696
1027
|
/**
|
|
697
1028
|
* The possible types for a `Rule`.
|
|
698
1029
|
*/
|
|
699
|
-
declare type ConfigModuleRuleType = "ESModule" | "CommonJS" | "CompiledWasm" | "Text" | "Data" | "PythonModule" | "PythonRequirement";
|
|
1030
|
+
declare type ConfigModuleRuleType = "ESModule" | "CommonJS" | "CompiledWasm" | "Text" | "Data" | "PythonModule" | "PythonRequirement" | "NodeJsCompatModule";
|
|
700
1031
|
|
|
701
1032
|
declare type ConfigUpdateEvent = {
|
|
702
1033
|
type: "configUpdate";
|
|
@@ -709,9 +1040,14 @@ url: string | URL_2 | UrlObject,
|
|
|
709
1040
|
options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.ConnectOptions, 'origin' | 'path'>
|
|
710
1041
|
): Promise<Dispatcher.ConnectData>;
|
|
711
1042
|
|
|
712
|
-
declare abstract class Controller extends
|
|
1043
|
+
declare abstract class Controller<EventMap extends ControllerEventMap = ControllerEventMap> extends TypedEventEmitterImpl<EventMap> {
|
|
1044
|
+
emitErrorEvent(data: ErrorEvent): void;
|
|
713
1045
|
}
|
|
714
1046
|
|
|
1047
|
+
declare type ControllerEventMap = {
|
|
1048
|
+
error: [ErrorEvent];
|
|
1049
|
+
};
|
|
1050
|
+
|
|
715
1051
|
declare interface Cookie {
|
|
716
1052
|
name: string
|
|
717
1053
|
value: string
|
|
@@ -753,7 +1089,7 @@ attributes?: { name?: string, domain?: string }
|
|
|
753
1089
|
* NOTE: You will need the `CLOUDFLARE_API_KEY` environment
|
|
754
1090
|
* variable set
|
|
755
1091
|
*/
|
|
756
|
-
declare function deploy({ directory, accountId, projectName, branch, skipCaching, commitMessage, commitHash, commitDirty, functionsDirectory: customFunctionsDirectory, bundle, }: PagesDeployOptions): Promise<{
|
|
1092
|
+
declare function deploy({ directory, accountId, projectName, branch, skipCaching, commitMessage, commitHash, commitDirty, functionsDirectory: customFunctionsDirectory, bundle, sourceMaps, args, }: PagesDeployOptions): Promise<{
|
|
757
1093
|
url: string;
|
|
758
1094
|
id: string;
|
|
759
1095
|
environment: "production" | "preview";
|
|
@@ -795,7 +1131,6 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
|
|
|
795
1131
|
build_image_major_version: number;
|
|
796
1132
|
kv_namespaces?: any;
|
|
797
1133
|
source?: {
|
|
798
|
-
type: "github" | "gitlab";
|
|
799
1134
|
config: {
|
|
800
1135
|
owner: string;
|
|
801
1136
|
repo_name: string;
|
|
@@ -807,6 +1142,7 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
|
|
|
807
1142
|
preview_branch_includes?: string[] | undefined;
|
|
808
1143
|
preview_branch_excludes?: string[] | undefined;
|
|
809
1144
|
};
|
|
1145
|
+
type: "github" | "gitlab";
|
|
810
1146
|
} | undefined;
|
|
811
1147
|
env_vars?: any;
|
|
812
1148
|
durable_object_namespaces?: any;
|
|
@@ -816,30 +1152,6 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
|
|
|
816
1152
|
} | undefined;
|
|
817
1153
|
}>;
|
|
818
1154
|
|
|
819
|
-
declare interface DeprecatedConfigFields {
|
|
820
|
-
/**
|
|
821
|
-
* The project "type". A holdover from Wrangler v1.x.
|
|
822
|
-
* Valid values were "webpack", "javascript", and "rust".
|
|
823
|
-
*
|
|
824
|
-
* @deprecated DO NOT USE THIS. Most common features now work out of the box with wrangler, including modules, jsx, typescript, etc. If you need anything more, use a custom build.
|
|
825
|
-
* @breaking
|
|
826
|
-
*/
|
|
827
|
-
type?: "webpack" | "javascript" | "rust";
|
|
828
|
-
/**
|
|
829
|
-
* Path to the webpack config to use when building your worker.
|
|
830
|
-
* A holdover from Wrangler v1.x, used with `type: "webpack"`.
|
|
831
|
-
*
|
|
832
|
-
* @deprecated DO NOT USE THIS. Most common features now work out of the box with wrangler, including modules, jsx, typescript, etc. If you need anything more, use a custom build.
|
|
833
|
-
* @breaking
|
|
834
|
-
*/
|
|
835
|
-
webpack_config?: string;
|
|
836
|
-
/**
|
|
837
|
-
* Configuration only used by a standalone use of the miniflare binary.
|
|
838
|
-
* @deprecated
|
|
839
|
-
*/
|
|
840
|
-
miniflare?: unknown;
|
|
841
|
-
}
|
|
842
|
-
|
|
843
1155
|
/**
|
|
844
1156
|
* Deprecated upload configuration.
|
|
845
1157
|
*/
|
|
@@ -851,7 +1163,7 @@ declare interface DeprecatedUpload {
|
|
|
851
1163
|
*/
|
|
852
1164
|
format?: "modules" | "service-worker";
|
|
853
1165
|
/**
|
|
854
|
-
* The directory you wish to upload your
|
|
1166
|
+
* The directory you wish to upload your Worker from,
|
|
855
1167
|
* relative to the wrangler.toml file.
|
|
856
1168
|
*
|
|
857
1169
|
* Defaults to the directory containing the wrangler.toml file.
|
|
@@ -875,25 +1187,25 @@ declare interface DevConfig {
|
|
|
875
1187
|
/**
|
|
876
1188
|
* IP address for the local dev server to listen on,
|
|
877
1189
|
*
|
|
878
|
-
* @default
|
|
1190
|
+
* @default localhost
|
|
879
1191
|
*/
|
|
880
1192
|
ip: string;
|
|
881
1193
|
/**
|
|
882
1194
|
* Port for the local dev server to listen on
|
|
883
1195
|
*
|
|
884
|
-
* @default
|
|
1196
|
+
* @default 8787
|
|
885
1197
|
*/
|
|
886
1198
|
port: number | undefined;
|
|
887
1199
|
/**
|
|
888
1200
|
* Port for the local dev server's inspector to listen on
|
|
889
1201
|
*
|
|
890
|
-
* @default
|
|
1202
|
+
* @default 9229
|
|
891
1203
|
*/
|
|
892
1204
|
inspector_port: number | undefined;
|
|
893
1205
|
/**
|
|
894
1206
|
* Protocol that local wrangler dev server listens to requests on.
|
|
895
1207
|
*
|
|
896
|
-
* @default
|
|
1208
|
+
* @default http
|
|
897
1209
|
*/
|
|
898
1210
|
local_protocol: "http" | "https";
|
|
899
1211
|
/**
|
|
@@ -902,7 +1214,7 @@ declare interface DevConfig {
|
|
|
902
1214
|
* Setting this to `http` is not currently implemented for remote mode.
|
|
903
1215
|
* See https://github.com/cloudflare/workers-sdk/issues/583
|
|
904
1216
|
*
|
|
905
|
-
* @default
|
|
1217
|
+
* @default https
|
|
906
1218
|
*/
|
|
907
1219
|
upstream_protocol: "https" | "http";
|
|
908
1220
|
/**
|
|
@@ -1224,7 +1536,7 @@ declare interface DispatchNamespaceOutbound {
|
|
|
1224
1536
|
service: string;
|
|
1225
1537
|
/** (Optional) Name of the environment handling the outbound requests. */
|
|
1226
1538
|
environment?: string;
|
|
1227
|
-
/** (Optional) List of parameter names, for sending context from your dispatch
|
|
1539
|
+
/** (Optional) List of parameter names, for sending context from your dispatch Worker to the outbound handler */
|
|
1228
1540
|
parameters?: string[];
|
|
1229
1541
|
}
|
|
1230
1542
|
|
|
@@ -1237,7 +1549,7 @@ declare type DurableObjectBindings = {
|
|
|
1237
1549
|
name: string;
|
|
1238
1550
|
/** The exported class name of the Durable Object */
|
|
1239
1551
|
class_name: string;
|
|
1240
|
-
/** The script where the Durable Object is defined (if it's external to this
|
|
1552
|
+
/** The script where the Durable Object is defined (if it's external to this Worker) */
|
|
1241
1553
|
script_name?: string;
|
|
1242
1554
|
/** The service environment of the script_name to bind to */
|
|
1243
1555
|
environment?: string;
|
|
@@ -1277,46 +1589,13 @@ declare type Entry = {
|
|
|
1277
1589
|
declare interface Environment extends EnvironmentInheritable, EnvironmentNonInheritable {
|
|
1278
1590
|
}
|
|
1279
1591
|
|
|
1280
|
-
/**
|
|
1281
|
-
* The environment configuration properties that have been deprecated.
|
|
1282
|
-
*/
|
|
1283
|
-
declare interface EnvironmentDeprecated {
|
|
1284
|
-
/**
|
|
1285
|
-
* The zone ID of the zone you want to deploy to. You can find this
|
|
1286
|
-
* in your domain page on the dashboard.
|
|
1287
|
-
*
|
|
1288
|
-
* @deprecated This is unnecessary since we can deduce this from routes directly.
|
|
1289
|
-
*/
|
|
1290
|
-
zone_id?: string;
|
|
1291
|
-
/**
|
|
1292
|
-
* Legacy way of defining KVNamespaces that is no longer supported.
|
|
1293
|
-
*
|
|
1294
|
-
* @deprecated DO NOT USE. This was a legacy bug from Wrangler v1, that we do not want to support.
|
|
1295
|
-
*/
|
|
1296
|
-
"kv-namespaces"?: string;
|
|
1297
|
-
/**
|
|
1298
|
-
* A list of services that your worker should be bound to.
|
|
1299
|
-
*
|
|
1300
|
-
* @default `[]`
|
|
1301
|
-
* @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.
|
|
1302
|
-
*/
|
|
1303
|
-
experimental_services?: {
|
|
1304
|
-
/** The binding name used to refer to the Service */
|
|
1305
|
-
name: string;
|
|
1306
|
-
/** The name of the Service being bound */
|
|
1307
|
-
service: string;
|
|
1308
|
-
/** The Service's environment */
|
|
1309
|
-
environment: string;
|
|
1310
|
-
}[];
|
|
1311
|
-
}
|
|
1312
|
-
|
|
1313
1592
|
/**
|
|
1314
1593
|
* The `EnvironmentInheritable` interface declares all the configuration fields for an environment
|
|
1315
1594
|
* that can be inherited (and overridden) from the top-level environment.
|
|
1316
1595
|
*/
|
|
1317
1596
|
declare interface EnvironmentInheritable {
|
|
1318
1597
|
/**
|
|
1319
|
-
* The name of your
|
|
1598
|
+
* The name of your Worker. Alphanumeric + dashes only.
|
|
1320
1599
|
*
|
|
1321
1600
|
* @inheritable
|
|
1322
1601
|
*/
|
|
@@ -1346,16 +1625,19 @@ declare interface EnvironmentInheritable {
|
|
|
1346
1625
|
*
|
|
1347
1626
|
* More details at https://developers.cloudflare.com/workers/platform/compatibility-dates
|
|
1348
1627
|
*
|
|
1628
|
+
* @default `[]`
|
|
1349
1629
|
* @inheritable
|
|
1350
1630
|
*/
|
|
1351
1631
|
compatibility_flags: string[];
|
|
1352
1632
|
/**
|
|
1353
1633
|
* The entrypoint/path to the JavaScript file that will be executed.
|
|
1634
|
+
*
|
|
1635
|
+
* @inheritable
|
|
1354
1636
|
*/
|
|
1355
1637
|
main: string | undefined;
|
|
1356
1638
|
/**
|
|
1357
1639
|
* If true then Wrangler will traverse the file tree below `base_dir`;
|
|
1358
|
-
* Any files that match `rules` will be included in the deployed
|
|
1640
|
+
* Any files that match `rules` will be included in the deployed Worker.
|
|
1359
1641
|
* Defaults to true if `no_bundle` is true, otherwise false.
|
|
1360
1642
|
*
|
|
1361
1643
|
* @inheritable
|
|
@@ -1366,45 +1648,50 @@ declare interface EnvironmentInheritable {
|
|
|
1366
1648
|
* Defaults to false.
|
|
1367
1649
|
* If left unset, files will be named using the pattern ${fileHash}-${basename},
|
|
1368
1650
|
* for example, `34de60b44167af5c5a709e62a4e20c4f18c9e3b6-favicon.ico`.
|
|
1651
|
+
*
|
|
1652
|
+
* @inheritable
|
|
1369
1653
|
*/
|
|
1370
1654
|
preserve_file_names: boolean | undefined;
|
|
1371
1655
|
/**
|
|
1372
|
-
* The directory in which module rules should be evaluated when including additional files into a
|
|
1373
|
-
* This defaults to the directory containing the `main` entry point of the
|
|
1656
|
+
* The directory in which module rules should be evaluated when including additional files into a Worker deployment.
|
|
1657
|
+
* This defaults to the directory containing the `main` entry point of the Worker if not specified.
|
|
1374
1658
|
*
|
|
1375
1659
|
* @inheritable
|
|
1376
1660
|
*/
|
|
1377
1661
|
base_dir: string | undefined;
|
|
1378
1662
|
/**
|
|
1379
1663
|
* Whether we use <name>.<subdomain>.workers.dev to
|
|
1380
|
-
* test and deploy your
|
|
1664
|
+
* test and deploy your Worker.
|
|
1381
1665
|
*
|
|
1666
|
+
* // Carmen according to our tests the default is undefined
|
|
1382
1667
|
* @default `true` (This is a breaking change from Wrangler v1)
|
|
1383
1668
|
* @breaking
|
|
1384
1669
|
* @inheritable
|
|
1385
1670
|
*/
|
|
1386
1671
|
workers_dev: boolean | undefined;
|
|
1387
1672
|
/**
|
|
1388
|
-
* A list of routes that your
|
|
1673
|
+
* A list of routes that your Worker should be published to.
|
|
1389
1674
|
* Only one of `routes` or `route` is required.
|
|
1390
1675
|
*
|
|
1391
|
-
* Only required when workers_dev is false, and there's no scheduled
|
|
1676
|
+
* Only required when workers_dev is false, and there's no scheduled Worker (see `triggers`)
|
|
1392
1677
|
*
|
|
1393
1678
|
* @inheritable
|
|
1394
1679
|
*/
|
|
1395
1680
|
routes: Route[] | undefined;
|
|
1396
1681
|
/**
|
|
1397
|
-
* A route that your
|
|
1682
|
+
* A route that your Worker should be published to. Literally
|
|
1398
1683
|
* the same as routes, but only one.
|
|
1399
1684
|
* Only one of `routes` or `route` is required.
|
|
1400
1685
|
*
|
|
1401
|
-
* Only required when workers_dev is false, and there's no scheduled
|
|
1686
|
+
* Only required when workers_dev is false, and there's no scheduled Worker
|
|
1402
1687
|
*
|
|
1403
1688
|
* @inheritable
|
|
1404
1689
|
*/
|
|
1405
1690
|
route: Route | undefined;
|
|
1406
1691
|
/**
|
|
1407
1692
|
* Path to a custom tsconfig
|
|
1693
|
+
*
|
|
1694
|
+
* @inheritable
|
|
1408
1695
|
*/
|
|
1409
1696
|
tsconfig: string | undefined;
|
|
1410
1697
|
/**
|
|
@@ -1422,9 +1709,9 @@ declare interface EnvironmentInheritable {
|
|
|
1422
1709
|
*/
|
|
1423
1710
|
jsx_fragment: string;
|
|
1424
1711
|
/**
|
|
1425
|
-
* "Cron" definitions to trigger a
|
|
1712
|
+
* "Cron" definitions to trigger a Worker's "scheduled" function.
|
|
1426
1713
|
*
|
|
1427
|
-
* Lets you call
|
|
1714
|
+
* Lets you call Workers periodically, much like a cron job.
|
|
1428
1715
|
*
|
|
1429
1716
|
* More details here https://developers.cloudflare.com/workers/platform/cron-triggers
|
|
1430
1717
|
*
|
|
@@ -1468,7 +1755,7 @@ declare interface EnvironmentInheritable {
|
|
|
1468
1755
|
* Refer to the [custom builds documentation](https://developers.cloudflare.com/workers/cli-wrangler/configuration#build)
|
|
1469
1756
|
* for more details.
|
|
1470
1757
|
*
|
|
1471
|
-
* @default {}
|
|
1758
|
+
* @default {watch_dir:"./src"}
|
|
1472
1759
|
*/
|
|
1473
1760
|
build: {
|
|
1474
1761
|
/** 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. */
|
|
@@ -1499,24 +1786,9 @@ declare interface EnvironmentInheritable {
|
|
|
1499
1786
|
*/
|
|
1500
1787
|
node_compat: boolean | undefined;
|
|
1501
1788
|
/**
|
|
1502
|
-
*
|
|
1789
|
+
* Designates this Worker as an internal-only "first-party" Worker.
|
|
1503
1790
|
*
|
|
1504
|
-
*
|
|
1505
|
-
* and so must be specified in every named environment.
|
|
1506
|
-
*
|
|
1507
|
-
* @default `[]`
|
|
1508
|
-
* @nonInheritable
|
|
1509
|
-
*/
|
|
1510
|
-
dispatch_namespaces: {
|
|
1511
|
-
/** The binding name used to refer to the bound service. */
|
|
1512
|
-
binding: string;
|
|
1513
|
-
/** The namespace to bind to. */
|
|
1514
|
-
namespace: string;
|
|
1515
|
-
/** Details about the outbound worker which will handle outbound requests from your namespace */
|
|
1516
|
-
outbound?: DispatchNamespaceOutbound;
|
|
1517
|
-
}[];
|
|
1518
|
-
/**
|
|
1519
|
-
* Designates this worker as an internal-only "first-party" worker.
|
|
1791
|
+
* @inheritable
|
|
1520
1792
|
*/
|
|
1521
1793
|
first_party_worker: boolean | undefined;
|
|
1522
1794
|
/**
|
|
@@ -1541,7 +1813,7 @@ declare interface EnvironmentInheritable {
|
|
|
1541
1813
|
}[];
|
|
1542
1814
|
};
|
|
1543
1815
|
/**
|
|
1544
|
-
* Send Trace Events from this
|
|
1816
|
+
* Send Trace Events from this Worker to Workers Logpush.
|
|
1545
1817
|
*
|
|
1546
1818
|
* This will not configure a corresponding Logpush job automatically.
|
|
1547
1819
|
*
|
|
@@ -1552,33 +1824,22 @@ declare interface EnvironmentInheritable {
|
|
|
1552
1824
|
*/
|
|
1553
1825
|
logpush: boolean | undefined;
|
|
1554
1826
|
/**
|
|
1555
|
-
*
|
|
1827
|
+
* Include source maps when uploading this worker.
|
|
1828
|
+
* @inheritable
|
|
1829
|
+
*/
|
|
1830
|
+
upload_source_maps: boolean | undefined;
|
|
1831
|
+
/**
|
|
1832
|
+
* Specify how the Worker should be located to minimize round-trip time.
|
|
1556
1833
|
*
|
|
1557
1834
|
* More details: https://developers.cloudflare.com/workers/platform/smart-placement/
|
|
1835
|
+
*
|
|
1836
|
+
* @inheritable
|
|
1558
1837
|
*/
|
|
1559
1838
|
placement: {
|
|
1560
1839
|
mode: "off" | "smart";
|
|
1561
1840
|
} | undefined;
|
|
1562
1841
|
}
|
|
1563
1842
|
|
|
1564
|
-
declare interface EnvironmentMap {
|
|
1565
|
-
/**
|
|
1566
|
-
* The `env` section defines overrides for the configuration for different environments.
|
|
1567
|
-
*
|
|
1568
|
-
* All environment fields can be specified at the top level of the config indicating the default environment settings.
|
|
1569
|
-
*
|
|
1570
|
-
* - Some fields are inherited and overridable in each environment.
|
|
1571
|
-
* - But some are not inherited and must be explicitly specified in every environment, if they are specified at the top level.
|
|
1572
|
-
*
|
|
1573
|
-
* For more information, see the documentation at https://developers.cloudflare.com/workers/cli-wrangler/configuration#environments
|
|
1574
|
-
*
|
|
1575
|
-
* @default `{}`
|
|
1576
|
-
*/
|
|
1577
|
-
env?: {
|
|
1578
|
-
[envName: string]: RawEnvironment;
|
|
1579
|
-
};
|
|
1580
|
-
}
|
|
1581
|
-
|
|
1582
1843
|
/**
|
|
1583
1844
|
* The `EnvironmentNonInheritable` interface declares all the configuration fields for an environment
|
|
1584
1845
|
* that cannot be inherited from the top-level environment, and must be defined specifically.
|
|
@@ -1588,7 +1849,7 @@ declare interface EnvironmentMap {
|
|
|
1588
1849
|
*/
|
|
1589
1850
|
declare interface EnvironmentNonInheritable {
|
|
1590
1851
|
/**
|
|
1591
|
-
* A map of values to substitute when deploying your
|
|
1852
|
+
* A map of values to substitute when deploying your Worker.
|
|
1592
1853
|
*
|
|
1593
1854
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1594
1855
|
* and so must be specified in every named environment.
|
|
@@ -1598,7 +1859,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1598
1859
|
*/
|
|
1599
1860
|
define: Record<string, string>;
|
|
1600
1861
|
/**
|
|
1601
|
-
* A map of environment variables to set when deploying your
|
|
1862
|
+
* A map of environment variables to set when deploying your Worker.
|
|
1602
1863
|
*
|
|
1603
1864
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1604
1865
|
* and so must be specified in every named environment.
|
|
@@ -1608,7 +1869,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1608
1869
|
*/
|
|
1609
1870
|
vars: Record<string, string | Json>;
|
|
1610
1871
|
/**
|
|
1611
|
-
* A list of durable objects that your
|
|
1872
|
+
* A list of durable objects that your Worker should be bound to.
|
|
1612
1873
|
*
|
|
1613
1874
|
* For more information about Durable Objects, see the documentation at
|
|
1614
1875
|
* https://developers.cloudflare.com/workers/learning/using-durable-objects
|
|
@@ -1676,16 +1937,18 @@ declare interface EnvironmentNonInheritable {
|
|
|
1676
1937
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1677
1938
|
* and so must be specified in every named environment.
|
|
1678
1939
|
*
|
|
1679
|
-
* @default `{}`
|
|
1940
|
+
* @default `{consumers:[],producers:[]}`
|
|
1680
1941
|
* @nonInheritable
|
|
1681
1942
|
*/
|
|
1682
1943
|
queues: {
|
|
1683
1944
|
/** Producer bindings */
|
|
1684
1945
|
producers?: {
|
|
1685
|
-
/** The binding name used to refer to the Queue in the
|
|
1946
|
+
/** The binding name used to refer to the Queue in the Worker. */
|
|
1686
1947
|
binding: string;
|
|
1687
1948
|
/** The name of this Queue. */
|
|
1688
1949
|
queue: string;
|
|
1950
|
+
/** The number of seconds to wait before delivering a message */
|
|
1951
|
+
delivery_delay?: number;
|
|
1689
1952
|
}[];
|
|
1690
1953
|
/** Consumer configuration */
|
|
1691
1954
|
consumers?: {
|
|
@@ -1719,7 +1982,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1719
1982
|
* @nonInheritable
|
|
1720
1983
|
*/
|
|
1721
1984
|
r2_buckets: {
|
|
1722
|
-
/** The binding name used to refer to the R2 bucket in the
|
|
1985
|
+
/** The binding name used to refer to the R2 bucket in the Worker. */
|
|
1723
1986
|
binding: string;
|
|
1724
1987
|
/** The name of this R2 bucket at the edge. */
|
|
1725
1988
|
bucket_name: string;
|
|
@@ -1738,7 +2001,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1738
2001
|
* @nonInheritable
|
|
1739
2002
|
*/
|
|
1740
2003
|
d1_databases: {
|
|
1741
|
-
/** The binding name used to refer to the D1 database in the
|
|
2004
|
+
/** The binding name used to refer to the D1 database in the Worker. */
|
|
1742
2005
|
binding: string;
|
|
1743
2006
|
/** The name of this D1 database. */
|
|
1744
2007
|
database_name: string;
|
|
@@ -1763,7 +2026,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1763
2026
|
* @nonInheritable
|
|
1764
2027
|
*/
|
|
1765
2028
|
vectorize: {
|
|
1766
|
-
/** The binding name used to refer to the Vectorize index in the
|
|
2029
|
+
/** The binding name used to refer to the Vectorize index in the Worker. */
|
|
1767
2030
|
binding: string;
|
|
1768
2031
|
/** The name of the index. */
|
|
1769
2032
|
index_name: string;
|
|
@@ -1778,7 +2041,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1778
2041
|
* @nonInheritable
|
|
1779
2042
|
*/
|
|
1780
2043
|
constellation: {
|
|
1781
|
-
/** The binding name used to refer to the project in the
|
|
2044
|
+
/** The binding name used to refer to the project in the Worker. */
|
|
1782
2045
|
binding: string;
|
|
1783
2046
|
/** The id of the project. */
|
|
1784
2047
|
project_id: string;
|
|
@@ -1793,7 +2056,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1793
2056
|
* @nonInheritable
|
|
1794
2057
|
*/
|
|
1795
2058
|
hyperdrive: {
|
|
1796
|
-
/** The binding name used to refer to the project in the
|
|
2059
|
+
/** The binding name used to refer to the project in the Worker. */
|
|
1797
2060
|
binding: string;
|
|
1798
2061
|
/** The id of the database. */
|
|
1799
2062
|
id: string;
|
|
@@ -1801,7 +2064,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1801
2064
|
localConnectionString?: string;
|
|
1802
2065
|
}[];
|
|
1803
2066
|
/**
|
|
1804
|
-
* Specifies service bindings (
|
|
2067
|
+
* Specifies service bindings (Worker-to-Worker) that are bound to this Worker environment.
|
|
1805
2068
|
*
|
|
1806
2069
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1807
2070
|
* and so must be specified in every named environment.
|
|
@@ -1816,6 +2079,8 @@ declare interface EnvironmentNonInheritable {
|
|
|
1816
2079
|
service: string;
|
|
1817
2080
|
/** The environment of the service (e.g. production, staging, etc). */
|
|
1818
2081
|
environment?: string;
|
|
2082
|
+
/** Optionally, the entrypoint (named export) of the service to bind to. */
|
|
2083
|
+
entrypoint?: string;
|
|
1819
2084
|
}[] | undefined;
|
|
1820
2085
|
/**
|
|
1821
2086
|
* Specifies analytics engine datasets that are bound to this Worker environment.
|
|
@@ -1827,22 +2092,41 @@ declare interface EnvironmentNonInheritable {
|
|
|
1827
2092
|
* @nonInheritable
|
|
1828
2093
|
*/
|
|
1829
2094
|
analytics_engine_datasets: {
|
|
1830
|
-
/** The binding name used to refer to the dataset in the
|
|
2095
|
+
/** The binding name used to refer to the dataset in the Worker. */
|
|
1831
2096
|
binding: string;
|
|
1832
2097
|
/** The name of this dataset to write to. */
|
|
1833
2098
|
dataset?: string;
|
|
1834
2099
|
}[];
|
|
1835
2100
|
/**
|
|
1836
|
-
* A browser that will be usable from the
|
|
2101
|
+
* A browser that will be usable from the Worker.
|
|
2102
|
+
*
|
|
2103
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2104
|
+
* and so must be specified in every named environment.
|
|
2105
|
+
*
|
|
2106
|
+
* @default `{}`
|
|
2107
|
+
* @nonInheritable
|
|
1837
2108
|
*/
|
|
1838
2109
|
browser: {
|
|
1839
2110
|
binding: string;
|
|
1840
2111
|
} | undefined;
|
|
1841
2112
|
/**
|
|
1842
2113
|
* Binding to the AI project.
|
|
2114
|
+
*
|
|
2115
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2116
|
+
* and so must be specified in every named environment.
|
|
2117
|
+
*
|
|
2118
|
+
* @default `{}`
|
|
2119
|
+
* @nonInheritable
|
|
1843
2120
|
*/
|
|
1844
2121
|
ai: {
|
|
1845
2122
|
binding: string;
|
|
2123
|
+
staging?: boolean;
|
|
2124
|
+
} | undefined;
|
|
2125
|
+
/**
|
|
2126
|
+
* Binding to the Worker Version's metadata
|
|
2127
|
+
*/
|
|
2128
|
+
version_metadata: {
|
|
2129
|
+
binding: string;
|
|
1846
2130
|
} | undefined;
|
|
1847
2131
|
/**
|
|
1848
2132
|
* "Unsafe" tables for features that aren't directly supported by wrangler.
|
|
@@ -1850,6 +2134,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1850
2134
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1851
2135
|
* and so must be specified in every named environment.
|
|
1852
2136
|
*
|
|
2137
|
+
* @default `{}`
|
|
1853
2138
|
* @nonInheritable
|
|
1854
2139
|
*/
|
|
1855
2140
|
unsafe: {
|
|
@@ -1883,18 +2168,53 @@ declare interface EnvironmentNonInheritable {
|
|
|
1883
2168
|
compiled_schema: string;
|
|
1884
2169
|
};
|
|
1885
2170
|
};
|
|
2171
|
+
/**
|
|
2172
|
+
* Specifies a list of mTLS certificates that are bound to this Worker environment.
|
|
2173
|
+
*
|
|
2174
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2175
|
+
* and so must be specified in every named environment.
|
|
2176
|
+
*
|
|
2177
|
+
* @default `[]`
|
|
2178
|
+
* @nonInheritable
|
|
2179
|
+
*/
|
|
1886
2180
|
mtls_certificates: {
|
|
1887
|
-
/** The binding name used to refer to the certificate in the
|
|
2181
|
+
/** The binding name used to refer to the certificate in the Worker */
|
|
1888
2182
|
binding: string;
|
|
1889
2183
|
/** The uuid of the uploaded mTLS certificate */
|
|
1890
2184
|
certificate_id: string;
|
|
1891
2185
|
}[];
|
|
2186
|
+
/**
|
|
2187
|
+
* Specifies a list of Tail Workers that are bound to this Worker environment
|
|
2188
|
+
*
|
|
2189
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2190
|
+
* and so must be specified in every named environment.
|
|
2191
|
+
*
|
|
2192
|
+
* @default `[]`
|
|
2193
|
+
* @nonInheritable
|
|
2194
|
+
*/
|
|
1892
2195
|
tail_consumers?: TailConsumer[];
|
|
2196
|
+
/**
|
|
2197
|
+
* Specifies namespace bindings that are bound to this Worker environment.
|
|
2198
|
+
*
|
|
2199
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2200
|
+
* and so must be specified in every named environment.
|
|
2201
|
+
*
|
|
2202
|
+
* @default `[]`
|
|
2203
|
+
* @nonInheritable
|
|
2204
|
+
*/
|
|
2205
|
+
dispatch_namespaces: {
|
|
2206
|
+
/** The binding name used to refer to the bound service. */
|
|
2207
|
+
binding: string;
|
|
2208
|
+
/** The namespace to bind to. */
|
|
2209
|
+
namespace: string;
|
|
2210
|
+
/** Details about the outbound Worker which will handle outbound requests from your namespace */
|
|
2211
|
+
outbound?: DispatchNamespaceOutbound;
|
|
2212
|
+
}[];
|
|
1893
2213
|
}
|
|
1894
2214
|
|
|
1895
2215
|
declare type ErrorEvent = BaseErrorEvent<"ConfigController" | "BundlerController" | "LocalRuntimeController" | "RemoteRuntimeController" | "ProxyWorker" | "InspectorProxyWorker"> | BaseErrorEvent<"ProxyController", {
|
|
1896
2216
|
config?: StartDevWorkerOptions;
|
|
1897
|
-
bundle?:
|
|
2217
|
+
bundle?: Bundle;
|
|
1898
2218
|
}>;
|
|
1899
2219
|
|
|
1900
2220
|
declare namespace Errors {
|
|
@@ -2024,6 +2344,7 @@ declare namespace Errors {
|
|
|
2024
2344
|
declare type EsbuildBundle = {
|
|
2025
2345
|
id: number;
|
|
2026
2346
|
path: string;
|
|
2347
|
+
entrypointSource: string;
|
|
2027
2348
|
entry: Entry;
|
|
2028
2349
|
type: CfModuleType;
|
|
2029
2350
|
modules: CfModule[];
|
|
@@ -2310,6 +2631,10 @@ export declare function getPlatformProxy<Env = Record<string, unknown>, CfProper
|
|
|
2310
2631
|
* Options for the `getPlatformProxy` utility
|
|
2311
2632
|
*/
|
|
2312
2633
|
export declare type GetPlatformProxyOptions = {
|
|
2634
|
+
/**
|
|
2635
|
+
* The name of the environment to use
|
|
2636
|
+
*/
|
|
2637
|
+
environment?: string;
|
|
2313
2638
|
/**
|
|
2314
2639
|
* The path to the config object to use (default `wrangler.toml`)
|
|
2315
2640
|
*/
|
|
@@ -2354,7 +2679,14 @@ declare class Headers implements SpecIterable<[string, string]> {
|
|
|
2354
2679
|
|
|
2355
2680
|
declare type HeadersInit = string[][] | Record<string, string | ReadonlyArray<string>> | Headers
|
|
2356
2681
|
|
|
2357
|
-
declare type Hook<T
|
|
2682
|
+
declare type Hook<T extends string | number | object> = T | Promise<T> | (() => T | Promise<T>);
|
|
2683
|
+
|
|
2684
|
+
/**
|
|
2685
|
+
* @property terminate Terminates HTTP server.
|
|
2686
|
+
*/
|
|
2687
|
+
declare type HttpTerminator = {
|
|
2688
|
+
readonly terminate: () => Promise<void>;
|
|
2689
|
+
};
|
|
2358
2690
|
|
|
2359
2691
|
/**
|
|
2360
2692
|
* The header type declaration of `undici`.
|
|
@@ -2389,6 +2721,21 @@ declare interface Interceptable extends Dispatcher {
|
|
|
2389
2721
|
intercept(options: MockInterceptor.Options): MockInterceptor;
|
|
2390
2722
|
}
|
|
2391
2723
|
|
|
2724
|
+
declare class Logger {
|
|
2725
|
+
constructor();
|
|
2726
|
+
loggerLevel: "error" | "none" | "warn" | "info" | "log" | "debug";
|
|
2727
|
+
columns: number;
|
|
2728
|
+
debug: (...args: unknown[]) => void;
|
|
2729
|
+
debugWithSanitization: (label: string, ...args: unknown[]) => void;
|
|
2730
|
+
info: (...args: unknown[]) => void;
|
|
2731
|
+
log: (...args: unknown[]) => void;
|
|
2732
|
+
warn: (...args: unknown[]) => void;
|
|
2733
|
+
error: (...args: unknown[]) => void;
|
|
2734
|
+
table<Keys extends string>(data: TableRow<Keys>[]): void;
|
|
2735
|
+
private doLog;
|
|
2736
|
+
private formatMessage;
|
|
2737
|
+
}
|
|
2738
|
+
|
|
2392
2739
|
declare type LogLevel = "debug" | "info" | "log" | "warn" | "error" | "none";
|
|
2393
2740
|
|
|
2394
2741
|
declare type MaybePromise<T> = T | Promise<T>;
|
|
@@ -2594,7 +2941,7 @@ declare class MockScope<TData extends object = object> {
|
|
|
2594
2941
|
}
|
|
2595
2942
|
|
|
2596
2943
|
declare interface ModuleRule {
|
|
2597
|
-
type: "ESModule" | "CommonJS" | "
|
|
2944
|
+
type: "ESModule" | "CommonJS" | "NodeJsCompatModule" | "CompiledWasm" | "Text" | "Data";
|
|
2598
2945
|
include?: string[];
|
|
2599
2946
|
fallthrough?: boolean;
|
|
2600
2947
|
}
|
|
@@ -2671,6 +3018,14 @@ declare interface PagesDeployOptions {
|
|
|
2671
3018
|
* Default: true
|
|
2672
3019
|
*/
|
|
2673
3020
|
bundle?: boolean;
|
|
3021
|
+
/**
|
|
3022
|
+
* Whether to upload any server-side sourcemaps with this deployment
|
|
3023
|
+
*/
|
|
3024
|
+
sourceMaps: boolean;
|
|
3025
|
+
/**
|
|
3026
|
+
* Command line args passed to the `pages deploy` cmd
|
|
3027
|
+
*/
|
|
3028
|
+
args?: Record<string, unknown>;
|
|
2674
3029
|
}
|
|
2675
3030
|
|
|
2676
3031
|
declare type _Params<ParamsArray extends [unknown?]> = ParamsArray extends [infer P] ? P : undefined;
|
|
@@ -23046,7 +23401,7 @@ declare namespace ProxyAgent {
|
|
|
23046
23401
|
}
|
|
23047
23402
|
}
|
|
23048
23403
|
|
|
23049
|
-
declare class ProxyController extends
|
|
23404
|
+
declare class ProxyController extends Controller<ProxyControllerEventMap> {
|
|
23050
23405
|
ready: DeferredPromise<ReadyEvent>;
|
|
23051
23406
|
proxyWorker?: Miniflare;
|
|
23052
23407
|
proxyWorkerOptions?: MiniflareOptions;
|
|
@@ -23070,21 +23425,24 @@ declare class ProxyController extends EventEmitter_2 {
|
|
|
23070
23425
|
teardown(): Promise<void>;
|
|
23071
23426
|
emitReadyEvent(proxyWorker: Miniflare): void;
|
|
23072
23427
|
emitPreviewTokenExpiredEvent(proxyData: ProxyData): void;
|
|
23073
|
-
emitErrorEvent(
|
|
23074
|
-
|
|
23075
|
-
on(event: "previewTokenExpired", listener: (_: PreviewTokenExpiredEvent) => void): this;
|
|
23076
|
-
on(event: "error", listener: (_: ErrorEvent) => void): this;
|
|
23077
|
-
once: typeof ProxyController.on;
|
|
23428
|
+
emitErrorEvent(data: ErrorEvent): void;
|
|
23429
|
+
emitErrorEvent(reason: string, cause?: Error | SerializedError): void;
|
|
23078
23430
|
}
|
|
23079
23431
|
|
|
23432
|
+
declare type ProxyControllerEventMap = ControllerEventMap & {
|
|
23433
|
+
ready: [ReadyEvent];
|
|
23434
|
+
previewTokenExpired: [PreviewTokenExpiredEvent];
|
|
23435
|
+
};
|
|
23436
|
+
|
|
23080
23437
|
declare type ProxyData = {
|
|
23081
23438
|
userWorkerUrl: UrlOriginParts;
|
|
23082
23439
|
userWorkerInspectorUrl: UrlOriginAndPathnameParts;
|
|
23083
|
-
userWorkerInnerUrlOverrides
|
|
23440
|
+
userWorkerInnerUrlOverrides?: Partial<UrlOriginParts>;
|
|
23084
23441
|
headers: Record<string, string>;
|
|
23085
23442
|
liveReload?: boolean;
|
|
23086
23443
|
proxyLogsToController?: boolean;
|
|
23087
23444
|
internalDurableObjects?: CfDurableObject[];
|
|
23445
|
+
entrypointAddresses: WorkerEntrypointsDefinition | undefined;
|
|
23088
23446
|
};
|
|
23089
23447
|
|
|
23090
23448
|
declare type ProxyWorkerIncomingRequestBody = {
|
|
@@ -23105,18 +23463,10 @@ declare type ProxyWorkerOutgoingRequestBody = {
|
|
|
23105
23463
|
args: Parameters<typeof console.debug>;
|
|
23106
23464
|
};
|
|
23107
23465
|
|
|
23108
|
-
declare type
|
|
23466
|
+
declare type QueueConsumer = NonNullable<Config["queues"]["consumers"]>[number];
|
|
23109
23467
|
|
|
23110
23468
|
declare type RawDevConfig = Partial<DevConfig>;
|
|
23111
23469
|
|
|
23112
|
-
/**
|
|
23113
|
-
* The raw environment configuration that we read from the config file.
|
|
23114
|
-
*
|
|
23115
|
-
* All the properties are optional, and will be replaced with defaults in the configuration that
|
|
23116
|
-
* is used in the rest of the codebase.
|
|
23117
|
-
*/
|
|
23118
|
-
declare type RawEnvironment = Partial<Environment> & EnvironmentDeprecated;
|
|
23119
|
-
|
|
23120
23470
|
declare type ReadyEvent = {
|
|
23121
23471
|
type: "ready";
|
|
23122
23472
|
proxyWorker: Miniflare;
|
|
@@ -23142,14 +23492,14 @@ declare type ReferrerPolicy =
|
|
|
23142
23492
|
declare type ReloadCompleteEvent = {
|
|
23143
23493
|
type: "reloadComplete";
|
|
23144
23494
|
config: StartDevWorkerOptions;
|
|
23145
|
-
bundle:
|
|
23495
|
+
bundle: Bundle;
|
|
23146
23496
|
proxyData: ProxyData;
|
|
23147
23497
|
};
|
|
23148
23498
|
|
|
23149
23499
|
declare type ReloadStartEvent = {
|
|
23150
23500
|
type: "reloadStart";
|
|
23151
23501
|
config: StartDevWorkerOptions;
|
|
23152
|
-
bundle:
|
|
23502
|
+
bundle: Bundle;
|
|
23153
23503
|
};
|
|
23154
23504
|
|
|
23155
23505
|
declare class Request implements BodyMixin {
|
|
@@ -23410,19 +23760,20 @@ declare type Rule = {
|
|
|
23410
23760
|
fallthrough?: boolean;
|
|
23411
23761
|
};
|
|
23412
23762
|
|
|
23413
|
-
declare abstract class RuntimeController extends Controller {
|
|
23763
|
+
declare abstract class RuntimeController extends Controller<RuntimeControllerEventMap> {
|
|
23414
23764
|
abstract onBundleStart(_: BundleStartEvent): void;
|
|
23415
23765
|
abstract onBundleComplete(_: BundleCompleteEvent): void;
|
|
23416
23766
|
abstract onPreviewTokenExpired(_: PreviewTokenExpiredEvent): void;
|
|
23417
23767
|
abstract teardown(): Promise<void>;
|
|
23418
23768
|
abstract emitReloadStartEvent(data: ReloadStartEvent): void;
|
|
23419
|
-
abstract
|
|
23420
|
-
on(event: "reloadStart", listener: (_: ReloadStartEvent) => void): this;
|
|
23421
|
-
on(event: "reloadComplete", listener: (_: ReloadCompleteEvent) => void): this;
|
|
23422
|
-
on(event: "error", listener: (_: ErrorEvent) => void): this;
|
|
23423
|
-
once: typeof RuntimeController.on;
|
|
23769
|
+
abstract emitReloadCompleteEvent(data: ReloadCompleteEvent): void;
|
|
23424
23770
|
}
|
|
23425
23771
|
|
|
23772
|
+
declare type RuntimeControllerEventMap = ControllerEventMap & {
|
|
23773
|
+
reloadStart: [ReloadStartEvent];
|
|
23774
|
+
reloadComplete: [ReloadCompleteEvent];
|
|
23775
|
+
};
|
|
23776
|
+
|
|
23426
23777
|
/**
|
|
23427
23778
|
* Convert a MIMEType object to a string.
|
|
23428
23779
|
* @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type
|
|
@@ -23436,12 +23787,7 @@ declare type SerializedError = {
|
|
|
23436
23787
|
cause?: unknown;
|
|
23437
23788
|
};
|
|
23438
23789
|
|
|
23439
|
-
declare
|
|
23440
|
-
name: string;
|
|
23441
|
-
env?: string;
|
|
23442
|
-
}
|
|
23443
|
-
|
|
23444
|
-
declare type ServiceFetch = (request: Request_2) => Promise<Response_2>;
|
|
23790
|
+
declare type ServiceFetch = (request: Request_2) => Promise<Response_2> | Response_2;
|
|
23445
23791
|
|
|
23446
23792
|
declare function setCookie (headers: Headers, cookie: Cookie): void
|
|
23447
23793
|
|
|
@@ -23478,7 +23824,7 @@ declare interface SpecIterator<T, TReturn = any, TNext = undefined> {
|
|
|
23478
23824
|
|
|
23479
23825
|
declare interface StartDevWorkerOptions {
|
|
23480
23826
|
/** The name of the worker. */
|
|
23481
|
-
name
|
|
23827
|
+
name?: string;
|
|
23482
23828
|
/**
|
|
23483
23829
|
* The javascript or typescript entry-point of the worker.
|
|
23484
23830
|
* This is the `main` property of a wrangler.toml.
|
|
@@ -23486,9 +23832,7 @@ declare interface StartDevWorkerOptions {
|
|
|
23486
23832
|
*/
|
|
23487
23833
|
script: File_2<string>;
|
|
23488
23834
|
/** The configuration of the worker. */
|
|
23489
|
-
config?: File_2<
|
|
23490
|
-
env?: string;
|
|
23491
|
-
};
|
|
23835
|
+
config?: File_2<Config>;
|
|
23492
23836
|
/** The compatibility date for the workerd runtime. */
|
|
23493
23837
|
compatibilityDate?: string;
|
|
23494
23838
|
/** The compatibility flags for the workerd runtime. */
|
|
@@ -23503,6 +23847,19 @@ declare interface StartDevWorkerOptions {
|
|
|
23503
23847
|
include?: string[];
|
|
23504
23848
|
exclude?: string[];
|
|
23505
23849
|
};
|
|
23850
|
+
/** Service environments. Providing support for existing workers with this property. Don't use this for new workers. */
|
|
23851
|
+
env?: string;
|
|
23852
|
+
/** Wrangler environments, defaults to true. */
|
|
23853
|
+
legacyEnv?: boolean;
|
|
23854
|
+
/**
|
|
23855
|
+
* Whether Wrangler should send usage metrics to Cloudflare for this project.
|
|
23856
|
+
*
|
|
23857
|
+
* When defined this will override any user settings.
|
|
23858
|
+
* Otherwise, Wrangler will use the user's preference.
|
|
23859
|
+
*/
|
|
23860
|
+
sendMetrics?: boolean;
|
|
23861
|
+
usageModel?: "bundled" | "unbound";
|
|
23862
|
+
_bindings?: CfWorkerInit["bindings"];
|
|
23506
23863
|
/** Options applying to the worker's build step. Applies to deploy and dev. */
|
|
23507
23864
|
build?: {
|
|
23508
23865
|
/** Whether the worker and its dependencies are bundled. Defaults to true. */
|
|
@@ -23554,7 +23911,7 @@ declare interface StartDevWorkerOptions {
|
|
|
23554
23911
|
httpsCertPath?: string;
|
|
23555
23912
|
};
|
|
23556
23913
|
/** Controls what request.url looks like inside the worker. */
|
|
23557
|
-
|
|
23914
|
+
origin?: {
|
|
23558
23915
|
hostname?: string;
|
|
23559
23916
|
secure?: boolean;
|
|
23560
23917
|
};
|
|
@@ -23562,6 +23919,8 @@ declare interface StartDevWorkerOptions {
|
|
|
23562
23919
|
outboundService?: ServiceFetch;
|
|
23563
23920
|
/** An undici MockAgent to declaratively mock fetch calls to particular resources. */
|
|
23564
23921
|
mockFetch?: undici.MockAgent;
|
|
23922
|
+
/** Gets a fetcher to a specific worker, used for multi-worker development */
|
|
23923
|
+
getRegisteredWorker?(name: string): WorkerDefinition | undefined;
|
|
23565
23924
|
};
|
|
23566
23925
|
}
|
|
23567
23926
|
|
|
@@ -23572,6 +23931,8 @@ options: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions, 'origin'
|
|
|
23572
23931
|
factory: Dispatcher.StreamFactory
|
|
23573
23932
|
): Promise<Dispatcher.StreamData>;
|
|
23574
23933
|
|
|
23934
|
+
declare type TableRow<Keys extends string> = Record<Keys, string>;
|
|
23935
|
+
|
|
23575
23936
|
declare type TailConsumer = {
|
|
23576
23937
|
/** The name of the service tail events will be forwarded to. */
|
|
23577
23938
|
service: string;
|
|
@@ -23584,30 +23945,35 @@ declare type Trigger = {
|
|
|
23584
23945
|
} | {
|
|
23585
23946
|
type: "route";
|
|
23586
23947
|
pattern: string;
|
|
23587
|
-
|
|
23588
|
-
} | {
|
|
23948
|
+
} | ({
|
|
23589
23949
|
type: "route";
|
|
23590
|
-
|
|
23591
|
-
zoneId: string;
|
|
23592
|
-
customDomain?: true;
|
|
23593
|
-
zoneName?: never;
|
|
23594
|
-
} | {
|
|
23950
|
+
} & ZoneIdRoute) | ({
|
|
23595
23951
|
type: "route";
|
|
23596
|
-
|
|
23597
|
-
|
|
23598
|
-
|
|
23599
|
-
|
|
23600
|
-
|
|
23601
|
-
|
|
23602
|
-
schedule: string;
|
|
23603
|
-
} | {
|
|
23952
|
+
} & ZoneNameRoute) | ({
|
|
23953
|
+
type: "route";
|
|
23954
|
+
} & CustomDomainRoute) | {
|
|
23955
|
+
type: "cron";
|
|
23956
|
+
cron: string;
|
|
23957
|
+
} | ({
|
|
23604
23958
|
type: "queue-consumer";
|
|
23605
|
-
|
|
23606
|
-
|
|
23607
|
-
|
|
23608
|
-
|
|
23609
|
-
|
|
23610
|
-
|
|
23959
|
+
} & QueueConsumer);
|
|
23960
|
+
|
|
23961
|
+
declare interface TypedEventEmitter<EventMap extends Record<string | symbol, unknown[]>> extends EventEmitter_2 {
|
|
23962
|
+
addListener<Name extends keyof EventMap>(eventName: Name, listener: (...args: EventMap[Name]) => void): this;
|
|
23963
|
+
on<Name extends keyof EventMap>(eventName: Name, listener: (...args: EventMap[Name]) => void): this;
|
|
23964
|
+
once<Name extends keyof EventMap>(eventName: Name, listener: (...args: EventMap[Name]) => void): this;
|
|
23965
|
+
removeListener<Name extends keyof EventMap>(eventName: Name, listener: (...args: EventMap[Name]) => void): this;
|
|
23966
|
+
off<Name extends keyof EventMap>(eventName: Name, listener: (...args: EventMap[Name]) => void): this;
|
|
23967
|
+
removeAllListeners(event?: keyof EventMap): this;
|
|
23968
|
+
listeners<Name extends keyof EventMap>(eventName: Name): ((...args: EventMap[Name]) => void)[];
|
|
23969
|
+
rawListeners<Name extends keyof EventMap>(eventName: Name): ((...args: EventMap[Name]) => void)[];
|
|
23970
|
+
emit<Name extends keyof EventMap>(eventName: Name, ...args: EventMap[Name]): boolean;
|
|
23971
|
+
listenerCount<Name extends keyof EventMap>(eventName: Name, listener?: (...args: EventMap[Name]) => void): number;
|
|
23972
|
+
prependListener<Name extends keyof EventMap>(eventName: Name, listener: (...args: EventMap[Name]) => void): this;
|
|
23973
|
+
prependOnceListener<Name extends keyof EventMap>(eventName: Name, listener: (...args: EventMap[Name]) => void): this;
|
|
23974
|
+
}
|
|
23975
|
+
|
|
23976
|
+
declare const TypedEventEmitterImpl: new <EventMap extends Record<string | symbol, unknown[]>>() => TypedEventEmitter<EventMap>;
|
|
23611
23977
|
|
|
23612
23978
|
declare namespace Undici {
|
|
23613
23979
|
var Dispatcher: Dispatcher
|
|
@@ -23749,7 +24115,9 @@ export declare class unstable_DevEnv extends EventEmitter_2 {
|
|
|
23749
24115
|
emitErrorEvent(ev: ErrorEvent): void;
|
|
23750
24116
|
}
|
|
23751
24117
|
|
|
23752
|
-
export declare
|
|
24118
|
+
export declare const unstable_generateASSETSBinding: (opts: UnstableASSETSBindingsOptions) => (request: Request_2) => Promise<Response_2>;
|
|
24119
|
+
|
|
24120
|
+
export declare function unstable_getMiniflareWorkerOptions(configPath: string, environment?: string): {
|
|
23753
24121
|
workerOptions: SourcelessWorkerOptions;
|
|
23754
24122
|
define: Record<string, string>;
|
|
23755
24123
|
main?: string;
|
|
@@ -23764,6 +24132,17 @@ export declare const unstable_pages: {
|
|
|
23764
24132
|
*/
|
|
23765
24133
|
export declare function unstable_splitSqlQuery(sql: string): string[];
|
|
23766
24134
|
|
|
24135
|
+
export declare function unstable_startWorkerRegistryServer(port: number): Promise<{
|
|
24136
|
+
server: Server<IncomingMessage, ServerResponse>;
|
|
24137
|
+
terminator: HttpTerminator;
|
|
24138
|
+
}>;
|
|
24139
|
+
|
|
24140
|
+
export declare interface UnstableASSETSBindingsOptions {
|
|
24141
|
+
log: Logger;
|
|
24142
|
+
proxyPort?: number;
|
|
24143
|
+
directory?: string;
|
|
24144
|
+
}
|
|
24145
|
+
|
|
23767
24146
|
export declare interface UnstableDevOptions {
|
|
23768
24147
|
config?: string;
|
|
23769
24148
|
env?: string;
|
|
@@ -23799,6 +24178,7 @@ export declare interface UnstableDevOptions {
|
|
|
23799
24178
|
binding: string;
|
|
23800
24179
|
service: string;
|
|
23801
24180
|
environment?: string | undefined;
|
|
24181
|
+
entrypoint?: string | undefined;
|
|
23802
24182
|
}[];
|
|
23803
24183
|
r2?: {
|
|
23804
24184
|
binding: string;
|
|
@@ -23808,6 +24188,9 @@ export declare interface UnstableDevOptions {
|
|
|
23808
24188
|
ai?: {
|
|
23809
24189
|
binding: string;
|
|
23810
24190
|
};
|
|
24191
|
+
version_metadata?: {
|
|
24192
|
+
binding: string;
|
|
24193
|
+
};
|
|
23811
24194
|
moduleRoot?: string;
|
|
23812
24195
|
rules?: Rule[];
|
|
23813
24196
|
logLevel?: "none" | "info" | "error" | "log" | "warn" | "debug";
|
|
@@ -23828,6 +24211,7 @@ export declare interface UnstableDevOptions {
|
|
|
23828
24211
|
testMode?: boolean;
|
|
23829
24212
|
testScheduled?: boolean;
|
|
23830
24213
|
watch?: boolean;
|
|
24214
|
+
devEnv?: boolean;
|
|
23831
24215
|
};
|
|
23832
24216
|
}
|
|
23833
24217
|
|
|
@@ -23851,7 +24235,7 @@ declare type UrlOriginAndPathnameParts = Pick<URL, "protocol" | "hostname" | "po
|
|
|
23851
24235
|
declare type UrlOriginParts = Pick<URL, "protocol" | "hostname" | "port">;
|
|
23852
24236
|
|
|
23853
24237
|
declare interface UserLimits {
|
|
23854
|
-
/** Maximum allowed CPU time for a
|
|
24238
|
+
/** Maximum allowed CPU time for a Worker's invocation in milliseconds */
|
|
23855
24239
|
cpu_ms: number;
|
|
23856
24240
|
}
|
|
23857
24241
|
|
|
@@ -23922,6 +24306,26 @@ declare interface WebSocketInit {
|
|
|
23922
24306
|
headers?: HeadersInit
|
|
23923
24307
|
}
|
|
23924
24308
|
|
|
24309
|
+
declare type WorkerDefinition = {
|
|
24310
|
+
port: number | undefined;
|
|
24311
|
+
protocol: "http" | "https" | undefined;
|
|
24312
|
+
host: string | undefined;
|
|
24313
|
+
mode: "local" | "remote";
|
|
24314
|
+
headers?: Record<string, string>;
|
|
24315
|
+
entrypointAddresses?: WorkerEntrypointsDefinition;
|
|
24316
|
+
durableObjects: {
|
|
24317
|
+
name: string;
|
|
24318
|
+
className: string;
|
|
24319
|
+
}[];
|
|
24320
|
+
durableObjectsHost?: string;
|
|
24321
|
+
durableObjectsPort?: number;
|
|
24322
|
+
};
|
|
24323
|
+
|
|
24324
|
+
declare type WorkerEntrypointsDefinition = Record<"default" | string, {
|
|
24325
|
+
host: string;
|
|
24326
|
+
port: number;
|
|
24327
|
+
} | undefined>;
|
|
24328
|
+
|
|
23925
24329
|
declare type ZoneIdRoute = {
|
|
23926
24330
|
pattern: string;
|
|
23927
24331
|
zone_id: string;
|