wrangler 4.20.1 → 4.20.3
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 +86 -49
- package/package.json +6 -6
- package/wrangler-dist/cli.d.ts +77 -58
- package/wrangler-dist/cli.js +433 -303
- package/wrangler-dist/metafile-cjs.json +1 -1
- /package/templates/{mixedMode → remoteBindings}/proxyServerWorker/index.ts +0 -0
- /package/templates/{mixedMode → remoteBindings}/proxyServerWorker/wrangler.jsonc +0 -0
package/wrangler-dist/cli.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Json, Request, Response as Response$1, DispatchFetch, WorkerOptions, NodeJSCompatMode, Miniflare, MiniflareOptions, Mutex, ModuleRule,
|
1
|
+
import { Json, Request, Response as Response$1, DispatchFetch, WorkerOptions, NodeJSCompatMode, Miniflare, MiniflareOptions, Mutex, ModuleRule, RemoteProxyConnectionString } from 'miniflare';
|
2
2
|
import * as undici from 'undici';
|
3
3
|
import { RequestInfo, RequestInit, Response, FormData } from 'undici';
|
4
4
|
import { RouterConfig, AssetConfig } from '@cloudflare/workers-shared';
|
@@ -66,7 +66,7 @@ type ContainerApp = {
|
|
66
66
|
image_vars?: Record<string, string>;
|
67
67
|
class_name: string;
|
68
68
|
/** The scheduling policy of the application, default is regional */
|
69
|
-
scheduling_policy?: "regional" | "moon";
|
69
|
+
scheduling_policy?: "regional" | "moon" | "default";
|
70
70
|
configuration: {
|
71
71
|
image: string;
|
72
72
|
labels?: {
|
@@ -427,8 +427,8 @@ type WorkflowBinding = {
|
|
427
427
|
class_name: string;
|
428
428
|
/** The script where the Workflow is defined (if it's external to this Worker) */
|
429
429
|
script_name?: string;
|
430
|
-
/** Whether the Workflow should be remote or not (only available under `--x-
|
431
|
-
|
430
|
+
/** Whether the Workflow should be remote or not (only available under `--x-remote-bindings`) */
|
431
|
+
experimental_remote?: boolean;
|
432
432
|
};
|
433
433
|
/**
|
434
434
|
* The `EnvironmentNonInheritable` interface declares all the configuration fields for an environment
|
@@ -500,6 +500,9 @@ interface EnvironmentNonInheritable {
|
|
500
500
|
/**
|
501
501
|
* Container related configuration
|
502
502
|
*
|
503
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
504
|
+
* and so must be specified in every named environment.
|
505
|
+
*
|
503
506
|
* @default []
|
504
507
|
* @nonInheritable
|
505
508
|
*/
|
@@ -526,8 +529,8 @@ interface EnvironmentNonInheritable {
|
|
526
529
|
id?: string;
|
527
530
|
/** The ID of the KV namespace used during `wrangler dev` */
|
528
531
|
preview_id?: string;
|
529
|
-
/** Whether the KV namespace should be remote or not (only available under `--x-
|
530
|
-
|
532
|
+
/** Whether the KV namespace should be remote or not (only available under `--x-remote-bindings`) */
|
533
|
+
experimental_remote?: boolean;
|
531
534
|
}[];
|
532
535
|
/**
|
533
536
|
* These specify bindings to send email from inside your Worker.
|
@@ -568,8 +571,8 @@ interface EnvironmentNonInheritable {
|
|
568
571
|
queue: string;
|
569
572
|
/** The number of seconds to wait before delivering a message */
|
570
573
|
delivery_delay?: number;
|
571
|
-
/** Whether the Queue producer should be remote or not (only available under `--x-
|
572
|
-
|
574
|
+
/** Whether the Queue producer should be remote or not (only available under `--x-remote-bindings`) */
|
575
|
+
experimental_remote?: boolean;
|
573
576
|
}[];
|
574
577
|
/** Consumer configuration */
|
575
578
|
consumers?: {
|
@@ -613,8 +616,8 @@ interface EnvironmentNonInheritable {
|
|
613
616
|
preview_bucket_name?: string;
|
614
617
|
/** The jurisdiction that the bucket exists in. Default if not present. */
|
615
618
|
jurisdiction?: string;
|
616
|
-
/** Whether the R2 bucket should be remote or not (only available under `--x-
|
617
|
-
|
619
|
+
/** Whether the R2 bucket should be remote or not (only available under `--x-remote-bindings`) */
|
620
|
+
experimental_remote?: boolean;
|
618
621
|
}[];
|
619
622
|
/**
|
620
623
|
* Specifies D1 databases that are bound to this Worker environment.
|
@@ -642,8 +645,8 @@ interface EnvironmentNonInheritable {
|
|
642
645
|
migrations_dir?: string;
|
643
646
|
/** Internal use only. */
|
644
647
|
database_internal_env?: string;
|
645
|
-
/** Whether the D1 database should be remote or not (only available under `--x-
|
646
|
-
|
648
|
+
/** Whether the D1 database should be remote or not (only available under `--x-remote-bindings`) */
|
649
|
+
experimental_remote?: boolean;
|
647
650
|
}[];
|
648
651
|
/**
|
649
652
|
* Specifies Vectorize indexes that are bound to this Worker environment.
|
@@ -661,8 +664,8 @@ interface EnvironmentNonInheritable {
|
|
661
664
|
binding: string;
|
662
665
|
/** The name of the index. */
|
663
666
|
index_name: string;
|
664
|
-
/** Whether the Vectorize index should be remote or not (only available under `--x-
|
665
|
-
|
667
|
+
/** Whether the Vectorize index should be remote or not (only available under `--x-remote-bindings`) */
|
668
|
+
experimental_remote?: boolean;
|
666
669
|
}[];
|
667
670
|
/**
|
668
671
|
* Specifies Hyperdrive configs that are bound to this Worker environment.
|
@@ -705,8 +708,8 @@ interface EnvironmentNonInheritable {
|
|
705
708
|
entrypoint?: string;
|
706
709
|
/** Optional properties that will be made available to the service via ctx.props. */
|
707
710
|
props?: Record<string, unknown>;
|
708
|
-
/** Whether the service binding should be remote or not (only available under `--x-
|
709
|
-
|
711
|
+
/** Whether the service binding should be remote or not (only available under `--x-remote-bindings`) */
|
712
|
+
experimental_remote?: boolean;
|
710
713
|
}[] | undefined;
|
711
714
|
/**
|
712
715
|
* Specifies analytics engine datasets that are bound to this Worker environment.
|
@@ -738,8 +741,8 @@ interface EnvironmentNonInheritable {
|
|
738
741
|
*/
|
739
742
|
browser: {
|
740
743
|
binding: string;
|
741
|
-
/** Whether the Browser binding should be remote or not (only available under `--x-
|
742
|
-
|
744
|
+
/** Whether the Browser binding should be remote or not (only available under `--x-remote-bindings`) */
|
745
|
+
experimental_remote?: boolean;
|
743
746
|
} | undefined;
|
744
747
|
/**
|
745
748
|
* Binding to the AI project.
|
@@ -755,8 +758,8 @@ interface EnvironmentNonInheritable {
|
|
755
758
|
ai: {
|
756
759
|
binding: string;
|
757
760
|
staging?: boolean;
|
758
|
-
/** Whether the AI binding should be remote or not (only available under `--x-
|
759
|
-
|
761
|
+
/** Whether the AI binding should be remote or not (only available under `--x-remote-bindings`) */
|
762
|
+
experimental_remote?: boolean;
|
760
763
|
} | undefined;
|
761
764
|
/**
|
762
765
|
* Binding to Cloudflare Images
|
@@ -771,8 +774,8 @@ interface EnvironmentNonInheritable {
|
|
771
774
|
*/
|
772
775
|
images: {
|
773
776
|
binding: string;
|
774
|
-
/** Whether the Images binding should be remote or not (only available under `--x-
|
775
|
-
|
777
|
+
/** Whether the Images binding should be remote or not (only available under `--x-remote-bindings`) */
|
778
|
+
experimental_remote?: boolean;
|
776
779
|
} | undefined;
|
777
780
|
/**
|
778
781
|
* Binding to the Worker Version's metadata
|
@@ -836,8 +839,8 @@ interface EnvironmentNonInheritable {
|
|
836
839
|
binding: string;
|
837
840
|
/** The uuid of the uploaded mTLS certificate */
|
838
841
|
certificate_id: string;
|
839
|
-
/** Whether the mtls fetcher should be remote or not (only available under `--x-
|
840
|
-
|
842
|
+
/** Whether the mtls fetcher should be remote or not (only available under `--x-remote-bindings`) */
|
843
|
+
experimental_remote?: boolean;
|
841
844
|
}[];
|
842
845
|
/**
|
843
846
|
* Specifies a list of Tail Workers that are bound to this Worker environment
|
@@ -867,8 +870,8 @@ interface EnvironmentNonInheritable {
|
|
867
870
|
namespace: string;
|
868
871
|
/** Details about the outbound Worker which will handle outbound requests from your namespace */
|
869
872
|
outbound?: DispatchNamespaceOutbound;
|
870
|
-
/** Whether the Dispatch Namespace should be remote or not (only available under `--x-
|
871
|
-
|
873
|
+
/** Whether the Dispatch Namespace should be remote or not (only available under `--x-remote-bindings`) */
|
874
|
+
experimental_remote?: boolean;
|
872
875
|
}[];
|
873
876
|
/**
|
874
877
|
* Specifies list of Pipelines bound to this Worker environment
|
@@ -984,6 +987,13 @@ interface Observability {
|
|
984
987
|
invocation_logs?: boolean;
|
985
988
|
};
|
986
989
|
}
|
990
|
+
type DockerConfiguration = {
|
991
|
+
/** Socket used by miniflare to communicate with Docker */
|
992
|
+
socketPath: string;
|
993
|
+
};
|
994
|
+
type ContainerEngine = {
|
995
|
+
localDocker: DockerConfiguration;
|
996
|
+
} | string;
|
987
997
|
|
988
998
|
/**
|
989
999
|
* This is the static type definition for the configuration object.
|
@@ -1189,6 +1199,11 @@ interface DevConfig {
|
|
1189
1199
|
* @default true
|
1190
1200
|
*/
|
1191
1201
|
enable_containers: boolean;
|
1202
|
+
/**
|
1203
|
+
* Either the Docker unix socket i.e. `unix:/var/run/docker.sock` or a full configuration.
|
1204
|
+
* Note that windows is only supported via WSL at the moment
|
1205
|
+
*/
|
1206
|
+
container_engine: ContainerEngine | undefined;
|
1192
1207
|
}
|
1193
1208
|
type RawDevConfig = Partial<DevConfig>;
|
1194
1209
|
interface EnvironmentMap {
|
@@ -1223,6 +1238,7 @@ type NormalizeAndValidateConfigArgs = {
|
|
1223
1238
|
upstreamProtocol?: string;
|
1224
1239
|
script?: string;
|
1225
1240
|
enableContainers?: boolean;
|
1241
|
+
containerEngine?: ContainerEngine;
|
1226
1242
|
};
|
1227
1243
|
|
1228
1244
|
type ReadConfigCommandArgs = NormalizeAndValidateConfigArgs & {
|
@@ -1232,7 +1248,7 @@ type ReadConfigCommandArgs = NormalizeAndValidateConfigArgs & {
|
|
1232
1248
|
type ReadConfigOptions = ResolveConfigPathOptions & {
|
1233
1249
|
hideWarnings?: boolean;
|
1234
1250
|
experimental?: {
|
1235
|
-
|
1251
|
+
remoteBindingsEnabled?: boolean;
|
1236
1252
|
};
|
1237
1253
|
};
|
1238
1254
|
type ConfigBindingOptions = Pick<Config, "ai" | "browser" | "d1_databases" | "dispatch_namespaces" | "durable_objects" | "queues" | "r2_buckets" | "services" | "kv_namespaces" | "mtls_certificates" | "vectorize" | "workflows">;
|
@@ -1309,7 +1325,7 @@ interface CfModule {
|
|
1309
1325
|
interface CfKvNamespace {
|
1310
1326
|
binding: string;
|
1311
1327
|
id?: string | typeof INHERIT_SYMBOL;
|
1312
|
-
|
1328
|
+
experimental_remote?: boolean;
|
1313
1329
|
raw?: boolean;
|
1314
1330
|
}
|
1315
1331
|
/**
|
@@ -1336,21 +1352,21 @@ interface CfWorkflow {
|
|
1336
1352
|
class_name: string;
|
1337
1353
|
binding: string;
|
1338
1354
|
script_name?: string;
|
1339
|
-
|
1355
|
+
experimental_remote?: boolean;
|
1340
1356
|
raw?: boolean;
|
1341
1357
|
}
|
1342
1358
|
interface CfQueue {
|
1343
1359
|
binding: string;
|
1344
1360
|
queue_name: string;
|
1345
1361
|
delivery_delay?: number;
|
1346
|
-
|
1362
|
+
experimental_remote?: boolean;
|
1347
1363
|
raw?: boolean;
|
1348
1364
|
}
|
1349
1365
|
interface CfR2Bucket {
|
1350
1366
|
binding: string;
|
1351
1367
|
bucket_name?: string | typeof INHERIT_SYMBOL;
|
1352
1368
|
jurisdiction?: string;
|
1353
|
-
|
1369
|
+
experimental_remote?: boolean;
|
1354
1370
|
raw?: boolean;
|
1355
1371
|
}
|
1356
1372
|
interface CfD1Database {
|
@@ -1361,14 +1377,14 @@ interface CfD1Database {
|
|
1361
1377
|
database_internal_env?: string;
|
1362
1378
|
migrations_table?: string;
|
1363
1379
|
migrations_dir?: string;
|
1364
|
-
|
1380
|
+
experimental_remote?: boolean;
|
1365
1381
|
raw?: boolean;
|
1366
1382
|
}
|
1367
1383
|
interface CfVectorize {
|
1368
1384
|
binding: string;
|
1369
1385
|
index_name: string;
|
1370
1386
|
raw?: boolean;
|
1371
|
-
|
1387
|
+
experimental_remote?: boolean;
|
1372
1388
|
}
|
1373
1389
|
interface CfSecretsStoreSecrets {
|
1374
1390
|
binding: string;
|
@@ -1390,7 +1406,7 @@ interface CfService {
|
|
1390
1406
|
environment?: string;
|
1391
1407
|
entrypoint?: string;
|
1392
1408
|
props?: Record<string, unknown>;
|
1393
|
-
|
1409
|
+
experimental_remote?: boolean;
|
1394
1410
|
}
|
1395
1411
|
interface CfAnalyticsEngineDataset {
|
1396
1412
|
binding: string;
|
@@ -1404,12 +1420,12 @@ interface CfDispatchNamespace {
|
|
1404
1420
|
environment?: string;
|
1405
1421
|
parameters?: string[];
|
1406
1422
|
};
|
1407
|
-
|
1423
|
+
experimental_remote?: boolean;
|
1408
1424
|
}
|
1409
1425
|
interface CfMTlsCertificate {
|
1410
1426
|
binding: string;
|
1411
1427
|
certificate_id: string;
|
1412
|
-
|
1428
|
+
experimental_remote?: boolean;
|
1413
1429
|
}
|
1414
1430
|
interface CfLogfwdrBinding {
|
1415
1431
|
name: string;
|
@@ -1549,6 +1565,7 @@ interface Unstable_DevOptions {
|
|
1549
1565
|
enableIpc?: boolean;
|
1550
1566
|
enableContainers?: boolean;
|
1551
1567
|
dockerPath?: string;
|
1568
|
+
containerEngine?: string;
|
1552
1569
|
};
|
1553
1570
|
}
|
1554
1571
|
interface Unstable_DevWorker {
|
@@ -1908,7 +1925,7 @@ interface StartDevWorkerInput {
|
|
1908
1925
|
watch?: boolean;
|
1909
1926
|
/** Whether a script tag is inserted on text/html responses which will reload the page upon file changes. Defaults to false. */
|
1910
1927
|
liveReload?: boolean;
|
1911
|
-
/** The local address to reach your worker. Applies to
|
1928
|
+
/** The local address to reach your worker. Applies to experimental_remote: true (remote mode) and remote: false (local mode). */
|
1912
1929
|
server?: {
|
1913
1930
|
hostname?: string;
|
1914
1931
|
port?: number;
|
@@ -1934,12 +1951,14 @@ interface StartDevWorkerInput {
|
|
1934
1951
|
imagesLocalMode?: boolean;
|
1935
1952
|
/** Treat this as the primary worker in a multiworker setup (i.e. the first Worker in Miniflare's options) */
|
1936
1953
|
multiworkerPrimary?: boolean;
|
1937
|
-
/** Whether the experimental
|
1938
|
-
|
1954
|
+
/** Whether the experimental remote bindings feature should be enabled */
|
1955
|
+
experimentalRemoteBindings?: boolean;
|
1939
1956
|
/** Whether to build and connect to containers during local dev. Requires Docker daemon to be running. Defaults to true. */
|
1940
1957
|
enableContainers?: boolean;
|
1941
1958
|
/** Path to the docker executable. Defaults to 'docker' */
|
1942
1959
|
dockerPath?: string;
|
1960
|
+
/** Options for the container engine */
|
1961
|
+
containerEngine?: ContainerEngine;
|
1943
1962
|
};
|
1944
1963
|
legacy?: {
|
1945
1964
|
site?: Hook<Config["site"], [Config]>;
|
@@ -2400,53 +2419,53 @@ interface Unstable_MiniflareWorkerOptions {
|
|
2400
2419
|
}
|
2401
2420
|
declare function unstable_getMiniflareWorkerOptions(configPath: string, env?: string, options?: {
|
2402
2421
|
imagesLocalMode?: boolean;
|
2403
|
-
|
2404
|
-
|
2422
|
+
remoteProxyConnectionString?: RemoteProxyConnectionString;
|
2423
|
+
remoteBindingsEnabled?: boolean;
|
2405
2424
|
overrides?: {
|
2406
2425
|
assets?: Partial<AssetsOptions>;
|
2407
2426
|
};
|
2408
2427
|
}): Unstable_MiniflareWorkerOptions;
|
2409
2428
|
declare function unstable_getMiniflareWorkerOptions(config: Config, env?: string, options?: {
|
2410
2429
|
imagesLocalMode?: boolean;
|
2411
|
-
|
2412
|
-
|
2430
|
+
remoteProxyConnectionString?: RemoteProxyConnectionString;
|
2431
|
+
remoteBindingsEnabled?: boolean;
|
2413
2432
|
overrides?: {
|
2414
2433
|
assets?: Partial<AssetsOptions>;
|
2415
2434
|
};
|
2416
2435
|
}): Unstable_MiniflareWorkerOptions;
|
2417
2436
|
|
2418
|
-
type
|
2437
|
+
type RemoteProxySession = Pick<Worker, "ready" | "dispose"> & {
|
2419
2438
|
updateBindings: (bindings: StartDevWorkerInput["bindings"]) => Promise<void>;
|
2420
|
-
|
2439
|
+
remoteProxyConnectionString: RemoteProxyConnectionString;
|
2421
2440
|
};
|
2422
|
-
type
|
2441
|
+
type StartRemoteProxySessionOptions = {
|
2423
2442
|
workerName?: string;
|
2424
2443
|
auth?: NonNullable<StartDevWorkerInput["dev"]>["auth"];
|
2425
2444
|
/** If running in a non-public compliance region, set this here. */
|
2426
2445
|
complianceRegion?: Config["compliance_region"];
|
2427
2446
|
};
|
2428
|
-
declare function
|
2447
|
+
declare function startRemoteProxySession(bindings: StartDevWorkerInput["bindings"], options?: StartRemoteProxySessionOptions): Promise<RemoteProxySession>;
|
2429
2448
|
declare function pickRemoteBindings(bindings: Record<string, Binding>): Record<string, Binding>;
|
2430
2449
|
/**
|
2431
|
-
* Utility for potentially starting or updating a
|
2450
|
+
* Utility for potentially starting or updating a remote proxy session.
|
2432
2451
|
*
|
2433
|
-
* It uses an internal map for storing existing
|
2434
|
-
* the
|
2452
|
+
* It uses an internal map for storing existing remote proxy session indexed by worker names. If no worker name is provided
|
2453
|
+
* the remote proxy session won't be retrieved nor saved to/from the internal map.
|
2435
2454
|
*
|
2436
2455
|
* @param configPathOrWorkerConfig either a file path to a wrangler configuration file or an object containing the name of
|
2437
2456
|
* the target worker alongside its bindings.
|
2438
|
-
* @param
|
2439
|
-
* @returns null if no existing
|
2440
|
-
* defining any remote bindings), the data associated to the created/updated
|
2457
|
+
* @param preExistingRemoteProxySessionData the data of a pre-existing remote proxy session if there was one null otherwise
|
2458
|
+
* @returns null if no existing remote proxy session was provided and one should not be created (because the worker is not
|
2459
|
+
* defining any remote bindings), the data associated to the created/updated remote proxy session otherwise.
|
2441
2460
|
*/
|
2442
|
-
declare function
|
2461
|
+
declare function maybeStartOrUpdateRemoteProxySession(configPathOrWorkerConfig: string | {
|
2443
2462
|
name?: string;
|
2444
2463
|
bindings: NonNullable<StartDevWorkerInput["bindings"]>;
|
2445
|
-
},
|
2446
|
-
session:
|
2464
|
+
}, preExistingRemoteProxySessionData: {
|
2465
|
+
session: RemoteProxySession;
|
2447
2466
|
remoteBindings: Record<string, Binding>;
|
2448
2467
|
} | null): Promise<{
|
2449
|
-
session:
|
2468
|
+
session: RemoteProxySession;
|
2450
2469
|
remoteBindings: Record<string, Binding>;
|
2451
2470
|
} | null>;
|
2452
2471
|
|
@@ -2505,4 +2524,4 @@ interface Unstable_ASSETSBindingsOptions {
|
|
2505
2524
|
}
|
2506
2525
|
declare const generateASSETSBinding: (opts: Unstable_ASSETSBindingsOptions) => (request: Request) => Promise<Response$1>;
|
2507
2526
|
|
2508
|
-
export { type ConfigBindingOptions as Experimental_ConfigBindingOptions, type
|
2527
|
+
export { type ConfigBindingOptions as Experimental_ConfigBindingOptions, type RemoteProxySession as Experimental_RemoteProxySession, type GetPlatformProxyOptions, type PlatformProxy, type SourcelessWorkerOptions, type Unstable_ASSETSBindingsOptions, type Binding as Unstable_Binding, type Config as Unstable_Config, type Unstable_DevOptions, type Unstable_DevWorker, type Unstable_MiniflareWorkerOptions, type RawConfig as Unstable_RawConfig, type RawEnvironment as Unstable_RawEnvironment, type StartRemoteProxySessionOptions as experimental_StartRemoteProxySessionOptions, maybeStartOrUpdateRemoteProxySession as experimental_maybeStartOrUpdateRemoteProxySession, experimental_patchConfig, pickRemoteBindings as experimental_pickRemoteBindings, experimental_readRawConfig, startRemoteProxySession as experimental_startRemoteProxySession, getPlatformProxy, DevEnv as unstable_DevEnv, convertConfigBindingsToStartWorkerBindings as unstable_convertConfigBindingsToStartWorkerBindings, unstable_dev, generateASSETSBinding as unstable_generateASSETSBinding, unstable_getMiniflareWorkerOptions, unstable_pages, readConfig as unstable_readConfig, splitSqlQuery as unstable_splitSqlQuery, startWorker as unstable_startWorker };
|