wrangler 0.0.0-eec0a6459 → 0.0.0-eec2a7074
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 +4 -0
- package/config-schema.json +213 -210
- package/package.json +14 -14
- package/templates/middleware/middleware-mock-analytics-engine.d.ts +3 -0
- package/templates/middleware/middleware-mock-analytics-engine.ts +30 -0
- package/templates/middleware/middleware-scheduled.ts +15 -1
- package/templates/middleware/middleware-serve-static-assets.ts +2 -2
- package/wrangler-dist/cli.d.ts +146 -65
- package/wrangler-dist/cli.js +115876 -110944
- package/templates/no-op-assets-worker.ts +0 -33
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference path="middleware-mock-analytics-engine.d.ts"/>
|
|
2
|
+
|
|
3
|
+
import { bindings } from "config:middleware/mock-analytics-engine";
|
|
4
|
+
import type { Middleware } from "./common";
|
|
5
|
+
|
|
6
|
+
const bindingsEnv = Object.fromEntries(
|
|
7
|
+
bindings.map((binding) => [
|
|
8
|
+
binding,
|
|
9
|
+
{
|
|
10
|
+
writeDataPoint() {
|
|
11
|
+
// no op in dev
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
])
|
|
15
|
+
) satisfies Record<string, AnalyticsEngineDataset>;
|
|
16
|
+
|
|
17
|
+
const analyticsEngine: Middleware = async (
|
|
18
|
+
request,
|
|
19
|
+
env,
|
|
20
|
+
_ctx,
|
|
21
|
+
middlewareCtx
|
|
22
|
+
) => {
|
|
23
|
+
// we're going to directly modify env so it maintains referential equality
|
|
24
|
+
for (const binding of bindings) {
|
|
25
|
+
env[binding] ??= bindingsEnv[binding];
|
|
26
|
+
}
|
|
27
|
+
return await middlewareCtx.next(request, env);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default analyticsEngine;
|
|
@@ -9,7 +9,21 @@ const scheduled: Middleware = async (request, env, _ctx, middlewareCtx) => {
|
|
|
9
9
|
|
|
10
10
|
return new Response("Ran scheduled event");
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
|
|
13
|
+
const resp = await middlewareCtx.next(request, env);
|
|
14
|
+
|
|
15
|
+
// If you open the `/__scheduled` page in a browser, the browser will automatically make a request to `/favicon.ico`.
|
|
16
|
+
// For scheduled Workers _without_ a fetch handler, this will result in a 500 response that clutters the log with unhelpful error messages.
|
|
17
|
+
// To avoid this, inject a 404 response to favicon.ico loads on the `/__scheduled` page
|
|
18
|
+
if (
|
|
19
|
+
request.headers.get("referer")?.endsWith("/__scheduled") &&
|
|
20
|
+
url.pathname === "/favicon.ico" &&
|
|
21
|
+
resp.status === 500
|
|
22
|
+
) {
|
|
23
|
+
return new Response(null, { status: 404 });
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return resp;
|
|
13
27
|
};
|
|
14
28
|
|
|
15
29
|
export default scheduled;
|
|
@@ -14,7 +14,7 @@ import type * as kvAssetHandler from "@cloudflare/kv-asset-handler";
|
|
|
14
14
|
|
|
15
15
|
const ASSET_MANIFEST = JSON.parse(manifest);
|
|
16
16
|
|
|
17
|
-
const staticAssets: Middleware = async (request, env,
|
|
17
|
+
const staticAssets: Middleware = async (request, env, ctx, middlewareCtx) => {
|
|
18
18
|
let options: Partial<Options> = {
|
|
19
19
|
ASSET_MANIFEST,
|
|
20
20
|
ASSET_NAMESPACE: env.__STATIC_CONTENT,
|
|
@@ -27,7 +27,7 @@ const staticAssets: Middleware = async (request, env, _ctx, middlewareCtx) => {
|
|
|
27
27
|
{
|
|
28
28
|
request,
|
|
29
29
|
waitUntil(promise) {
|
|
30
|
-
return
|
|
30
|
+
return ctx.waitUntil(promise);
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
33
|
options
|
package/wrangler-dist/cli.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { Miniflare } from 'miniflare';
|
|
|
16
16
|
import type { MiniflareOptions } from 'miniflare';
|
|
17
17
|
import type { ModuleRule } from 'miniflare';
|
|
18
18
|
import { Mutex } from 'miniflare';
|
|
19
|
+
import type { NodeJSCompatMode } from 'miniflare';
|
|
19
20
|
import { Readable } from 'stream';
|
|
20
21
|
import { ReadableStream } from 'stream/web';
|
|
21
22
|
import type { Request as Request_2 } from 'miniflare';
|
|
@@ -30,6 +31,7 @@ import { UrlObject } from 'url';
|
|
|
30
31
|
import { URLSearchParams as URLSearchParams_2 } from 'url';
|
|
31
32
|
import type { WorkerOptions } from 'miniflare';
|
|
32
33
|
import { Writable } from 'stream';
|
|
34
|
+
import { z } from 'zod';
|
|
33
35
|
|
|
34
36
|
declare type AbortSignal_2 = unknown;
|
|
35
37
|
|
|
@@ -72,6 +74,32 @@ declare type ApiCredentials = {
|
|
|
72
74
|
authEmail: string;
|
|
73
75
|
};
|
|
74
76
|
|
|
77
|
+
declare type AssetConfig = z.infer<typeof AssetConfigSchema>;
|
|
78
|
+
|
|
79
|
+
declare const AssetConfigSchema: z.ZodObject<{
|
|
80
|
+
html_handling: z.ZodOptional<z.ZodEnum<["auto-trailing-slash", "force-trailing-slash", "drop-trailing-slash", "none"]>>;
|
|
81
|
+
not_found_handling: z.ZodOptional<z.ZodEnum<["single-page-application", "404-page", "none"]>>;
|
|
82
|
+
}, "strip", z.ZodTypeAny, {
|
|
83
|
+
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
84
|
+
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
85
|
+
}, {
|
|
86
|
+
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
|
87
|
+
not_found_handling?: "none" | "single-page-application" | "404-page";
|
|
88
|
+
}>;
|
|
89
|
+
|
|
90
|
+
declare type Assets = {
|
|
91
|
+
/** Absolute path to assets directory */
|
|
92
|
+
directory: string;
|
|
93
|
+
binding?: string;
|
|
94
|
+
html_handling?: "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash" | "none";
|
|
95
|
+
not_found_handling?: "single-page-application" | "404-page" | "none";
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
declare type AssetsOptions = Pick<Assets, "directory" | "binding"> & {
|
|
99
|
+
routingConfig: RoutingConfig;
|
|
100
|
+
assetConfig: AssetConfig;
|
|
101
|
+
};
|
|
102
|
+
|
|
75
103
|
declare type AsyncHook<T extends HookValues, Args extends unknown[] = []> = Hook<T, Args> | Hook<Promise<T>, Args>;
|
|
76
104
|
|
|
77
105
|
declare class BalancedPool extends Dispatcher {
|
|
@@ -109,7 +137,7 @@ declare type Binding = {
|
|
|
109
137
|
type: "kv_namespace";
|
|
110
138
|
} & BindingOmit<CfKvNamespace>) | ({
|
|
111
139
|
type: "send_email";
|
|
112
|
-
} &
|
|
140
|
+
} & NameOmit<CfSendEmailBindings>) | {
|
|
113
141
|
type: "wasm_module";
|
|
114
142
|
source: BinaryFile;
|
|
115
143
|
} | {
|
|
@@ -126,7 +154,7 @@ declare type Binding = {
|
|
|
126
154
|
source: BinaryFile;
|
|
127
155
|
} | ({
|
|
128
156
|
type: "durable_object_namespace";
|
|
129
|
-
} &
|
|
157
|
+
} & NameOmit<CfDurableObject>) | ({
|
|
130
158
|
type: "workflow";
|
|
131
159
|
} & BindingOmit<CfWorkflow>) | ({
|
|
132
160
|
type: "queue";
|
|
@@ -150,14 +178,16 @@ declare type Binding = {
|
|
|
150
178
|
} & Omit<CfDispatchNamespace, "binding">) | ({
|
|
151
179
|
type: "mtls_certificate";
|
|
152
180
|
} & Omit<CfMTlsCertificate, "binding">) | ({
|
|
181
|
+
type: "pipeline";
|
|
182
|
+
} & Omit<CfPipeline, "binding">) | ({
|
|
153
183
|
type: "logfwdr";
|
|
154
|
-
} &
|
|
184
|
+
} & NameOmit<CfLogfwdrBinding>) | {
|
|
155
185
|
type: `unsafe_${string}`;
|
|
156
186
|
} | {
|
|
157
187
|
type: "assets";
|
|
158
188
|
};
|
|
159
189
|
|
|
160
|
-
declare type BindingOmit<T> = Omit<T, "binding"
|
|
190
|
+
declare type BindingOmit<T> = Omit<T, "binding">;
|
|
161
191
|
|
|
162
192
|
/**
|
|
163
193
|
* Result of the `getBindingsProxy` utility
|
|
@@ -178,7 +208,7 @@ declare type BodyInit =
|
|
|
178
208
|
| ArrayBuffer
|
|
179
209
|
| AsyncIterable<Uint8Array>
|
|
180
210
|
| Blob_2
|
|
181
|
-
|
|
|
211
|
+
| FormData_2
|
|
182
212
|
| Iterable<Uint8Array>
|
|
183
213
|
| NodeJS.ArrayBufferView
|
|
184
214
|
| URLSearchParams_2
|
|
@@ -191,7 +221,7 @@ declare interface BodyMixin {
|
|
|
191
221
|
|
|
192
222
|
readonly arrayBuffer: () => Promise<ArrayBuffer>
|
|
193
223
|
readonly blob: () => Promise<Blob_2>
|
|
194
|
-
readonly formData: () => Promise<
|
|
224
|
+
readonly formData: () => Promise<FormData_2>
|
|
195
225
|
readonly json: () => Promise<unknown>
|
|
196
226
|
readonly text: () => Promise<string>
|
|
197
227
|
}
|
|
@@ -521,6 +551,11 @@ declare interface CfMTlsCertificate {
|
|
|
521
551
|
certificate_id: string;
|
|
522
552
|
}
|
|
523
553
|
|
|
554
|
+
declare interface CfPipeline {
|
|
555
|
+
binding: string;
|
|
556
|
+
pipeline: string;
|
|
557
|
+
}
|
|
558
|
+
|
|
524
559
|
declare interface CfQueue {
|
|
525
560
|
binding: string;
|
|
526
561
|
queue_name: string;
|
|
@@ -603,7 +638,6 @@ declare interface CfWorkflow {
|
|
|
603
638
|
class_name: string;
|
|
604
639
|
binding: string;
|
|
605
640
|
script_name?: string;
|
|
606
|
-
environment?: string;
|
|
607
641
|
}
|
|
608
642
|
|
|
609
643
|
/**
|
|
@@ -752,7 +786,7 @@ declare class ConfigController extends Controller<ConfigControllerEventMap> {
|
|
|
752
786
|
#private;
|
|
753
787
|
latestInput?: StartDevWorkerInput;
|
|
754
788
|
latestConfig?: StartDevWorkerOptions;
|
|
755
|
-
set(input: StartDevWorkerInput): Promise<StartDevWorkerOptions | undefined>;
|
|
789
|
+
set(input: StartDevWorkerInput, throwErrors?: boolean): Promise<StartDevWorkerOptions | undefined>;
|
|
756
790
|
patch(input: Partial<StartDevWorkerInput>): Promise<StartDevWorkerOptions | undefined>;
|
|
757
791
|
teardown(): Promise<void>;
|
|
758
792
|
emitConfigUpdateEvent(config: StartDevWorkerOptions): void;
|
|
@@ -825,9 +859,11 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
|
|
|
825
859
|
exclude?: string[];
|
|
826
860
|
} | undefined;
|
|
827
861
|
/**
|
|
828
|
-
*
|
|
829
|
-
*
|
|
830
|
-
*
|
|
862
|
+
* Old behaviour of serving a folder of static assets with your Worker,
|
|
863
|
+
* without any additional code.
|
|
864
|
+
* This can either be a string, or an object with additional config
|
|
865
|
+
* fields.
|
|
866
|
+
* Will be deprecated in the near future in favor of `assets`.
|
|
831
867
|
*/
|
|
832
868
|
legacy_assets: {
|
|
833
869
|
bucket: string;
|
|
@@ -970,14 +1006,14 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
|
|
|
970
1006
|
type: string;
|
|
971
1007
|
};
|
|
972
1008
|
latest_stage: {
|
|
973
|
-
name: "
|
|
974
|
-
status: "active" | "idle" | "
|
|
1009
|
+
name: "queued" | "build" | "deploy" | "initialize" | "clone_repo";
|
|
1010
|
+
status: "active" | "idle" | "success" | "canceled" | "failure" | "skipped";
|
|
975
1011
|
started_on: string | null;
|
|
976
1012
|
ended_on: string | null;
|
|
977
1013
|
};
|
|
978
1014
|
stages: {
|
|
979
|
-
name: "
|
|
980
|
-
status: "active" | "idle" | "
|
|
1015
|
+
name: "queued" | "build" | "deploy" | "initialize" | "clone_repo";
|
|
1016
|
+
status: "active" | "idle" | "success" | "canceled" | "failure" | "skipped";
|
|
981
1017
|
started_on: string | null;
|
|
982
1018
|
ended_on: string | null;
|
|
983
1019
|
}[];
|
|
@@ -1234,7 +1270,7 @@ declare namespace Dispatcher {
|
|
|
1234
1270
|
path: string;
|
|
1235
1271
|
method: HttpMethod;
|
|
1236
1272
|
/** Default: `null` */
|
|
1237
|
-
body?: string | Buffer | Uint8Array | Readable | null |
|
|
1273
|
+
body?: string | Buffer | Uint8Array | Readable | null | FormData_2;
|
|
1238
1274
|
/** Default: `null` */
|
|
1239
1275
|
headers?: IncomingHttpHeaders | string[] | null;
|
|
1240
1276
|
/** Query string params to be embedded in the request URL. Default: `null` */
|
|
@@ -1400,6 +1436,25 @@ declare type DurableObjectBindings = {
|
|
|
1400
1436
|
environment?: string;
|
|
1401
1437
|
}[];
|
|
1402
1438
|
|
|
1439
|
+
/**
|
|
1440
|
+
* Configuration in wrangler for Durable Object Migrations
|
|
1441
|
+
*/
|
|
1442
|
+
declare type DurableObjectMigration = {
|
|
1443
|
+
/** A unique identifier for this migration. */
|
|
1444
|
+
tag: string;
|
|
1445
|
+
/** The new Durable Objects being defined. */
|
|
1446
|
+
new_classes?: string[];
|
|
1447
|
+
/** The new SQLite Durable Objects being defined. */
|
|
1448
|
+
new_sqlite_classes?: string[];
|
|
1449
|
+
/** The Durable Objects being renamed. */
|
|
1450
|
+
renamed_classes?: {
|
|
1451
|
+
from: string;
|
|
1452
|
+
to: string;
|
|
1453
|
+
}[];
|
|
1454
|
+
/** The Durable Objects being removed. */
|
|
1455
|
+
deleted_classes?: string[];
|
|
1456
|
+
};
|
|
1457
|
+
|
|
1403
1458
|
declare interface EnablePagesAssetsServiceBindingOptions {
|
|
1404
1459
|
proxyPort?: number;
|
|
1405
1460
|
directory?: string;
|
|
@@ -1419,12 +1474,12 @@ declare type Entry = {
|
|
|
1419
1474
|
format: CfScriptFormat;
|
|
1420
1475
|
/** The directory that contains all of a `--no-bundle` worker's modules. Usually `${directory}/src`. Defaults to path.dirname(file) */
|
|
1421
1476
|
moduleRoot: string;
|
|
1422
|
-
/** Whether this is a no-op worker that will not ultimately be uploaded e.g. for assets*/
|
|
1423
|
-
staticAssetsOnly?: boolean;
|
|
1424
1477
|
/**
|
|
1425
1478
|
* A worker's name
|
|
1426
1479
|
*/
|
|
1427
1480
|
name?: string | undefined;
|
|
1481
|
+
/** Export from a Worker's entrypoint */
|
|
1482
|
+
exports: string[];
|
|
1428
1483
|
};
|
|
1429
1484
|
|
|
1430
1485
|
/**
|
|
@@ -1511,6 +1566,7 @@ declare interface EnvironmentInheritable {
|
|
|
1511
1566
|
* test and deploy your Worker.
|
|
1512
1567
|
*
|
|
1513
1568
|
* // Carmen according to our tests the default is undefined
|
|
1569
|
+
* // warning: you must force "workers_dev: true" in tests to match expected behavior
|
|
1514
1570
|
* @default `true` (This is a breaking change from Wrangler v1)
|
|
1515
1571
|
* @breaking
|
|
1516
1572
|
* @inheritable
|
|
@@ -1565,19 +1621,7 @@ declare interface EnvironmentInheritable {
|
|
|
1565
1621
|
* @default []
|
|
1566
1622
|
* @inheritable
|
|
1567
1623
|
*/
|
|
1568
|
-
migrations:
|
|
1569
|
-
/** A unique identifier for this migration. */
|
|
1570
|
-
tag: string;
|
|
1571
|
-
/** The new Durable Objects being defined. */
|
|
1572
|
-
new_classes?: string[];
|
|
1573
|
-
/** The Durable Objects being renamed. */
|
|
1574
|
-
renamed_classes?: {
|
|
1575
|
-
from: string;
|
|
1576
|
-
to: string;
|
|
1577
|
-
}[];
|
|
1578
|
-
/** The Durable Objects being removed. */
|
|
1579
|
-
deleted_classes?: string[];
|
|
1580
|
-
}[];
|
|
1624
|
+
migrations: DurableObjectMigration[];
|
|
1581
1625
|
/**
|
|
1582
1626
|
* "Cron" definitions to trigger a Worker's "scheduled" function.
|
|
1583
1627
|
*
|
|
@@ -1707,13 +1751,22 @@ declare interface EnvironmentInheritable {
|
|
|
1707
1751
|
*/
|
|
1708
1752
|
placement: {
|
|
1709
1753
|
mode: "off" | "smart";
|
|
1754
|
+
hint?: string;
|
|
1710
1755
|
} | undefined;
|
|
1711
1756
|
/**
|
|
1712
1757
|
* Specify the directory of static assets to deploy/serve
|
|
1713
1758
|
*
|
|
1759
|
+
* More details at https://developers.cloudflare.com/workers/frameworks/
|
|
1760
|
+
*
|
|
1714
1761
|
* @inheritable
|
|
1715
1762
|
*/
|
|
1716
|
-
|
|
1763
|
+
assets: Assets | undefined;
|
|
1764
|
+
/**
|
|
1765
|
+
* Specify the observability behavior of the Worker.
|
|
1766
|
+
*
|
|
1767
|
+
* @inheritable
|
|
1768
|
+
*/
|
|
1769
|
+
observability: Observability | undefined;
|
|
1717
1770
|
}
|
|
1718
1771
|
|
|
1719
1772
|
/**
|
|
@@ -2081,6 +2134,21 @@ declare interface EnvironmentNonInheritable {
|
|
|
2081
2134
|
/** Details about the outbound Worker which will handle outbound requests from your namespace */
|
|
2082
2135
|
outbound?: DispatchNamespaceOutbound;
|
|
2083
2136
|
}[];
|
|
2137
|
+
/**
|
|
2138
|
+
* Specifies list of Pipelines bound to this Worker environment
|
|
2139
|
+
*
|
|
2140
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
2141
|
+
* and so must be specified in every named environment.
|
|
2142
|
+
*
|
|
2143
|
+
* @default `[]`
|
|
2144
|
+
* @nonInheritable
|
|
2145
|
+
*/
|
|
2146
|
+
pipelines: {
|
|
2147
|
+
/** The binding name used to refer to the bound service. */
|
|
2148
|
+
binding: string;
|
|
2149
|
+
/** Name of the Pipeline to bind */
|
|
2150
|
+
pipeline: string;
|
|
2151
|
+
}[];
|
|
2084
2152
|
}
|
|
2085
2153
|
|
|
2086
2154
|
declare type ErrorEvent = BaseErrorEvent<"ConfigController" | "BundlerController" | "LocalRuntimeController" | "RemoteRuntimeController" | "ProxyWorker" | "InspectorProxyWorker"> | BaseErrorEvent<"ProxyController", {
|
|
@@ -2292,12 +2360,6 @@ declare class ExecutionContext {
|
|
|
2292
2360
|
passThroughOnException(): void;
|
|
2293
2361
|
}
|
|
2294
2362
|
|
|
2295
|
-
declare type ExperimentalAssets = {
|
|
2296
|
-
/** Absolute path to assets directory */
|
|
2297
|
-
directory: string;
|
|
2298
|
-
binding?: string;
|
|
2299
|
-
};
|
|
2300
|
-
|
|
2301
2363
|
declare function fetch (
|
|
2302
2364
|
input: RequestInfo,
|
|
2303
2365
|
init?: RequestInit
|
|
@@ -2377,7 +2439,7 @@ declare class FileReader {
|
|
|
2377
2439
|
/**
|
|
2378
2440
|
* 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().
|
|
2379
2441
|
*/
|
|
2380
|
-
declare class
|
|
2442
|
+
declare class FormData_2 {
|
|
2381
2443
|
/**
|
|
2382
2444
|
* Appends a new value onto an existing key inside a FormData object,
|
|
2383
2445
|
* or adds the key if it does not already exist.
|
|
@@ -2442,7 +2504,7 @@ declare class FormData {
|
|
|
2442
2504
|
* Executes given callback function for each field of the FormData instance
|
|
2443
2505
|
*/
|
|
2444
2506
|
forEach: (
|
|
2445
|
-
callbackfn: (value: FormDataEntryValue, key: string, iterable:
|
|
2507
|
+
callbackfn: (value: FormDataEntryValue, key: string, iterable: FormData_2) => void,
|
|
2446
2508
|
thisArg?: unknown
|
|
2447
2509
|
) => void
|
|
2448
2510
|
|
|
@@ -2617,7 +2679,9 @@ declare interface Interceptable extends Dispatcher {
|
|
|
2617
2679
|
declare class Logger {
|
|
2618
2680
|
#private;
|
|
2619
2681
|
constructor();
|
|
2620
|
-
|
|
2682
|
+
private overrideLoggerLevel?;
|
|
2683
|
+
get loggerLevel(): "error" | "none" | "warn" | "info" | "log" | "debug";
|
|
2684
|
+
set loggerLevel(val: "error" | "none" | "warn" | "info" | "log" | "debug");
|
|
2621
2685
|
columns: number;
|
|
2622
2686
|
debug: (...args: unknown[]) => void;
|
|
2623
2687
|
debugWithSanitization: (label: string, ...args: unknown[]) => void;
|
|
@@ -2627,6 +2691,8 @@ declare class Logger {
|
|
|
2627
2691
|
error: (...args: unknown[]) => void;
|
|
2628
2692
|
table<Keys extends string>(data: TableRow<Keys>[]): void;
|
|
2629
2693
|
console<M extends Exclude<keyof Console, "Console">>(method: M, ...args: Parameters<Console[M]>): void;
|
|
2694
|
+
static warnOnceHistory: Set<unknown>;
|
|
2695
|
+
warnOnce(message: string): void;
|
|
2630
2696
|
private doLog;
|
|
2631
2697
|
static registerBeforeLogHook(callback: (() => void) | undefined): void;
|
|
2632
2698
|
static registerAfterLogHook(callback: (() => void) | undefined): void;
|
|
@@ -2843,14 +2909,14 @@ declare interface MultiCacheQueryOptions extends CacheQueryOptions {
|
|
|
2843
2909
|
cacheName?: string
|
|
2844
2910
|
}
|
|
2845
2911
|
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2912
|
+
declare type NameOmit<T> = Omit<T, "name">;
|
|
2913
|
+
|
|
2914
|
+
declare interface Observability {
|
|
2915
|
+
/** If observability is enabled for this Worker */
|
|
2916
|
+
enabled: boolean;
|
|
2917
|
+
/** The sampling rate */
|
|
2918
|
+
head_sampling_rate?: number;
|
|
2919
|
+
}
|
|
2854
2920
|
|
|
2855
2921
|
declare interface PagesConfigFields {
|
|
2856
2922
|
/**
|
|
@@ -25550,7 +25616,7 @@ declare class Request implements BodyMixin {
|
|
|
25550
25616
|
|
|
25551
25617
|
readonly arrayBuffer: () => Promise<ArrayBuffer>
|
|
25552
25618
|
readonly blob: () => Promise<Blob_2>
|
|
25553
|
-
readonly formData: () => Promise<
|
|
25619
|
+
readonly formData: () => Promise<FormData_2>
|
|
25554
25620
|
readonly json: () => Promise<unknown>
|
|
25555
25621
|
readonly text: () => Promise<string>
|
|
25556
25622
|
|
|
@@ -25634,7 +25700,7 @@ declare class Response implements BodyMixin {
|
|
|
25634
25700
|
|
|
25635
25701
|
readonly arrayBuffer: () => Promise<ArrayBuffer>
|
|
25636
25702
|
readonly blob: () => Promise<Blob_2>
|
|
25637
|
-
readonly formData: () => Promise<
|
|
25703
|
+
readonly formData: () => Promise<FormData_2>
|
|
25638
25704
|
readonly json: () => Promise<unknown>
|
|
25639
25705
|
readonly text: () => Promise<string>
|
|
25640
25706
|
|
|
@@ -25776,6 +25842,16 @@ declare namespace RetryHandler {
|
|
|
25776
25842
|
|
|
25777
25843
|
declare type Route = SimpleRoute | ZoneIdRoute | ZoneNameRoute | CustomDomainRoute;
|
|
25778
25844
|
|
|
25845
|
+
declare type RoutingConfig = z.infer<typeof RoutingConfigSchema>;
|
|
25846
|
+
|
|
25847
|
+
declare const RoutingConfigSchema: z.ZodObject<{
|
|
25848
|
+
has_user_worker: z.ZodOptional<z.ZodBoolean>;
|
|
25849
|
+
}, "strip", z.ZodTypeAny, {
|
|
25850
|
+
has_user_worker?: boolean;
|
|
25851
|
+
}, {
|
|
25852
|
+
has_user_worker?: boolean;
|
|
25853
|
+
}>;
|
|
25854
|
+
|
|
25779
25855
|
/**
|
|
25780
25856
|
* A bundling resolver rule, defining the modules type for paths that match the specified globs.
|
|
25781
25857
|
*/
|
|
@@ -25865,6 +25941,7 @@ declare interface StartDevWorkerInput {
|
|
|
25865
25941
|
env?: string;
|
|
25866
25942
|
/** The bindings available to the worker. The specified bindind type will be exposed to the worker on the `env` object under the same key. */
|
|
25867
25943
|
bindings?: Record<string, Binding>;
|
|
25944
|
+
migrations?: DurableObjectMigration[];
|
|
25868
25945
|
/** The triggers which will cause the worker's exported default handlers to be called. */
|
|
25869
25946
|
triggers?: Trigger[];
|
|
25870
25947
|
/**
|
|
@@ -25915,7 +25992,7 @@ declare interface StartDevWorkerInput {
|
|
|
25915
25992
|
/** Whether the worker runs on the edge or locally. */
|
|
25916
25993
|
remote?: boolean;
|
|
25917
25994
|
/** Cloudflare Account credentials. Can be provided upfront or as a function which will be called only when required. */
|
|
25918
|
-
auth?: AsyncHook<CfAccount>;
|
|
25995
|
+
auth?: AsyncHook<CfAccount, [Pick<Config, "account_id">]>;
|
|
25919
25996
|
/** Whether local storage (KV, Durable Objects, R2, D1, etc) is persisted. You can also specify the directory to persist data to. */
|
|
25920
25997
|
persist?: string;
|
|
25921
25998
|
/** Controls which logs are logged 🤙. */
|
|
@@ -25944,6 +26021,8 @@ declare interface StartDevWorkerInput {
|
|
|
25944
26021
|
/** Describes the registry of other Workers running locally */
|
|
25945
26022
|
registry?: WorkerRegistry;
|
|
25946
26023
|
testScheduled?: boolean;
|
|
26024
|
+
/** Whether to use Vectorize mixed mode -- the worker is run locally but accesses to Vectorize are made remotely */
|
|
26025
|
+
bindVectorizeToProd?: boolean;
|
|
25947
26026
|
};
|
|
25948
26027
|
legacy?: {
|
|
25949
26028
|
site?: Hook<Config["site"], [Config]>;
|
|
@@ -25951,12 +26030,10 @@ declare interface StartDevWorkerInput {
|
|
|
25951
26030
|
enableServiceEnvironments?: boolean;
|
|
25952
26031
|
};
|
|
25953
26032
|
unsafe?: Omit<CfUnsafe, "bindings">;
|
|
25954
|
-
|
|
25955
|
-
assets?: Omit<ExperimentalAssets, "bindings">;
|
|
25956
|
-
};
|
|
26033
|
+
assets?: string;
|
|
25957
26034
|
}
|
|
25958
26035
|
|
|
25959
|
-
declare type StartDevWorkerOptions = StartDevWorkerInput & {
|
|
26036
|
+
declare type StartDevWorkerOptions = Omit<StartDevWorkerInput, "assets"> & {
|
|
25960
26037
|
/** A worker's directory. Usually where the wrangler.toml file is located */
|
|
25961
26038
|
directory: string;
|
|
25962
26039
|
build: StartDevWorkerInput["build"] & {
|
|
@@ -25966,6 +26043,7 @@ declare type StartDevWorkerOptions = StartDevWorkerInput & {
|
|
|
25966
26043
|
moduleRules: Rule[];
|
|
25967
26044
|
define: Record<string, string>;
|
|
25968
26045
|
additionalModules: CfModule[];
|
|
26046
|
+
exports: string[];
|
|
25969
26047
|
processEntrypoint: boolean;
|
|
25970
26048
|
};
|
|
25971
26049
|
legacy: StartDevWorkerInput["legacy"] & {
|
|
@@ -25974,10 +26052,17 @@ declare type StartDevWorkerOptions = StartDevWorkerInput & {
|
|
|
25974
26052
|
};
|
|
25975
26053
|
dev: StartDevWorkerInput["dev"] & {
|
|
25976
26054
|
persist: string;
|
|
26055
|
+
auth?: AsyncHook<CfAccount>;
|
|
25977
26056
|
};
|
|
25978
26057
|
entrypoint: string;
|
|
26058
|
+
assets?: AssetsOptions;
|
|
25979
26059
|
};
|
|
25980
26060
|
|
|
26061
|
+
declare function startWorkerRegistryServer(port: number): Promise<{
|
|
26062
|
+
server: Server<IncomingMessage, ServerResponse>;
|
|
26063
|
+
terminator: HttpTerminator;
|
|
26064
|
+
}>;
|
|
26065
|
+
|
|
25981
26066
|
/** A faster version of `request`. */
|
|
25982
26067
|
declare function stream(
|
|
25983
26068
|
url: string | URL_2 | UrlObject,
|
|
@@ -26058,7 +26143,7 @@ declare namespace Undici {
|
|
|
26058
26143
|
var Headers: Headers;
|
|
26059
26144
|
var Response: Response;
|
|
26060
26145
|
var Request: Request;
|
|
26061
|
-
var FormData:
|
|
26146
|
+
var FormData: FormData_2;
|
|
26062
26147
|
var File: File;
|
|
26063
26148
|
var FileReader: FileReader;
|
|
26064
26149
|
var caches: caches;
|
|
@@ -26126,7 +26211,7 @@ declare namespace undici {
|
|
|
26126
26211
|
ProgressEventInit,
|
|
26127
26212
|
ProgressEvent,
|
|
26128
26213
|
FormDataEntryValue,
|
|
26129
|
-
FormData,
|
|
26214
|
+
FormData_2 as FormData,
|
|
26130
26215
|
DiagnosticsChannel,
|
|
26131
26216
|
BinaryType,
|
|
26132
26217
|
WebSocketEventMap,
|
|
@@ -26187,10 +26272,7 @@ export declare function unstable_splitSqlQuery(sql: string): string[];
|
|
|
26187
26272
|
|
|
26188
26273
|
export declare function unstable_startWorker(options: StartDevWorkerInput): Promise<Worker>;
|
|
26189
26274
|
|
|
26190
|
-
export declare
|
|
26191
|
-
server: Server<IncomingMessage, ServerResponse>;
|
|
26192
|
-
terminator: HttpTerminator;
|
|
26193
|
-
}>;
|
|
26275
|
+
export declare const unstable_startWorkerRegistryServer: startWorkerRegistryServer;
|
|
26194
26276
|
|
|
26195
26277
|
export declare interface UnstableASSETSBindingsOptions {
|
|
26196
26278
|
log: Logger;
|
|
@@ -26208,7 +26290,7 @@ export declare interface UnstableDevOptions {
|
|
|
26208
26290
|
localProtocol?: "http" | "https";
|
|
26209
26291
|
httpsKeyPath?: string;
|
|
26210
26292
|
httpsCertPath?: string;
|
|
26211
|
-
|
|
26293
|
+
assets?: string;
|
|
26212
26294
|
legacyAssets?: string;
|
|
26213
26295
|
site?: string;
|
|
26214
26296
|
siteInclude?: string[];
|
|
@@ -26268,6 +26350,7 @@ export declare interface UnstableDevOptions {
|
|
|
26268
26350
|
watch?: boolean;
|
|
26269
26351
|
devEnv?: boolean;
|
|
26270
26352
|
fileBasedRegistry?: boolean;
|
|
26353
|
+
vectorizeBindToProd?: boolean;
|
|
26271
26354
|
};
|
|
26272
26355
|
}
|
|
26273
26356
|
|
|
@@ -26406,8 +26489,6 @@ declare type WorkflowBinding = {
|
|
|
26406
26489
|
class_name: string;
|
|
26407
26490
|
/** The script where the Workflow is defined (if it's external to this Worker) */
|
|
26408
26491
|
script_name?: string;
|
|
26409
|
-
/** The service environment of the script_name to bind to */
|
|
26410
|
-
environment?: string;
|
|
26411
26492
|
};
|
|
26412
26493
|
|
|
26413
26494
|
declare type ZoneIdRoute = {
|