@cloudflare/vite-plugin 1.40.1 → 1.41.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/cf-vite.mjs +5 -7
- package/dist/{dist-MawCthRW.mjs → dist-Cr__Sz5N.mjs} +203 -83
- package/dist/dist-Cr__Sz5N.mjs.map +1 -0
- package/dist/experimental-config.d.mts +9 -7
- package/dist/experimental-config.d.mts.map +1 -1
- package/dist/index.d.mts +5 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +580 -277
- package/dist/index.mjs.map +1 -1
- package/dist/{package-os_6V9kZ.mjs → package-IaRylt-M.mjs} +2 -2
- package/dist/{package-os_6V9kZ.mjs.map → package-IaRylt-M.mjs.map} +1 -1
- package/package.json +8 -8
- package/dist/dist-MawCthRW.mjs.map +0 -1
|
@@ -10,11 +10,7 @@ async function resolveWorkerDefinition(def, ctx) {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
//#endregion
|
|
13
|
-
//#region
|
|
14
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
15
|
-
var __commonJS = (cb, mod) => function() {
|
|
16
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
17
|
-
};
|
|
13
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
|
|
18
14
|
var _a$1;
|
|
19
15
|
/** A special constant with type `never` */
|
|
20
16
|
const NEVER = /* @__PURE__ */ Object.freeze({ status: "aborted" });
|
|
@@ -74,6 +70,9 @@ function config(newConfig) {
|
|
|
74
70
|
if (newConfig) Object.assign(globalConfig, newConfig);
|
|
75
71
|
return globalConfig;
|
|
76
72
|
}
|
|
73
|
+
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js
|
|
77
76
|
function getEnumValues(entries) {
|
|
78
77
|
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
79
78
|
return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
@@ -395,6 +394,9 @@ function issue(...args) {
|
|
|
395
394
|
};
|
|
396
395
|
return { ...iss };
|
|
397
396
|
}
|
|
397
|
+
|
|
398
|
+
//#endregion
|
|
399
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.js
|
|
398
400
|
const initializer$1 = (inst, def) => {
|
|
399
401
|
inst.name = "$ZodError";
|
|
400
402
|
Object.defineProperty(inst, "_zod", {
|
|
@@ -453,6 +455,9 @@ function formatError(error, mapper = (issue$1) => issue$1.message) {
|
|
|
453
455
|
processError(error);
|
|
454
456
|
return fieldErrors;
|
|
455
457
|
}
|
|
458
|
+
|
|
459
|
+
//#endregion
|
|
460
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/parse.js
|
|
456
461
|
const _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
457
462
|
const ctx = _ctx ? {
|
|
458
463
|
..._ctx,
|
|
@@ -470,6 +475,7 @@ const _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
|
470
475
|
}
|
|
471
476
|
return result.value;
|
|
472
477
|
};
|
|
478
|
+
const parse$1 = /* @__PURE__ */ _parse($ZodRealError);
|
|
473
479
|
const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
|
|
474
480
|
const ctx = _ctx ? {
|
|
475
481
|
..._ctx,
|
|
@@ -487,6 +493,7 @@ const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
|
|
|
487
493
|
}
|
|
488
494
|
return result.value;
|
|
489
495
|
};
|
|
496
|
+
const parseAsync$1 = /* @__PURE__ */ _parseAsync($ZodRealError);
|
|
490
497
|
const _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
491
498
|
const ctx = _ctx ? {
|
|
492
499
|
..._ctx,
|
|
@@ -532,9 +539,11 @@ const _encode = (_Err) => (schema, value, _ctx) => {
|
|
|
532
539
|
} : { direction: "backward" };
|
|
533
540
|
return _parse(_Err)(schema, value, ctx);
|
|
534
541
|
};
|
|
542
|
+
const encode$1 = /* @__PURE__ */ _encode($ZodRealError);
|
|
535
543
|
const _decode = (_Err) => (schema, value, _ctx) => {
|
|
536
544
|
return _parse(_Err)(schema, value, _ctx);
|
|
537
545
|
};
|
|
546
|
+
const decode$1 = /* @__PURE__ */ _decode($ZodRealError);
|
|
538
547
|
const _encodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
539
548
|
const ctx = _ctx ? {
|
|
540
549
|
..._ctx,
|
|
@@ -542,9 +551,11 @@ const _encodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
542
551
|
} : { direction: "backward" };
|
|
543
552
|
return _parseAsync(_Err)(schema, value, ctx);
|
|
544
553
|
};
|
|
554
|
+
const encodeAsync$1 = /* @__PURE__ */ _encodeAsync($ZodRealError);
|
|
545
555
|
const _decodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
546
556
|
return _parseAsync(_Err)(schema, value, _ctx);
|
|
547
557
|
};
|
|
558
|
+
const decodeAsync$1 = /* @__PURE__ */ _decodeAsync($ZodRealError);
|
|
548
559
|
const _safeEncode = (_Err) => (schema, value, _ctx) => {
|
|
549
560
|
const ctx = _ctx ? {
|
|
550
561
|
..._ctx,
|
|
@@ -552,9 +563,11 @@ const _safeEncode = (_Err) => (schema, value, _ctx) => {
|
|
|
552
563
|
} : { direction: "backward" };
|
|
553
564
|
return _safeParse(_Err)(schema, value, ctx);
|
|
554
565
|
};
|
|
566
|
+
const safeEncode$1 = /* @__PURE__ */ _safeEncode($ZodRealError);
|
|
555
567
|
const _safeDecode = (_Err) => (schema, value, _ctx) => {
|
|
556
568
|
return _safeParse(_Err)(schema, value, _ctx);
|
|
557
569
|
};
|
|
570
|
+
const safeDecode$1 = /* @__PURE__ */ _safeDecode($ZodRealError);
|
|
558
571
|
const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
559
572
|
const ctx = _ctx ? {
|
|
560
573
|
..._ctx,
|
|
@@ -562,9 +575,14 @@ const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
562
575
|
} : { direction: "backward" };
|
|
563
576
|
return _safeParseAsync(_Err)(schema, value, ctx);
|
|
564
577
|
};
|
|
578
|
+
const safeEncodeAsync$1 = /* @__PURE__ */ _safeEncodeAsync($ZodRealError);
|
|
565
579
|
const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
566
580
|
return _safeParseAsync(_Err)(schema, value, _ctx);
|
|
567
581
|
};
|
|
582
|
+
const safeDecodeAsync$1 = /* @__PURE__ */ _safeDecodeAsync($ZodRealError);
|
|
583
|
+
|
|
584
|
+
//#endregion
|
|
585
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/regexes.js
|
|
568
586
|
/**
|
|
569
587
|
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
570
588
|
* (timestamps embedded in the id). Use {@link cuid2} instead.
|
|
@@ -628,6 +646,9 @@ const boolean$1 = /^(?:true|false)$/i;
|
|
|
628
646
|
const _null$2 = /^null$/i;
|
|
629
647
|
const lowercase = /^[^A-Z]*$/;
|
|
630
648
|
const uppercase = /^[^a-z]*$/;
|
|
649
|
+
|
|
650
|
+
//#endregion
|
|
651
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/checks.js
|
|
631
652
|
const $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
|
|
632
653
|
var _a$2;
|
|
633
654
|
inst._zod ?? (inst._zod = {});
|
|
@@ -984,6 +1005,9 @@ const $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (i
|
|
|
984
1005
|
payload.value = def.tx(payload.value);
|
|
985
1006
|
};
|
|
986
1007
|
});
|
|
1008
|
+
|
|
1009
|
+
//#endregion
|
|
1010
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/doc.js
|
|
987
1011
|
var Doc = class {
|
|
988
1012
|
constructor(args = []) {
|
|
989
1013
|
this.content = [];
|
|
@@ -1013,11 +1037,17 @@ var Doc = class {
|
|
|
1013
1037
|
return new F(...args, lines.join("\n"));
|
|
1014
1038
|
}
|
|
1015
1039
|
};
|
|
1040
|
+
|
|
1041
|
+
//#endregion
|
|
1042
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/versions.js
|
|
1016
1043
|
const version = {
|
|
1017
1044
|
major: 4,
|
|
1018
1045
|
minor: 4,
|
|
1019
1046
|
patch: 3
|
|
1020
1047
|
};
|
|
1048
|
+
|
|
1049
|
+
//#endregion
|
|
1050
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/schemas.js
|
|
1021
1051
|
const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
1022
1052
|
var _a$2;
|
|
1023
1053
|
inst ?? (inst = {});
|
|
@@ -1711,7 +1741,8 @@ const $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def)
|
|
|
1711
1741
|
let fastpass;
|
|
1712
1742
|
const isObject$1 = isObject;
|
|
1713
1743
|
const jit = !globalConfig.jitless;
|
|
1714
|
-
const
|
|
1744
|
+
const allowsEval$1 = allowsEval;
|
|
1745
|
+
const fastEnabled = jit && allowsEval$1.value;
|
|
1715
1746
|
const catchall = def.catchall;
|
|
1716
1747
|
let value;
|
|
1717
1748
|
inst._zod.parse = (payload, ctx) => {
|
|
@@ -2370,6 +2401,9 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
2370
2401
|
payload.issues.push(issue(_iss));
|
|
2371
2402
|
}
|
|
2372
2403
|
}
|
|
2404
|
+
|
|
2405
|
+
//#endregion
|
|
2406
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/registries.js
|
|
2373
2407
|
var _a;
|
|
2374
2408
|
var $ZodRegistry = class {
|
|
2375
2409
|
constructor() {
|
|
@@ -2415,6 +2449,9 @@ function registry() {
|
|
|
2415
2449
|
}
|
|
2416
2450
|
(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
|
|
2417
2451
|
const globalRegistry = globalThis.__zod_globalRegistry;
|
|
2452
|
+
|
|
2453
|
+
//#endregion
|
|
2454
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/api.js
|
|
2418
2455
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2419
2456
|
function _string(Class, params) {
|
|
2420
2457
|
return new Class({
|
|
@@ -2925,6 +2962,35 @@ function _check(fn, params) {
|
|
|
2925
2962
|
ch._zod.check = fn;
|
|
2926
2963
|
return ch;
|
|
2927
2964
|
}
|
|
2965
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2966
|
+
function describe$1(description) {
|
|
2967
|
+
const ch = new $ZodCheck({ check: "describe" });
|
|
2968
|
+
ch._zod.onattach = [(inst) => {
|
|
2969
|
+
const existing = globalRegistry.get(inst) ?? {};
|
|
2970
|
+
globalRegistry.add(inst, {
|
|
2971
|
+
...existing,
|
|
2972
|
+
description
|
|
2973
|
+
});
|
|
2974
|
+
}];
|
|
2975
|
+
ch._zod.check = () => {};
|
|
2976
|
+
return ch;
|
|
2977
|
+
}
|
|
2978
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2979
|
+
function meta$1(metadata) {
|
|
2980
|
+
const ch = new $ZodCheck({ check: "meta" });
|
|
2981
|
+
ch._zod.onattach = [(inst) => {
|
|
2982
|
+
const existing = globalRegistry.get(inst) ?? {};
|
|
2983
|
+
globalRegistry.add(inst, {
|
|
2984
|
+
...existing,
|
|
2985
|
+
...metadata
|
|
2986
|
+
});
|
|
2987
|
+
}];
|
|
2988
|
+
ch._zod.check = () => {};
|
|
2989
|
+
return ch;
|
|
2990
|
+
}
|
|
2991
|
+
|
|
2992
|
+
//#endregion
|
|
2993
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/to-json-schema.js
|
|
2928
2994
|
function initializeContext(params) {
|
|
2929
2995
|
let target = params?.target ?? "draft-2020-12";
|
|
2930
2996
|
if (target === "draft-4") target = "draft-04";
|
|
@@ -3216,6 +3282,9 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
|
|
|
3216
3282
|
extractDefs(ctx, schema);
|
|
3217
3283
|
return finalize(ctx, schema);
|
|
3218
3284
|
};
|
|
3285
|
+
|
|
3286
|
+
//#endregion
|
|
3287
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/json-schema-processors.js
|
|
3219
3288
|
const formatMap = {
|
|
3220
3289
|
guid: "uuid",
|
|
3221
3290
|
url: "uri",
|
|
@@ -3497,34 +3566,40 @@ const lazyProcessor = (schema, ctx, _json, params) => {
|
|
|
3497
3566
|
const seen = ctx.seen.get(schema);
|
|
3498
3567
|
seen.ref = innerType;
|
|
3499
3568
|
};
|
|
3569
|
+
|
|
3570
|
+
//#endregion
|
|
3571
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/iso.js
|
|
3500
3572
|
const ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
|
|
3501
3573
|
$ZodISODateTime.init(inst, def);
|
|
3502
3574
|
ZodStringFormat.init(inst, def);
|
|
3503
3575
|
});
|
|
3504
3576
|
function datetime(params) {
|
|
3505
|
-
return
|
|
3577
|
+
return _isoDateTime(ZodISODateTime, params);
|
|
3506
3578
|
}
|
|
3507
3579
|
const ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => {
|
|
3508
3580
|
$ZodISODate.init(inst, def);
|
|
3509
3581
|
ZodStringFormat.init(inst, def);
|
|
3510
3582
|
});
|
|
3511
3583
|
function date(params) {
|
|
3512
|
-
return
|
|
3584
|
+
return _isoDate(ZodISODate, params);
|
|
3513
3585
|
}
|
|
3514
3586
|
const ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => {
|
|
3515
3587
|
$ZodISOTime.init(inst, def);
|
|
3516
3588
|
ZodStringFormat.init(inst, def);
|
|
3517
3589
|
});
|
|
3518
3590
|
function time(params) {
|
|
3519
|
-
return
|
|
3591
|
+
return _isoTime(ZodISOTime, params);
|
|
3520
3592
|
}
|
|
3521
3593
|
const ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => {
|
|
3522
3594
|
$ZodISODuration.init(inst, def);
|
|
3523
3595
|
ZodStringFormat.init(inst, def);
|
|
3524
3596
|
});
|
|
3525
3597
|
function duration(params) {
|
|
3526
|
-
return
|
|
3598
|
+
return _isoDuration(ZodISODuration, params);
|
|
3527
3599
|
}
|
|
3600
|
+
|
|
3601
|
+
//#endregion
|
|
3602
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/errors.js
|
|
3528
3603
|
const initializer = (inst, issues) => {
|
|
3529
3604
|
$ZodError.init(inst, issues);
|
|
3530
3605
|
inst.name = "ZodError";
|
|
@@ -3545,6 +3620,9 @@ const initializer = (inst, issues) => {
|
|
|
3545
3620
|
});
|
|
3546
3621
|
};
|
|
3547
3622
|
const ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer, { Parent: Error });
|
|
3623
|
+
|
|
3624
|
+
//#endregion
|
|
3625
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/parse.js
|
|
3548
3626
|
const parse = /* @__PURE__ */ _parse(ZodRealError);
|
|
3549
3627
|
const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
3550
3628
|
const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
@@ -3557,6 +3635,9 @@ const safeEncode = /* @__PURE__ */ _safeEncode(ZodRealError);
|
|
|
3557
3635
|
const safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
3558
3636
|
const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
3559
3637
|
const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
3638
|
+
|
|
3639
|
+
//#endregion
|
|
3640
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/schemas.js
|
|
3560
3641
|
const _installedGroups = /* @__PURE__ */ new WeakMap();
|
|
3561
3642
|
function _installLazyMethods(inst, group, methods) {
|
|
3562
3643
|
const proto = Object.getPrototypeOf(inst);
|
|
@@ -3645,7 +3726,7 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
3645
3726
|
return this.check(superRefine(refinement, params));
|
|
3646
3727
|
},
|
|
3647
3728
|
overwrite(fn) {
|
|
3648
|
-
return this.check(
|
|
3729
|
+
return this.check(_overwrite(fn));
|
|
3649
3730
|
},
|
|
3650
3731
|
optional() {
|
|
3651
3732
|
return optional(this);
|
|
@@ -3729,85 +3810,85 @@ const _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
|
|
|
3729
3810
|
inst.maxLength = bag.maximum ?? null;
|
|
3730
3811
|
_installLazyMethods(inst, "_ZodString", {
|
|
3731
3812
|
regex(...args) {
|
|
3732
|
-
return this.check(
|
|
3813
|
+
return this.check(_regex(...args));
|
|
3733
3814
|
},
|
|
3734
3815
|
includes(...args) {
|
|
3735
|
-
return this.check(
|
|
3816
|
+
return this.check(_includes(...args));
|
|
3736
3817
|
},
|
|
3737
3818
|
startsWith(...args) {
|
|
3738
|
-
return this.check(
|
|
3819
|
+
return this.check(_startsWith(...args));
|
|
3739
3820
|
},
|
|
3740
3821
|
endsWith(...args) {
|
|
3741
|
-
return this.check(
|
|
3822
|
+
return this.check(_endsWith(...args));
|
|
3742
3823
|
},
|
|
3743
3824
|
min(...args) {
|
|
3744
|
-
return this.check(
|
|
3825
|
+
return this.check(_minLength(...args));
|
|
3745
3826
|
},
|
|
3746
3827
|
max(...args) {
|
|
3747
|
-
return this.check(
|
|
3828
|
+
return this.check(_maxLength(...args));
|
|
3748
3829
|
},
|
|
3749
3830
|
length(...args) {
|
|
3750
|
-
return this.check(
|
|
3831
|
+
return this.check(_length(...args));
|
|
3751
3832
|
},
|
|
3752
3833
|
nonempty(...args) {
|
|
3753
|
-
return this.check(
|
|
3834
|
+
return this.check(_minLength(1, ...args));
|
|
3754
3835
|
},
|
|
3755
3836
|
lowercase(params) {
|
|
3756
|
-
return this.check(
|
|
3837
|
+
return this.check(_lowercase(params));
|
|
3757
3838
|
},
|
|
3758
3839
|
uppercase(params) {
|
|
3759
|
-
return this.check(
|
|
3840
|
+
return this.check(_uppercase(params));
|
|
3760
3841
|
},
|
|
3761
3842
|
trim() {
|
|
3762
|
-
return this.check(
|
|
3843
|
+
return this.check(_trim());
|
|
3763
3844
|
},
|
|
3764
3845
|
normalize(...args) {
|
|
3765
|
-
return this.check(
|
|
3846
|
+
return this.check(_normalize(...args));
|
|
3766
3847
|
},
|
|
3767
3848
|
toLowerCase() {
|
|
3768
|
-
return this.check(
|
|
3849
|
+
return this.check(_toLowerCase());
|
|
3769
3850
|
},
|
|
3770
3851
|
toUpperCase() {
|
|
3771
|
-
return this.check(
|
|
3852
|
+
return this.check(_toUpperCase());
|
|
3772
3853
|
},
|
|
3773
3854
|
slugify() {
|
|
3774
|
-
return this.check(
|
|
3855
|
+
return this.check(_slugify());
|
|
3775
3856
|
}
|
|
3776
3857
|
});
|
|
3777
3858
|
});
|
|
3778
3859
|
const ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
|
|
3779
3860
|
$ZodString.init(inst, def);
|
|
3780
3861
|
_ZodString.init(inst, def);
|
|
3781
|
-
inst.email = (params) => inst.check(
|
|
3782
|
-
inst.url = (params) => inst.check(
|
|
3783
|
-
inst.jwt = (params) => inst.check(
|
|
3784
|
-
inst.emoji = (params) => inst.check(
|
|
3785
|
-
inst.guid = (params) => inst.check(
|
|
3786
|
-
inst.uuid = (params) => inst.check(
|
|
3787
|
-
inst.uuidv4 = (params) => inst.check(
|
|
3788
|
-
inst.uuidv6 = (params) => inst.check(
|
|
3789
|
-
inst.uuidv7 = (params) => inst.check(
|
|
3790
|
-
inst.nanoid = (params) => inst.check(
|
|
3791
|
-
inst.guid = (params) => inst.check(
|
|
3792
|
-
inst.cuid = (params) => inst.check(
|
|
3793
|
-
inst.cuid2 = (params) => inst.check(
|
|
3794
|
-
inst.ulid = (params) => inst.check(
|
|
3795
|
-
inst.base64 = (params) => inst.check(
|
|
3796
|
-
inst.base64url = (params) => inst.check(
|
|
3797
|
-
inst.xid = (params) => inst.check(
|
|
3798
|
-
inst.ksuid = (params) => inst.check(
|
|
3799
|
-
inst.ipv4 = (params) => inst.check(
|
|
3800
|
-
inst.ipv6 = (params) => inst.check(
|
|
3801
|
-
inst.cidrv4 = (params) => inst.check(
|
|
3802
|
-
inst.cidrv6 = (params) => inst.check(
|
|
3803
|
-
inst.e164 = (params) => inst.check(
|
|
3862
|
+
inst.email = (params) => inst.check(_email(ZodEmail, params));
|
|
3863
|
+
inst.url = (params) => inst.check(_url(ZodURL, params));
|
|
3864
|
+
inst.jwt = (params) => inst.check(_jwt(ZodJWT, params));
|
|
3865
|
+
inst.emoji = (params) => inst.check(_emoji(ZodEmoji, params));
|
|
3866
|
+
inst.guid = (params) => inst.check(_guid(ZodGUID, params));
|
|
3867
|
+
inst.uuid = (params) => inst.check(_uuid(ZodUUID, params));
|
|
3868
|
+
inst.uuidv4 = (params) => inst.check(_uuidv4(ZodUUID, params));
|
|
3869
|
+
inst.uuidv6 = (params) => inst.check(_uuidv6(ZodUUID, params));
|
|
3870
|
+
inst.uuidv7 = (params) => inst.check(_uuidv7(ZodUUID, params));
|
|
3871
|
+
inst.nanoid = (params) => inst.check(_nanoid(ZodNanoID, params));
|
|
3872
|
+
inst.guid = (params) => inst.check(_guid(ZodGUID, params));
|
|
3873
|
+
inst.cuid = (params) => inst.check(_cuid(ZodCUID, params));
|
|
3874
|
+
inst.cuid2 = (params) => inst.check(_cuid2(ZodCUID2, params));
|
|
3875
|
+
inst.ulid = (params) => inst.check(_ulid(ZodULID, params));
|
|
3876
|
+
inst.base64 = (params) => inst.check(_base64(ZodBase64, params));
|
|
3877
|
+
inst.base64url = (params) => inst.check(_base64url(ZodBase64URL, params));
|
|
3878
|
+
inst.xid = (params) => inst.check(_xid(ZodXID, params));
|
|
3879
|
+
inst.ksuid = (params) => inst.check(_ksuid(ZodKSUID, params));
|
|
3880
|
+
inst.ipv4 = (params) => inst.check(_ipv4(ZodIPv4, params));
|
|
3881
|
+
inst.ipv6 = (params) => inst.check(_ipv6(ZodIPv6, params));
|
|
3882
|
+
inst.cidrv4 = (params) => inst.check(_cidrv4(ZodCIDRv4, params));
|
|
3883
|
+
inst.cidrv6 = (params) => inst.check(_cidrv6(ZodCIDRv6, params));
|
|
3884
|
+
inst.e164 = (params) => inst.check(_e164(ZodE164, params));
|
|
3804
3885
|
inst.datetime = (params) => inst.check(datetime(params));
|
|
3805
3886
|
inst.date = (params) => inst.check(date(params));
|
|
3806
3887
|
inst.time = (params) => inst.check(time(params));
|
|
3807
3888
|
inst.duration = (params) => inst.check(duration(params));
|
|
3808
3889
|
});
|
|
3809
3890
|
function string(params) {
|
|
3810
|
-
return
|
|
3891
|
+
return _string(ZodString, params);
|
|
3811
3892
|
}
|
|
3812
3893
|
const ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def) => {
|
|
3813
3894
|
$ZodStringFormat.init(inst, def);
|
|
@@ -3900,22 +3981,22 @@ const ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
|
|
|
3900
3981
|
inst._zod.processJSONSchema = (ctx, json$1, params) => numberProcessor(inst, ctx, json$1, params);
|
|
3901
3982
|
_installLazyMethods(inst, "ZodNumber", {
|
|
3902
3983
|
gt(value, params) {
|
|
3903
|
-
return this.check(
|
|
3984
|
+
return this.check(_gt(value, params));
|
|
3904
3985
|
},
|
|
3905
3986
|
gte(value, params) {
|
|
3906
|
-
return this.check(
|
|
3987
|
+
return this.check(_gte(value, params));
|
|
3907
3988
|
},
|
|
3908
3989
|
min(value, params) {
|
|
3909
|
-
return this.check(
|
|
3990
|
+
return this.check(_gte(value, params));
|
|
3910
3991
|
},
|
|
3911
3992
|
lt(value, params) {
|
|
3912
|
-
return this.check(
|
|
3993
|
+
return this.check(_lt(value, params));
|
|
3913
3994
|
},
|
|
3914
3995
|
lte(value, params) {
|
|
3915
|
-
return this.check(
|
|
3996
|
+
return this.check(_lte(value, params));
|
|
3916
3997
|
},
|
|
3917
3998
|
max(value, params) {
|
|
3918
|
-
return this.check(
|
|
3999
|
+
return this.check(_lte(value, params));
|
|
3919
4000
|
},
|
|
3920
4001
|
int(params) {
|
|
3921
4002
|
return this.check(int(params));
|
|
@@ -3924,22 +4005,22 @@ const ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
|
|
|
3924
4005
|
return this.check(int(params));
|
|
3925
4006
|
},
|
|
3926
4007
|
positive(params) {
|
|
3927
|
-
return this.check(
|
|
4008
|
+
return this.check(_gt(0, params));
|
|
3928
4009
|
},
|
|
3929
4010
|
nonnegative(params) {
|
|
3930
|
-
return this.check(
|
|
4011
|
+
return this.check(_gte(0, params));
|
|
3931
4012
|
},
|
|
3932
4013
|
negative(params) {
|
|
3933
|
-
return this.check(
|
|
4014
|
+
return this.check(_lt(0, params));
|
|
3934
4015
|
},
|
|
3935
4016
|
nonpositive(params) {
|
|
3936
|
-
return this.check(
|
|
4017
|
+
return this.check(_lte(0, params));
|
|
3937
4018
|
},
|
|
3938
4019
|
multipleOf(value, params) {
|
|
3939
|
-
return this.check(
|
|
4020
|
+
return this.check(_multipleOf(value, params));
|
|
3940
4021
|
},
|
|
3941
4022
|
step(value, params) {
|
|
3942
|
-
return this.check(
|
|
4023
|
+
return this.check(_multipleOf(value, params));
|
|
3943
4024
|
},
|
|
3944
4025
|
finite() {
|
|
3945
4026
|
return this;
|
|
@@ -3953,14 +4034,14 @@ const ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
|
|
|
3953
4034
|
inst.format = bag.format ?? null;
|
|
3954
4035
|
});
|
|
3955
4036
|
function number(params) {
|
|
3956
|
-
return
|
|
4037
|
+
return _number(ZodNumber, params);
|
|
3957
4038
|
}
|
|
3958
4039
|
const ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, def) => {
|
|
3959
4040
|
$ZodNumberFormat.init(inst, def);
|
|
3960
4041
|
ZodNumber.init(inst, def);
|
|
3961
4042
|
});
|
|
3962
4043
|
function int(params) {
|
|
3963
|
-
return
|
|
4044
|
+
return _int(ZodNumberFormat, params);
|
|
3964
4045
|
}
|
|
3965
4046
|
const ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
|
|
3966
4047
|
$ZodBoolean.init(inst, def);
|
|
@@ -3968,7 +4049,7 @@ const ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
|
|
|
3968
4049
|
inst._zod.processJSONSchema = (ctx, json$1, params) => booleanProcessor(inst, ctx, json$1, params);
|
|
3969
4050
|
});
|
|
3970
4051
|
function boolean(params) {
|
|
3971
|
-
return
|
|
4052
|
+
return _boolean(ZodBoolean, params);
|
|
3972
4053
|
}
|
|
3973
4054
|
const ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => {
|
|
3974
4055
|
$ZodNull.init(inst, def);
|
|
@@ -3976,7 +4057,7 @@ const ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => {
|
|
|
3976
4057
|
inst._zod.processJSONSchema = (ctx, json$1, params) => nullProcessor(inst, ctx, json$1, params);
|
|
3977
4058
|
});
|
|
3978
4059
|
function _null(params) {
|
|
3979
|
-
return
|
|
4060
|
+
return _null$1(ZodNull, params);
|
|
3980
4061
|
}
|
|
3981
4062
|
const ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
|
|
3982
4063
|
$ZodUnknown.init(inst, def);
|
|
@@ -3984,7 +4065,7 @@ const ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
|
|
|
3984
4065
|
inst._zod.processJSONSchema = (ctx, json$1, params) => unknownProcessor(inst, ctx, json$1, params);
|
|
3985
4066
|
});
|
|
3986
4067
|
function unknown() {
|
|
3987
|
-
return
|
|
4068
|
+
return _unknown(ZodUnknown);
|
|
3988
4069
|
}
|
|
3989
4070
|
const ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
|
|
3990
4071
|
$ZodNever.init(inst, def);
|
|
@@ -3992,7 +4073,7 @@ const ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
|
|
|
3992
4073
|
inst._zod.processJSONSchema = (ctx, json$1, params) => neverProcessor(inst, ctx, json$1, params);
|
|
3993
4074
|
});
|
|
3994
4075
|
function never(params) {
|
|
3995
|
-
return
|
|
4076
|
+
return _never(ZodNever, params);
|
|
3996
4077
|
}
|
|
3997
4078
|
const ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
|
|
3998
4079
|
$ZodArray.init(inst, def);
|
|
@@ -4001,16 +4082,16 @@ const ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
|
|
|
4001
4082
|
inst.element = def.element;
|
|
4002
4083
|
_installLazyMethods(inst, "ZodArray", {
|
|
4003
4084
|
min(n, params) {
|
|
4004
|
-
return this.check(
|
|
4085
|
+
return this.check(_minLength(n, params));
|
|
4005
4086
|
},
|
|
4006
4087
|
nonempty(params) {
|
|
4007
|
-
return this.check(
|
|
4088
|
+
return this.check(_minLength(1, params));
|
|
4008
4089
|
},
|
|
4009
4090
|
max(n, params) {
|
|
4010
|
-
return this.check(
|
|
4091
|
+
return this.check(_maxLength(n, params));
|
|
4011
4092
|
},
|
|
4012
4093
|
length(n, params) {
|
|
4013
|
-
return this.check(
|
|
4094
|
+
return this.check(_length(n, params));
|
|
4014
4095
|
},
|
|
4015
4096
|
unwrap() {
|
|
4016
4097
|
return this.element;
|
|
@@ -4018,7 +4099,7 @@ const ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
|
|
|
4018
4099
|
});
|
|
4019
4100
|
});
|
|
4020
4101
|
function array(element, params) {
|
|
4021
|
-
return
|
|
4102
|
+
return _array(ZodArray, element, params);
|
|
4022
4103
|
}
|
|
4023
4104
|
const ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
|
|
4024
4105
|
$ZodObjectJIT.init(inst, def);
|
|
@@ -4396,11 +4477,13 @@ const ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
|
|
|
4396
4477
|
inst._zod.processJSONSchema = (ctx, json$1, params) => customProcessor(inst, ctx, json$1, params);
|
|
4397
4478
|
});
|
|
4398
4479
|
function refine(fn, _params = {}) {
|
|
4399
|
-
return
|
|
4480
|
+
return _refine(ZodCustom, fn, _params);
|
|
4400
4481
|
}
|
|
4401
4482
|
function superRefine(fn, params) {
|
|
4402
|
-
return
|
|
4483
|
+
return _superRefine(fn, params);
|
|
4403
4484
|
}
|
|
4485
|
+
const describe = describe$1;
|
|
4486
|
+
const meta = meta$1;
|
|
4404
4487
|
function json(params) {
|
|
4405
4488
|
const jsonSchema = lazy(() => {
|
|
4406
4489
|
return union([
|
|
@@ -4414,6 +4497,13 @@ function json(params) {
|
|
|
4414
4497
|
});
|
|
4415
4498
|
return jsonSchema;
|
|
4416
4499
|
}
|
|
4500
|
+
|
|
4501
|
+
//#endregion
|
|
4502
|
+
//#region ../config/dist/index.mjs
|
|
4503
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4504
|
+
var __commonJS = (cb, mod) => function() {
|
|
4505
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
4506
|
+
};
|
|
4417
4507
|
const AssetsSchema = strictObject({
|
|
4418
4508
|
htmlHandling: _enum([
|
|
4419
4509
|
"auto-trailing-slash",
|
|
@@ -4732,12 +4822,15 @@ const UnsafeSchema = strictObject({
|
|
|
4732
4822
|
compiledSchema: string()
|
|
4733
4823
|
})]).optional()
|
|
4734
4824
|
});
|
|
4735
|
-
|
|
4736
|
-
|
|
4825
|
+
/**
|
|
4826
|
+
* Base Worker schema — the set of fields shared between the input
|
|
4827
|
+
* (user-authored) and output (on-disk) Worker configs.
|
|
4828
|
+
*/
|
|
4829
|
+
const BaseWorkerSchema = strictObject({
|
|
4830
|
+
name: string(),
|
|
4737
4831
|
accountId: string().optional(),
|
|
4738
|
-
compatibilityDate: string()
|
|
4832
|
+
compatibilityDate: string(),
|
|
4739
4833
|
compatibilityFlags: array(string()).optional(),
|
|
4740
|
-
entrypoint: union([string(), strictObject({ default: string() })]).transform((value) => typeof value === "string" ? value : value.default).optional(),
|
|
4741
4834
|
assets: AssetsSchema.optional(),
|
|
4742
4835
|
domains: array(string()).optional(),
|
|
4743
4836
|
triggers: array(TriggerSchema).optional(),
|
|
@@ -4755,6 +4848,33 @@ const ConfigSchema = strictObject({
|
|
|
4755
4848
|
env: EnvSchema,
|
|
4756
4849
|
exports: record(string(), ExportSchema).optional()
|
|
4757
4850
|
});
|
|
4851
|
+
/**
|
|
4852
|
+
* Input Worker schema — the shape that user-authored `cloudflare.config.ts`
|
|
4853
|
+
* files are validated against. Adds an optional `entrypoint` field to the
|
|
4854
|
+
* base schema.
|
|
4855
|
+
*/
|
|
4856
|
+
const InputWorkerSchema = BaseWorkerSchema.extend({ entrypoint: union([string(), strictObject({ default: string() })]).transform((value) => typeof value === "string" ? value : value.default).optional() });
|
|
4857
|
+
const ModuleTypeSchema = _enum([
|
|
4858
|
+
"esm",
|
|
4859
|
+
"cjs",
|
|
4860
|
+
"python",
|
|
4861
|
+
"pythonRequirement",
|
|
4862
|
+
"wasm",
|
|
4863
|
+
"text",
|
|
4864
|
+
"data",
|
|
4865
|
+
"json",
|
|
4866
|
+
"sourcemap"
|
|
4867
|
+
]);
|
|
4868
|
+
const ManifestSchema = strictObject({
|
|
4869
|
+
mainModule: string(),
|
|
4870
|
+
modules: record(string(), strictObject({ type: ModuleTypeSchema }))
|
|
4871
|
+
});
|
|
4872
|
+
/**
|
|
4873
|
+
* Output Worker schema — the shape of `worker.config.json` in the
|
|
4874
|
+
* Build Output API. Adds an optional `manifest` field to the
|
|
4875
|
+
* base schema.
|
|
4876
|
+
*/
|
|
4877
|
+
const OutputWorkerSchema = BaseWorkerSchema.extend({ manifest: ManifestSchema.optional() });
|
|
4758
4878
|
var import_dist = (/* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ts-dedent@2.2.0/node_modules/ts-dedent/dist/index.js": ((exports$1) => {
|
|
4759
4879
|
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
4760
4880
|
exports$1.dedent = void 0;
|
|
@@ -4833,7 +4953,7 @@ function generateTypes({ configPath, packageName = "@cloudflare/config" }) {
|
|
|
4833
4953
|
* Convert a parsed `@cloudflare/config` config into a Wrangler `RawConfig`.
|
|
4834
4954
|
*
|
|
4835
4955
|
* The caller is responsible for unwrapping any function/promise wrapper around
|
|
4836
|
-
* the config and validating it against `
|
|
4956
|
+
* the config and validating it against `InputWorkerSchema` before passing it in.
|
|
4837
4957
|
*
|
|
4838
4958
|
* @param config The parsed (post-validation) config.
|
|
4839
4959
|
* @returns The corresponding Wrangler `RawConfig`.
|
|
@@ -5320,7 +5440,7 @@ const depsStore = new AsyncLocalStorage();
|
|
|
5320
5440
|
* Returns the module's default export, plus the set of file paths
|
|
5321
5441
|
* imported during resolution. Callers are responsible for unwrapping
|
|
5322
5442
|
* function/promise wrappers around the returned value and validating it
|
|
5323
|
-
* against `
|
|
5443
|
+
* against `InputWorkerSchema`.
|
|
5324
5444
|
*
|
|
5325
5445
|
* @param configPath Filesystem path to the config file. Relative paths are
|
|
5326
5446
|
* resolved against `process.cwd()`.
|
|
@@ -5410,5 +5530,5 @@ function cleanupImportAttributes(context) {
|
|
|
5410
5530
|
}
|
|
5411
5531
|
|
|
5412
5532
|
//#endregion
|
|
5413
|
-
export {
|
|
5414
|
-
//# sourceMappingURL=dist-
|
|
5533
|
+
export { InputWorkerSchema, OutputWorkerSchema, convertToWranglerConfig, generateTypes, loadConfig, resolveWorkerDefinition };
|
|
5534
|
+
//# sourceMappingURL=dist-Cr__Sz5N.mjs.map
|