@cloudflare/config 0.2.1 → 0.3.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/dist/index.d.mts +223 -22
- package/dist/index.mjs +116 -25
- package/dist/{public-mmLmXmLK.mjs → public-D2QZv1n6.mjs} +46 -6
- package/dist/{public-m7PNfSwY.d.mts → public-myuV_kLK.d.mts} +107 -42
- package/dist/public.d.mts +2 -2
- package/dist/public.mjs +2 -2
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as RateLimitBinding, A as AgentMemoryBinding, B as DispatchNamespaceBinding, C as exports, D as ScheduledTrigger, E as QueueConsumerTrigger, F as ArtifactsBinding, G as JsonBinding, H as FlagshipBinding, I as AssetsBinding, J as MediaBinding, K as KvBinding, L as Bindings, M as AiSearchBinding, N as AiSearchNamespaceBinding, O as Triggers, P as AnalyticsEngineDatasetBinding, Q as R2Binding, R as BrowserBinding, S as WorkerEntrypointExportOptions, T as FetchTrigger, U as HyperdriveBinding, V as DurableObjectBinding, W as ImagesBinding, X as PipelineBinding, Y as MtlsCertificateBinding, Z as QueueBinding, _ as DurableObjectExpectingTransferExport, _t as WebSearchBinding, a as InferMainModule, at as TypedAiBinding, b as Exports, bt as WorkflowBinding, c as WorkerConfigExport, ct as TypedPipelineBinding, d as SettingsConfig, dt as TypedWorkflowBinding, et as SecretBinding, f as WorkerConfig, ft as UnsafeBinding, g as DurableObjectDeletedExport, gt as VpcServiceBinding, h as DurableObjectCreatedExport, ht as VpcNetworkBinding, i as InferEnv, it as TextBinding, j as AiBinding, k as triggers, l as WorkerConfigInput, lt as TypedQueueBinding, m as resolveExportDefinition, mt as VersionMetadataBinding, n as defineSettings, nt as SendEmailBinding, o as UnwrapConfig, ot as TypedDurableObjectBinding, p as ConfigContext, pt as VectorizeBinding, q as LogfwdrBinding, r as InferDurableNamespaces, rt as StreamBinding, s as TypedWorkerDefinition, st as TypedKvBinding, t as SettingsConfigInput, tt as SecretsStoreSecretBinding, u as defineWorker, ut as TypedWorkerBinding, v as DurableObjectRenamedExport, vt as WorkerBinding, w as EmailTrigger, x as WorkerEntrypointExport, xt as bindings, y as DurableObjectTransferredExport, yt as WorkerLoaderBinding, z as D1Binding } from "./public-myuV_kLK.mjs";
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
import { RawConfig } from "@cloudflare/workers-utils";
|
|
4
4
|
|
|
@@ -37,7 +37,7 @@ declare const KnownBindingSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
37
37
|
remote: z.ZodOptional<z.ZodBoolean>;
|
|
38
38
|
}, z.core.$strict>, z.ZodObject<{
|
|
39
39
|
type: z.ZodLiteral<"dispatch-namespace">;
|
|
40
|
-
namespace: z.ZodString
|
|
40
|
+
namespace: z.ZodOptional<z.ZodString>;
|
|
41
41
|
outbound: z.ZodOptional<z.ZodObject<{
|
|
42
42
|
workerName: z.ZodString;
|
|
43
43
|
parameters: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -49,7 +49,7 @@ declare const KnownBindingSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
49
49
|
exportName: z.ZodString;
|
|
50
50
|
}, z.core.$strict>, z.ZodObject<{
|
|
51
51
|
type: z.ZodLiteral<"flagship">;
|
|
52
|
-
id: z.ZodString
|
|
52
|
+
id: z.ZodOptional<z.ZodString>;
|
|
53
53
|
remote: z.ZodOptional<z.ZodBoolean>;
|
|
54
54
|
}, z.core.$strict>, z.ZodObject<{
|
|
55
55
|
type: z.ZodLiteral<"hyperdrive">;
|
|
@@ -81,7 +81,7 @@ declare const KnownBindingSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
81
81
|
remote: z.ZodOptional<z.ZodBoolean>;
|
|
82
82
|
}, z.core.$strict>, z.ZodObject<{
|
|
83
83
|
type: z.ZodLiteral<"queue">;
|
|
84
|
-
name: z.ZodString
|
|
84
|
+
name: z.ZodOptional<z.ZodString>;
|
|
85
85
|
deliveryDelay: z.ZodOptional<z.ZodNumber>;
|
|
86
86
|
remote: z.ZodOptional<z.ZodBoolean>;
|
|
87
87
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -159,8 +159,8 @@ type BindingOutput = z.output<typeof KnownBindingSchema> | z.output<typeof Unsaf
|
|
|
159
159
|
* base schema.
|
|
160
160
|
*/
|
|
161
161
|
declare const InputWorkerSchema: z.ZodObject<{
|
|
162
|
+
type: z.ZodLiteral<"worker">;
|
|
162
163
|
name: z.ZodString;
|
|
163
|
-
accountId: z.ZodOptional<z.ZodString>;
|
|
164
164
|
compatibilityDate: z.ZodString;
|
|
165
165
|
compatibilityFlags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
166
166
|
assets: z.ZodOptional<z.ZodObject<{
|
|
@@ -247,10 +247,168 @@ declare const InputWorkerSchema: z.ZodObject<{
|
|
|
247
247
|
}, z.core.$strict>>;
|
|
248
248
|
workersDev: z.ZodOptional<z.ZodBoolean>;
|
|
249
249
|
previewUrls: z.ZodOptional<z.ZodBoolean>;
|
|
250
|
+
firstPartyWorker: z.ZodOptional<z.ZodBoolean>;
|
|
251
|
+
unsafe: z.ZodOptional<z.ZodObject<{
|
|
252
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
253
|
+
capnp: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
254
|
+
basePath: z.ZodString;
|
|
255
|
+
sourceSchemas: z.ZodArray<z.ZodString>;
|
|
256
|
+
compiledSchema: z.ZodOptional<z.ZodNever>;
|
|
257
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
258
|
+
basePath: z.ZodOptional<z.ZodNever>;
|
|
259
|
+
sourceSchemas: z.ZodOptional<z.ZodNever>;
|
|
260
|
+
compiledSchema: z.ZodString;
|
|
261
|
+
}, z.core.$strict>]>>;
|
|
262
|
+
}, z.core.$strict>>;
|
|
263
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<BindingOutput, BindingInput, z.core.$ZodTypeInternals<BindingOutput, BindingInput>>>>;
|
|
264
|
+
exports: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
265
|
+
type: z.ZodLiteral<"durable-object">;
|
|
266
|
+
state: z.ZodOptional<z.ZodLiteral<"created">>;
|
|
267
|
+
storage: z.ZodEnum<{
|
|
268
|
+
sqlite: "sqlite";
|
|
269
|
+
"legacy-kv": "legacy-kv";
|
|
270
|
+
}>;
|
|
271
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
272
|
+
type: z.ZodLiteral<"durable-object">;
|
|
273
|
+
state: z.ZodLiteral<"deleted">;
|
|
274
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
275
|
+
type: z.ZodLiteral<"durable-object">;
|
|
276
|
+
state: z.ZodLiteral<"renamed">;
|
|
277
|
+
renamedTo: z.ZodString;
|
|
278
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
279
|
+
type: z.ZodLiteral<"durable-object">;
|
|
280
|
+
state: z.ZodLiteral<"transferred">;
|
|
281
|
+
transferredTo: z.ZodString;
|
|
282
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
283
|
+
type: z.ZodLiteral<"durable-object">;
|
|
284
|
+
state: z.ZodLiteral<"expecting-transfer">;
|
|
285
|
+
storage: z.ZodEnum<{
|
|
286
|
+
sqlite: "sqlite";
|
|
287
|
+
"legacy-kv": "legacy-kv";
|
|
288
|
+
}>;
|
|
289
|
+
transferFrom: z.ZodString;
|
|
290
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
291
|
+
type: z.ZodLiteral<"worker">;
|
|
292
|
+
cache: z.ZodOptional<z.ZodObject<{
|
|
293
|
+
enabled: z.ZodBoolean;
|
|
294
|
+
}, z.core.$strict>>;
|
|
295
|
+
}, z.core.$strict>]>>>;
|
|
296
|
+
entrypoint: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
297
|
+
default: z.ZodString;
|
|
298
|
+
}, z.core.$strict>]>, z.ZodTransform<string, string | {
|
|
299
|
+
default: string;
|
|
300
|
+
}>>>;
|
|
301
|
+
}, z.core.$strict>;
|
|
302
|
+
type ParsedInputWorkerConfig = z.output<typeof InputWorkerSchema>;
|
|
303
|
+
/**
|
|
304
|
+
* Settings schema — validates the named `settings` export of a
|
|
305
|
+
* `cloudflare.config.ts`. Holds account/deployment settings shared by the other exports.
|
|
306
|
+
*/
|
|
307
|
+
declare const SettingsSchema: z.ZodObject<{
|
|
308
|
+
type: z.ZodLiteral<"settings">;
|
|
309
|
+
accountId: z.ZodOptional<z.ZodString>;
|
|
250
310
|
complianceRegion: z.ZodOptional<z.ZodEnum<{
|
|
251
311
|
public: "public";
|
|
252
312
|
"fedramp-high": "fedramp-high";
|
|
253
313
|
}>>;
|
|
314
|
+
}, z.core.$strict>;
|
|
315
|
+
type ParsedSettingsConfig = z.output<typeof SettingsSchema>;
|
|
316
|
+
/**
|
|
317
|
+
* Schema for the resolved config exports, keyed by export
|
|
318
|
+
* name. Each value is discriminated on its `type` field. Reserves the
|
|
319
|
+
* `settings` export name exclusively for settings configs: a `settings`
|
|
320
|
+
* config must live on the `settings` export, and the `settings` export
|
|
321
|
+
* may only hold a `settings` config.
|
|
322
|
+
*/
|
|
323
|
+
declare const ConfigExportsSchema: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
324
|
+
type: z.ZodLiteral<"worker">;
|
|
325
|
+
name: z.ZodString;
|
|
326
|
+
compatibilityDate: z.ZodString;
|
|
327
|
+
compatibilityFlags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
328
|
+
assets: z.ZodOptional<z.ZodObject<{
|
|
329
|
+
htmlHandling: z.ZodOptional<z.ZodEnum<{
|
|
330
|
+
"auto-trailing-slash": "auto-trailing-slash";
|
|
331
|
+
"drop-trailing-slash": "drop-trailing-slash";
|
|
332
|
+
"force-trailing-slash": "force-trailing-slash";
|
|
333
|
+
none: "none";
|
|
334
|
+
}>>;
|
|
335
|
+
notFoundHandling: z.ZodOptional<z.ZodEnum<{
|
|
336
|
+
none: "none";
|
|
337
|
+
"single-page-application": "single-page-application";
|
|
338
|
+
"404-page": "404-page";
|
|
339
|
+
}>>;
|
|
340
|
+
runWorkerFirst: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodBoolean]>>;
|
|
341
|
+
}, z.core.$strict>>;
|
|
342
|
+
domains: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
343
|
+
triggers: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
344
|
+
type: z.ZodLiteral<"email">;
|
|
345
|
+
addresses: z.ZodArray<z.ZodString>;
|
|
346
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
347
|
+
type: z.ZodLiteral<"fetch">;
|
|
348
|
+
pattern: z.ZodString;
|
|
349
|
+
zone: z.ZodOptional<z.ZodString>;
|
|
350
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
351
|
+
type: z.ZodLiteral<"queue">;
|
|
352
|
+
name: z.ZodString;
|
|
353
|
+
deadLetterQueue: z.ZodOptional<z.ZodString>;
|
|
354
|
+
maxBatchSize: z.ZodOptional<z.ZodNumber>;
|
|
355
|
+
maxBatchTimeout: z.ZodOptional<z.ZodNumber>;
|
|
356
|
+
maxConcurrency: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
357
|
+
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
358
|
+
retryDelay: z.ZodOptional<z.ZodNumber>;
|
|
359
|
+
visibilityTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
360
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
361
|
+
type: z.ZodLiteral<"scheduled">;
|
|
362
|
+
schedule: z.ZodString;
|
|
363
|
+
}, z.core.$strict>], "type">>>;
|
|
364
|
+
tailConsumers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
365
|
+
workerName: z.ZodString;
|
|
366
|
+
streaming: z.ZodOptional<z.ZodBoolean>;
|
|
367
|
+
}, z.core.$strict>>>;
|
|
368
|
+
cache: z.ZodOptional<z.ZodObject<{
|
|
369
|
+
enabled: z.ZodBoolean;
|
|
370
|
+
crossVersionCache: z.ZodOptional<z.ZodBoolean>;
|
|
371
|
+
}, z.core.$strict>>;
|
|
372
|
+
placement: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
373
|
+
mode: z.ZodEnum<{
|
|
374
|
+
off: "off";
|
|
375
|
+
smart: "smart";
|
|
376
|
+
}>;
|
|
377
|
+
hint: z.ZodOptional<z.ZodString>;
|
|
378
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
379
|
+
mode: z.ZodOptional<z.ZodLiteral<"targeted">>;
|
|
380
|
+
region: z.ZodString;
|
|
381
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
382
|
+
mode: z.ZodOptional<z.ZodLiteral<"targeted">>;
|
|
383
|
+
host: z.ZodString;
|
|
384
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
385
|
+
mode: z.ZodOptional<z.ZodLiteral<"targeted">>;
|
|
386
|
+
hostname: z.ZodString;
|
|
387
|
+
}, z.core.$strict>]>>;
|
|
388
|
+
limits: z.ZodOptional<z.ZodObject<{
|
|
389
|
+
cpuMs: z.ZodOptional<z.ZodNumber>;
|
|
390
|
+
subrequests: z.ZodOptional<z.ZodNumber>;
|
|
391
|
+
}, z.core.$strict>>;
|
|
392
|
+
logpush: z.ZodOptional<z.ZodBoolean>;
|
|
393
|
+
observability: z.ZodOptional<z.ZodObject<{
|
|
394
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
395
|
+
headSamplingRate: z.ZodOptional<z.ZodNumber>;
|
|
396
|
+
logs: z.ZodOptional<z.ZodObject<{
|
|
397
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
398
|
+
headSamplingRate: z.ZodOptional<z.ZodNumber>;
|
|
399
|
+
invocationLogs: z.ZodOptional<z.ZodBoolean>;
|
|
400
|
+
persist: z.ZodOptional<z.ZodBoolean>;
|
|
401
|
+
destinations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
402
|
+
}, z.core.$strict>>;
|
|
403
|
+
traces: z.ZodOptional<z.ZodObject<{
|
|
404
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
405
|
+
headSamplingRate: z.ZodOptional<z.ZodNumber>;
|
|
406
|
+
persist: z.ZodOptional<z.ZodBoolean>;
|
|
407
|
+
destinations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
408
|
+
}, z.core.$strict>>;
|
|
409
|
+
}, z.core.$strict>>;
|
|
410
|
+
workersDev: z.ZodOptional<z.ZodBoolean>;
|
|
411
|
+
previewUrls: z.ZodOptional<z.ZodBoolean>;
|
|
254
412
|
firstPartyWorker: z.ZodOptional<z.ZodBoolean>;
|
|
255
413
|
unsafe: z.ZodOptional<z.ZodObject<{
|
|
256
414
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -302,8 +460,15 @@ declare const InputWorkerSchema: z.ZodObject<{
|
|
|
302
460
|
}, z.core.$strict>]>, z.ZodTransform<string, string | {
|
|
303
461
|
default: string;
|
|
304
462
|
}>>>;
|
|
305
|
-
}, z.core.$strict
|
|
306
|
-
type
|
|
463
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
464
|
+
type: z.ZodLiteral<"settings">;
|
|
465
|
+
accountId: z.ZodOptional<z.ZodString>;
|
|
466
|
+
complianceRegion: z.ZodOptional<z.ZodEnum<{
|
|
467
|
+
public: "public";
|
|
468
|
+
"fedramp-high": "fedramp-high";
|
|
469
|
+
}>>;
|
|
470
|
+
}, z.core.$strict>], "type">>;
|
|
471
|
+
type ParsedConfigExports = z.output<typeof ConfigExportsSchema>;
|
|
307
472
|
declare const ModuleTypeSchema: z.ZodEnum<{
|
|
308
473
|
json: "json";
|
|
309
474
|
text: "text";
|
|
@@ -322,8 +487,8 @@ type ModuleType = z.output<typeof ModuleTypeSchema>;
|
|
|
322
487
|
* base schema.
|
|
323
488
|
*/
|
|
324
489
|
declare const OutputWorkerSchema: z.ZodObject<{
|
|
490
|
+
type: z.ZodLiteral<"worker">;
|
|
325
491
|
name: z.ZodString;
|
|
326
|
-
accountId: z.ZodOptional<z.ZodString>;
|
|
327
492
|
compatibilityDate: z.ZodString;
|
|
328
493
|
compatibilityFlags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
329
494
|
assets: z.ZodOptional<z.ZodObject<{
|
|
@@ -410,10 +575,6 @@ declare const OutputWorkerSchema: z.ZodObject<{
|
|
|
410
575
|
}, z.core.$strict>>;
|
|
411
576
|
workersDev: z.ZodOptional<z.ZodBoolean>;
|
|
412
577
|
previewUrls: z.ZodOptional<z.ZodBoolean>;
|
|
413
|
-
complianceRegion: z.ZodOptional<z.ZodEnum<{
|
|
414
|
-
public: "public";
|
|
415
|
-
"fedramp-high": "fedramp-high";
|
|
416
|
-
}>>;
|
|
417
578
|
firstPartyWorker: z.ZodOptional<z.ZodBoolean>;
|
|
418
579
|
unsafe: z.ZodOptional<z.ZodObject<{
|
|
419
580
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -490,10 +651,18 @@ declare const BUILD_OUTPUT_VERSION = "v0";
|
|
|
490
651
|
* Project-relative root.
|
|
491
652
|
*/
|
|
492
653
|
declare const BUILD_OUTPUT_ROOT = ".cloudflare/output";
|
|
654
|
+
/**
|
|
655
|
+
* Filename of the top-level (root) config holding shared settings.
|
|
656
|
+
*/
|
|
657
|
+
declare const ROOT_CONFIG_FILENAME = "config.json";
|
|
493
658
|
/**
|
|
494
659
|
* Filename of the per-Worker config.
|
|
495
660
|
*/
|
|
496
661
|
declare const WORKER_CONFIG_FILENAME = "worker.config.json";
|
|
662
|
+
/**
|
|
663
|
+
* Absolute path to the top-level `config.json` for the current project.
|
|
664
|
+
*/
|
|
665
|
+
declare function getRootConfigPath(root: string): string;
|
|
497
666
|
/**
|
|
498
667
|
* Clean the build output directory.
|
|
499
668
|
*/
|
|
@@ -522,6 +691,11 @@ declare function getWorkerAssetsDir(root: string, workerName: string): string;
|
|
|
522
691
|
* - Assets-only mode: `manifest` is omitted (no bundle/ directory).
|
|
523
692
|
*/
|
|
524
693
|
declare function writeOutputWorkerConfig(root: string, parsedConfig: ParsedInputWorkerConfig, manifest?: ParsedOutputWorkerConfig["manifest"]): Promise<void>;
|
|
694
|
+
/**
|
|
695
|
+
* Write the top-level `config.json` holding shared settings to the Build
|
|
696
|
+
* Output API tree.
|
|
697
|
+
*/
|
|
698
|
+
declare function writeRootOutputConfig(root: string, settings: ParsedSettingsConfig): Promise<void>;
|
|
525
699
|
//#endregion
|
|
526
700
|
//#region src/generate.d.ts
|
|
527
701
|
interface GenerateTypesOptions {
|
|
@@ -565,10 +739,12 @@ declare function generateTypes({
|
|
|
565
739
|
* The caller is responsible for unwrapping any function/promise wrapper around
|
|
566
740
|
* the config and validating it against `InputWorkerSchema` before passing it in.
|
|
567
741
|
*
|
|
568
|
-
* @param
|
|
742
|
+
* @param workerConfig The parsed (post-validation) Worker config.
|
|
743
|
+
* @param settingsConfig The optional parsed settings config, whose fields
|
|
744
|
+
* are merged onto the result.
|
|
569
745
|
* @returns The corresponding Wrangler `RawConfig`.
|
|
570
746
|
*/
|
|
571
|
-
declare function convertToWranglerConfig(
|
|
747
|
+
declare function convertToWranglerConfig(workerConfig: ParsedInputWorkerConfig, settingsConfig?: ParsedSettingsConfig): RawConfig;
|
|
572
748
|
//#endregion
|
|
573
749
|
//#region src/load.d.ts
|
|
574
750
|
/**
|
|
@@ -583,18 +759,26 @@ declare function convertToWranglerConfig(config: ParsedInputWorkerConfig): RawCo
|
|
|
583
759
|
/**
|
|
584
760
|
* Dynamically import a worker config file from disk.
|
|
585
761
|
*
|
|
586
|
-
* Returns the module's
|
|
587
|
-
* imported during resolution. Callers
|
|
588
|
-
* function/promise wrappers around
|
|
589
|
-
*
|
|
762
|
+
* Returns all of the module's exports (keyed by export name, including
|
|
763
|
+
* `default`), plus the set of file paths imported during resolution. Callers
|
|
764
|
+
* are responsible for unwrapping function/promise/definition wrappers around
|
|
765
|
+
* each export and validating them.
|
|
590
766
|
*
|
|
591
767
|
* @param configPath Filesystem path to the config file. Relative paths are
|
|
592
768
|
* resolved against `process.cwd()`.
|
|
769
|
+
* @param options.include When provided, only exports whose names are listed
|
|
770
|
+
* survive into the returned `exports` map. Filtering happens before any
|
|
771
|
+
* resolution or validation.
|
|
593
772
|
*/
|
|
594
|
-
declare function loadConfig(configPath: string
|
|
773
|
+
declare function loadConfig(configPath: string, options?: {
|
|
774
|
+
include?: string[];
|
|
775
|
+
}): Promise<LoadConfigResult>;
|
|
595
776
|
interface LoadConfigResult {
|
|
596
|
-
/**
|
|
597
|
-
|
|
777
|
+
/**
|
|
778
|
+
* All exports of the config module, keyed by export name (including
|
|
779
|
+
* `default`). Filtered by `options.include` when provided.
|
|
780
|
+
*/
|
|
781
|
+
exports: Record<string, unknown>;
|
|
598
782
|
/**
|
|
599
783
|
* Absolute file paths imported while resolving the config.
|
|
600
784
|
* `cf-worker` entrypoints are NOT included — they are
|
|
@@ -623,4 +807,21 @@ interface LoadConfigResult {
|
|
|
623
807
|
*/
|
|
624
808
|
declare function registerConfigHooks(): () => void;
|
|
625
809
|
//#endregion
|
|
626
|
-
|
|
810
|
+
//#region src/config-loader.d.ts
|
|
811
|
+
interface LoadAndValidateConfigResult {
|
|
812
|
+
/**
|
|
813
|
+
* Zod result for the validated exports record, keyed by JS export name.
|
|
814
|
+
* Consumers format `result.error` themselves.
|
|
815
|
+
*/
|
|
816
|
+
result: z.ZodSafeParseResult<ParsedConfigExports>;
|
|
817
|
+
/** Transitive deps imported while resolving the config (node_modules excluded). */
|
|
818
|
+
dependencies: Set<string>;
|
|
819
|
+
}
|
|
820
|
+
/**
|
|
821
|
+
* Load a `cloudflare.config.ts`, resolve all exports, and validate against {@link ConfigExportsSchema}.
|
|
822
|
+
*/
|
|
823
|
+
declare function loadAndValidateConfig(configPath: string, ctx: ConfigContext, options?: {
|
|
824
|
+
include?: string[];
|
|
825
|
+
}): Promise<LoadAndValidateConfigResult>;
|
|
826
|
+
//#endregion
|
|
827
|
+
export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, ArtifactsBinding, AssetsBinding, BUILD_OUTPUT_ROOT, BUILD_OUTPUT_VERSION, Bindings, BrowserBinding, ConfigContext, ConfigExportsSchema, D1Binding, DispatchNamespaceBinding, DurableObjectBinding, DurableObjectCreatedExport, DurableObjectDeletedExport, DurableObjectExpectingTransferExport, DurableObjectRenamedExport, DurableObjectTransferredExport, EmailTrigger, Exports, FetchTrigger, FlagshipBinding, HyperdriveBinding, ImagesBinding, InferDurableNamespaces, InferEnv, InferMainModule, InputWorkerSchema, JsonBinding, KvBinding, type LoadAndValidateConfigResult, type LoadConfigResult, LogfwdrBinding, MediaBinding, type ModuleType, ModuleTypeSchema, MtlsCertificateBinding, OutputWorkerSchema, type ParsedConfigExports, type ParsedInputWorkerConfig, type ParsedOutputWorkerConfig, type ParsedSettingsConfig, PipelineBinding, QueueBinding, QueueConsumerTrigger, R2Binding, ROOT_CONFIG_FILENAME, RateLimitBinding, ScheduledTrigger, SecretBinding, SecretsStoreSecretBinding, SendEmailBinding, SettingsConfig, SettingsConfigInput, SettingsSchema, StreamBinding, TextBinding, Triggers, TypedAiBinding, TypedDurableObjectBinding, TypedKvBinding, TypedPipelineBinding, TypedQueueBinding, TypedWorkerBinding, TypedWorkerDefinition, TypedWorkflowBinding, UnsafeBinding, UnwrapConfig, VectorizeBinding, VersionMetadataBinding, VpcNetworkBinding, VpcServiceBinding, WORKER_CONFIG_FILENAME, WebSearchBinding, WorkerBinding, WorkerConfig, WorkerConfigExport, WorkerConfigInput, WorkerEntrypointExport, WorkerEntrypointExportOptions, WorkerLoaderBinding, WorkflowBinding, bindings, cleanBuildOutputDir, convertToWranglerConfig, defineSettings, defineWorker, exports, generateTypes, getRootConfigPath, getWorkerAssetsDir, getWorkerBundleDir, getWorkerConfigPath, getWorkersDir, loadAndValidateConfig, loadConfig, registerConfigHooks, resolveExportDefinition, triggers, writeOutputWorkerConfig, writeRootOutputConfig };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as triggers, i as exports$1, n as defineWorker, o as bindings, r as resolveExportDefinition, t as defineSettings } from "./public-D2QZv1n6.mjs";
|
|
2
2
|
import * as nodeModule from "node:module";
|
|
3
3
|
import * as fsp from "node:fs/promises";
|
|
4
4
|
import * as path from "node:path";
|
|
@@ -2519,6 +2519,10 @@ const BUILD_OUTPUT_VERSION = "v0";
|
|
|
2519
2519
|
*/
|
|
2520
2520
|
const BUILD_OUTPUT_ROOT = ".cloudflare/output";
|
|
2521
2521
|
/**
|
|
2522
|
+
* Filename of the top-level (root) config holding shared settings.
|
|
2523
|
+
*/
|
|
2524
|
+
const ROOT_CONFIG_FILENAME = "config.json";
|
|
2525
|
+
/**
|
|
2522
2526
|
* Filename of the per-Worker config.
|
|
2523
2527
|
*/
|
|
2524
2528
|
const WORKER_CONFIG_FILENAME = "worker.config.json";
|
|
@@ -2529,6 +2533,12 @@ function getBuildOutputDir(root) {
|
|
|
2529
2533
|
return path.resolve(root, BUILD_OUTPUT_ROOT);
|
|
2530
2534
|
}
|
|
2531
2535
|
/**
|
|
2536
|
+
* Absolute path to the top-level `config.json` for the current project.
|
|
2537
|
+
*/
|
|
2538
|
+
function getRootConfigPath(root) {
|
|
2539
|
+
return path.join(getBuildOutputDir(root), BUILD_OUTPUT_VERSION, ROOT_CONFIG_FILENAME);
|
|
2540
|
+
}
|
|
2541
|
+
/**
|
|
2532
2542
|
* Clean the build output directory.
|
|
2533
2543
|
*/
|
|
2534
2544
|
async function cleanBuildOutputDir(root) {
|
|
@@ -2576,6 +2586,15 @@ async function writeOutputWorkerConfig(root, parsedConfig, manifest) {
|
|
|
2576
2586
|
const configPath = getWorkerConfigPath(root, outputConfig.name);
|
|
2577
2587
|
await fsp.writeFile(configPath, JSON.stringify(outputConfig));
|
|
2578
2588
|
}
|
|
2589
|
+
/**
|
|
2590
|
+
* Write the top-level `config.json` holding shared settings to the Build
|
|
2591
|
+
* Output API tree.
|
|
2592
|
+
*/
|
|
2593
|
+
async function writeRootOutputConfig(root, settings) {
|
|
2594
|
+
const configPath = getRootConfigPath(root);
|
|
2595
|
+
await fsp.mkdir(path.dirname(configPath), { recursive: true });
|
|
2596
|
+
await fsp.writeFile(configPath, JSON.stringify(settings));
|
|
2597
|
+
}
|
|
2579
2598
|
|
|
2580
2599
|
//#endregion
|
|
2581
2600
|
//#region src/schema.ts
|
|
@@ -2635,7 +2654,7 @@ const KnownBindingSchema = z.discriminatedUnion("type", [
|
|
|
2635
2654
|
}),
|
|
2636
2655
|
z.strictObject({
|
|
2637
2656
|
type: z.literal("dispatch-namespace"),
|
|
2638
|
-
namespace: z.string(),
|
|
2657
|
+
namespace: z.string().optional(),
|
|
2639
2658
|
outbound: z.strictObject({
|
|
2640
2659
|
workerName: z.string(),
|
|
2641
2660
|
parameters: z.array(z.string()).optional()
|
|
@@ -2649,7 +2668,7 @@ const KnownBindingSchema = z.discriminatedUnion("type", [
|
|
|
2649
2668
|
}),
|
|
2650
2669
|
z.strictObject({
|
|
2651
2670
|
type: z.literal("flagship"),
|
|
2652
|
-
id: z.string(),
|
|
2671
|
+
id: z.string().optional(),
|
|
2653
2672
|
remote: z.boolean().optional()
|
|
2654
2673
|
}),
|
|
2655
2674
|
z.strictObject({
|
|
@@ -2690,7 +2709,7 @@ const KnownBindingSchema = z.discriminatedUnion("type", [
|
|
|
2690
2709
|
}),
|
|
2691
2710
|
z.strictObject({
|
|
2692
2711
|
type: z.literal("queue"),
|
|
2693
|
-
name: z.string(),
|
|
2712
|
+
name: z.string().optional(),
|
|
2694
2713
|
deliveryDelay: z.number().optional(),
|
|
2695
2714
|
remote: z.boolean().optional()
|
|
2696
2715
|
}),
|
|
@@ -2936,8 +2955,8 @@ const UnsafeSchema = z.strictObject({
|
|
|
2936
2955
|
* (user-authored) and output (on-disk) Worker configs.
|
|
2937
2956
|
*/
|
|
2938
2957
|
const BaseWorkerSchema = z.strictObject({
|
|
2958
|
+
type: z.literal("worker"),
|
|
2939
2959
|
name: z.string(),
|
|
2940
|
-
accountId: z.string().optional(),
|
|
2941
2960
|
compatibilityDate: z.string(),
|
|
2942
2961
|
compatibilityFlags: z.array(z.string()).optional(),
|
|
2943
2962
|
assets: AssetsSchema.optional(),
|
|
@@ -2951,7 +2970,6 @@ const BaseWorkerSchema = z.strictObject({
|
|
|
2951
2970
|
observability: ObservabilitySchema.optional(),
|
|
2952
2971
|
workersDev: z.boolean().optional(),
|
|
2953
2972
|
previewUrls: z.boolean().optional(),
|
|
2954
|
-
complianceRegion: z.enum(["public", "fedramp-high"]).optional(),
|
|
2955
2973
|
firstPartyWorker: z.boolean().optional(),
|
|
2956
2974
|
unsafe: UnsafeSchema.optional(),
|
|
2957
2975
|
env: EnvSchema,
|
|
@@ -2963,6 +2981,45 @@ const BaseWorkerSchema = z.strictObject({
|
|
|
2963
2981
|
* base schema.
|
|
2964
2982
|
*/
|
|
2965
2983
|
const InputWorkerSchema = BaseWorkerSchema.extend({ entrypoint: z.union([z.string(), z.strictObject({ default: z.string() })]).transform((value) => typeof value === "string" ? value : value.default).optional() });
|
|
2984
|
+
/**
|
|
2985
|
+
* Settings schema — validates the named `settings` export of a
|
|
2986
|
+
* `cloudflare.config.ts`. Holds account/deployment settings shared by the other exports.
|
|
2987
|
+
*/
|
|
2988
|
+
const SettingsSchema = z.strictObject({
|
|
2989
|
+
type: z.literal("settings"),
|
|
2990
|
+
accountId: z.string().optional(),
|
|
2991
|
+
complianceRegion: z.enum(["public", "fedramp-high"]).optional()
|
|
2992
|
+
});
|
|
2993
|
+
/**
|
|
2994
|
+
* Discriminated union of the config kinds a single export may resolve to.
|
|
2995
|
+
*/
|
|
2996
|
+
const ConfigExportSchema = z.discriminatedUnion("type", [InputWorkerSchema, SettingsSchema]);
|
|
2997
|
+
const SETTINGS_EXPORT_NAME = "settings";
|
|
2998
|
+
/**
|
|
2999
|
+
* Schema for the resolved config exports, keyed by export
|
|
3000
|
+
* name. Each value is discriminated on its `type` field. Reserves the
|
|
3001
|
+
* `settings` export name exclusively for settings configs: a `settings`
|
|
3002
|
+
* config must live on the `settings` export, and the `settings` export
|
|
3003
|
+
* may only hold a `settings` config.
|
|
3004
|
+
*/
|
|
3005
|
+
const ConfigExportsSchema = z.record(z.string(), ConfigExportSchema).check((ctx) => {
|
|
3006
|
+
for (const [key, value] of Object.entries(ctx.value)) {
|
|
3007
|
+
const isSettingsName = key === SETTINGS_EXPORT_NAME;
|
|
3008
|
+
const isSettingsType = value.type === "settings";
|
|
3009
|
+
if (isSettingsType && !isSettingsName) ctx.issues.push({
|
|
3010
|
+
code: "custom",
|
|
3011
|
+
input: value,
|
|
3012
|
+
path: [key],
|
|
3013
|
+
message: `A \`settings\` config is only allowed on the \`${SETTINGS_EXPORT_NAME}\` export; found one on the \`${key}\` export.`
|
|
3014
|
+
});
|
|
3015
|
+
else if (isSettingsName && !isSettingsType) ctx.issues.push({
|
|
3016
|
+
code: "custom",
|
|
3017
|
+
input: value,
|
|
3018
|
+
path: [key],
|
|
3019
|
+
message: `The \`${SETTINGS_EXPORT_NAME}\` export is reserved for a \`settings\` config; found a \`${value.type}\` config.`
|
|
3020
|
+
});
|
|
3021
|
+
}
|
|
3022
|
+
});
|
|
2966
3023
|
const ModuleTypeSchema = z.enum([
|
|
2967
3024
|
"esm",
|
|
2968
3025
|
"cjs",
|
|
@@ -3070,29 +3127,38 @@ function generateTypes({ configPath, packageName = "@cloudflare/config" }) {
|
|
|
3070
3127
|
* The caller is responsible for unwrapping any function/promise wrapper around
|
|
3071
3128
|
* the config and validating it against `InputWorkerSchema` before passing it in.
|
|
3072
3129
|
*
|
|
3073
|
-
* @param
|
|
3130
|
+
* @param workerConfig The parsed (post-validation) Worker config.
|
|
3131
|
+
* @param settingsConfig The optional parsed settings config, whose fields
|
|
3132
|
+
* are merged onto the result.
|
|
3074
3133
|
* @returns The corresponding Wrangler `RawConfig`.
|
|
3075
3134
|
*/
|
|
3076
|
-
function convertToWranglerConfig(
|
|
3135
|
+
function convertToWranglerConfig(workerConfig, settingsConfig) {
|
|
3077
3136
|
const result = {};
|
|
3078
|
-
convertTopLevel(
|
|
3079
|
-
convertBindingsAndAssets(
|
|
3080
|
-
convertExports(
|
|
3081
|
-
convertDomains(
|
|
3082
|
-
convertTriggers(
|
|
3083
|
-
convertTailConsumers(
|
|
3137
|
+
convertTopLevel(workerConfig, result);
|
|
3138
|
+
convertBindingsAndAssets(workerConfig, result);
|
|
3139
|
+
convertExports(workerConfig, result);
|
|
3140
|
+
convertDomains(workerConfig, result);
|
|
3141
|
+
convertTriggers(workerConfig, result);
|
|
3142
|
+
convertTailConsumers(workerConfig, result);
|
|
3143
|
+
if (settingsConfig !== void 0) convertSettings(settingsConfig, result);
|
|
3084
3144
|
return result;
|
|
3085
3145
|
}
|
|
3146
|
+
/**
|
|
3147
|
+
* Merge a parsed settings config's fields (`account_id`, `compliance_region`)
|
|
3148
|
+
* onto an existing Wrangler `RawConfig`.
|
|
3149
|
+
*/
|
|
3150
|
+
function convertSettings(settings, result) {
|
|
3151
|
+
if (settings.accountId !== void 0) result.account_id = settings.accountId;
|
|
3152
|
+
if (settings.complianceRegion !== void 0) result.compliance_region = settings.complianceRegion === "fedramp-high" ? "fedramp_high" : "public";
|
|
3153
|
+
}
|
|
3086
3154
|
function convertTopLevel(config, result) {
|
|
3087
3155
|
if (config.name !== void 0) result.name = config.name;
|
|
3088
3156
|
if (typeof config.entrypoint === "string") result.main = config.entrypoint;
|
|
3089
|
-
if (config.accountId !== void 0) result.account_id = config.accountId;
|
|
3090
3157
|
if (config.compatibilityDate !== void 0) result.compatibility_date = config.compatibilityDate;
|
|
3091
3158
|
if (config.compatibilityFlags !== void 0) result.compatibility_flags = config.compatibilityFlags;
|
|
3092
3159
|
if (config.workersDev !== void 0) result.workers_dev = config.workersDev;
|
|
3093
3160
|
if (config.previewUrls !== void 0) result.preview_urls = config.previewUrls;
|
|
3094
3161
|
if (config.logpush !== void 0) result.logpush = config.logpush;
|
|
3095
|
-
if (config.complianceRegion !== void 0) result.compliance_region = config.complianceRegion === "fedramp-high" ? "fedramp_high" : "public";
|
|
3096
3162
|
if (config.firstPartyWorker !== void 0) result.first_party_worker = config.firstPartyWorker;
|
|
3097
3163
|
if (config.placement !== void 0) result.placement = config.placement;
|
|
3098
3164
|
if (config.limits !== void 0) {
|
|
@@ -3524,9 +3590,10 @@ function convertTriggers(config, result) {
|
|
|
3524
3590
|
const crons = [];
|
|
3525
3591
|
const routes = result.routes ? [...result.routes] : [];
|
|
3526
3592
|
const queueConsumers = result.queues?.consumers ? [...result.queues.consumers] : [];
|
|
3527
|
-
|
|
3593
|
+
let addresses;
|
|
3528
3594
|
for (const trigger of triggers$1) switch (trigger.type) {
|
|
3529
3595
|
case "email":
|
|
3596
|
+
addresses ??= [];
|
|
3530
3597
|
addresses.push(...trigger.addresses);
|
|
3531
3598
|
break;
|
|
3532
3599
|
case "scheduled":
|
|
@@ -3562,7 +3629,7 @@ function convertTriggers(config, result) {
|
|
|
3562
3629
|
...result.queues ?? {},
|
|
3563
3630
|
consumers: queueConsumers
|
|
3564
3631
|
};
|
|
3565
|
-
if (addresses
|
|
3632
|
+
if (addresses !== void 0) result.addresses = addresses;
|
|
3566
3633
|
}
|
|
3567
3634
|
function convertDomains(config, result) {
|
|
3568
3635
|
if (!config.domains || config.domains.length === 0) return;
|
|
@@ -3614,20 +3681,29 @@ const depsStore = new AsyncLocalStorage();
|
|
|
3614
3681
|
/**
|
|
3615
3682
|
* Dynamically import a worker config file from disk.
|
|
3616
3683
|
*
|
|
3617
|
-
* Returns the module's
|
|
3618
|
-
* imported during resolution. Callers
|
|
3619
|
-
* function/promise wrappers around
|
|
3620
|
-
*
|
|
3684
|
+
* Returns all of the module's exports (keyed by export name, including
|
|
3685
|
+
* `default`), plus the set of file paths imported during resolution. Callers
|
|
3686
|
+
* are responsible for unwrapping function/promise/definition wrappers around
|
|
3687
|
+
* each export and validating them.
|
|
3621
3688
|
*
|
|
3622
3689
|
* @param configPath Filesystem path to the config file. Relative paths are
|
|
3623
3690
|
* resolved against `process.cwd()`.
|
|
3691
|
+
* @param options.include When provided, only exports whose names are listed
|
|
3692
|
+
* survive into the returned `exports` map. Filtering happens before any
|
|
3693
|
+
* resolution or validation.
|
|
3624
3694
|
*/
|
|
3625
|
-
async function loadConfig(configPath) {
|
|
3695
|
+
async function loadConfig(configPath, options) {
|
|
3626
3696
|
registerConfigHooks();
|
|
3627
3697
|
const url = pathToFileURL(configPath).href;
|
|
3628
3698
|
const dependencies = /* @__PURE__ */ new Set();
|
|
3699
|
+
const mod = await depsStore.run(dependencies, () => import(url, { with: { [CF_ATTR]: CF_NO_CACHE_VALUE } }));
|
|
3700
|
+
const exports$2 = {};
|
|
3701
|
+
for (const [name, value] of Object.entries(mod)) {
|
|
3702
|
+
if (options?.include && !options.include.includes(name)) continue;
|
|
3703
|
+
exports$2[name] = value;
|
|
3704
|
+
}
|
|
3629
3705
|
return {
|
|
3630
|
-
|
|
3706
|
+
exports: exports$2,
|
|
3631
3707
|
dependencies
|
|
3632
3708
|
};
|
|
3633
3709
|
}
|
|
@@ -3713,4 +3789,19 @@ function cleanupImportAttributes(context) {
|
|
|
3713
3789
|
}
|
|
3714
3790
|
|
|
3715
3791
|
//#endregion
|
|
3716
|
-
|
|
3792
|
+
//#region src/config-loader.ts
|
|
3793
|
+
/**
|
|
3794
|
+
* Load a `cloudflare.config.ts`, resolve all exports, and validate against {@link ConfigExportsSchema}.
|
|
3795
|
+
*/
|
|
3796
|
+
async function loadAndValidateConfig(configPath, ctx, options) {
|
|
3797
|
+
const { exports: exports$2, dependencies } = await loadConfig(configPath, options);
|
|
3798
|
+
const resolved = {};
|
|
3799
|
+
for (const [name, value] of Object.entries(exports$2)) resolved[name] = await resolveExportDefinition(value, ctx);
|
|
3800
|
+
return {
|
|
3801
|
+
result: ConfigExportsSchema.safeParse(resolved),
|
|
3802
|
+
dependencies
|
|
3803
|
+
};
|
|
3804
|
+
}
|
|
3805
|
+
|
|
3806
|
+
//#endregion
|
|
3807
|
+
export { BUILD_OUTPUT_ROOT, BUILD_OUTPUT_VERSION, ConfigExportsSchema, InputWorkerSchema, ModuleTypeSchema, OutputWorkerSchema, ROOT_CONFIG_FILENAME, SettingsSchema, WORKER_CONFIG_FILENAME, bindings, cleanBuildOutputDir, convertToWranglerConfig, defineSettings, defineWorker, exports$1 as exports, generateTypes, getRootConfigPath, getWorkerAssetsDir, getWorkerBundleDir, getWorkerConfigPath, getWorkersDir, loadAndValidateConfig, loadConfig, registerConfigHooks, resolveExportDefinition, triggers, writeOutputWorkerConfig, writeRootOutputConfig };
|
|
@@ -206,12 +206,43 @@ const exports = {
|
|
|
206
206
|
worker
|
|
207
207
|
};
|
|
208
208
|
|
|
209
|
+
//#endregion
|
|
210
|
+
//#region src/definition.ts
|
|
211
|
+
const DEFINITION = Symbol.for("@cloudflare/config:definition");
|
|
212
|
+
/**
|
|
213
|
+
* Unwrap an authored config from its value / promise / function shape, awaiting
|
|
214
|
+
* the result. A function config is invoked with {@link ConfigContext}.
|
|
215
|
+
*/
|
|
216
|
+
async function unwrap(config, ctx) {
|
|
217
|
+
return typeof config === "function" ? await config(ctx) : await config;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Resolve any `cloudflare.config.ts` export to its plain config value.
|
|
221
|
+
*
|
|
222
|
+
* A `define*` helper stores its authored config plus `type` under the
|
|
223
|
+
* {@link DEFINITION} symbol; here we unwrap the config and stamp `type` back on.
|
|
224
|
+
* Every other export — a raw object/promise/function — is unwrapped as-is and
|
|
225
|
+
* already carries its own `type`. Discrimination happens afterwards via `type`.
|
|
226
|
+
*/
|
|
227
|
+
async function resolveExportDefinition(def, ctx) {
|
|
228
|
+
if (typeof def === "object" && def !== null && DEFINITION in def) {
|
|
229
|
+
const { config, type } = def[DEFINITION];
|
|
230
|
+
return {
|
|
231
|
+
...await unwrap(config, ctx),
|
|
232
|
+
type
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
return await unwrap(def, ctx);
|
|
236
|
+
}
|
|
237
|
+
|
|
209
238
|
//#endregion
|
|
210
239
|
//#region src/worker-definition.ts
|
|
211
|
-
const CONFIG = Symbol.for("@cloudflare/config:worker-config");
|
|
212
240
|
function defineWorker(config) {
|
|
213
241
|
return {
|
|
214
|
-
[
|
|
242
|
+
[DEFINITION]: {
|
|
243
|
+
config,
|
|
244
|
+
type: "worker"
|
|
245
|
+
},
|
|
215
246
|
durableObject(options) {
|
|
216
247
|
return {
|
|
217
248
|
type: "durable-object",
|
|
@@ -226,10 +257,19 @@ function defineWorker(config) {
|
|
|
226
257
|
}
|
|
227
258
|
};
|
|
228
259
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
260
|
+
|
|
261
|
+
//#endregion
|
|
262
|
+
//#region src/settings-definition.ts
|
|
263
|
+
/**
|
|
264
|
+
* Declare shared settings.
|
|
265
|
+
* Authored as a named `settings` export.
|
|
266
|
+
*/
|
|
267
|
+
function defineSettings(config) {
|
|
268
|
+
return { [DEFINITION]: {
|
|
269
|
+
config,
|
|
270
|
+
type: "settings"
|
|
271
|
+
} };
|
|
232
272
|
}
|
|
233
273
|
|
|
234
274
|
//#endregion
|
|
235
|
-
export {
|
|
275
|
+
export { triggers as a, exports as i, defineWorker as n, bindings as o, resolveExportDefinition as r, defineSettings as t };
|
|
@@ -132,7 +132,7 @@ interface D1Binding extends D1BindingOptions {
|
|
|
132
132
|
}
|
|
133
133
|
interface DispatchNamespaceBindingOptions {
|
|
134
134
|
/** The namespace to bind to. */
|
|
135
|
-
namespace
|
|
135
|
+
namespace?: string;
|
|
136
136
|
/** Details about the outbound Worker which will handle outbound requests from your namespace. */
|
|
137
137
|
outbound?: {
|
|
138
138
|
/** Name of the Worker handling the outbound requests. */
|
|
@@ -180,7 +180,7 @@ interface TypedDurableObjectBinding<TConfig$1, TExportName$1 extends string> ext
|
|
|
180
180
|
}
|
|
181
181
|
interface FlagshipBindingOptions {
|
|
182
182
|
/** The Flagship app ID to bind to. */
|
|
183
|
-
id
|
|
183
|
+
id?: string;
|
|
184
184
|
/** Set to `true` to suppress the remote binding warning in local dev. Flagship bindings are always remote. */
|
|
185
185
|
remote?: boolean;
|
|
186
186
|
}
|
|
@@ -293,7 +293,7 @@ interface TypedPipelineBinding<TRecord extends PipelineRecord = PipelineRecord>
|
|
|
293
293
|
}
|
|
294
294
|
interface QueueBindingOptions {
|
|
295
295
|
/** The name of this Queue. */
|
|
296
|
-
name
|
|
296
|
+
name?: string;
|
|
297
297
|
/** The number of seconds to wait before delivering a message. */
|
|
298
298
|
deliveryDelay?: number;
|
|
299
299
|
/** Whether the Queue producer should be remote or not in local development. */
|
|
@@ -600,7 +600,7 @@ interface Bindings {
|
|
|
600
600
|
*
|
|
601
601
|
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms
|
|
602
602
|
*/
|
|
603
|
-
dispatchNamespace(options
|
|
603
|
+
dispatchNamespace(options?: DispatchNamespaceBindingOptions): DispatchNamespaceBinding;
|
|
604
604
|
/**
|
|
605
605
|
* Binding to a Durable Object class. `workerName` is the name of the Worker
|
|
606
606
|
* that defines the class; `exportName` is the exported class name.
|
|
@@ -609,7 +609,7 @@ interface Bindings {
|
|
|
609
609
|
*/
|
|
610
610
|
durableObject(options: DurableObjectBindingOptions): DurableObjectBinding;
|
|
611
611
|
/** Binding to a Flagship feature-flag service. */
|
|
612
|
-
flagship(options
|
|
612
|
+
flagship(options?: FlagshipBindingOptions): FlagshipBinding;
|
|
613
613
|
/**
|
|
614
614
|
* Binding to a Hyperdrive configuration.
|
|
615
615
|
*
|
|
@@ -650,7 +650,7 @@ interface Bindings {
|
|
|
650
650
|
*
|
|
651
651
|
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
|
|
652
652
|
*/
|
|
653
|
-
queue<TBody = unknown>(options
|
|
653
|
+
queue<TBody = unknown>(options?: QueueBindingOptions): TypedQueueBinding<TBody>;
|
|
654
654
|
/**
|
|
655
655
|
* Binding to an R2 bucket.
|
|
656
656
|
*
|
|
@@ -1006,6 +1006,32 @@ interface Exports {
|
|
|
1006
1006
|
*/
|
|
1007
1007
|
declare const exports: Exports;
|
|
1008
1008
|
//#endregion
|
|
1009
|
+
//#region src/definition.d.ts
|
|
1010
|
+
interface ConfigContext {
|
|
1011
|
+
/**
|
|
1012
|
+
* The mode the config is being evaluated in.
|
|
1013
|
+
* Set via the `--mode` CLI flag.
|
|
1014
|
+
* In Vite the mode defaults to `development` in `vite dev` and `production` in `vite build` ([more info](https://vite.dev/guide/env-and-mode.html#modes)).
|
|
1015
|
+
* In Wrangler the mode defaults to `undefined`.
|
|
1016
|
+
*/
|
|
1017
|
+
mode: string | undefined;
|
|
1018
|
+
}
|
|
1019
|
+
declare const DEFINITION: unique symbol;
|
|
1020
|
+
/**
|
|
1021
|
+
* The authored config in any of its supported shapes: a plain value, a promise,
|
|
1022
|
+
* or a function of {@link ConfigContext}.
|
|
1023
|
+
*/
|
|
1024
|
+
type ConfigInput<T$1> = T$1 | Promise<T$1> | ((ctx: ConfigContext) => T$1 | Promise<T$1>);
|
|
1025
|
+
/**
|
|
1026
|
+
* Resolve any `cloudflare.config.ts` export to its plain config value.
|
|
1027
|
+
*
|
|
1028
|
+
* A `define*` helper stores its authored config plus `type` under the
|
|
1029
|
+
* {@link DEFINITION} symbol; here we unwrap the config and stamp `type` back on.
|
|
1030
|
+
* Every other export — a raw object/promise/function — is unwrapped as-is and
|
|
1031
|
+
* already carries its own `type`. Discrimination happens afterwards via `type`.
|
|
1032
|
+
*/
|
|
1033
|
+
declare function resolveExportDefinition(def: unknown, ctx: ConfigContext): Promise<unknown>;
|
|
1034
|
+
//#endregion
|
|
1009
1035
|
//#region src/types.d.ts
|
|
1010
1036
|
/**
|
|
1011
1037
|
* Union of all binding definitions accepted in `env`.
|
|
@@ -1028,19 +1054,18 @@ type Export = DurableObjectCreatedExport | DurableObjectDeletedExport | DurableO
|
|
|
1028
1054
|
* Fields are validated at runtime by `InputWorkerSchema` and normalised before
|
|
1029
1055
|
* being passed to downstream tooling.
|
|
1030
1056
|
*/
|
|
1031
|
-
interface
|
|
1057
|
+
interface WorkerConfig {
|
|
1032
1058
|
/**
|
|
1033
|
-
*
|
|
1059
|
+
* Discriminates this config as a Worker config.
|
|
1060
|
+
*
|
|
1061
|
+
* Injected automatically by `defineWorker`; only needs to be written by
|
|
1062
|
+
* hand when authoring a raw config object without the helper.
|
|
1034
1063
|
*/
|
|
1035
|
-
|
|
1064
|
+
type: "worker";
|
|
1036
1065
|
/**
|
|
1037
|
-
*
|
|
1038
|
-
* You might have more than one account, so make sure to use
|
|
1039
|
-
* the ID of the account associated with the zone/route you
|
|
1040
|
-
* provide, if you provide one. It can also be specified through
|
|
1041
|
-
* the CLOUDFLARE_ACCOUNT_ID environment variable.
|
|
1066
|
+
* The name of your Worker.
|
|
1042
1067
|
*/
|
|
1043
|
-
|
|
1068
|
+
name: string;
|
|
1044
1069
|
/**
|
|
1045
1070
|
* A date in the form yyyy-mm-dd, which will be used to determine
|
|
1046
1071
|
* which version of the Workers runtime is used.
|
|
@@ -1229,13 +1254,6 @@ interface UserConfig {
|
|
|
1229
1254
|
* @default false
|
|
1230
1255
|
*/
|
|
1231
1256
|
previewUrls?: boolean;
|
|
1232
|
-
/**
|
|
1233
|
-
* Specify the compliance region mode of the Worker.
|
|
1234
|
-
*
|
|
1235
|
-
* Although if the user does not specify a compliance region, the default is `public`,
|
|
1236
|
-
* it can be set to `undefined` in configuration to delegate to the CLOUDFLARE_COMPLIANCE_REGION environment variable.
|
|
1237
|
-
*/
|
|
1238
|
-
complianceRegion?: "public" | "fedramp-high";
|
|
1239
1257
|
/**
|
|
1240
1258
|
* Designates this Worker as an internal-only "first-party" Worker.
|
|
1241
1259
|
*
|
|
@@ -1287,29 +1305,51 @@ interface UserConfig {
|
|
|
1287
1305
|
*/
|
|
1288
1306
|
exports?: Record<string, Export>;
|
|
1289
1307
|
}
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1308
|
+
/**
|
|
1309
|
+
* Settings shared by the other exports.
|
|
1310
|
+
* Authored as a named `settings` export via
|
|
1311
|
+
* `defineSettings`.
|
|
1312
|
+
*/
|
|
1313
|
+
interface SettingsConfig {
|
|
1293
1314
|
/**
|
|
1294
|
-
*
|
|
1295
|
-
*
|
|
1296
|
-
*
|
|
1297
|
-
*
|
|
1315
|
+
* Discriminates this config as a settings config.
|
|
1316
|
+
*
|
|
1317
|
+
* Injected automatically by `defineSettings`; only needs to be written by
|
|
1318
|
+
* hand when authoring a raw config object without the helper.
|
|
1298
1319
|
*/
|
|
1299
|
-
|
|
1320
|
+
type: "settings";
|
|
1321
|
+
/**
|
|
1322
|
+
* This is the ID of the account associated with your zone.
|
|
1323
|
+
* You might have more than one account, so make sure to use
|
|
1324
|
+
* the ID of the account associated with the zone/route you
|
|
1325
|
+
* provide, if you provide one. It can also be specified through
|
|
1326
|
+
* the CLOUDFLARE_ACCOUNT_ID environment variable.
|
|
1327
|
+
*/
|
|
1328
|
+
accountId?: string;
|
|
1329
|
+
/**
|
|
1330
|
+
* Specify the compliance region mode of the Worker.
|
|
1331
|
+
*
|
|
1332
|
+
* Although if the user does not specify a compliance region, the default is `public`,
|
|
1333
|
+
* it can be set to `undefined` in configuration to delegate to the CLOUDFLARE_COMPLIANCE_REGION environment variable.
|
|
1334
|
+
*/
|
|
1335
|
+
complianceRegion?: "public" | "fedramp-high";
|
|
1300
1336
|
}
|
|
1301
|
-
|
|
1337
|
+
//#endregion
|
|
1338
|
+
//#region src/worker-definition.d.ts
|
|
1302
1339
|
/**
|
|
1303
|
-
* Base shape of a Worker definition. Carries the
|
|
1304
|
-
* untyped cross-worker binding helpers.
|
|
1340
|
+
* Base shape of a Worker definition. Carries the authored config (under
|
|
1341
|
+
* {@link DEFINITION}) and the untyped cross-worker binding helpers.
|
|
1305
1342
|
*/
|
|
1306
|
-
interface WorkerDefinition<TConfig$1 extends
|
|
1307
|
-
[
|
|
1343
|
+
interface WorkerDefinition<TConfig$1 extends WorkerConfig = WorkerConfig> extends Pick<Bindings, "durableObject" | "worker"> {
|
|
1344
|
+
[DEFINITION]: {
|
|
1345
|
+
config: ConfigInput<Omit<TConfig$1, "type">>;
|
|
1346
|
+
type: "worker";
|
|
1347
|
+
};
|
|
1308
1348
|
}
|
|
1309
1349
|
/**
|
|
1310
1350
|
* Worker definition with typed cross-worker binding helpers.
|
|
1311
1351
|
*/
|
|
1312
|
-
interface TypedWorkerDefinition<TConfig$1 extends
|
|
1352
|
+
interface TypedWorkerDefinition<TConfig$1 extends WorkerConfig, TWorkerName extends string = InferWorkerName<TConfig$1>> extends WorkerDefinition<TConfig$1> {
|
|
1313
1353
|
/**
|
|
1314
1354
|
* Binding to a Durable Object class. `workerName` is the name of the Worker
|
|
1315
1355
|
* that defines the class; `exportName` is the exported class name.
|
|
@@ -1334,10 +1374,18 @@ interface TypedWorkerDefinition<TConfig$1 extends UserConfig, TWorkerName extend
|
|
|
1334
1374
|
remote?: boolean;
|
|
1335
1375
|
}): TypedWorkerBinding<TConfig$1, TExportName$1 extends string ? TExportName$1 : "default">;
|
|
1336
1376
|
}
|
|
1337
|
-
type
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1377
|
+
type WorkerConfigExport<T$1 extends WorkerConfig = WorkerConfig> = ConfigInput<T$1>;
|
|
1378
|
+
/**
|
|
1379
|
+
* Authored Worker config shape — {@link WorkerConfig} without the `type`
|
|
1380
|
+
* discriminant, which `defineWorker` injects.
|
|
1381
|
+
*/
|
|
1382
|
+
type WorkerConfigInput = Omit<WorkerConfig, "type">;
|
|
1383
|
+
declare function defineWorker<const T$1 extends WorkerConfigInput>(config: (ctx: ConfigContext) => (WorkerConfigInput & T$1) | Promise<WorkerConfigInput & T$1>): TypedWorkerDefinition<T$1 & {
|
|
1384
|
+
type: "worker";
|
|
1385
|
+
}>;
|
|
1386
|
+
declare function defineWorker<const T$1 extends WorkerConfigInput>(config: (WorkerConfigInput & T$1) | Promise<WorkerConfigInput & T$1>): TypedWorkerDefinition<T$1 & {
|
|
1387
|
+
type: "worker";
|
|
1388
|
+
}>;
|
|
1341
1389
|
//#endregion
|
|
1342
1390
|
//#region src/inference.d.ts
|
|
1343
1391
|
/**
|
|
@@ -1475,7 +1523,7 @@ type InferWorkerEntrypointExports<TUnwrappedConfig$1> = Exclude<keyof InferMainM
|
|
|
1475
1523
|
* Unwrap function and promise types to get the underlying config.
|
|
1476
1524
|
* Use this to normalize a config before passing it to other inference utilities.
|
|
1477
1525
|
*/
|
|
1478
|
-
type UnwrapConfig<TConfig$1> = TConfig$1 extends WorkerDefinition<infer TUnwrappedConfig> ? TUnwrappedConfig : TConfig$1 extends
|
|
1526
|
+
type UnwrapConfig<TConfig$1> = TConfig$1 extends WorkerDefinition<infer TUnwrappedConfig> ? TUnwrappedConfig : TConfig$1 extends WorkerConfigExport<infer TUnwrappedConfig> ? TUnwrappedConfig : never;
|
|
1479
1527
|
/**
|
|
1480
1528
|
* Infer the `Env` interface type from a Worker config.
|
|
1481
1529
|
*
|
|
@@ -1545,4 +1593,21 @@ type InferMainModule<TUnwrappedConfig$1> = TUnwrappedConfig$1 extends {
|
|
|
1545
1593
|
entrypoint: infer TModule extends WorkerModule;
|
|
1546
1594
|
} ? TModule : DefaultModule;
|
|
1547
1595
|
//#endregion
|
|
1548
|
-
|
|
1596
|
+
//#region src/settings-definition.d.ts
|
|
1597
|
+
/**
|
|
1598
|
+
* Authored settings config shape — {@link SettingsConfig} without the `type`
|
|
1599
|
+
* discriminant, which `defineSettings` injects.
|
|
1600
|
+
*/
|
|
1601
|
+
type SettingsConfigInput = Omit<SettingsConfig, "type">;
|
|
1602
|
+
/**
|
|
1603
|
+
* Declare shared settings.
|
|
1604
|
+
* Authored as a named `settings` export.
|
|
1605
|
+
*/
|
|
1606
|
+
declare function defineSettings(config: ConfigInput<SettingsConfigInput>): {
|
|
1607
|
+
[DEFINITION]: {
|
|
1608
|
+
config: ConfigInput<SettingsConfigInput>;
|
|
1609
|
+
type: string;
|
|
1610
|
+
};
|
|
1611
|
+
};
|
|
1612
|
+
//#endregion
|
|
1613
|
+
export { RateLimitBinding as $, AgentMemoryBinding as A, DispatchNamespaceBinding as B, exports as C, ScheduledTrigger as D, QueueConsumerTrigger as E, ArtifactsBinding as F, JsonBinding as G, FlagshipBinding as H, AssetsBinding as I, MediaBinding$1 as J, KvBinding as K, Bindings as L, AiSearchBinding as M, AiSearchNamespaceBinding as N, Triggers as O, AnalyticsEngineDatasetBinding as P, R2Binding as Q, BrowserBinding as R, WorkerEntrypointExportOptions as S, FetchTrigger as T, HyperdriveBinding as U, DurableObjectBinding as V, ImagesBinding$1 as W, PipelineBinding as X, MtlsCertificateBinding as Y, QueueBinding as Z, DurableObjectExpectingTransferExport as _, WebSearchBinding as _t, InferMainModule as a, TypedAiBinding as at, Exports as b, WorkflowBinding as bt, WorkerConfigExport as c, TypedPipelineBinding as ct, SettingsConfig as d, TypedWorkflowBinding as dt, SecretBinding as et, WorkerConfig as f, UnsafeBinding as ft, DurableObjectDeletedExport as g, VpcServiceBinding as gt, DurableObjectCreatedExport as h, VpcNetworkBinding as ht, InferEnv as i, TextBinding as it, AiBinding as j, triggers as k, WorkerConfigInput as l, TypedQueueBinding as lt, resolveExportDefinition as m, VersionMetadataBinding as mt, defineSettings as n, SendEmailBinding as nt, UnwrapConfig as o, TypedDurableObjectBinding as ot, ConfigContext as p, VectorizeBinding as pt, LogfwdrBinding as q, InferDurableNamespaces as r, StreamBinding$1 as rt, TypedWorkerDefinition as s, TypedKvBinding as st, SettingsConfigInput as t, SecretsStoreSecretBinding as tt, defineWorker as u, TypedWorkerBinding as ut, DurableObjectRenamedExport as v, WorkerBinding as vt, EmailTrigger as w, WorkerEntrypointExport as x, bindings as xt, DurableObjectTransferredExport as y, WorkerLoaderBinding as yt, D1Binding as z };
|
package/dist/public.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, ArtifactsBinding, AssetsBinding, Bindings, BrowserBinding, ConfigContext, D1Binding, DispatchNamespaceBinding, DurableObjectBinding, DurableObjectCreatedExport, DurableObjectDeletedExport, DurableObjectExpectingTransferExport, DurableObjectRenamedExport, DurableObjectTransferredExport, EmailTrigger, Exports, FetchTrigger, FlagshipBinding, HyperdriveBinding, ImagesBinding, InferDurableNamespaces, InferEnv, InferMainModule, JsonBinding, KvBinding, LogfwdrBinding, MediaBinding, MtlsCertificateBinding, PipelineBinding, QueueBinding, QueueConsumerTrigger, R2Binding, RateLimitBinding, ScheduledTrigger, SecretBinding, SecretsStoreSecretBinding, SendEmailBinding, StreamBinding, TextBinding, Triggers, TypedAiBinding, TypedDurableObjectBinding, TypedKvBinding, TypedPipelineBinding, TypedQueueBinding, TypedWorkerBinding, TypedWorkerDefinition, TypedWorkflowBinding, UnsafeBinding, UnwrapConfig,
|
|
1
|
+
import { $ as RateLimitBinding, A as AgentMemoryBinding, B as DispatchNamespaceBinding, C as exports, D as ScheduledTrigger, E as QueueConsumerTrigger, F as ArtifactsBinding, G as JsonBinding, H as FlagshipBinding, I as AssetsBinding, J as MediaBinding, K as KvBinding, L as Bindings, M as AiSearchBinding, N as AiSearchNamespaceBinding, O as Triggers, P as AnalyticsEngineDatasetBinding, Q as R2Binding, R as BrowserBinding, S as WorkerEntrypointExportOptions, T as FetchTrigger, U as HyperdriveBinding, V as DurableObjectBinding, W as ImagesBinding, X as PipelineBinding, Y as MtlsCertificateBinding, Z as QueueBinding, _ as DurableObjectExpectingTransferExport, _t as WebSearchBinding, a as InferMainModule, at as TypedAiBinding, b as Exports, bt as WorkflowBinding, c as WorkerConfigExport, ct as TypedPipelineBinding, d as SettingsConfig, dt as TypedWorkflowBinding, et as SecretBinding, f as WorkerConfig, ft as UnsafeBinding, g as DurableObjectDeletedExport, gt as VpcServiceBinding, h as DurableObjectCreatedExport, ht as VpcNetworkBinding, i as InferEnv, it as TextBinding, j as AiBinding, k as triggers, l as WorkerConfigInput, lt as TypedQueueBinding, mt as VersionMetadataBinding, n as defineSettings, nt as SendEmailBinding, o as UnwrapConfig, ot as TypedDurableObjectBinding, p as ConfigContext, pt as VectorizeBinding, q as LogfwdrBinding, r as InferDurableNamespaces, rt as StreamBinding, s as TypedWorkerDefinition, st as TypedKvBinding, t as SettingsConfigInput, tt as SecretsStoreSecretBinding, u as defineWorker, ut as TypedWorkerBinding, v as DurableObjectRenamedExport, vt as WorkerBinding, w as EmailTrigger, x as WorkerEntrypointExport, xt as bindings, y as DurableObjectTransferredExport, yt as WorkerLoaderBinding, z as D1Binding } from "./public-myuV_kLK.mjs";
|
|
2
|
+
export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, ArtifactsBinding, AssetsBinding, Bindings, BrowserBinding, ConfigContext, D1Binding, DispatchNamespaceBinding, DurableObjectBinding, DurableObjectCreatedExport, DurableObjectDeletedExport, DurableObjectExpectingTransferExport, DurableObjectRenamedExport, DurableObjectTransferredExport, EmailTrigger, Exports, FetchTrigger, FlagshipBinding, HyperdriveBinding, ImagesBinding, InferDurableNamespaces, InferEnv, InferMainModule, JsonBinding, KvBinding, LogfwdrBinding, MediaBinding, MtlsCertificateBinding, PipelineBinding, QueueBinding, QueueConsumerTrigger, R2Binding, RateLimitBinding, ScheduledTrigger, SecretBinding, SecretsStoreSecretBinding, SendEmailBinding, SettingsConfig, SettingsConfigInput, 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 };
|
package/dist/public.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as triggers, i as exports, n as defineWorker, o as bindings, t as defineSettings } from "./public-D2QZv1n6.mjs";
|
|
2
2
|
|
|
3
|
-
export { bindings, defineWorker, exports, triggers };
|
|
3
|
+
export { bindings, defineSettings, defineWorker, exports, triggers };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Definitions and utilities for configuring Cloudflare Workers and related products. This is not yet stable enough for external use — APIs may change without notice.",
|
|
5
5
|
"homepage": "https://github.com/cloudflare/workers-sdk/tree/main/packages/config#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
"zod": "4.4.3"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@cloudflare/workers-types": "^5.
|
|
34
|
+
"@cloudflare/workers-types": "^5.20260721.1",
|
|
35
35
|
"ts-dedent": "^2.2.0",
|
|
36
36
|
"tsdown": "0.16.3",
|
|
37
37
|
"typescript": "5.8.3",
|
|
38
38
|
"vitest": "4.1.0",
|
|
39
|
-
"@cloudflare/workers-
|
|
40
|
-
"@cloudflare/workers-
|
|
39
|
+
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
40
|
+
"@cloudflare/workers-utils": "0.28.0"
|
|
41
41
|
},
|
|
42
42
|
"workers-sdk": {
|
|
43
43
|
"prerelease": true
|