react-luminus-components 1.1.11 → 1.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/manifest.json +86 -63
- package/dist/DataKey-C0-5Uwn-.cjs +1 -0
- package/dist/DataKey-SawjodF1.js +37 -0
- package/dist/SimpleTooltip-CLfGg88p.cjs +1 -0
- package/dist/{SimpleTooltip-DPtdCueR.mjs → SimpleTooltip-DV3SQ0iz.js} +2 -2
- package/dist/components/Buttons/ContextButton/ContextButton.d.ts +1 -1
- package/dist/components/Buttons/PrimaryButton/PrimaryButton.d.ts +1 -1
- package/dist/components/Dropdown/comps/SimpleToggle/SimpleToggle.d.ts +1 -1
- package/dist/components/HookForm/CheckInput/HookFormCheckInput.d.ts +1 -6
- package/dist/components/HookForm/DropdownPicker/HookFormDropdownPicker.d.ts +2 -5
- package/dist/components/HookForm/FileInput/HookFormFileInput.d.ts +15 -0
- package/dist/components/HookForm/FloatingSubmit/HookFormFloatingSubmit.d.ts +7 -0
- package/dist/components/HookForm/RadioInput/HookFormRadioInput.d.ts +1 -6
- package/dist/components/HookForm/SelectInput/HookFormSelectInput.d.ts +1 -6
- package/dist/components/HookForm/TextAreaInput/HookFormTextAreaInput.d.ts +1 -6
- package/dist/components/HookForm/TextInput/HookFormTextInput.d.ts +1 -6
- package/dist/components/HookForm/index.d.ts +2 -0
- package/dist/components/common/AppSearch/AppSearch.d.ts +3 -0
- package/dist/components/common/YearPicker/YearPicker.d.ts +9 -0
- package/dist/components/common/index.d.ts +2 -0
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +45 -45
- package/dist/hasClass-C0uHVOLl.cjs +20 -0
- package/dist/{hasClass-B-cXdF16.mjs → hasClass-cZEMP5cn.js} +584 -555
- package/dist/hooks/useZodSchemaTypes/useZodSchemaTypes.d.ts +10 -0
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +357 -355
- package/dist/layout/FullScreenContainer/FullScreenContainer.d.ts +1 -1
- package/dist/layout/MainContainer/MainContainer.d.ts +1 -1
- package/dist/layout/PageTitle/PageTitle.d.ts +6 -0
- package/dist/layout/TopBar/TopBar.d.ts +3 -2
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +86 -78
- package/dist/main.cjs.js +1 -1
- package/dist/main.d.ts +3 -2
- package/dist/main.es.js +1645 -1479
- package/dist/models/prop-types/ContainerProps.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/textUtils-CDK5A52_.js +28 -0
- package/dist/textUtils-FVcup93t.cjs +1 -0
- package/dist/{SimplePicker.module-CfYkCM-_.mjs → useAxios-Co2Q-JSk.js} +683 -772
- package/dist/useAxios-DuhvBHuH.cjs +212 -0
- package/dist/useConfirm-5e6ff6zl.cjs +1 -0
- package/dist/{useConfirm-Bp6-YzrM.mjs → useConfirm-8RQF_FiV.js} +1 -1
- package/dist/utils/text/textUtils.d.ts +1 -0
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +33 -32
- package/package.json +3 -1
- package/dist/DataKey-Cvr1Jyo1.mjs +0 -51
- package/dist/DataKey-SdbdzFMm.js +0 -1
- package/dist/SimplePicker.module-RQNGS1Wc.js +0 -212
- package/dist/SimpleTooltip-jdUmgMPW.js +0 -1
- package/dist/hasClass-DIKhTog9.js +0 -20
- package/dist/textUtils-9KFqOvA8.mjs +0 -27
- package/dist/textUtils-C0nqWp3S.js +0 -1
- package/dist/useConfirm-BhYmJh3b.js +0 -1
- /package/dist/{constants-CT2hnPeO.js → constants-CT2hnPeO.cjs} +0 -0
- /package/dist/{constants-CzNy5yO3.mjs → constants-CzNy5yO3.js} +0 -0
- /package/dist/{useClickOutside-BjJyGTec.mjs → useClickOutside-BjJyGTec.js} +0 -0
- /package/dist/{useClickOutside-DsVG12Cs.js → useClickOutside-DsVG12Cs.cjs} +0 -0
package/dist/hooks.es.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { L as
|
|
2
|
-
import { c as
|
|
3
|
-
import { u as
|
|
4
|
-
import { useContext as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { L as Ve } from "./useAxios-Co2Q-JSk.js";
|
|
2
|
+
import { c as Ht, u as Gt, b as Xt, a as Qt } from "./useAxios-Co2Q-JSk.js";
|
|
3
|
+
import { u as Ft } from "./useConfirm-8RQF_FiV.js";
|
|
4
|
+
import { useContext as $e } from "react";
|
|
5
|
+
import { f as Le } from "./textUtils-CDK5A52_.js";
|
|
6
|
+
import { isISODate as De } from "./utils.es.js";
|
|
7
|
+
import { u as tr } from "./useClickOutside-BjJyGTec.js";
|
|
7
8
|
var g;
|
|
8
9
|
(function(r) {
|
|
9
10
|
r.assertEqual = (n) => n;
|
|
@@ -40,14 +41,14 @@ var g;
|
|
|
40
41
|
}
|
|
41
42
|
r.joinValues = s, r.jsonStringifyReplacer = (n, a) => typeof a == "bigint" ? a.toString() : a;
|
|
42
43
|
})(g || (g = {}));
|
|
43
|
-
var
|
|
44
|
+
var be;
|
|
44
45
|
(function(r) {
|
|
45
46
|
r.mergeShapes = (e, t) => ({
|
|
46
47
|
...e,
|
|
47
48
|
...t
|
|
48
49
|
// second overwrites first
|
|
49
50
|
});
|
|
50
|
-
})(
|
|
51
|
+
})(be || (be = {}));
|
|
51
52
|
const u = g.arrayToEnum([
|
|
52
53
|
"string",
|
|
53
54
|
"nan",
|
|
@@ -107,8 +108,8 @@ const u = g.arrayToEnum([
|
|
|
107
108
|
"invalid_intersection_types",
|
|
108
109
|
"not_multiple_of",
|
|
109
110
|
"not_finite"
|
|
110
|
-
]),
|
|
111
|
-
class
|
|
111
|
+
]), Ue = (r) => JSON.stringify(r, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
112
|
+
class E extends Error {
|
|
112
113
|
constructor(e) {
|
|
113
114
|
super(), this.issues = [], this.addIssue = (s) => {
|
|
114
115
|
this.issues = [...this.issues, s];
|
|
@@ -163,8 +164,8 @@ class N extends Error {
|
|
|
163
164
|
return this.flatten();
|
|
164
165
|
}
|
|
165
166
|
}
|
|
166
|
-
|
|
167
|
-
const
|
|
167
|
+
E.create = (r) => new E(r);
|
|
168
|
+
const G = (r, e) => {
|
|
168
169
|
let t;
|
|
169
170
|
switch (r.code) {
|
|
170
171
|
case c.invalid_type:
|
|
@@ -220,14 +221,14 @@ const H = (r, e) => {
|
|
|
220
221
|
}
|
|
221
222
|
return { message: t };
|
|
222
223
|
};
|
|
223
|
-
let
|
|
224
|
-
function
|
|
225
|
-
|
|
224
|
+
let Oe = G;
|
|
225
|
+
function Be(r) {
|
|
226
|
+
Oe = r;
|
|
226
227
|
}
|
|
227
|
-
function
|
|
228
|
-
return
|
|
228
|
+
function ue() {
|
|
229
|
+
return Oe;
|
|
229
230
|
}
|
|
230
|
-
const
|
|
231
|
+
const le = (r) => {
|
|
231
232
|
const { data: e, path: t, errorMaps: s, issueData: n } = r, a = [...t, ...n.path || []], i = {
|
|
232
233
|
...n,
|
|
233
234
|
path: a
|
|
@@ -241,23 +242,23 @@ const ue = (r) => {
|
|
|
241
242
|
path: a,
|
|
242
243
|
message: n.message || o
|
|
243
244
|
};
|
|
244
|
-
},
|
|
245
|
+
}, qe = [];
|
|
245
246
|
function l(r, e) {
|
|
246
|
-
const t =
|
|
247
|
+
const t = le({
|
|
247
248
|
issueData: e,
|
|
248
249
|
data: r.data,
|
|
249
250
|
path: r.path,
|
|
250
251
|
errorMaps: [
|
|
251
252
|
r.common.contextualErrorMap,
|
|
252
253
|
r.schemaErrorMap,
|
|
253
|
-
|
|
254
|
-
|
|
254
|
+
ue(),
|
|
255
|
+
G
|
|
255
256
|
// then global default map
|
|
256
257
|
].filter((s) => !!s)
|
|
257
258
|
});
|
|
258
259
|
r.common.issues.push(t);
|
|
259
260
|
}
|
|
260
|
-
class
|
|
261
|
+
class Z {
|
|
261
262
|
constructor() {
|
|
262
263
|
this.value = "valid";
|
|
263
264
|
}
|
|
@@ -283,7 +284,7 @@ class T {
|
|
|
283
284
|
key: await n.key,
|
|
284
285
|
value: await n.value
|
|
285
286
|
});
|
|
286
|
-
return
|
|
287
|
+
return Z.mergeObjectSync(e, s);
|
|
287
288
|
}
|
|
288
289
|
static mergeObjectSync(e, t) {
|
|
289
290
|
const s = {};
|
|
@@ -298,12 +299,12 @@ class T {
|
|
|
298
299
|
}
|
|
299
300
|
const m = Object.freeze({
|
|
300
301
|
status: "aborted"
|
|
301
|
-
}),
|
|
302
|
+
}), Ne = (r) => ({ status: "dirty", value: r }), S = (r) => ({ status: "valid", value: r }), ke = (r) => r.status === "aborted", we = (r) => r.status === "dirty", X = (r) => r.status === "valid", fe = (r) => typeof Promise < "u" && r instanceof Promise;
|
|
302
303
|
var h;
|
|
303
304
|
(function(r) {
|
|
304
305
|
r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
305
306
|
})(h || (h = {}));
|
|
306
|
-
class
|
|
307
|
+
class j {
|
|
307
308
|
constructor(e, t, s, n) {
|
|
308
309
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = n;
|
|
309
310
|
}
|
|
@@ -311,8 +312,8 @@ class R {
|
|
|
311
312
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
312
313
|
}
|
|
313
314
|
}
|
|
314
|
-
const
|
|
315
|
-
if (
|
|
315
|
+
const Se = (r, e) => {
|
|
316
|
+
if (X(e))
|
|
316
317
|
return { success: !0, data: e.value };
|
|
317
318
|
if (!r.common.issues.length)
|
|
318
319
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -321,7 +322,7 @@ const Te = (r, e) => {
|
|
|
321
322
|
get error() {
|
|
322
323
|
if (this._error)
|
|
323
324
|
return this._error;
|
|
324
|
-
const t = new
|
|
325
|
+
const t = new E(r.common.issues);
|
|
325
326
|
return this._error = t, this._error;
|
|
326
327
|
}
|
|
327
328
|
};
|
|
@@ -356,7 +357,7 @@ class v {
|
|
|
356
357
|
}
|
|
357
358
|
_processInputParams(e) {
|
|
358
359
|
return {
|
|
359
|
-
status: new
|
|
360
|
+
status: new Z(),
|
|
360
361
|
ctx: {
|
|
361
362
|
common: e.parent.common,
|
|
362
363
|
data: e.data,
|
|
@@ -369,7 +370,7 @@ class v {
|
|
|
369
370
|
}
|
|
370
371
|
_parseSync(e) {
|
|
371
372
|
const t = this._parse(e);
|
|
372
|
-
if (
|
|
373
|
+
if (fe(t))
|
|
373
374
|
throw new Error("Synchronous parse encountered promise.");
|
|
374
375
|
return t;
|
|
375
376
|
}
|
|
@@ -397,7 +398,7 @@ class v {
|
|
|
397
398
|
data: e,
|
|
398
399
|
parsedType: P(e)
|
|
399
400
|
}, a = this._parseSync({ data: e, path: n.path, parent: n });
|
|
400
|
-
return
|
|
401
|
+
return Se(n, a);
|
|
401
402
|
}
|
|
402
403
|
async parseAsync(e, t) {
|
|
403
404
|
const s = await this.safeParseAsync(e, t);
|
|
@@ -417,8 +418,8 @@ class v {
|
|
|
417
418
|
parent: null,
|
|
418
419
|
data: e,
|
|
419
420
|
parsedType: P(e)
|
|
420
|
-
}, n = this._parse({ data: e, path: s.path, parent: s }), a = await (
|
|
421
|
-
return
|
|
421
|
+
}, n = this._parse({ data: e, path: s.path, parent: s }), a = await (fe(n) ? n : Promise.resolve(n));
|
|
422
|
+
return Se(s, a);
|
|
422
423
|
}
|
|
423
424
|
refine(e, t) {
|
|
424
425
|
const s = (n) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(n) : t;
|
|
@@ -434,7 +435,7 @@ class v {
|
|
|
434
435
|
return this._refinement((s, n) => e(s) ? !0 : (n.addIssue(typeof t == "function" ? t(s, n) : t), !1));
|
|
435
436
|
}
|
|
436
437
|
_refinement(e) {
|
|
437
|
-
return new
|
|
438
|
+
return new R({
|
|
438
439
|
schema: this,
|
|
439
440
|
typeName: p.ZodEffects,
|
|
440
441
|
effect: { type: "refinement", refinement: e }
|
|
@@ -444,28 +445,28 @@ class v {
|
|
|
444
445
|
return this._refinement(e);
|
|
445
446
|
}
|
|
446
447
|
optional() {
|
|
447
|
-
return
|
|
448
|
+
return M.create(this, this._def);
|
|
448
449
|
}
|
|
449
450
|
nullable() {
|
|
450
|
-
return
|
|
451
|
+
return q.create(this, this._def);
|
|
451
452
|
}
|
|
452
453
|
nullish() {
|
|
453
454
|
return this.nullable().optional();
|
|
454
455
|
}
|
|
455
456
|
array() {
|
|
456
|
-
return
|
|
457
|
+
return I.create(this, this._def);
|
|
457
458
|
}
|
|
458
459
|
promise() {
|
|
459
|
-
return
|
|
460
|
+
return H.create(this, this._def);
|
|
460
461
|
}
|
|
461
462
|
or(e) {
|
|
462
|
-
return
|
|
463
|
+
return ee.create([this, e], this._def);
|
|
463
464
|
}
|
|
464
465
|
and(e) {
|
|
465
|
-
return
|
|
466
|
+
return te.create(this, e, this._def);
|
|
466
467
|
}
|
|
467
468
|
transform(e) {
|
|
468
|
-
return new
|
|
469
|
+
return new R({
|
|
469
470
|
...y(this._def),
|
|
470
471
|
schema: this,
|
|
471
472
|
typeName: p.ZodEffects,
|
|
@@ -474,7 +475,7 @@ class v {
|
|
|
474
475
|
}
|
|
475
476
|
default(e) {
|
|
476
477
|
const t = typeof e == "function" ? e : () => e;
|
|
477
|
-
return new
|
|
478
|
+
return new ie({
|
|
478
479
|
...y(this._def),
|
|
479
480
|
innerType: this,
|
|
480
481
|
defaultValue: t,
|
|
@@ -482,7 +483,7 @@ class v {
|
|
|
482
483
|
});
|
|
483
484
|
}
|
|
484
485
|
brand() {
|
|
485
|
-
return new
|
|
486
|
+
return new Ie({
|
|
486
487
|
typeName: p.ZodBranded,
|
|
487
488
|
type: this,
|
|
488
489
|
...y(this._def)
|
|
@@ -490,7 +491,7 @@ class v {
|
|
|
490
491
|
}
|
|
491
492
|
catch(e) {
|
|
492
493
|
const t = typeof e == "function" ? e : () => e;
|
|
493
|
-
return new
|
|
494
|
+
return new ye({
|
|
494
495
|
...y(this._def),
|
|
495
496
|
innerType: this,
|
|
496
497
|
catchValue: t,
|
|
@@ -505,10 +506,10 @@ class v {
|
|
|
505
506
|
});
|
|
506
507
|
}
|
|
507
508
|
pipe(e) {
|
|
508
|
-
return
|
|
509
|
+
return oe.create(this, e);
|
|
509
510
|
}
|
|
510
511
|
readonly() {
|
|
511
|
-
return
|
|
512
|
+
return _e.create(this);
|
|
512
513
|
}
|
|
513
514
|
isOptional() {
|
|
514
515
|
return this.safeParse(void 0).success;
|
|
@@ -517,13 +518,13 @@ class v {
|
|
|
517
518
|
return this.safeParse(null).success;
|
|
518
519
|
}
|
|
519
520
|
}
|
|
520
|
-
const
|
|
521
|
-
let
|
|
522
|
-
const
|
|
523
|
-
function
|
|
524
|
-
return !!((e === "v4" || !e) &&
|
|
521
|
+
const We = /^c[^\s-]{8,}$/i, Je = /^[a-z][a-z0-9]*$/, Ye = /^[0-9A-HJKMNP-TV-Z]{26}$/, He = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Ge = /^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Xe = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
522
|
+
let xe;
|
|
523
|
+
const Qe = /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/, Ke = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, Fe = (r) => r.precision ? r.offset ? new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`) : new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}Z$`) : r.precision === 0 ? r.offset ? new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$") : new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$") : r.offset ? new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$") : new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");
|
|
524
|
+
function et(r, e) {
|
|
525
|
+
return !!((e === "v4" || !e) && Qe.test(r) || (e === "v6" || !e) && Ke.test(r));
|
|
525
526
|
}
|
|
526
|
-
class
|
|
527
|
+
class N extends v {
|
|
527
528
|
_parse(e) {
|
|
528
529
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== u.string) {
|
|
529
530
|
const a = this._getOrReturnCtx(e);
|
|
@@ -537,7 +538,7 @@ class O extends v {
|
|
|
537
538
|
//
|
|
538
539
|
), m;
|
|
539
540
|
}
|
|
540
|
-
const s = new
|
|
541
|
+
const s = new Z();
|
|
541
542
|
let n;
|
|
542
543
|
for (const a of this._def.checks)
|
|
543
544
|
if (a.kind === "min")
|
|
@@ -576,37 +577,37 @@ class O extends v {
|
|
|
576
577
|
message: a.message
|
|
577
578
|
}), s.dirty());
|
|
578
579
|
} else if (a.kind === "email")
|
|
579
|
-
|
|
580
|
+
Ge.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
|
|
580
581
|
validation: "email",
|
|
581
582
|
code: c.invalid_string,
|
|
582
583
|
message: a.message
|
|
583
584
|
}), s.dirty());
|
|
584
585
|
else if (a.kind === "emoji")
|
|
585
|
-
|
|
586
|
+
xe || (xe = new RegExp(Xe, "u")), xe.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
|
|
586
587
|
validation: "emoji",
|
|
587
588
|
code: c.invalid_string,
|
|
588
589
|
message: a.message
|
|
589
590
|
}), s.dirty());
|
|
590
591
|
else if (a.kind === "uuid")
|
|
591
|
-
|
|
592
|
+
He.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
|
|
592
593
|
validation: "uuid",
|
|
593
594
|
code: c.invalid_string,
|
|
594
595
|
message: a.message
|
|
595
596
|
}), s.dirty());
|
|
596
597
|
else if (a.kind === "cuid")
|
|
597
|
-
|
|
598
|
+
We.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
|
|
598
599
|
validation: "cuid",
|
|
599
600
|
code: c.invalid_string,
|
|
600
601
|
message: a.message
|
|
601
602
|
}), s.dirty());
|
|
602
603
|
else if (a.kind === "cuid2")
|
|
603
|
-
|
|
604
|
+
Je.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
|
|
604
605
|
validation: "cuid2",
|
|
605
606
|
code: c.invalid_string,
|
|
606
607
|
message: a.message
|
|
607
608
|
}), s.dirty());
|
|
608
609
|
else if (a.kind === "ulid")
|
|
609
|
-
|
|
610
|
+
Ye.test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
|
|
610
611
|
validation: "ulid",
|
|
611
612
|
code: c.invalid_string,
|
|
612
613
|
message: a.message
|
|
@@ -638,11 +639,11 @@ class O extends v {
|
|
|
638
639
|
code: c.invalid_string,
|
|
639
640
|
validation: { endsWith: a.value },
|
|
640
641
|
message: a.message
|
|
641
|
-
}), s.dirty()) : a.kind === "datetime" ?
|
|
642
|
+
}), s.dirty()) : a.kind === "datetime" ? Fe(a).test(e.data) || (n = this._getOrReturnCtx(e, n), l(n, {
|
|
642
643
|
code: c.invalid_string,
|
|
643
644
|
validation: "datetime",
|
|
644
645
|
message: a.message
|
|
645
|
-
}), s.dirty()) : a.kind === "ip" ?
|
|
646
|
+
}), s.dirty()) : a.kind === "ip" ? et(e.data, a.version) || (n = this._getOrReturnCtx(e, n), l(n, {
|
|
646
647
|
validation: "ip",
|
|
647
648
|
code: c.invalid_string,
|
|
648
649
|
message: a.message
|
|
@@ -657,7 +658,7 @@ class O extends v {
|
|
|
657
658
|
});
|
|
658
659
|
}
|
|
659
660
|
_addCheck(e) {
|
|
660
|
-
return new
|
|
661
|
+
return new N({
|
|
661
662
|
...this._def,
|
|
662
663
|
checks: [...this._def.checks, e]
|
|
663
664
|
});
|
|
@@ -758,19 +759,19 @@ class O extends v {
|
|
|
758
759
|
return this.min(1, h.errToObj(e));
|
|
759
760
|
}
|
|
760
761
|
trim() {
|
|
761
|
-
return new
|
|
762
|
+
return new N({
|
|
762
763
|
...this._def,
|
|
763
764
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
764
765
|
});
|
|
765
766
|
}
|
|
766
767
|
toLowerCase() {
|
|
767
|
-
return new
|
|
768
|
+
return new N({
|
|
768
769
|
...this._def,
|
|
769
770
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
770
771
|
});
|
|
771
772
|
}
|
|
772
773
|
toUpperCase() {
|
|
773
|
-
return new
|
|
774
|
+
return new N({
|
|
774
775
|
...this._def,
|
|
775
776
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
776
777
|
});
|
|
@@ -815,16 +816,16 @@ class O extends v {
|
|
|
815
816
|
return e;
|
|
816
817
|
}
|
|
817
818
|
}
|
|
818
|
-
|
|
819
|
+
N.create = (r) => {
|
|
819
820
|
var e;
|
|
820
|
-
return new
|
|
821
|
+
return new N({
|
|
821
822
|
checks: [],
|
|
822
823
|
typeName: p.ZodString,
|
|
823
824
|
coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1,
|
|
824
825
|
...y(r)
|
|
825
826
|
});
|
|
826
827
|
};
|
|
827
|
-
function
|
|
828
|
+
function tt(r, e) {
|
|
828
829
|
const t = (r.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, n = t > s ? t : s, a = parseInt(r.toFixed(n).replace(".", "")), i = parseInt(e.toFixed(n).replace(".", ""));
|
|
829
830
|
return a % i / Math.pow(10, n);
|
|
830
831
|
}
|
|
@@ -842,7 +843,7 @@ class V extends v {
|
|
|
842
843
|
}), m;
|
|
843
844
|
}
|
|
844
845
|
let s;
|
|
845
|
-
const n = new
|
|
846
|
+
const n = new Z();
|
|
846
847
|
for (const a of this._def.checks)
|
|
847
848
|
a.kind === "int" ? g.isInteger(e.data) || (s = this._getOrReturnCtx(e, s), l(s, {
|
|
848
849
|
code: c.invalid_type,
|
|
@@ -863,7 +864,7 @@ class V extends v {
|
|
|
863
864
|
inclusive: a.inclusive,
|
|
864
865
|
exact: !1,
|
|
865
866
|
message: a.message
|
|
866
|
-
}), n.dirty()) : a.kind === "multipleOf" ?
|
|
867
|
+
}), n.dirty()) : a.kind === "multipleOf" ? tt(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), l(s, {
|
|
867
868
|
code: c.not_multiple_of,
|
|
868
869
|
multipleOf: a.value,
|
|
869
870
|
message: a.message
|
|
@@ -1000,7 +1001,7 @@ V.create = (r) => new V({
|
|
|
1000
1001
|
coerce: (r == null ? void 0 : r.coerce) || !1,
|
|
1001
1002
|
...y(r)
|
|
1002
1003
|
});
|
|
1003
|
-
class
|
|
1004
|
+
class $ extends v {
|
|
1004
1005
|
constructor() {
|
|
1005
1006
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1006
1007
|
}
|
|
@@ -1014,7 +1015,7 @@ class z extends v {
|
|
|
1014
1015
|
}), m;
|
|
1015
1016
|
}
|
|
1016
1017
|
let s;
|
|
1017
|
-
const n = new
|
|
1018
|
+
const n = new Z();
|
|
1018
1019
|
for (const a of this._def.checks)
|
|
1019
1020
|
a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), l(s, {
|
|
1020
1021
|
code: c.too_small,
|
|
@@ -1048,7 +1049,7 @@ class z extends v {
|
|
|
1048
1049
|
return this.setLimit("max", e, !1, h.toString(t));
|
|
1049
1050
|
}
|
|
1050
1051
|
setLimit(e, t, s, n) {
|
|
1051
|
-
return new
|
|
1052
|
+
return new $({
|
|
1052
1053
|
...this._def,
|
|
1053
1054
|
checks: [
|
|
1054
1055
|
...this._def.checks,
|
|
@@ -1062,7 +1063,7 @@ class z extends v {
|
|
|
1062
1063
|
});
|
|
1063
1064
|
}
|
|
1064
1065
|
_addCheck(e) {
|
|
1065
|
-
return new
|
|
1066
|
+
return new $({
|
|
1066
1067
|
...this._def,
|
|
1067
1068
|
checks: [...this._def.checks, e]
|
|
1068
1069
|
});
|
|
@@ -1119,16 +1120,16 @@ class z extends v {
|
|
|
1119
1120
|
return e;
|
|
1120
1121
|
}
|
|
1121
1122
|
}
|
|
1122
|
-
|
|
1123
|
+
$.create = (r) => {
|
|
1123
1124
|
var e;
|
|
1124
|
-
return new
|
|
1125
|
+
return new $({
|
|
1125
1126
|
checks: [],
|
|
1126
1127
|
typeName: p.ZodBigInt,
|
|
1127
1128
|
coerce: (e = r == null ? void 0 : r.coerce) !== null && e !== void 0 ? e : !1,
|
|
1128
1129
|
...y(r)
|
|
1129
1130
|
});
|
|
1130
1131
|
};
|
|
1131
|
-
class
|
|
1132
|
+
class Q extends v {
|
|
1132
1133
|
_parse(e) {
|
|
1133
1134
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== u.boolean) {
|
|
1134
1135
|
const s = this._getOrReturnCtx(e);
|
|
@@ -1138,15 +1139,15 @@ class X extends v {
|
|
|
1138
1139
|
received: s.parsedType
|
|
1139
1140
|
}), m;
|
|
1140
1141
|
}
|
|
1141
|
-
return
|
|
1142
|
+
return S(e.data);
|
|
1142
1143
|
}
|
|
1143
1144
|
}
|
|
1144
|
-
|
|
1145
|
+
Q.create = (r) => new Q({
|
|
1145
1146
|
typeName: p.ZodBoolean,
|
|
1146
1147
|
coerce: (r == null ? void 0 : r.coerce) || !1,
|
|
1147
1148
|
...y(r)
|
|
1148
1149
|
});
|
|
1149
|
-
class
|
|
1150
|
+
class U extends v {
|
|
1150
1151
|
_parse(e) {
|
|
1151
1152
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== u.date) {
|
|
1152
1153
|
const a = this._getOrReturnCtx(e);
|
|
@@ -1162,7 +1163,7 @@ class D extends v {
|
|
|
1162
1163
|
code: c.invalid_date
|
|
1163
1164
|
}), m;
|
|
1164
1165
|
}
|
|
1165
|
-
const s = new
|
|
1166
|
+
const s = new Z();
|
|
1166
1167
|
let n;
|
|
1167
1168
|
for (const a of this._def.checks)
|
|
1168
1169
|
a.kind === "min" ? e.data.getTime() < a.value && (n = this._getOrReturnCtx(e, n), l(n, {
|
|
@@ -1186,7 +1187,7 @@ class D extends v {
|
|
|
1186
1187
|
};
|
|
1187
1188
|
}
|
|
1188
1189
|
_addCheck(e) {
|
|
1189
|
-
return new
|
|
1190
|
+
return new U({
|
|
1190
1191
|
...this._def,
|
|
1191
1192
|
checks: [...this._def.checks, e]
|
|
1192
1193
|
});
|
|
@@ -1218,13 +1219,13 @@ class D extends v {
|
|
|
1218
1219
|
return e != null ? new Date(e) : null;
|
|
1219
1220
|
}
|
|
1220
1221
|
}
|
|
1221
|
-
|
|
1222
|
+
U.create = (r) => new U({
|
|
1222
1223
|
checks: [],
|
|
1223
1224
|
coerce: (r == null ? void 0 : r.coerce) || !1,
|
|
1224
1225
|
typeName: p.ZodDate,
|
|
1225
1226
|
...y(r)
|
|
1226
1227
|
});
|
|
1227
|
-
class
|
|
1228
|
+
class he extends v {
|
|
1228
1229
|
_parse(e) {
|
|
1229
1230
|
if (this._getType(e) !== u.symbol) {
|
|
1230
1231
|
const s = this._getOrReturnCtx(e);
|
|
@@ -1234,14 +1235,14 @@ class fe extends v {
|
|
|
1234
1235
|
received: s.parsedType
|
|
1235
1236
|
}), m;
|
|
1236
1237
|
}
|
|
1237
|
-
return
|
|
1238
|
+
return S(e.data);
|
|
1238
1239
|
}
|
|
1239
1240
|
}
|
|
1240
|
-
|
|
1241
|
+
he.create = (r) => new he({
|
|
1241
1242
|
typeName: p.ZodSymbol,
|
|
1242
1243
|
...y(r)
|
|
1243
1244
|
});
|
|
1244
|
-
class
|
|
1245
|
+
class K extends v {
|
|
1245
1246
|
_parse(e) {
|
|
1246
1247
|
if (this._getType(e) !== u.undefined) {
|
|
1247
1248
|
const s = this._getOrReturnCtx(e);
|
|
@@ -1251,14 +1252,14 @@ class Q extends v {
|
|
|
1251
1252
|
received: s.parsedType
|
|
1252
1253
|
}), m;
|
|
1253
1254
|
}
|
|
1254
|
-
return
|
|
1255
|
+
return S(e.data);
|
|
1255
1256
|
}
|
|
1256
1257
|
}
|
|
1257
|
-
|
|
1258
|
+
K.create = (r) => new K({
|
|
1258
1259
|
typeName: p.ZodUndefined,
|
|
1259
1260
|
...y(r)
|
|
1260
1261
|
});
|
|
1261
|
-
class
|
|
1262
|
+
class F extends v {
|
|
1262
1263
|
_parse(e) {
|
|
1263
1264
|
if (this._getType(e) !== u.null) {
|
|
1264
1265
|
const s = this._getOrReturnCtx(e);
|
|
@@ -1268,38 +1269,38 @@ class K extends v {
|
|
|
1268
1269
|
received: s.parsedType
|
|
1269
1270
|
}), m;
|
|
1270
1271
|
}
|
|
1271
|
-
return
|
|
1272
|
+
return S(e.data);
|
|
1272
1273
|
}
|
|
1273
1274
|
}
|
|
1274
|
-
|
|
1275
|
+
F.create = (r) => new F({
|
|
1275
1276
|
typeName: p.ZodNull,
|
|
1276
1277
|
...y(r)
|
|
1277
1278
|
});
|
|
1278
|
-
class
|
|
1279
|
+
class Y extends v {
|
|
1279
1280
|
constructor() {
|
|
1280
1281
|
super(...arguments), this._any = !0;
|
|
1281
1282
|
}
|
|
1282
1283
|
_parse(e) {
|
|
1283
|
-
return
|
|
1284
|
+
return S(e.data);
|
|
1284
1285
|
}
|
|
1285
1286
|
}
|
|
1286
|
-
|
|
1287
|
+
Y.create = (r) => new Y({
|
|
1287
1288
|
typeName: p.ZodAny,
|
|
1288
1289
|
...y(r)
|
|
1289
1290
|
});
|
|
1290
|
-
class
|
|
1291
|
+
class D extends v {
|
|
1291
1292
|
constructor() {
|
|
1292
1293
|
super(...arguments), this._unknown = !0;
|
|
1293
1294
|
}
|
|
1294
1295
|
_parse(e) {
|
|
1295
|
-
return
|
|
1296
|
+
return S(e.data);
|
|
1296
1297
|
}
|
|
1297
1298
|
}
|
|
1298
|
-
|
|
1299
|
+
D.create = (r) => new D({
|
|
1299
1300
|
typeName: p.ZodUnknown,
|
|
1300
1301
|
...y(r)
|
|
1301
1302
|
});
|
|
1302
|
-
class
|
|
1303
|
+
class z extends v {
|
|
1303
1304
|
_parse(e) {
|
|
1304
1305
|
const t = this._getOrReturnCtx(e);
|
|
1305
1306
|
return l(t, {
|
|
@@ -1309,11 +1310,11 @@ class M extends v {
|
|
|
1309
1310
|
}), m;
|
|
1310
1311
|
}
|
|
1311
1312
|
}
|
|
1312
|
-
|
|
1313
|
+
z.create = (r) => new z({
|
|
1313
1314
|
typeName: p.ZodNever,
|
|
1314
1315
|
...y(r)
|
|
1315
1316
|
});
|
|
1316
|
-
class
|
|
1317
|
+
class pe extends v {
|
|
1317
1318
|
_parse(e) {
|
|
1318
1319
|
if (this._getType(e) !== u.undefined) {
|
|
1319
1320
|
const s = this._getOrReturnCtx(e);
|
|
@@ -1323,14 +1324,14 @@ class he extends v {
|
|
|
1323
1324
|
received: s.parsedType
|
|
1324
1325
|
}), m;
|
|
1325
1326
|
}
|
|
1326
|
-
return
|
|
1327
|
+
return S(e.data);
|
|
1327
1328
|
}
|
|
1328
1329
|
}
|
|
1329
|
-
|
|
1330
|
+
pe.create = (r) => new pe({
|
|
1330
1331
|
typeName: p.ZodVoid,
|
|
1331
1332
|
...y(r)
|
|
1332
1333
|
});
|
|
1333
|
-
class
|
|
1334
|
+
class I extends v {
|
|
1334
1335
|
_parse(e) {
|
|
1335
1336
|
const { ctx: t, status: s } = this._processInputParams(e), n = this._def;
|
|
1336
1337
|
if (t.parsedType !== u.array)
|
|
@@ -1366,27 +1367,27 @@ class E extends v {
|
|
|
1366
1367
|
exact: !1,
|
|
1367
1368
|
message: n.maxLength.message
|
|
1368
1369
|
}), s.dirty()), t.common.async)
|
|
1369
|
-
return Promise.all([...t.data].map((i, o) => n.type._parseAsync(new
|
|
1370
|
-
const a = [...t.data].map((i, o) => n.type._parseSync(new
|
|
1371
|
-
return
|
|
1370
|
+
return Promise.all([...t.data].map((i, o) => n.type._parseAsync(new j(t, i, t.path, o)))).then((i) => Z.mergeArray(s, i));
|
|
1371
|
+
const a = [...t.data].map((i, o) => n.type._parseSync(new j(t, i, t.path, o)));
|
|
1372
|
+
return Z.mergeArray(s, a);
|
|
1372
1373
|
}
|
|
1373
1374
|
get element() {
|
|
1374
1375
|
return this._def.type;
|
|
1375
1376
|
}
|
|
1376
1377
|
min(e, t) {
|
|
1377
|
-
return new
|
|
1378
|
+
return new I({
|
|
1378
1379
|
...this._def,
|
|
1379
1380
|
minLength: { value: e, message: h.toString(t) }
|
|
1380
1381
|
});
|
|
1381
1382
|
}
|
|
1382
1383
|
max(e, t) {
|
|
1383
|
-
return new
|
|
1384
|
+
return new I({
|
|
1384
1385
|
...this._def,
|
|
1385
1386
|
maxLength: { value: e, message: h.toString(t) }
|
|
1386
1387
|
});
|
|
1387
1388
|
}
|
|
1388
1389
|
length(e, t) {
|
|
1389
|
-
return new
|
|
1390
|
+
return new I({
|
|
1390
1391
|
...this._def,
|
|
1391
1392
|
exactLength: { value: e, message: h.toString(t) }
|
|
1392
1393
|
});
|
|
@@ -1395,7 +1396,7 @@ class E extends v {
|
|
|
1395
1396
|
return this.min(1, e);
|
|
1396
1397
|
}
|
|
1397
1398
|
}
|
|
1398
|
-
|
|
1399
|
+
I.create = (r, e) => new I({
|
|
1399
1400
|
type: r,
|
|
1400
1401
|
minLength: null,
|
|
1401
1402
|
maxLength: null,
|
|
@@ -1403,22 +1404,22 @@ E.create = (r, e) => new E({
|
|
|
1403
1404
|
typeName: p.ZodArray,
|
|
1404
1405
|
...y(e)
|
|
1405
1406
|
});
|
|
1406
|
-
function
|
|
1407
|
+
function W(r) {
|
|
1407
1408
|
if (r instanceof b) {
|
|
1408
1409
|
const e = {};
|
|
1409
1410
|
for (const t in r.shape) {
|
|
1410
1411
|
const s = r.shape[t];
|
|
1411
|
-
e[t] =
|
|
1412
|
+
e[t] = M.create(W(s));
|
|
1412
1413
|
}
|
|
1413
1414
|
return new b({
|
|
1414
1415
|
...r._def,
|
|
1415
1416
|
shape: () => e
|
|
1416
1417
|
});
|
|
1417
1418
|
} else
|
|
1418
|
-
return r instanceof
|
|
1419
|
+
return r instanceof I ? new I({
|
|
1419
1420
|
...r._def,
|
|
1420
|
-
type:
|
|
1421
|
-
}) : r instanceof
|
|
1421
|
+
type: W(r.element)
|
|
1422
|
+
}) : r instanceof M ? M.create(W(r.unwrap())) : r instanceof q ? q.create(W(r.unwrap())) : r instanceof A ? A.create(r.items.map((e) => W(e))) : r;
|
|
1422
1423
|
}
|
|
1423
1424
|
class b extends v {
|
|
1424
1425
|
constructor() {
|
|
@@ -1440,19 +1441,19 @@ class b extends v {
|
|
|
1440
1441
|
}), m;
|
|
1441
1442
|
}
|
|
1442
1443
|
const { status: s, ctx: n } = this._processInputParams(e), { shape: a, keys: i } = this._getCached(), o = [];
|
|
1443
|
-
if (!(this._def.catchall instanceof
|
|
1444
|
+
if (!(this._def.catchall instanceof z && this._def.unknownKeys === "strip"))
|
|
1444
1445
|
for (const d in n.data)
|
|
1445
1446
|
i.includes(d) || o.push(d);
|
|
1446
1447
|
const f = [];
|
|
1447
1448
|
for (const d of i) {
|
|
1448
|
-
const _ = a[d],
|
|
1449
|
+
const _ = a[d], O = n.data[d];
|
|
1449
1450
|
f.push({
|
|
1450
1451
|
key: { status: "valid", value: d },
|
|
1451
|
-
value: _._parse(new
|
|
1452
|
+
value: _._parse(new j(n, O, n.path, d)),
|
|
1452
1453
|
alwaysSet: d in n.data
|
|
1453
1454
|
});
|
|
1454
1455
|
}
|
|
1455
|
-
if (this._def.catchall instanceof
|
|
1456
|
+
if (this._def.catchall instanceof z) {
|
|
1456
1457
|
const d = this._def.unknownKeys;
|
|
1457
1458
|
if (d === "passthrough")
|
|
1458
1459
|
for (const _ of o)
|
|
@@ -1470,11 +1471,11 @@ class b extends v {
|
|
|
1470
1471
|
} else {
|
|
1471
1472
|
const d = this._def.catchall;
|
|
1472
1473
|
for (const _ of o) {
|
|
1473
|
-
const
|
|
1474
|
+
const O = n.data[_];
|
|
1474
1475
|
f.push({
|
|
1475
1476
|
key: { status: "valid", value: _ },
|
|
1476
1477
|
value: d._parse(
|
|
1477
|
-
new
|
|
1478
|
+
new j(n, O, n.path, _)
|
|
1478
1479
|
//, ctx.child(key), value, getParsedType(value)
|
|
1479
1480
|
),
|
|
1480
1481
|
alwaysSet: _ in n.data
|
|
@@ -1484,15 +1485,15 @@ class b extends v {
|
|
|
1484
1485
|
return n.common.async ? Promise.resolve().then(async () => {
|
|
1485
1486
|
const d = [];
|
|
1486
1487
|
for (const _ of f) {
|
|
1487
|
-
const
|
|
1488
|
+
const O = await _.key;
|
|
1488
1489
|
d.push({
|
|
1489
|
-
key:
|
|
1490
|
+
key: O,
|
|
1490
1491
|
value: await _.value,
|
|
1491
1492
|
alwaysSet: _.alwaysSet
|
|
1492
1493
|
});
|
|
1493
1494
|
}
|
|
1494
1495
|
return d;
|
|
1495
|
-
}).then((d) =>
|
|
1496
|
+
}).then((d) => Z.mergeObjectSync(s, d)) : Z.mergeObjectSync(s, f);
|
|
1496
1497
|
}
|
|
1497
1498
|
get shape() {
|
|
1498
1499
|
return this._def.shape();
|
|
@@ -1655,7 +1656,7 @@ class b extends v {
|
|
|
1655
1656
|
* @deprecated
|
|
1656
1657
|
*/
|
|
1657
1658
|
deepPartial() {
|
|
1658
|
-
return
|
|
1659
|
+
return W(this);
|
|
1659
1660
|
}
|
|
1660
1661
|
partial(e) {
|
|
1661
1662
|
const t = {};
|
|
@@ -1674,7 +1675,7 @@ class b extends v {
|
|
|
1674
1675
|
t[s] = this.shape[s];
|
|
1675
1676
|
else {
|
|
1676
1677
|
let a = this.shape[s];
|
|
1677
|
-
for (; a instanceof
|
|
1678
|
+
for (; a instanceof M; )
|
|
1678
1679
|
a = a._def.innerType;
|
|
1679
1680
|
t[s] = a;
|
|
1680
1681
|
}
|
|
@@ -1684,31 +1685,31 @@ class b extends v {
|
|
|
1684
1685
|
});
|
|
1685
1686
|
}
|
|
1686
1687
|
keyof() {
|
|
1687
|
-
return
|
|
1688
|
+
return Ee(g.objectKeys(this.shape));
|
|
1688
1689
|
}
|
|
1689
1690
|
}
|
|
1690
1691
|
b.create = (r, e) => new b({
|
|
1691
1692
|
shape: () => r,
|
|
1692
1693
|
unknownKeys: "strip",
|
|
1693
|
-
catchall:
|
|
1694
|
+
catchall: z.create(),
|
|
1694
1695
|
typeName: p.ZodObject,
|
|
1695
1696
|
...y(e)
|
|
1696
1697
|
});
|
|
1697
1698
|
b.strictCreate = (r, e) => new b({
|
|
1698
1699
|
shape: () => r,
|
|
1699
1700
|
unknownKeys: "strict",
|
|
1700
|
-
catchall:
|
|
1701
|
+
catchall: z.create(),
|
|
1701
1702
|
typeName: p.ZodObject,
|
|
1702
1703
|
...y(e)
|
|
1703
1704
|
});
|
|
1704
1705
|
b.lazycreate = (r, e) => new b({
|
|
1705
1706
|
shape: r,
|
|
1706
1707
|
unknownKeys: "strip",
|
|
1707
|
-
catchall:
|
|
1708
|
+
catchall: z.create(),
|
|
1708
1709
|
typeName: p.ZodObject,
|
|
1709
1710
|
...y(e)
|
|
1710
1711
|
});
|
|
1711
|
-
class
|
|
1712
|
+
class ee extends v {
|
|
1712
1713
|
_parse(e) {
|
|
1713
1714
|
const { ctx: t } = this._processInputParams(e), s = this._def.options;
|
|
1714
1715
|
function n(a) {
|
|
@@ -1718,7 +1719,7 @@ class F extends v {
|
|
|
1718
1719
|
for (const o of a)
|
|
1719
1720
|
if (o.result.status === "dirty")
|
|
1720
1721
|
return t.common.issues.push(...o.ctx.common.issues), o.result;
|
|
1721
|
-
const i = a.map((o) => new
|
|
1722
|
+
const i = a.map((o) => new E(o.ctx.common.issues));
|
|
1722
1723
|
return l(t, {
|
|
1723
1724
|
code: c.invalid_union,
|
|
1724
1725
|
unionErrors: i
|
|
@@ -1765,7 +1766,7 @@ class F extends v {
|
|
|
1765
1766
|
}
|
|
1766
1767
|
if (a)
|
|
1767
1768
|
return t.common.issues.push(...a.ctx.common.issues), a.result;
|
|
1768
|
-
const o = i.map((f) => new
|
|
1769
|
+
const o = i.map((f) => new E(f));
|
|
1769
1770
|
return l(t, {
|
|
1770
1771
|
code: c.invalid_union,
|
|
1771
1772
|
unionErrors: o
|
|
@@ -1776,13 +1777,13 @@ class F extends v {
|
|
|
1776
1777
|
return this._def.options;
|
|
1777
1778
|
}
|
|
1778
1779
|
}
|
|
1779
|
-
|
|
1780
|
+
ee.create = (r, e) => new ee({
|
|
1780
1781
|
options: r,
|
|
1781
1782
|
typeName: p.ZodUnion,
|
|
1782
1783
|
...y(e)
|
|
1783
1784
|
});
|
|
1784
|
-
const
|
|
1785
|
-
class
|
|
1785
|
+
const de = (r) => r instanceof se ? de(r.schema) : r instanceof R ? de(r.innerType()) : r instanceof ne ? [r.value] : r instanceof L ? r.options : r instanceof ae ? Object.keys(r.enum) : r instanceof ie ? de(r._def.innerType) : r instanceof K ? [void 0] : r instanceof F ? [null] : null;
|
|
1786
|
+
class ge extends v {
|
|
1786
1787
|
_parse(e) {
|
|
1787
1788
|
const { ctx: t } = this._processInputParams(e);
|
|
1788
1789
|
if (t.parsedType !== u.object)
|
|
@@ -1826,7 +1827,7 @@ class _e extends v {
|
|
|
1826
1827
|
static create(e, t, s) {
|
|
1827
1828
|
const n = /* @__PURE__ */ new Map();
|
|
1828
1829
|
for (const a of t) {
|
|
1829
|
-
const i =
|
|
1830
|
+
const i = de(a.shape[e]);
|
|
1830
1831
|
if (!i)
|
|
1831
1832
|
throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
|
|
1832
1833
|
for (const o of i) {
|
|
@@ -1835,7 +1836,7 @@ class _e extends v {
|
|
|
1835
1836
|
n.set(o, a);
|
|
1836
1837
|
}
|
|
1837
1838
|
}
|
|
1838
|
-
return new
|
|
1839
|
+
return new ge({
|
|
1839
1840
|
typeName: p.ZodDiscriminatedUnion,
|
|
1840
1841
|
discriminator: e,
|
|
1841
1842
|
options: t,
|
|
@@ -1844,14 +1845,14 @@ class _e extends v {
|
|
|
1844
1845
|
});
|
|
1845
1846
|
}
|
|
1846
1847
|
}
|
|
1847
|
-
function
|
|
1848
|
+
function Te(r, e) {
|
|
1848
1849
|
const t = P(r), s = P(e);
|
|
1849
1850
|
if (r === e)
|
|
1850
1851
|
return { valid: !0, data: r };
|
|
1851
1852
|
if (t === u.object && s === u.object) {
|
|
1852
1853
|
const n = g.objectKeys(e), a = g.objectKeys(r).filter((o) => n.indexOf(o) !== -1), i = { ...r, ...e };
|
|
1853
1854
|
for (const o of a) {
|
|
1854
|
-
const f =
|
|
1855
|
+
const f = Te(r[o], e[o]);
|
|
1855
1856
|
if (!f.valid)
|
|
1856
1857
|
return { valid: !1 };
|
|
1857
1858
|
i[o] = f.data;
|
|
@@ -1862,7 +1863,7 @@ function we(r, e) {
|
|
|
1862
1863
|
return { valid: !1 };
|
|
1863
1864
|
const n = [];
|
|
1864
1865
|
for (let a = 0; a < r.length; a++) {
|
|
1865
|
-
const i = r[a], o = e[a], f =
|
|
1866
|
+
const i = r[a], o = e[a], f = Te(i, o);
|
|
1866
1867
|
if (!f.valid)
|
|
1867
1868
|
return { valid: !1 };
|
|
1868
1869
|
n.push(f.data);
|
|
@@ -1871,13 +1872,13 @@ function we(r, e) {
|
|
|
1871
1872
|
} else
|
|
1872
1873
|
return t === u.date && s === u.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
|
|
1873
1874
|
}
|
|
1874
|
-
class
|
|
1875
|
+
class te extends v {
|
|
1875
1876
|
_parse(e) {
|
|
1876
1877
|
const { status: t, ctx: s } = this._processInputParams(e), n = (a, i) => {
|
|
1877
|
-
if (
|
|
1878
|
+
if (ke(a) || ke(i))
|
|
1878
1879
|
return m;
|
|
1879
|
-
const o =
|
|
1880
|
-
return o.valid ? ((
|
|
1880
|
+
const o = Te(a.value, i.value);
|
|
1881
|
+
return o.valid ? ((we(a) || we(i)) && t.dirty(), { status: t.value, value: o.data }) : (l(s, {
|
|
1881
1882
|
code: c.invalid_intersection_types
|
|
1882
1883
|
}), m);
|
|
1883
1884
|
};
|
|
@@ -1903,13 +1904,13 @@ class ee extends v {
|
|
|
1903
1904
|
}));
|
|
1904
1905
|
}
|
|
1905
1906
|
}
|
|
1906
|
-
|
|
1907
|
+
te.create = (r, e, t) => new te({
|
|
1907
1908
|
left: r,
|
|
1908
1909
|
right: e,
|
|
1909
1910
|
typeName: p.ZodIntersection,
|
|
1910
1911
|
...y(t)
|
|
1911
1912
|
});
|
|
1912
|
-
class
|
|
1913
|
+
class A extends v {
|
|
1913
1914
|
_parse(e) {
|
|
1914
1915
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
1915
1916
|
if (s.parsedType !== u.array)
|
|
@@ -1935,31 +1936,31 @@ class j extends v {
|
|
|
1935
1936
|
}), t.dirty());
|
|
1936
1937
|
const a = [...s.data].map((i, o) => {
|
|
1937
1938
|
const f = this._def.items[o] || this._def.rest;
|
|
1938
|
-
return f ? f._parse(new
|
|
1939
|
+
return f ? f._parse(new j(s, i, s.path, o)) : null;
|
|
1939
1940
|
}).filter((i) => !!i);
|
|
1940
|
-
return s.common.async ? Promise.all(a).then((i) =>
|
|
1941
|
+
return s.common.async ? Promise.all(a).then((i) => Z.mergeArray(t, i)) : Z.mergeArray(t, a);
|
|
1941
1942
|
}
|
|
1942
1943
|
get items() {
|
|
1943
1944
|
return this._def.items;
|
|
1944
1945
|
}
|
|
1945
1946
|
rest(e) {
|
|
1946
|
-
return new
|
|
1947
|
+
return new A({
|
|
1947
1948
|
...this._def,
|
|
1948
1949
|
rest: e
|
|
1949
1950
|
});
|
|
1950
1951
|
}
|
|
1951
1952
|
}
|
|
1952
|
-
|
|
1953
|
+
A.create = (r, e) => {
|
|
1953
1954
|
if (!Array.isArray(r))
|
|
1954
1955
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
1955
|
-
return new
|
|
1956
|
+
return new A({
|
|
1956
1957
|
items: r,
|
|
1957
1958
|
typeName: p.ZodTuple,
|
|
1958
1959
|
rest: null,
|
|
1959
1960
|
...y(e)
|
|
1960
1961
|
});
|
|
1961
1962
|
};
|
|
1962
|
-
class
|
|
1963
|
+
class re extends v {
|
|
1963
1964
|
get keySchema() {
|
|
1964
1965
|
return this._def.keyType;
|
|
1965
1966
|
}
|
|
@@ -1977,29 +1978,29 @@ class te extends v {
|
|
|
1977
1978
|
const n = [], a = this._def.keyType, i = this._def.valueType;
|
|
1978
1979
|
for (const o in s.data)
|
|
1979
1980
|
n.push({
|
|
1980
|
-
key: a._parse(new
|
|
1981
|
-
value: i._parse(new
|
|
1981
|
+
key: a._parse(new j(s, o, s.path, o)),
|
|
1982
|
+
value: i._parse(new j(s, s.data[o], s.path, o))
|
|
1982
1983
|
});
|
|
1983
|
-
return s.common.async ?
|
|
1984
|
+
return s.common.async ? Z.mergeObjectAsync(t, n) : Z.mergeObjectSync(t, n);
|
|
1984
1985
|
}
|
|
1985
1986
|
get element() {
|
|
1986
1987
|
return this._def.valueType;
|
|
1987
1988
|
}
|
|
1988
1989
|
static create(e, t, s) {
|
|
1989
|
-
return t instanceof v ? new
|
|
1990
|
+
return t instanceof v ? new re({
|
|
1990
1991
|
keyType: e,
|
|
1991
1992
|
valueType: t,
|
|
1992
1993
|
typeName: p.ZodRecord,
|
|
1993
1994
|
...y(s)
|
|
1994
|
-
}) : new
|
|
1995
|
-
keyType:
|
|
1995
|
+
}) : new re({
|
|
1996
|
+
keyType: N.create(),
|
|
1996
1997
|
valueType: e,
|
|
1997
1998
|
typeName: p.ZodRecord,
|
|
1998
1999
|
...y(t)
|
|
1999
2000
|
});
|
|
2000
2001
|
}
|
|
2001
2002
|
}
|
|
2002
|
-
class
|
|
2003
|
+
class me extends v {
|
|
2003
2004
|
get keySchema() {
|
|
2004
2005
|
return this._def.keyType;
|
|
2005
2006
|
}
|
|
@@ -2015,8 +2016,8 @@ class pe extends v {
|
|
|
2015
2016
|
received: s.parsedType
|
|
2016
2017
|
}), m;
|
|
2017
2018
|
const n = this._def.keyType, a = this._def.valueType, i = [...s.data.entries()].map(([o, f], d) => ({
|
|
2018
|
-
key: n._parse(new
|
|
2019
|
-
value: a._parse(new
|
|
2019
|
+
key: n._parse(new j(s, o, s.path, [d, "key"])),
|
|
2020
|
+
value: a._parse(new j(s, f, s.path, [d, "value"]))
|
|
2020
2021
|
}));
|
|
2021
2022
|
if (s.common.async) {
|
|
2022
2023
|
const o = /* @__PURE__ */ new Map();
|
|
@@ -2041,13 +2042,13 @@ class pe extends v {
|
|
|
2041
2042
|
}
|
|
2042
2043
|
}
|
|
2043
2044
|
}
|
|
2044
|
-
|
|
2045
|
+
me.create = (r, e, t) => new me({
|
|
2045
2046
|
valueType: e,
|
|
2046
2047
|
keyType: r,
|
|
2047
2048
|
typeName: p.ZodMap,
|
|
2048
2049
|
...y(t)
|
|
2049
2050
|
});
|
|
2050
|
-
class
|
|
2051
|
+
class B extends v {
|
|
2051
2052
|
_parse(e) {
|
|
2052
2053
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
2053
2054
|
if (s.parsedType !== u.set)
|
|
@@ -2082,17 +2083,17 @@ class U extends v {
|
|
|
2082
2083
|
}
|
|
2083
2084
|
return { status: t.value, value: d };
|
|
2084
2085
|
}
|
|
2085
|
-
const o = [...s.data.values()].map((f, d) => a._parse(new
|
|
2086
|
+
const o = [...s.data.values()].map((f, d) => a._parse(new j(s, f, s.path, d)));
|
|
2086
2087
|
return s.common.async ? Promise.all(o).then((f) => i(f)) : i(o);
|
|
2087
2088
|
}
|
|
2088
2089
|
min(e, t) {
|
|
2089
|
-
return new
|
|
2090
|
+
return new B({
|
|
2090
2091
|
...this._def,
|
|
2091
2092
|
minSize: { value: e, message: h.toString(t) }
|
|
2092
2093
|
});
|
|
2093
2094
|
}
|
|
2094
2095
|
max(e, t) {
|
|
2095
|
-
return new
|
|
2096
|
+
return new B({
|
|
2096
2097
|
...this._def,
|
|
2097
2098
|
maxSize: { value: e, message: h.toString(t) }
|
|
2098
2099
|
});
|
|
@@ -2104,14 +2105,14 @@ class U extends v {
|
|
|
2104
2105
|
return this.min(1, e);
|
|
2105
2106
|
}
|
|
2106
2107
|
}
|
|
2107
|
-
|
|
2108
|
+
B.create = (r, e) => new B({
|
|
2108
2109
|
valueType: r,
|
|
2109
2110
|
minSize: null,
|
|
2110
2111
|
maxSize: null,
|
|
2111
2112
|
typeName: p.ZodSet,
|
|
2112
2113
|
...y(e)
|
|
2113
2114
|
});
|
|
2114
|
-
class
|
|
2115
|
+
class J extends v {
|
|
2115
2116
|
constructor() {
|
|
2116
2117
|
super(...arguments), this.validate = this.implement;
|
|
2117
2118
|
}
|
|
@@ -2124,14 +2125,14 @@ class W extends v {
|
|
|
2124
2125
|
received: t.parsedType
|
|
2125
2126
|
}), m;
|
|
2126
2127
|
function s(o, f) {
|
|
2127
|
-
return
|
|
2128
|
+
return le({
|
|
2128
2129
|
data: o,
|
|
2129
2130
|
path: t.path,
|
|
2130
2131
|
errorMaps: [
|
|
2131
2132
|
t.common.contextualErrorMap,
|
|
2132
2133
|
t.schemaErrorMap,
|
|
2133
|
-
|
|
2134
|
-
|
|
2134
|
+
ue(),
|
|
2135
|
+
G
|
|
2135
2136
|
].filter((d) => !!d),
|
|
2136
2137
|
issueData: {
|
|
2137
2138
|
code: c.invalid_arguments,
|
|
@@ -2140,14 +2141,14 @@ class W extends v {
|
|
|
2140
2141
|
});
|
|
2141
2142
|
}
|
|
2142
2143
|
function n(o, f) {
|
|
2143
|
-
return
|
|
2144
|
+
return le({
|
|
2144
2145
|
data: o,
|
|
2145
2146
|
path: t.path,
|
|
2146
2147
|
errorMaps: [
|
|
2147
2148
|
t.common.contextualErrorMap,
|
|
2148
2149
|
t.schemaErrorMap,
|
|
2149
|
-
|
|
2150
|
-
|
|
2150
|
+
ue(),
|
|
2151
|
+
G
|
|
2151
2152
|
].filter((d) => !!d),
|
|
2152
2153
|
issueData: {
|
|
2153
2154
|
code: c.invalid_return_type,
|
|
@@ -2156,26 +2157,26 @@ class W extends v {
|
|
|
2156
2157
|
});
|
|
2157
2158
|
}
|
|
2158
2159
|
const a = { errorMap: t.common.contextualErrorMap }, i = t.data;
|
|
2159
|
-
if (this._def.returns instanceof
|
|
2160
|
+
if (this._def.returns instanceof H) {
|
|
2160
2161
|
const o = this;
|
|
2161
|
-
return
|
|
2162
|
-
const d = new
|
|
2163
|
-
throw d.addIssue(s(f,
|
|
2164
|
-
}),
|
|
2165
|
-
return await o._def.returns._def.type.parseAsync(
|
|
2166
|
-
throw d.addIssue(n(
|
|
2162
|
+
return S(async function(...f) {
|
|
2163
|
+
const d = new E([]), _ = await o._def.args.parseAsync(f, a).catch((ce) => {
|
|
2164
|
+
throw d.addIssue(s(f, ce)), d;
|
|
2165
|
+
}), O = await Reflect.apply(i, this, _);
|
|
2166
|
+
return await o._def.returns._def.type.parseAsync(O, a).catch((ce) => {
|
|
2167
|
+
throw d.addIssue(n(O, ce)), d;
|
|
2167
2168
|
});
|
|
2168
2169
|
});
|
|
2169
2170
|
} else {
|
|
2170
2171
|
const o = this;
|
|
2171
|
-
return
|
|
2172
|
+
return S(function(...f) {
|
|
2172
2173
|
const d = o._def.args.safeParse(f, a);
|
|
2173
2174
|
if (!d.success)
|
|
2174
|
-
throw new
|
|
2175
|
-
const _ = Reflect.apply(i, this, d.data),
|
|
2176
|
-
if (!
|
|
2177
|
-
throw new
|
|
2178
|
-
return
|
|
2175
|
+
throw new E([s(f, d.error)]);
|
|
2176
|
+
const _ = Reflect.apply(i, this, d.data), O = o._def.returns.safeParse(_, a);
|
|
2177
|
+
if (!O.success)
|
|
2178
|
+
throw new E([n(_, O.error)]);
|
|
2179
|
+
return O.data;
|
|
2179
2180
|
});
|
|
2180
2181
|
}
|
|
2181
2182
|
}
|
|
@@ -2186,13 +2187,13 @@ class W extends v {
|
|
|
2186
2187
|
return this._def.returns;
|
|
2187
2188
|
}
|
|
2188
2189
|
args(...e) {
|
|
2189
|
-
return new
|
|
2190
|
+
return new J({
|
|
2190
2191
|
...this._def,
|
|
2191
|
-
args:
|
|
2192
|
+
args: A.create(e).rest(D.create())
|
|
2192
2193
|
});
|
|
2193
2194
|
}
|
|
2194
2195
|
returns(e) {
|
|
2195
|
-
return new
|
|
2196
|
+
return new J({
|
|
2196
2197
|
...this._def,
|
|
2197
2198
|
returns: e
|
|
2198
2199
|
});
|
|
@@ -2204,15 +2205,15 @@ class W extends v {
|
|
|
2204
2205
|
return this.parse(e);
|
|
2205
2206
|
}
|
|
2206
2207
|
static create(e, t, s) {
|
|
2207
|
-
return new
|
|
2208
|
-
args: e ||
|
|
2209
|
-
returns: t ||
|
|
2208
|
+
return new J({
|
|
2209
|
+
args: e || A.create([]).rest(D.create()),
|
|
2210
|
+
returns: t || D.create(),
|
|
2210
2211
|
typeName: p.ZodFunction,
|
|
2211
2212
|
...y(s)
|
|
2212
2213
|
});
|
|
2213
2214
|
}
|
|
2214
2215
|
}
|
|
2215
|
-
class
|
|
2216
|
+
class se extends v {
|
|
2216
2217
|
get schema() {
|
|
2217
2218
|
return this._def.getter();
|
|
2218
2219
|
}
|
|
@@ -2221,12 +2222,12 @@ class re extends v {
|
|
|
2221
2222
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
2222
2223
|
}
|
|
2223
2224
|
}
|
|
2224
|
-
|
|
2225
|
+
se.create = (r, e) => new se({
|
|
2225
2226
|
getter: r,
|
|
2226
2227
|
typeName: p.ZodLazy,
|
|
2227
2228
|
...y(e)
|
|
2228
2229
|
});
|
|
2229
|
-
class
|
|
2230
|
+
class ne extends v {
|
|
2230
2231
|
_parse(e) {
|
|
2231
2232
|
if (e.data !== this._def.value) {
|
|
2232
2233
|
const t = this._getOrReturnCtx(e);
|
|
@@ -2242,19 +2243,19 @@ class se extends v {
|
|
|
2242
2243
|
return this._def.value;
|
|
2243
2244
|
}
|
|
2244
2245
|
}
|
|
2245
|
-
|
|
2246
|
+
ne.create = (r, e) => new ne({
|
|
2246
2247
|
value: r,
|
|
2247
2248
|
typeName: p.ZodLiteral,
|
|
2248
2249
|
...y(e)
|
|
2249
2250
|
});
|
|
2250
|
-
function
|
|
2251
|
-
return new
|
|
2251
|
+
function Ee(r, e) {
|
|
2252
|
+
return new L({
|
|
2252
2253
|
values: r,
|
|
2253
2254
|
typeName: p.ZodEnum,
|
|
2254
2255
|
...y(e)
|
|
2255
2256
|
});
|
|
2256
2257
|
}
|
|
2257
|
-
class
|
|
2258
|
+
class L extends v {
|
|
2258
2259
|
_parse(e) {
|
|
2259
2260
|
if (typeof e.data != "string") {
|
|
2260
2261
|
const t = this._getOrReturnCtx(e), s = this._def.values;
|
|
@@ -2272,7 +2273,7 @@ class $ extends v {
|
|
|
2272
2273
|
options: s
|
|
2273
2274
|
}), m;
|
|
2274
2275
|
}
|
|
2275
|
-
return
|
|
2276
|
+
return S(e.data);
|
|
2276
2277
|
}
|
|
2277
2278
|
get options() {
|
|
2278
2279
|
return this._def.values;
|
|
@@ -2296,14 +2297,14 @@ class $ extends v {
|
|
|
2296
2297
|
return e;
|
|
2297
2298
|
}
|
|
2298
2299
|
extract(e) {
|
|
2299
|
-
return
|
|
2300
|
+
return L.create(e);
|
|
2300
2301
|
}
|
|
2301
2302
|
exclude(e) {
|
|
2302
|
-
return
|
|
2303
|
+
return L.create(this.options.filter((t) => !e.includes(t)));
|
|
2303
2304
|
}
|
|
2304
2305
|
}
|
|
2305
|
-
|
|
2306
|
-
class
|
|
2306
|
+
L.create = Ee;
|
|
2307
|
+
class ae extends v {
|
|
2307
2308
|
_parse(e) {
|
|
2308
2309
|
const t = g.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
|
|
2309
2310
|
if (s.parsedType !== u.string && s.parsedType !== u.number) {
|
|
@@ -2322,18 +2323,18 @@ class ne extends v {
|
|
|
2322
2323
|
options: n
|
|
2323
2324
|
}), m;
|
|
2324
2325
|
}
|
|
2325
|
-
return
|
|
2326
|
+
return S(e.data);
|
|
2326
2327
|
}
|
|
2327
2328
|
get enum() {
|
|
2328
2329
|
return this._def.values;
|
|
2329
2330
|
}
|
|
2330
2331
|
}
|
|
2331
|
-
|
|
2332
|
+
ae.create = (r, e) => new ae({
|
|
2332
2333
|
values: r,
|
|
2333
2334
|
typeName: p.ZodNativeEnum,
|
|
2334
2335
|
...y(e)
|
|
2335
2336
|
});
|
|
2336
|
-
class
|
|
2337
|
+
class H extends v {
|
|
2337
2338
|
unwrap() {
|
|
2338
2339
|
return this._def.type;
|
|
2339
2340
|
}
|
|
@@ -2346,18 +2347,18 @@ class Y extends v {
|
|
|
2346
2347
|
received: t.parsedType
|
|
2347
2348
|
}), m;
|
|
2348
2349
|
const s = t.parsedType === u.promise ? t.data : Promise.resolve(t.data);
|
|
2349
|
-
return
|
|
2350
|
+
return S(s.then((n) => this._def.type.parseAsync(n, {
|
|
2350
2351
|
path: t.path,
|
|
2351
2352
|
errorMap: t.common.contextualErrorMap
|
|
2352
2353
|
})));
|
|
2353
2354
|
}
|
|
2354
2355
|
}
|
|
2355
|
-
|
|
2356
|
+
H.create = (r, e) => new H({
|
|
2356
2357
|
type: r,
|
|
2357
2358
|
typeName: p.ZodPromise,
|
|
2358
2359
|
...y(e)
|
|
2359
2360
|
});
|
|
2360
|
-
class
|
|
2361
|
+
class R extends v {
|
|
2361
2362
|
innerType() {
|
|
2362
2363
|
return this._def.schema;
|
|
2363
2364
|
}
|
|
@@ -2414,56 +2415,56 @@ class I extends v {
|
|
|
2414
2415
|
path: s.path,
|
|
2415
2416
|
parent: s
|
|
2416
2417
|
});
|
|
2417
|
-
if (!
|
|
2418
|
+
if (!X(i))
|
|
2418
2419
|
return i;
|
|
2419
2420
|
const o = n.transform(i.value, a);
|
|
2420
2421
|
if (o instanceof Promise)
|
|
2421
2422
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2422
2423
|
return { status: t.value, value: o };
|
|
2423
2424
|
} else
|
|
2424
|
-
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) =>
|
|
2425
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((i) => X(i) ? Promise.resolve(n.transform(i.value, a)).then((o) => ({ status: t.value, value: o })) : i);
|
|
2425
2426
|
g.assertNever(n);
|
|
2426
2427
|
}
|
|
2427
2428
|
}
|
|
2428
|
-
|
|
2429
|
+
R.create = (r, e, t) => new R({
|
|
2429
2430
|
schema: r,
|
|
2430
2431
|
typeName: p.ZodEffects,
|
|
2431
2432
|
effect: e,
|
|
2432
2433
|
...y(t)
|
|
2433
2434
|
});
|
|
2434
|
-
|
|
2435
|
+
R.createWithPreprocess = (r, e, t) => new R({
|
|
2435
2436
|
schema: e,
|
|
2436
2437
|
effect: { type: "preprocess", transform: r },
|
|
2437
2438
|
typeName: p.ZodEffects,
|
|
2438
2439
|
...y(t)
|
|
2439
2440
|
});
|
|
2440
|
-
class
|
|
2441
|
+
class M extends v {
|
|
2441
2442
|
_parse(e) {
|
|
2442
|
-
return this._getType(e) === u.undefined ?
|
|
2443
|
+
return this._getType(e) === u.undefined ? S(void 0) : this._def.innerType._parse(e);
|
|
2443
2444
|
}
|
|
2444
2445
|
unwrap() {
|
|
2445
2446
|
return this._def.innerType;
|
|
2446
2447
|
}
|
|
2447
2448
|
}
|
|
2448
|
-
|
|
2449
|
+
M.create = (r, e) => new M({
|
|
2449
2450
|
innerType: r,
|
|
2450
2451
|
typeName: p.ZodOptional,
|
|
2451
2452
|
...y(e)
|
|
2452
2453
|
});
|
|
2453
|
-
class
|
|
2454
|
+
class q extends v {
|
|
2454
2455
|
_parse(e) {
|
|
2455
|
-
return this._getType(e) === u.null ?
|
|
2456
|
+
return this._getType(e) === u.null ? S(null) : this._def.innerType._parse(e);
|
|
2456
2457
|
}
|
|
2457
2458
|
unwrap() {
|
|
2458
2459
|
return this._def.innerType;
|
|
2459
2460
|
}
|
|
2460
2461
|
}
|
|
2461
|
-
|
|
2462
|
+
q.create = (r, e) => new q({
|
|
2462
2463
|
innerType: r,
|
|
2463
2464
|
typeName: p.ZodNullable,
|
|
2464
2465
|
...y(e)
|
|
2465
2466
|
});
|
|
2466
|
-
class
|
|
2467
|
+
class ie extends v {
|
|
2467
2468
|
_parse(e) {
|
|
2468
2469
|
const { ctx: t } = this._processInputParams(e);
|
|
2469
2470
|
let s = t.data;
|
|
@@ -2477,13 +2478,13 @@ class ae extends v {
|
|
|
2477
2478
|
return this._def.innerType;
|
|
2478
2479
|
}
|
|
2479
2480
|
}
|
|
2480
|
-
|
|
2481
|
+
ie.create = (r, e) => new ie({
|
|
2481
2482
|
innerType: r,
|
|
2482
2483
|
typeName: p.ZodDefault,
|
|
2483
2484
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2484
2485
|
...y(e)
|
|
2485
2486
|
});
|
|
2486
|
-
class
|
|
2487
|
+
class ye extends v {
|
|
2487
2488
|
_parse(e) {
|
|
2488
2489
|
const { ctx: t } = this._processInputParams(e), s = {
|
|
2489
2490
|
...t,
|
|
@@ -2498,11 +2499,11 @@ class me extends v {
|
|
|
2498
2499
|
...s
|
|
2499
2500
|
}
|
|
2500
2501
|
});
|
|
2501
|
-
return
|
|
2502
|
+
return fe(n) ? n.then((a) => ({
|
|
2502
2503
|
status: "valid",
|
|
2503
2504
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
2504
2505
|
get error() {
|
|
2505
|
-
return new
|
|
2506
|
+
return new E(s.common.issues);
|
|
2506
2507
|
},
|
|
2507
2508
|
input: s.data
|
|
2508
2509
|
})
|
|
@@ -2510,7 +2511,7 @@ class me extends v {
|
|
|
2510
2511
|
status: "valid",
|
|
2511
2512
|
value: n.status === "valid" ? n.value : this._def.catchValue({
|
|
2512
2513
|
get error() {
|
|
2513
|
-
return new
|
|
2514
|
+
return new E(s.common.issues);
|
|
2514
2515
|
},
|
|
2515
2516
|
input: s.data
|
|
2516
2517
|
})
|
|
@@ -2520,13 +2521,13 @@ class me extends v {
|
|
|
2520
2521
|
return this._def.innerType;
|
|
2521
2522
|
}
|
|
2522
2523
|
}
|
|
2523
|
-
|
|
2524
|
+
ye.create = (r, e) => new ye({
|
|
2524
2525
|
innerType: r,
|
|
2525
2526
|
typeName: p.ZodCatch,
|
|
2526
2527
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2527
2528
|
...y(e)
|
|
2528
2529
|
});
|
|
2529
|
-
class
|
|
2530
|
+
class ve extends v {
|
|
2530
2531
|
_parse(e) {
|
|
2531
2532
|
if (this._getType(e) !== u.nan) {
|
|
2532
2533
|
const s = this._getOrReturnCtx(e);
|
|
@@ -2539,12 +2540,12 @@ class ye extends v {
|
|
|
2539
2540
|
return { status: "valid", value: e.data };
|
|
2540
2541
|
}
|
|
2541
2542
|
}
|
|
2542
|
-
|
|
2543
|
+
ve.create = (r) => new ve({
|
|
2543
2544
|
typeName: p.ZodNaN,
|
|
2544
2545
|
...y(r)
|
|
2545
2546
|
});
|
|
2546
|
-
const
|
|
2547
|
-
class
|
|
2547
|
+
const rt = Symbol("zod_brand");
|
|
2548
|
+
class Ie extends v {
|
|
2548
2549
|
_parse(e) {
|
|
2549
2550
|
const { ctx: t } = this._processInputParams(e), s = t.data;
|
|
2550
2551
|
return this._def.type._parse({
|
|
@@ -2557,7 +2558,7 @@ class Ne extends v {
|
|
|
2557
2558
|
return this._def.type;
|
|
2558
2559
|
}
|
|
2559
2560
|
}
|
|
2560
|
-
class
|
|
2561
|
+
class oe extends v {
|
|
2561
2562
|
_parse(e) {
|
|
2562
2563
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
2563
2564
|
if (s.common.async)
|
|
@@ -2567,7 +2568,7 @@ class ie extends v {
|
|
|
2567
2568
|
path: s.path,
|
|
2568
2569
|
parent: s
|
|
2569
2570
|
});
|
|
2570
|
-
return a.status === "aborted" ? m : a.status === "dirty" ? (t.dirty(),
|
|
2571
|
+
return a.status === "aborted" ? m : a.status === "dirty" ? (t.dirty(), Ne(a.value)) : this._def.out._parseAsync({
|
|
2571
2572
|
data: a.value,
|
|
2572
2573
|
path: s.path,
|
|
2573
2574
|
parent: s
|
|
@@ -2590,172 +2591,172 @@ class ie extends v {
|
|
|
2590
2591
|
}
|
|
2591
2592
|
}
|
|
2592
2593
|
static create(e, t) {
|
|
2593
|
-
return new
|
|
2594
|
+
return new oe({
|
|
2594
2595
|
in: e,
|
|
2595
2596
|
out: t,
|
|
2596
2597
|
typeName: p.ZodPipeline
|
|
2597
2598
|
});
|
|
2598
2599
|
}
|
|
2599
2600
|
}
|
|
2600
|
-
class
|
|
2601
|
+
class _e extends v {
|
|
2601
2602
|
_parse(e) {
|
|
2602
2603
|
const t = this._def.innerType._parse(e);
|
|
2603
|
-
return
|
|
2604
|
+
return X(t) && (t.value = Object.freeze(t.value)), t;
|
|
2604
2605
|
}
|
|
2605
2606
|
}
|
|
2606
|
-
|
|
2607
|
+
_e.create = (r, e) => new _e({
|
|
2607
2608
|
innerType: r,
|
|
2608
2609
|
typeName: p.ZodReadonly,
|
|
2609
2610
|
...y(e)
|
|
2610
2611
|
});
|
|
2611
|
-
const
|
|
2612
|
+
const Re = (r, e = {}, t) => r ? Y.create().superRefine((s, n) => {
|
|
2612
2613
|
var a, i;
|
|
2613
2614
|
if (!r(s)) {
|
|
2614
2615
|
const o = typeof e == "function" ? e(s) : typeof e == "string" ? { message: e } : e, f = (i = (a = o.fatal) !== null && a !== void 0 ? a : t) !== null && i !== void 0 ? i : !0, d = typeof o == "string" ? { message: o } : o;
|
|
2615
2616
|
n.addIssue({ code: "custom", ...d, fatal: f });
|
|
2616
2617
|
}
|
|
2617
|
-
}) :
|
|
2618
|
+
}) : Y.create(), st = {
|
|
2618
2619
|
object: b.lazycreate
|
|
2619
2620
|
};
|
|
2620
2621
|
var p;
|
|
2621
2622
|
(function(r) {
|
|
2622
2623
|
r.ZodString = "ZodString", r.ZodNumber = "ZodNumber", r.ZodNaN = "ZodNaN", r.ZodBigInt = "ZodBigInt", r.ZodBoolean = "ZodBoolean", r.ZodDate = "ZodDate", r.ZodSymbol = "ZodSymbol", r.ZodUndefined = "ZodUndefined", r.ZodNull = "ZodNull", r.ZodAny = "ZodAny", r.ZodUnknown = "ZodUnknown", r.ZodNever = "ZodNever", r.ZodVoid = "ZodVoid", r.ZodArray = "ZodArray", r.ZodObject = "ZodObject", r.ZodUnion = "ZodUnion", r.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", r.ZodIntersection = "ZodIntersection", r.ZodTuple = "ZodTuple", r.ZodRecord = "ZodRecord", r.ZodMap = "ZodMap", r.ZodSet = "ZodSet", r.ZodFunction = "ZodFunction", r.ZodLazy = "ZodLazy", r.ZodLiteral = "ZodLiteral", r.ZodEnum = "ZodEnum", r.ZodEffects = "ZodEffects", r.ZodNativeEnum = "ZodNativeEnum", r.ZodOptional = "ZodOptional", r.ZodNullable = "ZodNullable", r.ZodDefault = "ZodDefault", r.ZodCatch = "ZodCatch", r.ZodPromise = "ZodPromise", r.ZodBranded = "ZodBranded", r.ZodPipeline = "ZodPipeline", r.ZodReadonly = "ZodReadonly";
|
|
2623
2624
|
})(p || (p = {}));
|
|
2624
|
-
const
|
|
2625
|
+
const nt = (r, e = {
|
|
2625
2626
|
message: `Input not instance of ${r.name}`
|
|
2626
|
-
}) =>
|
|
2627
|
-
string: (r) =>
|
|
2627
|
+
}) => Re((t) => t instanceof r, e), je = N.create, Ae = V.create, at = ve.create, it = $.create, Me = Q.create, ot = U.create, ct = he.create, dt = K.create, ut = F.create, lt = Y.create, ft = D.create, ht = z.create, pt = pe.create, mt = I.create, yt = b.create, vt = b.strictCreate, _t = ee.create, gt = ge.create, xt = te.create, bt = A.create, kt = re.create, wt = me.create, Tt = B.create, Zt = J.create, St = se.create, Ct = ne.create, Ot = L.create, Nt = ae.create, Et = H.create, Ce = R.create, It = M.create, Rt = q.create, jt = R.createWithPreprocess, At = oe.create, Mt = () => je().optional(), zt = () => Ae().optional(), Pt = () => Me().optional(), Vt = {
|
|
2628
|
+
string: (r) => N.create({ ...r, coerce: !0 }),
|
|
2628
2629
|
number: (r) => V.create({ ...r, coerce: !0 }),
|
|
2629
|
-
boolean: (r) =>
|
|
2630
|
+
boolean: (r) => Q.create({
|
|
2630
2631
|
...r,
|
|
2631
2632
|
coerce: !0
|
|
2632
2633
|
}),
|
|
2633
|
-
bigint: (r) =>
|
|
2634
|
-
date: (r) =>
|
|
2635
|
-
},
|
|
2634
|
+
bigint: (r) => $.create({ ...r, coerce: !0 }),
|
|
2635
|
+
date: (r) => U.create({ ...r, coerce: !0 })
|
|
2636
|
+
}, $t = m;
|
|
2636
2637
|
var C = /* @__PURE__ */ Object.freeze({
|
|
2637
2638
|
__proto__: null,
|
|
2638
|
-
defaultErrorMap:
|
|
2639
|
-
setErrorMap:
|
|
2640
|
-
getErrorMap:
|
|
2641
|
-
makeIssue:
|
|
2642
|
-
EMPTY_PATH:
|
|
2639
|
+
defaultErrorMap: G,
|
|
2640
|
+
setErrorMap: Be,
|
|
2641
|
+
getErrorMap: ue,
|
|
2642
|
+
makeIssue: le,
|
|
2643
|
+
EMPTY_PATH: qe,
|
|
2643
2644
|
addIssueToContext: l,
|
|
2644
|
-
ParseStatus:
|
|
2645
|
+
ParseStatus: Z,
|
|
2645
2646
|
INVALID: m,
|
|
2646
|
-
DIRTY:
|
|
2647
|
-
OK:
|
|
2648
|
-
isAborted:
|
|
2649
|
-
isDirty:
|
|
2650
|
-
isValid:
|
|
2651
|
-
isAsync:
|
|
2647
|
+
DIRTY: Ne,
|
|
2648
|
+
OK: S,
|
|
2649
|
+
isAborted: ke,
|
|
2650
|
+
isDirty: we,
|
|
2651
|
+
isValid: X,
|
|
2652
|
+
isAsync: fe,
|
|
2652
2653
|
get util() {
|
|
2653
2654
|
return g;
|
|
2654
2655
|
},
|
|
2655
2656
|
get objectUtil() {
|
|
2656
|
-
return
|
|
2657
|
+
return be;
|
|
2657
2658
|
},
|
|
2658
2659
|
ZodParsedType: u,
|
|
2659
2660
|
getParsedType: P,
|
|
2660
2661
|
ZodType: v,
|
|
2661
|
-
ZodString:
|
|
2662
|
+
ZodString: N,
|
|
2662
2663
|
ZodNumber: V,
|
|
2663
|
-
ZodBigInt:
|
|
2664
|
-
ZodBoolean:
|
|
2665
|
-
ZodDate:
|
|
2666
|
-
ZodSymbol:
|
|
2667
|
-
ZodUndefined:
|
|
2668
|
-
ZodNull:
|
|
2669
|
-
ZodAny:
|
|
2670
|
-
ZodUnknown:
|
|
2671
|
-
ZodNever:
|
|
2672
|
-
ZodVoid:
|
|
2673
|
-
ZodArray:
|
|
2664
|
+
ZodBigInt: $,
|
|
2665
|
+
ZodBoolean: Q,
|
|
2666
|
+
ZodDate: U,
|
|
2667
|
+
ZodSymbol: he,
|
|
2668
|
+
ZodUndefined: K,
|
|
2669
|
+
ZodNull: F,
|
|
2670
|
+
ZodAny: Y,
|
|
2671
|
+
ZodUnknown: D,
|
|
2672
|
+
ZodNever: z,
|
|
2673
|
+
ZodVoid: pe,
|
|
2674
|
+
ZodArray: I,
|
|
2674
2675
|
ZodObject: b,
|
|
2675
|
-
ZodUnion:
|
|
2676
|
-
ZodDiscriminatedUnion:
|
|
2677
|
-
ZodIntersection:
|
|
2678
|
-
ZodTuple:
|
|
2679
|
-
ZodRecord:
|
|
2680
|
-
ZodMap:
|
|
2681
|
-
ZodSet:
|
|
2682
|
-
ZodFunction:
|
|
2683
|
-
ZodLazy:
|
|
2684
|
-
ZodLiteral:
|
|
2685
|
-
ZodEnum:
|
|
2686
|
-
ZodNativeEnum:
|
|
2687
|
-
ZodPromise:
|
|
2688
|
-
ZodEffects:
|
|
2689
|
-
ZodTransformer:
|
|
2690
|
-
ZodOptional:
|
|
2691
|
-
ZodNullable:
|
|
2692
|
-
ZodDefault:
|
|
2693
|
-
ZodCatch:
|
|
2694
|
-
ZodNaN:
|
|
2695
|
-
BRAND:
|
|
2696
|
-
ZodBranded:
|
|
2697
|
-
ZodPipeline:
|
|
2698
|
-
ZodReadonly:
|
|
2699
|
-
custom:
|
|
2676
|
+
ZodUnion: ee,
|
|
2677
|
+
ZodDiscriminatedUnion: ge,
|
|
2678
|
+
ZodIntersection: te,
|
|
2679
|
+
ZodTuple: A,
|
|
2680
|
+
ZodRecord: re,
|
|
2681
|
+
ZodMap: me,
|
|
2682
|
+
ZodSet: B,
|
|
2683
|
+
ZodFunction: J,
|
|
2684
|
+
ZodLazy: se,
|
|
2685
|
+
ZodLiteral: ne,
|
|
2686
|
+
ZodEnum: L,
|
|
2687
|
+
ZodNativeEnum: ae,
|
|
2688
|
+
ZodPromise: H,
|
|
2689
|
+
ZodEffects: R,
|
|
2690
|
+
ZodTransformer: R,
|
|
2691
|
+
ZodOptional: M,
|
|
2692
|
+
ZodNullable: q,
|
|
2693
|
+
ZodDefault: ie,
|
|
2694
|
+
ZodCatch: ye,
|
|
2695
|
+
ZodNaN: ve,
|
|
2696
|
+
BRAND: rt,
|
|
2697
|
+
ZodBranded: Ie,
|
|
2698
|
+
ZodPipeline: oe,
|
|
2699
|
+
ZodReadonly: _e,
|
|
2700
|
+
custom: Re,
|
|
2700
2701
|
Schema: v,
|
|
2701
2702
|
ZodSchema: v,
|
|
2702
|
-
late:
|
|
2703
|
+
late: st,
|
|
2703
2704
|
get ZodFirstPartyTypeKind() {
|
|
2704
2705
|
return p;
|
|
2705
2706
|
},
|
|
2706
|
-
coerce:
|
|
2707
|
-
any:
|
|
2708
|
-
array:
|
|
2709
|
-
bigint:
|
|
2710
|
-
boolean:
|
|
2711
|
-
date:
|
|
2712
|
-
discriminatedUnion:
|
|
2713
|
-
effect:
|
|
2714
|
-
enum:
|
|
2715
|
-
function:
|
|
2716
|
-
instanceof:
|
|
2717
|
-
intersection:
|
|
2718
|
-
lazy:
|
|
2719
|
-
literal:
|
|
2720
|
-
map:
|
|
2721
|
-
nan:
|
|
2722
|
-
nativeEnum:
|
|
2723
|
-
never:
|
|
2724
|
-
null:
|
|
2725
|
-
nullable:
|
|
2726
|
-
number:
|
|
2727
|
-
object:
|
|
2728
|
-
oboolean:
|
|
2729
|
-
onumber:
|
|
2730
|
-
optional:
|
|
2731
|
-
ostring:
|
|
2732
|
-
pipeline:
|
|
2733
|
-
preprocess:
|
|
2734
|
-
promise:
|
|
2735
|
-
record:
|
|
2736
|
-
set:
|
|
2737
|
-
strictObject:
|
|
2738
|
-
string:
|
|
2739
|
-
symbol:
|
|
2740
|
-
transformer:
|
|
2741
|
-
tuple:
|
|
2742
|
-
undefined:
|
|
2743
|
-
union:
|
|
2744
|
-
unknown:
|
|
2745
|
-
void:
|
|
2746
|
-
NEVER:
|
|
2707
|
+
coerce: Vt,
|
|
2708
|
+
any: lt,
|
|
2709
|
+
array: mt,
|
|
2710
|
+
bigint: it,
|
|
2711
|
+
boolean: Me,
|
|
2712
|
+
date: ot,
|
|
2713
|
+
discriminatedUnion: gt,
|
|
2714
|
+
effect: Ce,
|
|
2715
|
+
enum: Ot,
|
|
2716
|
+
function: Zt,
|
|
2717
|
+
instanceof: nt,
|
|
2718
|
+
intersection: xt,
|
|
2719
|
+
lazy: St,
|
|
2720
|
+
literal: Ct,
|
|
2721
|
+
map: wt,
|
|
2722
|
+
nan: at,
|
|
2723
|
+
nativeEnum: Nt,
|
|
2724
|
+
never: ht,
|
|
2725
|
+
null: ut,
|
|
2726
|
+
nullable: Rt,
|
|
2727
|
+
number: Ae,
|
|
2728
|
+
object: yt,
|
|
2729
|
+
oboolean: Pt,
|
|
2730
|
+
onumber: zt,
|
|
2731
|
+
optional: It,
|
|
2732
|
+
ostring: Mt,
|
|
2733
|
+
pipeline: At,
|
|
2734
|
+
preprocess: jt,
|
|
2735
|
+
promise: Et,
|
|
2736
|
+
record: kt,
|
|
2737
|
+
set: Tt,
|
|
2738
|
+
strictObject: vt,
|
|
2739
|
+
string: je,
|
|
2740
|
+
symbol: ct,
|
|
2741
|
+
transformer: Ce,
|
|
2742
|
+
tuple: bt,
|
|
2743
|
+
undefined: dt,
|
|
2744
|
+
union: _t,
|
|
2745
|
+
unknown: ft,
|
|
2746
|
+
void: pt,
|
|
2747
|
+
NEVER: $t,
|
|
2747
2748
|
ZodIssueCode: c,
|
|
2748
|
-
quotelessJson:
|
|
2749
|
-
ZodError:
|
|
2749
|
+
quotelessJson: Ue,
|
|
2750
|
+
ZodError: E
|
|
2750
2751
|
});
|
|
2751
|
-
const
|
|
2752
|
-
const { formValidationTexts: r } = Ve
|
|
2752
|
+
const Wt = () => {
|
|
2753
|
+
const { formValidationTexts: r } = $e(Ve), e = (x) => (x != null && x.useCoerce ? C.coerce : C).string({
|
|
2753
2754
|
invalid_type_error: r.required
|
|
2754
2755
|
}).transform((w) => w ?? null), t = (x) => e(x).nullable().optional().transform((k) => k ?? null), s = (x) => (x != null && x.useCoerce ? C.coerce : C).number({
|
|
2755
2756
|
invalid_type_error: r.required
|
|
2756
2757
|
}).transform((w) => w ?? null), n = (x) => s(x).nullable().optional().transform((k) => k ?? null), a = (x) => (x != null && x.useCoerce ? C.coerce : C).boolean({
|
|
2757
2758
|
invalid_type_error: r.required
|
|
2758
|
-
}).transform((k) => k ?? null), i = (x) => (x != null && x.useCoerce ? C.coerce : C).string({ invalid_type_error: r.required }).refine(
|
|
2759
|
+
}).transform((k) => k ?? null), i = (x) => (x != null && x.useCoerce ? C.coerce : C).string({ invalid_type_error: r.required }).refine(De, { message: r.invalidDate }).transform((w) => w ?? null), o = (x) => i(x).nullable().transform((k) => k ?? null), f = (x, k) => C.enum(x, { invalid_type_error: r.required }).transform((Ze) => Ze ?? null);
|
|
2759
2760
|
return {
|
|
2760
2761
|
zString: t,
|
|
2761
2762
|
zStringRequired: e,
|
|
@@ -2769,15 +2770,16 @@ const Lt = () => {
|
|
|
2769
2770
|
zObjectIdInt: (x) => C.object({ id: n({ useCoerce: !0 }) }).nullable().transform((w) => w ?? null),
|
|
2770
2771
|
zObjectIdIntRequired: (x) => C.object({ id: s() }).transform((w) => w ?? null),
|
|
2771
2772
|
zObjectIdStr: (x) => C.object({ id: t({ useCoerce: !0 }) }).nullable().transform((w) => w ?? null),
|
|
2772
|
-
zObjectIdStrRequired: (x) => C.object({ id: e() }).transform((w) => w ?? null)
|
|
2773
|
+
zObjectIdStrRequired: (x) => C.object({ id: e() }).transform((w) => w ?? null),
|
|
2774
|
+
zFile: ({ required: x, multiple: k, maxFileSize: w }) => C.any().transform((T) => Array.from(T ?? [])).refine((T) => !x || (T == null ? void 0 : T.length) > 0, "File is required.").refine((T) => k || (T == null ? void 0 : T.length) <= 1, "Multiple files not allowed.").refine((T) => T.every((Pe) => Pe.size <= w), `Maximum file size is ${Le(w)}.`).transform((T) => (k ? T : T == null ? void 0 : T[0]) ?? null)
|
|
2773
2775
|
};
|
|
2774
2776
|
};
|
|
2775
2777
|
export {
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2778
|
+
Ht as cancelToken,
|
|
2779
|
+
Gt as useAuth,
|
|
2780
|
+
Xt as useAxios,
|
|
2781
|
+
tr as useClickOutside,
|
|
2782
|
+
Ft as useConfirm,
|
|
2783
|
+
Qt as useNotifications,
|
|
2784
|
+
Wt as useZodSchemaTypes
|
|
2783
2785
|
};
|