wrangler 3.76.0 → 3.78.0
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/config-schema.json +183 -156
- package/package.json +8 -8
- 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-serve-static-assets.ts +2 -2
- package/wrangler-dist/cli.d.ts +86 -21
- package/wrangler-dist/cli.js +90545 -86285
package/wrangler-dist/cli.d.ts
CHANGED
@@ -30,6 +30,7 @@ import { UrlObject } from 'url';
|
|
30
30
|
import { URLSearchParams as URLSearchParams_2 } from 'url';
|
31
31
|
import type { WorkerOptions } from 'miniflare';
|
32
32
|
import { Writable } from 'stream';
|
33
|
+
import { z } from 'zod';
|
33
34
|
|
34
35
|
declare type AbortSignal_2 = unknown;
|
35
36
|
|
@@ -72,6 +73,19 @@ declare type ApiCredentials = {
|
|
72
73
|
authEmail: string;
|
73
74
|
};
|
74
75
|
|
76
|
+
declare type AssetConfig = z.infer<typeof AssetConfigSchema>;
|
77
|
+
|
78
|
+
declare const AssetConfigSchema: z.ZodObject<{
|
79
|
+
html_handling: z.ZodOptional<z.ZodEnum<["auto-trailing-slash", "force-trailing-slash", "drop-trailing-slash", "none"]>>;
|
80
|
+
not_found_handling: z.ZodOptional<z.ZodEnum<["single-page-application", "404-page", "none"]>>;
|
81
|
+
}, "strip", z.ZodTypeAny, {
|
82
|
+
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
83
|
+
not_found_handling?: "none" | "single-page-application" | "404-page";
|
84
|
+
}, {
|
85
|
+
html_handling?: "none" | "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash";
|
86
|
+
not_found_handling?: "none" | "single-page-application" | "404-page";
|
87
|
+
}>;
|
88
|
+
|
75
89
|
declare type AsyncHook<T extends HookValues, Args extends unknown[] = []> = Hook<T, Args> | Hook<Promise<T>, Args>;
|
76
90
|
|
77
91
|
declare class BalancedPool extends Dispatcher {
|
@@ -148,6 +162,8 @@ declare type Binding = {
|
|
148
162
|
} & Omit<CfDispatchNamespace, "binding">) | ({
|
149
163
|
type: "mtls_certificate";
|
150
164
|
} & Omit<CfMTlsCertificate, "binding">) | ({
|
165
|
+
type: "pipeline";
|
166
|
+
} & Omit<CfPipeline, "binding">) | ({
|
151
167
|
type: "logfwdr";
|
152
168
|
} & Omit<CfLogfwdrBinding, "name">) | {
|
153
169
|
type: `unsafe_${string}`;
|
@@ -519,6 +535,11 @@ declare interface CfMTlsCertificate {
|
|
519
535
|
certificate_id: string;
|
520
536
|
}
|
521
537
|
|
538
|
+
declare interface CfPipeline {
|
539
|
+
binding: string;
|
540
|
+
pipeline: string;
|
541
|
+
}
|
542
|
+
|
522
543
|
declare interface CfQueue {
|
523
544
|
binding: string;
|
524
545
|
queue_name: string;
|
@@ -975,7 +996,6 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
|
|
975
996
|
modified_on: string;
|
976
997
|
short_id: string;
|
977
998
|
build_image_major_version: number;
|
978
|
-
kv_namespaces?: any;
|
979
999
|
source?: {
|
980
1000
|
type: "github" | "gitlab";
|
981
1001
|
config: {
|
@@ -990,6 +1010,7 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
|
|
990
1010
|
preview_branch_excludes?: string[] | undefined;
|
991
1011
|
};
|
992
1012
|
} | undefined;
|
1013
|
+
kv_namespaces?: any;
|
993
1014
|
env_vars?: any;
|
994
1015
|
durable_object_namespaces?: any;
|
995
1016
|
is_skipped?: boolean | undefined;
|
@@ -1390,6 +1411,25 @@ declare type DurableObjectBindings = {
|
|
1390
1411
|
environment?: string;
|
1391
1412
|
}[];
|
1392
1413
|
|
1414
|
+
/**
|
1415
|
+
* Configuration in wrangler for Durable Object Migrations
|
1416
|
+
*/
|
1417
|
+
declare type DurableObjectMigration = {
|
1418
|
+
/** A unique identifier for this migration. */
|
1419
|
+
tag: string;
|
1420
|
+
/** The new Durable Objects being defined. */
|
1421
|
+
new_classes?: string[];
|
1422
|
+
/** The new SQLite Durable Objects being defined. */
|
1423
|
+
new_sqlite_classes?: string[];
|
1424
|
+
/** The Durable Objects being renamed. */
|
1425
|
+
renamed_classes?: {
|
1426
|
+
from: string;
|
1427
|
+
to: string;
|
1428
|
+
}[];
|
1429
|
+
/** The Durable Objects being removed. */
|
1430
|
+
deleted_classes?: string[];
|
1431
|
+
};
|
1432
|
+
|
1393
1433
|
declare interface EnablePagesAssetsServiceBindingOptions {
|
1394
1434
|
proxyPort?: number;
|
1395
1435
|
directory?: string;
|
@@ -1554,21 +1594,7 @@ declare interface EnvironmentInheritable {
|
|
1554
1594
|
* @default []
|
1555
1595
|
* @inheritable
|
1556
1596
|
*/
|
1557
|
-
migrations:
|
1558
|
-
/** A unique identifier for this migration. */
|
1559
|
-
tag: string;
|
1560
|
-
/** The new Durable Objects being defined. */
|
1561
|
-
new_classes?: string[];
|
1562
|
-
/** The new SQLite Durable Objects being defined. */
|
1563
|
-
new_sqlite_classes?: string[];
|
1564
|
-
/** The Durable Objects being renamed. */
|
1565
|
-
renamed_classes?: {
|
1566
|
-
from: string;
|
1567
|
-
to: string;
|
1568
|
-
}[];
|
1569
|
-
/** The Durable Objects being removed. */
|
1570
|
-
deleted_classes?: string[];
|
1571
|
-
}[];
|
1597
|
+
migrations: DurableObjectMigration[];
|
1572
1598
|
/**
|
1573
1599
|
* "Cron" definitions to trigger a Worker's "scheduled" function.
|
1574
1600
|
*
|
@@ -1698,6 +1724,7 @@ declare interface EnvironmentInheritable {
|
|
1698
1724
|
*/
|
1699
1725
|
placement: {
|
1700
1726
|
mode: "off" | "smart";
|
1727
|
+
hint?: string;
|
1701
1728
|
} | undefined;
|
1702
1729
|
/**
|
1703
1730
|
* Specify the directory of static assets to deploy/serve
|
@@ -1705,6 +1732,12 @@ declare interface EnvironmentInheritable {
|
|
1705
1732
|
* @inheritable
|
1706
1733
|
*/
|
1707
1734
|
experimental_assets: ExperimentalAssets | undefined;
|
1735
|
+
/**
|
1736
|
+
* Specify the observability behavior of the Worker.
|
1737
|
+
*
|
1738
|
+
* @inheritable
|
1739
|
+
*/
|
1740
|
+
observability: Observability | undefined;
|
1708
1741
|
}
|
1709
1742
|
|
1710
1743
|
/**
|
@@ -2062,6 +2095,21 @@ declare interface EnvironmentNonInheritable {
|
|
2062
2095
|
/** Details about the outbound Worker which will handle outbound requests from your namespace */
|
2063
2096
|
outbound?: DispatchNamespaceOutbound;
|
2064
2097
|
}[];
|
2098
|
+
/**
|
2099
|
+
* Specifies list of Pipelines bound to this Worker environment
|
2100
|
+
*
|
2101
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
2102
|
+
* and so must be specified in every named environment.
|
2103
|
+
*
|
2104
|
+
* @default `[]`
|
2105
|
+
* @nonInheritable
|
2106
|
+
*/
|
2107
|
+
pipelines: {
|
2108
|
+
/** The binding name used to refer to the bound service. */
|
2109
|
+
binding: string;
|
2110
|
+
/** Name of the Pipeline to bind */
|
2111
|
+
pipeline: string;
|
2112
|
+
}[];
|
2065
2113
|
}
|
2066
2114
|
|
2067
2115
|
declare type ErrorEvent = BaseErrorEvent<"ConfigController" | "BundlerController" | "LocalRuntimeController" | "RemoteRuntimeController" | "ProxyWorker" | "InspectorProxyWorker"> | BaseErrorEvent<"ProxyController", {
|
@@ -2277,11 +2325,14 @@ declare type ExperimentalAssets = {
|
|
2277
2325
|
/** Absolute path to assets directory */
|
2278
2326
|
directory: string;
|
2279
2327
|
binding?: string;
|
2328
|
+
html_handling?: "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash" | "none";
|
2329
|
+
not_found_handling?: "single-page-application" | "404-page" | "none";
|
2280
2330
|
};
|
2281
2331
|
|
2282
|
-
declare
|
2332
|
+
declare type ExperimentalAssetsOptions = Pick<ExperimentalAssets, "directory" | "binding"> & {
|
2283
2333
|
routingConfig: RoutingConfig;
|
2284
|
-
|
2334
|
+
assetConfig: AssetConfig;
|
2335
|
+
};
|
2285
2336
|
|
2286
2337
|
declare function fetch (
|
2287
2338
|
input: RequestInfo,
|
@@ -2838,6 +2889,13 @@ declare interface MultiCacheQueryOptions extends CacheQueryOptions {
|
|
2838
2889
|
*/
|
2839
2890
|
declare type NodeJSCompatMode = "legacy" | "als" | "v1" | "v2" | null;
|
2840
2891
|
|
2892
|
+
declare interface Observability {
|
2893
|
+
/** If observability is enabled for this Worker */
|
2894
|
+
enabled: boolean;
|
2895
|
+
/** The sampling rate */
|
2896
|
+
head_sampling_rate?: number;
|
2897
|
+
}
|
2898
|
+
|
2841
2899
|
declare interface PagesConfigFields {
|
2842
2900
|
/**
|
2843
2901
|
* The directory of static assets to serve.
|
@@ -25762,9 +25820,15 @@ declare namespace RetryHandler {
|
|
25762
25820
|
|
25763
25821
|
declare type Route = SimpleRoute | ZoneIdRoute | ZoneNameRoute | CustomDomainRoute;
|
25764
25822
|
|
25765
|
-
declare type RoutingConfig =
|
25766
|
-
|
25767
|
-
|
25823
|
+
declare type RoutingConfig = z.infer<typeof RoutingConfigSchema>;
|
25824
|
+
|
25825
|
+
declare const RoutingConfigSchema: z.ZodObject<{
|
25826
|
+
has_user_worker: z.ZodOptional<z.ZodBoolean>;
|
25827
|
+
}, "strip", z.ZodTypeAny, {
|
25828
|
+
has_user_worker?: boolean;
|
25829
|
+
}, {
|
25830
|
+
has_user_worker?: boolean;
|
25831
|
+
}>;
|
25768
25832
|
|
25769
25833
|
/**
|
25770
25834
|
* A bundling resolver rule, defining the modules type for paths that match the specified globs.
|
@@ -25855,6 +25919,7 @@ declare interface StartDevWorkerInput {
|
|
25855
25919
|
env?: string;
|
25856
25920
|
/** The bindings available to the worker. The specified bindind type will be exposed to the worker on the `env` object under the same key. */
|
25857
25921
|
bindings?: Record<string, Binding>;
|
25922
|
+
migrations?: DurableObjectMigration[];
|
25858
25923
|
/** The triggers which will cause the worker's exported default handlers to be called. */
|
25859
25924
|
triggers?: Trigger[];
|
25860
25925
|
/**
|