wrangler 0.0.0-e5037b92a → 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 +328 -1112
- package/package.json +40 -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 +624 -394
- package/wrangler-dist/cli.js +127150 -191643
- 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';
|
|
@@ -18,11 +17,9 @@ import type { ModuleRule } from 'miniflare';
|
|
|
18
17
|
import { Mutex } from 'miniflare';
|
|
19
18
|
import type { NodeJSCompatMode } from 'miniflare';
|
|
20
19
|
import { Readable } from 'stream';
|
|
21
|
-
import { ReadableStream } from 'stream/web';
|
|
22
|
-
import type { Request as
|
|
23
|
-
import { Response as
|
|
24
|
-
import type { Server } from 'node:http';
|
|
25
|
-
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';
|
|
26
23
|
import { Socket } from 'net';
|
|
27
24
|
import { TcpNetConnectOpts } from 'net';
|
|
28
25
|
import { TLSSocket } from 'tls';
|
|
@@ -77,27 +74,162 @@ declare type ApiCredentials = {
|
|
|
77
74
|
declare type AssetConfig = z.infer<typeof AssetConfigSchema>;
|
|
78
75
|
|
|
79
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">>;
|
|
80
81
|
html_handling: z.ZodOptional<z.ZodEnum<["auto-trailing-slash", "force-trailing-slash", "drop-trailing-slash", "none"]>>;
|
|
81
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
|
+
}>>;
|
|
82
156
|
}, "strip", z.ZodTypeAny, {
|
|
157
|
+
account_id?: number;
|
|
158
|
+
script_id?: number;
|
|
159
|
+
compatibility_date?: string;
|
|
160
|
+
compatibility_flags?: string[];
|
|
83
161
|
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
84
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
|
+
};
|
|
85
182
|
}, {
|
|
183
|
+
account_id?: number;
|
|
184
|
+
script_id?: number;
|
|
185
|
+
compatibility_date?: string;
|
|
186
|
+
compatibility_flags?: string[];
|
|
86
187
|
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
87
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
|
+
};
|
|
88
208
|
}>;
|
|
89
209
|
|
|
90
210
|
declare type Assets = {
|
|
91
211
|
/** Absolute path to assets directory */
|
|
92
|
-
directory
|
|
212
|
+
directory?: string;
|
|
213
|
+
/** Name of `env` binding property in the User Worker. */
|
|
93
214
|
binding?: string;
|
|
215
|
+
/** How to handle HTML requests. */
|
|
94
216
|
html_handling?: "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash" | "none";
|
|
217
|
+
/** How to handle requests that do not match an asset. */
|
|
95
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;
|
|
96
224
|
};
|
|
97
225
|
|
|
98
|
-
declare type AssetsOptions =
|
|
99
|
-
|
|
226
|
+
declare type AssetsOptions = {
|
|
227
|
+
directory: string;
|
|
228
|
+
binding?: string;
|
|
229
|
+
routerConfig: RouterConfig;
|
|
100
230
|
assetConfig: AssetConfig;
|
|
231
|
+
_redirects?: string;
|
|
232
|
+
_headers?: string;
|
|
101
233
|
};
|
|
102
234
|
|
|
103
235
|
declare type AsyncHook<T extends HookValues, Args extends unknown[] = []> = Hook<T, Args> | Hook<Promise<T>, Args>;
|
|
@@ -137,7 +269,7 @@ declare type Binding = {
|
|
|
137
269
|
type: "kv_namespace";
|
|
138
270
|
} & BindingOmit<CfKvNamespace>) | ({
|
|
139
271
|
type: "send_email";
|
|
140
|
-
} &
|
|
272
|
+
} & NameOmit<CfSendEmailBindings>) | {
|
|
141
273
|
type: "wasm_module";
|
|
142
274
|
source: BinaryFile;
|
|
143
275
|
} | {
|
|
@@ -147,6 +279,8 @@ declare type Binding = {
|
|
|
147
279
|
type: "browser";
|
|
148
280
|
} | {
|
|
149
281
|
type: "ai";
|
|
282
|
+
} | {
|
|
283
|
+
type: "images";
|
|
150
284
|
} | {
|
|
151
285
|
type: "version_metadata";
|
|
152
286
|
} | {
|
|
@@ -154,48 +288,40 @@ declare type Binding = {
|
|
|
154
288
|
source: BinaryFile;
|
|
155
289
|
} | ({
|
|
156
290
|
type: "durable_object_namespace";
|
|
157
|
-
} &
|
|
291
|
+
} & NameOmit<CfDurableObject>) | ({
|
|
292
|
+
type: "workflow";
|
|
293
|
+
} & BindingOmit<CfWorkflow>) | ({
|
|
158
294
|
type: "queue";
|
|
159
295
|
} & BindingOmit<CfQueue>) | ({
|
|
160
296
|
type: "r2_bucket";
|
|
161
297
|
} & BindingOmit<CfR2Bucket>) | ({
|
|
162
298
|
type: "d1";
|
|
163
|
-
} &
|
|
299
|
+
} & BindingOmit<CfD1Database>) | ({
|
|
164
300
|
type: "vectorize";
|
|
165
|
-
} &
|
|
301
|
+
} & BindingOmit<CfVectorize>) | ({
|
|
166
302
|
type: "hyperdrive";
|
|
167
|
-
} &
|
|
303
|
+
} & BindingOmit<CfHyperdrive>) | ({
|
|
168
304
|
type: "service";
|
|
169
|
-
} &
|
|
305
|
+
} & BindingOmit<CfService>) | {
|
|
170
306
|
type: "fetcher";
|
|
171
307
|
fetcher: ServiceFetch;
|
|
172
308
|
} | ({
|
|
173
309
|
type: "analytics_engine";
|
|
174
|
-
} &
|
|
310
|
+
} & BindingOmit<CfAnalyticsEngineDataset>) | ({
|
|
175
311
|
type: "dispatch_namespace";
|
|
176
|
-
} &
|
|
312
|
+
} & BindingOmit<CfDispatchNamespace>) | ({
|
|
177
313
|
type: "mtls_certificate";
|
|
178
|
-
} &
|
|
314
|
+
} & BindingOmit<CfMTlsCertificate>) | ({
|
|
179
315
|
type: "pipeline";
|
|
180
|
-
} &
|
|
316
|
+
} & BindingOmit<CfPipeline>) | ({
|
|
181
317
|
type: "logfwdr";
|
|
182
|
-
} &
|
|
318
|
+
} & NameOmit<CfLogfwdrBinding>) | {
|
|
183
319
|
type: `unsafe_${string}`;
|
|
184
320
|
} | {
|
|
185
321
|
type: "assets";
|
|
186
322
|
};
|
|
187
323
|
|
|
188
|
-
declare type BindingOmit<T> = Omit<T, "binding"
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Result of the `getBindingsProxy` utility
|
|
192
|
-
*/
|
|
193
|
-
export declare type BindingsProxy<Bindings = Record<string, unknown>, CfProperties extends Record<string, unknown> = IncomingRequestCfProperties> = Omit<PlatformProxy<Bindings, CfProperties>, "env"> & {
|
|
194
|
-
/**
|
|
195
|
-
* Object containing the various proxies
|
|
196
|
-
*/
|
|
197
|
-
bindings: Bindings;
|
|
198
|
-
};
|
|
324
|
+
declare type BindingOmit<T> = Omit<T, "binding">;
|
|
199
325
|
|
|
200
326
|
declare interface BlobPropertyBag {
|
|
201
327
|
type?: string
|
|
@@ -214,7 +340,7 @@ declare type BodyInit =
|
|
|
214
340
|
| string
|
|
215
341
|
|
|
216
342
|
declare interface BodyMixin {
|
|
217
|
-
readonly body:
|
|
343
|
+
readonly body: ReadableStream_2 | null
|
|
218
344
|
readonly bodyUsed: boolean
|
|
219
345
|
|
|
220
346
|
readonly arrayBuffer: () => Promise<ArrayBuffer>
|
|
@@ -339,13 +465,13 @@ declare type BundleStartEvent = {
|
|
|
339
465
|
};
|
|
340
466
|
|
|
341
467
|
declare interface Cache {
|
|
342
|
-
match (request: RequestInfo, options?: CacheQueryOptions): Promise<
|
|
343
|
-
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[]>,
|
|
344
470
|
add (request: RequestInfo): Promise<undefined>,
|
|
345
471
|
addAll (requests: RequestInfo[]): Promise<undefined>,
|
|
346
|
-
put (request: RequestInfo, response:
|
|
472
|
+
put (request: RequestInfo, response: Response_2): Promise<undefined>,
|
|
347
473
|
delete (request: RequestInfo, options?: CacheQueryOptions): Promise<boolean>,
|
|
348
|
-
keys (request?: RequestInfo, options?: CacheQueryOptions): Promise<readonly
|
|
474
|
+
keys (request?: RequestInfo, options?: CacheQueryOptions): Promise<readonly Request_2[]>
|
|
349
475
|
}
|
|
350
476
|
|
|
351
477
|
/**
|
|
@@ -374,7 +500,7 @@ declare type CacheResponse = any;
|
|
|
374
500
|
declare const caches: CacheStorage;
|
|
375
501
|
|
|
376
502
|
declare interface CacheStorage {
|
|
377
|
-
match (request: RequestInfo, options?: MultiCacheQueryOptions): Promise<
|
|
503
|
+
match (request: RequestInfo, options?: MultiCacheQueryOptions): Promise<Response_2 | undefined>,
|
|
378
504
|
has (cacheName: string): Promise<boolean>,
|
|
379
505
|
open (cacheName: string): Promise<Cache>,
|
|
380
506
|
delete (cacheName: string): Promise<boolean>,
|
|
@@ -447,8 +573,8 @@ declare type CfCapnp = {
|
|
|
447
573
|
|
|
448
574
|
declare interface CfD1Database {
|
|
449
575
|
binding: string;
|
|
450
|
-
database_id
|
|
451
|
-
database_name
|
|
576
|
+
database_id?: string | typeof INHERIT_SYMBOL;
|
|
577
|
+
database_name?: string;
|
|
452
578
|
preview_database_id?: string;
|
|
453
579
|
database_internal_env?: string;
|
|
454
580
|
migrations_table?: string;
|
|
@@ -486,7 +612,7 @@ declare interface CfHyperdrive {
|
|
|
486
612
|
*/
|
|
487
613
|
declare interface CfKvNamespace {
|
|
488
614
|
binding: string;
|
|
489
|
-
id
|
|
615
|
+
id?: string | typeof INHERIT_SYMBOL;
|
|
490
616
|
}
|
|
491
617
|
|
|
492
618
|
declare interface CfLogfwdrBinding {
|
|
@@ -524,7 +650,7 @@ declare interface CfModule {
|
|
|
524
650
|
* }
|
|
525
651
|
* }
|
|
526
652
|
*/
|
|
527
|
-
content: string | Buffer
|
|
653
|
+
content: string | Buffer<ArrayBuffer>;
|
|
528
654
|
/**
|
|
529
655
|
* An optional sourcemap for this module if it's of a ESM or CJS type, this will only be present
|
|
530
656
|
* if we're deploying with sourcemaps enabled. Since we copy extra modules that aren't bundled
|
|
@@ -562,7 +688,7 @@ declare interface CfQueue {
|
|
|
562
688
|
|
|
563
689
|
declare interface CfR2Bucket {
|
|
564
690
|
binding: string;
|
|
565
|
-
bucket_name
|
|
691
|
+
bucket_name?: string | typeof INHERIT_SYMBOL;
|
|
566
692
|
jurisdiction?: string;
|
|
567
693
|
}
|
|
568
694
|
|
|
@@ -631,6 +757,13 @@ declare interface CfWorkerSourceMap {
|
|
|
631
757
|
content: string | Buffer;
|
|
632
758
|
}
|
|
633
759
|
|
|
760
|
+
declare interface CfWorkflow {
|
|
761
|
+
name: string;
|
|
762
|
+
class_name: string;
|
|
763
|
+
binding: string;
|
|
764
|
+
script_name?: string;
|
|
765
|
+
}
|
|
766
|
+
|
|
634
767
|
/**
|
|
635
768
|
* A basic HTTP/1.1 client, mapped on top a single TCP/TLS connection. Pipelining is disabled by default.
|
|
636
769
|
*/
|
|
@@ -750,28 +883,19 @@ declare type CloudchamberConfig = {
|
|
|
750
883
|
ipv4?: boolean;
|
|
751
884
|
};
|
|
752
885
|
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
* - Fields that are specified in `PagesConfigFields` are only relevant for Pages projects
|
|
767
|
-
* - All top level fields in config and environments are optional in the wrangler.toml file.
|
|
768
|
-
*
|
|
769
|
-
* Legend for the annotations:
|
|
770
|
-
*
|
|
771
|
-
* - `@breaking`: the deprecation/optionality is a breaking change from Wrangler v1.
|
|
772
|
-
* - `@todo`: there's more work to be done (with details attached).
|
|
773
|
-
*/
|
|
774
|
-
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
|
+
}
|
|
775
899
|
|
|
776
900
|
declare class ConfigController extends Controller<ConfigControllerEventMap> {
|
|
777
901
|
#private;
|
|
@@ -788,7 +912,6 @@ declare type ConfigControllerEventMap = ControllerEventMap & {
|
|
|
788
912
|
};
|
|
789
913
|
|
|
790
914
|
declare interface ConfigFields<Dev extends RawDevConfig> {
|
|
791
|
-
configPath: string | undefined;
|
|
792
915
|
/**
|
|
793
916
|
* A boolean to enable "legacy" style wrangler environments (from Wrangler v1).
|
|
794
917
|
* These have been superseded by Services, but there may be projects that won't
|
|
@@ -817,7 +940,7 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
|
|
|
817
940
|
/**
|
|
818
941
|
* The directory containing your static assets.
|
|
819
942
|
*
|
|
820
|
-
* It must be a path relative to your
|
|
943
|
+
* It must be a path relative to your Wrangler configuration file.
|
|
821
944
|
* Example: bucket = "./public"
|
|
822
945
|
*
|
|
823
946
|
* If there is a `site` field then it must contain this `bucket` field.
|
|
@@ -849,20 +972,6 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
|
|
|
849
972
|
*/
|
|
850
973
|
exclude?: string[];
|
|
851
974
|
} | undefined;
|
|
852
|
-
/**
|
|
853
|
-
* Old behaviour of serving a folder of static assets with your Worker,
|
|
854
|
-
* without any additional code.
|
|
855
|
-
* This can either be a string, or an object with additional config
|
|
856
|
-
* fields.
|
|
857
|
-
* Will be deprecated in the near future in favor of `assets`.
|
|
858
|
-
*/
|
|
859
|
-
legacy_assets: {
|
|
860
|
-
bucket: string;
|
|
861
|
-
include: string[];
|
|
862
|
-
exclude: string[];
|
|
863
|
-
browser_TTL: number | undefined;
|
|
864
|
-
serve_single_page_app: boolean;
|
|
865
|
-
} | string | undefined;
|
|
866
975
|
/**
|
|
867
976
|
* A list of wasm modules that your worker should be bound to. This is
|
|
868
977
|
* the "legacy" way of binding to a wasm module. ES module workers should
|
|
@@ -895,7 +1004,7 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
|
|
|
895
1004
|
[key: string]: string;
|
|
896
1005
|
} | undefined;
|
|
897
1006
|
/**
|
|
898
|
-
* By default,
|
|
1007
|
+
* By default, the Wrangler configuration file is the source of truth for your environment configuration, like a terraform file.
|
|
899
1008
|
*
|
|
900
1009
|
* If you change your vars in the dashboard, wrangler *will* override/delete them on its next deploy.
|
|
901
1010
|
*
|
|
@@ -923,6 +1032,32 @@ url: string | URL_2 | UrlObject,
|
|
|
923
1032
|
options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.ConnectOptions, 'origin' | 'path'>
|
|
924
1033
|
): Promise<Dispatcher.ConnectData>;
|
|
925
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
|
+
|
|
926
1061
|
declare abstract class Controller<EventMap extends ControllerEventMap = ControllerEventMap> extends TypedEventEmitterImpl<EventMap> {
|
|
927
1062
|
emitErrorEvent(data: ErrorEvent): void;
|
|
928
1063
|
}
|
|
@@ -962,7 +1097,7 @@ declare type DeferredPromise<T> = {
|
|
|
962
1097
|
};
|
|
963
1098
|
|
|
964
1099
|
declare function deleteCookie (
|
|
965
|
-
headers:
|
|
1100
|
+
headers: Headers_2,
|
|
966
1101
|
name: string,
|
|
967
1102
|
attributes?: { name?: string, domain?: string }
|
|
968
1103
|
): void
|
|
@@ -973,99 +1108,71 @@ attributes?: { name?: string, domain?: string }
|
|
|
973
1108
|
* variable set
|
|
974
1109
|
*/
|
|
975
1110
|
declare function deploy({ directory, accountId, projectName, branch, skipCaching, commitMessage, commitHash, commitDirty, functionsDirectory: customFunctionsDirectory, bundle, sourceMaps, args, }: PagesDeployOptions): Promise<{
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
latest_stage: {
|
|
1000
|
-
name: "queued" | "build" | "deploy" | "initialize" | "clone_repo";
|
|
1001
|
-
status: "active" | "idle" | "canceled" | "success" | "failure" | "skipped";
|
|
1002
|
-
started_on: string | null;
|
|
1003
|
-
ended_on: string | null;
|
|
1004
|
-
};
|
|
1005
|
-
stages: {
|
|
1006
|
-
name: "queued" | "build" | "deploy" | "initialize" | "clone_repo";
|
|
1007
|
-
status: "active" | "idle" | "canceled" | "success" | "failure" | "skipped";
|
|
1008
|
-
started_on: string | null;
|
|
1009
|
-
ended_on: string | null;
|
|
1010
|
-
}[];
|
|
1011
|
-
aliases: string[];
|
|
1012
|
-
modified_on: string;
|
|
1013
|
-
short_id: string;
|
|
1014
|
-
build_image_major_version: number;
|
|
1015
|
-
source?: {
|
|
1016
|
-
type: "github" | "gitlab";
|
|
1017
|
-
config: {
|
|
1018
|
-
owner: string;
|
|
1019
|
-
repo_name: string;
|
|
1020
|
-
production_branch?: string | undefined;
|
|
1021
|
-
pr_comments_enabled?: boolean | undefined;
|
|
1022
|
-
deployments_enabled?: boolean | undefined;
|
|
1023
|
-
production_deployments_enabled?: boolean | undefined;
|
|
1024
|
-
preview_deployment_setting?: "none" | "all" | "custom" | undefined;
|
|
1025
|
-
preview_branch_includes?: string[] | undefined;
|
|
1026
|
-
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;
|
|
1027
1134
|
};
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
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;
|
|
1036
1174
|
}>;
|
|
1037
1175
|
|
|
1038
|
-
/**
|
|
1039
|
-
* Deprecated upload configuration.
|
|
1040
|
-
*/
|
|
1041
|
-
declare interface DeprecatedUpload {
|
|
1042
|
-
/**
|
|
1043
|
-
* The format of the Worker script.
|
|
1044
|
-
*
|
|
1045
|
-
* @deprecated We infer the format automatically now.
|
|
1046
|
-
*/
|
|
1047
|
-
format?: "modules" | "service-worker";
|
|
1048
|
-
/**
|
|
1049
|
-
* The directory you wish to upload your Worker from,
|
|
1050
|
-
* relative to the wrangler.toml file.
|
|
1051
|
-
*
|
|
1052
|
-
* Defaults to the directory containing the wrangler.toml file.
|
|
1053
|
-
*
|
|
1054
|
-
* @deprecated
|
|
1055
|
-
*/
|
|
1056
|
-
dir?: string;
|
|
1057
|
-
/**
|
|
1058
|
-
* The path to the Worker script, relative to `upload.dir`.
|
|
1059
|
-
*
|
|
1060
|
-
* @deprecated This will be replaced by a command line argument.
|
|
1061
|
-
*/
|
|
1062
|
-
main?: string;
|
|
1063
|
-
/**
|
|
1064
|
-
* @deprecated This is now defined at the top level `rules` field.
|
|
1065
|
-
*/
|
|
1066
|
-
rules?: Environment["rules"];
|
|
1067
|
-
}
|
|
1068
|
-
|
|
1069
1176
|
declare interface DevConfig {
|
|
1070
1177
|
/**
|
|
1071
1178
|
* IP address for the local dev server to listen on,
|
|
@@ -1412,7 +1519,7 @@ declare interface DispatchNamespaceOutbound {
|
|
|
1412
1519
|
parameters?: string[];
|
|
1413
1520
|
}
|
|
1414
1521
|
|
|
1415
|
-
declare type
|
|
1522
|
+
declare type DOMException_2 = typeof globalThis extends { DOMException: infer T }
|
|
1416
1523
|
? T
|
|
1417
1524
|
: any
|
|
1418
1525
|
|
|
@@ -1459,8 +1566,8 @@ declare interface EnablePagesAssetsServiceBindingOptions {
|
|
|
1459
1566
|
declare type Entry = {
|
|
1460
1567
|
/** A worker's entrypoint */
|
|
1461
1568
|
file: string;
|
|
1462
|
-
/** A worker's directory. Usually where the
|
|
1463
|
-
|
|
1569
|
+
/** A worker's directory. Usually where the Wrangler configuration file is located */
|
|
1570
|
+
projectRoot: string;
|
|
1464
1571
|
/** Is this a module worker or a service worker? */
|
|
1465
1572
|
format: CfScriptFormat;
|
|
1466
1573
|
/** The directory that contains all of a `--no-bundle` worker's modules. Usually `${directory}/src`. Defaults to path.dirname(file) */
|
|
@@ -1469,6 +1576,8 @@ declare type Entry = {
|
|
|
1469
1576
|
* A worker's name
|
|
1470
1577
|
*/
|
|
1471
1578
|
name?: string | undefined;
|
|
1579
|
+
/** Export from a Worker's entrypoint */
|
|
1580
|
+
exports: string[];
|
|
1472
1581
|
};
|
|
1473
1582
|
|
|
1474
1583
|
/**
|
|
@@ -1512,11 +1621,11 @@ declare interface EnvironmentInheritable {
|
|
|
1512
1621
|
compatibility_date: string | undefined;
|
|
1513
1622
|
/**
|
|
1514
1623
|
* A list of flags that enable features from upcoming features of
|
|
1515
|
-
* the Workers runtime, usually used together with
|
|
1624
|
+
* the Workers runtime, usually used together with compatibility_date.
|
|
1516
1625
|
*
|
|
1517
|
-
* More details at https://developers.cloudflare.com/workers/platform/compatibility-
|
|
1626
|
+
* More details at https://developers.cloudflare.com/workers/platform/compatibility-flags
|
|
1518
1627
|
*
|
|
1519
|
-
* @default
|
|
1628
|
+
* @default []
|
|
1520
1629
|
* @inheritable
|
|
1521
1630
|
*/
|
|
1522
1631
|
compatibility_flags: string[];
|
|
@@ -1554,13 +1663,20 @@ declare interface EnvironmentInheritable {
|
|
|
1554
1663
|
* Whether we use <name>.<subdomain>.workers.dev to
|
|
1555
1664
|
* test and deploy your Worker.
|
|
1556
1665
|
*
|
|
1557
|
-
*
|
|
1558
|
-
*
|
|
1559
|
-
* @default `true` (This is a breaking change from Wrangler v1)
|
|
1666
|
+
*
|
|
1667
|
+
* @default true
|
|
1560
1668
|
* @breaking
|
|
1561
1669
|
* @inheritable
|
|
1562
1670
|
*/
|
|
1563
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;
|
|
1564
1680
|
/**
|
|
1565
1681
|
* A list of routes that your Worker should be published to.
|
|
1566
1682
|
* Only one of `routes` or `route` is required.
|
|
@@ -1589,14 +1705,14 @@ declare interface EnvironmentInheritable {
|
|
|
1589
1705
|
/**
|
|
1590
1706
|
* The function to use to replace jsx syntax.
|
|
1591
1707
|
*
|
|
1592
|
-
* @default
|
|
1708
|
+
* @default "React.createElement"
|
|
1593
1709
|
* @inheritable
|
|
1594
1710
|
*/
|
|
1595
1711
|
jsx_factory: string;
|
|
1596
1712
|
/**
|
|
1597
1713
|
* The function to use to replace jsx fragment syntax.
|
|
1598
1714
|
*
|
|
1599
|
-
* @default
|
|
1715
|
+
* @default "React.Fragment"
|
|
1600
1716
|
* @inheritable
|
|
1601
1717
|
*/
|
|
1602
1718
|
jsx_fragment: string;
|
|
@@ -1618,24 +1734,12 @@ declare interface EnvironmentInheritable {
|
|
|
1618
1734
|
*
|
|
1619
1735
|
* More details here https://developers.cloudflare.com/workers/platform/cron-triggers
|
|
1620
1736
|
*
|
|
1621
|
-
* @default
|
|
1737
|
+
* @default {crons:[]}
|
|
1622
1738
|
* @inheritable
|
|
1623
1739
|
*/
|
|
1624
1740
|
triggers: {
|
|
1625
1741
|
crons: string[];
|
|
1626
1742
|
};
|
|
1627
|
-
/**
|
|
1628
|
-
* Specifies the Usage Model for your Worker. There are two options -
|
|
1629
|
-
* [bundled](https://developers.cloudflare.com/workers/platform/limits#bundled-usage-model) and
|
|
1630
|
-
* [unbound](https://developers.cloudflare.com/workers/platform/limits#unbound-usage-model).
|
|
1631
|
-
* For newly created Workers, if the Usage Model is omitted
|
|
1632
|
-
* it will be set to the [default Usage Model set on the account](https://dash.cloudflare.com/?account=workers/default-usage-model).
|
|
1633
|
-
* For existing Workers, if the Usage Model is omitted, it will be
|
|
1634
|
-
* set to the Usage Model configured in the dashboard for that Worker.
|
|
1635
|
-
*
|
|
1636
|
-
* @inheritable
|
|
1637
|
-
*/
|
|
1638
|
-
usage_model: "bundled" | "unbound" | undefined;
|
|
1639
1743
|
/**
|
|
1640
1744
|
* Specify limits for runtime behavior.
|
|
1641
1745
|
* Only supported for the "standard" Usage Model
|
|
@@ -1667,11 +1771,6 @@ declare interface EnvironmentInheritable {
|
|
|
1667
1771
|
cwd?: string;
|
|
1668
1772
|
/** The directory to watch for changes while using wrangler dev, defaults to the current working directory */
|
|
1669
1773
|
watch_dir?: string | string[];
|
|
1670
|
-
/**
|
|
1671
|
-
* Deprecated field previously used to configure the build and upload of the script.
|
|
1672
|
-
* @deprecated
|
|
1673
|
-
*/
|
|
1674
|
-
upload?: DeprecatedUpload;
|
|
1675
1774
|
};
|
|
1676
1775
|
/**
|
|
1677
1776
|
* Skip internal build steps and directly deploy script
|
|
@@ -1683,28 +1782,16 @@ declare interface EnvironmentInheritable {
|
|
|
1683
1782
|
* @inheritable
|
|
1684
1783
|
*/
|
|
1685
1784
|
minify: boolean | undefined;
|
|
1686
|
-
/**
|
|
1687
|
-
* Add polyfills for node builtin modules and globals
|
|
1688
|
-
* @inheritable
|
|
1689
|
-
*/
|
|
1690
|
-
node_compat: boolean | undefined;
|
|
1691
1785
|
/**
|
|
1692
1786
|
* Designates this Worker as an internal-only "first-party" Worker.
|
|
1693
1787
|
*
|
|
1694
1788
|
* @inheritable
|
|
1695
1789
|
*/
|
|
1696
1790
|
first_party_worker: boolean | undefined;
|
|
1697
|
-
/**
|
|
1698
|
-
* TODO: remove this as it has been deprecated.
|
|
1699
|
-
*
|
|
1700
|
-
* This is just here for now because the `route` commands use it.
|
|
1701
|
-
* So we need to include it in this type so it is available.
|
|
1702
|
-
*/
|
|
1703
|
-
zone_id?: string;
|
|
1704
1791
|
/**
|
|
1705
1792
|
* List of bindings that you will send to logfwdr
|
|
1706
1793
|
*
|
|
1707
|
-
* @default
|
|
1794
|
+
* @default {bindings:[]}
|
|
1708
1795
|
* @inheritable
|
|
1709
1796
|
*/
|
|
1710
1797
|
logfwdr: {
|
|
@@ -1758,6 +1845,24 @@ declare interface EnvironmentInheritable {
|
|
|
1758
1845
|
observability: Observability | undefined;
|
|
1759
1846
|
}
|
|
1760
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
|
+
|
|
1761
1866
|
/**
|
|
1762
1867
|
* The `EnvironmentNonInheritable` interface declares all the configuration fields for an environment
|
|
1763
1868
|
* that cannot be inherited from the top-level environment, and must be defined specifically.
|
|
@@ -1772,7 +1877,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1772
1877
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1773
1878
|
* and so must be specified in every named environment.
|
|
1774
1879
|
*
|
|
1775
|
-
* @default
|
|
1880
|
+
* @default {}
|
|
1776
1881
|
* @nonInheritable
|
|
1777
1882
|
*/
|
|
1778
1883
|
define: Record<string, string>;
|
|
@@ -1782,7 +1887,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1782
1887
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1783
1888
|
* and so must be specified in every named environment.
|
|
1784
1889
|
*
|
|
1785
|
-
* @default
|
|
1890
|
+
* @default {}
|
|
1786
1891
|
* @nonInheritable
|
|
1787
1892
|
*/
|
|
1788
1893
|
vars: Record<string, string | Json>;
|
|
@@ -1795,22 +1900,47 @@ declare interface EnvironmentNonInheritable {
|
|
|
1795
1900
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1796
1901
|
* and so must be specified in every named environment.
|
|
1797
1902
|
*
|
|
1798
|
-
* @default
|
|
1903
|
+
* @default {bindings:[]}
|
|
1799
1904
|
* @nonInheritable
|
|
1800
1905
|
*/
|
|
1801
1906
|
durable_objects: {
|
|
1802
1907
|
bindings: DurableObjectBindings;
|
|
1803
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[];
|
|
1804
1919
|
/**
|
|
1805
1920
|
* Cloudchamber configuration
|
|
1806
1921
|
*
|
|
1807
1922
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1808
1923
|
* and so must be specified in every named environment.
|
|
1809
1924
|
*
|
|
1810
|
-
* @default
|
|
1925
|
+
* @default {}
|
|
1811
1926
|
* @nonInheritable
|
|
1812
1927
|
*/
|
|
1813
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
|
+
};
|
|
1814
1944
|
/**
|
|
1815
1945
|
* These specify any Workers KV Namespaces you want to
|
|
1816
1946
|
* access from inside your Worker.
|
|
@@ -1821,14 +1951,14 @@ declare interface EnvironmentNonInheritable {
|
|
|
1821
1951
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1822
1952
|
* and so must be specified in every named environment.
|
|
1823
1953
|
*
|
|
1824
|
-
* @default
|
|
1954
|
+
* @default []
|
|
1825
1955
|
* @nonInheritable
|
|
1826
1956
|
*/
|
|
1827
1957
|
kv_namespaces: {
|
|
1828
1958
|
/** The binding name used to refer to the KV Namespace */
|
|
1829
1959
|
binding: string;
|
|
1830
1960
|
/** The ID of the KV namespace */
|
|
1831
|
-
id
|
|
1961
|
+
id?: string;
|
|
1832
1962
|
/** The ID of the KV namespace used during `wrangler dev` */
|
|
1833
1963
|
preview_id?: string;
|
|
1834
1964
|
}[];
|
|
@@ -1838,7 +1968,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1838
1968
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1839
1969
|
* and so must be specified in every named environment.
|
|
1840
1970
|
*
|
|
1841
|
-
* @default
|
|
1971
|
+
* @default []
|
|
1842
1972
|
* @nonInheritable
|
|
1843
1973
|
*/
|
|
1844
1974
|
send_email: {
|
|
@@ -1855,7 +1985,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1855
1985
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1856
1986
|
* and so must be specified in every named environment.
|
|
1857
1987
|
*
|
|
1858
|
-
* @default
|
|
1988
|
+
* @default {consumers:[],producers:[]}
|
|
1859
1989
|
* @nonInheritable
|
|
1860
1990
|
*/
|
|
1861
1991
|
queues: {
|
|
@@ -1896,14 +2026,14 @@ declare interface EnvironmentNonInheritable {
|
|
|
1896
2026
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1897
2027
|
* and so must be specified in every named environment.
|
|
1898
2028
|
*
|
|
1899
|
-
* @default
|
|
2029
|
+
* @default []
|
|
1900
2030
|
* @nonInheritable
|
|
1901
2031
|
*/
|
|
1902
2032
|
r2_buckets: {
|
|
1903
2033
|
/** The binding name used to refer to the R2 bucket in the Worker. */
|
|
1904
2034
|
binding: string;
|
|
1905
2035
|
/** The name of this R2 bucket at the edge. */
|
|
1906
|
-
bucket_name
|
|
2036
|
+
bucket_name?: string;
|
|
1907
2037
|
/** The preview name of this R2 bucket at the edge. */
|
|
1908
2038
|
preview_bucket_name?: string;
|
|
1909
2039
|
/** The jurisdiction that the bucket exists in. Default if not present. */
|
|
@@ -1915,16 +2045,16 @@ declare interface EnvironmentNonInheritable {
|
|
|
1915
2045
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1916
2046
|
* and so must be specified in every named environment.
|
|
1917
2047
|
*
|
|
1918
|
-
* @default
|
|
2048
|
+
* @default []
|
|
1919
2049
|
* @nonInheritable
|
|
1920
2050
|
*/
|
|
1921
2051
|
d1_databases: {
|
|
1922
2052
|
/** The binding name used to refer to the D1 database in the Worker. */
|
|
1923
2053
|
binding: string;
|
|
1924
2054
|
/** The name of this D1 database. */
|
|
1925
|
-
database_name
|
|
2055
|
+
database_name?: string;
|
|
1926
2056
|
/** The UUID of this D1 database (not required). */
|
|
1927
|
-
database_id
|
|
2057
|
+
database_id?: string;
|
|
1928
2058
|
/** The UUID of this D1 database for Wrangler Dev (if specified). */
|
|
1929
2059
|
preview_database_id?: string;
|
|
1930
2060
|
/** The name of the migrations table for this D1 database (defaults to 'd1_migrations'). */
|
|
@@ -1940,7 +2070,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1940
2070
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1941
2071
|
* and so must be specified in every named environment.
|
|
1942
2072
|
*
|
|
1943
|
-
* @default
|
|
2073
|
+
* @default []
|
|
1944
2074
|
* @nonInheritable
|
|
1945
2075
|
*/
|
|
1946
2076
|
vectorize: {
|
|
@@ -1955,7 +2085,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1955
2085
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1956
2086
|
* and so must be specified in every named environment.
|
|
1957
2087
|
*
|
|
1958
|
-
* @default
|
|
2088
|
+
* @default []
|
|
1959
2089
|
* @nonInheritable
|
|
1960
2090
|
*/
|
|
1961
2091
|
hyperdrive: {
|
|
@@ -1972,7 +2102,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1972
2102
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1973
2103
|
* and so must be specified in every named environment.
|
|
1974
2104
|
*
|
|
1975
|
-
* @default
|
|
2105
|
+
* @default []
|
|
1976
2106
|
* @nonInheritable
|
|
1977
2107
|
*/
|
|
1978
2108
|
services: {
|
|
@@ -1991,7 +2121,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
1991
2121
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1992
2122
|
* and so must be specified in every named environment.
|
|
1993
2123
|
*
|
|
1994
|
-
* @default
|
|
2124
|
+
* @default []
|
|
1995
2125
|
* @nonInheritable
|
|
1996
2126
|
*/
|
|
1997
2127
|
analytics_engine_datasets: {
|
|
@@ -2006,7 +2136,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
2006
2136
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2007
2137
|
* and so must be specified in every named environment.
|
|
2008
2138
|
*
|
|
2009
|
-
* @default
|
|
2139
|
+
* @default {}
|
|
2010
2140
|
* @nonInheritable
|
|
2011
2141
|
*/
|
|
2012
2142
|
browser: {
|
|
@@ -2018,13 +2148,25 @@ declare interface EnvironmentNonInheritable {
|
|
|
2018
2148
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2019
2149
|
* and so must be specified in every named environment.
|
|
2020
2150
|
*
|
|
2021
|
-
* @default
|
|
2151
|
+
* @default {}
|
|
2022
2152
|
* @nonInheritable
|
|
2023
2153
|
*/
|
|
2024
2154
|
ai: {
|
|
2025
2155
|
binding: string;
|
|
2026
2156
|
staging?: boolean;
|
|
2027
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;
|
|
2028
2170
|
/**
|
|
2029
2171
|
* Binding to the Worker Version's metadata
|
|
2030
2172
|
*/
|
|
@@ -2037,7 +2179,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
2037
2179
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2038
2180
|
* and so must be specified in every named environment.
|
|
2039
2181
|
*
|
|
2040
|
-
* @default
|
|
2182
|
+
* @default {}
|
|
2041
2183
|
* @nonInheritable
|
|
2042
2184
|
*/
|
|
2043
2185
|
unsafe: {
|
|
@@ -2077,7 +2219,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
2077
2219
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2078
2220
|
* and so must be specified in every named environment.
|
|
2079
2221
|
*
|
|
2080
|
-
* @default
|
|
2222
|
+
* @default []
|
|
2081
2223
|
* @nonInheritable
|
|
2082
2224
|
*/
|
|
2083
2225
|
mtls_certificates: {
|
|
@@ -2092,7 +2234,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
2092
2234
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2093
2235
|
* and so must be specified in every named environment.
|
|
2094
2236
|
*
|
|
2095
|
-
* @default
|
|
2237
|
+
* @default []
|
|
2096
2238
|
* @nonInheritable
|
|
2097
2239
|
*/
|
|
2098
2240
|
tail_consumers?: TailConsumer[];
|
|
@@ -2102,7 +2244,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
2102
2244
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2103
2245
|
* and so must be specified in every named environment.
|
|
2104
2246
|
*
|
|
2105
|
-
* @default
|
|
2247
|
+
* @default []
|
|
2106
2248
|
* @nonInheritable
|
|
2107
2249
|
*/
|
|
2108
2250
|
dispatch_namespaces: {
|
|
@@ -2119,7 +2261,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
2119
2261
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2120
2262
|
* and so must be specified in every named environment.
|
|
2121
2263
|
*
|
|
2122
|
-
* @default
|
|
2264
|
+
* @default []
|
|
2123
2265
|
* @nonInheritable
|
|
2124
2266
|
*/
|
|
2125
2267
|
pipelines: {
|
|
@@ -2130,7 +2272,7 @@ declare interface EnvironmentNonInheritable {
|
|
|
2130
2272
|
}[];
|
|
2131
2273
|
}
|
|
2132
2274
|
|
|
2133
|
-
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", {
|
|
2134
2276
|
config?: StartDevWorkerOptions;
|
|
2135
2277
|
bundle?: Bundle;
|
|
2136
2278
|
}> | BaseErrorEvent<"BundlerController", {
|
|
@@ -2339,10 +2481,18 @@ declare class ExecutionContext {
|
|
|
2339
2481
|
passThroughOnException(): void;
|
|
2340
2482
|
}
|
|
2341
2483
|
|
|
2342
|
-
declare
|
|
2484
|
+
export declare const experimental_patchConfig: (configPath: string, patch: Unstable_RawConfig, isArrayInsertion?: boolean) => string;
|
|
2485
|
+
|
|
2486
|
+
export declare const experimental_readRawConfig: (args: ReadConfigCommandArgs, options?: ReadConfigOptions) => {
|
|
2487
|
+
rawConfig: Unstable_RawConfig;
|
|
2488
|
+
configPath: string | undefined;
|
|
2489
|
+
userConfigPath: string | undefined;
|
|
2490
|
+
};
|
|
2491
|
+
|
|
2492
|
+
declare function fetch_2 (
|
|
2343
2493
|
input: RequestInfo,
|
|
2344
|
-
init?:
|
|
2345
|
-
): Promise<
|
|
2494
|
+
init?: RequestInit_2
|
|
2495
|
+
): Promise<Response_2>
|
|
2346
2496
|
|
|
2347
2497
|
declare class File extends Blob_2 {
|
|
2348
2498
|
/**
|
|
@@ -2405,7 +2555,7 @@ declare class FileReader {
|
|
|
2405
2555
|
|
|
2406
2556
|
readonly result: string | ArrayBuffer | null
|
|
2407
2557
|
|
|
2408
|
-
readonly error:
|
|
2558
|
+
readonly error: DOMException_2 | null
|
|
2409
2559
|
|
|
2410
2560
|
onloadstart: null | ((this: FileReader, event: ProgressEvent) => void)
|
|
2411
2561
|
onprogress: null | ((this: FileReader, event: ProgressEvent) => void)
|
|
@@ -2518,28 +2668,14 @@ declare class FormData_2 {
|
|
|
2518
2668
|
*/
|
|
2519
2669
|
declare type FormDataEntryValue = string | File
|
|
2520
2670
|
|
|
2521
|
-
|
|
2522
|
-
* By reading from a `wrangler.toml` file this function generates proxy binding objects that can be
|
|
2523
|
-
* used to simulate the interaction with bindings during local development in a Node.js environment
|
|
2524
|
-
*
|
|
2525
|
-
* @deprecated use `getPlatformProxy` instead
|
|
2526
|
-
*
|
|
2527
|
-
* @param options The various options that can tweak this function's behavior
|
|
2528
|
-
* @returns An Object containing the generated proxies alongside other related utilities
|
|
2529
|
-
*/
|
|
2530
|
-
export declare function getBindingsProxy<Bindings = Record<string, unknown>, CfProperties extends Record<string, unknown> = IncomingRequestCfProperties>(options?: GetBindingsProxyOptions): Promise<BindingsProxy<Bindings, CfProperties>>;
|
|
2531
|
-
|
|
2532
|
-
/** Options for the `getBindingsProxy` utility */
|
|
2533
|
-
export declare type GetBindingsProxyOptions = GetPlatformProxyOptions;
|
|
2534
|
-
|
|
2535
|
-
declare function getCookies (headers: Headers): Record<string, string>
|
|
2671
|
+
declare function getCookies (headers: Headers_2): Record<string, string>
|
|
2536
2672
|
|
|
2537
2673
|
declare function getGlobalDispatcher(): Dispatcher;
|
|
2538
2674
|
|
|
2539
2675
|
declare function getGlobalOrigin(): URL | undefined;
|
|
2540
2676
|
|
|
2541
2677
|
/**
|
|
2542
|
-
* By reading from a
|
|
2678
|
+
* By reading from a Wrangler configuration file this function generates proxy objects that can be
|
|
2543
2679
|
* used to simulate the interaction with the Cloudflare platform during local development
|
|
2544
2680
|
* in a Node.js environment
|
|
2545
2681
|
*
|
|
@@ -2559,19 +2695,12 @@ export declare type GetPlatformProxyOptions = {
|
|
|
2559
2695
|
/**
|
|
2560
2696
|
* The path to the config file to use.
|
|
2561
2697
|
* If no path is specified the default behavior is to search from the
|
|
2562
|
-
* current directory up the filesystem for a
|
|
2698
|
+
* current directory up the filesystem for a Wrangler configuration file to use.
|
|
2563
2699
|
*
|
|
2564
2700
|
* Note: this field is optional but if a path is specified it must
|
|
2565
2701
|
* point to a valid file on the filesystem
|
|
2566
2702
|
*/
|
|
2567
2703
|
configPath?: string;
|
|
2568
|
-
/**
|
|
2569
|
-
* Flag to indicate the utility to read a json config file (`wrangler.json`/`wrangler.jsonc`)
|
|
2570
|
-
* instead of the toml one (`wrangler.toml`)
|
|
2571
|
-
*
|
|
2572
|
-
* Note: this feature is experimental
|
|
2573
|
-
*/
|
|
2574
|
-
experimentalJsonConfig?: boolean;
|
|
2575
2704
|
/**
|
|
2576
2705
|
* Indicates if and where to persist the bindings data, if not present or `true` it defaults to the same location
|
|
2577
2706
|
* used by wrangler v3: `.wrangler/state/v3` (so that the same data can be easily used by the caller and wrangler).
|
|
@@ -2580,17 +2709,11 @@ export declare type GetPlatformProxyOptions = {
|
|
|
2580
2709
|
persist?: boolean | {
|
|
2581
2710
|
path: string;
|
|
2582
2711
|
};
|
|
2583
|
-
/**
|
|
2584
|
-
* Use the experimental file-based dev registry for service discovery
|
|
2585
|
-
*
|
|
2586
|
-
* Note: this feature is experimental
|
|
2587
|
-
*/
|
|
2588
|
-
experimentalRegistry?: boolean;
|
|
2589
2712
|
};
|
|
2590
2713
|
|
|
2591
|
-
declare function getSetCookies (headers:
|
|
2714
|
+
declare function getSetCookies (headers: Headers_2): Cookie[]
|
|
2592
2715
|
|
|
2593
|
-
declare class
|
|
2716
|
+
declare class Headers_2 implements SpecIterable<[string, string]> {
|
|
2594
2717
|
constructor (init?: HeadersInit)
|
|
2595
2718
|
readonly append: (name: string, value: string) => void
|
|
2596
2719
|
readonly delete: (name: string) => void
|
|
@@ -2599,7 +2722,7 @@ declare class Headers implements SpecIterable<[string, string]> {
|
|
|
2599
2722
|
readonly set: (name: string, value: string) => void
|
|
2600
2723
|
readonly getSetCookie: () => string[]
|
|
2601
2724
|
readonly forEach: (
|
|
2602
|
-
callbackfn: (value: string, key: string, iterable:
|
|
2725
|
+
callbackfn: (value: string, key: string, iterable: Headers_2) => void,
|
|
2603
2726
|
thisArg?: unknown
|
|
2604
2727
|
) => void
|
|
2605
2728
|
|
|
@@ -2609,23 +2732,21 @@ declare class Headers implements SpecIterable<[string, string]> {
|
|
|
2609
2732
|
readonly [Symbol.iterator]: () => SpecIterator<[string, string]>
|
|
2610
2733
|
}
|
|
2611
2734
|
|
|
2612
|
-
declare type HeadersInit = string[][] | Record<string, string | ReadonlyArray<string>> |
|
|
2735
|
+
declare type HeadersInit = string[][] | Record<string, string | ReadonlyArray<string>> | Headers_2
|
|
2613
2736
|
|
|
2614
2737
|
declare type Hook<T extends HookValues, Args extends unknown[] = []> = T | ((...args: Args) => T);
|
|
2615
2738
|
|
|
2616
2739
|
declare type HookValues = string | number | boolean | object | undefined | null;
|
|
2617
2740
|
|
|
2618
2741
|
/**
|
|
2619
|
-
*
|
|
2742
|
+
* The header type declaration of `undici`.
|
|
2620
2743
|
*/
|
|
2621
|
-
declare type
|
|
2622
|
-
readonly terminate: () => Promise<void>;
|
|
2623
|
-
};
|
|
2744
|
+
declare type IncomingHttpHeaders = Record<string, string | string[] | undefined>;
|
|
2624
2745
|
|
|
2625
2746
|
/**
|
|
2626
|
-
*
|
|
2747
|
+
* A symbol to inherit a binding from the deployed worker.
|
|
2627
2748
|
*/
|
|
2628
|
-
declare
|
|
2749
|
+
declare const INHERIT_SYMBOL: unique symbol;
|
|
2629
2750
|
|
|
2630
2751
|
declare type InspectorProxyWorkerIncomingWebSocketMessage = {
|
|
2631
2752
|
type: ReloadStartEvent["type"];
|
|
@@ -2659,8 +2780,10 @@ declare class Logger {
|
|
|
2659
2780
|
#private;
|
|
2660
2781
|
constructor();
|
|
2661
2782
|
private overrideLoggerLevel?;
|
|
2662
|
-
|
|
2663
|
-
|
|
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;
|
|
2664
2787
|
columns: number;
|
|
2665
2788
|
debug: (...args: unknown[]) => void;
|
|
2666
2789
|
debugWithSanitization: (label: string, ...args: unknown[]) => void;
|
|
@@ -2670,17 +2793,36 @@ declare class Logger {
|
|
|
2670
2793
|
error: (...args: unknown[]) => void;
|
|
2671
2794
|
table<Keys extends string>(data: TableRow<Keys>[]): void;
|
|
2672
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;
|
|
2673
2804
|
private doLog;
|
|
2674
2805
|
static registerBeforeLogHook(callback: (() => void) | undefined): void;
|
|
2675
2806
|
static registerAfterLogHook(callback: (() => void) | undefined): void;
|
|
2676
2807
|
private formatMessage;
|
|
2677
2808
|
}
|
|
2678
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
|
+
|
|
2679
2821
|
declare type LogLevel = "debug" | "info" | "log" | "warn" | "error" | "none";
|
|
2680
2822
|
|
|
2681
2823
|
declare type MaybePromise<T> = T | Promise<T>;
|
|
2682
2824
|
|
|
2683
|
-
declare interface
|
|
2825
|
+
declare interface MessageEvent_2<T = any> extends Event_2 {
|
|
2684
2826
|
readonly data: T
|
|
2685
2827
|
readonly lastEventId: string
|
|
2686
2828
|
readonly origin: string
|
|
@@ -2698,9 +2840,9 @@ declare interface MessageEvent<T = any> extends Event_2 {
|
|
|
2698
2840
|
): void;
|
|
2699
2841
|
}
|
|
2700
2842
|
|
|
2701
|
-
declare const
|
|
2702
|
-
prototype:
|
|
2703
|
-
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>
|
|
2704
2846
|
};
|
|
2705
2847
|
|
|
2706
2848
|
declare interface MessageEventInit<T = any> extends EventInit {
|
|
@@ -2839,7 +2981,7 @@ declare namespace MockInterceptor {
|
|
|
2839
2981
|
origin: string;
|
|
2840
2982
|
method: string;
|
|
2841
2983
|
body?: BodyInit | Dispatcher.DispatchOptions['body'];
|
|
2842
|
-
headers:
|
|
2984
|
+
headers: Headers_2 | Record<string, string>;
|
|
2843
2985
|
maxRedirections: number;
|
|
2844
2986
|
}
|
|
2845
2987
|
|
|
@@ -2886,29 +3028,38 @@ declare interface MultiCacheQueryOptions extends CacheQueryOptions {
|
|
|
2886
3028
|
cacheName?: string
|
|
2887
3029
|
}
|
|
2888
3030
|
|
|
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
|
+
};
|
|
3043
|
+
|
|
2889
3044
|
declare interface Observability {
|
|
2890
3045
|
/** If observability is enabled for this Worker */
|
|
2891
|
-
enabled
|
|
3046
|
+
enabled?: boolean;
|
|
2892
3047
|
/** The sampling rate */
|
|
2893
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
|
+
};
|
|
2894
3056
|
}
|
|
2895
3057
|
|
|
2896
3058
|
declare interface PagesConfigFields {
|
|
2897
3059
|
/**
|
|
2898
3060
|
* The directory of static assets to serve.
|
|
2899
3061
|
*
|
|
2900
|
-
* The presence of this field in
|
|
2901
|
-
* and will prompt the handling of the configuration file according to the
|
|
2902
|
-
* Pages-specific validation rules.
|
|
2903
|
-
*/
|
|
2904
|
-
pages_build_output_dir?: string;
|
|
2905
|
-
}
|
|
2906
|
-
|
|
2907
|
-
declare interface PagesConfigFields {
|
|
2908
|
-
/**
|
|
2909
|
-
* The directory of static assets to serve.
|
|
2910
|
-
*
|
|
2911
|
-
* 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,
|
|
2912
3063
|
* and will prompt the handling of the configuration file according to the
|
|
2913
3064
|
* Pages-specific validation rules.
|
|
2914
3065
|
*/
|
|
@@ -25484,7 +25635,7 @@ declare class ProxyController extends Controller<ProxyControllerEventMap> {
|
|
|
25484
25635
|
onReloadComplete(data: ReloadCompleteEvent): void;
|
|
25485
25636
|
onProxyWorkerMessage(message: ProxyWorkerOutgoingRequestBody): void;
|
|
25486
25637
|
onInspectorProxyWorkerMessage(message: InspectorProxyWorkerOutgoingWebsocketMessage): void;
|
|
25487
|
-
onInspectorProxyWorkerRequest(message: InspectorProxyWorkerOutgoingRequestBody): Promise<
|
|
25638
|
+
onInspectorProxyWorkerRequest(message: InspectorProxyWorkerOutgoingRequestBody): Promise<Response_3>;
|
|
25488
25639
|
_torndown: boolean;
|
|
25489
25640
|
teardown(): Promise<void>;
|
|
25490
25641
|
emitReadyEvent(proxyWorker: Miniflare, url: URL, inspectorUrl: URL): void;
|
|
@@ -25527,10 +25678,19 @@ declare type ProxyWorkerOutgoingRequestBody = {
|
|
|
25527
25678
|
args: Parameters<typeof console.debug>;
|
|
25528
25679
|
};
|
|
25529
25680
|
|
|
25530
|
-
declare type QueueConsumer = NonNullable<
|
|
25681
|
+
declare type QueueConsumer = NonNullable<Unstable_Config["queues"]["consumers"]>[number];
|
|
25531
25682
|
|
|
25532
25683
|
declare type RawDevConfig = Partial<DevConfig>;
|
|
25533
25684
|
|
|
25685
|
+
declare type ReadConfigCommandArgs = NormalizeAndValidateConfigArgs & {
|
|
25686
|
+
config?: string;
|
|
25687
|
+
script?: string;
|
|
25688
|
+
};
|
|
25689
|
+
|
|
25690
|
+
declare type ReadConfigOptions = ResolveConfigPathOptions & {
|
|
25691
|
+
hideWarnings?: boolean;
|
|
25692
|
+
};
|
|
25693
|
+
|
|
25534
25694
|
declare type ReadyEvent = {
|
|
25535
25695
|
type: "ready";
|
|
25536
25696
|
proxyWorker: Miniflare;
|
|
@@ -25568,13 +25728,19 @@ declare type ReloadStartEvent = {
|
|
|
25568
25728
|
bundle: Bundle;
|
|
25569
25729
|
};
|
|
25570
25730
|
|
|
25571
|
-
|
|
25572
|
-
|
|
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)
|
|
25573
25739
|
|
|
25574
25740
|
readonly cache: RequestCache
|
|
25575
25741
|
readonly credentials: RequestCredentials
|
|
25576
25742
|
readonly destination: RequestDestination
|
|
25577
|
-
readonly headers:
|
|
25743
|
+
readonly headers: Headers_2
|
|
25578
25744
|
readonly integrity: string
|
|
25579
25745
|
readonly method: string
|
|
25580
25746
|
readonly mode: RequestMode
|
|
@@ -25586,7 +25752,7 @@ declare class Request implements BodyMixin {
|
|
|
25586
25752
|
readonly signal: AbortSignal
|
|
25587
25753
|
readonly duplex: RequestDuplex
|
|
25588
25754
|
|
|
25589
|
-
readonly body:
|
|
25755
|
+
readonly body: ReadableStream_2 | null
|
|
25590
25756
|
readonly bodyUsed: boolean
|
|
25591
25757
|
|
|
25592
25758
|
readonly arrayBuffer: () => Promise<ArrayBuffer>
|
|
@@ -25595,15 +25761,9 @@ declare class Request implements BodyMixin {
|
|
|
25595
25761
|
readonly json: () => Promise<unknown>
|
|
25596
25762
|
readonly text: () => Promise<string>
|
|
25597
25763
|
|
|
25598
|
-
readonly clone: () =>
|
|
25764
|
+
readonly clone: () => Request_2
|
|
25599
25765
|
}
|
|
25600
25766
|
|
|
25601
|
-
/** Performs an HTTP request. */
|
|
25602
|
-
declare function request(
|
|
25603
|
-
url: string | URL_2 | UrlObject,
|
|
25604
|
-
options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions, 'origin' | 'path' | 'method'> & Partial<Pick<Dispatcher.RequestOptions, 'method'>>,
|
|
25605
|
-
): Promise<Dispatcher.ResponseData>;
|
|
25606
|
-
|
|
25607
25767
|
declare type RequestCache =
|
|
25608
25768
|
| 'default'
|
|
25609
25769
|
| 'force-cache'
|
|
@@ -25636,9 +25796,9 @@ declare type RequestDestination =
|
|
|
25636
25796
|
|
|
25637
25797
|
declare type RequestDuplex = 'half'
|
|
25638
25798
|
|
|
25639
|
-
declare type RequestInfo = string | URL_2 |
|
|
25799
|
+
declare type RequestInfo = string | URL_2 | Request_2
|
|
25640
25800
|
|
|
25641
|
-
declare interface
|
|
25801
|
+
declare interface RequestInit_2 {
|
|
25642
25802
|
method?: string
|
|
25643
25803
|
keepalive?: boolean
|
|
25644
25804
|
headers?: HeadersInit
|
|
@@ -25659,10 +25819,14 @@ declare type RequestMode = 'cors' | 'navigate' | 'no-cors' | 'same-origin'
|
|
|
25659
25819
|
|
|
25660
25820
|
declare type RequestRedirect = 'error' | 'follow' | 'manual'
|
|
25661
25821
|
|
|
25662
|
-
declare
|
|
25663
|
-
|
|
25822
|
+
declare type ResolveConfigPathOptions = {
|
|
25823
|
+
useRedirectIfAvailable?: boolean;
|
|
25824
|
+
};
|
|
25825
|
+
|
|
25826
|
+
declare class Response_2 implements BodyMixin {
|
|
25827
|
+
constructor (body?: BodyInit, init?: ResponseInit_2)
|
|
25664
25828
|
|
|
25665
|
-
readonly headers:
|
|
25829
|
+
readonly headers: Headers_2
|
|
25666
25830
|
readonly ok: boolean
|
|
25667
25831
|
readonly status: number
|
|
25668
25832
|
readonly statusText: string
|
|
@@ -25670,7 +25834,7 @@ declare class Response implements BodyMixin {
|
|
|
25670
25834
|
readonly url: string
|
|
25671
25835
|
readonly redirected: boolean
|
|
25672
25836
|
|
|
25673
|
-
readonly body:
|
|
25837
|
+
readonly body: ReadableStream_2 | null
|
|
25674
25838
|
readonly bodyUsed: boolean
|
|
25675
25839
|
|
|
25676
25840
|
readonly arrayBuffer: () => Promise<ArrayBuffer>
|
|
@@ -25679,14 +25843,14 @@ declare class Response implements BodyMixin {
|
|
|
25679
25843
|
readonly json: () => Promise<unknown>
|
|
25680
25844
|
readonly text: () => Promise<string>
|
|
25681
25845
|
|
|
25682
|
-
readonly clone: () =>
|
|
25846
|
+
readonly clone: () => Response_2
|
|
25683
25847
|
|
|
25684
|
-
static error ():
|
|
25685
|
-
static json(data: any, init?:
|
|
25686
|
-
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
|
|
25687
25851
|
}
|
|
25688
25852
|
|
|
25689
|
-
declare interface
|
|
25853
|
+
declare interface ResponseInit_2 {
|
|
25690
25854
|
readonly status?: number
|
|
25691
25855
|
readonly statusText?: string
|
|
25692
25856
|
readonly headers?: HeadersInit
|
|
@@ -25817,13 +25981,22 @@ declare namespace RetryHandler {
|
|
|
25817
25981
|
|
|
25818
25982
|
declare type Route = SimpleRoute | ZoneIdRoute | ZoneNameRoute | CustomDomainRoute;
|
|
25819
25983
|
|
|
25820
|
-
declare type
|
|
25984
|
+
declare type RouterConfig = z.infer<typeof RouterConfigSchema>;
|
|
25821
25985
|
|
|
25822
|
-
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>;
|
|
25823
25990
|
has_user_worker: z.ZodOptional<z.ZodBoolean>;
|
|
25824
25991
|
}, "strip", z.ZodTypeAny, {
|
|
25992
|
+
account_id?: number;
|
|
25993
|
+
script_id?: number;
|
|
25994
|
+
invoke_user_worker_ahead_of_assets?: boolean;
|
|
25825
25995
|
has_user_worker?: boolean;
|
|
25826
25996
|
}, {
|
|
25997
|
+
account_id?: number;
|
|
25998
|
+
script_id?: number;
|
|
25999
|
+
invoke_user_worker_ahead_of_assets?: boolean;
|
|
25827
26000
|
has_user_worker?: boolean;
|
|
25828
26001
|
}>;
|
|
25829
26002
|
|
|
@@ -25863,9 +26036,9 @@ declare type SerializedError = {
|
|
|
25863
26036
|
cause?: unknown;
|
|
25864
26037
|
};
|
|
25865
26038
|
|
|
25866
|
-
declare type ServiceFetch = (request:
|
|
26039
|
+
declare type ServiceFetch = (request: Request_3) => Promise<Response_3> | Response_3;
|
|
25867
26040
|
|
|
25868
|
-
declare function setCookie (headers:
|
|
26041
|
+
declare function setCookie (headers: Headers_2, cookie: Cookie): void
|
|
25869
26042
|
|
|
25870
26043
|
declare function setGlobalDispatcher<DispatcherImplementation extends Dispatcher>(dispatcher: DispatcherImplementation): void;
|
|
25871
26044
|
|
|
@@ -25903,7 +26076,7 @@ declare interface StartDevWorkerInput {
|
|
|
25903
26076
|
name?: string;
|
|
25904
26077
|
/**
|
|
25905
26078
|
* The javascript or typescript entry-point of the worker.
|
|
25906
|
-
* This is the `main` property of a
|
|
26079
|
+
* This is the `main` property of a Wrangler configuration file.
|
|
25907
26080
|
* You can specify a file path or provide the contents directly.
|
|
25908
26081
|
*/
|
|
25909
26082
|
entrypoint?: string;
|
|
@@ -25953,7 +26126,7 @@ declare interface StartDevWorkerInput {
|
|
|
25953
26126
|
jsxFactory?: string;
|
|
25954
26127
|
jsxFragment?: string;
|
|
25955
26128
|
tsconfig?: string;
|
|
25956
|
-
nodejsCompatMode?: Hook<NodeJSCompatMode, [
|
|
26129
|
+
nodejsCompatMode?: Hook<NodeJSCompatMode, [Unstable_Config]>;
|
|
25957
26130
|
moduleRoot?: string;
|
|
25958
26131
|
};
|
|
25959
26132
|
/** Options applying to the worker's development preview environment. */
|
|
@@ -25967,7 +26140,7 @@ declare interface StartDevWorkerInput {
|
|
|
25967
26140
|
/** Whether the worker runs on the edge or locally. */
|
|
25968
26141
|
remote?: boolean;
|
|
25969
26142
|
/** Cloudflare Account credentials. Can be provided upfront or as a function which will be called only when required. */
|
|
25970
|
-
auth?: AsyncHook<CfAccount>;
|
|
26143
|
+
auth?: AsyncHook<CfAccount, [Pick<Unstable_Config, "account_id">]>;
|
|
25971
26144
|
/** Whether local storage (KV, Durable Objects, R2, D1, etc) is persisted. You can also specify the directory to persist data to. */
|
|
25972
26145
|
persist?: string;
|
|
25973
26146
|
/** Controls which logs are logged 🤙. */
|
|
@@ -25994,12 +26167,17 @@ declare interface StartDevWorkerInput {
|
|
|
25994
26167
|
/** An undici MockAgent to declaratively mock fetch calls to particular resources. */
|
|
25995
26168
|
mockFetch?: undici.MockAgent;
|
|
25996
26169
|
/** Describes the registry of other Workers running locally */
|
|
25997
|
-
registry?: WorkerRegistry;
|
|
26170
|
+
registry?: WorkerRegistry | null;
|
|
25998
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;
|
|
25999
26178
|
};
|
|
26000
26179
|
legacy?: {
|
|
26001
|
-
site?: Hook<
|
|
26002
|
-
legacyAssets?: Hook<Config["legacy_assets"], [Config]>;
|
|
26180
|
+
site?: Hook<Unstable_Config["site"], [Unstable_Config]>;
|
|
26003
26181
|
enableServiceEnvironments?: boolean;
|
|
26004
26182
|
};
|
|
26005
26183
|
unsafe?: Omit<CfUnsafe, "bindings">;
|
|
@@ -26007,8 +26185,8 @@ declare interface StartDevWorkerInput {
|
|
|
26007
26185
|
}
|
|
26008
26186
|
|
|
26009
26187
|
declare type StartDevWorkerOptions = Omit<StartDevWorkerInput, "assets"> & {
|
|
26010
|
-
/** A worker's directory. Usually where the
|
|
26011
|
-
|
|
26188
|
+
/** A worker's directory. Usually where the Wrangler configuration file is located */
|
|
26189
|
+
projectRoot: string;
|
|
26012
26190
|
build: StartDevWorkerInput["build"] & {
|
|
26013
26191
|
nodejsCompatMode: NodeJSCompatMode;
|
|
26014
26192
|
format: CfScriptFormat;
|
|
@@ -26016,24 +26194,21 @@ declare type StartDevWorkerOptions = Omit<StartDevWorkerInput, "assets"> & {
|
|
|
26016
26194
|
moduleRules: Rule[];
|
|
26017
26195
|
define: Record<string, string>;
|
|
26018
26196
|
additionalModules: CfModule[];
|
|
26197
|
+
exports: string[];
|
|
26019
26198
|
processEntrypoint: boolean;
|
|
26020
26199
|
};
|
|
26021
26200
|
legacy: StartDevWorkerInput["legacy"] & {
|
|
26022
|
-
|
|
26023
|
-
site?: Config["site"];
|
|
26201
|
+
site?: Unstable_Config["site"];
|
|
26024
26202
|
};
|
|
26025
26203
|
dev: StartDevWorkerInput["dev"] & {
|
|
26026
26204
|
persist: string;
|
|
26205
|
+
auth?: AsyncHook<CfAccount>;
|
|
26027
26206
|
};
|
|
26028
26207
|
entrypoint: string;
|
|
26029
26208
|
assets?: AssetsOptions;
|
|
26209
|
+
name: string;
|
|
26030
26210
|
};
|
|
26031
26211
|
|
|
26032
|
-
declare function startWorkerRegistryServer(port: number): Promise<{
|
|
26033
|
-
server: Server<IncomingMessage, ServerResponse>;
|
|
26034
|
-
terminator: HttpTerminator;
|
|
26035
|
-
}>;
|
|
26036
|
-
|
|
26037
26212
|
/** A faster version of `request`. */
|
|
26038
26213
|
declare function stream(
|
|
26039
26214
|
url: string | URL_2 | UrlObject,
|
|
@@ -26110,10 +26285,10 @@ declare namespace Undici {
|
|
|
26110
26285
|
var MockPool: MockPool;
|
|
26111
26286
|
var MockAgent: MockAgent;
|
|
26112
26287
|
var mockErrors: MockErrors;
|
|
26113
|
-
var fetch:
|
|
26114
|
-
var Headers:
|
|
26115
|
-
var Response:
|
|
26116
|
-
var Request:
|
|
26288
|
+
var fetch: fetch_2;
|
|
26289
|
+
var Headers: Headers_2;
|
|
26290
|
+
var Response: Response_2;
|
|
26291
|
+
var Request: Request_2;
|
|
26117
26292
|
var FormData: FormData_2;
|
|
26118
26293
|
var File: File;
|
|
26119
26294
|
var FileReader: FileReader;
|
|
@@ -26153,7 +26328,7 @@ declare namespace undici {
|
|
|
26153
26328
|
getSetCookies,
|
|
26154
26329
|
setCookie,
|
|
26155
26330
|
Cookie,
|
|
26156
|
-
fetch,
|
|
26331
|
+
fetch_2 as fetch,
|
|
26157
26332
|
RequestInfo,
|
|
26158
26333
|
BodyInit,
|
|
26159
26334
|
BodyMixin,
|
|
@@ -26161,20 +26336,20 @@ declare namespace undici {
|
|
|
26161
26336
|
SpecIterableIterator,
|
|
26162
26337
|
SpecIterable,
|
|
26163
26338
|
HeadersInit,
|
|
26164
|
-
Headers,
|
|
26339
|
+
Headers_2 as Headers,
|
|
26165
26340
|
RequestCache,
|
|
26166
26341
|
RequestCredentials,
|
|
26167
26342
|
RequestDestination,
|
|
26168
|
-
RequestInit,
|
|
26343
|
+
RequestInit_2 as RequestInit,
|
|
26169
26344
|
ReferrerPolicy,
|
|
26170
26345
|
RequestMode,
|
|
26171
26346
|
RequestRedirect,
|
|
26172
26347
|
RequestDuplex,
|
|
26173
|
-
Request,
|
|
26174
|
-
ResponseInit,
|
|
26348
|
+
Request_2 as Request,
|
|
26349
|
+
ResponseInit_2 as ResponseInit,
|
|
26175
26350
|
ResponseType,
|
|
26176
26351
|
ResponseRedirectStatus,
|
|
26177
|
-
Response,
|
|
26352
|
+
Response_2 as Response,
|
|
26178
26353
|
BlobPropertyBag,
|
|
26179
26354
|
FilePropertyBag,
|
|
26180
26355
|
File,
|
|
@@ -26190,7 +26365,7 @@ declare namespace undici {
|
|
|
26190
26365
|
CloseEventInit,
|
|
26191
26366
|
CloseEvent,
|
|
26192
26367
|
MessageEventInit,
|
|
26193
|
-
MessageEvent,
|
|
26368
|
+
MessageEvent_2 as MessageEvent,
|
|
26194
26369
|
WebSocketInit,
|
|
26195
26370
|
parseMIMEType,
|
|
26196
26371
|
serializeAMimeType,
|
|
@@ -26203,10 +26378,39 @@ declare namespace undici {
|
|
|
26203
26378
|
}
|
|
26204
26379
|
}
|
|
26205
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
|
+
|
|
26206
26410
|
/**
|
|
26207
26411
|
* unstable_dev starts a wrangler dev server, and returns a promise that resolves with utility functions to interact with it.
|
|
26208
26412
|
*/
|
|
26209
|
-
export declare function unstable_dev(script: string, options?:
|
|
26413
|
+
export declare function unstable_dev(script: string, options?: Unstable_DevOptions, apiOptions?: unknown): Promise<Unstable_DevWorker>;
|
|
26210
26414
|
|
|
26211
26415
|
export declare class unstable_DevEnv extends EventEmitter_2 {
|
|
26212
26416
|
config: ConfigController;
|
|
@@ -26224,34 +26428,7 @@ export declare class unstable_DevEnv extends EventEmitter_2 {
|
|
|
26224
26428
|
emitErrorEvent(ev: ErrorEvent): void;
|
|
26225
26429
|
}
|
|
26226
26430
|
|
|
26227
|
-
export declare
|
|
26228
|
-
|
|
26229
|
-
export declare function unstable_getMiniflareWorkerOptions(configPath: string, env?: string): {
|
|
26230
|
-
workerOptions: SourcelessWorkerOptions;
|
|
26231
|
-
define: Record<string, string>;
|
|
26232
|
-
main?: string;
|
|
26233
|
-
};
|
|
26234
|
-
|
|
26235
|
-
export declare const unstable_pages: {
|
|
26236
|
-
deploy: typeof deploy;
|
|
26237
|
-
};
|
|
26238
|
-
|
|
26239
|
-
/**
|
|
26240
|
-
* Split an SQLQuery into an array of statements
|
|
26241
|
-
*/
|
|
26242
|
-
export declare function unstable_splitSqlQuery(sql: string): string[];
|
|
26243
|
-
|
|
26244
|
-
export declare function unstable_startWorker(options: StartDevWorkerInput): Promise<Worker>;
|
|
26245
|
-
|
|
26246
|
-
export declare const unstable_startWorkerRegistryServer: startWorkerRegistryServer;
|
|
26247
|
-
|
|
26248
|
-
export declare interface UnstableASSETSBindingsOptions {
|
|
26249
|
-
log: Logger;
|
|
26250
|
-
proxyPort?: number;
|
|
26251
|
-
directory?: string;
|
|
26252
|
-
}
|
|
26253
|
-
|
|
26254
|
-
export declare interface UnstableDevOptions {
|
|
26431
|
+
export declare interface Unstable_DevOptions {
|
|
26255
26432
|
config?: string;
|
|
26256
26433
|
env?: string;
|
|
26257
26434
|
ip?: string;
|
|
@@ -26262,11 +26439,9 @@ export declare interface UnstableDevOptions {
|
|
|
26262
26439
|
httpsKeyPath?: string;
|
|
26263
26440
|
httpsCertPath?: string;
|
|
26264
26441
|
assets?: string;
|
|
26265
|
-
legacyAssets?: string;
|
|
26266
26442
|
site?: string;
|
|
26267
26443
|
siteInclude?: string[];
|
|
26268
26444
|
siteExclude?: string[];
|
|
26269
|
-
nodeCompat?: boolean;
|
|
26270
26445
|
compatibilityDate?: string;
|
|
26271
26446
|
compatibilityFlags?: string[];
|
|
26272
26447
|
persist?: boolean;
|
|
@@ -26274,7 +26449,7 @@ export declare interface UnstableDevOptions {
|
|
|
26274
26449
|
vars?: Record<string, string | Json>;
|
|
26275
26450
|
kv?: {
|
|
26276
26451
|
binding: string;
|
|
26277
|
-
id
|
|
26452
|
+
id?: string;
|
|
26278
26453
|
preview_id?: string;
|
|
26279
26454
|
}[];
|
|
26280
26455
|
durableObjects?: {
|
|
@@ -26291,7 +26466,7 @@ export declare interface UnstableDevOptions {
|
|
|
26291
26466
|
}[];
|
|
26292
26467
|
r2?: {
|
|
26293
26468
|
binding: string;
|
|
26294
|
-
bucket_name
|
|
26469
|
+
bucket_name?: string;
|
|
26295
26470
|
preview_bucket_name?: string;
|
|
26296
26471
|
}[];
|
|
26297
26472
|
ai?: {
|
|
@@ -26321,18 +26496,61 @@ export declare interface UnstableDevOptions {
|
|
|
26321
26496
|
watch?: boolean;
|
|
26322
26497
|
devEnv?: boolean;
|
|
26323
26498
|
fileBasedRegistry?: boolean;
|
|
26499
|
+
vectorizeBindToProd?: boolean;
|
|
26500
|
+
imagesLocalMode?: boolean;
|
|
26501
|
+
enableIpc?: boolean;
|
|
26324
26502
|
};
|
|
26325
26503
|
}
|
|
26326
26504
|
|
|
26327
|
-
export declare interface
|
|
26505
|
+
export declare interface Unstable_DevWorker {
|
|
26328
26506
|
port: number;
|
|
26329
26507
|
address: string;
|
|
26330
|
-
proxyData: ProxyData;
|
|
26331
26508
|
stop: () => Promise<void>;
|
|
26332
|
-
fetch: (input?: RequestInfo, init?:
|
|
26509
|
+
fetch: (input?: RequestInfo, init?: RequestInit_2) => Promise<Response_2>;
|
|
26333
26510
|
waitUntilExit: () => Promise<void>;
|
|
26334
26511
|
}
|
|
26335
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
|
+
|
|
26336
26554
|
/** Upgrade to a different protocol. */
|
|
26337
26555
|
declare function upgrade(
|
|
26338
26556
|
url: string | URL_2 | UrlObject,
|
|
@@ -26405,7 +26623,7 @@ declare const WebSocket: {
|
|
|
26405
26623
|
declare interface WebSocketEventMap {
|
|
26406
26624
|
close: CloseEvent
|
|
26407
26625
|
error: Event_2
|
|
26408
|
-
message:
|
|
26626
|
+
message: MessageEvent_2
|
|
26409
26627
|
open: Event_2
|
|
26410
26628
|
}
|
|
26411
26629
|
|
|
@@ -26426,6 +26644,7 @@ declare interface Worker {
|
|
|
26426
26644
|
scheduled: MiniflareWorker["scheduled"];
|
|
26427
26645
|
queue: MiniflareWorker["queue"];
|
|
26428
26646
|
dispose(): Promise<void>;
|
|
26647
|
+
raw: unstable_DevEnv;
|
|
26429
26648
|
}
|
|
26430
26649
|
|
|
26431
26650
|
declare type WorkerDefinition = {
|
|
@@ -26450,6 +26669,17 @@ declare type WorkerEntrypointsDefinition = Record<"default" | string, {
|
|
|
26450
26669
|
|
|
26451
26670
|
declare type WorkerRegistry = Record<string, WorkerDefinition>;
|
|
26452
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
|
+
|
|
26453
26683
|
declare type ZoneIdRoute = {
|
|
26454
26684
|
pattern: string;
|
|
26455
26685
|
zone_id: string;
|