@authhero/kysely-adapter 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kysely-adapter.cjs +1 -1
- package/dist/kysely-adapter.d.ts +34 -11
- package/dist/kysely-adapter.iife.js +1 -1
- package/dist/kysely-adapter.mjs +394 -382
- 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);
|
|
@@ -71,14 +71,14 @@ function es(n) {
|
|
|
71
71
|
return;
|
|
72
72
|
n.ZodType.prototype.openapi = function(r, a) {
|
|
73
73
|
var o, c, d, u, l, j;
|
|
74
|
-
const A = typeof r == "string" ? a : r, U = A ?? {}, { param: ie } = U,
|
|
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), ce = Object.assign(Object.assign(Object.assign({}, (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata), Re), !((u = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.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
76
|
} : void 0), de = 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(ce).length > 0 ? { metadata: ce } : void 0) }));
|
|
77
77
|
if (Xn(this, "ZodObject")) {
|
|
78
|
-
const
|
|
79
|
-
de.extend = function(...
|
|
78
|
+
const $e = this.extend;
|
|
79
|
+
de.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
|
|
@@ -88,7 +88,7 @@ function es(n) {
|
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
90
|
return de;
|
|
91
|
-
},
|
|
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();
|
|
@@ -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 = {
|
|
@@ -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.");
|
|
@@ -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,8 +547,8 @@ 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;
|
|
@@ -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,
|
|
@@ -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;
|
|
@@ -649,16 +649,16 @@ class S {
|
|
|
649
649
|
}
|
|
650
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, cs = /^[a-z0-9_-]{21}$/i, ds = /^[-+]?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
|
}
|
|
@@ -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
|
|
@@ -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
|
});
|
|
@@ -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() {
|
|
@@ -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,7 +1905,7 @@ 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) {
|
|
@@ -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 dt ? 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 cn || 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);
|
|
@@ -2067,7 +2067,7 @@ function nn(n, e) {
|
|
|
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))
|
|
@@ -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,
|
|
@@ -2155,7 +2155,7 @@ ee.create = (n, e) => {
|
|
|
2155
2155
|
...T(e)
|
|
2156
2156
|
});
|
|
2157
2157
|
};
|
|
2158
|
-
class
|
|
2158
|
+
class ct extends S {
|
|
2159
2159
|
get keySchema() {
|
|
2160
2160
|
return this._def.keyType;
|
|
2161
2161
|
}
|
|
@@ -2183,12 +2183,12 @@ class dt extends S {
|
|
|
2183
2183
|
return this._def.valueType;
|
|
2184
2184
|
}
|
|
2185
2185
|
static create(e, t, s) {
|
|
2186
|
-
return t instanceof S ? new
|
|
2186
|
+
return t instanceof S ? new ct({
|
|
2187
2187
|
keyType: e,
|
|
2188
2188
|
valueType: t,
|
|
2189
2189
|
typeName: w.ZodRecord,
|
|
2190
2190
|
...T(s)
|
|
2191
|
-
}) : new
|
|
2191
|
+
}) : new ct({
|
|
2192
2192
|
keyType: F.create(),
|
|
2193
2193
|
valueType: e,
|
|
2194
2194
|
typeName: w.ZodRecord,
|
|
@@ -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
|
}
|
|
@@ -2328,7 +2328,7 @@ class Fe extends S {
|
|
|
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,
|
|
@@ -2344,7 +2344,7 @@ class Fe extends S {
|
|
|
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,
|
|
@@ -2353,7 +2353,7 @@ class Fe extends S {
|
|
|
2353
2353
|
});
|
|
2354
2354
|
}
|
|
2355
2355
|
const a = { errorMap: t.common.contextualErrorMap }, o = t.data;
|
|
2356
|
-
if (this._def.returns instanceof
|
|
2356
|
+
if (this._def.returns instanceof We) {
|
|
2357
2357
|
const c = this;
|
|
2358
2358
|
return D(async function(...d) {
|
|
2359
2359
|
const u = new L([]), l = await c._def.args.parseAsync(d, a).catch((A) => {
|
|
@@ -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 dt 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
|
+
dt.create = (n, e) => new dt({
|
|
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)
|
|
@@ -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
2639
|
const c = r.transform(o.value, a);
|
|
2640
2640
|
if (c instanceof Promise)
|
|
2641
2641
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2642
2642
|
return { status: t.value, value: c };
|
|
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((c) => ({ status: t.value, value: c })) : 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,
|
|
@@ -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
2838
|
const c = typeof e == "function" ? e(s) : typeof e == "string" ? { message: e } : e, d = (o = (a = c.fatal) !== null && a !== void 0 ? a : t) !== null && o !== void 0 ? o : !0, u = typeof c == "string" ? { message: c } : c;
|
|
2839
2839
|
r.addIssue({ code: "custom", ...u, fatal: d });
|
|
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 = ct.create, Vs = Mt.create, Us = Ne.create, Fs = Ue.create, zs = dt.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
|
-
ZodRecord:
|
|
2906
|
+
ZodRecord: ct,
|
|
2907
2907
|
ZodMap: Mt,
|
|
2908
2908
|
ZodSet: Ne,
|
|
2909
|
-
ZodFunction:
|
|
2910
|
-
ZodLazy:
|
|
2911
|
-
ZodLiteral:
|
|
2909
|
+
ZodFunction: Ue,
|
|
2910
|
+
ZodLazy: dt,
|
|
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
2923
|
ZodBranded: cn,
|
|
2924
|
-
ZodPipeline:
|
|
2925
|
-
ZodReadonly:
|
|
2926
|
-
custom:
|
|
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,
|
|
@@ -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(),
|
|
@@ -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(),
|
|
@@ -3098,18 +3098,18 @@ const cr = i.object({
|
|
|
3098
3098
|
updated_at: i.string().transform((n) => n === null ? "" : n),
|
|
3099
3099
|
...dr.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,14 @@ 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()
|
|
3154
3156
|
}).default({}).optional(),
|
|
3155
3157
|
enabled_clients: i.array(i.string()).default([]).optional(),
|
|
3156
|
-
authorization_endpoint: i.string().default("").optional(),
|
|
3157
3158
|
response_type: i.custom().optional(),
|
|
3158
3159
|
response_mode: i.custom().optional()
|
|
3159
|
-
}),
|
|
3160
|
+
}), Rn = i.object({
|
|
3160
3161
|
id: i.string(),
|
|
3161
3162
|
created_at: i.string().transform((n) => n === null ? "" : n),
|
|
3162
3163
|
updated_at: i.string().transform((n) => n === null ? "" : n)
|
|
@@ -3205,7 +3206,7 @@ i.object({
|
|
|
3205
3206
|
...ur.shape,
|
|
3206
3207
|
domains: i.array(mr),
|
|
3207
3208
|
tenant: fr,
|
|
3208
|
-
connections: i.array(
|
|
3209
|
+
connections: i.array(Rn)
|
|
3209
3210
|
});
|
|
3210
3211
|
const _r = i.enum([
|
|
3211
3212
|
"password_reset",
|
|
@@ -3440,8 +3441,8 @@ i.object({
|
|
|
3440
3441
|
revoked: i.boolean().optional().openapi({ description: "True if the key is revoked" }),
|
|
3441
3442
|
revoked_at: i.string().optional().openapi({ description: "The date and time when the key was revoked" })
|
|
3442
3443
|
});
|
|
3443
|
-
var
|
|
3444
|
-
const un = i.nativeEnum(
|
|
3444
|
+
var $n = /* @__PURE__ */ ((n) => (n.RefreshToken = "refresh_token", n.AuthorizationCode = "authorization_code", n.ClientCredential = "client_credentials", n.Passwordless = "passwordless", n.Password = "password", n))($n || {});
|
|
3445
|
+
const un = i.nativeEnum($n);
|
|
3445
3446
|
i.object({
|
|
3446
3447
|
grant_type: un.refine(
|
|
3447
3448
|
(n) => n === "authorization_code"
|
|
@@ -3514,19 +3515,19 @@ const jr = i.object({
|
|
|
3514
3515
|
success: i.string(),
|
|
3515
3516
|
widget_background: i.string(),
|
|
3516
3517
|
widget_border: i.string()
|
|
3517
|
-
}),
|
|
3518
|
+
}), De = i.object({
|
|
3518
3519
|
bold: i.boolean(),
|
|
3519
3520
|
size: i.number()
|
|
3520
3521
|
}), Cr = i.object({
|
|
3521
|
-
body_text:
|
|
3522
|
-
buttons_text:
|
|
3522
|
+
body_text: De,
|
|
3523
|
+
buttons_text: De,
|
|
3523
3524
|
font_url: i.string(),
|
|
3524
|
-
input_labels:
|
|
3525
|
-
links:
|
|
3525
|
+
input_labels: De,
|
|
3526
|
+
links: De,
|
|
3526
3527
|
links_style: i.enum(["normal"]),
|
|
3527
3528
|
reference_text_size: i.number(),
|
|
3528
|
-
subtitle:
|
|
3529
|
-
title:
|
|
3529
|
+
subtitle: De,
|
|
3530
|
+
title: De
|
|
3530
3531
|
}), Ir = i.object({
|
|
3531
3532
|
background_color: i.string(),
|
|
3532
3533
|
background_image_url: i.string(),
|
|
@@ -3560,7 +3561,7 @@ function ln(n) {
|
|
|
3560
3561
|
throw new Error(`Invalid user_id: ${n}`);
|
|
3561
3562
|
return { connection: e, id: t };
|
|
3562
3563
|
}
|
|
3563
|
-
function
|
|
3564
|
+
function Pn(n) {
|
|
3564
3565
|
let e = {};
|
|
3565
3566
|
try {
|
|
3566
3567
|
e = JSON.parse(n.profileData || "{}");
|
|
@@ -3599,7 +3600,7 @@ function $r(n) {
|
|
|
3599
3600
|
user_id: ln(s.user_id).id,
|
|
3600
3601
|
isSocial: !!s.is_social
|
|
3601
3602
|
},
|
|
3602
|
-
...r.map(
|
|
3603
|
+
...r.map(Pn)
|
|
3603
3604
|
]
|
|
3604
3605
|
};
|
|
3605
3606
|
return R(c);
|
|
@@ -3667,7 +3668,7 @@ function Pr(n) {
|
|
|
3667
3668
|
user_id: ln(l.user_id).id,
|
|
3668
3669
|
isSocial: !!l.is_social
|
|
3669
3670
|
},
|
|
3670
|
-
...j.map(
|
|
3671
|
+
...j.map(Pn)
|
|
3671
3672
|
]
|
|
3672
3673
|
});
|
|
3673
3674
|
}), { count: u } = await s.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
@@ -3781,7 +3782,7 @@ function Kr(n) {
|
|
|
3781
3782
|
remove: Jr(n)
|
|
3782
3783
|
};
|
|
3783
3784
|
}
|
|
3784
|
-
function
|
|
3785
|
+
function mn(n) {
|
|
3785
3786
|
return n ? JSON.stringify(n) : void 0;
|
|
3786
3787
|
}
|
|
3787
3788
|
const Hr = 1024;
|
|
@@ -3800,12 +3801,12 @@ function Qr(n) {
|
|
|
3800
3801
|
isMobile: t.isMobile ? 1 : 0,
|
|
3801
3802
|
tenant_id: e,
|
|
3802
3803
|
scope: (a = t.scope) == null ? void 0 : a.join(","),
|
|
3803
|
-
auth0_client:
|
|
3804
|
-
details: (o =
|
|
3804
|
+
auth0_client: mn(t.auth0_client),
|
|
3805
|
+
details: (o = mn(t.details)) == null ? void 0 : o.substring(0, 8192)
|
|
3805
3806
|
}).execute(), s;
|
|
3806
3807
|
};
|
|
3807
3808
|
}
|
|
3808
|
-
function
|
|
3809
|
+
function _n(n) {
|
|
3809
3810
|
if (!n)
|
|
3810
3811
|
return "";
|
|
3811
3812
|
try {
|
|
@@ -3814,13 +3815,13 @@ function gn(n) {
|
|
|
3814
3815
|
return n;
|
|
3815
3816
|
}
|
|
3816
3817
|
}
|
|
3817
|
-
function
|
|
3818
|
+
function Dn(n) {
|
|
3818
3819
|
return {
|
|
3819
3820
|
...n,
|
|
3820
3821
|
client_id: n.client_id,
|
|
3821
3822
|
client_name: "",
|
|
3822
|
-
auth0_client:
|
|
3823
|
-
details:
|
|
3823
|
+
auth0_client: _n(n.auth0_client),
|
|
3824
|
+
details: _n(n.details),
|
|
3824
3825
|
isMobile: !!n.isMobile,
|
|
3825
3826
|
scope: n.scope ? n.scope.split(",") : void 0,
|
|
3826
3827
|
log_id: n.id,
|
|
@@ -3842,7 +3843,7 @@ function Yr(n) {
|
|
|
3842
3843
|
r = r.offset(t.page * t.per_page).limit(t.per_page);
|
|
3843
3844
|
const a = await r.selectAll().execute(), { count: o } = await s.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
3844
3845
|
return {
|
|
3845
|
-
logs: a.map(
|
|
3846
|
+
logs: a.map(Dn),
|
|
3846
3847
|
start: t.page * t.per_page,
|
|
3847
3848
|
limit: t.per_page,
|
|
3848
3849
|
length: ke(o)
|
|
@@ -3852,7 +3853,7 @@ function Yr(n) {
|
|
|
3852
3853
|
function Gr(n) {
|
|
3853
3854
|
return async (e, t) => {
|
|
3854
3855
|
const s = await n.selectFrom("logs").where("logs.tenant_id", "=", e).where("logs.id", "=", t).selectAll().executeTakeFirst();
|
|
3855
|
-
return s ?
|
|
3856
|
+
return s ? Dn(s) : null;
|
|
3856
3857
|
};
|
|
3857
3858
|
}
|
|
3858
3859
|
function Xr(n) {
|
|
@@ -4123,7 +4124,23 @@ function Ta(n) {
|
|
|
4123
4124
|
update: xa(n)
|
|
4124
4125
|
};
|
|
4125
4126
|
}
|
|
4126
|
-
function Oa(n
|
|
4127
|
+
function Oa(n) {
|
|
4128
|
+
return async (e, t) => {
|
|
4129
|
+
const s = {
|
|
4130
|
+
id: Ae(),
|
|
4131
|
+
...t,
|
|
4132
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4133
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
4134
|
+
};
|
|
4135
|
+
return await n.insertInto("connections").values({
|
|
4136
|
+
...s,
|
|
4137
|
+
// The connection options will have many different properties depending on the strategy
|
|
4138
|
+
options: JSON.stringify(s.options || {}),
|
|
4139
|
+
tenant_id: e
|
|
4140
|
+
}).execute(), s;
|
|
4141
|
+
};
|
|
4142
|
+
}
|
|
4143
|
+
function Sa(n, e) {
|
|
4127
4144
|
var t = {};
|
|
4128
4145
|
for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && e.indexOf(s) < 0 && (t[s] = n[s]);
|
|
4129
4146
|
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -4131,30 +4148,30 @@ function Oa(n, e) {
|
|
|
4131
4148
|
e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, s[r]) && (t[s[r]] = n[s[r]]);
|
|
4132
4149
|
return t;
|
|
4133
4150
|
}
|
|
4134
|
-
function
|
|
4151
|
+
function Za(n, e) {
|
|
4135
4152
|
var t;
|
|
4136
4153
|
return ((t = n == null ? void 0 : n._def) === null || t === void 0 ? void 0 : t.typeName) === e;
|
|
4137
4154
|
}
|
|
4138
|
-
function
|
|
4155
|
+
function Qe(n, e) {
|
|
4139
4156
|
const t = n.ZodType.prototype[e];
|
|
4140
4157
|
n.ZodType.prototype[e] = function(...s) {
|
|
4141
4158
|
const r = t.apply(this, s);
|
|
4142
4159
|
return r._def.openapi = this._def.openapi, r;
|
|
4143
4160
|
};
|
|
4144
4161
|
}
|
|
4145
|
-
function
|
|
4162
|
+
function ja(n) {
|
|
4146
4163
|
if (typeof n.ZodType.prototype.openapi < "u")
|
|
4147
4164
|
return;
|
|
4148
4165
|
n.ZodType.prototype.openapi = function(r, a) {
|
|
4149
4166
|
var o, c, d, u, l, j;
|
|
4150
|
-
const A = typeof r == "string" ? a : r, U = A ?? {}, { param: ie } = U,
|
|
4167
|
+
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), ce = Object.assign(Object.assign(Object.assign({}, (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata), Re), !((u = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || u === void 0) && u.param || ie ? {
|
|
4151
4168
|
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
4169
|
} : void 0), de = 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(ce).length > 0 ? { metadata: ce } : void 0) }));
|
|
4153
|
-
if (
|
|
4154
|
-
const
|
|
4155
|
-
de.extend = function(...
|
|
4170
|
+
if (Za(this, "ZodObject")) {
|
|
4171
|
+
const $e = this.extend;
|
|
4172
|
+
de.extend = function(...Pe) {
|
|
4156
4173
|
var K, H, Q, ue, xe, Te;
|
|
4157
|
-
const Oe =
|
|
4174
|
+
const Oe = $e.apply(this, Pe);
|
|
4158
4175
|
return Oe._def.openapi = {
|
|
4159
4176
|
_internal: {
|
|
4160
4177
|
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
|
|
@@ -4164,7 +4181,7 @@ function Za(n) {
|
|
|
4164
4181
|
};
|
|
4165
4182
|
}
|
|
4166
4183
|
return de;
|
|
4167
|
-
},
|
|
4184
|
+
}, Qe(n, "optional"), Qe(n, "nullable"), Qe(n, "default"), Qe(n, "transform"), Qe(n, "refine");
|
|
4168
4185
|
const e = n.ZodObject.prototype.deepPartial;
|
|
4169
4186
|
n.ZodObject.prototype.deepPartial = function() {
|
|
4170
4187
|
const r = this._def.shape(), a = e.apply(this), o = a._def.shape();
|
|
@@ -4288,7 +4305,7 @@ const g = C.arrayToEnum([
|
|
|
4288
4305
|
"invalid_intersection_types",
|
|
4289
4306
|
"not_multiple_of",
|
|
4290
4307
|
"not_finite"
|
|
4291
|
-
]),
|
|
4308
|
+
]), Na = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
4292
4309
|
class V extends Error {
|
|
4293
4310
|
constructor(e) {
|
|
4294
4311
|
super(), this.issues = [], this.addIssue = (s) => {
|
|
@@ -4349,7 +4366,7 @@ class V extends Error {
|
|
|
4349
4366
|
}
|
|
4350
4367
|
}
|
|
4351
4368
|
V.create = (n) => new V(n);
|
|
4352
|
-
const
|
|
4369
|
+
const qe = (n, e) => {
|
|
4353
4370
|
let t;
|
|
4354
4371
|
switch (n.code) {
|
|
4355
4372
|
case h.invalid_type:
|
|
@@ -4405,12 +4422,12 @@ const Je = (n, e) => {
|
|
|
4405
4422
|
}
|
|
4406
4423
|
return { message: t };
|
|
4407
4424
|
};
|
|
4408
|
-
let
|
|
4409
|
-
function
|
|
4410
|
-
|
|
4425
|
+
let Mn = qe;
|
|
4426
|
+
function Ca(n) {
|
|
4427
|
+
Mn = n;
|
|
4411
4428
|
}
|
|
4412
4429
|
function Vt() {
|
|
4413
|
-
return
|
|
4430
|
+
return Mn;
|
|
4414
4431
|
}
|
|
4415
4432
|
const Ut = (n) => {
|
|
4416
4433
|
const { data: e, path: t, errorMaps: s, issueData: r } = n, a = [...t, ...r.path || []], o = {
|
|
@@ -4432,7 +4449,7 @@ const Ut = (n) => {
|
|
|
4432
4449
|
path: a,
|
|
4433
4450
|
message: c
|
|
4434
4451
|
};
|
|
4435
|
-
},
|
|
4452
|
+
}, Ia = [];
|
|
4436
4453
|
function m(n, e) {
|
|
4437
4454
|
const t = Vt(), s = Ut({
|
|
4438
4455
|
issueData: e,
|
|
@@ -4442,7 +4459,7 @@ function m(n, e) {
|
|
|
4442
4459
|
n.common.contextualErrorMap,
|
|
4443
4460
|
n.schemaErrorMap,
|
|
4444
4461
|
t,
|
|
4445
|
-
t ===
|
|
4462
|
+
t === qe ? void 0 : qe
|
|
4446
4463
|
// then global default map
|
|
4447
4464
|
].filter((r) => !!r)
|
|
4448
4465
|
});
|
|
@@ -4491,12 +4508,12 @@ class P {
|
|
|
4491
4508
|
}
|
|
4492
4509
|
const k = Object.freeze({
|
|
4493
4510
|
status: "aborted"
|
|
4494
|
-
}),
|
|
4511
|
+
}), 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
4512
|
function Ft(n, e, t, s) {
|
|
4496
4513
|
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
4514
|
return e.get(n);
|
|
4498
4515
|
}
|
|
4499
|
-
function
|
|
4516
|
+
function Ln(n, e, t, s, r) {
|
|
4500
4517
|
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
4518
|
return e.set(n, t), t;
|
|
4502
4519
|
}
|
|
@@ -4504,7 +4521,7 @@ var v;
|
|
|
4504
4521
|
(function(n) {
|
|
4505
4522
|
n.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, n.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
4506
4523
|
})(v || (v = {}));
|
|
4507
|
-
var
|
|
4524
|
+
var Xe, et;
|
|
4508
4525
|
class te {
|
|
4509
4526
|
constructor(e, t, s, r) {
|
|
4510
4527
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = r;
|
|
@@ -4513,8 +4530,8 @@ class te {
|
|
|
4513
4530
|
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
4531
|
}
|
|
4515
4532
|
}
|
|
4516
|
-
const
|
|
4517
|
-
if (
|
|
4533
|
+
const gn = (n, e) => {
|
|
4534
|
+
if (mt(e))
|
|
4518
4535
|
return { success: !0, data: e.value };
|
|
4519
4536
|
if (!n.common.issues.length)
|
|
4520
4537
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -4575,7 +4592,7 @@ class Z {
|
|
|
4575
4592
|
}
|
|
4576
4593
|
_parseSync(e) {
|
|
4577
4594
|
const t = this._parse(e);
|
|
4578
|
-
if (
|
|
4595
|
+
if (_t(t))
|
|
4579
4596
|
throw new Error("Synchronous parse encountered promise.");
|
|
4580
4597
|
return t;
|
|
4581
4598
|
}
|
|
@@ -4603,7 +4620,7 @@ class Z {
|
|
|
4603
4620
|
data: e,
|
|
4604
4621
|
parsedType: he(e)
|
|
4605
4622
|
}, a = this._parseSync({ data: e, path: r.path, parent: r });
|
|
4606
|
-
return
|
|
4623
|
+
return gn(r, a);
|
|
4607
4624
|
}
|
|
4608
4625
|
async parseAsync(e, t) {
|
|
4609
4626
|
const s = await this.safeParseAsync(e, t);
|
|
@@ -4623,8 +4640,8 @@ class Z {
|
|
|
4623
4640
|
parent: null,
|
|
4624
4641
|
data: e,
|
|
4625
4642
|
parsedType: he(e)
|
|
4626
|
-
}, r = this._parse({ data: e, path: s.path, parent: s }), a = await (
|
|
4627
|
-
return
|
|
4643
|
+
}, r = this._parse({ data: e, path: s.path, parent: s }), a = await (_t(r) ? r : Promise.resolve(r));
|
|
4644
|
+
return gn(s, a);
|
|
4628
4645
|
}
|
|
4629
4646
|
refine(e, t) {
|
|
4630
4647
|
const s = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
|
|
@@ -4662,13 +4679,13 @@ class Z {
|
|
|
4662
4679
|
return W.create(this, this._def);
|
|
4663
4680
|
}
|
|
4664
4681
|
promise() {
|
|
4665
|
-
return
|
|
4682
|
+
return Ke.create(this, this._def);
|
|
4666
4683
|
}
|
|
4667
4684
|
or(e) {
|
|
4668
|
-
return
|
|
4685
|
+
return wt.create([this, e], this._def);
|
|
4669
4686
|
}
|
|
4670
4687
|
and(e) {
|
|
4671
|
-
return
|
|
4688
|
+
return bt.create(this, e, this._def);
|
|
4672
4689
|
}
|
|
4673
4690
|
transform(e) {
|
|
4674
4691
|
return new J({
|
|
@@ -4680,7 +4697,7 @@ class Z {
|
|
|
4680
4697
|
}
|
|
4681
4698
|
default(e) {
|
|
4682
4699
|
const t = typeof e == "function" ? e : () => e;
|
|
4683
|
-
return new
|
|
4700
|
+
return new St({
|
|
4684
4701
|
...O(this._def),
|
|
4685
4702
|
innerType: this,
|
|
4686
4703
|
defaultValue: t,
|
|
@@ -4696,7 +4713,7 @@ class Z {
|
|
|
4696
4713
|
}
|
|
4697
4714
|
catch(e) {
|
|
4698
4715
|
const t = typeof e == "function" ? e : () => e;
|
|
4699
|
-
return new
|
|
4716
|
+
return new Zt({
|
|
4700
4717
|
...O(this._def),
|
|
4701
4718
|
innerType: this,
|
|
4702
4719
|
catchValue: t,
|
|
@@ -4711,10 +4728,10 @@ class Z {
|
|
|
4711
4728
|
});
|
|
4712
4729
|
}
|
|
4713
4730
|
pipe(e) {
|
|
4714
|
-
return
|
|
4731
|
+
return Ct.create(this, e);
|
|
4715
4732
|
}
|
|
4716
4733
|
readonly() {
|
|
4717
|
-
return
|
|
4734
|
+
return jt.create(this);
|
|
4718
4735
|
}
|
|
4719
4736
|
isOptional() {
|
|
4720
4737
|
return this.safeParse(void 0).success;
|
|
@@ -4723,23 +4740,23 @@ class Z {
|
|
|
4723
4740
|
return this.safeParse(null).success;
|
|
4724
4741
|
}
|
|
4725
4742
|
}
|
|
4726
|
-
const
|
|
4743
|
+
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
4744
|
let Yt;
|
|
4728
|
-
const
|
|
4729
|
-
function
|
|
4745
|
+
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}$`);
|
|
4746
|
+
function Un(n) {
|
|
4730
4747
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
4731
4748
|
return n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
4732
4749
|
}
|
|
4733
|
-
function
|
|
4734
|
-
return new RegExp(`^${
|
|
4750
|
+
function Ba(n) {
|
|
4751
|
+
return new RegExp(`^${Un(n)}$`);
|
|
4735
4752
|
}
|
|
4736
|
-
function
|
|
4737
|
-
let e = `${
|
|
4753
|
+
function Fn(n) {
|
|
4754
|
+
let e = `${Vn}T${Un(n)}`;
|
|
4738
4755
|
const t = [];
|
|
4739
4756
|
return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
4740
4757
|
}
|
|
4741
|
-
function
|
|
4742
|
-
return !!((e === "v4" || !e) &&
|
|
4758
|
+
function Wa(n, e) {
|
|
4759
|
+
return !!((e === "v4" || !e) && Va.test(n) || (e === "v6" || !e) && Ua.test(n));
|
|
4743
4760
|
}
|
|
4744
4761
|
class z extends Z {
|
|
4745
4762
|
_parse(e) {
|
|
@@ -4790,43 +4807,43 @@ class z extends Z {
|
|
|
4790
4807
|
message: a.message
|
|
4791
4808
|
}), s.dirty());
|
|
4792
4809
|
} else if (a.kind === "email")
|
|
4793
|
-
|
|
4810
|
+
Ma.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4794
4811
|
validation: "email",
|
|
4795
4812
|
code: h.invalid_string,
|
|
4796
4813
|
message: a.message
|
|
4797
4814
|
}), s.dirty());
|
|
4798
4815
|
else if (a.kind === "emoji")
|
|
4799
|
-
Yt || (Yt = new RegExp(
|
|
4816
|
+
Yt || (Yt = new RegExp(La, "u")), Yt.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4800
4817
|
validation: "emoji",
|
|
4801
4818
|
code: h.invalid_string,
|
|
4802
4819
|
message: a.message
|
|
4803
4820
|
}), s.dirty());
|
|
4804
4821
|
else if (a.kind === "uuid")
|
|
4805
|
-
|
|
4822
|
+
$a.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4806
4823
|
validation: "uuid",
|
|
4807
4824
|
code: h.invalid_string,
|
|
4808
4825
|
message: a.message
|
|
4809
4826
|
}), s.dirty());
|
|
4810
4827
|
else if (a.kind === "nanoid")
|
|
4811
|
-
|
|
4828
|
+
Pa.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4812
4829
|
validation: "nanoid",
|
|
4813
4830
|
code: h.invalid_string,
|
|
4814
4831
|
message: a.message
|
|
4815
4832
|
}), s.dirty());
|
|
4816
4833
|
else if (a.kind === "cuid")
|
|
4817
|
-
|
|
4834
|
+
Ea.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4818
4835
|
validation: "cuid",
|
|
4819
4836
|
code: h.invalid_string,
|
|
4820
4837
|
message: a.message
|
|
4821
4838
|
}), s.dirty());
|
|
4822
4839
|
else if (a.kind === "cuid2")
|
|
4823
|
-
|
|
4840
|
+
Aa.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4824
4841
|
validation: "cuid2",
|
|
4825
4842
|
code: h.invalid_string,
|
|
4826
4843
|
message: a.message
|
|
4827
4844
|
}), s.dirty());
|
|
4828
4845
|
else if (a.kind === "ulid")
|
|
4829
|
-
|
|
4846
|
+
Ra.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4830
4847
|
validation: "ulid",
|
|
4831
4848
|
code: h.invalid_string,
|
|
4832
4849
|
message: a.message
|
|
@@ -4857,27 +4874,27 @@ class z extends Z {
|
|
|
4857
4874
|
code: h.invalid_string,
|
|
4858
4875
|
validation: { endsWith: a.value },
|
|
4859
4876
|
message: a.message
|
|
4860
|
-
}), s.dirty()) : a.kind === "datetime" ?
|
|
4877
|
+
}), s.dirty()) : a.kind === "datetime" ? Fn(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4861
4878
|
code: h.invalid_string,
|
|
4862
4879
|
validation: "datetime",
|
|
4863
4880
|
message: a.message
|
|
4864
|
-
}), s.dirty()) : a.kind === "date" ?
|
|
4881
|
+
}), s.dirty()) : a.kind === "date" ? za.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4865
4882
|
code: h.invalid_string,
|
|
4866
4883
|
validation: "date",
|
|
4867
4884
|
message: a.message
|
|
4868
|
-
}), s.dirty()) : a.kind === "time" ?
|
|
4885
|
+
}), s.dirty()) : a.kind === "time" ? Ba(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4869
4886
|
code: h.invalid_string,
|
|
4870
4887
|
validation: "time",
|
|
4871
4888
|
message: a.message
|
|
4872
|
-
}), s.dirty()) : a.kind === "duration" ?
|
|
4889
|
+
}), s.dirty()) : a.kind === "duration" ? Da.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4873
4890
|
validation: "duration",
|
|
4874
4891
|
code: h.invalid_string,
|
|
4875
4892
|
message: a.message
|
|
4876
|
-
}), s.dirty()) : a.kind === "ip" ?
|
|
4893
|
+
}), s.dirty()) : a.kind === "ip" ? Wa(e.data, a.version) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4877
4894
|
validation: "ip",
|
|
4878
4895
|
code: h.invalid_string,
|
|
4879
4896
|
message: a.message
|
|
4880
|
-
}), s.dirty()) : a.kind === "base64" ?
|
|
4897
|
+
}), s.dirty()) : a.kind === "base64" ? Fa.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
4881
4898
|
validation: "base64",
|
|
4882
4899
|
code: h.invalid_string,
|
|
4883
4900
|
message: a.message
|
|
@@ -5099,7 +5116,7 @@ z.create = (n) => {
|
|
|
5099
5116
|
...O(n)
|
|
5100
5117
|
});
|
|
5101
5118
|
};
|
|
5102
|
-
function
|
|
5119
|
+
function qa(n, e) {
|
|
5103
5120
|
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
5121
|
return a % o / Math.pow(10, r);
|
|
5105
5122
|
}
|
|
@@ -5138,7 +5155,7 @@ class ye extends Z {
|
|
|
5138
5155
|
inclusive: a.inclusive,
|
|
5139
5156
|
exact: !1,
|
|
5140
5157
|
message: a.message
|
|
5141
|
-
}), r.dirty()) : a.kind === "multipleOf" ?
|
|
5158
|
+
}), r.dirty()) : a.kind === "multipleOf" ? qa(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), m(s, {
|
|
5142
5159
|
code: h.not_multiple_of,
|
|
5143
5160
|
multipleOf: a.value,
|
|
5144
5161
|
message: a.message
|
|
@@ -5403,7 +5420,7 @@ ve.create = (n) => {
|
|
|
5403
5420
|
...O(n)
|
|
5404
5421
|
});
|
|
5405
5422
|
};
|
|
5406
|
-
class
|
|
5423
|
+
class gt extends Z {
|
|
5407
5424
|
_parse(e) {
|
|
5408
5425
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== g.boolean) {
|
|
5409
5426
|
const s = this._getOrReturnCtx(e);
|
|
@@ -5416,7 +5433,7 @@ class yt extends Z {
|
|
|
5416
5433
|
return M(e.data);
|
|
5417
5434
|
}
|
|
5418
5435
|
}
|
|
5419
|
-
|
|
5436
|
+
gt.create = (n) => new gt({
|
|
5420
5437
|
typeName: b.ZodBoolean,
|
|
5421
5438
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
5422
5439
|
...O(n)
|
|
@@ -5516,7 +5533,7 @@ zt.create = (n) => new zt({
|
|
|
5516
5533
|
typeName: b.ZodSymbol,
|
|
5517
5534
|
...O(n)
|
|
5518
5535
|
});
|
|
5519
|
-
class
|
|
5536
|
+
class yt extends Z {
|
|
5520
5537
|
_parse(e) {
|
|
5521
5538
|
if (this._getType(e) !== g.undefined) {
|
|
5522
5539
|
const s = this._getOrReturnCtx(e);
|
|
@@ -5529,11 +5546,11 @@ class vt extends Z {
|
|
|
5529
5546
|
return M(e.data);
|
|
5530
5547
|
}
|
|
5531
5548
|
}
|
|
5532
|
-
|
|
5549
|
+
yt.create = (n) => new yt({
|
|
5533
5550
|
typeName: b.ZodUndefined,
|
|
5534
5551
|
...O(n)
|
|
5535
5552
|
});
|
|
5536
|
-
class
|
|
5553
|
+
class vt extends Z {
|
|
5537
5554
|
_parse(e) {
|
|
5538
5555
|
if (this._getType(e) !== g.null) {
|
|
5539
5556
|
const s = this._getOrReturnCtx(e);
|
|
@@ -5546,11 +5563,11 @@ class wt extends Z {
|
|
|
5546
5563
|
return M(e.data);
|
|
5547
5564
|
}
|
|
5548
5565
|
}
|
|
5549
|
-
|
|
5566
|
+
vt.create = (n) => new vt({
|
|
5550
5567
|
typeName: b.ZodNull,
|
|
5551
5568
|
...O(n)
|
|
5552
5569
|
});
|
|
5553
|
-
class
|
|
5570
|
+
class Je extends Z {
|
|
5554
5571
|
constructor() {
|
|
5555
5572
|
super(...arguments), this._any = !0;
|
|
5556
5573
|
}
|
|
@@ -5558,7 +5575,7 @@ class Ke extends Z {
|
|
|
5558
5575
|
return M(e.data);
|
|
5559
5576
|
}
|
|
5560
5577
|
}
|
|
5561
|
-
|
|
5578
|
+
Je.create = (n) => new Je({
|
|
5562
5579
|
typeName: b.ZodAny,
|
|
5563
5580
|
...O(n)
|
|
5564
5581
|
});
|
|
@@ -5678,12 +5695,12 @@ W.create = (n, e) => new W({
|
|
|
5678
5695
|
typeName: b.ZodArray,
|
|
5679
5696
|
...O(e)
|
|
5680
5697
|
});
|
|
5681
|
-
function
|
|
5698
|
+
function Le(n) {
|
|
5682
5699
|
if (n instanceof E) {
|
|
5683
5700
|
const e = {};
|
|
5684
5701
|
for (const t in n.shape) {
|
|
5685
5702
|
const s = n.shape[t];
|
|
5686
|
-
e[t] = G.create(
|
|
5703
|
+
e[t] = G.create(Le(s));
|
|
5687
5704
|
}
|
|
5688
5705
|
return new E({
|
|
5689
5706
|
...n._def,
|
|
@@ -5691,8 +5708,8 @@ function Ve(n) {
|
|
|
5691
5708
|
});
|
|
5692
5709
|
} else return n instanceof W ? new W({
|
|
5693
5710
|
...n._def,
|
|
5694
|
-
type:
|
|
5695
|
-
}) : n instanceof G ? G.create(
|
|
5711
|
+
type: Le(n.element)
|
|
5712
|
+
}) : 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
5713
|
}
|
|
5697
5714
|
class E extends Z {
|
|
5698
5715
|
constructor() {
|
|
@@ -5928,7 +5945,7 @@ class E extends Z {
|
|
|
5928
5945
|
* @deprecated
|
|
5929
5946
|
*/
|
|
5930
5947
|
deepPartial() {
|
|
5931
|
-
return
|
|
5948
|
+
return Le(this);
|
|
5932
5949
|
}
|
|
5933
5950
|
partial(e) {
|
|
5934
5951
|
const t = {};
|
|
@@ -5957,7 +5974,7 @@ class E extends Z {
|
|
|
5957
5974
|
});
|
|
5958
5975
|
}
|
|
5959
5976
|
keyof() {
|
|
5960
|
-
return
|
|
5977
|
+
return zn(C.objectKeys(this.shape));
|
|
5961
5978
|
}
|
|
5962
5979
|
}
|
|
5963
5980
|
E.create = (n, e) => new E({
|
|
@@ -5981,7 +5998,7 @@ E.lazycreate = (n, e) => new E({
|
|
|
5981
5998
|
typeName: b.ZodObject,
|
|
5982
5999
|
...O(e)
|
|
5983
6000
|
});
|
|
5984
|
-
class
|
|
6001
|
+
class wt extends Z {
|
|
5985
6002
|
_parse(e) {
|
|
5986
6003
|
const { ctx: t } = this._processInputParams(e), s = this._def.options;
|
|
5987
6004
|
function r(a) {
|
|
@@ -6049,12 +6066,12 @@ class bt extends Z {
|
|
|
6049
6066
|
return this._def.options;
|
|
6050
6067
|
}
|
|
6051
6068
|
}
|
|
6052
|
-
|
|
6069
|
+
wt.create = (n, e) => new wt({
|
|
6053
6070
|
options: n,
|
|
6054
6071
|
typeName: b.ZodUnion,
|
|
6055
6072
|
...O(e)
|
|
6056
6073
|
});
|
|
6057
|
-
const se = (n) => n instanceof
|
|
6074
|
+
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
6075
|
class Kt extends Z {
|
|
6059
6076
|
_parse(e) {
|
|
6060
6077
|
const { ctx: t } = this._processInputParams(e);
|
|
@@ -6143,7 +6160,7 @@ function on(n, e) {
|
|
|
6143
6160
|
return { valid: !0, data: r };
|
|
6144
6161
|
} else return t === g.date && s === g.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
|
|
6145
6162
|
}
|
|
6146
|
-
class
|
|
6163
|
+
class bt extends Z {
|
|
6147
6164
|
_parse(e) {
|
|
6148
6165
|
const { status: t, ctx: s } = this._processInputParams(e), r = (a, o) => {
|
|
6149
6166
|
if (rn(a) || rn(o))
|
|
@@ -6175,7 +6192,7 @@ class kt extends Z {
|
|
|
6175
6192
|
}));
|
|
6176
6193
|
}
|
|
6177
6194
|
}
|
|
6178
|
-
|
|
6195
|
+
bt.create = (n, e, t) => new bt({
|
|
6179
6196
|
left: n,
|
|
6180
6197
|
right: e,
|
|
6181
6198
|
typeName: b.ZodIntersection,
|
|
@@ -6231,7 +6248,7 @@ ne.create = (n, e) => {
|
|
|
6231
6248
|
...O(e)
|
|
6232
6249
|
});
|
|
6233
6250
|
};
|
|
6234
|
-
class
|
|
6251
|
+
class kt extends Z {
|
|
6235
6252
|
get keySchema() {
|
|
6236
6253
|
return this._def.keyType;
|
|
6237
6254
|
}
|
|
@@ -6259,12 +6276,12 @@ class xt extends Z {
|
|
|
6259
6276
|
return this._def.valueType;
|
|
6260
6277
|
}
|
|
6261
6278
|
static create(e, t, s) {
|
|
6262
|
-
return t instanceof Z ? new
|
|
6279
|
+
return t instanceof Z ? new kt({
|
|
6263
6280
|
keyType: e,
|
|
6264
6281
|
valueType: t,
|
|
6265
6282
|
typeName: b.ZodRecord,
|
|
6266
6283
|
...O(s)
|
|
6267
|
-
}) : new
|
|
6284
|
+
}) : new kt({
|
|
6268
6285
|
keyType: z.create(),
|
|
6269
6286
|
valueType: e,
|
|
6270
6287
|
typeName: b.ZodRecord,
|
|
@@ -6384,7 +6401,7 @@ Ie.create = (n, e) => new Ie({
|
|
|
6384
6401
|
typeName: b.ZodSet,
|
|
6385
6402
|
...O(e)
|
|
6386
6403
|
});
|
|
6387
|
-
class
|
|
6404
|
+
class Fe extends Z {
|
|
6388
6405
|
constructor() {
|
|
6389
6406
|
super(...arguments), this.validate = this.implement;
|
|
6390
6407
|
}
|
|
@@ -6404,7 +6421,7 @@ class ze extends Z {
|
|
|
6404
6421
|
t.common.contextualErrorMap,
|
|
6405
6422
|
t.schemaErrorMap,
|
|
6406
6423
|
Vt(),
|
|
6407
|
-
|
|
6424
|
+
qe
|
|
6408
6425
|
].filter((u) => !!u),
|
|
6409
6426
|
issueData: {
|
|
6410
6427
|
code: h.invalid_arguments,
|
|
@@ -6420,7 +6437,7 @@ class ze extends Z {
|
|
|
6420
6437
|
t.common.contextualErrorMap,
|
|
6421
6438
|
t.schemaErrorMap,
|
|
6422
6439
|
Vt(),
|
|
6423
|
-
|
|
6440
|
+
qe
|
|
6424
6441
|
].filter((u) => !!u),
|
|
6425
6442
|
issueData: {
|
|
6426
6443
|
code: h.invalid_return_type,
|
|
@@ -6429,7 +6446,7 @@ class ze extends Z {
|
|
|
6429
6446
|
});
|
|
6430
6447
|
}
|
|
6431
6448
|
const a = { errorMap: t.common.contextualErrorMap }, o = t.data;
|
|
6432
|
-
if (this._def.returns instanceof
|
|
6449
|
+
if (this._def.returns instanceof Ke) {
|
|
6433
6450
|
const c = this;
|
|
6434
6451
|
return M(async function(...d) {
|
|
6435
6452
|
const u = new V([]), l = await c._def.args.parseAsync(d, a).catch((U) => {
|
|
@@ -6459,13 +6476,13 @@ class ze extends Z {
|
|
|
6459
6476
|
return this._def.returns;
|
|
6460
6477
|
}
|
|
6461
6478
|
args(...e) {
|
|
6462
|
-
return new
|
|
6479
|
+
return new Fe({
|
|
6463
6480
|
...this._def,
|
|
6464
6481
|
args: ne.create(e).rest(Ze.create())
|
|
6465
6482
|
});
|
|
6466
6483
|
}
|
|
6467
6484
|
returns(e) {
|
|
6468
|
-
return new
|
|
6485
|
+
return new Fe({
|
|
6469
6486
|
...this._def,
|
|
6470
6487
|
returns: e
|
|
6471
6488
|
});
|
|
@@ -6477,7 +6494,7 @@ class ze extends Z {
|
|
|
6477
6494
|
return this.parse(e);
|
|
6478
6495
|
}
|
|
6479
6496
|
static create(e, t, s) {
|
|
6480
|
-
return new
|
|
6497
|
+
return new Fe({
|
|
6481
6498
|
args: e || ne.create([]).rest(Ze.create()),
|
|
6482
6499
|
returns: t || Ze.create(),
|
|
6483
6500
|
typeName: b.ZodFunction,
|
|
@@ -6485,7 +6502,7 @@ class ze extends Z {
|
|
|
6485
6502
|
});
|
|
6486
6503
|
}
|
|
6487
6504
|
}
|
|
6488
|
-
class
|
|
6505
|
+
class xt extends Z {
|
|
6489
6506
|
get schema() {
|
|
6490
6507
|
return this._def.getter();
|
|
6491
6508
|
}
|
|
@@ -6494,12 +6511,12 @@ class Tt extends Z {
|
|
|
6494
6511
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
6495
6512
|
}
|
|
6496
6513
|
}
|
|
6497
|
-
|
|
6514
|
+
xt.create = (n, e) => new xt({
|
|
6498
6515
|
getter: n,
|
|
6499
6516
|
typeName: b.ZodLazy,
|
|
6500
6517
|
...O(e)
|
|
6501
6518
|
});
|
|
6502
|
-
class
|
|
6519
|
+
class Tt extends Z {
|
|
6503
6520
|
_parse(e) {
|
|
6504
6521
|
if (e.data !== this._def.value) {
|
|
6505
6522
|
const t = this._getOrReturnCtx(e);
|
|
@@ -6515,12 +6532,12 @@ class Ot extends Z {
|
|
|
6515
6532
|
return this._def.value;
|
|
6516
6533
|
}
|
|
6517
6534
|
}
|
|
6518
|
-
|
|
6535
|
+
Tt.create = (n, e) => new Tt({
|
|
6519
6536
|
value: n,
|
|
6520
6537
|
typeName: b.ZodLiteral,
|
|
6521
6538
|
...O(e)
|
|
6522
6539
|
});
|
|
6523
|
-
function
|
|
6540
|
+
function zn(n, e) {
|
|
6524
6541
|
return new we({
|
|
6525
6542
|
values: n,
|
|
6526
6543
|
typeName: b.ZodEnum,
|
|
@@ -6529,7 +6546,7 @@ function Bn(n, e) {
|
|
|
6529
6546
|
}
|
|
6530
6547
|
class we extends Z {
|
|
6531
6548
|
constructor() {
|
|
6532
|
-
super(...arguments),
|
|
6549
|
+
super(...arguments), Xe.set(this, void 0);
|
|
6533
6550
|
}
|
|
6534
6551
|
_parse(e) {
|
|
6535
6552
|
if (typeof e.data != "string") {
|
|
@@ -6540,7 +6557,7 @@ class we extends Z {
|
|
|
6540
6557
|
code: h.invalid_type
|
|
6541
6558
|
}), k;
|
|
6542
6559
|
}
|
|
6543
|
-
if (Ft(this,
|
|
6560
|
+
if (Ft(this, Xe) || Ln(this, Xe, new Set(this._def.values)), !Ft(this, Xe).has(e.data)) {
|
|
6544
6561
|
const t = this._getOrReturnCtx(e), s = this._def.values;
|
|
6545
6562
|
return m(t, {
|
|
6546
6563
|
received: t.data,
|
|
@@ -6584,11 +6601,11 @@ class we extends Z {
|
|
|
6584
6601
|
});
|
|
6585
6602
|
}
|
|
6586
6603
|
}
|
|
6587
|
-
|
|
6588
|
-
we.create =
|
|
6589
|
-
class
|
|
6604
|
+
Xe = /* @__PURE__ */ new WeakMap();
|
|
6605
|
+
we.create = zn;
|
|
6606
|
+
class Ot extends Z {
|
|
6590
6607
|
constructor() {
|
|
6591
|
-
super(...arguments),
|
|
6608
|
+
super(...arguments), et.set(this, void 0);
|
|
6592
6609
|
}
|
|
6593
6610
|
_parse(e) {
|
|
6594
6611
|
const t = C.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
|
|
@@ -6600,7 +6617,7 @@ class St extends Z {
|
|
|
6600
6617
|
code: h.invalid_type
|
|
6601
6618
|
}), k;
|
|
6602
6619
|
}
|
|
6603
|
-
if (Ft(this,
|
|
6620
|
+
if (Ft(this, et) || Ln(this, et, new Set(C.getValidEnumValues(this._def.values))), !Ft(this, et).has(e.data)) {
|
|
6604
6621
|
const r = C.objectValues(t);
|
|
6605
6622
|
return m(s, {
|
|
6606
6623
|
received: s.data,
|
|
@@ -6614,13 +6631,13 @@ class St extends Z {
|
|
|
6614
6631
|
return this._def.values;
|
|
6615
6632
|
}
|
|
6616
6633
|
}
|
|
6617
|
-
|
|
6618
|
-
|
|
6634
|
+
et = /* @__PURE__ */ new WeakMap();
|
|
6635
|
+
Ot.create = (n, e) => new Ot({
|
|
6619
6636
|
values: n,
|
|
6620
6637
|
typeName: b.ZodNativeEnum,
|
|
6621
6638
|
...O(e)
|
|
6622
6639
|
});
|
|
6623
|
-
class
|
|
6640
|
+
class Ke extends Z {
|
|
6624
6641
|
unwrap() {
|
|
6625
6642
|
return this._def.type;
|
|
6626
6643
|
}
|
|
@@ -6639,7 +6656,7 @@ class He extends Z {
|
|
|
6639
6656
|
})));
|
|
6640
6657
|
}
|
|
6641
6658
|
}
|
|
6642
|
-
|
|
6659
|
+
Ke.create = (n, e) => new Ke({
|
|
6643
6660
|
type: n,
|
|
6644
6661
|
typeName: b.ZodPromise,
|
|
6645
6662
|
...O(e)
|
|
@@ -6671,7 +6688,7 @@ class J extends Z {
|
|
|
6671
6688
|
path: s.path,
|
|
6672
6689
|
parent: s
|
|
6673
6690
|
});
|
|
6674
|
-
return d.status === "aborted" ? k : d.status === "dirty" || t.value === "dirty" ?
|
|
6691
|
+
return d.status === "aborted" ? k : d.status === "dirty" || t.value === "dirty" ? Ve(d.value) : d;
|
|
6675
6692
|
});
|
|
6676
6693
|
{
|
|
6677
6694
|
if (t.value === "aborted")
|
|
@@ -6681,7 +6698,7 @@ class J extends Z {
|
|
|
6681
6698
|
path: s.path,
|
|
6682
6699
|
parent: s
|
|
6683
6700
|
});
|
|
6684
|
-
return c.status === "aborted" ? k : c.status === "dirty" || t.value === "dirty" ?
|
|
6701
|
+
return c.status === "aborted" ? k : c.status === "dirty" || t.value === "dirty" ? Ve(c.value) : c;
|
|
6685
6702
|
}
|
|
6686
6703
|
}
|
|
6687
6704
|
if (r.type === "refinement") {
|
|
@@ -6710,14 +6727,14 @@ class J extends Z {
|
|
|
6710
6727
|
path: s.path,
|
|
6711
6728
|
parent: s
|
|
6712
6729
|
});
|
|
6713
|
-
if (!
|
|
6730
|
+
if (!mt(o))
|
|
6714
6731
|
return o;
|
|
6715
6732
|
const c = r.transform(o.value, a);
|
|
6716
6733
|
if (c instanceof Promise)
|
|
6717
6734
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
6718
6735
|
return { status: t.value, value: c };
|
|
6719
6736
|
} else
|
|
6720
|
-
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) =>
|
|
6737
|
+
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((c) => ({ status: t.value, value: c })) : o);
|
|
6721
6738
|
C.assertNever(r);
|
|
6722
6739
|
}
|
|
6723
6740
|
}
|
|
@@ -6759,7 +6776,7 @@ be.create = (n, e) => new be({
|
|
|
6759
6776
|
typeName: b.ZodNullable,
|
|
6760
6777
|
...O(e)
|
|
6761
6778
|
});
|
|
6762
|
-
class
|
|
6779
|
+
class St extends Z {
|
|
6763
6780
|
_parse(e) {
|
|
6764
6781
|
const { ctx: t } = this._processInputParams(e);
|
|
6765
6782
|
let s = t.data;
|
|
@@ -6773,13 +6790,13 @@ class Zt extends Z {
|
|
|
6773
6790
|
return this._def.innerType;
|
|
6774
6791
|
}
|
|
6775
6792
|
}
|
|
6776
|
-
|
|
6793
|
+
St.create = (n, e) => new St({
|
|
6777
6794
|
innerType: n,
|
|
6778
6795
|
typeName: b.ZodDefault,
|
|
6779
6796
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
6780
6797
|
...O(e)
|
|
6781
6798
|
});
|
|
6782
|
-
class
|
|
6799
|
+
class Zt extends Z {
|
|
6783
6800
|
_parse(e) {
|
|
6784
6801
|
const { ctx: t } = this._processInputParams(e), s = {
|
|
6785
6802
|
...t,
|
|
@@ -6794,7 +6811,7 @@ class jt extends Z {
|
|
|
6794
6811
|
...s
|
|
6795
6812
|
}
|
|
6796
6813
|
});
|
|
6797
|
-
return
|
|
6814
|
+
return _t(r) ? r.then((a) => ({
|
|
6798
6815
|
status: "valid",
|
|
6799
6816
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
6800
6817
|
get error() {
|
|
@@ -6816,7 +6833,7 @@ class jt extends Z {
|
|
|
6816
6833
|
return this._def.innerType;
|
|
6817
6834
|
}
|
|
6818
6835
|
}
|
|
6819
|
-
|
|
6836
|
+
Zt.create = (n, e) => new Zt({
|
|
6820
6837
|
innerType: n,
|
|
6821
6838
|
typeName: b.ZodCatch,
|
|
6822
6839
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
@@ -6839,7 +6856,7 @@ qt.create = (n) => new qt({
|
|
|
6839
6856
|
typeName: b.ZodNaN,
|
|
6840
6857
|
...O(n)
|
|
6841
6858
|
});
|
|
6842
|
-
const
|
|
6859
|
+
const Ja = Symbol("zod_brand");
|
|
6843
6860
|
class pn extends Z {
|
|
6844
6861
|
_parse(e) {
|
|
6845
6862
|
const { ctx: t } = this._processInputParams(e), s = t.data;
|
|
@@ -6853,7 +6870,7 @@ class pn extends Z {
|
|
|
6853
6870
|
return this._def.type;
|
|
6854
6871
|
}
|
|
6855
6872
|
}
|
|
6856
|
-
class
|
|
6873
|
+
class Ct extends Z {
|
|
6857
6874
|
_parse(e) {
|
|
6858
6875
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
6859
6876
|
if (s.common.async)
|
|
@@ -6863,7 +6880,7 @@ class It extends Z {
|
|
|
6863
6880
|
path: s.path,
|
|
6864
6881
|
parent: s
|
|
6865
6882
|
});
|
|
6866
|
-
return a.status === "aborted" ? k : a.status === "dirty" ? (t.dirty(),
|
|
6883
|
+
return a.status === "aborted" ? k : a.status === "dirty" ? (t.dirty(), Ve(a.value)) : this._def.out._parseAsync({
|
|
6867
6884
|
data: a.value,
|
|
6868
6885
|
path: s.path,
|
|
6869
6886
|
parent: s
|
|
@@ -6886,71 +6903,71 @@ class It extends Z {
|
|
|
6886
6903
|
}
|
|
6887
6904
|
}
|
|
6888
6905
|
static create(e, t) {
|
|
6889
|
-
return new
|
|
6906
|
+
return new Ct({
|
|
6890
6907
|
in: e,
|
|
6891
6908
|
out: t,
|
|
6892
6909
|
typeName: b.ZodPipeline
|
|
6893
6910
|
});
|
|
6894
6911
|
}
|
|
6895
6912
|
}
|
|
6896
|
-
class
|
|
6913
|
+
class jt extends Z {
|
|
6897
6914
|
_parse(e) {
|
|
6898
|
-
const t = this._def.innerType._parse(e), s = (r) => (
|
|
6899
|
-
return
|
|
6915
|
+
const t = this._def.innerType._parse(e), s = (r) => (mt(r) && (r.value = Object.freeze(r.value)), r);
|
|
6916
|
+
return _t(t) ? t.then((r) => s(r)) : s(t);
|
|
6900
6917
|
}
|
|
6901
6918
|
unwrap() {
|
|
6902
6919
|
return this._def.innerType;
|
|
6903
6920
|
}
|
|
6904
6921
|
}
|
|
6905
|
-
|
|
6922
|
+
jt.create = (n, e) => new jt({
|
|
6906
6923
|
innerType: n,
|
|
6907
6924
|
typeName: b.ZodReadonly,
|
|
6908
6925
|
...O(e)
|
|
6909
6926
|
});
|
|
6910
|
-
function
|
|
6911
|
-
return n ?
|
|
6927
|
+
function Bn(n, e = {}, t) {
|
|
6928
|
+
return n ? Je.create().superRefine((s, r) => {
|
|
6912
6929
|
var a, o;
|
|
6913
6930
|
if (!n(s)) {
|
|
6914
6931
|
const c = typeof e == "function" ? e(s) : typeof e == "string" ? { message: e } : e, d = (o = (a = c.fatal) !== null && a !== void 0 ? a : t) !== null && o !== void 0 ? o : !0, u = typeof c == "string" ? { message: c } : c;
|
|
6915
6932
|
r.addIssue({ code: "custom", ...u, fatal: d });
|
|
6916
6933
|
}
|
|
6917
|
-
}) :
|
|
6934
|
+
}) : Je.create();
|
|
6918
6935
|
}
|
|
6919
|
-
const
|
|
6936
|
+
const Ka = {
|
|
6920
6937
|
object: E.lazycreate
|
|
6921
6938
|
};
|
|
6922
6939
|
var b;
|
|
6923
6940
|
(function(n) {
|
|
6924
6941
|
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
6942
|
})(b || (b = {}));
|
|
6926
|
-
const
|
|
6943
|
+
const Ha = (n, e = {
|
|
6927
6944
|
message: `Input not instance of ${n.name}`
|
|
6928
|
-
}) =>
|
|
6945
|
+
}) => 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, ci = E.strictCreate, di = 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
6946
|
string: (n) => z.create({ ...n, coerce: !0 }),
|
|
6930
6947
|
number: (n) => ye.create({ ...n, coerce: !0 }),
|
|
6931
|
-
boolean: (n) =>
|
|
6948
|
+
boolean: (n) => gt.create({
|
|
6932
6949
|
...n,
|
|
6933
6950
|
coerce: !0
|
|
6934
6951
|
}),
|
|
6935
6952
|
bigint: (n) => ve.create({ ...n, coerce: !0 }),
|
|
6936
6953
|
date: (n) => Ce.create({ ...n, coerce: !0 })
|
|
6937
|
-
},
|
|
6938
|
-
var
|
|
6954
|
+
}, Ci = k;
|
|
6955
|
+
var Ii = /* @__PURE__ */ Object.freeze({
|
|
6939
6956
|
__proto__: null,
|
|
6940
|
-
defaultErrorMap:
|
|
6941
|
-
setErrorMap:
|
|
6957
|
+
defaultErrorMap: qe,
|
|
6958
|
+
setErrorMap: Ca,
|
|
6942
6959
|
getErrorMap: Vt,
|
|
6943
6960
|
makeIssue: Ut,
|
|
6944
|
-
EMPTY_PATH:
|
|
6961
|
+
EMPTY_PATH: Ia,
|
|
6945
6962
|
addIssueToContext: m,
|
|
6946
6963
|
ParseStatus: P,
|
|
6947
6964
|
INVALID: k,
|
|
6948
|
-
DIRTY:
|
|
6965
|
+
DIRTY: Ve,
|
|
6949
6966
|
OK: M,
|
|
6950
6967
|
isAborted: rn,
|
|
6951
6968
|
isDirty: an,
|
|
6952
|
-
isValid:
|
|
6953
|
-
isAsync:
|
|
6969
|
+
isValid: mt,
|
|
6970
|
+
isAsync: _t,
|
|
6954
6971
|
get util() {
|
|
6955
6972
|
return C;
|
|
6956
6973
|
},
|
|
@@ -6960,107 +6977,107 @@ var Ci = /* @__PURE__ */ Object.freeze({
|
|
|
6960
6977
|
ZodParsedType: g,
|
|
6961
6978
|
getParsedType: he,
|
|
6962
6979
|
ZodType: Z,
|
|
6963
|
-
datetimeRegex:
|
|
6980
|
+
datetimeRegex: Fn,
|
|
6964
6981
|
ZodString: z,
|
|
6965
6982
|
ZodNumber: ye,
|
|
6966
6983
|
ZodBigInt: ve,
|
|
6967
|
-
ZodBoolean:
|
|
6984
|
+
ZodBoolean: gt,
|
|
6968
6985
|
ZodDate: Ce,
|
|
6969
6986
|
ZodSymbol: zt,
|
|
6970
|
-
ZodUndefined:
|
|
6971
|
-
ZodNull:
|
|
6972
|
-
ZodAny:
|
|
6987
|
+
ZodUndefined: yt,
|
|
6988
|
+
ZodNull: vt,
|
|
6989
|
+
ZodAny: Je,
|
|
6973
6990
|
ZodUnknown: Ze,
|
|
6974
6991
|
ZodNever: ae,
|
|
6975
6992
|
ZodVoid: Bt,
|
|
6976
6993
|
ZodArray: W,
|
|
6977
6994
|
ZodObject: E,
|
|
6978
|
-
ZodUnion:
|
|
6995
|
+
ZodUnion: wt,
|
|
6979
6996
|
ZodDiscriminatedUnion: Kt,
|
|
6980
|
-
ZodIntersection:
|
|
6997
|
+
ZodIntersection: bt,
|
|
6981
6998
|
ZodTuple: ne,
|
|
6982
|
-
ZodRecord:
|
|
6999
|
+
ZodRecord: kt,
|
|
6983
7000
|
ZodMap: Wt,
|
|
6984
7001
|
ZodSet: Ie,
|
|
6985
|
-
ZodFunction:
|
|
6986
|
-
ZodLazy:
|
|
6987
|
-
ZodLiteral:
|
|
7002
|
+
ZodFunction: Fe,
|
|
7003
|
+
ZodLazy: xt,
|
|
7004
|
+
ZodLiteral: Tt,
|
|
6988
7005
|
ZodEnum: we,
|
|
6989
|
-
ZodNativeEnum:
|
|
6990
|
-
ZodPromise:
|
|
7006
|
+
ZodNativeEnum: Ot,
|
|
7007
|
+
ZodPromise: Ke,
|
|
6991
7008
|
ZodEffects: J,
|
|
6992
7009
|
ZodTransformer: J,
|
|
6993
7010
|
ZodOptional: G,
|
|
6994
7011
|
ZodNullable: be,
|
|
6995
|
-
ZodDefault:
|
|
6996
|
-
ZodCatch:
|
|
7012
|
+
ZodDefault: St,
|
|
7013
|
+
ZodCatch: Zt,
|
|
6997
7014
|
ZodNaN: qt,
|
|
6998
|
-
BRAND:
|
|
7015
|
+
BRAND: Ja,
|
|
6999
7016
|
ZodBranded: pn,
|
|
7000
|
-
ZodPipeline:
|
|
7001
|
-
ZodReadonly:
|
|
7002
|
-
custom:
|
|
7017
|
+
ZodPipeline: Ct,
|
|
7018
|
+
ZodReadonly: jt,
|
|
7019
|
+
custom: Bn,
|
|
7003
7020
|
Schema: Z,
|
|
7004
7021
|
ZodSchema: Z,
|
|
7005
|
-
late:
|
|
7022
|
+
late: Ka,
|
|
7006
7023
|
get ZodFirstPartyTypeKind() {
|
|
7007
7024
|
return b;
|
|
7008
7025
|
},
|
|
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:
|
|
7046
|
-
union:
|
|
7047
|
-
unknown:
|
|
7048
|
-
void:
|
|
7049
|
-
NEVER:
|
|
7026
|
+
coerce: Ni,
|
|
7027
|
+
any: ni,
|
|
7028
|
+
array: ii,
|
|
7029
|
+
bigint: Ya,
|
|
7030
|
+
boolean: Jn,
|
|
7031
|
+
date: Ga,
|
|
7032
|
+
discriminatedUnion: ui,
|
|
7033
|
+
effect: yn,
|
|
7034
|
+
enum: vi,
|
|
7035
|
+
function: _i,
|
|
7036
|
+
instanceof: Ha,
|
|
7037
|
+
intersection: li,
|
|
7038
|
+
lazy: gi,
|
|
7039
|
+
literal: yi,
|
|
7040
|
+
map: fi,
|
|
7041
|
+
nan: Qa,
|
|
7042
|
+
nativeEnum: wi,
|
|
7043
|
+
never: ri,
|
|
7044
|
+
null: ti,
|
|
7045
|
+
nullable: xi,
|
|
7046
|
+
number: qn,
|
|
7047
|
+
object: oi,
|
|
7048
|
+
oboolean: ji,
|
|
7049
|
+
onumber: Zi,
|
|
7050
|
+
optional: ki,
|
|
7051
|
+
ostring: Si,
|
|
7052
|
+
pipeline: Oi,
|
|
7053
|
+
preprocess: Ti,
|
|
7054
|
+
promise: bi,
|
|
7055
|
+
record: hi,
|
|
7056
|
+
set: mi,
|
|
7057
|
+
strictObject: ci,
|
|
7058
|
+
string: Wn,
|
|
7059
|
+
symbol: Xa,
|
|
7060
|
+
transformer: yn,
|
|
7061
|
+
tuple: pi,
|
|
7062
|
+
undefined: ei,
|
|
7063
|
+
union: di,
|
|
7064
|
+
unknown: si,
|
|
7065
|
+
void: ai,
|
|
7066
|
+
NEVER: Ci,
|
|
7050
7067
|
ZodIssueCode: h,
|
|
7051
|
-
quotelessJson:
|
|
7068
|
+
quotelessJson: Na,
|
|
7052
7069
|
ZodError: V
|
|
7053
7070
|
});
|
|
7054
|
-
|
|
7055
|
-
function
|
|
7071
|
+
ja(Ii);
|
|
7072
|
+
function It(n, e = "", t = {}) {
|
|
7056
7073
|
for (let s in n)
|
|
7057
7074
|
if (Object.prototype.hasOwnProperty.call(n, s)) {
|
|
7058
7075
|
const r = e ? `${e}_${s}` : s;
|
|
7059
|
-
typeof n[s] == "object" && n[s] !== null && !Array.isArray(n[s]) ?
|
|
7076
|
+
typeof n[s] == "object" && n[s] !== null && !Array.isArray(n[s]) ? It(n[s], r, t) : t[r] = n[s];
|
|
7060
7077
|
}
|
|
7061
7078
|
return t;
|
|
7062
7079
|
}
|
|
7063
|
-
function
|
|
7080
|
+
function Kn(n, e) {
|
|
7064
7081
|
const t = {};
|
|
7065
7082
|
for (const [s, r] of Object.entries(n)) {
|
|
7066
7083
|
const a = e.find(
|
|
@@ -7078,17 +7095,6 @@ function hn(n, e) {
|
|
|
7078
7095
|
}
|
|
7079
7096
|
return t;
|
|
7080
7097
|
}
|
|
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
7098
|
function Ei(n) {
|
|
7093
7099
|
return async (e, t) => {
|
|
7094
7100
|
let s = n.selectFrom("connections").where("connections.tenant_id", "=", e);
|
|
@@ -7096,7 +7102,7 @@ function Ei(n) {
|
|
|
7096
7102
|
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();
|
|
7097
7103
|
return {
|
|
7098
7104
|
connections: a.map(
|
|
7099
|
-
(c) => R(
|
|
7105
|
+
(c) => R(Kn(c, ["options"]))
|
|
7100
7106
|
),
|
|
7101
7107
|
start: t.page * t.per_page,
|
|
7102
7108
|
limit: t.per_page,
|
|
@@ -7110,7 +7116,10 @@ function Ai(n) {
|
|
|
7110
7116
|
function Ri(n) {
|
|
7111
7117
|
return async (e, t) => {
|
|
7112
7118
|
const s = await n.selectFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).selectAll().executeTakeFirst();
|
|
7113
|
-
return s ? R(
|
|
7119
|
+
return s ? R({
|
|
7120
|
+
...s,
|
|
7121
|
+
options: JSON.parse(s.options)
|
|
7122
|
+
}) : null;
|
|
7114
7123
|
};
|
|
7115
7124
|
}
|
|
7116
7125
|
function $i(n) {
|
|
@@ -7119,12 +7128,15 @@ function $i(n) {
|
|
|
7119
7128
|
...s,
|
|
7120
7129
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7121
7130
|
};
|
|
7122
|
-
return await n.updateTable("connections").set(
|
|
7131
|
+
return await n.updateTable("connections").set({
|
|
7132
|
+
...r,
|
|
7133
|
+
options: r.options ? JSON.stringify(r.options) : void 0
|
|
7134
|
+
}).where("connections.id", "=", t).where("connections.tenant_id", "=", e).execute(), !0;
|
|
7123
7135
|
};
|
|
7124
7136
|
}
|
|
7125
7137
|
function Pi(n) {
|
|
7126
7138
|
return {
|
|
7127
|
-
create:
|
|
7139
|
+
create: Oa(n),
|
|
7128
7140
|
get: Ri(n),
|
|
7129
7141
|
list: Ei(n),
|
|
7130
7142
|
remove: Ai(n),
|
|
@@ -7144,7 +7156,7 @@ function Di(n) {
|
|
|
7144
7156
|
return {
|
|
7145
7157
|
...t,
|
|
7146
7158
|
connections: r.map(
|
|
7147
|
-
(c) =>
|
|
7159
|
+
(c) => Rn.parse(R(c))
|
|
7148
7160
|
),
|
|
7149
7161
|
domains: a,
|
|
7150
7162
|
addons: t.addons ? JSON.parse(t.addons) : {},
|
|
@@ -7241,7 +7253,7 @@ function Wi(n) {
|
|
|
7241
7253
|
}
|
|
7242
7254
|
function qi(n) {
|
|
7243
7255
|
return async (e, t) => {
|
|
7244
|
-
var o, c, d, u, l, j, A, U, ie,
|
|
7256
|
+
var o, c, d, u, l, j, A, U, ie, Re, oe, ce, de, $e, Pe, K, H, Q;
|
|
7245
7257
|
const { colors: s, font: r, ...a } = t;
|
|
7246
7258
|
try {
|
|
7247
7259
|
await n.insertInto("branding").values({
|
|
@@ -7258,9 +7270,9 @@ function qi(n) {
|
|
|
7258
7270
|
await n.updateTable("branding").set({
|
|
7259
7271
|
...a,
|
|
7260
7272
|
colors_primary: s == null ? void 0 : s.primary,
|
|
7261
|
-
colors_page_background_type: (oe = (
|
|
7273
|
+
colors_page_background_type: (oe = (Re = t.colors) == null ? void 0 : Re.page_background) == null ? void 0 : oe.type,
|
|
7262
7274
|
colors_page_background_start: (de = (ce = t.colors) == null ? void 0 : ce.page_background) == null ? void 0 : de.start,
|
|
7263
|
-
colors_page_background_end: (
|
|
7275
|
+
colors_page_background_end: (Pe = ($e = t.colors) == null ? void 0 : $e.page_background) == null ? void 0 : Pe.end,
|
|
7264
7276
|
colors_page_background_angle_dev: (H = (K = t.colors) == null ? void 0 : K.page_background) == null ? void 0 : H.angle_deg,
|
|
7265
7277
|
font_url: (Q = t.font) == null ? void 0 : Q.url
|
|
7266
7278
|
}).where("tenant_id", "=", e).execute();
|
|
@@ -7342,7 +7354,7 @@ function eo(n) {
|
|
|
7342
7354
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7343
7355
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7344
7356
|
};
|
|
7345
|
-
return await n.insertInto("themes").values({ ...
|
|
7357
|
+
return await n.insertInto("themes").values({ ...It(s), tenant_id: e }).execute(), s;
|
|
7346
7358
|
};
|
|
7347
7359
|
}
|
|
7348
7360
|
function to(n) {
|
|
@@ -7356,7 +7368,7 @@ function no(n) {
|
|
|
7356
7368
|
}
|
|
7357
7369
|
function so(n) {
|
|
7358
7370
|
return async (e, t, s) => {
|
|
7359
|
-
const r =
|
|
7371
|
+
const r = It({
|
|
7360
7372
|
...s,
|
|
7361
7373
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7362
7374
|
});
|
|
@@ -7375,7 +7387,7 @@ function ao(n) {
|
|
|
7375
7387
|
return async (e, t) => {
|
|
7376
7388
|
const s = (/* @__PURE__ */ new Date()).toISOString(), r = await n.selectFrom("logins").where("logins.expires_at", ">", s).where("logins.login_id", "=", t).selectAll().executeTakeFirst();
|
|
7377
7389
|
return r ? xr.parse(
|
|
7378
|
-
|
|
7390
|
+
Kn(R(r), ["authParams"])
|
|
7379
7391
|
) : null;
|
|
7380
7392
|
};
|
|
7381
7393
|
}
|
|
@@ -7387,11 +7399,11 @@ function io(n) {
|
|
|
7387
7399
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7388
7400
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7389
7401
|
};
|
|
7390
|
-
return await n.insertInto("logins").values({ ...
|
|
7402
|
+
return await n.insertInto("logins").values({ ...It(s), tenant_id: e }).execute(), s;
|
|
7391
7403
|
};
|
|
7392
7404
|
}
|
|
7393
7405
|
function oo(n) {
|
|
7394
|
-
return async (e, t, s) => (await n.updateTable("logins").set(
|
|
7406
|
+
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
7407
|
}
|
|
7396
7408
|
function co(n) {
|
|
7397
7409
|
return async (e, t) => (await n.deleteFrom("logins").where("logins.tenant_id", "=", e).where("logins.login_id", "=", t).execute()).length > 0;
|
|
@@ -7415,7 +7427,7 @@ function lo(n) {
|
|
|
7415
7427
|
});
|
|
7416
7428
|
};
|
|
7417
7429
|
}
|
|
7418
|
-
function
|
|
7430
|
+
function vn(n) {
|
|
7419
7431
|
return R({
|
|
7420
7432
|
...n,
|
|
7421
7433
|
webauthn_platform_first_factor: n.webauthn_platform_first_factor ? !!n.webauthn_platform_first_factor : void 0,
|
|
@@ -7429,11 +7441,11 @@ function po(n) {
|
|
|
7429
7441
|
try {
|
|
7430
7442
|
const s = Rr.parse(t);
|
|
7431
7443
|
await n.insertInto("prompt_settings").values({
|
|
7432
|
-
...
|
|
7444
|
+
...vn(s),
|
|
7433
7445
|
tenant_id: e
|
|
7434
7446
|
}).execute();
|
|
7435
7447
|
} catch {
|
|
7436
|
-
await n.updateTable("prompt_settings").set(
|
|
7448
|
+
await n.updateTable("prompt_settings").set(vn(t)).where("tenant_id", "=", e).execute();
|
|
7437
7449
|
}
|
|
7438
7450
|
};
|
|
7439
7451
|
}
|