@getexception/cli 0.1.27 → 0.1.28
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.js +1650 -779
- package/dist/integration.js +1658 -787
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -18,6 +18,7 @@ __export(external_exports, {
|
|
|
18
18
|
$brand: () => $brand,
|
|
19
19
|
$input: () => $input,
|
|
20
20
|
$output: () => $output,
|
|
21
|
+
INVALID: () => INVALID,
|
|
21
22
|
NEVER: () => NEVER,
|
|
22
23
|
TimePrecision: () => TimePrecision,
|
|
23
24
|
ZodAny: () => ZodAny,
|
|
@@ -51,12 +52,14 @@ __export(external_exports, {
|
|
|
51
52
|
ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
|
|
52
53
|
ZodFunction: () => ZodFunction,
|
|
53
54
|
ZodGUID: () => ZodGUID,
|
|
55
|
+
ZodIBAN: () => ZodIBAN,
|
|
54
56
|
ZodIPv4: () => ZodIPv4,
|
|
55
57
|
ZodIPv6: () => ZodIPv6,
|
|
56
58
|
ZodISODate: () => ZodISODate,
|
|
57
59
|
ZodISODateTime: () => ZodISODateTime,
|
|
58
60
|
ZodISODuration: () => ZodISODuration,
|
|
59
61
|
ZodISOTime: () => ZodISOTime,
|
|
62
|
+
ZodInstanceOf: () => ZodInstanceOf,
|
|
60
63
|
ZodIntersection: () => ZodIntersection,
|
|
61
64
|
ZodIssueCode: () => ZodIssueCode,
|
|
62
65
|
ZodJWT: () => ZodJWT,
|
|
@@ -122,6 +125,7 @@ __export(external_exports, {
|
|
|
122
125
|
creditCard: () => creditCard2,
|
|
123
126
|
cuid: () => cuid3,
|
|
124
127
|
cuid2: () => cuid22,
|
|
128
|
+
currencyCode: () => currencyCode2,
|
|
125
129
|
custom: () => custom,
|
|
126
130
|
date: () => date2,
|
|
127
131
|
decode: () => decode2,
|
|
@@ -154,6 +158,7 @@ __export(external_exports, {
|
|
|
154
158
|
hex: () => hex2,
|
|
155
159
|
hostname: () => hostname2,
|
|
156
160
|
httpUrl: () => httpUrl,
|
|
161
|
+
iban: () => iban2,
|
|
157
162
|
includes: () => _includes,
|
|
158
163
|
input: () => input,
|
|
159
164
|
instanceof: () => _instanceof,
|
|
@@ -265,6 +270,7 @@ __export(external_exports, {
|
|
|
265
270
|
validate: () => validate,
|
|
266
271
|
validateAsync: () => validateAsync,
|
|
267
272
|
void: () => _void2,
|
|
273
|
+
withParser: () => withParser,
|
|
268
274
|
xid: () => xid2,
|
|
269
275
|
xor: () => xor
|
|
270
276
|
});
|
|
@@ -301,6 +307,7 @@ __export(core_exports2, {
|
|
|
301
307
|
$ZodCheckMultipleOf: () => $ZodCheckMultipleOf,
|
|
302
308
|
$ZodCheckNumberFormat: () => $ZodCheckNumberFormat,
|
|
303
309
|
$ZodCheckOverwrite: () => $ZodCheckOverwrite,
|
|
310
|
+
$ZodCheckProperties: () => $ZodCheckProperties,
|
|
304
311
|
$ZodCheckProperty: () => $ZodCheckProperty,
|
|
305
312
|
$ZodCheckRegex: () => $ZodCheckRegex,
|
|
306
313
|
$ZodCheckSizeEquals: () => $ZodCheckSizeEquals,
|
|
@@ -325,6 +332,7 @@ __export(core_exports2, {
|
|
|
325
332
|
$ZodFile: () => $ZodFile,
|
|
326
333
|
$ZodFunction: () => $ZodFunction,
|
|
327
334
|
$ZodGUID: () => $ZodGUID,
|
|
335
|
+
$ZodIBAN: () => $ZodIBAN,
|
|
328
336
|
$ZodIPv4: () => $ZodIPv4,
|
|
329
337
|
$ZodIPv6: () => $ZodIPv6,
|
|
330
338
|
$ZodISODate: () => $ZodISODate,
|
|
@@ -426,6 +434,7 @@ __export(core_exports2, {
|
|
|
426
434
|
_gt: () => _gt,
|
|
427
435
|
_gte: () => _gte,
|
|
428
436
|
_guid: () => _guid,
|
|
437
|
+
_iban: () => _iban,
|
|
429
438
|
_includes: () => _includes,
|
|
430
439
|
_int: () => _int,
|
|
431
440
|
_int32: () => _int32,
|
|
@@ -517,6 +526,9 @@ __export(core_exports2, {
|
|
|
517
526
|
_void: () => _void,
|
|
518
527
|
_xid: () => _xid,
|
|
519
528
|
_xor: () => _xor,
|
|
529
|
+
base64Charset: () => base64Charset,
|
|
530
|
+
base64urlCharset: () => base64urlCharset,
|
|
531
|
+
canParseURL: () => canParseURL,
|
|
520
532
|
clone: () => clone,
|
|
521
533
|
compile: () => compile,
|
|
522
534
|
compileFn: () => compileFn,
|
|
@@ -543,6 +555,7 @@ __export(core_exports2, {
|
|
|
543
555
|
isValidBase64URL: () => isValidBase64URL,
|
|
544
556
|
isValidCIDRv6: () => isValidCIDRv6,
|
|
545
557
|
isValidCreditCard: () => isValidCreditCard,
|
|
558
|
+
isValidIBAN: () => isValidIBAN,
|
|
546
559
|
isValidIPv6: () => isValidIPv6,
|
|
547
560
|
isValidJWT: () => isValidJWT,
|
|
548
561
|
locales: () => locales_exports,
|
|
@@ -553,7 +566,8 @@ __export(core_exports2, {
|
|
|
553
566
|
parseAsync: () => parseAsync,
|
|
554
567
|
parseURLObject: () => parseURLObject,
|
|
555
568
|
prettifyError: () => prettifyError,
|
|
556
|
-
process: () =>
|
|
569
|
+
process: () => processSchema,
|
|
570
|
+
processSchema: () => processSchema,
|
|
557
571
|
regexes: () => regexes_exports,
|
|
558
572
|
registry: () => registry,
|
|
559
573
|
safeDecode: () => safeDecode,
|
|
@@ -573,7 +587,9 @@ __export(core_exports2, {
|
|
|
573
587
|
util: () => util_exports,
|
|
574
588
|
validate: () => validate,
|
|
575
589
|
validateAsync: () => validateAsync,
|
|
576
|
-
|
|
590
|
+
validateURL: () => validateURL,
|
|
591
|
+
version: () => version,
|
|
592
|
+
withParser: () => withParser
|
|
577
593
|
});
|
|
578
594
|
|
|
579
595
|
// node_modules/zod/v4/core/util.js
|
|
@@ -605,6 +621,7 @@ __export(util_exports, {
|
|
|
605
621
|
createTransparentProxy: () => createTransparentProxy,
|
|
606
622
|
defineLazy: () => defineLazy,
|
|
607
623
|
defineLazyInternal: () => defineLazyInternal,
|
|
624
|
+
derived: () => derived,
|
|
608
625
|
esc: () => esc,
|
|
609
626
|
escapeRegex: () => escapeRegex,
|
|
610
627
|
explicitlyAborted: () => explicitlyAborted,
|
|
@@ -642,9 +659,11 @@ __export(util_exports, {
|
|
|
642
659
|
promiseAllObject: () => promiseAllObject,
|
|
643
660
|
propertyKeyTypes: () => propertyKeyTypes,
|
|
644
661
|
randomString: () => randomString,
|
|
662
|
+
rawShape: () => rawShape,
|
|
645
663
|
required: () => required,
|
|
646
664
|
safeExtend: () => safeExtend,
|
|
647
665
|
shallowClone: () => shallowClone,
|
|
666
|
+
sizeCaps: () => sizeCaps,
|
|
648
667
|
slugify: () => slugify,
|
|
649
668
|
stringifyPrimitive: () => stringifyPrimitive,
|
|
650
669
|
toZod: () => toZod,
|
|
@@ -682,18 +701,22 @@ function jsonStringifyReplacer(_, value) {
|
|
|
682
701
|
return value.toString();
|
|
683
702
|
return value;
|
|
684
703
|
}
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
704
|
+
var Cached = class {
|
|
705
|
+
constructor(getter) {
|
|
706
|
+
this._getter = getter;
|
|
707
|
+
this._value = void 0;
|
|
708
|
+
}
|
|
709
|
+
get value() {
|
|
710
|
+
const getter = this._getter;
|
|
711
|
+
if (getter !== void 0) {
|
|
712
|
+
this._value = getter();
|
|
713
|
+
this._getter = void 0;
|
|
695
714
|
}
|
|
696
|
-
|
|
715
|
+
return this._value;
|
|
716
|
+
}
|
|
717
|
+
};
|
|
718
|
+
function cached(getter) {
|
|
719
|
+
return new Cached(getter);
|
|
697
720
|
}
|
|
698
721
|
function nullish(input2) {
|
|
699
722
|
return input2 === null || input2 === void 0;
|
|
@@ -745,6 +768,56 @@ function assignProp(target, prop, value) {
|
|
|
745
768
|
configurable: true
|
|
746
769
|
});
|
|
747
770
|
}
|
|
771
|
+
function rawShape(def) {
|
|
772
|
+
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
773
|
+
return desc?.get ? desc.get.raw : desc?.value;
|
|
774
|
+
}
|
|
775
|
+
function sourceShape(schema) {
|
|
776
|
+
return rawShape(schema._zod.def) ?? schema._zod.def.shape;
|
|
777
|
+
}
|
|
778
|
+
function deferProp(target, key, getter) {
|
|
779
|
+
Object.defineProperty(target, key, {
|
|
780
|
+
get() {
|
|
781
|
+
const value = getter();
|
|
782
|
+
assignProp(this, key, value);
|
|
783
|
+
return value;
|
|
784
|
+
},
|
|
785
|
+
enumerable: true,
|
|
786
|
+
configurable: true
|
|
787
|
+
});
|
|
788
|
+
}
|
|
789
|
+
function putProp(target, key, value) {
|
|
790
|
+
if (key in target)
|
|
791
|
+
assignProp(target, key, value);
|
|
792
|
+
else
|
|
793
|
+
target[key] = value;
|
|
794
|
+
}
|
|
795
|
+
function mirrorShape(target, source, keys, wrap) {
|
|
796
|
+
const raw = sourceShape(source);
|
|
797
|
+
for (const key of keys) {
|
|
798
|
+
const desc = Object.getOwnPropertyDescriptor(raw, key);
|
|
799
|
+
if (!desc.enumerable)
|
|
800
|
+
continue;
|
|
801
|
+
if (desc.get) {
|
|
802
|
+
deferProp(target, key, () => {
|
|
803
|
+
const value = source._zod.def.shape[key];
|
|
804
|
+
return wrap ? wrap(value, key) : value;
|
|
805
|
+
});
|
|
806
|
+
} else
|
|
807
|
+
putProp(target, key, wrap ? wrap(desc.value, key) : desc.value);
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
function mirrorProps(target, source) {
|
|
811
|
+
for (const key of Reflect.ownKeys(source)) {
|
|
812
|
+
const desc = Object.getOwnPropertyDescriptor(source, key);
|
|
813
|
+
if (!desc.enumerable)
|
|
814
|
+
continue;
|
|
815
|
+
if (desc.get)
|
|
816
|
+
deferProp(target, key, () => source[key]);
|
|
817
|
+
else
|
|
818
|
+
putProp(target, key, desc.value);
|
|
819
|
+
}
|
|
820
|
+
}
|
|
748
821
|
function mergeDefs(...defs) {
|
|
749
822
|
const mergedDescriptors = {};
|
|
750
823
|
for (const def of defs) {
|
|
@@ -983,23 +1056,21 @@ function pick(schema, mask) {
|
|
|
983
1056
|
if (hasChecks) {
|
|
984
1057
|
throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
985
1058
|
}
|
|
986
|
-
const
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
});
|
|
1002
|
-
return clone(schema, def);
|
|
1059
|
+
const newShape = {};
|
|
1060
|
+
mirrorShape(newShape, schema, maskedKeys(schema, mask));
|
|
1061
|
+
return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
|
|
1062
|
+
}
|
|
1063
|
+
function maskedKeys(schema, mask) {
|
|
1064
|
+
const raw = sourceShape(schema);
|
|
1065
|
+
const keys = [];
|
|
1066
|
+
for (const key of Reflect.ownKeys(mask)) {
|
|
1067
|
+
if (!Object.getOwnPropertyDescriptor(raw, key)?.enumerable) {
|
|
1068
|
+
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
1069
|
+
}
|
|
1070
|
+
if (mask[key])
|
|
1071
|
+
keys.push(key);
|
|
1072
|
+
}
|
|
1073
|
+
return keys;
|
|
1003
1074
|
}
|
|
1004
1075
|
function omit(schema, mask) {
|
|
1005
1076
|
const currDef = schema._zod.def;
|
|
@@ -1008,23 +1079,10 @@ function omit(schema, mask) {
|
|
|
1008
1079
|
if (hasChecks) {
|
|
1009
1080
|
throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
1010
1081
|
}
|
|
1011
|
-
const
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) {
|
|
1016
|
-
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
1017
|
-
}
|
|
1018
|
-
if (!mask[key])
|
|
1019
|
-
continue;
|
|
1020
|
-
delete newShape[key];
|
|
1021
|
-
}
|
|
1022
|
-
assignProp(this, "shape", newShape);
|
|
1023
|
-
return newShape;
|
|
1024
|
-
},
|
|
1025
|
-
checks: []
|
|
1026
|
-
});
|
|
1027
|
-
return clone(schema, def);
|
|
1082
|
+
const omitted = new Set(maskedKeys(schema, mask));
|
|
1083
|
+
const newShape = {};
|
|
1084
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key) => !omitted.has(key)));
|
|
1085
|
+
return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
|
|
1028
1086
|
}
|
|
1029
1087
|
function extend(schema, shape) {
|
|
1030
1088
|
if (!isPlainObject(shape)) {
|
|
@@ -1033,34 +1091,26 @@ function extend(schema, shape) {
|
|
|
1033
1091
|
const checks = schema._zod.def.checks;
|
|
1034
1092
|
const hasChecks = checks && checks.length > 0;
|
|
1035
1093
|
if (hasChecks) {
|
|
1036
|
-
const existingShape = schema
|
|
1094
|
+
const existingShape = sourceShape(schema);
|
|
1037
1095
|
for (const key of Reflect.ownKeys(shape)) {
|
|
1038
1096
|
if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) {
|
|
1039
1097
|
throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
1040
1098
|
}
|
|
1041
1099
|
}
|
|
1042
1100
|
}
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
return clone(schema, def);
|
|
1101
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
|
|
1102
|
+
}
|
|
1103
|
+
function extended(schema, shape) {
|
|
1104
|
+
const newShape = {};
|
|
1105
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)));
|
|
1106
|
+
mirrorProps(newShape, shape);
|
|
1107
|
+
return newShape;
|
|
1051
1108
|
}
|
|
1052
1109
|
function safeExtend(schema, shape) {
|
|
1053
1110
|
if (!isPlainObject(shape)) {
|
|
1054
1111
|
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
1055
1112
|
}
|
|
1056
|
-
|
|
1057
|
-
get shape() {
|
|
1058
|
-
const _shape = { ...schema._zod.def.shape, ...shape };
|
|
1059
|
-
assignProp(this, "shape", _shape);
|
|
1060
|
-
return _shape;
|
|
1061
|
-
}
|
|
1062
|
-
});
|
|
1063
|
-
return clone(schema, def);
|
|
1113
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
|
|
1064
1114
|
}
|
|
1065
1115
|
function merge(a, b) {
|
|
1066
1116
|
if (!b?._zod?.def) {
|
|
@@ -1069,12 +1119,11 @@ function merge(a, b) {
|
|
|
1069
1119
|
if (a._zod.def.checks?.length) {
|
|
1070
1120
|
throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
|
|
1071
1121
|
}
|
|
1122
|
+
const newShape = {};
|
|
1123
|
+
mirrorShape(newShape, a, Reflect.ownKeys(sourceShape(a)));
|
|
1124
|
+
mirrorShape(newShape, b, Reflect.ownKeys(sourceShape(b)));
|
|
1072
1125
|
const def = mergeDefs(a._zod.def, {
|
|
1073
|
-
|
|
1074
|
-
const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
|
|
1075
|
-
assignProp(this, "shape", _shape);
|
|
1076
|
-
return _shape;
|
|
1077
|
-
},
|
|
1126
|
+
shape: newShape,
|
|
1078
1127
|
get catchall() {
|
|
1079
1128
|
return b._zod.def.catchall;
|
|
1080
1129
|
},
|
|
@@ -1089,67 +1138,19 @@ function partial(Class2, schema, mask, name = "partial") {
|
|
|
1089
1138
|
if (hasChecks) {
|
|
1090
1139
|
throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
|
|
1091
1140
|
}
|
|
1092
|
-
const
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
if (mask) {
|
|
1097
|
-
for (const key of Reflect.ownKeys(mask)) {
|
|
1098
|
-
if (!Object.prototype.hasOwnProperty.call(oldShape, key)) {
|
|
1099
|
-
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
1100
|
-
}
|
|
1101
|
-
if (!mask[key])
|
|
1102
|
-
continue;
|
|
1103
|
-
shape[key] = Class2 ? new Class2({
|
|
1104
|
-
type: "optional",
|
|
1105
|
-
innerType: oldShape[key]
|
|
1106
|
-
}) : oldShape[key];
|
|
1107
|
-
}
|
|
1108
|
-
} else {
|
|
1109
|
-
for (const key of Reflect.ownKeys(oldShape)) {
|
|
1110
|
-
shape[key] = Class2 ? new Class2({
|
|
1111
|
-
type: "optional",
|
|
1112
|
-
innerType: oldShape[key]
|
|
1113
|
-
}) : oldShape[key];
|
|
1114
|
-
}
|
|
1115
|
-
}
|
|
1116
|
-
assignProp(this, "shape", shape);
|
|
1117
|
-
return shape;
|
|
1118
|
-
},
|
|
1119
|
-
checks: []
|
|
1120
|
-
});
|
|
1121
|
-
return clone(schema, def);
|
|
1141
|
+
const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
|
|
1142
|
+
const newShape = {};
|
|
1143
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class2 && ((value, key) => selected && !selected.has(key) ? value : new Class2({ type: "optional", innerType: value })));
|
|
1144
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape, checks: [] }));
|
|
1122
1145
|
}
|
|
1123
1146
|
function required(Class2, schema, mask) {
|
|
1124
|
-
const
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
1132
|
-
}
|
|
1133
|
-
if (!mask[key])
|
|
1134
|
-
continue;
|
|
1135
|
-
shape[key] = new Class2({
|
|
1136
|
-
type: "nonoptional",
|
|
1137
|
-
innerType: oldShape[key]
|
|
1138
|
-
});
|
|
1139
|
-
}
|
|
1140
|
-
} else {
|
|
1141
|
-
for (const key of Reflect.ownKeys(oldShape)) {
|
|
1142
|
-
shape[key] = new Class2({
|
|
1143
|
-
type: "nonoptional",
|
|
1144
|
-
innerType: oldShape[key]
|
|
1145
|
-
});
|
|
1146
|
-
}
|
|
1147
|
-
}
|
|
1148
|
-
assignProp(this, "shape", shape);
|
|
1149
|
-
return shape;
|
|
1150
|
-
}
|
|
1151
|
-
});
|
|
1152
|
-
return clone(schema, def);
|
|
1147
|
+
const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
|
|
1148
|
+
const newShape = {};
|
|
1149
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key) => (
|
|
1150
|
+
// overwrite with non-optional
|
|
1151
|
+
selected && !selected.has(key) ? value : new Class2({ type: "nonoptional", innerType: value })
|
|
1152
|
+
));
|
|
1153
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape }));
|
|
1153
1154
|
}
|
|
1154
1155
|
function aborted(x, startIndex = 0) {
|
|
1155
1156
|
if (x.aborted === true)
|
|
@@ -1182,6 +1183,18 @@ function prefixIssues(path, issues) {
|
|
|
1182
1183
|
function unwrapMessage(message) {
|
|
1183
1184
|
return typeof message === "string" ? message : message?.message;
|
|
1184
1185
|
}
|
|
1186
|
+
function sizeCaps(defChecks) {
|
|
1187
|
+
const caps = [];
|
|
1188
|
+
for (const ch of defChecks ?? []) {
|
|
1189
|
+
const d = ch._zod.def;
|
|
1190
|
+
if (!/_(length|size)$|_equals$/.test(d.check))
|
|
1191
|
+
break;
|
|
1192
|
+
const max = d.maximum ?? d.length ?? d.size;
|
|
1193
|
+
if (max >= 0)
|
|
1194
|
+
caps.push([max, ch]);
|
|
1195
|
+
}
|
|
1196
|
+
return caps;
|
|
1197
|
+
}
|
|
1185
1198
|
function attachSchema(issues, start, inst) {
|
|
1186
1199
|
var _a3;
|
|
1187
1200
|
for (let i = start; i < issues.length; i++) {
|
|
@@ -1199,13 +1212,18 @@ function finalizeIssue(iss, ctx, config2) {
|
|
|
1199
1212
|
}
|
|
1200
1213
|
const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : void 0;
|
|
1201
1214
|
const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(schemaError?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
|
|
1202
|
-
const
|
|
1203
|
-
|
|
1204
|
-
|
|
1215
|
+
const full = {};
|
|
1216
|
+
for (const k of Object.keys(iss)) {
|
|
1217
|
+
if (k === "inst" || k === "schema" || k === "continue" || k === "input" || k === "__proto__")
|
|
1218
|
+
continue;
|
|
1219
|
+
full[k] = iss[k];
|
|
1220
|
+
}
|
|
1221
|
+
full.path ?? (full.path = []);
|
|
1222
|
+
full.message = message;
|
|
1205
1223
|
if (ctx?.reportInput) {
|
|
1206
|
-
|
|
1224
|
+
full.input = iss.input;
|
|
1207
1225
|
}
|
|
1208
|
-
return
|
|
1226
|
+
return full;
|
|
1209
1227
|
}
|
|
1210
1228
|
function getSizableOrigin(input2) {
|
|
1211
1229
|
if (input2 instanceof Set)
|
|
@@ -1332,6 +1350,23 @@ function own(inst, key, value, enumerable = true) {
|
|
|
1332
1350
|
function hide(inst, key, value) {
|
|
1333
1351
|
return own(inst, key, value, false);
|
|
1334
1352
|
}
|
|
1353
|
+
// @__NO_SIDE_EFFECTS__
|
|
1354
|
+
function derived(computes, table) {
|
|
1355
|
+
for (const key in computes) {
|
|
1356
|
+
const compute = computes[key];
|
|
1357
|
+
Object.defineProperty(table, key, {
|
|
1358
|
+
configurable: true,
|
|
1359
|
+
enumerable: true,
|
|
1360
|
+
get() {
|
|
1361
|
+
return own(this, key, compute(this));
|
|
1362
|
+
},
|
|
1363
|
+
set(value) {
|
|
1364
|
+
own(this, key, value);
|
|
1365
|
+
}
|
|
1366
|
+
});
|
|
1367
|
+
}
|
|
1368
|
+
return table;
|
|
1369
|
+
}
|
|
1335
1370
|
function defineBound(proto, key, fn) {
|
|
1336
1371
|
Object.defineProperty(proto, key, {
|
|
1337
1372
|
configurable: true,
|
|
@@ -1459,8 +1494,7 @@ function $constructor(name, initializer3, proto, params) {
|
|
|
1459
1494
|
} finally {
|
|
1460
1495
|
_zodDesc.value = void 0;
|
|
1461
1496
|
}
|
|
1462
|
-
}
|
|
1463
|
-
if (inst._zod.traits.has(name)) {
|
|
1497
|
+
} else if (inst._zod.traits.has(name)) {
|
|
1464
1498
|
return;
|
|
1465
1499
|
}
|
|
1466
1500
|
inst._zod.traits.add(name);
|
|
@@ -1551,16 +1585,12 @@ var _messageDesc = {
|
|
|
1551
1585
|
enumerable: true,
|
|
1552
1586
|
configurable: true
|
|
1553
1587
|
};
|
|
1554
|
-
var _zodDesc2 = { value: void 0, enumerable: false };
|
|
1555
1588
|
var _issuesDesc = { value: void 0, enumerable: false };
|
|
1556
1589
|
var _installedToString = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
1557
1590
|
var initializer = (inst, def) => {
|
|
1558
1591
|
inst.name = "$ZodError";
|
|
1559
|
-
_zodDesc2.value = inst._zod;
|
|
1560
|
-
Object.defineProperty(inst, "_zod", _zodDesc2);
|
|
1561
1592
|
_issuesDesc.value = def;
|
|
1562
1593
|
Object.defineProperty(inst, "issues", _issuesDesc);
|
|
1563
|
-
_zodDesc2.value = void 0;
|
|
1564
1594
|
_issuesDesc.value = void 0;
|
|
1565
1595
|
Object.defineProperty(inst, "message", _messageDesc);
|
|
1566
1596
|
const proto = Object.getPrototypeOf(inst);
|
|
@@ -1594,10 +1624,10 @@ function node(obj, key, make) {
|
|
|
1594
1624
|
}
|
|
1595
1625
|
return obj[key];
|
|
1596
1626
|
}
|
|
1597
|
-
function flattenError(
|
|
1627
|
+
function flattenError(error62, mapper = (issue2) => issue2.message) {
|
|
1598
1628
|
const fieldErrors = {};
|
|
1599
1629
|
const formErrors = [];
|
|
1600
|
-
for (const sub of
|
|
1630
|
+
for (const sub of error62.issues) {
|
|
1601
1631
|
if (sub.path.length > 0) {
|
|
1602
1632
|
node(fieldErrors, sub.path[0], () => []).push(mapper(sub));
|
|
1603
1633
|
} else {
|
|
@@ -1606,10 +1636,10 @@ function flattenError(error61, mapper = (issue2) => issue2.message) {
|
|
|
1606
1636
|
}
|
|
1607
1637
|
return { formErrors, fieldErrors };
|
|
1608
1638
|
}
|
|
1609
|
-
function formatError(
|
|
1639
|
+
function formatError(error62, mapper = (issue2) => issue2.message) {
|
|
1610
1640
|
const fieldErrors = { _errors: [] };
|
|
1611
|
-
const processError = (
|
|
1612
|
-
for (const issue2 of
|
|
1641
|
+
const processError = (error63, path = []) => {
|
|
1642
|
+
for (const issue2 of error63.issues) {
|
|
1613
1643
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1614
1644
|
issue2.errors.map((issues) => processError({ issues }, [...path, ...issue2.path]));
|
|
1615
1645
|
} else if (issue2.code === "invalid_key") {
|
|
@@ -1651,14 +1681,14 @@ function formatError(error61, mapper = (issue2) => issue2.message) {
|
|
|
1651
1681
|
}
|
|
1652
1682
|
}
|
|
1653
1683
|
};
|
|
1654
|
-
processError(
|
|
1684
|
+
processError(error62);
|
|
1655
1685
|
return fieldErrors;
|
|
1656
1686
|
}
|
|
1657
|
-
function treeifyError(
|
|
1687
|
+
function treeifyError(error62, mapper = (issue2) => issue2.message) {
|
|
1658
1688
|
const result = { errors: [] };
|
|
1659
|
-
const processError = (
|
|
1689
|
+
const processError = (error63, path = []) => {
|
|
1660
1690
|
var _a3;
|
|
1661
|
-
for (const issue2 of
|
|
1691
|
+
for (const issue2 of error63.issues) {
|
|
1662
1692
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1663
1693
|
issue2.errors.map((issues) => processError({ issues }, [...path, ...issue2.path]));
|
|
1664
1694
|
} else if (issue2.code === "invalid_key") {
|
|
@@ -1700,7 +1730,7 @@ function treeifyError(error61, mapper = (issue2) => issue2.message) {
|
|
|
1700
1730
|
}
|
|
1701
1731
|
}
|
|
1702
1732
|
};
|
|
1703
|
-
processError(
|
|
1733
|
+
processError(error62);
|
|
1704
1734
|
return result;
|
|
1705
1735
|
}
|
|
1706
1736
|
function toDotPath(_path) {
|
|
@@ -1721,9 +1751,9 @@ function toDotPath(_path) {
|
|
|
1721
1751
|
}
|
|
1722
1752
|
return segs.join("");
|
|
1723
1753
|
}
|
|
1724
|
-
function prettifyError(
|
|
1754
|
+
function prettifyError(error62) {
|
|
1725
1755
|
const lines = [];
|
|
1726
|
-
const issues = [...
|
|
1756
|
+
const issues = [...error62.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);
|
|
1727
1757
|
for (const issue2 of issues) {
|
|
1728
1758
|
lines.push(`\u2716 ${issue2.message}`);
|
|
1729
1759
|
if (issue2.path?.length)
|
|
@@ -1775,33 +1805,50 @@ var _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
|
1775
1805
|
if (result instanceof Promise) {
|
|
1776
1806
|
throw new $ZodAsyncError();
|
|
1777
1807
|
}
|
|
1778
|
-
return result.issues.length ? {
|
|
1779
|
-
success: false,
|
|
1780
|
-
error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
1781
|
-
} : { success: true, data: result.value };
|
|
1808
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
|
|
1782
1809
|
};
|
|
1783
1810
|
var safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
|
|
1811
|
+
function failure(Err, issues, ctx) {
|
|
1812
|
+
let error62;
|
|
1813
|
+
return {
|
|
1814
|
+
success: false,
|
|
1815
|
+
get error() {
|
|
1816
|
+
if (!error62) {
|
|
1817
|
+
error62 = new Err(issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
1818
|
+
issues = void 0;
|
|
1819
|
+
ctx = void 0;
|
|
1820
|
+
}
|
|
1821
|
+
return error62;
|
|
1822
|
+
},
|
|
1823
|
+
set error(e) {
|
|
1824
|
+
error62 = e;
|
|
1825
|
+
issues = void 0;
|
|
1826
|
+
ctx = void 0;
|
|
1827
|
+
}
|
|
1828
|
+
};
|
|
1829
|
+
}
|
|
1784
1830
|
var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
1785
1831
|
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
|
1786
1832
|
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
1787
1833
|
if (result instanceof Promise)
|
|
1788
1834
|
result = await result;
|
|
1789
|
-
return result.issues.length ? {
|
|
1790
|
-
success: false,
|
|
1791
|
-
error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
1792
|
-
} : { success: true, data: result.value };
|
|
1835
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
|
|
1793
1836
|
};
|
|
1794
1837
|
var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
|
|
1795
1838
|
var COMPILE_INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid");
|
|
1796
1839
|
var COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
|
|
1797
1840
|
var validate = ((schema, value, _ctx) => {
|
|
1798
1841
|
const validator = schema._zod.bag.validator;
|
|
1799
|
-
if (validator !== void 0
|
|
1800
|
-
|
|
1842
|
+
if (validator !== void 0) {
|
|
1843
|
+
if (validator(value) !== COMPILE_INVALID)
|
|
1844
|
+
return true;
|
|
1845
|
+
if (validator.definite === true && _ctx === void 0)
|
|
1846
|
+
return false;
|
|
1847
|
+
}
|
|
1801
1848
|
return validateFallback(schema, value, _ctx);
|
|
1802
1849
|
});
|
|
1803
1850
|
function validateFallback(schema, value, _ctx) {
|
|
1804
|
-
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
1851
|
+
const ctx = _ctx ? { ..._ctx, async: false, abortEarly: true } : { async: false, abortEarly: true };
|
|
1805
1852
|
const fallbackRun = schema._zod.bag.fallbackRun;
|
|
1806
1853
|
let result;
|
|
1807
1854
|
if (fallbackRun) {
|
|
@@ -1816,7 +1863,7 @@ function validateFallback(schema, value, _ctx) {
|
|
|
1816
1863
|
return result.issues.length === 0;
|
|
1817
1864
|
}
|
|
1818
1865
|
var validateAsync = async (schema, value, _ctx) => {
|
|
1819
|
-
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
|
1866
|
+
const ctx = _ctx ? { ..._ctx, async: true, abortEarly: true } : { async: true, abortEarly: true };
|
|
1820
1867
|
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
1821
1868
|
if (result instanceof Promise)
|
|
1822
1869
|
result = await result;
|
|
@@ -1878,6 +1925,7 @@ var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync($ZodRealError);
|
|
|
1878
1925
|
// node_modules/zod/v4/core/regexes.js
|
|
1879
1926
|
var regexes_exports = {};
|
|
1880
1927
|
__export(regexes_exports, {
|
|
1928
|
+
anyString: () => anyString,
|
|
1881
1929
|
base64: () => base64,
|
|
1882
1930
|
base64url: () => base64url,
|
|
1883
1931
|
bigint: () => bigint,
|
|
@@ -1888,6 +1936,7 @@ __export(regexes_exports, {
|
|
|
1888
1936
|
creditCard: () => creditCard,
|
|
1889
1937
|
cuid: () => cuid,
|
|
1890
1938
|
cuid2: () => cuid2,
|
|
1939
|
+
currencyCode: () => currencyCode,
|
|
1891
1940
|
date: () => date,
|
|
1892
1941
|
datetime: () => datetime,
|
|
1893
1942
|
domain: () => domain,
|
|
@@ -1901,6 +1950,7 @@ __export(regexes_exports, {
|
|
|
1901
1950
|
hostname: () => hostname,
|
|
1902
1951
|
html5Email: () => html5Email,
|
|
1903
1952
|
httpProtocol: () => httpProtocol,
|
|
1953
|
+
iban: () => iban,
|
|
1904
1954
|
idnEmail: () => idnEmail,
|
|
1905
1955
|
integer: () => integer,
|
|
1906
1956
|
ipv4: () => ipv4,
|
|
@@ -1960,13 +2010,13 @@ var uuid = (version2) => {
|
|
|
1960
2010
|
var uuid4 = /* @__PURE__ */ uuid(4);
|
|
1961
2011
|
var uuid6 = /* @__PURE__ */ uuid(6);
|
|
1962
2012
|
var uuid7 = /* @__PURE__ */ uuid(7);
|
|
1963
|
-
var email = /^(
|
|
2013
|
+
var email = /^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
|
|
1964
2014
|
var html5Email = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
|
1965
2015
|
var rfc5322Email = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
1966
2016
|
var unicodeEmail = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u;
|
|
1967
2017
|
var idnEmail = unicodeEmail;
|
|
1968
2018
|
var browserEmail = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
|
1969
|
-
var _emoji = `^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
|
|
2019
|
+
var _emoji = `^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
|
|
1970
2020
|
function emoji() {
|
|
1971
2021
|
return new RegExp(_emoji, "u");
|
|
1972
2022
|
}
|
|
@@ -1979,12 +2029,14 @@ var mac = (delimiter) => {
|
|
|
1979
2029
|
var cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
|
|
1980
2030
|
var cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
|
|
1981
2031
|
var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
|
|
1982
|
-
var base64url = /^[A-Za-z0-9_-]
|
|
2032
|
+
var base64url = /^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;
|
|
1983
2033
|
var hostname = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;
|
|
1984
2034
|
var domain = /^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/;
|
|
1985
2035
|
var httpProtocol = /^https?$/;
|
|
1986
2036
|
var e164 = /^\+[1-9]\d{6,14}$/;
|
|
1987
2037
|
var creditCard = /^\d(?:[ -]?\d){11,18}$/;
|
|
2038
|
+
var currencyCode = /^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/;
|
|
2039
|
+
var iban = /^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/;
|
|
1988
2040
|
var dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
|
|
1989
2041
|
function anchor(source) {
|
|
1990
2042
|
return new RegExp(`^${source}$`);
|
|
@@ -2006,6 +2058,7 @@ function datetime(args) {
|
|
|
2006
2058
|
const timeRegex = args.local ? `${qualified}|${timeSource({ precision: args.precision })}` : qualified;
|
|
2007
2059
|
return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
|
|
2008
2060
|
}
|
|
2061
|
+
var anyString = /^[\s\S]{0,}$/;
|
|
2009
2062
|
var string = (params) => {
|
|
2010
2063
|
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
2011
2064
|
return new RegExp(`^${regex}$`);
|
|
@@ -2064,16 +2117,6 @@ var numericOriginMap = {
|
|
|
2064
2117
|
var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => {
|
|
2065
2118
|
$ZodCheck.init(inst, def);
|
|
2066
2119
|
const origin = numericOriginMap[typeof def.value];
|
|
2067
|
-
inst._zod.onattach.push((inst2) => {
|
|
2068
|
-
const bag = inst2._zod.bag;
|
|
2069
|
-
const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
2070
|
-
if (def.value < curr) {
|
|
2071
|
-
if (def.inclusive)
|
|
2072
|
-
bag.maximum = def.value;
|
|
2073
|
-
else
|
|
2074
|
-
bag.exclusiveMaximum = def.value;
|
|
2075
|
-
}
|
|
2076
|
-
});
|
|
2077
2120
|
inst._zod.check = (payload) => {
|
|
2078
2121
|
if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {
|
|
2079
2122
|
return;
|
|
@@ -2092,16 +2135,6 @@ var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst,
|
|
|
2092
2135
|
var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => {
|
|
2093
2136
|
$ZodCheck.init(inst, def);
|
|
2094
2137
|
const origin = numericOriginMap[typeof def.value];
|
|
2095
|
-
inst._zod.onattach.push((inst2) => {
|
|
2096
|
-
const bag = inst2._zod.bag;
|
|
2097
|
-
const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
2098
|
-
if (def.value > curr) {
|
|
2099
|
-
if (def.inclusive)
|
|
2100
|
-
bag.minimum = def.value;
|
|
2101
|
-
else
|
|
2102
|
-
bag.exclusiveMinimum = def.value;
|
|
2103
|
-
}
|
|
2104
|
-
});
|
|
2105
2138
|
inst._zod.check = (payload) => {
|
|
2106
2139
|
if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {
|
|
2107
2140
|
return;
|
|
@@ -2119,10 +2152,6 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
|
|
|
2119
2152
|
});
|
|
2120
2153
|
var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
|
|
2121
2154
|
$ZodCheck.init(inst, def);
|
|
2122
|
-
inst._zod.onattach.push((inst2) => {
|
|
2123
|
-
var _a3;
|
|
2124
|
-
(_a3 = inst2._zod.bag).multipleOf ?? (_a3.multipleOf = def.value);
|
|
2125
|
-
});
|
|
2126
2155
|
inst._zod.check = (payload) => {
|
|
2127
2156
|
if (typeof payload.value !== typeof def.value)
|
|
2128
2157
|
throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
@@ -2148,14 +2177,6 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
2148
2177
|
const isInt = def.format?.includes("int");
|
|
2149
2178
|
const origin = isInt ? "int" : "number";
|
|
2150
2179
|
const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
|
|
2151
|
-
inst._zod.onattach.push((inst2) => {
|
|
2152
|
-
const bag = inst2._zod.bag;
|
|
2153
|
-
bag.format = def.format;
|
|
2154
|
-
bag.minimum = minimum;
|
|
2155
|
-
bag.maximum = maximum;
|
|
2156
|
-
if (isInt)
|
|
2157
|
-
bag.pattern = integer;
|
|
2158
|
-
});
|
|
2159
2180
|
inst._zod.check = (payload) => {
|
|
2160
2181
|
const input2 = payload.value;
|
|
2161
2182
|
if (isInt) {
|
|
@@ -2224,12 +2245,6 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
2224
2245
|
var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat", (inst, def) => {
|
|
2225
2246
|
$ZodCheck.init(inst, def);
|
|
2226
2247
|
const [minimum, maximum] = BIGINT_FORMAT_RANGES[def.format];
|
|
2227
|
-
inst._zod.onattach.push((inst2) => {
|
|
2228
|
-
const bag = inst2._zod.bag;
|
|
2229
|
-
bag.format = def.format;
|
|
2230
|
-
bag.minimum = minimum;
|
|
2231
|
-
bag.maximum = maximum;
|
|
2232
|
-
});
|
|
2233
2248
|
inst._zod.check = (payload) => {
|
|
2234
2249
|
const input2 = payload.value;
|
|
2235
2250
|
if (input2 < minimum) {
|
|
@@ -2260,11 +2275,6 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
|
|
|
2260
2275
|
var _a3;
|
|
2261
2276
|
$ZodCheck.init(inst, def);
|
|
2262
2277
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasSize);
|
|
2263
|
-
inst._zod.onattach.push((inst2) => {
|
|
2264
|
-
const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
2265
|
-
if (def.maximum < curr)
|
|
2266
|
-
inst2._zod.bag.maximum = def.maximum;
|
|
2267
|
-
});
|
|
2268
2278
|
inst._zod.check = (payload) => {
|
|
2269
2279
|
const input2 = payload.value;
|
|
2270
2280
|
const size = input2.size;
|
|
@@ -2285,11 +2295,6 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
|
|
|
2285
2295
|
var _a3;
|
|
2286
2296
|
$ZodCheck.init(inst, def);
|
|
2287
2297
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasSize);
|
|
2288
|
-
inst._zod.onattach.push((inst2) => {
|
|
2289
|
-
const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
2290
|
-
if (def.minimum > curr)
|
|
2291
|
-
inst2._zod.bag.minimum = def.minimum;
|
|
2292
|
-
});
|
|
2293
2298
|
inst._zod.check = (payload) => {
|
|
2294
2299
|
const input2 = payload.value;
|
|
2295
2300
|
const size = input2.size;
|
|
@@ -2310,12 +2315,6 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
|
|
|
2310
2315
|
var _a3;
|
|
2311
2316
|
$ZodCheck.init(inst, def);
|
|
2312
2317
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasSize);
|
|
2313
|
-
inst._zod.onattach.push((inst2) => {
|
|
2314
|
-
const bag = inst2._zod.bag;
|
|
2315
|
-
bag.minimum = def.size;
|
|
2316
|
-
bag.maximum = def.size;
|
|
2317
|
-
bag.size = def.size;
|
|
2318
|
-
});
|
|
2319
2318
|
inst._zod.check = (payload) => {
|
|
2320
2319
|
const input2 = payload.value;
|
|
2321
2320
|
const size = input2.size;
|
|
@@ -2337,11 +2336,6 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
|
|
|
2337
2336
|
var _a3;
|
|
2338
2337
|
$ZodCheck.init(inst, def);
|
|
2339
2338
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
|
|
2340
|
-
inst._zod.onattach.push((inst2) => {
|
|
2341
|
-
const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
2342
|
-
if (def.maximum < curr)
|
|
2343
|
-
inst2._zod.bag.maximum = def.maximum;
|
|
2344
|
-
});
|
|
2345
2339
|
inst._zod.check = (payload) => {
|
|
2346
2340
|
const input2 = payload.value;
|
|
2347
2341
|
const units = input2.length;
|
|
@@ -2364,11 +2358,6 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
|
|
|
2364
2358
|
var _a3;
|
|
2365
2359
|
$ZodCheck.init(inst, def);
|
|
2366
2360
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
|
|
2367
|
-
inst._zod.onattach.push((inst2) => {
|
|
2368
|
-
const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
2369
|
-
if (def.minimum > curr)
|
|
2370
|
-
inst2._zod.bag.minimum = def.minimum;
|
|
2371
|
-
});
|
|
2372
2361
|
inst._zod.check = (payload) => {
|
|
2373
2362
|
const input2 = payload.value;
|
|
2374
2363
|
const units = input2.length;
|
|
@@ -2391,12 +2380,6 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
|
|
|
2391
2380
|
var _a3;
|
|
2392
2381
|
$ZodCheck.init(inst, def);
|
|
2393
2382
|
(_a3 = inst._zod.def).when ?? (_a3.when = _whenHasLength);
|
|
2394
|
-
inst._zod.onattach.push((inst2) => {
|
|
2395
|
-
const bag = inst2._zod.bag;
|
|
2396
|
-
bag.minimum = def.length;
|
|
2397
|
-
bag.maximum = def.length;
|
|
2398
|
-
bag.length = def.length;
|
|
2399
|
-
});
|
|
2400
2383
|
inst._zod.check = (payload) => {
|
|
2401
2384
|
const input2 = payload.value;
|
|
2402
2385
|
const units = input2.length;
|
|
@@ -2419,14 +2402,6 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
|
|
|
2419
2402
|
var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
2420
2403
|
var _a3, _b;
|
|
2421
2404
|
$ZodCheck.init(inst, def);
|
|
2422
|
-
inst._zod.onattach.push((inst2) => {
|
|
2423
|
-
const bag = inst2._zod.bag;
|
|
2424
|
-
bag.format = def.format;
|
|
2425
|
-
if (def.pattern) {
|
|
2426
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
2427
|
-
bag.patterns.add(def.pattern);
|
|
2428
|
-
}
|
|
2429
|
-
});
|
|
2430
2405
|
if (def.pattern)
|
|
2431
2406
|
(_a3 = inst._zod).check ?? (_a3.check = (payload) => {
|
|
2432
2407
|
def.pattern.lastIndex = 0;
|
|
@@ -2476,11 +2451,6 @@ var $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst,
|
|
|
2476
2451
|
const escapedRegex = escapeRegex(def.includes);
|
|
2477
2452
|
const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position},}${escapedRegex}` : escapedRegex);
|
|
2478
2453
|
def.pattern = pattern;
|
|
2479
|
-
inst._zod.onattach.push((inst2) => {
|
|
2480
|
-
const bag = inst2._zod.bag;
|
|
2481
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
2482
|
-
bag.patterns.add(pattern);
|
|
2483
|
-
});
|
|
2484
2454
|
inst._zod.check = (payload) => {
|
|
2485
2455
|
if (payload.value.includes(def.includes, def.position))
|
|
2486
2456
|
return;
|
|
@@ -2499,11 +2469,6 @@ var $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (i
|
|
|
2499
2469
|
$ZodCheck.init(inst, def);
|
|
2500
2470
|
const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
|
|
2501
2471
|
def.pattern ?? (def.pattern = pattern);
|
|
2502
|
-
inst._zod.onattach.push((inst2) => {
|
|
2503
|
-
const bag = inst2._zod.bag;
|
|
2504
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
2505
|
-
bag.patterns.add(pattern);
|
|
2506
|
-
});
|
|
2507
2472
|
inst._zod.check = (payload) => {
|
|
2508
2473
|
if (payload.value.startsWith(def.prefix))
|
|
2509
2474
|
return;
|
|
@@ -2522,11 +2487,6 @@ var $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst,
|
|
|
2522
2487
|
$ZodCheck.init(inst, def);
|
|
2523
2488
|
const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
|
|
2524
2489
|
def.pattern ?? (def.pattern = pattern);
|
|
2525
|
-
inst._zod.onattach.push((inst2) => {
|
|
2526
|
-
const bag = inst2._zod.bag;
|
|
2527
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
2528
|
-
bag.patterns.add(pattern);
|
|
2529
|
-
});
|
|
2530
2490
|
inst._zod.check = (payload) => {
|
|
2531
2491
|
if (payload.value.endsWith(def.suffix))
|
|
2532
2492
|
return;
|
|
@@ -2560,12 +2520,37 @@ var $ZodCheckProperty = /* @__PURE__ */ $constructor("$ZodCheckProperty", (inst,
|
|
|
2560
2520
|
return;
|
|
2561
2521
|
};
|
|
2562
2522
|
});
|
|
2523
|
+
var $ZodCheckProperties = /* @__PURE__ */ $constructor("$ZodCheckProperties", (inst, def) => {
|
|
2524
|
+
$ZodCheck.init(inst, def);
|
|
2525
|
+
hide(inst, Symbol.iterator, function* () {
|
|
2526
|
+
yield inst;
|
|
2527
|
+
});
|
|
2528
|
+
let entries;
|
|
2529
|
+
inst._zod.check = (payload) => {
|
|
2530
|
+
if (payload.value == null) {
|
|
2531
|
+
payload.issues.push({ expected: "object", code: "invalid_type", input: payload.value, inst });
|
|
2532
|
+
return void 0;
|
|
2533
|
+
}
|
|
2534
|
+
entries ?? (entries = Reflect.ownKeys(def.shape).map((key) => [key, def.shape[key]]));
|
|
2535
|
+
const input2 = payload.value;
|
|
2536
|
+
let proms;
|
|
2537
|
+
for (const [key, schema] of entries) {
|
|
2538
|
+
const result = schema._zod.run({ value: input2[key], issues: [] }, {});
|
|
2539
|
+
if (result instanceof Promise) {
|
|
2540
|
+
proms ?? (proms = []);
|
|
2541
|
+
proms.push(result.then((result2) => handleCheckPropertyResult(result2, payload, key)));
|
|
2542
|
+
} else {
|
|
2543
|
+
handleCheckPropertyResult(result, payload, key);
|
|
2544
|
+
}
|
|
2545
|
+
}
|
|
2546
|
+
if (proms)
|
|
2547
|
+
return Promise.all(proms).then(() => void 0);
|
|
2548
|
+
return void 0;
|
|
2549
|
+
};
|
|
2550
|
+
});
|
|
2563
2551
|
var $ZodCheckMimeType = /* @__PURE__ */ $constructor("$ZodCheckMimeType", (inst, def) => {
|
|
2564
2552
|
$ZodCheck.init(inst, def);
|
|
2565
2553
|
const mimeSet = new Set(def.mime);
|
|
2566
|
-
inst._zod.onattach.push((inst2) => {
|
|
2567
|
-
inst2._zod.bag.mime = def.mime;
|
|
2568
|
-
});
|
|
2569
2554
|
inst._zod.check = (payload) => {
|
|
2570
2555
|
if (mimeSet.has(payload.value.type))
|
|
2571
2556
|
return;
|
|
@@ -2593,10 +2578,14 @@ var Doc = class {
|
|
|
2593
2578
|
this.args = args;
|
|
2594
2579
|
this.closed = closed;
|
|
2595
2580
|
}
|
|
2581
|
+
// the compiler catches a child's throw and keeps writing into this doc, so the indent has to unwind with it
|
|
2596
2582
|
indented(fn) {
|
|
2597
2583
|
this.indent += 1;
|
|
2598
|
-
|
|
2599
|
-
|
|
2584
|
+
try {
|
|
2585
|
+
fn(this);
|
|
2586
|
+
} finally {
|
|
2587
|
+
this.indent -= 1;
|
|
2588
|
+
}
|
|
2600
2589
|
}
|
|
2601
2590
|
write(arg) {
|
|
2602
2591
|
if (typeof arg === "function") {
|
|
@@ -2625,8 +2614,8 @@ ${content.join("\n")}
|
|
|
2625
2614
|
// node_modules/zod/v4/core/versions.js
|
|
2626
2615
|
var version = {
|
|
2627
2616
|
major: 4,
|
|
2628
|
-
minor:
|
|
2629
|
-
patch:
|
|
2617
|
+
minor: 6,
|
|
2618
|
+
patch: 7
|
|
2630
2619
|
};
|
|
2631
2620
|
|
|
2632
2621
|
// node_modules/zod/v4/core/schemas.js
|
|
@@ -2739,15 +2728,22 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
2739
2728
|
own(this, "~standard", value);
|
|
2740
2729
|
}
|
|
2741
2730
|
});
|
|
2742
|
-
var toStandardResult = (r) => r.
|
|
2731
|
+
var toStandardResult = (r, ctx) => r.issues.length ? { issues: r.issues.map((iss) => finalizeIssue(iss, ctx, config())) } : { value: r.value };
|
|
2732
|
+
async function validateAsync2(inst, value) {
|
|
2733
|
+
const ctx = { async: true };
|
|
2734
|
+
return toStandardResult(await inst._zod.run({ value, issues: [] }, ctx), ctx);
|
|
2735
|
+
}
|
|
2743
2736
|
function standardProps(inst) {
|
|
2744
2737
|
return {
|
|
2745
2738
|
validate: (value) => {
|
|
2739
|
+
const ctx = { async: false };
|
|
2746
2740
|
try {
|
|
2747
|
-
|
|
2741
|
+
const r = inst._zod.run({ value, issues: [] }, ctx);
|
|
2742
|
+
if (!(r instanceof Promise))
|
|
2743
|
+
return toStandardResult(r, ctx);
|
|
2748
2744
|
} catch (_) {
|
|
2749
|
-
return safeParseAsync(inst, value).then(toStandardResult);
|
|
2750
2745
|
}
|
|
2746
|
+
return validateAsync2(inst, value);
|
|
2751
2747
|
},
|
|
2752
2748
|
vendor: "zod",
|
|
2753
2749
|
version: 1
|
|
@@ -2755,7 +2751,7 @@ function standardProps(inst) {
|
|
|
2755
2751
|
}
|
|
2756
2752
|
var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
|
|
2757
2753
|
$ZodType.init(inst, def);
|
|
2758
|
-
inst._zod.pattern =
|
|
2754
|
+
inst._zod.pattern = def.pattern ?? anyString;
|
|
2759
2755
|
inst._zod.parse = (payload, _) => {
|
|
2760
2756
|
if (def.coerce)
|
|
2761
2757
|
try {
|
|
@@ -2807,11 +2803,32 @@ var $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def) => {
|
|
|
2807
2803
|
});
|
|
2808
2804
|
var URL_BAD_FORMAT = 1;
|
|
2809
2805
|
var URL_UNPARSEABLE = 2;
|
|
2806
|
+
function canParseURL(input2) {
|
|
2807
|
+
try {
|
|
2808
|
+
if (typeof URL !== "undefined" && typeof URL.canParse === "function")
|
|
2809
|
+
return URL.canParse(input2);
|
|
2810
|
+
new URL(input2);
|
|
2811
|
+
return true;
|
|
2812
|
+
} catch {
|
|
2813
|
+
return false;
|
|
2814
|
+
}
|
|
2815
|
+
}
|
|
2816
|
+
function validateURL(trimmed, def) {
|
|
2817
|
+
if (!("normalize" in def) && !("hostname" in def) && !("protocol" in def)) {
|
|
2818
|
+
return canParseURL(trimmed) || URL_UNPARSEABLE;
|
|
2819
|
+
}
|
|
2820
|
+
return parseURLObject(trimmed, def);
|
|
2821
|
+
}
|
|
2810
2822
|
function parseURLObject(trimmed, def) {
|
|
2811
2823
|
if (!def.normalize && def.protocol?.source === httpProtocol.source && !/^https?:\/\//i.test(trimmed)) {
|
|
2812
2824
|
return URL_BAD_FORMAT;
|
|
2813
2825
|
}
|
|
2814
2826
|
try {
|
|
2827
|
+
if (typeof URL !== "undefined") {
|
|
2828
|
+
const URLStatic = URL;
|
|
2829
|
+
if (typeof URLStatic.parse === "function")
|
|
2830
|
+
return URLStatic.parse(trimmed) ?? URL_UNPARSEABLE;
|
|
2831
|
+
}
|
|
2815
2832
|
return new URL(trimmed);
|
|
2816
2833
|
} catch {
|
|
2817
2834
|
return URL_UNPARSEABLE;
|
|
@@ -2834,7 +2851,7 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
|
2834
2851
|
inst._zod.check = (payload) => {
|
|
2835
2852
|
try {
|
|
2836
2853
|
const trimmed = payload.value.trim();
|
|
2837
|
-
const url2 =
|
|
2854
|
+
const url2 = validateURL(trimmed, def);
|
|
2838
2855
|
if (url2 === URL_BAD_FORMAT) {
|
|
2839
2856
|
payload.issues.push({
|
|
2840
2857
|
code: "invalid_format",
|
|
@@ -2856,6 +2873,10 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
|
2856
2873
|
});
|
|
2857
2874
|
return;
|
|
2858
2875
|
}
|
|
2876
|
+
if (url2 === true) {
|
|
2877
|
+
payload.value = stripTabAndNewline(trimmed);
|
|
2878
|
+
return;
|
|
2879
|
+
}
|
|
2859
2880
|
if (def.hostname && !urlHostnameOk(url2, def.hostname)) {
|
|
2860
2881
|
payload.issues.push({
|
|
2861
2882
|
code: "invalid_format",
|
|
@@ -2924,12 +2945,6 @@ var $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def) => {
|
|
|
2924
2945
|
var $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => {
|
|
2925
2946
|
def.pattern ?? (def.pattern = datetime(def));
|
|
2926
2947
|
$ZodStringFormat.init(inst, def);
|
|
2927
|
-
if (def.local || def.precision === -1) {
|
|
2928
|
-
inst._zod.bag.laxFormat = true;
|
|
2929
|
-
inst._zod.onattach.push((s) => {
|
|
2930
|
-
s._zod.bag.laxFormat = true;
|
|
2931
|
-
});
|
|
2932
|
-
}
|
|
2933
2948
|
});
|
|
2934
2949
|
var $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => {
|
|
2935
2950
|
def.pattern ?? (def.pattern = date);
|
|
@@ -2946,23 +2961,16 @@ var $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def
|
|
|
2946
2961
|
var $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => {
|
|
2947
2962
|
def.pattern ?? (def.pattern = ipv4);
|
|
2948
2963
|
$ZodStringFormat.init(inst, def);
|
|
2949
|
-
inst._zod.bag.format = `ipv4`;
|
|
2950
2964
|
});
|
|
2951
2965
|
var ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
|
|
2952
2966
|
function isValidIPv6(value) {
|
|
2953
2967
|
if (!ipv6Alphabet.test(value))
|
|
2954
2968
|
return false;
|
|
2955
|
-
|
|
2956
|
-
new URL(`http://[${value}]`);
|
|
2957
|
-
return true;
|
|
2958
|
-
} catch {
|
|
2959
|
-
return false;
|
|
2960
|
-
}
|
|
2969
|
+
return canParseURL(`http://[${value}]`);
|
|
2961
2970
|
}
|
|
2962
2971
|
var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
|
|
2963
2972
|
def.pattern ?? (def.pattern = ipv6);
|
|
2964
2973
|
$ZodStringFormat.init(inst, def);
|
|
2965
|
-
inst._zod.bag.format = `ipv6`;
|
|
2966
2974
|
inst._zod.check = (payload) => {
|
|
2967
2975
|
if (!isValidIPv6(payload.value)) {
|
|
2968
2976
|
payload.issues.push({
|
|
@@ -2978,7 +2986,6 @@ var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
|
|
|
2978
2986
|
var $ZodMAC = /* @__PURE__ */ $constructor("$ZodMAC", (inst, def) => {
|
|
2979
2987
|
def.pattern ?? (def.pattern = mac(def.delimiter));
|
|
2980
2988
|
$ZodStringFormat.init(inst, def);
|
|
2981
|
-
inst._zod.bag.format = `mac`;
|
|
2982
2989
|
});
|
|
2983
2990
|
var $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def) => {
|
|
2984
2991
|
def.pattern ?? (def.pattern = cidrv4);
|
|
@@ -3027,10 +3034,10 @@ function isValidBase64(data) {
|
|
|
3027
3034
|
return false;
|
|
3028
3035
|
}
|
|
3029
3036
|
}
|
|
3037
|
+
var base64Charset = /^[0-9a-zA-Z+/]*={0,2}$/;
|
|
3030
3038
|
var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
|
|
3031
|
-
def.pattern ?? (def.pattern =
|
|
3039
|
+
def.pattern ?? (def.pattern = base64Charset);
|
|
3032
3040
|
$ZodStringFormat.init(inst, def);
|
|
3033
|
-
inst._zod.bag.contentEncoding = "base64";
|
|
3034
3041
|
inst._zod.check = (payload) => {
|
|
3035
3042
|
if (isValidBase64(payload.value))
|
|
3036
3043
|
return;
|
|
@@ -3043,17 +3050,17 @@ var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
|
|
|
3043
3050
|
});
|
|
3044
3051
|
};
|
|
3045
3052
|
});
|
|
3053
|
+
var base64urlCharset = /^[A-Za-z0-9_-]*$/;
|
|
3046
3054
|
function isValidBase64URL(data) {
|
|
3047
|
-
if (!
|
|
3055
|
+
if (!base64urlCharset.test(data))
|
|
3048
3056
|
return false;
|
|
3049
3057
|
const base643 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
|
|
3050
3058
|
const padded = base643.padEnd(Math.ceil(base643.length / 4) * 4, "=");
|
|
3051
3059
|
return isValidBase64(padded);
|
|
3052
3060
|
}
|
|
3053
3061
|
var $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => {
|
|
3054
|
-
def.pattern ?? (def.pattern =
|
|
3062
|
+
def.pattern ?? (def.pattern = base64urlCharset);
|
|
3055
3063
|
$ZodStringFormat.init(inst, def);
|
|
3056
|
-
inst._zod.bag.contentEncoding = "base64url";
|
|
3057
3064
|
inst._zod.check = (payload) => {
|
|
3058
3065
|
if (isValidBase64URL(payload.value))
|
|
3059
3066
|
return;
|
|
@@ -3076,7 +3083,7 @@ function isLuhnAlgo(digits) {
|
|
|
3076
3083
|
let bit = 1;
|
|
3077
3084
|
let sum = 0;
|
|
3078
3085
|
while (length) {
|
|
3079
|
-
const value =
|
|
3086
|
+
const value = digits.charCodeAt(--length) - 48;
|
|
3080
3087
|
bit ^= 1;
|
|
3081
3088
|
sum += bit ? [0, 2, 4, 6, 8, 1, 3, 5, 7, 9][value] : value;
|
|
3082
3089
|
}
|
|
@@ -3102,6 +3109,39 @@ var $ZodCreditCard = /* @__PURE__ */ $constructor("$ZodCreditCard", (inst, def)
|
|
|
3102
3109
|
});
|
|
3103
3110
|
};
|
|
3104
3111
|
});
|
|
3112
|
+
function isIso7064Mod97(iban3) {
|
|
3113
|
+
let remainder = 0;
|
|
3114
|
+
const len = iban3.length;
|
|
3115
|
+
for (let i = 4; i < len; i++) {
|
|
3116
|
+
const code = iban3.charCodeAt(i);
|
|
3117
|
+
remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
|
|
3118
|
+
}
|
|
3119
|
+
for (let i = 0; i < 4; i++) {
|
|
3120
|
+
const code = iban3.charCodeAt(i);
|
|
3121
|
+
remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
|
|
3122
|
+
}
|
|
3123
|
+
return remainder === 1;
|
|
3124
|
+
}
|
|
3125
|
+
function isValidIBAN(input2) {
|
|
3126
|
+
if (!iban.test(input2))
|
|
3127
|
+
return false;
|
|
3128
|
+
return isIso7064Mod97(input2);
|
|
3129
|
+
}
|
|
3130
|
+
var $ZodIBAN = /* @__PURE__ */ $constructor("$ZodIBAN", (inst, def) => {
|
|
3131
|
+
def.pattern ?? (def.pattern = iban);
|
|
3132
|
+
$ZodStringFormat.init(inst, def);
|
|
3133
|
+
inst._zod.check = (payload) => {
|
|
3134
|
+
if (isValidIBAN(payload.value))
|
|
3135
|
+
return;
|
|
3136
|
+
payload.issues.push({
|
|
3137
|
+
code: "invalid_format",
|
|
3138
|
+
format: "iban",
|
|
3139
|
+
input: payload.value,
|
|
3140
|
+
inst,
|
|
3141
|
+
continue: !def.abort
|
|
3142
|
+
});
|
|
3143
|
+
};
|
|
3144
|
+
});
|
|
3105
3145
|
function isValidJWT(token, algorithm = null) {
|
|
3106
3146
|
try {
|
|
3107
3147
|
const tokensParts = token.split(".");
|
|
@@ -3152,7 +3192,7 @@ var $ZodCustomStringFormat = /* @__PURE__ */ $constructor("$ZodCustomStringForma
|
|
|
3152
3192
|
});
|
|
3153
3193
|
var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
|
|
3154
3194
|
$ZodType.init(inst, def);
|
|
3155
|
-
inst._zod.pattern =
|
|
3195
|
+
inst._zod.pattern = number;
|
|
3156
3196
|
inst._zod.parse = (payload, _ctx) => {
|
|
3157
3197
|
if (def.coerce)
|
|
3158
3198
|
try {
|
|
@@ -3331,6 +3371,31 @@ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
|
|
|
3331
3371
|
return payload;
|
|
3332
3372
|
};
|
|
3333
3373
|
});
|
|
3374
|
+
function capSize(inst, size) {
|
|
3375
|
+
const caps = sizeCaps(inst._zod.def.checks);
|
|
3376
|
+
if (!caps.length)
|
|
3377
|
+
return;
|
|
3378
|
+
const cap = Math.min(...caps.map((c) => c[0]));
|
|
3379
|
+
const parse5 = inst._zod.parse;
|
|
3380
|
+
inst._zod.parse = (payload, ctx) => {
|
|
3381
|
+
const n = size(payload.value);
|
|
3382
|
+
if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
|
|
3383
|
+
for (const [max, ch] of sizeCaps(inst._zod.def.checks)) {
|
|
3384
|
+
if (n > max && ch._zod.def.when(payload)) {
|
|
3385
|
+
const start = payload.issues.length;
|
|
3386
|
+
ch._zod.check(payload);
|
|
3387
|
+
payload.issues[start].continue = false;
|
|
3388
|
+
attachSchema(payload.issues, start, inst);
|
|
3389
|
+
return payload;
|
|
3390
|
+
}
|
|
3391
|
+
}
|
|
3392
|
+
}
|
|
3393
|
+
return parse5(payload, ctx);
|
|
3394
|
+
};
|
|
3395
|
+
}
|
|
3396
|
+
var arraySize = (input2) => Array.isArray(input2) ? input2.length : -1;
|
|
3397
|
+
var mapSize = (input2) => input2 instanceof Map ? input2.size : -1;
|
|
3398
|
+
var setSize = (input2) => input2 instanceof Set ? input2.size : -1;
|
|
3334
3399
|
function handleArrayResult(result, final, index) {
|
|
3335
3400
|
if (result.issues.length) {
|
|
3336
3401
|
final.issues.push(...prefixIssues(index, result.issues));
|
|
@@ -3354,6 +3419,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
3354
3419
|
}
|
|
3355
3420
|
payload.value = memo2 ? memo2.alloc(inst, payload, Array(input2.length), ctx) : Array(input2.length);
|
|
3356
3421
|
const proms = [];
|
|
3422
|
+
const abortEarly = ctx?.abortEarly;
|
|
3357
3423
|
for (let i = 0; i < input2.length; i++) {
|
|
3358
3424
|
const item = input2[i];
|
|
3359
3425
|
const result = def.element._zod.run({
|
|
@@ -3364,6 +3430,8 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
3364
3430
|
proms.push(result.then((result2) => handleArrayResult(result2, payload, i)));
|
|
3365
3431
|
} else {
|
|
3366
3432
|
handleArrayResult(result, payload, i);
|
|
3433
|
+
if (abortEarly && result.issues.length !== 0 && aborted(result))
|
|
3434
|
+
break;
|
|
3367
3435
|
}
|
|
3368
3436
|
}
|
|
3369
3437
|
if (proms.length) {
|
|
@@ -3371,6 +3439,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
3371
3439
|
}
|
|
3372
3440
|
return payload;
|
|
3373
3441
|
};
|
|
3442
|
+
capSize(inst, arraySize);
|
|
3374
3443
|
});
|
|
3375
3444
|
function handlePropertyResult(result, final, key, input2, optin, optout) {
|
|
3376
3445
|
const isPresent = key in input2;
|
|
@@ -3396,7 +3465,7 @@ function handlePropertyResult(result, final, key, input2, optin, optout) {
|
|
|
3396
3465
|
return;
|
|
3397
3466
|
}
|
|
3398
3467
|
if (result.value === void 0) {
|
|
3399
|
-
if (isPresent) {
|
|
3468
|
+
if (isPresent || optin === "defaulted" && !isOptionalOut) {
|
|
3400
3469
|
final.value[key] = void 0;
|
|
3401
3470
|
}
|
|
3402
3471
|
} else {
|
|
@@ -3425,14 +3494,20 @@ function normalizeDef(def) {
|
|
|
3425
3494
|
optionalKeys: new Set(okeys)
|
|
3426
3495
|
};
|
|
3427
3496
|
}
|
|
3428
|
-
function handleCatchall(proms, input2, payload, ctx, def, inst) {
|
|
3497
|
+
function handleCatchall(proms, input2, payload, ctx, def, inst, abortEarly) {
|
|
3429
3498
|
const unrecognized = [];
|
|
3430
3499
|
const keySet = def.keySet;
|
|
3431
3500
|
const _catchall = def.catchall._zod;
|
|
3432
3501
|
const t = _catchall.def.type;
|
|
3433
3502
|
const optin = _catchall.optin;
|
|
3434
3503
|
const optout = _catchall.optout;
|
|
3504
|
+
let seen = 0;
|
|
3435
3505
|
for (const key in input2) {
|
|
3506
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
3507
|
+
if (aborted(payload, seen))
|
|
3508
|
+
break;
|
|
3509
|
+
seen = payload.issues.length;
|
|
3510
|
+
}
|
|
3436
3511
|
if (keySet.has(key))
|
|
3437
3512
|
continue;
|
|
3438
3513
|
if (key === "__proto__") {
|
|
@@ -3467,23 +3542,19 @@ function handleCatchall(proms, input2, payload, ctx, def, inst) {
|
|
|
3467
3542
|
return payload;
|
|
3468
3543
|
});
|
|
3469
3544
|
}
|
|
3470
|
-
var propShapes = /* @__PURE__ */ new WeakMap();
|
|
3471
3545
|
var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
3472
3546
|
$ZodType.init(inst, def);
|
|
3473
3547
|
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
return newSh;
|
|
3485
|
-
}
|
|
3486
|
-
});
|
|
3548
|
+
const sh = desc?.get ? desc.get.raw : def.shape ?? {};
|
|
3549
|
+
if (sh) {
|
|
3550
|
+
const get = () => {
|
|
3551
|
+
const newSh = { ...sh };
|
|
3552
|
+
Object.defineProperty(def, "shape", { value: newSh });
|
|
3553
|
+
get.raw = newSh;
|
|
3554
|
+
return newSh;
|
|
3555
|
+
};
|
|
3556
|
+
get.raw = sh;
|
|
3557
|
+
Object.defineProperty(def, "shape", { get });
|
|
3487
3558
|
}
|
|
3488
3559
|
const _normalized = cached(() => normalizeDef(def));
|
|
3489
3560
|
defineLazyInternal(inst, "propValues", (zod) => {
|
|
@@ -3523,7 +3594,14 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3523
3594
|
payload.value = memo2 ? memo2.alloc(inst, payload, {}, ctx) : {};
|
|
3524
3595
|
const proms = [];
|
|
3525
3596
|
const shape = value.shape;
|
|
3597
|
+
const abortEarly = ctx?.abortEarly;
|
|
3598
|
+
let seen = payload.issues.length;
|
|
3526
3599
|
for (const key of value.allKeys) {
|
|
3600
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
3601
|
+
if (aborted(payload, seen))
|
|
3602
|
+
break;
|
|
3603
|
+
seen = payload.issues.length;
|
|
3604
|
+
}
|
|
3527
3605
|
if (key === "__proto__")
|
|
3528
3606
|
continue;
|
|
3529
3607
|
const el = shape[key];
|
|
@@ -3539,7 +3617,7 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3539
3617
|
if (!catchall) {
|
|
3540
3618
|
return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
3541
3619
|
}
|
|
3542
|
-
return handleCatchall(proms, input2, payload, ctx, _normalized.value, inst);
|
|
3620
|
+
return handleCatchall(proms, input2, payload, ctx, _normalized.value, inst, abortEarly === true);
|
|
3543
3621
|
};
|
|
3544
3622
|
});
|
|
3545
3623
|
var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
|
|
@@ -3553,10 +3631,16 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
3553
3631
|
const doc = new Doc(["payload", "ctx"], { shape, inst, memo: memo2, syms });
|
|
3554
3632
|
const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
3555
3633
|
const prefixStr = (id, k) => `
|
|
3634
|
+
let ${id}_ab = false;
|
|
3556
3635
|
for (let i = 0; i < ${id}.issues.length; i++) {
|
|
3557
3636
|
const iss = ${id}.issues[i];
|
|
3558
3637
|
iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
|
|
3559
3638
|
payload.issues.push(iss);
|
|
3639
|
+
if (iss.continue !== true) ${id}_ab = true;
|
|
3640
|
+
}
|
|
3641
|
+
if (${id}_ab && ctx && ctx.abortEarly) {
|
|
3642
|
+
payload.value = newResult;
|
|
3643
|
+
return payload;
|
|
3560
3644
|
}`;
|
|
3561
3645
|
doc.write(`const input = payload.value;`);
|
|
3562
3646
|
const ids = /* @__PURE__ */ Object.create(null);
|
|
@@ -3602,6 +3686,10 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
3602
3686
|
input: undefined,
|
|
3603
3687
|
path: [${k}]
|
|
3604
3688
|
});
|
|
3689
|
+
if (ctx && ctx.abortEarly) {
|
|
3690
|
+
payload.value = newResult;
|
|
3691
|
+
return payload;
|
|
3692
|
+
}
|
|
3605
3693
|
}
|
|
3606
3694
|
|
|
3607
3695
|
if (${id}_present) {
|
|
@@ -3613,16 +3701,16 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
3613
3701
|
doc.write(`
|
|
3614
3702
|
if (${id}.issues.length) {${prefixStr(id, k)}
|
|
3615
3703
|
}
|
|
3616
|
-
|
|
3617
|
-
if (
|
|
3618
|
-
|
|
3619
|
-
newResult[${k}] = undefined;
|
|
3620
|
-
}
|
|
3704
|
+
`);
|
|
3705
|
+
if (optin === "defaulted") {
|
|
3706
|
+
doc.write(`newResult[${k}] = ${id}.value;`);
|
|
3621
3707
|
} else {
|
|
3708
|
+
doc.write(`
|
|
3709
|
+
if (${id}.value !== undefined || ${isPresent}) {
|
|
3622
3710
|
newResult[${k}] = ${id}.value;
|
|
3623
3711
|
}
|
|
3624
|
-
|
|
3625
3712
|
`);
|
|
3713
|
+
}
|
|
3626
3714
|
}
|
|
3627
3715
|
}
|
|
3628
3716
|
doc.write(`payload.value = newResult;`);
|
|
@@ -3654,7 +3742,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
3654
3742
|
payload = fastpass(payload, ctx);
|
|
3655
3743
|
if (!catchall)
|
|
3656
3744
|
return payload;
|
|
3657
|
-
return handleCatchall([], input2, payload, ctx, value, inst);
|
|
3745
|
+
return handleCatchall([], input2, payload, ctx, value, inst, ctx?.abortEarly === true);
|
|
3658
3746
|
}
|
|
3659
3747
|
return superParse(payload, ctx);
|
|
3660
3748
|
};
|
|
@@ -3786,16 +3874,31 @@ function getDiscriminatedOption(union2, value) {
|
|
|
3786
3874
|
const internals = union2._zod;
|
|
3787
3875
|
let map2 = internals.bag.optionsMap;
|
|
3788
3876
|
if (!map2) {
|
|
3789
|
-
map2 =
|
|
3790
|
-
const { options, discriminator } = internals.def;
|
|
3791
|
-
for (const option of options) {
|
|
3792
|
-
for (const v of option._zod.propValues?.[discriminator] ?? [])
|
|
3793
|
-
if (!map2.has(v))
|
|
3794
|
-
map2.set(v, option);
|
|
3795
|
-
}
|
|
3877
|
+
map2 = discriminatorMap(internals.def);
|
|
3796
3878
|
internals.bag.optionsMap = map2;
|
|
3797
3879
|
}
|
|
3798
|
-
|
|
3880
|
+
const option = map2.get(value);
|
|
3881
|
+
if (option === null)
|
|
3882
|
+
throw new Error(`Ambiguous discriminator value "${String(value)}"`);
|
|
3883
|
+
return option;
|
|
3884
|
+
}
|
|
3885
|
+
function discriminatorMap(def) {
|
|
3886
|
+
const map2 = /* @__PURE__ */ new Map();
|
|
3887
|
+
for (const option of def.options) {
|
|
3888
|
+
const values = option._zod.propValues?.[def.discriminator];
|
|
3889
|
+
if (!values || values.size === 0)
|
|
3890
|
+
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
|
|
3891
|
+
for (const value of values) {
|
|
3892
|
+
if (map2.has(value)) {
|
|
3893
|
+
if (value !== void 0)
|
|
3894
|
+
throw new Error(`Duplicate discriminator value "${String(value)}"`);
|
|
3895
|
+
map2.set(value, null);
|
|
3896
|
+
} else {
|
|
3897
|
+
map2.set(value, option);
|
|
3898
|
+
}
|
|
3899
|
+
}
|
|
3900
|
+
}
|
|
3901
|
+
return map2;
|
|
3799
3902
|
}
|
|
3800
3903
|
var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnion", (inst, def) => {
|
|
3801
3904
|
def.inclusive = false;
|
|
@@ -3803,10 +3906,13 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
3803
3906
|
const _super = inst._zod.parse;
|
|
3804
3907
|
defineLazyInternal(inst, "propValues", (zod) => {
|
|
3805
3908
|
const propValues = {};
|
|
3909
|
+
let undefinedCount = 0;
|
|
3806
3910
|
for (const option of zod.def.options) {
|
|
3807
3911
|
const pv = option._zod.propValues;
|
|
3808
3912
|
if (!pv || Object.keys(pv).length === 0)
|
|
3809
3913
|
throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
|
|
3914
|
+
if (pv[zod.def.discriminator]?.has(void 0))
|
|
3915
|
+
undefinedCount++;
|
|
3810
3916
|
for (const [k, v] of Object.entries(pv)) {
|
|
3811
3917
|
if (!Object.prototype.hasOwnProperty.call(propValues, k)) {
|
|
3812
3918
|
assignProp(propValues, k, /* @__PURE__ */ new Set());
|
|
@@ -3816,30 +3922,17 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
3816
3922
|
}
|
|
3817
3923
|
}
|
|
3818
3924
|
}
|
|
3925
|
+
if (!zod.def.unionFallback && undefinedCount > 1)
|
|
3926
|
+
propValues[zod.def.discriminator]?.delete(void 0);
|
|
3819
3927
|
return propValues;
|
|
3820
3928
|
});
|
|
3821
3929
|
def.options.forEach((option, i) => {
|
|
3822
|
-
const propShape =
|
|
3930
|
+
const propShape = rawShape(option._zod.def);
|
|
3823
3931
|
if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) {
|
|
3824
3932
|
throw new Error(`Invalid discriminated union option at index "${i}"`);
|
|
3825
3933
|
}
|
|
3826
3934
|
});
|
|
3827
|
-
const disc = cached(() =>
|
|
3828
|
-
const opts = def.options;
|
|
3829
|
-
const map2 = /* @__PURE__ */ new Map();
|
|
3830
|
-
for (const o of opts) {
|
|
3831
|
-
const values = o._zod.propValues?.[def.discriminator];
|
|
3832
|
-
if (!values || values.size === 0)
|
|
3833
|
-
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
|
|
3834
|
-
for (const v of values) {
|
|
3835
|
-
if (map2.has(v)) {
|
|
3836
|
-
throw new Error(`Duplicate discriminator value "${String(v)}"`);
|
|
3837
|
-
}
|
|
3838
|
-
map2.set(v, o);
|
|
3839
|
-
}
|
|
3840
|
-
}
|
|
3841
|
-
return map2;
|
|
3842
|
-
});
|
|
3935
|
+
const disc = cached(() => discriminatorMap(def));
|
|
3843
3936
|
inst._zod.parse = (payload, ctx) => {
|
|
3844
3937
|
const input2 = payload.value;
|
|
3845
3938
|
if (!isObject(input2)) {
|
|
@@ -3851,8 +3944,9 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
3851
3944
|
});
|
|
3852
3945
|
return payload;
|
|
3853
3946
|
}
|
|
3854
|
-
const
|
|
3855
|
-
|
|
3947
|
+
const value = input2?.[def.discriminator];
|
|
3948
|
+
const opt = disc.value.get(value);
|
|
3949
|
+
if (opt && (value !== void 0 || ctx.direction !== "backward")) {
|
|
3856
3950
|
return opt._zod.run(payload, ctx);
|
|
3857
3951
|
}
|
|
3858
3952
|
if (def.unionFallback || ctx.direction === "backward") {
|
|
@@ -3863,7 +3957,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
3863
3957
|
errors: [],
|
|
3864
3958
|
note: "No matching discriminator",
|
|
3865
3959
|
discriminator: def.discriminator,
|
|
3866
|
-
options: Array.from(disc.value.keys()),
|
|
3960
|
+
options: Array.from(disc.value.keys()).filter((value2) => disc.value.get(value2) !== null),
|
|
3867
3961
|
input: input2,
|
|
3868
3962
|
path: [def.discriminator],
|
|
3869
3963
|
inst
|
|
@@ -4029,6 +4123,8 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
4029
4123
|
}
|
|
4030
4124
|
}
|
|
4031
4125
|
const itemResults = new Array(items.length);
|
|
4126
|
+
const abortEarly = def.rest ? ctx?.abortEarly : void 0;
|
|
4127
|
+
let itemAborted = false;
|
|
4032
4128
|
for (let i = 0; i < items.length; i++) {
|
|
4033
4129
|
const r = items[i]._zod.run({ value: input2[i], issues: [] }, ctx);
|
|
4034
4130
|
if (r instanceof Promise) {
|
|
@@ -4037,12 +4133,20 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
4037
4133
|
}));
|
|
4038
4134
|
} else {
|
|
4039
4135
|
itemResults[i] = r;
|
|
4136
|
+
if (abortEarly && !itemAborted && r.issues.length)
|
|
4137
|
+
itemAborted = aborted(r);
|
|
4040
4138
|
}
|
|
4041
4139
|
}
|
|
4042
|
-
if (def.rest) {
|
|
4140
|
+
if (def.rest && !itemAborted) {
|
|
4043
4141
|
let i = items.length - 1;
|
|
4044
4142
|
const rest = input2.slice(items.length);
|
|
4143
|
+
let seen = payload.issues.length;
|
|
4045
4144
|
for (const el of rest) {
|
|
4145
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
4146
|
+
if (aborted(payload, seen))
|
|
4147
|
+
break;
|
|
4148
|
+
seen = payload.issues.length;
|
|
4149
|
+
}
|
|
4046
4150
|
i++;
|
|
4047
4151
|
const result = def.rest._zod.run({ value: el, issues: [] }, ctx);
|
|
4048
4152
|
if (result instanceof Promise) {
|
|
@@ -4270,7 +4374,14 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
|
4270
4374
|
}
|
|
4271
4375
|
const proms = [];
|
|
4272
4376
|
payload.value = memo2 ? memo2.alloc(inst, payload, /* @__PURE__ */ new Map(), ctx) : /* @__PURE__ */ new Map();
|
|
4377
|
+
const abortEarly = ctx?.abortEarly;
|
|
4378
|
+
let seen = payload.issues.length;
|
|
4273
4379
|
for (const [key, value] of input2) {
|
|
4380
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
4381
|
+
if (aborted(payload, seen))
|
|
4382
|
+
break;
|
|
4383
|
+
seen = payload.issues.length;
|
|
4384
|
+
}
|
|
4274
4385
|
const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
4275
4386
|
const valueResult = def.valueType._zod.run({ value, issues: [] }, ctx);
|
|
4276
4387
|
if (keyResult instanceof Promise || valueResult instanceof Promise) {
|
|
@@ -4285,6 +4396,7 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
|
4285
4396
|
return Promise.all(proms).then(() => payload);
|
|
4286
4397
|
return payload;
|
|
4287
4398
|
};
|
|
4399
|
+
capSize(inst, mapSize);
|
|
4288
4400
|
});
|
|
4289
4401
|
function handleMapResult(keyResult, valueResult, final, key, input2, inst, ctx) {
|
|
4290
4402
|
if (keyResult.issues.length) {
|
|
@@ -4333,7 +4445,14 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
|
|
|
4333
4445
|
}
|
|
4334
4446
|
const proms = [];
|
|
4335
4447
|
payload.value = memo2 ? memo2.alloc(inst, payload, /* @__PURE__ */ new Set(), ctx) : /* @__PURE__ */ new Set();
|
|
4448
|
+
const abortEarly = ctx?.abortEarly;
|
|
4449
|
+
let seen = payload.issues.length;
|
|
4336
4450
|
for (const item of input2) {
|
|
4451
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
4452
|
+
if (aborted(payload, seen))
|
|
4453
|
+
break;
|
|
4454
|
+
seen = payload.issues.length;
|
|
4455
|
+
}
|
|
4337
4456
|
const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
|
|
4338
4457
|
if (result instanceof Promise) {
|
|
4339
4458
|
proms.push(result.then((result2) => handleSetResult(result2, payload)));
|
|
@@ -4344,6 +4463,7 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
|
|
|
4344
4463
|
return Promise.all(proms).then(() => payload);
|
|
4345
4464
|
return payload;
|
|
4346
4465
|
};
|
|
4466
|
+
capSize(inst, setSize);
|
|
4347
4467
|
});
|
|
4348
4468
|
function handleSetResult(result, final) {
|
|
4349
4469
|
if (result.issues.length) {
|
|
@@ -4356,8 +4476,10 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
|
4356
4476
|
const values = getEnumValues(def.entries);
|
|
4357
4477
|
const valuesSet = new Set(values);
|
|
4358
4478
|
inst._zod.values = valuesSet;
|
|
4359
|
-
|
|
4360
|
-
|
|
4479
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
4480
|
+
const patternValues = getEnumValues(zod.def.entries).filter((k) => propertyKeyTypes.has(typeof k));
|
|
4481
|
+
return new RegExp(patternValues.length ? `^(${patternValues.map((o) => escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
|
|
4482
|
+
});
|
|
4361
4483
|
inst._zod.parse = (payload, _ctx) => {
|
|
4362
4484
|
const input2 = payload.value;
|
|
4363
4485
|
if (valuesSet.has(input2)) {
|
|
@@ -4376,7 +4498,10 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
4376
4498
|
$ZodType.init(inst, def);
|
|
4377
4499
|
const values = new Set(def.values);
|
|
4378
4500
|
inst._zod.values = values;
|
|
4379
|
-
inst
|
|
4501
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
4502
|
+
const vals = zod.def.values;
|
|
4503
|
+
return new RegExp(vals.length ? `^(${vals.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$` : "^[^\\s\\S]$");
|
|
4504
|
+
});
|
|
4380
4505
|
inst._zod.parse = (payload, _ctx) => {
|
|
4381
4506
|
const input2 = payload.value;
|
|
4382
4507
|
if (values.has(input2)) {
|
|
@@ -4714,20 +4839,62 @@ function handleReadonlyResult(payload) {
|
|
|
4714
4839
|
payload.value = Object.freeze(payload.value);
|
|
4715
4840
|
return payload;
|
|
4716
4841
|
}
|
|
4842
|
+
function leafPattern(schema) {
|
|
4843
|
+
const def = schema._zod.def;
|
|
4844
|
+
let pattern = def.pattern;
|
|
4845
|
+
let isInt = !!def.format?.includes("int");
|
|
4846
|
+
let minimum;
|
|
4847
|
+
let maximum;
|
|
4848
|
+
for (const ch of def.checks ?? []) {
|
|
4849
|
+
const d = ch._zod.def;
|
|
4850
|
+
if (d.pattern)
|
|
4851
|
+
pattern = d.pattern;
|
|
4852
|
+
isInt || (isInt = !!d.format?.includes("int"));
|
|
4853
|
+
const lo = d.minimum ?? d.length;
|
|
4854
|
+
const hi = d.maximum ?? d.length;
|
|
4855
|
+
if (lo !== void 0 && (minimum === void 0 || lo > minimum))
|
|
4856
|
+
minimum = lo;
|
|
4857
|
+
if (hi !== void 0 && (maximum === void 0 || hi < maximum))
|
|
4858
|
+
maximum = hi;
|
|
4859
|
+
}
|
|
4860
|
+
if (pattern)
|
|
4861
|
+
return pattern.source;
|
|
4862
|
+
if (minimum !== void 0 && maximum !== void 0 && minimum > maximum)
|
|
4863
|
+
return "(?!)";
|
|
4864
|
+
if (minimum !== void 0 || maximum !== void 0)
|
|
4865
|
+
return string({ minimum, maximum }).source;
|
|
4866
|
+
const own2 = schema._zod.pattern;
|
|
4867
|
+
return (isInt && own2 === number ? integer : own2)?.source;
|
|
4868
|
+
}
|
|
4869
|
+
function partPattern(schema) {
|
|
4870
|
+
const def = schema._zod.def;
|
|
4871
|
+
const own2 = schema._zod.pattern?.source;
|
|
4872
|
+
const inner = def.innerType ?? schema._zod.innerType;
|
|
4873
|
+
if (inner) {
|
|
4874
|
+
const before = inner._zod.pattern?.source;
|
|
4875
|
+
const after = partPattern(inner);
|
|
4876
|
+
if (own2 && before && after && after !== before) {
|
|
4877
|
+
return own2.replace(cleanRegex(before), () => cleanRegex(after));
|
|
4878
|
+
}
|
|
4879
|
+
return own2;
|
|
4880
|
+
}
|
|
4881
|
+
if (def.options) {
|
|
4882
|
+
const sources = def.options.map(partPattern);
|
|
4883
|
+
if (sources.every(Boolean))
|
|
4884
|
+
return `^(${sources.map((s) => cleanRegex(s)).join("|")})$`;
|
|
4885
|
+
}
|
|
4886
|
+
return leafPattern(schema);
|
|
4887
|
+
}
|
|
4717
4888
|
var $ZodTemplateLiteral = /* @__PURE__ */ $constructor("$ZodTemplateLiteral", (inst, def) => {
|
|
4718
4889
|
$ZodType.init(inst, def);
|
|
4719
4890
|
const regexParts = [];
|
|
4720
4891
|
for (const part of def.parts) {
|
|
4721
4892
|
if (typeof part === "object" && part !== null) {
|
|
4722
|
-
|
|
4893
|
+
const source = partPattern(part);
|
|
4894
|
+
if (!source) {
|
|
4723
4895
|
throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);
|
|
4724
4896
|
}
|
|
4725
|
-
|
|
4726
|
-
if (!source)
|
|
4727
|
-
throw new Error(`Invalid template literal part: ${part._zod.traits}`);
|
|
4728
|
-
const start = source.startsWith("^") ? 1 : 0;
|
|
4729
|
-
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
4730
|
-
regexParts.push(source.slice(start, end));
|
|
4897
|
+
regexParts.push(cleanRegex(source));
|
|
4731
4898
|
} else if (part === null || primitiveTypes.has(typeof part)) {
|
|
4732
4899
|
regexParts.push(escapeRegex(`${part}`));
|
|
4733
4900
|
} else {
|
|
@@ -4902,28 +5069,53 @@ var $ZodCyclicError = class extends Error {
|
|
|
4902
5069
|
};
|
|
4903
5070
|
var STATE = "~memo";
|
|
4904
5071
|
var NO_ISSUES = [];
|
|
5072
|
+
function isRef(value) {
|
|
5073
|
+
return value !== null && typeof value === "object";
|
|
5074
|
+
}
|
|
4905
5075
|
function cloneIssues(issues) {
|
|
4906
5076
|
return issues.map((iss) => iss.path ? { ...iss, path: iss.path.slice() } : { ...iss });
|
|
4907
5077
|
}
|
|
4908
5078
|
var recursive = /* @__PURE__ */ new WeakMap();
|
|
4909
|
-
|
|
5079
|
+
var NONE = 0;
|
|
5080
|
+
var ASSUMED = 1;
|
|
5081
|
+
var PROVEN = 2;
|
|
5082
|
+
function isRecursive(inst, stack, resolve3) {
|
|
4910
5083
|
const cached2 = recursive.get(inst);
|
|
4911
5084
|
if (cached2 !== void 0)
|
|
4912
|
-
return cached2;
|
|
5085
|
+
return cached2 ? PROVEN : NONE;
|
|
4913
5086
|
if (stack.has(inst))
|
|
4914
|
-
return
|
|
5087
|
+
return PROVEN;
|
|
4915
5088
|
stack.add(inst);
|
|
4916
|
-
let result =
|
|
5089
|
+
let result = NONE;
|
|
4917
5090
|
const check2 = (child) => {
|
|
4918
|
-
if (
|
|
4919
|
-
|
|
5091
|
+
if (result !== PROVEN && child?._zod) {
|
|
5092
|
+
const answer = isRecursive(child, stack, resolve3);
|
|
5093
|
+
if (answer > result)
|
|
5094
|
+
result = answer;
|
|
5095
|
+
}
|
|
5096
|
+
};
|
|
5097
|
+
const shape = (sh, spread) => {
|
|
5098
|
+
let answer = NONE;
|
|
5099
|
+
for (const key of Reflect.ownKeys(sh)) {
|
|
5100
|
+
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
5101
|
+
if (spread && !desc.enumerable)
|
|
5102
|
+
continue;
|
|
5103
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve3) : NONE;
|
|
5104
|
+
if (child > answer)
|
|
5105
|
+
answer = child;
|
|
5106
|
+
}
|
|
5107
|
+
return answer;
|
|
5108
|
+
};
|
|
5109
|
+
const merge2 = (answer) => {
|
|
5110
|
+
if (answer > result)
|
|
5111
|
+
result = answer;
|
|
4920
5112
|
};
|
|
4921
5113
|
const def = inst._zod.def;
|
|
4922
5114
|
const kind = def.type;
|
|
4923
5115
|
switch (kind) {
|
|
4924
5116
|
case "object": {
|
|
4925
|
-
|
|
4926
|
-
|
|
5117
|
+
const raw = rawShape(def);
|
|
5118
|
+
merge2(raw ? shape(raw, true) : ASSUMED);
|
|
4927
5119
|
check2(def.catchall);
|
|
4928
5120
|
break;
|
|
4929
5121
|
}
|
|
@@ -4970,10 +5162,12 @@ function isRecursive(inst, stack) {
|
|
|
4970
5162
|
check2(def.input);
|
|
4971
5163
|
check2(def.output);
|
|
4972
5164
|
break;
|
|
4973
|
-
//
|
|
4974
|
-
case "lazy":
|
|
4975
|
-
|
|
5165
|
+
// `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
|
|
5166
|
+
case "lazy": {
|
|
5167
|
+
const inner = def._cachedInner ?? (resolve3 ? inst._zod.innerType : void 0);
|
|
5168
|
+
merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
4976
5169
|
break;
|
|
5170
|
+
}
|
|
4977
5171
|
// a leaf by choice: `parts` are regex fragments, not data positions
|
|
4978
5172
|
case "template_literal":
|
|
4979
5173
|
// leaves
|
|
@@ -5015,16 +5209,20 @@ function isRecursive(inst, stack) {
|
|
|
5015
5209
|
}
|
|
5016
5210
|
}
|
|
5017
5211
|
stack.delete(inst);
|
|
5018
|
-
|
|
5019
|
-
|
|
5212
|
+
return settle(inst, result);
|
|
5213
|
+
}
|
|
5214
|
+
function settle(inst, answer) {
|
|
5215
|
+
if (answer !== ASSUMED)
|
|
5216
|
+
recursive.set(inst, answer === PROVEN);
|
|
5217
|
+
return answer;
|
|
5020
5218
|
}
|
|
5021
5219
|
function isRecursiveSchema(inst) {
|
|
5022
|
-
return isRecursive(inst, /* @__PURE__ */ new Set());
|
|
5220
|
+
return isRecursive(inst, /* @__PURE__ */ new Set(), true) !== NONE;
|
|
5023
5221
|
}
|
|
5024
5222
|
function bucketFor(state, inst) {
|
|
5025
5223
|
let bucket = state.buckets.get(inst);
|
|
5026
5224
|
if (!bucket) {
|
|
5027
|
-
bucket = /* @__PURE__ */ new
|
|
5225
|
+
bucket = /* @__PURE__ */ new WeakMap();
|
|
5028
5226
|
state.buckets.set(inst, bucket);
|
|
5029
5227
|
}
|
|
5030
5228
|
return bucket;
|
|
@@ -5060,6 +5258,7 @@ var memo = {
|
|
|
5060
5258
|
attach(inst) {
|
|
5061
5259
|
var _a3;
|
|
5062
5260
|
let isRecursiveInst;
|
|
5261
|
+
let rechecked = false;
|
|
5063
5262
|
let lastCtx;
|
|
5064
5263
|
let lastBucket;
|
|
5065
5264
|
(_a3 = inst._zod).deferred ?? (_a3.deferred = []);
|
|
@@ -5067,20 +5266,24 @@ var memo = {
|
|
|
5067
5266
|
const base = inst._zod.parse;
|
|
5068
5267
|
const wrapped = (payload, ctx) => {
|
|
5069
5268
|
if (isRecursiveInst === void 0) {
|
|
5070
|
-
|
|
5071
|
-
if (
|
|
5269
|
+
const walked = isRecursive(inst, /* @__PURE__ */ new Set(), false);
|
|
5270
|
+
if (walked === NONE) {
|
|
5072
5271
|
inst._zod.parse = base;
|
|
5073
5272
|
if (inst._zod.run === wrapped)
|
|
5074
5273
|
inst._zod.run = base;
|
|
5075
5274
|
return base(payload, ctx);
|
|
5076
5275
|
}
|
|
5276
|
+
if (walked === PROVEN || rechecked)
|
|
5277
|
+
isRecursiveInst = true;
|
|
5278
|
+
else
|
|
5279
|
+
rechecked = true;
|
|
5077
5280
|
}
|
|
5078
5281
|
const input2 = payload.value;
|
|
5079
|
-
if (input2
|
|
5282
|
+
if (!isRef(input2))
|
|
5080
5283
|
return base(payload, ctx);
|
|
5081
5284
|
let state = ctx[STATE];
|
|
5082
5285
|
if (!state) {
|
|
5083
|
-
state = { buckets: /* @__PURE__ */ new
|
|
5286
|
+
state = { buckets: /* @__PURE__ */ new WeakMap(), backEdges: void 0 };
|
|
5084
5287
|
ctx[STATE] = state;
|
|
5085
5288
|
}
|
|
5086
5289
|
let bucket;
|
|
@@ -5099,7 +5302,7 @@ var memo = {
|
|
|
5099
5302
|
payload.issues.push(...cloneIssues(hit.issues));
|
|
5100
5303
|
} else {
|
|
5101
5304
|
payload.memo = true;
|
|
5102
|
-
state.backEdges ?? (state.backEdges = /* @__PURE__ */ new
|
|
5305
|
+
state.backEdges ?? (state.backEdges = /* @__PURE__ */ new WeakSet());
|
|
5103
5306
|
state.backEdges.add(hit.value);
|
|
5104
5307
|
}
|
|
5105
5308
|
return payload;
|
|
@@ -5131,7 +5334,7 @@ function memoizer() {
|
|
|
5131
5334
|
}
|
|
5132
5335
|
function isBackEdge(ctx, value) {
|
|
5133
5336
|
const backEdges = ctx[STATE]?.backEdges;
|
|
5134
|
-
return backEdges !== void 0 && value
|
|
5337
|
+
return backEdges !== void 0 && isRef(value) && backEdges.has(value);
|
|
5135
5338
|
}
|
|
5136
5339
|
|
|
5137
5340
|
// node_modules/zod/v4/locales/index.js
|
|
@@ -5188,6 +5391,7 @@ __export(locales_exports, {
|
|
|
5188
5391
|
sl: () => sl_default,
|
|
5189
5392
|
sv: () => sv_default,
|
|
5190
5393
|
ta: () => ta_default,
|
|
5394
|
+
tg: () => tg_default,
|
|
5191
5395
|
th: () => th_default,
|
|
5192
5396
|
tk: () => tk_default,
|
|
5193
5397
|
tr: () => tr_default,
|
|
@@ -5242,6 +5446,8 @@ var error = () => {
|
|
|
5242
5446
|
json_string: "\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",
|
|
5243
5447
|
e164: "\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",
|
|
5244
5448
|
credit_card: "\u0631\u0642\u0645 \u0628\u0637\u0627\u0642\u0629 \u0627\u0644\u0627\u0626\u062A\u0645\u0627\u0646",
|
|
5449
|
+
currency_code: "\u0631\u0645\u0632 \u0627\u0644\u0639\u0645\u0644\u0629",
|
|
5450
|
+
iban: "IBAN",
|
|
5245
5451
|
jwt: "JWT",
|
|
5246
5452
|
template_literal: "\u0645\u062F\u062E\u0644"
|
|
5247
5453
|
};
|
|
@@ -5352,6 +5558,8 @@ var error2 = () => {
|
|
|
5352
5558
|
json_string: "JSON string",
|
|
5353
5559
|
e164: "E.164 number",
|
|
5354
5560
|
credit_card: "kredit kart\u0131 n\xF6mr\u0259si",
|
|
5561
|
+
currency_code: "valyuta kodu",
|
|
5562
|
+
iban: "IBAN",
|
|
5355
5563
|
jwt: "JWT",
|
|
5356
5564
|
template_literal: "input"
|
|
5357
5565
|
};
|
|
@@ -5511,6 +5719,8 @@ var error3 = () => {
|
|
|
5511
5719
|
json_string: "JSON \u0440\u0430\u0434\u043E\u043A",
|
|
5512
5720
|
e164: "\u043D\u0443\u043C\u0430\u0440 E.164",
|
|
5513
5721
|
credit_card: "\u043D\u0443\u043C\u0430\u0440 \u043A\u0440\u044D\u0434\u044B\u0442\u043D\u0430\u0439 \u043A\u0430\u0440\u0442\u044B",
|
|
5722
|
+
currency_code: "\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u044B",
|
|
5723
|
+
iban: "IBAN",
|
|
5514
5724
|
jwt: "JWT",
|
|
5515
5725
|
template_literal: "\u0443\u0432\u043E\u0434"
|
|
5516
5726
|
};
|
|
@@ -5628,6 +5838,8 @@ var error4 = () => {
|
|
|
5628
5838
|
json_string: "JSON \u043D\u0438\u0437",
|
|
5629
5839
|
e164: "E.164 \u043D\u043E\u043C\u0435\u0440",
|
|
5630
5840
|
credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0430",
|
|
5841
|
+
currency_code: "\u043A\u043E\u0434 \u043D\u0430 \u0432\u0430\u043B\u0443\u0442\u0430",
|
|
5842
|
+
iban: "IBAN",
|
|
5631
5843
|
jwt: "JWT",
|
|
5632
5844
|
template_literal: "\u0432\u0445\u043E\u0434"
|
|
5633
5845
|
};
|
|
@@ -5752,6 +5964,8 @@ var error5 = () => {
|
|
|
5752
5964
|
json_string: "JSON \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",
|
|
5753
5965
|
e164: "E.164 \u09A8\u09AE\u09CD\u09AC\u09B0",
|
|
5754
5966
|
credit_card: "\u0995\u09CD\u09B0\u09C7\u09A1\u09BF\u099F \u0995\u09BE\u09B0\u09CD\u09A1 \u09A8\u09AE\u09CD\u09AC\u09B0",
|
|
5967
|
+
currency_code: "\u09AE\u09C1\u09A6\u09CD\u09B0\u09BE \u0995\u09CB\u09A1",
|
|
5968
|
+
iban: "IBAN",
|
|
5755
5969
|
jwt: "JWT",
|
|
5756
5970
|
template_literal: "\u0987\u09A8\u09AA\u09C1\u099F"
|
|
5757
5971
|
};
|
|
@@ -5864,6 +6078,8 @@ var error6 = () => {
|
|
|
5864
6078
|
json_string: "cadena JSON",
|
|
5865
6079
|
e164: "n\xFAmero E.164",
|
|
5866
6080
|
credit_card: "n\xFAmero de targeta de cr\xE8dit",
|
|
6081
|
+
currency_code: "codi de moneda",
|
|
6082
|
+
iban: "IBAN",
|
|
5867
6083
|
jwt: "JWT",
|
|
5868
6084
|
template_literal: "entrada"
|
|
5869
6085
|
};
|
|
@@ -5976,6 +6192,8 @@ var error7 = () => {
|
|
|
5976
6192
|
json_string: "\u062F\u06D5\u0642\u06CC JSON",
|
|
5977
6193
|
e164: "\u0698\u0645\u0627\u0631\u06D5\u06CC E.164",
|
|
5978
6194
|
credit_card: "\u0698\u0645\u0627\u0631\u06D5\u06CC \u06A9\u0627\u0631\u062A\u06CC \u06A9\u0631\u06CE\u062F\u06CC\u062A",
|
|
6195
|
+
currency_code: "\u06A9\u06C6\u062F\u06CC \u062F\u0631\u0627\u0648",
|
|
6196
|
+
iban: "IBAN",
|
|
5979
6197
|
jwt: "JWT",
|
|
5980
6198
|
template_literal: "\u062A\u06CE\u06A9\u0631\u062F\u06D5"
|
|
5981
6199
|
};
|
|
@@ -6107,6 +6325,8 @@ var error8 = () => {
|
|
|
6107
6325
|
json_string: "\u0159et\u011Bzec ve form\xE1tu JSON",
|
|
6108
6326
|
e164: "\u010D\xEDslo E.164",
|
|
6109
6327
|
credit_card: "\u010D\xEDslo kreditn\xED karty",
|
|
6328
|
+
currency_code: "k\xF3d m\u011Bny",
|
|
6329
|
+
iban: "IBAN",
|
|
6110
6330
|
jwt: "JWT",
|
|
6111
6331
|
template_literal: "vstup"
|
|
6112
6332
|
};
|
|
@@ -6222,6 +6442,8 @@ var error9 = () => {
|
|
|
6222
6442
|
json_string: "JSON-streng",
|
|
6223
6443
|
e164: "E.164-nummer",
|
|
6224
6444
|
credit_card: "kreditkortnummer",
|
|
6445
|
+
currency_code: "valutakode",
|
|
6446
|
+
iban: "IBAN",
|
|
6225
6447
|
jwt: "JWT",
|
|
6226
6448
|
template_literal: "input"
|
|
6227
6449
|
};
|
|
@@ -6341,6 +6563,8 @@ var error10 = () => {
|
|
|
6341
6563
|
json_string: "JSON-String",
|
|
6342
6564
|
e164: "E.164-Nummer",
|
|
6343
6565
|
credit_card: "Kreditkartennummer",
|
|
6566
|
+
currency_code: "W\xE4hrungscode",
|
|
6567
|
+
iban: "IBAN",
|
|
6344
6568
|
jwt: "JWT",
|
|
6345
6569
|
template_literal: "Eingabe"
|
|
6346
6570
|
};
|
|
@@ -6453,6 +6677,8 @@ var error11 = () => {
|
|
|
6453
6677
|
json_string: "\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",
|
|
6454
6678
|
e164: "\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",
|
|
6455
6679
|
credit_card: "\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 \u03C0\u03B9\u03C3\u03C4\u03C9\u03C4\u03B9\u03BA\u03AE\u03C2 \u03BA\u03AC\u03C1\u03C4\u03B1\u03C2",
|
|
6680
|
+
currency_code: "\u03BA\u03C9\u03B4\u03B9\u03BA\u03CC\u03C2 \u03BD\u03BF\u03BC\u03AF\u03C3\u03BC\u03B1\u03C4\u03BF\u03C2",
|
|
6681
|
+
iban: "IBAN",
|
|
6456
6682
|
jwt: "JWT",
|
|
6457
6683
|
template_literal: "\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"
|
|
6458
6684
|
};
|
|
@@ -6563,7 +6789,9 @@ var error12 = () => {
|
|
|
6563
6789
|
base64url: "base64url-encoded string",
|
|
6564
6790
|
json_string: "JSON string",
|
|
6565
6791
|
e164: "E.164 number",
|
|
6792
|
+
currency_code: "currency code",
|
|
6566
6793
|
credit_card: "credit card number",
|
|
6794
|
+
iban: "IBAN",
|
|
6567
6795
|
jwt: "JWT",
|
|
6568
6796
|
template_literal: "input"
|
|
6569
6797
|
};
|
|
@@ -6687,6 +6915,8 @@ var error13 = () => {
|
|
|
6687
6915
|
json_string: "JSON-karaktraro",
|
|
6688
6916
|
e164: "E.164-nombro",
|
|
6689
6917
|
credit_card: "kreditkarta numero",
|
|
6918
|
+
currency_code: "valuta kodo",
|
|
6919
|
+
iban: "IBAN",
|
|
6690
6920
|
jwt: "JWT",
|
|
6691
6921
|
template_literal: "enigo"
|
|
6692
6922
|
};
|
|
@@ -6799,6 +7029,8 @@ var error14 = () => {
|
|
|
6799
7029
|
json_string: "cadena JSON",
|
|
6800
7030
|
e164: "n\xFAmero E.164",
|
|
6801
7031
|
credit_card: "n\xFAmero de tarjeta de cr\xE9dito",
|
|
7032
|
+
currency_code: "c\xF3digo de moneda",
|
|
7033
|
+
iban: "IBAN",
|
|
6802
7034
|
jwt: "JWT",
|
|
6803
7035
|
template_literal: "entrada"
|
|
6804
7036
|
};
|
|
@@ -6935,6 +7167,8 @@ var error15 = () => {
|
|
|
6935
7167
|
json_string: "JSON \u0631\u0634\u062A\u0647",
|
|
6936
7168
|
e164: "E.164 \u0639\u062F\u062F",
|
|
6937
7169
|
credit_card: "\u0634\u0645\u0627\u0631\u0647 \u06A9\u0627\u0631\u062A \u0627\u0639\u062A\u0628\u0627\u0631\u06CC",
|
|
7170
|
+
currency_code: "\u06A9\u062F \u0627\u0631\u0632",
|
|
7171
|
+
iban: "IBAN",
|
|
6938
7172
|
jwt: "JWT",
|
|
6939
7173
|
template_literal: "\u0648\u0631\u0648\u062F\u06CC"
|
|
6940
7174
|
};
|
|
@@ -7057,6 +7291,8 @@ var error16 = () => {
|
|
|
7057
7291
|
json_string: "JSON-merkkijono",
|
|
7058
7292
|
e164: "E.164-luku",
|
|
7059
7293
|
credit_card: "luottokortin numero",
|
|
7294
|
+
currency_code: "valuuttakoodi",
|
|
7295
|
+
iban: "IBAN",
|
|
7060
7296
|
jwt: "JWT",
|
|
7061
7297
|
template_literal: "templaattimerkkijono"
|
|
7062
7298
|
};
|
|
@@ -7168,6 +7404,8 @@ var error17 = () => {
|
|
|
7168
7404
|
json_string: "cha\xEEne de caract\xE8res JSON",
|
|
7169
7405
|
e164: "num\xE9ro au format E.164",
|
|
7170
7406
|
credit_card: "num\xE9ro de carte de cr\xE9dit",
|
|
7407
|
+
currency_code: "code de devise",
|
|
7408
|
+
iban: "IBAN",
|
|
7171
7409
|
jwt: "JWT",
|
|
7172
7410
|
template_literal: "entr\xE9e"
|
|
7173
7411
|
};
|
|
@@ -7297,6 +7535,8 @@ var error18 = () => {
|
|
|
7297
7535
|
json_string: "cha\xEEne JSON",
|
|
7298
7536
|
e164: "num\xE9ro E.164",
|
|
7299
7537
|
credit_card: "num\xE9ro de carte de cr\xE9dit",
|
|
7538
|
+
currency_code: "code de devise",
|
|
7539
|
+
iban: "IBAN",
|
|
7300
7540
|
jwt: "JWT",
|
|
7301
7541
|
template_literal: "entr\xE9e"
|
|
7302
7542
|
};
|
|
@@ -7408,6 +7648,8 @@ var error19 = () => {
|
|
|
7408
7648
|
json_string: "JSON \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",
|
|
7409
7649
|
e164: "E.164 \u0AA8\u0A82\u0AAC\u0AB0",
|
|
7410
7650
|
credit_card: "\u0A95\u0ACD\u0AB0\u0AC7\u0AA1\u0ABF\u0A9F \u0A95\u0ABE\u0AB0\u0ACD\u0AA1 \u0AA8\u0A82\u0AAC\u0AB0",
|
|
7651
|
+
currency_code: "\u0A9A\u0AB2\u0AA3 \u0A95\u0ACB\u0AA1",
|
|
7652
|
+
iban: "IBAN",
|
|
7411
7653
|
jwt: "JWT",
|
|
7412
7654
|
template_literal: "\u0A87\u0AA8\u0AAA\u0AC1\u0A9F"
|
|
7413
7655
|
};
|
|
@@ -7556,6 +7798,8 @@ var error20 = () => {
|
|
|
7556
7798
|
json_string: { label: "\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON", gender: "f" },
|
|
7557
7799
|
e164: { label: "\u05DE\u05E1\u05E4\u05E8 E.164", gender: "m" },
|
|
7558
7800
|
credit_card: { label: "\u05DE\u05E1\u05E4\u05E8 \u05DB\u05E8\u05D8\u05D9\u05E1 \u05D0\u05E9\u05E8\u05D0\u05D9", gender: "m" },
|
|
7801
|
+
currency_code: { label: "\u05E7\u05D5\u05D3 \u05DE\u05D8\u05D1\u05E2", gender: "m" },
|
|
7802
|
+
iban: { label: "IBAN", gender: "m" },
|
|
7559
7803
|
jwt: { label: "JWT", gender: "m" },
|
|
7560
7804
|
template_literal: { label: "\u05E7\u05DC\u05D8", gender: "m" },
|
|
7561
7805
|
ends_with: { label: "\u05E7\u05DC\u05D8", gender: "m" },
|
|
@@ -7720,6 +7964,8 @@ var error21 = () => {
|
|
|
7720
7964
|
json_string: "JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",
|
|
7721
7965
|
e164: "E.164 \u0938\u0902\u0916\u094D\u092F\u093E",
|
|
7722
7966
|
credit_card: "\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0938\u0902\u0916\u094D\u092F\u093E",
|
|
7967
|
+
currency_code: "\u092E\u0941\u0926\u094D\u0930\u093E \u0915\u094B\u0921",
|
|
7968
|
+
iban: "IBAN",
|
|
7723
7969
|
jwt: "JWT",
|
|
7724
7970
|
template_literal: "\u0907\u0928\u092A\u0941\u091F"
|
|
7725
7971
|
};
|
|
@@ -7829,6 +8075,8 @@ var error22 = () => {
|
|
|
7829
8075
|
json_string: "JSON tekst",
|
|
7830
8076
|
e164: "E.164 broj",
|
|
7831
8077
|
credit_card: "broj kreditne kartice",
|
|
8078
|
+
currency_code: "kod valute",
|
|
8079
|
+
iban: "IBAN",
|
|
7832
8080
|
jwt: "JWT",
|
|
7833
8081
|
template_literal: "unos"
|
|
7834
8082
|
};
|
|
@@ -7955,6 +8203,8 @@ var error23 = () => {
|
|
|
7955
8203
|
json_string: "JSON string",
|
|
7956
8204
|
e164: "E.164 sz\xE1m",
|
|
7957
8205
|
credit_card: "hitelk\xE1rtyasz\xE1m",
|
|
8206
|
+
currency_code: "p\xE9nznemk\xF3d",
|
|
8207
|
+
iban: "IBAN",
|
|
7958
8208
|
jwt: "JWT",
|
|
7959
8209
|
template_literal: "bemenet"
|
|
7960
8210
|
};
|
|
@@ -8107,6 +8357,8 @@ var error24 = () => {
|
|
|
8107
8357
|
json_string: "JSON \u057F\u0578\u0572",
|
|
8108
8358
|
e164: "E.164 \u0570\u0561\u0574\u0561\u0580",
|
|
8109
8359
|
credit_card: "\u056F\u0580\u0565\u0564\u056B\u057F \u0584\u0561\u0580\u057F\u056B \u0570\u0561\u0574\u0561\u0580",
|
|
8360
|
+
currency_code: "\u0561\u0580\u056A\u0578\u0582\u0575\u0569\u056B \u056F\u0578\u0564",
|
|
8361
|
+
iban: "IBAN",
|
|
8110
8362
|
jwt: "JWT",
|
|
8111
8363
|
template_literal: "\u0574\u0578\u0582\u057F\u0584"
|
|
8112
8364
|
};
|
|
@@ -8224,6 +8476,8 @@ var error25 = () => {
|
|
|
8224
8476
|
json_string: "string JSON",
|
|
8225
8477
|
e164: "angka E.164",
|
|
8226
8478
|
credit_card: "nomor kartu kredit",
|
|
8479
|
+
currency_code: "kode mata uang",
|
|
8480
|
+
iban: "IBAN",
|
|
8227
8481
|
jwt: "JWT",
|
|
8228
8482
|
template_literal: "input"
|
|
8229
8483
|
};
|
|
@@ -8334,6 +8588,8 @@ var error26 = () => {
|
|
|
8334
8588
|
json_string: "JSON strengur",
|
|
8335
8589
|
e164: "E.164 t\xF6lugildi",
|
|
8336
8590
|
credit_card: "kreditkortan\xFAmer",
|
|
8591
|
+
currency_code: "gjaldmi\xF0ilsk\xF3\xF0i",
|
|
8592
|
+
iban: "IBAN",
|
|
8337
8593
|
jwt: "JWT",
|
|
8338
8594
|
template_literal: "gildi"
|
|
8339
8595
|
};
|
|
@@ -8447,6 +8703,8 @@ var error27 = () => {
|
|
|
8447
8703
|
json_string: "stringa JSON",
|
|
8448
8704
|
e164: "numero E.164",
|
|
8449
8705
|
credit_card: "numero di carta di credito",
|
|
8706
|
+
currency_code: "codice valuta",
|
|
8707
|
+
iban: "IBAN",
|
|
8450
8708
|
jwt: "JWT",
|
|
8451
8709
|
template_literal: "input"
|
|
8452
8710
|
};
|
|
@@ -8559,6 +8817,8 @@ var error28 = () => {
|
|
|
8559
8817
|
json_string: "JSON\u6587\u5B57\u5217",
|
|
8560
8818
|
e164: "E.164\u756A\u53F7",
|
|
8561
8819
|
credit_card: "\u30AF\u30EC\u30B8\u30C3\u30C8\u30AB\u30FC\u30C9\u756A\u53F7",
|
|
8820
|
+
currency_code: "\u901A\u8CA8\u30B3\u30FC\u30C9",
|
|
8821
|
+
iban: "IBAN",
|
|
8562
8822
|
jwt: "JWT",
|
|
8563
8823
|
template_literal: "\u5165\u529B\u5024"
|
|
8564
8824
|
};
|
|
@@ -8670,6 +8930,8 @@ var error29 = () => {
|
|
|
8670
8930
|
json_string: "JSON \u10D5\u10D4\u10DA\u10D8",
|
|
8671
8931
|
e164: "E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",
|
|
8672
8932
|
credit_card: "\u10E1\u10D0\u10D9\u10E0\u10D4\u10D3\u10D8\u10E2\u10DD \u10D1\u10D0\u10E0\u10D0\u10D7\u10D8\u10E1 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",
|
|
8933
|
+
currency_code: "\u10D5\u10D0\u10DA\u10E3\u10E2\u10D8\u10E1 \u10D9\u10DD\u10D3\u10D8",
|
|
8934
|
+
iban: "IBAN",
|
|
8673
8935
|
jwt: "JWT",
|
|
8674
8936
|
template_literal: "\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"
|
|
8675
8937
|
};
|
|
@@ -8786,6 +9048,8 @@ var error30 = () => {
|
|
|
8786
9048
|
json_string: "\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",
|
|
8787
9049
|
e164: "\u179B\u17C1\u1781 E.164",
|
|
8788
9050
|
credit_card: "\u179B\u17C1\u1781\u1794\u17D0\u178E\u17D2\u178E\u17A5\u178E\u1791\u17B6\u1793",
|
|
9051
|
+
currency_code: "\u1780\u17BC\u178A\u179A\u17BC\u1794\u17B7\u1799\u1794\u17D0\u178E\u17D2\u178E",
|
|
9052
|
+
iban: "IBAN",
|
|
8789
9053
|
jwt: "JWT",
|
|
8790
9054
|
template_literal: "\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"
|
|
8791
9055
|
};
|
|
@@ -8905,6 +9169,8 @@ var error31 = () => {
|
|
|
8905
9169
|
json_string: "JSON\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",
|
|
8906
9170
|
e164: "E.164 \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",
|
|
8907
9171
|
credit_card: "\u0C95\u0CCD\u0CB0\u0CC6\u0CA1\u0CBF\u0C9F\u0CCD \u0C95\u0CBE\u0CB0\u0CCD\u0CA1\u0CCD \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",
|
|
9172
|
+
currency_code: "\u0C95\u0CB0\u0CC6\u0CA8\u0CCD\u0CB8\u0CBF \u0C95\u0CCB\u0CA1\u0CCD",
|
|
9173
|
+
iban: "IBAN",
|
|
8908
9174
|
jwt: "JWT",
|
|
8909
9175
|
template_literal: "\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD"
|
|
8910
9176
|
};
|
|
@@ -9019,6 +9285,8 @@ var error32 = () => {
|
|
|
9019
9285
|
json_string: "JSON \uBB38\uC790\uC5F4",
|
|
9020
9286
|
e164: "E.164 \uBC88\uD638",
|
|
9021
9287
|
credit_card: "\uC2E0\uC6A9\uCE74\uB4DC \uBC88\uD638",
|
|
9288
|
+
currency_code: "\uD1B5\uD654 \uCF54\uB4DC",
|
|
9289
|
+
iban: "IBAN",
|
|
9022
9290
|
jwt: "JWT",
|
|
9023
9291
|
template_literal: "\uC785\uB825"
|
|
9024
9292
|
};
|
|
@@ -9216,6 +9484,8 @@ var error33 = () => {
|
|
|
9216
9484
|
json_string: "JSON eilut\u0117",
|
|
9217
9485
|
e164: "E.164 numeris",
|
|
9218
9486
|
credit_card: "kredito kortel\u0117s numeris",
|
|
9487
|
+
currency_code: "valiutos kodas",
|
|
9488
|
+
iban: "IBAN",
|
|
9219
9489
|
jwt: "JWT",
|
|
9220
9490
|
template_literal: "\u012Fvestis"
|
|
9221
9491
|
};
|
|
@@ -9340,6 +9610,8 @@ var error34 = () => {
|
|
|
9340
9610
|
json_string: "JSON \u043D\u0438\u0437\u0430",
|
|
9341
9611
|
e164: "E.164 \u0431\u0440\u043E\u0458",
|
|
9342
9612
|
credit_card: "\u0431\u0440\u043E\u0458 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0438\u0447\u043A\u0430",
|
|
9613
|
+
currency_code: "\u043A\u043E\u0434 \u043D\u0430 \u0432\u0430\u043B\u0443\u0442\u0430",
|
|
9614
|
+
iban: "IBAN",
|
|
9343
9615
|
jwt: "JWT",
|
|
9344
9616
|
template_literal: "\u0432\u043D\u0435\u0441"
|
|
9345
9617
|
};
|
|
@@ -9453,6 +9725,8 @@ var error35 = () => {
|
|
|
9453
9725
|
json_string: "string JSON",
|
|
9454
9726
|
e164: "nombor E.164",
|
|
9455
9727
|
credit_card: "nombor kad kredit",
|
|
9728
|
+
currency_code: "kod mata wang",
|
|
9729
|
+
iban: "IBAN",
|
|
9456
9730
|
jwt: "JWT",
|
|
9457
9731
|
template_literal: "input"
|
|
9458
9732
|
};
|
|
@@ -9564,6 +9838,8 @@ var error36 = () => {
|
|
|
9564
9838
|
json_string: "JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0919",
|
|
9565
9839
|
e164: "E.164 \u0928\u092E\u094D\u092C\u0930",
|
|
9566
9840
|
credit_card: "\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0928\u092E\u094D\u092C\u0930",
|
|
9841
|
+
currency_code: "\u092E\u0941\u0926\u094D\u0930\u093E \u0915\u094B\u0921",
|
|
9842
|
+
iban: "IBAN",
|
|
9567
9843
|
jwt: "JWT",
|
|
9568
9844
|
template_literal: "\u0907\u0928\u092A\u0941\u091F"
|
|
9569
9845
|
};
|
|
@@ -9674,6 +9950,8 @@ var error37 = () => {
|
|
|
9674
9950
|
json_string: "JSON string",
|
|
9675
9951
|
e164: "E.164-nummer",
|
|
9676
9952
|
credit_card: "creditcardnummer",
|
|
9953
|
+
currency_code: "valutacode",
|
|
9954
|
+
iban: "IBAN",
|
|
9677
9955
|
jwt: "JWT",
|
|
9678
9956
|
template_literal: "invoer"
|
|
9679
9957
|
};
|
|
@@ -9788,6 +10066,8 @@ var error38 = () => {
|
|
|
9788
10066
|
json_string: "JSON-streng",
|
|
9789
10067
|
e164: "E.164-nummer",
|
|
9790
10068
|
credit_card: "kredittkortnummer",
|
|
10069
|
+
currency_code: "valutakode",
|
|
10070
|
+
iban: "IBAN",
|
|
9791
10071
|
jwt: "JWT",
|
|
9792
10072
|
template_literal: "input"
|
|
9793
10073
|
};
|
|
@@ -9900,6 +10180,8 @@ var error39 = () => {
|
|
|
9900
10180
|
json_string: "JSON-streng",
|
|
9901
10181
|
e164: "E.164-nummer",
|
|
9902
10182
|
credit_card: "kredittkortnummer",
|
|
10183
|
+
currency_code: "valutakode",
|
|
10184
|
+
iban: "IBAN",
|
|
9903
10185
|
jwt: "JWT",
|
|
9904
10186
|
template_literal: "input"
|
|
9905
10187
|
};
|
|
@@ -10012,6 +10294,8 @@ var error40 = () => {
|
|
|
10012
10294
|
json_string: "JSON metin",
|
|
10013
10295
|
e164: "E.164 say\u0131s\u0131",
|
|
10014
10296
|
credit_card: "i'tib\xE2r kart\u0131 numaras\u0131",
|
|
10297
|
+
currency_code: "para birimi kodu",
|
|
10298
|
+
iban: "IBAN",
|
|
10015
10299
|
jwt: "JWT",
|
|
10016
10300
|
template_literal: "giren"
|
|
10017
10301
|
};
|
|
@@ -10125,6 +10409,8 @@ var error41 = () => {
|
|
|
10125
10409
|
json_string: "JSON \u0645\u062A\u0646",
|
|
10126
10410
|
e164: "\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",
|
|
10127
10411
|
credit_card: "\u062F \u06A9\u0631\u06CC\u0689\u06CC\u067C \u06A9\u0627\u0631\u062A \u0634\u0645\u06CC\u0631\u0647",
|
|
10412
|
+
currency_code: "\u062F \u0627\u0633\u0639\u0627\u0631\u0648 \u06A9\u0648\u0689",
|
|
10413
|
+
iban: "IBAN",
|
|
10128
10414
|
jwt: "JWT",
|
|
10129
10415
|
template_literal: "\u0648\u0631\u0648\u062F\u064A"
|
|
10130
10416
|
};
|
|
@@ -10243,6 +10529,8 @@ var error42 = () => {
|
|
|
10243
10529
|
json_string: "ci\u0105g znak\xF3w w formacie JSON",
|
|
10244
10530
|
e164: "liczba E.164",
|
|
10245
10531
|
credit_card: "numer karty kredytowej",
|
|
10532
|
+
currency_code: "kod waluty",
|
|
10533
|
+
iban: "IBAN",
|
|
10246
10534
|
jwt: "JWT",
|
|
10247
10535
|
template_literal: "wej\u015Bcie"
|
|
10248
10536
|
};
|
|
@@ -10356,6 +10644,8 @@ var error43 = () => {
|
|
|
10356
10644
|
json_string: "o texto JSON",
|
|
10357
10645
|
e164: "o n\xFAmero E.164",
|
|
10358
10646
|
credit_card: "o n\xFAmero de cart\xE3o de cr\xE9dito",
|
|
10647
|
+
currency_code: "o c\xF3digo de moeda",
|
|
10648
|
+
iban: "o IBAN",
|
|
10359
10649
|
jwt: "o JWT",
|
|
10360
10650
|
template_literal: "a entrada"
|
|
10361
10651
|
};
|
|
@@ -10433,8 +10723,8 @@ var error43 = () => {
|
|
|
10433
10723
|
case "not_multiple_of":
|
|
10434
10724
|
return `N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${issue2.divisor}`;
|
|
10435
10725
|
case "unrecognized_keys": {
|
|
10436
|
-
const
|
|
10437
|
-
return `Chave${
|
|
10726
|
+
const plural2 = issue2.keys.length > 1 ? "s" : "";
|
|
10727
|
+
return `Chave${plural2} inv\xE1lida${plural2}: ${joinValues(issue2.keys, ", ")}`;
|
|
10438
10728
|
}
|
|
10439
10729
|
case "invalid_key":
|
|
10440
10730
|
return `Entrada inv\xE1lida n${translateOriginWithArticle(issue2.origin, "definite")}`;
|
|
@@ -10498,6 +10788,8 @@ var error44 = () => {
|
|
|
10498
10788
|
json_string: "o texto JSON",
|
|
10499
10789
|
e164: "o n\xFAmero E.164",
|
|
10500
10790
|
credit_card: "o n\xFAmero de cart\xE3o de cr\xE9dito",
|
|
10791
|
+
currency_code: "o c\xF3digo de moeda",
|
|
10792
|
+
iban: "o IBAN",
|
|
10501
10793
|
jwt: "o JWT",
|
|
10502
10794
|
template_literal: "a entrada"
|
|
10503
10795
|
};
|
|
@@ -10576,8 +10868,8 @@ var error44 = () => {
|
|
|
10576
10868
|
case "not_multiple_of":
|
|
10577
10869
|
return `N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${issue2.divisor}`;
|
|
10578
10870
|
case "unrecognized_keys": {
|
|
10579
|
-
const
|
|
10580
|
-
return `Chave${
|
|
10871
|
+
const plural2 = issue2.keys.length > 1 ? "s" : "";
|
|
10872
|
+
return `Chave${plural2} inv\xE1lida${plural2}: ${joinValues(issue2.keys, ", ")}`;
|
|
10581
10873
|
}
|
|
10582
10874
|
case "invalid_key":
|
|
10583
10875
|
return `Entrada inv\xE1lida n${translateOriginWithArticle(issue2.origin, "definite")}`;
|
|
@@ -10641,6 +10933,8 @@ var error45 = () => {
|
|
|
10641
10933
|
json_string: "\u0219ir JSON",
|
|
10642
10934
|
e164: "num\u0103r E.164",
|
|
10643
10935
|
credit_card: "num\u0103r de card de credit",
|
|
10936
|
+
currency_code: "cod valutar",
|
|
10937
|
+
iban: "IBAN",
|
|
10644
10938
|
jwt: "JWT",
|
|
10645
10939
|
template_literal: "intrare"
|
|
10646
10940
|
};
|
|
@@ -10812,6 +11106,8 @@ var error46 = () => {
|
|
|
10812
11106
|
json_string: "JSON \u0441\u0442\u0440\u043E\u043A\u0430",
|
|
10813
11107
|
e164: "\u043D\u043E\u043C\u0435\u0440 E.164",
|
|
10814
11108
|
credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0439 \u043A\u0430\u0440\u0442\u044B",
|
|
11109
|
+
currency_code: "\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u044B",
|
|
11110
|
+
iban: "IBAN",
|
|
10815
11111
|
jwt: "JWT",
|
|
10816
11112
|
template_literal: "\u0432\u0432\u043E\u0434"
|
|
10817
11113
|
};
|
|
@@ -10929,6 +11225,8 @@ var error47 = () => {
|
|
|
10929
11225
|
json_string: "re\u0165azec vo form\xE1te JSON",
|
|
10930
11226
|
e164: "\u010D\xEDslo E.164",
|
|
10931
11227
|
credit_card: "\u010D\xEDslo kreditnej karty",
|
|
11228
|
+
currency_code: "k\xF3d meny",
|
|
11229
|
+
iban: "IBAN",
|
|
10932
11230
|
jwt: "JWT",
|
|
10933
11231
|
template_literal: "vstup"
|
|
10934
11232
|
};
|
|
@@ -11044,6 +11342,8 @@ var error48 = () => {
|
|
|
11044
11342
|
json_string: "JSON niz",
|
|
11045
11343
|
e164: "E.164 \u0161tevilka",
|
|
11046
11344
|
credit_card: "\u0161tevilka kreditne kartice",
|
|
11345
|
+
currency_code: "koda valute",
|
|
11346
|
+
iban: "IBAN",
|
|
11047
11347
|
jwt: "JWT",
|
|
11048
11348
|
template_literal: "vnos"
|
|
11049
11349
|
};
|
|
@@ -11157,6 +11457,8 @@ var error49 = () => {
|
|
|
11157
11457
|
json_string: "JSON-str\xE4ng",
|
|
11158
11458
|
e164: "E.164-nummer",
|
|
11159
11459
|
credit_card: "kreditkortsnummer",
|
|
11460
|
+
currency_code: "valutakod",
|
|
11461
|
+
iban: "IBAN",
|
|
11160
11462
|
jwt: "JWT",
|
|
11161
11463
|
template_literal: "mall-literal"
|
|
11162
11464
|
};
|
|
@@ -11271,6 +11573,8 @@ var error50 = () => {
|
|
|
11271
11573
|
json_string: "JSON \u0B9A\u0BB0\u0BAE\u0BCD",
|
|
11272
11574
|
e164: "E.164 \u0B8E\u0BA3\u0BCD",
|
|
11273
11575
|
credit_card: "\u0B95\u0B9F\u0BA9\u0BCD \u0B85\u0B9F\u0BCD\u0B9F\u0BC8 \u0B8E\u0BA3\u0BCD",
|
|
11576
|
+
currency_code: "\u0BA8\u0BBE\u0BA3\u0BAF\u0B95\u0BCD \u0B95\u0BC1\u0BB1\u0BBF\u0BAF\u0BC0\u0B9F\u0BC1",
|
|
11577
|
+
iban: "IBAN",
|
|
11274
11578
|
jwt: "JWT",
|
|
11275
11579
|
template_literal: "input"
|
|
11276
11580
|
};
|
|
@@ -11344,23 +11648,23 @@ function ta_default() {
|
|
|
11344
11648
|
};
|
|
11345
11649
|
}
|
|
11346
11650
|
|
|
11347
|
-
// node_modules/zod/v4/locales/
|
|
11651
|
+
// node_modules/zod/v4/locales/tg.js
|
|
11348
11652
|
var error51 = () => {
|
|
11349
11653
|
const Sizable = {
|
|
11350
|
-
string: { unit: "\
|
|
11351
|
-
file: { unit: "\
|
|
11352
|
-
array: { unit: "\
|
|
11353
|
-
set: { unit: "\
|
|
11354
|
-
map: { unit: "\
|
|
11654
|
+
string: { unit: "\u0430\u043B\u043E\u043C\u0430\u0442", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
|
|
11655
|
+
file: { unit: "\u0431\u0430\u0439\u0442", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
|
|
11656
|
+
array: { unit: "\u0443\u043D\u0441\u0443\u0440", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
|
|
11657
|
+
set: { unit: "\u0443\u043D\u0441\u0443\u0440", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" },
|
|
11658
|
+
map: { unit: "\u0441\u0430\u0431\u0442", verb: "\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434" }
|
|
11355
11659
|
};
|
|
11356
11660
|
function getSizing(origin) {
|
|
11357
11661
|
return Sizable[origin] ?? null;
|
|
11358
11662
|
}
|
|
11359
11663
|
const FormatDictionary = {
|
|
11360
|
-
regex: "\
|
|
11361
|
-
email: "\
|
|
11664
|
+
regex: "\u0432\u0443\u0440\u0443\u0434",
|
|
11665
|
+
email: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 email",
|
|
11362
11666
|
url: "URL",
|
|
11363
|
-
emoji: "\
|
|
11667
|
+
emoji: "\u044D\u043C\u043E\u04B7\u0438",
|
|
11364
11668
|
uuid: "UUID",
|
|
11365
11669
|
uuidv4: "UUIDv4",
|
|
11366
11670
|
uuidv6: "UUIDv6",
|
|
@@ -11371,20 +11675,139 @@ var error51 = () => {
|
|
|
11371
11675
|
ulid: "ULID",
|
|
11372
11676
|
xid: "XID",
|
|
11373
11677
|
ksuid: "KSUID",
|
|
11374
|
-
datetime: "\
|
|
11375
|
-
date: "\
|
|
11376
|
-
time: "\
|
|
11377
|
-
duration: "\
|
|
11378
|
-
ipv4: "\
|
|
11379
|
-
ipv6: "\
|
|
11380
|
-
mac: "\
|
|
11381
|
-
cidrv4: "\
|
|
11382
|
-
cidrv6: "\
|
|
11383
|
-
base64: "\
|
|
11384
|
-
base64url: "\
|
|
11385
|
-
json_string: "\
|
|
11386
|
-
e164: "\
|
|
11678
|
+
datetime: "\u0441\u0430\u043D\u0430\u0432\u0443 \u0432\u0430\u049B\u0442\u0438 ISO",
|
|
11679
|
+
date: "\u0441\u0430\u043D\u0430\u0438 ISO",
|
|
11680
|
+
time: "\u0432\u0430\u049B\u0442\u0438 ISO",
|
|
11681
|
+
duration: "\u0434\u0430\u0432\u043E\u043C\u043D\u043E\u043A\u0438\u0438 ISO",
|
|
11682
|
+
ipv4: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv4",
|
|
11683
|
+
ipv6: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv6",
|
|
11684
|
+
mac: "\u0441\u0443\u0440\u043E\u0493\u0430\u0438 MAC",
|
|
11685
|
+
cidrv4: "\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv4",
|
|
11686
|
+
cidrv6: "\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv6",
|
|
11687
|
+
base64: "\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64",
|
|
11688
|
+
base64url: "\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64url",
|
|
11689
|
+
json_string: "\u0441\u0430\u0442\u0440\u0438 JSON",
|
|
11690
|
+
e164: "\u0440\u0430\u049B\u0430\u043C\u0438 E.164",
|
|
11691
|
+
credit_card: "\u0440\u0430\u049B\u0430\u043C\u0438 \u043A\u043E\u0440\u0442\u0438 \u043A\u0440\u0435\u0434\u0438\u0442\u04E3",
|
|
11692
|
+
currency_code: "\u0440\u0430\u043C\u0437\u0438 \u0430\u0441\u044A\u043E\u0440",
|
|
11693
|
+
iban: "IBAN",
|
|
11694
|
+
jwt: "JWT",
|
|
11695
|
+
template_literal: "\u0432\u0443\u0440\u0443\u0434"
|
|
11696
|
+
};
|
|
11697
|
+
const TypeDictionary = {
|
|
11698
|
+
nan: "NaN",
|
|
11699
|
+
number: "\u0440\u0430\u049B\u0430\u043C",
|
|
11700
|
+
string: "\u0441\u0430\u0442\u0440",
|
|
11701
|
+
array: "\u043C\u0430\u0441\u0441\u0438\u0432",
|
|
11702
|
+
object: "\u043E\u0431\u044A\u0435\u043A\u0442",
|
|
11703
|
+
date: "\u0441\u0430\u043D\u0430"
|
|
11704
|
+
};
|
|
11705
|
+
return (issue2) => {
|
|
11706
|
+
switch (issue2.code) {
|
|
11707
|
+
case "invalid_type": {
|
|
11708
|
+
const expected = TypeDictionary[issue2.expected] ?? issue2.expected;
|
|
11709
|
+
const receivedType = parsedType(issue2.input);
|
|
11710
|
+
const received = TypeDictionary[receivedType] ?? receivedType;
|
|
11711
|
+
return `\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${expected} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442, ${received} \u0433\u0438\u0440\u0438\u0444\u0442\u0430 \u0448\u0443\u0434`;
|
|
11712
|
+
}
|
|
11713
|
+
case "invalid_value":
|
|
11714
|
+
if (issue2.values.length === 1)
|
|
11715
|
+
return `\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${stringifyPrimitive(issue2.values[0])} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`;
|
|
11716
|
+
return `\u0418\u043D\u0442\u0438\u0445\u043E\u0431\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u044F\u043A\u0435 \u0430\u0437 ${joinValues(issue2.values, "|")} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`;
|
|
11717
|
+
case "too_big": {
|
|
11718
|
+
const adj = issue2.inclusive ? "<=" : "<";
|
|
11719
|
+
const sizing = getSizing(issue2.origin);
|
|
11720
|
+
if (sizing)
|
|
11721
|
+
return `\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${issue2.origin ?? "\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${adj}${issue2.maximum.toString()} ${sizing.unit} ${sizing.verb}`;
|
|
11722
|
+
return `\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${issue2.origin ?? "\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${adj}${issue2.maximum.toString()} \u0431\u043E\u0448\u0430\u0434`;
|
|
11723
|
+
}
|
|
11724
|
+
case "too_small": {
|
|
11725
|
+
const adj = issue2.inclusive ? ">=" : ">";
|
|
11726
|
+
const sizing = getSizing(issue2.origin);
|
|
11727
|
+
if (sizing)
|
|
11728
|
+
return `\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${issue2.origin} \u0431\u043E\u044F\u0434 ${adj}${issue2.minimum.toString()} ${sizing.unit} ${sizing.verb}`;
|
|
11729
|
+
return `\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${issue2.origin} \u0431\u043E\u044F\u0434 ${adj}${issue2.minimum.toString()} \u0431\u043E\u0448\u0430\u0434`;
|
|
11730
|
+
}
|
|
11731
|
+
case "invalid_format": {
|
|
11732
|
+
const _issue = issue2;
|
|
11733
|
+
if (_issue.format === "starts_with")
|
|
11734
|
+
return `\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${_issue.prefix}" \u043E\u0493\u043E\u0437 \u0448\u0430\u0432\u0430\u0434`;
|
|
11735
|
+
if (_issue.format === "ends_with")
|
|
11736
|
+
return `\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${_issue.suffix}" \u0430\u043D\u04B7\u043E\u043C \u0451\u0431\u0430\u0434`;
|
|
11737
|
+
if (_issue.format === "includes")
|
|
11738
|
+
return `\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 "${_issue.includes}"-\u0440\u043E \u0434\u0430\u0440 \u0431\u0430\u0440 \u0433\u0438\u0440\u0430\u0434`;
|
|
11739
|
+
if (_issue.format === "regex")
|
|
11740
|
+
return `\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 \u043D\u0430\u043C\u0443\u043D\u0430\u0438 ${_issue.pattern} \u043C\u0443\u0432\u043E\u0444\u0438\u049B\u0430\u0442 \u043A\u0443\u043D\u0430\u0434`;
|
|
11741
|
+
return `${FormatDictionary[_issue.format] ?? issue2.format}-\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442`;
|
|
11742
|
+
}
|
|
11743
|
+
case "not_multiple_of":
|
|
11744
|
+
return `\u0420\u0430\u049B\u0430\u043C\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 ${issue2.divisor} \u0431\u0435 \u0431\u0430\u049B\u0438\u044F \u0442\u0430\u049B\u0441\u0438\u043C \u0448\u0430\u0432\u0430\u0434`;
|
|
11745
|
+
case "unrecognized_keys":
|
|
11746
|
+
return `\u041A\u0430\u043B\u0438\u0434${issue2.keys.length > 1 ? "\u04B3\u043E\u0438" : "\u0438"} \u043D\u043E\u043C\u0430\u044A\u043B\u0443\u043C: ${joinValues(issue2.keys, ", ")}`;
|
|
11747
|
+
case "invalid_key":
|
|
11748
|
+
return `\u041A\u0430\u043B\u0438\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${issue2.origin}`;
|
|
11749
|
+
case "invalid_union":
|
|
11750
|
+
if (issue2.options && Array.isArray(issue2.options) && issue2.options.length > 0) {
|
|
11751
|
+
const opts = issue2.options.map((o) => `'${o}'`).join(" | ");
|
|
11752
|
+
return `\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442\u0438 \u0434\u0438\u0441\u043A\u0440\u0438\u043C\u0438\u043D\u0430\u0442\u043E\u0440: ${opts} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`;
|
|
11753
|
+
}
|
|
11754
|
+
return "\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442";
|
|
11755
|
+
case "invalid_element":
|
|
11756
|
+
return `\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${issue2.origin}`;
|
|
11757
|
+
default:
|
|
11758
|
+
return `\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442`;
|
|
11759
|
+
}
|
|
11760
|
+
};
|
|
11761
|
+
};
|
|
11762
|
+
function tg_default() {
|
|
11763
|
+
return {
|
|
11764
|
+
localeError: error51()
|
|
11765
|
+
};
|
|
11766
|
+
}
|
|
11767
|
+
|
|
11768
|
+
// node_modules/zod/v4/locales/th.js
|
|
11769
|
+
var error52 = () => {
|
|
11770
|
+
const Sizable = {
|
|
11771
|
+
string: { unit: "\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
11772
|
+
file: { unit: "\u0E44\u0E1A\u0E15\u0E4C", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
11773
|
+
array: { unit: "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
11774
|
+
set: { unit: "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
|
|
11775
|
+
map: { unit: "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" }
|
|
11776
|
+
};
|
|
11777
|
+
function getSizing(origin) {
|
|
11778
|
+
return Sizable[origin] ?? null;
|
|
11779
|
+
}
|
|
11780
|
+
const FormatDictionary = {
|
|
11781
|
+
regex: "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",
|
|
11782
|
+
email: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",
|
|
11783
|
+
url: "URL",
|
|
11784
|
+
emoji: "\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",
|
|
11785
|
+
uuid: "UUID",
|
|
11786
|
+
uuidv4: "UUIDv4",
|
|
11787
|
+
uuidv6: "UUIDv6",
|
|
11788
|
+
nanoid: "nanoid",
|
|
11789
|
+
guid: "GUID",
|
|
11790
|
+
cuid: "cuid",
|
|
11791
|
+
cuid2: "cuid2",
|
|
11792
|
+
ulid: "ULID",
|
|
11793
|
+
xid: "XID",
|
|
11794
|
+
ksuid: "KSUID",
|
|
11795
|
+
datetime: "\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",
|
|
11796
|
+
date: "\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",
|
|
11797
|
+
time: "\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",
|
|
11798
|
+
duration: "\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",
|
|
11799
|
+
ipv4: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",
|
|
11800
|
+
ipv6: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",
|
|
11801
|
+
mac: "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 MAC",
|
|
11802
|
+
cidrv4: "\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",
|
|
11803
|
+
cidrv6: "\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",
|
|
11804
|
+
base64: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",
|
|
11805
|
+
base64url: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",
|
|
11806
|
+
json_string: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",
|
|
11807
|
+
e164: "\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",
|
|
11387
11808
|
credit_card: "\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E1A\u0E31\u0E15\u0E23\u0E40\u0E04\u0E23\u0E14\u0E34\u0E15",
|
|
11809
|
+
currency_code: "\u0E23\u0E2B\u0E31\u0E2A\u0E2A\u0E01\u0E38\u0E25\u0E40\u0E07\u0E34\u0E19",
|
|
11810
|
+
iban: "IBAN",
|
|
11388
11811
|
jwt: "\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",
|
|
11389
11812
|
template_literal: "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"
|
|
11390
11813
|
};
|
|
@@ -11454,12 +11877,12 @@ var error51 = () => {
|
|
|
11454
11877
|
};
|
|
11455
11878
|
function th_default() {
|
|
11456
11879
|
return {
|
|
11457
|
-
localeError:
|
|
11880
|
+
localeError: error52()
|
|
11458
11881
|
};
|
|
11459
11882
|
}
|
|
11460
11883
|
|
|
11461
11884
|
// node_modules/zod/v4/locales/tk.js
|
|
11462
|
-
var
|
|
11885
|
+
var error53 = () => {
|
|
11463
11886
|
const Sizable = {
|
|
11464
11887
|
string: { unit: "simwol", verb: "bolmaly" },
|
|
11465
11888
|
file: { unit: "ba\xFDt", verb: "bolmaly" },
|
|
@@ -11499,6 +11922,8 @@ var error52 = () => {
|
|
|
11499
11922
|
json_string: "JSON setiri",
|
|
11500
11923
|
e164: "E.164 nomeri",
|
|
11501
11924
|
credit_card: "kredit kartyny\u0148 nomeri",
|
|
11925
|
+
currency_code: "wal\xFDuta kody",
|
|
11926
|
+
iban: "IBAN",
|
|
11502
11927
|
jwt: "JWT",
|
|
11503
11928
|
template_literal: "\u015Fablon"
|
|
11504
11929
|
};
|
|
@@ -11560,12 +11985,12 @@ var error52 = () => {
|
|
|
11560
11985
|
};
|
|
11561
11986
|
function tk_default() {
|
|
11562
11987
|
return {
|
|
11563
|
-
localeError:
|
|
11988
|
+
localeError: error53()
|
|
11564
11989
|
};
|
|
11565
11990
|
}
|
|
11566
11991
|
|
|
11567
11992
|
// node_modules/zod/v4/locales/tr.js
|
|
11568
|
-
var
|
|
11993
|
+
var error54 = () => {
|
|
11569
11994
|
const Sizable = {
|
|
11570
11995
|
string: { unit: "karakter", verb: "olmal\u0131" },
|
|
11571
11996
|
file: { unit: "bayt", verb: "olmal\u0131" },
|
|
@@ -11605,6 +12030,8 @@ var error53 = () => {
|
|
|
11605
12030
|
json_string: "JSON dizesi",
|
|
11606
12031
|
e164: "E.164 say\u0131s\u0131",
|
|
11607
12032
|
credit_card: "kredi kart\u0131 numaras\u0131",
|
|
12033
|
+
currency_code: "para birimi kodu",
|
|
12034
|
+
iban: "IBAN",
|
|
11608
12035
|
jwt: "JWT",
|
|
11609
12036
|
template_literal: "\u015Eablon dizesi"
|
|
11610
12037
|
};
|
|
@@ -11669,12 +12096,12 @@ var error53 = () => {
|
|
|
11669
12096
|
};
|
|
11670
12097
|
function tr_default() {
|
|
11671
12098
|
return {
|
|
11672
|
-
localeError:
|
|
12099
|
+
localeError: error54()
|
|
11673
12100
|
};
|
|
11674
12101
|
}
|
|
11675
12102
|
|
|
11676
12103
|
// node_modules/zod/v4/locales/uk.js
|
|
11677
|
-
var
|
|
12104
|
+
var error55 = () => {
|
|
11678
12105
|
const Sizable = {
|
|
11679
12106
|
string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
|
|
11680
12107
|
file: { unit: "\u0431\u0430\u0439\u0442\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
|
|
@@ -11714,6 +12141,8 @@ var error54 = () => {
|
|
|
11714
12141
|
json_string: "\u0440\u044F\u0434\u043E\u043A JSON",
|
|
11715
12142
|
e164: "\u043D\u043E\u043C\u0435\u0440 E.164",
|
|
11716
12143
|
credit_card: "\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0457 \u043A\u0430\u0440\u0442\u043A\u0438",
|
|
12144
|
+
currency_code: "\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u0438",
|
|
12145
|
+
iban: "IBAN",
|
|
11717
12146
|
jwt: "JWT",
|
|
11718
12147
|
template_literal: "\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"
|
|
11719
12148
|
};
|
|
@@ -11781,7 +12210,7 @@ var error54 = () => {
|
|
|
11781
12210
|
};
|
|
11782
12211
|
function uk_default() {
|
|
11783
12212
|
return {
|
|
11784
|
-
localeError:
|
|
12213
|
+
localeError: error55()
|
|
11785
12214
|
};
|
|
11786
12215
|
}
|
|
11787
12216
|
|
|
@@ -11791,7 +12220,7 @@ function ua_default() {
|
|
|
11791
12220
|
}
|
|
11792
12221
|
|
|
11793
12222
|
// node_modules/zod/v4/locales/ur.js
|
|
11794
|
-
var
|
|
12223
|
+
var error56 = () => {
|
|
11795
12224
|
const Sizable = {
|
|
11796
12225
|
string: { unit: "\u062D\u0631\u0648\u0641", verb: "\u06C1\u0648\u0646\u0627" },
|
|
11797
12226
|
file: { unit: "\u0628\u0627\u0626\u0679\u0633", verb: "\u06C1\u0648\u0646\u0627" },
|
|
@@ -11831,6 +12260,8 @@ var error55 = () => {
|
|
|
11831
12260
|
json_string: "\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",
|
|
11832
12261
|
e164: "\u0627\u06CC 164 \u0646\u0645\u0628\u0631",
|
|
11833
12262
|
credit_card: "\u06A9\u0631\u06CC\u0688\u0679 \u06A9\u0627\u0631\u0688 \u0646\u0645\u0628\u0631",
|
|
12263
|
+
currency_code: "\u06A9\u0631\u0646\u0633\u06CC \u06A9\u0648\u0688",
|
|
12264
|
+
iban: "IBAN",
|
|
11834
12265
|
jwt: "\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",
|
|
11835
12266
|
template_literal: "\u0627\u0646 \u067E\u0679"
|
|
11836
12267
|
};
|
|
@@ -11900,12 +12331,12 @@ var error55 = () => {
|
|
|
11900
12331
|
};
|
|
11901
12332
|
function ur_default() {
|
|
11902
12333
|
return {
|
|
11903
|
-
localeError:
|
|
12334
|
+
localeError: error56()
|
|
11904
12335
|
};
|
|
11905
12336
|
}
|
|
11906
12337
|
|
|
11907
12338
|
// node_modules/zod/v4/locales/uz.js
|
|
11908
|
-
var
|
|
12339
|
+
var error57 = () => {
|
|
11909
12340
|
const Sizable = {
|
|
11910
12341
|
string: { unit: "belgi", verb: "bo\u2018lishi kerak" },
|
|
11911
12342
|
file: { unit: "bayt", verb: "bo\u2018lishi kerak" },
|
|
@@ -11945,6 +12376,8 @@ var error56 = () => {
|
|
|
11945
12376
|
json_string: "JSON satr",
|
|
11946
12377
|
e164: "E.164 raqam",
|
|
11947
12378
|
credit_card: "kredit karta raqami",
|
|
12379
|
+
currency_code: "valyuta kodi",
|
|
12380
|
+
iban: "IBAN",
|
|
11948
12381
|
jwt: "JWT",
|
|
11949
12382
|
template_literal: "kirish"
|
|
11950
12383
|
};
|
|
@@ -12012,12 +12445,12 @@ var error56 = () => {
|
|
|
12012
12445
|
};
|
|
12013
12446
|
function uz_default() {
|
|
12014
12447
|
return {
|
|
12015
|
-
localeError:
|
|
12448
|
+
localeError: error57()
|
|
12016
12449
|
};
|
|
12017
12450
|
}
|
|
12018
12451
|
|
|
12019
12452
|
// node_modules/zod/v4/locales/vi.js
|
|
12020
|
-
var
|
|
12453
|
+
var error58 = () => {
|
|
12021
12454
|
const Sizable = {
|
|
12022
12455
|
string: { unit: "k\xFD t\u1EF1", verb: "c\xF3" },
|
|
12023
12456
|
file: { unit: "byte", verb: "c\xF3" },
|
|
@@ -12057,6 +12490,8 @@ var error57 = () => {
|
|
|
12057
12490
|
json_string: "chu\u1ED7i JSON",
|
|
12058
12491
|
e164: "s\u1ED1 E.164",
|
|
12059
12492
|
credit_card: "s\u1ED1 th\u1EBB t\xEDn d\u1EE5ng",
|
|
12493
|
+
currency_code: "m\xE3 ti\u1EC1n t\u1EC7",
|
|
12494
|
+
iban: "IBAN",
|
|
12060
12495
|
jwt: "JWT",
|
|
12061
12496
|
template_literal: "\u0111\u1EA7u v\xE0o"
|
|
12062
12497
|
};
|
|
@@ -12124,12 +12559,12 @@ var error57 = () => {
|
|
|
12124
12559
|
};
|
|
12125
12560
|
function vi_default() {
|
|
12126
12561
|
return {
|
|
12127
|
-
localeError:
|
|
12562
|
+
localeError: error58()
|
|
12128
12563
|
};
|
|
12129
12564
|
}
|
|
12130
12565
|
|
|
12131
12566
|
// node_modules/zod/v4/locales/zh-CN.js
|
|
12132
|
-
var
|
|
12567
|
+
var error59 = () => {
|
|
12133
12568
|
const Sizable = {
|
|
12134
12569
|
string: { unit: "\u5B57\u7B26", verb: "\u5305\u542B" },
|
|
12135
12570
|
file: { unit: "\u5B57\u8282", verb: "\u5305\u542B" },
|
|
@@ -12169,6 +12604,8 @@ var error58 = () => {
|
|
|
12169
12604
|
json_string: "JSON\u5B57\u7B26\u4E32",
|
|
12170
12605
|
e164: "E.164\u53F7\u7801",
|
|
12171
12606
|
credit_card: "\u4FE1\u7528\u5361\u53F7",
|
|
12607
|
+
currency_code: "\u8D27\u5E01\u4EE3\u7801",
|
|
12608
|
+
iban: "IBAN",
|
|
12172
12609
|
jwt: "JWT",
|
|
12173
12610
|
template_literal: "\u8F93\u5165"
|
|
12174
12611
|
};
|
|
@@ -12237,12 +12674,12 @@ var error58 = () => {
|
|
|
12237
12674
|
};
|
|
12238
12675
|
function zh_CN_default() {
|
|
12239
12676
|
return {
|
|
12240
|
-
localeError:
|
|
12677
|
+
localeError: error59()
|
|
12241
12678
|
};
|
|
12242
12679
|
}
|
|
12243
12680
|
|
|
12244
12681
|
// node_modules/zod/v4/locales/zh-TW.js
|
|
12245
|
-
var
|
|
12682
|
+
var error60 = () => {
|
|
12246
12683
|
const Sizable = {
|
|
12247
12684
|
string: { unit: "\u5B57\u5143", verb: "\u64C1\u6709" },
|
|
12248
12685
|
file: { unit: "\u4F4D\u5143\u7D44", verb: "\u64C1\u6709" },
|
|
@@ -12282,6 +12719,8 @@ var error59 = () => {
|
|
|
12282
12719
|
json_string: "JSON \u5B57\u4E32",
|
|
12283
12720
|
e164: "E.164 \u6578\u503C",
|
|
12284
12721
|
credit_card: "\u4FE1\u7528\u5361\u865F",
|
|
12722
|
+
currency_code: "\u8CA8\u5E63\u4EE3\u78BC",
|
|
12723
|
+
iban: "IBAN",
|
|
12285
12724
|
jwt: "JWT",
|
|
12286
12725
|
template_literal: "\u8F38\u5165"
|
|
12287
12726
|
};
|
|
@@ -12348,12 +12787,12 @@ var error59 = () => {
|
|
|
12348
12787
|
};
|
|
12349
12788
|
function zh_TW_default() {
|
|
12350
12789
|
return {
|
|
12351
|
-
localeError:
|
|
12790
|
+
localeError: error60()
|
|
12352
12791
|
};
|
|
12353
12792
|
}
|
|
12354
12793
|
|
|
12355
12794
|
// node_modules/zod/v4/locales/yo.js
|
|
12356
|
-
var
|
|
12795
|
+
var error61 = () => {
|
|
12357
12796
|
const Sizable = {
|
|
12358
12797
|
string: { unit: "\xE0mi", verb: "n\xED" },
|
|
12359
12798
|
file: { unit: "bytes", verb: "n\xED" },
|
|
@@ -12393,6 +12832,8 @@ var error60 = () => {
|
|
|
12393
12832
|
json_string: "\u1ECD\u0300r\u1ECD\u0300 JSON",
|
|
12394
12833
|
e164: "n\u1ECD\u0301mb\xE0 E.164",
|
|
12395
12834
|
credit_card: "n\u1ECDmba kaadi gbese",
|
|
12835
|
+
currency_code: "koodu ow\xF3",
|
|
12836
|
+
iban: "IBAN",
|
|
12396
12837
|
jwt: "JWT",
|
|
12397
12838
|
template_literal: "\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"
|
|
12398
12839
|
};
|
|
@@ -12459,7 +12900,7 @@ var error60 = () => {
|
|
|
12459
12900
|
};
|
|
12460
12901
|
function yo_default() {
|
|
12461
12902
|
return {
|
|
12462
|
-
localeError:
|
|
12903
|
+
localeError: error61()
|
|
12463
12904
|
};
|
|
12464
12905
|
}
|
|
12465
12906
|
|
|
@@ -12539,31 +12980,8 @@ function compileValidator(schema, parser) {
|
|
|
12539
12980
|
function compile(schema, options) {
|
|
12540
12981
|
try {
|
|
12541
12982
|
const parser = compileFn(schema);
|
|
12542
|
-
const clone2 =
|
|
12543
|
-
const liveRun = schema._zod.run;
|
|
12544
|
-
const originalRun = liveRun.__originalRun ?? liveRun;
|
|
12545
|
-
const wrapped = (payload, ctx) => {
|
|
12546
|
-
if (ctx?.async || ctx?.direction === "backward" || ctx?.skipChecks || ctx?.[FALLBACK_FLAG]) {
|
|
12547
|
-
return originalRun(payload, ctx);
|
|
12548
|
-
}
|
|
12549
|
-
if (ctx && isBackEdge(ctx, payload.value)) {
|
|
12550
|
-
return originalRun(payload, ctx);
|
|
12551
|
-
}
|
|
12552
|
-
const out = parser(payload.value);
|
|
12553
|
-
if (out !== INVALID) {
|
|
12554
|
-
payload.value = out;
|
|
12555
|
-
return payload;
|
|
12556
|
-
}
|
|
12557
|
-
if (ctx)
|
|
12558
|
-
ctx[FALLBACK_FLAG] = true;
|
|
12559
|
-
return originalRun(payload, ctx);
|
|
12560
|
-
};
|
|
12561
|
-
wrapped.__originalRun = originalRun;
|
|
12562
|
-
clone2._zod.bag.fallbackRun = originalRun;
|
|
12983
|
+
const clone2 = withParser(schema, parser);
|
|
12563
12984
|
clone2._zod.bag.validator = compileValidator(schema, parser);
|
|
12564
|
-
clone2._zod.run = wrapped;
|
|
12565
|
-
if (!liveRun.__originalRun)
|
|
12566
|
-
installCompiledUserMethods(clone2, schema, parser);
|
|
12567
12985
|
return clone2;
|
|
12568
12986
|
} catch (err) {
|
|
12569
12987
|
if (options?.strict)
|
|
@@ -12571,6 +12989,37 @@ function compile(schema, options) {
|
|
|
12571
12989
|
return schema;
|
|
12572
12990
|
}
|
|
12573
12991
|
}
|
|
12992
|
+
function withParser(schema, parser) {
|
|
12993
|
+
if (isRecursiveSchema(schema)) {
|
|
12994
|
+
throw new ZodCompileUnsupportedError("a schema whose subtree contains a reference cycle");
|
|
12995
|
+
}
|
|
12996
|
+
const clone2 = clone(schema);
|
|
12997
|
+
const liveRun = schema._zod.run;
|
|
12998
|
+
const originalRun = liveRun.__originalRun ?? liveRun;
|
|
12999
|
+
const wrapped = (payload, ctx) => {
|
|
13000
|
+
if (ctx?.async || ctx?.direction === "backward" || ctx?.skipChecks || ctx?.[FALLBACK_FLAG]) {
|
|
13001
|
+
return originalRun(payload, ctx);
|
|
13002
|
+
}
|
|
13003
|
+
if (ctx && isBackEdge(ctx, payload.value)) {
|
|
13004
|
+
return originalRun(payload, ctx);
|
|
13005
|
+
}
|
|
13006
|
+
const out = parser(payload.value);
|
|
13007
|
+
if (out !== INVALID) {
|
|
13008
|
+
payload.value = out;
|
|
13009
|
+
return payload;
|
|
13010
|
+
}
|
|
13011
|
+
if (ctx)
|
|
13012
|
+
ctx[FALLBACK_FLAG] = true;
|
|
13013
|
+
return originalRun(payload, ctx);
|
|
13014
|
+
};
|
|
13015
|
+
wrapped.__originalRun = originalRun;
|
|
13016
|
+
clone2._zod.bag.fallbackRun = originalRun;
|
|
13017
|
+
clone2._zod.bag.validator = parser;
|
|
13018
|
+
clone2._zod.run = wrapped;
|
|
13019
|
+
if (!liveRun.__originalRun)
|
|
13020
|
+
installCompiledUserMethods(clone2, schema, parser);
|
|
13021
|
+
return clone2;
|
|
13022
|
+
}
|
|
12574
13023
|
function installCompiledUserMethods(target, source, parser) {
|
|
12575
13024
|
const targetAny = target;
|
|
12576
13025
|
const sourceAny = source;
|
|
@@ -12607,7 +13056,8 @@ function compileFn(schema, options) {
|
|
|
12607
13056
|
const ctx = {
|
|
12608
13057
|
constants: /* @__PURE__ */ new Map(),
|
|
12609
13058
|
constantCounter: 0,
|
|
12610
|
-
varCounter: 0
|
|
13059
|
+
varCounter: 0,
|
|
13060
|
+
definite: true
|
|
12611
13061
|
};
|
|
12612
13062
|
const doc = new Doc(["input"]);
|
|
12613
13063
|
const outputAccessor = generateCheck(doc, ctx, schema, "input", !options?.assertOnly);
|
|
@@ -12631,6 +13081,7 @@ ${code}
|
|
|
12631
13081
|
if (options?.debug) {
|
|
12632
13082
|
fn.code = fullCode;
|
|
12633
13083
|
}
|
|
13084
|
+
fn.definite = ctx.definite;
|
|
12634
13085
|
return fn;
|
|
12635
13086
|
}
|
|
12636
13087
|
function addConstant(ctx, value) {
|
|
@@ -12642,6 +13093,10 @@ function addConstant(ctx, value) {
|
|
|
12642
13093
|
ctx.constants.set(name, value);
|
|
12643
13094
|
return name;
|
|
12644
13095
|
}
|
|
13096
|
+
function addUserConstant(ctx, fn) {
|
|
13097
|
+
ctx.definite = false;
|
|
13098
|
+
return addConstant(ctx, fn);
|
|
13099
|
+
}
|
|
12645
13100
|
function newVar(ctx) {
|
|
12646
13101
|
return `v${ctx.varCounter++}`;
|
|
12647
13102
|
}
|
|
@@ -12674,6 +13129,7 @@ function compileChild(doc, ctx, schema, accessor, needsValue = true) {
|
|
|
12674
13129
|
}
|
|
12675
13130
|
}
|
|
12676
13131
|
function emitRuntimeIsland(doc, ctx, schema, accessor) {
|
|
13132
|
+
ctx.definite = false;
|
|
12677
13133
|
const schemaConst = addConstant(ctx, schema);
|
|
12678
13134
|
const runConst = addConstant(ctx, runtimeRun);
|
|
12679
13135
|
const outVar = newVar(ctx);
|
|
@@ -12754,6 +13210,9 @@ function generateChecks(doc, ctx, schema, accessor) {
|
|
|
12754
13210
|
case "property":
|
|
12755
13211
|
generatePropertyCheck(doc, ctx, def, currentAccessor);
|
|
12756
13212
|
break;
|
|
13213
|
+
case "properties":
|
|
13214
|
+
generatePropertiesChecks(doc, ctx, def, currentAccessor);
|
|
13215
|
+
break;
|
|
12757
13216
|
case "overwrite": {
|
|
12758
13217
|
const newAccessor = newVar(ctx);
|
|
12759
13218
|
generateOverwriteCheck(doc, ctx, check2, currentAccessor, newAccessor);
|
|
@@ -12862,6 +13321,19 @@ function generateMimeTypeCheck(doc, ctx, def, accessor) {
|
|
|
12862
13321
|
doc.write(`if (!${mimeSet}.has(${accessor}.type)) return INVALID;`);
|
|
12863
13322
|
}
|
|
12864
13323
|
}
|
|
13324
|
+
function generatePropertiesChecks(doc, ctx, def, accessor) {
|
|
13325
|
+
if (def.when) {
|
|
13326
|
+
throw new ZodCompileUnsupportedError(`check with a custom "when" condition`);
|
|
13327
|
+
}
|
|
13328
|
+
doc.write(`if (${accessor} == null) return INVALID;`);
|
|
13329
|
+
const shape = def.shape;
|
|
13330
|
+
for (const key of Reflect.ownKeys(shape)) {
|
|
13331
|
+
const keyExpr = typeof key === "symbol" ? addConstant(ctx, key) : esc(key);
|
|
13332
|
+
const inputVar = newVar(ctx);
|
|
13333
|
+
doc.write(`const ${inputVar} = ${accessor}[${keyExpr}];`);
|
|
13334
|
+
compileChild(doc, ctx, shape[key], inputVar, false);
|
|
13335
|
+
}
|
|
13336
|
+
}
|
|
12865
13337
|
function generatePropertyCheck(doc, ctx, def, accessor) {
|
|
12866
13338
|
const propAccessor = `${accessor}[${JSON.stringify(def.property)}]`;
|
|
12867
13339
|
generateCheck(doc, ctx, def.schema, propAccessor);
|
|
@@ -12889,7 +13361,7 @@ function generateCustomRefineCheck(doc, ctx, check2, accessor) {
|
|
|
12889
13361
|
if (isAsyncFunction(def.fn)) {
|
|
12890
13362
|
throw new ZodCompileAsyncError("z.compile: async .refine() predicates are not supported");
|
|
12891
13363
|
}
|
|
12892
|
-
const fnConst =
|
|
13364
|
+
const fnConst = addUserConstant(ctx, def.fn);
|
|
12893
13365
|
const throwAsyncConst = addConstant(ctx, throwAsync);
|
|
12894
13366
|
const resVar = newVar(ctx);
|
|
12895
13367
|
doc.write(`const ${resVar} = ${fnConst}(${accessor});`);
|
|
@@ -12909,7 +13381,7 @@ function generateCustomRefineCheck(doc, ctx, check2, accessor) {
|
|
|
12909
13381
|
throwAsync();
|
|
12910
13382
|
return fakePayload.issues.length === 0 ? fakePayload.value : INVALID;
|
|
12911
13383
|
};
|
|
12912
|
-
const helperConst =
|
|
13384
|
+
const helperConst = addUserConstant(ctx, helperFn);
|
|
12913
13385
|
const outVar = newVar(ctx);
|
|
12914
13386
|
doc.write(`const ${outVar} = ${helperConst}(${accessor});`);
|
|
12915
13387
|
doc.write(`if (${outVar} === INVALID) return INVALID;`);
|
|
@@ -12943,7 +13415,7 @@ var PATTERN_IS_COMPLETE = /* @__PURE__ */ new Set([
|
|
|
12943
13415
|
"uuid",
|
|
12944
13416
|
"xid"
|
|
12945
13417
|
]);
|
|
12946
|
-
function generateStringFormatCheck(doc, ctx, def, accessor) {
|
|
13418
|
+
function generateStringFormatCheck(doc, ctx, def, accessor, needsValue = true) {
|
|
12947
13419
|
const fmt = def.format;
|
|
12948
13420
|
if (fmt === "base64") {
|
|
12949
13421
|
const validator = addConstant(ctx, isValidBase64);
|
|
@@ -12976,9 +13448,14 @@ function generateStringFormatCheck(doc, ctx, def, accessor) {
|
|
|
12976
13448
|
doc.write(`if (!${validator}(${accessor})) return INVALID;`);
|
|
12977
13449
|
return accessor;
|
|
12978
13450
|
}
|
|
13451
|
+
if (fmt === "iban") {
|
|
13452
|
+
const validator = addConstant(ctx, isValidIBAN);
|
|
13453
|
+
doc.write(`if (!${validator}(${accessor})) return INVALID;`);
|
|
13454
|
+
return accessor;
|
|
13455
|
+
}
|
|
12979
13456
|
const formatDef = def;
|
|
12980
13457
|
if (fmt === "url" || fmt === "httpurl" || formatDef.normalize || formatDef.hostname !== void 0 || formatDef.protocol !== void 0) {
|
|
12981
|
-
const parseConst = addConstant(ctx,
|
|
13458
|
+
const parseConst = addConstant(ctx, validateURL);
|
|
12982
13459
|
const defConst = addConstant(ctx, def);
|
|
12983
13460
|
const trimVar = newVar(ctx);
|
|
12984
13461
|
const urlVar = newVar(ctx);
|
|
@@ -12993,6 +13470,8 @@ function generateStringFormatCheck(doc, ctx, def, accessor) {
|
|
|
12993
13470
|
const protocolConst = addConstant(ctx, urlProtocolOk);
|
|
12994
13471
|
doc.write(`if (!${protocolConst}(${urlVar}, ${defConst}.protocol)) return INVALID;`);
|
|
12995
13472
|
}
|
|
13473
|
+
if (!needsValue)
|
|
13474
|
+
return null;
|
|
12996
13475
|
const outputVar = newVar(ctx);
|
|
12997
13476
|
const outputExpr = formatDef.normalize ? `${urlVar}.href` : `${addConstant(ctx, stripTabAndNewline)}(${trimVar})`;
|
|
12998
13477
|
doc.write(`const ${outputVar} = ${outputExpr};`);
|
|
@@ -13052,7 +13531,7 @@ function generateCheck(doc, ctx, schema, accessor, needsValue = true) {
|
|
|
13052
13531
|
let typeAccessor;
|
|
13053
13532
|
switch (type) {
|
|
13054
13533
|
case "string":
|
|
13055
|
-
typeAccessor = generateStringCheck(doc, ctx, schema, accessor);
|
|
13534
|
+
typeAccessor = generateStringCheck(doc, ctx, schema, accessor, buildsValue);
|
|
13056
13535
|
break;
|
|
13057
13536
|
case "number":
|
|
13058
13537
|
typeAccessor = generateNumberCheck(doc, schema, accessor);
|
|
@@ -13173,12 +13652,12 @@ function generateCheck(doc, ctx, schema, accessor, needsValue = true) {
|
|
|
13173
13652
|
return null;
|
|
13174
13653
|
return generateChecks(doc, ctx, schema, typeAccessor);
|
|
13175
13654
|
}
|
|
13176
|
-
function generateStringCheck(doc, ctx, schema, accessor) {
|
|
13655
|
+
function generateStringCheck(doc, ctx, schema, accessor, needsValue = true) {
|
|
13177
13656
|
doc.write(`if (typeof ${accessor} !== "string") return INVALID;`);
|
|
13178
13657
|
const def = schema._zod.def;
|
|
13179
13658
|
if (def.format === void 0)
|
|
13180
13659
|
return accessor;
|
|
13181
|
-
return generateStringFormatCheck(doc, ctx, def, accessor);
|
|
13660
|
+
return generateStringFormatCheck(doc, ctx, def, accessor, needsValue);
|
|
13182
13661
|
}
|
|
13183
13662
|
function generateNumberCheck(doc, schema, accessor) {
|
|
13184
13663
|
doc.write(`if (typeof ${accessor} !== "number" || !Number.isFinite(${accessor})) return INVALID;`);
|
|
@@ -13296,7 +13775,7 @@ function generateObjectCheck(doc, ctx, schema, accessor, buildsValue = true) {
|
|
|
13296
13775
|
}
|
|
13297
13776
|
}
|
|
13298
13777
|
const outputVar = newVar(ctx);
|
|
13299
|
-
const hasConditionalKeys = allKeys.some((k) =>
|
|
13778
|
+
const hasConditionalKeys = allKeys.some((k) => mayOmitUndefined(propShape[k]) || dropsWhenAbsent(propShape[k]));
|
|
13300
13779
|
if (!buildsValue) {
|
|
13301
13780
|
if (unknownKeysMode === "schema") {
|
|
13302
13781
|
const knownSet = keys.length > 0 ? addConstant(ctx, new Set(keys)) : null;
|
|
@@ -13323,7 +13802,7 @@ function generateObjectCheck(doc, ctx, schema, accessor, buildsValue = true) {
|
|
|
13323
13802
|
const out = propOutputs.get(k);
|
|
13324
13803
|
if (dropsWhenAbsent(propShape[k])) {
|
|
13325
13804
|
doc.write(`if (${kx} in ${accessor}) ${outputVar}[${kx}] = ${out};`);
|
|
13326
|
-
} else if (
|
|
13805
|
+
} else if (mayOmitUndefined(propShape[k])) {
|
|
13327
13806
|
doc.write(`if (${out} !== undefined || ${kx} in ${accessor}) ${outputVar}[${kx}] = ${out};`);
|
|
13328
13807
|
} else {
|
|
13329
13808
|
doc.write(`${outputVar}[${kx}] = ${out};`);
|
|
@@ -13456,6 +13935,9 @@ function fastPathAcceptsAbsence(schema) {
|
|
|
13456
13935
|
function dropsWhenAbsent(schema) {
|
|
13457
13936
|
return schema._zod.optin === "optional" && schema._zod.optout === "optional";
|
|
13458
13937
|
}
|
|
13938
|
+
function mayOmitUndefined(schema) {
|
|
13939
|
+
return (schema._zod.optin !== "defaulted" || schema._zod.optout === "optional") && mayOutputUndefined(schema);
|
|
13940
|
+
}
|
|
13459
13941
|
function mayOutputUndefined(schema) {
|
|
13460
13942
|
const def = schema._zod.def;
|
|
13461
13943
|
switch (def.type) {
|
|
@@ -13512,9 +13994,15 @@ function generateNullableCheck(doc, ctx, schema, accessor, buildsValue = true) {
|
|
|
13512
13994
|
doc.write(`}`);
|
|
13513
13995
|
return outputVar;
|
|
13514
13996
|
}
|
|
13997
|
+
function generateSizeGate(doc, schema, size) {
|
|
13998
|
+
for (const [max, check2] of sizeCaps(schema._zod.def.checks)) {
|
|
13999
|
+
doc.write(`if (${size} > ${numericOperand(max, check2._zod.def.check)}) return INVALID;`);
|
|
14000
|
+
}
|
|
14001
|
+
}
|
|
13515
14002
|
function generateArrayCheck(doc, ctx, schema, accessor, buildsValue = true) {
|
|
13516
14003
|
const def = schema._zod.def;
|
|
13517
14004
|
doc.write(`if (!Array.isArray(${accessor})) return INVALID;`);
|
|
14005
|
+
generateSizeGate(doc, schema, `${accessor}.length`);
|
|
13518
14006
|
const outputVar = buildsValue ? newVar(ctx) : null;
|
|
13519
14007
|
const iVar = newVar(ctx);
|
|
13520
14008
|
const elemVar = newVar(ctx);
|
|
@@ -13798,6 +14286,7 @@ function literalEquality(ctx, accessor, value) {
|
|
|
13798
14286
|
}
|
|
13799
14287
|
function generateIntersectionCheck(doc, ctx, schema, accessor) {
|
|
13800
14288
|
const def = schema._zod.def;
|
|
14289
|
+
ctx.definite = false;
|
|
13801
14290
|
const leftOutput = compileChild(doc, ctx, def.left, accessor);
|
|
13802
14291
|
const rightOutput = compileChild(doc, ctx, def.right, accessor);
|
|
13803
14292
|
const mergeConst = addConstant(ctx, mergeValues);
|
|
@@ -13851,14 +14340,13 @@ function generateRecordCheck(doc, ctx, schema, accessor) {
|
|
|
13851
14340
|
const keyIsBareString = keyDef.type === "string" && keyDef.format === void 0 && !keyDef.coerce && (keyDef.checks?.length ?? 0) === 0;
|
|
13852
14341
|
if (!keyIsBareString) {
|
|
13853
14342
|
const isLoose = def.mode === "loose";
|
|
13854
|
-
const
|
|
14343
|
+
const keyFn = compileFn(def.keyType);
|
|
14344
|
+
if (keyFn.definite === false)
|
|
14345
|
+
ctx.definite = false;
|
|
14346
|
+
const keyFast = addConstant(ctx, keyFn);
|
|
13855
14347
|
const numericConst = addConstant(ctx, number);
|
|
13856
|
-
const propIsEnumerableConst = addConstant(ctx, Object.prototype.propertyIsEnumerable);
|
|
13857
14348
|
const outKeyVar = newVar(ctx);
|
|
13858
|
-
doc
|
|
13859
|
-
doc.indented((d) => {
|
|
13860
|
-
d.write(`if (${kVar} === "__proto__") continue;`);
|
|
13861
|
-
d.write(`if (!${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
|
|
14349
|
+
emitOwnKeys(doc, ctx, accessor, kVar, (d) => {
|
|
13862
14350
|
d.write(`let ${outKeyVar} = ${keyFast}(${kVar});`);
|
|
13863
14351
|
d.write(`if (${outKeyVar} === INVALID && typeof ${kVar} === "string" && ${numericConst}.test(${kVar})) ${outKeyVar} = ${keyFast}(Number(${kVar}));`);
|
|
13864
14352
|
if (isLoose) {
|
|
@@ -13872,21 +14360,39 @@ function generateRecordCheck(doc, ctx, schema, accessor) {
|
|
|
13872
14360
|
const valOutput = compileChild(d, ctx, def.valueType, valueVar);
|
|
13873
14361
|
d.write(`${outputVar}[${outKeyVar}] = ${valOutput};`);
|
|
13874
14362
|
});
|
|
13875
|
-
doc.write(`}`);
|
|
13876
14363
|
return outputVar;
|
|
13877
14364
|
}
|
|
13878
|
-
|
|
13879
|
-
doc.write(`for (const ${kVar} of Reflect.ownKeys(${accessor})) {`);
|
|
13880
|
-
doc.indented((d) => {
|
|
13881
|
-
d.write(`if (${kVar} === "__proto__") continue;`);
|
|
13882
|
-
d.write(`if (!${propIsEnumerable}.call(${accessor}, ${kVar})) continue;`);
|
|
13883
|
-
d.write(`if (typeof ${kVar} !== "string") return INVALID;`);
|
|
14365
|
+
emitOwnKeys(doc, ctx, accessor, kVar, (d) => {
|
|
13884
14366
|
d.write(`const ${valVar} = ${accessor}[${kVar}];`);
|
|
13885
14367
|
const valOutput = compileChild(d, ctx, def.valueType, valVar);
|
|
13886
14368
|
d.write(`${outputVar}[${kVar}] = ${valOutput};`);
|
|
14369
|
+
}, `return INVALID;`);
|
|
14370
|
+
return outputVar;
|
|
14371
|
+
}
|
|
14372
|
+
function emitOwnKeys(doc, ctx, accessor, kVar, body, onSymbol) {
|
|
14373
|
+
const propIsEnumerableConst = addConstant(ctx, Object.prototype.propertyIsEnumerable);
|
|
14374
|
+
const symsVar = newVar(ctx);
|
|
14375
|
+
const keysVar = newVar(ctx);
|
|
14376
|
+
const iVar = newVar(ctx);
|
|
14377
|
+
doc.write(`const ${symsVar} = Object.getOwnPropertySymbols(${accessor});`);
|
|
14378
|
+
doc.write(`const ${keysVar} = Object.getOwnPropertyNames(${accessor});`);
|
|
14379
|
+
doc.write(`for (let ${iVar} = 0; ${iVar} < ${keysVar}.length; ${iVar}++) {`);
|
|
14380
|
+
doc.indented((d) => {
|
|
14381
|
+
d.write(`const ${kVar} = ${keysVar}[${iVar}];`);
|
|
14382
|
+
d.write(`if (${kVar} === "__proto__" || !${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
|
|
14383
|
+
body(d);
|
|
14384
|
+
});
|
|
14385
|
+
doc.write(`}`);
|
|
14386
|
+
doc.write(`for (let ${iVar} = 0; ${iVar} < ${symsVar}.length; ${iVar}++) {`);
|
|
14387
|
+
doc.indented((d) => {
|
|
14388
|
+
d.write(`const ${kVar} = ${symsVar}[${iVar}];`);
|
|
14389
|
+
d.write(`if (!${propIsEnumerableConst}.call(${accessor}, ${kVar})) continue;`);
|
|
14390
|
+
if (onSymbol)
|
|
14391
|
+
d.write(onSymbol);
|
|
14392
|
+
else
|
|
14393
|
+
body(d);
|
|
13887
14394
|
});
|
|
13888
14395
|
doc.write(`}`);
|
|
13889
|
-
return outputVar;
|
|
13890
14396
|
}
|
|
13891
14397
|
function literalPropertyKey(ctx, key) {
|
|
13892
14398
|
if (typeof key === "string")
|
|
@@ -13896,6 +14402,7 @@ function literalPropertyKey(ctx, key) {
|
|
|
13896
14402
|
function generateMapCheck(doc, ctx, schema, accessor) {
|
|
13897
14403
|
const def = schema._zod.def;
|
|
13898
14404
|
doc.write(`if (!(${accessor} instanceof Map)) return INVALID;`);
|
|
14405
|
+
generateSizeGate(doc, schema, `${accessor}.size`);
|
|
13899
14406
|
const outputVar = newVar(ctx);
|
|
13900
14407
|
const kVar = newVar(ctx);
|
|
13901
14408
|
const valVar = newVar(ctx);
|
|
@@ -13912,6 +14419,7 @@ function generateMapCheck(doc, ctx, schema, accessor) {
|
|
|
13912
14419
|
function generateSetCheck(doc, ctx, schema, accessor) {
|
|
13913
14420
|
const def = schema._zod.def;
|
|
13914
14421
|
doc.write(`if (!(${accessor} instanceof Set)) return INVALID;`);
|
|
14422
|
+
generateSizeGate(doc, schema, `${accessor}.size`);
|
|
13915
14423
|
const outputVar = newVar(ctx);
|
|
13916
14424
|
const valVar = newVar(ctx);
|
|
13917
14425
|
doc.write(`const ${outputVar} = new Set();`);
|
|
@@ -13939,7 +14447,7 @@ function generateTemplateLiteralCheck(doc, ctx, schema, accessor) {
|
|
|
13939
14447
|
}
|
|
13940
14448
|
function generateLazyCheck(doc, ctx, schema, accessor) {
|
|
13941
14449
|
const def = schema._zod.def;
|
|
13942
|
-
const getterConst =
|
|
14450
|
+
const getterConst = addUserConstant(ctx, def.getter);
|
|
13943
14451
|
const cacheConst = addConstant(ctx, { parser: null });
|
|
13944
14452
|
doc.write(`if (!${cacheConst}.parser) {`);
|
|
13945
14453
|
doc.indented((d) => {
|
|
@@ -13972,7 +14480,7 @@ function generatePipeCheck(doc, ctx, schema, accessor) {
|
|
|
13972
14480
|
return INVALID;
|
|
13973
14481
|
return fakePayload.issues.length === 0 ? result : INVALID;
|
|
13974
14482
|
};
|
|
13975
|
-
const helperConst =
|
|
14483
|
+
const helperConst = addUserConstant(ctx, helperFn);
|
|
13976
14484
|
const transformedVar = newVar(ctx);
|
|
13977
14485
|
doc.write(`const ${transformedVar} = ${helperConst}(${inputOutput});`);
|
|
13978
14486
|
doc.write(`if (${transformedVar} === INVALID) return INVALID;`);
|
|
@@ -13990,7 +14498,7 @@ function generateCustomCheck(doc, ctx, schema, accessor) {
|
|
|
13990
14498
|
if (isAsyncFunction(def.fn)) {
|
|
13991
14499
|
throw new ZodCompileAsyncError("z.compile: async custom predicates are not supported");
|
|
13992
14500
|
}
|
|
13993
|
-
const fnConst =
|
|
14501
|
+
const fnConst = addUserConstant(ctx, def.fn);
|
|
13994
14502
|
const throwAsyncConst = addConstant(ctx, throwAsync);
|
|
13995
14503
|
const resVar = newVar(ctx);
|
|
13996
14504
|
doc.write(`const ${resVar} = ${fnConst}(${accessor});`);
|
|
@@ -14023,7 +14531,7 @@ function generateCatchCheck(doc, ctx, schema, accessor) {
|
|
|
14023
14531
|
});
|
|
14024
14532
|
doc.write(`})();`);
|
|
14025
14533
|
const innerConst = addConstant(ctx, def.innerType);
|
|
14026
|
-
const catchConst =
|
|
14534
|
+
const catchConst = addUserConstant(ctx, def.catchValue);
|
|
14027
14535
|
const catchHelperConst = addConstant(ctx, runtimeCatch);
|
|
14028
14536
|
doc.write(`if (${outputVar} === INVALID) {`);
|
|
14029
14537
|
doc.indented((d) => {
|
|
@@ -14047,7 +14555,7 @@ function generateTransformCheck(doc, ctx, schema, accessor) {
|
|
|
14047
14555
|
return INVALID;
|
|
14048
14556
|
return fakePayload.issues.length === 0 ? result : INVALID;
|
|
14049
14557
|
};
|
|
14050
|
-
const helperConst =
|
|
14558
|
+
const helperConst = addUserConstant(ctx, helperFn);
|
|
14051
14559
|
const outputVar = newVar(ctx);
|
|
14052
14560
|
doc.write(`const ${outputVar} = ${helperConst}(${accessor});`);
|
|
14053
14561
|
doc.write(`if (${outputVar} === INVALID) return INVALID;`);
|
|
@@ -14057,20 +14565,18 @@ function generateTransformCheck(doc, ctx, schema, accessor) {
|
|
|
14057
14565
|
}
|
|
14058
14566
|
|
|
14059
14567
|
// node_modules/zod/v4/core/api.js
|
|
14568
|
+
function snapshotChecks(def) {
|
|
14569
|
+
if (def.checks)
|
|
14570
|
+
def.checks = [...def.checks];
|
|
14571
|
+
return def;
|
|
14572
|
+
}
|
|
14060
14573
|
// @__NO_SIDE_EFFECTS__
|
|
14061
14574
|
function _string(Class2, params) {
|
|
14062
|
-
return new Class2({
|
|
14063
|
-
type: "string",
|
|
14064
|
-
...normalizeParams(params)
|
|
14065
|
-
});
|
|
14575
|
+
return new Class2(snapshotChecks({ type: "string", ...normalizeParams(params) }));
|
|
14066
14576
|
}
|
|
14067
14577
|
// @__NO_SIDE_EFFECTS__
|
|
14068
14578
|
function _coercedString(Class2, params) {
|
|
14069
|
-
return new Class2({
|
|
14070
|
-
type: "string",
|
|
14071
|
-
coerce: true,
|
|
14072
|
-
...normalizeParams(params)
|
|
14073
|
-
});
|
|
14579
|
+
return new Class2(snapshotChecks({ type: "string", coerce: true, ...normalizeParams(params) }));
|
|
14074
14580
|
}
|
|
14075
14581
|
// @__NO_SIDE_EFFECTS__
|
|
14076
14582
|
function _email(Class2, params) {
|
|
@@ -14306,6 +14812,16 @@ function _creditCard(Class2, params) {
|
|
|
14306
14812
|
});
|
|
14307
14813
|
}
|
|
14308
14814
|
// @__NO_SIDE_EFFECTS__
|
|
14815
|
+
function _iban(Class2, params) {
|
|
14816
|
+
return new Class2({
|
|
14817
|
+
type: "string",
|
|
14818
|
+
format: "iban",
|
|
14819
|
+
check: "string_format",
|
|
14820
|
+
abort: false,
|
|
14821
|
+
...normalizeParams(params)
|
|
14822
|
+
});
|
|
14823
|
+
}
|
|
14824
|
+
// @__NO_SIDE_EFFECTS__
|
|
14309
14825
|
function _jwt(Class2, params) {
|
|
14310
14826
|
return new Class2({
|
|
14311
14827
|
type: "string",
|
|
@@ -14364,20 +14880,11 @@ function _isoDuration(Class2, params) {
|
|
|
14364
14880
|
}
|
|
14365
14881
|
// @__NO_SIDE_EFFECTS__
|
|
14366
14882
|
function _number(Class2, params) {
|
|
14367
|
-
return new Class2({
|
|
14368
|
-
type: "number",
|
|
14369
|
-
checks: [],
|
|
14370
|
-
...normalizeParams(params)
|
|
14371
|
-
});
|
|
14883
|
+
return new Class2(snapshotChecks({ type: "number", checks: [], ...normalizeParams(params) }));
|
|
14372
14884
|
}
|
|
14373
14885
|
// @__NO_SIDE_EFFECTS__
|
|
14374
14886
|
function _coercedNumber(Class2, params) {
|
|
14375
|
-
return new Class2({
|
|
14376
|
-
type: "number",
|
|
14377
|
-
coerce: true,
|
|
14378
|
-
checks: [],
|
|
14379
|
-
...normalizeParams(params)
|
|
14380
|
-
});
|
|
14887
|
+
return new Class2(snapshotChecks({ type: "number", coerce: true, checks: [], ...normalizeParams(params) }));
|
|
14381
14888
|
}
|
|
14382
14889
|
// @__NO_SIDE_EFFECTS__
|
|
14383
14890
|
function _int(Class2, params) {
|
|
@@ -14719,8 +15226,12 @@ function _property(property, schema, params) {
|
|
|
14719
15226
|
});
|
|
14720
15227
|
}
|
|
14721
15228
|
// @__NO_SIDE_EFFECTS__
|
|
14722
|
-
function _properties(shape) {
|
|
14723
|
-
return
|
|
15229
|
+
function _properties(shape, params) {
|
|
15230
|
+
return new $ZodCheckProperties({
|
|
15231
|
+
check: "properties",
|
|
15232
|
+
shape,
|
|
15233
|
+
...normalizeParams(params)
|
|
15234
|
+
});
|
|
14724
15235
|
}
|
|
14725
15236
|
// @__NO_SIDE_EFFECTS__
|
|
14726
15237
|
function _mime(types, params) {
|
|
@@ -15157,7 +15668,7 @@ function handleUnrepresentable(schema, ctx, json2, params, message) {
|
|
|
15157
15668
|
Object.assign(json2, result);
|
|
15158
15669
|
return true;
|
|
15159
15670
|
}
|
|
15160
|
-
function
|
|
15671
|
+
function processSchema(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
15161
15672
|
var _a3;
|
|
15162
15673
|
const def = schema._zod.def;
|
|
15163
15674
|
const seen = ctx.seen.get(schema);
|
|
@@ -15196,7 +15707,7 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
|
15196
15707
|
if (parent) {
|
|
15197
15708
|
if (!result.ref)
|
|
15198
15709
|
result.ref = parent;
|
|
15199
|
-
|
|
15710
|
+
processSchema(parent, ctx, params);
|
|
15200
15711
|
ctx.seen.get(parent).isParent = true;
|
|
15201
15712
|
}
|
|
15202
15713
|
}
|
|
@@ -15303,7 +15814,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15303
15814
|
if (seen.count > 1) {
|
|
15304
15815
|
if (ctx.reused === "ref") {
|
|
15305
15816
|
extractToDef(entry);
|
|
15306
|
-
continue;
|
|
15307
15817
|
}
|
|
15308
15818
|
}
|
|
15309
15819
|
}
|
|
@@ -15631,19 +16141,107 @@ function isTransforming(_schema, _ctx) {
|
|
|
15631
16141
|
}
|
|
15632
16142
|
var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
15633
16143
|
const ctx = initializeContext({ ...params, processors });
|
|
15634
|
-
|
|
16144
|
+
processSchema(schema, ctx);
|
|
15635
16145
|
extractDefs(ctx, schema);
|
|
15636
16146
|
return finalize(ctx, schema);
|
|
15637
16147
|
};
|
|
15638
16148
|
var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
|
|
15639
16149
|
const { libraryOptions, target } = params ?? {};
|
|
15640
16150
|
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
|
|
15641
|
-
|
|
16151
|
+
processSchema(schema, ctx);
|
|
15642
16152
|
extractDefs(ctx, schema);
|
|
15643
16153
|
return finalize(ctx, schema);
|
|
15644
16154
|
};
|
|
15645
16155
|
|
|
15646
16156
|
// node_modules/zod/v4/core/json-schema-processors.js
|
|
16157
|
+
var narrowMin = (agg, key, value) => {
|
|
16158
|
+
if (agg[key] === void 0 || value > agg[key])
|
|
16159
|
+
agg[key] = value;
|
|
16160
|
+
};
|
|
16161
|
+
var narrowMax = (agg, key, value) => {
|
|
16162
|
+
if (agg[key] === void 0 || value < agg[key])
|
|
16163
|
+
agg[key] = value;
|
|
16164
|
+
};
|
|
16165
|
+
var narrowBoth = (agg, value) => {
|
|
16166
|
+
narrowMin(agg, "minimum", value);
|
|
16167
|
+
narrowMax(agg, "maximum", value);
|
|
16168
|
+
};
|
|
16169
|
+
var addDivisor = (agg, value) => {
|
|
16170
|
+
agg.multipleOf ?? (agg.multipleOf = []);
|
|
16171
|
+
if (!agg.multipleOf.includes(value))
|
|
16172
|
+
agg.multipleOf.push(value);
|
|
16173
|
+
};
|
|
16174
|
+
var addPattern = (agg, pattern) => {
|
|
16175
|
+
agg.patterns ?? (agg.patterns = /* @__PURE__ */ new Set());
|
|
16176
|
+
agg.patterns.add(pattern);
|
|
16177
|
+
};
|
|
16178
|
+
var intersectMime = (agg, mime) => {
|
|
16179
|
+
agg.mime = agg.mime ? agg.mime.filter((m) => mime.includes(m)) : [...mime];
|
|
16180
|
+
};
|
|
16181
|
+
var setFormat = (agg, format) => {
|
|
16182
|
+
agg.format = format;
|
|
16183
|
+
if (format.includes("int"))
|
|
16184
|
+
agg.isInt = true;
|
|
16185
|
+
};
|
|
16186
|
+
var minContributor = (agg, def) => narrowMin(agg, "minimum", def.minimum);
|
|
16187
|
+
var maxContributor = (agg, def) => narrowMax(agg, "maximum", def.maximum);
|
|
16188
|
+
var formatContributor = (ranges) => (agg, def) => {
|
|
16189
|
+
setFormat(agg, def.format);
|
|
16190
|
+
const [minimum, maximum] = ranges[def.format];
|
|
16191
|
+
narrowMin(agg, "minimum", minimum);
|
|
16192
|
+
narrowMax(agg, "maximum", maximum);
|
|
16193
|
+
};
|
|
16194
|
+
var contributors = {
|
|
16195
|
+
greater_than: (agg, def) => narrowMin(agg, def.inclusive ? "minimum" : "exclusiveMinimum", def.value),
|
|
16196
|
+
less_than: (agg, def) => narrowMax(agg, def.inclusive ? "maximum" : "exclusiveMaximum", def.value),
|
|
16197
|
+
multiple_of: (agg, def) => addDivisor(agg, def.value),
|
|
16198
|
+
number_format: formatContributor(NUMBER_FORMAT_RANGES),
|
|
16199
|
+
bigint_format: formatContributor(BIGINT_FORMAT_RANGES),
|
|
16200
|
+
min_length: minContributor,
|
|
16201
|
+
max_length: maxContributor,
|
|
16202
|
+
length_equals: (agg, def) => narrowBoth(agg, def.length),
|
|
16203
|
+
min_size: minContributor,
|
|
16204
|
+
max_size: maxContributor,
|
|
16205
|
+
size_equals: (agg, def) => narrowBoth(agg, def.size),
|
|
16206
|
+
string_format: (agg, def) => {
|
|
16207
|
+
setFormat(agg, def.format);
|
|
16208
|
+
if (def.pattern)
|
|
16209
|
+
addPattern(agg, def.pattern);
|
|
16210
|
+
if (def.format === "base64" || def.format === "base64url")
|
|
16211
|
+
agg.contentEncoding = def.format;
|
|
16212
|
+
if (def.local || def.precision === -1)
|
|
16213
|
+
agg.laxFormat = true;
|
|
16214
|
+
},
|
|
16215
|
+
mime_type: (agg, def) => intersectMime(agg, def.mime)
|
|
16216
|
+
};
|
|
16217
|
+
function aggregateChecks(schema) {
|
|
16218
|
+
const agg = {};
|
|
16219
|
+
const def = schema._zod.def;
|
|
16220
|
+
const list = schema._zod.traits.has("$ZodCheck") ? [schema, ...def.checks ?? []] : def.checks ?? [];
|
|
16221
|
+
for (const ch of list)
|
|
16222
|
+
contributors[ch._zod.def.check]?.(agg, ch._zod.def);
|
|
16223
|
+
const bag = schema._zod.bag;
|
|
16224
|
+
if (bag.minimum !== void 0)
|
|
16225
|
+
narrowMin(agg, "minimum", bag.minimum);
|
|
16226
|
+
if (bag.exclusiveMinimum !== void 0)
|
|
16227
|
+
narrowMin(agg, "exclusiveMinimum", bag.exclusiveMinimum);
|
|
16228
|
+
if (bag.maximum !== void 0)
|
|
16229
|
+
narrowMax(agg, "maximum", bag.maximum);
|
|
16230
|
+
if (bag.exclusiveMaximum !== void 0)
|
|
16231
|
+
narrowMax(agg, "exclusiveMaximum", bag.exclusiveMaximum);
|
|
16232
|
+
if (bag.multipleOf !== void 0)
|
|
16233
|
+
addDivisor(agg, bag.multipleOf);
|
|
16234
|
+
if (bag.format !== void 0) {
|
|
16235
|
+
agg.format ?? (agg.format = bag.format);
|
|
16236
|
+
if (bag.format.includes("int"))
|
|
16237
|
+
agg.isInt = true;
|
|
16238
|
+
}
|
|
16239
|
+
if (bag.mime)
|
|
16240
|
+
intersectMime(agg, bag.mime);
|
|
16241
|
+
for (const pattern of bag.patterns ?? [])
|
|
16242
|
+
addPattern(agg, pattern);
|
|
16243
|
+
return agg;
|
|
16244
|
+
}
|
|
15647
16245
|
var formatMap = {
|
|
15648
16246
|
guid: "uuid",
|
|
15649
16247
|
url: "uri",
|
|
@@ -15652,10 +16250,15 @@ var formatMap = {
|
|
|
15652
16250
|
regex: ""
|
|
15653
16251
|
// do not set
|
|
15654
16252
|
};
|
|
16253
|
+
var exactPatterns = /* @__PURE__ */ new Map([
|
|
16254
|
+
[base64Charset, base64],
|
|
16255
|
+
[base64urlCharset, base64url]
|
|
16256
|
+
]);
|
|
16257
|
+
var exactPattern = (p) => exactPatterns.get(p) ?? p;
|
|
15655
16258
|
var stringProcessor = (schema, ctx, _json, _params) => {
|
|
15656
16259
|
const json2 = _json;
|
|
15657
16260
|
json2.type = "string";
|
|
15658
|
-
const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = schema
|
|
16261
|
+
const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = aggregateChecks(schema);
|
|
15659
16262
|
if (typeof minimum === "number")
|
|
15660
16263
|
json2.minLength = minimum;
|
|
15661
16264
|
if (typeof maximum === "number")
|
|
@@ -15671,7 +16274,7 @@ var stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
15671
16274
|
if (contentEncoding)
|
|
15672
16275
|
json2.contentEncoding = contentEncoding;
|
|
15673
16276
|
if (patterns && patterns.size > 0) {
|
|
15674
|
-
const patternList = [...patterns];
|
|
16277
|
+
const patternList = [...patterns].map(exactPattern);
|
|
15675
16278
|
if (patternList.length === 1)
|
|
15676
16279
|
json2.pattern = patternList[0].source;
|
|
15677
16280
|
else if (patternList.length > 1) {
|
|
@@ -15686,11 +16289,8 @@ var stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
15686
16289
|
};
|
|
15687
16290
|
var numberProcessor = (schema, ctx, _json, params) => {
|
|
15688
16291
|
const json2 = _json;
|
|
15689
|
-
const { minimum, maximum,
|
|
15690
|
-
|
|
15691
|
-
json2.type = "integer";
|
|
15692
|
-
else
|
|
15693
|
-
json2.type = "number";
|
|
16292
|
+
const { minimum, maximum, multipleOf, exclusiveMaximum, exclusiveMinimum, isInt } = aggregateChecks(schema);
|
|
16293
|
+
json2.type = isInt ? "integer" : "number";
|
|
15694
16294
|
const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
|
|
15695
16295
|
const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
|
|
15696
16296
|
const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
|
|
@@ -15714,11 +16314,19 @@ var numberProcessor = (schema, ctx, _json, params) => {
|
|
|
15714
16314
|
} else if (typeof maximum === "number") {
|
|
15715
16315
|
json2.maximum = maximum;
|
|
15716
16316
|
}
|
|
15717
|
-
if (
|
|
15718
|
-
|
|
15719
|
-
|
|
15720
|
-
|
|
15721
|
-
|
|
16317
|
+
if (multipleOf) {
|
|
16318
|
+
const divisors = /* @__PURE__ */ new Set();
|
|
16319
|
+
for (const divisor of multipleOf) {
|
|
16320
|
+
if (Number.isFinite(divisor) && divisor !== 0)
|
|
16321
|
+
divisors.add(Math.abs(divisor));
|
|
16322
|
+
else
|
|
16323
|
+
handleUnrepresentable(schema, ctx, json2, params, `A multipleOf divisor of ${divisor} cannot be represented in JSON Schema`);
|
|
16324
|
+
}
|
|
16325
|
+
const [first, ...rest] = divisors;
|
|
16326
|
+
if (first !== void 0)
|
|
16327
|
+
json2.multipleOf = first;
|
|
16328
|
+
if (rest.length)
|
|
16329
|
+
json2.allOf = [...json2.allOf ?? [], ...rest.map((m) => ({ multipleOf: m }))];
|
|
15722
16330
|
}
|
|
15723
16331
|
};
|
|
15724
16332
|
var booleanProcessor = (_schema, _ctx, json2, _params) => {
|
|
@@ -15821,27 +16429,22 @@ var templateLiteralProcessor = (schema, _ctx, json2, _params) => {
|
|
|
15821
16429
|
};
|
|
15822
16430
|
var fileProcessor = (schema, _ctx, json2, _params) => {
|
|
15823
16431
|
const _json = json2;
|
|
15824
|
-
|
|
15825
|
-
|
|
15826
|
-
|
|
15827
|
-
|
|
15828
|
-
};
|
|
15829
|
-
const { minimum, maximum, mime } = schema._zod.bag;
|
|
16432
|
+
_json.type = "string";
|
|
16433
|
+
_json.format = "binary";
|
|
16434
|
+
_json.contentEncoding = "binary";
|
|
16435
|
+
const { minimum, maximum, mime } = aggregateChecks(schema);
|
|
15830
16436
|
if (minimum !== void 0)
|
|
15831
|
-
|
|
16437
|
+
_json.minLength = minimum;
|
|
15832
16438
|
if (maximum !== void 0)
|
|
15833
|
-
|
|
15834
|
-
if (mime)
|
|
15835
|
-
|
|
15836
|
-
|
|
15837
|
-
|
|
15838
|
-
|
|
15839
|
-
|
|
15840
|
-
|
|
15841
|
-
}
|
|
15842
|
-
} else {
|
|
15843
|
-
Object.assign(_json, file2);
|
|
15844
|
-
}
|
|
16439
|
+
_json.maxLength = maximum;
|
|
16440
|
+
if (!mime)
|
|
16441
|
+
return;
|
|
16442
|
+
if (mime.length === 0)
|
|
16443
|
+
_json.not = {};
|
|
16444
|
+
else if (mime.length === 1)
|
|
16445
|
+
_json.contentMediaType = mime[0];
|
|
16446
|
+
else
|
|
16447
|
+
_json.anyOf = mime.map((m) => ({ contentMediaType: m }));
|
|
15845
16448
|
};
|
|
15846
16449
|
var successProcessor = (_schema, _ctx, json2, _params) => {
|
|
15847
16450
|
json2.type = "boolean";
|
|
@@ -15864,13 +16467,13 @@ var setProcessor = (schema, ctx, json2, params) => {
|
|
|
15864
16467
|
var arrayProcessor = (schema, ctx, _json, params) => {
|
|
15865
16468
|
const json2 = _json;
|
|
15866
16469
|
const def = schema._zod.def;
|
|
15867
|
-
const { minimum, maximum } = schema
|
|
16470
|
+
const { minimum, maximum } = aggregateChecks(schema);
|
|
15868
16471
|
if (typeof minimum === "number")
|
|
15869
16472
|
json2.minItems = minimum;
|
|
15870
16473
|
if (typeof maximum === "number")
|
|
15871
16474
|
json2.maxItems = maximum;
|
|
15872
16475
|
json2.type = "array";
|
|
15873
|
-
json2.items =
|
|
16476
|
+
json2.items = processSchema(def.element, ctx, {
|
|
15874
16477
|
...params,
|
|
15875
16478
|
path: [...params.path, "items"]
|
|
15876
16479
|
});
|
|
@@ -15896,22 +16499,20 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
15896
16499
|
json2.type = "object";
|
|
15897
16500
|
json2.properties = {};
|
|
15898
16501
|
for (const key in shape) {
|
|
15899
|
-
assignProp(json2.properties, key,
|
|
16502
|
+
assignProp(json2.properties, key, processSchema(shape[key], ctx, {
|
|
15900
16503
|
...params,
|
|
15901
16504
|
path: [...params.path, "properties", key]
|
|
15902
16505
|
}));
|
|
15903
16506
|
}
|
|
15904
|
-
const
|
|
15905
|
-
const
|
|
16507
|
+
const requiredKeys = [];
|
|
16508
|
+
for (const key of Object.keys(shape)) {
|
|
15906
16509
|
const field = def.shape[key];
|
|
15907
|
-
if (ctx.io === "input") {
|
|
15908
|
-
|
|
15909
|
-
} else {
|
|
15910
|
-
return field._zod.optout === void 0;
|
|
16510
|
+
if (ctx.io === "input" ? inputOptin(field) === void 0 : field._zod.optout === void 0) {
|
|
16511
|
+
requiredKeys.push(key);
|
|
15911
16512
|
}
|
|
15912
|
-
}
|
|
15913
|
-
if (requiredKeys.
|
|
15914
|
-
json2.required =
|
|
16513
|
+
}
|
|
16514
|
+
if (requiredKeys.length > 0) {
|
|
16515
|
+
json2.required = requiredKeys;
|
|
15915
16516
|
}
|
|
15916
16517
|
if (def.catchall?._zod.def.type === "never") {
|
|
15917
16518
|
json2.additionalProperties = false;
|
|
@@ -15919,7 +16520,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
15919
16520
|
if (ctx.io === "output")
|
|
15920
16521
|
json2.additionalProperties = false;
|
|
15921
16522
|
} else if (def.catchall) {
|
|
15922
|
-
json2.additionalProperties =
|
|
16523
|
+
json2.additionalProperties = processSchema(def.catchall, ctx, {
|
|
15923
16524
|
...params,
|
|
15924
16525
|
path: [...params.path, "additionalProperties"]
|
|
15925
16526
|
});
|
|
@@ -15928,7 +16529,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
15928
16529
|
var unionProcessor = (schema, ctx, json2, params) => {
|
|
15929
16530
|
const def = schema._zod.def;
|
|
15930
16531
|
const isExclusive = def.inclusive === false;
|
|
15931
|
-
const options = def.options.map((x, i) =>
|
|
16532
|
+
const options = def.options.map((x, i) => processSchema(x, ctx, {
|
|
15932
16533
|
...params,
|
|
15933
16534
|
path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
|
|
15934
16535
|
}));
|
|
@@ -15940,11 +16541,11 @@ var unionProcessor = (schema, ctx, json2, params) => {
|
|
|
15940
16541
|
};
|
|
15941
16542
|
var intersectionProcessor = (schema, ctx, json2, params) => {
|
|
15942
16543
|
const def = schema._zod.def;
|
|
15943
|
-
const a =
|
|
16544
|
+
const a = processSchema(def.left, ctx, {
|
|
15944
16545
|
...params,
|
|
15945
16546
|
path: [...params.path, "allOf", 0]
|
|
15946
16547
|
});
|
|
15947
|
-
const b =
|
|
16548
|
+
const b = processSchema(def.right, ctx, {
|
|
15948
16549
|
...params,
|
|
15949
16550
|
path: [...params.path, "allOf", 1]
|
|
15950
16551
|
});
|
|
@@ -15962,11 +16563,11 @@ var tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
15962
16563
|
json2.type = "array";
|
|
15963
16564
|
const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
15964
16565
|
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
15965
|
-
const prefixItems = def.items.map((x, i) =>
|
|
16566
|
+
const prefixItems = def.items.map((x, i) => processSchema(x, ctx, {
|
|
15966
16567
|
...params,
|
|
15967
16568
|
path: [...params.path, prefixPath, i]
|
|
15968
16569
|
}));
|
|
15969
|
-
const rest = def.rest ?
|
|
16570
|
+
const rest = def.rest ? processSchema(def.rest, ctx, {
|
|
15970
16571
|
...params,
|
|
15971
16572
|
path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
|
|
15972
16573
|
}) : null;
|
|
@@ -16014,7 +16615,7 @@ var tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
16014
16615
|
if (isClosed)
|
|
16015
16616
|
json2.maxItems = maxItems;
|
|
16016
16617
|
}
|
|
16017
|
-
const { minimum, maximum } = schema
|
|
16618
|
+
const { minimum, maximum } = aggregateChecks(schema);
|
|
16018
16619
|
if (typeof minimum === "number")
|
|
16019
16620
|
json2.minItems = minimum;
|
|
16020
16621
|
if (typeof maximum === "number")
|
|
@@ -16088,20 +16689,19 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
16088
16689
|
const def = schema._zod.def;
|
|
16089
16690
|
json2.type = "object";
|
|
16090
16691
|
const keyType = def.keyType;
|
|
16091
|
-
const
|
|
16092
|
-
const patterns = keyBag?.patterns;
|
|
16692
|
+
const patterns = aggregateChecks(keyType).patterns;
|
|
16093
16693
|
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
16094
|
-
const valueSchema =
|
|
16694
|
+
const valueSchema = processSchema(def.valueType, ctx, {
|
|
16095
16695
|
...params,
|
|
16096
16696
|
path: [...params.path, "patternProperties", "*"]
|
|
16097
16697
|
});
|
|
16098
16698
|
json2.patternProperties = {};
|
|
16099
16699
|
for (const pattern of patterns) {
|
|
16100
|
-
assignProp(json2.patternProperties, pattern.source, valueSchema);
|
|
16700
|
+
assignProp(json2.patternProperties, exactPattern(pattern).source, valueSchema);
|
|
16101
16701
|
}
|
|
16102
16702
|
} else {
|
|
16103
16703
|
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
|
|
16104
|
-
json2.propertyNames =
|
|
16704
|
+
json2.propertyNames = processSchema(def.keyType, ctx, {
|
|
16105
16705
|
...params,
|
|
16106
16706
|
path: [...params.path, "propertyNames"]
|
|
16107
16707
|
});
|
|
@@ -16113,7 +16713,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
16113
16713
|
}
|
|
16114
16714
|
pending.push(schema);
|
|
16115
16715
|
}
|
|
16116
|
-
json2.additionalProperties =
|
|
16716
|
+
json2.additionalProperties = processSchema(def.valueType, ctx, {
|
|
16117
16717
|
...params,
|
|
16118
16718
|
path: [...params.path, "additionalProperties"]
|
|
16119
16719
|
});
|
|
@@ -16129,7 +16729,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
16129
16729
|
};
|
|
16130
16730
|
var nullableProcessor = (schema, ctx, json2, params) => {
|
|
16131
16731
|
const def = schema._zod.def;
|
|
16132
|
-
const inner =
|
|
16732
|
+
const inner = processSchema(def.innerType, ctx, params);
|
|
16133
16733
|
const seen = ctx.seen.get(schema);
|
|
16134
16734
|
if (ctx.target === "openapi-3.0") {
|
|
16135
16735
|
seen.ref = def.innerType;
|
|
@@ -16140,7 +16740,7 @@ var nullableProcessor = (schema, ctx, json2, params) => {
|
|
|
16140
16740
|
};
|
|
16141
16741
|
var nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
16142
16742
|
const def = schema._zod.def;
|
|
16143
|
-
|
|
16743
|
+
processSchema(def.innerType, ctx, params);
|
|
16144
16744
|
const seen = ctx.seen.get(schema);
|
|
16145
16745
|
seen.ref = def.innerType;
|
|
16146
16746
|
};
|
|
@@ -16160,7 +16760,7 @@ function serializeDefaultValue(value, schema, ctx, json2, params) {
|
|
|
16160
16760
|
}
|
|
16161
16761
|
var defaultProcessor = (schema, ctx, json2, params) => {
|
|
16162
16762
|
const def = schema._zod.def;
|
|
16163
|
-
|
|
16763
|
+
processSchema(def.innerType, ctx, params);
|
|
16164
16764
|
const seen = ctx.seen.get(schema);
|
|
16165
16765
|
seen.ref = def.innerType;
|
|
16166
16766
|
const value = serializeDefaultValue(def.defaultValue, schema, ctx, json2, params);
|
|
@@ -16169,7 +16769,7 @@ var defaultProcessor = (schema, ctx, json2, params) => {
|
|
|
16169
16769
|
};
|
|
16170
16770
|
var prefaultProcessor = (schema, ctx, json2, params) => {
|
|
16171
16771
|
const def = schema._zod.def;
|
|
16172
|
-
|
|
16772
|
+
processSchema(def.innerType, ctx, params);
|
|
16173
16773
|
const seen = ctx.seen.get(schema);
|
|
16174
16774
|
seen.ref = def.innerType;
|
|
16175
16775
|
if (ctx.io !== "input")
|
|
@@ -16180,7 +16780,7 @@ var prefaultProcessor = (schema, ctx, json2, params) => {
|
|
|
16180
16780
|
};
|
|
16181
16781
|
var catchProcessor = (schema, ctx, json2, params) => {
|
|
16182
16782
|
const def = schema._zod.def;
|
|
16183
|
-
|
|
16783
|
+
processSchema(def.innerType, ctx, params);
|
|
16184
16784
|
const seen = ctx.seen.get(schema);
|
|
16185
16785
|
seen.ref = def.innerType;
|
|
16186
16786
|
let catchValue;
|
|
@@ -16196,32 +16796,32 @@ var pipeProcessor = (schema, ctx, _json, params) => {
|
|
|
16196
16796
|
const def = schema._zod.def;
|
|
16197
16797
|
const inIsTransform = def.in._zod.traits.has("$ZodTransform");
|
|
16198
16798
|
const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
|
|
16199
|
-
|
|
16799
|
+
processSchema(innerType, ctx, params);
|
|
16200
16800
|
const seen = ctx.seen.get(schema);
|
|
16201
16801
|
seen.ref = innerType;
|
|
16202
16802
|
};
|
|
16203
16803
|
var readonlyProcessor = (schema, ctx, json2, params) => {
|
|
16204
16804
|
const def = schema._zod.def;
|
|
16205
|
-
|
|
16805
|
+
processSchema(def.innerType, ctx, params);
|
|
16206
16806
|
const seen = ctx.seen.get(schema);
|
|
16207
16807
|
seen.ref = def.innerType;
|
|
16208
16808
|
json2.readOnly = true;
|
|
16209
16809
|
};
|
|
16210
16810
|
var promiseProcessor = (schema, ctx, _json, params) => {
|
|
16211
16811
|
const def = schema._zod.def;
|
|
16212
|
-
|
|
16812
|
+
processSchema(def.innerType, ctx, params);
|
|
16213
16813
|
const seen = ctx.seen.get(schema);
|
|
16214
16814
|
seen.ref = def.innerType;
|
|
16215
16815
|
};
|
|
16216
16816
|
var optionalProcessor = (schema, ctx, _json, params) => {
|
|
16217
16817
|
const def = schema._zod.def;
|
|
16218
|
-
|
|
16818
|
+
processSchema(def.innerType, ctx, params);
|
|
16219
16819
|
const seen = ctx.seen.get(schema);
|
|
16220
16820
|
seen.ref = def.innerType;
|
|
16221
16821
|
};
|
|
16222
16822
|
var lazyProcessor = (schema, ctx, _json, params) => {
|
|
16223
16823
|
const innerType = schema._zod.innerType;
|
|
16224
|
-
|
|
16824
|
+
processSchema(innerType, ctx, params);
|
|
16225
16825
|
const seen = ctx.seen.get(schema);
|
|
16226
16826
|
seen.ref = innerType;
|
|
16227
16827
|
};
|
|
@@ -16273,7 +16873,7 @@ function toJSONSchema(input2, params) {
|
|
|
16273
16873
|
const defs = {};
|
|
16274
16874
|
for (const entry of registry2._idmap.entries()) {
|
|
16275
16875
|
const [_, schema] = entry;
|
|
16276
|
-
|
|
16876
|
+
processSchema(schema, ctx2);
|
|
16277
16877
|
}
|
|
16278
16878
|
const schemas = {};
|
|
16279
16879
|
const external = {
|
|
@@ -16296,7 +16896,7 @@ function toJSONSchema(input2, params) {
|
|
|
16296
16896
|
return { schemas };
|
|
16297
16897
|
}
|
|
16298
16898
|
const ctx = initializeContext({ ...params, processors: allProcessors });
|
|
16299
|
-
|
|
16899
|
+
processSchema(input2, ctx);
|
|
16300
16900
|
extractDefs(ctx, input2);
|
|
16301
16901
|
return finalize(ctx, input2);
|
|
16302
16902
|
}
|
|
@@ -16355,7 +16955,7 @@ var JSONSchemaGenerator = class {
|
|
|
16355
16955
|
* This must be called before emit().
|
|
16356
16956
|
*/
|
|
16357
16957
|
process(schema, _params = { path: [], schemaPath: [] }) {
|
|
16358
|
-
return
|
|
16958
|
+
return processSchema(schema, this.ctx, _params);
|
|
16359
16959
|
}
|
|
16360
16960
|
/**
|
|
16361
16961
|
* Emit the final JSON Schema after processing.
|
|
@@ -16412,12 +17012,14 @@ __export(schemas_exports2, {
|
|
|
16412
17012
|
ZodFile: () => ZodFile,
|
|
16413
17013
|
ZodFunction: () => ZodFunction,
|
|
16414
17014
|
ZodGUID: () => ZodGUID,
|
|
17015
|
+
ZodIBAN: () => ZodIBAN,
|
|
16415
17016
|
ZodIPv4: () => ZodIPv4,
|
|
16416
17017
|
ZodIPv6: () => ZodIPv6,
|
|
16417
17018
|
ZodISODate: () => ZodISODate,
|
|
16418
17019
|
ZodISODateTime: () => ZodISODateTime,
|
|
16419
17020
|
ZodISODuration: () => ZodISODuration,
|
|
16420
17021
|
ZodISOTime: () => ZodISOTime,
|
|
17022
|
+
ZodInstanceOf: () => ZodInstanceOf,
|
|
16421
17023
|
ZodIntersection: () => ZodIntersection,
|
|
16422
17024
|
ZodJWT: () => ZodJWT,
|
|
16423
17025
|
ZodKSUID: () => ZodKSUID,
|
|
@@ -16476,6 +17078,7 @@ __export(schemas_exports2, {
|
|
|
16476
17078
|
creditCard: () => creditCard2,
|
|
16477
17079
|
cuid: () => cuid3,
|
|
16478
17080
|
cuid2: () => cuid22,
|
|
17081
|
+
currencyCode: () => currencyCode2,
|
|
16479
17082
|
custom: () => custom,
|
|
16480
17083
|
date: () => date2,
|
|
16481
17084
|
describe: () => describe2,
|
|
@@ -16494,6 +17097,7 @@ __export(schemas_exports2, {
|
|
|
16494
17097
|
hex: () => hex2,
|
|
16495
17098
|
hostname: () => hostname2,
|
|
16496
17099
|
httpUrl: () => httpUrl,
|
|
17100
|
+
iban: () => iban2,
|
|
16497
17101
|
instanceof: () => _instanceof,
|
|
16498
17102
|
int: () => int,
|
|
16499
17103
|
int32: () => int32,
|
|
@@ -16796,6 +17400,12 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
16796
17400
|
set spa(value) {
|
|
16797
17401
|
util_exports.own(this, "spa", value);
|
|
16798
17402
|
},
|
|
17403
|
+
validate(data, params) {
|
|
17404
|
+
return validate(this, data, params);
|
|
17405
|
+
},
|
|
17406
|
+
validateAsync(data, params) {
|
|
17407
|
+
return validateAsync(this, data, params);
|
|
17408
|
+
},
|
|
16799
17409
|
encode: function _encode2(data, params) {
|
|
16800
17410
|
return encode2(this, data, params, { callee: _encode2 });
|
|
16801
17411
|
},
|
|
@@ -16832,61 +17442,65 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
16832
17442
|
return this._zod.def;
|
|
16833
17443
|
}
|
|
16834
17444
|
});
|
|
16835
|
-
var _ZodString = /* @__PURE__ */ $constructor(
|
|
16836
|
-
|
|
16837
|
-
|
|
16838
|
-
|
|
16839
|
-
|
|
16840
|
-
|
|
16841
|
-
inst.minLength = bag.minimum ?? null;
|
|
16842
|
-
inst.maxLength = bag.maximum ?? null;
|
|
16843
|
-
}, {
|
|
16844
|
-
regex(...args) {
|
|
16845
|
-
return this.check(_regex(...args));
|
|
16846
|
-
},
|
|
16847
|
-
includes(...args) {
|
|
16848
|
-
return this.check(_includes(...args));
|
|
16849
|
-
},
|
|
16850
|
-
startsWith(...args) {
|
|
16851
|
-
return this.check(_startsWith(...args));
|
|
16852
|
-
},
|
|
16853
|
-
endsWith(...args) {
|
|
16854
|
-
return this.check(_endsWith(...args));
|
|
16855
|
-
},
|
|
16856
|
-
min(...args) {
|
|
16857
|
-
return this.check(_minLength(...args));
|
|
16858
|
-
},
|
|
16859
|
-
max(...args) {
|
|
16860
|
-
return this.check(_maxLength(...args));
|
|
16861
|
-
},
|
|
16862
|
-
length(...args) {
|
|
16863
|
-
return this.check(_length(...args));
|
|
16864
|
-
},
|
|
16865
|
-
nonempty(...args) {
|
|
16866
|
-
return this.check(_minLength(1, ...args));
|
|
16867
|
-
},
|
|
16868
|
-
lowercase(params) {
|
|
16869
|
-
return this.check(_lowercase(params));
|
|
16870
|
-
},
|
|
16871
|
-
uppercase(params) {
|
|
16872
|
-
return this.check(_uppercase(params));
|
|
17445
|
+
var _ZodString = /* @__PURE__ */ $constructor(
|
|
17446
|
+
"_ZodString",
|
|
17447
|
+
(inst, def) => {
|
|
17448
|
+
$ZodString.init(inst, def);
|
|
17449
|
+
ZodType.init(inst, def);
|
|
17450
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => stringProcessor(inst, ctx, json2, params);
|
|
16873
17451
|
},
|
|
16874
|
-
|
|
16875
|
-
|
|
16876
|
-
|
|
16877
|
-
|
|
16878
|
-
|
|
16879
|
-
|
|
16880
|
-
|
|
16881
|
-
|
|
16882
|
-
|
|
16883
|
-
|
|
16884
|
-
|
|
16885
|
-
|
|
16886
|
-
|
|
16887
|
-
|
|
16888
|
-
|
|
16889
|
-
|
|
17452
|
+
/* @__PURE__ */ util_exports.derived({
|
|
17453
|
+
format: (inst) => aggregateChecks(inst).format ?? null,
|
|
17454
|
+
minLength: (inst) => aggregateChecks(inst).minimum ?? null,
|
|
17455
|
+
maxLength: (inst) => aggregateChecks(inst).maximum ?? null
|
|
17456
|
+
}, {
|
|
17457
|
+
regex(...args) {
|
|
17458
|
+
return this.check(_regex(...args));
|
|
17459
|
+
},
|
|
17460
|
+
includes(...args) {
|
|
17461
|
+
return this.check(_includes(...args));
|
|
17462
|
+
},
|
|
17463
|
+
startsWith(...args) {
|
|
17464
|
+
return this.check(_startsWith(...args));
|
|
17465
|
+
},
|
|
17466
|
+
endsWith(...args) {
|
|
17467
|
+
return this.check(_endsWith(...args));
|
|
17468
|
+
},
|
|
17469
|
+
min(...args) {
|
|
17470
|
+
return this.check(_minLength(...args));
|
|
17471
|
+
},
|
|
17472
|
+
max(...args) {
|
|
17473
|
+
return this.check(_maxLength(...args));
|
|
17474
|
+
},
|
|
17475
|
+
length(...args) {
|
|
17476
|
+
return this.check(_length(...args));
|
|
17477
|
+
},
|
|
17478
|
+
nonempty(...args) {
|
|
17479
|
+
return this.check(_minLength(1, ...args));
|
|
17480
|
+
},
|
|
17481
|
+
lowercase(params) {
|
|
17482
|
+
return this.check(_lowercase(params));
|
|
17483
|
+
},
|
|
17484
|
+
uppercase(params) {
|
|
17485
|
+
return this.check(_uppercase(params));
|
|
17486
|
+
},
|
|
17487
|
+
trim() {
|
|
17488
|
+
return this.check(_trim());
|
|
17489
|
+
},
|
|
17490
|
+
normalize(...args) {
|
|
17491
|
+
return this.check(_normalize(...args));
|
|
17492
|
+
},
|
|
17493
|
+
toLowerCase() {
|
|
17494
|
+
return this.check(_toLowerCase());
|
|
17495
|
+
},
|
|
17496
|
+
toUpperCase() {
|
|
17497
|
+
return this.check(_toUpperCase());
|
|
17498
|
+
},
|
|
17499
|
+
slugify() {
|
|
17500
|
+
return this.check(_slugify());
|
|
17501
|
+
}
|
|
17502
|
+
})
|
|
17503
|
+
);
|
|
16890
17504
|
var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
|
|
16891
17505
|
$ZodString.init(inst, def);
|
|
16892
17506
|
_ZodString.init(inst, def);
|
|
@@ -17032,8 +17646,8 @@ function url(params) {
|
|
|
17032
17646
|
}
|
|
17033
17647
|
function httpUrl(params) {
|
|
17034
17648
|
return _url(ZodURL, {
|
|
17035
|
-
protocol:
|
|
17036
|
-
hostname:
|
|
17649
|
+
protocol: httpProtocol,
|
|
17650
|
+
hostname: domain,
|
|
17037
17651
|
...util_exports.normalizeParams(params)
|
|
17038
17652
|
});
|
|
17039
17653
|
}
|
|
@@ -17149,6 +17763,13 @@ var ZodCreditCard = /* @__PURE__ */ $constructor("ZodCreditCard", (inst, def) =>
|
|
|
17149
17763
|
function creditCard2(params) {
|
|
17150
17764
|
return _creditCard(ZodCreditCard, params);
|
|
17151
17765
|
}
|
|
17766
|
+
var ZodIBAN = /* @__PURE__ */ $constructor("ZodIBAN", (inst, def) => {
|
|
17767
|
+
$ZodIBAN.init(inst, def);
|
|
17768
|
+
ZodStringFormat.init(inst, def);
|
|
17769
|
+
});
|
|
17770
|
+
function iban2(params) {
|
|
17771
|
+
return _iban(ZodIBAN, params);
|
|
17772
|
+
}
|
|
17152
17773
|
var ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
|
|
17153
17774
|
$ZodJWT.init(inst, def);
|
|
17154
17775
|
ZodStringFormat.init(inst, def);
|
|
@@ -17164,10 +17785,13 @@ function stringFormat(format, fnOrRegex, _params = {}) {
|
|
|
17164
17785
|
return _stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
|
|
17165
17786
|
}
|
|
17166
17787
|
function hostname2(_params) {
|
|
17167
|
-
return _stringFormat(ZodCustomStringFormat, "hostname",
|
|
17788
|
+
return _stringFormat(ZodCustomStringFormat, "hostname", hostname, _params);
|
|
17168
17789
|
}
|
|
17169
17790
|
function hex2(_params) {
|
|
17170
|
-
return _stringFormat(ZodCustomStringFormat, "hex",
|
|
17791
|
+
return _stringFormat(ZodCustomStringFormat, "hex", hex, _params);
|
|
17792
|
+
}
|
|
17793
|
+
function currencyCode2(_params) {
|
|
17794
|
+
return _stringFormat(ZodCustomStringFormat, "currency_code", currencyCode, _params);
|
|
17171
17795
|
}
|
|
17172
17796
|
function hash(alg, params) {
|
|
17173
17797
|
const enc = params?.enc ?? "hex";
|
|
@@ -17177,63 +17801,76 @@ function hash(alg, params) {
|
|
|
17177
17801
|
throw new Error(`Unrecognized hash format: ${format}`);
|
|
17178
17802
|
return _stringFormat(ZodCustomStringFormat, format, regex, params);
|
|
17179
17803
|
}
|
|
17180
|
-
var ZodNumber = /* @__PURE__ */ $constructor(
|
|
17181
|
-
|
|
17182
|
-
|
|
17183
|
-
|
|
17184
|
-
|
|
17185
|
-
|
|
17186
|
-
|
|
17187
|
-
inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
|
|
17188
|
-
inst.isFinite = true;
|
|
17189
|
-
inst.format = bag.format ?? null;
|
|
17190
|
-
}, {
|
|
17191
|
-
gt(value, params) {
|
|
17192
|
-
return this.check(_gt(value, params));
|
|
17193
|
-
},
|
|
17194
|
-
gte(value, params) {
|
|
17195
|
-
return this.check(_gte(value, params));
|
|
17196
|
-
},
|
|
17197
|
-
min(value, params) {
|
|
17198
|
-
return this.check(_gte(value, params));
|
|
17199
|
-
},
|
|
17200
|
-
lt(value, params) {
|
|
17201
|
-
return this.check(_lt(value, params));
|
|
17202
|
-
},
|
|
17203
|
-
lte(value, params) {
|
|
17204
|
-
return this.check(_lte(value, params));
|
|
17205
|
-
},
|
|
17206
|
-
max(value, params) {
|
|
17207
|
-
return this.check(_lte(value, params));
|
|
17208
|
-
},
|
|
17209
|
-
int(params) {
|
|
17210
|
-
return this.check(int(params));
|
|
17211
|
-
},
|
|
17212
|
-
safe(params) {
|
|
17213
|
-
return this.check(int(params));
|
|
17214
|
-
},
|
|
17215
|
-
positive(params) {
|
|
17216
|
-
return this.check(_gt(0, params));
|
|
17217
|
-
},
|
|
17218
|
-
nonnegative(params) {
|
|
17219
|
-
return this.check(_gte(0, params));
|
|
17220
|
-
},
|
|
17221
|
-
negative(params) {
|
|
17222
|
-
return this.check(_lt(0, params));
|
|
17223
|
-
},
|
|
17224
|
-
nonpositive(params) {
|
|
17225
|
-
return this.check(_lte(0, params));
|
|
17226
|
-
},
|
|
17227
|
-
multipleOf(value, params) {
|
|
17228
|
-
return this.check(_multipleOf(value, params));
|
|
17804
|
+
var ZodNumber = /* @__PURE__ */ $constructor(
|
|
17805
|
+
"ZodNumber",
|
|
17806
|
+
(inst, def) => {
|
|
17807
|
+
$ZodNumber.init(inst, def);
|
|
17808
|
+
ZodType.init(inst, def);
|
|
17809
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => numberProcessor(inst, ctx, json2, params);
|
|
17810
|
+
inst.isFinite = true;
|
|
17229
17811
|
},
|
|
17230
|
-
|
|
17231
|
-
|
|
17232
|
-
|
|
17233
|
-
|
|
17234
|
-
|
|
17235
|
-
|
|
17236
|
-
});
|
|
17812
|
+
/* @__PURE__ */ util_exports.derived({
|
|
17813
|
+
minValue: (inst) => {
|
|
17814
|
+
const { minimum, exclusiveMinimum } = aggregateChecks(inst);
|
|
17815
|
+
return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);
|
|
17816
|
+
},
|
|
17817
|
+
maxValue: (inst) => {
|
|
17818
|
+
const { maximum, exclusiveMaximum } = aggregateChecks(inst);
|
|
17819
|
+
return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);
|
|
17820
|
+
},
|
|
17821
|
+
isInt: (inst) => {
|
|
17822
|
+
const { isInt, multipleOf } = aggregateChecks(inst);
|
|
17823
|
+
return !!isInt || !!multipleOf?.some(Number.isSafeInteger);
|
|
17824
|
+
},
|
|
17825
|
+
format: (inst) => aggregateChecks(inst).format ?? null
|
|
17826
|
+
}, {
|
|
17827
|
+
gt(value, params) {
|
|
17828
|
+
return this.check(_gt(value, params));
|
|
17829
|
+
},
|
|
17830
|
+
gte(value, params) {
|
|
17831
|
+
return this.check(_gte(value, params));
|
|
17832
|
+
},
|
|
17833
|
+
min(value, params) {
|
|
17834
|
+
return this.check(_gte(value, params));
|
|
17835
|
+
},
|
|
17836
|
+
lt(value, params) {
|
|
17837
|
+
return this.check(_lt(value, params));
|
|
17838
|
+
},
|
|
17839
|
+
lte(value, params) {
|
|
17840
|
+
return this.check(_lte(value, params));
|
|
17841
|
+
},
|
|
17842
|
+
max(value, params) {
|
|
17843
|
+
return this.check(_lte(value, params));
|
|
17844
|
+
},
|
|
17845
|
+
int(params) {
|
|
17846
|
+
return this.check(int(params));
|
|
17847
|
+
},
|
|
17848
|
+
safe(params) {
|
|
17849
|
+
return this.check(int(params));
|
|
17850
|
+
},
|
|
17851
|
+
positive(params) {
|
|
17852
|
+
return this.check(_gt(0, params));
|
|
17853
|
+
},
|
|
17854
|
+
nonnegative(params) {
|
|
17855
|
+
return this.check(_gte(0, params));
|
|
17856
|
+
},
|
|
17857
|
+
negative(params) {
|
|
17858
|
+
return this.check(_lt(0, params));
|
|
17859
|
+
},
|
|
17860
|
+
nonpositive(params) {
|
|
17861
|
+
return this.check(_lte(0, params));
|
|
17862
|
+
},
|
|
17863
|
+
multipleOf(value, params) {
|
|
17864
|
+
return this.check(_multipleOf(value, params));
|
|
17865
|
+
},
|
|
17866
|
+
step(value, params) {
|
|
17867
|
+
return this.check(_multipleOf(value, params));
|
|
17868
|
+
},
|
|
17869
|
+
finite() {
|
|
17870
|
+
return this;
|
|
17871
|
+
}
|
|
17872
|
+
})
|
|
17873
|
+
);
|
|
17237
17874
|
function number2(params) {
|
|
17238
17875
|
return _number(ZodNumber, params);
|
|
17239
17876
|
}
|
|
@@ -17264,49 +17901,53 @@ var ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
|
|
|
17264
17901
|
function boolean2(params) {
|
|
17265
17902
|
return _boolean(ZodBoolean, params);
|
|
17266
17903
|
}
|
|
17267
|
-
var ZodBigInt = /* @__PURE__ */ $constructor(
|
|
17268
|
-
|
|
17269
|
-
|
|
17270
|
-
|
|
17271
|
-
|
|
17272
|
-
|
|
17273
|
-
inst.maxValue = bag.maximum ?? null;
|
|
17274
|
-
inst.format = bag.format ?? null;
|
|
17275
|
-
}, {
|
|
17276
|
-
gte(value, params) {
|
|
17277
|
-
return this.check(_gte(value, params));
|
|
17278
|
-
},
|
|
17279
|
-
min(value, params) {
|
|
17280
|
-
return this.check(_gte(value, params));
|
|
17904
|
+
var ZodBigInt = /* @__PURE__ */ $constructor(
|
|
17905
|
+
"ZodBigInt",
|
|
17906
|
+
(inst, def) => {
|
|
17907
|
+
$ZodBigInt.init(inst, def);
|
|
17908
|
+
ZodType.init(inst, def);
|
|
17909
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => bigintProcessor(inst, ctx, json2, params);
|
|
17281
17910
|
},
|
|
17282
|
-
|
|
17283
|
-
|
|
17284
|
-
|
|
17285
|
-
|
|
17286
|
-
|
|
17287
|
-
|
|
17288
|
-
|
|
17289
|
-
|
|
17290
|
-
|
|
17291
|
-
|
|
17292
|
-
|
|
17293
|
-
|
|
17294
|
-
|
|
17295
|
-
|
|
17296
|
-
|
|
17297
|
-
|
|
17298
|
-
|
|
17299
|
-
|
|
17300
|
-
|
|
17301
|
-
|
|
17302
|
-
|
|
17303
|
-
|
|
17304
|
-
|
|
17305
|
-
|
|
17306
|
-
|
|
17307
|
-
|
|
17308
|
-
|
|
17309
|
-
|
|
17911
|
+
/* @__PURE__ */ util_exports.derived({
|
|
17912
|
+
minValue: (inst) => aggregateChecks(inst).minimum ?? null,
|
|
17913
|
+
maxValue: (inst) => aggregateChecks(inst).maximum ?? null,
|
|
17914
|
+
format: (inst) => aggregateChecks(inst).format ?? null
|
|
17915
|
+
}, {
|
|
17916
|
+
gte(value, params) {
|
|
17917
|
+
return this.check(_gte(value, params));
|
|
17918
|
+
},
|
|
17919
|
+
min(value, params) {
|
|
17920
|
+
return this.check(_gte(value, params));
|
|
17921
|
+
},
|
|
17922
|
+
gt(value, params) {
|
|
17923
|
+
return this.check(_gt(value, params));
|
|
17924
|
+
},
|
|
17925
|
+
lt(value, params) {
|
|
17926
|
+
return this.check(_lt(value, params));
|
|
17927
|
+
},
|
|
17928
|
+
lte(value, params) {
|
|
17929
|
+
return this.check(_lte(value, params));
|
|
17930
|
+
},
|
|
17931
|
+
max(value, params) {
|
|
17932
|
+
return this.check(_lte(value, params));
|
|
17933
|
+
},
|
|
17934
|
+
positive(params) {
|
|
17935
|
+
return this.check(_gt(BigInt(0), params));
|
|
17936
|
+
},
|
|
17937
|
+
negative(params) {
|
|
17938
|
+
return this.check(_lt(BigInt(0), params));
|
|
17939
|
+
},
|
|
17940
|
+
nonpositive(params) {
|
|
17941
|
+
return this.check(_lte(BigInt(0), params));
|
|
17942
|
+
},
|
|
17943
|
+
nonnegative(params) {
|
|
17944
|
+
return this.check(_gte(BigInt(0), params));
|
|
17945
|
+
},
|
|
17946
|
+
multipleOf(value, params) {
|
|
17947
|
+
return this.check(_multipleOf(value, params));
|
|
17948
|
+
}
|
|
17949
|
+
})
|
|
17950
|
+
);
|
|
17310
17951
|
function bigint2(params) {
|
|
17311
17952
|
return _bigint(ZodBigInt, params);
|
|
17312
17953
|
}
|
|
@@ -17376,16 +18017,26 @@ var ZodVoid = /* @__PURE__ */ $constructor("ZodVoid", (inst, def) => {
|
|
|
17376
18017
|
function _void2(params) {
|
|
17377
18018
|
return _void(ZodVoid, params);
|
|
17378
18019
|
}
|
|
17379
|
-
var ZodDate = /* @__PURE__ */ $constructor(
|
|
17380
|
-
|
|
17381
|
-
|
|
17382
|
-
|
|
17383
|
-
|
|
17384
|
-
|
|
17385
|
-
|
|
17386
|
-
|
|
17387
|
-
|
|
17388
|
-
|
|
18020
|
+
var ZodDate = /* @__PURE__ */ $constructor(
|
|
18021
|
+
"ZodDate",
|
|
18022
|
+
(inst, def) => {
|
|
18023
|
+
$ZodDate.init(inst, def);
|
|
18024
|
+
ZodType.init(inst, def);
|
|
18025
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => dateProcessor(inst, ctx, json2, params);
|
|
18026
|
+
inst.min = (value, params) => inst.check(_gte(value, params));
|
|
18027
|
+
inst.max = (value, params) => inst.check(_lte(value, params));
|
|
18028
|
+
},
|
|
18029
|
+
/* @__PURE__ */ util_exports.derived({
|
|
18030
|
+
minDate: (inst) => {
|
|
18031
|
+
const { minimum } = aggregateChecks(inst);
|
|
18032
|
+
return minimum ? new Date(minimum) : null;
|
|
18033
|
+
},
|
|
18034
|
+
maxDate: (inst) => {
|
|
18035
|
+
const { maximum } = aggregateChecks(inst);
|
|
18036
|
+
return maximum ? new Date(maximum) : null;
|
|
18037
|
+
}
|
|
18038
|
+
}, {})
|
|
18039
|
+
);
|
|
17389
18040
|
function date2(params) {
|
|
17390
18041
|
return _date(ZodDate, params);
|
|
17391
18042
|
}
|
|
@@ -17430,19 +18081,19 @@ var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
|
|
|
17430
18081
|
return _enum2(Object.keys(this._zod.def.shape));
|
|
17431
18082
|
},
|
|
17432
18083
|
catchall(catchall) {
|
|
17433
|
-
return this.clone(
|
|
18084
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall }));
|
|
17434
18085
|
},
|
|
17435
18086
|
passthrough() {
|
|
17436
|
-
return this.clone(
|
|
18087
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
17437
18088
|
},
|
|
17438
18089
|
loose() {
|
|
17439
|
-
return this.clone(
|
|
18090
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
17440
18091
|
},
|
|
17441
18092
|
strict() {
|
|
17442
|
-
return this.clone(
|
|
18093
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall: never() }));
|
|
17443
18094
|
},
|
|
17444
18095
|
strip() {
|
|
17445
|
-
return this.clone(
|
|
18096
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall: void 0 }));
|
|
17446
18097
|
},
|
|
17447
18098
|
extend(incoming) {
|
|
17448
18099
|
return util_exports.extend(this, incoming);
|
|
@@ -17661,7 +18312,7 @@ var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
|
|
|
17661
18312
|
ZodType.init(inst, def);
|
|
17662
18313
|
inst._zod.processJSONSchema = (ctx, json2, params) => enumProcessor(inst, ctx, json2, params);
|
|
17663
18314
|
inst.enum = def.entries;
|
|
17664
|
-
inst.options =
|
|
18315
|
+
inst.options = [...inst._zod.values];
|
|
17665
18316
|
const keys = new Set(Object.keys(def.entries));
|
|
17666
18317
|
inst.extract = (values, params) => {
|
|
17667
18318
|
const newEntries = {};
|
|
@@ -18024,8 +18675,15 @@ function superRefine(fn, params) {
|
|
|
18024
18675
|
}
|
|
18025
18676
|
var describe2 = describe;
|
|
18026
18677
|
var meta2 = meta;
|
|
18678
|
+
var ZodInstanceOf = /* @__PURE__ */ $constructor("ZodInstanceOf", (inst, def) => {
|
|
18679
|
+
ZodCustom.init(inst, def);
|
|
18680
|
+
}, {
|
|
18681
|
+
properties(shape, params) {
|
|
18682
|
+
return this.check(_properties(shape, params));
|
|
18683
|
+
}
|
|
18684
|
+
});
|
|
18027
18685
|
function _instanceof(cls, params = {}) {
|
|
18028
|
-
const inst = new
|
|
18686
|
+
const inst = new ZodInstanceOf({
|
|
18029
18687
|
type: "custom",
|
|
18030
18688
|
check: "custom",
|
|
18031
18689
|
fn: (data) => data instanceof cls,
|
|
@@ -18230,27 +18888,188 @@ function resolveRef(ref, ctx) {
|
|
|
18230
18888
|
}
|
|
18231
18889
|
throw new Error(`Reference not found: ${ref}`);
|
|
18232
18890
|
}
|
|
18233
|
-
function
|
|
18891
|
+
function checkObjectGuards(objectSchema, guards) {
|
|
18234
18892
|
const guard = z.transform((value) => value).check((payload) => {
|
|
18235
18893
|
const value = payload.value;
|
|
18236
18894
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
18237
18895
|
return;
|
|
18238
|
-
|
|
18239
|
-
|
|
18240
|
-
if (result.success)
|
|
18241
|
-
continue;
|
|
18896
|
+
const keys = Object.getOwnPropertyNames(value);
|
|
18897
|
+
if (guards.minProperties !== void 0 && keys.length < guards.minProperties) {
|
|
18242
18898
|
payload.issues.push({
|
|
18243
|
-
|
|
18244
|
-
|
|
18245
|
-
|
|
18246
|
-
|
|
18247
|
-
|
|
18899
|
+
origin: "object",
|
|
18900
|
+
code: "too_small",
|
|
18901
|
+
minimum: guards.minProperties,
|
|
18902
|
+
inclusive: true,
|
|
18903
|
+
message: `Too small: expected object to have >=${guards.minProperties} properties`,
|
|
18904
|
+
input: value,
|
|
18905
|
+
inst: objectSchema,
|
|
18906
|
+
continue: true
|
|
18907
|
+
});
|
|
18908
|
+
}
|
|
18909
|
+
if (guards.maxProperties !== void 0 && keys.length > guards.maxProperties) {
|
|
18910
|
+
payload.issues.push({
|
|
18911
|
+
origin: "object",
|
|
18912
|
+
code: "too_big",
|
|
18913
|
+
maximum: guards.maxProperties,
|
|
18914
|
+
inclusive: true,
|
|
18915
|
+
message: `Too big: expected object to have <=${guards.maxProperties} properties`,
|
|
18916
|
+
input: value,
|
|
18917
|
+
inst: objectSchema,
|
|
18248
18918
|
continue: true
|
|
18249
18919
|
});
|
|
18250
18920
|
}
|
|
18921
|
+
if (guards.keySchema) {
|
|
18922
|
+
for (const key of keys) {
|
|
18923
|
+
const result = guards.keySchema.safeParse(key);
|
|
18924
|
+
if (result.success)
|
|
18925
|
+
continue;
|
|
18926
|
+
payload.issues.push({
|
|
18927
|
+
code: "invalid_key",
|
|
18928
|
+
origin: "record",
|
|
18929
|
+
issues: result.error.issues,
|
|
18930
|
+
input: key,
|
|
18931
|
+
path: [key],
|
|
18932
|
+
continue: true
|
|
18933
|
+
});
|
|
18934
|
+
}
|
|
18935
|
+
}
|
|
18251
18936
|
});
|
|
18252
18937
|
return guard.pipe(objectSchema);
|
|
18253
18938
|
}
|
|
18939
|
+
function canonicalKey(value, seen) {
|
|
18940
|
+
if (value === null)
|
|
18941
|
+
return "z";
|
|
18942
|
+
const type = typeof value;
|
|
18943
|
+
if (type !== "object") {
|
|
18944
|
+
if (type === "number" && Number.isNaN(value))
|
|
18945
|
+
return null;
|
|
18946
|
+
const raw = String(value);
|
|
18947
|
+
return `${type[0]}${raw.length}:${raw}`;
|
|
18948
|
+
}
|
|
18949
|
+
if (seen.has(value))
|
|
18950
|
+
return null;
|
|
18951
|
+
seen.add(value);
|
|
18952
|
+
try {
|
|
18953
|
+
if (Array.isArray(value)) {
|
|
18954
|
+
const parts2 = [];
|
|
18955
|
+
for (const item of value) {
|
|
18956
|
+
const key = canonicalKey(item, seen);
|
|
18957
|
+
if (key === null)
|
|
18958
|
+
return null;
|
|
18959
|
+
parts2.push(key);
|
|
18960
|
+
}
|
|
18961
|
+
return `a${parts2.length}:[${parts2.join(",")}]`;
|
|
18962
|
+
}
|
|
18963
|
+
const keys = Object.keys(value).sort();
|
|
18964
|
+
const parts = [];
|
|
18965
|
+
for (const k of keys) {
|
|
18966
|
+
const key = canonicalKey(value[k], seen);
|
|
18967
|
+
if (key === null)
|
|
18968
|
+
return null;
|
|
18969
|
+
parts.push(`${k.length}:${k}=${key}`);
|
|
18970
|
+
}
|
|
18971
|
+
return `o${parts.length}:{${parts.join(",")}}`;
|
|
18972
|
+
} finally {
|
|
18973
|
+
seen.delete(value);
|
|
18974
|
+
}
|
|
18975
|
+
}
|
|
18976
|
+
var SCHEMA_KEYWORDS = /* @__PURE__ */ new Set([
|
|
18977
|
+
"items",
|
|
18978
|
+
"prefixItems",
|
|
18979
|
+
"additionalItems",
|
|
18980
|
+
"additionalProperties",
|
|
18981
|
+
"contains",
|
|
18982
|
+
"propertyNames",
|
|
18983
|
+
"not",
|
|
18984
|
+
"if",
|
|
18985
|
+
"then",
|
|
18986
|
+
"else",
|
|
18987
|
+
"allOf",
|
|
18988
|
+
"anyOf",
|
|
18989
|
+
"oneOf",
|
|
18990
|
+
"unevaluatedItems",
|
|
18991
|
+
"unevaluatedProperties",
|
|
18992
|
+
"contentSchema"
|
|
18993
|
+
]);
|
|
18994
|
+
var SCHEMA_MAP_KEYWORDS = /* @__PURE__ */ new Set([
|
|
18995
|
+
"properties",
|
|
18996
|
+
"patternProperties",
|
|
18997
|
+
"dependentSchemas",
|
|
18998
|
+
"dependencies",
|
|
18999
|
+
"$defs",
|
|
19000
|
+
"definitions"
|
|
19001
|
+
]);
|
|
19002
|
+
function containsRef(value) {
|
|
19003
|
+
if (typeof value !== "object" || value === null)
|
|
19004
|
+
return false;
|
|
19005
|
+
if (Array.isArray(value))
|
|
19006
|
+
return value.some(containsRef);
|
|
19007
|
+
if (typeof value.$ref === "string")
|
|
19008
|
+
return true;
|
|
19009
|
+
return Object.entries(value).some(([key, sub]) => {
|
|
19010
|
+
if (SCHEMA_KEYWORDS.has(key))
|
|
19011
|
+
return containsRef(sub);
|
|
19012
|
+
if (!SCHEMA_MAP_KEYWORDS.has(key) || typeof sub !== "object" || sub === null)
|
|
19013
|
+
return false;
|
|
19014
|
+
return Object.values(sub).some(containsRef);
|
|
19015
|
+
});
|
|
19016
|
+
}
|
|
19017
|
+
function plural(n) {
|
|
19018
|
+
return n === 1 ? "element" : "elements";
|
|
19019
|
+
}
|
|
19020
|
+
function checkArrayGuards(arraySchema, guards) {
|
|
19021
|
+
const guard = z.transform((value) => value).check((payload) => {
|
|
19022
|
+
const items = payload.value;
|
|
19023
|
+
if (!Array.isArray(items))
|
|
19024
|
+
return;
|
|
19025
|
+
if (guards.uniqueItems === true) {
|
|
19026
|
+
const firstSeen = /* @__PURE__ */ new Map();
|
|
19027
|
+
for (let i = 0; i < items.length; i++) {
|
|
19028
|
+
const key = canonicalKey(items[i], /* @__PURE__ */ new Set());
|
|
19029
|
+
if (key === null)
|
|
19030
|
+
continue;
|
|
19031
|
+
const first = firstSeen.get(key);
|
|
19032
|
+
if (first === void 0) {
|
|
19033
|
+
firstSeen.set(key, i);
|
|
19034
|
+
continue;
|
|
19035
|
+
}
|
|
19036
|
+
payload.issues.push({
|
|
19037
|
+
code: "custom",
|
|
19038
|
+
message: `Array items must be unique: element at index ${i} duplicates the one at index ${first}`,
|
|
19039
|
+
input: items,
|
|
19040
|
+
path: [i],
|
|
19041
|
+
continue: true
|
|
19042
|
+
});
|
|
19043
|
+
}
|
|
19044
|
+
}
|
|
19045
|
+
if (guards.containsSchema) {
|
|
19046
|
+
const minContains = guards.minContains ?? 1;
|
|
19047
|
+
const ceiling = guards.maxContains !== void 0 ? guards.maxContains + 1 : Number.POSITIVE_INFINITY;
|
|
19048
|
+
let matches = 0;
|
|
19049
|
+
for (const item of items) {
|
|
19050
|
+
if (guards.containsSchema.safeParse(item).success && ++matches >= ceiling)
|
|
19051
|
+
break;
|
|
19052
|
+
}
|
|
19053
|
+
if (matches < minContains) {
|
|
19054
|
+
payload.issues.push({
|
|
19055
|
+
code: "custom",
|
|
19056
|
+
message: `Array must contain at least ${minContains} matching ${plural(minContains)}; found ${matches}`,
|
|
19057
|
+
input: items,
|
|
19058
|
+
continue: true
|
|
19059
|
+
});
|
|
19060
|
+
}
|
|
19061
|
+
if (guards.maxContains !== void 0 && matches > guards.maxContains) {
|
|
19062
|
+
payload.issues.push({
|
|
19063
|
+
code: "custom",
|
|
19064
|
+
message: `Array must contain at most ${guards.maxContains} matching ${plural(guards.maxContains)}`,
|
|
19065
|
+
input: items,
|
|
19066
|
+
continue: true
|
|
19067
|
+
});
|
|
19068
|
+
}
|
|
19069
|
+
}
|
|
19070
|
+
});
|
|
19071
|
+
return guard.pipe(arraySchema);
|
|
19072
|
+
}
|
|
18254
19073
|
function getTupleRest(restSchema, ctx) {
|
|
18255
19074
|
if (restSchema === false) {
|
|
18256
19075
|
return void 0;
|
|
@@ -18380,6 +19199,8 @@ function convertBaseSchema(schema, ctx) {
|
|
|
18380
19199
|
stringSchema = stringSchema.check(z.e164());
|
|
18381
19200
|
} else if (format === "credit_card") {
|
|
18382
19201
|
stringSchema = stringSchema.check(z.creditCard());
|
|
19202
|
+
} else if (format === "iban") {
|
|
19203
|
+
stringSchema = stringSchema.check(z.iban());
|
|
18383
19204
|
} else if (format === "jwt") {
|
|
18384
19205
|
stringSchema = stringSchema.check(z.jwt());
|
|
18385
19206
|
} else if (format === "emoji") {
|
|
@@ -18512,9 +19333,16 @@ function convertBaseSchema(schema, ctx) {
|
|
|
18512
19333
|
zodSchema = objectSchema.passthrough();
|
|
18513
19334
|
}
|
|
18514
19335
|
}
|
|
18515
|
-
|
|
18516
|
-
|
|
18517
|
-
|
|
19336
|
+
const hasKeyGuard = schema.propertyNames !== void 0 && schema.propertyNames !== true;
|
|
19337
|
+
const minProperties = typeof schema.minProperties === "number" ? schema.minProperties : void 0;
|
|
19338
|
+
const maxProperties = typeof schema.maxProperties === "number" ? schema.maxProperties : void 0;
|
|
19339
|
+
if (hasKeyGuard || minProperties !== void 0 || maxProperties !== void 0) {
|
|
19340
|
+
let keySchema;
|
|
19341
|
+
if (hasKeyGuard) {
|
|
19342
|
+
const keyJSONSchema = typeof schema.propertyNames === "object" && schema.propertyNames.type === void 0 ? { type: "string", ...schema.propertyNames } : schema.propertyNames;
|
|
19343
|
+
keySchema = convertSchema(keyJSONSchema, ctx);
|
|
19344
|
+
}
|
|
19345
|
+
zodSchema = checkObjectGuards(zodSchema, { keySchema, minProperties, maxProperties });
|
|
18518
19346
|
}
|
|
18519
19347
|
break;
|
|
18520
19348
|
}
|
|
@@ -18560,6 +19388,14 @@ function convertBaseSchema(schema, ctx) {
|
|
|
18560
19388
|
} else {
|
|
18561
19389
|
zodSchema = z.array(z.any());
|
|
18562
19390
|
}
|
|
19391
|
+
if (schema.uniqueItems === true || schema.contains !== void 0) {
|
|
19392
|
+
zodSchema = checkArrayGuards(zodSchema, {
|
|
19393
|
+
uniqueItems: schema.uniqueItems === true,
|
|
19394
|
+
containsSchema: schema.contains !== void 0 ? convertSchema(schema.contains, ctx) : void 0,
|
|
19395
|
+
minContains: typeof schema.minContains === "number" ? schema.minContains : void 0,
|
|
19396
|
+
maxContains: typeof schema.maxContains === "number" ? schema.maxContains : void 0
|
|
19397
|
+
});
|
|
19398
|
+
}
|
|
18563
19399
|
break;
|
|
18564
19400
|
}
|
|
18565
19401
|
default:
|
|
@@ -18617,8 +19453,23 @@ function convertSchema(schema, ctx) {
|
|
|
18617
19453
|
extraMeta[key] = schema[key];
|
|
18618
19454
|
}
|
|
18619
19455
|
}
|
|
18620
|
-
if (schema.
|
|
18621
|
-
|
|
19456
|
+
if (schema.type === "object" && schema.$ref === void 0) {
|
|
19457
|
+
if (schema.propertyNames !== void 0 && !containsRef(schema.propertyNames)) {
|
|
19458
|
+
extraMeta.propertyNames = schema.propertyNames;
|
|
19459
|
+
}
|
|
19460
|
+
for (const key of ["minProperties", "maxProperties"]) {
|
|
19461
|
+
if (schema[key] !== void 0)
|
|
19462
|
+
extraMeta[key] = schema[key];
|
|
19463
|
+
}
|
|
19464
|
+
}
|
|
19465
|
+
if (schema.type === "array" && schema.$ref === void 0) {
|
|
19466
|
+
if (schema.contains !== void 0 && !containsRef(schema.contains)) {
|
|
19467
|
+
extraMeta.contains = schema.contains;
|
|
19468
|
+
}
|
|
19469
|
+
for (const key of ["uniqueItems", "minContains", "maxContains"]) {
|
|
19470
|
+
if (schema[key] !== void 0)
|
|
19471
|
+
extraMeta[key] = schema[key];
|
|
19472
|
+
}
|
|
18622
19473
|
}
|
|
18623
19474
|
for (const key of Object.keys(schema)) {
|
|
18624
19475
|
if (!RECOGNIZED_KEYS.has(key)) {
|
|
@@ -18948,6 +19799,25 @@ var releaseRegistrationSchema = external_exports.object({
|
|
|
18948
19799
|
deployment: deploymentSchema
|
|
18949
19800
|
}).strict();
|
|
18950
19801
|
|
|
19802
|
+
// packages/protocol/src/event-metadata.ts
|
|
19803
|
+
var EVENT_METADATA_LIMITS = {
|
|
19804
|
+
userId: 128,
|
|
19805
|
+
tagName: 32,
|
|
19806
|
+
tagValue: 120,
|
|
19807
|
+
tags: 50,
|
|
19808
|
+
tagFilters: 5
|
|
19809
|
+
};
|
|
19810
|
+
var tagNameSchema = external_exports.string().regex(/^[a-zA-Z][a-zA-Z0-9_]{0,31}$/).refine(
|
|
19811
|
+
(value) => !["constructor", "prototype", "__proto__"].includes(value)
|
|
19812
|
+
);
|
|
19813
|
+
var allowedTagsSchema = external_exports.array(tagNameSchema).max(EVENT_METADATA_LIMITS.tags).transform((values) => [...new Set(values)]);
|
|
19814
|
+
var endUserIdSchema = external_exports.string().regex(/^[a-zA-Z0-9_-]{1,128}$/);
|
|
19815
|
+
var tagFilterSchema = external_exports.object({
|
|
19816
|
+
name: tagNameSchema,
|
|
19817
|
+
value: external_exports.string().max(EVENT_METADATA_LIMITS.tagValue),
|
|
19818
|
+
operator: external_exports.enum(["eq", "neq"]).optional()
|
|
19819
|
+
}).strict();
|
|
19820
|
+
|
|
18951
19821
|
// packages/protocol/src/diagnostics.ts
|
|
18952
19822
|
var API_REASONS = [
|
|
18953
19823
|
"network_error",
|
|
@@ -19064,6 +19934,7 @@ var safeEventSchema = external_exports.object({
|
|
|
19064
19934
|
message: external_exports.string().max(1024),
|
|
19065
19935
|
exceptionType: external_exports.string().max(120),
|
|
19066
19936
|
handled: external_exports.boolean(),
|
|
19937
|
+
endUserId: endUserIdSchema.optional(),
|
|
19067
19938
|
environment: environmentNameSchema,
|
|
19068
19939
|
release: external_exports.string().max(160).optional(),
|
|
19069
19940
|
appVersion: appVersionSchema.optional(),
|
|
@@ -19072,7 +19943,7 @@ var safeEventSchema = external_exports.object({
|
|
|
19072
19943
|
api: apiContextSchema.optional(),
|
|
19073
19944
|
browser: browserContextSchema.optional(),
|
|
19074
19945
|
frames: external_exports.array(safeFrameSchema).max(100),
|
|
19075
|
-
tags: external_exports.record(external_exports.string().max(
|
|
19946
|
+
tags: external_exports.record(tagNameSchema, external_exports.string().max(EVENT_METADATA_LIMITS.tagValue)).refine((tags) => Object.keys(tags).length <= EVENT_METADATA_LIMITS.tags),
|
|
19076
19947
|
breadcrumbs: external_exports.array(safeBreadcrumbSchema).max(50)
|
|
19077
19948
|
}).strict();
|
|
19078
19949
|
|
|
@@ -19497,19 +20368,19 @@ var CliError = class extends Error {
|
|
|
19497
20368
|
httpStatus;
|
|
19498
20369
|
requestId;
|
|
19499
20370
|
};
|
|
19500
|
-
function formatDiagnostic(
|
|
20371
|
+
function formatDiagnostic(error62) {
|
|
19501
20372
|
const safe = diagnosticSchema.safeParse({
|
|
19502
20373
|
version: 1,
|
|
19503
|
-
code:
|
|
19504
|
-
...
|
|
20374
|
+
code: error62 instanceof CliError ? error62.code : "COMMAND_FAILED",
|
|
20375
|
+
...error62 instanceof CliError ? { httpStatus: error62.httpStatus, requestId: error62.requestId } : {}
|
|
19505
20376
|
});
|
|
19506
20377
|
return `GETEXCEPTION_DIAGNOSTIC ${JSON.stringify(
|
|
19507
20378
|
safe.success ? safe.data : { version: 1, code: "COMMAND_FAILED" }
|
|
19508
20379
|
)}
|
|
19509
20380
|
`;
|
|
19510
20381
|
}
|
|
19511
|
-
function networkError(
|
|
19512
|
-
let current =
|
|
20382
|
+
function networkError(error62, httpStatus) {
|
|
20383
|
+
let current = error62;
|
|
19513
20384
|
for (let depth = 0; depth < 4 && current instanceof Error; depth++) {
|
|
19514
20385
|
const candidate = current.code;
|
|
19515
20386
|
const code = typeof candidate === "string" ? candidate : "";
|
|
@@ -19597,8 +20468,8 @@ async function responseJson(response) {
|
|
|
19597
20468
|
}
|
|
19598
20469
|
chunks.push(value);
|
|
19599
20470
|
}
|
|
19600
|
-
} catch (
|
|
19601
|
-
throw
|
|
20471
|
+
} catch (error62) {
|
|
20472
|
+
throw error62 instanceof CliError ? error62 : networkError(error62, response.status);
|
|
19602
20473
|
} finally {
|
|
19603
20474
|
reader.releaseLock();
|
|
19604
20475
|
}
|
|
@@ -19641,13 +20512,13 @@ async function httpError(response) {
|
|
|
19641
20512
|
}
|
|
19642
20513
|
|
|
19643
20514
|
// packages/cli/src/api.ts
|
|
19644
|
-
function retryableNetworkError(
|
|
20515
|
+
function retryableNetworkError(error62) {
|
|
19645
20516
|
return [
|
|
19646
20517
|
"NETWORK_DNS",
|
|
19647
20518
|
"NETWORK_CONNECTION",
|
|
19648
20519
|
"NETWORK_TIMEOUT",
|
|
19649
20520
|
"NETWORK_ERROR"
|
|
19650
|
-
].includes(
|
|
20521
|
+
].includes(error62.code);
|
|
19651
20522
|
}
|
|
19652
20523
|
function projectApi(address, project, token, transport = fetch, options = {}) {
|
|
19653
20524
|
let url2;
|
|
@@ -19693,9 +20564,9 @@ function projectApi(address, project, token, transport = fetch, options = {}) {
|
|
|
19693
20564
|
...options.signal ? [options.signal] : []
|
|
19694
20565
|
])
|
|
19695
20566
|
});
|
|
19696
|
-
} catch (
|
|
19697
|
-
const
|
|
19698
|
-
if (retryableNetworkError(
|
|
20567
|
+
} catch (error62) {
|
|
20568
|
+
const failure2 = networkError(error62);
|
|
20569
|
+
if (retryableNetworkError(failure2) && attempt < 2) {
|
|
19699
20570
|
await delay(
|
|
19700
20571
|
Math.min(1e3 * 2 ** attempt, Math.max(1, deadline - Date.now())),
|
|
19701
20572
|
void 0,
|
|
@@ -19703,7 +20574,7 @@ function projectApi(address, project, token, transport = fetch, options = {}) {
|
|
|
19703
20574
|
);
|
|
19704
20575
|
continue;
|
|
19705
20576
|
}
|
|
19706
|
-
throw
|
|
20577
|
+
throw failure2;
|
|
19707
20578
|
}
|
|
19708
20579
|
if (response.ok) {
|
|
19709
20580
|
return responseJson(response);
|
|
@@ -19832,9 +20703,9 @@ async function prepareSourceMaps(options) {
|
|
|
19832
20703
|
release: options.release,
|
|
19833
20704
|
buildId: options.buildId
|
|
19834
20705
|
};
|
|
19835
|
-
} catch (
|
|
20706
|
+
} catch (error62) {
|
|
19836
20707
|
await rm2(output2, { recursive: true, force: true });
|
|
19837
|
-
throw
|
|
20708
|
+
throw error62;
|
|
19838
20709
|
}
|
|
19839
20710
|
}
|
|
19840
20711
|
async function uploadSourceMaps(options, transport = fetch) {
|
|
@@ -19880,10 +20751,10 @@ async function uploadSourceMaps(options, transport = fetch) {
|
|
|
19880
20751
|
);
|
|
19881
20752
|
}
|
|
19882
20753
|
return { status: "ready", batches: batches.length };
|
|
19883
|
-
} catch (
|
|
20754
|
+
} catch (error62) {
|
|
19884
20755
|
return {
|
|
19885
20756
|
status: "unavailable",
|
|
19886
|
-
diagnostic: formatDiagnostic(
|
|
20757
|
+
diagnostic: formatDiagnostic(error62).trim()
|
|
19887
20758
|
};
|
|
19888
20759
|
}
|
|
19889
20760
|
}
|
|
@@ -20037,7 +20908,7 @@ async function main() {
|
|
|
20037
20908
|
throw new Error("Invalid command");
|
|
20038
20909
|
}
|
|
20039
20910
|
}
|
|
20040
|
-
void main().catch((
|
|
20041
|
-
process.stderr.write(formatDiagnostic(
|
|
20911
|
+
void main().catch((error62) => {
|
|
20912
|
+
process.stderr.write(formatDiagnostic(error62));
|
|
20042
20913
|
process.exitCode = 1;
|
|
20043
20914
|
});
|