wrangler 0.0.0-e75c5812f → 0.0.0-e771fe990
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 +25 -37
- package/config-schema.json +468 -238
- package/package.json +23 -37
- package/templates/init-tests/test-vitest-new-worker.ts +2 -2
- package/templates/middleware/middleware-mock-analytics-engine.d.ts +3 -0
- package/templates/middleware/middleware-mock-analytics-engine.ts +30 -0
- package/templates/middleware/middleware-patch-console-prefix.d.ts +3 -0
- package/templates/middleware/middleware-patch-console-prefix.ts +21 -0
- package/templates/middleware/middleware-scheduled.ts +15 -1
- package/templates/middleware/middleware-serve-static-assets.ts +2 -2
- package/wrangler-dist/InspectorProxyWorker.js.map +1 -1
- package/wrangler-dist/ProxyWorker.js.map +1 -1
- package/wrangler-dist/cli.d.ts +558 -226
- package/wrangler-dist/cli.js +88814 -120696
- package/templates/no-op-assets-worker.ts +0 -33
- package/wrangler-dist/wasm-sync.wasm +0 -0
package/wrangler-dist/cli.d.ts
CHANGED
|
@@ -16,11 +16,12 @@ import { Miniflare } from 'miniflare';
|
|
|
16
16
|
import type { MiniflareOptions } from 'miniflare';
|
|
17
17
|
import type { ModuleRule } from 'miniflare';
|
|
18
18
|
import { Mutex } from 'miniflare';
|
|
19
|
+
import type { NodeJSCompatMode } from 'miniflare';
|
|
19
20
|
import { Readable } from 'stream';
|
|
20
|
-
import { ReadableStream } from 'stream/web';
|
|
21
|
-
import type { Request as
|
|
22
|
-
import { Response as
|
|
23
|
-
import
|
|
21
|
+
import { ReadableStream as ReadableStream_2 } from 'stream/web';
|
|
22
|
+
import type { Request as Request_3 } from 'miniflare';
|
|
23
|
+
import { Response as Response_3 } from 'miniflare';
|
|
24
|
+
import { Server } from 'http';
|
|
24
25
|
import { ServerResponse } from 'http';
|
|
25
26
|
import { Socket } from 'net';
|
|
26
27
|
import { TcpNetConnectOpts } from 'net';
|
|
@@ -30,6 +31,7 @@ import { UrlObject } from 'url';
|
|
|
30
31
|
import { URLSearchParams as URLSearchParams_2 } from 'url';
|
|
31
32
|
import type { WorkerOptions } from 'miniflare';
|
|
32
33
|
import { Writable } from 'stream';
|
|
34
|
+
import { z } from 'zod';
|
|
33
35
|
|
|
34
36
|
declare type AbortSignal_2 = unknown;
|
|
35
37
|
|
|
@@ -72,6 +74,45 @@ declare type ApiCredentials = {
|
|
|
72
74
|
authEmail: string;
|
|
73
75
|
};
|
|
74
76
|
|
|
77
|
+
declare type AssetConfig = z.infer<typeof AssetConfigSchema>;
|
|
78
|
+
|
|
79
|
+
declare const AssetConfigSchema: z.ZodObject<{
|
|
80
|
+
html_handling: z.ZodOptional<z.ZodEnum<["auto-trailing-slash", "force-trailing-slash", "drop-trailing-slash", "none"]>>;
|
|
81
|
+
not_found_handling: z.ZodOptional<z.ZodEnum<["single-page-application", "404-page", "none"]>>;
|
|
82
|
+
serve_directly: z.ZodOptional<z.ZodBoolean>;
|
|
83
|
+
}, "strip", z.ZodTypeAny, {
|
|
84
|
+
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
85
|
+
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
86
|
+
serve_directly?: boolean;
|
|
87
|
+
}, {
|
|
88
|
+
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
89
|
+
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
90
|
+
serve_directly?: boolean;
|
|
91
|
+
}>;
|
|
92
|
+
|
|
93
|
+
declare type Assets = {
|
|
94
|
+
/** Absolute path to assets directory */
|
|
95
|
+
directory?: string;
|
|
96
|
+
/** Name of `env` binding property in the User Worker. */
|
|
97
|
+
binding?: string;
|
|
98
|
+
/** How to handle HTML requests. */
|
|
99
|
+
html_handling?: "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash" | "none";
|
|
100
|
+
/** How to handle requests that do not match an asset. */
|
|
101
|
+
not_found_handling?: "single-page-application" | "404-page" | "none";
|
|
102
|
+
/**
|
|
103
|
+
* If true, then respond to requests that match an asset with that asset directly.
|
|
104
|
+
* If false, route every request to the User Worker, whether or not it matches an asset.
|
|
105
|
+
* */
|
|
106
|
+
experimental_serve_directly?: boolean;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
declare type AssetsOptions = {
|
|
110
|
+
directory: string;
|
|
111
|
+
binding?: string;
|
|
112
|
+
routingConfig: RoutingConfig;
|
|
113
|
+
assetConfig: AssetConfig;
|
|
114
|
+
};
|
|
115
|
+
|
|
75
116
|
declare type AsyncHook<T extends HookValues, Args extends unknown[] = []> = Hook<T, Args> | Hook<Promise<T>, Args>;
|
|
76
117
|
|
|
77
118
|
declare class BalancedPool extends Dispatcher {
|
|
@@ -109,7 +150,7 @@ declare type Binding = {
|
|
|
109
150
|
type: "kv_namespace";
|
|
110
151
|
} & BindingOmit<CfKvNamespace>) | ({
|
|
111
152
|
type: "send_email";
|
|
112
|
-
} &
|
|
153
|
+
} & NameOmit<CfSendEmailBindings>) | {
|
|
113
154
|
type: "wasm_module";
|
|
114
155
|
source: BinaryFile;
|
|
115
156
|
} | {
|
|
@@ -126,7 +167,9 @@ declare type Binding = {
|
|
|
126
167
|
source: BinaryFile;
|
|
127
168
|
} | ({
|
|
128
169
|
type: "durable_object_namespace";
|
|
129
|
-
} &
|
|
170
|
+
} & NameOmit<CfDurableObject>) | ({
|
|
171
|
+
type: "workflow";
|
|
172
|
+
} & BindingOmit<CfWorkflow>) | ({
|
|
130
173
|
type: "queue";
|
|
131
174
|
} & BindingOmit<CfQueue>) | ({
|
|
132
175
|
type: "r2_bucket";
|
|
@@ -148,14 +191,16 @@ declare type Binding = {
|
|
|
148
191
|
} & Omit<CfDispatchNamespace, "binding">) | ({
|
|
149
192
|
type: "mtls_certificate";
|
|
150
193
|
} & Omit<CfMTlsCertificate, "binding">) | ({
|
|
194
|
+
type: "pipeline";
|
|
195
|
+
} & Omit<CfPipeline, "binding">) | ({
|
|
151
196
|
type: "logfwdr";
|
|
152
|
-
} &
|
|
197
|
+
} & NameOmit<CfLogfwdrBinding>) | {
|
|
153
198
|
type: `unsafe_${string}`;
|
|
154
199
|
} | {
|
|
155
200
|
type: "assets";
|
|
156
201
|
};
|
|
157
202
|
|
|
158
|
-
declare type BindingOmit<T> = Omit<T, "binding"
|
|
203
|
+
declare type BindingOmit<T> = Omit<T, "binding">;
|
|
159
204
|
|
|
160
205
|
/**
|
|
161
206
|
* Result of the `getBindingsProxy` utility
|
|
@@ -176,7 +221,7 @@ declare type BodyInit =
|
|
|
176
221
|
| ArrayBuffer
|
|
177
222
|
| AsyncIterable<Uint8Array>
|
|
178
223
|
| Blob_2
|
|
179
|
-
|
|
|
224
|
+
| FormData_2
|
|
180
225
|
| Iterable<Uint8Array>
|
|
181
226
|
| NodeJS.ArrayBufferView
|
|
182
227
|
| URLSearchParams_2
|
|
@@ -184,12 +229,12 @@ declare type BodyInit =
|
|
|
184
229
|
| string
|
|
185
230
|
|
|
186
231
|
declare interface BodyMixin {
|
|
187
|
-
readonly body:
|
|
232
|
+
readonly body: ReadableStream_2 | null
|
|
188
233
|
readonly bodyUsed: boolean
|
|
189
234
|
|
|
190
235
|
readonly arrayBuffer: () => Promise<ArrayBuffer>
|
|
191
236
|
readonly blob: () => Promise<Blob_2>
|
|
192
|
-
readonly formData: () => Promise<
|
|
237
|
+
readonly formData: () => Promise<FormData_2>
|
|
193
238
|
readonly json: () => Promise<unknown>
|
|
194
239
|
readonly text: () => Promise<string>
|
|
195
240
|
}
|
|
@@ -309,13 +354,13 @@ declare type BundleStartEvent = {
|
|
|
309
354
|
};
|
|
310
355
|
|
|
311
356
|
declare interface Cache {
|
|
312
|
-
match (request: RequestInfo, options?: CacheQueryOptions): Promise<
|
|
313
|
-
matchAll (request?: RequestInfo, options?: CacheQueryOptions): Promise<readonly
|
|
357
|
+
match (request: RequestInfo, options?: CacheQueryOptions): Promise<Response_2 | undefined>,
|
|
358
|
+
matchAll (request?: RequestInfo, options?: CacheQueryOptions): Promise<readonly Response_2[]>,
|
|
314
359
|
add (request: RequestInfo): Promise<undefined>,
|
|
315
360
|
addAll (requests: RequestInfo[]): Promise<undefined>,
|
|
316
|
-
put (request: RequestInfo, response:
|
|
361
|
+
put (request: RequestInfo, response: Response_2): Promise<undefined>,
|
|
317
362
|
delete (request: RequestInfo, options?: CacheQueryOptions): Promise<boolean>,
|
|
318
|
-
keys (request?: RequestInfo, options?: CacheQueryOptions): Promise<readonly
|
|
363
|
+
keys (request?: RequestInfo, options?: CacheQueryOptions): Promise<readonly Request_2[]>
|
|
319
364
|
}
|
|
320
365
|
|
|
321
366
|
/**
|
|
@@ -344,7 +389,7 @@ declare type CacheResponse = any;
|
|
|
344
389
|
declare const caches: CacheStorage;
|
|
345
390
|
|
|
346
391
|
declare interface CacheStorage {
|
|
347
|
-
match (request: RequestInfo, options?: MultiCacheQueryOptions): Promise<
|
|
392
|
+
match (request: RequestInfo, options?: MultiCacheQueryOptions): Promise<Response_2 | undefined>,
|
|
348
393
|
has (cacheName: string): Promise<boolean>,
|
|
349
394
|
open (cacheName: string): Promise<Cache>,
|
|
350
395
|
delete (cacheName: string): Promise<boolean>,
|
|
@@ -417,8 +462,8 @@ declare type CfCapnp = {
|
|
|
417
462
|
|
|
418
463
|
declare interface CfD1Database {
|
|
419
464
|
binding: string;
|
|
420
|
-
database_id
|
|
421
|
-
database_name
|
|
465
|
+
database_id?: string | typeof INHERIT_SYMBOL;
|
|
466
|
+
database_name?: string;
|
|
422
467
|
preview_database_id?: string;
|
|
423
468
|
database_internal_env?: string;
|
|
424
469
|
migrations_table?: string;
|
|
@@ -456,7 +501,7 @@ declare interface CfHyperdrive {
|
|
|
456
501
|
*/
|
|
457
502
|
declare interface CfKvNamespace {
|
|
458
503
|
binding: string;
|
|
459
|
-
id
|
|
504
|
+
id?: string | typeof INHERIT_SYMBOL;
|
|
460
505
|
}
|
|
461
506
|
|
|
462
507
|
declare interface CfLogfwdrBinding {
|
|
@@ -519,6 +564,11 @@ declare interface CfMTlsCertificate {
|
|
|
519
564
|
certificate_id: string;
|
|
520
565
|
}
|
|
521
566
|
|
|
567
|
+
declare interface CfPipeline {
|
|
568
|
+
binding: string;
|
|
569
|
+
pipeline: string;
|
|
570
|
+
}
|
|
571
|
+
|
|
522
572
|
declare interface CfQueue {
|
|
523
573
|
binding: string;
|
|
524
574
|
queue_name: string;
|
|
@@ -527,7 +577,7 @@ declare interface CfQueue {
|
|
|
527
577
|
|
|
528
578
|
declare interface CfR2Bucket {
|
|
529
579
|
binding: string;
|
|
530
|
-
bucket_name
|
|
580
|
+
bucket_name?: string | typeof INHERIT_SYMBOL;
|
|
531
581
|
jurisdiction?: string;
|
|
532
582
|
}
|
|
533
583
|
|
|
@@ -596,6 +646,13 @@ declare interface CfWorkerSourceMap {
|
|
|
596
646
|
content: string | Buffer;
|
|
597
647
|
}
|
|
598
648
|
|
|
649
|
+
declare interface CfWorkflow {
|
|
650
|
+
name: string;
|
|
651
|
+
class_name: string;
|
|
652
|
+
binding: string;
|
|
653
|
+
script_name?: string;
|
|
654
|
+
}
|
|
655
|
+
|
|
599
656
|
/**
|
|
600
657
|
* A basic HTTP/1.1 client, mapped on top a single TCP/TLS connection. Pipelining is disabled by default.
|
|
601
658
|
*/
|
|
@@ -715,34 +772,25 @@ declare type CloudchamberConfig = {
|
|
|
715
772
|
ipv4?: boolean;
|
|
716
773
|
};
|
|
717
774
|
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
* - Fields that are specified in `PagesConfigFields` are only relevant for Pages projects
|
|
732
|
-
* - All top level fields in config and environments are optional in the wrangler.toml file.
|
|
733
|
-
*
|
|
734
|
-
* Legend for the annotations:
|
|
735
|
-
*
|
|
736
|
-
* - `@breaking`: the deprecation/optionality is a breaking change from Wrangler v1.
|
|
737
|
-
* - `@todo`: there's more work to be done (with details attached).
|
|
738
|
-
*/
|
|
739
|
-
declare type Config = ConfigFields<DevConfig> & PagesConfigFields & Environment;
|
|
775
|
+
declare interface ComputedFields {
|
|
776
|
+
/** The path to the Wrangler configuration file (if any, and possibly redirected from the user Wrangler configuration) used to create this configuration. */
|
|
777
|
+
configPath: string | undefined;
|
|
778
|
+
/** The path to the user's Wrangler configuration file (if any), which may have been redirected to another file that used to create this configuration. */
|
|
779
|
+
userConfigPath: string | undefined;
|
|
780
|
+
/**
|
|
781
|
+
* The original top level name for the Worker in the raw configuration.
|
|
782
|
+
*
|
|
783
|
+
* When a raw configuration has been flattened to a single environment the worker name may have been replaced or transformed.
|
|
784
|
+
* It can be useful to know what the top-level name was before the flattening.
|
|
785
|
+
*/
|
|
786
|
+
topLevelName: string | undefined;
|
|
787
|
+
}
|
|
740
788
|
|
|
741
789
|
declare class ConfigController extends Controller<ConfigControllerEventMap> {
|
|
742
790
|
#private;
|
|
743
791
|
latestInput?: StartDevWorkerInput;
|
|
744
792
|
latestConfig?: StartDevWorkerOptions;
|
|
745
|
-
set(input: StartDevWorkerInput): Promise<StartDevWorkerOptions | undefined>;
|
|
793
|
+
set(input: StartDevWorkerInput, throwErrors?: boolean): Promise<StartDevWorkerOptions | undefined>;
|
|
746
794
|
patch(input: Partial<StartDevWorkerInput>): Promise<StartDevWorkerOptions | undefined>;
|
|
747
795
|
teardown(): Promise<void>;
|
|
748
796
|
emitConfigUpdateEvent(config: StartDevWorkerOptions): void;
|
|
@@ -753,7 +801,6 @@ declare type ConfigControllerEventMap = ControllerEventMap & {
|
|
|
753
801
|
};
|
|
754
802
|
|
|
755
803
|
declare interface ConfigFields<Dev extends RawDevConfig> {
|
|
756
|
-
configPath: string | undefined;
|
|
757
804
|
/**
|
|
758
805
|
* A boolean to enable "legacy" style wrangler environments (from Wrangler v1).
|
|
759
806
|
* These have been superseded by Services, but there may be projects that won't
|
|
@@ -782,7 +829,7 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
|
|
|
782
829
|
/**
|
|
783
830
|
* The directory containing your static assets.
|
|
784
831
|
*
|
|
785
|
-
* It must be a path relative to your
|
|
832
|
+
* It must be a path relative to your Wrangler configuration file.
|
|
786
833
|
* Example: bucket = "./public"
|
|
787
834
|
*
|
|
788
835
|
* If there is a `site` field then it must contain this `bucket` field.
|
|
@@ -815,9 +862,11 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
|
|
|
815
862
|
exclude?: string[];
|
|
816
863
|
} | undefined;
|
|
817
864
|
/**
|
|
818
|
-
*
|
|
819
|
-
*
|
|
820
|
-
*
|
|
865
|
+
* Old behaviour of serving a folder of static assets with your Worker,
|
|
866
|
+
* without any additional code.
|
|
867
|
+
* This can either be a string, or an object with additional config
|
|
868
|
+
* fields.
|
|
869
|
+
* Will be deprecated in the near future in favor of `assets`.
|
|
821
870
|
*/
|
|
822
871
|
legacy_assets: {
|
|
823
872
|
bucket: string;
|
|
@@ -858,7 +907,7 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
|
|
|
858
907
|
[key: string]: string;
|
|
859
908
|
} | undefined;
|
|
860
909
|
/**
|
|
861
|
-
* By default,
|
|
910
|
+
* By default, the Wrangler configuration file is the source of truth for your environment configuration, like a terraform file.
|
|
862
911
|
*
|
|
863
912
|
* If you change your vars in the dashboard, wrangler *will* override/delete them on its next deploy.
|
|
864
913
|
*
|
|
@@ -886,6 +935,32 @@ url: string | URL_2 | UrlObject,
|
|
|
886
935
|
options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.ConnectOptions, 'origin' | 'path'>
|
|
887
936
|
): Promise<Dispatcher.ConnectData>;
|
|
888
937
|
|
|
938
|
+
/**
|
|
939
|
+
* Configuration for a container application
|
|
940
|
+
*/
|
|
941
|
+
declare type ContainerApp = {
|
|
942
|
+
name: string;
|
|
943
|
+
instances: number;
|
|
944
|
+
scheduling_policy?: "regional" | "moon";
|
|
945
|
+
configuration: {
|
|
946
|
+
image: string;
|
|
947
|
+
labels?: {
|
|
948
|
+
name: string;
|
|
949
|
+
value: string;
|
|
950
|
+
}[];
|
|
951
|
+
secrets?: {
|
|
952
|
+
name: string;
|
|
953
|
+
type: "env";
|
|
954
|
+
secret: string;
|
|
955
|
+
}[];
|
|
956
|
+
};
|
|
957
|
+
constraints?: {
|
|
958
|
+
regions?: string[];
|
|
959
|
+
cities?: string[];
|
|
960
|
+
tier?: number;
|
|
961
|
+
};
|
|
962
|
+
};
|
|
963
|
+
|
|
889
964
|
declare abstract class Controller<EventMap extends ControllerEventMap = ControllerEventMap> extends TypedEventEmitterImpl<EventMap> {
|
|
890
965
|
emitErrorEvent(data: ErrorEvent): void;
|
|
891
966
|
}
|
|
@@ -925,7 +1000,7 @@ declare type DeferredPromise<T> = {
|
|
|
925
1000
|
};
|
|
926
1001
|
|
|
927
1002
|
declare function deleteCookie (
|
|
928
|
-
headers:
|
|
1003
|
+
headers: Headers_2,
|
|
929
1004
|
name: string,
|
|
930
1005
|
attributes?: { name?: string, domain?: string }
|
|
931
1006
|
): void
|
|
@@ -960,14 +1035,14 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
|
|
|
960
1035
|
type: string;
|
|
961
1036
|
};
|
|
962
1037
|
latest_stage: {
|
|
963
|
-
|
|
964
|
-
|
|
1038
|
+
status: "canceled" | "active" | "idle" | "success" | "failure" | "skipped";
|
|
1039
|
+
name: "queued" | "build" | "deploy" | "initialize" | "clone_repo";
|
|
965
1040
|
started_on: string | null;
|
|
966
1041
|
ended_on: string | null;
|
|
967
1042
|
};
|
|
968
1043
|
stages: {
|
|
969
|
-
|
|
970
|
-
|
|
1044
|
+
status: "canceled" | "active" | "idle" | "success" | "failure" | "skipped";
|
|
1045
|
+
name: "queued" | "build" | "deploy" | "initialize" | "clone_repo";
|
|
971
1046
|
started_on: string | null;
|
|
972
1047
|
ended_on: string | null;
|
|
973
1048
|
}[];
|
|
@@ -977,7 +1052,6 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
|
|
|
977
1052
|
build_image_major_version: number;
|
|
978
1053
|
kv_namespaces?: any;
|
|
979
1054
|
source?: {
|
|
980
|
-
type: "github" | "gitlab";
|
|
981
1055
|
config: {
|
|
982
1056
|
owner: string;
|
|
983
1057
|
repo_name: string;
|
|
@@ -985,10 +1059,11 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
|
|
|
985
1059
|
pr_comments_enabled?: boolean | undefined;
|
|
986
1060
|
deployments_enabled?: boolean | undefined;
|
|
987
1061
|
production_deployments_enabled?: boolean | undefined;
|
|
988
|
-
preview_deployment_setting?: "none" | "
|
|
1062
|
+
preview_deployment_setting?: "none" | "custom" | "all" | undefined;
|
|
989
1063
|
preview_branch_includes?: string[] | undefined;
|
|
990
1064
|
preview_branch_excludes?: string[] | undefined;
|
|
991
1065
|
};
|
|
1066
|
+
type: "github" | "gitlab";
|
|
992
1067
|
} | undefined;
|
|
993
1068
|
env_vars?: any;
|
|
994
1069
|
durable_object_namespaces?: any;
|
|
@@ -998,6 +1073,30 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
|
|
|
998
1073
|
} | undefined;
|
|
999
1074
|
}>;
|
|
1000
1075
|
|
|
1076
|
+
declare interface DeprecatedConfigFields {
|
|
1077
|
+
/**
|
|
1078
|
+
* The project "type". A holdover from Wrangler v1.x.
|
|
1079
|
+
* Valid values were "webpack", "javascript", and "rust".
|
|
1080
|
+
*
|
|
1081
|
+
* @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.
|
|
1082
|
+
* @breaking
|
|
1083
|
+
*/
|
|
1084
|
+
type?: "webpack" | "javascript" | "rust";
|
|
1085
|
+
/**
|
|
1086
|
+
* Path to the webpack config to use when building your worker.
|
|
1087
|
+
* A holdover from Wrangler v1.x, used with `type: "webpack"`.
|
|
1088
|
+
*
|
|
1089
|
+
* @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.
|
|
1090
|
+
* @breaking
|
|
1091
|
+
*/
|
|
1092
|
+
webpack_config?: string;
|
|
1093
|
+
/**
|
|
1094
|
+
* Configuration only used by a standalone use of the miniflare binary.
|
|
1095
|
+
* @deprecated
|
|
1096
|
+
*/
|
|
1097
|
+
miniflare?: unknown;
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1001
1100
|
/**
|
|
1002
1101
|
* Deprecated upload configuration.
|
|
1003
1102
|
*/
|
|
@@ -1010,9 +1109,9 @@ declare interface DeprecatedUpload {
|
|
|
1010
1109
|
format?: "modules" | "service-worker";
|
|
1011
1110
|
/**
|
|
1012
1111
|
* The directory you wish to upload your Worker from,
|
|
1013
|
-
* relative to the
|
|
1112
|
+
* relative to the Wrangler configuration file.
|
|
1014
1113
|
*
|
|
1015
|
-
* Defaults to the directory containing the
|
|
1114
|
+
* Defaults to the directory containing the Wrangler configuration file.
|
|
1016
1115
|
*
|
|
1017
1116
|
* @deprecated
|
|
1018
1117
|
*/
|
|
@@ -1224,7 +1323,7 @@ declare namespace Dispatcher {
|
|
|
1224
1323
|
path: string;
|
|
1225
1324
|
method: HttpMethod;
|
|
1226
1325
|
/** Default: `null` */
|
|
1227
|
-
body?: string | Buffer | Uint8Array | Readable | null |
|
|
1326
|
+
body?: string | Buffer | Uint8Array | Readable | null | FormData_2;
|
|
1228
1327
|
/** Default: `null` */
|
|
1229
1328
|
headers?: IncomingHttpHeaders | string[] | null;
|
|
1230
1329
|
/** Query string params to be embedded in the request URL. Default: `null` */
|
|
@@ -1375,7 +1474,7 @@ declare interface DispatchNamespaceOutbound {
|
|
|
1375
1474
|
parameters?: string[];
|
|
1376
1475
|
}
|
|
1377
1476
|
|
|
1378
|
-
declare type
|
|
1477
|
+
declare type DOMException_2 = typeof globalThis extends { DOMException: infer T }
|
|
1379
1478
|
? T
|
|
1380
1479
|
: any
|
|
1381
1480
|
|
|
@@ -1390,6 +1489,25 @@ declare type DurableObjectBindings = {
|
|
|
1390
1489
|
environment?: string;
|
|
1391
1490
|
}[];
|
|
1392
1491
|
|
|
1492
|
+
/**
|
|
1493
|
+
* Configuration in wrangler for Durable Object Migrations
|
|
1494
|
+
*/
|
|
1495
|
+
declare type DurableObjectMigration = {
|
|
1496
|
+
/** A unique identifier for this migration. */
|
|
1497
|
+
tag: string;
|
|
1498
|
+
/** The new Durable Objects being defined. */
|
|
1499
|
+
new_classes?: string[];
|
|
1500
|
+
/** The new SQLite Durable Objects being defined. */
|
|
1501
|
+
new_sqlite_classes?: string[];
|
|
1502
|
+
/** The Durable Objects being renamed. */
|
|
1503
|
+
renamed_classes?: {
|
|
1504
|
+
from: string;
|
|
1505
|
+
to: string;
|
|
1506
|
+
}[];
|
|
1507
|
+
/** The Durable Objects being removed. */
|
|
1508
|
+
deleted_classes?: string[];
|
|
1509
|
+
};
|
|
1510
|
+
|
|
1393
1511
|
declare interface EnablePagesAssetsServiceBindingOptions {
|
|
1394
1512
|
proxyPort?: number;
|
|
1395
1513
|
directory?: string;
|
|
@@ -1403,18 +1521,18 @@ declare interface EnablePagesAssetsServiceBindingOptions {
|
|
|
1403
1521
|
declare type Entry = {
|
|
1404
1522
|
/** A worker's entrypoint */
|
|
1405
1523
|
file: string;
|
|
1406
|
-
/** A worker's directory. Usually where the
|
|
1407
|
-
|
|
1524
|
+
/** A worker's directory. Usually where the Wrangler configuration file is located */
|
|
1525
|
+
projectRoot: string;
|
|
1408
1526
|
/** Is this a module worker or a service worker? */
|
|
1409
1527
|
format: CfScriptFormat;
|
|
1410
1528
|
/** The directory that contains all of a `--no-bundle` worker's modules. Usually `${directory}/src`. Defaults to path.dirname(file) */
|
|
1411
1529
|
moduleRoot: string;
|
|
1412
|
-
/** Whether this is a no-op worker that will not ultimately be uploaded e.g. for assets*/
|
|
1413
|
-
staticAssetsOnly?: boolean;
|
|
1414
1530
|
/**
|
|
1415
1531
|
* A worker's name
|
|
1416
1532
|
*/
|
|
1417
1533
|
name?: string | undefined;
|
|
1534
|
+
/** Export from a Worker's entrypoint */
|
|
1535
|
+
exports: string[];
|
|
1418
1536
|
};
|
|
1419
1537
|
|
|
1420
1538
|
/**
|
|
@@ -1426,6 +1544,39 @@ declare type Entry = {
|
|
|
1426
1544
|
declare interface Environment extends EnvironmentInheritable, EnvironmentNonInheritable {
|
|
1427
1545
|
}
|
|
1428
1546
|
|
|
1547
|
+
/**
|
|
1548
|
+
* The environment configuration properties that have been deprecated.
|
|
1549
|
+
*/
|
|
1550
|
+
declare interface EnvironmentDeprecated {
|
|
1551
|
+
/**
|
|
1552
|
+
* The zone ID of the zone you want to deploy to. You can find this
|
|
1553
|
+
* in your domain page on the dashboard.
|
|
1554
|
+
*
|
|
1555
|
+
* @deprecated This is unnecessary since we can deduce this from routes directly.
|
|
1556
|
+
*/
|
|
1557
|
+
zone_id?: string;
|
|
1558
|
+
/**
|
|
1559
|
+
* Legacy way of defining KVNamespaces that is no longer supported.
|
|
1560
|
+
*
|
|
1561
|
+
* @deprecated DO NOT USE. This was a legacy bug from Wrangler v1, that we do not want to support.
|
|
1562
|
+
*/
|
|
1563
|
+
"kv-namespaces"?: string;
|
|
1564
|
+
/**
|
|
1565
|
+
* A list of services that your Worker should be bound to.
|
|
1566
|
+
*
|
|
1567
|
+
* @default `[]`
|
|
1568
|
+
* @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.
|
|
1569
|
+
*/
|
|
1570
|
+
experimental_services?: {
|
|
1571
|
+
/** The binding name used to refer to the Service */
|
|
1572
|
+
name: string;
|
|
1573
|
+
/** The name of the Service being bound */
|
|
1574
|
+
service: string;
|
|
1575
|
+
/** The Service's environment */
|
|
1576
|
+
environment: string;
|
|
1577
|
+
}[];
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1429
1580
|
/**
|
|
1430
1581
|
* The `EnvironmentInheritable` interface declares all the configuration fields for an environment
|
|
1431
1582
|
* that can be inherited (and overridden) from the top-level environment.
|
|
@@ -1501,11 +1652,20 @@ declare interface EnvironmentInheritable {
|
|
|
1501
1652
|
* test and deploy your Worker.
|
|
1502
1653
|
*
|
|
1503
1654
|
* // Carmen according to our tests the default is undefined
|
|
1655
|
+
* // warning: you must force "workers_dev: true" in tests to match expected behavior
|
|
1504
1656
|
* @default `true` (This is a breaking change from Wrangler v1)
|
|
1505
1657
|
* @breaking
|
|
1506
1658
|
* @inheritable
|
|
1507
1659
|
*/
|
|
1508
1660
|
workers_dev: boolean | undefined;
|
|
1661
|
+
/**
|
|
1662
|
+
* Whether we use <version>-<name>.<subdomain>.workers.dev to
|
|
1663
|
+
* serve Preview URLs for your Worker.
|
|
1664
|
+
*
|
|
1665
|
+
* @default `true`
|
|
1666
|
+
* @inheritable
|
|
1667
|
+
*/
|
|
1668
|
+
preview_urls: boolean | undefined;
|
|
1509
1669
|
/**
|
|
1510
1670
|
* A list of routes that your Worker should be published to.
|
|
1511
1671
|
* Only one of `routes` or `route` is required.
|
|
@@ -1555,19 +1715,7 @@ declare interface EnvironmentInheritable {
|
|
|
1555
1715
|
* @default []
|
|
1556
1716
|
* @inheritable
|
|
1557
1717
|
*/
|
|
1558
|
-
migrations:
|
|
1559
|
-
/** A unique identifier for this migration. */
|
|
1560
|
-
tag: string;
|
|
1561
|
-
/** The new Durable Objects being defined. */
|
|
1562
|
-
new_classes?: string[];
|
|
1563
|
-
/** The Durable Objects being renamed. */
|
|
1564
|
-
renamed_classes?: {
|
|
1565
|
-
from: string;
|
|
1566
|
-
to: string;
|
|
1567
|
-
}[];
|
|
1568
|
-
/** The Durable Objects being removed. */
|
|
1569
|
-
deleted_classes?: string[];
|
|
1570
|
-
}[];
|
|
1718
|
+
migrations: DurableObjectMigration[];
|
|
1571
1719
|
/**
|
|
1572
1720
|
* "Cron" definitions to trigger a Worker's "scheduled" function.
|
|
1573
1721
|
*
|
|
@@ -1697,13 +1845,40 @@ declare interface EnvironmentInheritable {
|
|
|
1697
1845
|
*/
|
|
1698
1846
|
placement: {
|
|
1699
1847
|
mode: "off" | "smart";
|
|
1848
|
+
hint?: string;
|
|
1700
1849
|
} | undefined;
|
|
1701
1850
|
/**
|
|
1702
1851
|
* Specify the directory of static assets to deploy/serve
|
|
1703
1852
|
*
|
|
1853
|
+
* More details at https://developers.cloudflare.com/workers/frameworks/
|
|
1854
|
+
*
|
|
1704
1855
|
* @inheritable
|
|
1705
1856
|
*/
|
|
1706
|
-
|
|
1857
|
+
assets: Assets | undefined;
|
|
1858
|
+
/**
|
|
1859
|
+
* Specify the observability behavior of the Worker.
|
|
1860
|
+
*
|
|
1861
|
+
* @inheritable
|
|
1862
|
+
*/
|
|
1863
|
+
observability: Observability | undefined;
|
|
1864
|
+
}
|
|
1865
|
+
|
|
1866
|
+
declare interface EnvironmentMap {
|
|
1867
|
+
/**
|
|
1868
|
+
* The `env` section defines overrides for the configuration for different environments.
|
|
1869
|
+
*
|
|
1870
|
+
* All environment fields can be specified at the top level of the config indicating the default environment settings.
|
|
1871
|
+
*
|
|
1872
|
+
* - Some fields are inherited and overridable in each environment.
|
|
1873
|
+
* - But some are not inherited and must be explicitly specified in every environment, if they are specified at the top level.
|
|
1874
|
+
*
|
|
1875
|
+
* For more information, see the documentation at https://developers.cloudflare.com/workers/cli-wrangler/configuration#environments
|
|
1876
|
+
*
|
|
1877
|
+
* @default {}
|
|
1878
|
+
*/
|
|
1879
|
+
env?: {
|
|
1880
|
+
[envName: string]: Unstable_RawEnvironment;
|
|
1881
|
+
};
|
|
1707
1882
|
}
|
|
1708
1883
|
|
|
1709
1884
|
/**
|
|
@@ -1749,6 +1924,16 @@ declare interface EnvironmentNonInheritable {
|
|
|
1749
1924
|
durable_objects: {
|
|
1750
1925
|
bindings: DurableObjectBindings;
|
|
1751
1926
|
};
|
|
1927
|
+
/**
|
|
1928
|
+
* A list of workflows that your Worker should be bound to.
|
|
1929
|
+
*
|
|
1930
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1931
|
+
* and so must be specified in every named environment.
|
|
1932
|
+
*
|
|
1933
|
+
* @default `[]`
|
|
1934
|
+
* @nonInheritable
|
|
1935
|
+
*/
|
|
1936
|
+
workflows: WorkflowBinding[];
|
|
1752
1937
|
/**
|
|
1753
1938
|
* Cloudchamber configuration
|
|
1754
1939
|
*
|
|
@@ -1759,6 +1944,21 @@ declare interface EnvironmentNonInheritable {
|
|
|
1759
1944
|
* @nonInheritable
|
|
1760
1945
|
*/
|
|
1761
1946
|
cloudchamber: CloudchamberConfig;
|
|
1947
|
+
/**
|
|
1948
|
+
* Container related configuration
|
|
1949
|
+
*/
|
|
1950
|
+
containers: {
|
|
1951
|
+
/**
|
|
1952
|
+
* Container app configuration
|
|
1953
|
+
*
|
|
1954
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1955
|
+
* and so must be specified in every named environment.
|
|
1956
|
+
*
|
|
1957
|
+
* @default `{}`
|
|
1958
|
+
* @nonInheritable
|
|
1959
|
+
*/
|
|
1960
|
+
app: ContainerApp[];
|
|
1961
|
+
};
|
|
1762
1962
|
/**
|
|
1763
1963
|
* These specify any Workers KV Namespaces you want to
|
|
1764
1964
|
* access from inside your Worker.
|
|
@@ -1776,7 +1976,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1776
1976
|
/** The binding name used to refer to the KV Namespace */
|
|
1777
1977
|
binding: string;
|
|
1778
1978
|
/** The ID of the KV namespace */
|
|
1779
|
-
id
|
|
1979
|
+
id?: string;
|
|
1780
1980
|
/** The ID of the KV namespace used during `wrangler dev` */
|
|
1781
1981
|
preview_id?: string;
|
|
1782
1982
|
}[];
|
|
@@ -1851,7 +2051,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1851
2051
|
/** The binding name used to refer to the R2 bucket in the Worker. */
|
|
1852
2052
|
binding: string;
|
|
1853
2053
|
/** The name of this R2 bucket at the edge. */
|
|
1854
|
-
bucket_name
|
|
2054
|
+
bucket_name?: string;
|
|
1855
2055
|
/** The preview name of this R2 bucket at the edge. */
|
|
1856
2056
|
preview_bucket_name?: string;
|
|
1857
2057
|
/** The jurisdiction that the bucket exists in. Default if not present. */
|
|
@@ -1870,9 +2070,9 @@ declare interface EnvironmentNonInheritable {
|
|
|
1870
2070
|
/** The binding name used to refer to the D1 database in the Worker. */
|
|
1871
2071
|
binding: string;
|
|
1872
2072
|
/** The name of this D1 database. */
|
|
1873
|
-
database_name
|
|
2073
|
+
database_name?: string;
|
|
1874
2074
|
/** The UUID of this D1 database (not required). */
|
|
1875
|
-
database_id
|
|
2075
|
+
database_id?: string;
|
|
1876
2076
|
/** The UUID of this D1 database for Wrangler Dev (if specified). */
|
|
1877
2077
|
preview_database_id?: string;
|
|
1878
2078
|
/** The name of the migrations table for this D1 database (defaults to 'd1_migrations'). */
|
|
@@ -2061,9 +2261,24 @@ declare interface EnvironmentNonInheritable {
|
|
|
2061
2261
|
/** Details about the outbound Worker which will handle outbound requests from your namespace */
|
|
2062
2262
|
outbound?: DispatchNamespaceOutbound;
|
|
2063
2263
|
}[];
|
|
2264
|
+
/**
|
|
2265
|
+
* Specifies list of Pipelines bound to this Worker environment
|
|
2266
|
+
*
|
|
2267
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2268
|
+
* and so must be specified in every named environment.
|
|
2269
|
+
*
|
|
2270
|
+
* @default `[]`
|
|
2271
|
+
* @nonInheritable
|
|
2272
|
+
*/
|
|
2273
|
+
pipelines: {
|
|
2274
|
+
/** The binding name used to refer to the bound service. */
|
|
2275
|
+
binding: string;
|
|
2276
|
+
/** Name of the Pipeline to bind */
|
|
2277
|
+
pipeline: string;
|
|
2278
|
+
}[];
|
|
2064
2279
|
}
|
|
2065
2280
|
|
|
2066
|
-
declare type ErrorEvent = BaseErrorEvent<"ConfigController" | "BundlerController" | "LocalRuntimeController" | "RemoteRuntimeController" | "ProxyWorker" | "InspectorProxyWorker"> | BaseErrorEvent<"ProxyController", {
|
|
2281
|
+
declare type ErrorEvent = BaseErrorEvent<"ConfigController" | "BundlerController" | "LocalRuntimeController" | "RemoteRuntimeController" | "ProxyWorker" | "InspectorProxyWorker" | "MultiworkerRuntimeController"> | BaseErrorEvent<"ProxyController", {
|
|
2067
2282
|
config?: StartDevWorkerOptions;
|
|
2068
2283
|
bundle?: Bundle;
|
|
2069
2284
|
}> | BaseErrorEvent<"BundlerController", {
|
|
@@ -2272,16 +2487,18 @@ declare class ExecutionContext {
|
|
|
2272
2487
|
passThroughOnException(): void;
|
|
2273
2488
|
}
|
|
2274
2489
|
|
|
2275
|
-
declare
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2490
|
+
export declare const experimental_patchConfig: (configPath: string, patch: Unstable_RawConfig, isArrayInsertion?: boolean) => string;
|
|
2491
|
+
|
|
2492
|
+
export declare const experimental_readRawConfig: (args: ReadConfigCommandArgs, options?: ReadConfigOptions) => {
|
|
2493
|
+
rawConfig: Unstable_RawConfig;
|
|
2494
|
+
configPath: string | undefined;
|
|
2495
|
+
userConfigPath: string | undefined;
|
|
2279
2496
|
};
|
|
2280
2497
|
|
|
2281
|
-
declare function
|
|
2498
|
+
declare function fetch_2 (
|
|
2282
2499
|
input: RequestInfo,
|
|
2283
|
-
init?:
|
|
2284
|
-
): Promise<
|
|
2500
|
+
init?: RequestInit_2
|
|
2501
|
+
): Promise<Response_2>
|
|
2285
2502
|
|
|
2286
2503
|
declare class File extends Blob_2 {
|
|
2287
2504
|
/**
|
|
@@ -2344,7 +2561,7 @@ declare class FileReader {
|
|
|
2344
2561
|
|
|
2345
2562
|
readonly result: string | ArrayBuffer | null
|
|
2346
2563
|
|
|
2347
|
-
readonly error:
|
|
2564
|
+
readonly error: DOMException_2 | null
|
|
2348
2565
|
|
|
2349
2566
|
onloadstart: null | ((this: FileReader, event: ProgressEvent) => void)
|
|
2350
2567
|
onprogress: null | ((this: FileReader, event: ProgressEvent) => void)
|
|
@@ -2357,7 +2574,7 @@ declare class FileReader {
|
|
|
2357
2574
|
/**
|
|
2358
2575
|
* 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().
|
|
2359
2576
|
*/
|
|
2360
|
-
declare class
|
|
2577
|
+
declare class FormData_2 {
|
|
2361
2578
|
/**
|
|
2362
2579
|
* Appends a new value onto an existing key inside a FormData object,
|
|
2363
2580
|
* or adds the key if it does not already exist.
|
|
@@ -2422,7 +2639,7 @@ declare class FormData {
|
|
|
2422
2639
|
* Executes given callback function for each field of the FormData instance
|
|
2423
2640
|
*/
|
|
2424
2641
|
forEach: (
|
|
2425
|
-
callbackfn: (value: FormDataEntryValue, key: string, iterable:
|
|
2642
|
+
callbackfn: (value: FormDataEntryValue, key: string, iterable: FormData_2) => void,
|
|
2426
2643
|
thisArg?: unknown
|
|
2427
2644
|
) => void
|
|
2428
2645
|
|
|
@@ -2458,7 +2675,7 @@ declare class FormData {
|
|
|
2458
2675
|
declare type FormDataEntryValue = string | File
|
|
2459
2676
|
|
|
2460
2677
|
/**
|
|
2461
|
-
* By reading from a
|
|
2678
|
+
* By reading from a Wrangler configuration file this function generates proxy binding objects that can be
|
|
2462
2679
|
* used to simulate the interaction with bindings during local development in a Node.js environment
|
|
2463
2680
|
*
|
|
2464
2681
|
* @deprecated use `getPlatformProxy` instead
|
|
@@ -2471,14 +2688,14 @@ export declare function getBindingsProxy<Bindings = Record<string, unknown>, CfP
|
|
|
2471
2688
|
/** Options for the `getBindingsProxy` utility */
|
|
2472
2689
|
export declare type GetBindingsProxyOptions = GetPlatformProxyOptions;
|
|
2473
2690
|
|
|
2474
|
-
declare function getCookies (headers:
|
|
2691
|
+
declare function getCookies (headers: Headers_2): Record<string, string>
|
|
2475
2692
|
|
|
2476
2693
|
declare function getGlobalDispatcher(): Dispatcher;
|
|
2477
2694
|
|
|
2478
2695
|
declare function getGlobalOrigin(): URL | undefined;
|
|
2479
2696
|
|
|
2480
2697
|
/**
|
|
2481
|
-
* By reading from a
|
|
2698
|
+
* By reading from a Wrangler configuration file this function generates proxy objects that can be
|
|
2482
2699
|
* used to simulate the interaction with the Cloudflare platform during local development
|
|
2483
2700
|
* in a Node.js environment
|
|
2484
2701
|
*
|
|
@@ -2498,19 +2715,12 @@ export declare type GetPlatformProxyOptions = {
|
|
|
2498
2715
|
/**
|
|
2499
2716
|
* The path to the config file to use.
|
|
2500
2717
|
* If no path is specified the default behavior is to search from the
|
|
2501
|
-
* current directory up the filesystem for a
|
|
2718
|
+
* current directory up the filesystem for a Wrangler configuration file to use.
|
|
2502
2719
|
*
|
|
2503
2720
|
* Note: this field is optional but if a path is specified it must
|
|
2504
2721
|
* point to a valid file on the filesystem
|
|
2505
2722
|
*/
|
|
2506
2723
|
configPath?: string;
|
|
2507
|
-
/**
|
|
2508
|
-
* Flag to indicate the utility to read a json config file (`wrangler.json`/`wrangler.jsonc`)
|
|
2509
|
-
* instead of the toml one (`wrangler.toml`)
|
|
2510
|
-
*
|
|
2511
|
-
* Note: this feature is experimental
|
|
2512
|
-
*/
|
|
2513
|
-
experimentalJsonConfig?: boolean;
|
|
2514
2724
|
/**
|
|
2515
2725
|
* Indicates if and where to persist the bindings data, if not present or `true` it defaults to the same location
|
|
2516
2726
|
* used by wrangler v3: `.wrangler/state/v3` (so that the same data can be easily used by the caller and wrangler).
|
|
@@ -2527,9 +2737,9 @@ export declare type GetPlatformProxyOptions = {
|
|
|
2527
2737
|
experimentalRegistry?: boolean;
|
|
2528
2738
|
};
|
|
2529
2739
|
|
|
2530
|
-
declare function getSetCookies (headers:
|
|
2740
|
+
declare function getSetCookies (headers: Headers_2): Cookie[]
|
|
2531
2741
|
|
|
2532
|
-
declare class
|
|
2742
|
+
declare class Headers_2 implements SpecIterable<[string, string]> {
|
|
2533
2743
|
constructor (init?: HeadersInit)
|
|
2534
2744
|
readonly append: (name: string, value: string) => void
|
|
2535
2745
|
readonly delete: (name: string) => void
|
|
@@ -2538,7 +2748,7 @@ declare class Headers implements SpecIterable<[string, string]> {
|
|
|
2538
2748
|
readonly set: (name: string, value: string) => void
|
|
2539
2749
|
readonly getSetCookie: () => string[]
|
|
2540
2750
|
readonly forEach: (
|
|
2541
|
-
callbackfn: (value: string, key: string, iterable:
|
|
2751
|
+
callbackfn: (value: string, key: string, iterable: Headers_2) => void,
|
|
2542
2752
|
thisArg?: unknown
|
|
2543
2753
|
) => void
|
|
2544
2754
|
|
|
@@ -2548,7 +2758,7 @@ declare class Headers implements SpecIterable<[string, string]> {
|
|
|
2548
2758
|
readonly [Symbol.iterator]: () => SpecIterator<[string, string]>
|
|
2549
2759
|
}
|
|
2550
2760
|
|
|
2551
|
-
declare type HeadersInit = string[][] | Record<string, string | ReadonlyArray<string>> |
|
|
2761
|
+
declare type HeadersInit = string[][] | Record<string, string | ReadonlyArray<string>> | Headers_2
|
|
2552
2762
|
|
|
2553
2763
|
declare type Hook<T extends HookValues, Args extends unknown[] = []> = T | ((...args: Args) => T);
|
|
2554
2764
|
|
|
@@ -2566,6 +2776,11 @@ declare type HttpTerminator = {
|
|
|
2566
2776
|
*/
|
|
2567
2777
|
declare type IncomingHttpHeaders = Record<string, string | string[] | undefined>;
|
|
2568
2778
|
|
|
2779
|
+
/**
|
|
2780
|
+
* A symbol to inherit a binding from the deployed worker.
|
|
2781
|
+
*/
|
|
2782
|
+
declare const INHERIT_SYMBOL: unique symbol;
|
|
2783
|
+
|
|
2569
2784
|
declare type InspectorProxyWorkerIncomingWebSocketMessage = {
|
|
2570
2785
|
type: ReloadStartEvent["type"];
|
|
2571
2786
|
} | {
|
|
@@ -2597,7 +2812,9 @@ declare interface Interceptable extends Dispatcher {
|
|
|
2597
2812
|
declare class Logger {
|
|
2598
2813
|
#private;
|
|
2599
2814
|
constructor();
|
|
2600
|
-
|
|
2815
|
+
private overrideLoggerLevel?;
|
|
2816
|
+
get loggerLevel(): "log" | "error" | "none" | "debug" | "info" | "warn";
|
|
2817
|
+
set loggerLevel(val: "log" | "error" | "none" | "debug" | "info" | "warn");
|
|
2601
2818
|
columns: number;
|
|
2602
2819
|
debug: (...args: unknown[]) => void;
|
|
2603
2820
|
debugWithSanitization: (label: string, ...args: unknown[]) => void;
|
|
@@ -2607,17 +2824,36 @@ declare class Logger {
|
|
|
2607
2824
|
error: (...args: unknown[]) => void;
|
|
2608
2825
|
table<Keys extends string>(data: TableRow<Keys>[]): void;
|
|
2609
2826
|
console<M extends Exclude<keyof Console, "Console">>(method: M, ...args: Parameters<Console[M]>): void;
|
|
2827
|
+
static onceHistory: Set<unknown>;
|
|
2828
|
+
get once(): {
|
|
2829
|
+
info: (...args: unknown[]) => void;
|
|
2830
|
+
log: (...args: unknown[]) => void;
|
|
2831
|
+
warn: (...args: unknown[]) => void;
|
|
2832
|
+
error: (...args: unknown[]) => void;
|
|
2833
|
+
};
|
|
2834
|
+
doLogOnce(messageLevel: Exclude<LoggerLevel, "none">, args: unknown[]): void;
|
|
2610
2835
|
private doLog;
|
|
2611
2836
|
static registerBeforeLogHook(callback: (() => void) | undefined): void;
|
|
2612
2837
|
static registerAfterLogHook(callback: (() => void) | undefined): void;
|
|
2613
2838
|
private formatMessage;
|
|
2614
2839
|
}
|
|
2615
2840
|
|
|
2841
|
+
declare const LOGGER_LEVELS: {
|
|
2842
|
+
readonly none: -1;
|
|
2843
|
+
readonly error: 0;
|
|
2844
|
+
readonly warn: 1;
|
|
2845
|
+
readonly info: 2;
|
|
2846
|
+
readonly log: 3;
|
|
2847
|
+
readonly debug: 4;
|
|
2848
|
+
};
|
|
2849
|
+
|
|
2850
|
+
declare type LoggerLevel = keyof typeof LOGGER_LEVELS;
|
|
2851
|
+
|
|
2616
2852
|
declare type LogLevel = "debug" | "info" | "log" | "warn" | "error" | "none";
|
|
2617
2853
|
|
|
2618
2854
|
declare type MaybePromise<T> = T | Promise<T>;
|
|
2619
2855
|
|
|
2620
|
-
declare interface
|
|
2856
|
+
declare interface MessageEvent_2<T = any> extends Event_2 {
|
|
2621
2857
|
readonly data: T
|
|
2622
2858
|
readonly lastEventId: string
|
|
2623
2859
|
readonly origin: string
|
|
@@ -2635,9 +2871,9 @@ declare interface MessageEvent<T = any> extends Event_2 {
|
|
|
2635
2871
|
): void;
|
|
2636
2872
|
}
|
|
2637
2873
|
|
|
2638
|
-
declare const
|
|
2639
|
-
prototype:
|
|
2640
|
-
new<T>(type: string, eventInitDict?: MessageEventInit<T>):
|
|
2874
|
+
declare const MessageEvent_2: {
|
|
2875
|
+
prototype: MessageEvent_2
|
|
2876
|
+
new<T>(type: string, eventInitDict?: MessageEventInit<T>): MessageEvent_2<T>
|
|
2641
2877
|
};
|
|
2642
2878
|
|
|
2643
2879
|
declare interface MessageEventInit<T = any> extends EventInit {
|
|
@@ -2776,7 +3012,7 @@ declare namespace MockInterceptor {
|
|
|
2776
3012
|
origin: string;
|
|
2777
3013
|
method: string;
|
|
2778
3014
|
body?: BodyInit | Dispatcher.DispatchOptions['body'];
|
|
2779
|
-
headers:
|
|
3015
|
+
headers: Headers_2 | Record<string, string>;
|
|
2780
3016
|
maxRedirections: number;
|
|
2781
3017
|
}
|
|
2782
3018
|
|
|
@@ -2823,31 +3059,38 @@ declare interface MultiCacheQueryOptions extends CacheQueryOptions {
|
|
|
2823
3059
|
cacheName?: string
|
|
2824
3060
|
}
|
|
2825
3061
|
|
|
2826
|
-
|
|
2827
|
-
* Wrangler can provide Node.js compatibility in a number of different modes:
|
|
2828
|
-
* - "legacy" - this mode adds compile-time polyfills that are not well maintained and cannot work with workerd runtime builtins.
|
|
2829
|
-
* - "v1" - this mode tells the workerd runtime to enable some Node.js builtin libraries (accessible only via `node:...` imports) but no globals.
|
|
2830
|
-
* - "v2" - this mode tells the workerd runtime to enable more Node.js builtin libraries (accessible both with and without the `node:` prefix)
|
|
2831
|
-
* and also some Node.js globals such as `Buffer`; it also turns on additional compile-time polyfills for those that are not provided by the runtime.
|
|
2832
|
-
*/
|
|
2833
|
-
declare type NodeJSCompatMode = "legacy" | "v1" | "v2" | null;
|
|
3062
|
+
declare type NameOmit<T> = Omit<T, "name">;
|
|
2834
3063
|
|
|
2835
|
-
declare
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
3064
|
+
declare type NormalizeAndValidateConfigArgs = {
|
|
3065
|
+
name?: string;
|
|
3066
|
+
env?: string;
|
|
3067
|
+
"legacy-env"?: boolean;
|
|
3068
|
+
"dispatch-namespace"?: string;
|
|
3069
|
+
remote?: boolean;
|
|
3070
|
+
localProtocol?: string;
|
|
3071
|
+
upstreamProtocol?: string;
|
|
3072
|
+
script?: string;
|
|
3073
|
+
};
|
|
3074
|
+
|
|
3075
|
+
declare interface Observability {
|
|
3076
|
+
/** If observability is enabled for this Worker */
|
|
3077
|
+
enabled?: boolean;
|
|
3078
|
+
/** The sampling rate */
|
|
3079
|
+
head_sampling_rate?: number;
|
|
3080
|
+
logs?: {
|
|
3081
|
+
enabled?: boolean;
|
|
3082
|
+
/** The sampling rate */
|
|
3083
|
+
head_sampling_rate?: number;
|
|
3084
|
+
/** Set to false to disable invocation logs */
|
|
3085
|
+
invocation_logs?: boolean;
|
|
3086
|
+
};
|
|
2844
3087
|
}
|
|
2845
3088
|
|
|
2846
3089
|
declare interface PagesConfigFields {
|
|
2847
3090
|
/**
|
|
2848
3091
|
* The directory of static assets to serve.
|
|
2849
3092
|
*
|
|
2850
|
-
* The presence of this field in
|
|
3093
|
+
* The presence of this field in a Wrangler configuration file indicates a Pages project,
|
|
2851
3094
|
* and will prompt the handling of the configuration file according to the
|
|
2852
3095
|
* Pages-specific validation rules.
|
|
2853
3096
|
*/
|
|
@@ -25423,7 +25666,7 @@ declare class ProxyController extends Controller<ProxyControllerEventMap> {
|
|
|
25423
25666
|
onReloadComplete(data: ReloadCompleteEvent): void;
|
|
25424
25667
|
onProxyWorkerMessage(message: ProxyWorkerOutgoingRequestBody): void;
|
|
25425
25668
|
onInspectorProxyWorkerMessage(message: InspectorProxyWorkerOutgoingWebsocketMessage): void;
|
|
25426
|
-
onInspectorProxyWorkerRequest(message: InspectorProxyWorkerOutgoingRequestBody): Promise<
|
|
25669
|
+
onInspectorProxyWorkerRequest(message: InspectorProxyWorkerOutgoingRequestBody): Promise<Response_3>;
|
|
25427
25670
|
_torndown: boolean;
|
|
25428
25671
|
teardown(): Promise<void>;
|
|
25429
25672
|
emitReadyEvent(proxyWorker: Miniflare, url: URL, inspectorUrl: URL): void;
|
|
@@ -25466,10 +25709,19 @@ declare type ProxyWorkerOutgoingRequestBody = {
|
|
|
25466
25709
|
args: Parameters<typeof console.debug>;
|
|
25467
25710
|
};
|
|
25468
25711
|
|
|
25469
|
-
declare type QueueConsumer = NonNullable<
|
|
25712
|
+
declare type QueueConsumer = NonNullable<Unstable_Config["queues"]["consumers"]>[number];
|
|
25470
25713
|
|
|
25471
25714
|
declare type RawDevConfig = Partial<DevConfig>;
|
|
25472
25715
|
|
|
25716
|
+
declare type ReadConfigCommandArgs = NormalizeAndValidateConfigArgs & {
|
|
25717
|
+
config?: string;
|
|
25718
|
+
script?: string;
|
|
25719
|
+
};
|
|
25720
|
+
|
|
25721
|
+
declare type ReadConfigOptions = ResolveConfigPathOptions & {
|
|
25722
|
+
hideWarnings?: boolean;
|
|
25723
|
+
};
|
|
25724
|
+
|
|
25473
25725
|
declare type ReadyEvent = {
|
|
25474
25726
|
type: "ready";
|
|
25475
25727
|
proxyWorker: Miniflare;
|
|
@@ -25507,13 +25759,19 @@ declare type ReloadStartEvent = {
|
|
|
25507
25759
|
bundle: Bundle;
|
|
25508
25760
|
};
|
|
25509
25761
|
|
|
25510
|
-
|
|
25511
|
-
|
|
25762
|
+
/** Performs an HTTP request. */
|
|
25763
|
+
declare function request(
|
|
25764
|
+
url: string | URL_2 | UrlObject,
|
|
25765
|
+
options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions, 'origin' | 'path' | 'method'> & Partial<Pick<Dispatcher.RequestOptions, 'method'>>,
|
|
25766
|
+
): Promise<Dispatcher.ResponseData>;
|
|
25767
|
+
|
|
25768
|
+
declare class Request_2 implements BodyMixin {
|
|
25769
|
+
constructor (input: RequestInfo, init?: RequestInit_2)
|
|
25512
25770
|
|
|
25513
25771
|
readonly cache: RequestCache
|
|
25514
25772
|
readonly credentials: RequestCredentials
|
|
25515
25773
|
readonly destination: RequestDestination
|
|
25516
|
-
readonly headers:
|
|
25774
|
+
readonly headers: Headers_2
|
|
25517
25775
|
readonly integrity: string
|
|
25518
25776
|
readonly method: string
|
|
25519
25777
|
readonly mode: RequestMode
|
|
@@ -25525,24 +25783,18 @@ declare class Request implements BodyMixin {
|
|
|
25525
25783
|
readonly signal: AbortSignal
|
|
25526
25784
|
readonly duplex: RequestDuplex
|
|
25527
25785
|
|
|
25528
|
-
readonly body:
|
|
25786
|
+
readonly body: ReadableStream_2 | null
|
|
25529
25787
|
readonly bodyUsed: boolean
|
|
25530
25788
|
|
|
25531
25789
|
readonly arrayBuffer: () => Promise<ArrayBuffer>
|
|
25532
25790
|
readonly blob: () => Promise<Blob_2>
|
|
25533
|
-
readonly formData: () => Promise<
|
|
25791
|
+
readonly formData: () => Promise<FormData_2>
|
|
25534
25792
|
readonly json: () => Promise<unknown>
|
|
25535
25793
|
readonly text: () => Promise<string>
|
|
25536
25794
|
|
|
25537
|
-
readonly clone: () =>
|
|
25795
|
+
readonly clone: () => Request_2
|
|
25538
25796
|
}
|
|
25539
25797
|
|
|
25540
|
-
/** Performs an HTTP request. */
|
|
25541
|
-
declare function request(
|
|
25542
|
-
url: string | URL_2 | UrlObject,
|
|
25543
|
-
options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions, 'origin' | 'path' | 'method'> & Partial<Pick<Dispatcher.RequestOptions, 'method'>>,
|
|
25544
|
-
): Promise<Dispatcher.ResponseData>;
|
|
25545
|
-
|
|
25546
25798
|
declare type RequestCache =
|
|
25547
25799
|
| 'default'
|
|
25548
25800
|
| 'force-cache'
|
|
@@ -25575,9 +25827,9 @@ declare type RequestDestination =
|
|
|
25575
25827
|
|
|
25576
25828
|
declare type RequestDuplex = 'half'
|
|
25577
25829
|
|
|
25578
|
-
declare type RequestInfo = string | URL_2 |
|
|
25830
|
+
declare type RequestInfo = string | URL_2 | Request_2
|
|
25579
25831
|
|
|
25580
|
-
declare interface
|
|
25832
|
+
declare interface RequestInit_2 {
|
|
25581
25833
|
method?: string
|
|
25582
25834
|
keepalive?: boolean
|
|
25583
25835
|
headers?: HeadersInit
|
|
@@ -25598,10 +25850,14 @@ declare type RequestMode = 'cors' | 'navigate' | 'no-cors' | 'same-origin'
|
|
|
25598
25850
|
|
|
25599
25851
|
declare type RequestRedirect = 'error' | 'follow' | 'manual'
|
|
25600
25852
|
|
|
25601
|
-
declare
|
|
25602
|
-
|
|
25853
|
+
declare type ResolveConfigPathOptions = {
|
|
25854
|
+
useRedirectIfAvailable?: boolean;
|
|
25855
|
+
};
|
|
25603
25856
|
|
|
25604
|
-
|
|
25857
|
+
declare class Response_2 implements BodyMixin {
|
|
25858
|
+
constructor (body?: BodyInit, init?: ResponseInit_2)
|
|
25859
|
+
|
|
25860
|
+
readonly headers: Headers_2
|
|
25605
25861
|
readonly ok: boolean
|
|
25606
25862
|
readonly status: number
|
|
25607
25863
|
readonly statusText: string
|
|
@@ -25609,23 +25865,23 @@ declare class Response implements BodyMixin {
|
|
|
25609
25865
|
readonly url: string
|
|
25610
25866
|
readonly redirected: boolean
|
|
25611
25867
|
|
|
25612
|
-
readonly body:
|
|
25868
|
+
readonly body: ReadableStream_2 | null
|
|
25613
25869
|
readonly bodyUsed: boolean
|
|
25614
25870
|
|
|
25615
25871
|
readonly arrayBuffer: () => Promise<ArrayBuffer>
|
|
25616
25872
|
readonly blob: () => Promise<Blob_2>
|
|
25617
|
-
readonly formData: () => Promise<
|
|
25873
|
+
readonly formData: () => Promise<FormData_2>
|
|
25618
25874
|
readonly json: () => Promise<unknown>
|
|
25619
25875
|
readonly text: () => Promise<string>
|
|
25620
25876
|
|
|
25621
|
-
readonly clone: () =>
|
|
25877
|
+
readonly clone: () => Response_2
|
|
25622
25878
|
|
|
25623
|
-
static error ():
|
|
25624
|
-
static json(data: any, init?:
|
|
25625
|
-
static redirect (url: string | URL_2, status: ResponseRedirectStatus):
|
|
25879
|
+
static error (): Response_2
|
|
25880
|
+
static json(data: any, init?: ResponseInit_2): Response_2
|
|
25881
|
+
static redirect (url: string | URL_2, status: ResponseRedirectStatus): Response_2
|
|
25626
25882
|
}
|
|
25627
25883
|
|
|
25628
|
-
declare interface
|
|
25884
|
+
declare interface ResponseInit_2 {
|
|
25629
25885
|
readonly status?: number
|
|
25630
25886
|
readonly statusText?: string
|
|
25631
25887
|
readonly headers?: HeadersInit
|
|
@@ -25756,6 +26012,19 @@ declare namespace RetryHandler {
|
|
|
25756
26012
|
|
|
25757
26013
|
declare type Route = SimpleRoute | ZoneIdRoute | ZoneNameRoute | CustomDomainRoute;
|
|
25758
26014
|
|
|
26015
|
+
declare type RoutingConfig = z.infer<typeof RoutingConfigSchema>;
|
|
26016
|
+
|
|
26017
|
+
declare const RoutingConfigSchema: z.ZodObject<{
|
|
26018
|
+
has_user_worker: z.ZodOptional<z.ZodBoolean>;
|
|
26019
|
+
invoke_user_worker_ahead_of_assets: z.ZodOptional<z.ZodBoolean>;
|
|
26020
|
+
}, "strip", z.ZodTypeAny, {
|
|
26021
|
+
has_user_worker?: boolean;
|
|
26022
|
+
invoke_user_worker_ahead_of_assets?: boolean;
|
|
26023
|
+
}, {
|
|
26024
|
+
has_user_worker?: boolean;
|
|
26025
|
+
invoke_user_worker_ahead_of_assets?: boolean;
|
|
26026
|
+
}>;
|
|
26027
|
+
|
|
25759
26028
|
/**
|
|
25760
26029
|
* A bundling resolver rule, defining the modules type for paths that match the specified globs.
|
|
25761
26030
|
*/
|
|
@@ -25792,9 +26061,9 @@ declare type SerializedError = {
|
|
|
25792
26061
|
cause?: unknown;
|
|
25793
26062
|
};
|
|
25794
26063
|
|
|
25795
|
-
declare type ServiceFetch = (request:
|
|
26064
|
+
declare type ServiceFetch = (request: Request_3) => Promise<Response_3> | Response_3;
|
|
25796
26065
|
|
|
25797
|
-
declare function setCookie (headers:
|
|
26066
|
+
declare function setCookie (headers: Headers_2, cookie: Cookie): void
|
|
25798
26067
|
|
|
25799
26068
|
declare function setGlobalDispatcher<DispatcherImplementation extends Dispatcher>(dispatcher: DispatcherImplementation): void;
|
|
25800
26069
|
|
|
@@ -25832,7 +26101,7 @@ declare interface StartDevWorkerInput {
|
|
|
25832
26101
|
name?: string;
|
|
25833
26102
|
/**
|
|
25834
26103
|
* The javascript or typescript entry-point of the worker.
|
|
25835
|
-
* This is the `main` property of a
|
|
26104
|
+
* This is the `main` property of a Wrangler configuration file.
|
|
25836
26105
|
* You can specify a file path or provide the contents directly.
|
|
25837
26106
|
*/
|
|
25838
26107
|
entrypoint?: string;
|
|
@@ -25845,6 +26114,7 @@ declare interface StartDevWorkerInput {
|
|
|
25845
26114
|
env?: string;
|
|
25846
26115
|
/** The bindings available to the worker. The specified bindind type will be exposed to the worker on the `env` object under the same key. */
|
|
25847
26116
|
bindings?: Record<string, Binding>;
|
|
26117
|
+
migrations?: DurableObjectMigration[];
|
|
25848
26118
|
/** The triggers which will cause the worker's exported default handlers to be called. */
|
|
25849
26119
|
triggers?: Trigger[];
|
|
25850
26120
|
/**
|
|
@@ -25881,7 +26151,7 @@ declare interface StartDevWorkerInput {
|
|
|
25881
26151
|
jsxFactory?: string;
|
|
25882
26152
|
jsxFragment?: string;
|
|
25883
26153
|
tsconfig?: string;
|
|
25884
|
-
nodejsCompatMode?: Hook<NodeJSCompatMode, [
|
|
26154
|
+
nodejsCompatMode?: Hook<NodeJSCompatMode, [Unstable_Config]>;
|
|
25885
26155
|
moduleRoot?: string;
|
|
25886
26156
|
};
|
|
25887
26157
|
/** Options applying to the worker's development preview environment. */
|
|
@@ -25895,7 +26165,7 @@ declare interface StartDevWorkerInput {
|
|
|
25895
26165
|
/** Whether the worker runs on the edge or locally. */
|
|
25896
26166
|
remote?: boolean;
|
|
25897
26167
|
/** Cloudflare Account credentials. Can be provided upfront or as a function which will be called only when required. */
|
|
25898
|
-
auth?: AsyncHook<CfAccount>;
|
|
26168
|
+
auth?: AsyncHook<CfAccount, [Pick<Unstable_Config, "account_id">]>;
|
|
25899
26169
|
/** Whether local storage (KV, Durable Objects, R2, D1, etc) is persisted. You can also specify the directory to persist data to. */
|
|
25900
26170
|
persist?: string;
|
|
25901
26171
|
/** Controls which logs are logged 🤙. */
|
|
@@ -25922,23 +26192,25 @@ declare interface StartDevWorkerInput {
|
|
|
25922
26192
|
/** An undici MockAgent to declaratively mock fetch calls to particular resources. */
|
|
25923
26193
|
mockFetch?: undici.MockAgent;
|
|
25924
26194
|
/** Describes the registry of other Workers running locally */
|
|
25925
|
-
registry?: WorkerRegistry;
|
|
26195
|
+
registry?: WorkerRegistry | null;
|
|
25926
26196
|
testScheduled?: boolean;
|
|
26197
|
+
/** Whether to use Vectorize mixed mode -- the worker is run locally but accesses to Vectorize are made remotely */
|
|
26198
|
+
bindVectorizeToProd?: boolean;
|
|
26199
|
+
/** Treat this as the primary worker in a multiworker setup (i.e. the first Worker in Miniflare's options) */
|
|
26200
|
+
multiworkerPrimary?: boolean;
|
|
25927
26201
|
};
|
|
25928
26202
|
legacy?: {
|
|
25929
|
-
site?: Hook<
|
|
25930
|
-
legacyAssets?: Hook<
|
|
26203
|
+
site?: Hook<Unstable_Config["site"], [Unstable_Config]>;
|
|
26204
|
+
legacyAssets?: Hook<Unstable_Config["legacy_assets"], [Unstable_Config]>;
|
|
25931
26205
|
enableServiceEnvironments?: boolean;
|
|
25932
26206
|
};
|
|
25933
26207
|
unsafe?: Omit<CfUnsafe, "bindings">;
|
|
25934
|
-
|
|
25935
|
-
assets?: Omit<ExperimentalAssets, "bindings">;
|
|
25936
|
-
};
|
|
26208
|
+
assets?: string;
|
|
25937
26209
|
}
|
|
25938
26210
|
|
|
25939
|
-
declare type StartDevWorkerOptions = StartDevWorkerInput & {
|
|
25940
|
-
/** A worker's directory. Usually where the
|
|
25941
|
-
|
|
26211
|
+
declare type StartDevWorkerOptions = Omit<StartDevWorkerInput, "assets"> & {
|
|
26212
|
+
/** A worker's directory. Usually where the Wrangler configuration file is located */
|
|
26213
|
+
projectRoot: string;
|
|
25942
26214
|
build: StartDevWorkerInput["build"] & {
|
|
25943
26215
|
nodejsCompatMode: NodeJSCompatMode;
|
|
25944
26216
|
format: CfScriptFormat;
|
|
@@ -25946,16 +26218,20 @@ declare type StartDevWorkerOptions = StartDevWorkerInput & {
|
|
|
25946
26218
|
moduleRules: Rule[];
|
|
25947
26219
|
define: Record<string, string>;
|
|
25948
26220
|
additionalModules: CfModule[];
|
|
26221
|
+
exports: string[];
|
|
25949
26222
|
processEntrypoint: boolean;
|
|
25950
26223
|
};
|
|
25951
26224
|
legacy: StartDevWorkerInput["legacy"] & {
|
|
25952
|
-
legacyAssets?:
|
|
25953
|
-
site?:
|
|
26225
|
+
legacyAssets?: Unstable_Config["legacy_assets"];
|
|
26226
|
+
site?: Unstable_Config["site"];
|
|
25954
26227
|
};
|
|
25955
26228
|
dev: StartDevWorkerInput["dev"] & {
|
|
25956
26229
|
persist: string;
|
|
26230
|
+
auth?: AsyncHook<CfAccount>;
|
|
25957
26231
|
};
|
|
25958
26232
|
entrypoint: string;
|
|
26233
|
+
assets?: AssetsOptions;
|
|
26234
|
+
name: string;
|
|
25959
26235
|
};
|
|
25960
26236
|
|
|
25961
26237
|
/** A faster version of `request`. */
|
|
@@ -26034,11 +26310,11 @@ declare namespace Undici {
|
|
|
26034
26310
|
var MockPool: MockPool;
|
|
26035
26311
|
var MockAgent: MockAgent;
|
|
26036
26312
|
var mockErrors: MockErrors;
|
|
26037
|
-
var fetch:
|
|
26038
|
-
var Headers:
|
|
26039
|
-
var Response:
|
|
26040
|
-
var Request:
|
|
26041
|
-
var FormData:
|
|
26313
|
+
var fetch: fetch_2;
|
|
26314
|
+
var Headers: Headers_2;
|
|
26315
|
+
var Response: Response_2;
|
|
26316
|
+
var Request: Request_2;
|
|
26317
|
+
var FormData: FormData_2;
|
|
26042
26318
|
var File: File;
|
|
26043
26319
|
var FileReader: FileReader;
|
|
26044
26320
|
var caches: caches;
|
|
@@ -26077,7 +26353,7 @@ declare namespace undici {
|
|
|
26077
26353
|
getSetCookies,
|
|
26078
26354
|
setCookie,
|
|
26079
26355
|
Cookie,
|
|
26080
|
-
fetch,
|
|
26356
|
+
fetch_2 as fetch,
|
|
26081
26357
|
RequestInfo,
|
|
26082
26358
|
BodyInit,
|
|
26083
26359
|
BodyMixin,
|
|
@@ -26085,20 +26361,20 @@ declare namespace undici {
|
|
|
26085
26361
|
SpecIterableIterator,
|
|
26086
26362
|
SpecIterable,
|
|
26087
26363
|
HeadersInit,
|
|
26088
|
-
Headers,
|
|
26364
|
+
Headers_2 as Headers,
|
|
26089
26365
|
RequestCache,
|
|
26090
26366
|
RequestCredentials,
|
|
26091
26367
|
RequestDestination,
|
|
26092
|
-
RequestInit,
|
|
26368
|
+
RequestInit_2 as RequestInit,
|
|
26093
26369
|
ReferrerPolicy,
|
|
26094
26370
|
RequestMode,
|
|
26095
26371
|
RequestRedirect,
|
|
26096
26372
|
RequestDuplex,
|
|
26097
|
-
Request,
|
|
26098
|
-
ResponseInit,
|
|
26373
|
+
Request_2 as Request,
|
|
26374
|
+
ResponseInit_2 as ResponseInit,
|
|
26099
26375
|
ResponseType,
|
|
26100
26376
|
ResponseRedirectStatus,
|
|
26101
|
-
Response,
|
|
26377
|
+
Response_2 as Response,
|
|
26102
26378
|
BlobPropertyBag,
|
|
26103
26379
|
FilePropertyBag,
|
|
26104
26380
|
File,
|
|
@@ -26106,7 +26382,7 @@ declare namespace undici {
|
|
|
26106
26382
|
ProgressEventInit,
|
|
26107
26383
|
ProgressEvent,
|
|
26108
26384
|
FormDataEntryValue,
|
|
26109
|
-
FormData,
|
|
26385
|
+
FormData_2 as FormData,
|
|
26110
26386
|
DiagnosticsChannel,
|
|
26111
26387
|
BinaryType,
|
|
26112
26388
|
WebSocketEventMap,
|
|
@@ -26114,7 +26390,7 @@ declare namespace undici {
|
|
|
26114
26390
|
CloseEventInit,
|
|
26115
26391
|
CloseEvent,
|
|
26116
26392
|
MessageEventInit,
|
|
26117
|
-
MessageEvent,
|
|
26393
|
+
MessageEvent_2 as MessageEvent,
|
|
26118
26394
|
WebSocketInit,
|
|
26119
26395
|
parseMIMEType,
|
|
26120
26396
|
serializeAMimeType,
|
|
@@ -26127,10 +26403,39 @@ declare namespace undici {
|
|
|
26127
26403
|
}
|
|
26128
26404
|
}
|
|
26129
26405
|
|
|
26406
|
+
export declare interface Unstable_ASSETSBindingsOptions {
|
|
26407
|
+
log: Logger;
|
|
26408
|
+
proxyPort?: number;
|
|
26409
|
+
directory?: string;
|
|
26410
|
+
}
|
|
26411
|
+
|
|
26412
|
+
/**
|
|
26413
|
+
* This is the static type definition for the configuration object.
|
|
26414
|
+
*
|
|
26415
|
+
* It reflects a normalized and validated version of the configuration that you can write in a Wrangler configuration file,
|
|
26416
|
+
* and optionally augment with arguments passed directly to wrangler.
|
|
26417
|
+
*
|
|
26418
|
+
* For more information about the configuration object, see the
|
|
26419
|
+
* documentation at https://developers.cloudflare.com/workers/cli-wrangler/configuration
|
|
26420
|
+
*
|
|
26421
|
+
* Notes:
|
|
26422
|
+
*
|
|
26423
|
+
* - Fields that are only specified in `ConfigFields` and not `Environment` can only appear
|
|
26424
|
+
* in the top level config and should not appear in any environments.
|
|
26425
|
+
* - Fields that are specified in `PagesConfigFields` are only relevant for Pages projects
|
|
26426
|
+
* - All top level fields in config and environments are optional in the Wrangler configuration file.
|
|
26427
|
+
*
|
|
26428
|
+
* Legend for the annotations:
|
|
26429
|
+
*
|
|
26430
|
+
* - `@breaking`: the deprecation/optionality is a breaking change from Wrangler v1.
|
|
26431
|
+
* - `@todo`: there's more work to be done (with details attached).
|
|
26432
|
+
*/
|
|
26433
|
+
export declare type Unstable_Config = ComputedFields & ConfigFields<DevConfig> & PagesConfigFields & Environment;
|
|
26434
|
+
|
|
26130
26435
|
/**
|
|
26131
26436
|
* unstable_dev starts a wrangler dev server, and returns a promise that resolves with utility functions to interact with it.
|
|
26132
26437
|
*/
|
|
26133
|
-
export declare function unstable_dev(script: string, options?:
|
|
26438
|
+
export declare function unstable_dev(script: string, options?: Unstable_DevOptions, apiOptions?: unknown): Promise<Unstable_DevWorker>;
|
|
26134
26439
|
|
|
26135
26440
|
export declare class unstable_DevEnv extends EventEmitter_2 {
|
|
26136
26441
|
config: ConfigController;
|
|
@@ -26148,37 +26453,7 @@ export declare class unstable_DevEnv extends EventEmitter_2 {
|
|
|
26148
26453
|
emitErrorEvent(ev: ErrorEvent): void;
|
|
26149
26454
|
}
|
|
26150
26455
|
|
|
26151
|
-
export declare
|
|
26152
|
-
|
|
26153
|
-
export declare function unstable_getMiniflareWorkerOptions(configPath: string, env?: string): {
|
|
26154
|
-
workerOptions: SourcelessWorkerOptions;
|
|
26155
|
-
define: Record<string, string>;
|
|
26156
|
-
main?: string;
|
|
26157
|
-
};
|
|
26158
|
-
|
|
26159
|
-
export declare const unstable_pages: {
|
|
26160
|
-
deploy: typeof deploy;
|
|
26161
|
-
};
|
|
26162
|
-
|
|
26163
|
-
/**
|
|
26164
|
-
* Split an SQLQuery into an array of statements
|
|
26165
|
-
*/
|
|
26166
|
-
export declare function unstable_splitSqlQuery(sql: string): string[];
|
|
26167
|
-
|
|
26168
|
-
export declare function unstable_startWorker(options: StartDevWorkerInput): Promise<Worker>;
|
|
26169
|
-
|
|
26170
|
-
export declare function unstable_startWorkerRegistryServer(port: number): Promise<{
|
|
26171
|
-
server: Server<IncomingMessage, ServerResponse>;
|
|
26172
|
-
terminator: HttpTerminator;
|
|
26173
|
-
}>;
|
|
26174
|
-
|
|
26175
|
-
export declare interface UnstableASSETSBindingsOptions {
|
|
26176
|
-
log: Logger;
|
|
26177
|
-
proxyPort?: number;
|
|
26178
|
-
directory?: string;
|
|
26179
|
-
}
|
|
26180
|
-
|
|
26181
|
-
export declare interface UnstableDevOptions {
|
|
26456
|
+
export declare interface Unstable_DevOptions {
|
|
26182
26457
|
config?: string;
|
|
26183
26458
|
env?: string;
|
|
26184
26459
|
ip?: string;
|
|
@@ -26188,7 +26463,7 @@ export declare interface UnstableDevOptions {
|
|
|
26188
26463
|
localProtocol?: "http" | "https";
|
|
26189
26464
|
httpsKeyPath?: string;
|
|
26190
26465
|
httpsCertPath?: string;
|
|
26191
|
-
|
|
26466
|
+
assets?: string;
|
|
26192
26467
|
legacyAssets?: string;
|
|
26193
26468
|
site?: string;
|
|
26194
26469
|
siteInclude?: string[];
|
|
@@ -26201,7 +26476,7 @@ export declare interface UnstableDevOptions {
|
|
|
26201
26476
|
vars?: Record<string, string | Json>;
|
|
26202
26477
|
kv?: {
|
|
26203
26478
|
binding: string;
|
|
26204
|
-
id
|
|
26479
|
+
id?: string;
|
|
26205
26480
|
preview_id?: string;
|
|
26206
26481
|
}[];
|
|
26207
26482
|
durableObjects?: {
|
|
@@ -26218,7 +26493,7 @@ export declare interface UnstableDevOptions {
|
|
|
26218
26493
|
}[];
|
|
26219
26494
|
r2?: {
|
|
26220
26495
|
binding: string;
|
|
26221
|
-
bucket_name
|
|
26496
|
+
bucket_name?: string;
|
|
26222
26497
|
preview_bucket_name?: string;
|
|
26223
26498
|
}[];
|
|
26224
26499
|
ai?: {
|
|
@@ -26248,18 +26523,64 @@ export declare interface UnstableDevOptions {
|
|
|
26248
26523
|
watch?: boolean;
|
|
26249
26524
|
devEnv?: boolean;
|
|
26250
26525
|
fileBasedRegistry?: boolean;
|
|
26526
|
+
vectorizeBindToProd?: boolean;
|
|
26527
|
+
enableIpc?: boolean;
|
|
26251
26528
|
};
|
|
26252
26529
|
}
|
|
26253
26530
|
|
|
26254
|
-
export declare interface
|
|
26531
|
+
export declare interface Unstable_DevWorker {
|
|
26255
26532
|
port: number;
|
|
26256
26533
|
address: string;
|
|
26257
|
-
proxyData: ProxyData;
|
|
26258
26534
|
stop: () => Promise<void>;
|
|
26259
|
-
fetch: (input?: RequestInfo, init?:
|
|
26535
|
+
fetch: (input?: RequestInfo, init?: RequestInit_2) => Promise<Response_2>;
|
|
26260
26536
|
waitUntilExit: () => Promise<void>;
|
|
26261
26537
|
}
|
|
26262
26538
|
|
|
26539
|
+
export declare const unstable_generateASSETSBinding: (opts: Unstable_ASSETSBindingsOptions) => (request: Request_3) => Promise<Response_3>;
|
|
26540
|
+
|
|
26541
|
+
export declare function unstable_getMiniflareWorkerOptions(configPath: string, env?: string): Unstable_MiniflareWorkerOptions;
|
|
26542
|
+
|
|
26543
|
+
export declare function unstable_getMiniflareWorkerOptions(config: Unstable_Config): Unstable_MiniflareWorkerOptions;
|
|
26544
|
+
|
|
26545
|
+
export declare interface Unstable_MiniflareWorkerOptions {
|
|
26546
|
+
workerOptions: SourcelessWorkerOptions;
|
|
26547
|
+
define: Record<string, string>;
|
|
26548
|
+
main?: string;
|
|
26549
|
+
}
|
|
26550
|
+
|
|
26551
|
+
export declare const unstable_pages: {
|
|
26552
|
+
deploy: typeof deploy;
|
|
26553
|
+
};
|
|
26554
|
+
|
|
26555
|
+
export declare type Unstable_RawConfig = Partial<ConfigFields<RawDevConfig>> & PagesConfigFields & Unstable_RawEnvironment & DeprecatedConfigFields & EnvironmentMap & {
|
|
26556
|
+
$schema?: string;
|
|
26557
|
+
};
|
|
26558
|
+
|
|
26559
|
+
/**
|
|
26560
|
+
* The raw environment configuration that we read from the config file.
|
|
26561
|
+
*
|
|
26562
|
+
* All the properties are optional, and will be replaced with defaults in the configuration that
|
|
26563
|
+
* is used in the rest of the codebase.
|
|
26564
|
+
*/
|
|
26565
|
+
export declare type Unstable_RawEnvironment = Partial<Environment> & EnvironmentDeprecated;
|
|
26566
|
+
|
|
26567
|
+
/**
|
|
26568
|
+
* Get the Wrangler configuration; read it from the give `configPath` if available.
|
|
26569
|
+
*/
|
|
26570
|
+
export declare function unstable_readConfig(args: ReadConfigCommandArgs, options?: ReadConfigOptions): Unstable_Config;
|
|
26571
|
+
|
|
26572
|
+
/**
|
|
26573
|
+
* Split an SQLQuery into an array of statements
|
|
26574
|
+
*/
|
|
26575
|
+
export declare function unstable_splitSqlQuery(sql: string): string[];
|
|
26576
|
+
|
|
26577
|
+
export declare function unstable_startWorker(options: StartDevWorkerInput): Promise<Worker>;
|
|
26578
|
+
|
|
26579
|
+
export declare const unstable_startWorkerRegistryServer: (port: number) => Promise<{
|
|
26580
|
+
server: Server<IncomingMessage, ServerResponse>;
|
|
26581
|
+
terminator: HttpTerminator;
|
|
26582
|
+
}>;
|
|
26583
|
+
|
|
26263
26584
|
/** Upgrade to a different protocol. */
|
|
26264
26585
|
declare function upgrade(
|
|
26265
26586
|
url: string | URL_2 | UrlObject,
|
|
@@ -26332,7 +26653,7 @@ declare const WebSocket: {
|
|
|
26332
26653
|
declare interface WebSocketEventMap {
|
|
26333
26654
|
close: CloseEvent
|
|
26334
26655
|
error: Event_2
|
|
26335
|
-
message:
|
|
26656
|
+
message: MessageEvent_2
|
|
26336
26657
|
open: Event_2
|
|
26337
26658
|
}
|
|
26338
26659
|
|
|
@@ -26377,6 +26698,17 @@ declare type WorkerEntrypointsDefinition = Record<"default" | string, {
|
|
|
26377
26698
|
|
|
26378
26699
|
declare type WorkerRegistry = Record<string, WorkerDefinition>;
|
|
26379
26700
|
|
|
26701
|
+
declare type WorkflowBinding = {
|
|
26702
|
+
/** The name of the binding used to refer to the Workflow */
|
|
26703
|
+
binding: string;
|
|
26704
|
+
/** The name of the Workflow */
|
|
26705
|
+
name: string;
|
|
26706
|
+
/** The exported class name of the Workflow */
|
|
26707
|
+
class_name: string;
|
|
26708
|
+
/** The script where the Workflow is defined (if it's external to this Worker) */
|
|
26709
|
+
script_name?: string;
|
|
26710
|
+
};
|
|
26711
|
+
|
|
26380
26712
|
declare type ZoneIdRoute = {
|
|
26381
26713
|
pattern: string;
|
|
26382
26714
|
zone_id: string;
|