@authhero/kysely-adapter 0.10.0 → 0.11.1
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/kysely-adapter.cjs +1 -1
- package/dist/kysely-adapter.d.ts +102 -11
- package/dist/kysely-adapter.iife.js +1 -1
- package/dist/kysely-adapter.mjs +721 -705
- package/package.json +2 -2
package/dist/kysely-adapter.mjs
CHANGED
|
@@ -59,7 +59,7 @@ function Xn(n, e) {
|
|
|
59
59
|
var t;
|
|
60
60
|
return ((t = n == null ? void 0 : n._def) === null || t === void 0 ? void 0 : t.typeName) === e;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function He(n, e) {
|
|
63
63
|
const t = n.ZodType.prototype[e];
|
|
64
64
|
n.ZodType.prototype[e] = function(...s) {
|
|
65
65
|
const r = t.apply(this, s);
|
|
@@ -70,15 +70,15 @@ function es(n) {
|
|
|
70
70
|
if (typeof n.ZodType.prototype.openapi < "u")
|
|
71
71
|
return;
|
|
72
72
|
n.ZodType.prototype.openapi = function(r, a) {
|
|
73
|
-
var o,
|
|
74
|
-
const A = typeof r == "string" ? a : r, U = A ?? {}, { param: ie } = U,
|
|
73
|
+
var o, d, c, u, l, j;
|
|
74
|
+
const A = typeof r == "string" ? a : r, U = A ?? {}, { param: ie } = U, Re = Gn(U, ["param"]), oe = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), de = Object.assign(Object.assign(Object.assign({}, (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata), Re), !((u = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata) === null || u === void 0) && u.param || ie ? {
|
|
75
75
|
param: Object.assign(Object.assign({}, (j = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || j === void 0 ? void 0 : j.param), ie)
|
|
76
|
-
} : void 0),
|
|
76
|
+
} : void 0), ce = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(oe).length > 0 ? { _internal: oe } : void 0), Object.keys(de).length > 0 ? { metadata: de } : void 0) }));
|
|
77
77
|
if (Xn(this, "ZodObject")) {
|
|
78
|
-
const
|
|
79
|
-
|
|
78
|
+
const $e = this.extend;
|
|
79
|
+
ce.extend = function(...Pe) {
|
|
80
80
|
var K, H, Q, ue, xe, Te;
|
|
81
|
-
const Oe =
|
|
81
|
+
const Oe = $e.apply(this, Pe);
|
|
82
82
|
return Oe._def.openapi = {
|
|
83
83
|
_internal: {
|
|
84
84
|
extendedFrom: !((H = (K = this._def.openapi) === null || K === void 0 ? void 0 : K._internal) === null || H === void 0) && H.refId ? { refId: (ue = (Q = this._def.openapi) === null || Q === void 0 ? void 0 : Q._internal) === null || ue === void 0 ? void 0 : ue.refId, schema: this } : (xe = this._def.openapi) === null || xe === void 0 ? void 0 : xe._internal.extendedFrom
|
|
@@ -87,14 +87,14 @@ function es(n) {
|
|
|
87
87
|
}, Oe;
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
|
-
return
|
|
91
|
-
},
|
|
90
|
+
return ce;
|
|
91
|
+
}, He(n, "optional"), He(n, "nullable"), He(n, "default"), He(n, "transform"), He(n, "refine");
|
|
92
92
|
const e = n.ZodObject.prototype.deepPartial;
|
|
93
93
|
n.ZodObject.prototype.deepPartial = function() {
|
|
94
94
|
const r = this._def.shape(), a = e.apply(this), o = a._def.shape();
|
|
95
|
-
return Object.entries(o).forEach(([
|
|
95
|
+
return Object.entries(o).forEach(([d, c]) => {
|
|
96
96
|
var u, l;
|
|
97
|
-
|
|
97
|
+
c._def.openapi = (l = (u = r[d]) === null || u === void 0 ? void 0 : u._def) === null || l === void 0 ? void 0 : l.openapi;
|
|
98
98
|
}), a._def.openapi = void 0, a;
|
|
99
99
|
};
|
|
100
100
|
const t = n.ZodObject.prototype.pick;
|
|
@@ -124,9 +124,9 @@ var N;
|
|
|
124
124
|
a[o] = o;
|
|
125
125
|
return a;
|
|
126
126
|
}, n.getValidEnumValues = (r) => {
|
|
127
|
-
const a = n.objectKeys(r).filter((
|
|
128
|
-
for (const
|
|
129
|
-
o[
|
|
127
|
+
const a = n.objectKeys(r).filter((d) => typeof r[r[d]] != "number"), o = {};
|
|
128
|
+
for (const d of a)
|
|
129
|
+
o[d] = r[d];
|
|
130
130
|
return n.objectValues(o);
|
|
131
131
|
}, n.objectValues = (r) => n.objectKeys(r).map(function(a) {
|
|
132
132
|
return r[a];
|
|
@@ -240,10 +240,10 @@ class L extends Error {
|
|
|
240
240
|
else if (o.path.length === 0)
|
|
241
241
|
s._errors.push(t(o));
|
|
242
242
|
else {
|
|
243
|
-
let
|
|
244
|
-
for (;
|
|
245
|
-
const u = o.path[
|
|
246
|
-
|
|
243
|
+
let d = s, c = 0;
|
|
244
|
+
for (; c < o.path.length; ) {
|
|
245
|
+
const u = o.path[c];
|
|
246
|
+
c === o.path.length - 1 ? (d[u] = d[u] || { _errors: [] }, d[u]._errors.push(t(o))) : d[u] = d[u] || { _errors: [] }, d = d[u], c++;
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
};
|
|
@@ -273,7 +273,7 @@ class L extends Error {
|
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
L.create = (n) => new L(n);
|
|
276
|
-
const
|
|
276
|
+
const ze = (n, e) => {
|
|
277
277
|
let t;
|
|
278
278
|
switch (n.code) {
|
|
279
279
|
case p.invalid_type:
|
|
@@ -329,12 +329,12 @@ const Be = (n, e) => {
|
|
|
329
329
|
}
|
|
330
330
|
return { message: t };
|
|
331
331
|
};
|
|
332
|
-
let
|
|
332
|
+
let wn = ze;
|
|
333
333
|
function ns(n) {
|
|
334
|
-
|
|
334
|
+
wn = n;
|
|
335
335
|
}
|
|
336
336
|
function Et() {
|
|
337
|
-
return
|
|
337
|
+
return wn;
|
|
338
338
|
}
|
|
339
339
|
const At = (n) => {
|
|
340
340
|
const { data: e, path: t, errorMaps: s, issueData: r } = n, a = [...t, ...r.path || []], o = {
|
|
@@ -347,14 +347,14 @@ const At = (n) => {
|
|
|
347
347
|
path: a,
|
|
348
348
|
message: r.message
|
|
349
349
|
};
|
|
350
|
-
let
|
|
351
|
-
const
|
|
352
|
-
for (const u of
|
|
353
|
-
|
|
350
|
+
let d = "";
|
|
351
|
+
const c = s.filter((u) => !!u).slice().reverse();
|
|
352
|
+
for (const u of c)
|
|
353
|
+
d = u(o, { data: e, defaultError: d }).message;
|
|
354
354
|
return {
|
|
355
355
|
...r,
|
|
356
356
|
path: a,
|
|
357
|
-
message:
|
|
357
|
+
message: d
|
|
358
358
|
};
|
|
359
359
|
}, ss = [];
|
|
360
360
|
function f(n, e) {
|
|
@@ -366,7 +366,7 @@ function f(n, e) {
|
|
|
366
366
|
n.common.contextualErrorMap,
|
|
367
367
|
n.schemaErrorMap,
|
|
368
368
|
t,
|
|
369
|
-
t ===
|
|
369
|
+
t === ze ? void 0 : ze
|
|
370
370
|
// then global default map
|
|
371
371
|
].filter((r) => !!r)
|
|
372
372
|
});
|
|
@@ -415,12 +415,12 @@ class $ {
|
|
|
415
415
|
}
|
|
416
416
|
const x = Object.freeze({
|
|
417
417
|
status: "aborted"
|
|
418
|
-
}), Rt = (n) => ({ status: "dirty", value: n }), D = (n) => ({ status: "valid", value: n }), en = (n) => n.status === "aborted", tn = (n) => n.status === "dirty",
|
|
418
|
+
}), Rt = (n) => ({ status: "dirty", value: n }), D = (n) => ({ status: "valid", value: n }), en = (n) => n.status === "aborted", tn = (n) => n.status === "dirty", tt = (n) => n.status === "valid", nt = (n) => typeof Promise < "u" && n instanceof Promise;
|
|
419
419
|
function $t(n, e, t, s) {
|
|
420
420
|
if (typeof e == "function" ? n !== e || !s : !e.has(n)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
421
421
|
return e.get(n);
|
|
422
422
|
}
|
|
423
|
-
function
|
|
423
|
+
function bn(n, e, t, s, r) {
|
|
424
424
|
if (typeof e == "function" ? n !== e || !r : !e.has(n)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
425
425
|
return e.set(n, t), t;
|
|
426
426
|
}
|
|
@@ -428,7 +428,7 @@ var y;
|
|
|
428
428
|
(function(n) {
|
|
429
429
|
n.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, n.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
430
430
|
})(y || (y = {}));
|
|
431
|
-
var
|
|
431
|
+
var Ye, Ge;
|
|
432
432
|
class X {
|
|
433
433
|
constructor(e, t, s, r) {
|
|
434
434
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = r;
|
|
@@ -437,8 +437,8 @@ class X {
|
|
|
437
437
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
const
|
|
441
|
-
if (
|
|
440
|
+
const hn = (n, e) => {
|
|
441
|
+
if (tt(e))
|
|
442
442
|
return { success: !0, data: e.value };
|
|
443
443
|
if (!n.common.issues.length)
|
|
444
444
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -459,9 +459,9 @@ function T(n) {
|
|
|
459
459
|
if (e && (t || s))
|
|
460
460
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
461
461
|
return e ? { errorMap: e, description: r } : { errorMap: (a, o) => {
|
|
462
|
-
var
|
|
462
|
+
var d, c;
|
|
463
463
|
const { message: u } = n;
|
|
464
|
-
return a.code === "invalid_enum_value" ? { message: u ?? o.defaultError } : typeof o.data > "u" ? { message: (
|
|
464
|
+
return a.code === "invalid_enum_value" ? { message: u ?? o.defaultError } : typeof o.data > "u" ? { message: (d = u ?? s) !== null && d !== void 0 ? d : o.defaultError } : a.code !== "invalid_type" ? { message: o.defaultError } : { message: (c = u ?? t) !== null && c !== void 0 ? c : o.defaultError };
|
|
465
465
|
}, description: r };
|
|
466
466
|
}
|
|
467
467
|
class S {
|
|
@@ -499,7 +499,7 @@ class S {
|
|
|
499
499
|
}
|
|
500
500
|
_parseSync(e) {
|
|
501
501
|
const t = this._parse(e);
|
|
502
|
-
if (
|
|
502
|
+
if (nt(t))
|
|
503
503
|
throw new Error("Synchronous parse encountered promise.");
|
|
504
504
|
return t;
|
|
505
505
|
}
|
|
@@ -527,7 +527,7 @@ class S {
|
|
|
527
527
|
data: e,
|
|
528
528
|
parsedType: pe(e)
|
|
529
529
|
}, a = this._parseSync({ data: e, path: r.path, parent: r });
|
|
530
|
-
return
|
|
530
|
+
return hn(r, a);
|
|
531
531
|
}
|
|
532
532
|
async parseAsync(e, t) {
|
|
533
533
|
const s = await this.safeParseAsync(e, t);
|
|
@@ -547,17 +547,17 @@ class S {
|
|
|
547
547
|
parent: null,
|
|
548
548
|
data: e,
|
|
549
549
|
parsedType: pe(e)
|
|
550
|
-
}, r = this._parse({ data: e, path: s.path, parent: s }), a = await (
|
|
551
|
-
return
|
|
550
|
+
}, r = this._parse({ data: e, path: s.path, parent: s }), a = await (nt(r) ? r : Promise.resolve(r));
|
|
551
|
+
return hn(s, a);
|
|
552
552
|
}
|
|
553
553
|
refine(e, t) {
|
|
554
554
|
const s = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
|
|
555
555
|
return this._refinement((r, a) => {
|
|
556
|
-
const o = e(r),
|
|
556
|
+
const o = e(r), d = () => a.addIssue({
|
|
557
557
|
code: p.custom,
|
|
558
558
|
...s(r)
|
|
559
559
|
});
|
|
560
|
-
return typeof Promise < "u" && o instanceof Promise ? o.then((
|
|
560
|
+
return typeof Promise < "u" && o instanceof Promise ? o.then((c) => c ? !0 : (d(), !1)) : o ? !0 : (d(), !1);
|
|
561
561
|
});
|
|
562
562
|
}
|
|
563
563
|
refinement(e, t) {
|
|
@@ -586,13 +586,13 @@ class S {
|
|
|
586
586
|
return B.create(this, this._def);
|
|
587
587
|
}
|
|
588
588
|
promise() {
|
|
589
|
-
return
|
|
589
|
+
return We.create(this, this._def);
|
|
590
590
|
}
|
|
591
591
|
or(e) {
|
|
592
|
-
return
|
|
592
|
+
return it.create([this, e], this._def);
|
|
593
593
|
}
|
|
594
594
|
and(e) {
|
|
595
|
-
return
|
|
595
|
+
return ot.create(this, e, this._def);
|
|
596
596
|
}
|
|
597
597
|
transform(e) {
|
|
598
598
|
return new q({
|
|
@@ -604,7 +604,7 @@ class S {
|
|
|
604
604
|
}
|
|
605
605
|
default(e) {
|
|
606
606
|
const t = typeof e == "function" ? e : () => e;
|
|
607
|
-
return new
|
|
607
|
+
return new pt({
|
|
608
608
|
...T(this._def),
|
|
609
609
|
innerType: this,
|
|
610
610
|
defaultValue: t,
|
|
@@ -612,7 +612,7 @@ class S {
|
|
|
612
612
|
});
|
|
613
613
|
}
|
|
614
614
|
brand() {
|
|
615
|
-
return new
|
|
615
|
+
return new dn({
|
|
616
616
|
typeName: w.ZodBranded,
|
|
617
617
|
type: this,
|
|
618
618
|
...T(this._def)
|
|
@@ -620,7 +620,7 @@ class S {
|
|
|
620
620
|
}
|
|
621
621
|
catch(e) {
|
|
622
622
|
const t = typeof e == "function" ? e : () => e;
|
|
623
|
-
return new
|
|
623
|
+
return new ht({
|
|
624
624
|
...T(this._def),
|
|
625
625
|
innerType: this,
|
|
626
626
|
catchValue: t,
|
|
@@ -635,10 +635,10 @@ class S {
|
|
|
635
635
|
});
|
|
636
636
|
}
|
|
637
637
|
pipe(e) {
|
|
638
|
-
return
|
|
638
|
+
return Nt.create(this, e);
|
|
639
639
|
}
|
|
640
640
|
readonly() {
|
|
641
|
-
return
|
|
641
|
+
return ft.create(this);
|
|
642
642
|
}
|
|
643
643
|
isOptional() {
|
|
644
644
|
return this.safeParse(void 0).success;
|
|
@@ -647,18 +647,18 @@ class S {
|
|
|
647
647
|
return this.safeParse(null).success;
|
|
648
648
|
}
|
|
649
649
|
}
|
|
650
|
-
const rs = /^c[^\s-]{8,}$/i, as = /^[0-9a-z]+$/, is = /^[0-9A-HJKMNP-TV-Z]{26}$/, os = /^[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,
|
|
650
|
+
const rs = /^c[^\s-]{8,}$/i, as = /^[0-9a-z]+$/, is = /^[0-9A-HJKMNP-TV-Z]{26}$/, os = /^[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, ds = /^[a-z0-9_-]{21}$/i, cs = /^[-+]?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)?)??$/, us = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ls = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
651
651
|
let Qt;
|
|
652
|
-
const ps = /^(?:(?: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])$/, hs = /^(([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})))$/, fs = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,
|
|
653
|
-
function
|
|
652
|
+
const ps = /^(?:(?: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])$/, hs = /^(([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})))$/, fs = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, kn = "((\\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])))", ms = new RegExp(`^${kn}$`);
|
|
653
|
+
function xn(n) {
|
|
654
654
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
655
655
|
return n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
656
656
|
}
|
|
657
657
|
function _s(n) {
|
|
658
|
-
return new RegExp(`^${
|
|
658
|
+
return new RegExp(`^${xn(n)}$`);
|
|
659
659
|
}
|
|
660
|
-
function
|
|
661
|
-
let e = `${
|
|
660
|
+
function Tn(n) {
|
|
661
|
+
let e = `${kn}T${xn(n)}`;
|
|
662
662
|
const t = [];
|
|
663
663
|
return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
664
664
|
}
|
|
@@ -732,7 +732,7 @@ class F extends S {
|
|
|
732
732
|
message: r.message
|
|
733
733
|
}), t.dirty());
|
|
734
734
|
else if (r.kind === "nanoid")
|
|
735
|
-
|
|
735
|
+
ds.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
736
736
|
validation: "nanoid",
|
|
737
737
|
code: p.invalid_string,
|
|
738
738
|
message: r.message
|
|
@@ -781,7 +781,7 @@ class F extends S {
|
|
|
781
781
|
code: p.invalid_string,
|
|
782
782
|
validation: { endsWith: r.value },
|
|
783
783
|
message: r.message
|
|
784
|
-
}), t.dirty()) : r.kind === "datetime" ?
|
|
784
|
+
}), t.dirty()) : r.kind === "datetime" ? Tn(r).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
785
785
|
code: p.invalid_string,
|
|
786
786
|
validation: "datetime",
|
|
787
787
|
message: r.message
|
|
@@ -793,7 +793,7 @@ class F extends S {
|
|
|
793
793
|
code: p.invalid_string,
|
|
794
794
|
validation: "time",
|
|
795
795
|
message: r.message
|
|
796
|
-
}), t.dirty()) : r.kind === "duration" ?
|
|
796
|
+
}), t.dirty()) : r.kind === "duration" ? cs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
797
797
|
validation: "duration",
|
|
798
798
|
code: p.invalid_string,
|
|
799
799
|
message: r.message
|
|
@@ -1327,7 +1327,7 @@ me.create = (n) => {
|
|
|
1327
1327
|
...T(n)
|
|
1328
1328
|
});
|
|
1329
1329
|
};
|
|
1330
|
-
class
|
|
1330
|
+
class st extends S {
|
|
1331
1331
|
_parse(e) {
|
|
1332
1332
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== _.boolean) {
|
|
1333
1333
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1340,7 +1340,7 @@ class rt extends S {
|
|
|
1340
1340
|
return D(e.data);
|
|
1341
1341
|
}
|
|
1342
1342
|
}
|
|
1343
|
-
|
|
1343
|
+
st.create = (n) => new st({
|
|
1344
1344
|
typeName: w.ZodBoolean,
|
|
1345
1345
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
1346
1346
|
...T(n)
|
|
@@ -1440,7 +1440,7 @@ Pt.create = (n) => new Pt({
|
|
|
1440
1440
|
typeName: w.ZodSymbol,
|
|
1441
1441
|
...T(n)
|
|
1442
1442
|
});
|
|
1443
|
-
class
|
|
1443
|
+
class rt extends S {
|
|
1444
1444
|
_parse(e) {
|
|
1445
1445
|
if (this._getType(e) !== _.undefined) {
|
|
1446
1446
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1453,11 +1453,11 @@ class at extends S {
|
|
|
1453
1453
|
return D(e.data);
|
|
1454
1454
|
}
|
|
1455
1455
|
}
|
|
1456
|
-
|
|
1456
|
+
rt.create = (n) => new rt({
|
|
1457
1457
|
typeName: w.ZodUndefined,
|
|
1458
1458
|
...T(n)
|
|
1459
1459
|
});
|
|
1460
|
-
class
|
|
1460
|
+
class at extends S {
|
|
1461
1461
|
_parse(e) {
|
|
1462
1462
|
if (this._getType(e) !== _.null) {
|
|
1463
1463
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1470,11 +1470,11 @@ class it extends S {
|
|
|
1470
1470
|
return D(e.data);
|
|
1471
1471
|
}
|
|
1472
1472
|
}
|
|
1473
|
-
|
|
1473
|
+
at.create = (n) => new at({
|
|
1474
1474
|
typeName: w.ZodNull,
|
|
1475
1475
|
...T(n)
|
|
1476
1476
|
});
|
|
1477
|
-
class
|
|
1477
|
+
class Be extends S {
|
|
1478
1478
|
constructor() {
|
|
1479
1479
|
super(...arguments), this._any = !0;
|
|
1480
1480
|
}
|
|
@@ -1482,7 +1482,7 @@ class We extends S {
|
|
|
1482
1482
|
return D(e.data);
|
|
1483
1483
|
}
|
|
1484
1484
|
}
|
|
1485
|
-
|
|
1485
|
+
Be.create = (n) => new Be({
|
|
1486
1486
|
typeName: w.ZodAny,
|
|
1487
1487
|
...T(n)
|
|
1488
1488
|
});
|
|
@@ -1539,10 +1539,10 @@ class B extends S {
|
|
|
1539
1539
|
received: t.parsedType
|
|
1540
1540
|
}), x;
|
|
1541
1541
|
if (r.exactLength !== null) {
|
|
1542
|
-
const o = t.data.length > r.exactLength.value,
|
|
1543
|
-
(o ||
|
|
1542
|
+
const o = t.data.length > r.exactLength.value, d = t.data.length < r.exactLength.value;
|
|
1543
|
+
(o || d) && (f(t, {
|
|
1544
1544
|
code: o ? p.too_big : p.too_small,
|
|
1545
|
-
minimum:
|
|
1545
|
+
minimum: d ? r.exactLength.value : void 0,
|
|
1546
1546
|
maximum: o ? r.exactLength.value : void 0,
|
|
1547
1547
|
type: "array",
|
|
1548
1548
|
inclusive: !0,
|
|
@@ -1565,8 +1565,8 @@ class B extends S {
|
|
|
1565
1565
|
exact: !1,
|
|
1566
1566
|
message: r.maxLength.message
|
|
1567
1567
|
}), s.dirty()), t.common.async)
|
|
1568
|
-
return Promise.all([...t.data].map((o,
|
|
1569
|
-
const a = [...t.data].map((o,
|
|
1568
|
+
return Promise.all([...t.data].map((o, d) => r.type._parseAsync(new X(t, o, t.path, d)))).then((o) => $.mergeArray(s, o));
|
|
1569
|
+
const a = [...t.data].map((o, d) => r.type._parseSync(new X(t, o, t.path, d)));
|
|
1570
1570
|
return $.mergeArray(s, a);
|
|
1571
1571
|
}
|
|
1572
1572
|
get element() {
|
|
@@ -1602,12 +1602,12 @@ B.create = (n, e) => new B({
|
|
|
1602
1602
|
typeName: w.ZodArray,
|
|
1603
1603
|
...T(e)
|
|
1604
1604
|
});
|
|
1605
|
-
function
|
|
1605
|
+
function Me(n) {
|
|
1606
1606
|
if (n instanceof I) {
|
|
1607
1607
|
const e = {};
|
|
1608
1608
|
for (const t in n.shape) {
|
|
1609
1609
|
const s = n.shape[t];
|
|
1610
|
-
e[t] = Y.create(
|
|
1610
|
+
e[t] = Y.create(Me(s));
|
|
1611
1611
|
}
|
|
1612
1612
|
return new I({
|
|
1613
1613
|
...n._def,
|
|
@@ -1615,8 +1615,8 @@ function Le(n) {
|
|
|
1615
1615
|
});
|
|
1616
1616
|
} else return n instanceof B ? new B({
|
|
1617
1617
|
...n._def,
|
|
1618
|
-
type:
|
|
1619
|
-
}) : n instanceof Y ? Y.create(
|
|
1618
|
+
type: Me(n.element)
|
|
1619
|
+
}) : n instanceof Y ? Y.create(Me(n.unwrap())) : n instanceof ge ? ge.create(Me(n.unwrap())) : n instanceof ee ? ee.create(n.items.map((e) => Me(e))) : n;
|
|
1620
1620
|
}
|
|
1621
1621
|
class I extends S {
|
|
1622
1622
|
constructor() {
|
|
@@ -1630,47 +1630,47 @@ class I extends S {
|
|
|
1630
1630
|
}
|
|
1631
1631
|
_parse(e) {
|
|
1632
1632
|
if (this._getType(e) !== _.object) {
|
|
1633
|
-
const
|
|
1634
|
-
return f(
|
|
1633
|
+
const c = this._getOrReturnCtx(e);
|
|
1634
|
+
return f(c, {
|
|
1635
1635
|
code: p.invalid_type,
|
|
1636
1636
|
expected: _.object,
|
|
1637
|
-
received:
|
|
1637
|
+
received: c.parsedType
|
|
1638
1638
|
}), x;
|
|
1639
1639
|
}
|
|
1640
1640
|
const { status: t, ctx: s } = this._processInputParams(e), { shape: r, keys: a } = this._getCached(), o = [];
|
|
1641
1641
|
if (!(this._def.catchall instanceof re && this._def.unknownKeys === "strip"))
|
|
1642
|
-
for (const
|
|
1643
|
-
a.includes(
|
|
1644
|
-
const
|
|
1645
|
-
for (const
|
|
1646
|
-
const u = r[
|
|
1647
|
-
|
|
1648
|
-
key: { status: "valid", value:
|
|
1649
|
-
value: u._parse(new X(s, l, s.path,
|
|
1650
|
-
alwaysSet:
|
|
1642
|
+
for (const c in s.data)
|
|
1643
|
+
a.includes(c) || o.push(c);
|
|
1644
|
+
const d = [];
|
|
1645
|
+
for (const c of a) {
|
|
1646
|
+
const u = r[c], l = s.data[c];
|
|
1647
|
+
d.push({
|
|
1648
|
+
key: { status: "valid", value: c },
|
|
1649
|
+
value: u._parse(new X(s, l, s.path, c)),
|
|
1650
|
+
alwaysSet: c in s.data
|
|
1651
1651
|
});
|
|
1652
1652
|
}
|
|
1653
1653
|
if (this._def.catchall instanceof re) {
|
|
1654
|
-
const
|
|
1655
|
-
if (
|
|
1654
|
+
const c = this._def.unknownKeys;
|
|
1655
|
+
if (c === "passthrough")
|
|
1656
1656
|
for (const u of o)
|
|
1657
|
-
|
|
1657
|
+
d.push({
|
|
1658
1658
|
key: { status: "valid", value: u },
|
|
1659
1659
|
value: { status: "valid", value: s.data[u] }
|
|
1660
1660
|
});
|
|
1661
|
-
else if (
|
|
1661
|
+
else if (c === "strict")
|
|
1662
1662
|
o.length > 0 && (f(s, {
|
|
1663
1663
|
code: p.unrecognized_keys,
|
|
1664
1664
|
keys: o
|
|
1665
1665
|
}), t.dirty());
|
|
1666
|
-
else if (
|
|
1666
|
+
else if (c !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
1667
1667
|
} else {
|
|
1668
|
-
const
|
|
1668
|
+
const c = this._def.catchall;
|
|
1669
1669
|
for (const u of o) {
|
|
1670
1670
|
const l = s.data[u];
|
|
1671
|
-
|
|
1671
|
+
d.push({
|
|
1672
1672
|
key: { status: "valid", value: u },
|
|
1673
|
-
value:
|
|
1673
|
+
value: c._parse(
|
|
1674
1674
|
new X(s, l, s.path, u)
|
|
1675
1675
|
//, ctx.child(key), value, getParsedType(value)
|
|
1676
1676
|
),
|
|
@@ -1679,17 +1679,17 @@ class I extends S {
|
|
|
1679
1679
|
}
|
|
1680
1680
|
}
|
|
1681
1681
|
return s.common.async ? Promise.resolve().then(async () => {
|
|
1682
|
-
const
|
|
1683
|
-
for (const u of
|
|
1682
|
+
const c = [];
|
|
1683
|
+
for (const u of d) {
|
|
1684
1684
|
const l = await u.key, j = await u.value;
|
|
1685
|
-
|
|
1685
|
+
c.push({
|
|
1686
1686
|
key: l,
|
|
1687
1687
|
value: j,
|
|
1688
1688
|
alwaysSet: u.alwaysSet
|
|
1689
1689
|
});
|
|
1690
1690
|
}
|
|
1691
|
-
return
|
|
1692
|
-
}).then((
|
|
1691
|
+
return c;
|
|
1692
|
+
}).then((c) => $.mergeObjectSync(t, c)) : $.mergeObjectSync(t, d);
|
|
1693
1693
|
}
|
|
1694
1694
|
get shape() {
|
|
1695
1695
|
return this._def.shape();
|
|
@@ -1700,12 +1700,12 @@ class I extends S {
|
|
|
1700
1700
|
unknownKeys: "strict",
|
|
1701
1701
|
...e !== void 0 ? {
|
|
1702
1702
|
errorMap: (t, s) => {
|
|
1703
|
-
var r, a, o,
|
|
1704
|
-
const
|
|
1703
|
+
var r, a, o, d;
|
|
1704
|
+
const c = (o = (a = (r = this._def).errorMap) === null || a === void 0 ? void 0 : a.call(r, t, s).message) !== null && o !== void 0 ? o : s.defaultError;
|
|
1705
1705
|
return t.code === "unrecognized_keys" ? {
|
|
1706
|
-
message: (
|
|
1706
|
+
message: (d = y.errToObj(e).message) !== null && d !== void 0 ? d : c
|
|
1707
1707
|
} : {
|
|
1708
|
-
message:
|
|
1708
|
+
message: c
|
|
1709
1709
|
};
|
|
1710
1710
|
}
|
|
1711
1711
|
} : {}
|
|
@@ -1852,7 +1852,7 @@ class I extends S {
|
|
|
1852
1852
|
* @deprecated
|
|
1853
1853
|
*/
|
|
1854
1854
|
deepPartial() {
|
|
1855
|
-
return
|
|
1855
|
+
return Me(this);
|
|
1856
1856
|
}
|
|
1857
1857
|
partial(e) {
|
|
1858
1858
|
const t = {};
|
|
@@ -1881,7 +1881,7 @@ class I extends S {
|
|
|
1881
1881
|
});
|
|
1882
1882
|
}
|
|
1883
1883
|
keyof() {
|
|
1884
|
-
return
|
|
1884
|
+
return On(N.objectKeys(this.shape));
|
|
1885
1885
|
}
|
|
1886
1886
|
}
|
|
1887
1887
|
I.create = (n, e) => new I({
|
|
@@ -1905,17 +1905,17 @@ I.lazycreate = (n, e) => new I({
|
|
|
1905
1905
|
typeName: w.ZodObject,
|
|
1906
1906
|
...T(e)
|
|
1907
1907
|
});
|
|
1908
|
-
class
|
|
1908
|
+
class it extends S {
|
|
1909
1909
|
_parse(e) {
|
|
1910
1910
|
const { ctx: t } = this._processInputParams(e), s = this._def.options;
|
|
1911
1911
|
function r(a) {
|
|
1912
|
-
for (const
|
|
1913
|
-
if (
|
|
1914
|
-
return
|
|
1915
|
-
for (const
|
|
1916
|
-
if (
|
|
1917
|
-
return t.common.issues.push(...
|
|
1918
|
-
const o = a.map((
|
|
1912
|
+
for (const d of a)
|
|
1913
|
+
if (d.result.status === "valid")
|
|
1914
|
+
return d.result;
|
|
1915
|
+
for (const d of a)
|
|
1916
|
+
if (d.result.status === "dirty")
|
|
1917
|
+
return t.common.issues.push(...d.ctx.common.issues), d.result;
|
|
1918
|
+
const o = a.map((d) => new L(d.ctx.common.issues));
|
|
1919
1919
|
return f(t, {
|
|
1920
1920
|
code: p.invalid_union,
|
|
1921
1921
|
unionErrors: o
|
|
@@ -1943,7 +1943,7 @@ class ot extends S {
|
|
|
1943
1943
|
{
|
|
1944
1944
|
let a;
|
|
1945
1945
|
const o = [];
|
|
1946
|
-
for (const
|
|
1946
|
+
for (const c of s) {
|
|
1947
1947
|
const u = {
|
|
1948
1948
|
...t,
|
|
1949
1949
|
common: {
|
|
@@ -1951,7 +1951,7 @@ class ot extends S {
|
|
|
1951
1951
|
issues: []
|
|
1952
1952
|
},
|
|
1953
1953
|
parent: null
|
|
1954
|
-
}, l =
|
|
1954
|
+
}, l = c._parseSync({
|
|
1955
1955
|
data: t.data,
|
|
1956
1956
|
path: t.path,
|
|
1957
1957
|
parent: u
|
|
@@ -1962,10 +1962,10 @@ class ot extends S {
|
|
|
1962
1962
|
}
|
|
1963
1963
|
if (a)
|
|
1964
1964
|
return t.common.issues.push(...a.ctx.common.issues), a.result;
|
|
1965
|
-
const
|
|
1965
|
+
const d = o.map((c) => new L(c));
|
|
1966
1966
|
return f(t, {
|
|
1967
1967
|
code: p.invalid_union,
|
|
1968
|
-
unionErrors:
|
|
1968
|
+
unionErrors: d
|
|
1969
1969
|
}), x;
|
|
1970
1970
|
}
|
|
1971
1971
|
}
|
|
@@ -1973,12 +1973,12 @@ class ot extends S {
|
|
|
1973
1973
|
return this._def.options;
|
|
1974
1974
|
}
|
|
1975
1975
|
}
|
|
1976
|
-
|
|
1976
|
+
it.create = (n, e) => new it({
|
|
1977
1977
|
options: n,
|
|
1978
1978
|
typeName: w.ZodUnion,
|
|
1979
1979
|
...T(e)
|
|
1980
1980
|
});
|
|
1981
|
-
const le = (n) => n instanceof
|
|
1981
|
+
const le = (n) => n instanceof ct ? le(n.schema) : n instanceof q ? le(n.innerType()) : n instanceof ut ? [n.value] : n instanceof _e ? n.options : n instanceof lt ? N.objectValues(n.enum) : n instanceof pt ? le(n._def.innerType) : n instanceof rt ? [void 0] : n instanceof at ? [null] : n instanceof Y ? [void 0, ...le(n.unwrap())] : n instanceof ge ? [null, ...le(n.unwrap())] : n instanceof dn || n instanceof ft ? le(n.unwrap()) : n instanceof ht ? le(n._def.innerType) : [];
|
|
1982
1982
|
class Jt extends S {
|
|
1983
1983
|
_parse(e) {
|
|
1984
1984
|
const { ctx: t } = this._processInputParams(e);
|
|
@@ -2026,10 +2026,10 @@ class Jt extends S {
|
|
|
2026
2026
|
const o = le(a.shape[e]);
|
|
2027
2027
|
if (!o.length)
|
|
2028
2028
|
throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
|
|
2029
|
-
for (const
|
|
2030
|
-
if (r.has(
|
|
2031
|
-
throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(
|
|
2032
|
-
r.set(
|
|
2029
|
+
for (const d of o) {
|
|
2030
|
+
if (r.has(d))
|
|
2031
|
+
throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);
|
|
2032
|
+
r.set(d, a);
|
|
2033
2033
|
}
|
|
2034
2034
|
}
|
|
2035
2035
|
return new Jt({
|
|
@@ -2046,12 +2046,12 @@ function nn(n, e) {
|
|
|
2046
2046
|
if (n === e)
|
|
2047
2047
|
return { valid: !0, data: n };
|
|
2048
2048
|
if (t === _.object && s === _.object) {
|
|
2049
|
-
const r = N.objectKeys(e), a = N.objectKeys(n).filter((
|
|
2050
|
-
for (const
|
|
2051
|
-
const
|
|
2052
|
-
if (!
|
|
2049
|
+
const r = N.objectKeys(e), a = N.objectKeys(n).filter((d) => r.indexOf(d) !== -1), o = { ...n, ...e };
|
|
2050
|
+
for (const d of a) {
|
|
2051
|
+
const c = nn(n[d], e[d]);
|
|
2052
|
+
if (!c.valid)
|
|
2053
2053
|
return { valid: !1 };
|
|
2054
|
-
o[
|
|
2054
|
+
o[d] = c.data;
|
|
2055
2055
|
}
|
|
2056
2056
|
return { valid: !0, data: o };
|
|
2057
2057
|
} else if (t === _.array && s === _.array) {
|
|
@@ -2059,21 +2059,21 @@ function nn(n, e) {
|
|
|
2059
2059
|
return { valid: !1 };
|
|
2060
2060
|
const r = [];
|
|
2061
2061
|
for (let a = 0; a < n.length; a++) {
|
|
2062
|
-
const o = n[a],
|
|
2063
|
-
if (!
|
|
2062
|
+
const o = n[a], d = e[a], c = nn(o, d);
|
|
2063
|
+
if (!c.valid)
|
|
2064
2064
|
return { valid: !1 };
|
|
2065
|
-
r.push(
|
|
2065
|
+
r.push(c.data);
|
|
2066
2066
|
}
|
|
2067
2067
|
return { valid: !0, data: r };
|
|
2068
2068
|
} else return t === _.date && s === _.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
|
|
2069
2069
|
}
|
|
2070
|
-
class
|
|
2070
|
+
class ot extends S {
|
|
2071
2071
|
_parse(e) {
|
|
2072
2072
|
const { status: t, ctx: s } = this._processInputParams(e), r = (a, o) => {
|
|
2073
2073
|
if (en(a) || en(o))
|
|
2074
2074
|
return x;
|
|
2075
|
-
const
|
|
2076
|
-
return
|
|
2075
|
+
const d = nn(a.value, o.value);
|
|
2076
|
+
return d.valid ? ((tn(a) || tn(o)) && t.dirty(), { status: t.value, value: d.data }) : (f(s, {
|
|
2077
2077
|
code: p.invalid_intersection_types
|
|
2078
2078
|
}), x);
|
|
2079
2079
|
};
|
|
@@ -2099,7 +2099,7 @@ class ct extends S {
|
|
|
2099
2099
|
}));
|
|
2100
2100
|
}
|
|
2101
2101
|
}
|
|
2102
|
-
|
|
2102
|
+
ot.create = (n, e, t) => new ot({
|
|
2103
2103
|
left: n,
|
|
2104
2104
|
right: e,
|
|
2105
2105
|
typeName: w.ZodIntersection,
|
|
@@ -2130,8 +2130,8 @@ class ee extends S {
|
|
|
2130
2130
|
type: "array"
|
|
2131
2131
|
}), t.dirty());
|
|
2132
2132
|
const r = [...s.data].map((a, o) => {
|
|
2133
|
-
const
|
|
2134
|
-
return
|
|
2133
|
+
const d = this._def.items[o] || this._def.rest;
|
|
2134
|
+
return d ? d._parse(new X(s, a, s.path, o)) : null;
|
|
2135
2135
|
}).filter((a) => !!a);
|
|
2136
2136
|
return s.common.async ? Promise.all(r).then((a) => $.mergeArray(t, a)) : $.mergeArray(t, r);
|
|
2137
2137
|
}
|
|
@@ -2171,11 +2171,11 @@ class dt extends S {
|
|
|
2171
2171
|
received: s.parsedType
|
|
2172
2172
|
}), x;
|
|
2173
2173
|
const r = [], a = this._def.keyType, o = this._def.valueType;
|
|
2174
|
-
for (const
|
|
2174
|
+
for (const d in s.data)
|
|
2175
2175
|
r.push({
|
|
2176
|
-
key: a._parse(new X(s,
|
|
2177
|
-
value: o._parse(new X(s, s.data[
|
|
2178
|
-
alwaysSet:
|
|
2176
|
+
key: a._parse(new X(s, d, s.path, d)),
|
|
2177
|
+
value: o._parse(new X(s, s.data[d], s.path, d)),
|
|
2178
|
+
alwaysSet: d in s.data
|
|
2179
2179
|
});
|
|
2180
2180
|
return s.common.async ? $.mergeObjectAsync(t, r) : $.mergeObjectSync(t, r);
|
|
2181
2181
|
}
|
|
@@ -2211,30 +2211,30 @@ class Mt extends S {
|
|
|
2211
2211
|
expected: _.map,
|
|
2212
2212
|
received: s.parsedType
|
|
2213
2213
|
}), x;
|
|
2214
|
-
const r = this._def.keyType, a = this._def.valueType, o = [...s.data.entries()].map(([
|
|
2215
|
-
key: r._parse(new X(s,
|
|
2216
|
-
value: a._parse(new X(s,
|
|
2214
|
+
const r = this._def.keyType, a = this._def.valueType, o = [...s.data.entries()].map(([d, c], u) => ({
|
|
2215
|
+
key: r._parse(new X(s, d, s.path, [u, "key"])),
|
|
2216
|
+
value: a._parse(new X(s, c, s.path, [u, "value"]))
|
|
2217
2217
|
}));
|
|
2218
2218
|
if (s.common.async) {
|
|
2219
|
-
const
|
|
2219
|
+
const d = /* @__PURE__ */ new Map();
|
|
2220
2220
|
return Promise.resolve().then(async () => {
|
|
2221
|
-
for (const
|
|
2222
|
-
const u = await
|
|
2221
|
+
for (const c of o) {
|
|
2222
|
+
const u = await c.key, l = await c.value;
|
|
2223
2223
|
if (u.status === "aborted" || l.status === "aborted")
|
|
2224
2224
|
return x;
|
|
2225
|
-
(u.status === "dirty" || l.status === "dirty") && t.dirty(),
|
|
2225
|
+
(u.status === "dirty" || l.status === "dirty") && t.dirty(), d.set(u.value, l.value);
|
|
2226
2226
|
}
|
|
2227
|
-
return { status: t.value, value:
|
|
2227
|
+
return { status: t.value, value: d };
|
|
2228
2228
|
});
|
|
2229
2229
|
} else {
|
|
2230
|
-
const
|
|
2231
|
-
for (const
|
|
2232
|
-
const u =
|
|
2230
|
+
const d = /* @__PURE__ */ new Map();
|
|
2231
|
+
for (const c of o) {
|
|
2232
|
+
const u = c.key, l = c.value;
|
|
2233
2233
|
if (u.status === "aborted" || l.status === "aborted")
|
|
2234
2234
|
return x;
|
|
2235
|
-
(u.status === "dirty" || l.status === "dirty") && t.dirty(),
|
|
2235
|
+
(u.status === "dirty" || l.status === "dirty") && t.dirty(), d.set(u.value, l.value);
|
|
2236
2236
|
}
|
|
2237
|
-
return { status: t.value, value:
|
|
2237
|
+
return { status: t.value, value: d };
|
|
2238
2238
|
}
|
|
2239
2239
|
}
|
|
2240
2240
|
}
|
|
@@ -2270,17 +2270,17 @@ class Ne extends S {
|
|
|
2270
2270
|
message: r.maxSize.message
|
|
2271
2271
|
}), t.dirty());
|
|
2272
2272
|
const a = this._def.valueType;
|
|
2273
|
-
function o(
|
|
2273
|
+
function o(c) {
|
|
2274
2274
|
const u = /* @__PURE__ */ new Set();
|
|
2275
|
-
for (const l of
|
|
2275
|
+
for (const l of c) {
|
|
2276
2276
|
if (l.status === "aborted")
|
|
2277
2277
|
return x;
|
|
2278
2278
|
l.status === "dirty" && t.dirty(), u.add(l.value);
|
|
2279
2279
|
}
|
|
2280
2280
|
return { status: t.value, value: u };
|
|
2281
2281
|
}
|
|
2282
|
-
const
|
|
2283
|
-
return s.common.async ? Promise.all(
|
|
2282
|
+
const d = [...s.data.values()].map((c, u) => a._parse(new X(s, c, s.path, u)));
|
|
2283
|
+
return s.common.async ? Promise.all(d).then((c) => o(c)) : o(d);
|
|
2284
2284
|
}
|
|
2285
2285
|
min(e, t) {
|
|
2286
2286
|
return new Ne({
|
|
@@ -2308,7 +2308,7 @@ Ne.create = (n, e) => new Ne({
|
|
|
2308
2308
|
typeName: w.ZodSet,
|
|
2309
2309
|
...T(e)
|
|
2310
2310
|
});
|
|
2311
|
-
class
|
|
2311
|
+
class Ue extends S {
|
|
2312
2312
|
constructor() {
|
|
2313
2313
|
super(...arguments), this.validate = this.implement;
|
|
2314
2314
|
}
|
|
@@ -2320,56 +2320,56 @@ class Fe extends S {
|
|
|
2320
2320
|
expected: _.function,
|
|
2321
2321
|
received: t.parsedType
|
|
2322
2322
|
}), x;
|
|
2323
|
-
function s(
|
|
2323
|
+
function s(d, c) {
|
|
2324
2324
|
return At({
|
|
2325
|
-
data:
|
|
2325
|
+
data: d,
|
|
2326
2326
|
path: t.path,
|
|
2327
2327
|
errorMaps: [
|
|
2328
2328
|
t.common.contextualErrorMap,
|
|
2329
2329
|
t.schemaErrorMap,
|
|
2330
2330
|
Et(),
|
|
2331
|
-
|
|
2331
|
+
ze
|
|
2332
2332
|
].filter((u) => !!u),
|
|
2333
2333
|
issueData: {
|
|
2334
2334
|
code: p.invalid_arguments,
|
|
2335
|
-
argumentsError:
|
|
2335
|
+
argumentsError: c
|
|
2336
2336
|
}
|
|
2337
2337
|
});
|
|
2338
2338
|
}
|
|
2339
|
-
function r(
|
|
2339
|
+
function r(d, c) {
|
|
2340
2340
|
return At({
|
|
2341
|
-
data:
|
|
2341
|
+
data: d,
|
|
2342
2342
|
path: t.path,
|
|
2343
2343
|
errorMaps: [
|
|
2344
2344
|
t.common.contextualErrorMap,
|
|
2345
2345
|
t.schemaErrorMap,
|
|
2346
2346
|
Et(),
|
|
2347
|
-
|
|
2347
|
+
ze
|
|
2348
2348
|
].filter((u) => !!u),
|
|
2349
2349
|
issueData: {
|
|
2350
2350
|
code: p.invalid_return_type,
|
|
2351
|
-
returnTypeError:
|
|
2351
|
+
returnTypeError: c
|
|
2352
2352
|
}
|
|
2353
2353
|
});
|
|
2354
2354
|
}
|
|
2355
2355
|
const a = { errorMap: t.common.contextualErrorMap }, o = t.data;
|
|
2356
|
-
if (this._def.returns instanceof
|
|
2357
|
-
const
|
|
2358
|
-
return D(async function(...
|
|
2359
|
-
const u = new L([]), l = await
|
|
2360
|
-
throw u.addIssue(s(
|
|
2356
|
+
if (this._def.returns instanceof We) {
|
|
2357
|
+
const d = this;
|
|
2358
|
+
return D(async function(...c) {
|
|
2359
|
+
const u = new L([]), l = await d._def.args.parseAsync(c, a).catch((A) => {
|
|
2360
|
+
throw u.addIssue(s(c, A)), u;
|
|
2361
2361
|
}), j = await Reflect.apply(o, this, l);
|
|
2362
|
-
return await
|
|
2362
|
+
return await d._def.returns._def.type.parseAsync(j, a).catch((A) => {
|
|
2363
2363
|
throw u.addIssue(r(j, A)), u;
|
|
2364
2364
|
});
|
|
2365
2365
|
});
|
|
2366
2366
|
} else {
|
|
2367
|
-
const
|
|
2368
|
-
return D(function(...
|
|
2369
|
-
const u =
|
|
2367
|
+
const d = this;
|
|
2368
|
+
return D(function(...c) {
|
|
2369
|
+
const u = d._def.args.safeParse(c, a);
|
|
2370
2370
|
if (!u.success)
|
|
2371
|
-
throw new L([s(
|
|
2372
|
-
const l = Reflect.apply(o, this, u.data), j =
|
|
2371
|
+
throw new L([s(c, u.error)]);
|
|
2372
|
+
const l = Reflect.apply(o, this, u.data), j = d._def.returns.safeParse(l, a);
|
|
2373
2373
|
if (!j.success)
|
|
2374
2374
|
throw new L([r(l, j.error)]);
|
|
2375
2375
|
return j.data;
|
|
@@ -2383,13 +2383,13 @@ class Fe extends S {
|
|
|
2383
2383
|
return this._def.returns;
|
|
2384
2384
|
}
|
|
2385
2385
|
args(...e) {
|
|
2386
|
-
return new
|
|
2386
|
+
return new Ue({
|
|
2387
2387
|
...this._def,
|
|
2388
2388
|
args: ee.create(e).rest(Se.create())
|
|
2389
2389
|
});
|
|
2390
2390
|
}
|
|
2391
2391
|
returns(e) {
|
|
2392
|
-
return new
|
|
2392
|
+
return new Ue({
|
|
2393
2393
|
...this._def,
|
|
2394
2394
|
returns: e
|
|
2395
2395
|
});
|
|
@@ -2401,7 +2401,7 @@ class Fe extends S {
|
|
|
2401
2401
|
return this.parse(e);
|
|
2402
2402
|
}
|
|
2403
2403
|
static create(e, t, s) {
|
|
2404
|
-
return new
|
|
2404
|
+
return new Ue({
|
|
2405
2405
|
args: e || ee.create([]).rest(Se.create()),
|
|
2406
2406
|
returns: t || Se.create(),
|
|
2407
2407
|
typeName: w.ZodFunction,
|
|
@@ -2409,7 +2409,7 @@ class Fe extends S {
|
|
|
2409
2409
|
});
|
|
2410
2410
|
}
|
|
2411
2411
|
}
|
|
2412
|
-
class
|
|
2412
|
+
class ct extends S {
|
|
2413
2413
|
get schema() {
|
|
2414
2414
|
return this._def.getter();
|
|
2415
2415
|
}
|
|
@@ -2418,12 +2418,12 @@ class ut extends S {
|
|
|
2418
2418
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
2419
2419
|
}
|
|
2420
2420
|
}
|
|
2421
|
-
|
|
2421
|
+
ct.create = (n, e) => new ct({
|
|
2422
2422
|
getter: n,
|
|
2423
2423
|
typeName: w.ZodLazy,
|
|
2424
2424
|
...T(e)
|
|
2425
2425
|
});
|
|
2426
|
-
class
|
|
2426
|
+
class ut extends S {
|
|
2427
2427
|
_parse(e) {
|
|
2428
2428
|
if (e.data !== this._def.value) {
|
|
2429
2429
|
const t = this._getOrReturnCtx(e);
|
|
@@ -2439,12 +2439,12 @@ class lt extends S {
|
|
|
2439
2439
|
return this._def.value;
|
|
2440
2440
|
}
|
|
2441
2441
|
}
|
|
2442
|
-
|
|
2442
|
+
ut.create = (n, e) => new ut({
|
|
2443
2443
|
value: n,
|
|
2444
2444
|
typeName: w.ZodLiteral,
|
|
2445
2445
|
...T(e)
|
|
2446
2446
|
});
|
|
2447
|
-
function
|
|
2447
|
+
function On(n, e) {
|
|
2448
2448
|
return new _e({
|
|
2449
2449
|
values: n,
|
|
2450
2450
|
typeName: w.ZodEnum,
|
|
@@ -2453,7 +2453,7 @@ function Sn(n, e) {
|
|
|
2453
2453
|
}
|
|
2454
2454
|
class _e extends S {
|
|
2455
2455
|
constructor() {
|
|
2456
|
-
super(...arguments),
|
|
2456
|
+
super(...arguments), Ye.set(this, void 0);
|
|
2457
2457
|
}
|
|
2458
2458
|
_parse(e) {
|
|
2459
2459
|
if (typeof e.data != "string") {
|
|
@@ -2464,7 +2464,7 @@ class _e extends S {
|
|
|
2464
2464
|
code: p.invalid_type
|
|
2465
2465
|
}), x;
|
|
2466
2466
|
}
|
|
2467
|
-
if ($t(this,
|
|
2467
|
+
if ($t(this, Ye) || bn(this, Ye, new Set(this._def.values)), !$t(this, Ye).has(e.data)) {
|
|
2468
2468
|
const t = this._getOrReturnCtx(e), s = this._def.values;
|
|
2469
2469
|
return f(t, {
|
|
2470
2470
|
received: t.data,
|
|
@@ -2508,11 +2508,11 @@ class _e extends S {
|
|
|
2508
2508
|
});
|
|
2509
2509
|
}
|
|
2510
2510
|
}
|
|
2511
|
-
|
|
2512
|
-
_e.create =
|
|
2513
|
-
class
|
|
2511
|
+
Ye = /* @__PURE__ */ new WeakMap();
|
|
2512
|
+
_e.create = On;
|
|
2513
|
+
class lt extends S {
|
|
2514
2514
|
constructor() {
|
|
2515
|
-
super(...arguments),
|
|
2515
|
+
super(...arguments), Ge.set(this, void 0);
|
|
2516
2516
|
}
|
|
2517
2517
|
_parse(e) {
|
|
2518
2518
|
const t = N.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
|
|
@@ -2524,7 +2524,7 @@ class pt extends S {
|
|
|
2524
2524
|
code: p.invalid_type
|
|
2525
2525
|
}), x;
|
|
2526
2526
|
}
|
|
2527
|
-
if ($t(this,
|
|
2527
|
+
if ($t(this, Ge) || bn(this, Ge, new Set(N.getValidEnumValues(this._def.values))), !$t(this, Ge).has(e.data)) {
|
|
2528
2528
|
const r = N.objectValues(t);
|
|
2529
2529
|
return f(s, {
|
|
2530
2530
|
received: s.data,
|
|
@@ -2538,13 +2538,13 @@ class pt extends S {
|
|
|
2538
2538
|
return this._def.values;
|
|
2539
2539
|
}
|
|
2540
2540
|
}
|
|
2541
|
-
|
|
2542
|
-
|
|
2541
|
+
Ge = /* @__PURE__ */ new WeakMap();
|
|
2542
|
+
lt.create = (n, e) => new lt({
|
|
2543
2543
|
values: n,
|
|
2544
2544
|
typeName: w.ZodNativeEnum,
|
|
2545
2545
|
...T(e)
|
|
2546
2546
|
});
|
|
2547
|
-
class
|
|
2547
|
+
class We extends S {
|
|
2548
2548
|
unwrap() {
|
|
2549
2549
|
return this._def.type;
|
|
2550
2550
|
}
|
|
@@ -2563,7 +2563,7 @@ class qe extends S {
|
|
|
2563
2563
|
})));
|
|
2564
2564
|
}
|
|
2565
2565
|
}
|
|
2566
|
-
|
|
2566
|
+
We.create = (n, e) => new We({
|
|
2567
2567
|
type: n,
|
|
2568
2568
|
typeName: w.ZodPromise,
|
|
2569
2569
|
...T(e)
|
|
@@ -2587,45 +2587,45 @@ class q extends S {
|
|
|
2587
2587
|
if (a.addIssue = a.addIssue.bind(a), r.type === "preprocess") {
|
|
2588
2588
|
const o = r.transform(s.data, a);
|
|
2589
2589
|
if (s.common.async)
|
|
2590
|
-
return Promise.resolve(o).then(async (
|
|
2590
|
+
return Promise.resolve(o).then(async (d) => {
|
|
2591
2591
|
if (t.value === "aborted")
|
|
2592
2592
|
return x;
|
|
2593
|
-
const
|
|
2594
|
-
data:
|
|
2593
|
+
const c = await this._def.schema._parseAsync({
|
|
2594
|
+
data: d,
|
|
2595
2595
|
path: s.path,
|
|
2596
2596
|
parent: s
|
|
2597
2597
|
});
|
|
2598
|
-
return
|
|
2598
|
+
return c.status === "aborted" ? x : c.status === "dirty" || t.value === "dirty" ? Rt(c.value) : c;
|
|
2599
2599
|
});
|
|
2600
2600
|
{
|
|
2601
2601
|
if (t.value === "aborted")
|
|
2602
2602
|
return x;
|
|
2603
|
-
const
|
|
2603
|
+
const d = this._def.schema._parseSync({
|
|
2604
2604
|
data: o,
|
|
2605
2605
|
path: s.path,
|
|
2606
2606
|
parent: s
|
|
2607
2607
|
});
|
|
2608
|
-
return
|
|
2608
|
+
return d.status === "aborted" ? x : d.status === "dirty" || t.value === "dirty" ? Rt(d.value) : d;
|
|
2609
2609
|
}
|
|
2610
2610
|
}
|
|
2611
2611
|
if (r.type === "refinement") {
|
|
2612
|
-
const o = (
|
|
2613
|
-
const
|
|
2612
|
+
const o = (d) => {
|
|
2613
|
+
const c = r.refinement(d, a);
|
|
2614
2614
|
if (s.common.async)
|
|
2615
|
-
return Promise.resolve(
|
|
2616
|
-
if (
|
|
2615
|
+
return Promise.resolve(c);
|
|
2616
|
+
if (c instanceof Promise)
|
|
2617
2617
|
throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2618
|
-
return
|
|
2618
|
+
return d;
|
|
2619
2619
|
};
|
|
2620
2620
|
if (s.common.async === !1) {
|
|
2621
|
-
const
|
|
2621
|
+
const d = this._def.schema._parseSync({
|
|
2622
2622
|
data: s.data,
|
|
2623
2623
|
path: s.path,
|
|
2624
2624
|
parent: s
|
|
2625
2625
|
});
|
|
2626
|
-
return
|
|
2626
|
+
return d.status === "aborted" ? x : (d.status === "dirty" && t.dirty(), o(d.value), { status: t.value, value: d.value });
|
|
2627
2627
|
} else
|
|
2628
|
-
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((
|
|
2628
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((d) => d.status === "aborted" ? x : (d.status === "dirty" && t.dirty(), o(d.value).then(() => ({ status: t.value, value: d.value }))));
|
|
2629
2629
|
}
|
|
2630
2630
|
if (r.type === "transform")
|
|
2631
2631
|
if (s.common.async === !1) {
|
|
@@ -2634,14 +2634,14 @@ class q extends S {
|
|
|
2634
2634
|
path: s.path,
|
|
2635
2635
|
parent: s
|
|
2636
2636
|
});
|
|
2637
|
-
if (!
|
|
2637
|
+
if (!tt(o))
|
|
2638
2638
|
return o;
|
|
2639
|
-
const
|
|
2640
|
-
if (
|
|
2639
|
+
const d = r.transform(o.value, a);
|
|
2640
|
+
if (d instanceof Promise)
|
|
2641
2641
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2642
|
-
return { status: t.value, value:
|
|
2642
|
+
return { status: t.value, value: d };
|
|
2643
2643
|
} else
|
|
2644
|
-
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) =>
|
|
2644
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => tt(o) ? Promise.resolve(r.transform(o.value, a)).then((d) => ({ status: t.value, value: d })) : o);
|
|
2645
2645
|
N.assertNever(r);
|
|
2646
2646
|
}
|
|
2647
2647
|
}
|
|
@@ -2683,7 +2683,7 @@ ge.create = (n, e) => new ge({
|
|
|
2683
2683
|
typeName: w.ZodNullable,
|
|
2684
2684
|
...T(e)
|
|
2685
2685
|
});
|
|
2686
|
-
class
|
|
2686
|
+
class pt extends S {
|
|
2687
2687
|
_parse(e) {
|
|
2688
2688
|
const { ctx: t } = this._processInputParams(e);
|
|
2689
2689
|
let s = t.data;
|
|
@@ -2697,13 +2697,13 @@ class ht extends S {
|
|
|
2697
2697
|
return this._def.innerType;
|
|
2698
2698
|
}
|
|
2699
2699
|
}
|
|
2700
|
-
|
|
2700
|
+
pt.create = (n, e) => new pt({
|
|
2701
2701
|
innerType: n,
|
|
2702
2702
|
typeName: w.ZodDefault,
|
|
2703
2703
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2704
2704
|
...T(e)
|
|
2705
2705
|
});
|
|
2706
|
-
class
|
|
2706
|
+
class ht extends S {
|
|
2707
2707
|
_parse(e) {
|
|
2708
2708
|
const { ctx: t } = this._processInputParams(e), s = {
|
|
2709
2709
|
...t,
|
|
@@ -2718,7 +2718,7 @@ class ft extends S {
|
|
|
2718
2718
|
...s
|
|
2719
2719
|
}
|
|
2720
2720
|
});
|
|
2721
|
-
return
|
|
2721
|
+
return nt(r) ? r.then((a) => ({
|
|
2722
2722
|
status: "valid",
|
|
2723
2723
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
2724
2724
|
get error() {
|
|
@@ -2740,7 +2740,7 @@ class ft extends S {
|
|
|
2740
2740
|
return this._def.innerType;
|
|
2741
2741
|
}
|
|
2742
2742
|
}
|
|
2743
|
-
|
|
2743
|
+
ht.create = (n, e) => new ht({
|
|
2744
2744
|
innerType: n,
|
|
2745
2745
|
typeName: w.ZodCatch,
|
|
2746
2746
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
@@ -2764,7 +2764,7 @@ Lt.create = (n) => new Lt({
|
|
|
2764
2764
|
...T(n)
|
|
2765
2765
|
});
|
|
2766
2766
|
const vs = Symbol("zod_brand");
|
|
2767
|
-
class
|
|
2767
|
+
class dn extends S {
|
|
2768
2768
|
_parse(e) {
|
|
2769
2769
|
const { ctx: t } = this._processInputParams(e), s = t.data;
|
|
2770
2770
|
return this._def.type._parse({
|
|
@@ -2777,7 +2777,7 @@ class cn extends S {
|
|
|
2777
2777
|
return this._def.type;
|
|
2778
2778
|
}
|
|
2779
2779
|
}
|
|
2780
|
-
class
|
|
2780
|
+
class Nt extends S {
|
|
2781
2781
|
_parse(e) {
|
|
2782
2782
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
2783
2783
|
if (s.common.async)
|
|
@@ -2810,35 +2810,35 @@ class Ct extends S {
|
|
|
2810
2810
|
}
|
|
2811
2811
|
}
|
|
2812
2812
|
static create(e, t) {
|
|
2813
|
-
return new
|
|
2813
|
+
return new Nt({
|
|
2814
2814
|
in: e,
|
|
2815
2815
|
out: t,
|
|
2816
2816
|
typeName: w.ZodPipeline
|
|
2817
2817
|
});
|
|
2818
2818
|
}
|
|
2819
2819
|
}
|
|
2820
|
-
class
|
|
2820
|
+
class ft extends S {
|
|
2821
2821
|
_parse(e) {
|
|
2822
|
-
const t = this._def.innerType._parse(e), s = (r) => (
|
|
2823
|
-
return
|
|
2822
|
+
const t = this._def.innerType._parse(e), s = (r) => (tt(r) && (r.value = Object.freeze(r.value)), r);
|
|
2823
|
+
return nt(t) ? t.then((r) => s(r)) : s(t);
|
|
2824
2824
|
}
|
|
2825
2825
|
unwrap() {
|
|
2826
2826
|
return this._def.innerType;
|
|
2827
2827
|
}
|
|
2828
2828
|
}
|
|
2829
|
-
|
|
2829
|
+
ft.create = (n, e) => new ft({
|
|
2830
2830
|
innerType: n,
|
|
2831
2831
|
typeName: w.ZodReadonly,
|
|
2832
2832
|
...T(e)
|
|
2833
2833
|
});
|
|
2834
|
-
function
|
|
2835
|
-
return n ?
|
|
2834
|
+
function Sn(n, e = {}, t) {
|
|
2835
|
+
return n ? Be.create().superRefine((s, r) => {
|
|
2836
2836
|
var a, o;
|
|
2837
2837
|
if (!n(s)) {
|
|
2838
|
-
const
|
|
2839
|
-
r.addIssue({ code: "custom", ...u, fatal:
|
|
2838
|
+
const d = typeof e == "function" ? e(s) : typeof e == "string" ? { message: e } : e, c = (o = (a = d.fatal) !== null && a !== void 0 ? a : t) !== null && o !== void 0 ? o : !0, u = typeof d == "string" ? { message: d } : d;
|
|
2839
|
+
r.addIssue({ code: "custom", ...u, fatal: c });
|
|
2840
2840
|
}
|
|
2841
|
-
}) :
|
|
2841
|
+
}) : Be.create();
|
|
2842
2842
|
}
|
|
2843
2843
|
const ws = {
|
|
2844
2844
|
object: I.lazycreate
|
|
@@ -2849,10 +2849,10 @@ var w;
|
|
|
2849
2849
|
})(w || (w = {}));
|
|
2850
2850
|
const bs = (n, e = {
|
|
2851
2851
|
message: `Input not instance of ${n.name}`
|
|
2852
|
-
}) =>
|
|
2852
|
+
}) => Sn((t) => t instanceof n, e), Zn = F.create, jn = fe.create, ks = Lt.create, xs = me.create, Nn = st.create, Ts = je.create, Os = Pt.create, Ss = rt.create, Zs = at.create, js = Be.create, Ns = Se.create, Cs = re.create, Is = Dt.create, Es = B.create, As = I.create, Rs = I.strictCreate, $s = it.create, Ps = Jt.create, Ds = ot.create, Ms = ee.create, Ls = dt.create, Vs = Mt.create, Us = Ne.create, Fs = Ue.create, zs = ct.create, Bs = ut.create, Ws = _e.create, qs = lt.create, Js = We.create, fn = q.create, Ks = Y.create, Hs = ge.create, Qs = q.createWithPreprocess, Ys = Nt.create, Gs = () => Zn().optional(), Xs = () => jn().optional(), er = () => Nn().optional(), tr = {
|
|
2853
2853
|
string: (n) => F.create({ ...n, coerce: !0 }),
|
|
2854
2854
|
number: (n) => fe.create({ ...n, coerce: !0 }),
|
|
2855
|
-
boolean: (n) =>
|
|
2855
|
+
boolean: (n) => st.create({
|
|
2856
2856
|
...n,
|
|
2857
2857
|
coerce: !0
|
|
2858
2858
|
}),
|
|
@@ -2861,7 +2861,7 @@ const bs = (n, e = {
|
|
|
2861
2861
|
}, nr = x;
|
|
2862
2862
|
var i = /* @__PURE__ */ Object.freeze({
|
|
2863
2863
|
__proto__: null,
|
|
2864
|
-
defaultErrorMap:
|
|
2864
|
+
defaultErrorMap: ze,
|
|
2865
2865
|
setErrorMap: ns,
|
|
2866
2866
|
getErrorMap: Et,
|
|
2867
2867
|
makeIssue: At,
|
|
@@ -2873,8 +2873,8 @@ var i = /* @__PURE__ */ Object.freeze({
|
|
|
2873
2873
|
OK: D,
|
|
2874
2874
|
isAborted: en,
|
|
2875
2875
|
isDirty: tn,
|
|
2876
|
-
isValid:
|
|
2877
|
-
isAsync:
|
|
2876
|
+
isValid: tt,
|
|
2877
|
+
isAsync: nt,
|
|
2878
2878
|
get util() {
|
|
2879
2879
|
return N;
|
|
2880
2880
|
},
|
|
@@ -2884,46 +2884,46 @@ var i = /* @__PURE__ */ Object.freeze({
|
|
|
2884
2884
|
ZodParsedType: _,
|
|
2885
2885
|
getParsedType: pe,
|
|
2886
2886
|
ZodType: S,
|
|
2887
|
-
datetimeRegex:
|
|
2887
|
+
datetimeRegex: Tn,
|
|
2888
2888
|
ZodString: F,
|
|
2889
2889
|
ZodNumber: fe,
|
|
2890
2890
|
ZodBigInt: me,
|
|
2891
|
-
ZodBoolean:
|
|
2891
|
+
ZodBoolean: st,
|
|
2892
2892
|
ZodDate: je,
|
|
2893
2893
|
ZodSymbol: Pt,
|
|
2894
|
-
ZodUndefined:
|
|
2895
|
-
ZodNull:
|
|
2896
|
-
ZodAny:
|
|
2894
|
+
ZodUndefined: rt,
|
|
2895
|
+
ZodNull: at,
|
|
2896
|
+
ZodAny: Be,
|
|
2897
2897
|
ZodUnknown: Se,
|
|
2898
2898
|
ZodNever: re,
|
|
2899
2899
|
ZodVoid: Dt,
|
|
2900
2900
|
ZodArray: B,
|
|
2901
2901
|
ZodObject: I,
|
|
2902
|
-
ZodUnion:
|
|
2902
|
+
ZodUnion: it,
|
|
2903
2903
|
ZodDiscriminatedUnion: Jt,
|
|
2904
|
-
ZodIntersection:
|
|
2904
|
+
ZodIntersection: ot,
|
|
2905
2905
|
ZodTuple: ee,
|
|
2906
2906
|
ZodRecord: dt,
|
|
2907
2907
|
ZodMap: Mt,
|
|
2908
2908
|
ZodSet: Ne,
|
|
2909
|
-
ZodFunction:
|
|
2910
|
-
ZodLazy:
|
|
2911
|
-
ZodLiteral:
|
|
2909
|
+
ZodFunction: Ue,
|
|
2910
|
+
ZodLazy: ct,
|
|
2911
|
+
ZodLiteral: ut,
|
|
2912
2912
|
ZodEnum: _e,
|
|
2913
|
-
ZodNativeEnum:
|
|
2914
|
-
ZodPromise:
|
|
2913
|
+
ZodNativeEnum: lt,
|
|
2914
|
+
ZodPromise: We,
|
|
2915
2915
|
ZodEffects: q,
|
|
2916
2916
|
ZodTransformer: q,
|
|
2917
2917
|
ZodOptional: Y,
|
|
2918
2918
|
ZodNullable: ge,
|
|
2919
|
-
ZodDefault:
|
|
2920
|
-
ZodCatch:
|
|
2919
|
+
ZodDefault: pt,
|
|
2920
|
+
ZodCatch: ht,
|
|
2921
2921
|
ZodNaN: Lt,
|
|
2922
2922
|
BRAND: vs,
|
|
2923
|
-
ZodBranded:
|
|
2924
|
-
ZodPipeline:
|
|
2925
|
-
ZodReadonly:
|
|
2926
|
-
custom:
|
|
2923
|
+
ZodBranded: dn,
|
|
2924
|
+
ZodPipeline: Nt,
|
|
2925
|
+
ZodReadonly: ft,
|
|
2926
|
+
custom: Sn,
|
|
2927
2927
|
Schema: S,
|
|
2928
2928
|
ZodSchema: S,
|
|
2929
2929
|
late: ws,
|
|
@@ -2934,10 +2934,10 @@ var i = /* @__PURE__ */ Object.freeze({
|
|
|
2934
2934
|
any: js,
|
|
2935
2935
|
array: Es,
|
|
2936
2936
|
bigint: xs,
|
|
2937
|
-
boolean:
|
|
2937
|
+
boolean: Nn,
|
|
2938
2938
|
date: Ts,
|
|
2939
2939
|
discriminatedUnion: Ps,
|
|
2940
|
-
effect:
|
|
2940
|
+
effect: fn,
|
|
2941
2941
|
enum: Ws,
|
|
2942
2942
|
function: Fs,
|
|
2943
2943
|
instanceof: bs,
|
|
@@ -2950,7 +2950,7 @@ var i = /* @__PURE__ */ Object.freeze({
|
|
|
2950
2950
|
never: Cs,
|
|
2951
2951
|
null: Zs,
|
|
2952
2952
|
nullable: Hs,
|
|
2953
|
-
number:
|
|
2953
|
+
number: jn,
|
|
2954
2954
|
object: As,
|
|
2955
2955
|
oboolean: er,
|
|
2956
2956
|
onumber: Xs,
|
|
@@ -2962,9 +2962,9 @@ var i = /* @__PURE__ */ Object.freeze({
|
|
|
2962
2962
|
record: Ls,
|
|
2963
2963
|
set: Us,
|
|
2964
2964
|
strictObject: Rs,
|
|
2965
|
-
string:
|
|
2965
|
+
string: Zn,
|
|
2966
2966
|
symbol: Os,
|
|
2967
|
-
transformer:
|
|
2967
|
+
transformer: fn,
|
|
2968
2968
|
tuple: Ms,
|
|
2969
2969
|
undefined: Ss,
|
|
2970
2970
|
union: $s,
|
|
@@ -2981,7 +2981,7 @@ i.object({
|
|
|
2981
2981
|
limit: i.number(),
|
|
2982
2982
|
length: i.number()
|
|
2983
2983
|
});
|
|
2984
|
-
const
|
|
2984
|
+
const cn = i.object({
|
|
2985
2985
|
created_at: i.string(),
|
|
2986
2986
|
updated_at: i.string()
|
|
2987
2987
|
}), sr = i.object({
|
|
@@ -3002,7 +3002,7 @@ const dn = i.object({
|
|
|
3002
3002
|
access_token_secret: i.string().optional(),
|
|
3003
3003
|
refresh_token: i.string().optional(),
|
|
3004
3004
|
profileData: sr.optional()
|
|
3005
|
-
}),
|
|
3005
|
+
}), Cn = i.object({
|
|
3006
3006
|
email: i.string().optional(),
|
|
3007
3007
|
username: i.string().optional(),
|
|
3008
3008
|
given_name: i.string().optional(),
|
|
@@ -3014,7 +3014,7 @@ const dn = i.object({
|
|
|
3014
3014
|
linked_to: i.string().optional(),
|
|
3015
3015
|
profileData: i.string().optional(),
|
|
3016
3016
|
user_id: i.string().optional()
|
|
3017
|
-
}), ar =
|
|
3017
|
+
}), ar = Cn.extend({
|
|
3018
3018
|
email_verified: i.boolean().default(!1),
|
|
3019
3019
|
verify_email: i.boolean().optional(),
|
|
3020
3020
|
last_ip: i.string().optional(),
|
|
@@ -3023,7 +3023,7 @@ const dn = i.object({
|
|
|
3023
3023
|
provider: i.string().default("email"),
|
|
3024
3024
|
connection: i.string().default("email")
|
|
3025
3025
|
});
|
|
3026
|
-
ar.extend(
|
|
3026
|
+
ar.extend(cn.shape).extend({
|
|
3027
3027
|
user_id: i.string(),
|
|
3028
3028
|
// TODO: this not might be correct if you use the username
|
|
3029
3029
|
email: i.string(),
|
|
@@ -3031,7 +3031,7 @@ ar.extend(dn.shape).extend({
|
|
|
3031
3031
|
login_count: i.number(),
|
|
3032
3032
|
identities: i.array(rr).optional()
|
|
3033
3033
|
});
|
|
3034
|
-
|
|
3034
|
+
Cn.extend({
|
|
3035
3035
|
email: i.string(),
|
|
3036
3036
|
login_count: i.number(),
|
|
3037
3037
|
multifactor: i.array(i.string()).optional(),
|
|
@@ -3046,7 +3046,7 @@ let or = (n = 21) => {
|
|
|
3046
3046
|
e += ir[t[n] & 63];
|
|
3047
3047
|
return e;
|
|
3048
3048
|
};
|
|
3049
|
-
const
|
|
3049
|
+
const dr = i.object({
|
|
3050
3050
|
audience: i.string().optional(),
|
|
3051
3051
|
recipient: i.string().optional(),
|
|
3052
3052
|
createUpnClaim: i.boolean().optional(),
|
|
@@ -3063,7 +3063,7 @@ const cr = i.object({
|
|
|
3063
3063
|
nameIdentifierProbes: i.array(i.string()).optional(),
|
|
3064
3064
|
authnContextClassRef: i.string().optional(),
|
|
3065
3065
|
mappings: i.record(i.string()).optional()
|
|
3066
|
-
}),
|
|
3066
|
+
}), cr = i.object({
|
|
3067
3067
|
id: i.string(),
|
|
3068
3068
|
name: i.string(),
|
|
3069
3069
|
callbacks: i.array(i.string()).default([]).optional().openapi({
|
|
@@ -3082,7 +3082,7 @@ const cr = i.object({
|
|
|
3082
3082
|
description: "Ids of clients that will be allowed to perform delegation requests. Clients that will be allowed to make delegation request. By default, all your clients will be allowed. This field allows you to specify specific clients"
|
|
3083
3083
|
}),
|
|
3084
3084
|
addons: i.object({
|
|
3085
|
-
samlp:
|
|
3085
|
+
samlp: dr.optional()
|
|
3086
3086
|
}).default({}).optional().openapi({
|
|
3087
3087
|
description: "Addons associated with the client. The key is the addon's package name and the value is an object with the configuration for the addon."
|
|
3088
3088
|
}),
|
|
@@ -3096,20 +3096,20 @@ const cr = i.object({
|
|
|
3096
3096
|
}), ur = i.object({
|
|
3097
3097
|
created_at: i.string().transform((n) => n === null ? "" : n),
|
|
3098
3098
|
updated_at: i.string().transform((n) => n === null ? "" : n),
|
|
3099
|
-
...
|
|
3099
|
+
...cr.shape
|
|
3100
3100
|
});
|
|
3101
|
-
var
|
|
3101
|
+
var In = /* @__PURE__ */ ((n) => (n.TOKEN = "token", n.TOKEN_ID_TOKEN = "token id_token", n.CODE = "code", n))(In || {}), En = /* @__PURE__ */ ((n) => (n.QUERY = "query", n.FRAGMENT = "fragment", n.FORM_POST = "form_post", n.WEB_MESSAGE = "web_message", n.SAML_POST = "saml_post", n))(En || {}), An = /* @__PURE__ */ ((n) => (n.S265 = "S256", n.plain = "plain", n))(An || {});
|
|
3102
3102
|
const lr = i.object({
|
|
3103
3103
|
client_id: i.string(),
|
|
3104
3104
|
vendor_id: i.string().optional(),
|
|
3105
|
-
response_type: i.nativeEnum(
|
|
3106
|
-
response_mode: i.nativeEnum(
|
|
3105
|
+
response_type: i.nativeEnum(In).optional(),
|
|
3106
|
+
response_mode: i.nativeEnum(En).optional(),
|
|
3107
3107
|
redirect_uri: i.string().optional(),
|
|
3108
3108
|
audience: i.string().optional(),
|
|
3109
3109
|
state: i.string().optional(),
|
|
3110
3110
|
nonce: i.string().optional(),
|
|
3111
3111
|
scope: i.string().optional(),
|
|
3112
|
-
code_challenge_method: i.nativeEnum(
|
|
3112
|
+
code_challenge_method: i.nativeEnum(An).optional(),
|
|
3113
3113
|
code_challenge: i.string().optional(),
|
|
3114
3114
|
username: i.string().optional()
|
|
3115
3115
|
});
|
|
@@ -3150,13 +3150,18 @@ const pr = i.object({
|
|
|
3150
3150
|
client_id: i.string().optional(),
|
|
3151
3151
|
client_secret: i.string().optional(),
|
|
3152
3152
|
app_secret: i.string().optional(),
|
|
3153
|
-
scope: i.string().optional()
|
|
3153
|
+
scope: i.string().optional(),
|
|
3154
|
+
authorization_endpoint: i.string().default("").optional(),
|
|
3155
|
+
token_endpoint: i.string().default("").optional(),
|
|
3156
|
+
userinfo_endpoint: i.string().default("").optional(),
|
|
3157
|
+
jwks_uri: i.string().default("").optional(),
|
|
3158
|
+
discovery_url: i.string().default("").optional(),
|
|
3159
|
+
issuer: i.string().default("").optional()
|
|
3154
3160
|
}).default({}).optional(),
|
|
3155
3161
|
enabled_clients: i.array(i.string()).default([]).optional(),
|
|
3156
|
-
authorization_endpoint: i.string().default("").optional(),
|
|
3157
3162
|
response_type: i.custom().optional(),
|
|
3158
3163
|
response_mode: i.custom().optional()
|
|
3159
|
-
}),
|
|
3164
|
+
}), Rn = i.object({
|
|
3160
3165
|
id: i.string(),
|
|
3161
3166
|
created_at: i.string().transform((n) => n === null ? "" : n),
|
|
3162
3167
|
updated_at: i.string().transform((n) => n === null ? "" : n)
|
|
@@ -3205,7 +3210,7 @@ i.object({
|
|
|
3205
3210
|
...ur.shape,
|
|
3206
3211
|
domains: i.array(mr),
|
|
3207
3212
|
tenant: fr,
|
|
3208
|
-
connections: i.array(
|
|
3213
|
+
connections: i.array(Rn)
|
|
3209
3214
|
});
|
|
3210
3215
|
const _r = i.enum([
|
|
3211
3216
|
"password_reset",
|
|
@@ -3238,7 +3243,7 @@ const _r = i.enum([
|
|
|
3238
3243
|
email_api_key: i.string().optional(),
|
|
3239
3244
|
email_service: i.enum(["mailgun", "mailchannels"])
|
|
3240
3245
|
});
|
|
3241
|
-
|
|
3246
|
+
cn.extend({
|
|
3242
3247
|
...vr.shape,
|
|
3243
3248
|
id: i.string()
|
|
3244
3249
|
});
|
|
@@ -3255,7 +3260,7 @@ const wr = i.object({
|
|
|
3255
3260
|
priority: i.number().optional()
|
|
3256
3261
|
});
|
|
3257
3262
|
wr.extend({
|
|
3258
|
-
...
|
|
3263
|
+
...cn.shape,
|
|
3259
3264
|
hook_id: i.string()
|
|
3260
3265
|
});
|
|
3261
3266
|
const br = i.object({
|
|
@@ -3440,8 +3445,8 @@ i.object({
|
|
|
3440
3445
|
revoked: i.boolean().optional().openapi({ description: "True if the key is revoked" }),
|
|
3441
3446
|
revoked_at: i.string().optional().openapi({ description: "The date and time when the key was revoked" })
|
|
3442
3447
|
});
|
|
3443
|
-
var
|
|
3444
|
-
const un = i.nativeEnum(
|
|
3448
|
+
var $n = /* @__PURE__ */ ((n) => (n.RefreshToken = "refresh_token", n.AuthorizationCode = "authorization_code", n.ClientCredential = "client_credentials", n.Passwordless = "passwordless", n.Password = "password", n))($n || {});
|
|
3449
|
+
const un = i.nativeEnum($n);
|
|
3445
3450
|
i.object({
|
|
3446
3451
|
grant_type: un.refine(
|
|
3447
3452
|
(n) => n === "authorization_code"
|
|
@@ -3514,19 +3519,19 @@ const jr = i.object({
|
|
|
3514
3519
|
success: i.string(),
|
|
3515
3520
|
widget_background: i.string(),
|
|
3516
3521
|
widget_border: i.string()
|
|
3517
|
-
}),
|
|
3522
|
+
}), De = i.object({
|
|
3518
3523
|
bold: i.boolean(),
|
|
3519
3524
|
size: i.number()
|
|
3520
3525
|
}), Cr = i.object({
|
|
3521
|
-
body_text:
|
|
3522
|
-
buttons_text:
|
|
3526
|
+
body_text: De,
|
|
3527
|
+
buttons_text: De,
|
|
3523
3528
|
font_url: i.string(),
|
|
3524
|
-
input_labels:
|
|
3525
|
-
links:
|
|
3529
|
+
input_labels: De,
|
|
3530
|
+
links: De,
|
|
3526
3531
|
links_style: i.enum(["normal"]),
|
|
3527
3532
|
reference_text_size: i.number(),
|
|
3528
|
-
subtitle:
|
|
3529
|
-
title:
|
|
3533
|
+
subtitle: De,
|
|
3534
|
+
title: De
|
|
3530
3535
|
}), Ir = i.object({
|
|
3531
3536
|
background_color: i.string(),
|
|
3532
3537
|
background_image_url: i.string(),
|
|
@@ -3560,7 +3565,7 @@ function ln(n) {
|
|
|
3560
3565
|
throw new Error(`Invalid user_id: ${n}`);
|
|
3561
3566
|
return { connection: e, id: t };
|
|
3562
3567
|
}
|
|
3563
|
-
function
|
|
3568
|
+
function Pn(n) {
|
|
3564
3569
|
let e = {};
|
|
3565
3570
|
try {
|
|
3566
3571
|
e = JSON.parse(n.profileData || "{}");
|
|
@@ -3587,7 +3592,7 @@ function $r(n) {
|
|
|
3587
3592
|
]);
|
|
3588
3593
|
if (!s)
|
|
3589
3594
|
return null;
|
|
3590
|
-
const { tenant_id: a, ...o } = s,
|
|
3595
|
+
const { tenant_id: a, ...o } = s, d = {
|
|
3591
3596
|
...o,
|
|
3592
3597
|
email: s.email || "",
|
|
3593
3598
|
email_verified: s.email_verified === 1,
|
|
@@ -3599,21 +3604,21 @@ function $r(n) {
|
|
|
3599
3604
|
user_id: ln(s.user_id).id,
|
|
3600
3605
|
isSocial: !!s.is_social
|
|
3601
3606
|
},
|
|
3602
|
-
...r.map(
|
|
3607
|
+
...r.map(Pn)
|
|
3603
3608
|
]
|
|
3604
3609
|
};
|
|
3605
|
-
return R(
|
|
3610
|
+
return R(d);
|
|
3606
3611
|
};
|
|
3607
3612
|
}
|
|
3608
3613
|
function Ee(n, e, t, s) {
|
|
3609
3614
|
return t.split(/\s+/).map((a) => a.replace(/^([^:]+)=/g, "$1:")).map((a) => {
|
|
3610
|
-
let o = a.startsWith("-"),
|
|
3611
|
-
return a.startsWith("-_exists_:") ? (
|
|
3612
|
-
}).forEach(({ key: a, value: o, isNegation:
|
|
3615
|
+
let o = a.startsWith("-"), d, c, u, l;
|
|
3616
|
+
return a.startsWith("-_exists_:") ? (d = a.substring(10), u = !0, o = !0) : a.startsWith("_exists_:") ? (d = a.substring(9), u = !0, o = !1) : a.includes(":") ? (o = a.startsWith("-"), [d, c] = o ? a.substring(1).split(":") : a.split(":"), u = !1, c.startsWith(">=") ? (l = ">=", c = c.substring(2)) : c.startsWith(">") ? (l = ">", c = c.substring(1)) : c.startsWith("<=") ? (console.log("value", c), l = "<=", c = c.substring(2)) : c.startsWith("<") ? (l = "<", c = c.substring(1)) : l = "=") : (d = null, c = a, u = !1), { key: d, value: c, isNegation: o, isExistsQuery: u, operator: l };
|
|
3617
|
+
}).forEach(({ key: a, value: o, isNegation: d, isExistsQuery: c, operator: u }) => {
|
|
3613
3618
|
if (a)
|
|
3614
|
-
if (
|
|
3615
|
-
|
|
3616
|
-
else if (
|
|
3619
|
+
if (c)
|
|
3620
|
+
d ? e = e.where(a, "is", null) : e = e.where(a, "is not", null);
|
|
3621
|
+
else if (d)
|
|
3617
3622
|
switch (u) {
|
|
3618
3623
|
case ">":
|
|
3619
3624
|
e = e.where(a, "<=", o);
|
|
@@ -3652,8 +3657,8 @@ function Pr(n) {
|
|
|
3652
3657
|
const { ref: l } = n.dynamic;
|
|
3653
3658
|
s = s.orderBy(l(t.sort.sort_by), t.sort.sort_order);
|
|
3654
3659
|
}
|
|
3655
|
-
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), o = a.map((l) => l.user_id),
|
|
3656
|
-
const j =
|
|
3660
|
+
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), o = a.map((l) => l.user_id), d = o.length ? await n.selectFrom("users").selectAll().where("users.tenant_id", "=", e).where("users.linked_to", "in", o).execute() : [], c = a.map((l) => {
|
|
3661
|
+
const j = d.filter(
|
|
3657
3662
|
(A) => A.linked_to === l.user_id
|
|
3658
3663
|
);
|
|
3659
3664
|
return R({
|
|
@@ -3667,12 +3672,12 @@ function Pr(n) {
|
|
|
3667
3672
|
user_id: ln(l.user_id).id,
|
|
3668
3673
|
isSocial: !!l.is_social
|
|
3669
3674
|
},
|
|
3670
|
-
...j.map(
|
|
3675
|
+
...j.map(Pn)
|
|
3671
3676
|
]
|
|
3672
3677
|
});
|
|
3673
3678
|
}), { count: u } = await s.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
3674
3679
|
return {
|
|
3675
|
-
users:
|
|
3680
|
+
users: c,
|
|
3676
3681
|
start: t.page * t.per_page,
|
|
3677
3682
|
limit: t.per_page,
|
|
3678
3683
|
length: ke(u)
|
|
@@ -3741,16 +3746,16 @@ function Wr(n) {
|
|
|
3741
3746
|
return async (e) => {
|
|
3742
3747
|
let t = n.selectFrom("tenants");
|
|
3743
3748
|
if (e.sort && e.sort.sort_by) {
|
|
3744
|
-
const { ref:
|
|
3745
|
-
t = t.orderBy(
|
|
3749
|
+
const { ref: d } = n.dynamic;
|
|
3750
|
+
t = t.orderBy(d(e.sort.sort_by), e.sort.sort_order);
|
|
3746
3751
|
}
|
|
3747
|
-
e.q && (t = t.where((
|
|
3752
|
+
e.q && (t = t.where((d) => d.or([d("name", "like", `%${e.q}%`)])));
|
|
3748
3753
|
const r = await t.offset(e.page * e.per_page).limit(e.per_page).selectAll().execute();
|
|
3749
3754
|
if (!e.include_totals)
|
|
3750
3755
|
return {
|
|
3751
3756
|
tenants: r
|
|
3752
3757
|
};
|
|
3753
|
-
const { count: a } = await t.select((
|
|
3758
|
+
const { count: a } = await t.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), o = ke(a);
|
|
3754
3759
|
return {
|
|
3755
3760
|
tenants: r.map(R),
|
|
3756
3761
|
start: (e.page - 1) * e.per_page,
|
|
@@ -3781,7 +3786,7 @@ function Kr(n) {
|
|
|
3781
3786
|
remove: Jr(n)
|
|
3782
3787
|
};
|
|
3783
3788
|
}
|
|
3784
|
-
function
|
|
3789
|
+
function mn(n) {
|
|
3785
3790
|
return n ? JSON.stringify(n) : void 0;
|
|
3786
3791
|
}
|
|
3787
3792
|
const Hr = 1024;
|
|
@@ -3800,12 +3805,12 @@ function Qr(n) {
|
|
|
3800
3805
|
isMobile: t.isMobile ? 1 : 0,
|
|
3801
3806
|
tenant_id: e,
|
|
3802
3807
|
scope: (a = t.scope) == null ? void 0 : a.join(","),
|
|
3803
|
-
auth0_client:
|
|
3804
|
-
details: (o =
|
|
3808
|
+
auth0_client: mn(t.auth0_client),
|
|
3809
|
+
details: (o = mn(t.details)) == null ? void 0 : o.substring(0, 8192)
|
|
3805
3810
|
}).execute(), s;
|
|
3806
3811
|
};
|
|
3807
3812
|
}
|
|
3808
|
-
function
|
|
3813
|
+
function _n(n) {
|
|
3809
3814
|
if (!n)
|
|
3810
3815
|
return "";
|
|
3811
3816
|
try {
|
|
@@ -3814,13 +3819,13 @@ function gn(n) {
|
|
|
3814
3819
|
return n;
|
|
3815
3820
|
}
|
|
3816
3821
|
}
|
|
3817
|
-
function
|
|
3822
|
+
function Dn(n) {
|
|
3818
3823
|
return {
|
|
3819
3824
|
...n,
|
|
3820
3825
|
client_id: n.client_id,
|
|
3821
3826
|
client_name: "",
|
|
3822
|
-
auth0_client:
|
|
3823
|
-
details:
|
|
3827
|
+
auth0_client: _n(n.auth0_client),
|
|
3828
|
+
details: _n(n.details),
|
|
3824
3829
|
isMobile: !!n.isMobile,
|
|
3825
3830
|
scope: n.scope ? n.scope.split(",") : void 0,
|
|
3826
3831
|
log_id: n.id,
|
|
@@ -3833,16 +3838,16 @@ function Yr(n) {
|
|
|
3833
3838
|
t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
|
|
3834
3839
|
let r = s;
|
|
3835
3840
|
if (t.sort && t.sort.sort_by) {
|
|
3836
|
-
const { ref:
|
|
3841
|
+
const { ref: d } = n.dynamic;
|
|
3837
3842
|
r = r.orderBy(
|
|
3838
|
-
|
|
3843
|
+
d(t.sort.sort_by),
|
|
3839
3844
|
t.sort.sort_order
|
|
3840
3845
|
);
|
|
3841
3846
|
}
|
|
3842
3847
|
r = r.offset(t.page * t.per_page).limit(t.per_page);
|
|
3843
|
-
const a = await r.selectAll().execute(), { count: o } = await s.select((
|
|
3848
|
+
const a = await r.selectAll().execute(), { count: o } = await s.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
3844
3849
|
return {
|
|
3845
|
-
logs: a.map(
|
|
3850
|
+
logs: a.map(Dn),
|
|
3846
3851
|
start: t.page * t.per_page,
|
|
3847
3852
|
limit: t.per_page,
|
|
3848
3853
|
length: ke(o)
|
|
@@ -3852,7 +3857,7 @@ function Yr(n) {
|
|
|
3852
3857
|
function Gr(n) {
|
|
3853
3858
|
return async (e, t) => {
|
|
3854
3859
|
const s = await n.selectFrom("logs").where("logs.tenant_id", "=", e).where("logs.id", "=", t).selectAll().executeTakeFirst();
|
|
3855
|
-
return s ?
|
|
3860
|
+
return s ? Dn(s) : null;
|
|
3856
3861
|
};
|
|
3857
3862
|
}
|
|
3858
3863
|
function Xr(n) {
|
|
@@ -3887,19 +3892,19 @@ function ra(n) {
|
|
|
3887
3892
|
t.q && (s = Ee(n, s, t.q, ["user_id", "session_id"]));
|
|
3888
3893
|
let r = s;
|
|
3889
3894
|
if (t.sort && t.sort.sort_by) {
|
|
3890
|
-
const { ref:
|
|
3895
|
+
const { ref: c } = n.dynamic;
|
|
3891
3896
|
r = r.orderBy(
|
|
3892
|
-
|
|
3897
|
+
c(t.sort.sort_by),
|
|
3893
3898
|
t.sort.sort_order
|
|
3894
3899
|
);
|
|
3895
3900
|
}
|
|
3896
3901
|
r = r.offset(t.page * t.per_page).limit(t.per_page);
|
|
3897
|
-
const a = await r.selectAll().execute(), { count: o } = await s.select((
|
|
3902
|
+
const a = await r.selectAll().execute(), { count: o } = await s.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), d = ke(o);
|
|
3898
3903
|
return {
|
|
3899
3904
|
sessions: a,
|
|
3900
3905
|
start: t.page * t.per_page,
|
|
3901
3906
|
limit: t.per_page,
|
|
3902
|
-
length:
|
|
3907
|
+
length: d
|
|
3903
3908
|
};
|
|
3904
3909
|
};
|
|
3905
3910
|
}
|
|
@@ -3921,8 +3926,8 @@ function ia(n) {
|
|
|
3921
3926
|
nonce: r,
|
|
3922
3927
|
state: a,
|
|
3923
3928
|
scope: o,
|
|
3924
|
-
response_type:
|
|
3925
|
-
response_mode:
|
|
3929
|
+
response_type: d,
|
|
3930
|
+
response_mode: c,
|
|
3926
3931
|
redirect_uri: u,
|
|
3927
3932
|
...l
|
|
3928
3933
|
} = s;
|
|
@@ -3932,8 +3937,8 @@ function ia(n) {
|
|
|
3932
3937
|
nonce: r,
|
|
3933
3938
|
state: a,
|
|
3934
3939
|
scope: o,
|
|
3935
|
-
response_type:
|
|
3936
|
-
response_mode:
|
|
3940
|
+
response_type: d,
|
|
3941
|
+
response_mode: c,
|
|
3937
3942
|
redirect_uri: u
|
|
3938
3943
|
},
|
|
3939
3944
|
created_at: new Date(s.created_at),
|
|
@@ -3954,18 +3959,18 @@ function oa(n) {
|
|
|
3954
3959
|
await n.insertInto("tickets").values(r).execute();
|
|
3955
3960
|
};
|
|
3956
3961
|
}
|
|
3957
|
-
function
|
|
3962
|
+
function da(n) {
|
|
3958
3963
|
return async (e, t) => {
|
|
3959
3964
|
await n.updateTable("tickets").set({
|
|
3960
3965
|
used_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3961
3966
|
}).where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).execute();
|
|
3962
3967
|
};
|
|
3963
3968
|
}
|
|
3964
|
-
function
|
|
3969
|
+
function ca(n) {
|
|
3965
3970
|
return {
|
|
3966
3971
|
create: oa(n),
|
|
3967
3972
|
get: ia(n),
|
|
3968
|
-
remove:
|
|
3973
|
+
remove: da(n)
|
|
3969
3974
|
};
|
|
3970
3975
|
}
|
|
3971
3976
|
function ua(n) {
|
|
@@ -4004,10 +4009,10 @@ function fa(n) {
|
|
|
4004
4009
|
return async (e, t) => {
|
|
4005
4010
|
let s = n.selectFrom("codes").where("codes.tenant_id", "=", e);
|
|
4006
4011
|
t.q && (s = Ee(n, s, t.q, ["code", "login_id"]));
|
|
4007
|
-
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((
|
|
4012
|
+
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
4008
4013
|
return {
|
|
4009
|
-
codes: a.map((
|
|
4010
|
-
const { tenant_id: u, ...l } =
|
|
4014
|
+
codes: a.map((c) => {
|
|
4015
|
+
const { tenant_id: u, ...l } = c;
|
|
4011
4016
|
return yr.parse(R(l));
|
|
4012
4017
|
}),
|
|
4013
4018
|
start: t.page * t.per_page,
|
|
@@ -4053,7 +4058,7 @@ function va(n) {
|
|
|
4053
4058
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4054
4059
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4055
4060
|
...t
|
|
4056
|
-
}, r = JSON.stringify(t.allowed_origins), a = JSON.stringify(t.callbacks), o = JSON.stringify(t.web_origins),
|
|
4061
|
+
}, r = JSON.stringify(t.allowed_origins), a = JSON.stringify(t.callbacks), o = JSON.stringify(t.web_origins), d = JSON.stringify(t.allowed_logout_urls), c = JSON.stringify(t.allowed_clients);
|
|
4057
4062
|
return await n.insertInto("applications").values({
|
|
4058
4063
|
...s,
|
|
4059
4064
|
tenant_id: e,
|
|
@@ -4062,8 +4067,8 @@ function va(n) {
|
|
|
4062
4067
|
callbacks: a,
|
|
4063
4068
|
allowed_origins: r,
|
|
4064
4069
|
web_origins: o,
|
|
4065
|
-
allowed_logout_urls:
|
|
4066
|
-
allowed_clients:
|
|
4070
|
+
allowed_logout_urls: d,
|
|
4071
|
+
allowed_clients: c
|
|
4067
4072
|
}).execute(), s;
|
|
4068
4073
|
};
|
|
4069
4074
|
}
|
|
@@ -4123,7 +4128,23 @@ function Ta(n) {
|
|
|
4123
4128
|
update: xa(n)
|
|
4124
4129
|
};
|
|
4125
4130
|
}
|
|
4126
|
-
function Oa(n
|
|
4131
|
+
function Oa(n) {
|
|
4132
|
+
return async (e, t) => {
|
|
4133
|
+
const s = {
|
|
4134
|
+
id: Ae(),
|
|
4135
|
+
...t,
|
|
4136
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4137
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
4138
|
+
};
|
|
4139
|
+
return await n.insertInto("connections").values({
|
|
4140
|
+
...s,
|
|
4141
|
+
// The connection options will have many different properties depending on the strategy
|
|
4142
|
+
options: JSON.stringify(s.options || {}),
|
|
4143
|
+
tenant_id: e
|
|
4144
|
+
}).execute(), s;
|
|
4145
|
+
};
|
|
4146
|
+
}
|
|
4147
|
+
function Sa(n, e) {
|
|
4127
4148
|
var t = {};
|
|
4128
4149
|
for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && e.indexOf(s) < 0 && (t[s] = n[s]);
|
|
4129
4150
|
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -4131,30 +4152,30 @@ function Oa(n, e) {
|
|
|
4131
4152
|
e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, s[r]) && (t[s[r]] = n[s[r]]);
|
|
4132
4153
|
return t;
|
|
4133
4154
|
}
|
|
4134
|
-
function
|
|
4155
|
+
function Za(n, e) {
|
|
4135
4156
|
var t;
|
|
4136
4157
|
return ((t = n == null ? void 0 : n._def) === null || t === void 0 ? void 0 : t.typeName) === e;
|
|
4137
4158
|
}
|
|
4138
|
-
function
|
|
4159
|
+
function Qe(n, e) {
|
|
4139
4160
|
const t = n.ZodType.prototype[e];
|
|
4140
4161
|
n.ZodType.prototype[e] = function(...s) {
|
|
4141
4162
|
const r = t.apply(this, s);
|
|
4142
4163
|
return r._def.openapi = this._def.openapi, r;
|
|
4143
4164
|
};
|
|
4144
4165
|
}
|
|
4145
|
-
function
|
|
4166
|
+
function ja(n) {
|
|
4146
4167
|
if (typeof n.ZodType.prototype.openapi < "u")
|
|
4147
4168
|
return;
|
|
4148
4169
|
n.ZodType.prototype.openapi = function(r, a) {
|
|
4149
|
-
var o,
|
|
4150
|
-
const A = typeof r == "string" ? a : r, U = A ?? {}, { param: ie } = U,
|
|
4170
|
+
var o, d, c, u, l, j;
|
|
4171
|
+
const A = typeof r == "string" ? a : r, U = A ?? {}, { param: ie } = U, Re = Sa(U, ["param"]), oe = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), de = Object.assign(Object.assign(Object.assign({}, (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata), Re), !((u = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata) === null || u === void 0) && u.param || ie ? {
|
|
4151
4172
|
param: Object.assign(Object.assign({}, (j = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || j === void 0 ? void 0 : j.param), ie)
|
|
4152
|
-
} : void 0),
|
|
4153
|
-
if (
|
|
4154
|
-
const
|
|
4155
|
-
|
|
4173
|
+
} : void 0), ce = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(oe).length > 0 ? { _internal: oe } : void 0), Object.keys(de).length > 0 ? { metadata: de } : void 0) }));
|
|
4174
|
+
if (Za(this, "ZodObject")) {
|
|
4175
|
+
const $e = this.extend;
|
|
4176
|
+
ce.extend = function(...Pe) {
|
|
4156
4177
|
var K, H, Q, ue, xe, Te;
|
|
4157
|
-
const Oe =
|
|
4178
|
+
const Oe = $e.apply(this, Pe);
|
|
4158
4179
|
return Oe._def.openapi = {
|
|
4159
4180
|
_internal: {
|
|
4160
4181
|
extendedFrom: !((H = (K = this._def.openapi) === null || K === void 0 ? void 0 : K._internal) === null || H === void 0) && H.refId ? { refId: (ue = (Q = this._def.openapi) === null || Q === void 0 ? void 0 : Q._internal) === null || ue === void 0 ? void 0 : ue.refId, schema: this } : (xe = this._def.openapi) === null || xe === void 0 ? void 0 : xe._internal.extendedFrom
|
|
@@ -4163,14 +4184,14 @@ function Za(n) {
|
|
|
4163
4184
|
}, Oe;
|
|
4164
4185
|
};
|
|
4165
4186
|
}
|
|
4166
|
-
return
|
|
4167
|
-
},
|
|
4187
|
+
return ce;
|
|
4188
|
+
}, Qe(n, "optional"), Qe(n, "nullable"), Qe(n, "default"), Qe(n, "transform"), Qe(n, "refine");
|
|
4168
4189
|
const e = n.ZodObject.prototype.deepPartial;
|
|
4169
4190
|
n.ZodObject.prototype.deepPartial = function() {
|
|
4170
4191
|
const r = this._def.shape(), a = e.apply(this), o = a._def.shape();
|
|
4171
|
-
return Object.entries(o).forEach(([
|
|
4192
|
+
return Object.entries(o).forEach(([d, c]) => {
|
|
4172
4193
|
var u, l;
|
|
4173
|
-
|
|
4194
|
+
c._def.openapi = (l = (u = r[d]) === null || u === void 0 ? void 0 : u._def) === null || l === void 0 ? void 0 : l.openapi;
|
|
4174
4195
|
}), a._def.openapi = void 0, a;
|
|
4175
4196
|
};
|
|
4176
4197
|
const t = n.ZodObject.prototype.pick;
|
|
@@ -4200,9 +4221,9 @@ var C;
|
|
|
4200
4221
|
a[o] = o;
|
|
4201
4222
|
return a;
|
|
4202
4223
|
}, n.getValidEnumValues = (r) => {
|
|
4203
|
-
const a = n.objectKeys(r).filter((
|
|
4204
|
-
for (const
|
|
4205
|
-
o[
|
|
4224
|
+
const a = n.objectKeys(r).filter((d) => typeof r[r[d]] != "number"), o = {};
|
|
4225
|
+
for (const d of a)
|
|
4226
|
+
o[d] = r[d];
|
|
4206
4227
|
return n.objectValues(o);
|
|
4207
4228
|
}, n.objectValues = (r) => n.objectKeys(r).map(function(a) {
|
|
4208
4229
|
return r[a];
|
|
@@ -4288,7 +4309,7 @@ const g = C.arrayToEnum([
|
|
|
4288
4309
|
"invalid_intersection_types",
|
|
4289
4310
|
"not_multiple_of",
|
|
4290
4311
|
"not_finite"
|
|
4291
|
-
]),
|
|
4312
|
+
]), Na = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
4292
4313
|
class V extends Error {
|
|
4293
4314
|
constructor(e) {
|
|
4294
4315
|
super(), this.issues = [], this.addIssue = (s) => {
|
|
@@ -4316,10 +4337,10 @@ class V extends Error {
|
|
|
4316
4337
|
else if (o.path.length === 0)
|
|
4317
4338
|
s._errors.push(t(o));
|
|
4318
4339
|
else {
|
|
4319
|
-
let
|
|
4320
|
-
for (;
|
|
4321
|
-
const u = o.path[
|
|
4322
|
-
|
|
4340
|
+
let d = s, c = 0;
|
|
4341
|
+
for (; c < o.path.length; ) {
|
|
4342
|
+
const u = o.path[c];
|
|
4343
|
+
c === o.path.length - 1 ? (d[u] = d[u] || { _errors: [] }, d[u]._errors.push(t(o))) : d[u] = d[u] || { _errors: [] }, d = d[u], c++;
|
|
4323
4344
|
}
|
|
4324
4345
|
}
|
|
4325
4346
|
};
|
|
@@ -4349,7 +4370,7 @@ class V extends Error {
|
|
|
4349
4370
|
}
|
|
4350
4371
|
}
|
|
4351
4372
|
V.create = (n) => new V(n);
|
|
4352
|
-
const
|
|
4373
|
+
const qe = (n, e) => {
|
|
4353
4374
|
let t;
|
|
4354
4375
|
switch (n.code) {
|
|
4355
4376
|
case h.invalid_type:
|
|
@@ -4405,12 +4426,12 @@ const Je = (n, e) => {
|
|
|
4405
4426
|
}
|
|
4406
4427
|
return { message: t };
|
|
4407
4428
|
};
|
|
4408
|
-
let
|
|
4409
|
-
function
|
|
4410
|
-
|
|
4429
|
+
let Mn = qe;
|
|
4430
|
+
function Ca(n) {
|
|
4431
|
+
Mn = n;
|
|
4411
4432
|
}
|
|
4412
4433
|
function Vt() {
|
|
4413
|
-
return
|
|
4434
|
+
return Mn;
|
|
4414
4435
|
}
|
|
4415
4436
|
const Ut = (n) => {
|
|
4416
4437
|
const { data: e, path: t, errorMaps: s, issueData: r } = n, a = [...t, ...r.path || []], o = {
|
|
@@ -4423,16 +4444,16 @@ const Ut = (n) => {
|
|
|
4423
4444
|
path: a,
|
|
4424
4445
|
message: r.message
|
|
4425
4446
|
};
|
|
4426
|
-
let
|
|
4427
|
-
const
|
|
4428
|
-
for (const u of
|
|
4429
|
-
|
|
4447
|
+
let d = "";
|
|
4448
|
+
const c = s.filter((u) => !!u).slice().reverse();
|
|
4449
|
+
for (const u of c)
|
|
4450
|
+
d = u(o, { data: e, defaultError: d }).message;
|
|
4430
4451
|
return {
|
|
4431
4452
|
...r,
|
|
4432
4453
|
path: a,
|
|
4433
|
-
message:
|
|
4454
|
+
message: d
|
|
4434
4455
|
};
|
|
4435
|
-
},
|
|
4456
|
+
}, Ia = [];
|
|
4436
4457
|
function m(n, e) {
|
|
4437
4458
|
const t = Vt(), s = Ut({
|
|
4438
4459
|
issueData: e,
|
|
@@ -4442,7 +4463,7 @@ function m(n, e) {
|
|
|
4442
4463
|
n.common.contextualErrorMap,
|
|
4443
4464
|
n.schemaErrorMap,
|
|
4444
4465
|
t,
|
|
4445
|
-
t ===
|
|
4466
|
+
t === qe ? void 0 : qe
|
|
4446
4467
|
// then global default map
|
|
4447
4468
|
].filter((r) => !!r)
|
|
4448
4469
|
});
|
|
@@ -4491,12 +4512,12 @@ class P {
|
|
|
4491
4512
|
}
|
|
4492
4513
|
const k = Object.freeze({
|
|
4493
4514
|
status: "aborted"
|
|
4494
|
-
}),
|
|
4515
|
+
}), Ve = (n) => ({ status: "dirty", value: n }), M = (n) => ({ status: "valid", value: n }), rn = (n) => n.status === "aborted", an = (n) => n.status === "dirty", mt = (n) => n.status === "valid", _t = (n) => typeof Promise < "u" && n instanceof Promise;
|
|
4495
4516
|
function Ft(n, e, t, s) {
|
|
4496
4517
|
if (typeof e == "function" ? n !== e || !s : !e.has(n)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4497
4518
|
return e.get(n);
|
|
4498
4519
|
}
|
|
4499
|
-
function
|
|
4520
|
+
function Ln(n, e, t, s, r) {
|
|
4500
4521
|
if (typeof e == "function" ? n !== e || !r : !e.has(n)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
4501
4522
|
return e.set(n, t), t;
|
|
4502
4523
|
}
|
|
@@ -4504,7 +4525,7 @@ var v;
|
|
|
4504
4525
|
(function(n) {
|
|
4505
4526
|
n.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, n.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
4506
4527
|
})(v || (v = {}));
|
|
4507
|
-
var
|
|
4528
|
+
var Xe, et;
|
|
4508
4529
|
class te {
|
|
4509
4530
|
constructor(e, t, s, r) {
|
|
4510
4531
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = r;
|
|
@@ -4513,8 +4534,8 @@ class te {
|
|
|
4513
4534
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
4514
4535
|
}
|
|
4515
4536
|
}
|
|
4516
|
-
const
|
|
4517
|
-
if (
|
|
4537
|
+
const gn = (n, e) => {
|
|
4538
|
+
if (mt(e))
|
|
4518
4539
|
return { success: !0, data: e.value };
|
|
4519
4540
|
if (!n.common.issues.length)
|
|
4520
4541
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -4534,10 +4555,10 @@ function O(n) {
|
|
|
4534
4555
|
const { errorMap: e, invalid_type_error: t, required_error: s, description: r } = n;
|
|
4535
4556
|
if (e && (t || s))
|
|
4536
4557
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
4537
|
-
return e ? { errorMap: e, description: r } : { errorMap: (o,
|
|
4538
|
-
var
|
|
4558
|
+
return e ? { errorMap: e, description: r } : { errorMap: (o, d) => {
|
|
4559
|
+
var c, u;
|
|
4539
4560
|
const { message: l } = n;
|
|
4540
|
-
return o.code === "invalid_enum_value" ? { message: l ??
|
|
4561
|
+
return o.code === "invalid_enum_value" ? { message: l ?? d.defaultError } : typeof d.data > "u" ? { message: (c = l ?? s) !== null && c !== void 0 ? c : d.defaultError } : o.code !== "invalid_type" ? { message: d.defaultError } : { message: (u = l ?? t) !== null && u !== void 0 ? u : d.defaultError };
|
|
4541
4562
|
}, description: r };
|
|
4542
4563
|
}
|
|
4543
4564
|
class Z {
|
|
@@ -4575,7 +4596,7 @@ class Z {
|
|
|
4575
4596
|
}
|
|
4576
4597
|
_parseSync(e) {
|
|
4577
4598
|
const t = this._parse(e);
|
|
4578
|
-
if (
|
|
4599
|
+
if (_t(t))
|
|
4579
4600
|
throw new Error("Synchronous parse encountered promise.");
|
|
4580
4601
|
return t;
|
|
4581
4602
|
}
|
|
@@ -4603,7 +4624,7 @@ class Z {
|
|
|
4603
4624
|
data: e,
|
|
4604
4625
|
parsedType: he(e)
|
|
4605
4626
|
}, a = this._parseSync({ data: e, path: r.path, parent: r });
|
|
4606
|
-
return
|
|
4627
|
+
return gn(r, a);
|
|
4607
4628
|
}
|
|
4608
4629
|
async parseAsync(e, t) {
|
|
4609
4630
|
const s = await this.safeParseAsync(e, t);
|
|
@@ -4623,17 +4644,17 @@ class Z {
|
|
|
4623
4644
|
parent: null,
|
|
4624
4645
|
data: e,
|
|
4625
4646
|
parsedType: he(e)
|
|
4626
|
-
}, r = this._parse({ data: e, path: s.path, parent: s }), a = await (
|
|
4627
|
-
return
|
|
4647
|
+
}, r = this._parse({ data: e, path: s.path, parent: s }), a = await (_t(r) ? r : Promise.resolve(r));
|
|
4648
|
+
return gn(s, a);
|
|
4628
4649
|
}
|
|
4629
4650
|
refine(e, t) {
|
|
4630
4651
|
const s = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
|
|
4631
4652
|
return this._refinement((r, a) => {
|
|
4632
|
-
const o = e(r),
|
|
4653
|
+
const o = e(r), d = () => a.addIssue({
|
|
4633
4654
|
code: h.custom,
|
|
4634
4655
|
...s(r)
|
|
4635
4656
|
});
|
|
4636
|
-
return typeof Promise < "u" && o instanceof Promise ? o.then((
|
|
4657
|
+
return typeof Promise < "u" && o instanceof Promise ? o.then((c) => c ? !0 : (d(), !1)) : o ? !0 : (d(), !1);
|
|
4637
4658
|
});
|
|
4638
4659
|
}
|
|
4639
4660
|
refinement(e, t) {
|
|
@@ -4662,13 +4683,13 @@ class Z {
|
|
|
4662
4683
|
return W.create(this, this._def);
|
|
4663
4684
|
}
|
|
4664
4685
|
promise() {
|
|
4665
|
-
return
|
|
4686
|
+
return Ke.create(this, this._def);
|
|
4666
4687
|
}
|
|
4667
4688
|
or(e) {
|
|
4668
|
-
return
|
|
4689
|
+
return wt.create([this, e], this._def);
|
|
4669
4690
|
}
|
|
4670
4691
|
and(e) {
|
|
4671
|
-
return
|
|
4692
|
+
return bt.create(this, e, this._def);
|
|
4672
4693
|
}
|
|
4673
4694
|
transform(e) {
|
|
4674
4695
|
return new J({
|
|
@@ -4680,7 +4701,7 @@ class Z {
|
|
|
4680
4701
|
}
|
|
4681
4702
|
default(e) {
|
|
4682
4703
|
const t = typeof e == "function" ? e : () => e;
|
|
4683
|
-
return new
|
|
4704
|
+
return new St({
|
|
4684
4705
|
...O(this._def),
|
|
4685
4706
|
innerType: this,
|
|
4686
4707
|
defaultValue: t,
|
|
@@ -4696,7 +4717,7 @@ class Z {
|
|
|
4696
4717
|
}
|
|
4697
4718
|
catch(e) {
|
|
4698
4719
|
const t = typeof e == "function" ? e : () => e;
|
|
4699
|
-
return new
|
|
4720
|
+
return new Zt({
|
|
4700
4721
|
...O(this._def),
|
|
4701
4722
|
innerType: this,
|
|
4702
4723
|
catchValue: t,
|
|
@@ -4711,10 +4732,10 @@ class Z {
|
|
|
4711
4732
|
});
|
|
4712
4733
|
}
|
|
4713
4734
|
pipe(e) {
|
|
4714
|
-
return
|
|
4735
|
+
return Ct.create(this, e);
|
|
4715
4736
|
}
|
|
4716
4737
|
readonly() {
|
|
4717
|
-
return
|
|
4738
|
+
return jt.create(this);
|
|
4718
4739
|
}
|
|
4719
4740
|
isOptional() {
|
|
4720
4741
|
return this.safeParse(void 0).success;
|
|
@@ -4723,23 +4744,23 @@ class Z {
|
|
|
4723
4744
|
return this.safeParse(null).success;
|
|
4724
4745
|
}
|
|
4725
4746
|
}
|
|
4726
|
-
const
|
|
4747
|
+
const Ea = /^c[^\s-]{8,}$/i, Aa = /^[0-9a-z]+$/, Ra = /^[0-9A-HJKMNP-TV-Z]{26}$/, $a = /^[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, Pa = /^[a-z0-9_-]{21}$/i, Da = /^[-+]?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)?)??$/, Ma = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, La = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
4727
4748
|
let Yt;
|
|
4728
|
-
const
|
|
4729
|
-
function
|
|
4749
|
+
const Va = /^(?:(?: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])$/, Ua = /^(([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})))$/, Fa = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Vn = "((\\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])))", za = new RegExp(`^${Vn}$`);
|
|
4750
|
+
function Un(n) {
|
|
4730
4751
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
4731
4752
|
return n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
4732
4753
|
}
|
|
4733
|
-
function
|
|
4734
|
-
return new RegExp(`^${
|
|
4754
|
+
function Ba(n) {
|
|
4755
|
+
return new RegExp(`^${Un(n)}$`);
|
|
4735
4756
|
}
|
|
4736
|
-
function
|
|
4737
|
-
let e = `${
|
|
4757
|
+
function Fn(n) {
|
|
4758
|
+
let e = `${Vn}T${Un(n)}`;
|
|
4738
4759
|
const t = [];
|
|
4739
4760
|
return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
4740
4761
|
}
|
|
4741
|
-
function
|
|
4742
|
-
return !!((e === "v4" || !e) &&
|
|
4762
|
+
function Wa(n, e) {
|
|
4763
|
+
return !!((e === "v4" || !e) && Va.test(n) || (e === "v6" || !e) && Ua.test(n));
|
|
4743
4764
|
}
|
|
4744
4765
|
class z extends Z {
|
|
4745
4766
|
_parse(e) {
|
|
@@ -4773,15 +4794,15 @@ class z extends Z {
|
|
|
4773
4794
|
message: a.message
|
|
4774
4795
|
}), s.dirty());
|
|
4775
4796
|
else if (a.kind === "length") {
|
|
4776
|
-
const o = e.data.length > a.value,
|
|
4777
|
-
(o ||
|
|
4797
|
+
const o = e.data.length > a.value, d = e.data.length < a.value;
|
|
4798
|
+
(o || d) && (r = this._getOrReturnCtx(e, r), o ? m(r, {
|
|
4778
4799
|
code: h.too_big,
|
|
4779
4800
|
maximum: a.value,
|
|
4780
4801
|
type: "string",
|
|
4781
4802
|
inclusive: !0,
|
|
4782
4803
|
exact: !0,
|
|
4783
4804
|
message: a.message
|
|
4784
|
-
}) :
|
|
4805
|
+
}) : d && m(r, {
|
|
4785
4806
|
code: h.too_small,
|
|
4786
4807
|
minimum: a.value,
|
|
4787
4808
|
type: "string",
|
|
@@ -4790,43 +4811,43 @@ class z extends Z {
|
|
|
4790
4811
|
message: a.message
|
|
4791
4812
|
}), s.dirty());
|
|
4792
4813
|
} else if (a.kind === "email")
|
|
4793
|
-
|
|
4814
|
+
Ma.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4794
4815
|
validation: "email",
|
|
4795
4816
|
code: h.invalid_string,
|
|
4796
4817
|
message: a.message
|
|
4797
4818
|
}), s.dirty());
|
|
4798
4819
|
else if (a.kind === "emoji")
|
|
4799
|
-
Yt || (Yt = new RegExp(
|
|
4820
|
+
Yt || (Yt = new RegExp(La, "u")), Yt.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4800
4821
|
validation: "emoji",
|
|
4801
4822
|
code: h.invalid_string,
|
|
4802
4823
|
message: a.message
|
|
4803
4824
|
}), s.dirty());
|
|
4804
4825
|
else if (a.kind === "uuid")
|
|
4805
|
-
|
|
4826
|
+
$a.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4806
4827
|
validation: "uuid",
|
|
4807
4828
|
code: h.invalid_string,
|
|
4808
4829
|
message: a.message
|
|
4809
4830
|
}), s.dirty());
|
|
4810
4831
|
else if (a.kind === "nanoid")
|
|
4811
|
-
|
|
4832
|
+
Pa.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4812
4833
|
validation: "nanoid",
|
|
4813
4834
|
code: h.invalid_string,
|
|
4814
4835
|
message: a.message
|
|
4815
4836
|
}), s.dirty());
|
|
4816
4837
|
else if (a.kind === "cuid")
|
|
4817
|
-
|
|
4838
|
+
Ea.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4818
4839
|
validation: "cuid",
|
|
4819
4840
|
code: h.invalid_string,
|
|
4820
4841
|
message: a.message
|
|
4821
4842
|
}), s.dirty());
|
|
4822
4843
|
else if (a.kind === "cuid2")
|
|
4823
|
-
|
|
4844
|
+
Aa.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4824
4845
|
validation: "cuid2",
|
|
4825
4846
|
code: h.invalid_string,
|
|
4826
4847
|
message: a.message
|
|
4827
4848
|
}), s.dirty());
|
|
4828
4849
|
else if (a.kind === "ulid")
|
|
4829
|
-
|
|
4850
|
+
Ra.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4830
4851
|
validation: "ulid",
|
|
4831
4852
|
code: h.invalid_string,
|
|
4832
4853
|
message: a.message
|
|
@@ -4857,27 +4878,27 @@ class z extends Z {
|
|
|
4857
4878
|
code: h.invalid_string,
|
|
4858
4879
|
validation: { endsWith: a.value },
|
|
4859
4880
|
message: a.message
|
|
4860
|
-
}), s.dirty()) : a.kind === "datetime" ?
|
|
4881
|
+
}), s.dirty()) : a.kind === "datetime" ? Fn(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4861
4882
|
code: h.invalid_string,
|
|
4862
4883
|
validation: "datetime",
|
|
4863
4884
|
message: a.message
|
|
4864
|
-
}), s.dirty()) : a.kind === "date" ?
|
|
4885
|
+
}), s.dirty()) : a.kind === "date" ? za.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4865
4886
|
code: h.invalid_string,
|
|
4866
4887
|
validation: "date",
|
|
4867
4888
|
message: a.message
|
|
4868
|
-
}), s.dirty()) : a.kind === "time" ?
|
|
4889
|
+
}), s.dirty()) : a.kind === "time" ? Ba(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4869
4890
|
code: h.invalid_string,
|
|
4870
4891
|
validation: "time",
|
|
4871
4892
|
message: a.message
|
|
4872
|
-
}), s.dirty()) : a.kind === "duration" ?
|
|
4893
|
+
}), s.dirty()) : a.kind === "duration" ? Da.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4873
4894
|
validation: "duration",
|
|
4874
4895
|
code: h.invalid_string,
|
|
4875
4896
|
message: a.message
|
|
4876
|
-
}), s.dirty()) : a.kind === "ip" ?
|
|
4897
|
+
}), s.dirty()) : a.kind === "ip" ? Wa(e.data, a.version) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4877
4898
|
validation: "ip",
|
|
4878
4899
|
code: h.invalid_string,
|
|
4879
4900
|
message: a.message
|
|
4880
|
-
}), s.dirty()) : a.kind === "base64" ?
|
|
4901
|
+
}), s.dirty()) : a.kind === "base64" ? Fa.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4881
4902
|
validation: "base64",
|
|
4882
4903
|
code: h.invalid_string,
|
|
4883
4904
|
message: a.message
|
|
@@ -5099,7 +5120,7 @@ z.create = (n) => {
|
|
|
5099
5120
|
...O(n)
|
|
5100
5121
|
});
|
|
5101
5122
|
};
|
|
5102
|
-
function
|
|
5123
|
+
function qa(n, e) {
|
|
5103
5124
|
const t = (n.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, r = t > s ? t : s, a = parseInt(n.toFixed(r).replace(".", "")), o = parseInt(e.toFixed(r).replace(".", ""));
|
|
5104
5125
|
return a % o / Math.pow(10, r);
|
|
5105
5126
|
}
|
|
@@ -5138,7 +5159,7 @@ class ye extends Z {
|
|
|
5138
5159
|
inclusive: a.inclusive,
|
|
5139
5160
|
exact: !1,
|
|
5140
5161
|
message: a.message
|
|
5141
|
-
}), r.dirty()) : a.kind === "multipleOf" ?
|
|
5162
|
+
}), r.dirty()) : a.kind === "multipleOf" ? qa(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), m(s, {
|
|
5142
5163
|
code: h.not_multiple_of,
|
|
5143
5164
|
multipleOf: a.value,
|
|
5144
5165
|
message: a.message
|
|
@@ -5403,7 +5424,7 @@ ve.create = (n) => {
|
|
|
5403
5424
|
...O(n)
|
|
5404
5425
|
});
|
|
5405
5426
|
};
|
|
5406
|
-
class
|
|
5427
|
+
class gt extends Z {
|
|
5407
5428
|
_parse(e) {
|
|
5408
5429
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== g.boolean) {
|
|
5409
5430
|
const s = this._getOrReturnCtx(e);
|
|
@@ -5416,7 +5437,7 @@ class yt extends Z {
|
|
|
5416
5437
|
return M(e.data);
|
|
5417
5438
|
}
|
|
5418
5439
|
}
|
|
5419
|
-
|
|
5440
|
+
gt.create = (n) => new gt({
|
|
5420
5441
|
typeName: b.ZodBoolean,
|
|
5421
5442
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
5422
5443
|
...O(n)
|
|
@@ -5516,7 +5537,7 @@ zt.create = (n) => new zt({
|
|
|
5516
5537
|
typeName: b.ZodSymbol,
|
|
5517
5538
|
...O(n)
|
|
5518
5539
|
});
|
|
5519
|
-
class
|
|
5540
|
+
class yt extends Z {
|
|
5520
5541
|
_parse(e) {
|
|
5521
5542
|
if (this._getType(e) !== g.undefined) {
|
|
5522
5543
|
const s = this._getOrReturnCtx(e);
|
|
@@ -5529,11 +5550,11 @@ class vt extends Z {
|
|
|
5529
5550
|
return M(e.data);
|
|
5530
5551
|
}
|
|
5531
5552
|
}
|
|
5532
|
-
|
|
5553
|
+
yt.create = (n) => new yt({
|
|
5533
5554
|
typeName: b.ZodUndefined,
|
|
5534
5555
|
...O(n)
|
|
5535
5556
|
});
|
|
5536
|
-
class
|
|
5557
|
+
class vt extends Z {
|
|
5537
5558
|
_parse(e) {
|
|
5538
5559
|
if (this._getType(e) !== g.null) {
|
|
5539
5560
|
const s = this._getOrReturnCtx(e);
|
|
@@ -5546,11 +5567,11 @@ class wt extends Z {
|
|
|
5546
5567
|
return M(e.data);
|
|
5547
5568
|
}
|
|
5548
5569
|
}
|
|
5549
|
-
|
|
5570
|
+
vt.create = (n) => new vt({
|
|
5550
5571
|
typeName: b.ZodNull,
|
|
5551
5572
|
...O(n)
|
|
5552
5573
|
});
|
|
5553
|
-
class
|
|
5574
|
+
class Je extends Z {
|
|
5554
5575
|
constructor() {
|
|
5555
5576
|
super(...arguments), this._any = !0;
|
|
5556
5577
|
}
|
|
@@ -5558,7 +5579,7 @@ class Ke extends Z {
|
|
|
5558
5579
|
return M(e.data);
|
|
5559
5580
|
}
|
|
5560
5581
|
}
|
|
5561
|
-
|
|
5582
|
+
Je.create = (n) => new Je({
|
|
5562
5583
|
typeName: b.ZodAny,
|
|
5563
5584
|
...O(n)
|
|
5564
5585
|
});
|
|
@@ -5615,10 +5636,10 @@ class W extends Z {
|
|
|
5615
5636
|
received: t.parsedType
|
|
5616
5637
|
}), k;
|
|
5617
5638
|
if (r.exactLength !== null) {
|
|
5618
|
-
const o = t.data.length > r.exactLength.value,
|
|
5619
|
-
(o ||
|
|
5639
|
+
const o = t.data.length > r.exactLength.value, d = t.data.length < r.exactLength.value;
|
|
5640
|
+
(o || d) && (m(t, {
|
|
5620
5641
|
code: o ? h.too_big : h.too_small,
|
|
5621
|
-
minimum:
|
|
5642
|
+
minimum: d ? r.exactLength.value : void 0,
|
|
5622
5643
|
maximum: o ? r.exactLength.value : void 0,
|
|
5623
5644
|
type: "array",
|
|
5624
5645
|
inclusive: !0,
|
|
@@ -5641,8 +5662,8 @@ class W extends Z {
|
|
|
5641
5662
|
exact: !1,
|
|
5642
5663
|
message: r.maxLength.message
|
|
5643
5664
|
}), s.dirty()), t.common.async)
|
|
5644
|
-
return Promise.all([...t.data].map((o,
|
|
5645
|
-
const a = [...t.data].map((o,
|
|
5665
|
+
return Promise.all([...t.data].map((o, d) => r.type._parseAsync(new te(t, o, t.path, d)))).then((o) => P.mergeArray(s, o));
|
|
5666
|
+
const a = [...t.data].map((o, d) => r.type._parseSync(new te(t, o, t.path, d)));
|
|
5646
5667
|
return P.mergeArray(s, a);
|
|
5647
5668
|
}
|
|
5648
5669
|
get element() {
|
|
@@ -5678,12 +5699,12 @@ W.create = (n, e) => new W({
|
|
|
5678
5699
|
typeName: b.ZodArray,
|
|
5679
5700
|
...O(e)
|
|
5680
5701
|
});
|
|
5681
|
-
function
|
|
5702
|
+
function Le(n) {
|
|
5682
5703
|
if (n instanceof E) {
|
|
5683
5704
|
const e = {};
|
|
5684
5705
|
for (const t in n.shape) {
|
|
5685
5706
|
const s = n.shape[t];
|
|
5686
|
-
e[t] = G.create(
|
|
5707
|
+
e[t] = G.create(Le(s));
|
|
5687
5708
|
}
|
|
5688
5709
|
return new E({
|
|
5689
5710
|
...n._def,
|
|
@@ -5691,8 +5712,8 @@ function Ve(n) {
|
|
|
5691
5712
|
});
|
|
5692
5713
|
} else return n instanceof W ? new W({
|
|
5693
5714
|
...n._def,
|
|
5694
|
-
type:
|
|
5695
|
-
}) : n instanceof G ? G.create(
|
|
5715
|
+
type: Le(n.element)
|
|
5716
|
+
}) : n instanceof G ? G.create(Le(n.unwrap())) : n instanceof be ? be.create(Le(n.unwrap())) : n instanceof ne ? ne.create(n.items.map((e) => Le(e))) : n;
|
|
5696
5717
|
}
|
|
5697
5718
|
class E extends Z {
|
|
5698
5719
|
constructor() {
|
|
@@ -5713,14 +5734,14 @@ class E extends Z {
|
|
|
5713
5734
|
received: u.parsedType
|
|
5714
5735
|
}), k;
|
|
5715
5736
|
}
|
|
5716
|
-
const { status: s, ctx: r } = this._processInputParams(e), { shape: a, keys: o } = this._getCached(),
|
|
5737
|
+
const { status: s, ctx: r } = this._processInputParams(e), { shape: a, keys: o } = this._getCached(), d = [];
|
|
5717
5738
|
if (!(this._def.catchall instanceof ae && this._def.unknownKeys === "strip"))
|
|
5718
5739
|
for (const u in r.data)
|
|
5719
|
-
o.includes(u) ||
|
|
5720
|
-
const
|
|
5740
|
+
o.includes(u) || d.push(u);
|
|
5741
|
+
const c = [];
|
|
5721
5742
|
for (const u of o) {
|
|
5722
5743
|
const l = a[u], j = r.data[u];
|
|
5723
|
-
|
|
5744
|
+
c.push({
|
|
5724
5745
|
key: { status: "valid", value: u },
|
|
5725
5746
|
value: l._parse(new te(r, j, r.path, u)),
|
|
5726
5747
|
alwaysSet: u in r.data
|
|
@@ -5729,22 +5750,22 @@ class E extends Z {
|
|
|
5729
5750
|
if (this._def.catchall instanceof ae) {
|
|
5730
5751
|
const u = this._def.unknownKeys;
|
|
5731
5752
|
if (u === "passthrough")
|
|
5732
|
-
for (const l of
|
|
5733
|
-
|
|
5753
|
+
for (const l of d)
|
|
5754
|
+
c.push({
|
|
5734
5755
|
key: { status: "valid", value: l },
|
|
5735
5756
|
value: { status: "valid", value: r.data[l] }
|
|
5736
5757
|
});
|
|
5737
5758
|
else if (u === "strict")
|
|
5738
|
-
|
|
5759
|
+
d.length > 0 && (m(r, {
|
|
5739
5760
|
code: h.unrecognized_keys,
|
|
5740
|
-
keys:
|
|
5761
|
+
keys: d
|
|
5741
5762
|
}), s.dirty());
|
|
5742
5763
|
else if (u !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
5743
5764
|
} else {
|
|
5744
5765
|
const u = this._def.catchall;
|
|
5745
|
-
for (const l of
|
|
5766
|
+
for (const l of d) {
|
|
5746
5767
|
const j = r.data[l];
|
|
5747
|
-
|
|
5768
|
+
c.push({
|
|
5748
5769
|
key: { status: "valid", value: l },
|
|
5749
5770
|
value: u._parse(
|
|
5750
5771
|
new te(r, j, r.path, l)
|
|
@@ -5756,7 +5777,7 @@ class E extends Z {
|
|
|
5756
5777
|
}
|
|
5757
5778
|
return r.common.async ? Promise.resolve().then(async () => {
|
|
5758
5779
|
const u = [];
|
|
5759
|
-
for (const l of
|
|
5780
|
+
for (const l of c) {
|
|
5760
5781
|
const j = await l.key, A = await l.value;
|
|
5761
5782
|
u.push({
|
|
5762
5783
|
key: j,
|
|
@@ -5765,7 +5786,7 @@ class E extends Z {
|
|
|
5765
5786
|
});
|
|
5766
5787
|
}
|
|
5767
5788
|
return u;
|
|
5768
|
-
}).then((u) => P.mergeObjectSync(s, u)) : P.mergeObjectSync(s,
|
|
5789
|
+
}).then((u) => P.mergeObjectSync(s, u)) : P.mergeObjectSync(s, c);
|
|
5769
5790
|
}
|
|
5770
5791
|
get shape() {
|
|
5771
5792
|
return this._def.shape();
|
|
@@ -5776,12 +5797,12 @@ class E extends Z {
|
|
|
5776
5797
|
unknownKeys: "strict",
|
|
5777
5798
|
...e !== void 0 ? {
|
|
5778
5799
|
errorMap: (t, s) => {
|
|
5779
|
-
var r, a, o,
|
|
5780
|
-
const
|
|
5800
|
+
var r, a, o, d;
|
|
5801
|
+
const c = (o = (a = (r = this._def).errorMap) === null || a === void 0 ? void 0 : a.call(r, t, s).message) !== null && o !== void 0 ? o : s.defaultError;
|
|
5781
5802
|
return t.code === "unrecognized_keys" ? {
|
|
5782
|
-
message: (
|
|
5803
|
+
message: (d = v.errToObj(e).message) !== null && d !== void 0 ? d : c
|
|
5783
5804
|
} : {
|
|
5784
|
-
message:
|
|
5805
|
+
message: c
|
|
5785
5806
|
};
|
|
5786
5807
|
}
|
|
5787
5808
|
} : {}
|
|
@@ -5928,7 +5949,7 @@ class E extends Z {
|
|
|
5928
5949
|
* @deprecated
|
|
5929
5950
|
*/
|
|
5930
5951
|
deepPartial() {
|
|
5931
|
-
return
|
|
5952
|
+
return Le(this);
|
|
5932
5953
|
}
|
|
5933
5954
|
partial(e) {
|
|
5934
5955
|
const t = {};
|
|
@@ -5957,7 +5978,7 @@ class E extends Z {
|
|
|
5957
5978
|
});
|
|
5958
5979
|
}
|
|
5959
5980
|
keyof() {
|
|
5960
|
-
return
|
|
5981
|
+
return zn(C.objectKeys(this.shape));
|
|
5961
5982
|
}
|
|
5962
5983
|
}
|
|
5963
5984
|
E.create = (n, e) => new E({
|
|
@@ -5981,17 +6002,17 @@ E.lazycreate = (n, e) => new E({
|
|
|
5981
6002
|
typeName: b.ZodObject,
|
|
5982
6003
|
...O(e)
|
|
5983
6004
|
});
|
|
5984
|
-
class
|
|
6005
|
+
class wt extends Z {
|
|
5985
6006
|
_parse(e) {
|
|
5986
6007
|
const { ctx: t } = this._processInputParams(e), s = this._def.options;
|
|
5987
6008
|
function r(a) {
|
|
5988
|
-
for (const
|
|
5989
|
-
if (
|
|
5990
|
-
return
|
|
5991
|
-
for (const
|
|
5992
|
-
if (
|
|
5993
|
-
return t.common.issues.push(...
|
|
5994
|
-
const o = a.map((
|
|
6009
|
+
for (const d of a)
|
|
6010
|
+
if (d.result.status === "valid")
|
|
6011
|
+
return d.result;
|
|
6012
|
+
for (const d of a)
|
|
6013
|
+
if (d.result.status === "dirty")
|
|
6014
|
+
return t.common.issues.push(...d.ctx.common.issues), d.result;
|
|
6015
|
+
const o = a.map((d) => new V(d.ctx.common.issues));
|
|
5995
6016
|
return m(t, {
|
|
5996
6017
|
code: h.invalid_union,
|
|
5997
6018
|
unionErrors: o
|
|
@@ -6019,7 +6040,7 @@ class bt extends Z {
|
|
|
6019
6040
|
{
|
|
6020
6041
|
let a;
|
|
6021
6042
|
const o = [];
|
|
6022
|
-
for (const
|
|
6043
|
+
for (const c of s) {
|
|
6023
6044
|
const u = {
|
|
6024
6045
|
...t,
|
|
6025
6046
|
common: {
|
|
@@ -6027,7 +6048,7 @@ class bt extends Z {
|
|
|
6027
6048
|
issues: []
|
|
6028
6049
|
},
|
|
6029
6050
|
parent: null
|
|
6030
|
-
}, l =
|
|
6051
|
+
}, l = c._parseSync({
|
|
6031
6052
|
data: t.data,
|
|
6032
6053
|
path: t.path,
|
|
6033
6054
|
parent: u
|
|
@@ -6038,10 +6059,10 @@ class bt extends Z {
|
|
|
6038
6059
|
}
|
|
6039
6060
|
if (a)
|
|
6040
6061
|
return t.common.issues.push(...a.ctx.common.issues), a.result;
|
|
6041
|
-
const
|
|
6062
|
+
const d = o.map((c) => new V(c));
|
|
6042
6063
|
return m(t, {
|
|
6043
6064
|
code: h.invalid_union,
|
|
6044
|
-
unionErrors:
|
|
6065
|
+
unionErrors: d
|
|
6045
6066
|
}), k;
|
|
6046
6067
|
}
|
|
6047
6068
|
}
|
|
@@ -6049,12 +6070,12 @@ class bt extends Z {
|
|
|
6049
6070
|
return this._def.options;
|
|
6050
6071
|
}
|
|
6051
6072
|
}
|
|
6052
|
-
|
|
6073
|
+
wt.create = (n, e) => new wt({
|
|
6053
6074
|
options: n,
|
|
6054
6075
|
typeName: b.ZodUnion,
|
|
6055
6076
|
...O(e)
|
|
6056
6077
|
});
|
|
6057
|
-
const se = (n) => n instanceof
|
|
6078
|
+
const se = (n) => n instanceof xt ? se(n.schema) : n instanceof J ? se(n.innerType()) : n instanceof Tt ? [n.value] : n instanceof we ? n.options : n instanceof Ot ? C.objectValues(n.enum) : n instanceof St ? se(n._def.innerType) : n instanceof yt ? [void 0] : n instanceof vt ? [null] : n instanceof G ? [void 0, ...se(n.unwrap())] : n instanceof be ? [null, ...se(n.unwrap())] : n instanceof pn || n instanceof jt ? se(n.unwrap()) : n instanceof Zt ? se(n._def.innerType) : [];
|
|
6058
6079
|
class Kt extends Z {
|
|
6059
6080
|
_parse(e) {
|
|
6060
6081
|
const { ctx: t } = this._processInputParams(e);
|
|
@@ -6102,10 +6123,10 @@ class Kt extends Z {
|
|
|
6102
6123
|
const o = se(a.shape[e]);
|
|
6103
6124
|
if (!o.length)
|
|
6104
6125
|
throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
|
|
6105
|
-
for (const
|
|
6106
|
-
if (r.has(
|
|
6107
|
-
throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(
|
|
6108
|
-
r.set(
|
|
6126
|
+
for (const d of o) {
|
|
6127
|
+
if (r.has(d))
|
|
6128
|
+
throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);
|
|
6129
|
+
r.set(d, a);
|
|
6109
6130
|
}
|
|
6110
6131
|
}
|
|
6111
6132
|
return new Kt({
|
|
@@ -6122,12 +6143,12 @@ function on(n, e) {
|
|
|
6122
6143
|
if (n === e)
|
|
6123
6144
|
return { valid: !0, data: n };
|
|
6124
6145
|
if (t === g.object && s === g.object) {
|
|
6125
|
-
const r = C.objectKeys(e), a = C.objectKeys(n).filter((
|
|
6126
|
-
for (const
|
|
6127
|
-
const
|
|
6128
|
-
if (!
|
|
6146
|
+
const r = C.objectKeys(e), a = C.objectKeys(n).filter((d) => r.indexOf(d) !== -1), o = { ...n, ...e };
|
|
6147
|
+
for (const d of a) {
|
|
6148
|
+
const c = on(n[d], e[d]);
|
|
6149
|
+
if (!c.valid)
|
|
6129
6150
|
return { valid: !1 };
|
|
6130
|
-
o[
|
|
6151
|
+
o[d] = c.data;
|
|
6131
6152
|
}
|
|
6132
6153
|
return { valid: !0, data: o };
|
|
6133
6154
|
} else if (t === g.array && s === g.array) {
|
|
@@ -6135,21 +6156,21 @@ function on(n, e) {
|
|
|
6135
6156
|
return { valid: !1 };
|
|
6136
6157
|
const r = [];
|
|
6137
6158
|
for (let a = 0; a < n.length; a++) {
|
|
6138
|
-
const o = n[a],
|
|
6139
|
-
if (!
|
|
6159
|
+
const o = n[a], d = e[a], c = on(o, d);
|
|
6160
|
+
if (!c.valid)
|
|
6140
6161
|
return { valid: !1 };
|
|
6141
|
-
r.push(
|
|
6162
|
+
r.push(c.data);
|
|
6142
6163
|
}
|
|
6143
6164
|
return { valid: !0, data: r };
|
|
6144
6165
|
} else return t === g.date && s === g.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
|
|
6145
6166
|
}
|
|
6146
|
-
class
|
|
6167
|
+
class bt extends Z {
|
|
6147
6168
|
_parse(e) {
|
|
6148
6169
|
const { status: t, ctx: s } = this._processInputParams(e), r = (a, o) => {
|
|
6149
6170
|
if (rn(a) || rn(o))
|
|
6150
6171
|
return k;
|
|
6151
|
-
const
|
|
6152
|
-
return
|
|
6172
|
+
const d = on(a.value, o.value);
|
|
6173
|
+
return d.valid ? ((an(a) || an(o)) && t.dirty(), { status: t.value, value: d.data }) : (m(s, {
|
|
6153
6174
|
code: h.invalid_intersection_types
|
|
6154
6175
|
}), k);
|
|
6155
6176
|
};
|
|
@@ -6175,7 +6196,7 @@ class kt extends Z {
|
|
|
6175
6196
|
}));
|
|
6176
6197
|
}
|
|
6177
6198
|
}
|
|
6178
|
-
|
|
6199
|
+
bt.create = (n, e, t) => new bt({
|
|
6179
6200
|
left: n,
|
|
6180
6201
|
right: e,
|
|
6181
6202
|
typeName: b.ZodIntersection,
|
|
@@ -6205,9 +6226,9 @@ class ne extends Z {
|
|
|
6205
6226
|
exact: !1,
|
|
6206
6227
|
type: "array"
|
|
6207
6228
|
}), t.dirty());
|
|
6208
|
-
const a = [...s.data].map((o,
|
|
6209
|
-
const
|
|
6210
|
-
return
|
|
6229
|
+
const a = [...s.data].map((o, d) => {
|
|
6230
|
+
const c = this._def.items[d] || this._def.rest;
|
|
6231
|
+
return c ? c._parse(new te(s, o, s.path, d)) : null;
|
|
6211
6232
|
}).filter((o) => !!o);
|
|
6212
6233
|
return s.common.async ? Promise.all(a).then((o) => P.mergeArray(t, o)) : P.mergeArray(t, a);
|
|
6213
6234
|
}
|
|
@@ -6231,7 +6252,7 @@ ne.create = (n, e) => {
|
|
|
6231
6252
|
...O(e)
|
|
6232
6253
|
});
|
|
6233
6254
|
};
|
|
6234
|
-
class
|
|
6255
|
+
class kt extends Z {
|
|
6235
6256
|
get keySchema() {
|
|
6236
6257
|
return this._def.keyType;
|
|
6237
6258
|
}
|
|
@@ -6247,11 +6268,11 @@ class xt extends Z {
|
|
|
6247
6268
|
received: s.parsedType
|
|
6248
6269
|
}), k;
|
|
6249
6270
|
const r = [], a = this._def.keyType, o = this._def.valueType;
|
|
6250
|
-
for (const
|
|
6271
|
+
for (const d in s.data)
|
|
6251
6272
|
r.push({
|
|
6252
|
-
key: a._parse(new te(s,
|
|
6253
|
-
value: o._parse(new te(s, s.data[
|
|
6254
|
-
alwaysSet:
|
|
6273
|
+
key: a._parse(new te(s, d, s.path, d)),
|
|
6274
|
+
value: o._parse(new te(s, s.data[d], s.path, d)),
|
|
6275
|
+
alwaysSet: d in s.data
|
|
6255
6276
|
});
|
|
6256
6277
|
return s.common.async ? P.mergeObjectAsync(t, r) : P.mergeObjectSync(t, r);
|
|
6257
6278
|
}
|
|
@@ -6259,12 +6280,12 @@ class xt extends Z {
|
|
|
6259
6280
|
return this._def.valueType;
|
|
6260
6281
|
}
|
|
6261
6282
|
static create(e, t, s) {
|
|
6262
|
-
return t instanceof Z ? new
|
|
6283
|
+
return t instanceof Z ? new kt({
|
|
6263
6284
|
keyType: e,
|
|
6264
6285
|
valueType: t,
|
|
6265
6286
|
typeName: b.ZodRecord,
|
|
6266
6287
|
...O(s)
|
|
6267
|
-
}) : new
|
|
6288
|
+
}) : new kt({
|
|
6268
6289
|
keyType: z.create(),
|
|
6269
6290
|
valueType: e,
|
|
6270
6291
|
typeName: b.ZodRecord,
|
|
@@ -6287,30 +6308,30 @@ class Wt extends Z {
|
|
|
6287
6308
|
expected: g.map,
|
|
6288
6309
|
received: s.parsedType
|
|
6289
6310
|
}), k;
|
|
6290
|
-
const r = this._def.keyType, a = this._def.valueType, o = [...s.data.entries()].map(([
|
|
6291
|
-
key: r._parse(new te(s,
|
|
6292
|
-
value: a._parse(new te(s,
|
|
6311
|
+
const r = this._def.keyType, a = this._def.valueType, o = [...s.data.entries()].map(([d, c], u) => ({
|
|
6312
|
+
key: r._parse(new te(s, d, s.path, [u, "key"])),
|
|
6313
|
+
value: a._parse(new te(s, c, s.path, [u, "value"]))
|
|
6293
6314
|
}));
|
|
6294
6315
|
if (s.common.async) {
|
|
6295
|
-
const
|
|
6316
|
+
const d = /* @__PURE__ */ new Map();
|
|
6296
6317
|
return Promise.resolve().then(async () => {
|
|
6297
|
-
for (const
|
|
6298
|
-
const u = await
|
|
6318
|
+
for (const c of o) {
|
|
6319
|
+
const u = await c.key, l = await c.value;
|
|
6299
6320
|
if (u.status === "aborted" || l.status === "aborted")
|
|
6300
6321
|
return k;
|
|
6301
|
-
(u.status === "dirty" || l.status === "dirty") && t.dirty(),
|
|
6322
|
+
(u.status === "dirty" || l.status === "dirty") && t.dirty(), d.set(u.value, l.value);
|
|
6302
6323
|
}
|
|
6303
|
-
return { status: t.value, value:
|
|
6324
|
+
return { status: t.value, value: d };
|
|
6304
6325
|
});
|
|
6305
6326
|
} else {
|
|
6306
|
-
const
|
|
6307
|
-
for (const
|
|
6308
|
-
const u =
|
|
6327
|
+
const d = /* @__PURE__ */ new Map();
|
|
6328
|
+
for (const c of o) {
|
|
6329
|
+
const u = c.key, l = c.value;
|
|
6309
6330
|
if (u.status === "aborted" || l.status === "aborted")
|
|
6310
6331
|
return k;
|
|
6311
|
-
(u.status === "dirty" || l.status === "dirty") && t.dirty(),
|
|
6332
|
+
(u.status === "dirty" || l.status === "dirty") && t.dirty(), d.set(u.value, l.value);
|
|
6312
6333
|
}
|
|
6313
|
-
return { status: t.value, value:
|
|
6334
|
+
return { status: t.value, value: d };
|
|
6314
6335
|
}
|
|
6315
6336
|
}
|
|
6316
6337
|
}
|
|
@@ -6346,17 +6367,17 @@ class Ie extends Z {
|
|
|
6346
6367
|
message: r.maxSize.message
|
|
6347
6368
|
}), t.dirty());
|
|
6348
6369
|
const a = this._def.valueType;
|
|
6349
|
-
function o(
|
|
6370
|
+
function o(c) {
|
|
6350
6371
|
const u = /* @__PURE__ */ new Set();
|
|
6351
|
-
for (const l of
|
|
6372
|
+
for (const l of c) {
|
|
6352
6373
|
if (l.status === "aborted")
|
|
6353
6374
|
return k;
|
|
6354
6375
|
l.status === "dirty" && t.dirty(), u.add(l.value);
|
|
6355
6376
|
}
|
|
6356
6377
|
return { status: t.value, value: u };
|
|
6357
6378
|
}
|
|
6358
|
-
const
|
|
6359
|
-
return s.common.async ? Promise.all(
|
|
6379
|
+
const d = [...s.data.values()].map((c, u) => a._parse(new te(s, c, s.path, u)));
|
|
6380
|
+
return s.common.async ? Promise.all(d).then((c) => o(c)) : o(d);
|
|
6360
6381
|
}
|
|
6361
6382
|
min(e, t) {
|
|
6362
6383
|
return new Ie({
|
|
@@ -6384,7 +6405,7 @@ Ie.create = (n, e) => new Ie({
|
|
|
6384
6405
|
typeName: b.ZodSet,
|
|
6385
6406
|
...O(e)
|
|
6386
6407
|
});
|
|
6387
|
-
class
|
|
6408
|
+
class Fe extends Z {
|
|
6388
6409
|
constructor() {
|
|
6389
6410
|
super(...arguments), this.validate = this.implement;
|
|
6390
6411
|
}
|
|
@@ -6396,56 +6417,56 @@ class ze extends Z {
|
|
|
6396
6417
|
expected: g.function,
|
|
6397
6418
|
received: t.parsedType
|
|
6398
6419
|
}), k;
|
|
6399
|
-
function s(
|
|
6420
|
+
function s(d, c) {
|
|
6400
6421
|
return Ut({
|
|
6401
|
-
data:
|
|
6422
|
+
data: d,
|
|
6402
6423
|
path: t.path,
|
|
6403
6424
|
errorMaps: [
|
|
6404
6425
|
t.common.contextualErrorMap,
|
|
6405
6426
|
t.schemaErrorMap,
|
|
6406
6427
|
Vt(),
|
|
6407
|
-
|
|
6428
|
+
qe
|
|
6408
6429
|
].filter((u) => !!u),
|
|
6409
6430
|
issueData: {
|
|
6410
6431
|
code: h.invalid_arguments,
|
|
6411
|
-
argumentsError:
|
|
6432
|
+
argumentsError: c
|
|
6412
6433
|
}
|
|
6413
6434
|
});
|
|
6414
6435
|
}
|
|
6415
|
-
function r(
|
|
6436
|
+
function r(d, c) {
|
|
6416
6437
|
return Ut({
|
|
6417
|
-
data:
|
|
6438
|
+
data: d,
|
|
6418
6439
|
path: t.path,
|
|
6419
6440
|
errorMaps: [
|
|
6420
6441
|
t.common.contextualErrorMap,
|
|
6421
6442
|
t.schemaErrorMap,
|
|
6422
6443
|
Vt(),
|
|
6423
|
-
|
|
6444
|
+
qe
|
|
6424
6445
|
].filter((u) => !!u),
|
|
6425
6446
|
issueData: {
|
|
6426
6447
|
code: h.invalid_return_type,
|
|
6427
|
-
returnTypeError:
|
|
6448
|
+
returnTypeError: c
|
|
6428
6449
|
}
|
|
6429
6450
|
});
|
|
6430
6451
|
}
|
|
6431
6452
|
const a = { errorMap: t.common.contextualErrorMap }, o = t.data;
|
|
6432
|
-
if (this._def.returns instanceof
|
|
6433
|
-
const
|
|
6434
|
-
return M(async function(...
|
|
6435
|
-
const u = new V([]), l = await
|
|
6436
|
-
throw u.addIssue(s(
|
|
6453
|
+
if (this._def.returns instanceof Ke) {
|
|
6454
|
+
const d = this;
|
|
6455
|
+
return M(async function(...c) {
|
|
6456
|
+
const u = new V([]), l = await d._def.args.parseAsync(c, a).catch((U) => {
|
|
6457
|
+
throw u.addIssue(s(c, U)), u;
|
|
6437
6458
|
}), j = await Reflect.apply(o, this, l);
|
|
6438
|
-
return await
|
|
6459
|
+
return await d._def.returns._def.type.parseAsync(j, a).catch((U) => {
|
|
6439
6460
|
throw u.addIssue(r(j, U)), u;
|
|
6440
6461
|
});
|
|
6441
6462
|
});
|
|
6442
6463
|
} else {
|
|
6443
|
-
const
|
|
6444
|
-
return M(function(...
|
|
6445
|
-
const u =
|
|
6464
|
+
const d = this;
|
|
6465
|
+
return M(function(...c) {
|
|
6466
|
+
const u = d._def.args.safeParse(c, a);
|
|
6446
6467
|
if (!u.success)
|
|
6447
|
-
throw new V([s(
|
|
6448
|
-
const l = Reflect.apply(o, this, u.data), j =
|
|
6468
|
+
throw new V([s(c, u.error)]);
|
|
6469
|
+
const l = Reflect.apply(o, this, u.data), j = d._def.returns.safeParse(l, a);
|
|
6449
6470
|
if (!j.success)
|
|
6450
6471
|
throw new V([r(l, j.error)]);
|
|
6451
6472
|
return j.data;
|
|
@@ -6459,13 +6480,13 @@ class ze extends Z {
|
|
|
6459
6480
|
return this._def.returns;
|
|
6460
6481
|
}
|
|
6461
6482
|
args(...e) {
|
|
6462
|
-
return new
|
|
6483
|
+
return new Fe({
|
|
6463
6484
|
...this._def,
|
|
6464
6485
|
args: ne.create(e).rest(Ze.create())
|
|
6465
6486
|
});
|
|
6466
6487
|
}
|
|
6467
6488
|
returns(e) {
|
|
6468
|
-
return new
|
|
6489
|
+
return new Fe({
|
|
6469
6490
|
...this._def,
|
|
6470
6491
|
returns: e
|
|
6471
6492
|
});
|
|
@@ -6477,7 +6498,7 @@ class ze extends Z {
|
|
|
6477
6498
|
return this.parse(e);
|
|
6478
6499
|
}
|
|
6479
6500
|
static create(e, t, s) {
|
|
6480
|
-
return new
|
|
6501
|
+
return new Fe({
|
|
6481
6502
|
args: e || ne.create([]).rest(Ze.create()),
|
|
6482
6503
|
returns: t || Ze.create(),
|
|
6483
6504
|
typeName: b.ZodFunction,
|
|
@@ -6485,7 +6506,7 @@ class ze extends Z {
|
|
|
6485
6506
|
});
|
|
6486
6507
|
}
|
|
6487
6508
|
}
|
|
6488
|
-
class
|
|
6509
|
+
class xt extends Z {
|
|
6489
6510
|
get schema() {
|
|
6490
6511
|
return this._def.getter();
|
|
6491
6512
|
}
|
|
@@ -6494,12 +6515,12 @@ class Tt extends Z {
|
|
|
6494
6515
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
6495
6516
|
}
|
|
6496
6517
|
}
|
|
6497
|
-
|
|
6518
|
+
xt.create = (n, e) => new xt({
|
|
6498
6519
|
getter: n,
|
|
6499
6520
|
typeName: b.ZodLazy,
|
|
6500
6521
|
...O(e)
|
|
6501
6522
|
});
|
|
6502
|
-
class
|
|
6523
|
+
class Tt extends Z {
|
|
6503
6524
|
_parse(e) {
|
|
6504
6525
|
if (e.data !== this._def.value) {
|
|
6505
6526
|
const t = this._getOrReturnCtx(e);
|
|
@@ -6515,12 +6536,12 @@ class Ot extends Z {
|
|
|
6515
6536
|
return this._def.value;
|
|
6516
6537
|
}
|
|
6517
6538
|
}
|
|
6518
|
-
|
|
6539
|
+
Tt.create = (n, e) => new Tt({
|
|
6519
6540
|
value: n,
|
|
6520
6541
|
typeName: b.ZodLiteral,
|
|
6521
6542
|
...O(e)
|
|
6522
6543
|
});
|
|
6523
|
-
function
|
|
6544
|
+
function zn(n, e) {
|
|
6524
6545
|
return new we({
|
|
6525
6546
|
values: n,
|
|
6526
6547
|
typeName: b.ZodEnum,
|
|
@@ -6529,7 +6550,7 @@ function Bn(n, e) {
|
|
|
6529
6550
|
}
|
|
6530
6551
|
class we extends Z {
|
|
6531
6552
|
constructor() {
|
|
6532
|
-
super(...arguments),
|
|
6553
|
+
super(...arguments), Xe.set(this, void 0);
|
|
6533
6554
|
}
|
|
6534
6555
|
_parse(e) {
|
|
6535
6556
|
if (typeof e.data != "string") {
|
|
@@ -6540,7 +6561,7 @@ class we extends Z {
|
|
|
6540
6561
|
code: h.invalid_type
|
|
6541
6562
|
}), k;
|
|
6542
6563
|
}
|
|
6543
|
-
if (Ft(this,
|
|
6564
|
+
if (Ft(this, Xe) || Ln(this, Xe, new Set(this._def.values)), !Ft(this, Xe).has(e.data)) {
|
|
6544
6565
|
const t = this._getOrReturnCtx(e), s = this._def.values;
|
|
6545
6566
|
return m(t, {
|
|
6546
6567
|
received: t.data,
|
|
@@ -6584,11 +6605,11 @@ class we extends Z {
|
|
|
6584
6605
|
});
|
|
6585
6606
|
}
|
|
6586
6607
|
}
|
|
6587
|
-
|
|
6588
|
-
we.create =
|
|
6589
|
-
class
|
|
6608
|
+
Xe = /* @__PURE__ */ new WeakMap();
|
|
6609
|
+
we.create = zn;
|
|
6610
|
+
class Ot extends Z {
|
|
6590
6611
|
constructor() {
|
|
6591
|
-
super(...arguments),
|
|
6612
|
+
super(...arguments), et.set(this, void 0);
|
|
6592
6613
|
}
|
|
6593
6614
|
_parse(e) {
|
|
6594
6615
|
const t = C.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
|
|
@@ -6600,7 +6621,7 @@ class St extends Z {
|
|
|
6600
6621
|
code: h.invalid_type
|
|
6601
6622
|
}), k;
|
|
6602
6623
|
}
|
|
6603
|
-
if (Ft(this,
|
|
6624
|
+
if (Ft(this, et) || Ln(this, et, new Set(C.getValidEnumValues(this._def.values))), !Ft(this, et).has(e.data)) {
|
|
6604
6625
|
const r = C.objectValues(t);
|
|
6605
6626
|
return m(s, {
|
|
6606
6627
|
received: s.data,
|
|
@@ -6614,13 +6635,13 @@ class St extends Z {
|
|
|
6614
6635
|
return this._def.values;
|
|
6615
6636
|
}
|
|
6616
6637
|
}
|
|
6617
|
-
|
|
6618
|
-
|
|
6638
|
+
et = /* @__PURE__ */ new WeakMap();
|
|
6639
|
+
Ot.create = (n, e) => new Ot({
|
|
6619
6640
|
values: n,
|
|
6620
6641
|
typeName: b.ZodNativeEnum,
|
|
6621
6642
|
...O(e)
|
|
6622
6643
|
});
|
|
6623
|
-
class
|
|
6644
|
+
class Ke extends Z {
|
|
6624
6645
|
unwrap() {
|
|
6625
6646
|
return this._def.type;
|
|
6626
6647
|
}
|
|
@@ -6639,7 +6660,7 @@ class He extends Z {
|
|
|
6639
6660
|
})));
|
|
6640
6661
|
}
|
|
6641
6662
|
}
|
|
6642
|
-
|
|
6663
|
+
Ke.create = (n, e) => new Ke({
|
|
6643
6664
|
type: n,
|
|
6644
6665
|
typeName: b.ZodPromise,
|
|
6645
6666
|
...O(e)
|
|
@@ -6663,45 +6684,45 @@ class J extends Z {
|
|
|
6663
6684
|
if (a.addIssue = a.addIssue.bind(a), r.type === "preprocess") {
|
|
6664
6685
|
const o = r.transform(s.data, a);
|
|
6665
6686
|
if (s.common.async)
|
|
6666
|
-
return Promise.resolve(o).then(async (
|
|
6687
|
+
return Promise.resolve(o).then(async (d) => {
|
|
6667
6688
|
if (t.value === "aborted")
|
|
6668
6689
|
return k;
|
|
6669
|
-
const
|
|
6670
|
-
data:
|
|
6690
|
+
const c = await this._def.schema._parseAsync({
|
|
6691
|
+
data: d,
|
|
6671
6692
|
path: s.path,
|
|
6672
6693
|
parent: s
|
|
6673
6694
|
});
|
|
6674
|
-
return
|
|
6695
|
+
return c.status === "aborted" ? k : c.status === "dirty" || t.value === "dirty" ? Ve(c.value) : c;
|
|
6675
6696
|
});
|
|
6676
6697
|
{
|
|
6677
6698
|
if (t.value === "aborted")
|
|
6678
6699
|
return k;
|
|
6679
|
-
const
|
|
6700
|
+
const d = this._def.schema._parseSync({
|
|
6680
6701
|
data: o,
|
|
6681
6702
|
path: s.path,
|
|
6682
6703
|
parent: s
|
|
6683
6704
|
});
|
|
6684
|
-
return
|
|
6705
|
+
return d.status === "aborted" ? k : d.status === "dirty" || t.value === "dirty" ? Ve(d.value) : d;
|
|
6685
6706
|
}
|
|
6686
6707
|
}
|
|
6687
6708
|
if (r.type === "refinement") {
|
|
6688
|
-
const o = (
|
|
6689
|
-
const
|
|
6709
|
+
const o = (d) => {
|
|
6710
|
+
const c = r.refinement(d, a);
|
|
6690
6711
|
if (s.common.async)
|
|
6691
|
-
return Promise.resolve(
|
|
6692
|
-
if (
|
|
6712
|
+
return Promise.resolve(c);
|
|
6713
|
+
if (c instanceof Promise)
|
|
6693
6714
|
throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
6694
|
-
return
|
|
6715
|
+
return d;
|
|
6695
6716
|
};
|
|
6696
6717
|
if (s.common.async === !1) {
|
|
6697
|
-
const
|
|
6718
|
+
const d = this._def.schema._parseSync({
|
|
6698
6719
|
data: s.data,
|
|
6699
6720
|
path: s.path,
|
|
6700
6721
|
parent: s
|
|
6701
6722
|
});
|
|
6702
|
-
return
|
|
6723
|
+
return d.status === "aborted" ? k : (d.status === "dirty" && t.dirty(), o(d.value), { status: t.value, value: d.value });
|
|
6703
6724
|
} else
|
|
6704
|
-
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((
|
|
6725
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((d) => d.status === "aborted" ? k : (d.status === "dirty" && t.dirty(), o(d.value).then(() => ({ status: t.value, value: d.value }))));
|
|
6705
6726
|
}
|
|
6706
6727
|
if (r.type === "transform")
|
|
6707
6728
|
if (s.common.async === !1) {
|
|
@@ -6710,14 +6731,14 @@ class J extends Z {
|
|
|
6710
6731
|
path: s.path,
|
|
6711
6732
|
parent: s
|
|
6712
6733
|
});
|
|
6713
|
-
if (!
|
|
6734
|
+
if (!mt(o))
|
|
6714
6735
|
return o;
|
|
6715
|
-
const
|
|
6716
|
-
if (
|
|
6736
|
+
const d = r.transform(o.value, a);
|
|
6737
|
+
if (d instanceof Promise)
|
|
6717
6738
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
6718
|
-
return { status: t.value, value:
|
|
6739
|
+
return { status: t.value, value: d };
|
|
6719
6740
|
} else
|
|
6720
|
-
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) =>
|
|
6741
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => mt(o) ? Promise.resolve(r.transform(o.value, a)).then((d) => ({ status: t.value, value: d })) : o);
|
|
6721
6742
|
C.assertNever(r);
|
|
6722
6743
|
}
|
|
6723
6744
|
}
|
|
@@ -6759,7 +6780,7 @@ be.create = (n, e) => new be({
|
|
|
6759
6780
|
typeName: b.ZodNullable,
|
|
6760
6781
|
...O(e)
|
|
6761
6782
|
});
|
|
6762
|
-
class
|
|
6783
|
+
class St extends Z {
|
|
6763
6784
|
_parse(e) {
|
|
6764
6785
|
const { ctx: t } = this._processInputParams(e);
|
|
6765
6786
|
let s = t.data;
|
|
@@ -6773,13 +6794,13 @@ class Zt extends Z {
|
|
|
6773
6794
|
return this._def.innerType;
|
|
6774
6795
|
}
|
|
6775
6796
|
}
|
|
6776
|
-
|
|
6797
|
+
St.create = (n, e) => new St({
|
|
6777
6798
|
innerType: n,
|
|
6778
6799
|
typeName: b.ZodDefault,
|
|
6779
6800
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
6780
6801
|
...O(e)
|
|
6781
6802
|
});
|
|
6782
|
-
class
|
|
6803
|
+
class Zt extends Z {
|
|
6783
6804
|
_parse(e) {
|
|
6784
6805
|
const { ctx: t } = this._processInputParams(e), s = {
|
|
6785
6806
|
...t,
|
|
@@ -6794,7 +6815,7 @@ class jt extends Z {
|
|
|
6794
6815
|
...s
|
|
6795
6816
|
}
|
|
6796
6817
|
});
|
|
6797
|
-
return
|
|
6818
|
+
return _t(r) ? r.then((a) => ({
|
|
6798
6819
|
status: "valid",
|
|
6799
6820
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
6800
6821
|
get error() {
|
|
@@ -6816,7 +6837,7 @@ class jt extends Z {
|
|
|
6816
6837
|
return this._def.innerType;
|
|
6817
6838
|
}
|
|
6818
6839
|
}
|
|
6819
|
-
|
|
6840
|
+
Zt.create = (n, e) => new Zt({
|
|
6820
6841
|
innerType: n,
|
|
6821
6842
|
typeName: b.ZodCatch,
|
|
6822
6843
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
@@ -6839,7 +6860,7 @@ qt.create = (n) => new qt({
|
|
|
6839
6860
|
typeName: b.ZodNaN,
|
|
6840
6861
|
...O(n)
|
|
6841
6862
|
});
|
|
6842
|
-
const
|
|
6863
|
+
const Ja = Symbol("zod_brand");
|
|
6843
6864
|
class pn extends Z {
|
|
6844
6865
|
_parse(e) {
|
|
6845
6866
|
const { ctx: t } = this._processInputParams(e), s = t.data;
|
|
@@ -6853,7 +6874,7 @@ class pn extends Z {
|
|
|
6853
6874
|
return this._def.type;
|
|
6854
6875
|
}
|
|
6855
6876
|
}
|
|
6856
|
-
class
|
|
6877
|
+
class Ct extends Z {
|
|
6857
6878
|
_parse(e) {
|
|
6858
6879
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
6859
6880
|
if (s.common.async)
|
|
@@ -6863,7 +6884,7 @@ class It extends Z {
|
|
|
6863
6884
|
path: s.path,
|
|
6864
6885
|
parent: s
|
|
6865
6886
|
});
|
|
6866
|
-
return a.status === "aborted" ? k : a.status === "dirty" ? (t.dirty(),
|
|
6887
|
+
return a.status === "aborted" ? k : a.status === "dirty" ? (t.dirty(), Ve(a.value)) : this._def.out._parseAsync({
|
|
6867
6888
|
data: a.value,
|
|
6868
6889
|
path: s.path,
|
|
6869
6890
|
parent: s
|
|
@@ -6886,71 +6907,71 @@ class It extends Z {
|
|
|
6886
6907
|
}
|
|
6887
6908
|
}
|
|
6888
6909
|
static create(e, t) {
|
|
6889
|
-
return new
|
|
6910
|
+
return new Ct({
|
|
6890
6911
|
in: e,
|
|
6891
6912
|
out: t,
|
|
6892
6913
|
typeName: b.ZodPipeline
|
|
6893
6914
|
});
|
|
6894
6915
|
}
|
|
6895
6916
|
}
|
|
6896
|
-
class
|
|
6917
|
+
class jt extends Z {
|
|
6897
6918
|
_parse(e) {
|
|
6898
|
-
const t = this._def.innerType._parse(e), s = (r) => (
|
|
6899
|
-
return
|
|
6919
|
+
const t = this._def.innerType._parse(e), s = (r) => (mt(r) && (r.value = Object.freeze(r.value)), r);
|
|
6920
|
+
return _t(t) ? t.then((r) => s(r)) : s(t);
|
|
6900
6921
|
}
|
|
6901
6922
|
unwrap() {
|
|
6902
6923
|
return this._def.innerType;
|
|
6903
6924
|
}
|
|
6904
6925
|
}
|
|
6905
|
-
|
|
6926
|
+
jt.create = (n, e) => new jt({
|
|
6906
6927
|
innerType: n,
|
|
6907
6928
|
typeName: b.ZodReadonly,
|
|
6908
6929
|
...O(e)
|
|
6909
6930
|
});
|
|
6910
|
-
function
|
|
6911
|
-
return n ?
|
|
6931
|
+
function Bn(n, e = {}, t) {
|
|
6932
|
+
return n ? Je.create().superRefine((s, r) => {
|
|
6912
6933
|
var a, o;
|
|
6913
6934
|
if (!n(s)) {
|
|
6914
|
-
const
|
|
6915
|
-
r.addIssue({ code: "custom", ...u, fatal:
|
|
6935
|
+
const d = typeof e == "function" ? e(s) : typeof e == "string" ? { message: e } : e, c = (o = (a = d.fatal) !== null && a !== void 0 ? a : t) !== null && o !== void 0 ? o : !0, u = typeof d == "string" ? { message: d } : d;
|
|
6936
|
+
r.addIssue({ code: "custom", ...u, fatal: c });
|
|
6916
6937
|
}
|
|
6917
|
-
}) :
|
|
6938
|
+
}) : Je.create();
|
|
6918
6939
|
}
|
|
6919
|
-
const
|
|
6940
|
+
const Ka = {
|
|
6920
6941
|
object: E.lazycreate
|
|
6921
6942
|
};
|
|
6922
6943
|
var b;
|
|
6923
6944
|
(function(n) {
|
|
6924
6945
|
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";
|
|
6925
6946
|
})(b || (b = {}));
|
|
6926
|
-
const
|
|
6947
|
+
const Ha = (n, e = {
|
|
6927
6948
|
message: `Input not instance of ${n.name}`
|
|
6928
|
-
}) =>
|
|
6949
|
+
}) => Bn((t) => t instanceof n, e), Wn = z.create, qn = ye.create, Qa = qt.create, Ya = ve.create, Jn = gt.create, Ga = Ce.create, Xa = zt.create, ei = yt.create, ti = vt.create, ni = Je.create, si = Ze.create, ri = ae.create, ai = Bt.create, ii = W.create, oi = E.create, di = E.strictCreate, ci = wt.create, ui = Kt.create, li = bt.create, pi = ne.create, hi = kt.create, fi = Wt.create, mi = Ie.create, _i = Fe.create, gi = xt.create, yi = Tt.create, vi = we.create, wi = Ot.create, bi = Ke.create, yn = J.create, ki = G.create, xi = be.create, Ti = J.createWithPreprocess, Oi = Ct.create, Si = () => Wn().optional(), Zi = () => qn().optional(), ji = () => Jn().optional(), Ni = {
|
|
6929
6950
|
string: (n) => z.create({ ...n, coerce: !0 }),
|
|
6930
6951
|
number: (n) => ye.create({ ...n, coerce: !0 }),
|
|
6931
|
-
boolean: (n) =>
|
|
6952
|
+
boolean: (n) => gt.create({
|
|
6932
6953
|
...n,
|
|
6933
6954
|
coerce: !0
|
|
6934
6955
|
}),
|
|
6935
6956
|
bigint: (n) => ve.create({ ...n, coerce: !0 }),
|
|
6936
6957
|
date: (n) => Ce.create({ ...n, coerce: !0 })
|
|
6937
|
-
},
|
|
6938
|
-
var
|
|
6958
|
+
}, Ci = k;
|
|
6959
|
+
var Ii = /* @__PURE__ */ Object.freeze({
|
|
6939
6960
|
__proto__: null,
|
|
6940
|
-
defaultErrorMap:
|
|
6941
|
-
setErrorMap:
|
|
6961
|
+
defaultErrorMap: qe,
|
|
6962
|
+
setErrorMap: Ca,
|
|
6942
6963
|
getErrorMap: Vt,
|
|
6943
6964
|
makeIssue: Ut,
|
|
6944
|
-
EMPTY_PATH:
|
|
6965
|
+
EMPTY_PATH: Ia,
|
|
6945
6966
|
addIssueToContext: m,
|
|
6946
6967
|
ParseStatus: P,
|
|
6947
6968
|
INVALID: k,
|
|
6948
|
-
DIRTY:
|
|
6969
|
+
DIRTY: Ve,
|
|
6949
6970
|
OK: M,
|
|
6950
6971
|
isAborted: rn,
|
|
6951
6972
|
isDirty: an,
|
|
6952
|
-
isValid:
|
|
6953
|
-
isAsync:
|
|
6973
|
+
isValid: mt,
|
|
6974
|
+
isAsync: _t,
|
|
6954
6975
|
get util() {
|
|
6955
6976
|
return C;
|
|
6956
6977
|
},
|
|
@@ -6960,107 +6981,107 @@ var Ci = /* @__PURE__ */ Object.freeze({
|
|
|
6960
6981
|
ZodParsedType: g,
|
|
6961
6982
|
getParsedType: he,
|
|
6962
6983
|
ZodType: Z,
|
|
6963
|
-
datetimeRegex:
|
|
6984
|
+
datetimeRegex: Fn,
|
|
6964
6985
|
ZodString: z,
|
|
6965
6986
|
ZodNumber: ye,
|
|
6966
6987
|
ZodBigInt: ve,
|
|
6967
|
-
ZodBoolean:
|
|
6988
|
+
ZodBoolean: gt,
|
|
6968
6989
|
ZodDate: Ce,
|
|
6969
6990
|
ZodSymbol: zt,
|
|
6970
|
-
ZodUndefined:
|
|
6971
|
-
ZodNull:
|
|
6972
|
-
ZodAny:
|
|
6991
|
+
ZodUndefined: yt,
|
|
6992
|
+
ZodNull: vt,
|
|
6993
|
+
ZodAny: Je,
|
|
6973
6994
|
ZodUnknown: Ze,
|
|
6974
6995
|
ZodNever: ae,
|
|
6975
6996
|
ZodVoid: Bt,
|
|
6976
6997
|
ZodArray: W,
|
|
6977
6998
|
ZodObject: E,
|
|
6978
|
-
ZodUnion:
|
|
6999
|
+
ZodUnion: wt,
|
|
6979
7000
|
ZodDiscriminatedUnion: Kt,
|
|
6980
|
-
ZodIntersection:
|
|
7001
|
+
ZodIntersection: bt,
|
|
6981
7002
|
ZodTuple: ne,
|
|
6982
|
-
ZodRecord:
|
|
7003
|
+
ZodRecord: kt,
|
|
6983
7004
|
ZodMap: Wt,
|
|
6984
7005
|
ZodSet: Ie,
|
|
6985
|
-
ZodFunction:
|
|
6986
|
-
ZodLazy:
|
|
6987
|
-
ZodLiteral:
|
|
7006
|
+
ZodFunction: Fe,
|
|
7007
|
+
ZodLazy: xt,
|
|
7008
|
+
ZodLiteral: Tt,
|
|
6988
7009
|
ZodEnum: we,
|
|
6989
|
-
ZodNativeEnum:
|
|
6990
|
-
ZodPromise:
|
|
7010
|
+
ZodNativeEnum: Ot,
|
|
7011
|
+
ZodPromise: Ke,
|
|
6991
7012
|
ZodEffects: J,
|
|
6992
7013
|
ZodTransformer: J,
|
|
6993
7014
|
ZodOptional: G,
|
|
6994
7015
|
ZodNullable: be,
|
|
6995
|
-
ZodDefault:
|
|
6996
|
-
ZodCatch:
|
|
7016
|
+
ZodDefault: St,
|
|
7017
|
+
ZodCatch: Zt,
|
|
6997
7018
|
ZodNaN: qt,
|
|
6998
|
-
BRAND:
|
|
7019
|
+
BRAND: Ja,
|
|
6999
7020
|
ZodBranded: pn,
|
|
7000
|
-
ZodPipeline:
|
|
7001
|
-
ZodReadonly:
|
|
7002
|
-
custom:
|
|
7021
|
+
ZodPipeline: Ct,
|
|
7022
|
+
ZodReadonly: jt,
|
|
7023
|
+
custom: Bn,
|
|
7003
7024
|
Schema: Z,
|
|
7004
7025
|
ZodSchema: Z,
|
|
7005
|
-
late:
|
|
7026
|
+
late: Ka,
|
|
7006
7027
|
get ZodFirstPartyTypeKind() {
|
|
7007
7028
|
return b;
|
|
7008
7029
|
},
|
|
7009
|
-
coerce:
|
|
7010
|
-
any:
|
|
7011
|
-
array:
|
|
7012
|
-
bigint:
|
|
7013
|
-
boolean:
|
|
7014
|
-
date:
|
|
7015
|
-
discriminatedUnion:
|
|
7016
|
-
effect:
|
|
7017
|
-
enum:
|
|
7018
|
-
function:
|
|
7019
|
-
instanceof:
|
|
7020
|
-
intersection:
|
|
7021
|
-
lazy:
|
|
7022
|
-
literal:
|
|
7023
|
-
map:
|
|
7024
|
-
nan:
|
|
7025
|
-
nativeEnum:
|
|
7026
|
-
never:
|
|
7027
|
-
null:
|
|
7028
|
-
nullable:
|
|
7029
|
-
number:
|
|
7030
|
-
object:
|
|
7031
|
-
oboolean:
|
|
7032
|
-
onumber:
|
|
7033
|
-
optional:
|
|
7034
|
-
ostring:
|
|
7035
|
-
pipeline:
|
|
7036
|
-
preprocess:
|
|
7037
|
-
promise:
|
|
7038
|
-
record:
|
|
7039
|
-
set:
|
|
7040
|
-
strictObject:
|
|
7041
|
-
string:
|
|
7042
|
-
symbol:
|
|
7043
|
-
transformer:
|
|
7044
|
-
tuple:
|
|
7045
|
-
undefined:
|
|
7030
|
+
coerce: Ni,
|
|
7031
|
+
any: ni,
|
|
7032
|
+
array: ii,
|
|
7033
|
+
bigint: Ya,
|
|
7034
|
+
boolean: Jn,
|
|
7035
|
+
date: Ga,
|
|
7036
|
+
discriminatedUnion: ui,
|
|
7037
|
+
effect: yn,
|
|
7038
|
+
enum: vi,
|
|
7039
|
+
function: _i,
|
|
7040
|
+
instanceof: Ha,
|
|
7041
|
+
intersection: li,
|
|
7042
|
+
lazy: gi,
|
|
7043
|
+
literal: yi,
|
|
7044
|
+
map: fi,
|
|
7045
|
+
nan: Qa,
|
|
7046
|
+
nativeEnum: wi,
|
|
7047
|
+
never: ri,
|
|
7048
|
+
null: ti,
|
|
7049
|
+
nullable: xi,
|
|
7050
|
+
number: qn,
|
|
7051
|
+
object: oi,
|
|
7052
|
+
oboolean: ji,
|
|
7053
|
+
onumber: Zi,
|
|
7054
|
+
optional: ki,
|
|
7055
|
+
ostring: Si,
|
|
7056
|
+
pipeline: Oi,
|
|
7057
|
+
preprocess: Ti,
|
|
7058
|
+
promise: bi,
|
|
7059
|
+
record: hi,
|
|
7060
|
+
set: mi,
|
|
7061
|
+
strictObject: di,
|
|
7062
|
+
string: Wn,
|
|
7063
|
+
symbol: Xa,
|
|
7064
|
+
transformer: yn,
|
|
7065
|
+
tuple: pi,
|
|
7066
|
+
undefined: ei,
|
|
7046
7067
|
union: ci,
|
|
7047
|
-
unknown:
|
|
7048
|
-
void:
|
|
7049
|
-
NEVER:
|
|
7068
|
+
unknown: si,
|
|
7069
|
+
void: ai,
|
|
7070
|
+
NEVER: Ci,
|
|
7050
7071
|
ZodIssueCode: h,
|
|
7051
|
-
quotelessJson:
|
|
7072
|
+
quotelessJson: Na,
|
|
7052
7073
|
ZodError: V
|
|
7053
7074
|
});
|
|
7054
|
-
|
|
7055
|
-
function
|
|
7075
|
+
ja(Ii);
|
|
7076
|
+
function It(n, e = "", t = {}) {
|
|
7056
7077
|
for (let s in n)
|
|
7057
7078
|
if (Object.prototype.hasOwnProperty.call(n, s)) {
|
|
7058
7079
|
const r = e ? `${e}_${s}` : s;
|
|
7059
|
-
typeof n[s] == "object" && n[s] !== null && !Array.isArray(n[s]) ?
|
|
7080
|
+
typeof n[s] == "object" && n[s] !== null && !Array.isArray(n[s]) ? It(n[s], r, t) : t[r] = n[s];
|
|
7060
7081
|
}
|
|
7061
7082
|
return t;
|
|
7062
7083
|
}
|
|
7063
|
-
function
|
|
7084
|
+
function Kn(n, e) {
|
|
7064
7085
|
const t = {};
|
|
7065
7086
|
for (const [s, r] of Object.entries(n)) {
|
|
7066
7087
|
const a = e.find(
|
|
@@ -7078,25 +7099,14 @@ function hn(n, e) {
|
|
|
7078
7099
|
}
|
|
7079
7100
|
return t;
|
|
7080
7101
|
}
|
|
7081
|
-
function Ii(n) {
|
|
7082
|
-
return async (e, t) => {
|
|
7083
|
-
const s = {
|
|
7084
|
-
id: Ae(),
|
|
7085
|
-
...t,
|
|
7086
|
-
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7087
|
-
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7088
|
-
};
|
|
7089
|
-
return await n.insertInto("connections").values({ ...Re(s), tenant_id: e }).execute(), s;
|
|
7090
|
-
};
|
|
7091
|
-
}
|
|
7092
7102
|
function Ei(n) {
|
|
7093
7103
|
return async (e, t) => {
|
|
7094
7104
|
let s = n.selectFrom("connections").where("connections.tenant_id", "=", e);
|
|
7095
7105
|
t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
|
|
7096
|
-
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((
|
|
7106
|
+
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
7097
7107
|
return {
|
|
7098
7108
|
connections: a.map(
|
|
7099
|
-
(
|
|
7109
|
+
(d) => R(Kn(d, ["options"]))
|
|
7100
7110
|
),
|
|
7101
7111
|
start: t.page * t.per_page,
|
|
7102
7112
|
limit: t.per_page,
|
|
@@ -7110,7 +7120,10 @@ function Ai(n) {
|
|
|
7110
7120
|
function Ri(n) {
|
|
7111
7121
|
return async (e, t) => {
|
|
7112
7122
|
const s = await n.selectFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).selectAll().executeTakeFirst();
|
|
7113
|
-
return s ? R(
|
|
7123
|
+
return s ? R({
|
|
7124
|
+
...s,
|
|
7125
|
+
options: JSON.parse(s.options)
|
|
7126
|
+
}) : null;
|
|
7114
7127
|
};
|
|
7115
7128
|
}
|
|
7116
7129
|
function $i(n) {
|
|
@@ -7119,12 +7132,15 @@ function $i(n) {
|
|
|
7119
7132
|
...s,
|
|
7120
7133
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7121
7134
|
};
|
|
7122
|
-
return await n.updateTable("connections").set(
|
|
7135
|
+
return await n.updateTable("connections").set({
|
|
7136
|
+
...r,
|
|
7137
|
+
options: r.options ? JSON.stringify(r.options) : void 0
|
|
7138
|
+
}).where("connections.id", "=", t).where("connections.tenant_id", "=", e).execute(), !0;
|
|
7123
7139
|
};
|
|
7124
7140
|
}
|
|
7125
7141
|
function Pi(n) {
|
|
7126
7142
|
return {
|
|
7127
|
-
create:
|
|
7143
|
+
create: Oa(n),
|
|
7128
7144
|
get: Ri(n),
|
|
7129
7145
|
list: Ei(n),
|
|
7130
7146
|
remove: Ai(n),
|
|
@@ -7144,7 +7160,7 @@ function Di(n) {
|
|
|
7144
7160
|
return {
|
|
7145
7161
|
...t,
|
|
7146
7162
|
connections: r.map(
|
|
7147
|
-
(
|
|
7163
|
+
(d) => Rn.parse(R(d))
|
|
7148
7164
|
),
|
|
7149
7165
|
domains: a,
|
|
7150
7166
|
addons: t.addons ? JSON.parse(t.addons) : {},
|
|
@@ -7194,7 +7210,7 @@ function zi(n) {
|
|
|
7194
7210
|
return async (e, t) => {
|
|
7195
7211
|
let s = n.selectFrom("domains").where("domains.tenant_id", "=", e);
|
|
7196
7212
|
t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
|
|
7197
|
-
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((
|
|
7213
|
+
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
7198
7214
|
return {
|
|
7199
7215
|
domains: a,
|
|
7200
7216
|
start: t.page * t.per_page,
|
|
@@ -7219,8 +7235,8 @@ function Wi(n) {
|
|
|
7219
7235
|
colors_primary: r,
|
|
7220
7236
|
colors_page_background_type: a,
|
|
7221
7237
|
colors_page_background_start: o,
|
|
7222
|
-
colors_page_background_end:
|
|
7223
|
-
colors_page_background_angle_dev:
|
|
7238
|
+
colors_page_background_end: d,
|
|
7239
|
+
colors_page_background_angle_dev: c,
|
|
7224
7240
|
font_url: u,
|
|
7225
7241
|
...l
|
|
7226
7242
|
} = t;
|
|
@@ -7231,8 +7247,8 @@ function Wi(n) {
|
|
|
7231
7247
|
page_background: {
|
|
7232
7248
|
type: a,
|
|
7233
7249
|
start: o,
|
|
7234
|
-
end:
|
|
7235
|
-
angle_deg:
|
|
7250
|
+
end: d,
|
|
7251
|
+
angle_deg: c
|
|
7236
7252
|
}
|
|
7237
7253
|
},
|
|
7238
7254
|
font: u ? { url: u } : void 0
|
|
@@ -7241,14 +7257,14 @@ function Wi(n) {
|
|
|
7241
7257
|
}
|
|
7242
7258
|
function qi(n) {
|
|
7243
7259
|
return async (e, t) => {
|
|
7244
|
-
var o,
|
|
7260
|
+
var o, d, c, u, l, j, A, U, ie, Re, oe, de, ce, $e, Pe, K, H, Q;
|
|
7245
7261
|
const { colors: s, font: r, ...a } = t;
|
|
7246
7262
|
try {
|
|
7247
7263
|
await n.insertInto("branding").values({
|
|
7248
7264
|
...a,
|
|
7249
7265
|
colors_primary: s == null ? void 0 : s.primary,
|
|
7250
|
-
colors_page_background_type: (
|
|
7251
|
-
colors_page_background_start: (u = (
|
|
7266
|
+
colors_page_background_type: (d = (o = t.colors) == null ? void 0 : o.page_background) == null ? void 0 : d.type,
|
|
7267
|
+
colors_page_background_start: (u = (c = t.colors) == null ? void 0 : c.page_background) == null ? void 0 : u.start,
|
|
7252
7268
|
colors_page_background_end: (j = (l = t.colors) == null ? void 0 : l.page_background) == null ? void 0 : j.end,
|
|
7253
7269
|
colors_page_background_angle_dev: (U = (A = t.colors) == null ? void 0 : A.page_background) == null ? void 0 : U.angle_deg,
|
|
7254
7270
|
font_url: (ie = t.font) == null ? void 0 : ie.url,
|
|
@@ -7258,9 +7274,9 @@ function qi(n) {
|
|
|
7258
7274
|
await n.updateTable("branding").set({
|
|
7259
7275
|
...a,
|
|
7260
7276
|
colors_primary: s == null ? void 0 : s.primary,
|
|
7261
|
-
colors_page_background_type: (oe = (
|
|
7262
|
-
colors_page_background_start: (
|
|
7263
|
-
colors_page_background_end: (
|
|
7277
|
+
colors_page_background_type: (oe = (Re = t.colors) == null ? void 0 : Re.page_background) == null ? void 0 : oe.type,
|
|
7278
|
+
colors_page_background_start: (ce = (de = t.colors) == null ? void 0 : de.page_background) == null ? void 0 : ce.start,
|
|
7279
|
+
colors_page_background_end: (Pe = ($e = t.colors) == null ? void 0 : $e.page_background) == null ? void 0 : Pe.end,
|
|
7264
7280
|
colors_page_background_angle_dev: (H = (K = t.colors) == null ? void 0 : K.page_background) == null ? void 0 : H.angle_deg,
|
|
7265
7281
|
font_url: (Q = t.font) == null ? void 0 : Q.url
|
|
7266
7282
|
}).where("tenant_id", "=", e).execute();
|
|
@@ -7277,10 +7293,10 @@ function Ki(n) {
|
|
|
7277
7293
|
return async (e, t) => {
|
|
7278
7294
|
let s = n.selectFrom("hooks").where("hooks.tenant_id", "=", e);
|
|
7279
7295
|
t.q && (s = Ee(n, s, t.q, ["url"]));
|
|
7280
|
-
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((
|
|
7296
|
+
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
7281
7297
|
return {
|
|
7282
|
-
hooks: a.map((
|
|
7283
|
-
const { tenant_id: u, enabled: l, synchronous: j, ...A } =
|
|
7298
|
+
hooks: a.map((c) => {
|
|
7299
|
+
const { tenant_id: u, enabled: l, synchronous: j, ...A } = c;
|
|
7284
7300
|
return R({
|
|
7285
7301
|
...A,
|
|
7286
7302
|
enabled: !!l,
|
|
@@ -7342,7 +7358,7 @@ function eo(n) {
|
|
|
7342
7358
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7343
7359
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7344
7360
|
};
|
|
7345
|
-
return await n.insertInto("themes").values({ ...
|
|
7361
|
+
return await n.insertInto("themes").values({ ...It(s), tenant_id: e }).execute(), s;
|
|
7346
7362
|
};
|
|
7347
7363
|
}
|
|
7348
7364
|
function to(n) {
|
|
@@ -7356,7 +7372,7 @@ function no(n) {
|
|
|
7356
7372
|
}
|
|
7357
7373
|
function so(n) {
|
|
7358
7374
|
return async (e, t, s) => {
|
|
7359
|
-
const r =
|
|
7375
|
+
const r = It({
|
|
7360
7376
|
...s,
|
|
7361
7377
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7362
7378
|
});
|
|
@@ -7375,7 +7391,7 @@ function ao(n) {
|
|
|
7375
7391
|
return async (e, t) => {
|
|
7376
7392
|
const s = (/* @__PURE__ */ new Date()).toISOString(), r = await n.selectFrom("logins").where("logins.expires_at", ">", s).where("logins.login_id", "=", t).selectAll().executeTakeFirst();
|
|
7377
7393
|
return r ? xr.parse(
|
|
7378
|
-
|
|
7394
|
+
Kn(R(r), ["authParams"])
|
|
7379
7395
|
) : null;
|
|
7380
7396
|
};
|
|
7381
7397
|
}
|
|
@@ -7387,11 +7403,11 @@ function io(n) {
|
|
|
7387
7403
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7388
7404
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7389
7405
|
};
|
|
7390
|
-
return await n.insertInto("logins").values({ ...
|
|
7406
|
+
return await n.insertInto("logins").values({ ...It(s), tenant_id: e }).execute(), s;
|
|
7391
7407
|
};
|
|
7392
7408
|
}
|
|
7393
7409
|
function oo(n) {
|
|
7394
|
-
return async (e, t, s) => (await n.updateTable("logins").set(
|
|
7410
|
+
return async (e, t, s) => (await n.updateTable("logins").set(It(s)).where("logins.login_id", "=", t).where("logins.tenant_id", "=", e).execute()).length === 1;
|
|
7395
7411
|
}
|
|
7396
7412
|
function co(n) {
|
|
7397
7413
|
return async (e, t) => (await n.deleteFrom("logins").where("logins.tenant_id", "=", e).where("logins.login_id", "=", t).execute()).length > 0;
|
|
@@ -7415,7 +7431,7 @@ function lo(n) {
|
|
|
7415
7431
|
});
|
|
7416
7432
|
};
|
|
7417
7433
|
}
|
|
7418
|
-
function
|
|
7434
|
+
function vn(n) {
|
|
7419
7435
|
return R({
|
|
7420
7436
|
...n,
|
|
7421
7437
|
webauthn_platform_first_factor: n.webauthn_platform_first_factor ? !!n.webauthn_platform_first_factor : void 0,
|
|
@@ -7429,11 +7445,11 @@ function po(n) {
|
|
|
7429
7445
|
try {
|
|
7430
7446
|
const s = Rr.parse(t);
|
|
7431
7447
|
await n.insertInto("prompt_settings").values({
|
|
7432
|
-
...
|
|
7448
|
+
...vn(s),
|
|
7433
7449
|
tenant_id: e
|
|
7434
7450
|
}).execute();
|
|
7435
7451
|
} catch {
|
|
7436
|
-
await n.updateTable("prompt_settings").set(
|
|
7452
|
+
await n.updateTable("prompt_settings").set(vn(t)).where("tenant_id", "=", e).execute();
|
|
7437
7453
|
}
|
|
7438
7454
|
};
|
|
7439
7455
|
}
|
|
@@ -7461,7 +7477,7 @@ function mo(n) {
|
|
|
7461
7477
|
sessions: aa(n),
|
|
7462
7478
|
tenants: Kr(n),
|
|
7463
7479
|
themes: ro(n),
|
|
7464
|
-
tickets:
|
|
7480
|
+
tickets: ca(n)
|
|
7465
7481
|
};
|
|
7466
7482
|
}
|
|
7467
7483
|
export {
|