@cloudflare/vite-plugin 1.53.1 → 1.54.1
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/dist/experimental-config.d.mts +85 -65
- package/dist/experimental-config.d.mts.map +1 -1
- package/dist/index.mjs +273 -144
- package/dist/index.mjs.map +1 -1
- package/dist/{package-lfy4Z5C1.mjs → package-C9YPmEf_.mjs} +2 -2
- package/dist/{package-lfy4Z5C1.mjs.map → package-C9YPmEf_.mjs.map} +1 -1
- package/package.json +12 -12
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Pipeline, PipelineRecord } from "cloudflare:pipelines";
|
|
2
2
|
|
|
3
|
-
//#region ../config/dist/public-
|
|
3
|
+
//#region ../config/dist/public-C3uXDKsB.d.mts
|
|
4
4
|
|
|
5
5
|
//#region src/utils.d.ts
|
|
6
6
|
/**
|
|
@@ -11,11 +11,16 @@ type Json = string | number | boolean | null | Json[] | {
|
|
|
11
11
|
};
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/bindings.d.ts
|
|
14
|
+
/** Options that control a binding during local development. */
|
|
15
|
+
interface BindingDevOptions {
|
|
16
|
+
/** Whether the binding should connect to the remote resource. */
|
|
17
|
+
remote?: boolean;
|
|
18
|
+
}
|
|
14
19
|
interface AgentMemoryBindingOptions {
|
|
15
20
|
/** The user-chosen namespace name. Must exist in Cloudflare at deploy time. */
|
|
16
21
|
namespace: string;
|
|
17
|
-
/**
|
|
18
|
-
|
|
22
|
+
/** Options that only apply during local development. */
|
|
23
|
+
dev?: BindingDevOptions;
|
|
19
24
|
}
|
|
20
25
|
/**
|
|
21
26
|
* Agent Memory namespace binding. Each binding is scoped to a namespace and
|
|
@@ -25,8 +30,8 @@ interface AgentMemoryBinding extends AgentMemoryBindingOptions {
|
|
|
25
30
|
type: "agent-memory";
|
|
26
31
|
}
|
|
27
32
|
interface AiBindingOptions {
|
|
28
|
-
/**
|
|
29
|
-
|
|
33
|
+
/** Options that only apply during local development. */
|
|
34
|
+
dev?: BindingDevOptions;
|
|
30
35
|
}
|
|
31
36
|
/**
|
|
32
37
|
* Binding to the Workers AI project.
|
|
@@ -48,8 +53,8 @@ interface TypedAiBinding<TAiModelList extends AiModelListType = AiModels> extend
|
|
|
48
53
|
interface AiSearchBindingOptions {
|
|
49
54
|
/** The user-chosen instance name. Must exist in Cloudflare at deploy time. */
|
|
50
55
|
name: string;
|
|
51
|
-
/**
|
|
52
|
-
|
|
56
|
+
/** Options that only apply during local development. */
|
|
57
|
+
dev?: BindingDevOptions;
|
|
53
58
|
}
|
|
54
59
|
/**
|
|
55
60
|
* AI Search instance binding. Each binding is bound directly to a single
|
|
@@ -61,8 +66,8 @@ interface AiSearchBinding extends AiSearchBindingOptions {
|
|
|
61
66
|
interface AiSearchNamespaceBindingOptions {
|
|
62
67
|
/** The user-chosen namespace name. Must exist in Cloudflare at deploy time. */
|
|
63
68
|
namespace: string;
|
|
64
|
-
/**
|
|
65
|
-
|
|
69
|
+
/** Options that only apply during local development. */
|
|
70
|
+
dev?: BindingDevOptions;
|
|
66
71
|
}
|
|
67
72
|
/**
|
|
68
73
|
* AI Search namespace binding. Each binding is scoped to a namespace and
|
|
@@ -86,8 +91,8 @@ interface AnalyticsEngineDatasetBinding extends AnalyticsEngineDatasetBindingOpt
|
|
|
86
91
|
interface ArtifactsBindingOptions {
|
|
87
92
|
/** The namespace to use. */
|
|
88
93
|
namespace: string;
|
|
89
|
-
/**
|
|
90
|
-
|
|
94
|
+
/** Options that only apply during local development. */
|
|
95
|
+
dev?: BindingDevOptions;
|
|
91
96
|
}
|
|
92
97
|
/**
|
|
93
98
|
* Binding to an Artifacts instance. Artifacts provides git-compatible file
|
|
@@ -105,8 +110,8 @@ interface AssetsBinding {
|
|
|
105
110
|
type: "assets";
|
|
106
111
|
}
|
|
107
112
|
interface BrowserBindingOptions {
|
|
108
|
-
/**
|
|
109
|
-
|
|
113
|
+
/** Options that only apply during local development. */
|
|
114
|
+
dev?: BindingDevOptions;
|
|
110
115
|
}
|
|
111
116
|
/**
|
|
112
117
|
* Binding to a headless browser usable from the Worker.
|
|
@@ -121,8 +126,8 @@ interface D1BindingOptions {
|
|
|
121
126
|
id?: string;
|
|
122
127
|
/** The name of this D1 database. */
|
|
123
128
|
name?: string;
|
|
124
|
-
/**
|
|
125
|
-
|
|
129
|
+
/** Options that only apply during local development. */
|
|
130
|
+
dev?: BindingDevOptions;
|
|
126
131
|
}
|
|
127
132
|
/**
|
|
128
133
|
* Binding to a D1 database.
|
|
@@ -142,8 +147,8 @@ interface DispatchNamespaceBindingOptions {
|
|
|
142
147
|
/** (Optional) List of parameter names, for sending context from your dispatch Worker to the outbound handler. */
|
|
143
148
|
parameters?: string[];
|
|
144
149
|
};
|
|
145
|
-
/**
|
|
146
|
-
|
|
150
|
+
/** Options that only apply during local development. */
|
|
151
|
+
dev?: BindingDevOptions;
|
|
147
152
|
}
|
|
148
153
|
/**
|
|
149
154
|
* Binding to a Workers for Platforms dispatch namespace.
|
|
@@ -183,8 +188,8 @@ interface TypedDurableObjectBinding<TConfig$1, TExportName$1 extends string> ext
|
|
|
183
188
|
interface FlagshipBindingOptions {
|
|
184
189
|
/** The Flagship app ID to bind to. */
|
|
185
190
|
id?: string;
|
|
186
|
-
/**
|
|
187
|
-
|
|
191
|
+
/** Options that only apply during local development. */
|
|
192
|
+
dev?: BindingDevOptions;
|
|
188
193
|
}
|
|
189
194
|
/** Binding to a Flagship feature-flag service. */
|
|
190
195
|
interface FlagshipBinding extends FlagshipBindingOptions {
|
|
@@ -193,8 +198,11 @@ interface FlagshipBinding extends FlagshipBindingOptions {
|
|
|
193
198
|
interface HyperdriveBindingOptions {
|
|
194
199
|
/** The ID of the Hyperdrive configuration. */
|
|
195
200
|
id: string;
|
|
196
|
-
/**
|
|
197
|
-
|
|
201
|
+
/** Options that only apply during local development. */
|
|
202
|
+
dev?: {
|
|
203
|
+
/** The database connection string used during local development. */
|
|
204
|
+
connectionString?: string;
|
|
205
|
+
};
|
|
198
206
|
}
|
|
199
207
|
/**
|
|
200
208
|
* Binding to a Hyperdrive configuration.
|
|
@@ -205,8 +213,8 @@ interface HyperdriveBinding extends HyperdriveBindingOptions {
|
|
|
205
213
|
type: "hyperdrive";
|
|
206
214
|
}
|
|
207
215
|
interface ImagesBindingOptions {
|
|
208
|
-
/**
|
|
209
|
-
|
|
216
|
+
/** Options that only apply during local development. */
|
|
217
|
+
dev?: BindingDevOptions;
|
|
210
218
|
}
|
|
211
219
|
/**
|
|
212
220
|
* Binding to Cloudflare Images.
|
|
@@ -228,8 +236,8 @@ interface JsonBinding<T$1 extends Json = Json> {
|
|
|
228
236
|
interface KvBindingOptions {
|
|
229
237
|
/** The ID of the KV namespace. */
|
|
230
238
|
id?: string;
|
|
231
|
-
/**
|
|
232
|
-
|
|
239
|
+
/** Options that only apply during local development. */
|
|
240
|
+
dev?: BindingDevOptions;
|
|
233
241
|
}
|
|
234
242
|
/**
|
|
235
243
|
* Binding to a Workers KV namespace.
|
|
@@ -257,8 +265,8 @@ interface LogfwdrBinding extends LogfwdrBindingOptions {
|
|
|
257
265
|
type: "logfwdr";
|
|
258
266
|
}
|
|
259
267
|
interface MediaBindingOptions {
|
|
260
|
-
/**
|
|
261
|
-
|
|
268
|
+
/** Options that only apply during local development. */
|
|
269
|
+
dev?: BindingDevOptions;
|
|
262
270
|
}
|
|
263
271
|
/** Binding to Cloudflare Media Transformations. */
|
|
264
272
|
interface MediaBinding$1 extends MediaBindingOptions {
|
|
@@ -267,8 +275,8 @@ interface MediaBinding$1 extends MediaBindingOptions {
|
|
|
267
275
|
interface MtlsCertificateBindingOptions {
|
|
268
276
|
/** The UUID of the uploaded mTLS certificate. */
|
|
269
277
|
id: string;
|
|
270
|
-
/**
|
|
271
|
-
|
|
278
|
+
/** Options that only apply during local development. */
|
|
279
|
+
dev?: BindingDevOptions;
|
|
272
280
|
}
|
|
273
281
|
/**
|
|
274
282
|
* Binding to an uploaded mTLS certificate.
|
|
@@ -281,8 +289,8 @@ interface MtlsCertificateBinding extends MtlsCertificateBindingOptions {
|
|
|
281
289
|
interface PipelineBindingOptions {
|
|
282
290
|
/** Name of the Pipeline to bind. */
|
|
283
291
|
name: string;
|
|
284
|
-
/**
|
|
285
|
-
|
|
292
|
+
/** Options that only apply during local development. */
|
|
293
|
+
dev?: BindingDevOptions;
|
|
286
294
|
}
|
|
287
295
|
/** Binding to a Cloudflare Pipeline. */
|
|
288
296
|
interface PipelineBinding extends PipelineBindingOptions {
|
|
@@ -298,8 +306,8 @@ interface QueueBindingOptions {
|
|
|
298
306
|
name?: string;
|
|
299
307
|
/** The number of seconds to wait before delivering a message. */
|
|
300
308
|
deliveryDelay?: number;
|
|
301
|
-
/**
|
|
302
|
-
|
|
309
|
+
/** Options that only apply during local development. */
|
|
310
|
+
dev?: BindingDevOptions;
|
|
303
311
|
}
|
|
304
312
|
/**
|
|
305
313
|
* Producer binding to a Cloudflare Queue.
|
|
@@ -323,10 +331,8 @@ interface R2BindingOptions {
|
|
|
323
331
|
name?: string;
|
|
324
332
|
/** The jurisdiction that the bucket exists in. Default if not present. */
|
|
325
333
|
jurisdiction?: string;
|
|
326
|
-
/** Whether the R2 bucket should be remote or not in local development. */
|
|
327
|
-
remote?: boolean;
|
|
328
334
|
/** Settings that only apply to local development. */
|
|
329
|
-
|
|
335
|
+
dev?: BindingDevOptions & {
|
|
330
336
|
/** EXPERIMENTAL: credentials for the local S3-compatible endpoint. */
|
|
331
337
|
experimentalS3Credentials?: {
|
|
332
338
|
accessKeyId: string;
|
|
@@ -380,27 +386,35 @@ interface SecretsStoreSecretBindingOptions {
|
|
|
380
386
|
interface SecretsStoreSecretBinding extends SecretsStoreSecretBindingOptions {
|
|
381
387
|
type: "secrets-store-secret";
|
|
382
388
|
}
|
|
383
|
-
|
|
389
|
+
type SendEmailDestinationOptions = {
|
|
384
390
|
/** If this binding should be restricted to a specific verified address. */
|
|
385
|
-
destinationAddress
|
|
391
|
+
destinationAddress: string;
|
|
392
|
+
allowedDestinationAddresses?: never;
|
|
393
|
+
} | {
|
|
394
|
+
destinationAddress?: never;
|
|
386
395
|
/** If this binding should be restricted to a set of verified addresses. */
|
|
387
|
-
allowedDestinationAddresses
|
|
396
|
+
allowedDestinationAddresses: string[];
|
|
397
|
+
} | {
|
|
398
|
+
destinationAddress?: never;
|
|
399
|
+
allowedDestinationAddresses?: never;
|
|
400
|
+
};
|
|
401
|
+
type SendEmailBindingOptions = SendEmailDestinationOptions & {
|
|
388
402
|
/** If this binding should be restricted to a set of sender addresses. */
|
|
389
403
|
allowedSenderAddresses?: string[];
|
|
390
|
-
/**
|
|
391
|
-
|
|
392
|
-
}
|
|
404
|
+
/** Options that only apply during local development. */
|
|
405
|
+
dev?: BindingDevOptions;
|
|
406
|
+
};
|
|
393
407
|
/**
|
|
394
408
|
* Binding for sending email from inside the Worker.
|
|
395
409
|
*
|
|
396
410
|
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#email-bindings
|
|
397
411
|
*/
|
|
398
|
-
|
|
412
|
+
type SendEmailBinding = SendEmailBindingOptions & {
|
|
399
413
|
type: "send-email";
|
|
400
|
-
}
|
|
414
|
+
};
|
|
401
415
|
interface StreamBindingOptions {
|
|
402
|
-
/**
|
|
403
|
-
|
|
416
|
+
/** Options that only apply during local development. */
|
|
417
|
+
dev?: BindingDevOptions;
|
|
404
418
|
}
|
|
405
419
|
/** Binding to Cloudflare Stream. */
|
|
406
420
|
interface StreamBinding$1 extends StreamBindingOptions {
|
|
@@ -441,8 +455,8 @@ interface UnsafeBinding extends UnsafeBindingOptions {
|
|
|
441
455
|
interface VectorizeBindingOptions {
|
|
442
456
|
/** The name of the Vectorize index. */
|
|
443
457
|
name: string;
|
|
444
|
-
/**
|
|
445
|
-
|
|
458
|
+
/** Options that only apply during local development. */
|
|
459
|
+
dev?: BindingDevOptions;
|
|
446
460
|
}
|
|
447
461
|
/**
|
|
448
462
|
* Binding to a Vectorize index.
|
|
@@ -459,13 +473,15 @@ interface VersionMetadataBinding {
|
|
|
459
473
|
type VpcNetworkBindingOptions = {
|
|
460
474
|
/** The tunnel ID of the Cloudflare Tunnel to route traffic through. Mutually exclusive with `networkId`. */
|
|
461
475
|
tunnelId: string;
|
|
462
|
-
|
|
463
|
-
|
|
476
|
+
networkId?: never;
|
|
477
|
+
/** Options that only apply during local development. */
|
|
478
|
+
dev?: BindingDevOptions;
|
|
464
479
|
} | {
|
|
480
|
+
tunnelId?: never;
|
|
465
481
|
/** The network ID to route traffic through. Mutually exclusive with `tunnelId`. */
|
|
466
482
|
networkId: string;
|
|
467
|
-
/**
|
|
468
|
-
|
|
483
|
+
/** Options that only apply during local development. */
|
|
484
|
+
dev?: BindingDevOptions;
|
|
469
485
|
};
|
|
470
486
|
/** Binding to a VPC network. */
|
|
471
487
|
type VpcNetworkBinding = VpcNetworkBindingOptions & {
|
|
@@ -474,16 +490,16 @@ type VpcNetworkBinding = VpcNetworkBindingOptions & {
|
|
|
474
490
|
interface VpcServiceBindingOptions {
|
|
475
491
|
/** The service ID of the VPC connectivity service. */
|
|
476
492
|
id: string;
|
|
477
|
-
/**
|
|
478
|
-
|
|
493
|
+
/** Options that only apply during local development. */
|
|
494
|
+
dev?: BindingDevOptions;
|
|
479
495
|
}
|
|
480
496
|
/** Binding to a VPC service. */
|
|
481
497
|
interface VpcServiceBinding extends VpcServiceBindingOptions {
|
|
482
498
|
type: "vpc-service";
|
|
483
499
|
}
|
|
484
500
|
interface WebSearchBindingOptions {
|
|
485
|
-
/**
|
|
486
|
-
|
|
501
|
+
/** Options that only apply during local development. */
|
|
502
|
+
dev?: BindingDevOptions;
|
|
487
503
|
}
|
|
488
504
|
/**
|
|
489
505
|
* Cloudflare Web Search binding. There is exactly one shared web corpus, so
|
|
@@ -499,8 +515,8 @@ interface WorkerBindingOptions {
|
|
|
499
515
|
exportName?: string;
|
|
500
516
|
/** Optional properties that will be made available to the service via `ctx.props`. */
|
|
501
517
|
props?: Record<string, unknown>;
|
|
502
|
-
/**
|
|
503
|
-
|
|
518
|
+
/** Options that only apply during local development. */
|
|
519
|
+
dev?: BindingDevOptions;
|
|
504
520
|
}
|
|
505
521
|
/**
|
|
506
522
|
* Service binding (Worker-to-Worker). `workerName` is the name of the bound
|
|
@@ -1416,7 +1432,7 @@ interface TypedWorkerDefinition<TConfig$1 extends WorkerConfig, TWorkerName exte
|
|
|
1416
1432
|
workerName: TWorkerName;
|
|
1417
1433
|
exportName?: TExportName$1;
|
|
1418
1434
|
props?: Record<string, unknown>;
|
|
1419
|
-
|
|
1435
|
+
dev?: BindingDevOptions;
|
|
1420
1436
|
}): TypedWorkerBinding<TConfig$1, TExportName$1 extends string ? TExportName$1 : "default">;
|
|
1421
1437
|
}
|
|
1422
1438
|
type WorkerConfigExport<T$1 extends WorkerConfig = WorkerConfig> = ConfigInput<T$1>;
|
|
@@ -1645,16 +1661,20 @@ type InferMainModule<TUnwrappedConfig$1> = TUnwrappedConfig$1 extends {
|
|
|
1645
1661
|
*/
|
|
1646
1662
|
type SettingsConfigInput = Omit<SettingsConfig, "type">;
|
|
1647
1663
|
/**
|
|
1648
|
-
*
|
|
1649
|
-
* Authored as a named `settings` export.
|
|
1664
|
+
* A settings definition created by {@link defineSettings}.
|
|
1650
1665
|
*/
|
|
1651
|
-
|
|
1666
|
+
interface SettingsDefinition {
|
|
1652
1667
|
[DEFINITION]: {
|
|
1653
1668
|
config: ConfigInput<SettingsConfigInput>;
|
|
1654
|
-
type:
|
|
1669
|
+
type: "settings";
|
|
1655
1670
|
};
|
|
1656
|
-
}
|
|
1671
|
+
}
|
|
1672
|
+
/**
|
|
1673
|
+
* Declare shared settings.
|
|
1674
|
+
* Authored as a named `settings` export.
|
|
1675
|
+
*/
|
|
1676
|
+
declare function defineSettings(config: ConfigInput<SettingsConfigInput>): SettingsDefinition;
|
|
1657
1677
|
//#endregion
|
|
1658
1678
|
//#endregion
|
|
1659
|
-
export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, ArtifactsBinding, AssetsBinding, Bindings, BrowserBinding, ConfigContext, ConnectTrigger, D1Binding, DispatchNamespaceBinding, DurableObjectBinding, DurableObjectCreatedExport, DurableObjectDeletedExport, DurableObjectExpectingTransferExport, DurableObjectRenamedExport, DurableObjectTransferredExport, EmailTrigger, Exports, FetchTrigger, FlagshipBinding, HyperdriveBinding, ImagesBinding$1 as ImagesBinding, InferDurableNamespaces, InferEnv, InferMainModule, JsonBinding, KvBinding, LogfwdrBinding, MediaBinding$1 as MediaBinding, MtlsCertificateBinding, PipelineBinding, QueueBinding, QueueConsumerTrigger, R2Binding, RateLimitBinding, ScheduledTrigger, SecretBinding, SecretsStoreSecretBinding, SendEmailBinding, SettingsConfig, SettingsConfigInput, StreamBinding$1 as StreamBinding, TextBinding, Triggers, TypedAiBinding, TypedDurableObjectBinding, TypedKvBinding, TypedPipelineBinding, TypedQueueBinding, TypedWorkerBinding, TypedWorkerDefinition, TypedWorkflowBinding, UnsafeBinding, UnwrapConfig, VectorizeBinding, VersionMetadataBinding, VpcNetworkBinding, VpcServiceBinding, WebSearchBinding, WorkerBinding, WorkerConfig, WorkerConfigExport, WorkerConfigInput, WorkerEntrypointExport, WorkerEntrypointExportOptions, WorkerLoaderBinding, WorkflowBinding, bindings, defineSettings, defineWorker, exports, triggers };
|
|
1679
|
+
export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, ArtifactsBinding, AssetsBinding, BindingDevOptions, Bindings, BrowserBinding, ConfigContext, ConnectTrigger, D1Binding, DispatchNamespaceBinding, DurableObjectBinding, DurableObjectCreatedExport, DurableObjectDeletedExport, DurableObjectExpectingTransferExport, DurableObjectRenamedExport, DurableObjectTransferredExport, EmailTrigger, Exports, FetchTrigger, FlagshipBinding, HyperdriveBinding, ImagesBinding$1 as ImagesBinding, InferDurableNamespaces, InferEnv, InferMainModule, JsonBinding, KvBinding, LogfwdrBinding, MediaBinding$1 as MediaBinding, MtlsCertificateBinding, PipelineBinding, QueueBinding, QueueConsumerTrigger, R2Binding, RateLimitBinding, ScheduledTrigger, SecretBinding, SecretsStoreSecretBinding, SendEmailBinding, SettingsConfig, SettingsConfigInput, SettingsDefinition, StreamBinding$1 as StreamBinding, TextBinding, Triggers, TypedAiBinding, TypedDurableObjectBinding, TypedKvBinding, TypedPipelineBinding, TypedQueueBinding, TypedWorkerBinding, TypedWorkerDefinition, TypedWorkflowBinding, UnsafeBinding, UnwrapConfig, VectorizeBinding, VersionMetadataBinding, VpcNetworkBinding, VpcServiceBinding, WebSearchBinding, WorkerBinding, WorkerConfig, WorkerConfigExport, WorkerConfigInput, WorkerEntrypointExport, WorkerEntrypointExportOptions, WorkerLoaderBinding, WorkflowBinding, bindings, defineSettings, defineWorker, exports, triggers };
|
|
1660
1680
|
//# sourceMappingURL=experimental-config.d.mts.map
|