@jsdev_ninja/core 0.13.19 → 0.13.21
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/core.cjs.js +1 -1
- package/dist/core.cjs.js.map +1 -1
- package/dist/core.es.js +119 -117
- package/dist/core.es.js.map +1 -1
- package/dist/core.umd.js +1 -1
- package/dist/core.umd.js.map +1 -1
- package/dist/entities/Order.d.ts +5 -2
- package/dist/entities/Order.d.ts.map +1 -1
- package/dist/entities/Order.js +1 -0
- package/dist/entities/Organization.d.ts +6 -0
- package/dist/entities/Organization.d.ts.map +1 -1
- package/dist/entities/Organization.js +1 -0
- package/lib/entities/Order.ts +1 -0
- package/lib/entities/Organization.ts +1 -0
- package/lib/firebase-api/index.ts +1 -0
- package/package.json +1 -1
package/dist/core.es.js
CHANGED
|
@@ -225,7 +225,7 @@ let Fe = X;
|
|
|
225
225
|
function ct(n) {
|
|
226
226
|
Fe = n;
|
|
227
227
|
}
|
|
228
|
-
function
|
|
228
|
+
function ge() {
|
|
229
229
|
return Fe;
|
|
230
230
|
}
|
|
231
231
|
const ve = (n) => {
|
|
@@ -250,7 +250,7 @@ const ve = (n) => {
|
|
|
250
250
|
};
|
|
251
251
|
}, dt = [];
|
|
252
252
|
function f(n, e) {
|
|
253
|
-
const t =
|
|
253
|
+
const t = ge(), r = ve({
|
|
254
254
|
issueData: e,
|
|
255
255
|
data: n.data,
|
|
256
256
|
path: n.path,
|
|
@@ -281,7 +281,7 @@ class T {
|
|
|
281
281
|
const r = [];
|
|
282
282
|
for (const s of t) {
|
|
283
283
|
if (s.status === "aborted")
|
|
284
|
-
return
|
|
284
|
+
return g;
|
|
285
285
|
s.status === "dirty" && e.dirty(), r.push(s.value);
|
|
286
286
|
}
|
|
287
287
|
return { status: e.value, value: r };
|
|
@@ -302,13 +302,13 @@ class T {
|
|
|
302
302
|
for (const s of t) {
|
|
303
303
|
const { key: a, value: o } = s;
|
|
304
304
|
if (a.status === "aborted" || o.status === "aborted")
|
|
305
|
-
return
|
|
305
|
+
return g;
|
|
306
306
|
a.status === "dirty" && e.dirty(), o.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof o.value < "u" || s.alwaysSet) && (r[a.value] = o.value);
|
|
307
307
|
}
|
|
308
308
|
return { status: e.value, value: r };
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
|
-
const
|
|
311
|
+
const g = Object.freeze({
|
|
312
312
|
status: "aborted"
|
|
313
313
|
}), Y = (n) => ({ status: "dirty", value: n }), I = (n) => ({ status: "valid", value: n }), Ze = (n) => n.status === "aborted", Oe = (n) => n.status === "dirty", B = (n) => n.status === "valid", re = (n) => typeof Promise < "u" && n instanceof Promise;
|
|
314
314
|
function _e(n, e, t, r) {
|
|
@@ -491,7 +491,7 @@ class _ {
|
|
|
491
491
|
_refinement(e) {
|
|
492
492
|
return new O({
|
|
493
493
|
schema: this,
|
|
494
|
-
typeName:
|
|
494
|
+
typeName: y.ZodEffects,
|
|
495
495
|
effect: { type: "refinement", refinement: e }
|
|
496
496
|
});
|
|
497
497
|
}
|
|
@@ -530,7 +530,7 @@ class _ {
|
|
|
530
530
|
return new O({
|
|
531
531
|
...v(this._def),
|
|
532
532
|
schema: this,
|
|
533
|
-
typeName:
|
|
533
|
+
typeName: y.ZodEffects,
|
|
534
534
|
effect: { type: "transform", transform: e }
|
|
535
535
|
});
|
|
536
536
|
}
|
|
@@ -540,12 +540,12 @@ class _ {
|
|
|
540
540
|
...v(this._def),
|
|
541
541
|
innerType: this,
|
|
542
542
|
defaultValue: t,
|
|
543
|
-
typeName:
|
|
543
|
+
typeName: y.ZodDefault
|
|
544
544
|
});
|
|
545
545
|
}
|
|
546
546
|
brand() {
|
|
547
547
|
return new je({
|
|
548
|
-
typeName:
|
|
548
|
+
typeName: y.ZodBranded,
|
|
549
549
|
type: this,
|
|
550
550
|
...v(this._def)
|
|
551
551
|
});
|
|
@@ -556,7 +556,7 @@ class _ {
|
|
|
556
556
|
...v(this._def),
|
|
557
557
|
innerType: this,
|
|
558
558
|
catchValue: t,
|
|
559
|
-
typeName:
|
|
559
|
+
typeName: y.ZodCatch
|
|
560
560
|
});
|
|
561
561
|
}
|
|
562
562
|
describe(e) {
|
|
@@ -567,7 +567,7 @@ class _ {
|
|
|
567
567
|
});
|
|
568
568
|
}
|
|
569
569
|
pipe(e) {
|
|
570
|
-
return
|
|
570
|
+
return ye.create(this, e);
|
|
571
571
|
}
|
|
572
572
|
readonly() {
|
|
573
573
|
return pe.create(this);
|
|
@@ -579,7 +579,7 @@ class _ {
|
|
|
579
579
|
return this.safeParse(null).success;
|
|
580
580
|
}
|
|
581
581
|
}
|
|
582
|
-
const ut = /^c[^\s-]{8,}$/i, lt = /^[0-9a-z]+$/, ft = /^[0-9A-HJKMNP-TV-Z]{26}$/i, mt = /^[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, ht = /^[a-z0-9_-]{21}$/i, pt = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,
|
|
582
|
+
const ut = /^c[^\s-]{8,}$/i, lt = /^[0-9a-z]+$/, ft = /^[0-9A-HJKMNP-TV-Z]{26}$/i, mt = /^[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, ht = /^[a-z0-9_-]{21}$/i, pt = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, yt = /^[-+]?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)?)??$/, gt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, vt = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
583
583
|
let Ae;
|
|
584
584
|
const _t = /^(?:(?: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])$/, bt = /^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/, xt = /^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, kt = /^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, wt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Tt = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, ze = "((\\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])))", It = new RegExp(`^${ze}$`);
|
|
585
585
|
function Le(n) {
|
|
@@ -618,7 +618,7 @@ class N extends _ {
|
|
|
618
618
|
code: u.invalid_type,
|
|
619
619
|
expected: m.string,
|
|
620
620
|
received: a.parsedType
|
|
621
|
-
}),
|
|
621
|
+
}), g;
|
|
622
622
|
}
|
|
623
623
|
const r = new T();
|
|
624
624
|
let s;
|
|
@@ -659,7 +659,7 @@ class N extends _ {
|
|
|
659
659
|
message: a.message
|
|
660
660
|
}), r.dirty());
|
|
661
661
|
} else if (a.kind === "email")
|
|
662
|
-
|
|
662
|
+
gt.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
663
663
|
validation: "email",
|
|
664
664
|
code: u.invalid_string,
|
|
665
665
|
message: a.message
|
|
@@ -738,7 +738,7 @@ class N extends _ {
|
|
|
738
738
|
code: u.invalid_string,
|
|
739
739
|
validation: "time",
|
|
740
740
|
message: a.message
|
|
741
|
-
}), r.dirty()) : a.kind === "duration" ?
|
|
741
|
+
}), r.dirty()) : a.kind === "duration" ? yt.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
742
742
|
validation: "duration",
|
|
743
743
|
code: u.invalid_string,
|
|
744
744
|
message: a.message
|
|
@@ -992,7 +992,7 @@ N.create = (n) => {
|
|
|
992
992
|
var e;
|
|
993
993
|
return new N({
|
|
994
994
|
checks: [],
|
|
995
|
-
typeName:
|
|
995
|
+
typeName: y.ZodString,
|
|
996
996
|
coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1,
|
|
997
997
|
...v(n)
|
|
998
998
|
});
|
|
@@ -1012,7 +1012,7 @@ class V extends _ {
|
|
|
1012
1012
|
code: u.invalid_type,
|
|
1013
1013
|
expected: m.number,
|
|
1014
1014
|
received: a.parsedType
|
|
1015
|
-
}),
|
|
1015
|
+
}), g;
|
|
1016
1016
|
}
|
|
1017
1017
|
let r;
|
|
1018
1018
|
const s = new T();
|
|
@@ -1169,7 +1169,7 @@ class V extends _ {
|
|
|
1169
1169
|
}
|
|
1170
1170
|
V.create = (n) => new V({
|
|
1171
1171
|
checks: [],
|
|
1172
|
-
typeName:
|
|
1172
|
+
typeName: y.ZodNumber,
|
|
1173
1173
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
1174
1174
|
...v(n)
|
|
1175
1175
|
});
|
|
@@ -1214,7 +1214,7 @@ class F extends _ {
|
|
|
1214
1214
|
code: u.invalid_type,
|
|
1215
1215
|
expected: m.bigint,
|
|
1216
1216
|
received: t.parsedType
|
|
1217
|
-
}),
|
|
1217
|
+
}), g;
|
|
1218
1218
|
}
|
|
1219
1219
|
gte(e, t) {
|
|
1220
1220
|
return this.setLimit("min", e, !0, p.toString(t));
|
|
@@ -1304,7 +1304,7 @@ F.create = (n) => {
|
|
|
1304
1304
|
var e;
|
|
1305
1305
|
return new F({
|
|
1306
1306
|
checks: [],
|
|
1307
|
-
typeName:
|
|
1307
|
+
typeName: y.ZodBigInt,
|
|
1308
1308
|
coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1,
|
|
1309
1309
|
...v(n)
|
|
1310
1310
|
});
|
|
@@ -1317,13 +1317,13 @@ class se extends _ {
|
|
|
1317
1317
|
code: u.invalid_type,
|
|
1318
1318
|
expected: m.boolean,
|
|
1319
1319
|
received: r.parsedType
|
|
1320
|
-
}),
|
|
1320
|
+
}), g;
|
|
1321
1321
|
}
|
|
1322
1322
|
return I(e.data);
|
|
1323
1323
|
}
|
|
1324
1324
|
}
|
|
1325
1325
|
se.create = (n) => new se({
|
|
1326
|
-
typeName:
|
|
1326
|
+
typeName: y.ZodBoolean,
|
|
1327
1327
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
1328
1328
|
...v(n)
|
|
1329
1329
|
});
|
|
@@ -1335,13 +1335,13 @@ class q extends _ {
|
|
|
1335
1335
|
code: u.invalid_type,
|
|
1336
1336
|
expected: m.date,
|
|
1337
1337
|
received: a.parsedType
|
|
1338
|
-
}),
|
|
1338
|
+
}), g;
|
|
1339
1339
|
}
|
|
1340
1340
|
if (isNaN(e.data.getTime())) {
|
|
1341
1341
|
const a = this._getOrReturnCtx(e);
|
|
1342
1342
|
return f(a, {
|
|
1343
1343
|
code: u.invalid_date
|
|
1344
|
-
}),
|
|
1344
|
+
}), g;
|
|
1345
1345
|
}
|
|
1346
1346
|
const r = new T();
|
|
1347
1347
|
let s;
|
|
@@ -1402,7 +1402,7 @@ class q extends _ {
|
|
|
1402
1402
|
q.create = (n) => new q({
|
|
1403
1403
|
checks: [],
|
|
1404
1404
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
1405
|
-
typeName:
|
|
1405
|
+
typeName: y.ZodDate,
|
|
1406
1406
|
...v(n)
|
|
1407
1407
|
});
|
|
1408
1408
|
class be extends _ {
|
|
@@ -1413,13 +1413,13 @@ class be extends _ {
|
|
|
1413
1413
|
code: u.invalid_type,
|
|
1414
1414
|
expected: m.symbol,
|
|
1415
1415
|
received: r.parsedType
|
|
1416
|
-
}),
|
|
1416
|
+
}), g;
|
|
1417
1417
|
}
|
|
1418
1418
|
return I(e.data);
|
|
1419
1419
|
}
|
|
1420
1420
|
}
|
|
1421
1421
|
be.create = (n) => new be({
|
|
1422
|
-
typeName:
|
|
1422
|
+
typeName: y.ZodSymbol,
|
|
1423
1423
|
...v(n)
|
|
1424
1424
|
});
|
|
1425
1425
|
class ae extends _ {
|
|
@@ -1430,13 +1430,13 @@ class ae extends _ {
|
|
|
1430
1430
|
code: u.invalid_type,
|
|
1431
1431
|
expected: m.undefined,
|
|
1432
1432
|
received: r.parsedType
|
|
1433
|
-
}),
|
|
1433
|
+
}), g;
|
|
1434
1434
|
}
|
|
1435
1435
|
return I(e.data);
|
|
1436
1436
|
}
|
|
1437
1437
|
}
|
|
1438
1438
|
ae.create = (n) => new ae({
|
|
1439
|
-
typeName:
|
|
1439
|
+
typeName: y.ZodUndefined,
|
|
1440
1440
|
...v(n)
|
|
1441
1441
|
});
|
|
1442
1442
|
class ie extends _ {
|
|
@@ -1447,13 +1447,13 @@ class ie extends _ {
|
|
|
1447
1447
|
code: u.invalid_type,
|
|
1448
1448
|
expected: m.null,
|
|
1449
1449
|
received: r.parsedType
|
|
1450
|
-
}),
|
|
1450
|
+
}), g;
|
|
1451
1451
|
}
|
|
1452
1452
|
return I(e.data);
|
|
1453
1453
|
}
|
|
1454
1454
|
}
|
|
1455
1455
|
ie.create = (n) => new ie({
|
|
1456
|
-
typeName:
|
|
1456
|
+
typeName: y.ZodNull,
|
|
1457
1457
|
...v(n)
|
|
1458
1458
|
});
|
|
1459
1459
|
class H extends _ {
|
|
@@ -1465,7 +1465,7 @@ class H extends _ {
|
|
|
1465
1465
|
}
|
|
1466
1466
|
}
|
|
1467
1467
|
H.create = (n) => new H({
|
|
1468
|
-
typeName:
|
|
1468
|
+
typeName: y.ZodAny,
|
|
1469
1469
|
...v(n)
|
|
1470
1470
|
});
|
|
1471
1471
|
class L extends _ {
|
|
@@ -1477,7 +1477,7 @@ class L extends _ {
|
|
|
1477
1477
|
}
|
|
1478
1478
|
}
|
|
1479
1479
|
L.create = (n) => new L({
|
|
1480
|
-
typeName:
|
|
1480
|
+
typeName: y.ZodUnknown,
|
|
1481
1481
|
...v(n)
|
|
1482
1482
|
});
|
|
1483
1483
|
class $ extends _ {
|
|
@@ -1487,11 +1487,11 @@ class $ extends _ {
|
|
|
1487
1487
|
code: u.invalid_type,
|
|
1488
1488
|
expected: m.never,
|
|
1489
1489
|
received: t.parsedType
|
|
1490
|
-
}),
|
|
1490
|
+
}), g;
|
|
1491
1491
|
}
|
|
1492
1492
|
}
|
|
1493
1493
|
$.create = (n) => new $({
|
|
1494
|
-
typeName:
|
|
1494
|
+
typeName: y.ZodNever,
|
|
1495
1495
|
...v(n)
|
|
1496
1496
|
});
|
|
1497
1497
|
class xe extends _ {
|
|
@@ -1502,13 +1502,13 @@ class xe extends _ {
|
|
|
1502
1502
|
code: u.invalid_type,
|
|
1503
1503
|
expected: m.void,
|
|
1504
1504
|
received: r.parsedType
|
|
1505
|
-
}),
|
|
1505
|
+
}), g;
|
|
1506
1506
|
}
|
|
1507
1507
|
return I(e.data);
|
|
1508
1508
|
}
|
|
1509
1509
|
}
|
|
1510
1510
|
xe.create = (n) => new xe({
|
|
1511
|
-
typeName:
|
|
1511
|
+
typeName: y.ZodVoid,
|
|
1512
1512
|
...v(n)
|
|
1513
1513
|
});
|
|
1514
1514
|
class Z extends _ {
|
|
@@ -1519,7 +1519,7 @@ class Z extends _ {
|
|
|
1519
1519
|
code: u.invalid_type,
|
|
1520
1520
|
expected: m.array,
|
|
1521
1521
|
received: t.parsedType
|
|
1522
|
-
}),
|
|
1522
|
+
}), g;
|
|
1523
1523
|
if (s.exactLength !== null) {
|
|
1524
1524
|
const o = t.data.length > s.exactLength.value, c = t.data.length < s.exactLength.value;
|
|
1525
1525
|
(o || c) && (f(t, {
|
|
@@ -1581,7 +1581,7 @@ Z.create = (n, e) => new Z({
|
|
|
1581
1581
|
minLength: null,
|
|
1582
1582
|
maxLength: null,
|
|
1583
1583
|
exactLength: null,
|
|
1584
|
-
typeName:
|
|
1584
|
+
typeName: y.ZodArray,
|
|
1585
1585
|
...v(e)
|
|
1586
1586
|
});
|
|
1587
1587
|
function Q(n) {
|
|
@@ -1617,7 +1617,7 @@ class k extends _ {
|
|
|
1617
1617
|
code: u.invalid_type,
|
|
1618
1618
|
expected: m.object,
|
|
1619
1619
|
received: l.parsedType
|
|
1620
|
-
}),
|
|
1620
|
+
}), g;
|
|
1621
1621
|
}
|
|
1622
1622
|
const { status: r, ctx: s } = this._processInputParams(e), { shape: a, keys: o } = this._getCached(), c = [];
|
|
1623
1623
|
if (!(this._def.catchall instanceof $ && this._def.unknownKeys === "strip"))
|
|
@@ -1744,7 +1744,7 @@ class k extends _ {
|
|
|
1744
1744
|
...this._def.shape(),
|
|
1745
1745
|
...e._def.shape()
|
|
1746
1746
|
}),
|
|
1747
|
-
typeName:
|
|
1747
|
+
typeName: y.ZodObject
|
|
1748
1748
|
});
|
|
1749
1749
|
}
|
|
1750
1750
|
// merge<
|
|
@@ -1870,21 +1870,21 @@ k.create = (n, e) => new k({
|
|
|
1870
1870
|
shape: () => n,
|
|
1871
1871
|
unknownKeys: "strip",
|
|
1872
1872
|
catchall: $.create(),
|
|
1873
|
-
typeName:
|
|
1873
|
+
typeName: y.ZodObject,
|
|
1874
1874
|
...v(e)
|
|
1875
1875
|
});
|
|
1876
1876
|
k.strictCreate = (n, e) => new k({
|
|
1877
1877
|
shape: () => n,
|
|
1878
1878
|
unknownKeys: "strict",
|
|
1879
1879
|
catchall: $.create(),
|
|
1880
|
-
typeName:
|
|
1880
|
+
typeName: y.ZodObject,
|
|
1881
1881
|
...v(e)
|
|
1882
1882
|
});
|
|
1883
1883
|
k.lazycreate = (n, e) => new k({
|
|
1884
1884
|
shape: n,
|
|
1885
1885
|
unknownKeys: "strip",
|
|
1886
1886
|
catchall: $.create(),
|
|
1887
|
-
typeName:
|
|
1887
|
+
typeName: y.ZodObject,
|
|
1888
1888
|
...v(e)
|
|
1889
1889
|
});
|
|
1890
1890
|
class oe extends _ {
|
|
@@ -1901,7 +1901,7 @@ class oe extends _ {
|
|
|
1901
1901
|
return f(t, {
|
|
1902
1902
|
code: u.invalid_union,
|
|
1903
1903
|
unionErrors: o
|
|
1904
|
-
}),
|
|
1904
|
+
}), g;
|
|
1905
1905
|
}
|
|
1906
1906
|
if (t.common.async)
|
|
1907
1907
|
return Promise.all(r.map(async (a) => {
|
|
@@ -1948,7 +1948,7 @@ class oe extends _ {
|
|
|
1948
1948
|
return f(t, {
|
|
1949
1949
|
code: u.invalid_union,
|
|
1950
1950
|
unionErrors: c
|
|
1951
|
-
}),
|
|
1951
|
+
}), g;
|
|
1952
1952
|
}
|
|
1953
1953
|
}
|
|
1954
1954
|
get options() {
|
|
@@ -1957,7 +1957,7 @@ class oe extends _ {
|
|
|
1957
1957
|
}
|
|
1958
1958
|
oe.create = (n, e) => new oe({
|
|
1959
1959
|
options: n,
|
|
1960
|
-
typeName:
|
|
1960
|
+
typeName: y.ZodUnion,
|
|
1961
1961
|
...v(e)
|
|
1962
1962
|
});
|
|
1963
1963
|
const P = (n) => n instanceof ue ? P(n.schema) : n instanceof O ? P(n.innerType()) : n instanceof le ? [n.value] : n instanceof U ? n.options : n instanceof fe ? x.objectValues(n.enum) : n instanceof me ? P(n._def.innerType) : n instanceof ae ? [void 0] : n instanceof ie ? [null] : n instanceof D ? [void 0, ...P(n.unwrap())] : n instanceof z ? [null, ...P(n.unwrap())] : n instanceof je || n instanceof pe ? P(n.unwrap()) : n instanceof he ? P(n._def.innerType) : [];
|
|
@@ -1969,7 +1969,7 @@ class Te extends _ {
|
|
|
1969
1969
|
code: u.invalid_type,
|
|
1970
1970
|
expected: m.object,
|
|
1971
1971
|
received: t.parsedType
|
|
1972
|
-
}),
|
|
1972
|
+
}), g;
|
|
1973
1973
|
const r = this.discriminator, s = t.data[r], a = this.optionsMap.get(s);
|
|
1974
1974
|
return a ? t.common.async ? a._parseAsync({
|
|
1975
1975
|
data: t.data,
|
|
@@ -1983,7 +1983,7 @@ class Te extends _ {
|
|
|
1983
1983
|
code: u.invalid_union_discriminator,
|
|
1984
1984
|
options: Array.from(this.optionsMap.keys()),
|
|
1985
1985
|
path: [r]
|
|
1986
|
-
}),
|
|
1986
|
+
}), g);
|
|
1987
1987
|
}
|
|
1988
1988
|
get discriminator() {
|
|
1989
1989
|
return this._def.discriminator;
|
|
@@ -2015,7 +2015,7 @@ class Te extends _ {
|
|
|
2015
2015
|
}
|
|
2016
2016
|
}
|
|
2017
2017
|
return new Te({
|
|
2018
|
-
typeName:
|
|
2018
|
+
typeName: y.ZodDiscriminatedUnion,
|
|
2019
2019
|
discriminator: e,
|
|
2020
2020
|
options: t,
|
|
2021
2021
|
optionsMap: s,
|
|
@@ -2053,11 +2053,11 @@ class ce extends _ {
|
|
|
2053
2053
|
_parse(e) {
|
|
2054
2054
|
const { status: t, ctx: r } = this._processInputParams(e), s = (a, o) => {
|
|
2055
2055
|
if (Ze(a) || Ze(o))
|
|
2056
|
-
return
|
|
2056
|
+
return g;
|
|
2057
2057
|
const c = De(a.value, o.value);
|
|
2058
2058
|
return c.valid ? ((Oe(a) || Oe(o)) && t.dirty(), { status: t.value, value: c.data }) : (f(r, {
|
|
2059
2059
|
code: u.invalid_intersection_types
|
|
2060
|
-
}),
|
|
2060
|
+
}), g);
|
|
2061
2061
|
};
|
|
2062
2062
|
return r.common.async ? Promise.all([
|
|
2063
2063
|
this._def.left._parseAsync({
|
|
@@ -2084,7 +2084,7 @@ class ce extends _ {
|
|
|
2084
2084
|
ce.create = (n, e, t) => new ce({
|
|
2085
2085
|
left: n,
|
|
2086
2086
|
right: e,
|
|
2087
|
-
typeName:
|
|
2087
|
+
typeName: y.ZodIntersection,
|
|
2088
2088
|
...v(t)
|
|
2089
2089
|
});
|
|
2090
2090
|
class E extends _ {
|
|
@@ -2095,7 +2095,7 @@ class E extends _ {
|
|
|
2095
2095
|
code: u.invalid_type,
|
|
2096
2096
|
expected: m.array,
|
|
2097
2097
|
received: r.parsedType
|
|
2098
|
-
}),
|
|
2098
|
+
}), g;
|
|
2099
2099
|
if (r.data.length < this._def.items.length)
|
|
2100
2100
|
return f(r, {
|
|
2101
2101
|
code: u.too_small,
|
|
@@ -2103,7 +2103,7 @@ class E extends _ {
|
|
|
2103
2103
|
inclusive: !0,
|
|
2104
2104
|
exact: !1,
|
|
2105
2105
|
type: "array"
|
|
2106
|
-
}),
|
|
2106
|
+
}), g;
|
|
2107
2107
|
!this._def.rest && r.data.length > this._def.items.length && (f(r, {
|
|
2108
2108
|
code: u.too_big,
|
|
2109
2109
|
maximum: this._def.items.length,
|
|
@@ -2132,7 +2132,7 @@ E.create = (n, e) => {
|
|
|
2132
2132
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2133
2133
|
return new E({
|
|
2134
2134
|
items: n,
|
|
2135
|
-
typeName:
|
|
2135
|
+
typeName: y.ZodTuple,
|
|
2136
2136
|
rest: null,
|
|
2137
2137
|
...v(e)
|
|
2138
2138
|
});
|
|
@@ -2151,7 +2151,7 @@ class de extends _ {
|
|
|
2151
2151
|
code: u.invalid_type,
|
|
2152
2152
|
expected: m.object,
|
|
2153
2153
|
received: r.parsedType
|
|
2154
|
-
}),
|
|
2154
|
+
}), g;
|
|
2155
2155
|
const s = [], a = this._def.keyType, o = this._def.valueType;
|
|
2156
2156
|
for (const c in r.data)
|
|
2157
2157
|
s.push({
|
|
@@ -2168,12 +2168,12 @@ class de extends _ {
|
|
|
2168
2168
|
return t instanceof _ ? new de({
|
|
2169
2169
|
keyType: e,
|
|
2170
2170
|
valueType: t,
|
|
2171
|
-
typeName:
|
|
2171
|
+
typeName: y.ZodRecord,
|
|
2172
2172
|
...v(r)
|
|
2173
2173
|
}) : new de({
|
|
2174
2174
|
keyType: N.create(),
|
|
2175
2175
|
valueType: e,
|
|
2176
|
-
typeName:
|
|
2176
|
+
typeName: y.ZodRecord,
|
|
2177
2177
|
...v(t)
|
|
2178
2178
|
});
|
|
2179
2179
|
}
|
|
@@ -2192,7 +2192,7 @@ class ke extends _ {
|
|
|
2192
2192
|
code: u.invalid_type,
|
|
2193
2193
|
expected: m.map,
|
|
2194
2194
|
received: r.parsedType
|
|
2195
|
-
}),
|
|
2195
|
+
}), g;
|
|
2196
2196
|
const s = this._def.keyType, a = this._def.valueType, o = [...r.data.entries()].map(([c, d], l) => ({
|
|
2197
2197
|
key: s._parse(new j(r, c, r.path, [l, "key"])),
|
|
2198
2198
|
value: a._parse(new j(r, d, r.path, [l, "value"]))
|
|
@@ -2203,7 +2203,7 @@ class ke extends _ {
|
|
|
2203
2203
|
for (const d of o) {
|
|
2204
2204
|
const l = await d.key, h = await d.value;
|
|
2205
2205
|
if (l.status === "aborted" || h.status === "aborted")
|
|
2206
|
-
return
|
|
2206
|
+
return g;
|
|
2207
2207
|
(l.status === "dirty" || h.status === "dirty") && t.dirty(), c.set(l.value, h.value);
|
|
2208
2208
|
}
|
|
2209
2209
|
return { status: t.value, value: c };
|
|
@@ -2213,7 +2213,7 @@ class ke extends _ {
|
|
|
2213
2213
|
for (const d of o) {
|
|
2214
2214
|
const l = d.key, h = d.value;
|
|
2215
2215
|
if (l.status === "aborted" || h.status === "aborted")
|
|
2216
|
-
return
|
|
2216
|
+
return g;
|
|
2217
2217
|
(l.status === "dirty" || h.status === "dirty") && t.dirty(), c.set(l.value, h.value);
|
|
2218
2218
|
}
|
|
2219
2219
|
return { status: t.value, value: c };
|
|
@@ -2223,7 +2223,7 @@ class ke extends _ {
|
|
|
2223
2223
|
ke.create = (n, e, t) => new ke({
|
|
2224
2224
|
valueType: e,
|
|
2225
2225
|
keyType: n,
|
|
2226
|
-
typeName:
|
|
2226
|
+
typeName: y.ZodMap,
|
|
2227
2227
|
...v(t)
|
|
2228
2228
|
});
|
|
2229
2229
|
class W extends _ {
|
|
@@ -2234,7 +2234,7 @@ class W extends _ {
|
|
|
2234
2234
|
code: u.invalid_type,
|
|
2235
2235
|
expected: m.set,
|
|
2236
2236
|
received: r.parsedType
|
|
2237
|
-
}),
|
|
2237
|
+
}), g;
|
|
2238
2238
|
const s = this._def;
|
|
2239
2239
|
s.minSize !== null && r.data.size < s.minSize.value && (f(r, {
|
|
2240
2240
|
code: u.too_small,
|
|
@@ -2256,7 +2256,7 @@ class W extends _ {
|
|
|
2256
2256
|
const l = /* @__PURE__ */ new Set();
|
|
2257
2257
|
for (const h of d) {
|
|
2258
2258
|
if (h.status === "aborted")
|
|
2259
|
-
return
|
|
2259
|
+
return g;
|
|
2260
2260
|
h.status === "dirty" && t.dirty(), l.add(h.value);
|
|
2261
2261
|
}
|
|
2262
2262
|
return { status: t.value, value: l };
|
|
@@ -2287,7 +2287,7 @@ W.create = (n, e) => new W({
|
|
|
2287
2287
|
valueType: n,
|
|
2288
2288
|
minSize: null,
|
|
2289
2289
|
maxSize: null,
|
|
2290
|
-
typeName:
|
|
2290
|
+
typeName: y.ZodSet,
|
|
2291
2291
|
...v(e)
|
|
2292
2292
|
});
|
|
2293
2293
|
class J extends _ {
|
|
@@ -2301,7 +2301,7 @@ class J extends _ {
|
|
|
2301
2301
|
code: u.invalid_type,
|
|
2302
2302
|
expected: m.function,
|
|
2303
2303
|
received: t.parsedType
|
|
2304
|
-
}),
|
|
2304
|
+
}), g;
|
|
2305
2305
|
function r(c, d) {
|
|
2306
2306
|
return ve({
|
|
2307
2307
|
data: c,
|
|
@@ -2309,7 +2309,7 @@ class J extends _ {
|
|
|
2309
2309
|
errorMaps: [
|
|
2310
2310
|
t.common.contextualErrorMap,
|
|
2311
2311
|
t.schemaErrorMap,
|
|
2312
|
-
|
|
2312
|
+
ge(),
|
|
2313
2313
|
X
|
|
2314
2314
|
].filter((l) => !!l),
|
|
2315
2315
|
issueData: {
|
|
@@ -2325,7 +2325,7 @@ class J extends _ {
|
|
|
2325
2325
|
errorMaps: [
|
|
2326
2326
|
t.common.contextualErrorMap,
|
|
2327
2327
|
t.schemaErrorMap,
|
|
2328
|
-
|
|
2328
|
+
ge(),
|
|
2329
2329
|
X
|
|
2330
2330
|
].filter((l) => !!l),
|
|
2331
2331
|
issueData: {
|
|
@@ -2386,7 +2386,7 @@ class J extends _ {
|
|
|
2386
2386
|
return new J({
|
|
2387
2387
|
args: e || E.create([]).rest(L.create()),
|
|
2388
2388
|
returns: t || L.create(),
|
|
2389
|
-
typeName:
|
|
2389
|
+
typeName: y.ZodFunction,
|
|
2390
2390
|
...v(r)
|
|
2391
2391
|
});
|
|
2392
2392
|
}
|
|
@@ -2402,7 +2402,7 @@ class ue extends _ {
|
|
|
2402
2402
|
}
|
|
2403
2403
|
ue.create = (n, e) => new ue({
|
|
2404
2404
|
getter: n,
|
|
2405
|
-
typeName:
|
|
2405
|
+
typeName: y.ZodLazy,
|
|
2406
2406
|
...v(e)
|
|
2407
2407
|
});
|
|
2408
2408
|
class le extends _ {
|
|
@@ -2413,7 +2413,7 @@ class le extends _ {
|
|
|
2413
2413
|
received: t.data,
|
|
2414
2414
|
code: u.invalid_literal,
|
|
2415
2415
|
expected: this._def.value
|
|
2416
|
-
}),
|
|
2416
|
+
}), g;
|
|
2417
2417
|
}
|
|
2418
2418
|
return { status: "valid", value: e.data };
|
|
2419
2419
|
}
|
|
@@ -2423,13 +2423,13 @@ class le extends _ {
|
|
|
2423
2423
|
}
|
|
2424
2424
|
le.create = (n, e) => new le({
|
|
2425
2425
|
value: n,
|
|
2426
|
-
typeName:
|
|
2426
|
+
typeName: y.ZodLiteral,
|
|
2427
2427
|
...v(e)
|
|
2428
2428
|
});
|
|
2429
2429
|
function qe(n, e) {
|
|
2430
2430
|
return new U({
|
|
2431
2431
|
values: n,
|
|
2432
|
-
typeName:
|
|
2432
|
+
typeName: y.ZodEnum,
|
|
2433
2433
|
...v(e)
|
|
2434
2434
|
});
|
|
2435
2435
|
}
|
|
@@ -2444,7 +2444,7 @@ class U extends _ {
|
|
|
2444
2444
|
expected: x.joinValues(r),
|
|
2445
2445
|
received: t.parsedType,
|
|
2446
2446
|
code: u.invalid_type
|
|
2447
|
-
}),
|
|
2447
|
+
}), g;
|
|
2448
2448
|
}
|
|
2449
2449
|
if (_e(this, ee) || Ue(this, ee, new Set(this._def.values)), !_e(this, ee).has(e.data)) {
|
|
2450
2450
|
const t = this._getOrReturnCtx(e), r = this._def.values;
|
|
@@ -2452,7 +2452,7 @@ class U extends _ {
|
|
|
2452
2452
|
received: t.data,
|
|
2453
2453
|
code: u.invalid_enum_value,
|
|
2454
2454
|
options: r
|
|
2455
|
-
}),
|
|
2455
|
+
}), g;
|
|
2456
2456
|
}
|
|
2457
2457
|
return I(e.data);
|
|
2458
2458
|
}
|
|
@@ -2504,7 +2504,7 @@ class fe extends _ {
|
|
|
2504
2504
|
expected: x.joinValues(s),
|
|
2505
2505
|
received: r.parsedType,
|
|
2506
2506
|
code: u.invalid_type
|
|
2507
|
-
}),
|
|
2507
|
+
}), g;
|
|
2508
2508
|
}
|
|
2509
2509
|
if (_e(this, te) || Ue(this, te, new Set(x.getValidEnumValues(this._def.values))), !_e(this, te).has(e.data)) {
|
|
2510
2510
|
const s = x.objectValues(t);
|
|
@@ -2512,7 +2512,7 @@ class fe extends _ {
|
|
|
2512
2512
|
received: r.data,
|
|
2513
2513
|
code: u.invalid_enum_value,
|
|
2514
2514
|
options: s
|
|
2515
|
-
}),
|
|
2515
|
+
}), g;
|
|
2516
2516
|
}
|
|
2517
2517
|
return I(e.data);
|
|
2518
2518
|
}
|
|
@@ -2523,7 +2523,7 @@ class fe extends _ {
|
|
|
2523
2523
|
te = /* @__PURE__ */ new WeakMap();
|
|
2524
2524
|
fe.create = (n, e) => new fe({
|
|
2525
2525
|
values: n,
|
|
2526
|
-
typeName:
|
|
2526
|
+
typeName: y.ZodNativeEnum,
|
|
2527
2527
|
...v(e)
|
|
2528
2528
|
});
|
|
2529
2529
|
class G extends _ {
|
|
@@ -2537,7 +2537,7 @@ class G extends _ {
|
|
|
2537
2537
|
code: u.invalid_type,
|
|
2538
2538
|
expected: m.promise,
|
|
2539
2539
|
received: t.parsedType
|
|
2540
|
-
}),
|
|
2540
|
+
}), g;
|
|
2541
2541
|
const r = t.parsedType === m.promise ? t.data : Promise.resolve(t.data);
|
|
2542
2542
|
return I(r.then((s) => this._def.type.parseAsync(s, {
|
|
2543
2543
|
path: t.path,
|
|
@@ -2547,7 +2547,7 @@ class G extends _ {
|
|
|
2547
2547
|
}
|
|
2548
2548
|
G.create = (n, e) => new G({
|
|
2549
2549
|
type: n,
|
|
2550
|
-
typeName:
|
|
2550
|
+
typeName: y.ZodPromise,
|
|
2551
2551
|
...v(e)
|
|
2552
2552
|
});
|
|
2553
2553
|
class O extends _ {
|
|
@@ -2555,7 +2555,7 @@ class O extends _ {
|
|
|
2555
2555
|
return this._def.schema;
|
|
2556
2556
|
}
|
|
2557
2557
|
sourceType() {
|
|
2558
|
-
return this._def.schema._def.typeName ===
|
|
2558
|
+
return this._def.schema._def.typeName === y.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
2559
2559
|
}
|
|
2560
2560
|
_parse(e) {
|
|
2561
2561
|
const { status: t, ctx: r } = this._processInputParams(e), s = this._def.effect || null, a = {
|
|
@@ -2571,23 +2571,23 @@ class O extends _ {
|
|
|
2571
2571
|
if (r.common.async)
|
|
2572
2572
|
return Promise.resolve(o).then(async (c) => {
|
|
2573
2573
|
if (t.value === "aborted")
|
|
2574
|
-
return
|
|
2574
|
+
return g;
|
|
2575
2575
|
const d = await this._def.schema._parseAsync({
|
|
2576
2576
|
data: c,
|
|
2577
2577
|
path: r.path,
|
|
2578
2578
|
parent: r
|
|
2579
2579
|
});
|
|
2580
|
-
return d.status === "aborted" ?
|
|
2580
|
+
return d.status === "aborted" ? g : d.status === "dirty" || t.value === "dirty" ? Y(d.value) : d;
|
|
2581
2581
|
});
|
|
2582
2582
|
{
|
|
2583
2583
|
if (t.value === "aborted")
|
|
2584
|
-
return
|
|
2584
|
+
return g;
|
|
2585
2585
|
const c = this._def.schema._parseSync({
|
|
2586
2586
|
data: o,
|
|
2587
2587
|
path: r.path,
|
|
2588
2588
|
parent: r
|
|
2589
2589
|
});
|
|
2590
|
-
return c.status === "aborted" ?
|
|
2590
|
+
return c.status === "aborted" ? g : c.status === "dirty" || t.value === "dirty" ? Y(c.value) : c;
|
|
2591
2591
|
}
|
|
2592
2592
|
}
|
|
2593
2593
|
if (s.type === "refinement") {
|
|
@@ -2605,9 +2605,9 @@ class O extends _ {
|
|
|
2605
2605
|
path: r.path,
|
|
2606
2606
|
parent: r
|
|
2607
2607
|
});
|
|
2608
|
-
return c.status === "aborted" ?
|
|
2608
|
+
return c.status === "aborted" ? g : (c.status === "dirty" && t.dirty(), o(c.value), { status: t.value, value: c.value });
|
|
2609
2609
|
} else
|
|
2610
|
-
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((c) => c.status === "aborted" ?
|
|
2610
|
+
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((c) => c.status === "aborted" ? g : (c.status === "dirty" && t.dirty(), o(c.value).then(() => ({ status: t.value, value: c.value }))));
|
|
2611
2611
|
}
|
|
2612
2612
|
if (s.type === "transform")
|
|
2613
2613
|
if (r.common.async === !1) {
|
|
@@ -2629,14 +2629,14 @@ class O extends _ {
|
|
|
2629
2629
|
}
|
|
2630
2630
|
O.create = (n, e, t) => new O({
|
|
2631
2631
|
schema: n,
|
|
2632
|
-
typeName:
|
|
2632
|
+
typeName: y.ZodEffects,
|
|
2633
2633
|
effect: e,
|
|
2634
2634
|
...v(t)
|
|
2635
2635
|
});
|
|
2636
2636
|
O.createWithPreprocess = (n, e, t) => new O({
|
|
2637
2637
|
schema: e,
|
|
2638
2638
|
effect: { type: "preprocess", transform: n },
|
|
2639
|
-
typeName:
|
|
2639
|
+
typeName: y.ZodEffects,
|
|
2640
2640
|
...v(t)
|
|
2641
2641
|
});
|
|
2642
2642
|
class D extends _ {
|
|
@@ -2649,7 +2649,7 @@ class D extends _ {
|
|
|
2649
2649
|
}
|
|
2650
2650
|
D.create = (n, e) => new D({
|
|
2651
2651
|
innerType: n,
|
|
2652
|
-
typeName:
|
|
2652
|
+
typeName: y.ZodOptional,
|
|
2653
2653
|
...v(e)
|
|
2654
2654
|
});
|
|
2655
2655
|
class z extends _ {
|
|
@@ -2662,7 +2662,7 @@ class z extends _ {
|
|
|
2662
2662
|
}
|
|
2663
2663
|
z.create = (n, e) => new z({
|
|
2664
2664
|
innerType: n,
|
|
2665
|
-
typeName:
|
|
2665
|
+
typeName: y.ZodNullable,
|
|
2666
2666
|
...v(e)
|
|
2667
2667
|
});
|
|
2668
2668
|
class me extends _ {
|
|
@@ -2681,7 +2681,7 @@ class me extends _ {
|
|
|
2681
2681
|
}
|
|
2682
2682
|
me.create = (n, e) => new me({
|
|
2683
2683
|
innerType: n,
|
|
2684
|
-
typeName:
|
|
2684
|
+
typeName: y.ZodDefault,
|
|
2685
2685
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2686
2686
|
...v(e)
|
|
2687
2687
|
});
|
|
@@ -2724,7 +2724,7 @@ class he extends _ {
|
|
|
2724
2724
|
}
|
|
2725
2725
|
he.create = (n, e) => new he({
|
|
2726
2726
|
innerType: n,
|
|
2727
|
-
typeName:
|
|
2727
|
+
typeName: y.ZodCatch,
|
|
2728
2728
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2729
2729
|
...v(e)
|
|
2730
2730
|
});
|
|
@@ -2736,13 +2736,13 @@ class we extends _ {
|
|
|
2736
2736
|
code: u.invalid_type,
|
|
2737
2737
|
expected: m.nan,
|
|
2738
2738
|
received: r.parsedType
|
|
2739
|
-
}),
|
|
2739
|
+
}), g;
|
|
2740
2740
|
}
|
|
2741
2741
|
return { status: "valid", value: e.data };
|
|
2742
2742
|
}
|
|
2743
2743
|
}
|
|
2744
2744
|
we.create = (n) => new we({
|
|
2745
|
-
typeName:
|
|
2745
|
+
typeName: y.ZodNaN,
|
|
2746
2746
|
...v(n)
|
|
2747
2747
|
});
|
|
2748
2748
|
const Ot = Symbol("zod_brand");
|
|
@@ -2759,7 +2759,7 @@ class je extends _ {
|
|
|
2759
2759
|
return this._def.type;
|
|
2760
2760
|
}
|
|
2761
2761
|
}
|
|
2762
|
-
class
|
|
2762
|
+
class ye extends _ {
|
|
2763
2763
|
_parse(e) {
|
|
2764
2764
|
const { status: t, ctx: r } = this._processInputParams(e);
|
|
2765
2765
|
if (r.common.async)
|
|
@@ -2769,7 +2769,7 @@ class ge extends _ {
|
|
|
2769
2769
|
path: r.path,
|
|
2770
2770
|
parent: r
|
|
2771
2771
|
});
|
|
2772
|
-
return a.status === "aborted" ?
|
|
2772
|
+
return a.status === "aborted" ? g : a.status === "dirty" ? (t.dirty(), Y(a.value)) : this._def.out._parseAsync({
|
|
2773
2773
|
data: a.value,
|
|
2774
2774
|
path: r.path,
|
|
2775
2775
|
parent: r
|
|
@@ -2781,7 +2781,7 @@ class ge extends _ {
|
|
|
2781
2781
|
path: r.path,
|
|
2782
2782
|
parent: r
|
|
2783
2783
|
});
|
|
2784
|
-
return s.status === "aborted" ?
|
|
2784
|
+
return s.status === "aborted" ? g : s.status === "dirty" ? (t.dirty(), {
|
|
2785
2785
|
status: "dirty",
|
|
2786
2786
|
value: s.value
|
|
2787
2787
|
}) : this._def.out._parseSync({
|
|
@@ -2792,10 +2792,10 @@ class ge extends _ {
|
|
|
2792
2792
|
}
|
|
2793
2793
|
}
|
|
2794
2794
|
static create(e, t) {
|
|
2795
|
-
return new
|
|
2795
|
+
return new ye({
|
|
2796
2796
|
in: e,
|
|
2797
2797
|
out: t,
|
|
2798
|
-
typeName:
|
|
2798
|
+
typeName: y.ZodPipeline
|
|
2799
2799
|
});
|
|
2800
2800
|
}
|
|
2801
2801
|
}
|
|
@@ -2810,7 +2810,7 @@ class pe extends _ {
|
|
|
2810
2810
|
}
|
|
2811
2811
|
pe.create = (n, e) => new pe({
|
|
2812
2812
|
innerType: n,
|
|
2813
|
-
typeName:
|
|
2813
|
+
typeName: y.ZodReadonly,
|
|
2814
2814
|
...v(e)
|
|
2815
2815
|
});
|
|
2816
2816
|
function $e(n, e) {
|
|
@@ -2838,13 +2838,13 @@ function We(n, e = {}, t) {
|
|
|
2838
2838
|
const Dt = {
|
|
2839
2839
|
object: k.lazycreate
|
|
2840
2840
|
};
|
|
2841
|
-
var
|
|
2841
|
+
var y;
|
|
2842
2842
|
(function(n) {
|
|
2843
2843
|
n.ZodString = "ZodString", n.ZodNumber = "ZodNumber", n.ZodNaN = "ZodNaN", n.ZodBigInt = "ZodBigInt", n.ZodBoolean = "ZodBoolean", n.ZodDate = "ZodDate", n.ZodSymbol = "ZodSymbol", n.ZodUndefined = "ZodUndefined", n.ZodNull = "ZodNull", n.ZodAny = "ZodAny", n.ZodUnknown = "ZodUnknown", n.ZodNever = "ZodNever", n.ZodVoid = "ZodVoid", n.ZodArray = "ZodArray", n.ZodObject = "ZodObject", n.ZodUnion = "ZodUnion", n.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", n.ZodIntersection = "ZodIntersection", n.ZodTuple = "ZodTuple", n.ZodRecord = "ZodRecord", n.ZodMap = "ZodMap", n.ZodSet = "ZodSet", n.ZodFunction = "ZodFunction", n.ZodLazy = "ZodLazy", n.ZodLiteral = "ZodLiteral", n.ZodEnum = "ZodEnum", n.ZodEffects = "ZodEffects", n.ZodNativeEnum = "ZodNativeEnum", n.ZodOptional = "ZodOptional", n.ZodNullable = "ZodNullable", n.ZodDefault = "ZodDefault", n.ZodCatch = "ZodCatch", n.ZodPromise = "ZodPromise", n.ZodBranded = "ZodBranded", n.ZodPipeline = "ZodPipeline", n.ZodReadonly = "ZodReadonly";
|
|
2844
|
-
})(
|
|
2844
|
+
})(y || (y = {}));
|
|
2845
2845
|
const jt = (n, e = {
|
|
2846
2846
|
message: `Input not instance of ${n.name}`
|
|
2847
|
-
}) => We((t) => t instanceof n, e), Qe = N.create, Ye = V.create, Et = we.create, Pt = F.create, Je = se.create, Rt = q.create, Mt = be.create, $t = ae.create, Vt = ie.create, Ft = H.create, Ut = L.create, zt = $.create, Lt = xe.create, Bt = Z.create, qt = k.create, Wt = k.strictCreate, Qt = oe.create, Yt = Te.create, Jt = ce.create, Xt = E.create, Ht = de.create, Gt = ke.create, Kt = W.create, en = J.create, tn = ue.create, nn = le.create, rn = U.create, sn = fe.create, an = G.create, Ve = O.create, on = D.create, cn = z.create, dn = O.createWithPreprocess, un =
|
|
2847
|
+
}) => We((t) => t instanceof n, e), Qe = N.create, Ye = V.create, Et = we.create, Pt = F.create, Je = se.create, Rt = q.create, Mt = be.create, $t = ae.create, Vt = ie.create, Ft = H.create, Ut = L.create, zt = $.create, Lt = xe.create, Bt = Z.create, qt = k.create, Wt = k.strictCreate, Qt = oe.create, Yt = Te.create, Jt = ce.create, Xt = E.create, Ht = de.create, Gt = ke.create, Kt = W.create, en = J.create, tn = ue.create, nn = le.create, rn = U.create, sn = fe.create, an = G.create, Ve = O.create, on = D.create, cn = z.create, dn = O.createWithPreprocess, un = ye.create, ln = () => Qe().optional(), fn = () => Ye().optional(), mn = () => Je().optional(), hn = {
|
|
2848
2848
|
string: (n) => N.create({ ...n, coerce: !0 }),
|
|
2849
2849
|
number: (n) => V.create({ ...n, coerce: !0 }),
|
|
2850
2850
|
boolean: (n) => se.create({
|
|
@@ -2853,17 +2853,17 @@ const jt = (n, e = {
|
|
|
2853
2853
|
}),
|
|
2854
2854
|
bigint: (n) => F.create({ ...n, coerce: !0 }),
|
|
2855
2855
|
date: (n) => q.create({ ...n, coerce: !0 })
|
|
2856
|
-
}, pn =
|
|
2856
|
+
}, pn = g;
|
|
2857
2857
|
var i = /* @__PURE__ */ Object.freeze({
|
|
2858
2858
|
__proto__: null,
|
|
2859
2859
|
defaultErrorMap: X,
|
|
2860
2860
|
setErrorMap: ct,
|
|
2861
|
-
getErrorMap:
|
|
2861
|
+
getErrorMap: ge,
|
|
2862
2862
|
makeIssue: ve,
|
|
2863
2863
|
EMPTY_PATH: dt,
|
|
2864
2864
|
addIssueToContext: f,
|
|
2865
2865
|
ParseStatus: T,
|
|
2866
|
-
INVALID:
|
|
2866
|
+
INVALID: g,
|
|
2867
2867
|
DIRTY: Y,
|
|
2868
2868
|
OK: I,
|
|
2869
2869
|
isAborted: Ze,
|
|
@@ -2916,14 +2916,14 @@ var i = /* @__PURE__ */ Object.freeze({
|
|
|
2916
2916
|
ZodNaN: we,
|
|
2917
2917
|
BRAND: Ot,
|
|
2918
2918
|
ZodBranded: je,
|
|
2919
|
-
ZodPipeline:
|
|
2919
|
+
ZodPipeline: ye,
|
|
2920
2920
|
ZodReadonly: pe,
|
|
2921
2921
|
custom: We,
|
|
2922
2922
|
Schema: _,
|
|
2923
2923
|
ZodSchema: _,
|
|
2924
2924
|
late: Dt,
|
|
2925
2925
|
get ZodFirstPartyTypeKind() {
|
|
2926
|
-
return
|
|
2926
|
+
return y;
|
|
2927
2927
|
},
|
|
2928
2928
|
coerce: hn,
|
|
2929
2929
|
any: Ft,
|
|
@@ -2970,7 +2970,7 @@ var i = /* @__PURE__ */ Object.freeze({
|
|
|
2970
2970
|
quotelessJson: ot,
|
|
2971
2971
|
ZodError: A
|
|
2972
2972
|
});
|
|
2973
|
-
const
|
|
2973
|
+
const yn = i.object({
|
|
2974
2974
|
country: i.string(),
|
|
2975
2975
|
city: i.string(),
|
|
2976
2976
|
street: i.string(),
|
|
@@ -3082,7 +3082,7 @@ const ne = i.object({
|
|
|
3082
3082
|
productId: i.string().uuid()
|
|
3083
3083
|
}), Ke = i.enum(["default", "delayed"], {
|
|
3084
3084
|
description: "delayed is J5 transaction"
|
|
3085
|
-
}),
|
|
3085
|
+
}), gn = i.object({
|
|
3086
3086
|
type: i.literal("Profile"),
|
|
3087
3087
|
id: M,
|
|
3088
3088
|
companyId: M,
|
|
@@ -3093,7 +3093,7 @@ const ne = i.object({
|
|
|
3093
3093
|
displayName: M,
|
|
3094
3094
|
email: i.string().email(),
|
|
3095
3095
|
phoneNumber: i.string().optional(),
|
|
3096
|
-
address:
|
|
3096
|
+
address: yn.optional(),
|
|
3097
3097
|
isAnonymous: i.boolean(),
|
|
3098
3098
|
createdDate: i.number(),
|
|
3099
3099
|
lastActivityDate: i.number(),
|
|
@@ -3165,7 +3165,8 @@ const tt = i.object({
|
|
|
3165
3165
|
name: i.string(),
|
|
3166
3166
|
discountPercentage: i.number().positive().min(0).max(100).optional(),
|
|
3167
3167
|
nameOnInvoice: i.string().optional(),
|
|
3168
|
-
billingAccounts: i.array(tt)
|
|
3168
|
+
billingAccounts: i.array(tt),
|
|
3169
|
+
paymentType: i.enum(["default", "delayed"])
|
|
3169
3170
|
}), Ln = vn.omit({ id: !0 }), _n = i.object({
|
|
3170
3171
|
doc_uuid: i.string().uuid("Document UUID must be a valid UUID"),
|
|
3171
3172
|
pdf_link: i.string().url("PDF link must be a valid URL"),
|
|
@@ -3197,6 +3198,7 @@ const tt = i.object({
|
|
|
3197
3198
|
"completed",
|
|
3198
3199
|
"refunded"
|
|
3199
3200
|
]),
|
|
3201
|
+
paymentType: i.enum(["internal", "external"]).optional(),
|
|
3200
3202
|
paymentStatus: i.enum(["pending", "pending_j5", "external", "completed", "failed", "refunded"]),
|
|
3201
3203
|
//todo check if hyp support partial refund
|
|
3202
3204
|
cart: i.object({
|
|
@@ -3213,7 +3215,7 @@ const tt = i.object({
|
|
|
3213
3215
|
// what store charge
|
|
3214
3216
|
date: i.number(),
|
|
3215
3217
|
deliveryDate: i.coerce.number(),
|
|
3216
|
-
client:
|
|
3218
|
+
client: gn.required({}),
|
|
3217
3219
|
nameOnInvoice: i.string().optional(),
|
|
3218
3220
|
clientComment: i.string().optional(),
|
|
3219
3221
|
deliveryNote: et.optional(),
|
|
@@ -3500,7 +3502,7 @@ const An = {
|
|
|
3500
3502
|
firestore: Nn
|
|
3501
3503
|
};
|
|
3502
3504
|
export {
|
|
3503
|
-
|
|
3505
|
+
yn as AddressSchema,
|
|
3504
3506
|
Xe as BaseCategorySchema,
|
|
3505
3507
|
tt as BillingAccountSchema,
|
|
3506
3508
|
wn as BundleDiscountStrategy,
|
|
@@ -3526,7 +3528,7 @@ export {
|
|
|
3526
3528
|
vn as OrganizationSchema,
|
|
3527
3529
|
He as ProductSchema,
|
|
3528
3530
|
Ke as ProfilePaymentTypeSchema,
|
|
3529
|
-
|
|
3531
|
+
gn as ProfileSchema,
|
|
3530
3532
|
qn as StoreSchema,
|
|
3531
3533
|
Pn as TFlattenCategorySchema,
|
|
3532
3534
|
Jn as calculatePercentageDiscount,
|