wrangler 0.0.0-e4fe35cc5 → 0.0.0-e51304ca0
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 +29 -41
- package/bin/wrangler.js +2 -8
- package/config-schema.json +417 -1242
- package/package.json +39 -54
- package/templates/init-tests/test-vitest-new-worker.ts +2 -2
- package/templates/middleware/middleware-patch-console-prefix.d.ts +3 -0
- package/templates/middleware/middleware-patch-console-prefix.ts +21 -0
- package/templates/pages-dev-pipeline.ts +3 -2
- package/templates/tsconfig.json +8 -1
- package/templates/tsconfig.tsbuildinfo +1 -0
- package/wrangler-dist/InspectorProxyWorker.js +4 -8
- package/wrangler-dist/InspectorProxyWorker.js.map +1 -1
- package/wrangler-dist/ProxyWorker.js +3 -6
- package/wrangler-dist/ProxyWorker.js.map +1 -1
- package/wrangler-dist/cli.d.ts +649 -421
- package/wrangler-dist/cli.js +124450 -188831
- package/templates/middleware/middleware-serve-static-assets.d.ts +0 -6
- package/templates/middleware/middleware-serve-static-assets.ts +0 -56
- package/wrangler-dist/wasm-sync.wasm +0 -0
package/wrangler-dist/cli.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ import type { DispatchFetch } from 'miniflare';
|
|
|
6
6
|
import { Duplex } from 'stream';
|
|
7
7
|
import { EventEmitter } from 'events';
|
|
8
8
|
import { EventEmitter as EventEmitter_2 } from 'node:events';
|
|
9
|
-
import { IncomingMessage } from 'http';
|
|
10
9
|
import type { IncomingRequestCfProperties } from '@cloudflare/workers-types/experimental';
|
|
11
10
|
import { IpcNetConnectOpts } from 'net';
|
|
12
11
|
import type { Json } from 'miniflare';
|
|
@@ -16,12 +15,11 @@ import { Miniflare } from 'miniflare';
|
|
|
16
15
|
import type { MiniflareOptions } from 'miniflare';
|
|
17
16
|
import type { ModuleRule } from 'miniflare';
|
|
18
17
|
import { Mutex } from 'miniflare';
|
|
18
|
+
import type { NodeJSCompatMode } from 'miniflare';
|
|
19
19
|
import { Readable } from 'stream';
|
|
20
|
-
import { ReadableStream } from 'stream/web';
|
|
21
|
-
import type { Request as
|
|
22
|
-
import { Response as
|
|
23
|
-
import type { Server } from 'node:http';
|
|
24
|
-
import { ServerResponse } from 'http';
|
|
20
|
+
import { ReadableStream as ReadableStream_2 } from 'stream/web';
|
|
21
|
+
import type { Request as Request_3 } from 'miniflare';
|
|
22
|
+
import { Response as Response_3 } from 'miniflare';
|
|
25
23
|
import { Socket } from 'net';
|
|
26
24
|
import { TcpNetConnectOpts } from 'net';
|
|
27
25
|
import { TLSSocket } from 'tls';
|
|
@@ -76,16 +74,164 @@ declare type ApiCredentials = {
|
|
|
76
74
|
declare type AssetConfig = z.infer<typeof AssetConfigSchema>;
|
|
77
75
|
|
|
78
76
|
declare const AssetConfigSchema: z.ZodObject<{
|
|
77
|
+
account_id: z.ZodOptional<z.ZodNumber>;
|
|
78
|
+
script_id: z.ZodOptional<z.ZodNumber>;
|
|
79
|
+
compatibility_date: z.ZodOptional<z.ZodString>;
|
|
80
|
+
compatibility_flags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
79
81
|
html_handling: z.ZodOptional<z.ZodEnum<["auto-trailing-slash", "force-trailing-slash", "drop-trailing-slash", "none"]>>;
|
|
80
82
|
not_found_handling: z.ZodOptional<z.ZodEnum<["single-page-application", "404-page", "none"]>>;
|
|
83
|
+
redirects: z.ZodOptional<z.ZodObject<{
|
|
84
|
+
version: z.ZodLiteral<1>;
|
|
85
|
+
staticRules: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
86
|
+
status: z.ZodNumber;
|
|
87
|
+
to: z.ZodString;
|
|
88
|
+
lineNumber: z.ZodNumber;
|
|
89
|
+
}, "strip", z.ZodTypeAny, {
|
|
90
|
+
status?: number;
|
|
91
|
+
to?: string;
|
|
92
|
+
lineNumber?: number;
|
|
93
|
+
}, {
|
|
94
|
+
status?: number;
|
|
95
|
+
to?: string;
|
|
96
|
+
lineNumber?: number;
|
|
97
|
+
}>>;
|
|
98
|
+
rules: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
99
|
+
status: z.ZodNumber;
|
|
100
|
+
to: z.ZodString;
|
|
101
|
+
}, "strip", z.ZodTypeAny, {
|
|
102
|
+
status?: number;
|
|
103
|
+
to?: string;
|
|
104
|
+
}, {
|
|
105
|
+
status?: number;
|
|
106
|
+
to?: string;
|
|
107
|
+
}>>;
|
|
108
|
+
}, "strip", z.ZodTypeAny, {
|
|
109
|
+
version?: 1;
|
|
110
|
+
staticRules?: Record<string, {
|
|
111
|
+
status?: number;
|
|
112
|
+
to?: string;
|
|
113
|
+
lineNumber?: number;
|
|
114
|
+
}>;
|
|
115
|
+
rules?: Record<string, {
|
|
116
|
+
status?: number;
|
|
117
|
+
to?: string;
|
|
118
|
+
}>;
|
|
119
|
+
}, {
|
|
120
|
+
version?: 1;
|
|
121
|
+
staticRules?: Record<string, {
|
|
122
|
+
status?: number;
|
|
123
|
+
to?: string;
|
|
124
|
+
lineNumber?: number;
|
|
125
|
+
}>;
|
|
126
|
+
rules?: Record<string, {
|
|
127
|
+
status?: number;
|
|
128
|
+
to?: string;
|
|
129
|
+
}>;
|
|
130
|
+
}>>;
|
|
131
|
+
headers: z.ZodOptional<z.ZodObject<{
|
|
132
|
+
version: z.ZodLiteral<2>;
|
|
133
|
+
rules: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
134
|
+
set: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
135
|
+
unset: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
136
|
+
}, "strip", z.ZodTypeAny, {
|
|
137
|
+
set?: Record<string, string>;
|
|
138
|
+
unset?: string[];
|
|
139
|
+
}, {
|
|
140
|
+
set?: Record<string, string>;
|
|
141
|
+
unset?: string[];
|
|
142
|
+
}>>;
|
|
143
|
+
}, "strip", z.ZodTypeAny, {
|
|
144
|
+
version?: 2;
|
|
145
|
+
rules?: Record<string, {
|
|
146
|
+
set?: Record<string, string>;
|
|
147
|
+
unset?: string[];
|
|
148
|
+
}>;
|
|
149
|
+
}, {
|
|
150
|
+
version?: 2;
|
|
151
|
+
rules?: Record<string, {
|
|
152
|
+
set?: Record<string, string>;
|
|
153
|
+
unset?: string[];
|
|
154
|
+
}>;
|
|
155
|
+
}>>;
|
|
81
156
|
}, "strip", z.ZodTypeAny, {
|
|
157
|
+
account_id?: number;
|
|
158
|
+
script_id?: number;
|
|
159
|
+
compatibility_date?: string;
|
|
160
|
+
compatibility_flags?: string[];
|
|
82
161
|
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
83
162
|
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
163
|
+
redirects?: {
|
|
164
|
+
version?: 1;
|
|
165
|
+
staticRules?: Record<string, {
|
|
166
|
+
status?: number;
|
|
167
|
+
to?: string;
|
|
168
|
+
lineNumber?: number;
|
|
169
|
+
}>;
|
|
170
|
+
rules?: Record<string, {
|
|
171
|
+
status?: number;
|
|
172
|
+
to?: string;
|
|
173
|
+
}>;
|
|
174
|
+
};
|
|
175
|
+
headers?: {
|
|
176
|
+
version?: 2;
|
|
177
|
+
rules?: Record<string, {
|
|
178
|
+
set?: Record<string, string>;
|
|
179
|
+
unset?: string[];
|
|
180
|
+
}>;
|
|
181
|
+
};
|
|
84
182
|
}, {
|
|
183
|
+
account_id?: number;
|
|
184
|
+
script_id?: number;
|
|
185
|
+
compatibility_date?: string;
|
|
186
|
+
compatibility_flags?: string[];
|
|
85
187
|
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
86
188
|
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
189
|
+
redirects?: {
|
|
190
|
+
version?: 1;
|
|
191
|
+
staticRules?: Record<string, {
|
|
192
|
+
status?: number;
|
|
193
|
+
to?: string;
|
|
194
|
+
lineNumber?: number;
|
|
195
|
+
}>;
|
|
196
|
+
rules?: Record<string, {
|
|
197
|
+
status?: number;
|
|
198
|
+
to?: string;
|
|
199
|
+
}>;
|
|
200
|
+
};
|
|
201
|
+
headers?: {
|
|
202
|
+
version?: 2;
|
|
203
|
+
rules?: Record<string, {
|
|
204
|
+
set?: Record<string, string>;
|
|
205
|
+
unset?: string[];
|
|
206
|
+
}>;
|
|
207
|
+
};
|
|
87
208
|
}>;
|
|
88
209
|
|
|
210
|
+
declare type Assets = {
|
|
211
|
+
/** Absolute path to assets directory */
|
|
212
|
+
directory?: string;
|
|
213
|
+
/** Name of `env` binding property in the User Worker. */
|
|
214
|
+
binding?: string;
|
|
215
|
+
/** How to handle HTML requests. */
|
|
216
|
+
html_handling?: "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash" | "none";
|
|
217
|
+
/** How to handle requests that do not match an asset. */
|
|
218
|
+
not_found_handling?: "single-page-application" | "404-page" | "none";
|
|
219
|
+
/**
|
|
220
|
+
* If true, route every request to the User Worker, whether or not it matches an asset.
|
|
221
|
+
* If false, then respond to requests that match an asset with that asset directly.
|
|
222
|
+
* */
|
|
223
|
+
run_worker_first?: boolean;
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
declare type AssetsOptions = {
|
|
227
|
+
directory: string;
|
|
228
|
+
binding?: string;
|
|
229
|
+
routerConfig: RouterConfig;
|
|
230
|
+
assetConfig: AssetConfig;
|
|
231
|
+
_redirects?: string;
|
|
232
|
+
_headers?: string;
|
|
233
|
+
};
|
|
234
|
+
|
|
89
235
|
declare type AsyncHook<T extends HookValues, Args extends unknown[] = []> = Hook<T, Args> | Hook<Promise<T>, Args>;
|
|
90
236
|
|
|
91
237
|
declare class BalancedPool extends Dispatcher {
|
|
@@ -123,7 +269,7 @@ declare type Binding = {
|
|
|
123
269
|
type: "kv_namespace";
|
|
124
270
|
} & BindingOmit<CfKvNamespace>) | ({
|
|
125
271
|
type: "send_email";
|
|
126
|
-
} &
|
|
272
|
+
} & NameOmit<CfSendEmailBindings>) | {
|
|
127
273
|
type: "wasm_module";
|
|
128
274
|
source: BinaryFile;
|
|
129
275
|
} | {
|
|
@@ -133,6 +279,8 @@ declare type Binding = {
|
|
|
133
279
|
type: "browser";
|
|
134
280
|
} | {
|
|
135
281
|
type: "ai";
|
|
282
|
+
} | {
|
|
283
|
+
type: "images";
|
|
136
284
|
} | {
|
|
137
285
|
type: "version_metadata";
|
|
138
286
|
} | {
|
|
@@ -140,48 +288,40 @@ declare type Binding = {
|
|
|
140
288
|
source: BinaryFile;
|
|
141
289
|
} | ({
|
|
142
290
|
type: "durable_object_namespace";
|
|
143
|
-
} &
|
|
291
|
+
} & NameOmit<CfDurableObject>) | ({
|
|
292
|
+
type: "workflow";
|
|
293
|
+
} & BindingOmit<CfWorkflow>) | ({
|
|
144
294
|
type: "queue";
|
|
145
295
|
} & BindingOmit<CfQueue>) | ({
|
|
146
296
|
type: "r2_bucket";
|
|
147
297
|
} & BindingOmit<CfR2Bucket>) | ({
|
|
148
298
|
type: "d1";
|
|
149
|
-
} &
|
|
299
|
+
} & BindingOmit<CfD1Database>) | ({
|
|
150
300
|
type: "vectorize";
|
|
151
|
-
} &
|
|
301
|
+
} & BindingOmit<CfVectorize>) | ({
|
|
152
302
|
type: "hyperdrive";
|
|
153
|
-
} &
|
|
303
|
+
} & BindingOmit<CfHyperdrive>) | ({
|
|
154
304
|
type: "service";
|
|
155
|
-
} &
|
|
305
|
+
} & BindingOmit<CfService>) | {
|
|
156
306
|
type: "fetcher";
|
|
157
307
|
fetcher: ServiceFetch;
|
|
158
308
|
} | ({
|
|
159
309
|
type: "analytics_engine";
|
|
160
|
-
} &
|
|
310
|
+
} & BindingOmit<CfAnalyticsEngineDataset>) | ({
|
|
161
311
|
type: "dispatch_namespace";
|
|
162
|
-
} &
|
|
312
|
+
} & BindingOmit<CfDispatchNamespace>) | ({
|
|
163
313
|
type: "mtls_certificate";
|
|
164
|
-
} &
|
|
314
|
+
} & BindingOmit<CfMTlsCertificate>) | ({
|
|
165
315
|
type: "pipeline";
|
|
166
|
-
} &
|
|
316
|
+
} & BindingOmit<CfPipeline>) | ({
|
|
167
317
|
type: "logfwdr";
|
|
168
|
-
} &
|
|
318
|
+
} & NameOmit<CfLogfwdrBinding>) | {
|
|
169
319
|
type: `unsafe_${string}`;
|
|
170
320
|
} | {
|
|
171
321
|
type: "assets";
|
|
172
322
|
};
|
|
173
323
|
|
|
174
|
-
declare type BindingOmit<T> = Omit<T, "binding"
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* Result of the `getBindingsProxy` utility
|
|
178
|
-
*/
|
|
179
|
-
export declare type BindingsProxy<Bindings = Record<string, unknown>, CfProperties extends Record<string, unknown> = IncomingRequestCfProperties> = Omit<PlatformProxy<Bindings, CfProperties>, "env"> & {
|
|
180
|
-
/**
|
|
181
|
-
* Object containing the various proxies
|
|
182
|
-
*/
|
|
183
|
-
bindings: Bindings;
|
|
184
|
-
};
|
|
324
|
+
declare type BindingOmit<T> = Omit<T, "binding">;
|
|
185
325
|
|
|
186
326
|
declare interface BlobPropertyBag {
|
|
187
327
|
type?: string
|
|
@@ -192,7 +332,7 @@ declare type BodyInit =
|
|
|
192
332
|
| ArrayBuffer
|
|
193
333
|
| AsyncIterable<Uint8Array>
|
|
194
334
|
| Blob_2
|
|
195
|
-
|
|
|
335
|
+
| FormData_2
|
|
196
336
|
| Iterable<Uint8Array>
|
|
197
337
|
| NodeJS.ArrayBufferView
|
|
198
338
|
| URLSearchParams_2
|
|
@@ -200,12 +340,12 @@ declare type BodyInit =
|
|
|
200
340
|
| string
|
|
201
341
|
|
|
202
342
|
declare interface BodyMixin {
|
|
203
|
-
readonly body:
|
|
343
|
+
readonly body: ReadableStream_2 | null
|
|
204
344
|
readonly bodyUsed: boolean
|
|
205
345
|
|
|
206
346
|
readonly arrayBuffer: () => Promise<ArrayBuffer>
|
|
207
347
|
readonly blob: () => Promise<Blob_2>
|
|
208
|
-
readonly formData: () => Promise<
|
|
348
|
+
readonly formData: () => Promise<FormData_2>
|
|
209
349
|
readonly json: () => Promise<unknown>
|
|
210
350
|
readonly text: () => Promise<string>
|
|
211
351
|
}
|
|
@@ -325,13 +465,13 @@ declare type BundleStartEvent = {
|
|
|
325
465
|
};
|
|
326
466
|
|
|
327
467
|
declare interface Cache {
|
|
328
|
-
match (request: RequestInfo, options?: CacheQueryOptions): Promise<
|
|
329
|
-
matchAll (request?: RequestInfo, options?: CacheQueryOptions): Promise<readonly
|
|
468
|
+
match (request: RequestInfo, options?: CacheQueryOptions): Promise<Response_2 | undefined>,
|
|
469
|
+
matchAll (request?: RequestInfo, options?: CacheQueryOptions): Promise<readonly Response_2[]>,
|
|
330
470
|
add (request: RequestInfo): Promise<undefined>,
|
|
331
471
|
addAll (requests: RequestInfo[]): Promise<undefined>,
|
|
332
|
-
put (request: RequestInfo, response:
|
|
472
|
+
put (request: RequestInfo, response: Response_2): Promise<undefined>,
|
|
333
473
|
delete (request: RequestInfo, options?: CacheQueryOptions): Promise<boolean>,
|
|
334
|
-
keys (request?: RequestInfo, options?: CacheQueryOptions): Promise<readonly
|
|
474
|
+
keys (request?: RequestInfo, options?: CacheQueryOptions): Promise<readonly Request_2[]>
|
|
335
475
|
}
|
|
336
476
|
|
|
337
477
|
/**
|
|
@@ -360,7 +500,7 @@ declare type CacheResponse = any;
|
|
|
360
500
|
declare const caches: CacheStorage;
|
|
361
501
|
|
|
362
502
|
declare interface CacheStorage {
|
|
363
|
-
match (request: RequestInfo, options?: MultiCacheQueryOptions): Promise<
|
|
503
|
+
match (request: RequestInfo, options?: MultiCacheQueryOptions): Promise<Response_2 | undefined>,
|
|
364
504
|
has (cacheName: string): Promise<boolean>,
|
|
365
505
|
open (cacheName: string): Promise<Cache>,
|
|
366
506
|
delete (cacheName: string): Promise<boolean>,
|
|
@@ -433,8 +573,8 @@ declare type CfCapnp = {
|
|
|
433
573
|
|
|
434
574
|
declare interface CfD1Database {
|
|
435
575
|
binding: string;
|
|
436
|
-
database_id
|
|
437
|
-
database_name
|
|
576
|
+
database_id?: string | typeof INHERIT_SYMBOL;
|
|
577
|
+
database_name?: string;
|
|
438
578
|
preview_database_id?: string;
|
|
439
579
|
database_internal_env?: string;
|
|
440
580
|
migrations_table?: string;
|
|
@@ -472,7 +612,7 @@ declare interface CfHyperdrive {
|
|
|
472
612
|
*/
|
|
473
613
|
declare interface CfKvNamespace {
|
|
474
614
|
binding: string;
|
|
475
|
-
id
|
|
615
|
+
id?: string | typeof INHERIT_SYMBOL;
|
|
476
616
|
}
|
|
477
617
|
|
|
478
618
|
declare interface CfLogfwdrBinding {
|
|
@@ -510,7 +650,7 @@ declare interface CfModule {
|
|
|
510
650
|
* }
|
|
511
651
|
* }
|
|
512
652
|
*/
|
|
513
|
-
content: string | Buffer
|
|
653
|
+
content: string | Buffer<ArrayBuffer>;
|
|
514
654
|
/**
|
|
515
655
|
* An optional sourcemap for this module if it's of a ESM or CJS type, this will only be present
|
|
516
656
|
* if we're deploying with sourcemaps enabled. Since we copy extra modules that aren't bundled
|
|
@@ -548,7 +688,7 @@ declare interface CfQueue {
|
|
|
548
688
|
|
|
549
689
|
declare interface CfR2Bucket {
|
|
550
690
|
binding: string;
|
|
551
|
-
bucket_name
|
|
691
|
+
bucket_name?: string | typeof INHERIT_SYMBOL;
|
|
552
692
|
jurisdiction?: string;
|
|
553
693
|
}
|
|
554
694
|
|
|
@@ -617,6 +757,13 @@ declare interface CfWorkerSourceMap {
|
|
|
617
757
|
content: string | Buffer;
|
|
618
758
|
}
|
|
619
759
|
|
|
760
|
+
declare interface CfWorkflow {
|
|
761
|
+
name: string;
|
|
762
|
+
class_name: string;
|
|
763
|
+
binding: string;
|
|
764
|
+
script_name?: string;
|
|
765
|
+
}
|
|
766
|
+
|
|
620
767
|
/**
|
|
621
768
|
* A basic HTTP/1.1 client, mapped on top a single TCP/TLS connection. Pipelining is disabled by default.
|
|
622
769
|
*/
|
|
@@ -736,34 +883,25 @@ declare type CloudchamberConfig = {
|
|
|
736
883
|
ipv4?: boolean;
|
|
737
884
|
};
|
|
738
885
|
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
* - Fields that are specified in `PagesConfigFields` are only relevant for Pages projects
|
|
753
|
-
* - All top level fields in config and environments are optional in the wrangler.toml file.
|
|
754
|
-
*
|
|
755
|
-
* Legend for the annotations:
|
|
756
|
-
*
|
|
757
|
-
* - `@breaking`: the deprecation/optionality is a breaking change from Wrangler v1.
|
|
758
|
-
* - `@todo`: there's more work to be done (with details attached).
|
|
759
|
-
*/
|
|
760
|
-
declare type Config = ConfigFields<DevConfig> & PagesConfigFields & Environment;
|
|
886
|
+
declare interface ComputedFields {
|
|
887
|
+
/** The path to the Wrangler configuration file (if any, and possibly redirected from the user Wrangler configuration) used to create this configuration. */
|
|
888
|
+
configPath: string | undefined;
|
|
889
|
+
/** 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. */
|
|
890
|
+
userConfigPath: string | undefined;
|
|
891
|
+
/**
|
|
892
|
+
* The original top level name for the Worker in the raw configuration.
|
|
893
|
+
*
|
|
894
|
+
* When a raw configuration has been flattened to a single environment the worker name may have been replaced or transformed.
|
|
895
|
+
* It can be useful to know what the top-level name was before the flattening.
|
|
896
|
+
*/
|
|
897
|
+
topLevelName: string | undefined;
|
|
898
|
+
}
|
|
761
899
|
|
|
762
900
|
declare class ConfigController extends Controller<ConfigControllerEventMap> {
|
|
763
901
|
#private;
|
|
764
902
|
latestInput?: StartDevWorkerInput;
|
|
765
903
|
latestConfig?: StartDevWorkerOptions;
|
|
766
|
-
set(input: StartDevWorkerInput): Promise<StartDevWorkerOptions | undefined>;
|
|
904
|
+
set(input: StartDevWorkerInput, throwErrors?: boolean): Promise<StartDevWorkerOptions | undefined>;
|
|
767
905
|
patch(input: Partial<StartDevWorkerInput>): Promise<StartDevWorkerOptions | undefined>;
|
|
768
906
|
teardown(): Promise<void>;
|
|
769
907
|
emitConfigUpdateEvent(config: StartDevWorkerOptions): void;
|
|
@@ -774,7 +912,6 @@ declare type ConfigControllerEventMap = ControllerEventMap & {
|
|
|
774
912
|
};
|
|
775
913
|
|
|
776
914
|
declare interface ConfigFields<Dev extends RawDevConfig> {
|
|
777
|
-
configPath: string | undefined;
|
|
778
915
|
/**
|
|
779
916
|
* A boolean to enable "legacy" style wrangler environments (from Wrangler v1).
|
|
780
917
|
* These have been superseded by Services, but there may be projects that won't
|
|
@@ -803,7 +940,7 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
|
|
|
803
940
|
/**
|
|
804
941
|
* The directory containing your static assets.
|
|
805
942
|
*
|
|
806
|
-
* It must be a path relative to your
|
|
943
|
+
* It must be a path relative to your Wrangler configuration file.
|
|
807
944
|
* Example: bucket = "./public"
|
|
808
945
|
*
|
|
809
946
|
* If there is a `site` field then it must contain this `bucket` field.
|
|
@@ -835,18 +972,6 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
|
|
|
835
972
|
*/
|
|
836
973
|
exclude?: string[];
|
|
837
974
|
} | undefined;
|
|
838
|
-
/**
|
|
839
|
-
* Serve a folder of static assets with your Worker, without any additional code.
|
|
840
|
-
* This can either be a string, or an object with additional config fields.
|
|
841
|
-
* Only one of assets and legacy_assets can be used.
|
|
842
|
-
*/
|
|
843
|
-
legacy_assets: {
|
|
844
|
-
bucket: string;
|
|
845
|
-
include: string[];
|
|
846
|
-
exclude: string[];
|
|
847
|
-
browser_TTL: number | undefined;
|
|
848
|
-
serve_single_page_app: boolean;
|
|
849
|
-
} | string | undefined;
|
|
850
975
|
/**
|
|
851
976
|
* A list of wasm modules that your worker should be bound to. This is
|
|
852
977
|
* the "legacy" way of binding to a wasm module. ES module workers should
|
|
@@ -879,7 +1004,7 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
|
|
|
879
1004
|
[key: string]: string;
|
|
880
1005
|
} | undefined;
|
|
881
1006
|
/**
|
|
882
|
-
* By default,
|
|
1007
|
+
* By default, the Wrangler configuration file is the source of truth for your environment configuration, like a terraform file.
|
|
883
1008
|
*
|
|
884
1009
|
* If you change your vars in the dashboard, wrangler *will* override/delete them on its next deploy.
|
|
885
1010
|
*
|
|
@@ -907,6 +1032,32 @@ url: string | URL_2 | UrlObject,
|
|
|
907
1032
|
options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.ConnectOptions, 'origin' | 'path'>
|
|
908
1033
|
): Promise<Dispatcher.ConnectData>;
|
|
909
1034
|
|
|
1035
|
+
/**
|
|
1036
|
+
* Configuration for a container application
|
|
1037
|
+
*/
|
|
1038
|
+
declare type ContainerApp = {
|
|
1039
|
+
name: string;
|
|
1040
|
+
instances: number;
|
|
1041
|
+
scheduling_policy?: "regional" | "moon";
|
|
1042
|
+
configuration: {
|
|
1043
|
+
image: string;
|
|
1044
|
+
labels?: {
|
|
1045
|
+
name: string;
|
|
1046
|
+
value: string;
|
|
1047
|
+
}[];
|
|
1048
|
+
secrets?: {
|
|
1049
|
+
name: string;
|
|
1050
|
+
type: "env";
|
|
1051
|
+
secret: string;
|
|
1052
|
+
}[];
|
|
1053
|
+
};
|
|
1054
|
+
constraints?: {
|
|
1055
|
+
regions?: string[];
|
|
1056
|
+
cities?: string[];
|
|
1057
|
+
tier?: number;
|
|
1058
|
+
};
|
|
1059
|
+
};
|
|
1060
|
+
|
|
910
1061
|
declare abstract class Controller<EventMap extends ControllerEventMap = ControllerEventMap> extends TypedEventEmitterImpl<EventMap> {
|
|
911
1062
|
emitErrorEvent(data: ErrorEvent): void;
|
|
912
1063
|
}
|
|
@@ -946,7 +1097,7 @@ declare type DeferredPromise<T> = {
|
|
|
946
1097
|
};
|
|
947
1098
|
|
|
948
1099
|
declare function deleteCookie (
|
|
949
|
-
headers:
|
|
1100
|
+
headers: Headers_2,
|
|
950
1101
|
name: string,
|
|
951
1102
|
attributes?: { name?: string, domain?: string }
|
|
952
1103
|
): void
|
|
@@ -957,99 +1108,71 @@ attributes?: { name?: string, domain?: string }
|
|
|
957
1108
|
* variable set
|
|
958
1109
|
*/
|
|
959
1110
|
declare function deploy({ directory, accountId, projectName, branch, skipCaching, commitMessage, commitHash, commitDirty, functionsDirectory: customFunctionsDirectory, bundle, sourceMaps, args, }: PagesDeployOptions): Promise<{
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
latest_stage: {
|
|
984
|
-
name: "build" | "deploy" | "queued" | "initialize" | "clone_repo";
|
|
985
|
-
status: "active" | "idle" | "canceled" | "success" | "failure" | "skipped";
|
|
986
|
-
started_on: string | null;
|
|
987
|
-
ended_on: string | null;
|
|
988
|
-
};
|
|
989
|
-
stages: {
|
|
990
|
-
name: "build" | "deploy" | "queued" | "initialize" | "clone_repo";
|
|
991
|
-
status: "active" | "idle" | "canceled" | "success" | "failure" | "skipped";
|
|
992
|
-
started_on: string | null;
|
|
993
|
-
ended_on: string | null;
|
|
994
|
-
}[];
|
|
995
|
-
aliases: string[];
|
|
996
|
-
modified_on: string;
|
|
997
|
-
short_id: string;
|
|
998
|
-
build_image_major_version: number;
|
|
999
|
-
source?: {
|
|
1000
|
-
type: "github" | "gitlab";
|
|
1001
|
-
config: {
|
|
1002
|
-
owner: string;
|
|
1003
|
-
repo_name: string;
|
|
1004
|
-
production_branch?: string | undefined;
|
|
1005
|
-
pr_comments_enabled?: boolean | undefined;
|
|
1006
|
-
deployments_enabled?: boolean | undefined;
|
|
1007
|
-
production_deployments_enabled?: boolean | undefined;
|
|
1008
|
-
preview_deployment_setting?: "none" | "all" | "custom" | undefined;
|
|
1009
|
-
preview_branch_includes?: string[] | undefined;
|
|
1010
|
-
preview_branch_excludes?: string[] | undefined;
|
|
1111
|
+
deploymentResponse: {
|
|
1112
|
+
url: string;
|
|
1113
|
+
id: string;
|
|
1114
|
+
environment: "production" | "preview";
|
|
1115
|
+
build_config: {
|
|
1116
|
+
build_command: string;
|
|
1117
|
+
destination_dir: string;
|
|
1118
|
+
root_dir: string;
|
|
1119
|
+
web_analytics_tag?: string | undefined;
|
|
1120
|
+
web_analytics_token?: string | undefined;
|
|
1121
|
+
fast_builds?: boolean | undefined;
|
|
1122
|
+
};
|
|
1123
|
+
created_on: string;
|
|
1124
|
+
production_branch: string;
|
|
1125
|
+
project_id: string;
|
|
1126
|
+
project_name: string;
|
|
1127
|
+
deployment_trigger: {
|
|
1128
|
+
metadata: {
|
|
1129
|
+
branch: string;
|
|
1130
|
+
commit_hash: string;
|
|
1131
|
+
commit_message: string;
|
|
1132
|
+
};
|
|
1133
|
+
type: string;
|
|
1011
1134
|
};
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1135
|
+
latest_stage: {
|
|
1136
|
+
status: "canceled" | "active" | "idle" | "success" | "failure" | "skipped";
|
|
1137
|
+
name: "queued" | "build" | "deploy" | "initialize" | "clone_repo";
|
|
1138
|
+
started_on: string | null;
|
|
1139
|
+
ended_on: string | null;
|
|
1140
|
+
};
|
|
1141
|
+
stages: {
|
|
1142
|
+
status: "canceled" | "active" | "idle" | "success" | "failure" | "skipped";
|
|
1143
|
+
name: "queued" | "build" | "deploy" | "initialize" | "clone_repo";
|
|
1144
|
+
started_on: string | null;
|
|
1145
|
+
ended_on: string | null;
|
|
1146
|
+
}[];
|
|
1147
|
+
aliases: string[];
|
|
1148
|
+
modified_on: string;
|
|
1149
|
+
short_id: string;
|
|
1150
|
+
build_image_major_version: number;
|
|
1151
|
+
kv_namespaces?: any;
|
|
1152
|
+
source?: {
|
|
1153
|
+
config: {
|
|
1154
|
+
owner: string;
|
|
1155
|
+
repo_name: string;
|
|
1156
|
+
production_branch?: string | undefined;
|
|
1157
|
+
pr_comments_enabled?: boolean | undefined;
|
|
1158
|
+
deployments_enabled?: boolean | undefined;
|
|
1159
|
+
production_deployments_enabled?: boolean | undefined;
|
|
1160
|
+
preview_deployment_setting?: "none" | "custom" | "all" | undefined;
|
|
1161
|
+
preview_branch_includes?: string[] | undefined;
|
|
1162
|
+
preview_branch_excludes?: string[] | undefined;
|
|
1163
|
+
};
|
|
1164
|
+
type: "github" | "gitlab";
|
|
1165
|
+
} | undefined;
|
|
1166
|
+
env_vars?: any;
|
|
1167
|
+
durable_object_namespaces?: any;
|
|
1168
|
+
is_skipped?: boolean | undefined;
|
|
1169
|
+
files?: {
|
|
1170
|
+
[x: string]: string | undefined;
|
|
1171
|
+
} | undefined;
|
|
1172
|
+
};
|
|
1173
|
+
formData: FormData_2;
|
|
1020
1174
|
}>;
|
|
1021
1175
|
|
|
1022
|
-
/**
|
|
1023
|
-
* Deprecated upload configuration.
|
|
1024
|
-
*/
|
|
1025
|
-
declare interface DeprecatedUpload {
|
|
1026
|
-
/**
|
|
1027
|
-
* The format of the Worker script.
|
|
1028
|
-
*
|
|
1029
|
-
* @deprecated We infer the format automatically now.
|
|
1030
|
-
*/
|
|
1031
|
-
format?: "modules" | "service-worker";
|
|
1032
|
-
/**
|
|
1033
|
-
* The directory you wish to upload your Worker from,
|
|
1034
|
-
* relative to the wrangler.toml file.
|
|
1035
|
-
*
|
|
1036
|
-
* Defaults to the directory containing the wrangler.toml file.
|
|
1037
|
-
*
|
|
1038
|
-
* @deprecated
|
|
1039
|
-
*/
|
|
1040
|
-
dir?: string;
|
|
1041
|
-
/**
|
|
1042
|
-
* The path to the Worker script, relative to `upload.dir`.
|
|
1043
|
-
*
|
|
1044
|
-
* @deprecated This will be replaced by a command line argument.
|
|
1045
|
-
*/
|
|
1046
|
-
main?: string;
|
|
1047
|
-
/**
|
|
1048
|
-
* @deprecated This is now defined at the top level `rules` field.
|
|
1049
|
-
*/
|
|
1050
|
-
rules?: Environment["rules"];
|
|
1051
|
-
}
|
|
1052
|
-
|
|
1053
1176
|
declare interface DevConfig {
|
|
1054
1177
|
/**
|
|
1055
1178
|
* IP address for the local dev server to listen on,
|
|
@@ -1245,7 +1368,7 @@ declare namespace Dispatcher {
|
|
|
1245
1368
|
path: string;
|
|
1246
1369
|
method: HttpMethod;
|
|
1247
1370
|
/** Default: `null` */
|
|
1248
|
-
body?: string | Buffer | Uint8Array | Readable | null |
|
|
1371
|
+
body?: string | Buffer | Uint8Array | Readable | null | FormData_2;
|
|
1249
1372
|
/** Default: `null` */
|
|
1250
1373
|
headers?: IncomingHttpHeaders | string[] | null;
|
|
1251
1374
|
/** Query string params to be embedded in the request URL. Default: `null` */
|
|
@@ -1396,7 +1519,7 @@ declare interface DispatchNamespaceOutbound {
|
|
|
1396
1519
|
parameters?: string[];
|
|
1397
1520
|
}
|
|
1398
1521
|
|
|
1399
|
-
declare type
|
|
1522
|
+
declare type DOMException_2 = typeof globalThis extends { DOMException: infer T }
|
|
1400
1523
|
? T
|
|
1401
1524
|
: any
|
|
1402
1525
|
|
|
@@ -1443,8 +1566,8 @@ declare interface EnablePagesAssetsServiceBindingOptions {
|
|
|
1443
1566
|
declare type Entry = {
|
|
1444
1567
|
/** A worker's entrypoint */
|
|
1445
1568
|
file: string;
|
|
1446
|
-
/** A worker's directory. Usually where the
|
|
1447
|
-
|
|
1569
|
+
/** A worker's directory. Usually where the Wrangler configuration file is located */
|
|
1570
|
+
projectRoot: string;
|
|
1448
1571
|
/** Is this a module worker or a service worker? */
|
|
1449
1572
|
format: CfScriptFormat;
|
|
1450
1573
|
/** The directory that contains all of a `--no-bundle` worker's modules. Usually `${directory}/src`. Defaults to path.dirname(file) */
|
|
@@ -1453,6 +1576,8 @@ declare type Entry = {
|
|
|
1453
1576
|
* A worker's name
|
|
1454
1577
|
*/
|
|
1455
1578
|
name?: string | undefined;
|
|
1579
|
+
/** Export from a Worker's entrypoint */
|
|
1580
|
+
exports: string[];
|
|
1456
1581
|
};
|
|
1457
1582
|
|
|
1458
1583
|
/**
|
|
@@ -1496,11 +1621,11 @@ declare interface EnvironmentInheritable {
|
|
|
1496
1621
|
compatibility_date: string | undefined;
|
|
1497
1622
|
/**
|
|
1498
1623
|
* A list of flags that enable features from upcoming features of
|
|
1499
|
-
* the Workers runtime, usually used together with
|
|
1624
|
+
* the Workers runtime, usually used together with compatibility_date.
|
|
1500
1625
|
*
|
|
1501
|
-
* More details at https://developers.cloudflare.com/workers/platform/compatibility-
|
|
1626
|
+
* More details at https://developers.cloudflare.com/workers/platform/compatibility-flags
|
|
1502
1627
|
*
|
|
1503
|
-
* @default
|
|
1628
|
+
* @default []
|
|
1504
1629
|
* @inheritable
|
|
1505
1630
|
*/
|
|
1506
1631
|
compatibility_flags: string[];
|
|
@@ -1538,13 +1663,20 @@ declare interface EnvironmentInheritable {
|
|
|
1538
1663
|
* Whether we use <name>.<subdomain>.workers.dev to
|
|
1539
1664
|
* test and deploy your Worker.
|
|
1540
1665
|
*
|
|
1541
|
-
*
|
|
1542
|
-
*
|
|
1543
|
-
* @default `true` (This is a breaking change from Wrangler v1)
|
|
1666
|
+
*
|
|
1667
|
+
* @default true
|
|
1544
1668
|
* @breaking
|
|
1545
1669
|
* @inheritable
|
|
1546
1670
|
*/
|
|
1547
1671
|
workers_dev: boolean | undefined;
|
|
1672
|
+
/**
|
|
1673
|
+
* Whether we use <version>-<name>.<subdomain>.workers.dev to
|
|
1674
|
+
* serve Preview URLs for your Worker.
|
|
1675
|
+
*
|
|
1676
|
+
* @default true
|
|
1677
|
+
* @inheritable
|
|
1678
|
+
*/
|
|
1679
|
+
preview_urls: boolean | undefined;
|
|
1548
1680
|
/**
|
|
1549
1681
|
* A list of routes that your Worker should be published to.
|
|
1550
1682
|
* Only one of `routes` or `route` is required.
|
|
@@ -1573,14 +1705,14 @@ declare interface EnvironmentInheritable {
|
|
|
1573
1705
|
/**
|
|
1574
1706
|
* The function to use to replace jsx syntax.
|
|
1575
1707
|
*
|
|
1576
|
-
* @default
|
|
1708
|
+
* @default "React.createElement"
|
|
1577
1709
|
* @inheritable
|
|
1578
1710
|
*/
|
|
1579
1711
|
jsx_factory: string;
|
|
1580
1712
|
/**
|
|
1581
1713
|
* The function to use to replace jsx fragment syntax.
|
|
1582
1714
|
*
|
|
1583
|
-
* @default
|
|
1715
|
+
* @default "React.Fragment"
|
|
1584
1716
|
* @inheritable
|
|
1585
1717
|
*/
|
|
1586
1718
|
jsx_fragment: string;
|
|
@@ -1602,24 +1734,12 @@ declare interface EnvironmentInheritable {
|
|
|
1602
1734
|
*
|
|
1603
1735
|
* More details here https://developers.cloudflare.com/workers/platform/cron-triggers
|
|
1604
1736
|
*
|
|
1605
|
-
* @default
|
|
1737
|
+
* @default {crons:[]}
|
|
1606
1738
|
* @inheritable
|
|
1607
1739
|
*/
|
|
1608
1740
|
triggers: {
|
|
1609
1741
|
crons: string[];
|
|
1610
1742
|
};
|
|
1611
|
-
/**
|
|
1612
|
-
* Specifies the Usage Model for your Worker. There are two options -
|
|
1613
|
-
* [bundled](https://developers.cloudflare.com/workers/platform/limits#bundled-usage-model) and
|
|
1614
|
-
* [unbound](https://developers.cloudflare.com/workers/platform/limits#unbound-usage-model).
|
|
1615
|
-
* For newly created Workers, if the Usage Model is omitted
|
|
1616
|
-
* it will be set to the [default Usage Model set on the account](https://dash.cloudflare.com/?account=workers/default-usage-model).
|
|
1617
|
-
* For existing Workers, if the Usage Model is omitted, it will be
|
|
1618
|
-
* set to the Usage Model configured in the dashboard for that Worker.
|
|
1619
|
-
*
|
|
1620
|
-
* @inheritable
|
|
1621
|
-
*/
|
|
1622
|
-
usage_model: "bundled" | "unbound" | undefined;
|
|
1623
1743
|
/**
|
|
1624
1744
|
* Specify limits for runtime behavior.
|
|
1625
1745
|
* Only supported for the "standard" Usage Model
|
|
@@ -1651,11 +1771,6 @@ declare interface EnvironmentInheritable {
|
|
|
1651
1771
|
cwd?: string;
|
|
1652
1772
|
/** The directory to watch for changes while using wrangler dev, defaults to the current working directory */
|
|
1653
1773
|
watch_dir?: string | string[];
|
|
1654
|
-
/**
|
|
1655
|
-
* Deprecated field previously used to configure the build and upload of the script.
|
|
1656
|
-
* @deprecated
|
|
1657
|
-
*/
|
|
1658
|
-
upload?: DeprecatedUpload;
|
|
1659
1774
|
};
|
|
1660
1775
|
/**
|
|
1661
1776
|
* Skip internal build steps and directly deploy script
|
|
@@ -1667,28 +1782,16 @@ declare interface EnvironmentInheritable {
|
|
|
1667
1782
|
* @inheritable
|
|
1668
1783
|
*/
|
|
1669
1784
|
minify: boolean | undefined;
|
|
1670
|
-
/**
|
|
1671
|
-
* Add polyfills for node builtin modules and globals
|
|
1672
|
-
* @inheritable
|
|
1673
|
-
*/
|
|
1674
|
-
node_compat: boolean | undefined;
|
|
1675
1785
|
/**
|
|
1676
1786
|
* Designates this Worker as an internal-only "first-party" Worker.
|
|
1677
1787
|
*
|
|
1678
1788
|
* @inheritable
|
|
1679
1789
|
*/
|
|
1680
1790
|
first_party_worker: boolean | undefined;
|
|
1681
|
-
/**
|
|
1682
|
-
* TODO: remove this as it has been deprecated.
|
|
1683
|
-
*
|
|
1684
|
-
* This is just here for now because the `route` commands use it.
|
|
1685
|
-
* So we need to include it in this type so it is available.
|
|
1686
|
-
*/
|
|
1687
|
-
zone_id?: string;
|
|
1688
1791
|
/**
|
|
1689
1792
|
* List of bindings that you will send to logfwdr
|
|
1690
1793
|
*
|
|
1691
|
-
* @default
|
|
1794
|
+
* @default {bindings:[]}
|
|
1692
1795
|
* @inheritable
|
|
1693
1796
|
*/
|
|
1694
1797
|
logfwdr: {
|
|
@@ -1729,9 +1832,11 @@ declare interface EnvironmentInheritable {
|
|
|
1729
1832
|
/**
|
|
1730
1833
|
* Specify the directory of static assets to deploy/serve
|
|
1731
1834
|
*
|
|
1835
|
+
* More details at https://developers.cloudflare.com/workers/frameworks/
|
|
1836
|
+
*
|
|
1732
1837
|
* @inheritable
|
|
1733
1838
|
*/
|
|
1734
|
-
|
|
1839
|
+
assets: Assets | undefined;
|
|
1735
1840
|
/**
|
|
1736
1841
|
* Specify the observability behavior of the Worker.
|
|
1737
1842
|
*
|
|
@@ -1740,6 +1845,24 @@ declare interface EnvironmentInheritable {
|
|
|
1740
1845
|
observability: Observability | undefined;
|
|
1741
1846
|
}
|
|
1742
1847
|
|
|
1848
|
+
declare interface EnvironmentMap {
|
|
1849
|
+
/**
|
|
1850
|
+
* The `env` section defines overrides for the configuration for different environments.
|
|
1851
|
+
*
|
|
1852
|
+
* All environment fields can be specified at the top level of the config indicating the default environment settings.
|
|
1853
|
+
*
|
|
1854
|
+
* - Some fields are inherited and overridable in each environment.
|
|
1855
|
+
* - But some are not inherited and must be explicitly specified in every environment, if they are specified at the top level.
|
|
1856
|
+
*
|
|
1857
|
+
* For more information, see the documentation at https://developers.cloudflare.com/workers/cli-wrangler/configuration#environments
|
|
1858
|
+
*
|
|
1859
|
+
* @default {}
|
|
1860
|
+
*/
|
|
1861
|
+
env?: {
|
|
1862
|
+
[envName: string]: Unstable_RawEnvironment;
|
|
1863
|
+
};
|
|
1864
|
+
}
|
|
1865
|
+
|
|
1743
1866
|
/**
|
|
1744
1867
|
* The `EnvironmentNonInheritable` interface declares all the configuration fields for an environment
|
|
1745
1868
|
* that cannot be inherited from the top-level environment, and must be defined specifically.
|
|
@@ -1754,7 +1877,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1754
1877
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1755
1878
|
* and so must be specified in every named environment.
|
|
1756
1879
|
*
|
|
1757
|
-
* @default
|
|
1880
|
+
* @default {}
|
|
1758
1881
|
* @nonInheritable
|
|
1759
1882
|
*/
|
|
1760
1883
|
define: Record<string, string>;
|
|
@@ -1764,7 +1887,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1764
1887
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1765
1888
|
* and so must be specified in every named environment.
|
|
1766
1889
|
*
|
|
1767
|
-
* @default
|
|
1890
|
+
* @default {}
|
|
1768
1891
|
* @nonInheritable
|
|
1769
1892
|
*/
|
|
1770
1893
|
vars: Record<string, string | Json>;
|
|
@@ -1777,22 +1900,47 @@ declare interface EnvironmentNonInheritable {
|
|
|
1777
1900
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1778
1901
|
* and so must be specified in every named environment.
|
|
1779
1902
|
*
|
|
1780
|
-
* @default
|
|
1903
|
+
* @default {bindings:[]}
|
|
1781
1904
|
* @nonInheritable
|
|
1782
1905
|
*/
|
|
1783
1906
|
durable_objects: {
|
|
1784
1907
|
bindings: DurableObjectBindings;
|
|
1785
1908
|
};
|
|
1909
|
+
/**
|
|
1910
|
+
* A list of workflows that your Worker should be bound to.
|
|
1911
|
+
*
|
|
1912
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1913
|
+
* and so must be specified in every named environment.
|
|
1914
|
+
*
|
|
1915
|
+
* @default []
|
|
1916
|
+
* @nonInheritable
|
|
1917
|
+
*/
|
|
1918
|
+
workflows: WorkflowBinding[];
|
|
1786
1919
|
/**
|
|
1787
1920
|
* Cloudchamber configuration
|
|
1788
1921
|
*
|
|
1789
1922
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1790
1923
|
* and so must be specified in every named environment.
|
|
1791
1924
|
*
|
|
1792
|
-
* @default
|
|
1925
|
+
* @default {}
|
|
1793
1926
|
* @nonInheritable
|
|
1794
1927
|
*/
|
|
1795
1928
|
cloudchamber: CloudchamberConfig;
|
|
1929
|
+
/**
|
|
1930
|
+
* Container related configuration
|
|
1931
|
+
*/
|
|
1932
|
+
containers: {
|
|
1933
|
+
/**
|
|
1934
|
+
* Container app configuration
|
|
1935
|
+
*
|
|
1936
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1937
|
+
* and so must be specified in every named environment.
|
|
1938
|
+
*
|
|
1939
|
+
* @default {}
|
|
1940
|
+
* @nonInheritable
|
|
1941
|
+
*/
|
|
1942
|
+
app: ContainerApp[];
|
|
1943
|
+
};
|
|
1796
1944
|
/**
|
|
1797
1945
|
* These specify any Workers KV Namespaces you want to
|
|
1798
1946
|
* access from inside your Worker.
|
|
@@ -1803,14 +1951,14 @@ declare interface EnvironmentNonInheritable {
|
|
|
1803
1951
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1804
1952
|
* and so must be specified in every named environment.
|
|
1805
1953
|
*
|
|
1806
|
-
* @default
|
|
1954
|
+
* @default []
|
|
1807
1955
|
* @nonInheritable
|
|
1808
1956
|
*/
|
|
1809
1957
|
kv_namespaces: {
|
|
1810
1958
|
/** The binding name used to refer to the KV Namespace */
|
|
1811
1959
|
binding: string;
|
|
1812
1960
|
/** The ID of the KV namespace */
|
|
1813
|
-
id
|
|
1961
|
+
id?: string;
|
|
1814
1962
|
/** The ID of the KV namespace used during `wrangler dev` */
|
|
1815
1963
|
preview_id?: string;
|
|
1816
1964
|
}[];
|
|
@@ -1820,7 +1968,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1820
1968
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1821
1969
|
* and so must be specified in every named environment.
|
|
1822
1970
|
*
|
|
1823
|
-
* @default
|
|
1971
|
+
* @default []
|
|
1824
1972
|
* @nonInheritable
|
|
1825
1973
|
*/
|
|
1826
1974
|
send_email: {
|
|
@@ -1837,7 +1985,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1837
1985
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1838
1986
|
* and so must be specified in every named environment.
|
|
1839
1987
|
*
|
|
1840
|
-
* @default
|
|
1988
|
+
* @default {consumers:[],producers:[]}
|
|
1841
1989
|
* @nonInheritable
|
|
1842
1990
|
*/
|
|
1843
1991
|
queues: {
|
|
@@ -1878,14 +2026,14 @@ declare interface EnvironmentNonInheritable {
|
|
|
1878
2026
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1879
2027
|
* and so must be specified in every named environment.
|
|
1880
2028
|
*
|
|
1881
|
-
* @default
|
|
2029
|
+
* @default []
|
|
1882
2030
|
* @nonInheritable
|
|
1883
2031
|
*/
|
|
1884
2032
|
r2_buckets: {
|
|
1885
2033
|
/** The binding name used to refer to the R2 bucket in the Worker. */
|
|
1886
2034
|
binding: string;
|
|
1887
2035
|
/** The name of this R2 bucket at the edge. */
|
|
1888
|
-
bucket_name
|
|
2036
|
+
bucket_name?: string;
|
|
1889
2037
|
/** The preview name of this R2 bucket at the edge. */
|
|
1890
2038
|
preview_bucket_name?: string;
|
|
1891
2039
|
/** The jurisdiction that the bucket exists in. Default if not present. */
|
|
@@ -1897,16 +2045,16 @@ declare interface EnvironmentNonInheritable {
|
|
|
1897
2045
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1898
2046
|
* and so must be specified in every named environment.
|
|
1899
2047
|
*
|
|
1900
|
-
* @default
|
|
2048
|
+
* @default []
|
|
1901
2049
|
* @nonInheritable
|
|
1902
2050
|
*/
|
|
1903
2051
|
d1_databases: {
|
|
1904
2052
|
/** The binding name used to refer to the D1 database in the Worker. */
|
|
1905
2053
|
binding: string;
|
|
1906
2054
|
/** The name of this D1 database. */
|
|
1907
|
-
database_name
|
|
2055
|
+
database_name?: string;
|
|
1908
2056
|
/** The UUID of this D1 database (not required). */
|
|
1909
|
-
database_id
|
|
2057
|
+
database_id?: string;
|
|
1910
2058
|
/** The UUID of this D1 database for Wrangler Dev (if specified). */
|
|
1911
2059
|
preview_database_id?: string;
|
|
1912
2060
|
/** The name of the migrations table for this D1 database (defaults to 'd1_migrations'). */
|
|
@@ -1922,7 +2070,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1922
2070
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1923
2071
|
* and so must be specified in every named environment.
|
|
1924
2072
|
*
|
|
1925
|
-
* @default
|
|
2073
|
+
* @default []
|
|
1926
2074
|
* @nonInheritable
|
|
1927
2075
|
*/
|
|
1928
2076
|
vectorize: {
|
|
@@ -1937,7 +2085,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1937
2085
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1938
2086
|
* and so must be specified in every named environment.
|
|
1939
2087
|
*
|
|
1940
|
-
* @default
|
|
2088
|
+
* @default []
|
|
1941
2089
|
* @nonInheritable
|
|
1942
2090
|
*/
|
|
1943
2091
|
hyperdrive: {
|
|
@@ -1954,7 +2102,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1954
2102
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1955
2103
|
* and so must be specified in every named environment.
|
|
1956
2104
|
*
|
|
1957
|
-
* @default
|
|
2105
|
+
* @default []
|
|
1958
2106
|
* @nonInheritable
|
|
1959
2107
|
*/
|
|
1960
2108
|
services: {
|
|
@@ -1973,7 +2121,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1973
2121
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1974
2122
|
* and so must be specified in every named environment.
|
|
1975
2123
|
*
|
|
1976
|
-
* @default
|
|
2124
|
+
* @default []
|
|
1977
2125
|
* @nonInheritable
|
|
1978
2126
|
*/
|
|
1979
2127
|
analytics_engine_datasets: {
|
|
@@ -1988,7 +2136,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1988
2136
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1989
2137
|
* and so must be specified in every named environment.
|
|
1990
2138
|
*
|
|
1991
|
-
* @default
|
|
2139
|
+
* @default {}
|
|
1992
2140
|
* @nonInheritable
|
|
1993
2141
|
*/
|
|
1994
2142
|
browser: {
|
|
@@ -2000,13 +2148,25 @@ declare interface EnvironmentNonInheritable {
|
|
|
2000
2148
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2001
2149
|
* and so must be specified in every named environment.
|
|
2002
2150
|
*
|
|
2003
|
-
* @default
|
|
2151
|
+
* @default {}
|
|
2004
2152
|
* @nonInheritable
|
|
2005
2153
|
*/
|
|
2006
2154
|
ai: {
|
|
2007
2155
|
binding: string;
|
|
2008
2156
|
staging?: boolean;
|
|
2009
2157
|
} | undefined;
|
|
2158
|
+
/**
|
|
2159
|
+
* Binding to Cloudflare Images
|
|
2160
|
+
*
|
|
2161
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2162
|
+
* and so must be specified in every named environment.
|
|
2163
|
+
*
|
|
2164
|
+
* @default {}
|
|
2165
|
+
* @nonInheritable
|
|
2166
|
+
*/
|
|
2167
|
+
images: {
|
|
2168
|
+
binding: string;
|
|
2169
|
+
} | undefined;
|
|
2010
2170
|
/**
|
|
2011
2171
|
* Binding to the Worker Version's metadata
|
|
2012
2172
|
*/
|
|
@@ -2019,7 +2179,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
2019
2179
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2020
2180
|
* and so must be specified in every named environment.
|
|
2021
2181
|
*
|
|
2022
|
-
* @default
|
|
2182
|
+
* @default {}
|
|
2023
2183
|
* @nonInheritable
|
|
2024
2184
|
*/
|
|
2025
2185
|
unsafe: {
|
|
@@ -2059,7 +2219,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
2059
2219
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2060
2220
|
* and so must be specified in every named environment.
|
|
2061
2221
|
*
|
|
2062
|
-
* @default
|
|
2222
|
+
* @default []
|
|
2063
2223
|
* @nonInheritable
|
|
2064
2224
|
*/
|
|
2065
2225
|
mtls_certificates: {
|
|
@@ -2074,7 +2234,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
2074
2234
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2075
2235
|
* and so must be specified in every named environment.
|
|
2076
2236
|
*
|
|
2077
|
-
* @default
|
|
2237
|
+
* @default []
|
|
2078
2238
|
* @nonInheritable
|
|
2079
2239
|
*/
|
|
2080
2240
|
tail_consumers?: TailConsumer[];
|
|
@@ -2084,7 +2244,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
2084
2244
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2085
2245
|
* and so must be specified in every named environment.
|
|
2086
2246
|
*
|
|
2087
|
-
* @default
|
|
2247
|
+
* @default []
|
|
2088
2248
|
* @nonInheritable
|
|
2089
2249
|
*/
|
|
2090
2250
|
dispatch_namespaces: {
|
|
@@ -2101,7 +2261,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
2101
2261
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2102
2262
|
* and so must be specified in every named environment.
|
|
2103
2263
|
*
|
|
2104
|
-
* @default
|
|
2264
|
+
* @default []
|
|
2105
2265
|
* @nonInheritable
|
|
2106
2266
|
*/
|
|
2107
2267
|
pipelines: {
|
|
@@ -2112,7 +2272,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
2112
2272
|
}[];
|
|
2113
2273
|
}
|
|
2114
2274
|
|
|
2115
|
-
declare type ErrorEvent = BaseErrorEvent<"ConfigController" | "BundlerController" | "LocalRuntimeController" | "RemoteRuntimeController" | "ProxyWorker" | "InspectorProxyWorker"> | BaseErrorEvent<"ProxyController", {
|
|
2275
|
+
declare type ErrorEvent = BaseErrorEvent<"ConfigController" | "BundlerController" | "LocalRuntimeController" | "RemoteRuntimeController" | "ProxyWorker" | "InspectorProxyWorker" | "MultiworkerRuntimeController"> | BaseErrorEvent<"ProxyController", {
|
|
2116
2276
|
config?: StartDevWorkerOptions;
|
|
2117
2277
|
bundle?: Bundle;
|
|
2118
2278
|
}> | BaseErrorEvent<"BundlerController", {
|
|
@@ -2321,23 +2481,18 @@ declare class ExecutionContext {
|
|
|
2321
2481
|
passThroughOnException(): void;
|
|
2322
2482
|
}
|
|
2323
2483
|
|
|
2324
|
-
declare
|
|
2325
|
-
/** Absolute path to assets directory */
|
|
2326
|
-
directory: string;
|
|
2327
|
-
binding?: string;
|
|
2328
|
-
html_handling?: "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash" | "none";
|
|
2329
|
-
not_found_handling?: "single-page-application" | "404-page" | "none";
|
|
2330
|
-
};
|
|
2484
|
+
export declare const experimental_patchConfig: (configPath: string, patch: Unstable_RawConfig, isArrayInsertion?: boolean) => string;
|
|
2331
2485
|
|
|
2332
|
-
declare
|
|
2333
|
-
|
|
2334
|
-
|
|
2486
|
+
export declare const experimental_readRawConfig: (args: ReadConfigCommandArgs, options?: ReadConfigOptions) => {
|
|
2487
|
+
rawConfig: Unstable_RawConfig;
|
|
2488
|
+
configPath: string | undefined;
|
|
2489
|
+
userConfigPath: string | undefined;
|
|
2335
2490
|
};
|
|
2336
2491
|
|
|
2337
|
-
declare function
|
|
2492
|
+
declare function fetch_2 (
|
|
2338
2493
|
input: RequestInfo,
|
|
2339
|
-
init?:
|
|
2340
|
-
): Promise<
|
|
2494
|
+
init?: RequestInit_2
|
|
2495
|
+
): Promise<Response_2>
|
|
2341
2496
|
|
|
2342
2497
|
declare class File extends Blob_2 {
|
|
2343
2498
|
/**
|
|
@@ -2400,7 +2555,7 @@ declare class FileReader {
|
|
|
2400
2555
|
|
|
2401
2556
|
readonly result: string | ArrayBuffer | null
|
|
2402
2557
|
|
|
2403
|
-
readonly error:
|
|
2558
|
+
readonly error: DOMException_2 | null
|
|
2404
2559
|
|
|
2405
2560
|
onloadstart: null | ((this: FileReader, event: ProgressEvent) => void)
|
|
2406
2561
|
onprogress: null | ((this: FileReader, event: ProgressEvent) => void)
|
|
@@ -2413,7 +2568,7 @@ declare class FileReader {
|
|
|
2413
2568
|
/**
|
|
2414
2569
|
* 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().
|
|
2415
2570
|
*/
|
|
2416
|
-
declare class
|
|
2571
|
+
declare class FormData_2 {
|
|
2417
2572
|
/**
|
|
2418
2573
|
* Appends a new value onto an existing key inside a FormData object,
|
|
2419
2574
|
* or adds the key if it does not already exist.
|
|
@@ -2478,7 +2633,7 @@ declare class FormData {
|
|
|
2478
2633
|
* Executes given callback function for each field of the FormData instance
|
|
2479
2634
|
*/
|
|
2480
2635
|
forEach: (
|
|
2481
|
-
callbackfn: (value: FormDataEntryValue, key: string, iterable:
|
|
2636
|
+
callbackfn: (value: FormDataEntryValue, key: string, iterable: FormData_2) => void,
|
|
2482
2637
|
thisArg?: unknown
|
|
2483
2638
|
) => void
|
|
2484
2639
|
|
|
@@ -2513,28 +2668,14 @@ declare class FormData {
|
|
|
2513
2668
|
*/
|
|
2514
2669
|
declare type FormDataEntryValue = string | File
|
|
2515
2670
|
|
|
2516
|
-
|
|
2517
|
-
* By reading from a `wrangler.toml` file this function generates proxy binding objects that can be
|
|
2518
|
-
* used to simulate the interaction with bindings during local development in a Node.js environment
|
|
2519
|
-
*
|
|
2520
|
-
* @deprecated use `getPlatformProxy` instead
|
|
2521
|
-
*
|
|
2522
|
-
* @param options The various options that can tweak this function's behavior
|
|
2523
|
-
* @returns An Object containing the generated proxies alongside other related utilities
|
|
2524
|
-
*/
|
|
2525
|
-
export declare function getBindingsProxy<Bindings = Record<string, unknown>, CfProperties extends Record<string, unknown> = IncomingRequestCfProperties>(options?: GetBindingsProxyOptions): Promise<BindingsProxy<Bindings, CfProperties>>;
|
|
2526
|
-
|
|
2527
|
-
/** Options for the `getBindingsProxy` utility */
|
|
2528
|
-
export declare type GetBindingsProxyOptions = GetPlatformProxyOptions;
|
|
2529
|
-
|
|
2530
|
-
declare function getCookies (headers: Headers): Record<string, string>
|
|
2671
|
+
declare function getCookies (headers: Headers_2): Record<string, string>
|
|
2531
2672
|
|
|
2532
2673
|
declare function getGlobalDispatcher(): Dispatcher;
|
|
2533
2674
|
|
|
2534
2675
|
declare function getGlobalOrigin(): URL | undefined;
|
|
2535
2676
|
|
|
2536
2677
|
/**
|
|
2537
|
-
* By reading from a
|
|
2678
|
+
* By reading from a Wrangler configuration file this function generates proxy objects that can be
|
|
2538
2679
|
* used to simulate the interaction with the Cloudflare platform during local development
|
|
2539
2680
|
* in a Node.js environment
|
|
2540
2681
|
*
|
|
@@ -2554,19 +2695,12 @@ export declare type GetPlatformProxyOptions = {
|
|
|
2554
2695
|
/**
|
|
2555
2696
|
* The path to the config file to use.
|
|
2556
2697
|
* If no path is specified the default behavior is to search from the
|
|
2557
|
-
* current directory up the filesystem for a
|
|
2698
|
+
* current directory up the filesystem for a Wrangler configuration file to use.
|
|
2558
2699
|
*
|
|
2559
2700
|
* Note: this field is optional but if a path is specified it must
|
|
2560
2701
|
* point to a valid file on the filesystem
|
|
2561
2702
|
*/
|
|
2562
2703
|
configPath?: string;
|
|
2563
|
-
/**
|
|
2564
|
-
* Flag to indicate the utility to read a json config file (`wrangler.json`/`wrangler.jsonc`)
|
|
2565
|
-
* instead of the toml one (`wrangler.toml`)
|
|
2566
|
-
*
|
|
2567
|
-
* Note: this feature is experimental
|
|
2568
|
-
*/
|
|
2569
|
-
experimentalJsonConfig?: boolean;
|
|
2570
2704
|
/**
|
|
2571
2705
|
* Indicates if and where to persist the bindings data, if not present or `true` it defaults to the same location
|
|
2572
2706
|
* used by wrangler v3: `.wrangler/state/v3` (so that the same data can be easily used by the caller and wrangler).
|
|
@@ -2575,17 +2709,11 @@ export declare type GetPlatformProxyOptions = {
|
|
|
2575
2709
|
persist?: boolean | {
|
|
2576
2710
|
path: string;
|
|
2577
2711
|
};
|
|
2578
|
-
/**
|
|
2579
|
-
* Use the experimental file-based dev registry for service discovery
|
|
2580
|
-
*
|
|
2581
|
-
* Note: this feature is experimental
|
|
2582
|
-
*/
|
|
2583
|
-
experimentalRegistry?: boolean;
|
|
2584
2712
|
};
|
|
2585
2713
|
|
|
2586
|
-
declare function getSetCookies (headers:
|
|
2714
|
+
declare function getSetCookies (headers: Headers_2): Cookie[]
|
|
2587
2715
|
|
|
2588
|
-
declare class
|
|
2716
|
+
declare class Headers_2 implements SpecIterable<[string, string]> {
|
|
2589
2717
|
constructor (init?: HeadersInit)
|
|
2590
2718
|
readonly append: (name: string, value: string) => void
|
|
2591
2719
|
readonly delete: (name: string) => void
|
|
@@ -2594,7 +2722,7 @@ declare class Headers implements SpecIterable<[string, string]> {
|
|
|
2594
2722
|
readonly set: (name: string, value: string) => void
|
|
2595
2723
|
readonly getSetCookie: () => string[]
|
|
2596
2724
|
readonly forEach: (
|
|
2597
|
-
callbackfn: (value: string, key: string, iterable:
|
|
2725
|
+
callbackfn: (value: string, key: string, iterable: Headers_2) => void,
|
|
2598
2726
|
thisArg?: unknown
|
|
2599
2727
|
) => void
|
|
2600
2728
|
|
|
@@ -2604,23 +2732,21 @@ declare class Headers implements SpecIterable<[string, string]> {
|
|
|
2604
2732
|
readonly [Symbol.iterator]: () => SpecIterator<[string, string]>
|
|
2605
2733
|
}
|
|
2606
2734
|
|
|
2607
|
-
declare type HeadersInit = string[][] | Record<string, string | ReadonlyArray<string>> |
|
|
2735
|
+
declare type HeadersInit = string[][] | Record<string, string | ReadonlyArray<string>> | Headers_2
|
|
2608
2736
|
|
|
2609
2737
|
declare type Hook<T extends HookValues, Args extends unknown[] = []> = T | ((...args: Args) => T);
|
|
2610
2738
|
|
|
2611
2739
|
declare type HookValues = string | number | boolean | object | undefined | null;
|
|
2612
2740
|
|
|
2613
2741
|
/**
|
|
2614
|
-
*
|
|
2742
|
+
* The header type declaration of `undici`.
|
|
2615
2743
|
*/
|
|
2616
|
-
declare type
|
|
2617
|
-
readonly terminate: () => Promise<void>;
|
|
2618
|
-
};
|
|
2744
|
+
declare type IncomingHttpHeaders = Record<string, string | string[] | undefined>;
|
|
2619
2745
|
|
|
2620
2746
|
/**
|
|
2621
|
-
*
|
|
2747
|
+
* A symbol to inherit a binding from the deployed worker.
|
|
2622
2748
|
*/
|
|
2623
|
-
declare
|
|
2749
|
+
declare const INHERIT_SYMBOL: unique symbol;
|
|
2624
2750
|
|
|
2625
2751
|
declare type InspectorProxyWorkerIncomingWebSocketMessage = {
|
|
2626
2752
|
type: ReloadStartEvent["type"];
|
|
@@ -2653,7 +2779,11 @@ declare interface Interceptable extends Dispatcher {
|
|
|
2653
2779
|
declare class Logger {
|
|
2654
2780
|
#private;
|
|
2655
2781
|
constructor();
|
|
2656
|
-
|
|
2782
|
+
private overrideLoggerLevel?;
|
|
2783
|
+
private onceHistory;
|
|
2784
|
+
get loggerLevel(): "log" | "error" | "none" | "debug" | "info" | "warn";
|
|
2785
|
+
set loggerLevel(val: "log" | "error" | "none" | "debug" | "info" | "warn");
|
|
2786
|
+
resetLoggerLevel(): void;
|
|
2657
2787
|
columns: number;
|
|
2658
2788
|
debug: (...args: unknown[]) => void;
|
|
2659
2789
|
debugWithSanitization: (label: string, ...args: unknown[]) => void;
|
|
@@ -2663,17 +2793,36 @@ declare class Logger {
|
|
|
2663
2793
|
error: (...args: unknown[]) => void;
|
|
2664
2794
|
table<Keys extends string>(data: TableRow<Keys>[]): void;
|
|
2665
2795
|
console<M extends Exclude<keyof Console, "Console">>(method: M, ...args: Parameters<Console[M]>): void;
|
|
2796
|
+
get once(): {
|
|
2797
|
+
info: (...args: unknown[]) => void;
|
|
2798
|
+
log: (...args: unknown[]) => void;
|
|
2799
|
+
warn: (...args: unknown[]) => void;
|
|
2800
|
+
error: (...args: unknown[]) => void;
|
|
2801
|
+
};
|
|
2802
|
+
clearHistory(): void;
|
|
2803
|
+
doLogOnce(messageLevel: Exclude<LoggerLevel, "none">, args: unknown[]): void;
|
|
2666
2804
|
private doLog;
|
|
2667
2805
|
static registerBeforeLogHook(callback: (() => void) | undefined): void;
|
|
2668
2806
|
static registerAfterLogHook(callback: (() => void) | undefined): void;
|
|
2669
2807
|
private formatMessage;
|
|
2670
2808
|
}
|
|
2671
2809
|
|
|
2810
|
+
declare const LOGGER_LEVELS: {
|
|
2811
|
+
readonly none: -1;
|
|
2812
|
+
readonly error: 0;
|
|
2813
|
+
readonly warn: 1;
|
|
2814
|
+
readonly info: 2;
|
|
2815
|
+
readonly log: 3;
|
|
2816
|
+
readonly debug: 4;
|
|
2817
|
+
};
|
|
2818
|
+
|
|
2819
|
+
declare type LoggerLevel = keyof typeof LOGGER_LEVELS;
|
|
2820
|
+
|
|
2672
2821
|
declare type LogLevel = "debug" | "info" | "log" | "warn" | "error" | "none";
|
|
2673
2822
|
|
|
2674
2823
|
declare type MaybePromise<T> = T | Promise<T>;
|
|
2675
2824
|
|
|
2676
|
-
declare interface
|
|
2825
|
+
declare interface MessageEvent_2<T = any> extends Event_2 {
|
|
2677
2826
|
readonly data: T
|
|
2678
2827
|
readonly lastEventId: string
|
|
2679
2828
|
readonly origin: string
|
|
@@ -2691,9 +2840,9 @@ declare interface MessageEvent<T = any> extends Event_2 {
|
|
|
2691
2840
|
): void;
|
|
2692
2841
|
}
|
|
2693
2842
|
|
|
2694
|
-
declare const
|
|
2695
|
-
prototype:
|
|
2696
|
-
new<T>(type: string, eventInitDict?: MessageEventInit<T>):
|
|
2843
|
+
declare const MessageEvent_2: {
|
|
2844
|
+
prototype: MessageEvent_2
|
|
2845
|
+
new<T>(type: string, eventInitDict?: MessageEventInit<T>): MessageEvent_2<T>
|
|
2697
2846
|
};
|
|
2698
2847
|
|
|
2699
2848
|
declare interface MessageEventInit<T = any> extends EventInit {
|
|
@@ -2832,7 +2981,7 @@ declare namespace MockInterceptor {
|
|
|
2832
2981
|
origin: string;
|
|
2833
2982
|
method: string;
|
|
2834
2983
|
body?: BodyInit | Dispatcher.DispatchOptions['body'];
|
|
2835
|
-
headers:
|
|
2984
|
+
headers: Headers_2 | Record<string, string>;
|
|
2836
2985
|
maxRedirections: number;
|
|
2837
2986
|
}
|
|
2838
2987
|
|
|
@@ -2879,39 +3028,38 @@ declare interface MultiCacheQueryOptions extends CacheQueryOptions {
|
|
|
2879
3028
|
cacheName?: string
|
|
2880
3029
|
}
|
|
2881
3030
|
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
3031
|
+
declare type NameOmit<T> = Omit<T, "name">;
|
|
3032
|
+
|
|
3033
|
+
declare type NormalizeAndValidateConfigArgs = {
|
|
3034
|
+
name?: string;
|
|
3035
|
+
env?: string;
|
|
3036
|
+
"legacy-env"?: boolean;
|
|
3037
|
+
"dispatch-namespace"?: string;
|
|
3038
|
+
remote?: boolean;
|
|
3039
|
+
localProtocol?: string;
|
|
3040
|
+
upstreamProtocol?: string;
|
|
3041
|
+
script?: string;
|
|
3042
|
+
};
|
|
2891
3043
|
|
|
2892
3044
|
declare interface Observability {
|
|
2893
3045
|
/** If observability is enabled for this Worker */
|
|
2894
|
-
enabled
|
|
3046
|
+
enabled?: boolean;
|
|
2895
3047
|
/** The sampling rate */
|
|
2896
3048
|
head_sampling_rate?: number;
|
|
3049
|
+
logs?: {
|
|
3050
|
+
enabled?: boolean;
|
|
3051
|
+
/** The sampling rate */
|
|
3052
|
+
head_sampling_rate?: number;
|
|
3053
|
+
/** Set to false to disable invocation logs */
|
|
3054
|
+
invocation_logs?: boolean;
|
|
3055
|
+
};
|
|
2897
3056
|
}
|
|
2898
3057
|
|
|
2899
3058
|
declare interface PagesConfigFields {
|
|
2900
3059
|
/**
|
|
2901
3060
|
* The directory of static assets to serve.
|
|
2902
3061
|
*
|
|
2903
|
-
* The presence of this field in
|
|
2904
|
-
* and will prompt the handling of the configuration file according to the
|
|
2905
|
-
* Pages-specific validation rules.
|
|
2906
|
-
*/
|
|
2907
|
-
pages_build_output_dir?: string;
|
|
2908
|
-
}
|
|
2909
|
-
|
|
2910
|
-
declare interface PagesConfigFields {
|
|
2911
|
-
/**
|
|
2912
|
-
* The directory of static assets to serve.
|
|
2913
|
-
*
|
|
2914
|
-
* The presence of this field in `wrangler.toml` indicates a Pages project,
|
|
3062
|
+
* The presence of this field in a Wrangler configuration file indicates a Pages project,
|
|
2915
3063
|
* and will prompt the handling of the configuration file according to the
|
|
2916
3064
|
* Pages-specific validation rules.
|
|
2917
3065
|
*/
|
|
@@ -25487,7 +25635,7 @@ declare class ProxyController extends Controller<ProxyControllerEventMap> {
|
|
|
25487
25635
|
onReloadComplete(data: ReloadCompleteEvent): void;
|
|
25488
25636
|
onProxyWorkerMessage(message: ProxyWorkerOutgoingRequestBody): void;
|
|
25489
25637
|
onInspectorProxyWorkerMessage(message: InspectorProxyWorkerOutgoingWebsocketMessage): void;
|
|
25490
|
-
onInspectorProxyWorkerRequest(message: InspectorProxyWorkerOutgoingRequestBody): Promise<
|
|
25638
|
+
onInspectorProxyWorkerRequest(message: InspectorProxyWorkerOutgoingRequestBody): Promise<Response_3>;
|
|
25491
25639
|
_torndown: boolean;
|
|
25492
25640
|
teardown(): Promise<void>;
|
|
25493
25641
|
emitReadyEvent(proxyWorker: Miniflare, url: URL, inspectorUrl: URL): void;
|
|
@@ -25530,10 +25678,19 @@ declare type ProxyWorkerOutgoingRequestBody = {
|
|
|
25530
25678
|
args: Parameters<typeof console.debug>;
|
|
25531
25679
|
};
|
|
25532
25680
|
|
|
25533
|
-
declare type QueueConsumer = NonNullable<
|
|
25681
|
+
declare type QueueConsumer = NonNullable<Unstable_Config["queues"]["consumers"]>[number];
|
|
25534
25682
|
|
|
25535
25683
|
declare type RawDevConfig = Partial<DevConfig>;
|
|
25536
25684
|
|
|
25685
|
+
declare type ReadConfigCommandArgs = NormalizeAndValidateConfigArgs & {
|
|
25686
|
+
config?: string;
|
|
25687
|
+
script?: string;
|
|
25688
|
+
};
|
|
25689
|
+
|
|
25690
|
+
declare type ReadConfigOptions = ResolveConfigPathOptions & {
|
|
25691
|
+
hideWarnings?: boolean;
|
|
25692
|
+
};
|
|
25693
|
+
|
|
25537
25694
|
declare type ReadyEvent = {
|
|
25538
25695
|
type: "ready";
|
|
25539
25696
|
proxyWorker: Miniflare;
|
|
@@ -25571,13 +25728,19 @@ declare type ReloadStartEvent = {
|
|
|
25571
25728
|
bundle: Bundle;
|
|
25572
25729
|
};
|
|
25573
25730
|
|
|
25574
|
-
|
|
25575
|
-
|
|
25731
|
+
/** Performs an HTTP request. */
|
|
25732
|
+
declare function request(
|
|
25733
|
+
url: string | URL_2 | UrlObject,
|
|
25734
|
+
options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions, 'origin' | 'path' | 'method'> & Partial<Pick<Dispatcher.RequestOptions, 'method'>>,
|
|
25735
|
+
): Promise<Dispatcher.ResponseData>;
|
|
25736
|
+
|
|
25737
|
+
declare class Request_2 implements BodyMixin {
|
|
25738
|
+
constructor (input: RequestInfo, init?: RequestInit_2)
|
|
25576
25739
|
|
|
25577
25740
|
readonly cache: RequestCache
|
|
25578
25741
|
readonly credentials: RequestCredentials
|
|
25579
25742
|
readonly destination: RequestDestination
|
|
25580
|
-
readonly headers:
|
|
25743
|
+
readonly headers: Headers_2
|
|
25581
25744
|
readonly integrity: string
|
|
25582
25745
|
readonly method: string
|
|
25583
25746
|
readonly mode: RequestMode
|
|
@@ -25589,24 +25752,18 @@ declare class Request implements BodyMixin {
|
|
|
25589
25752
|
readonly signal: AbortSignal
|
|
25590
25753
|
readonly duplex: RequestDuplex
|
|
25591
25754
|
|
|
25592
|
-
readonly body:
|
|
25755
|
+
readonly body: ReadableStream_2 | null
|
|
25593
25756
|
readonly bodyUsed: boolean
|
|
25594
25757
|
|
|
25595
25758
|
readonly arrayBuffer: () => Promise<ArrayBuffer>
|
|
25596
25759
|
readonly blob: () => Promise<Blob_2>
|
|
25597
|
-
readonly formData: () => Promise<
|
|
25760
|
+
readonly formData: () => Promise<FormData_2>
|
|
25598
25761
|
readonly json: () => Promise<unknown>
|
|
25599
25762
|
readonly text: () => Promise<string>
|
|
25600
25763
|
|
|
25601
|
-
readonly clone: () =>
|
|
25764
|
+
readonly clone: () => Request_2
|
|
25602
25765
|
}
|
|
25603
25766
|
|
|
25604
|
-
/** Performs an HTTP request. */
|
|
25605
|
-
declare function request(
|
|
25606
|
-
url: string | URL_2 | UrlObject,
|
|
25607
|
-
options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions, 'origin' | 'path' | 'method'> & Partial<Pick<Dispatcher.RequestOptions, 'method'>>,
|
|
25608
|
-
): Promise<Dispatcher.ResponseData>;
|
|
25609
|
-
|
|
25610
25767
|
declare type RequestCache =
|
|
25611
25768
|
| 'default'
|
|
25612
25769
|
| 'force-cache'
|
|
@@ -25639,9 +25796,9 @@ declare type RequestDestination =
|
|
|
25639
25796
|
|
|
25640
25797
|
declare type RequestDuplex = 'half'
|
|
25641
25798
|
|
|
25642
|
-
declare type RequestInfo = string | URL_2 |
|
|
25799
|
+
declare type RequestInfo = string | URL_2 | Request_2
|
|
25643
25800
|
|
|
25644
|
-
declare interface
|
|
25801
|
+
declare interface RequestInit_2 {
|
|
25645
25802
|
method?: string
|
|
25646
25803
|
keepalive?: boolean
|
|
25647
25804
|
headers?: HeadersInit
|
|
@@ -25662,10 +25819,14 @@ declare type RequestMode = 'cors' | 'navigate' | 'no-cors' | 'same-origin'
|
|
|
25662
25819
|
|
|
25663
25820
|
declare type RequestRedirect = 'error' | 'follow' | 'manual'
|
|
25664
25821
|
|
|
25665
|
-
declare
|
|
25666
|
-
|
|
25822
|
+
declare type ResolveConfigPathOptions = {
|
|
25823
|
+
useRedirectIfAvailable?: boolean;
|
|
25824
|
+
};
|
|
25825
|
+
|
|
25826
|
+
declare class Response_2 implements BodyMixin {
|
|
25827
|
+
constructor (body?: BodyInit, init?: ResponseInit_2)
|
|
25667
25828
|
|
|
25668
|
-
readonly headers:
|
|
25829
|
+
readonly headers: Headers_2
|
|
25669
25830
|
readonly ok: boolean
|
|
25670
25831
|
readonly status: number
|
|
25671
25832
|
readonly statusText: string
|
|
@@ -25673,23 +25834,23 @@ declare class Response implements BodyMixin {
|
|
|
25673
25834
|
readonly url: string
|
|
25674
25835
|
readonly redirected: boolean
|
|
25675
25836
|
|
|
25676
|
-
readonly body:
|
|
25837
|
+
readonly body: ReadableStream_2 | null
|
|
25677
25838
|
readonly bodyUsed: boolean
|
|
25678
25839
|
|
|
25679
25840
|
readonly arrayBuffer: () => Promise<ArrayBuffer>
|
|
25680
25841
|
readonly blob: () => Promise<Blob_2>
|
|
25681
|
-
readonly formData: () => Promise<
|
|
25842
|
+
readonly formData: () => Promise<FormData_2>
|
|
25682
25843
|
readonly json: () => Promise<unknown>
|
|
25683
25844
|
readonly text: () => Promise<string>
|
|
25684
25845
|
|
|
25685
|
-
readonly clone: () =>
|
|
25846
|
+
readonly clone: () => Response_2
|
|
25686
25847
|
|
|
25687
|
-
static error ():
|
|
25688
|
-
static json(data: any, init?:
|
|
25689
|
-
static redirect (url: string | URL_2, status: ResponseRedirectStatus):
|
|
25848
|
+
static error (): Response_2
|
|
25849
|
+
static json(data: any, init?: ResponseInit_2): Response_2
|
|
25850
|
+
static redirect (url: string | URL_2, status: ResponseRedirectStatus): Response_2
|
|
25690
25851
|
}
|
|
25691
25852
|
|
|
25692
|
-
declare interface
|
|
25853
|
+
declare interface ResponseInit_2 {
|
|
25693
25854
|
readonly status?: number
|
|
25694
25855
|
readonly statusText?: string
|
|
25695
25856
|
readonly headers?: HeadersInit
|
|
@@ -25820,13 +25981,22 @@ declare namespace RetryHandler {
|
|
|
25820
25981
|
|
|
25821
25982
|
declare type Route = SimpleRoute | ZoneIdRoute | ZoneNameRoute | CustomDomainRoute;
|
|
25822
25983
|
|
|
25823
|
-
declare type
|
|
25984
|
+
declare type RouterConfig = z.infer<typeof RouterConfigSchema>;
|
|
25824
25985
|
|
|
25825
|
-
declare const
|
|
25986
|
+
declare const RouterConfigSchema: z.ZodObject<{
|
|
25987
|
+
account_id: z.ZodOptional<z.ZodNumber>;
|
|
25988
|
+
script_id: z.ZodOptional<z.ZodNumber>;
|
|
25989
|
+
invoke_user_worker_ahead_of_assets: z.ZodOptional<z.ZodBoolean>;
|
|
25826
25990
|
has_user_worker: z.ZodOptional<z.ZodBoolean>;
|
|
25827
25991
|
}, "strip", z.ZodTypeAny, {
|
|
25992
|
+
account_id?: number;
|
|
25993
|
+
script_id?: number;
|
|
25994
|
+
invoke_user_worker_ahead_of_assets?: boolean;
|
|
25828
25995
|
has_user_worker?: boolean;
|
|
25829
25996
|
}, {
|
|
25997
|
+
account_id?: number;
|
|
25998
|
+
script_id?: number;
|
|
25999
|
+
invoke_user_worker_ahead_of_assets?: boolean;
|
|
25830
26000
|
has_user_worker?: boolean;
|
|
25831
26001
|
}>;
|
|
25832
26002
|
|
|
@@ -25866,9 +26036,9 @@ declare type SerializedError = {
|
|
|
25866
26036
|
cause?: unknown;
|
|
25867
26037
|
};
|
|
25868
26038
|
|
|
25869
|
-
declare type ServiceFetch = (request:
|
|
26039
|
+
declare type ServiceFetch = (request: Request_3) => Promise<Response_3> | Response_3;
|
|
25870
26040
|
|
|
25871
|
-
declare function setCookie (headers:
|
|
26041
|
+
declare function setCookie (headers: Headers_2, cookie: Cookie): void
|
|
25872
26042
|
|
|
25873
26043
|
declare function setGlobalDispatcher<DispatcherImplementation extends Dispatcher>(dispatcher: DispatcherImplementation): void;
|
|
25874
26044
|
|
|
@@ -25906,7 +26076,7 @@ declare interface StartDevWorkerInput {
|
|
|
25906
26076
|
name?: string;
|
|
25907
26077
|
/**
|
|
25908
26078
|
* The javascript or typescript entry-point of the worker.
|
|
25909
|
-
* This is the `main` property of a
|
|
26079
|
+
* This is the `main` property of a Wrangler configuration file.
|
|
25910
26080
|
* You can specify a file path or provide the contents directly.
|
|
25911
26081
|
*/
|
|
25912
26082
|
entrypoint?: string;
|
|
@@ -25956,7 +26126,7 @@ declare interface StartDevWorkerInput {
|
|
|
25956
26126
|
jsxFactory?: string;
|
|
25957
26127
|
jsxFragment?: string;
|
|
25958
26128
|
tsconfig?: string;
|
|
25959
|
-
nodejsCompatMode?: Hook<NodeJSCompatMode, [
|
|
26129
|
+
nodejsCompatMode?: Hook<NodeJSCompatMode, [Unstable_Config]>;
|
|
25960
26130
|
moduleRoot?: string;
|
|
25961
26131
|
};
|
|
25962
26132
|
/** Options applying to the worker's development preview environment. */
|
|
@@ -25970,7 +26140,7 @@ declare interface StartDevWorkerInput {
|
|
|
25970
26140
|
/** Whether the worker runs on the edge or locally. */
|
|
25971
26141
|
remote?: boolean;
|
|
25972
26142
|
/** Cloudflare Account credentials. Can be provided upfront or as a function which will be called only when required. */
|
|
25973
|
-
auth?: AsyncHook<CfAccount>;
|
|
26143
|
+
auth?: AsyncHook<CfAccount, [Pick<Unstable_Config, "account_id">]>;
|
|
25974
26144
|
/** Whether local storage (KV, Durable Objects, R2, D1, etc) is persisted. You can also specify the directory to persist data to. */
|
|
25975
26145
|
persist?: string;
|
|
25976
26146
|
/** Controls which logs are logged 🤙. */
|
|
@@ -25997,23 +26167,26 @@ declare interface StartDevWorkerInput {
|
|
|
25997
26167
|
/** An undici MockAgent to declaratively mock fetch calls to particular resources. */
|
|
25998
26168
|
mockFetch?: undici.MockAgent;
|
|
25999
26169
|
/** Describes the registry of other Workers running locally */
|
|
26000
|
-
registry?: WorkerRegistry;
|
|
26170
|
+
registry?: WorkerRegistry | null;
|
|
26001
26171
|
testScheduled?: boolean;
|
|
26172
|
+
/** Whether to use Vectorize mixed mode -- the worker is run locally but accesses to Vectorize are made remotely */
|
|
26173
|
+
bindVectorizeToProd?: boolean;
|
|
26174
|
+
/** Whether to use Images local mode -- this is lower fidelity, but doesn't require network access */
|
|
26175
|
+
imagesLocalMode?: boolean;
|
|
26176
|
+
/** Treat this as the primary worker in a multiworker setup (i.e. the first Worker in Miniflare's options) */
|
|
26177
|
+
multiworkerPrimary?: boolean;
|
|
26002
26178
|
};
|
|
26003
26179
|
legacy?: {
|
|
26004
|
-
site?: Hook<
|
|
26005
|
-
legacyAssets?: Hook<Config["legacy_assets"], [Config]>;
|
|
26180
|
+
site?: Hook<Unstable_Config["site"], [Unstable_Config]>;
|
|
26006
26181
|
enableServiceEnvironments?: boolean;
|
|
26007
26182
|
};
|
|
26008
26183
|
unsafe?: Omit<CfUnsafe, "bindings">;
|
|
26009
|
-
|
|
26010
|
-
assets?: Omit<ExperimentalAssetsOptions, "bindings">;
|
|
26011
|
-
};
|
|
26184
|
+
assets?: string;
|
|
26012
26185
|
}
|
|
26013
26186
|
|
|
26014
|
-
declare type StartDevWorkerOptions = StartDevWorkerInput & {
|
|
26015
|
-
/** A worker's directory. Usually where the
|
|
26016
|
-
|
|
26187
|
+
declare type StartDevWorkerOptions = Omit<StartDevWorkerInput, "assets"> & {
|
|
26188
|
+
/** A worker's directory. Usually where the Wrangler configuration file is located */
|
|
26189
|
+
projectRoot: string;
|
|
26017
26190
|
build: StartDevWorkerInput["build"] & {
|
|
26018
26191
|
nodejsCompatMode: NodeJSCompatMode;
|
|
26019
26192
|
format: CfScriptFormat;
|
|
@@ -26021,16 +26194,19 @@ declare type StartDevWorkerOptions = StartDevWorkerInput & {
|
|
|
26021
26194
|
moduleRules: Rule[];
|
|
26022
26195
|
define: Record<string, string>;
|
|
26023
26196
|
additionalModules: CfModule[];
|
|
26197
|
+
exports: string[];
|
|
26024
26198
|
processEntrypoint: boolean;
|
|
26025
26199
|
};
|
|
26026
26200
|
legacy: StartDevWorkerInput["legacy"] & {
|
|
26027
|
-
|
|
26028
|
-
site?: Config["site"];
|
|
26201
|
+
site?: Unstable_Config["site"];
|
|
26029
26202
|
};
|
|
26030
26203
|
dev: StartDevWorkerInput["dev"] & {
|
|
26031
26204
|
persist: string;
|
|
26205
|
+
auth?: AsyncHook<CfAccount>;
|
|
26032
26206
|
};
|
|
26033
26207
|
entrypoint: string;
|
|
26208
|
+
assets?: AssetsOptions;
|
|
26209
|
+
name: string;
|
|
26034
26210
|
};
|
|
26035
26211
|
|
|
26036
26212
|
/** A faster version of `request`. */
|
|
@@ -26109,11 +26285,11 @@ declare namespace Undici {
|
|
|
26109
26285
|
var MockPool: MockPool;
|
|
26110
26286
|
var MockAgent: MockAgent;
|
|
26111
26287
|
var mockErrors: MockErrors;
|
|
26112
|
-
var fetch:
|
|
26113
|
-
var Headers:
|
|
26114
|
-
var Response:
|
|
26115
|
-
var Request:
|
|
26116
|
-
var FormData:
|
|
26288
|
+
var fetch: fetch_2;
|
|
26289
|
+
var Headers: Headers_2;
|
|
26290
|
+
var Response: Response_2;
|
|
26291
|
+
var Request: Request_2;
|
|
26292
|
+
var FormData: FormData_2;
|
|
26117
26293
|
var File: File;
|
|
26118
26294
|
var FileReader: FileReader;
|
|
26119
26295
|
var caches: caches;
|
|
@@ -26152,7 +26328,7 @@ declare namespace undici {
|
|
|
26152
26328
|
getSetCookies,
|
|
26153
26329
|
setCookie,
|
|
26154
26330
|
Cookie,
|
|
26155
|
-
fetch,
|
|
26331
|
+
fetch_2 as fetch,
|
|
26156
26332
|
RequestInfo,
|
|
26157
26333
|
BodyInit,
|
|
26158
26334
|
BodyMixin,
|
|
@@ -26160,20 +26336,20 @@ declare namespace undici {
|
|
|
26160
26336
|
SpecIterableIterator,
|
|
26161
26337
|
SpecIterable,
|
|
26162
26338
|
HeadersInit,
|
|
26163
|
-
Headers,
|
|
26339
|
+
Headers_2 as Headers,
|
|
26164
26340
|
RequestCache,
|
|
26165
26341
|
RequestCredentials,
|
|
26166
26342
|
RequestDestination,
|
|
26167
|
-
RequestInit,
|
|
26343
|
+
RequestInit_2 as RequestInit,
|
|
26168
26344
|
ReferrerPolicy,
|
|
26169
26345
|
RequestMode,
|
|
26170
26346
|
RequestRedirect,
|
|
26171
26347
|
RequestDuplex,
|
|
26172
|
-
Request,
|
|
26173
|
-
ResponseInit,
|
|
26348
|
+
Request_2 as Request,
|
|
26349
|
+
ResponseInit_2 as ResponseInit,
|
|
26174
26350
|
ResponseType,
|
|
26175
26351
|
ResponseRedirectStatus,
|
|
26176
|
-
Response,
|
|
26352
|
+
Response_2 as Response,
|
|
26177
26353
|
BlobPropertyBag,
|
|
26178
26354
|
FilePropertyBag,
|
|
26179
26355
|
File,
|
|
@@ -26181,7 +26357,7 @@ declare namespace undici {
|
|
|
26181
26357
|
ProgressEventInit,
|
|
26182
26358
|
ProgressEvent,
|
|
26183
26359
|
FormDataEntryValue,
|
|
26184
|
-
FormData,
|
|
26360
|
+
FormData_2 as FormData,
|
|
26185
26361
|
DiagnosticsChannel,
|
|
26186
26362
|
BinaryType,
|
|
26187
26363
|
WebSocketEventMap,
|
|
@@ -26189,7 +26365,7 @@ declare namespace undici {
|
|
|
26189
26365
|
CloseEventInit,
|
|
26190
26366
|
CloseEvent,
|
|
26191
26367
|
MessageEventInit,
|
|
26192
|
-
MessageEvent,
|
|
26368
|
+
MessageEvent_2 as MessageEvent,
|
|
26193
26369
|
WebSocketInit,
|
|
26194
26370
|
parseMIMEType,
|
|
26195
26371
|
serializeAMimeType,
|
|
@@ -26202,10 +26378,39 @@ declare namespace undici {
|
|
|
26202
26378
|
}
|
|
26203
26379
|
}
|
|
26204
26380
|
|
|
26381
|
+
export declare interface Unstable_ASSETSBindingsOptions {
|
|
26382
|
+
log: Logger;
|
|
26383
|
+
proxyPort?: number;
|
|
26384
|
+
directory?: string;
|
|
26385
|
+
}
|
|
26386
|
+
|
|
26387
|
+
/**
|
|
26388
|
+
* This is the static type definition for the configuration object.
|
|
26389
|
+
*
|
|
26390
|
+
* It reflects a normalized and validated version of the configuration that you can write in a Wrangler configuration file,
|
|
26391
|
+
* and optionally augment with arguments passed directly to wrangler.
|
|
26392
|
+
*
|
|
26393
|
+
* For more information about the configuration object, see the
|
|
26394
|
+
* documentation at https://developers.cloudflare.com/workers/cli-wrangler/configuration
|
|
26395
|
+
*
|
|
26396
|
+
* Notes:
|
|
26397
|
+
*
|
|
26398
|
+
* - Fields that are only specified in `ConfigFields` and not `Environment` can only appear
|
|
26399
|
+
* in the top level config and should not appear in any environments.
|
|
26400
|
+
* - Fields that are specified in `PagesConfigFields` are only relevant for Pages projects
|
|
26401
|
+
* - All top level fields in config and environments are optional in the Wrangler configuration file.
|
|
26402
|
+
*
|
|
26403
|
+
* Legend for the annotations:
|
|
26404
|
+
*
|
|
26405
|
+
* - `@breaking`: the deprecation/optionality is a breaking change from Wrangler v1.
|
|
26406
|
+
* - `@todo`: there's more work to be done (with details attached).
|
|
26407
|
+
*/
|
|
26408
|
+
export declare type Unstable_Config = ComputedFields & ConfigFields<DevConfig> & PagesConfigFields & Environment;
|
|
26409
|
+
|
|
26205
26410
|
/**
|
|
26206
26411
|
* unstable_dev starts a wrangler dev server, and returns a promise that resolves with utility functions to interact with it.
|
|
26207
26412
|
*/
|
|
26208
|
-
export declare function unstable_dev(script: string, options?:
|
|
26413
|
+
export declare function unstable_dev(script: string, options?: Unstable_DevOptions, apiOptions?: unknown): Promise<Unstable_DevWorker>;
|
|
26209
26414
|
|
|
26210
26415
|
export declare class unstable_DevEnv extends EventEmitter_2 {
|
|
26211
26416
|
config: ConfigController;
|
|
@@ -26223,37 +26428,7 @@ export declare class unstable_DevEnv extends EventEmitter_2 {
|
|
|
26223
26428
|
emitErrorEvent(ev: ErrorEvent): void;
|
|
26224
26429
|
}
|
|
26225
26430
|
|
|
26226
|
-
export declare
|
|
26227
|
-
|
|
26228
|
-
export declare function unstable_getMiniflareWorkerOptions(configPath: string, env?: string): {
|
|
26229
|
-
workerOptions: SourcelessWorkerOptions;
|
|
26230
|
-
define: Record<string, string>;
|
|
26231
|
-
main?: string;
|
|
26232
|
-
};
|
|
26233
|
-
|
|
26234
|
-
export declare const unstable_pages: {
|
|
26235
|
-
deploy: typeof deploy;
|
|
26236
|
-
};
|
|
26237
|
-
|
|
26238
|
-
/**
|
|
26239
|
-
* Split an SQLQuery into an array of statements
|
|
26240
|
-
*/
|
|
26241
|
-
export declare function unstable_splitSqlQuery(sql: string): string[];
|
|
26242
|
-
|
|
26243
|
-
export declare function unstable_startWorker(options: StartDevWorkerInput): Promise<Worker>;
|
|
26244
|
-
|
|
26245
|
-
export declare function unstable_startWorkerRegistryServer(port: number): Promise<{
|
|
26246
|
-
server: Server<IncomingMessage, ServerResponse>;
|
|
26247
|
-
terminator: HttpTerminator;
|
|
26248
|
-
}>;
|
|
26249
|
-
|
|
26250
|
-
export declare interface UnstableASSETSBindingsOptions {
|
|
26251
|
-
log: Logger;
|
|
26252
|
-
proxyPort?: number;
|
|
26253
|
-
directory?: string;
|
|
26254
|
-
}
|
|
26255
|
-
|
|
26256
|
-
export declare interface UnstableDevOptions {
|
|
26431
|
+
export declare interface Unstable_DevOptions {
|
|
26257
26432
|
config?: string;
|
|
26258
26433
|
env?: string;
|
|
26259
26434
|
ip?: string;
|
|
@@ -26263,12 +26438,10 @@ export declare interface UnstableDevOptions {
|
|
|
26263
26438
|
localProtocol?: "http" | "https";
|
|
26264
26439
|
httpsKeyPath?: string;
|
|
26265
26440
|
httpsCertPath?: string;
|
|
26266
|
-
|
|
26267
|
-
legacyAssets?: string;
|
|
26441
|
+
assets?: string;
|
|
26268
26442
|
site?: string;
|
|
26269
26443
|
siteInclude?: string[];
|
|
26270
26444
|
siteExclude?: string[];
|
|
26271
|
-
nodeCompat?: boolean;
|
|
26272
26445
|
compatibilityDate?: string;
|
|
26273
26446
|
compatibilityFlags?: string[];
|
|
26274
26447
|
persist?: boolean;
|
|
@@ -26276,7 +26449,7 @@ export declare interface UnstableDevOptions {
|
|
|
26276
26449
|
vars?: Record<string, string | Json>;
|
|
26277
26450
|
kv?: {
|
|
26278
26451
|
binding: string;
|
|
26279
|
-
id
|
|
26452
|
+
id?: string;
|
|
26280
26453
|
preview_id?: string;
|
|
26281
26454
|
}[];
|
|
26282
26455
|
durableObjects?: {
|
|
@@ -26293,7 +26466,7 @@ export declare interface UnstableDevOptions {
|
|
|
26293
26466
|
}[];
|
|
26294
26467
|
r2?: {
|
|
26295
26468
|
binding: string;
|
|
26296
|
-
bucket_name
|
|
26469
|
+
bucket_name?: string;
|
|
26297
26470
|
preview_bucket_name?: string;
|
|
26298
26471
|
}[];
|
|
26299
26472
|
ai?: {
|
|
@@ -26323,18 +26496,61 @@ export declare interface UnstableDevOptions {
|
|
|
26323
26496
|
watch?: boolean;
|
|
26324
26497
|
devEnv?: boolean;
|
|
26325
26498
|
fileBasedRegistry?: boolean;
|
|
26499
|
+
vectorizeBindToProd?: boolean;
|
|
26500
|
+
imagesLocalMode?: boolean;
|
|
26501
|
+
enableIpc?: boolean;
|
|
26326
26502
|
};
|
|
26327
26503
|
}
|
|
26328
26504
|
|
|
26329
|
-
export declare interface
|
|
26505
|
+
export declare interface Unstable_DevWorker {
|
|
26330
26506
|
port: number;
|
|
26331
26507
|
address: string;
|
|
26332
|
-
proxyData: ProxyData;
|
|
26333
26508
|
stop: () => Promise<void>;
|
|
26334
|
-
fetch: (input?: RequestInfo, init?:
|
|
26509
|
+
fetch: (input?: RequestInfo, init?: RequestInit_2) => Promise<Response_2>;
|
|
26335
26510
|
waitUntilExit: () => Promise<void>;
|
|
26336
26511
|
}
|
|
26337
26512
|
|
|
26513
|
+
export declare const unstable_generateASSETSBinding: (opts: Unstable_ASSETSBindingsOptions) => (request: Request_3) => Promise<Response_3>;
|
|
26514
|
+
|
|
26515
|
+
export declare function unstable_getMiniflareWorkerOptions(configPath: string, env?: string): Unstable_MiniflareWorkerOptions;
|
|
26516
|
+
|
|
26517
|
+
export declare function unstable_getMiniflareWorkerOptions(config: Unstable_Config, env?: string): Unstable_MiniflareWorkerOptions;
|
|
26518
|
+
|
|
26519
|
+
export declare interface Unstable_MiniflareWorkerOptions {
|
|
26520
|
+
workerOptions: SourcelessWorkerOptions;
|
|
26521
|
+
define: Record<string, string>;
|
|
26522
|
+
main?: string;
|
|
26523
|
+
externalWorkers: WorkerOptions[];
|
|
26524
|
+
}
|
|
26525
|
+
|
|
26526
|
+
export declare const unstable_pages: {
|
|
26527
|
+
deploy: typeof deploy;
|
|
26528
|
+
};
|
|
26529
|
+
|
|
26530
|
+
export declare type Unstable_RawConfig = Partial<ConfigFields<RawDevConfig>> & PagesConfigFields & Unstable_RawEnvironment & EnvironmentMap & {
|
|
26531
|
+
$schema?: string;
|
|
26532
|
+
};
|
|
26533
|
+
|
|
26534
|
+
/**
|
|
26535
|
+
* The raw environment configuration that we read from the config file.
|
|
26536
|
+
*
|
|
26537
|
+
* All the properties are optional, and will be replaced with defaults in the configuration that
|
|
26538
|
+
* is used in the rest of the codebase.
|
|
26539
|
+
*/
|
|
26540
|
+
export declare type Unstable_RawEnvironment = Partial<Environment>;
|
|
26541
|
+
|
|
26542
|
+
/**
|
|
26543
|
+
* Get the Wrangler configuration; read it from the give `configPath` if available.
|
|
26544
|
+
*/
|
|
26545
|
+
export declare function unstable_readConfig(args: ReadConfigCommandArgs, options?: ReadConfigOptions): Unstable_Config;
|
|
26546
|
+
|
|
26547
|
+
/**
|
|
26548
|
+
* Split an SQLQuery into an array of statements
|
|
26549
|
+
*/
|
|
26550
|
+
export declare function unstable_splitSqlQuery(sql: string): string[];
|
|
26551
|
+
|
|
26552
|
+
export declare function unstable_startWorker(options: StartDevWorkerInput): Promise<Worker>;
|
|
26553
|
+
|
|
26338
26554
|
/** Upgrade to a different protocol. */
|
|
26339
26555
|
declare function upgrade(
|
|
26340
26556
|
url: string | URL_2 | UrlObject,
|
|
@@ -26407,7 +26623,7 @@ declare const WebSocket: {
|
|
|
26407
26623
|
declare interface WebSocketEventMap {
|
|
26408
26624
|
close: CloseEvent
|
|
26409
26625
|
error: Event_2
|
|
26410
|
-
message:
|
|
26626
|
+
message: MessageEvent_2
|
|
26411
26627
|
open: Event_2
|
|
26412
26628
|
}
|
|
26413
26629
|
|
|
@@ -26428,6 +26644,7 @@ declare interface Worker {
|
|
|
26428
26644
|
scheduled: MiniflareWorker["scheduled"];
|
|
26429
26645
|
queue: MiniflareWorker["queue"];
|
|
26430
26646
|
dispose(): Promise<void>;
|
|
26647
|
+
raw: unstable_DevEnv;
|
|
26431
26648
|
}
|
|
26432
26649
|
|
|
26433
26650
|
declare type WorkerDefinition = {
|
|
@@ -26452,6 +26669,17 @@ declare type WorkerEntrypointsDefinition = Record<"default" | string, {
|
|
|
26452
26669
|
|
|
26453
26670
|
declare type WorkerRegistry = Record<string, WorkerDefinition>;
|
|
26454
26671
|
|
|
26672
|
+
declare type WorkflowBinding = {
|
|
26673
|
+
/** The name of the binding used to refer to the Workflow */
|
|
26674
|
+
binding: string;
|
|
26675
|
+
/** The name of the Workflow */
|
|
26676
|
+
name: string;
|
|
26677
|
+
/** The exported class name of the Workflow */
|
|
26678
|
+
class_name: string;
|
|
26679
|
+
/** The script where the Workflow is defined (if it's external to this Worker) */
|
|
26680
|
+
script_name?: string;
|
|
26681
|
+
};
|
|
26682
|
+
|
|
26455
26683
|
declare type ZoneIdRoute = {
|
|
26456
26684
|
pattern: string;
|
|
26457
26685
|
zone_id: string;
|