@cloudflare/config 0.10.0 → 0.12.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 +234 -179
- package/dist/index.mjs +424 -19
- package/dist/{public-BwQqexwo.mjs → public-BYCVISMH.mjs} +31 -50
- package/dist/{public-DZgNmLyp.d.mts → public-CxIWEZqM.d.mts} +1509 -1384
- package/dist/public.d.mts +2 -2
- package/dist/public.mjs +2 -2
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as SettingsConfig, A as SecretsStoreSecretBinding, B as VersionMetadataBinding, C as MediaBinding, Ct as InferMainModule, D as R2Binding, E as QueueBinding, F as TypedKvBinding, G as WorkerLoaderBinding, H as VpcServiceBinding, I as TypedPipelineBinding, J as bindings, K as WorkerReference, L as TypedQueueBinding, M as StreamBinding, N as TextBinding, O as RateLimitBinding, P as TypedAiBinding, Q as ContainerConfig, R as UnsafeBinding, S as LogfwdrBinding, St as InferEnv, T as PipelineBinding, U as WebSearchBinding, V as VpcNetworkBinding, W as WorkerBinding, X as WorkerConfigInput, Y as WorkerConfigExport, Z as defineWorker, _ as FlagshipBinding, _t as ContainerConfigExport, a as AiBinding, at as ScheduledTrigger, b as JsonBinding, bt as ConfigContext, c as AnalyticsEngineDatasetBinding, ct as DurableObjectCreatedExport, d as BindingDevOptions, dt as DurableObjectRenamedExport, et as WorkerConfig, f as Bindings, ft as DurableObjectTransferredExport, g as DurableObjectBinding, gt as exports, h as DispatchNamespaceBinding, ht as WorkerEntrypointExportOptions, i as AgentMemoryBinding, it as QueueConsumerTrigger, j as SendEmailBinding, k as SecretBinding, l as ArtifactsBinding, lt as DurableObjectDeletedExport, m as D1Binding, mt as WorkerEntrypointExport, n as SettingsConfigInput, nt as EmailTrigger, o as AiSearchBinding, ot as Triggers, p as BrowserBinding, pt as Exports, q as WorkflowBinding, r as defineSettings, rt as FetchTrigger, s as AiSearchNamespaceBinding, st as triggers, t as SettingsConfigExport, tt as ConnectTrigger, u as AssetsBinding, ut as DurableObjectExpectingTransferExport, v as HyperdriveBinding, vt as ContainerConfigInput, w as MtlsCertificateBinding, wt as UnwrapConfig, x as KvBinding, xt as InferDurableNamespaces, y as ImagesBinding, yt as defineContainer, z as VectorizeBinding } from "./public-CxIWEZqM.mjs";
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
import { RawConfig } from "@cloudflare/workers-utils";
|
|
4
4
|
|
|
@@ -321,6 +321,215 @@ declare const BindingSchema: z.ZodType<BindingOutput, BindingInput>;
|
|
|
321
321
|
declare function validateSingletonBindings(env: Record<string, {
|
|
322
322
|
type: string;
|
|
323
323
|
}>, ctx: z.RefinementCtx): void;
|
|
324
|
+
/**
|
|
325
|
+
* Input Container schema — validates user-authored `cloudflare.config.ts`
|
|
326
|
+
* Container exports. Dockerfiles are built by the consuming build tool.
|
|
327
|
+
*/
|
|
328
|
+
declare const InputContainerSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
329
|
+
type: z.ZodLiteral<"container">;
|
|
330
|
+
name: z.ZodString;
|
|
331
|
+
observability: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
332
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
333
|
+
logs: z.ZodOptional<z.ZodObject<{
|
|
334
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
335
|
+
}, z.core.$strict>>;
|
|
336
|
+
targetInstancePercentage: z.ZodOptional<z.ZodNumber>;
|
|
337
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
338
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
339
|
+
logs: z.ZodOptional<z.ZodObject<{
|
|
340
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
341
|
+
}, z.core.$strict>>;
|
|
342
|
+
targetInstanceCount: z.ZodOptional<z.ZodNumber>;
|
|
343
|
+
}, z.core.$strict>]>>;
|
|
344
|
+
unsafe: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
345
|
+
maxInstances: z.ZodDefault<z.ZodNumber>;
|
|
346
|
+
instanceType: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
347
|
+
basic: "basic";
|
|
348
|
+
lite: "lite";
|
|
349
|
+
"standard-1": "standard-1";
|
|
350
|
+
"standard-2": "standard-2";
|
|
351
|
+
"standard-3": "standard-3";
|
|
352
|
+
"standard-4": "standard-4";
|
|
353
|
+
}>, z.ZodObject<{
|
|
354
|
+
vcpu: z.ZodOptional<z.ZodNumber>;
|
|
355
|
+
memoryMib: z.ZodOptional<z.ZodNumber>;
|
|
356
|
+
diskMb: z.ZodOptional<z.ZodNumber>;
|
|
357
|
+
}, z.core.$strict>]>>;
|
|
358
|
+
schedulingPolicy: z.ZodOptional<z.ZodEnum<{
|
|
359
|
+
default: "default";
|
|
360
|
+
regional: "regional";
|
|
361
|
+
}>>;
|
|
362
|
+
ssh: z.ZodOptional<z.ZodObject<{
|
|
363
|
+
enabled: z.ZodBoolean;
|
|
364
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
365
|
+
}, z.core.$strict>>;
|
|
366
|
+
authorizedKeys: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
367
|
+
name: z.ZodString;
|
|
368
|
+
publicKey: z.ZodString;
|
|
369
|
+
}, z.core.$strict>>>;
|
|
370
|
+
constraints: z.ZodOptional<z.ZodObject<{
|
|
371
|
+
regions: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
372
|
+
ENAM: "ENAM";
|
|
373
|
+
WNAM: "WNAM";
|
|
374
|
+
EEUR: "EEUR";
|
|
375
|
+
WEUR: "WEUR";
|
|
376
|
+
APAC: "APAC";
|
|
377
|
+
SAM: "SAM";
|
|
378
|
+
ME: "ME";
|
|
379
|
+
OC: "OC";
|
|
380
|
+
AFR: "AFR";
|
|
381
|
+
}>>>;
|
|
382
|
+
jurisdiction: z.ZodOptional<z.ZodEnum<{
|
|
383
|
+
eu: "eu";
|
|
384
|
+
fedramp: "fedramp";
|
|
385
|
+
}>>;
|
|
386
|
+
}, z.core.$strict>>;
|
|
387
|
+
rollout: z.ZodOptional<z.ZodObject<{
|
|
388
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
389
|
+
none: "none";
|
|
390
|
+
"full-auto": "full-auto";
|
|
391
|
+
"full-manual": "full-manual";
|
|
392
|
+
}>>;
|
|
393
|
+
stepPercentage: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>;
|
|
394
|
+
activeGracePeriod: z.ZodOptional<z.ZodNumber>;
|
|
395
|
+
}, z.core.$strict>>;
|
|
396
|
+
image: z.ZodUnion<readonly [z.ZodObject<{
|
|
397
|
+
dockerfile: z.ZodString;
|
|
398
|
+
buildContext: z.ZodOptional<z.ZodString>;
|
|
399
|
+
buildVars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
400
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
401
|
+
reference: z.ZodString;
|
|
402
|
+
}, z.core.$strict>]>;
|
|
403
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
404
|
+
type: z.ZodLiteral<"container">;
|
|
405
|
+
name: z.ZodString;
|
|
406
|
+
observability: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
407
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
408
|
+
logs: z.ZodOptional<z.ZodObject<{
|
|
409
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
410
|
+
}, z.core.$strict>>;
|
|
411
|
+
targetInstancePercentage: z.ZodOptional<z.ZodNumber>;
|
|
412
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
413
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
414
|
+
logs: z.ZodOptional<z.ZodObject<{
|
|
415
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
416
|
+
}, z.core.$strict>>;
|
|
417
|
+
targetInstanceCount: z.ZodOptional<z.ZodNumber>;
|
|
418
|
+
}, z.core.$strict>]>>;
|
|
419
|
+
unsafe: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
420
|
+
schedulingPolicy: z.ZodLiteral<"durable-object">;
|
|
421
|
+
images: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
422
|
+
dockerfile: z.ZodString;
|
|
423
|
+
buildContext: z.ZodOptional<z.ZodString>;
|
|
424
|
+
buildVars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
425
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
426
|
+
reference: z.ZodString;
|
|
427
|
+
}, z.core.$strict>]>>>;
|
|
428
|
+
}, z.core.$strict>]>;
|
|
429
|
+
type ParsedInputContainerConfig = z.output<typeof InputContainerSchema>;
|
|
430
|
+
/**
|
|
431
|
+
* Output Container schema — validates Container configs in the Build Output
|
|
432
|
+
* Specification, after any Dockerfile has been built into a local or remote
|
|
433
|
+
* image reference.
|
|
434
|
+
*/
|
|
435
|
+
declare const OutputContainerSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
436
|
+
type: z.ZodLiteral<"container">;
|
|
437
|
+
name: z.ZodString;
|
|
438
|
+
observability: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
439
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
440
|
+
logs: z.ZodOptional<z.ZodObject<{
|
|
441
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
442
|
+
}, z.core.$strict>>;
|
|
443
|
+
targetInstancePercentage: z.ZodOptional<z.ZodNumber>;
|
|
444
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
445
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
446
|
+
logs: z.ZodOptional<z.ZodObject<{
|
|
447
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
448
|
+
}, z.core.$strict>>;
|
|
449
|
+
targetInstanceCount: z.ZodOptional<z.ZodNumber>;
|
|
450
|
+
}, z.core.$strict>]>>;
|
|
451
|
+
unsafe: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
452
|
+
maxInstances: z.ZodDefault<z.ZodNumber>;
|
|
453
|
+
instanceType: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
454
|
+
basic: "basic";
|
|
455
|
+
lite: "lite";
|
|
456
|
+
"standard-1": "standard-1";
|
|
457
|
+
"standard-2": "standard-2";
|
|
458
|
+
"standard-3": "standard-3";
|
|
459
|
+
"standard-4": "standard-4";
|
|
460
|
+
}>, z.ZodObject<{
|
|
461
|
+
vcpu: z.ZodOptional<z.ZodNumber>;
|
|
462
|
+
memoryMib: z.ZodOptional<z.ZodNumber>;
|
|
463
|
+
diskMb: z.ZodOptional<z.ZodNumber>;
|
|
464
|
+
}, z.core.$strict>]>>;
|
|
465
|
+
schedulingPolicy: z.ZodOptional<z.ZodEnum<{
|
|
466
|
+
default: "default";
|
|
467
|
+
regional: "regional";
|
|
468
|
+
}>>;
|
|
469
|
+
ssh: z.ZodOptional<z.ZodObject<{
|
|
470
|
+
enabled: z.ZodBoolean;
|
|
471
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
472
|
+
}, z.core.$strict>>;
|
|
473
|
+
authorizedKeys: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
474
|
+
name: z.ZodString;
|
|
475
|
+
publicKey: z.ZodString;
|
|
476
|
+
}, z.core.$strict>>>;
|
|
477
|
+
constraints: z.ZodOptional<z.ZodObject<{
|
|
478
|
+
regions: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
479
|
+
ENAM: "ENAM";
|
|
480
|
+
WNAM: "WNAM";
|
|
481
|
+
EEUR: "EEUR";
|
|
482
|
+
WEUR: "WEUR";
|
|
483
|
+
APAC: "APAC";
|
|
484
|
+
SAM: "SAM";
|
|
485
|
+
ME: "ME";
|
|
486
|
+
OC: "OC";
|
|
487
|
+
AFR: "AFR";
|
|
488
|
+
}>>>;
|
|
489
|
+
jurisdiction: z.ZodOptional<z.ZodEnum<{
|
|
490
|
+
eu: "eu";
|
|
491
|
+
fedramp: "fedramp";
|
|
492
|
+
}>>;
|
|
493
|
+
}, z.core.$strict>>;
|
|
494
|
+
rollout: z.ZodOptional<z.ZodObject<{
|
|
495
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
496
|
+
none: "none";
|
|
497
|
+
"full-auto": "full-auto";
|
|
498
|
+
"full-manual": "full-manual";
|
|
499
|
+
}>>;
|
|
500
|
+
stepPercentage: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>;
|
|
501
|
+
activeGracePeriod: z.ZodOptional<z.ZodNumber>;
|
|
502
|
+
}, z.core.$strict>>;
|
|
503
|
+
image: z.ZodUnion<readonly [z.ZodObject<{
|
|
504
|
+
reference: z.ZodString;
|
|
505
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
506
|
+
localReference: z.ZodString;
|
|
507
|
+
}, z.core.$strict>]>;
|
|
508
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
509
|
+
type: z.ZodLiteral<"container">;
|
|
510
|
+
name: z.ZodString;
|
|
511
|
+
observability: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
512
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
513
|
+
logs: z.ZodOptional<z.ZodObject<{
|
|
514
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
515
|
+
}, z.core.$strict>>;
|
|
516
|
+
targetInstancePercentage: z.ZodOptional<z.ZodNumber>;
|
|
517
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
518
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
519
|
+
logs: z.ZodOptional<z.ZodObject<{
|
|
520
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
521
|
+
}, z.core.$strict>>;
|
|
522
|
+
targetInstanceCount: z.ZodOptional<z.ZodNumber>;
|
|
523
|
+
}, z.core.$strict>]>>;
|
|
524
|
+
unsafe: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
525
|
+
schedulingPolicy: z.ZodLiteral<"durable-object">;
|
|
526
|
+
images: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
527
|
+
reference: z.ZodString;
|
|
528
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
529
|
+
localReference: z.ZodString;
|
|
530
|
+
}, z.core.$strict>]>>>;
|
|
531
|
+
}, z.core.$strict>]>;
|
|
532
|
+
type ParsedOutputContainerConfig = z.output<typeof OutputContainerSchema>;
|
|
324
533
|
declare const DurableObjectCreatedExportSchema: z.ZodObject<{
|
|
325
534
|
type: z.ZodLiteral<"durable-object">;
|
|
326
535
|
state: z.ZodOptional<z.ZodLiteral<"created">>;
|
|
@@ -588,177 +797,6 @@ declare const OutputSettingsSchema: z.ZodObject<{
|
|
|
588
797
|
mode: z.ZodOptional<z.ZodString>;
|
|
589
798
|
}, z.core.$strict>;
|
|
590
799
|
type ParsedOutputSettingsConfig = z.output<typeof OutputSettingsSchema>;
|
|
591
|
-
/**
|
|
592
|
-
* Schema for the resolved config exports, keyed by export
|
|
593
|
-
* name. Each value is discriminated on its `type` field. Reserves the
|
|
594
|
-
* `settings` export name exclusively for settings configs: a `settings`
|
|
595
|
-
* config must live on the `settings` export, and the `settings` export
|
|
596
|
-
* may only hold a `settings` config.
|
|
597
|
-
*/
|
|
598
|
-
declare const ConfigExportsSchema: z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodObject<{
|
|
599
|
-
settings: z.ZodOptional<z.ZodObject<{
|
|
600
|
-
type: z.ZodLiteral<"settings">;
|
|
601
|
-
accountId: z.ZodOptional<z.ZodString>;
|
|
602
|
-
complianceRegion: z.ZodOptional<z.ZodEnum<{
|
|
603
|
-
public: "public";
|
|
604
|
-
"fedramp-high": "fedramp-high";
|
|
605
|
-
}>>;
|
|
606
|
-
}, z.core.$strict>>;
|
|
607
|
-
}, z.core.$catchall<z.ZodObject<{
|
|
608
|
-
type: z.ZodLiteral<"worker">;
|
|
609
|
-
name: z.ZodString;
|
|
610
|
-
compatibilityDate: z.ZodString;
|
|
611
|
-
compatibilityFlags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
612
|
-
assets: z.ZodOptional<z.ZodObject<{
|
|
613
|
-
htmlHandling: z.ZodOptional<z.ZodEnum<{
|
|
614
|
-
"auto-trailing-slash": "auto-trailing-slash";
|
|
615
|
-
"drop-trailing-slash": "drop-trailing-slash";
|
|
616
|
-
"force-trailing-slash": "force-trailing-slash";
|
|
617
|
-
none: "none";
|
|
618
|
-
}>>;
|
|
619
|
-
notFoundHandling: z.ZodOptional<z.ZodEnum<{
|
|
620
|
-
none: "none";
|
|
621
|
-
"single-page-application": "single-page-application";
|
|
622
|
-
"404-page": "404-page";
|
|
623
|
-
}>>;
|
|
624
|
-
runWorkerFirst: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodBoolean]>>;
|
|
625
|
-
}, z.core.$strict>>;
|
|
626
|
-
domains: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
627
|
-
triggers: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
628
|
-
type: z.ZodLiteral<"email">;
|
|
629
|
-
addresses: z.ZodArray<z.ZodString>;
|
|
630
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
631
|
-
type: z.ZodLiteral<"fetch">;
|
|
632
|
-
pattern: z.ZodString;
|
|
633
|
-
zone: z.ZodOptional<z.ZodString>;
|
|
634
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
635
|
-
type: z.ZodLiteral<"queue">;
|
|
636
|
-
name: z.ZodString;
|
|
637
|
-
deadLetterQueue: z.ZodOptional<z.ZodString>;
|
|
638
|
-
maxBatchSize: z.ZodOptional<z.ZodNumber>;
|
|
639
|
-
maxBatchTimeout: z.ZodOptional<z.ZodNumber>;
|
|
640
|
-
maxConcurrency: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
641
|
-
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
642
|
-
retryDelay: z.ZodOptional<z.ZodNumber>;
|
|
643
|
-
visibilityTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
644
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
645
|
-
type: z.ZodLiteral<"scheduled">;
|
|
646
|
-
schedule: z.ZodString;
|
|
647
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
648
|
-
type: z.ZodLiteral<"connect">;
|
|
649
|
-
protocol: z.ZodEnum<{
|
|
650
|
-
tcp: "tcp";
|
|
651
|
-
}>;
|
|
652
|
-
port: z.ZodNumber;
|
|
653
|
-
address: z.ZodOptional<z.ZodString>;
|
|
654
|
-
}, z.core.$strict>], "type">>>;
|
|
655
|
-
tailConsumers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
656
|
-
worker: z.ZodString;
|
|
657
|
-
streaming: z.ZodOptional<z.ZodBoolean>;
|
|
658
|
-
}, z.core.$strict>>>;
|
|
659
|
-
cache: z.ZodOptional<z.ZodObject<{
|
|
660
|
-
enabled: z.ZodBoolean;
|
|
661
|
-
crossVersionCache: z.ZodOptional<z.ZodBoolean>;
|
|
662
|
-
}, z.core.$strict>>;
|
|
663
|
-
placement: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
664
|
-
mode: z.ZodEnum<{
|
|
665
|
-
off: "off";
|
|
666
|
-
smart: "smart";
|
|
667
|
-
}>;
|
|
668
|
-
hint: z.ZodOptional<z.ZodString>;
|
|
669
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
670
|
-
mode: z.ZodOptional<z.ZodLiteral<"targeted">>;
|
|
671
|
-
region: z.ZodString;
|
|
672
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
673
|
-
mode: z.ZodOptional<z.ZodLiteral<"targeted">>;
|
|
674
|
-
host: z.ZodString;
|
|
675
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
676
|
-
mode: z.ZodOptional<z.ZodLiteral<"targeted">>;
|
|
677
|
-
hostname: z.ZodString;
|
|
678
|
-
}, z.core.$strict>]>>;
|
|
679
|
-
limits: z.ZodOptional<z.ZodObject<{
|
|
680
|
-
cpuMs: z.ZodOptional<z.ZodNumber>;
|
|
681
|
-
subrequests: z.ZodOptional<z.ZodNumber>;
|
|
682
|
-
}, z.core.$strict>>;
|
|
683
|
-
logpush: z.ZodOptional<z.ZodBoolean>;
|
|
684
|
-
observability: z.ZodOptional<z.ZodObject<{
|
|
685
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
686
|
-
headSamplingRate: z.ZodOptional<z.ZodNumber>;
|
|
687
|
-
redactQueryString: z.ZodOptional<z.ZodBoolean>;
|
|
688
|
-
logs: z.ZodOptional<z.ZodObject<{
|
|
689
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
690
|
-
headSamplingRate: z.ZodOptional<z.ZodNumber>;
|
|
691
|
-
invocationLogs: z.ZodOptional<z.ZodBoolean>;
|
|
692
|
-
persist: z.ZodOptional<z.ZodBoolean>;
|
|
693
|
-
destinations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
694
|
-
}, z.core.$strict>>;
|
|
695
|
-
traces: z.ZodOptional<z.ZodObject<{
|
|
696
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
697
|
-
headSamplingRate: z.ZodOptional<z.ZodNumber>;
|
|
698
|
-
persist: z.ZodOptional<z.ZodBoolean>;
|
|
699
|
-
destinations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
700
|
-
}, z.core.$strict>>;
|
|
701
|
-
}, z.core.$strict>>;
|
|
702
|
-
workersDev: z.ZodOptional<z.ZodBoolean>;
|
|
703
|
-
previewUrls: z.ZodOptional<z.ZodBoolean>;
|
|
704
|
-
firstPartyWorker: z.ZodOptional<z.ZodBoolean>;
|
|
705
|
-
unsafe: z.ZodOptional<z.ZodObject<{
|
|
706
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
707
|
-
capnp: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
708
|
-
basePath: z.ZodString;
|
|
709
|
-
sourceSchemas: z.ZodArray<z.ZodString>;
|
|
710
|
-
compiledSchema: z.ZodOptional<z.ZodNever>;
|
|
711
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
712
|
-
basePath: z.ZodOptional<z.ZodNever>;
|
|
713
|
-
sourceSchemas: z.ZodOptional<z.ZodNever>;
|
|
714
|
-
compiledSchema: z.ZodString;
|
|
715
|
-
}, z.core.$strict>]>>;
|
|
716
|
-
}, z.core.$strict>>;
|
|
717
|
-
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<BindingOutput, BindingInput, z.core.$ZodTypeInternals<BindingOutput, BindingInput>>>>;
|
|
718
|
-
exports: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
719
|
-
type: z.ZodLiteral<"durable-object">;
|
|
720
|
-
state: z.ZodOptional<z.ZodLiteral<"created">>;
|
|
721
|
-
container: z.ZodOptional<z.ZodString>;
|
|
722
|
-
storage: z.ZodLiteral<"sqlite">;
|
|
723
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
724
|
-
type: z.ZodLiteral<"durable-object">;
|
|
725
|
-
state: z.ZodOptional<z.ZodLiteral<"created">>;
|
|
726
|
-
storage: z.ZodLiteral<"legacy-kv">;
|
|
727
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
728
|
-
type: z.ZodLiteral<"durable-object">;
|
|
729
|
-
state: z.ZodLiteral<"deleted">;
|
|
730
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
731
|
-
type: z.ZodLiteral<"durable-object">;
|
|
732
|
-
state: z.ZodLiteral<"renamed">;
|
|
733
|
-
renamedTo: z.ZodString;
|
|
734
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
735
|
-
type: z.ZodLiteral<"durable-object">;
|
|
736
|
-
state: z.ZodLiteral<"transferred">;
|
|
737
|
-
transferredTo: z.ZodString;
|
|
738
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
739
|
-
type: z.ZodLiteral<"durable-object">;
|
|
740
|
-
state: z.ZodLiteral<"expecting-transfer">;
|
|
741
|
-
transferFrom: z.ZodString;
|
|
742
|
-
container: z.ZodOptional<z.ZodString>;
|
|
743
|
-
storage: z.ZodLiteral<"sqlite">;
|
|
744
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
745
|
-
type: z.ZodLiteral<"durable-object">;
|
|
746
|
-
state: z.ZodLiteral<"expecting-transfer">;
|
|
747
|
-
transferFrom: z.ZodString;
|
|
748
|
-
storage: z.ZodLiteral<"legacy-kv">;
|
|
749
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
750
|
-
type: z.ZodLiteral<"worker">;
|
|
751
|
-
cache: z.ZodOptional<z.ZodObject<{
|
|
752
|
-
enabled: z.ZodBoolean;
|
|
753
|
-
}, z.core.$strict>>;
|
|
754
|
-
}, z.core.$strict>]>>>;
|
|
755
|
-
entrypoint: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
756
|
-
default: z.ZodString;
|
|
757
|
-
}, z.core.$strict>]>, z.ZodTransform<string, string | {
|
|
758
|
-
default: string;
|
|
759
|
-
}>>>;
|
|
760
|
-
}, z.core.$strict>>>>;
|
|
761
|
-
type ParsedConfigExports = z.output<typeof ConfigExportsSchema>;
|
|
762
800
|
declare const ModuleTypeSchema: z.ZodEnum<{
|
|
763
801
|
json: "json";
|
|
764
802
|
text: "text";
|
|
@@ -986,15 +1024,18 @@ declare function generateTypes({
|
|
|
986
1024
|
/**
|
|
987
1025
|
* Convert a parsed `@cloudflare/config` config into a Wrangler `RawConfig`.
|
|
988
1026
|
*
|
|
989
|
-
* The caller is responsible for unwrapping any function/promise
|
|
990
|
-
* the
|
|
1027
|
+
* The caller is responsible for unwrapping any function/promise wrappers and
|
|
1028
|
+
* validating the configs against their corresponding input schemas before
|
|
1029
|
+
* passing them in.
|
|
991
1030
|
*
|
|
992
1031
|
* @param workerConfig The parsed (post-validation) Worker config.
|
|
993
1032
|
* @param settingsConfig The optional parsed settings config, whose fields
|
|
994
1033
|
* are merged onto the result.
|
|
1034
|
+
* @param containerExports The parsed Container exports to include in the
|
|
1035
|
+
* result.
|
|
995
1036
|
* @returns The corresponding Wrangler `RawConfig`.
|
|
996
1037
|
*/
|
|
997
|
-
declare function convertToWranglerConfig(workerConfig: ParsedInputWorkerConfig, settingsConfig?: ParsedInputSettingsConfig): RawConfig;
|
|
1038
|
+
declare function convertToWranglerConfig(workerConfig: ParsedInputWorkerConfig, settingsConfig?: ParsedInputSettingsConfig, containerExports?: ParsedInputContainerConfig[]): RawConfig;
|
|
998
1039
|
//#endregion
|
|
999
1040
|
//#region src/load.d.ts
|
|
1000
1041
|
/**
|
|
@@ -1058,20 +1099,34 @@ interface LoadConfigResult {
|
|
|
1058
1099
|
declare function registerConfigHooks(): () => void;
|
|
1059
1100
|
//#endregion
|
|
1060
1101
|
//#region src/config-loader.d.ts
|
|
1102
|
+
type ParsedConfigExports = {
|
|
1103
|
+
default?: ParsedInputWorkerConfig;
|
|
1104
|
+
settings?: ParsedInputSettingsConfig;
|
|
1105
|
+
} & Record<string, ParsedInputContainerConfig | ParsedInputWorkerConfig>;
|
|
1106
|
+
type ConfigParseResult = z.ZodSafeParseSuccess<ParsedConfigExports> | z.ZodSafeParseError<unknown>;
|
|
1061
1107
|
interface LoadAndValidateConfigResult {
|
|
1062
1108
|
/**
|
|
1063
|
-
* Zod result for the
|
|
1109
|
+
* Zod result for the parsed exports record, keyed by JS export name.
|
|
1064
1110
|
* Consumers format `result.error` themselves.
|
|
1065
1111
|
*/
|
|
1066
|
-
result:
|
|
1112
|
+
result: ConfigParseResult;
|
|
1067
1113
|
/** Transitive deps imported while resolving the config (node_modules excluded). */
|
|
1068
1114
|
dependencies: Set<string>;
|
|
1069
1115
|
}
|
|
1070
1116
|
/**
|
|
1071
|
-
*
|
|
1117
|
+
* Resolve and validate loaded `cloudflare.config.ts` exports.
|
|
1118
|
+
*
|
|
1119
|
+
* Config inputs are resolved once by identity. Top-level Worker and Container
|
|
1120
|
+
* exports are also parsed once by identity. References are resolved only far
|
|
1121
|
+
* enough to replace them with resource names, then Container links are
|
|
1122
|
+
* validated across the exported resources.
|
|
1123
|
+
*/
|
|
1124
|
+
declare function resolveAndValidateConfigExports(exports: Record<string, unknown>, ctx: ConfigContext): Promise<ConfigParseResult>;
|
|
1125
|
+
/**
|
|
1126
|
+
* Load a `cloudflare.config.ts`, resolve all exports, and validate them.
|
|
1072
1127
|
*/
|
|
1073
1128
|
declare function loadAndValidateConfig(configPath: string, ctx: ConfigContext, options?: {
|
|
1074
1129
|
include?: string[];
|
|
1075
1130
|
}): Promise<LoadAndValidateConfigResult>;
|
|
1076
1131
|
//#endregion
|
|
1077
|
-
export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, AnalyticsEngineDatasetBindingSchema, ArtifactsBinding, AssetsBinding, AssetsSchema, BindingDevOptions, BindingSchema, Bindings, BrowserBinding, BrowserBindingSchema, ConfigContext,
|
|
1132
|
+
export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, AnalyticsEngineDatasetBindingSchema, ArtifactsBinding, AssetsBinding, AssetsSchema, BindingDevOptions, BindingSchema, Bindings, BrowserBinding, BrowserBindingSchema, ConfigContext, type ConfigParseResult, ConnectTrigger, ContainerConfig, ContainerConfigExport, ContainerConfigInput, D1Binding, D1BindingSchema, DispatchNamespaceBinding, DurableObjectBinding, DurableObjectCreatedExport, DurableObjectCreatedExportSchema, DurableObjectDeletedExport, DurableObjectDeletedExportSchema, DurableObjectExpectingTransferExport, DurableObjectExpectingTransferExportSchema, DurableObjectRenamedExport, DurableObjectRenamedExportSchema, DurableObjectTransferredExport, DurableObjectTransferredExportSchema, EmailTrigger, ExportSchema, Exports, FetchTrigger, FlagshipBinding, FlagshipBindingSchema, HyperdriveBinding, HyperdriveBindingSchema, ImagesBinding, InferDurableNamespaces, InferEnv, InferMainModule, InputContainerSchema, InputSettingsSchema, InputWorkerSchema, JsonBinding, KVBindingSchema, KnownBindingSchema, KvBinding, type LoadAndValidateConfigResult, type LoadConfigResult, LogfwdrBinding, MediaBinding, type ModuleType, ModuleTypeSchema, MtlsCertificateBinding, OutputContainerSchema, OutputSettingsSchema, OutputWorkerSchema, type ParsedConfigExports, type ParsedInputContainerConfig, type ParsedInputSettingsConfig, type ParsedInputWorkerConfig, type ParsedOutputContainerConfig, type ParsedOutputSettingsConfig, type ParsedOutputWorkerConfig, PipelineBinding, QueueBinding, QueueBindingSchema, QueueConsumerTrigger, R2Binding, R2BindingSchema, RateLimitBinding, ScheduledTrigger, SecretBinding, SecretsStoreSecretBinding, SendEmailBinding, SettingsConfig, SettingsConfigExport, SettingsConfigInput, StreamBinding, TailConsumerSchema, TextBinding, Triggers, TypedAiBinding, TypedKvBinding, TypedPipelineBinding, TypedQueueBinding, UnsafeBinding, UnsafeBindingSchema, UnwrapConfig, VectorizeBinding, VersionMetadataBinding, VpcNetworkBinding, VpcServiceBinding, WebSearchBinding, WorkerBinding, WorkerBindingSchema, WorkerConfig, WorkerConfigExport, WorkerConfigInput, WorkerEntrypointExport, WorkerEntrypointExportOptions, WorkerEntrypointExportSchema, WorkerLoaderBinding, WorkerReference, WorkflowBinding, bindings, convertToWranglerConfig, defineContainer, defineSettings, defineWorker, exports, generateTypes, loadAndValidateConfig, loadConfig, registerConfigHooks, resolveAndValidateConfigExports, triggers, validateSingletonBindings };
|