wrangler 4.20.2 → 4.20.4
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 +48 -47
- package/package.json +5 -5
- package/wrangler-dist/cli.d.ts +62 -61
- package/wrangler-dist/cli.js +16641 -16389
- 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,
|
1
|
+
import { Json, Request, Response as Response$1, DispatchFetch, NodeJSCompatMode, Miniflare, MiniflareOptions, Mutex, WorkerOptions, 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
|
@@ -529,8 +529,8 @@ interface EnvironmentNonInheritable {
|
|
529
529
|
id?: string;
|
530
530
|
/** The ID of the KV namespace used during `wrangler dev` */
|
531
531
|
preview_id?: string;
|
532
|
-
/** Whether the KV namespace should be remote or not (only available under `--x-
|
533
|
-
|
532
|
+
/** Whether the KV namespace should be remote or not (only available under `--x-remote-bindings`) */
|
533
|
+
experimental_remote?: boolean;
|
534
534
|
}[];
|
535
535
|
/**
|
536
536
|
* These specify bindings to send email from inside your Worker.
|
@@ -571,8 +571,8 @@ interface EnvironmentNonInheritable {
|
|
571
571
|
queue: string;
|
572
572
|
/** The number of seconds to wait before delivering a message */
|
573
573
|
delivery_delay?: number;
|
574
|
-
/** Whether the Queue producer should be remote or not (only available under `--x-
|
575
|
-
|
574
|
+
/** Whether the Queue producer should be remote or not (only available under `--x-remote-bindings`) */
|
575
|
+
experimental_remote?: boolean;
|
576
576
|
}[];
|
577
577
|
/** Consumer configuration */
|
578
578
|
consumers?: {
|
@@ -616,8 +616,8 @@ interface EnvironmentNonInheritable {
|
|
616
616
|
preview_bucket_name?: string;
|
617
617
|
/** The jurisdiction that the bucket exists in. Default if not present. */
|
618
618
|
jurisdiction?: string;
|
619
|
-
/** Whether the R2 bucket should be remote or not (only available under `--x-
|
620
|
-
|
619
|
+
/** Whether the R2 bucket should be remote or not (only available under `--x-remote-bindings`) */
|
620
|
+
experimental_remote?: boolean;
|
621
621
|
}[];
|
622
622
|
/**
|
623
623
|
* Specifies D1 databases that are bound to this Worker environment.
|
@@ -645,8 +645,8 @@ interface EnvironmentNonInheritable {
|
|
645
645
|
migrations_dir?: string;
|
646
646
|
/** Internal use only. */
|
647
647
|
database_internal_env?: string;
|
648
|
-
/** Whether the D1 database should be remote or not (only available under `--x-
|
649
|
-
|
648
|
+
/** Whether the D1 database should be remote or not (only available under `--x-remote-bindings`) */
|
649
|
+
experimental_remote?: boolean;
|
650
650
|
}[];
|
651
651
|
/**
|
652
652
|
* Specifies Vectorize indexes that are bound to this Worker environment.
|
@@ -664,8 +664,8 @@ interface EnvironmentNonInheritable {
|
|
664
664
|
binding: string;
|
665
665
|
/** The name of the index. */
|
666
666
|
index_name: string;
|
667
|
-
/** Whether the Vectorize index should be remote or not (only available under `--x-
|
668
|
-
|
667
|
+
/** Whether the Vectorize index should be remote or not (only available under `--x-remote-bindings`) */
|
668
|
+
experimental_remote?: boolean;
|
669
669
|
}[];
|
670
670
|
/**
|
671
671
|
* Specifies Hyperdrive configs that are bound to this Worker environment.
|
@@ -708,8 +708,8 @@ interface EnvironmentNonInheritable {
|
|
708
708
|
entrypoint?: string;
|
709
709
|
/** Optional properties that will be made available to the service via ctx.props. */
|
710
710
|
props?: Record<string, unknown>;
|
711
|
-
/** Whether the service binding should be remote or not (only available under `--x-
|
712
|
-
|
711
|
+
/** Whether the service binding should be remote or not (only available under `--x-remote-bindings`) */
|
712
|
+
experimental_remote?: boolean;
|
713
713
|
}[] | undefined;
|
714
714
|
/**
|
715
715
|
* Specifies analytics engine datasets that are bound to this Worker environment.
|
@@ -741,8 +741,8 @@ interface EnvironmentNonInheritable {
|
|
741
741
|
*/
|
742
742
|
browser: {
|
743
743
|
binding: string;
|
744
|
-
/** Whether the Browser binding should be remote or not (only available under `--x-
|
745
|
-
|
744
|
+
/** Whether the Browser binding should be remote or not (only available under `--x-remote-bindings`) */
|
745
|
+
experimental_remote?: boolean;
|
746
746
|
} | undefined;
|
747
747
|
/**
|
748
748
|
* Binding to the AI project.
|
@@ -758,8 +758,8 @@ interface EnvironmentNonInheritable {
|
|
758
758
|
ai: {
|
759
759
|
binding: string;
|
760
760
|
staging?: boolean;
|
761
|
-
/** Whether the AI binding should be remote or not (only available under `--x-
|
762
|
-
|
761
|
+
/** Whether the AI binding should be remote or not (only available under `--x-remote-bindings`) */
|
762
|
+
experimental_remote?: boolean;
|
763
763
|
} | undefined;
|
764
764
|
/**
|
765
765
|
* Binding to Cloudflare Images
|
@@ -774,8 +774,8 @@ interface EnvironmentNonInheritable {
|
|
774
774
|
*/
|
775
775
|
images: {
|
776
776
|
binding: string;
|
777
|
-
/** Whether the Images binding should be remote or not (only available under `--x-
|
778
|
-
|
777
|
+
/** Whether the Images binding should be remote or not (only available under `--x-remote-bindings`) */
|
778
|
+
experimental_remote?: boolean;
|
779
779
|
} | undefined;
|
780
780
|
/**
|
781
781
|
* Binding to the Worker Version's metadata
|
@@ -839,8 +839,8 @@ interface EnvironmentNonInheritable {
|
|
839
839
|
binding: string;
|
840
840
|
/** The uuid of the uploaded mTLS certificate */
|
841
841
|
certificate_id: string;
|
842
|
-
/** Whether the mtls fetcher should be remote or not (only available under `--x-
|
843
|
-
|
842
|
+
/** Whether the mtls fetcher should be remote or not (only available under `--x-remote-bindings`) */
|
843
|
+
experimental_remote?: boolean;
|
844
844
|
}[];
|
845
845
|
/**
|
846
846
|
* Specifies a list of Tail Workers that are bound to this Worker environment
|
@@ -870,8 +870,8 @@ interface EnvironmentNonInheritable {
|
|
870
870
|
namespace: string;
|
871
871
|
/** Details about the outbound Worker which will handle outbound requests from your namespace */
|
872
872
|
outbound?: DispatchNamespaceOutbound;
|
873
|
-
/** Whether the Dispatch Namespace should be remote or not (only available under `--x-
|
874
|
-
|
873
|
+
/** Whether the Dispatch Namespace should be remote or not (only available under `--x-remote-bindings`) */
|
874
|
+
experimental_remote?: boolean;
|
875
875
|
}[];
|
876
876
|
/**
|
877
877
|
* Specifies list of Pipelines bound to this Worker environment
|
@@ -1248,7 +1248,7 @@ type ReadConfigCommandArgs = NormalizeAndValidateConfigArgs & {
|
|
1248
1248
|
type ReadConfigOptions = ResolveConfigPathOptions & {
|
1249
1249
|
hideWarnings?: boolean;
|
1250
1250
|
experimental?: {
|
1251
|
-
|
1251
|
+
remoteBindingsEnabled?: boolean;
|
1252
1252
|
};
|
1253
1253
|
};
|
1254
1254
|
type ConfigBindingOptions = Pick<Config, "ai" | "browser" | "d1_databases" | "dispatch_namespaces" | "durable_objects" | "queues" | "r2_buckets" | "services" | "kv_namespaces" | "mtls_certificates" | "vectorize" | "workflows">;
|
@@ -1325,7 +1325,7 @@ interface CfModule {
|
|
1325
1325
|
interface CfKvNamespace {
|
1326
1326
|
binding: string;
|
1327
1327
|
id?: string | typeof INHERIT_SYMBOL;
|
1328
|
-
|
1328
|
+
experimental_remote?: boolean;
|
1329
1329
|
raw?: boolean;
|
1330
1330
|
}
|
1331
1331
|
/**
|
@@ -1352,21 +1352,21 @@ interface CfWorkflow {
|
|
1352
1352
|
class_name: string;
|
1353
1353
|
binding: string;
|
1354
1354
|
script_name?: string;
|
1355
|
-
|
1355
|
+
experimental_remote?: boolean;
|
1356
1356
|
raw?: boolean;
|
1357
1357
|
}
|
1358
1358
|
interface CfQueue {
|
1359
1359
|
binding: string;
|
1360
1360
|
queue_name: string;
|
1361
1361
|
delivery_delay?: number;
|
1362
|
-
|
1362
|
+
experimental_remote?: boolean;
|
1363
1363
|
raw?: boolean;
|
1364
1364
|
}
|
1365
1365
|
interface CfR2Bucket {
|
1366
1366
|
binding: string;
|
1367
1367
|
bucket_name?: string | typeof INHERIT_SYMBOL;
|
1368
1368
|
jurisdiction?: string;
|
1369
|
-
|
1369
|
+
experimental_remote?: boolean;
|
1370
1370
|
raw?: boolean;
|
1371
1371
|
}
|
1372
1372
|
interface CfD1Database {
|
@@ -1377,14 +1377,14 @@ interface CfD1Database {
|
|
1377
1377
|
database_internal_env?: string;
|
1378
1378
|
migrations_table?: string;
|
1379
1379
|
migrations_dir?: string;
|
1380
|
-
|
1380
|
+
experimental_remote?: boolean;
|
1381
1381
|
raw?: boolean;
|
1382
1382
|
}
|
1383
1383
|
interface CfVectorize {
|
1384
1384
|
binding: string;
|
1385
1385
|
index_name: string;
|
1386
1386
|
raw?: boolean;
|
1387
|
-
|
1387
|
+
experimental_remote?: boolean;
|
1388
1388
|
}
|
1389
1389
|
interface CfSecretsStoreSecrets {
|
1390
1390
|
binding: string;
|
@@ -1406,7 +1406,7 @@ interface CfService {
|
|
1406
1406
|
environment?: string;
|
1407
1407
|
entrypoint?: string;
|
1408
1408
|
props?: Record<string, unknown>;
|
1409
|
-
|
1409
|
+
experimental_remote?: boolean;
|
1410
1410
|
}
|
1411
1411
|
interface CfAnalyticsEngineDataset {
|
1412
1412
|
binding: string;
|
@@ -1420,12 +1420,12 @@ interface CfDispatchNamespace {
|
|
1420
1420
|
environment?: string;
|
1421
1421
|
parameters?: string[];
|
1422
1422
|
};
|
1423
|
-
|
1423
|
+
experimental_remote?: boolean;
|
1424
1424
|
}
|
1425
1425
|
interface CfMTlsCertificate {
|
1426
1426
|
binding: string;
|
1427
1427
|
certificate_id: string;
|
1428
|
-
|
1428
|
+
experimental_remote?: boolean;
|
1429
1429
|
}
|
1430
1430
|
interface CfLogfwdrBinding {
|
1431
1431
|
name: string;
|
@@ -1666,14 +1666,14 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
|
|
1666
1666
|
type: string;
|
1667
1667
|
};
|
1668
1668
|
latest_stage: {
|
1669
|
-
status: "canceled" | "active" | "idle" | "success" | "failure" | "skipped";
|
1670
1669
|
name: "queued" | "build" | "deploy" | "initialize" | "clone_repo";
|
1670
|
+
status: "canceled" | "active" | "idle" | "success" | "failure" | "skipped";
|
1671
1671
|
started_on: string | null;
|
1672
1672
|
ended_on: string | null;
|
1673
1673
|
};
|
1674
1674
|
stages: {
|
1675
|
-
status: "canceled" | "active" | "idle" | "success" | "failure" | "skipped";
|
1676
1675
|
name: "queued" | "build" | "deploy" | "initialize" | "clone_repo";
|
1676
|
+
status: "canceled" | "active" | "idle" | "success" | "failure" | "skipped";
|
1677
1677
|
started_on: string | null;
|
1678
1678
|
ended_on: string | null;
|
1679
1679
|
}[];
|
@@ -1862,7 +1862,7 @@ interface StartDevWorkerInput {
|
|
1862
1862
|
/** The bindings available to the worker. The specified bindind type will be exposed to the worker on the `env` object under the same key. */
|
1863
1863
|
bindings?: Record<string, Binding>;
|
1864
1864
|
migrations?: DurableObjectMigration[];
|
1865
|
-
containers?:
|
1865
|
+
containers?: ContainerApp[];
|
1866
1866
|
/** The triggers which will cause the worker's exported default handlers to be called. */
|
1867
1867
|
triggers?: Trigger[];
|
1868
1868
|
tailConsumers?: CfTailConsumer[];
|
@@ -1925,7 +1925,7 @@ interface StartDevWorkerInput {
|
|
1925
1925
|
watch?: boolean;
|
1926
1926
|
/** Whether a script tag is inserted on text/html responses which will reload the page upon file changes. Defaults to false. */
|
1927
1927
|
liveReload?: boolean;
|
1928
|
-
/** 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). */
|
1929
1929
|
server?: {
|
1930
1930
|
hostname?: string;
|
1931
1931
|
port?: number;
|
@@ -1951,8 +1951,9 @@ interface StartDevWorkerInput {
|
|
1951
1951
|
imagesLocalMode?: boolean;
|
1952
1952
|
/** Treat this as the primary worker in a multiworker setup (i.e. the first Worker in Miniflare's options) */
|
1953
1953
|
multiworkerPrimary?: boolean;
|
1954
|
-
/** Whether the experimental
|
1955
|
-
|
1954
|
+
/** Whether the experimental remote bindings feature should be enabled */
|
1955
|
+
experimentalRemoteBindings?: boolean;
|
1956
|
+
containerBuildId?: string;
|
1956
1957
|
/** Whether to build and connect to containers during local dev. Requires Docker daemon to be running. Defaults to true. */
|
1957
1958
|
enableContainers?: boolean;
|
1958
1959
|
/** Path to the docker executable. Defaults to 'docker' */
|
@@ -2419,53 +2420,53 @@ interface Unstable_MiniflareWorkerOptions {
|
|
2419
2420
|
}
|
2420
2421
|
declare function unstable_getMiniflareWorkerOptions(configPath: string, env?: string, options?: {
|
2421
2422
|
imagesLocalMode?: boolean;
|
2422
|
-
|
2423
|
-
|
2423
|
+
remoteProxyConnectionString?: RemoteProxyConnectionString;
|
2424
|
+
remoteBindingsEnabled?: boolean;
|
2424
2425
|
overrides?: {
|
2425
2426
|
assets?: Partial<AssetsOptions>;
|
2426
2427
|
};
|
2427
2428
|
}): Unstable_MiniflareWorkerOptions;
|
2428
2429
|
declare function unstable_getMiniflareWorkerOptions(config: Config, env?: string, options?: {
|
2429
2430
|
imagesLocalMode?: boolean;
|
2430
|
-
|
2431
|
-
|
2431
|
+
remoteProxyConnectionString?: RemoteProxyConnectionString;
|
2432
|
+
remoteBindingsEnabled?: boolean;
|
2432
2433
|
overrides?: {
|
2433
2434
|
assets?: Partial<AssetsOptions>;
|
2434
2435
|
};
|
2435
2436
|
}): Unstable_MiniflareWorkerOptions;
|
2436
2437
|
|
2437
|
-
type
|
2438
|
+
type RemoteProxySession = Pick<Worker, "ready" | "dispose"> & {
|
2438
2439
|
updateBindings: (bindings: StartDevWorkerInput["bindings"]) => Promise<void>;
|
2439
|
-
|
2440
|
+
remoteProxyConnectionString: RemoteProxyConnectionString;
|
2440
2441
|
};
|
2441
|
-
type
|
2442
|
+
type StartRemoteProxySessionOptions = {
|
2442
2443
|
workerName?: string;
|
2443
2444
|
auth?: NonNullable<StartDevWorkerInput["dev"]>["auth"];
|
2444
2445
|
/** If running in a non-public compliance region, set this here. */
|
2445
2446
|
complianceRegion?: Config["compliance_region"];
|
2446
2447
|
};
|
2447
|
-
declare function
|
2448
|
+
declare function startRemoteProxySession(bindings: StartDevWorkerInput["bindings"], options?: StartRemoteProxySessionOptions): Promise<RemoteProxySession>;
|
2448
2449
|
declare function pickRemoteBindings(bindings: Record<string, Binding>): Record<string, Binding>;
|
2449
2450
|
/**
|
2450
|
-
* Utility for potentially starting or updating a
|
2451
|
+
* Utility for potentially starting or updating a remote proxy session.
|
2451
2452
|
*
|
2452
|
-
* It uses an internal map for storing existing
|
2453
|
-
* the
|
2453
|
+
* It uses an internal map for storing existing remote proxy session indexed by worker names. If no worker name is provided
|
2454
|
+
* the remote proxy session won't be retrieved nor saved to/from the internal map.
|
2454
2455
|
*
|
2455
2456
|
* @param configPathOrWorkerConfig either a file path to a wrangler configuration file or an object containing the name of
|
2456
2457
|
* the target worker alongside its bindings.
|
2457
|
-
* @param
|
2458
|
-
* @returns null if no existing
|
2459
|
-
* defining any remote bindings), the data associated to the created/updated
|
2458
|
+
* @param preExistingRemoteProxySessionData the data of a pre-existing remote proxy session if there was one null otherwise
|
2459
|
+
* @returns null if no existing remote proxy session was provided and one should not be created (because the worker is not
|
2460
|
+
* defining any remote bindings), the data associated to the created/updated remote proxy session otherwise.
|
2460
2461
|
*/
|
2461
|
-
declare function
|
2462
|
+
declare function maybeStartOrUpdateRemoteProxySession(configPathOrWorkerConfig: string | {
|
2462
2463
|
name?: string;
|
2463
2464
|
bindings: NonNullable<StartDevWorkerInput["bindings"]>;
|
2464
|
-
},
|
2465
|
-
session:
|
2465
|
+
}, preExistingRemoteProxySessionData: {
|
2466
|
+
session: RemoteProxySession;
|
2466
2467
|
remoteBindings: Record<string, Binding>;
|
2467
2468
|
} | null): Promise<{
|
2468
|
-
session:
|
2469
|
+
session: RemoteProxySession;
|
2469
2470
|
remoteBindings: Record<string, Binding>;
|
2470
2471
|
} | null>;
|
2471
2472
|
|
@@ -2524,4 +2525,4 @@ interface Unstable_ASSETSBindingsOptions {
|
|
2524
2525
|
}
|
2525
2526
|
declare const generateASSETSBinding: (opts: Unstable_ASSETSBindingsOptions) => (request: Request) => Promise<Response$1>;
|
2526
2527
|
|
2527
|
-
export { type ConfigBindingOptions as Experimental_ConfigBindingOptions, type
|
2528
|
+
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 };
|