dsh-budget 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.es.md +1 -0
- package/README.hi.md +1 -0
- package/README.md +1 -0
- package/README.pt.md +1 -0
- package/README.zh.md +1 -0
- package/cordis.patch.yml +7 -0
- package/lib/index.js +7058 -174
- package/lib/rolldown-runtime-D7D4PA-g.js +13 -0
- package/lib/typert.host.js +1 -1
- package/lib/types/aggregate/usage.d.ts +31 -0
- package/lib/types/aggregate/usage.d.ts.map +1 -1
- package/lib/types/config.d.ts +13 -0
- package/lib/types/config.d.ts.map +1 -1
- package/lib/types/index.d.ts +7 -3
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/store.d.ts +62 -0
- package/lib/types/store.d.ts.map +1 -0
- package/lib/{wire-Bq5J-SHv.js → wire-zYaXk7IG.js} +2858 -74
- package/package.json +3 -1
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
1
2
|
//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
|
|
2
3
|
var _a$1;
|
|
4
|
+
/** A special constant with type `never` */
|
|
5
|
+
const NEVER = /*@__PURE__*/ Object.freeze({ status: "aborted" });
|
|
3
6
|
function $constructor(name, initializer, params) {
|
|
4
7
|
function init(inst, def) {
|
|
5
8
|
if (!inst._zod) Object.defineProperty(inst, "_zod", {
|
|
@@ -39,6 +42,7 @@ function $constructor(name, initializer, params) {
|
|
|
39
42
|
Object.defineProperty(_, "name", { value: name });
|
|
40
43
|
return _;
|
|
41
44
|
}
|
|
45
|
+
const $brand = Symbol("zod_brand");
|
|
42
46
|
var $ZodAsyncError = class extends Error {
|
|
43
47
|
constructor() {
|
|
44
48
|
super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
|
|
@@ -58,10 +62,89 @@ function config(newConfig) {
|
|
|
58
62
|
}
|
|
59
63
|
//#endregion
|
|
60
64
|
//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js
|
|
65
|
+
var util_exports = /* @__PURE__ */ __exportAll({
|
|
66
|
+
BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
|
|
67
|
+
Class: () => Class,
|
|
68
|
+
NUMBER_FORMAT_RANGES: () => NUMBER_FORMAT_RANGES,
|
|
69
|
+
aborted: () => aborted,
|
|
70
|
+
allowsEval: () => allowsEval,
|
|
71
|
+
assert: () => assert,
|
|
72
|
+
assertEqual: () => assertEqual,
|
|
73
|
+
assertIs: () => assertIs,
|
|
74
|
+
assertNever: () => assertNever,
|
|
75
|
+
assertNotEqual: () => assertNotEqual,
|
|
76
|
+
assignProp: () => assignProp,
|
|
77
|
+
base64ToUint8Array: () => base64ToUint8Array,
|
|
78
|
+
base64urlToUint8Array: () => base64urlToUint8Array,
|
|
79
|
+
cached: () => cached,
|
|
80
|
+
captureStackTrace: () => captureStackTrace,
|
|
81
|
+
cleanEnum: () => cleanEnum,
|
|
82
|
+
cleanRegex: () => cleanRegex,
|
|
83
|
+
clone: () => clone,
|
|
84
|
+
cloneDef: () => cloneDef,
|
|
85
|
+
createTransparentProxy: () => createTransparentProxy,
|
|
86
|
+
defineLazy: () => defineLazy,
|
|
87
|
+
esc: () => esc,
|
|
88
|
+
escapeRegex: () => escapeRegex,
|
|
89
|
+
explicitlyAborted: () => explicitlyAborted,
|
|
90
|
+
extend: () => extend,
|
|
91
|
+
finalizeIssue: () => finalizeIssue,
|
|
92
|
+
floatSafeRemainder: () => floatSafeRemainder,
|
|
93
|
+
getElementAtPath: () => getElementAtPath,
|
|
94
|
+
getEnumValues: () => getEnumValues,
|
|
95
|
+
getLengthableOrigin: () => getLengthableOrigin,
|
|
96
|
+
getParsedType: () => getParsedType,
|
|
97
|
+
getSizableOrigin: () => getSizableOrigin,
|
|
98
|
+
hexToUint8Array: () => hexToUint8Array,
|
|
99
|
+
isObject: () => isObject,
|
|
100
|
+
isPlainObject: () => isPlainObject,
|
|
101
|
+
issue: () => issue,
|
|
102
|
+
joinValues: () => joinValues,
|
|
103
|
+
jsonStringifyReplacer: () => jsonStringifyReplacer,
|
|
104
|
+
merge: () => merge,
|
|
105
|
+
mergeDefs: () => mergeDefs,
|
|
106
|
+
normalizeParams: () => normalizeParams,
|
|
107
|
+
nullish: () => nullish$1,
|
|
108
|
+
numKeys: () => numKeys,
|
|
109
|
+
objectClone: () => objectClone,
|
|
110
|
+
omit: () => omit,
|
|
111
|
+
optionalKeys: () => optionalKeys,
|
|
112
|
+
parsedType: () => parsedType,
|
|
113
|
+
partial: () => partial,
|
|
114
|
+
pick: () => pick,
|
|
115
|
+
prefixIssues: () => prefixIssues,
|
|
116
|
+
primitiveTypes: () => primitiveTypes,
|
|
117
|
+
promiseAllObject: () => promiseAllObject,
|
|
118
|
+
propertyKeyTypes: () => propertyKeyTypes,
|
|
119
|
+
randomString: () => randomString,
|
|
120
|
+
required: () => required,
|
|
121
|
+
safeExtend: () => safeExtend,
|
|
122
|
+
shallowClone: () => shallowClone,
|
|
123
|
+
slugify: () => slugify,
|
|
124
|
+
stringifyPrimitive: () => stringifyPrimitive,
|
|
125
|
+
uint8ArrayToBase64: () => uint8ArrayToBase64,
|
|
126
|
+
uint8ArrayToBase64url: () => uint8ArrayToBase64url,
|
|
127
|
+
uint8ArrayToHex: () => uint8ArrayToHex,
|
|
128
|
+
unwrapMessage: () => unwrapMessage
|
|
129
|
+
});
|
|
130
|
+
function assertEqual(val) {
|
|
131
|
+
return val;
|
|
132
|
+
}
|
|
133
|
+
function assertNotEqual(val) {
|
|
134
|
+
return val;
|
|
135
|
+
}
|
|
136
|
+
function assertIs(_arg) {}
|
|
137
|
+
function assertNever(_x) {
|
|
138
|
+
throw new Error("Unexpected value in exhaustive check");
|
|
139
|
+
}
|
|
140
|
+
function assert(_) {}
|
|
61
141
|
function getEnumValues(entries) {
|
|
62
142
|
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
63
143
|
return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
64
144
|
}
|
|
145
|
+
function joinValues(array, separator = "|") {
|
|
146
|
+
return array.map((val) => stringifyPrimitive(val)).join(separator);
|
|
147
|
+
}
|
|
65
148
|
function jsonStringifyReplacer(_, value) {
|
|
66
149
|
if (typeof value === "bigint") return value.toString();
|
|
67
150
|
return value;
|
|
@@ -75,7 +158,7 @@ function cached(getter) {
|
|
|
75
158
|
}
|
|
76
159
|
} };
|
|
77
160
|
}
|
|
78
|
-
function nullish(input) {
|
|
161
|
+
function nullish$1(input) {
|
|
79
162
|
return input === null || input === void 0;
|
|
80
163
|
}
|
|
81
164
|
function cleanRegex(source) {
|
|
@@ -108,6 +191,9 @@ function defineLazy(object, key, getter) {
|
|
|
108
191
|
configurable: true
|
|
109
192
|
});
|
|
110
193
|
}
|
|
194
|
+
function objectClone(obj) {
|
|
195
|
+
return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));
|
|
196
|
+
}
|
|
111
197
|
function assignProp(target, prop, value) {
|
|
112
198
|
Object.defineProperty(target, prop, {
|
|
113
199
|
value,
|
|
@@ -124,6 +210,28 @@ function mergeDefs(...defs) {
|
|
|
124
210
|
}
|
|
125
211
|
return Object.defineProperties({}, mergedDescriptors);
|
|
126
212
|
}
|
|
213
|
+
function cloneDef(schema) {
|
|
214
|
+
return mergeDefs(schema._zod.def);
|
|
215
|
+
}
|
|
216
|
+
function getElementAtPath(obj, path) {
|
|
217
|
+
if (!path) return obj;
|
|
218
|
+
return path.reduce((acc, key) => acc?.[key], obj);
|
|
219
|
+
}
|
|
220
|
+
function promiseAllObject(promisesObj) {
|
|
221
|
+
const keys = Object.keys(promisesObj);
|
|
222
|
+
const promises = keys.map((key) => promisesObj[key]);
|
|
223
|
+
return Promise.all(promises).then((results) => {
|
|
224
|
+
const resolvedObj = {};
|
|
225
|
+
for (let i = 0; i < keys.length; i++) resolvedObj[keys[i]] = results[i];
|
|
226
|
+
return resolvedObj;
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
function randomString(length = 10) {
|
|
230
|
+
const chars = "abcdefghijklmnopqrstuvwxyz";
|
|
231
|
+
let str = "";
|
|
232
|
+
for (let i = 0; i < length; i++) str += chars[Math.floor(Math.random() * 26)];
|
|
233
|
+
return str;
|
|
234
|
+
}
|
|
127
235
|
function esc(str) {
|
|
128
236
|
return JSON.stringify(str);
|
|
129
237
|
}
|
|
@@ -161,11 +269,46 @@ function shallowClone(o) {
|
|
|
161
269
|
if (o instanceof Set) return new Set(o);
|
|
162
270
|
return o;
|
|
163
271
|
}
|
|
272
|
+
function numKeys(data) {
|
|
273
|
+
let keyCount = 0;
|
|
274
|
+
for (const key in data) if (Object.prototype.hasOwnProperty.call(data, key)) keyCount++;
|
|
275
|
+
return keyCount;
|
|
276
|
+
}
|
|
277
|
+
const getParsedType = (data) => {
|
|
278
|
+
const t = typeof data;
|
|
279
|
+
switch (t) {
|
|
280
|
+
case "undefined": return "undefined";
|
|
281
|
+
case "string": return "string";
|
|
282
|
+
case "number": return Number.isNaN(data) ? "nan" : "number";
|
|
283
|
+
case "boolean": return "boolean";
|
|
284
|
+
case "function": return "function";
|
|
285
|
+
case "bigint": return "bigint";
|
|
286
|
+
case "symbol": return "symbol";
|
|
287
|
+
case "object":
|
|
288
|
+
if (Array.isArray(data)) return "array";
|
|
289
|
+
if (data === null) return "null";
|
|
290
|
+
if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") return "promise";
|
|
291
|
+
if (typeof Map !== "undefined" && data instanceof Map) return "map";
|
|
292
|
+
if (typeof Set !== "undefined" && data instanceof Set) return "set";
|
|
293
|
+
if (typeof Date !== "undefined" && data instanceof Date) return "date";
|
|
294
|
+
if (typeof File !== "undefined" && data instanceof File) return "file";
|
|
295
|
+
return "object";
|
|
296
|
+
default: throw new Error(`Unknown data type: ${t}`);
|
|
297
|
+
}
|
|
298
|
+
};
|
|
164
299
|
const propertyKeyTypes = /* @__PURE__*/ new Set([
|
|
165
300
|
"string",
|
|
166
301
|
"number",
|
|
167
302
|
"symbol"
|
|
168
303
|
]);
|
|
304
|
+
const primitiveTypes = /* @__PURE__*/ new Set([
|
|
305
|
+
"string",
|
|
306
|
+
"number",
|
|
307
|
+
"bigint",
|
|
308
|
+
"boolean",
|
|
309
|
+
"symbol",
|
|
310
|
+
"undefined"
|
|
311
|
+
]);
|
|
169
312
|
function escapeRegex(str) {
|
|
170
313
|
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
171
314
|
}
|
|
@@ -189,6 +332,44 @@ function normalizeParams(_params) {
|
|
|
189
332
|
};
|
|
190
333
|
return params;
|
|
191
334
|
}
|
|
335
|
+
function createTransparentProxy(getter) {
|
|
336
|
+
let target;
|
|
337
|
+
return new Proxy({}, {
|
|
338
|
+
get(_, prop, receiver) {
|
|
339
|
+
target ?? (target = getter());
|
|
340
|
+
return Reflect.get(target, prop, receiver);
|
|
341
|
+
},
|
|
342
|
+
set(_, prop, value, receiver) {
|
|
343
|
+
target ?? (target = getter());
|
|
344
|
+
return Reflect.set(target, prop, value, receiver);
|
|
345
|
+
},
|
|
346
|
+
has(_, prop) {
|
|
347
|
+
target ?? (target = getter());
|
|
348
|
+
return Reflect.has(target, prop);
|
|
349
|
+
},
|
|
350
|
+
deleteProperty(_, prop) {
|
|
351
|
+
target ?? (target = getter());
|
|
352
|
+
return Reflect.deleteProperty(target, prop);
|
|
353
|
+
},
|
|
354
|
+
ownKeys(_) {
|
|
355
|
+
target ?? (target = getter());
|
|
356
|
+
return Reflect.ownKeys(target);
|
|
357
|
+
},
|
|
358
|
+
getOwnPropertyDescriptor(_, prop) {
|
|
359
|
+
target ?? (target = getter());
|
|
360
|
+
return Reflect.getOwnPropertyDescriptor(target, prop);
|
|
361
|
+
},
|
|
362
|
+
defineProperty(_, prop, descriptor) {
|
|
363
|
+
target ?? (target = getter());
|
|
364
|
+
return Reflect.defineProperty(target, prop, descriptor);
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
function stringifyPrimitive(value) {
|
|
369
|
+
if (typeof value === "bigint") return value.toString() + "n";
|
|
370
|
+
if (typeof value === "string") return `"${value}"`;
|
|
371
|
+
return `${value}`;
|
|
372
|
+
}
|
|
192
373
|
function optionalKeys(shape) {
|
|
193
374
|
return Object.keys(shape).filter((k) => {
|
|
194
375
|
return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
|
|
@@ -201,6 +382,10 @@ const NUMBER_FORMAT_RANGES = {
|
|
|
201
382
|
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
202
383
|
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
203
384
|
};
|
|
385
|
+
const BIGINT_FORMAT_RANGES = {
|
|
386
|
+
int64: [/* @__PURE__*/ BigInt("-9223372036854775808"), /* @__PURE__*/ BigInt("9223372036854775807")],
|
|
387
|
+
uint64: [/* @__PURE__*/ BigInt(0), /* @__PURE__*/ BigInt("18446744073709551615")]
|
|
388
|
+
};
|
|
204
389
|
function pick(schema, mask) {
|
|
205
390
|
const currDef = schema._zod.def;
|
|
206
391
|
const checks = currDef.checks;
|
|
@@ -355,11 +540,30 @@ function finalizeIssue(iss, ctx, config) {
|
|
|
355
540
|
if (ctx?.reportInput) rest.input = _input;
|
|
356
541
|
return rest;
|
|
357
542
|
}
|
|
543
|
+
function getSizableOrigin(input) {
|
|
544
|
+
if (input instanceof Set) return "set";
|
|
545
|
+
if (input instanceof Map) return "map";
|
|
546
|
+
if (input instanceof File) return "file";
|
|
547
|
+
return "unknown";
|
|
548
|
+
}
|
|
358
549
|
function getLengthableOrigin(input) {
|
|
359
550
|
if (Array.isArray(input)) return "array";
|
|
360
551
|
if (typeof input === "string") return "string";
|
|
361
552
|
return "unknown";
|
|
362
553
|
}
|
|
554
|
+
function parsedType(data) {
|
|
555
|
+
const t = typeof data;
|
|
556
|
+
switch (t) {
|
|
557
|
+
case "number": return Number.isNaN(data) ? "nan" : "number";
|
|
558
|
+
case "object": {
|
|
559
|
+
if (data === null) return "null";
|
|
560
|
+
if (Array.isArray(data)) return "array";
|
|
561
|
+
const obj = data;
|
|
562
|
+
if (obj && Object.getPrototypeOf(obj) !== Object.prototype && "constructor" in obj && obj.constructor) return obj.constructor.name;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
return t;
|
|
566
|
+
}
|
|
363
567
|
function issue(...args) {
|
|
364
568
|
const [iss, input, inst] = args;
|
|
365
569
|
if (typeof iss === "string") return {
|
|
@@ -370,6 +574,42 @@ function issue(...args) {
|
|
|
370
574
|
};
|
|
371
575
|
return { ...iss };
|
|
372
576
|
}
|
|
577
|
+
function cleanEnum(obj) {
|
|
578
|
+
return Object.entries(obj).filter(([k, _]) => {
|
|
579
|
+
return Number.isNaN(Number.parseInt(k, 10));
|
|
580
|
+
}).map((el) => el[1]);
|
|
581
|
+
}
|
|
582
|
+
function base64ToUint8Array(base64) {
|
|
583
|
+
const binaryString = atob(base64);
|
|
584
|
+
const bytes = new Uint8Array(binaryString.length);
|
|
585
|
+
for (let i = 0; i < binaryString.length; i++) bytes[i] = binaryString.charCodeAt(i);
|
|
586
|
+
return bytes;
|
|
587
|
+
}
|
|
588
|
+
function uint8ArrayToBase64(bytes) {
|
|
589
|
+
let binaryString = "";
|
|
590
|
+
for (let i = 0; i < bytes.length; i++) binaryString += String.fromCharCode(bytes[i]);
|
|
591
|
+
return btoa(binaryString);
|
|
592
|
+
}
|
|
593
|
+
function base64urlToUint8Array(base64url) {
|
|
594
|
+
const base64 = base64url.replace(/-/g, "+").replace(/_/g, "/");
|
|
595
|
+
return base64ToUint8Array(base64 + "=".repeat((4 - base64.length % 4) % 4));
|
|
596
|
+
}
|
|
597
|
+
function uint8ArrayToBase64url(bytes) {
|
|
598
|
+
return uint8ArrayToBase64(bytes).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
599
|
+
}
|
|
600
|
+
function hexToUint8Array(hex) {
|
|
601
|
+
const cleanHex = hex.replace(/^0x/, "");
|
|
602
|
+
if (cleanHex.length % 2 !== 0) throw new Error("Invalid hex string length");
|
|
603
|
+
const bytes = new Uint8Array(cleanHex.length / 2);
|
|
604
|
+
for (let i = 0; i < cleanHex.length; i += 2) bytes[i / 2] = Number.parseInt(cleanHex.slice(i, i + 2), 16);
|
|
605
|
+
return bytes;
|
|
606
|
+
}
|
|
607
|
+
function uint8ArrayToHex(bytes) {
|
|
608
|
+
return Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
609
|
+
}
|
|
610
|
+
var Class = class {
|
|
611
|
+
constructor(..._args) {}
|
|
612
|
+
};
|
|
373
613
|
//#endregion
|
|
374
614
|
//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.js
|
|
375
615
|
const initializer$1 = (inst, def) => {
|
|
@@ -430,6 +670,94 @@ function formatError(error, mapper = (issue) => issue.message) {
|
|
|
430
670
|
processError(error);
|
|
431
671
|
return fieldErrors;
|
|
432
672
|
}
|
|
673
|
+
function treeifyError(error, mapper = (issue) => issue.message) {
|
|
674
|
+
const result = { errors: [] };
|
|
675
|
+
const processError = (error, path = []) => {
|
|
676
|
+
var _a, _b;
|
|
677
|
+
for (const issue of error.issues) if (issue.code === "invalid_union" && issue.errors.length) issue.errors.map((issues) => processError({ issues }, [...path, ...issue.path]));
|
|
678
|
+
else if (issue.code === "invalid_key") processError({ issues: issue.issues }, [...path, ...issue.path]);
|
|
679
|
+
else if (issue.code === "invalid_element") processError({ issues: issue.issues }, [...path, ...issue.path]);
|
|
680
|
+
else {
|
|
681
|
+
const fullpath = [...path, ...issue.path];
|
|
682
|
+
if (fullpath.length === 0) {
|
|
683
|
+
result.errors.push(mapper(issue));
|
|
684
|
+
continue;
|
|
685
|
+
}
|
|
686
|
+
let curr = result;
|
|
687
|
+
let i = 0;
|
|
688
|
+
while (i < fullpath.length) {
|
|
689
|
+
const el = fullpath[i];
|
|
690
|
+
const terminal = i === fullpath.length - 1;
|
|
691
|
+
if (typeof el === "string") {
|
|
692
|
+
curr.properties ?? (curr.properties = {});
|
|
693
|
+
(_a = curr.properties)[el] ?? (_a[el] = { errors: [] });
|
|
694
|
+
curr = curr.properties[el];
|
|
695
|
+
} else {
|
|
696
|
+
curr.items ?? (curr.items = []);
|
|
697
|
+
(_b = curr.items)[el] ?? (_b[el] = { errors: [] });
|
|
698
|
+
curr = curr.items[el];
|
|
699
|
+
}
|
|
700
|
+
if (terminal) curr.errors.push(mapper(issue));
|
|
701
|
+
i++;
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
};
|
|
705
|
+
processError(error);
|
|
706
|
+
return result;
|
|
707
|
+
}
|
|
708
|
+
/** Format a ZodError as a human-readable string in the following form.
|
|
709
|
+
*
|
|
710
|
+
* From
|
|
711
|
+
*
|
|
712
|
+
* ```ts
|
|
713
|
+
* ZodError {
|
|
714
|
+
* issues: [
|
|
715
|
+
* {
|
|
716
|
+
* expected: 'string',
|
|
717
|
+
* code: 'invalid_type',
|
|
718
|
+
* path: [ 'username' ],
|
|
719
|
+
* message: 'Invalid input: expected string'
|
|
720
|
+
* },
|
|
721
|
+
* {
|
|
722
|
+
* expected: 'number',
|
|
723
|
+
* code: 'invalid_type',
|
|
724
|
+
* path: [ 'favoriteNumbers', 1 ],
|
|
725
|
+
* message: 'Invalid input: expected number'
|
|
726
|
+
* }
|
|
727
|
+
* ];
|
|
728
|
+
* }
|
|
729
|
+
* ```
|
|
730
|
+
*
|
|
731
|
+
* to
|
|
732
|
+
*
|
|
733
|
+
* ```
|
|
734
|
+
* username
|
|
735
|
+
* ✖ Expected number, received string at "username
|
|
736
|
+
* favoriteNumbers[0]
|
|
737
|
+
* ✖ Invalid input: expected number
|
|
738
|
+
* ```
|
|
739
|
+
*/
|
|
740
|
+
function toDotPath(_path) {
|
|
741
|
+
const segs = [];
|
|
742
|
+
const path = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
743
|
+
for (const seg of path) if (typeof seg === "number") segs.push(`[${seg}]`);
|
|
744
|
+
else if (typeof seg === "symbol") segs.push(`[${JSON.stringify(String(seg))}]`);
|
|
745
|
+
else if (/[^\w$]/.test(seg)) segs.push(`[${JSON.stringify(seg)}]`);
|
|
746
|
+
else {
|
|
747
|
+
if (segs.length) segs.push(".");
|
|
748
|
+
segs.push(seg);
|
|
749
|
+
}
|
|
750
|
+
return segs.join("");
|
|
751
|
+
}
|
|
752
|
+
function prettifyError(error) {
|
|
753
|
+
const lines = [];
|
|
754
|
+
const issues = [...error.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);
|
|
755
|
+
for (const issue of issues) {
|
|
756
|
+
lines.push(`✖ ${issue.message}`);
|
|
757
|
+
if (issue.path?.length) lines.push(` → at ${toDotPath(issue.path)}`);
|
|
758
|
+
}
|
|
759
|
+
return lines.join("\n");
|
|
760
|
+
}
|
|
433
761
|
//#endregion
|
|
434
762
|
//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/parse.js
|
|
435
763
|
const _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
@@ -449,6 +777,7 @@ const _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
|
449
777
|
}
|
|
450
778
|
return result.value;
|
|
451
779
|
};
|
|
780
|
+
const parse$1 = /* @__PURE__*/ _parse($ZodRealError);
|
|
452
781
|
const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
|
|
453
782
|
const ctx = _ctx ? {
|
|
454
783
|
..._ctx,
|
|
@@ -466,6 +795,7 @@ const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
|
|
|
466
795
|
}
|
|
467
796
|
return result.value;
|
|
468
797
|
};
|
|
798
|
+
const parseAsync$1 = /* @__PURE__*/ _parseAsync($ZodRealError);
|
|
469
799
|
const _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
470
800
|
const ctx = _ctx ? {
|
|
471
801
|
..._ctx,
|
|
@@ -511,9 +841,11 @@ const _encode = (_Err) => (schema, value, _ctx) => {
|
|
|
511
841
|
} : { direction: "backward" };
|
|
512
842
|
return _parse(_Err)(schema, value, ctx);
|
|
513
843
|
};
|
|
844
|
+
const encode$1 = /* @__PURE__*/ _encode($ZodRealError);
|
|
514
845
|
const _decode = (_Err) => (schema, value, _ctx) => {
|
|
515
846
|
return _parse(_Err)(schema, value, _ctx);
|
|
516
847
|
};
|
|
848
|
+
const decode$1 = /* @__PURE__*/ _decode($ZodRealError);
|
|
517
849
|
const _encodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
518
850
|
const ctx = _ctx ? {
|
|
519
851
|
..._ctx,
|
|
@@ -521,9 +853,11 @@ const _encodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
521
853
|
} : { direction: "backward" };
|
|
522
854
|
return _parseAsync(_Err)(schema, value, ctx);
|
|
523
855
|
};
|
|
856
|
+
const encodeAsync$1 = /* @__PURE__*/ _encodeAsync($ZodRealError);
|
|
524
857
|
const _decodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
525
858
|
return _parseAsync(_Err)(schema, value, _ctx);
|
|
526
859
|
};
|
|
860
|
+
const decodeAsync$1 = /* @__PURE__*/ _decodeAsync($ZodRealError);
|
|
527
861
|
const _safeEncode = (_Err) => (schema, value, _ctx) => {
|
|
528
862
|
const ctx = _ctx ? {
|
|
529
863
|
..._ctx,
|
|
@@ -531,9 +865,11 @@ const _safeEncode = (_Err) => (schema, value, _ctx) => {
|
|
|
531
865
|
} : { direction: "backward" };
|
|
532
866
|
return _safeParse(_Err)(schema, value, ctx);
|
|
533
867
|
};
|
|
868
|
+
const safeEncode$1 = /* @__PURE__*/ _safeEncode($ZodRealError);
|
|
534
869
|
const _safeDecode = (_Err) => (schema, value, _ctx) => {
|
|
535
870
|
return _safeParse(_Err)(schema, value, _ctx);
|
|
536
871
|
};
|
|
872
|
+
const safeDecode$1 = /* @__PURE__*/ _safeDecode($ZodRealError);
|
|
537
873
|
const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
538
874
|
const ctx = _ctx ? {
|
|
539
875
|
..._ctx,
|
|
@@ -541,49 +877,131 @@ const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
541
877
|
} : { direction: "backward" };
|
|
542
878
|
return _safeParseAsync(_Err)(schema, value, ctx);
|
|
543
879
|
};
|
|
880
|
+
const safeEncodeAsync$1 = /* @__PURE__*/ _safeEncodeAsync($ZodRealError);
|
|
544
881
|
const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
545
882
|
return _safeParseAsync(_Err)(schema, value, _ctx);
|
|
546
883
|
};
|
|
884
|
+
const safeDecodeAsync$1 = /* @__PURE__*/ _safeDecodeAsync($ZodRealError);
|
|
547
885
|
//#endregion
|
|
548
886
|
//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/regexes.js
|
|
887
|
+
var regexes_exports = /* @__PURE__ */ __exportAll({
|
|
888
|
+
base64: () => base64$1,
|
|
889
|
+
base64url: () => base64url$1,
|
|
890
|
+
bigint: () => bigint$1,
|
|
891
|
+
boolean: () => boolean$1,
|
|
892
|
+
browserEmail: () => browserEmail,
|
|
893
|
+
cidrv4: () => cidrv4$1,
|
|
894
|
+
cidrv6: () => cidrv6$1,
|
|
895
|
+
cuid: () => cuid$1,
|
|
896
|
+
cuid2: () => cuid2$1,
|
|
897
|
+
date: () => date$2,
|
|
898
|
+
datetime: () => datetime$1,
|
|
899
|
+
domain: () => domain,
|
|
900
|
+
duration: () => duration$1,
|
|
901
|
+
e164: () => e164$1,
|
|
902
|
+
email: () => email$1,
|
|
903
|
+
emoji: () => emoji$1,
|
|
904
|
+
extendedDuration: () => extendedDuration,
|
|
905
|
+
guid: () => guid$1,
|
|
906
|
+
hex: () => hex$1,
|
|
907
|
+
hostname: () => hostname$1,
|
|
908
|
+
html5Email: () => html5Email,
|
|
909
|
+
httpProtocol: () => httpProtocol,
|
|
910
|
+
idnEmail: () => idnEmail,
|
|
911
|
+
integer: () => integer,
|
|
912
|
+
ipv4: () => ipv4$1,
|
|
913
|
+
ipv6: () => ipv6$1,
|
|
914
|
+
ksuid: () => ksuid$1,
|
|
915
|
+
lowercase: () => lowercase,
|
|
916
|
+
mac: () => mac$1,
|
|
917
|
+
md5_base64: () => md5_base64,
|
|
918
|
+
md5_base64url: () => md5_base64url,
|
|
919
|
+
md5_hex: () => md5_hex,
|
|
920
|
+
nanoid: () => nanoid$1,
|
|
921
|
+
null: () => _null$2,
|
|
922
|
+
number: () => number$1,
|
|
923
|
+
rfc5322Email: () => rfc5322Email,
|
|
924
|
+
sha1_base64: () => sha1_base64,
|
|
925
|
+
sha1_base64url: () => sha1_base64url,
|
|
926
|
+
sha1_hex: () => sha1_hex,
|
|
927
|
+
sha256_base64: () => sha256_base64,
|
|
928
|
+
sha256_base64url: () => sha256_base64url,
|
|
929
|
+
sha256_hex: () => sha256_hex,
|
|
930
|
+
sha384_base64: () => sha384_base64,
|
|
931
|
+
sha384_base64url: () => sha384_base64url,
|
|
932
|
+
sha384_hex: () => sha384_hex,
|
|
933
|
+
sha512_base64: () => sha512_base64,
|
|
934
|
+
sha512_base64url: () => sha512_base64url,
|
|
935
|
+
sha512_hex: () => sha512_hex,
|
|
936
|
+
string: () => string$1,
|
|
937
|
+
time: () => time$1,
|
|
938
|
+
ulid: () => ulid$1,
|
|
939
|
+
undefined: () => _undefined$2,
|
|
940
|
+
unicodeEmail: () => unicodeEmail,
|
|
941
|
+
uppercase: () => uppercase,
|
|
942
|
+
uuid: () => uuid$1,
|
|
943
|
+
uuid4: () => uuid4,
|
|
944
|
+
uuid6: () => uuid6,
|
|
945
|
+
uuid7: () => uuid7,
|
|
946
|
+
xid: () => xid$1
|
|
947
|
+
});
|
|
549
948
|
/**
|
|
550
949
|
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
551
950
|
* (timestamps embedded in the id). Use {@link cuid2} instead.
|
|
552
951
|
* See https://github.com/paralleldrive/cuid.
|
|
553
952
|
*/
|
|
554
|
-
const cuid = /^[cC][0-9a-z]{6,}$/;
|
|
555
|
-
const cuid2 = /^[0-9a-z]+$/;
|
|
556
|
-
const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
|
|
557
|
-
const xid = /^[0-9a-vA-V]{20}$/;
|
|
558
|
-
const ksuid = /^[A-Za-z0-9]{27}$/;
|
|
559
|
-
const nanoid = /^[a-zA-Z0-9_-]{21}$/;
|
|
953
|
+
const cuid$1 = /^[cC][0-9a-z]{6,}$/;
|
|
954
|
+
const cuid2$1 = /^[0-9a-z]+$/;
|
|
955
|
+
const ulid$1 = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
|
|
956
|
+
const xid$1 = /^[0-9a-vA-V]{20}$/;
|
|
957
|
+
const ksuid$1 = /^[A-Za-z0-9]{27}$/;
|
|
958
|
+
const nanoid$1 = /^[a-zA-Z0-9_-]{21}$/;
|
|
560
959
|
/** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */
|
|
561
960
|
const duration$1 = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
|
|
961
|
+
/** Implements ISO 8601-2 extensions like explicit +- prefixes, mixing weeks with other units, and fractional/negative components. */
|
|
962
|
+
const extendedDuration = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
|
|
562
963
|
/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */
|
|
563
|
-
const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
|
|
964
|
+
const guid$1 = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
|
|
564
965
|
/** Returns a regex for validating an RFC 9562/4122 UUID.
|
|
565
966
|
*
|
|
566
967
|
* @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */
|
|
567
|
-
const uuid = (version) => {
|
|
968
|
+
const uuid$1 = (version) => {
|
|
568
969
|
if (!version) return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;
|
|
569
970
|
return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
|
|
570
971
|
};
|
|
972
|
+
const uuid4 = /*@__PURE__*/ uuid$1(4);
|
|
973
|
+
const uuid6 = /*@__PURE__*/ uuid$1(6);
|
|
974
|
+
const uuid7 = /*@__PURE__*/ uuid$1(7);
|
|
571
975
|
/** Practical email validation */
|
|
572
|
-
const email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
|
|
976
|
+
const email$1 = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
|
|
977
|
+
/** Equivalent to the HTML5 input[type=email] validation implemented by browsers. Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email */
|
|
978
|
+
const 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])?)*$/;
|
|
979
|
+
/** The classic emailregex.com regex for RFC 5322-compliant emails */
|
|
980
|
+
const 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,}))$/;
|
|
981
|
+
/** A loose regex that allows Unicode characters, enforces length limits, and that's about it. */
|
|
982
|
+
const unicodeEmail = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u;
|
|
983
|
+
const idnEmail = unicodeEmail;
|
|
984
|
+
const 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])?)*$/;
|
|
573
985
|
const _emoji$1 = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
|
|
574
|
-
function emoji() {
|
|
986
|
+
function emoji$1() {
|
|
575
987
|
return new RegExp(_emoji$1, "u");
|
|
576
988
|
}
|
|
577
|
-
const ipv4 = /^(?:(?: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])$/;
|
|
578
|
-
const ipv6 = /^(([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}|:))$/;
|
|
579
|
-
const
|
|
580
|
-
const
|
|
581
|
-
|
|
582
|
-
|
|
989
|
+
const ipv4$1 = /^(?:(?: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])$/;
|
|
990
|
+
const ipv6$1 = /^(([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}|:))$/;
|
|
991
|
+
const mac$1 = (delimiter) => {
|
|
992
|
+
const escapedDelim = escapeRegex(delimiter ?? ":");
|
|
993
|
+
return new RegExp(`^(?:[0-9A-F]{2}${escapedDelim}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${escapedDelim}){5}[0-9a-f]{2}$`);
|
|
994
|
+
};
|
|
995
|
+
const cidrv4$1 = /^((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])$/;
|
|
996
|
+
const cidrv6$1 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
|
|
997
|
+
const base64$1 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
|
|
998
|
+
const base64url$1 = /^[A-Za-z0-9_-]*$/;
|
|
999
|
+
const hostname$1 = /^(?=.{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])?)*\.?$/;
|
|
1000
|
+
const domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
|
|
583
1001
|
const httpProtocol = /^https?$/;
|
|
584
|
-
const e164 = /^\+[1-9]\d{6,14}$/;
|
|
1002
|
+
const e164$1 = /^\+[1-9]\d{6,14}$/;
|
|
585
1003
|
const 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])))`;
|
|
586
|
-
const date$
|
|
1004
|
+
const date$2 = /*@__PURE__*/ new RegExp(`^${dateSource}$`);
|
|
587
1005
|
function timeSource(args) {
|
|
588
1006
|
const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
|
|
589
1007
|
return typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
@@ -603,11 +1021,36 @@ const string$1 = (params) => {
|
|
|
603
1021
|
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
604
1022
|
return new RegExp(`^${regex}$`);
|
|
605
1023
|
};
|
|
1024
|
+
const bigint$1 = /^-?\d+n?$/;
|
|
606
1025
|
const integer = /^-?\d+$/;
|
|
607
1026
|
const number$1 = /^-?\d+(?:\.\d+)?$/;
|
|
608
1027
|
const boolean$1 = /^(?:true|false)$/i;
|
|
1028
|
+
const _null$2 = /^null$/i;
|
|
1029
|
+
const _undefined$2 = /^undefined$/i;
|
|
609
1030
|
const lowercase = /^[^A-Z]*$/;
|
|
610
1031
|
const uppercase = /^[^a-z]*$/;
|
|
1032
|
+
const hex$1 = /^[0-9a-fA-F]*$/;
|
|
1033
|
+
function fixedBase64(bodyLength, padding) {
|
|
1034
|
+
return new RegExp(`^[A-Za-z0-9+/]{${bodyLength}}${padding}$`);
|
|
1035
|
+
}
|
|
1036
|
+
function fixedBase64url(length) {
|
|
1037
|
+
return new RegExp(`^[A-Za-z0-9_-]{${length}}$`);
|
|
1038
|
+
}
|
|
1039
|
+
const md5_hex = /^[0-9a-fA-F]{32}$/;
|
|
1040
|
+
const md5_base64 = /*@__PURE__*/ fixedBase64(22, "==");
|
|
1041
|
+
const md5_base64url = /*@__PURE__*/ fixedBase64url(22);
|
|
1042
|
+
const sha1_hex = /^[0-9a-fA-F]{40}$/;
|
|
1043
|
+
const sha1_base64 = /*@__PURE__*/ fixedBase64(27, "=");
|
|
1044
|
+
const sha1_base64url = /*@__PURE__*/ fixedBase64url(27);
|
|
1045
|
+
const sha256_hex = /^[0-9a-fA-F]{64}$/;
|
|
1046
|
+
const sha256_base64 = /*@__PURE__*/ fixedBase64(43, "=");
|
|
1047
|
+
const sha256_base64url = /*@__PURE__*/ fixedBase64url(43);
|
|
1048
|
+
const sha384_hex = /^[0-9a-fA-F]{96}$/;
|
|
1049
|
+
const sha384_base64 = /*@__PURE__*/ fixedBase64(64, "");
|
|
1050
|
+
const sha384_base64url = /*@__PURE__*/ fixedBase64url(64);
|
|
1051
|
+
const sha512_hex = /^[0-9a-fA-F]{128}$/;
|
|
1052
|
+
const sha512_base64 = /*@__PURE__*/ fixedBase64(86, "==");
|
|
1053
|
+
const sha512_base64url = /*@__PURE__*/ fixedBase64url(86);
|
|
611
1054
|
//#endregion
|
|
612
1055
|
//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/checks.js
|
|
613
1056
|
const $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
|
|
@@ -759,12 +1202,128 @@ const $ZodCheckNumberFormat = /*@__PURE__*/ $constructor("$ZodCheckNumberFormat"
|
|
|
759
1202
|
});
|
|
760
1203
|
};
|
|
761
1204
|
});
|
|
1205
|
+
const $ZodCheckBigIntFormat = /*@__PURE__*/ $constructor("$ZodCheckBigIntFormat", (inst, def) => {
|
|
1206
|
+
$ZodCheck.init(inst, def);
|
|
1207
|
+
const [minimum, maximum] = BIGINT_FORMAT_RANGES[def.format];
|
|
1208
|
+
inst._zod.onattach.push((inst) => {
|
|
1209
|
+
const bag = inst._zod.bag;
|
|
1210
|
+
bag.format = def.format;
|
|
1211
|
+
bag.minimum = minimum;
|
|
1212
|
+
bag.maximum = maximum;
|
|
1213
|
+
});
|
|
1214
|
+
inst._zod.check = (payload) => {
|
|
1215
|
+
const input = payload.value;
|
|
1216
|
+
if (input < minimum) payload.issues.push({
|
|
1217
|
+
origin: "bigint",
|
|
1218
|
+
input,
|
|
1219
|
+
code: "too_small",
|
|
1220
|
+
minimum,
|
|
1221
|
+
inclusive: true,
|
|
1222
|
+
inst,
|
|
1223
|
+
continue: !def.abort
|
|
1224
|
+
});
|
|
1225
|
+
if (input > maximum) payload.issues.push({
|
|
1226
|
+
origin: "bigint",
|
|
1227
|
+
input,
|
|
1228
|
+
code: "too_big",
|
|
1229
|
+
maximum,
|
|
1230
|
+
inclusive: true,
|
|
1231
|
+
inst,
|
|
1232
|
+
continue: !def.abort
|
|
1233
|
+
});
|
|
1234
|
+
};
|
|
1235
|
+
});
|
|
1236
|
+
const $ZodCheckMaxSize = /*@__PURE__*/ $constructor("$ZodCheckMaxSize", (inst, def) => {
|
|
1237
|
+
var _a;
|
|
1238
|
+
$ZodCheck.init(inst, def);
|
|
1239
|
+
(_a = inst._zod.def).when ?? (_a.when = (payload) => {
|
|
1240
|
+
const val = payload.value;
|
|
1241
|
+
return !nullish$1(val) && val.size !== void 0;
|
|
1242
|
+
});
|
|
1243
|
+
inst._zod.onattach.push((inst) => {
|
|
1244
|
+
const curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
1245
|
+
if (def.maximum < curr) inst._zod.bag.maximum = def.maximum;
|
|
1246
|
+
});
|
|
1247
|
+
inst._zod.check = (payload) => {
|
|
1248
|
+
const input = payload.value;
|
|
1249
|
+
if (input.size <= def.maximum) return;
|
|
1250
|
+
payload.issues.push({
|
|
1251
|
+
origin: getSizableOrigin(input),
|
|
1252
|
+
code: "too_big",
|
|
1253
|
+
maximum: def.maximum,
|
|
1254
|
+
inclusive: true,
|
|
1255
|
+
input,
|
|
1256
|
+
inst,
|
|
1257
|
+
continue: !def.abort
|
|
1258
|
+
});
|
|
1259
|
+
};
|
|
1260
|
+
});
|
|
1261
|
+
const $ZodCheckMinSize = /*@__PURE__*/ $constructor("$ZodCheckMinSize", (inst, def) => {
|
|
1262
|
+
var _a;
|
|
1263
|
+
$ZodCheck.init(inst, def);
|
|
1264
|
+
(_a = inst._zod.def).when ?? (_a.when = (payload) => {
|
|
1265
|
+
const val = payload.value;
|
|
1266
|
+
return !nullish$1(val) && val.size !== void 0;
|
|
1267
|
+
});
|
|
1268
|
+
inst._zod.onattach.push((inst) => {
|
|
1269
|
+
const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
1270
|
+
if (def.minimum > curr) inst._zod.bag.minimum = def.minimum;
|
|
1271
|
+
});
|
|
1272
|
+
inst._zod.check = (payload) => {
|
|
1273
|
+
const input = payload.value;
|
|
1274
|
+
if (input.size >= def.minimum) return;
|
|
1275
|
+
payload.issues.push({
|
|
1276
|
+
origin: getSizableOrigin(input),
|
|
1277
|
+
code: "too_small",
|
|
1278
|
+
minimum: def.minimum,
|
|
1279
|
+
inclusive: true,
|
|
1280
|
+
input,
|
|
1281
|
+
inst,
|
|
1282
|
+
continue: !def.abort
|
|
1283
|
+
});
|
|
1284
|
+
};
|
|
1285
|
+
});
|
|
1286
|
+
const $ZodCheckSizeEquals = /*@__PURE__*/ $constructor("$ZodCheckSizeEquals", (inst, def) => {
|
|
1287
|
+
var _a;
|
|
1288
|
+
$ZodCheck.init(inst, def);
|
|
1289
|
+
(_a = inst._zod.def).when ?? (_a.when = (payload) => {
|
|
1290
|
+
const val = payload.value;
|
|
1291
|
+
return !nullish$1(val) && val.size !== void 0;
|
|
1292
|
+
});
|
|
1293
|
+
inst._zod.onattach.push((inst) => {
|
|
1294
|
+
const bag = inst._zod.bag;
|
|
1295
|
+
bag.minimum = def.size;
|
|
1296
|
+
bag.maximum = def.size;
|
|
1297
|
+
bag.size = def.size;
|
|
1298
|
+
});
|
|
1299
|
+
inst._zod.check = (payload) => {
|
|
1300
|
+
const input = payload.value;
|
|
1301
|
+
const size = input.size;
|
|
1302
|
+
if (size === def.size) return;
|
|
1303
|
+
const tooBig = size > def.size;
|
|
1304
|
+
payload.issues.push({
|
|
1305
|
+
origin: getSizableOrigin(input),
|
|
1306
|
+
...tooBig ? {
|
|
1307
|
+
code: "too_big",
|
|
1308
|
+
maximum: def.size
|
|
1309
|
+
} : {
|
|
1310
|
+
code: "too_small",
|
|
1311
|
+
minimum: def.size
|
|
1312
|
+
},
|
|
1313
|
+
inclusive: true,
|
|
1314
|
+
exact: true,
|
|
1315
|
+
input: payload.value,
|
|
1316
|
+
inst,
|
|
1317
|
+
continue: !def.abort
|
|
1318
|
+
});
|
|
1319
|
+
};
|
|
1320
|
+
});
|
|
762
1321
|
const $ZodCheckMaxLength = /*@__PURE__*/ $constructor("$ZodCheckMaxLength", (inst, def) => {
|
|
763
1322
|
var _a;
|
|
764
1323
|
$ZodCheck.init(inst, def);
|
|
765
1324
|
(_a = inst._zod.def).when ?? (_a.when = (payload) => {
|
|
766
1325
|
const val = payload.value;
|
|
767
|
-
return !nullish(val) && val.length !== void 0;
|
|
1326
|
+
return !nullish$1(val) && val.length !== void 0;
|
|
768
1327
|
});
|
|
769
1328
|
inst._zod.onattach.push((inst) => {
|
|
770
1329
|
const curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
@@ -790,7 +1349,7 @@ const $ZodCheckMinLength = /*@__PURE__*/ $constructor("$ZodCheckMinLength", (ins
|
|
|
790
1349
|
$ZodCheck.init(inst, def);
|
|
791
1350
|
(_a = inst._zod.def).when ?? (_a.when = (payload) => {
|
|
792
1351
|
const val = payload.value;
|
|
793
|
-
return !nullish(val) && val.length !== void 0;
|
|
1352
|
+
return !nullish$1(val) && val.length !== void 0;
|
|
794
1353
|
});
|
|
795
1354
|
inst._zod.onattach.push((inst) => {
|
|
796
1355
|
const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
@@ -816,7 +1375,7 @@ const $ZodCheckLengthEquals = /*@__PURE__*/ $constructor("$ZodCheckLengthEquals"
|
|
|
816
1375
|
$ZodCheck.init(inst, def);
|
|
817
1376
|
(_a = inst._zod.def).when ?? (_a.when = (payload) => {
|
|
818
1377
|
const val = payload.value;
|
|
819
|
-
return !nullish(val) && val.length !== void 0;
|
|
1378
|
+
return !nullish$1(val) && val.length !== void 0;
|
|
820
1379
|
});
|
|
821
1380
|
inst._zod.onattach.push((inst) => {
|
|
822
1381
|
const bag = inst._zod.bag;
|
|
@@ -964,6 +1523,37 @@ const $ZodCheckEndsWith = /*@__PURE__*/ $constructor("$ZodCheckEndsWith", (inst,
|
|
|
964
1523
|
});
|
|
965
1524
|
};
|
|
966
1525
|
});
|
|
1526
|
+
function handleCheckPropertyResult(result, payload, property) {
|
|
1527
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(property, result.issues));
|
|
1528
|
+
}
|
|
1529
|
+
const $ZodCheckProperty = /*@__PURE__*/ $constructor("$ZodCheckProperty", (inst, def) => {
|
|
1530
|
+
$ZodCheck.init(inst, def);
|
|
1531
|
+
inst._zod.check = (payload) => {
|
|
1532
|
+
const result = def.schema._zod.run({
|
|
1533
|
+
value: payload.value[def.property],
|
|
1534
|
+
issues: []
|
|
1535
|
+
}, {});
|
|
1536
|
+
if (result instanceof Promise) return result.then((result) => handleCheckPropertyResult(result, payload, def.property));
|
|
1537
|
+
handleCheckPropertyResult(result, payload, def.property);
|
|
1538
|
+
};
|
|
1539
|
+
});
|
|
1540
|
+
const $ZodCheckMimeType = /*@__PURE__*/ $constructor("$ZodCheckMimeType", (inst, def) => {
|
|
1541
|
+
$ZodCheck.init(inst, def);
|
|
1542
|
+
const mimeSet = new Set(def.mime);
|
|
1543
|
+
inst._zod.onattach.push((inst) => {
|
|
1544
|
+
inst._zod.bag.mime = def.mime;
|
|
1545
|
+
});
|
|
1546
|
+
inst._zod.check = (payload) => {
|
|
1547
|
+
if (mimeSet.has(payload.value.type)) return;
|
|
1548
|
+
payload.issues.push({
|
|
1549
|
+
code: "invalid_value",
|
|
1550
|
+
values: def.mime,
|
|
1551
|
+
input: payload.value.type,
|
|
1552
|
+
inst,
|
|
1553
|
+
continue: !def.abort
|
|
1554
|
+
});
|
|
1555
|
+
};
|
|
1556
|
+
});
|
|
967
1557
|
const $ZodCheckOverwrite = /*@__PURE__*/ $constructor("$ZodCheckOverwrite", (inst, def) => {
|
|
968
1558
|
$ZodCheck.init(inst, def);
|
|
969
1559
|
inst._zod.check = (payload) => {
|
|
@@ -1121,7 +1711,7 @@ const $ZodStringFormat = /*@__PURE__*/ $constructor("$ZodStringFormat", (inst, d
|
|
|
1121
1711
|
$ZodString.init(inst, def);
|
|
1122
1712
|
});
|
|
1123
1713
|
const $ZodGUID = /*@__PURE__*/ $constructor("$ZodGUID", (inst, def) => {
|
|
1124
|
-
def.pattern ?? (def.pattern = guid);
|
|
1714
|
+
def.pattern ?? (def.pattern = guid$1);
|
|
1125
1715
|
$ZodStringFormat.init(inst, def);
|
|
1126
1716
|
});
|
|
1127
1717
|
const $ZodUUID = /*@__PURE__*/ $constructor("$ZodUUID", (inst, def) => {
|
|
@@ -1137,12 +1727,12 @@ const $ZodUUID = /*@__PURE__*/ $constructor("$ZodUUID", (inst, def) => {
|
|
|
1137
1727
|
v8: 8
|
|
1138
1728
|
}[def.version];
|
|
1139
1729
|
if (v === void 0) throw new Error(`Invalid UUID version: "${def.version}"`);
|
|
1140
|
-
def.pattern ?? (def.pattern = uuid(v));
|
|
1141
|
-
} else def.pattern ?? (def.pattern = uuid());
|
|
1730
|
+
def.pattern ?? (def.pattern = uuid$1(v));
|
|
1731
|
+
} else def.pattern ?? (def.pattern = uuid$1());
|
|
1142
1732
|
$ZodStringFormat.init(inst, def);
|
|
1143
1733
|
});
|
|
1144
1734
|
const $ZodEmail = /*@__PURE__*/ $constructor("$ZodEmail", (inst, def) => {
|
|
1145
|
-
def.pattern ?? (def.pattern = email);
|
|
1735
|
+
def.pattern ?? (def.pattern = email$1);
|
|
1146
1736
|
$ZodStringFormat.init(inst, def);
|
|
1147
1737
|
});
|
|
1148
1738
|
const $ZodURL = /*@__PURE__*/ $constructor("$ZodURL", (inst, def) => {
|
|
@@ -1203,11 +1793,11 @@ const $ZodURL = /*@__PURE__*/ $constructor("$ZodURL", (inst, def) => {
|
|
|
1203
1793
|
};
|
|
1204
1794
|
});
|
|
1205
1795
|
const $ZodEmoji = /*@__PURE__*/ $constructor("$ZodEmoji", (inst, def) => {
|
|
1206
|
-
def.pattern ?? (def.pattern = emoji());
|
|
1796
|
+
def.pattern ?? (def.pattern = emoji$1());
|
|
1207
1797
|
$ZodStringFormat.init(inst, def);
|
|
1208
1798
|
});
|
|
1209
1799
|
const $ZodNanoID = /*@__PURE__*/ $constructor("$ZodNanoID", (inst, def) => {
|
|
1210
|
-
def.pattern ?? (def.pattern = nanoid);
|
|
1800
|
+
def.pattern ?? (def.pattern = nanoid$1);
|
|
1211
1801
|
$ZodStringFormat.init(inst, def);
|
|
1212
1802
|
});
|
|
1213
1803
|
/**
|
|
@@ -1216,23 +1806,23 @@ const $ZodNanoID = /*@__PURE__*/ $constructor("$ZodNanoID", (inst, def) => {
|
|
|
1216
1806
|
* See https://github.com/paralleldrive/cuid.
|
|
1217
1807
|
*/
|
|
1218
1808
|
const $ZodCUID = /*@__PURE__*/ $constructor("$ZodCUID", (inst, def) => {
|
|
1219
|
-
def.pattern ?? (def.pattern = cuid);
|
|
1809
|
+
def.pattern ?? (def.pattern = cuid$1);
|
|
1220
1810
|
$ZodStringFormat.init(inst, def);
|
|
1221
1811
|
});
|
|
1222
1812
|
const $ZodCUID2 = /*@__PURE__*/ $constructor("$ZodCUID2", (inst, def) => {
|
|
1223
|
-
def.pattern ?? (def.pattern = cuid2);
|
|
1813
|
+
def.pattern ?? (def.pattern = cuid2$1);
|
|
1224
1814
|
$ZodStringFormat.init(inst, def);
|
|
1225
1815
|
});
|
|
1226
1816
|
const $ZodULID = /*@__PURE__*/ $constructor("$ZodULID", (inst, def) => {
|
|
1227
|
-
def.pattern ?? (def.pattern = ulid);
|
|
1817
|
+
def.pattern ?? (def.pattern = ulid$1);
|
|
1228
1818
|
$ZodStringFormat.init(inst, def);
|
|
1229
1819
|
});
|
|
1230
1820
|
const $ZodXID = /*@__PURE__*/ $constructor("$ZodXID", (inst, def) => {
|
|
1231
|
-
def.pattern ?? (def.pattern = xid);
|
|
1821
|
+
def.pattern ?? (def.pattern = xid$1);
|
|
1232
1822
|
$ZodStringFormat.init(inst, def);
|
|
1233
1823
|
});
|
|
1234
1824
|
const $ZodKSUID = /*@__PURE__*/ $constructor("$ZodKSUID", (inst, def) => {
|
|
1235
|
-
def.pattern ?? (def.pattern = ksuid);
|
|
1825
|
+
def.pattern ?? (def.pattern = ksuid$1);
|
|
1236
1826
|
$ZodStringFormat.init(inst, def);
|
|
1237
1827
|
});
|
|
1238
1828
|
const $ZodISODateTime = /*@__PURE__*/ $constructor("$ZodISODateTime", (inst, def) => {
|
|
@@ -1240,7 +1830,7 @@ const $ZodISODateTime = /*@__PURE__*/ $constructor("$ZodISODateTime", (inst, def
|
|
|
1240
1830
|
$ZodStringFormat.init(inst, def);
|
|
1241
1831
|
});
|
|
1242
1832
|
const $ZodISODate = /*@__PURE__*/ $constructor("$ZodISODate", (inst, def) => {
|
|
1243
|
-
def.pattern ?? (def.pattern = date$
|
|
1833
|
+
def.pattern ?? (def.pattern = date$2);
|
|
1244
1834
|
$ZodStringFormat.init(inst, def);
|
|
1245
1835
|
});
|
|
1246
1836
|
const $ZodISOTime = /*@__PURE__*/ $constructor("$ZodISOTime", (inst, def) => {
|
|
@@ -1252,12 +1842,12 @@ const $ZodISODuration = /*@__PURE__*/ $constructor("$ZodISODuration", (inst, def
|
|
|
1252
1842
|
$ZodStringFormat.init(inst, def);
|
|
1253
1843
|
});
|
|
1254
1844
|
const $ZodIPv4 = /*@__PURE__*/ $constructor("$ZodIPv4", (inst, def) => {
|
|
1255
|
-
def.pattern ?? (def.pattern = ipv4);
|
|
1845
|
+
def.pattern ?? (def.pattern = ipv4$1);
|
|
1256
1846
|
$ZodStringFormat.init(inst, def);
|
|
1257
1847
|
inst._zod.bag.format = `ipv4`;
|
|
1258
1848
|
});
|
|
1259
1849
|
const $ZodIPv6 = /*@__PURE__*/ $constructor("$ZodIPv6", (inst, def) => {
|
|
1260
|
-
def.pattern ?? (def.pattern = ipv6);
|
|
1850
|
+
def.pattern ?? (def.pattern = ipv6$1);
|
|
1261
1851
|
$ZodStringFormat.init(inst, def);
|
|
1262
1852
|
inst._zod.bag.format = `ipv6`;
|
|
1263
1853
|
inst._zod.check = (payload) => {
|
|
@@ -1274,12 +1864,17 @@ const $ZodIPv6 = /*@__PURE__*/ $constructor("$ZodIPv6", (inst, def) => {
|
|
|
1274
1864
|
}
|
|
1275
1865
|
};
|
|
1276
1866
|
});
|
|
1867
|
+
const $ZodMAC = /*@__PURE__*/ $constructor("$ZodMAC", (inst, def) => {
|
|
1868
|
+
def.pattern ?? (def.pattern = mac$1(def.delimiter));
|
|
1869
|
+
$ZodStringFormat.init(inst, def);
|
|
1870
|
+
inst._zod.bag.format = `mac`;
|
|
1871
|
+
});
|
|
1277
1872
|
const $ZodCIDRv4 = /*@__PURE__*/ $constructor("$ZodCIDRv4", (inst, def) => {
|
|
1278
|
-
def.pattern ?? (def.pattern = cidrv4);
|
|
1873
|
+
def.pattern ?? (def.pattern = cidrv4$1);
|
|
1279
1874
|
$ZodStringFormat.init(inst, def);
|
|
1280
1875
|
});
|
|
1281
1876
|
const $ZodCIDRv6 = /*@__PURE__*/ $constructor("$ZodCIDRv6", (inst, def) => {
|
|
1282
|
-
def.pattern ?? (def.pattern = cidrv6);
|
|
1877
|
+
def.pattern ?? (def.pattern = cidrv6$1);
|
|
1283
1878
|
$ZodStringFormat.init(inst, def);
|
|
1284
1879
|
inst._zod.check = (payload) => {
|
|
1285
1880
|
const parts = payload.value.split("/");
|
|
@@ -1314,7 +1909,7 @@ function isValidBase64(data) {
|
|
|
1314
1909
|
}
|
|
1315
1910
|
}
|
|
1316
1911
|
const $ZodBase64 = /*@__PURE__*/ $constructor("$ZodBase64", (inst, def) => {
|
|
1317
|
-
def.pattern ?? (def.pattern = base64);
|
|
1912
|
+
def.pattern ?? (def.pattern = base64$1);
|
|
1318
1913
|
$ZodStringFormat.init(inst, def);
|
|
1319
1914
|
inst._zod.bag.contentEncoding = "base64";
|
|
1320
1915
|
inst._zod.check = (payload) => {
|
|
@@ -1329,12 +1924,12 @@ const $ZodBase64 = /*@__PURE__*/ $constructor("$ZodBase64", (inst, def) => {
|
|
|
1329
1924
|
};
|
|
1330
1925
|
});
|
|
1331
1926
|
function isValidBase64URL(data) {
|
|
1332
|
-
if (!base64url.test(data)) return false;
|
|
1927
|
+
if (!base64url$1.test(data)) return false;
|
|
1333
1928
|
const base64 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
|
|
1334
1929
|
return isValidBase64(base64.padEnd(Math.ceil(base64.length / 4) * 4, "="));
|
|
1335
1930
|
}
|
|
1336
1931
|
const $ZodBase64URL = /*@__PURE__*/ $constructor("$ZodBase64URL", (inst, def) => {
|
|
1337
|
-
def.pattern ?? (def.pattern = base64url);
|
|
1932
|
+
def.pattern ?? (def.pattern = base64url$1);
|
|
1338
1933
|
$ZodStringFormat.init(inst, def);
|
|
1339
1934
|
inst._zod.bag.contentEncoding = "base64url";
|
|
1340
1935
|
inst._zod.check = (payload) => {
|
|
@@ -1349,7 +1944,7 @@ const $ZodBase64URL = /*@__PURE__*/ $constructor("$ZodBase64URL", (inst, def) =>
|
|
|
1349
1944
|
};
|
|
1350
1945
|
});
|
|
1351
1946
|
const $ZodE164 = /*@__PURE__*/ $constructor("$ZodE164", (inst, def) => {
|
|
1352
|
-
def.pattern ?? (def.pattern = e164);
|
|
1947
|
+
def.pattern ?? (def.pattern = e164$1);
|
|
1353
1948
|
$ZodStringFormat.init(inst, def);
|
|
1354
1949
|
});
|
|
1355
1950
|
function isValidJWT(token, algorithm = null) {
|
|
@@ -1380,6 +1975,19 @@ const $ZodJWT = /*@__PURE__*/ $constructor("$ZodJWT", (inst, def) => {
|
|
|
1380
1975
|
});
|
|
1381
1976
|
};
|
|
1382
1977
|
});
|
|
1978
|
+
const $ZodCustomStringFormat = /*@__PURE__*/ $constructor("$ZodCustomStringFormat", (inst, def) => {
|
|
1979
|
+
$ZodStringFormat.init(inst, def);
|
|
1980
|
+
inst._zod.check = (payload) => {
|
|
1981
|
+
if (def.fn(payload.value)) return;
|
|
1982
|
+
payload.issues.push({
|
|
1983
|
+
code: "invalid_format",
|
|
1984
|
+
format: def.format,
|
|
1985
|
+
input: payload.value,
|
|
1986
|
+
inst,
|
|
1987
|
+
continue: !def.abort
|
|
1988
|
+
});
|
|
1989
|
+
};
|
|
1990
|
+
});
|
|
1383
1991
|
const $ZodNumber = /*@__PURE__*/ $constructor("$ZodNumber", (inst, def) => {
|
|
1384
1992
|
$ZodType.init(inst, def);
|
|
1385
1993
|
inst._zod.pattern = inst._zod.bag.pattern ?? number$1;
|
|
@@ -1422,6 +2030,77 @@ const $ZodBoolean = /*@__PURE__*/ $constructor("$ZodBoolean", (inst, def) => {
|
|
|
1422
2030
|
return payload;
|
|
1423
2031
|
};
|
|
1424
2032
|
});
|
|
2033
|
+
const $ZodBigInt = /*@__PURE__*/ $constructor("$ZodBigInt", (inst, def) => {
|
|
2034
|
+
$ZodType.init(inst, def);
|
|
2035
|
+
inst._zod.pattern = bigint$1;
|
|
2036
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
2037
|
+
if (def.coerce) try {
|
|
2038
|
+
payload.value = BigInt(payload.value);
|
|
2039
|
+
} catch (_) {}
|
|
2040
|
+
if (typeof payload.value === "bigint") return payload;
|
|
2041
|
+
payload.issues.push({
|
|
2042
|
+
expected: "bigint",
|
|
2043
|
+
code: "invalid_type",
|
|
2044
|
+
input: payload.value,
|
|
2045
|
+
inst
|
|
2046
|
+
});
|
|
2047
|
+
return payload;
|
|
2048
|
+
};
|
|
2049
|
+
});
|
|
2050
|
+
const $ZodBigIntFormat = /*@__PURE__*/ $constructor("$ZodBigIntFormat", (inst, def) => {
|
|
2051
|
+
$ZodCheckBigIntFormat.init(inst, def);
|
|
2052
|
+
$ZodBigInt.init(inst, def);
|
|
2053
|
+
});
|
|
2054
|
+
const $ZodSymbol = /*@__PURE__*/ $constructor("$ZodSymbol", (inst, def) => {
|
|
2055
|
+
$ZodType.init(inst, def);
|
|
2056
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
2057
|
+
const input = payload.value;
|
|
2058
|
+
if (typeof input === "symbol") return payload;
|
|
2059
|
+
payload.issues.push({
|
|
2060
|
+
expected: "symbol",
|
|
2061
|
+
code: "invalid_type",
|
|
2062
|
+
input,
|
|
2063
|
+
inst
|
|
2064
|
+
});
|
|
2065
|
+
return payload;
|
|
2066
|
+
};
|
|
2067
|
+
});
|
|
2068
|
+
const $ZodUndefined = /*@__PURE__*/ $constructor("$ZodUndefined", (inst, def) => {
|
|
2069
|
+
$ZodType.init(inst, def);
|
|
2070
|
+
inst._zod.pattern = _undefined$2;
|
|
2071
|
+
inst._zod.values = /* @__PURE__ */ new Set([void 0]);
|
|
2072
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
2073
|
+
const input = payload.value;
|
|
2074
|
+
if (typeof input === "undefined") return payload;
|
|
2075
|
+
payload.issues.push({
|
|
2076
|
+
expected: "undefined",
|
|
2077
|
+
code: "invalid_type",
|
|
2078
|
+
input,
|
|
2079
|
+
inst
|
|
2080
|
+
});
|
|
2081
|
+
return payload;
|
|
2082
|
+
};
|
|
2083
|
+
});
|
|
2084
|
+
const $ZodNull = /*@__PURE__*/ $constructor("$ZodNull", (inst, def) => {
|
|
2085
|
+
$ZodType.init(inst, def);
|
|
2086
|
+
inst._zod.pattern = _null$2;
|
|
2087
|
+
inst._zod.values = /* @__PURE__ */ new Set([null]);
|
|
2088
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
2089
|
+
const input = payload.value;
|
|
2090
|
+
if (input === null) return payload;
|
|
2091
|
+
payload.issues.push({
|
|
2092
|
+
expected: "null",
|
|
2093
|
+
code: "invalid_type",
|
|
2094
|
+
input,
|
|
2095
|
+
inst
|
|
2096
|
+
});
|
|
2097
|
+
return payload;
|
|
2098
|
+
};
|
|
2099
|
+
});
|
|
2100
|
+
const $ZodAny = /*@__PURE__*/ $constructor("$ZodAny", (inst, def) => {
|
|
2101
|
+
$ZodType.init(inst, def);
|
|
2102
|
+
inst._zod.parse = (payload) => payload;
|
|
2103
|
+
});
|
|
1425
2104
|
const $ZodUnknown = /*@__PURE__*/ $constructor("$ZodUnknown", (inst, def) => {
|
|
1426
2105
|
$ZodType.init(inst, def);
|
|
1427
2106
|
inst._zod.parse = (payload) => payload;
|
|
@@ -1438,6 +2117,39 @@ const $ZodNever = /*@__PURE__*/ $constructor("$ZodNever", (inst, def) => {
|
|
|
1438
2117
|
return payload;
|
|
1439
2118
|
};
|
|
1440
2119
|
});
|
|
2120
|
+
const $ZodVoid = /*@__PURE__*/ $constructor("$ZodVoid", (inst, def) => {
|
|
2121
|
+
$ZodType.init(inst, def);
|
|
2122
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
2123
|
+
const input = payload.value;
|
|
2124
|
+
if (typeof input === "undefined") return payload;
|
|
2125
|
+
payload.issues.push({
|
|
2126
|
+
expected: "void",
|
|
2127
|
+
code: "invalid_type",
|
|
2128
|
+
input,
|
|
2129
|
+
inst
|
|
2130
|
+
});
|
|
2131
|
+
return payload;
|
|
2132
|
+
};
|
|
2133
|
+
});
|
|
2134
|
+
const $ZodDate = /*@__PURE__*/ $constructor("$ZodDate", (inst, def) => {
|
|
2135
|
+
$ZodType.init(inst, def);
|
|
2136
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
2137
|
+
if (def.coerce) try {
|
|
2138
|
+
payload.value = new Date(payload.value);
|
|
2139
|
+
} catch (_err) {}
|
|
2140
|
+
const input = payload.value;
|
|
2141
|
+
const isDate = input instanceof Date;
|
|
2142
|
+
if (isDate && !Number.isNaN(input.getTime())) return payload;
|
|
2143
|
+
payload.issues.push({
|
|
2144
|
+
expected: "date",
|
|
2145
|
+
code: "invalid_type",
|
|
2146
|
+
input,
|
|
2147
|
+
...isDate ? { received: "Invalid Date" } : {},
|
|
2148
|
+
inst
|
|
2149
|
+
});
|
|
2150
|
+
return payload;
|
|
2151
|
+
};
|
|
2152
|
+
});
|
|
1441
2153
|
function handleArrayResult(result, final, index) {
|
|
1442
2154
|
if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
|
|
1443
2155
|
final.value[index] = result.value;
|
|
@@ -1766,8 +2478,109 @@ const $ZodUnion = /*@__PURE__*/ $constructor("$ZodUnion", (inst, def) => {
|
|
|
1766
2478
|
});
|
|
1767
2479
|
};
|
|
1768
2480
|
});
|
|
1769
|
-
|
|
1770
|
-
|
|
2481
|
+
function handleExclusiveUnionResults(results, final, inst, ctx) {
|
|
2482
|
+
const successes = results.filter((r) => r.issues.length === 0);
|
|
2483
|
+
if (successes.length === 1) {
|
|
2484
|
+
final.value = successes[0].value;
|
|
2485
|
+
return final;
|
|
2486
|
+
}
|
|
2487
|
+
if (successes.length === 0) final.issues.push({
|
|
2488
|
+
code: "invalid_union",
|
|
2489
|
+
input: final.value,
|
|
2490
|
+
inst,
|
|
2491
|
+
errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
2492
|
+
});
|
|
2493
|
+
else final.issues.push({
|
|
2494
|
+
code: "invalid_union",
|
|
2495
|
+
input: final.value,
|
|
2496
|
+
inst,
|
|
2497
|
+
errors: [],
|
|
2498
|
+
inclusive: false
|
|
2499
|
+
});
|
|
2500
|
+
return final;
|
|
2501
|
+
}
|
|
2502
|
+
const $ZodXor = /*@__PURE__*/ $constructor("$ZodXor", (inst, def) => {
|
|
2503
|
+
$ZodUnion.init(inst, def);
|
|
2504
|
+
def.inclusive = false;
|
|
2505
|
+
const first = def.options.length === 1 ? def.options[0]._zod.run : null;
|
|
2506
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2507
|
+
if (first) return first(payload, ctx);
|
|
2508
|
+
let async = false;
|
|
2509
|
+
const results = [];
|
|
2510
|
+
for (const option of def.options) {
|
|
2511
|
+
const result = option._zod.run({
|
|
2512
|
+
value: payload.value,
|
|
2513
|
+
issues: []
|
|
2514
|
+
}, ctx);
|
|
2515
|
+
if (result instanceof Promise) {
|
|
2516
|
+
results.push(result);
|
|
2517
|
+
async = true;
|
|
2518
|
+
} else results.push(result);
|
|
2519
|
+
}
|
|
2520
|
+
if (!async) return handleExclusiveUnionResults(results, payload, inst, ctx);
|
|
2521
|
+
return Promise.all(results).then((results) => {
|
|
2522
|
+
return handleExclusiveUnionResults(results, payload, inst, ctx);
|
|
2523
|
+
});
|
|
2524
|
+
};
|
|
2525
|
+
});
|
|
2526
|
+
const $ZodDiscriminatedUnion = /*@__PURE__*/ $constructor("$ZodDiscriminatedUnion", (inst, def) => {
|
|
2527
|
+
def.inclusive = false;
|
|
2528
|
+
$ZodUnion.init(inst, def);
|
|
2529
|
+
const _super = inst._zod.parse;
|
|
2530
|
+
defineLazy(inst._zod, "propValues", () => {
|
|
2531
|
+
const propValues = {};
|
|
2532
|
+
for (const option of def.options) {
|
|
2533
|
+
const pv = option._zod.propValues;
|
|
2534
|
+
if (!pv || Object.keys(pv).length === 0) throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
|
|
2535
|
+
for (const [k, v] of Object.entries(pv)) {
|
|
2536
|
+
if (!propValues[k]) propValues[k] = /* @__PURE__ */ new Set();
|
|
2537
|
+
for (const val of v) propValues[k].add(val);
|
|
2538
|
+
}
|
|
2539
|
+
}
|
|
2540
|
+
return propValues;
|
|
2541
|
+
});
|
|
2542
|
+
const disc = cached(() => {
|
|
2543
|
+
const opts = def.options;
|
|
2544
|
+
const map = /* @__PURE__ */ new Map();
|
|
2545
|
+
for (const o of opts) {
|
|
2546
|
+
const values = o._zod.propValues?.[def.discriminator];
|
|
2547
|
+
if (!values || values.size === 0) throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
|
|
2548
|
+
for (const v of values) {
|
|
2549
|
+
if (map.has(v)) throw new Error(`Duplicate discriminator value "${String(v)}"`);
|
|
2550
|
+
map.set(v, o);
|
|
2551
|
+
}
|
|
2552
|
+
}
|
|
2553
|
+
return map;
|
|
2554
|
+
});
|
|
2555
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2556
|
+
const input = payload.value;
|
|
2557
|
+
if (!isObject(input)) {
|
|
2558
|
+
payload.issues.push({
|
|
2559
|
+
code: "invalid_type",
|
|
2560
|
+
expected: "object",
|
|
2561
|
+
input,
|
|
2562
|
+
inst
|
|
2563
|
+
});
|
|
2564
|
+
return payload;
|
|
2565
|
+
}
|
|
2566
|
+
const opt = disc.value.get(input?.[def.discriminator]);
|
|
2567
|
+
if (opt) return opt._zod.run(payload, ctx);
|
|
2568
|
+
if (def.unionFallback || ctx.direction === "backward") return _super(payload, ctx);
|
|
2569
|
+
payload.issues.push({
|
|
2570
|
+
code: "invalid_union",
|
|
2571
|
+
errors: [],
|
|
2572
|
+
note: "No matching discriminator",
|
|
2573
|
+
discriminator: def.discriminator,
|
|
2574
|
+
options: Array.from(disc.value.keys()),
|
|
2575
|
+
input,
|
|
2576
|
+
path: [def.discriminator],
|
|
2577
|
+
inst
|
|
2578
|
+
});
|
|
2579
|
+
return payload;
|
|
2580
|
+
};
|
|
2581
|
+
});
|
|
2582
|
+
const $ZodIntersection = /*@__PURE__*/ $constructor("$ZodIntersection", (inst, def) => {
|
|
2583
|
+
$ZodType.init(inst, def);
|
|
1771
2584
|
inst._zod.parse = (payload, ctx) => {
|
|
1772
2585
|
const input = payload.value;
|
|
1773
2586
|
const left = def.left._zod.run({
|
|
@@ -1865,6 +2678,295 @@ function handleIntersectionResults(result, left, right) {
|
|
|
1865
2678
|
result.value = merged.data;
|
|
1866
2679
|
return result;
|
|
1867
2680
|
}
|
|
2681
|
+
const $ZodTuple = /*@__PURE__*/ $constructor("$ZodTuple", (inst, def) => {
|
|
2682
|
+
$ZodType.init(inst, def);
|
|
2683
|
+
const items = def.items;
|
|
2684
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2685
|
+
const input = payload.value;
|
|
2686
|
+
if (!Array.isArray(input)) {
|
|
2687
|
+
payload.issues.push({
|
|
2688
|
+
input,
|
|
2689
|
+
inst,
|
|
2690
|
+
expected: "tuple",
|
|
2691
|
+
code: "invalid_type"
|
|
2692
|
+
});
|
|
2693
|
+
return payload;
|
|
2694
|
+
}
|
|
2695
|
+
payload.value = [];
|
|
2696
|
+
const proms = [];
|
|
2697
|
+
const optinStart = getTupleOptStart(items, "optin");
|
|
2698
|
+
const optoutStart = getTupleOptStart(items, "optout");
|
|
2699
|
+
if (!def.rest) {
|
|
2700
|
+
if (input.length < optinStart) {
|
|
2701
|
+
payload.issues.push({
|
|
2702
|
+
code: "too_small",
|
|
2703
|
+
minimum: optinStart,
|
|
2704
|
+
inclusive: true,
|
|
2705
|
+
input,
|
|
2706
|
+
inst,
|
|
2707
|
+
origin: "array"
|
|
2708
|
+
});
|
|
2709
|
+
return payload;
|
|
2710
|
+
}
|
|
2711
|
+
if (input.length > items.length) payload.issues.push({
|
|
2712
|
+
code: "too_big",
|
|
2713
|
+
maximum: items.length,
|
|
2714
|
+
inclusive: true,
|
|
2715
|
+
input,
|
|
2716
|
+
inst,
|
|
2717
|
+
origin: "array"
|
|
2718
|
+
});
|
|
2719
|
+
}
|
|
2720
|
+
const itemResults = new Array(items.length);
|
|
2721
|
+
for (let i = 0; i < items.length; i++) {
|
|
2722
|
+
const r = items[i]._zod.run({
|
|
2723
|
+
value: input[i],
|
|
2724
|
+
issues: []
|
|
2725
|
+
}, ctx);
|
|
2726
|
+
if (r instanceof Promise) proms.push(r.then((rr) => {
|
|
2727
|
+
itemResults[i] = rr;
|
|
2728
|
+
}));
|
|
2729
|
+
else itemResults[i] = r;
|
|
2730
|
+
}
|
|
2731
|
+
if (def.rest) {
|
|
2732
|
+
let i = items.length - 1;
|
|
2733
|
+
const rest = input.slice(items.length);
|
|
2734
|
+
for (const el of rest) {
|
|
2735
|
+
i++;
|
|
2736
|
+
const result = def.rest._zod.run({
|
|
2737
|
+
value: el,
|
|
2738
|
+
issues: []
|
|
2739
|
+
}, ctx);
|
|
2740
|
+
if (result instanceof Promise) proms.push(result.then((r) => handleTupleResult(r, payload, i)));
|
|
2741
|
+
else handleTupleResult(result, payload, i);
|
|
2742
|
+
}
|
|
2743
|
+
}
|
|
2744
|
+
if (proms.length) return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input, optoutStart));
|
|
2745
|
+
return handleTupleResults(itemResults, payload, items, input, optoutStart);
|
|
2746
|
+
};
|
|
2747
|
+
});
|
|
2748
|
+
function getTupleOptStart(items, key) {
|
|
2749
|
+
for (let i = items.length - 1; i >= 0; i--) if (items[i]._zod[key] !== "optional") return i + 1;
|
|
2750
|
+
return 0;
|
|
2751
|
+
}
|
|
2752
|
+
function handleTupleResult(result, final, index) {
|
|
2753
|
+
if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
|
|
2754
|
+
final.value[index] = result.value;
|
|
2755
|
+
}
|
|
2756
|
+
function handleTupleResults(itemResults, final, items, input, optoutStart) {
|
|
2757
|
+
for (let i = 0; i < items.length; i++) {
|
|
2758
|
+
const r = itemResults[i];
|
|
2759
|
+
const isPresent = i < input.length;
|
|
2760
|
+
if (r.issues.length) {
|
|
2761
|
+
if (!isPresent && i >= optoutStart) {
|
|
2762
|
+
final.value.length = i;
|
|
2763
|
+
break;
|
|
2764
|
+
}
|
|
2765
|
+
final.issues.push(...prefixIssues(i, r.issues));
|
|
2766
|
+
}
|
|
2767
|
+
final.value[i] = r.value;
|
|
2768
|
+
}
|
|
2769
|
+
for (let i = final.value.length - 1; i >= input.length; i--) if (items[i]._zod.optout === "optional" && final.value[i] === void 0) final.value.length = i;
|
|
2770
|
+
else break;
|
|
2771
|
+
return final;
|
|
2772
|
+
}
|
|
2773
|
+
const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
|
|
2774
|
+
$ZodType.init(inst, def);
|
|
2775
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2776
|
+
const input = payload.value;
|
|
2777
|
+
if (!isPlainObject(input)) {
|
|
2778
|
+
payload.issues.push({
|
|
2779
|
+
expected: "record",
|
|
2780
|
+
code: "invalid_type",
|
|
2781
|
+
input,
|
|
2782
|
+
inst
|
|
2783
|
+
});
|
|
2784
|
+
return payload;
|
|
2785
|
+
}
|
|
2786
|
+
const proms = [];
|
|
2787
|
+
const values = def.keyType._zod.values;
|
|
2788
|
+
if (values) {
|
|
2789
|
+
payload.value = {};
|
|
2790
|
+
const recordKeys = /* @__PURE__ */ new Set();
|
|
2791
|
+
for (const key of values) if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
|
|
2792
|
+
recordKeys.add(typeof key === "number" ? key.toString() : key);
|
|
2793
|
+
const keyResult = def.keyType._zod.run({
|
|
2794
|
+
value: key,
|
|
2795
|
+
issues: []
|
|
2796
|
+
}, ctx);
|
|
2797
|
+
if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
|
|
2798
|
+
if (keyResult.issues.length) {
|
|
2799
|
+
payload.issues.push({
|
|
2800
|
+
code: "invalid_key",
|
|
2801
|
+
origin: "record",
|
|
2802
|
+
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
|
|
2803
|
+
input: key,
|
|
2804
|
+
path: [key],
|
|
2805
|
+
inst
|
|
2806
|
+
});
|
|
2807
|
+
continue;
|
|
2808
|
+
}
|
|
2809
|
+
const outKey = keyResult.value;
|
|
2810
|
+
const result = def.valueType._zod.run({
|
|
2811
|
+
value: input[key],
|
|
2812
|
+
issues: []
|
|
2813
|
+
}, ctx);
|
|
2814
|
+
if (result instanceof Promise) proms.push(result.then((result) => {
|
|
2815
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
2816
|
+
payload.value[outKey] = result.value;
|
|
2817
|
+
}));
|
|
2818
|
+
else {
|
|
2819
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
2820
|
+
payload.value[outKey] = result.value;
|
|
2821
|
+
}
|
|
2822
|
+
}
|
|
2823
|
+
let unrecognized;
|
|
2824
|
+
for (const key in input) if (!recordKeys.has(key)) {
|
|
2825
|
+
unrecognized = unrecognized ?? [];
|
|
2826
|
+
unrecognized.push(key);
|
|
2827
|
+
}
|
|
2828
|
+
if (unrecognized && unrecognized.length > 0) payload.issues.push({
|
|
2829
|
+
code: "unrecognized_keys",
|
|
2830
|
+
input,
|
|
2831
|
+
inst,
|
|
2832
|
+
keys: unrecognized
|
|
2833
|
+
});
|
|
2834
|
+
} else {
|
|
2835
|
+
payload.value = {};
|
|
2836
|
+
for (const key of Reflect.ownKeys(input)) {
|
|
2837
|
+
if (key === "__proto__") continue;
|
|
2838
|
+
if (!Object.prototype.propertyIsEnumerable.call(input, key)) continue;
|
|
2839
|
+
let keyResult = def.keyType._zod.run({
|
|
2840
|
+
value: key,
|
|
2841
|
+
issues: []
|
|
2842
|
+
}, ctx);
|
|
2843
|
+
if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
|
|
2844
|
+
if (typeof key === "string" && number$1.test(key) && keyResult.issues.length) {
|
|
2845
|
+
const retryResult = def.keyType._zod.run({
|
|
2846
|
+
value: Number(key),
|
|
2847
|
+
issues: []
|
|
2848
|
+
}, ctx);
|
|
2849
|
+
if (retryResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
|
|
2850
|
+
if (retryResult.issues.length === 0) keyResult = retryResult;
|
|
2851
|
+
}
|
|
2852
|
+
if (keyResult.issues.length) {
|
|
2853
|
+
if (def.mode === "loose") payload.value[key] = input[key];
|
|
2854
|
+
else payload.issues.push({
|
|
2855
|
+
code: "invalid_key",
|
|
2856
|
+
origin: "record",
|
|
2857
|
+
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
|
|
2858
|
+
input: key,
|
|
2859
|
+
path: [key],
|
|
2860
|
+
inst
|
|
2861
|
+
});
|
|
2862
|
+
continue;
|
|
2863
|
+
}
|
|
2864
|
+
const result = def.valueType._zod.run({
|
|
2865
|
+
value: input[key],
|
|
2866
|
+
issues: []
|
|
2867
|
+
}, ctx);
|
|
2868
|
+
if (result instanceof Promise) proms.push(result.then((result) => {
|
|
2869
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
2870
|
+
payload.value[keyResult.value] = result.value;
|
|
2871
|
+
}));
|
|
2872
|
+
else {
|
|
2873
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
2874
|
+
payload.value[keyResult.value] = result.value;
|
|
2875
|
+
}
|
|
2876
|
+
}
|
|
2877
|
+
}
|
|
2878
|
+
if (proms.length) return Promise.all(proms).then(() => payload);
|
|
2879
|
+
return payload;
|
|
2880
|
+
};
|
|
2881
|
+
});
|
|
2882
|
+
const $ZodMap = /*@__PURE__*/ $constructor("$ZodMap", (inst, def) => {
|
|
2883
|
+
$ZodType.init(inst, def);
|
|
2884
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2885
|
+
const input = payload.value;
|
|
2886
|
+
if (!(input instanceof Map)) {
|
|
2887
|
+
payload.issues.push({
|
|
2888
|
+
expected: "map",
|
|
2889
|
+
code: "invalid_type",
|
|
2890
|
+
input,
|
|
2891
|
+
inst
|
|
2892
|
+
});
|
|
2893
|
+
return payload;
|
|
2894
|
+
}
|
|
2895
|
+
const proms = [];
|
|
2896
|
+
payload.value = /* @__PURE__ */ new Map();
|
|
2897
|
+
for (const [key, value] of input) {
|
|
2898
|
+
const keyResult = def.keyType._zod.run({
|
|
2899
|
+
value: key,
|
|
2900
|
+
issues: []
|
|
2901
|
+
}, ctx);
|
|
2902
|
+
const valueResult = def.valueType._zod.run({
|
|
2903
|
+
value,
|
|
2904
|
+
issues: []
|
|
2905
|
+
}, ctx);
|
|
2906
|
+
if (keyResult instanceof Promise || valueResult instanceof Promise) proms.push(Promise.all([keyResult, valueResult]).then(([keyResult, valueResult]) => {
|
|
2907
|
+
handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);
|
|
2908
|
+
}));
|
|
2909
|
+
else handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);
|
|
2910
|
+
}
|
|
2911
|
+
if (proms.length) return Promise.all(proms).then(() => payload);
|
|
2912
|
+
return payload;
|
|
2913
|
+
};
|
|
2914
|
+
});
|
|
2915
|
+
function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
|
|
2916
|
+
if (keyResult.issues.length) {
|
|
2917
|
+
if (propertyKeyTypes.has(typeof key)) final.issues.push(...prefixIssues(key, keyResult.issues));
|
|
2918
|
+
else final.issues.push({
|
|
2919
|
+
code: "invalid_key",
|
|
2920
|
+
origin: "map",
|
|
2921
|
+
input,
|
|
2922
|
+
inst,
|
|
2923
|
+
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
|
|
2924
|
+
});
|
|
2925
|
+
}
|
|
2926
|
+
if (valueResult.issues.length) {
|
|
2927
|
+
if (propertyKeyTypes.has(typeof key)) final.issues.push(...prefixIssues(key, valueResult.issues));
|
|
2928
|
+
else final.issues.push({
|
|
2929
|
+
origin: "map",
|
|
2930
|
+
code: "invalid_element",
|
|
2931
|
+
input,
|
|
2932
|
+
inst,
|
|
2933
|
+
key,
|
|
2934
|
+
issues: valueResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
|
|
2935
|
+
});
|
|
2936
|
+
}
|
|
2937
|
+
final.value.set(keyResult.value, valueResult.value);
|
|
2938
|
+
}
|
|
2939
|
+
const $ZodSet = /*@__PURE__*/ $constructor("$ZodSet", (inst, def) => {
|
|
2940
|
+
$ZodType.init(inst, def);
|
|
2941
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2942
|
+
const input = payload.value;
|
|
2943
|
+
if (!(input instanceof Set)) {
|
|
2944
|
+
payload.issues.push({
|
|
2945
|
+
input,
|
|
2946
|
+
inst,
|
|
2947
|
+
expected: "set",
|
|
2948
|
+
code: "invalid_type"
|
|
2949
|
+
});
|
|
2950
|
+
return payload;
|
|
2951
|
+
}
|
|
2952
|
+
const proms = [];
|
|
2953
|
+
payload.value = /* @__PURE__ */ new Set();
|
|
2954
|
+
for (const item of input) {
|
|
2955
|
+
const result = def.valueType._zod.run({
|
|
2956
|
+
value: item,
|
|
2957
|
+
issues: []
|
|
2958
|
+
}, ctx);
|
|
2959
|
+
if (result instanceof Promise) proms.push(result.then((result) => handleSetResult(result, payload)));
|
|
2960
|
+
else handleSetResult(result, payload);
|
|
2961
|
+
}
|
|
2962
|
+
if (proms.length) return Promise.all(proms).then(() => payload);
|
|
2963
|
+
return payload;
|
|
2964
|
+
};
|
|
2965
|
+
});
|
|
2966
|
+
function handleSetResult(result, final) {
|
|
2967
|
+
if (result.issues.length) final.issues.push(...result.issues);
|
|
2968
|
+
final.value.add(result.value);
|
|
2969
|
+
}
|
|
1868
2970
|
const $ZodEnum = /*@__PURE__*/ $constructor("$ZodEnum", (inst, def) => {
|
|
1869
2971
|
$ZodType.init(inst, def);
|
|
1870
2972
|
const values = getEnumValues(def.entries);
|
|
@@ -1901,6 +3003,20 @@ const $ZodLiteral = /*@__PURE__*/ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
1901
3003
|
return payload;
|
|
1902
3004
|
};
|
|
1903
3005
|
});
|
|
3006
|
+
const $ZodFile = /*@__PURE__*/ $constructor("$ZodFile", (inst, def) => {
|
|
3007
|
+
$ZodType.init(inst, def);
|
|
3008
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
3009
|
+
const input = payload.value;
|
|
3010
|
+
if (input instanceof File) return payload;
|
|
3011
|
+
payload.issues.push({
|
|
3012
|
+
expected: "file",
|
|
3013
|
+
code: "invalid_type",
|
|
3014
|
+
input,
|
|
3015
|
+
inst
|
|
3016
|
+
});
|
|
3017
|
+
return payload;
|
|
3018
|
+
};
|
|
3019
|
+
});
|
|
1904
3020
|
const $ZodTransform = /*@__PURE__*/ $constructor("$ZodTransform", (inst, def) => {
|
|
1905
3021
|
$ZodType.init(inst, def);
|
|
1906
3022
|
inst._zod.optin = "optional";
|
|
@@ -2024,6 +3140,19 @@ function handleNonOptionalResult(payload, inst) {
|
|
|
2024
3140
|
});
|
|
2025
3141
|
return payload;
|
|
2026
3142
|
}
|
|
3143
|
+
const $ZodSuccess = /*@__PURE__*/ $constructor("$ZodSuccess", (inst, def) => {
|
|
3144
|
+
$ZodType.init(inst, def);
|
|
3145
|
+
inst._zod.parse = (payload, ctx) => {
|
|
3146
|
+
if (ctx.direction === "backward") throw new $ZodEncodeError("ZodSuccess");
|
|
3147
|
+
const result = def.innerType._zod.run(payload, ctx);
|
|
3148
|
+
if (result instanceof Promise) return result.then((result) => {
|
|
3149
|
+
payload.value = result.issues.length === 0;
|
|
3150
|
+
return payload;
|
|
3151
|
+
});
|
|
3152
|
+
payload.value = result.issues.length === 0;
|
|
3153
|
+
return payload;
|
|
3154
|
+
};
|
|
3155
|
+
});
|
|
2027
3156
|
const $ZodCatch = /*@__PURE__*/ $constructor("$ZodCatch", (inst, def) => {
|
|
2028
3157
|
$ZodType.init(inst, def);
|
|
2029
3158
|
inst._zod.optin = "optional";
|
|
@@ -2058,6 +3187,21 @@ const $ZodCatch = /*@__PURE__*/ $constructor("$ZodCatch", (inst, def) => {
|
|
|
2058
3187
|
return payload;
|
|
2059
3188
|
};
|
|
2060
3189
|
});
|
|
3190
|
+
const $ZodNaN = /*@__PURE__*/ $constructor("$ZodNaN", (inst, def) => {
|
|
3191
|
+
$ZodType.init(inst, def);
|
|
3192
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
3193
|
+
if (typeof payload.value !== "number" || !Number.isNaN(payload.value)) {
|
|
3194
|
+
payload.issues.push({
|
|
3195
|
+
input: payload.value,
|
|
3196
|
+
inst,
|
|
3197
|
+
expected: "nan",
|
|
3198
|
+
code: "invalid_type"
|
|
3199
|
+
});
|
|
3200
|
+
return payload;
|
|
3201
|
+
}
|
|
3202
|
+
return payload;
|
|
3203
|
+
};
|
|
3204
|
+
});
|
|
2061
3205
|
const $ZodPipe = /*@__PURE__*/ $constructor("$ZodPipe", (inst, def) => {
|
|
2062
3206
|
$ZodType.init(inst, def);
|
|
2063
3207
|
defineLazy(inst._zod, "values", () => def.in._zod.values);
|
|
@@ -2086,6 +3230,52 @@ function handlePipeResult(left, next, ctx) {
|
|
|
2086
3230
|
fallback: left.fallback
|
|
2087
3231
|
}, ctx);
|
|
2088
3232
|
}
|
|
3233
|
+
const $ZodCodec = /*@__PURE__*/ $constructor("$ZodCodec", (inst, def) => {
|
|
3234
|
+
$ZodType.init(inst, def);
|
|
3235
|
+
defineLazy(inst._zod, "values", () => def.in._zod.values);
|
|
3236
|
+
defineLazy(inst._zod, "optin", () => def.in._zod.optin);
|
|
3237
|
+
defineLazy(inst._zod, "optout", () => def.out._zod.optout);
|
|
3238
|
+
defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
|
|
3239
|
+
inst._zod.parse = (payload, ctx) => {
|
|
3240
|
+
if ((ctx.direction || "forward") === "forward") {
|
|
3241
|
+
const left = def.in._zod.run(payload, ctx);
|
|
3242
|
+
if (left instanceof Promise) return left.then((left) => handleCodecAResult(left, def, ctx));
|
|
3243
|
+
return handleCodecAResult(left, def, ctx);
|
|
3244
|
+
} else {
|
|
3245
|
+
const right = def.out._zod.run(payload, ctx);
|
|
3246
|
+
if (right instanceof Promise) return right.then((right) => handleCodecAResult(right, def, ctx));
|
|
3247
|
+
return handleCodecAResult(right, def, ctx);
|
|
3248
|
+
}
|
|
3249
|
+
};
|
|
3250
|
+
});
|
|
3251
|
+
function handleCodecAResult(result, def, ctx) {
|
|
3252
|
+
if (result.issues.length) {
|
|
3253
|
+
result.aborted = true;
|
|
3254
|
+
return result;
|
|
3255
|
+
}
|
|
3256
|
+
if ((ctx.direction || "forward") === "forward") {
|
|
3257
|
+
const transformed = def.transform(result.value, result);
|
|
3258
|
+
if (transformed instanceof Promise) return transformed.then((value) => handleCodecTxResult(result, value, def.out, ctx));
|
|
3259
|
+
return handleCodecTxResult(result, transformed, def.out, ctx);
|
|
3260
|
+
} else {
|
|
3261
|
+
const transformed = def.reverseTransform(result.value, result);
|
|
3262
|
+
if (transformed instanceof Promise) return transformed.then((value) => handleCodecTxResult(result, value, def.in, ctx));
|
|
3263
|
+
return handleCodecTxResult(result, transformed, def.in, ctx);
|
|
3264
|
+
}
|
|
3265
|
+
}
|
|
3266
|
+
function handleCodecTxResult(left, value, nextSchema, ctx) {
|
|
3267
|
+
if (left.issues.length) {
|
|
3268
|
+
left.aborted = true;
|
|
3269
|
+
return left;
|
|
3270
|
+
}
|
|
3271
|
+
return nextSchema._zod.run({
|
|
3272
|
+
value,
|
|
3273
|
+
issues: left.issues
|
|
3274
|
+
}, ctx);
|
|
3275
|
+
}
|
|
3276
|
+
const $ZodPreprocess = /*@__PURE__*/ $constructor("$ZodPreprocess", (inst, def) => {
|
|
3277
|
+
$ZodPipe.init(inst, def);
|
|
3278
|
+
});
|
|
2089
3279
|
const $ZodReadonly = /*@__PURE__*/ $constructor("$ZodReadonly", (inst, def) => {
|
|
2090
3280
|
$ZodType.init(inst, def);
|
|
2091
3281
|
defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
|
|
@@ -2103,6 +3293,130 @@ function handleReadonlyResult(payload) {
|
|
|
2103
3293
|
payload.value = Object.freeze(payload.value);
|
|
2104
3294
|
return payload;
|
|
2105
3295
|
}
|
|
3296
|
+
const $ZodTemplateLiteral = /*@__PURE__*/ $constructor("$ZodTemplateLiteral", (inst, def) => {
|
|
3297
|
+
$ZodType.init(inst, def);
|
|
3298
|
+
const regexParts = [];
|
|
3299
|
+
for (const part of def.parts) if (typeof part === "object" && part !== null) {
|
|
3300
|
+
if (!part._zod.pattern) throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);
|
|
3301
|
+
const source = part._zod.pattern instanceof RegExp ? part._zod.pattern.source : part._zod.pattern;
|
|
3302
|
+
if (!source) throw new Error(`Invalid template literal part: ${part._zod.traits}`);
|
|
3303
|
+
const start = source.startsWith("^") ? 1 : 0;
|
|
3304
|
+
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
3305
|
+
regexParts.push(source.slice(start, end));
|
|
3306
|
+
} else if (part === null || primitiveTypes.has(typeof part)) regexParts.push(escapeRegex(`${part}`));
|
|
3307
|
+
else throw new Error(`Invalid template literal part: ${part}`);
|
|
3308
|
+
inst._zod.pattern = new RegExp(`^${regexParts.join("")}$`);
|
|
3309
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
3310
|
+
if (typeof payload.value !== "string") {
|
|
3311
|
+
payload.issues.push({
|
|
3312
|
+
input: payload.value,
|
|
3313
|
+
inst,
|
|
3314
|
+
expected: "string",
|
|
3315
|
+
code: "invalid_type"
|
|
3316
|
+
});
|
|
3317
|
+
return payload;
|
|
3318
|
+
}
|
|
3319
|
+
inst._zod.pattern.lastIndex = 0;
|
|
3320
|
+
if (!inst._zod.pattern.test(payload.value)) {
|
|
3321
|
+
payload.issues.push({
|
|
3322
|
+
input: payload.value,
|
|
3323
|
+
inst,
|
|
3324
|
+
code: "invalid_format",
|
|
3325
|
+
format: def.format ?? "template_literal",
|
|
3326
|
+
pattern: inst._zod.pattern.source
|
|
3327
|
+
});
|
|
3328
|
+
return payload;
|
|
3329
|
+
}
|
|
3330
|
+
return payload;
|
|
3331
|
+
};
|
|
3332
|
+
});
|
|
3333
|
+
const $ZodFunction = /*@__PURE__*/ $constructor("$ZodFunction", (inst, def) => {
|
|
3334
|
+
$ZodType.init(inst, def);
|
|
3335
|
+
inst._def = def;
|
|
3336
|
+
inst._zod.def = def;
|
|
3337
|
+
inst.implement = (func) => {
|
|
3338
|
+
if (typeof func !== "function") throw new Error("implement() must be called with a function");
|
|
3339
|
+
return function(...args) {
|
|
3340
|
+
const parsedArgs = inst._def.input ? parse$1(inst._def.input, args) : args;
|
|
3341
|
+
const result = Reflect.apply(func, this, parsedArgs);
|
|
3342
|
+
if (inst._def.output) return parse$1(inst._def.output, result);
|
|
3343
|
+
return result;
|
|
3344
|
+
};
|
|
3345
|
+
};
|
|
3346
|
+
inst.implementAsync = (func) => {
|
|
3347
|
+
if (typeof func !== "function") throw new Error("implementAsync() must be called with a function");
|
|
3348
|
+
return async function(...args) {
|
|
3349
|
+
const parsedArgs = inst._def.input ? await parseAsync$1(inst._def.input, args) : args;
|
|
3350
|
+
const result = await Reflect.apply(func, this, parsedArgs);
|
|
3351
|
+
if (inst._def.output) return await parseAsync$1(inst._def.output, result);
|
|
3352
|
+
return result;
|
|
3353
|
+
};
|
|
3354
|
+
};
|
|
3355
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
3356
|
+
if (typeof payload.value !== "function") {
|
|
3357
|
+
payload.issues.push({
|
|
3358
|
+
code: "invalid_type",
|
|
3359
|
+
expected: "function",
|
|
3360
|
+
input: payload.value,
|
|
3361
|
+
inst
|
|
3362
|
+
});
|
|
3363
|
+
return payload;
|
|
3364
|
+
}
|
|
3365
|
+
if (inst._def.output && inst._def.output._zod.def.type === "promise") payload.value = inst.implementAsync(payload.value);
|
|
3366
|
+
else payload.value = inst.implement(payload.value);
|
|
3367
|
+
return payload;
|
|
3368
|
+
};
|
|
3369
|
+
inst.input = (...args) => {
|
|
3370
|
+
const F = inst.constructor;
|
|
3371
|
+
if (Array.isArray(args[0])) return new F({
|
|
3372
|
+
type: "function",
|
|
3373
|
+
input: new $ZodTuple({
|
|
3374
|
+
type: "tuple",
|
|
3375
|
+
items: args[0],
|
|
3376
|
+
rest: args[1]
|
|
3377
|
+
}),
|
|
3378
|
+
output: inst._def.output
|
|
3379
|
+
});
|
|
3380
|
+
return new F({
|
|
3381
|
+
type: "function",
|
|
3382
|
+
input: args[0],
|
|
3383
|
+
output: inst._def.output
|
|
3384
|
+
});
|
|
3385
|
+
};
|
|
3386
|
+
inst.output = (output) => {
|
|
3387
|
+
const F = inst.constructor;
|
|
3388
|
+
return new F({
|
|
3389
|
+
type: "function",
|
|
3390
|
+
input: inst._def.input,
|
|
3391
|
+
output
|
|
3392
|
+
});
|
|
3393
|
+
};
|
|
3394
|
+
return inst;
|
|
3395
|
+
});
|
|
3396
|
+
const $ZodPromise = /*@__PURE__*/ $constructor("$ZodPromise", (inst, def) => {
|
|
3397
|
+
$ZodType.init(inst, def);
|
|
3398
|
+
inst._zod.parse = (payload, ctx) => {
|
|
3399
|
+
return Promise.resolve(payload.value).then((inner) => def.innerType._zod.run({
|
|
3400
|
+
value: inner,
|
|
3401
|
+
issues: []
|
|
3402
|
+
}, ctx));
|
|
3403
|
+
};
|
|
3404
|
+
});
|
|
3405
|
+
const $ZodLazy = /*@__PURE__*/ $constructor("$ZodLazy", (inst, def) => {
|
|
3406
|
+
$ZodType.init(inst, def);
|
|
3407
|
+
defineLazy(inst._zod, "innerType", () => {
|
|
3408
|
+
const d = def;
|
|
3409
|
+
if (!d._cachedInner) d._cachedInner = def.getter();
|
|
3410
|
+
return d._cachedInner;
|
|
3411
|
+
});
|
|
3412
|
+
defineLazy(inst._zod, "pattern", () => inst._zod.innerType?._zod?.pattern);
|
|
3413
|
+
defineLazy(inst._zod, "propValues", () => inst._zod.innerType?._zod?.propValues);
|
|
3414
|
+
defineLazy(inst._zod, "optin", () => inst._zod.innerType?._zod?.optin ?? void 0);
|
|
3415
|
+
defineLazy(inst._zod, "optout", () => inst._zod.innerType?._zod?.optout ?? void 0);
|
|
3416
|
+
inst._zod.parse = (payload, ctx) => {
|
|
3417
|
+
return inst._zod.innerType._zod.run(payload, ctx);
|
|
3418
|
+
};
|
|
3419
|
+
});
|
|
2106
3420
|
const $ZodCustom = /*@__PURE__*/ $constructor("$ZodCustom", (inst, def) => {
|
|
2107
3421
|
$ZodCheck.init(inst, def);
|
|
2108
3422
|
$ZodType.init(inst, def);
|
|
@@ -2132,6 +3446,8 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
2132
3446
|
//#endregion
|
|
2133
3447
|
//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/registries.js
|
|
2134
3448
|
var _a;
|
|
3449
|
+
const $output = Symbol("ZodOutput");
|
|
3450
|
+
const $input = Symbol("ZodInput");
|
|
2135
3451
|
var $ZodRegistry = class {
|
|
2136
3452
|
constructor() {
|
|
2137
3453
|
this._map = /* @__PURE__ */ new WeakMap();
|
|
@@ -2186,6 +3502,14 @@ function _string(Class, params) {
|
|
|
2186
3502
|
});
|
|
2187
3503
|
}
|
|
2188
3504
|
// @__NO_SIDE_EFFECTS__
|
|
3505
|
+
function _coercedString(Class, params) {
|
|
3506
|
+
return new Class({
|
|
3507
|
+
type: "string",
|
|
3508
|
+
coerce: true,
|
|
3509
|
+
...normalizeParams(params)
|
|
3510
|
+
});
|
|
3511
|
+
}
|
|
3512
|
+
// @__NO_SIDE_EFFECTS__
|
|
2189
3513
|
function _email(Class, params) {
|
|
2190
3514
|
return new Class({
|
|
2191
3515
|
type: "string",
|
|
@@ -2354,6 +3678,16 @@ function _ipv6(Class, params) {
|
|
|
2354
3678
|
});
|
|
2355
3679
|
}
|
|
2356
3680
|
// @__NO_SIDE_EFFECTS__
|
|
3681
|
+
function _mac(Class, params) {
|
|
3682
|
+
return new Class({
|
|
3683
|
+
type: "string",
|
|
3684
|
+
format: "mac",
|
|
3685
|
+
check: "string_format",
|
|
3686
|
+
abort: false,
|
|
3687
|
+
...normalizeParams(params)
|
|
3688
|
+
});
|
|
3689
|
+
}
|
|
3690
|
+
// @__NO_SIDE_EFFECTS__
|
|
2357
3691
|
function _cidrv4(Class, params) {
|
|
2358
3692
|
return new Class({
|
|
2359
3693
|
type: "string",
|
|
@@ -2413,6 +3747,13 @@ function _jwt(Class, params) {
|
|
|
2413
3747
|
...normalizeParams(params)
|
|
2414
3748
|
});
|
|
2415
3749
|
}
|
|
3750
|
+
const TimePrecision = {
|
|
3751
|
+
Any: null,
|
|
3752
|
+
Minute: -1,
|
|
3753
|
+
Second: 0,
|
|
3754
|
+
Millisecond: 3,
|
|
3755
|
+
Microsecond: 6
|
|
3756
|
+
};
|
|
2416
3757
|
// @__NO_SIDE_EFFECTS__
|
|
2417
3758
|
function _isoDateTime(Class, params) {
|
|
2418
3759
|
return new Class({
|
|
@@ -2426,66 +3767,212 @@ function _isoDateTime(Class, params) {
|
|
|
2426
3767
|
});
|
|
2427
3768
|
}
|
|
2428
3769
|
// @__NO_SIDE_EFFECTS__
|
|
2429
|
-
function _isoDate(Class, params) {
|
|
3770
|
+
function _isoDate(Class, params) {
|
|
3771
|
+
return new Class({
|
|
3772
|
+
type: "string",
|
|
3773
|
+
format: "date",
|
|
3774
|
+
check: "string_format",
|
|
3775
|
+
...normalizeParams(params)
|
|
3776
|
+
});
|
|
3777
|
+
}
|
|
3778
|
+
// @__NO_SIDE_EFFECTS__
|
|
3779
|
+
function _isoTime(Class, params) {
|
|
3780
|
+
return new Class({
|
|
3781
|
+
type: "string",
|
|
3782
|
+
format: "time",
|
|
3783
|
+
check: "string_format",
|
|
3784
|
+
precision: null,
|
|
3785
|
+
...normalizeParams(params)
|
|
3786
|
+
});
|
|
3787
|
+
}
|
|
3788
|
+
// @__NO_SIDE_EFFECTS__
|
|
3789
|
+
function _isoDuration(Class, params) {
|
|
3790
|
+
return new Class({
|
|
3791
|
+
type: "string",
|
|
3792
|
+
format: "duration",
|
|
3793
|
+
check: "string_format",
|
|
3794
|
+
...normalizeParams(params)
|
|
3795
|
+
});
|
|
3796
|
+
}
|
|
3797
|
+
// @__NO_SIDE_EFFECTS__
|
|
3798
|
+
function _number(Class, params) {
|
|
3799
|
+
return new Class({
|
|
3800
|
+
type: "number",
|
|
3801
|
+
checks: [],
|
|
3802
|
+
...normalizeParams(params)
|
|
3803
|
+
});
|
|
3804
|
+
}
|
|
3805
|
+
// @__NO_SIDE_EFFECTS__
|
|
3806
|
+
function _coercedNumber(Class, params) {
|
|
3807
|
+
return new Class({
|
|
3808
|
+
type: "number",
|
|
3809
|
+
coerce: true,
|
|
3810
|
+
checks: [],
|
|
3811
|
+
...normalizeParams(params)
|
|
3812
|
+
});
|
|
3813
|
+
}
|
|
3814
|
+
// @__NO_SIDE_EFFECTS__
|
|
3815
|
+
function _int(Class, params) {
|
|
3816
|
+
return new Class({
|
|
3817
|
+
type: "number",
|
|
3818
|
+
check: "number_format",
|
|
3819
|
+
abort: false,
|
|
3820
|
+
format: "safeint",
|
|
3821
|
+
...normalizeParams(params)
|
|
3822
|
+
});
|
|
3823
|
+
}
|
|
3824
|
+
// @__NO_SIDE_EFFECTS__
|
|
3825
|
+
function _float32(Class, params) {
|
|
3826
|
+
return new Class({
|
|
3827
|
+
type: "number",
|
|
3828
|
+
check: "number_format",
|
|
3829
|
+
abort: false,
|
|
3830
|
+
format: "float32",
|
|
3831
|
+
...normalizeParams(params)
|
|
3832
|
+
});
|
|
3833
|
+
}
|
|
3834
|
+
// @__NO_SIDE_EFFECTS__
|
|
3835
|
+
function _float64(Class, params) {
|
|
3836
|
+
return new Class({
|
|
3837
|
+
type: "number",
|
|
3838
|
+
check: "number_format",
|
|
3839
|
+
abort: false,
|
|
3840
|
+
format: "float64",
|
|
3841
|
+
...normalizeParams(params)
|
|
3842
|
+
});
|
|
3843
|
+
}
|
|
3844
|
+
// @__NO_SIDE_EFFECTS__
|
|
3845
|
+
function _int32(Class, params) {
|
|
3846
|
+
return new Class({
|
|
3847
|
+
type: "number",
|
|
3848
|
+
check: "number_format",
|
|
3849
|
+
abort: false,
|
|
3850
|
+
format: "int32",
|
|
3851
|
+
...normalizeParams(params)
|
|
3852
|
+
});
|
|
3853
|
+
}
|
|
3854
|
+
// @__NO_SIDE_EFFECTS__
|
|
3855
|
+
function _uint32(Class, params) {
|
|
3856
|
+
return new Class({
|
|
3857
|
+
type: "number",
|
|
3858
|
+
check: "number_format",
|
|
3859
|
+
abort: false,
|
|
3860
|
+
format: "uint32",
|
|
3861
|
+
...normalizeParams(params)
|
|
3862
|
+
});
|
|
3863
|
+
}
|
|
3864
|
+
// @__NO_SIDE_EFFECTS__
|
|
3865
|
+
function _boolean(Class, params) {
|
|
3866
|
+
return new Class({
|
|
3867
|
+
type: "boolean",
|
|
3868
|
+
...normalizeParams(params)
|
|
3869
|
+
});
|
|
3870
|
+
}
|
|
3871
|
+
// @__NO_SIDE_EFFECTS__
|
|
3872
|
+
function _coercedBoolean(Class, params) {
|
|
3873
|
+
return new Class({
|
|
3874
|
+
type: "boolean",
|
|
3875
|
+
coerce: true,
|
|
3876
|
+
...normalizeParams(params)
|
|
3877
|
+
});
|
|
3878
|
+
}
|
|
3879
|
+
// @__NO_SIDE_EFFECTS__
|
|
3880
|
+
function _bigint(Class, params) {
|
|
3881
|
+
return new Class({
|
|
3882
|
+
type: "bigint",
|
|
3883
|
+
...normalizeParams(params)
|
|
3884
|
+
});
|
|
3885
|
+
}
|
|
3886
|
+
// @__NO_SIDE_EFFECTS__
|
|
3887
|
+
function _coercedBigint(Class, params) {
|
|
3888
|
+
return new Class({
|
|
3889
|
+
type: "bigint",
|
|
3890
|
+
coerce: true,
|
|
3891
|
+
...normalizeParams(params)
|
|
3892
|
+
});
|
|
3893
|
+
}
|
|
3894
|
+
// @__NO_SIDE_EFFECTS__
|
|
3895
|
+
function _int64(Class, params) {
|
|
3896
|
+
return new Class({
|
|
3897
|
+
type: "bigint",
|
|
3898
|
+
check: "bigint_format",
|
|
3899
|
+
abort: false,
|
|
3900
|
+
format: "int64",
|
|
3901
|
+
...normalizeParams(params)
|
|
3902
|
+
});
|
|
3903
|
+
}
|
|
3904
|
+
// @__NO_SIDE_EFFECTS__
|
|
3905
|
+
function _uint64(Class, params) {
|
|
3906
|
+
return new Class({
|
|
3907
|
+
type: "bigint",
|
|
3908
|
+
check: "bigint_format",
|
|
3909
|
+
abort: false,
|
|
3910
|
+
format: "uint64",
|
|
3911
|
+
...normalizeParams(params)
|
|
3912
|
+
});
|
|
3913
|
+
}
|
|
3914
|
+
// @__NO_SIDE_EFFECTS__
|
|
3915
|
+
function _symbol(Class, params) {
|
|
2430
3916
|
return new Class({
|
|
2431
|
-
type: "
|
|
2432
|
-
format: "date",
|
|
2433
|
-
check: "string_format",
|
|
3917
|
+
type: "symbol",
|
|
2434
3918
|
...normalizeParams(params)
|
|
2435
3919
|
});
|
|
2436
3920
|
}
|
|
2437
3921
|
// @__NO_SIDE_EFFECTS__
|
|
2438
|
-
function
|
|
3922
|
+
function _undefined$1(Class, params) {
|
|
2439
3923
|
return new Class({
|
|
2440
|
-
type: "
|
|
2441
|
-
format: "time",
|
|
2442
|
-
check: "string_format",
|
|
2443
|
-
precision: null,
|
|
3924
|
+
type: "undefined",
|
|
2444
3925
|
...normalizeParams(params)
|
|
2445
3926
|
});
|
|
2446
3927
|
}
|
|
2447
3928
|
// @__NO_SIDE_EFFECTS__
|
|
2448
|
-
function
|
|
3929
|
+
function _null$1(Class, params) {
|
|
2449
3930
|
return new Class({
|
|
2450
|
-
type: "
|
|
2451
|
-
format: "duration",
|
|
2452
|
-
check: "string_format",
|
|
3931
|
+
type: "null",
|
|
2453
3932
|
...normalizeParams(params)
|
|
2454
3933
|
});
|
|
2455
3934
|
}
|
|
2456
3935
|
// @__NO_SIDE_EFFECTS__
|
|
2457
|
-
function
|
|
3936
|
+
function _any(Class) {
|
|
3937
|
+
return new Class({ type: "any" });
|
|
3938
|
+
}
|
|
3939
|
+
// @__NO_SIDE_EFFECTS__
|
|
3940
|
+
function _unknown(Class) {
|
|
3941
|
+
return new Class({ type: "unknown" });
|
|
3942
|
+
}
|
|
3943
|
+
// @__NO_SIDE_EFFECTS__
|
|
3944
|
+
function _never(Class, params) {
|
|
2458
3945
|
return new Class({
|
|
2459
|
-
type: "
|
|
2460
|
-
checks: [],
|
|
3946
|
+
type: "never",
|
|
2461
3947
|
...normalizeParams(params)
|
|
2462
3948
|
});
|
|
2463
3949
|
}
|
|
2464
3950
|
// @__NO_SIDE_EFFECTS__
|
|
2465
|
-
function
|
|
3951
|
+
function _void$1(Class, params) {
|
|
2466
3952
|
return new Class({
|
|
2467
|
-
type: "
|
|
2468
|
-
check: "number_format",
|
|
2469
|
-
abort: false,
|
|
2470
|
-
format: "safeint",
|
|
3953
|
+
type: "void",
|
|
2471
3954
|
...normalizeParams(params)
|
|
2472
3955
|
});
|
|
2473
3956
|
}
|
|
2474
3957
|
// @__NO_SIDE_EFFECTS__
|
|
2475
|
-
function
|
|
3958
|
+
function _date(Class, params) {
|
|
2476
3959
|
return new Class({
|
|
2477
|
-
type: "
|
|
3960
|
+
type: "date",
|
|
2478
3961
|
...normalizeParams(params)
|
|
2479
3962
|
});
|
|
2480
3963
|
}
|
|
2481
3964
|
// @__NO_SIDE_EFFECTS__
|
|
2482
|
-
function
|
|
2483
|
-
return new Class({
|
|
3965
|
+
function _coercedDate(Class, params) {
|
|
3966
|
+
return new Class({
|
|
3967
|
+
type: "date",
|
|
3968
|
+
coerce: true,
|
|
3969
|
+
...normalizeParams(params)
|
|
3970
|
+
});
|
|
2484
3971
|
}
|
|
2485
3972
|
// @__NO_SIDE_EFFECTS__
|
|
2486
|
-
function
|
|
3973
|
+
function _nan(Class, params) {
|
|
2487
3974
|
return new Class({
|
|
2488
|
-
type: "
|
|
3975
|
+
type: "nan",
|
|
2489
3976
|
...normalizeParams(params)
|
|
2490
3977
|
});
|
|
2491
3978
|
}
|
|
@@ -2526,6 +4013,22 @@ function _gte(value, params) {
|
|
|
2526
4013
|
});
|
|
2527
4014
|
}
|
|
2528
4015
|
// @__NO_SIDE_EFFECTS__
|
|
4016
|
+
function _positive(params) {
|
|
4017
|
+
return /* @__PURE__ */ _gt(0, params);
|
|
4018
|
+
}
|
|
4019
|
+
// @__NO_SIDE_EFFECTS__
|
|
4020
|
+
function _negative(params) {
|
|
4021
|
+
return /* @__PURE__ */ _lt(0, params);
|
|
4022
|
+
}
|
|
4023
|
+
// @__NO_SIDE_EFFECTS__
|
|
4024
|
+
function _nonpositive(params) {
|
|
4025
|
+
return /* @__PURE__ */ _lte(0, params);
|
|
4026
|
+
}
|
|
4027
|
+
// @__NO_SIDE_EFFECTS__
|
|
4028
|
+
function _nonnegative(params) {
|
|
4029
|
+
return /* @__PURE__ */ _gte(0, params);
|
|
4030
|
+
}
|
|
4031
|
+
// @__NO_SIDE_EFFECTS__
|
|
2529
4032
|
function _multipleOf(value, params) {
|
|
2530
4033
|
return new $ZodCheckMultipleOf({
|
|
2531
4034
|
check: "multiple_of",
|
|
@@ -2534,6 +4037,30 @@ function _multipleOf(value, params) {
|
|
|
2534
4037
|
});
|
|
2535
4038
|
}
|
|
2536
4039
|
// @__NO_SIDE_EFFECTS__
|
|
4040
|
+
function _maxSize(maximum, params) {
|
|
4041
|
+
return new $ZodCheckMaxSize({
|
|
4042
|
+
check: "max_size",
|
|
4043
|
+
...normalizeParams(params),
|
|
4044
|
+
maximum
|
|
4045
|
+
});
|
|
4046
|
+
}
|
|
4047
|
+
// @__NO_SIDE_EFFECTS__
|
|
4048
|
+
function _minSize(minimum, params) {
|
|
4049
|
+
return new $ZodCheckMinSize({
|
|
4050
|
+
check: "min_size",
|
|
4051
|
+
...normalizeParams(params),
|
|
4052
|
+
minimum
|
|
4053
|
+
});
|
|
4054
|
+
}
|
|
4055
|
+
// @__NO_SIDE_EFFECTS__
|
|
4056
|
+
function _size(size, params) {
|
|
4057
|
+
return new $ZodCheckSizeEquals({
|
|
4058
|
+
check: "size_equals",
|
|
4059
|
+
...normalizeParams(params),
|
|
4060
|
+
size
|
|
4061
|
+
});
|
|
4062
|
+
}
|
|
4063
|
+
// @__NO_SIDE_EFFECTS__
|
|
2537
4064
|
function _maxLength(maximum, params) {
|
|
2538
4065
|
return new $ZodCheckMaxLength({
|
|
2539
4066
|
check: "max_length",
|
|
@@ -2610,6 +4137,23 @@ function _endsWith(suffix, params) {
|
|
|
2610
4137
|
});
|
|
2611
4138
|
}
|
|
2612
4139
|
// @__NO_SIDE_EFFECTS__
|
|
4140
|
+
function _property(property, schema, params) {
|
|
4141
|
+
return new $ZodCheckProperty({
|
|
4142
|
+
check: "property",
|
|
4143
|
+
property,
|
|
4144
|
+
schema,
|
|
4145
|
+
...normalizeParams(params)
|
|
4146
|
+
});
|
|
4147
|
+
}
|
|
4148
|
+
// @__NO_SIDE_EFFECTS__
|
|
4149
|
+
function _mime(types, params) {
|
|
4150
|
+
return new $ZodCheckMimeType({
|
|
4151
|
+
check: "mime_type",
|
|
4152
|
+
mime: types,
|
|
4153
|
+
...normalizeParams(params)
|
|
4154
|
+
});
|
|
4155
|
+
}
|
|
4156
|
+
// @__NO_SIDE_EFFECTS__
|
|
2613
4157
|
function _overwrite(tx) {
|
|
2614
4158
|
return new $ZodCheckOverwrite({
|
|
2615
4159
|
check: "overwrite",
|
|
@@ -2645,6 +4189,215 @@ function _array(Class, element, params) {
|
|
|
2645
4189
|
});
|
|
2646
4190
|
}
|
|
2647
4191
|
// @__NO_SIDE_EFFECTS__
|
|
4192
|
+
function _union(Class, options, params) {
|
|
4193
|
+
return new Class({
|
|
4194
|
+
type: "union",
|
|
4195
|
+
options,
|
|
4196
|
+
...normalizeParams(params)
|
|
4197
|
+
});
|
|
4198
|
+
}
|
|
4199
|
+
function _xor(Class, options, params) {
|
|
4200
|
+
return new Class({
|
|
4201
|
+
type: "union",
|
|
4202
|
+
options,
|
|
4203
|
+
inclusive: false,
|
|
4204
|
+
...normalizeParams(params)
|
|
4205
|
+
});
|
|
4206
|
+
}
|
|
4207
|
+
// @__NO_SIDE_EFFECTS__
|
|
4208
|
+
function _discriminatedUnion(Class, discriminator, options, params) {
|
|
4209
|
+
return new Class({
|
|
4210
|
+
type: "union",
|
|
4211
|
+
options,
|
|
4212
|
+
discriminator,
|
|
4213
|
+
...normalizeParams(params)
|
|
4214
|
+
});
|
|
4215
|
+
}
|
|
4216
|
+
// @__NO_SIDE_EFFECTS__
|
|
4217
|
+
function _intersection(Class, left, right) {
|
|
4218
|
+
return new Class({
|
|
4219
|
+
type: "intersection",
|
|
4220
|
+
left,
|
|
4221
|
+
right
|
|
4222
|
+
});
|
|
4223
|
+
}
|
|
4224
|
+
// @__NO_SIDE_EFFECTS__
|
|
4225
|
+
function _tuple(Class, items, _paramsOrRest, _params) {
|
|
4226
|
+
const hasRest = _paramsOrRest instanceof $ZodType;
|
|
4227
|
+
return new Class({
|
|
4228
|
+
type: "tuple",
|
|
4229
|
+
items,
|
|
4230
|
+
rest: hasRest ? _paramsOrRest : null,
|
|
4231
|
+
...normalizeParams(hasRest ? _params : _paramsOrRest)
|
|
4232
|
+
});
|
|
4233
|
+
}
|
|
4234
|
+
// @__NO_SIDE_EFFECTS__
|
|
4235
|
+
function _record(Class, keyType, valueType, params) {
|
|
4236
|
+
return new Class({
|
|
4237
|
+
type: "record",
|
|
4238
|
+
keyType,
|
|
4239
|
+
valueType,
|
|
4240
|
+
...normalizeParams(params)
|
|
4241
|
+
});
|
|
4242
|
+
}
|
|
4243
|
+
// @__NO_SIDE_EFFECTS__
|
|
4244
|
+
function _map(Class, keyType, valueType, params) {
|
|
4245
|
+
return new Class({
|
|
4246
|
+
type: "map",
|
|
4247
|
+
keyType,
|
|
4248
|
+
valueType,
|
|
4249
|
+
...normalizeParams(params)
|
|
4250
|
+
});
|
|
4251
|
+
}
|
|
4252
|
+
// @__NO_SIDE_EFFECTS__
|
|
4253
|
+
function _set(Class, valueType, params) {
|
|
4254
|
+
return new Class({
|
|
4255
|
+
type: "set",
|
|
4256
|
+
valueType,
|
|
4257
|
+
...normalizeParams(params)
|
|
4258
|
+
});
|
|
4259
|
+
}
|
|
4260
|
+
// @__NO_SIDE_EFFECTS__
|
|
4261
|
+
function _enum$1(Class, values, params) {
|
|
4262
|
+
return new Class({
|
|
4263
|
+
type: "enum",
|
|
4264
|
+
entries: Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values,
|
|
4265
|
+
...normalizeParams(params)
|
|
4266
|
+
});
|
|
4267
|
+
}
|
|
4268
|
+
/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
|
|
4269
|
+
*
|
|
4270
|
+
* ```ts
|
|
4271
|
+
* enum Colors { red, green, blue }
|
|
4272
|
+
* z.enum(Colors);
|
|
4273
|
+
* ```
|
|
4274
|
+
*/
|
|
4275
|
+
// @__NO_SIDE_EFFECTS__
|
|
4276
|
+
function _nativeEnum(Class, entries, params) {
|
|
4277
|
+
return new Class({
|
|
4278
|
+
type: "enum",
|
|
4279
|
+
entries,
|
|
4280
|
+
...normalizeParams(params)
|
|
4281
|
+
});
|
|
4282
|
+
}
|
|
4283
|
+
// @__NO_SIDE_EFFECTS__
|
|
4284
|
+
function _literal(Class, value, params) {
|
|
4285
|
+
return new Class({
|
|
4286
|
+
type: "literal",
|
|
4287
|
+
values: Array.isArray(value) ? value : [value],
|
|
4288
|
+
...normalizeParams(params)
|
|
4289
|
+
});
|
|
4290
|
+
}
|
|
4291
|
+
// @__NO_SIDE_EFFECTS__
|
|
4292
|
+
function _file(Class, params) {
|
|
4293
|
+
return new Class({
|
|
4294
|
+
type: "file",
|
|
4295
|
+
...normalizeParams(params)
|
|
4296
|
+
});
|
|
4297
|
+
}
|
|
4298
|
+
// @__NO_SIDE_EFFECTS__
|
|
4299
|
+
function _transform(Class, fn) {
|
|
4300
|
+
return new Class({
|
|
4301
|
+
type: "transform",
|
|
4302
|
+
transform: fn
|
|
4303
|
+
});
|
|
4304
|
+
}
|
|
4305
|
+
// @__NO_SIDE_EFFECTS__
|
|
4306
|
+
function _optional(Class, innerType) {
|
|
4307
|
+
return new Class({
|
|
4308
|
+
type: "optional",
|
|
4309
|
+
innerType
|
|
4310
|
+
});
|
|
4311
|
+
}
|
|
4312
|
+
// @__NO_SIDE_EFFECTS__
|
|
4313
|
+
function _nullable(Class, innerType) {
|
|
4314
|
+
return new Class({
|
|
4315
|
+
type: "nullable",
|
|
4316
|
+
innerType
|
|
4317
|
+
});
|
|
4318
|
+
}
|
|
4319
|
+
// @__NO_SIDE_EFFECTS__
|
|
4320
|
+
function _default$1(Class, innerType, defaultValue) {
|
|
4321
|
+
return new Class({
|
|
4322
|
+
type: "default",
|
|
4323
|
+
innerType,
|
|
4324
|
+
get defaultValue() {
|
|
4325
|
+
return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
|
|
4326
|
+
}
|
|
4327
|
+
});
|
|
4328
|
+
}
|
|
4329
|
+
// @__NO_SIDE_EFFECTS__
|
|
4330
|
+
function _nonoptional(Class, innerType, params) {
|
|
4331
|
+
return new Class({
|
|
4332
|
+
type: "nonoptional",
|
|
4333
|
+
innerType,
|
|
4334
|
+
...normalizeParams(params)
|
|
4335
|
+
});
|
|
4336
|
+
}
|
|
4337
|
+
// @__NO_SIDE_EFFECTS__
|
|
4338
|
+
function _success(Class, innerType) {
|
|
4339
|
+
return new Class({
|
|
4340
|
+
type: "success",
|
|
4341
|
+
innerType
|
|
4342
|
+
});
|
|
4343
|
+
}
|
|
4344
|
+
// @__NO_SIDE_EFFECTS__
|
|
4345
|
+
function _catch$1(Class, innerType, catchValue) {
|
|
4346
|
+
return new Class({
|
|
4347
|
+
type: "catch",
|
|
4348
|
+
innerType,
|
|
4349
|
+
catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
|
|
4350
|
+
});
|
|
4351
|
+
}
|
|
4352
|
+
// @__NO_SIDE_EFFECTS__
|
|
4353
|
+
function _pipe(Class, in_, out) {
|
|
4354
|
+
return new Class({
|
|
4355
|
+
type: "pipe",
|
|
4356
|
+
in: in_,
|
|
4357
|
+
out
|
|
4358
|
+
});
|
|
4359
|
+
}
|
|
4360
|
+
// @__NO_SIDE_EFFECTS__
|
|
4361
|
+
function _readonly(Class, innerType) {
|
|
4362
|
+
return new Class({
|
|
4363
|
+
type: "readonly",
|
|
4364
|
+
innerType
|
|
4365
|
+
});
|
|
4366
|
+
}
|
|
4367
|
+
// @__NO_SIDE_EFFECTS__
|
|
4368
|
+
function _templateLiteral(Class, parts, params) {
|
|
4369
|
+
return new Class({
|
|
4370
|
+
type: "template_literal",
|
|
4371
|
+
parts,
|
|
4372
|
+
...normalizeParams(params)
|
|
4373
|
+
});
|
|
4374
|
+
}
|
|
4375
|
+
// @__NO_SIDE_EFFECTS__
|
|
4376
|
+
function _lazy(Class, getter) {
|
|
4377
|
+
return new Class({
|
|
4378
|
+
type: "lazy",
|
|
4379
|
+
getter
|
|
4380
|
+
});
|
|
4381
|
+
}
|
|
4382
|
+
// @__NO_SIDE_EFFECTS__
|
|
4383
|
+
function _promise(Class, innerType) {
|
|
4384
|
+
return new Class({
|
|
4385
|
+
type: "promise",
|
|
4386
|
+
innerType
|
|
4387
|
+
});
|
|
4388
|
+
}
|
|
4389
|
+
// @__NO_SIDE_EFFECTS__
|
|
4390
|
+
function _custom(Class, fn, _params) {
|
|
4391
|
+
const norm = normalizeParams(_params);
|
|
4392
|
+
norm.abort ?? (norm.abort = true);
|
|
4393
|
+
return new Class({
|
|
4394
|
+
type: "custom",
|
|
4395
|
+
check: "custom",
|
|
4396
|
+
fn,
|
|
4397
|
+
...norm
|
|
4398
|
+
});
|
|
4399
|
+
}
|
|
4400
|
+
// @__NO_SIDE_EFFECTS__
|
|
2648
4401
|
function _refine(Class, fn, _params) {
|
|
2649
4402
|
return new Class({
|
|
2650
4403
|
type: "custom",
|
|
@@ -2681,6 +4434,108 @@ function _check(fn, params) {
|
|
|
2681
4434
|
ch._zod.check = fn;
|
|
2682
4435
|
return ch;
|
|
2683
4436
|
}
|
|
4437
|
+
// @__NO_SIDE_EFFECTS__
|
|
4438
|
+
function describe$1(description) {
|
|
4439
|
+
const ch = new $ZodCheck({ check: "describe" });
|
|
4440
|
+
ch._zod.onattach = [(inst) => {
|
|
4441
|
+
const existing = globalRegistry.get(inst) ?? {};
|
|
4442
|
+
globalRegistry.add(inst, {
|
|
4443
|
+
...existing,
|
|
4444
|
+
description
|
|
4445
|
+
});
|
|
4446
|
+
}];
|
|
4447
|
+
ch._zod.check = () => {};
|
|
4448
|
+
return ch;
|
|
4449
|
+
}
|
|
4450
|
+
// @__NO_SIDE_EFFECTS__
|
|
4451
|
+
function meta$1(metadata) {
|
|
4452
|
+
const ch = new $ZodCheck({ check: "meta" });
|
|
4453
|
+
ch._zod.onattach = [(inst) => {
|
|
4454
|
+
const existing = globalRegistry.get(inst) ?? {};
|
|
4455
|
+
globalRegistry.add(inst, {
|
|
4456
|
+
...existing,
|
|
4457
|
+
...metadata
|
|
4458
|
+
});
|
|
4459
|
+
}];
|
|
4460
|
+
ch._zod.check = () => {};
|
|
4461
|
+
return ch;
|
|
4462
|
+
}
|
|
4463
|
+
// @__NO_SIDE_EFFECTS__
|
|
4464
|
+
function _stringbool(Classes, _params) {
|
|
4465
|
+
const params = normalizeParams(_params);
|
|
4466
|
+
let truthyArray = params.truthy ?? [
|
|
4467
|
+
"true",
|
|
4468
|
+
"1",
|
|
4469
|
+
"yes",
|
|
4470
|
+
"on",
|
|
4471
|
+
"y",
|
|
4472
|
+
"enabled"
|
|
4473
|
+
];
|
|
4474
|
+
let falsyArray = params.falsy ?? [
|
|
4475
|
+
"false",
|
|
4476
|
+
"0",
|
|
4477
|
+
"no",
|
|
4478
|
+
"off",
|
|
4479
|
+
"n",
|
|
4480
|
+
"disabled"
|
|
4481
|
+
];
|
|
4482
|
+
if (params.case !== "sensitive") {
|
|
4483
|
+
truthyArray = truthyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
|
|
4484
|
+
falsyArray = falsyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
|
|
4485
|
+
}
|
|
4486
|
+
const truthySet = new Set(truthyArray);
|
|
4487
|
+
const falsySet = new Set(falsyArray);
|
|
4488
|
+
const _Codec = Classes.Codec ?? $ZodCodec;
|
|
4489
|
+
const _Boolean = Classes.Boolean ?? $ZodBoolean;
|
|
4490
|
+
const codec = new _Codec({
|
|
4491
|
+
type: "pipe",
|
|
4492
|
+
in: new (Classes.String ?? $ZodString)({
|
|
4493
|
+
type: "string",
|
|
4494
|
+
error: params.error
|
|
4495
|
+
}),
|
|
4496
|
+
out: new _Boolean({
|
|
4497
|
+
type: "boolean",
|
|
4498
|
+
error: params.error
|
|
4499
|
+
}),
|
|
4500
|
+
transform: ((input, payload) => {
|
|
4501
|
+
let data = input;
|
|
4502
|
+
if (params.case !== "sensitive") data = data.toLowerCase();
|
|
4503
|
+
if (truthySet.has(data)) return true;
|
|
4504
|
+
else if (falsySet.has(data)) return false;
|
|
4505
|
+
else {
|
|
4506
|
+
payload.issues.push({
|
|
4507
|
+
code: "invalid_value",
|
|
4508
|
+
expected: "stringbool",
|
|
4509
|
+
values: [...truthySet, ...falsySet],
|
|
4510
|
+
input: payload.value,
|
|
4511
|
+
inst: codec,
|
|
4512
|
+
continue: false
|
|
4513
|
+
});
|
|
4514
|
+
return {};
|
|
4515
|
+
}
|
|
4516
|
+
}),
|
|
4517
|
+
reverseTransform: ((input, _payload) => {
|
|
4518
|
+
if (input === true) return truthyArray[0] || "true";
|
|
4519
|
+
else return falsyArray[0] || "false";
|
|
4520
|
+
}),
|
|
4521
|
+
error: params.error
|
|
4522
|
+
});
|
|
4523
|
+
return codec;
|
|
4524
|
+
}
|
|
4525
|
+
// @__NO_SIDE_EFFECTS__
|
|
4526
|
+
function _stringFormat(Class, format, fnOrRegex, _params = {}) {
|
|
4527
|
+
const params = normalizeParams(_params);
|
|
4528
|
+
const def = {
|
|
4529
|
+
...normalizeParams(_params),
|
|
4530
|
+
check: "string_format",
|
|
4531
|
+
type: "string",
|
|
4532
|
+
format,
|
|
4533
|
+
fn: typeof fnOrRegex === "function" ? fnOrRegex : (val) => fnOrRegex.test(val),
|
|
4534
|
+
...params
|
|
4535
|
+
};
|
|
4536
|
+
if (fnOrRegex instanceof RegExp) def.pattern = fnOrRegex;
|
|
4537
|
+
return new Class(def);
|
|
4538
|
+
}
|
|
2684
4539
|
//#endregion
|
|
2685
4540
|
//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/to-json-schema.js
|
|
2686
4541
|
function initializeContext(params) {
|
|
@@ -3031,9 +4886,33 @@ const numberProcessor = (schema, ctx, _json, _params) => {
|
|
|
3031
4886
|
const booleanProcessor = (_schema, _ctx, json, _params) => {
|
|
3032
4887
|
json.type = "boolean";
|
|
3033
4888
|
};
|
|
4889
|
+
const bigintProcessor = (_schema, ctx, _json, _params) => {
|
|
4890
|
+
if (ctx.unrepresentable === "throw") throw new Error("BigInt cannot be represented in JSON Schema");
|
|
4891
|
+
};
|
|
4892
|
+
const symbolProcessor = (_schema, ctx, _json, _params) => {
|
|
4893
|
+
if (ctx.unrepresentable === "throw") throw new Error("Symbols cannot be represented in JSON Schema");
|
|
4894
|
+
};
|
|
4895
|
+
const nullProcessor = (_schema, ctx, json, _params) => {
|
|
4896
|
+
if (ctx.target === "openapi-3.0") {
|
|
4897
|
+
json.type = "string";
|
|
4898
|
+
json.nullable = true;
|
|
4899
|
+
json.enum = [null];
|
|
4900
|
+
} else json.type = "null";
|
|
4901
|
+
};
|
|
4902
|
+
const undefinedProcessor = (_schema, ctx, _json, _params) => {
|
|
4903
|
+
if (ctx.unrepresentable === "throw") throw new Error("Undefined cannot be represented in JSON Schema");
|
|
4904
|
+
};
|
|
4905
|
+
const voidProcessor = (_schema, ctx, _json, _params) => {
|
|
4906
|
+
if (ctx.unrepresentable === "throw") throw new Error("Void cannot be represented in JSON Schema");
|
|
4907
|
+
};
|
|
3034
4908
|
const neverProcessor = (_schema, _ctx, json, _params) => {
|
|
3035
4909
|
json.not = {};
|
|
3036
4910
|
};
|
|
4911
|
+
const anyProcessor = (_schema, _ctx, _json, _params) => {};
|
|
4912
|
+
const unknownProcessor = (_schema, _ctx, _json, _params) => {};
|
|
4913
|
+
const dateProcessor = (_schema, ctx, _json, _params) => {
|
|
4914
|
+
if (ctx.unrepresentable === "throw") throw new Error("Date cannot be represented in JSON Schema");
|
|
4915
|
+
};
|
|
3037
4916
|
const enumProcessor = (schema, _ctx, json, _params) => {
|
|
3038
4917
|
const def = schema._zod.def;
|
|
3039
4918
|
const values = getEnumValues(def.entries);
|
|
@@ -3063,12 +4942,54 @@ const literalProcessor = (schema, ctx, json, _params) => {
|
|
|
3063
4942
|
json.enum = vals;
|
|
3064
4943
|
}
|
|
3065
4944
|
};
|
|
4945
|
+
const nanProcessor = (_schema, ctx, _json, _params) => {
|
|
4946
|
+
if (ctx.unrepresentable === "throw") throw new Error("NaN cannot be represented in JSON Schema");
|
|
4947
|
+
};
|
|
4948
|
+
const templateLiteralProcessor = (schema, _ctx, json, _params) => {
|
|
4949
|
+
const _json = json;
|
|
4950
|
+
const pattern = schema._zod.pattern;
|
|
4951
|
+
if (!pattern) throw new Error("Pattern not found in template literal");
|
|
4952
|
+
_json.type = "string";
|
|
4953
|
+
_json.pattern = pattern.source;
|
|
4954
|
+
};
|
|
4955
|
+
const fileProcessor = (schema, _ctx, json, _params) => {
|
|
4956
|
+
const _json = json;
|
|
4957
|
+
const file = {
|
|
4958
|
+
type: "string",
|
|
4959
|
+
format: "binary",
|
|
4960
|
+
contentEncoding: "binary"
|
|
4961
|
+
};
|
|
4962
|
+
const { minimum, maximum, mime } = schema._zod.bag;
|
|
4963
|
+
if (minimum !== void 0) file.minLength = minimum;
|
|
4964
|
+
if (maximum !== void 0) file.maxLength = maximum;
|
|
4965
|
+
if (mime) {
|
|
4966
|
+
if (mime.length === 1) {
|
|
4967
|
+
file.contentMediaType = mime[0];
|
|
4968
|
+
Object.assign(_json, file);
|
|
4969
|
+
} else {
|
|
4970
|
+
Object.assign(_json, file);
|
|
4971
|
+
_json.anyOf = mime.map((m) => ({ contentMediaType: m }));
|
|
4972
|
+
}
|
|
4973
|
+
} else Object.assign(_json, file);
|
|
4974
|
+
};
|
|
4975
|
+
const successProcessor = (_schema, _ctx, json, _params) => {
|
|
4976
|
+
json.type = "boolean";
|
|
4977
|
+
};
|
|
3066
4978
|
const customProcessor = (_schema, ctx, _json, _params) => {
|
|
3067
4979
|
if (ctx.unrepresentable === "throw") throw new Error("Custom types cannot be represented in JSON Schema");
|
|
3068
4980
|
};
|
|
4981
|
+
const functionProcessor = (_schema, ctx, _json, _params) => {
|
|
4982
|
+
if (ctx.unrepresentable === "throw") throw new Error("Function types cannot be represented in JSON Schema");
|
|
4983
|
+
};
|
|
3069
4984
|
const transformProcessor = (_schema, ctx, _json, _params) => {
|
|
3070
4985
|
if (ctx.unrepresentable === "throw") throw new Error("Transforms cannot be represented in JSON Schema");
|
|
3071
4986
|
};
|
|
4987
|
+
const mapProcessor = (_schema, ctx, _json, _params) => {
|
|
4988
|
+
if (ctx.unrepresentable === "throw") throw new Error("Map cannot be represented in JSON Schema");
|
|
4989
|
+
};
|
|
4990
|
+
const setProcessor = (_schema, ctx, _json, _params) => {
|
|
4991
|
+
if (ctx.unrepresentable === "throw") throw new Error("Set cannot be represented in JSON Schema");
|
|
4992
|
+
};
|
|
3072
4993
|
const arrayProcessor = (schema, ctx, _json, params) => {
|
|
3073
4994
|
const json = _json;
|
|
3074
4995
|
const def = schema._zod.def;
|
|
@@ -3145,6 +5066,77 @@ const intersectionProcessor = (schema, ctx, json, params) => {
|
|
|
3145
5066
|
const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
|
|
3146
5067
|
json.allOf = [...isSimpleIntersection(a) ? a.allOf : [a], ...isSimpleIntersection(b) ? b.allOf : [b]];
|
|
3147
5068
|
};
|
|
5069
|
+
const tupleProcessor = (schema, ctx, _json, params) => {
|
|
5070
|
+
const json = _json;
|
|
5071
|
+
const def = schema._zod.def;
|
|
5072
|
+
json.type = "array";
|
|
5073
|
+
const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
5074
|
+
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
5075
|
+
const prefixItems = def.items.map((x, i) => process(x, ctx, {
|
|
5076
|
+
...params,
|
|
5077
|
+
path: [
|
|
5078
|
+
...params.path,
|
|
5079
|
+
prefixPath,
|
|
5080
|
+
i
|
|
5081
|
+
]
|
|
5082
|
+
}));
|
|
5083
|
+
const rest = def.rest ? process(def.rest, ctx, {
|
|
5084
|
+
...params,
|
|
5085
|
+
path: [
|
|
5086
|
+
...params.path,
|
|
5087
|
+
restPath,
|
|
5088
|
+
...ctx.target === "openapi-3.0" ? [def.items.length] : []
|
|
5089
|
+
]
|
|
5090
|
+
}) : null;
|
|
5091
|
+
if (ctx.target === "draft-2020-12") {
|
|
5092
|
+
json.prefixItems = prefixItems;
|
|
5093
|
+
if (rest) json.items = rest;
|
|
5094
|
+
} else if (ctx.target === "openapi-3.0") {
|
|
5095
|
+
json.items = { anyOf: prefixItems };
|
|
5096
|
+
if (rest) json.items.anyOf.push(rest);
|
|
5097
|
+
json.minItems = prefixItems.length;
|
|
5098
|
+
if (!rest) json.maxItems = prefixItems.length;
|
|
5099
|
+
} else {
|
|
5100
|
+
json.items = prefixItems;
|
|
5101
|
+
if (rest) json.additionalItems = rest;
|
|
5102
|
+
}
|
|
5103
|
+
const { minimum, maximum } = schema._zod.bag;
|
|
5104
|
+
if (typeof minimum === "number") json.minItems = minimum;
|
|
5105
|
+
if (typeof maximum === "number") json.maxItems = maximum;
|
|
5106
|
+
};
|
|
5107
|
+
const recordProcessor = (schema, ctx, _json, params) => {
|
|
5108
|
+
const json = _json;
|
|
5109
|
+
const def = schema._zod.def;
|
|
5110
|
+
json.type = "object";
|
|
5111
|
+
const keyType = def.keyType;
|
|
5112
|
+
const patterns = keyType._zod.bag?.patterns;
|
|
5113
|
+
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
5114
|
+
const valueSchema = process(def.valueType, ctx, {
|
|
5115
|
+
...params,
|
|
5116
|
+
path: [
|
|
5117
|
+
...params.path,
|
|
5118
|
+
"patternProperties",
|
|
5119
|
+
"*"
|
|
5120
|
+
]
|
|
5121
|
+
});
|
|
5122
|
+
json.patternProperties = {};
|
|
5123
|
+
for (const pattern of patterns) json.patternProperties[pattern.source] = valueSchema;
|
|
5124
|
+
} else {
|
|
5125
|
+
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") json.propertyNames = process(def.keyType, ctx, {
|
|
5126
|
+
...params,
|
|
5127
|
+
path: [...params.path, "propertyNames"]
|
|
5128
|
+
});
|
|
5129
|
+
json.additionalProperties = process(def.valueType, ctx, {
|
|
5130
|
+
...params,
|
|
5131
|
+
path: [...params.path, "additionalProperties"]
|
|
5132
|
+
});
|
|
5133
|
+
}
|
|
5134
|
+
const keyValues = keyType._zod.values;
|
|
5135
|
+
if (keyValues) {
|
|
5136
|
+
const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
|
|
5137
|
+
if (validKeyValues.length > 0) json.required = validKeyValues;
|
|
5138
|
+
}
|
|
5139
|
+
};
|
|
3148
5140
|
const nullableProcessor = (schema, ctx, json, params) => {
|
|
3149
5141
|
const def = schema._zod.def;
|
|
3150
5142
|
const inner = process(def.innerType, ctx, params);
|
|
@@ -3202,14 +5194,111 @@ const readonlyProcessor = (schema, ctx, json, params) => {
|
|
|
3202
5194
|
seen.ref = def.innerType;
|
|
3203
5195
|
json.readOnly = true;
|
|
3204
5196
|
};
|
|
5197
|
+
const promiseProcessor = (schema, ctx, _json, params) => {
|
|
5198
|
+
const def = schema._zod.def;
|
|
5199
|
+
process(def.innerType, ctx, params);
|
|
5200
|
+
const seen = ctx.seen.get(schema);
|
|
5201
|
+
seen.ref = def.innerType;
|
|
5202
|
+
};
|
|
3205
5203
|
const optionalProcessor = (schema, ctx, _json, params) => {
|
|
3206
5204
|
const def = schema._zod.def;
|
|
3207
5205
|
process(def.innerType, ctx, params);
|
|
3208
5206
|
const seen = ctx.seen.get(schema);
|
|
3209
5207
|
seen.ref = def.innerType;
|
|
3210
5208
|
};
|
|
5209
|
+
const lazyProcessor = (schema, ctx, _json, params) => {
|
|
5210
|
+
const innerType = schema._zod.innerType;
|
|
5211
|
+
process(innerType, ctx, params);
|
|
5212
|
+
const seen = ctx.seen.get(schema);
|
|
5213
|
+
seen.ref = innerType;
|
|
5214
|
+
};
|
|
5215
|
+
const allProcessors = {
|
|
5216
|
+
string: stringProcessor,
|
|
5217
|
+
number: numberProcessor,
|
|
5218
|
+
boolean: booleanProcessor,
|
|
5219
|
+
bigint: bigintProcessor,
|
|
5220
|
+
symbol: symbolProcessor,
|
|
5221
|
+
null: nullProcessor,
|
|
5222
|
+
undefined: undefinedProcessor,
|
|
5223
|
+
void: voidProcessor,
|
|
5224
|
+
never: neverProcessor,
|
|
5225
|
+
any: anyProcessor,
|
|
5226
|
+
unknown: unknownProcessor,
|
|
5227
|
+
date: dateProcessor,
|
|
5228
|
+
enum: enumProcessor,
|
|
5229
|
+
literal: literalProcessor,
|
|
5230
|
+
nan: nanProcessor,
|
|
5231
|
+
template_literal: templateLiteralProcessor,
|
|
5232
|
+
file: fileProcessor,
|
|
5233
|
+
success: successProcessor,
|
|
5234
|
+
custom: customProcessor,
|
|
5235
|
+
function: functionProcessor,
|
|
5236
|
+
transform: transformProcessor,
|
|
5237
|
+
map: mapProcessor,
|
|
5238
|
+
set: setProcessor,
|
|
5239
|
+
array: arrayProcessor,
|
|
5240
|
+
object: objectProcessor,
|
|
5241
|
+
union: unionProcessor,
|
|
5242
|
+
intersection: intersectionProcessor,
|
|
5243
|
+
tuple: tupleProcessor,
|
|
5244
|
+
record: recordProcessor,
|
|
5245
|
+
nullable: nullableProcessor,
|
|
5246
|
+
nonoptional: nonoptionalProcessor,
|
|
5247
|
+
default: defaultProcessor,
|
|
5248
|
+
prefault: prefaultProcessor,
|
|
5249
|
+
catch: catchProcessor,
|
|
5250
|
+
pipe: pipeProcessor,
|
|
5251
|
+
readonly: readonlyProcessor,
|
|
5252
|
+
promise: promiseProcessor,
|
|
5253
|
+
optional: optionalProcessor,
|
|
5254
|
+
lazy: lazyProcessor
|
|
5255
|
+
};
|
|
5256
|
+
function toJSONSchema(input, params) {
|
|
5257
|
+
if ("_idmap" in input) {
|
|
5258
|
+
const registry = input;
|
|
5259
|
+
const ctx = initializeContext({
|
|
5260
|
+
...params,
|
|
5261
|
+
processors: allProcessors
|
|
5262
|
+
});
|
|
5263
|
+
const defs = {};
|
|
5264
|
+
for (const entry of registry._idmap.entries()) {
|
|
5265
|
+
const [_, schema] = entry;
|
|
5266
|
+
process(schema, ctx);
|
|
5267
|
+
}
|
|
5268
|
+
const schemas = {};
|
|
5269
|
+
ctx.external = {
|
|
5270
|
+
registry,
|
|
5271
|
+
uri: params?.uri,
|
|
5272
|
+
defs
|
|
5273
|
+
};
|
|
5274
|
+
for (const entry of registry._idmap.entries()) {
|
|
5275
|
+
const [key, schema] = entry;
|
|
5276
|
+
extractDefs(ctx, schema);
|
|
5277
|
+
schemas[key] = finalize(ctx, schema);
|
|
5278
|
+
}
|
|
5279
|
+
if (Object.keys(defs).length > 0) schemas.__shared = { [ctx.target === "draft-2020-12" ? "$defs" : "definitions"]: defs };
|
|
5280
|
+
return { schemas };
|
|
5281
|
+
}
|
|
5282
|
+
const ctx = initializeContext({
|
|
5283
|
+
...params,
|
|
5284
|
+
processors: allProcessors
|
|
5285
|
+
});
|
|
5286
|
+
process(input, ctx);
|
|
5287
|
+
extractDefs(ctx, input);
|
|
5288
|
+
return finalize(ctx, input);
|
|
5289
|
+
}
|
|
3211
5290
|
//#endregion
|
|
3212
5291
|
//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/iso.js
|
|
5292
|
+
var iso_exports = /* @__PURE__ */ __exportAll({
|
|
5293
|
+
ZodISODate: () => ZodISODate,
|
|
5294
|
+
ZodISODateTime: () => ZodISODateTime,
|
|
5295
|
+
ZodISODuration: () => ZodISODuration,
|
|
5296
|
+
ZodISOTime: () => ZodISOTime,
|
|
5297
|
+
date: () => date$1,
|
|
5298
|
+
datetime: () => datetime,
|
|
5299
|
+
duration: () => duration,
|
|
5300
|
+
time: () => time
|
|
5301
|
+
});
|
|
3213
5302
|
const ZodISODateTime = /*@__PURE__*/ $constructor("ZodISODateTime", (inst, def) => {
|
|
3214
5303
|
$ZodISODateTime.init(inst, def);
|
|
3215
5304
|
ZodStringFormat.init(inst, def);
|
|
@@ -3221,7 +5310,7 @@ const ZodISODate = /*@__PURE__*/ $constructor("ZodISODate", (inst, def) => {
|
|
|
3221
5310
|
$ZodISODate.init(inst, def);
|
|
3222
5311
|
ZodStringFormat.init(inst, def);
|
|
3223
5312
|
});
|
|
3224
|
-
function date(params) {
|
|
5313
|
+
function date$1(params) {
|
|
3225
5314
|
return /* @__PURE__ */ _isoDate(ZodISODate, params);
|
|
3226
5315
|
}
|
|
3227
5316
|
const ZodISOTime = /*@__PURE__*/ $constructor("ZodISOTime", (inst, def) => {
|
|
@@ -3259,6 +5348,7 @@ const initializer = (inst, issues) => {
|
|
|
3259
5348
|
} }
|
|
3260
5349
|
});
|
|
3261
5350
|
};
|
|
5351
|
+
const ZodError = /*@__PURE__*/ $constructor("ZodError", initializer);
|
|
3262
5352
|
const ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, { Parent: Error });
|
|
3263
5353
|
//#endregion
|
|
3264
5354
|
//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/parse.js
|
|
@@ -3276,6 +5366,174 @@ const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
|
3276
5366
|
const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
3277
5367
|
//#endregion
|
|
3278
5368
|
//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/schemas.js
|
|
5369
|
+
var schemas_exports = /* @__PURE__ */ __exportAll({
|
|
5370
|
+
ZodAny: () => ZodAny,
|
|
5371
|
+
ZodArray: () => ZodArray,
|
|
5372
|
+
ZodBase64: () => ZodBase64,
|
|
5373
|
+
ZodBase64URL: () => ZodBase64URL,
|
|
5374
|
+
ZodBigInt: () => ZodBigInt,
|
|
5375
|
+
ZodBigIntFormat: () => ZodBigIntFormat,
|
|
5376
|
+
ZodBoolean: () => ZodBoolean,
|
|
5377
|
+
ZodCIDRv4: () => ZodCIDRv4,
|
|
5378
|
+
ZodCIDRv6: () => ZodCIDRv6,
|
|
5379
|
+
ZodCUID: () => ZodCUID,
|
|
5380
|
+
ZodCUID2: () => ZodCUID2,
|
|
5381
|
+
ZodCatch: () => ZodCatch,
|
|
5382
|
+
ZodCodec: () => ZodCodec,
|
|
5383
|
+
ZodCustom: () => ZodCustom,
|
|
5384
|
+
ZodCustomStringFormat: () => ZodCustomStringFormat,
|
|
5385
|
+
ZodDate: () => ZodDate,
|
|
5386
|
+
ZodDefault: () => ZodDefault,
|
|
5387
|
+
ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
|
|
5388
|
+
ZodE164: () => ZodE164,
|
|
5389
|
+
ZodEmail: () => ZodEmail,
|
|
5390
|
+
ZodEmoji: () => ZodEmoji,
|
|
5391
|
+
ZodEnum: () => ZodEnum,
|
|
5392
|
+
ZodExactOptional: () => ZodExactOptional,
|
|
5393
|
+
ZodFile: () => ZodFile,
|
|
5394
|
+
ZodFunction: () => ZodFunction,
|
|
5395
|
+
ZodGUID: () => ZodGUID,
|
|
5396
|
+
ZodIPv4: () => ZodIPv4,
|
|
5397
|
+
ZodIPv6: () => ZodIPv6,
|
|
5398
|
+
ZodIntersection: () => ZodIntersection,
|
|
5399
|
+
ZodJWT: () => ZodJWT,
|
|
5400
|
+
ZodKSUID: () => ZodKSUID,
|
|
5401
|
+
ZodLazy: () => ZodLazy,
|
|
5402
|
+
ZodLiteral: () => ZodLiteral,
|
|
5403
|
+
ZodMAC: () => ZodMAC,
|
|
5404
|
+
ZodMap: () => ZodMap,
|
|
5405
|
+
ZodNaN: () => ZodNaN,
|
|
5406
|
+
ZodNanoID: () => ZodNanoID,
|
|
5407
|
+
ZodNever: () => ZodNever,
|
|
5408
|
+
ZodNonOptional: () => ZodNonOptional,
|
|
5409
|
+
ZodNull: () => ZodNull,
|
|
5410
|
+
ZodNullable: () => ZodNullable,
|
|
5411
|
+
ZodNumber: () => ZodNumber,
|
|
5412
|
+
ZodNumberFormat: () => ZodNumberFormat,
|
|
5413
|
+
ZodObject: () => ZodObject,
|
|
5414
|
+
ZodOptional: () => ZodOptional,
|
|
5415
|
+
ZodPipe: () => ZodPipe,
|
|
5416
|
+
ZodPrefault: () => ZodPrefault,
|
|
5417
|
+
ZodPreprocess: () => ZodPreprocess,
|
|
5418
|
+
ZodPromise: () => ZodPromise,
|
|
5419
|
+
ZodReadonly: () => ZodReadonly,
|
|
5420
|
+
ZodRecord: () => ZodRecord,
|
|
5421
|
+
ZodSet: () => ZodSet,
|
|
5422
|
+
ZodString: () => ZodString,
|
|
5423
|
+
ZodStringFormat: () => ZodStringFormat,
|
|
5424
|
+
ZodSuccess: () => ZodSuccess,
|
|
5425
|
+
ZodSymbol: () => ZodSymbol,
|
|
5426
|
+
ZodTemplateLiteral: () => ZodTemplateLiteral,
|
|
5427
|
+
ZodTransform: () => ZodTransform,
|
|
5428
|
+
ZodTuple: () => ZodTuple,
|
|
5429
|
+
ZodType: () => ZodType,
|
|
5430
|
+
ZodULID: () => ZodULID,
|
|
5431
|
+
ZodURL: () => ZodURL,
|
|
5432
|
+
ZodUUID: () => ZodUUID,
|
|
5433
|
+
ZodUndefined: () => ZodUndefined,
|
|
5434
|
+
ZodUnion: () => ZodUnion,
|
|
5435
|
+
ZodUnknown: () => ZodUnknown,
|
|
5436
|
+
ZodVoid: () => ZodVoid,
|
|
5437
|
+
ZodXID: () => ZodXID,
|
|
5438
|
+
ZodXor: () => ZodXor,
|
|
5439
|
+
_ZodString: () => _ZodString,
|
|
5440
|
+
_default: () => _default,
|
|
5441
|
+
_function: () => _function,
|
|
5442
|
+
any: () => any,
|
|
5443
|
+
array: () => array,
|
|
5444
|
+
base64: () => base64,
|
|
5445
|
+
base64url: () => base64url,
|
|
5446
|
+
bigint: () => bigint,
|
|
5447
|
+
boolean: () => boolean,
|
|
5448
|
+
catch: () => _catch,
|
|
5449
|
+
check: () => check,
|
|
5450
|
+
cidrv4: () => cidrv4,
|
|
5451
|
+
cidrv6: () => cidrv6,
|
|
5452
|
+
codec: () => codec,
|
|
5453
|
+
cuid: () => cuid,
|
|
5454
|
+
cuid2: () => cuid2,
|
|
5455
|
+
custom: () => custom,
|
|
5456
|
+
date: () => date,
|
|
5457
|
+
describe: () => describe,
|
|
5458
|
+
discriminatedUnion: () => discriminatedUnion,
|
|
5459
|
+
e164: () => e164,
|
|
5460
|
+
email: () => email,
|
|
5461
|
+
emoji: () => emoji,
|
|
5462
|
+
enum: () => _enum,
|
|
5463
|
+
exactOptional: () => exactOptional,
|
|
5464
|
+
file: () => file,
|
|
5465
|
+
float32: () => float32,
|
|
5466
|
+
float64: () => float64,
|
|
5467
|
+
function: () => _function,
|
|
5468
|
+
guid: () => guid,
|
|
5469
|
+
hash: () => hash,
|
|
5470
|
+
hex: () => hex,
|
|
5471
|
+
hostname: () => hostname,
|
|
5472
|
+
httpUrl: () => httpUrl,
|
|
5473
|
+
instanceof: () => _instanceof,
|
|
5474
|
+
int: () => int,
|
|
5475
|
+
int32: () => int32,
|
|
5476
|
+
int64: () => int64,
|
|
5477
|
+
intersection: () => intersection,
|
|
5478
|
+
invertCodec: () => invertCodec,
|
|
5479
|
+
ipv4: () => ipv4,
|
|
5480
|
+
ipv6: () => ipv6,
|
|
5481
|
+
json: () => json,
|
|
5482
|
+
jwt: () => jwt,
|
|
5483
|
+
keyof: () => keyof,
|
|
5484
|
+
ksuid: () => ksuid,
|
|
5485
|
+
lazy: () => lazy,
|
|
5486
|
+
literal: () => literal,
|
|
5487
|
+
looseObject: () => looseObject,
|
|
5488
|
+
looseRecord: () => looseRecord,
|
|
5489
|
+
mac: () => mac,
|
|
5490
|
+
map: () => map,
|
|
5491
|
+
meta: () => meta,
|
|
5492
|
+
nan: () => nan,
|
|
5493
|
+
nanoid: () => nanoid,
|
|
5494
|
+
nativeEnum: () => nativeEnum,
|
|
5495
|
+
never: () => never,
|
|
5496
|
+
nonoptional: () => nonoptional,
|
|
5497
|
+
null: () => _null,
|
|
5498
|
+
nullable: () => nullable,
|
|
5499
|
+
nullish: () => nullish,
|
|
5500
|
+
number: () => number,
|
|
5501
|
+
object: () => object,
|
|
5502
|
+
optional: () => optional,
|
|
5503
|
+
partialRecord: () => partialRecord,
|
|
5504
|
+
pipe: () => pipe,
|
|
5505
|
+
prefault: () => prefault,
|
|
5506
|
+
preprocess: () => preprocess,
|
|
5507
|
+
promise: () => promise,
|
|
5508
|
+
readonly: () => readonly,
|
|
5509
|
+
record: () => record,
|
|
5510
|
+
refine: () => refine,
|
|
5511
|
+
set: () => set,
|
|
5512
|
+
strictObject: () => strictObject,
|
|
5513
|
+
string: () => string,
|
|
5514
|
+
stringFormat: () => stringFormat,
|
|
5515
|
+
stringbool: () => stringbool,
|
|
5516
|
+
success: () => success,
|
|
5517
|
+
superRefine: () => superRefine,
|
|
5518
|
+
symbol: () => symbol,
|
|
5519
|
+
templateLiteral: () => templateLiteral,
|
|
5520
|
+
transform: () => transform,
|
|
5521
|
+
tuple: () => tuple,
|
|
5522
|
+
uint32: () => uint32,
|
|
5523
|
+
uint64: () => uint64,
|
|
5524
|
+
ulid: () => ulid,
|
|
5525
|
+
undefined: () => _undefined,
|
|
5526
|
+
union: () => union,
|
|
5527
|
+
unknown: () => unknown,
|
|
5528
|
+
url: () => url,
|
|
5529
|
+
uuid: () => uuid,
|
|
5530
|
+
uuidv4: () => uuidv4,
|
|
5531
|
+
uuidv6: () => uuidv6,
|
|
5532
|
+
uuidv7: () => uuidv7,
|
|
5533
|
+
void: () => _void,
|
|
5534
|
+
xid: () => xid,
|
|
5535
|
+
xor: () => xor
|
|
5536
|
+
});
|
|
3279
5537
|
const _installedGroups = /* @__PURE__ */ new WeakMap();
|
|
3280
5538
|
function _installLazyMethods(inst, group, methods) {
|
|
3281
5539
|
const proto = Object.getPrototypeOf(inst);
|
|
@@ -3521,7 +5779,7 @@ const ZodString = /*@__PURE__*/ $constructor("ZodString", (inst, def) => {
|
|
|
3521
5779
|
inst.cidrv6 = (params) => inst.check(/* @__PURE__ */ _cidrv6(ZodCIDRv6, params));
|
|
3522
5780
|
inst.e164 = (params) => inst.check(/* @__PURE__ */ _e164(ZodE164, params));
|
|
3523
5781
|
inst.datetime = (params) => inst.check(datetime(params));
|
|
3524
|
-
inst.date = (params) => inst.check(date(params));
|
|
5782
|
+
inst.date = (params) => inst.check(date$1(params));
|
|
3525
5783
|
inst.time = (params) => inst.check(time(params));
|
|
3526
5784
|
inst.duration = (params) => inst.check(duration(params));
|
|
3527
5785
|
});
|
|
@@ -3536,26 +5794,60 @@ const ZodEmail = /*@__PURE__*/ $constructor("ZodEmail", (inst, def) => {
|
|
|
3536
5794
|
$ZodEmail.init(inst, def);
|
|
3537
5795
|
ZodStringFormat.init(inst, def);
|
|
3538
5796
|
});
|
|
5797
|
+
function email(params) {
|
|
5798
|
+
return /* @__PURE__ */ _email(ZodEmail, params);
|
|
5799
|
+
}
|
|
3539
5800
|
const ZodGUID = /*@__PURE__*/ $constructor("ZodGUID", (inst, def) => {
|
|
3540
5801
|
$ZodGUID.init(inst, def);
|
|
3541
5802
|
ZodStringFormat.init(inst, def);
|
|
3542
5803
|
});
|
|
5804
|
+
function guid(params) {
|
|
5805
|
+
return /* @__PURE__ */ _guid(ZodGUID, params);
|
|
5806
|
+
}
|
|
3543
5807
|
const ZodUUID = /*@__PURE__*/ $constructor("ZodUUID", (inst, def) => {
|
|
3544
5808
|
$ZodUUID.init(inst, def);
|
|
3545
5809
|
ZodStringFormat.init(inst, def);
|
|
3546
5810
|
});
|
|
5811
|
+
function uuid(params) {
|
|
5812
|
+
return /* @__PURE__ */ _uuid(ZodUUID, params);
|
|
5813
|
+
}
|
|
5814
|
+
function uuidv4(params) {
|
|
5815
|
+
return /* @__PURE__ */ _uuidv4(ZodUUID, params);
|
|
5816
|
+
}
|
|
5817
|
+
function uuidv6(params) {
|
|
5818
|
+
return /* @__PURE__ */ _uuidv6(ZodUUID, params);
|
|
5819
|
+
}
|
|
5820
|
+
function uuidv7(params) {
|
|
5821
|
+
return /* @__PURE__ */ _uuidv7(ZodUUID, params);
|
|
5822
|
+
}
|
|
3547
5823
|
const ZodURL = /*@__PURE__*/ $constructor("ZodURL", (inst, def) => {
|
|
3548
5824
|
$ZodURL.init(inst, def);
|
|
3549
5825
|
ZodStringFormat.init(inst, def);
|
|
3550
5826
|
});
|
|
5827
|
+
function url(params) {
|
|
5828
|
+
return /* @__PURE__ */ _url(ZodURL, params);
|
|
5829
|
+
}
|
|
5830
|
+
function httpUrl(params) {
|
|
5831
|
+
return /* @__PURE__ */ _url(ZodURL, {
|
|
5832
|
+
protocol: httpProtocol,
|
|
5833
|
+
hostname: domain,
|
|
5834
|
+
...normalizeParams(params)
|
|
5835
|
+
});
|
|
5836
|
+
}
|
|
3551
5837
|
const ZodEmoji = /*@__PURE__*/ $constructor("ZodEmoji", (inst, def) => {
|
|
3552
5838
|
$ZodEmoji.init(inst, def);
|
|
3553
5839
|
ZodStringFormat.init(inst, def);
|
|
3554
5840
|
});
|
|
5841
|
+
function emoji(params) {
|
|
5842
|
+
return /* @__PURE__ */ _emoji(ZodEmoji, params);
|
|
5843
|
+
}
|
|
3555
5844
|
const ZodNanoID = /*@__PURE__*/ $constructor("ZodNanoID", (inst, def) => {
|
|
3556
5845
|
$ZodNanoID.init(inst, def);
|
|
3557
5846
|
ZodStringFormat.init(inst, def);
|
|
3558
5847
|
});
|
|
5848
|
+
function nanoid(params) {
|
|
5849
|
+
return /* @__PURE__ */ _nanoid(ZodNanoID, params);
|
|
5850
|
+
}
|
|
3559
5851
|
/**
|
|
3560
5852
|
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
3561
5853
|
* (timestamps embedded in the id). Use {@link ZodCUID2} instead.
|
|
@@ -3565,54 +5857,126 @@ const ZodCUID = /*@__PURE__*/ $constructor("ZodCUID", (inst, def) => {
|
|
|
3565
5857
|
$ZodCUID.init(inst, def);
|
|
3566
5858
|
ZodStringFormat.init(inst, def);
|
|
3567
5859
|
});
|
|
5860
|
+
/**
|
|
5861
|
+
* Validates a CUID v1 string.
|
|
5862
|
+
*
|
|
5863
|
+
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
5864
|
+
* (timestamps embedded in the id). Use {@link cuid2 | `z.cuid2()`} instead.
|
|
5865
|
+
* See https://github.com/paralleldrive/cuid.
|
|
5866
|
+
*/
|
|
5867
|
+
function cuid(params) {
|
|
5868
|
+
return /* @__PURE__ */ _cuid(ZodCUID, params);
|
|
5869
|
+
}
|
|
3568
5870
|
const ZodCUID2 = /*@__PURE__*/ $constructor("ZodCUID2", (inst, def) => {
|
|
3569
5871
|
$ZodCUID2.init(inst, def);
|
|
3570
5872
|
ZodStringFormat.init(inst, def);
|
|
3571
5873
|
});
|
|
5874
|
+
function cuid2(params) {
|
|
5875
|
+
return /* @__PURE__ */ _cuid2(ZodCUID2, params);
|
|
5876
|
+
}
|
|
3572
5877
|
const ZodULID = /*@__PURE__*/ $constructor("ZodULID", (inst, def) => {
|
|
3573
5878
|
$ZodULID.init(inst, def);
|
|
3574
5879
|
ZodStringFormat.init(inst, def);
|
|
3575
5880
|
});
|
|
5881
|
+
function ulid(params) {
|
|
5882
|
+
return /* @__PURE__ */ _ulid(ZodULID, params);
|
|
5883
|
+
}
|
|
3576
5884
|
const ZodXID = /*@__PURE__*/ $constructor("ZodXID", (inst, def) => {
|
|
3577
5885
|
$ZodXID.init(inst, def);
|
|
3578
5886
|
ZodStringFormat.init(inst, def);
|
|
3579
5887
|
});
|
|
5888
|
+
function xid(params) {
|
|
5889
|
+
return /* @__PURE__ */ _xid(ZodXID, params);
|
|
5890
|
+
}
|
|
3580
5891
|
const ZodKSUID = /*@__PURE__*/ $constructor("ZodKSUID", (inst, def) => {
|
|
3581
5892
|
$ZodKSUID.init(inst, def);
|
|
3582
5893
|
ZodStringFormat.init(inst, def);
|
|
3583
5894
|
});
|
|
5895
|
+
function ksuid(params) {
|
|
5896
|
+
return /* @__PURE__ */ _ksuid(ZodKSUID, params);
|
|
5897
|
+
}
|
|
3584
5898
|
const ZodIPv4 = /*@__PURE__*/ $constructor("ZodIPv4", (inst, def) => {
|
|
3585
5899
|
$ZodIPv4.init(inst, def);
|
|
3586
5900
|
ZodStringFormat.init(inst, def);
|
|
3587
5901
|
});
|
|
5902
|
+
function ipv4(params) {
|
|
5903
|
+
return /* @__PURE__ */ _ipv4(ZodIPv4, params);
|
|
5904
|
+
}
|
|
5905
|
+
const ZodMAC = /*@__PURE__*/ $constructor("ZodMAC", (inst, def) => {
|
|
5906
|
+
$ZodMAC.init(inst, def);
|
|
5907
|
+
ZodStringFormat.init(inst, def);
|
|
5908
|
+
});
|
|
5909
|
+
function mac(params) {
|
|
5910
|
+
return /* @__PURE__ */ _mac(ZodMAC, params);
|
|
5911
|
+
}
|
|
3588
5912
|
const ZodIPv6 = /*@__PURE__*/ $constructor("ZodIPv6", (inst, def) => {
|
|
3589
5913
|
$ZodIPv6.init(inst, def);
|
|
3590
5914
|
ZodStringFormat.init(inst, def);
|
|
3591
5915
|
});
|
|
5916
|
+
function ipv6(params) {
|
|
5917
|
+
return /* @__PURE__ */ _ipv6(ZodIPv6, params);
|
|
5918
|
+
}
|
|
3592
5919
|
const ZodCIDRv4 = /*@__PURE__*/ $constructor("ZodCIDRv4", (inst, def) => {
|
|
3593
5920
|
$ZodCIDRv4.init(inst, def);
|
|
3594
5921
|
ZodStringFormat.init(inst, def);
|
|
3595
5922
|
});
|
|
5923
|
+
function cidrv4(params) {
|
|
5924
|
+
return /* @__PURE__ */ _cidrv4(ZodCIDRv4, params);
|
|
5925
|
+
}
|
|
3596
5926
|
const ZodCIDRv6 = /*@__PURE__*/ $constructor("ZodCIDRv6", (inst, def) => {
|
|
3597
5927
|
$ZodCIDRv6.init(inst, def);
|
|
3598
5928
|
ZodStringFormat.init(inst, def);
|
|
3599
5929
|
});
|
|
5930
|
+
function cidrv6(params) {
|
|
5931
|
+
return /* @__PURE__ */ _cidrv6(ZodCIDRv6, params);
|
|
5932
|
+
}
|
|
3600
5933
|
const ZodBase64 = /*@__PURE__*/ $constructor("ZodBase64", (inst, def) => {
|
|
3601
5934
|
$ZodBase64.init(inst, def);
|
|
3602
5935
|
ZodStringFormat.init(inst, def);
|
|
3603
5936
|
});
|
|
5937
|
+
function base64(params) {
|
|
5938
|
+
return /* @__PURE__ */ _base64(ZodBase64, params);
|
|
5939
|
+
}
|
|
3604
5940
|
const ZodBase64URL = /*@__PURE__*/ $constructor("ZodBase64URL", (inst, def) => {
|
|
3605
5941
|
$ZodBase64URL.init(inst, def);
|
|
3606
5942
|
ZodStringFormat.init(inst, def);
|
|
3607
5943
|
});
|
|
5944
|
+
function base64url(params) {
|
|
5945
|
+
return /* @__PURE__ */ _base64url(ZodBase64URL, params);
|
|
5946
|
+
}
|
|
3608
5947
|
const ZodE164 = /*@__PURE__*/ $constructor("ZodE164", (inst, def) => {
|
|
3609
5948
|
$ZodE164.init(inst, def);
|
|
3610
5949
|
ZodStringFormat.init(inst, def);
|
|
3611
5950
|
});
|
|
5951
|
+
function e164(params) {
|
|
5952
|
+
return /* @__PURE__ */ _e164(ZodE164, params);
|
|
5953
|
+
}
|
|
3612
5954
|
const ZodJWT = /*@__PURE__*/ $constructor("ZodJWT", (inst, def) => {
|
|
3613
5955
|
$ZodJWT.init(inst, def);
|
|
3614
5956
|
ZodStringFormat.init(inst, def);
|
|
3615
5957
|
});
|
|
5958
|
+
function jwt(params) {
|
|
5959
|
+
return /* @__PURE__ */ _jwt(ZodJWT, params);
|
|
5960
|
+
}
|
|
5961
|
+
const ZodCustomStringFormat = /*@__PURE__*/ $constructor("ZodCustomStringFormat", (inst, def) => {
|
|
5962
|
+
$ZodCustomStringFormat.init(inst, def);
|
|
5963
|
+
ZodStringFormat.init(inst, def);
|
|
5964
|
+
});
|
|
5965
|
+
function stringFormat(format, fnOrRegex, _params = {}) {
|
|
5966
|
+
return /* @__PURE__ */ _stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
|
|
5967
|
+
}
|
|
5968
|
+
function hostname(_params) {
|
|
5969
|
+
return /* @__PURE__ */ _stringFormat(ZodCustomStringFormat, "hostname", hostname$1, _params);
|
|
5970
|
+
}
|
|
5971
|
+
function hex(_params) {
|
|
5972
|
+
return /* @__PURE__ */ _stringFormat(ZodCustomStringFormat, "hex", hex$1, _params);
|
|
5973
|
+
}
|
|
5974
|
+
function hash(alg, params) {
|
|
5975
|
+
const format = `${alg}_${params?.enc ?? "hex"}`;
|
|
5976
|
+
const regex = regexes_exports[format];
|
|
5977
|
+
if (!regex) throw new Error(`Unrecognized hash format: ${format}`);
|
|
5978
|
+
return /* @__PURE__ */ _stringFormat(ZodCustomStringFormat, format, regex, params);
|
|
5979
|
+
}
|
|
3616
5980
|
const ZodNumber = /*@__PURE__*/ $constructor("ZodNumber", (inst, def) => {
|
|
3617
5981
|
$ZodNumber.init(inst, def);
|
|
3618
5982
|
ZodType.init(inst, def);
|
|
@@ -3681,6 +6045,18 @@ const ZodNumberFormat = /*@__PURE__*/ $constructor("ZodNumberFormat", (inst, def
|
|
|
3681
6045
|
function int(params) {
|
|
3682
6046
|
return /* @__PURE__ */ _int(ZodNumberFormat, params);
|
|
3683
6047
|
}
|
|
6048
|
+
function float32(params) {
|
|
6049
|
+
return /* @__PURE__ */ _float32(ZodNumberFormat, params);
|
|
6050
|
+
}
|
|
6051
|
+
function float64(params) {
|
|
6052
|
+
return /* @__PURE__ */ _float64(ZodNumberFormat, params);
|
|
6053
|
+
}
|
|
6054
|
+
function int32(params) {
|
|
6055
|
+
return /* @__PURE__ */ _int32(ZodNumberFormat, params);
|
|
6056
|
+
}
|
|
6057
|
+
function uint32(params) {
|
|
6058
|
+
return /* @__PURE__ */ _uint32(ZodNumberFormat, params);
|
|
6059
|
+
}
|
|
3684
6060
|
const ZodBoolean = /*@__PURE__*/ $constructor("ZodBoolean", (inst, def) => {
|
|
3685
6061
|
$ZodBoolean.init(inst, def);
|
|
3686
6062
|
ZodType.init(inst, def);
|
|
@@ -3689,6 +6065,73 @@ const ZodBoolean = /*@__PURE__*/ $constructor("ZodBoolean", (inst, def) => {
|
|
|
3689
6065
|
function boolean(params) {
|
|
3690
6066
|
return /* @__PURE__ */ _boolean(ZodBoolean, params);
|
|
3691
6067
|
}
|
|
6068
|
+
const ZodBigInt = /*@__PURE__*/ $constructor("ZodBigInt", (inst, def) => {
|
|
6069
|
+
$ZodBigInt.init(inst, def);
|
|
6070
|
+
ZodType.init(inst, def);
|
|
6071
|
+
inst._zod.processJSONSchema = (ctx, json, params) => bigintProcessor(inst, ctx, json, params);
|
|
6072
|
+
inst.gte = (value, params) => inst.check(/* @__PURE__ */ _gte(value, params));
|
|
6073
|
+
inst.min = (value, params) => inst.check(/* @__PURE__ */ _gte(value, params));
|
|
6074
|
+
inst.gt = (value, params) => inst.check(/* @__PURE__ */ _gt(value, params));
|
|
6075
|
+
inst.gte = (value, params) => inst.check(/* @__PURE__ */ _gte(value, params));
|
|
6076
|
+
inst.min = (value, params) => inst.check(/* @__PURE__ */ _gte(value, params));
|
|
6077
|
+
inst.lt = (value, params) => inst.check(/* @__PURE__ */ _lt(value, params));
|
|
6078
|
+
inst.lte = (value, params) => inst.check(/* @__PURE__ */ _lte(value, params));
|
|
6079
|
+
inst.max = (value, params) => inst.check(/* @__PURE__ */ _lte(value, params));
|
|
6080
|
+
inst.positive = (params) => inst.check(/* @__PURE__ */ _gt(BigInt(0), params));
|
|
6081
|
+
inst.negative = (params) => inst.check(/* @__PURE__ */ _lt(BigInt(0), params));
|
|
6082
|
+
inst.nonpositive = (params) => inst.check(/* @__PURE__ */ _lte(BigInt(0), params));
|
|
6083
|
+
inst.nonnegative = (params) => inst.check(/* @__PURE__ */ _gte(BigInt(0), params));
|
|
6084
|
+
inst.multipleOf = (value, params) => inst.check(/* @__PURE__ */ _multipleOf(value, params));
|
|
6085
|
+
const bag = inst._zod.bag;
|
|
6086
|
+
inst.minValue = bag.minimum ?? null;
|
|
6087
|
+
inst.maxValue = bag.maximum ?? null;
|
|
6088
|
+
inst.format = bag.format ?? null;
|
|
6089
|
+
});
|
|
6090
|
+
function bigint(params) {
|
|
6091
|
+
return /* @__PURE__ */ _bigint(ZodBigInt, params);
|
|
6092
|
+
}
|
|
6093
|
+
const ZodBigIntFormat = /*@__PURE__*/ $constructor("ZodBigIntFormat", (inst, def) => {
|
|
6094
|
+
$ZodBigIntFormat.init(inst, def);
|
|
6095
|
+
ZodBigInt.init(inst, def);
|
|
6096
|
+
});
|
|
6097
|
+
function int64(params) {
|
|
6098
|
+
return /* @__PURE__ */ _int64(ZodBigIntFormat, params);
|
|
6099
|
+
}
|
|
6100
|
+
function uint64(params) {
|
|
6101
|
+
return /* @__PURE__ */ _uint64(ZodBigIntFormat, params);
|
|
6102
|
+
}
|
|
6103
|
+
const ZodSymbol = /*@__PURE__*/ $constructor("ZodSymbol", (inst, def) => {
|
|
6104
|
+
$ZodSymbol.init(inst, def);
|
|
6105
|
+
ZodType.init(inst, def);
|
|
6106
|
+
inst._zod.processJSONSchema = (ctx, json, params) => symbolProcessor(inst, ctx, json, params);
|
|
6107
|
+
});
|
|
6108
|
+
function symbol(params) {
|
|
6109
|
+
return /* @__PURE__ */ _symbol(ZodSymbol, params);
|
|
6110
|
+
}
|
|
6111
|
+
const ZodUndefined = /*@__PURE__*/ $constructor("ZodUndefined", (inst, def) => {
|
|
6112
|
+
$ZodUndefined.init(inst, def);
|
|
6113
|
+
ZodType.init(inst, def);
|
|
6114
|
+
inst._zod.processJSONSchema = (ctx, json, params) => undefinedProcessor(inst, ctx, json, params);
|
|
6115
|
+
});
|
|
6116
|
+
function _undefined(params) {
|
|
6117
|
+
return /* @__PURE__ */ _undefined$1(ZodUndefined, params);
|
|
6118
|
+
}
|
|
6119
|
+
const ZodNull = /*@__PURE__*/ $constructor("ZodNull", (inst, def) => {
|
|
6120
|
+
$ZodNull.init(inst, def);
|
|
6121
|
+
ZodType.init(inst, def);
|
|
6122
|
+
inst._zod.processJSONSchema = (ctx, json, params) => nullProcessor(inst, ctx, json, params);
|
|
6123
|
+
});
|
|
6124
|
+
function _null(params) {
|
|
6125
|
+
return /* @__PURE__ */ _null$1(ZodNull, params);
|
|
6126
|
+
}
|
|
6127
|
+
const ZodAny = /*@__PURE__*/ $constructor("ZodAny", (inst, def) => {
|
|
6128
|
+
$ZodAny.init(inst, def);
|
|
6129
|
+
ZodType.init(inst, def);
|
|
6130
|
+
inst._zod.processJSONSchema = (ctx, json, params) => void 0;
|
|
6131
|
+
});
|
|
6132
|
+
function any() {
|
|
6133
|
+
return /* @__PURE__ */ _any(ZodAny);
|
|
6134
|
+
}
|
|
3692
6135
|
const ZodUnknown = /*@__PURE__*/ $constructor("ZodUnknown", (inst, def) => {
|
|
3693
6136
|
$ZodUnknown.init(inst, def);
|
|
3694
6137
|
ZodType.init(inst, def);
|
|
@@ -3705,6 +6148,27 @@ const ZodNever = /*@__PURE__*/ $constructor("ZodNever", (inst, def) => {
|
|
|
3705
6148
|
function never(params) {
|
|
3706
6149
|
return /* @__PURE__ */ _never(ZodNever, params);
|
|
3707
6150
|
}
|
|
6151
|
+
const ZodVoid = /*@__PURE__*/ $constructor("ZodVoid", (inst, def) => {
|
|
6152
|
+
$ZodVoid.init(inst, def);
|
|
6153
|
+
ZodType.init(inst, def);
|
|
6154
|
+
inst._zod.processJSONSchema = (ctx, json, params) => voidProcessor(inst, ctx, json, params);
|
|
6155
|
+
});
|
|
6156
|
+
function _void(params) {
|
|
6157
|
+
return /* @__PURE__ */ _void$1(ZodVoid, params);
|
|
6158
|
+
}
|
|
6159
|
+
const ZodDate = /*@__PURE__*/ $constructor("ZodDate", (inst, def) => {
|
|
6160
|
+
$ZodDate.init(inst, def);
|
|
6161
|
+
ZodType.init(inst, def);
|
|
6162
|
+
inst._zod.processJSONSchema = (ctx, json, params) => dateProcessor(inst, ctx, json, params);
|
|
6163
|
+
inst.min = (value, params) => inst.check(/* @__PURE__ */ _gte(value, params));
|
|
6164
|
+
inst.max = (value, params) => inst.check(/* @__PURE__ */ _lte(value, params));
|
|
6165
|
+
const c = inst._zod.bag;
|
|
6166
|
+
inst.minDate = c.minimum ? new Date(c.minimum) : null;
|
|
6167
|
+
inst.maxDate = c.maximum ? new Date(c.maximum) : null;
|
|
6168
|
+
});
|
|
6169
|
+
function date(params) {
|
|
6170
|
+
return /* @__PURE__ */ _date(ZodDate, params);
|
|
6171
|
+
}
|
|
3708
6172
|
const ZodArray = /*@__PURE__*/ $constructor("ZodArray", (inst, def) => {
|
|
3709
6173
|
$ZodArray.init(inst, def);
|
|
3710
6174
|
ZodType.init(inst, def);
|
|
@@ -3731,6 +6195,10 @@ const ZodArray = /*@__PURE__*/ $constructor("ZodArray", (inst, def) => {
|
|
|
3731
6195
|
function array(element, params) {
|
|
3732
6196
|
return /* @__PURE__ */ _array(ZodArray, element, params);
|
|
3733
6197
|
}
|
|
6198
|
+
function keyof(schema) {
|
|
6199
|
+
const shape = schema._zod.def.shape;
|
|
6200
|
+
return _enum(Object.keys(shape));
|
|
6201
|
+
}
|
|
3734
6202
|
const ZodObject = /*@__PURE__*/ $constructor("ZodObject", (inst, def) => {
|
|
3735
6203
|
$ZodObjectJIT.init(inst, def);
|
|
3736
6204
|
ZodType.init(inst, def);
|
|
@@ -3803,6 +6271,22 @@ function object(shape, params) {
|
|
|
3803
6271
|
};
|
|
3804
6272
|
return new ZodObject(def);
|
|
3805
6273
|
}
|
|
6274
|
+
function strictObject(shape, params) {
|
|
6275
|
+
return new ZodObject({
|
|
6276
|
+
type: "object",
|
|
6277
|
+
shape,
|
|
6278
|
+
catchall: never(),
|
|
6279
|
+
...normalizeParams(params)
|
|
6280
|
+
});
|
|
6281
|
+
}
|
|
6282
|
+
function looseObject(shape, params) {
|
|
6283
|
+
return new ZodObject({
|
|
6284
|
+
type: "object",
|
|
6285
|
+
shape,
|
|
6286
|
+
catchall: unknown(),
|
|
6287
|
+
...normalizeParams(params)
|
|
6288
|
+
});
|
|
6289
|
+
}
|
|
3806
6290
|
const ZodUnion = /*@__PURE__*/ $constructor("ZodUnion", (inst, def) => {
|
|
3807
6291
|
$ZodUnion.init(inst, def);
|
|
3808
6292
|
ZodType.init(inst, def);
|
|
@@ -3816,6 +6300,35 @@ function union(options, params) {
|
|
|
3816
6300
|
...normalizeParams(params)
|
|
3817
6301
|
});
|
|
3818
6302
|
}
|
|
6303
|
+
const ZodXor = /*@__PURE__*/ $constructor("ZodXor", (inst, def) => {
|
|
6304
|
+
ZodUnion.init(inst, def);
|
|
6305
|
+
$ZodXor.init(inst, def);
|
|
6306
|
+
inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params);
|
|
6307
|
+
inst.options = def.options;
|
|
6308
|
+
});
|
|
6309
|
+
/** Creates an exclusive union (XOR) where exactly one option must match.
|
|
6310
|
+
* Unlike regular unions that succeed when any option matches, xor fails if
|
|
6311
|
+
* zero or more than one option matches the input. */
|
|
6312
|
+
function xor(options, params) {
|
|
6313
|
+
return new ZodXor({
|
|
6314
|
+
type: "union",
|
|
6315
|
+
options,
|
|
6316
|
+
inclusive: false,
|
|
6317
|
+
...normalizeParams(params)
|
|
6318
|
+
});
|
|
6319
|
+
}
|
|
6320
|
+
const ZodDiscriminatedUnion = /*@__PURE__*/ $constructor("ZodDiscriminatedUnion", (inst, def) => {
|
|
6321
|
+
ZodUnion.init(inst, def);
|
|
6322
|
+
$ZodDiscriminatedUnion.init(inst, def);
|
|
6323
|
+
});
|
|
6324
|
+
function discriminatedUnion(discriminator, options, params) {
|
|
6325
|
+
return new ZodDiscriminatedUnion({
|
|
6326
|
+
type: "union",
|
|
6327
|
+
options,
|
|
6328
|
+
discriminator,
|
|
6329
|
+
...normalizeParams(params)
|
|
6330
|
+
});
|
|
6331
|
+
}
|
|
3819
6332
|
const ZodIntersection = /*@__PURE__*/ $constructor("ZodIntersection", (inst, def) => {
|
|
3820
6333
|
$ZodIntersection.init(inst, def);
|
|
3821
6334
|
ZodType.init(inst, def);
|
|
@@ -3828,6 +6341,99 @@ function intersection(left, right) {
|
|
|
3828
6341
|
right
|
|
3829
6342
|
});
|
|
3830
6343
|
}
|
|
6344
|
+
const ZodTuple = /*@__PURE__*/ $constructor("ZodTuple", (inst, def) => {
|
|
6345
|
+
$ZodTuple.init(inst, def);
|
|
6346
|
+
ZodType.init(inst, def);
|
|
6347
|
+
inst._zod.processJSONSchema = (ctx, json, params) => tupleProcessor(inst, ctx, json, params);
|
|
6348
|
+
inst.rest = (rest) => inst.clone({
|
|
6349
|
+
...inst._zod.def,
|
|
6350
|
+
rest
|
|
6351
|
+
});
|
|
6352
|
+
});
|
|
6353
|
+
function tuple(items, _paramsOrRest, _params) {
|
|
6354
|
+
const hasRest = _paramsOrRest instanceof $ZodType;
|
|
6355
|
+
return new ZodTuple({
|
|
6356
|
+
type: "tuple",
|
|
6357
|
+
items,
|
|
6358
|
+
rest: hasRest ? _paramsOrRest : null,
|
|
6359
|
+
...normalizeParams(hasRest ? _params : _paramsOrRest)
|
|
6360
|
+
});
|
|
6361
|
+
}
|
|
6362
|
+
const ZodRecord = /*@__PURE__*/ $constructor("ZodRecord", (inst, def) => {
|
|
6363
|
+
$ZodRecord.init(inst, def);
|
|
6364
|
+
ZodType.init(inst, def);
|
|
6365
|
+
inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params);
|
|
6366
|
+
inst.keyType = def.keyType;
|
|
6367
|
+
inst.valueType = def.valueType;
|
|
6368
|
+
});
|
|
6369
|
+
function record(keyType, valueType, params) {
|
|
6370
|
+
if (!valueType || !valueType._zod) return new ZodRecord({
|
|
6371
|
+
type: "record",
|
|
6372
|
+
keyType: string(),
|
|
6373
|
+
valueType: keyType,
|
|
6374
|
+
...normalizeParams(valueType)
|
|
6375
|
+
});
|
|
6376
|
+
return new ZodRecord({
|
|
6377
|
+
type: "record",
|
|
6378
|
+
keyType,
|
|
6379
|
+
valueType,
|
|
6380
|
+
...normalizeParams(params)
|
|
6381
|
+
});
|
|
6382
|
+
}
|
|
6383
|
+
function partialRecord(keyType, valueType, params) {
|
|
6384
|
+
const k = clone(keyType);
|
|
6385
|
+
k._zod.values = void 0;
|
|
6386
|
+
return new ZodRecord({
|
|
6387
|
+
type: "record",
|
|
6388
|
+
keyType: k,
|
|
6389
|
+
valueType,
|
|
6390
|
+
...normalizeParams(params)
|
|
6391
|
+
});
|
|
6392
|
+
}
|
|
6393
|
+
function looseRecord(keyType, valueType, params) {
|
|
6394
|
+
return new ZodRecord({
|
|
6395
|
+
type: "record",
|
|
6396
|
+
keyType,
|
|
6397
|
+
valueType,
|
|
6398
|
+
mode: "loose",
|
|
6399
|
+
...normalizeParams(params)
|
|
6400
|
+
});
|
|
6401
|
+
}
|
|
6402
|
+
const ZodMap = /*@__PURE__*/ $constructor("ZodMap", (inst, def) => {
|
|
6403
|
+
$ZodMap.init(inst, def);
|
|
6404
|
+
ZodType.init(inst, def);
|
|
6405
|
+
inst._zod.processJSONSchema = (ctx, json, params) => mapProcessor(inst, ctx, json, params);
|
|
6406
|
+
inst.keyType = def.keyType;
|
|
6407
|
+
inst.valueType = def.valueType;
|
|
6408
|
+
inst.min = (...args) => inst.check(/* @__PURE__ */ _minSize(...args));
|
|
6409
|
+
inst.nonempty = (params) => inst.check(/* @__PURE__ */ _minSize(1, params));
|
|
6410
|
+
inst.max = (...args) => inst.check(/* @__PURE__ */ _maxSize(...args));
|
|
6411
|
+
inst.size = (...args) => inst.check(/* @__PURE__ */ _size(...args));
|
|
6412
|
+
});
|
|
6413
|
+
function map(keyType, valueType, params) {
|
|
6414
|
+
return new ZodMap({
|
|
6415
|
+
type: "map",
|
|
6416
|
+
keyType,
|
|
6417
|
+
valueType,
|
|
6418
|
+
...normalizeParams(params)
|
|
6419
|
+
});
|
|
6420
|
+
}
|
|
6421
|
+
const ZodSet = /*@__PURE__*/ $constructor("ZodSet", (inst, def) => {
|
|
6422
|
+
$ZodSet.init(inst, def);
|
|
6423
|
+
ZodType.init(inst, def);
|
|
6424
|
+
inst._zod.processJSONSchema = (ctx, json, params) => setProcessor(inst, ctx, json, params);
|
|
6425
|
+
inst.min = (...args) => inst.check(/* @__PURE__ */ _minSize(...args));
|
|
6426
|
+
inst.nonempty = (params) => inst.check(/* @__PURE__ */ _minSize(1, params));
|
|
6427
|
+
inst.max = (...args) => inst.check(/* @__PURE__ */ _maxSize(...args));
|
|
6428
|
+
inst.size = (...args) => inst.check(/* @__PURE__ */ _size(...args));
|
|
6429
|
+
});
|
|
6430
|
+
function set(valueType, params) {
|
|
6431
|
+
return new ZodSet({
|
|
6432
|
+
type: "set",
|
|
6433
|
+
valueType,
|
|
6434
|
+
...normalizeParams(params)
|
|
6435
|
+
});
|
|
6436
|
+
}
|
|
3831
6437
|
const ZodEnum = /*@__PURE__*/ $constructor("ZodEnum", (inst, def) => {
|
|
3832
6438
|
$ZodEnum.init(inst, def);
|
|
3833
6439
|
ZodType.init(inst, def);
|
|
@@ -3866,6 +6472,20 @@ function _enum(values, params) {
|
|
|
3866
6472
|
...normalizeParams(params)
|
|
3867
6473
|
});
|
|
3868
6474
|
}
|
|
6475
|
+
/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
|
|
6476
|
+
*
|
|
6477
|
+
* ```ts
|
|
6478
|
+
* enum Colors { red, green, blue }
|
|
6479
|
+
* z.enum(Colors);
|
|
6480
|
+
* ```
|
|
6481
|
+
*/
|
|
6482
|
+
function nativeEnum(entries, params) {
|
|
6483
|
+
return new ZodEnum({
|
|
6484
|
+
type: "enum",
|
|
6485
|
+
entries,
|
|
6486
|
+
...normalizeParams(params)
|
|
6487
|
+
});
|
|
6488
|
+
}
|
|
3869
6489
|
const ZodLiteral = /*@__PURE__*/ $constructor("ZodLiteral", (inst, def) => {
|
|
3870
6490
|
$ZodLiteral.init(inst, def);
|
|
3871
6491
|
ZodType.init(inst, def);
|
|
@@ -3883,6 +6503,17 @@ function literal(value, params) {
|
|
|
3883
6503
|
...normalizeParams(params)
|
|
3884
6504
|
});
|
|
3885
6505
|
}
|
|
6506
|
+
const ZodFile = /*@__PURE__*/ $constructor("ZodFile", (inst, def) => {
|
|
6507
|
+
$ZodFile.init(inst, def);
|
|
6508
|
+
ZodType.init(inst, def);
|
|
6509
|
+
inst._zod.processJSONSchema = (ctx, json, params) => fileProcessor(inst, ctx, json, params);
|
|
6510
|
+
inst.min = (size, params) => inst.check(/* @__PURE__ */ _minSize(size, params));
|
|
6511
|
+
inst.max = (size, params) => inst.check(/* @__PURE__ */ _maxSize(size, params));
|
|
6512
|
+
inst.mime = (types, params) => inst.check(/* @__PURE__ */ _mime(Array.isArray(types) ? types : [types], params));
|
|
6513
|
+
});
|
|
6514
|
+
function file(params) {
|
|
6515
|
+
return /* @__PURE__ */ _file(ZodFile, params);
|
|
6516
|
+
}
|
|
3886
6517
|
const ZodTransform = /*@__PURE__*/ $constructor("ZodTransform", (inst, def) => {
|
|
3887
6518
|
$ZodTransform.init(inst, def);
|
|
3888
6519
|
ZodType.init(inst, def);
|
|
@@ -3953,6 +6584,9 @@ function nullable(innerType) {
|
|
|
3953
6584
|
innerType
|
|
3954
6585
|
});
|
|
3955
6586
|
}
|
|
6587
|
+
function nullish(innerType) {
|
|
6588
|
+
return optional(nullable(innerType));
|
|
6589
|
+
}
|
|
3956
6590
|
const ZodDefault = /*@__PURE__*/ $constructor("ZodDefault", (inst, def) => {
|
|
3957
6591
|
$ZodDefault.init(inst, def);
|
|
3958
6592
|
ZodType.init(inst, def);
|
|
@@ -3997,6 +6631,18 @@ function nonoptional(innerType, params) {
|
|
|
3997
6631
|
...normalizeParams(params)
|
|
3998
6632
|
});
|
|
3999
6633
|
}
|
|
6634
|
+
const ZodSuccess = /*@__PURE__*/ $constructor("ZodSuccess", (inst, def) => {
|
|
6635
|
+
$ZodSuccess.init(inst, def);
|
|
6636
|
+
ZodType.init(inst, def);
|
|
6637
|
+
inst._zod.processJSONSchema = (ctx, json, params) => successProcessor(inst, ctx, json, params);
|
|
6638
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
6639
|
+
});
|
|
6640
|
+
function success(innerType) {
|
|
6641
|
+
return new ZodSuccess({
|
|
6642
|
+
type: "success",
|
|
6643
|
+
innerType
|
|
6644
|
+
});
|
|
6645
|
+
}
|
|
4000
6646
|
const ZodCatch = /*@__PURE__*/ $constructor("ZodCatch", (inst, def) => {
|
|
4001
6647
|
$ZodCatch.init(inst, def);
|
|
4002
6648
|
ZodType.init(inst, def);
|
|
@@ -4011,6 +6657,14 @@ function _catch(innerType, catchValue) {
|
|
|
4011
6657
|
catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
|
|
4012
6658
|
});
|
|
4013
6659
|
}
|
|
6660
|
+
const ZodNaN = /*@__PURE__*/ $constructor("ZodNaN", (inst, def) => {
|
|
6661
|
+
$ZodNaN.init(inst, def);
|
|
6662
|
+
ZodType.init(inst, def);
|
|
6663
|
+
inst._zod.processJSONSchema = (ctx, json, params) => nanProcessor(inst, ctx, json, params);
|
|
6664
|
+
});
|
|
6665
|
+
function nan(params) {
|
|
6666
|
+
return /* @__PURE__ */ _nan(ZodNaN, params);
|
|
6667
|
+
}
|
|
4014
6668
|
const ZodPipe = /*@__PURE__*/ $constructor("ZodPipe", (inst, def) => {
|
|
4015
6669
|
$ZodPipe.init(inst, def);
|
|
4016
6670
|
ZodType.init(inst, def);
|
|
@@ -4025,6 +6679,33 @@ function pipe(in_, out) {
|
|
|
4025
6679
|
out
|
|
4026
6680
|
});
|
|
4027
6681
|
}
|
|
6682
|
+
const ZodCodec = /*@__PURE__*/ $constructor("ZodCodec", (inst, def) => {
|
|
6683
|
+
ZodPipe.init(inst, def);
|
|
6684
|
+
$ZodCodec.init(inst, def);
|
|
6685
|
+
});
|
|
6686
|
+
function codec(in_, out, params) {
|
|
6687
|
+
return new ZodCodec({
|
|
6688
|
+
type: "pipe",
|
|
6689
|
+
in: in_,
|
|
6690
|
+
out,
|
|
6691
|
+
transform: params.decode,
|
|
6692
|
+
reverseTransform: params.encode
|
|
6693
|
+
});
|
|
6694
|
+
}
|
|
6695
|
+
function invertCodec(codec) {
|
|
6696
|
+
const def = codec._zod.def;
|
|
6697
|
+
return new ZodCodec({
|
|
6698
|
+
type: "pipe",
|
|
6699
|
+
in: def.out,
|
|
6700
|
+
out: def.in,
|
|
6701
|
+
transform: def.reverseTransform,
|
|
6702
|
+
reverseTransform: def.transform
|
|
6703
|
+
});
|
|
6704
|
+
}
|
|
6705
|
+
const ZodPreprocess = /*@__PURE__*/ $constructor("ZodPreprocess", (inst, def) => {
|
|
6706
|
+
ZodPipe.init(inst, def);
|
|
6707
|
+
$ZodPreprocess.init(inst, def);
|
|
6708
|
+
});
|
|
4028
6709
|
const ZodReadonly = /*@__PURE__*/ $constructor("ZodReadonly", (inst, def) => {
|
|
4029
6710
|
$ZodReadonly.init(inst, def);
|
|
4030
6711
|
ZodType.init(inst, def);
|
|
@@ -4037,17 +6718,120 @@ function readonly(innerType) {
|
|
|
4037
6718
|
innerType
|
|
4038
6719
|
});
|
|
4039
6720
|
}
|
|
6721
|
+
const ZodTemplateLiteral = /*@__PURE__*/ $constructor("ZodTemplateLiteral", (inst, def) => {
|
|
6722
|
+
$ZodTemplateLiteral.init(inst, def);
|
|
6723
|
+
ZodType.init(inst, def);
|
|
6724
|
+
inst._zod.processJSONSchema = (ctx, json, params) => templateLiteralProcessor(inst, ctx, json, params);
|
|
6725
|
+
});
|
|
6726
|
+
function templateLiteral(parts, params) {
|
|
6727
|
+
return new ZodTemplateLiteral({
|
|
6728
|
+
type: "template_literal",
|
|
6729
|
+
parts,
|
|
6730
|
+
...normalizeParams(params)
|
|
6731
|
+
});
|
|
6732
|
+
}
|
|
6733
|
+
const ZodLazy = /*@__PURE__*/ $constructor("ZodLazy", (inst, def) => {
|
|
6734
|
+
$ZodLazy.init(inst, def);
|
|
6735
|
+
ZodType.init(inst, def);
|
|
6736
|
+
inst._zod.processJSONSchema = (ctx, json, params) => lazyProcessor(inst, ctx, json, params);
|
|
6737
|
+
inst.unwrap = () => inst._zod.def.getter();
|
|
6738
|
+
});
|
|
6739
|
+
function lazy(getter) {
|
|
6740
|
+
return new ZodLazy({
|
|
6741
|
+
type: "lazy",
|
|
6742
|
+
getter
|
|
6743
|
+
});
|
|
6744
|
+
}
|
|
6745
|
+
const ZodPromise = /*@__PURE__*/ $constructor("ZodPromise", (inst, def) => {
|
|
6746
|
+
$ZodPromise.init(inst, def);
|
|
6747
|
+
ZodType.init(inst, def);
|
|
6748
|
+
inst._zod.processJSONSchema = (ctx, json, params) => promiseProcessor(inst, ctx, json, params);
|
|
6749
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
6750
|
+
});
|
|
6751
|
+
function promise(innerType) {
|
|
6752
|
+
return new ZodPromise({
|
|
6753
|
+
type: "promise",
|
|
6754
|
+
innerType
|
|
6755
|
+
});
|
|
6756
|
+
}
|
|
6757
|
+
const ZodFunction = /*@__PURE__*/ $constructor("ZodFunction", (inst, def) => {
|
|
6758
|
+
$ZodFunction.init(inst, def);
|
|
6759
|
+
ZodType.init(inst, def);
|
|
6760
|
+
inst._zod.processJSONSchema = (ctx, json, params) => functionProcessor(inst, ctx, json, params);
|
|
6761
|
+
});
|
|
6762
|
+
function _function(params) {
|
|
6763
|
+
return new ZodFunction({
|
|
6764
|
+
type: "function",
|
|
6765
|
+
input: Array.isArray(params?.input) ? tuple(params?.input) : params?.input ?? array(unknown()),
|
|
6766
|
+
output: params?.output ?? unknown()
|
|
6767
|
+
});
|
|
6768
|
+
}
|
|
4040
6769
|
const ZodCustom = /*@__PURE__*/ $constructor("ZodCustom", (inst, def) => {
|
|
4041
6770
|
$ZodCustom.init(inst, def);
|
|
4042
6771
|
ZodType.init(inst, def);
|
|
4043
6772
|
inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
|
|
4044
6773
|
});
|
|
6774
|
+
function check(fn) {
|
|
6775
|
+
const ch = new $ZodCheck({ check: "custom" });
|
|
6776
|
+
ch._zod.check = fn;
|
|
6777
|
+
return ch;
|
|
6778
|
+
}
|
|
6779
|
+
function custom(fn, _params) {
|
|
6780
|
+
return /* @__PURE__ */ _custom(ZodCustom, fn ?? (() => true), _params);
|
|
6781
|
+
}
|
|
4045
6782
|
function refine(fn, _params = {}) {
|
|
4046
6783
|
return /* @__PURE__ */ _refine(ZodCustom, fn, _params);
|
|
4047
6784
|
}
|
|
4048
6785
|
function superRefine(fn, params) {
|
|
4049
6786
|
return /* @__PURE__ */ _superRefine(fn, params);
|
|
4050
6787
|
}
|
|
6788
|
+
const describe = describe$1;
|
|
6789
|
+
const meta = meta$1;
|
|
6790
|
+
function _instanceof(cls, params = {}) {
|
|
6791
|
+
const inst = new ZodCustom({
|
|
6792
|
+
type: "custom",
|
|
6793
|
+
check: "custom",
|
|
6794
|
+
fn: (data) => data instanceof cls,
|
|
6795
|
+
abort: true,
|
|
6796
|
+
...normalizeParams(params)
|
|
6797
|
+
});
|
|
6798
|
+
inst._zod.bag.Class = cls;
|
|
6799
|
+
inst._zod.check = (payload) => {
|
|
6800
|
+
if (!(payload.value instanceof cls)) payload.issues.push({
|
|
6801
|
+
code: "invalid_type",
|
|
6802
|
+
expected: cls.name,
|
|
6803
|
+
input: payload.value,
|
|
6804
|
+
inst,
|
|
6805
|
+
path: [...inst._zod.def.path ?? []]
|
|
6806
|
+
});
|
|
6807
|
+
};
|
|
6808
|
+
return inst;
|
|
6809
|
+
}
|
|
6810
|
+
const stringbool = (...args) => /* @__PURE__ */ _stringbool({
|
|
6811
|
+
Codec: ZodCodec,
|
|
6812
|
+
Boolean: ZodBoolean,
|
|
6813
|
+
String: ZodString
|
|
6814
|
+
}, ...args);
|
|
6815
|
+
function json(params) {
|
|
6816
|
+
const jsonSchema = lazy(() => {
|
|
6817
|
+
return union([
|
|
6818
|
+
string(params),
|
|
6819
|
+
number(),
|
|
6820
|
+
boolean(),
|
|
6821
|
+
_null(),
|
|
6822
|
+
array(jsonSchema),
|
|
6823
|
+
record(string(), jsonSchema)
|
|
6824
|
+
]);
|
|
6825
|
+
});
|
|
6826
|
+
return jsonSchema;
|
|
6827
|
+
}
|
|
6828
|
+
function preprocess(fn, schema) {
|
|
6829
|
+
return new ZodPreprocess({
|
|
6830
|
+
type: "pipe",
|
|
6831
|
+
in: transform(fn),
|
|
6832
|
+
out: schema
|
|
6833
|
+
});
|
|
6834
|
+
}
|
|
4051
6835
|
//#endregion
|
|
4052
6836
|
//#region src/wire.ts
|
|
4053
6837
|
/**
|
|
@@ -4224,4 +7008,4 @@ const BUDGET_INVOCATIONS = Object.freeze([
|
|
|
4224
7008
|
BUDGET_UNBLOCK_DESCRIPTOR
|
|
4225
7009
|
]);
|
|
4226
7010
|
//#endregion
|
|
4227
|
-
export { BUDGET_SETTINGS_SCHEMA as n, BUDGET_INVOCATIONS as t };
|
|
7011
|
+
export { ZodRecord as $, $ZodCIDRv4 as $a, _overwrite as $i, unknown as $n, $ZodTemplateLiteral as $o, _date as $r, decodeAsync$1 as $s, hostname as $t, ZodIPv6 as A, _uppercase as Aa, _lt as Ai, pipe as An, $ZodMap as Ao, extractDefs as Ar, $ZodCheckMultipleOf as As, base64url as At, ZodNever as B, meta$1 as Ba, _nan as Bi, string as Bn, $ZodObjectJIT as Bo, _boolean as Br, _decode as Bs, date as Bt, ZodEmoji as C, _tuple as Ca, $ZodEncodeError as Cc, _isoTime as Ci, nonoptional as Cn, $ZodISOTime as Co, ZodISODuration as Cr, $ZodCheckLessThan as Cs, _instanceof as Ct, ZodFunction as D, _undefined$1 as Da, config as Dc, _length as Di, object as Dn, $ZodLazy as Do, toJSONSchema as Dr, $ZodCheckMimeType as Ds, any as Dt, ZodFile as E, _ulid as Ea, NEVER as Ec, _lazy as Ei, number as En, $ZodKSUID as Eo, allProcessors as Er, $ZodCheckMaxSize as Es, _void as Et, ZodLiteral as F, _uuidv7 as Fa, _maxSize as Fi, record as Fn, $ZodNull as Fo, _any as Fr, $ZodCheckSizeEquals as Fs, cidrv6 as Ft, ZodNumberFormat as G, registry as Ga, _nonnegative as Gi, symbol as Gn, $ZodPromise as Go, _coercedBigint as Gr, _parseAsync as Gs, emoji as Gt, ZodNull as H, $input as Ha, _nativeEnum as Hi, stringbool as Hn, $ZodPipe as Ho, _check as Hr, _encode as Hs, discriminatedUnion as Ht, ZodMAC as I, _void$1 as Ia, _mime as Ii, refine as In, $ZodNullable as Io, _array as Ir, $ZodCheckStartsWith as Is, codec as It, ZodPipe as J, $ZodBase64 as Ja, _normalize as Ji, tuple as Jn, $ZodSet as Jo, _coercedNumber as Jr, _safeEncode as Js, float32 as Jt, ZodObject as K, $ZodAny as Ka, _nonoptional as Ki, templateLiteral as Kn, $ZodReadonly as Ko, _coercedBoolean as Kr, _safeDecode as Ks, exactOptional as Kt, ZodMap as L, _xid as La, _minLength as Li, schemas_exports as Ln, $ZodNumber as Lo, _base64 as Lr, $ZodCheckStringFormat as Ls, cuid as Lt, ZodJWT as M, _uuid as Ma, _mac as Mi, preprocess as Mn, $ZodNanoID as Mo, initializeContext as Mr, $ZodCheckOverwrite as Ms, boolean as Mt, ZodKSUID as N, _uuidv4 as Na, _map as Ni, promise as Nn, $ZodNever as No, process as Nr, $ZodCheckProperty as Ns, check as Nt, ZodGUID as O, _union as Oa, globalConfig as Oc, _literal as Oi, optional as On, $ZodLiteral as Oo, createStandardJSONSchemaMethod as Or, $ZodCheckMinLength as Os, array as Ot, ZodLazy as P, _uuidv6 as Pa, _maxLength as Pi, readonly as Pn, $ZodNonOptional as Po, TimePrecision as Pr, $ZodCheckRegex as Ps, cidrv4 as Pt, ZodReadonly as Q, $ZodBoolean as Qa, _optional as Qi, union as Qn, $ZodSymbol as Qo, _custom as Qr, decode$1 as Qs, hex as Qt, ZodNaN as R, _xor as Ra, _minSize as Ri, set as Rn, $ZodNumberFormat as Ro, _base64url as Rr, $ZodCheckUpperCase as Rs, cuid2 as Rt, ZodEmail as S, _trim as Sa, $ZodAsyncError as Sc, _isoDuration as Si, never as Sn, $ZodISODuration as So, ZodISODateTime as Sr, $ZodCheckLengthEquals as Ss, _function as St, ZodExactOptional as T, _uint64 as Ta, $constructor as Tc, _ksuid as Ti, nullish as Tn, $ZodJWT as To, iso_exports as Tr, $ZodCheckMaxLength as Ts, _undefined as Tt, ZodNullable as U, $output as Ua, _negative as Ui, success as Un, $ZodPrefault as Uo, _cidrv4 as Ur, _encodeAsync as Us, e164 as Ut, ZodNonOptional as V, $ZodRegistry as Va, _nanoid as Vi, stringFormat as Vn, $ZodOptional as Vo, _catch$1 as Vr, _decodeAsync as Vs, describe as Vt, ZodNumber as W, globalRegistry as Wa, _never as Wi, superRefine as Wn, $ZodPreprocess as Wo, _cidrv6 as Wr, _parse as Ws, email as Wt, ZodPreprocess as X, $ZodBigInt as Xa, _nullable as Xi, uint64 as Xn, $ZodStringFormat as Xo, _cuid as Xr, _safeParse as Xs, guid as Xt, ZodPrefault as Y, $ZodBase64URL as Ya, _null$1 as Yi, uint32 as Yn, $ZodString as Yo, _coercedString as Yr, _safeEncodeAsync as Ys, float64 as Yt, ZodPromise as Z, $ZodBigIntFormat as Za, _number as Zi, ulid as Zn, $ZodSuccess as Zo, _cuid2 as Zr, _safeParseAsync as Zs, hash as Zt, ZodCustomStringFormat as _, _symbol as _a, clone as _c, _intersection as _i, map as _n, $ZodGUID as _o, safeParse as _r, $ZodCheck as _s, ZodXor as _t, ZodBase64 as a, _record as aa, safeDecodeAsync$1 as ac, _endsWith as ai, invertCodec as an, $ZodCustom as ao, xid as ar, $ZodUUID as as, ZodTemplateLiteral as at, ZodDiscriminatedUnion as b, _toUpperCase as ba, stringifyPrimitive as bc, _isoDate as bi, nanoid as bn, $ZodISODate as bo, ZodRealError as br, $ZodCheckGreaterThan as bs, _default as bt, ZodBigIntFormat as c, _set as ca, safeParse$1 as cc, _float32 as ci, json as cn, $ZodDefault as co, decodeAsync as cr, $ZodUnknown as cs, ZodType as ct, ZodCIDRv6 as d, _startsWith as da, $ZodRealError as dc, _gte as di, ksuid as dn, $ZodEmail as do, parse as dr, $ZodXor as ds, ZodUUID as dt, _pipe as ea, encode$1 as ec, _default$1 as ei, httpUrl as en, $ZodCIDRv6 as eo, url as er, $ZodTransform as es, ZodSet as et, ZodCUID as f, _string as fa, flattenError as fc, _guid as fi, lazy as fn, $ZodEmoji as fo, parseAsync as fr, isValidBase64 as fs, ZodUndefined as ft, ZodCustom as g, _superRefine as ga, treeifyError as gc, _int64 as gi, mac as gn, $ZodFunction as go, safeEncodeAsync as gr, Doc as gs, ZodXID as gt, ZodCodec as h, _success as ha, toDotPath as hc, _int32 as hi, looseRecord as hn, $ZodFile as ho, safeEncode as hr, version as hs, ZodVoid as ht, ZodArray as i, _readonly as ia, safeDecode$1 as ic, _emoji as ii, intersection as in, $ZodCodec as io, uuidv7 as ir, $ZodURL as is, ZodSymbol as it, ZodIntersection as j, _url as ja, _lte as ji, prefault as jn, $ZodNaN as jo, finalize as jr, $ZodCheckNumberFormat as js, bigint as jt, ZodIPv4 as k, _unknown as ka, _lowercase as ki, partialRecord as kn, $ZodMAC as ko, createToJSONSchemaMethod as kr, $ZodCheckMinSize as ks, base64 as kt, ZodBoolean as l, _size as la, safeParseAsync$1 as lc, _float64 as li, jwt as ln, $ZodDiscriminatedUnion as lo, encode as lr, $ZodVoid as ls, ZodULID as lt, ZodCatch as m, _stringbool as ma, prettifyError as mc, _int as mi, looseObject as mn, $ZodExactOptional as mo, safeDecodeAsync as mr, isValidJWT as ms, ZodUnknown as mt, BUDGET_SETTINGS_SCHEMA as n, _promise as na, parse$1 as nc, _e164 as ni, int32 as nn, $ZodCUID2 as no, uuidv4 as nr, $ZodType as ns, ZodStringFormat as nt, ZodBase64URL as o, _refine as oa, safeEncode$1 as oc, _enum$1 as oi, ipv4 as on, $ZodCustomStringFormat as oo, xor as or, $ZodUndefined as os, ZodTransform as ot, ZodCUID2 as p, _stringFormat as pa, formatError as pc, _includes as pi, literal as pn, $ZodEnum as po, safeDecode as pr, isValidBase64URL as ps, ZodUnion as pt, ZodOptional as q, $ZodArray as qa, _nonpositive as qi, transform as qn, $ZodRecord as qo, _coercedDate as qr, _safeDecodeAsync as qs, file as qt, ZodAny as r, _property as ra, parseAsync$1 as rc, _email as ri, int64 as rn, $ZodCatch as ro, uuidv6 as rr, $ZodULID as rs, ZodSuccess as rt, ZodBigInt as s, _regex as sa, safeEncodeAsync$1 as sc, _file as si, ipv6 as sn, $ZodDate as so, decode as sr, $ZodUnion as ss, ZodTuple as st, BUDGET_INVOCATIONS as t, _positive as ta, encodeAsync$1 as tc, _discriminatedUnion as ti, int as tn, $ZodCUID as to, uuid as tr, $ZodTuple as ts, ZodString as tt, ZodCIDRv4 as u, _slugify as ua, $ZodError as uc, _gt as ui, keyof as un, $ZodE164 as uo, encodeAsync as ur, $ZodXID as us, ZodURL as ut, ZodDate as v, _templateLiteral as va, joinValues as vc, _ipv4 as vi, meta as vn, $ZodIPv4 as vo, safeParseAsync as vr, $ZodCheckBigIntFormat as vs, _ZodString as vt, ZodEnum as w, _uint32 as wa, $brand as wc, _jwt as wi, nullable as wn, $ZodIntersection as wo, ZodISOTime as wr, $ZodCheckLowerCase as ws, _null as wt, ZodE164 as x, _transform as xa, util_exports as xc, _isoDateTime as xi, nativeEnum as xn, $ZodISODateTime as xo, ZodISODate as xr, $ZodCheckIncludes as xs, _enum as xt, ZodDefault as y, _toLowerCase as ya, parsedType as yc, _ipv6 as yi, nan as yn, $ZodIPv6 as yo, ZodError as yr, $ZodCheckEndsWith as ys, _catch as yt, ZodNanoID as z, describe$1 as za, _multipleOf as zi, strictObject as zn, $ZodObject as zo, _bigint as zr, regexes_exports as zs, custom as zt };
|