@authhero/kysely-adapter 0.8.1 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kysely-adapter.cjs +1 -1
- package/dist/kysely-adapter.d.ts +274 -27
- package/dist/kysely-adapter.iife.js +1 -1
- package/dist/kysely-adapter.mjs +1038 -975
- package/package.json +2 -2
package/dist/kysely-adapter.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var Ht = (n, e, t) =>
|
|
1
|
+
var Kn = Object.defineProperty;
|
|
2
|
+
var Hn = (n, e, t) => e in n ? Kn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var Ht = (n, e, t) => Hn(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
var Gt = class extends Error {
|
|
5
5
|
constructor(e = 500, t) {
|
|
6
6
|
super(t == null ? void 0 : t.message, { cause: t == null ? void 0 : t.cause });
|
|
@@ -17,7 +17,7 @@ var Gt = class extends Error {
|
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
function
|
|
20
|
+
function Qn(n) {
|
|
21
21
|
return async (e, t) => {
|
|
22
22
|
const { identities: s, ...r } = t, a = {
|
|
23
23
|
...r,
|
|
@@ -47,7 +47,7 @@ function R(n) {
|
|
|
47
47
|
e[t] === null ? delete e[t] : typeof e[t] == "object" && (Array.isArray(e[t]) ? e[t] = e[t].map(R) : e[t] = R(e[t]));
|
|
48
48
|
return e;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function Yn(n, e) {
|
|
51
51
|
var t = {};
|
|
52
52
|
for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && e.indexOf(s) < 0 && (t[s] = n[s]);
|
|
53
53
|
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -55,30 +55,30 @@ function Qn(n, e) {
|
|
|
55
55
|
e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, s[r]) && (t[s[r]] = n[s[r]]);
|
|
56
56
|
return t;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function Gn(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 Qe(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);
|
|
66
66
|
return r._def.openapi = this._def.openapi, r;
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function Xn(n) {
|
|
70
70
|
if (typeof n.ZodType.prototype.openapi < "u")
|
|
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, $e = Yn(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), $e), !((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
|
-
if (
|
|
78
|
-
const
|
|
79
|
-
de.extend = function(...
|
|
77
|
+
if (Gn(this, "ZodObject")) {
|
|
78
|
+
const Pe = this.extend;
|
|
79
|
+
de.extend = function(...De) {
|
|
80
80
|
var K, H, Q, ue, xe, Te;
|
|
81
|
-
const Oe =
|
|
81
|
+
const Oe = Pe.apply(this, De);
|
|
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 Gn(n) {
|
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
90
|
return de;
|
|
91
|
-
},
|
|
91
|
+
}, Qe(n, "optional"), Qe(n, "nullable"), Qe(n, "default"), Qe(n, "transform"), Qe(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();
|
|
@@ -212,7 +212,7 @@ const _ = N.arrayToEnum([
|
|
|
212
212
|
"invalid_intersection_types",
|
|
213
213
|
"not_multiple_of",
|
|
214
214
|
"not_finite"
|
|
215
|
-
]),
|
|
215
|
+
]), es = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
216
216
|
class L extends Error {
|
|
217
217
|
constructor(e) {
|
|
218
218
|
super(), this.issues = [], this.addIssue = (s) => {
|
|
@@ -273,7 +273,7 @@ class L extends Error {
|
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
L.create = (n) => new L(n);
|
|
276
|
-
const
|
|
276
|
+
const Be = (n, e) => {
|
|
277
277
|
let t;
|
|
278
278
|
switch (n.code) {
|
|
279
279
|
case p.invalid_type:
|
|
@@ -329,12 +329,12 @@ const ze = (n, e) => {
|
|
|
329
329
|
}
|
|
330
330
|
return { message: t };
|
|
331
331
|
};
|
|
332
|
-
let
|
|
333
|
-
function
|
|
334
|
-
|
|
332
|
+
let wn = Be;
|
|
333
|
+
function ts(n) {
|
|
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 = {
|
|
@@ -356,7 +356,7 @@ const At = (n) => {
|
|
|
356
356
|
path: a,
|
|
357
357
|
message: c
|
|
358
358
|
};
|
|
359
|
-
},
|
|
359
|
+
}, ns = [];
|
|
360
360
|
function f(n, e) {
|
|
361
361
|
const t = Et(), s = At({
|
|
362
362
|
issueData: e,
|
|
@@ -366,7 +366,7 @@ function f(n, e) {
|
|
|
366
366
|
n.common.contextualErrorMap,
|
|
367
367
|
n.schemaErrorMap,
|
|
368
368
|
t,
|
|
369
|
-
t ===
|
|
369
|
+
t === Be ? void 0 : Be
|
|
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", nt = (n) => n.status === "valid", st = (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 Ge, Xe;
|
|
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 fn = (n, e) => {
|
|
441
|
+
if (nt(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 (st(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 fn(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 (st(r) ? r : Promise.resolve(r));
|
|
551
|
+
return fn(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 qe.create(this, this._def);
|
|
590
590
|
}
|
|
591
591
|
or(e) {
|
|
592
|
-
return
|
|
592
|
+
return ot.create([this, e], this._def);
|
|
593
593
|
}
|
|
594
594
|
and(e) {
|
|
595
|
-
return
|
|
595
|
+
return ct.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 ht({
|
|
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 ft({
|
|
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 Ct.create(this, e);
|
|
639
639
|
}
|
|
640
640
|
readonly() {
|
|
641
|
-
return
|
|
641
|
+
return mt.create(this);
|
|
642
642
|
}
|
|
643
643
|
isOptional() {
|
|
644
644
|
return this.safeParse(void 0).success;
|
|
@@ -647,23 +647,23 @@ class S {
|
|
|
647
647
|
return this.safeParse(null).success;
|
|
648
648
|
}
|
|
649
649
|
}
|
|
650
|
-
const
|
|
650
|
+
const ss = /^c[^\s-]{8,}$/i, rs = /^[0-9a-z]+$/, as = /^[0-9A-HJKMNP-TV-Z]{26}$/, is = /^[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, os = /^[a-z0-9_-]{21}$/i, cs = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, ds = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, us = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
651
651
|
let Qt;
|
|
652
|
-
const
|
|
653
|
-
function
|
|
652
|
+
const ls = /^(?:(?: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])$/, ps = /^(([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})))$/, hs = /^([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])))", fs = 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
|
-
function
|
|
658
|
-
return new RegExp(`^${
|
|
657
|
+
function ms(n) {
|
|
658
|
+
return new RegExp(`^${xn(n)}$`);
|
|
659
659
|
}
|
|
660
|
-
function
|
|
661
|
-
let e = `${kn}T${
|
|
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
|
}
|
|
665
|
-
function
|
|
666
|
-
return !!((e === "v4" || !e) &&
|
|
665
|
+
function _s(n, e) {
|
|
666
|
+
return !!((e === "v4" || !e) && ls.test(n) || (e === "v6" || !e) && ps.test(n));
|
|
667
667
|
}
|
|
668
668
|
class F extends S {
|
|
669
669
|
_parse(e) {
|
|
@@ -714,43 +714,43 @@ class F extends S {
|
|
|
714
714
|
message: r.message
|
|
715
715
|
}), t.dirty());
|
|
716
716
|
} else if (r.kind === "email")
|
|
717
|
-
|
|
717
|
+
ds.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
718
718
|
validation: "email",
|
|
719
719
|
code: p.invalid_string,
|
|
720
720
|
message: r.message
|
|
721
721
|
}), t.dirty());
|
|
722
722
|
else if (r.kind === "emoji")
|
|
723
|
-
Qt || (Qt = new RegExp(
|
|
723
|
+
Qt || (Qt = new RegExp(us, "u")), Qt.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
724
724
|
validation: "emoji",
|
|
725
725
|
code: p.invalid_string,
|
|
726
726
|
message: r.message
|
|
727
727
|
}), t.dirty());
|
|
728
728
|
else if (r.kind === "uuid")
|
|
729
|
-
|
|
729
|
+
is.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
730
730
|
validation: "uuid",
|
|
731
731
|
code: p.invalid_string,
|
|
732
732
|
message: r.message
|
|
733
733
|
}), t.dirty());
|
|
734
734
|
else if (r.kind === "nanoid")
|
|
735
|
-
|
|
735
|
+
os.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
736
736
|
validation: "nanoid",
|
|
737
737
|
code: p.invalid_string,
|
|
738
738
|
message: r.message
|
|
739
739
|
}), t.dirty());
|
|
740
740
|
else if (r.kind === "cuid")
|
|
741
|
-
|
|
741
|
+
ss.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
742
742
|
validation: "cuid",
|
|
743
743
|
code: p.invalid_string,
|
|
744
744
|
message: r.message
|
|
745
745
|
}), t.dirty());
|
|
746
746
|
else if (r.kind === "cuid2")
|
|
747
|
-
|
|
747
|
+
rs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
748
748
|
validation: "cuid2",
|
|
749
749
|
code: p.invalid_string,
|
|
750
750
|
message: r.message
|
|
751
751
|
}), t.dirty());
|
|
752
752
|
else if (r.kind === "ulid")
|
|
753
|
-
|
|
753
|
+
as.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
754
754
|
validation: "ulid",
|
|
755
755
|
code: p.invalid_string,
|
|
756
756
|
message: r.message
|
|
@@ -781,27 +781,27 @@ 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
|
|
788
|
-
}), t.dirty()) : r.kind === "date" ?
|
|
788
|
+
}), t.dirty()) : r.kind === "date" ? fs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
789
789
|
code: p.invalid_string,
|
|
790
790
|
validation: "date",
|
|
791
791
|
message: r.message
|
|
792
|
-
}), t.dirty()) : r.kind === "time" ?
|
|
792
|
+
}), t.dirty()) : r.kind === "time" ? ms(r).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
793
793
|
code: p.invalid_string,
|
|
794
794
|
validation: "time",
|
|
795
795
|
message: r.message
|
|
796
|
-
}), t.dirty()) : r.kind === "duration" ?
|
|
796
|
+
}), t.dirty()) : r.kind === "duration" ? cs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
797
797
|
validation: "duration",
|
|
798
798
|
code: p.invalid_string,
|
|
799
799
|
message: r.message
|
|
800
|
-
}), t.dirty()) : r.kind === "ip" ?
|
|
800
|
+
}), t.dirty()) : r.kind === "ip" ? _s(e.data, r.version) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
801
801
|
validation: "ip",
|
|
802
802
|
code: p.invalid_string,
|
|
803
803
|
message: r.message
|
|
804
|
-
}), t.dirty()) : r.kind === "base64" ?
|
|
804
|
+
}), t.dirty()) : r.kind === "base64" ? hs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
805
805
|
validation: "base64",
|
|
806
806
|
code: p.invalid_string,
|
|
807
807
|
message: r.message
|
|
@@ -1023,7 +1023,7 @@ F.create = (n) => {
|
|
|
1023
1023
|
...T(n)
|
|
1024
1024
|
});
|
|
1025
1025
|
};
|
|
1026
|
-
function
|
|
1026
|
+
function gs(n, e) {
|
|
1027
1027
|
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(".", ""));
|
|
1028
1028
|
return a % o / Math.pow(10, r);
|
|
1029
1029
|
}
|
|
@@ -1062,7 +1062,7 @@ class fe extends S {
|
|
|
1062
1062
|
inclusive: r.inclusive,
|
|
1063
1063
|
exact: !1,
|
|
1064
1064
|
message: r.message
|
|
1065
|
-
}), s.dirty()) : r.kind === "multipleOf" ?
|
|
1065
|
+
}), s.dirty()) : r.kind === "multipleOf" ? gs(e.data, r.value) !== 0 && (t = this._getOrReturnCtx(e, t), f(t, {
|
|
1066
1066
|
code: p.not_multiple_of,
|
|
1067
1067
|
multipleOf: r.value,
|
|
1068
1068
|
message: r.message
|
|
@@ -1327,7 +1327,7 @@ me.create = (n) => {
|
|
|
1327
1327
|
...T(n)
|
|
1328
1328
|
});
|
|
1329
1329
|
};
|
|
1330
|
-
class
|
|
1330
|
+
class rt 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 st extends S {
|
|
|
1340
1340
|
return D(e.data);
|
|
1341
1341
|
}
|
|
1342
1342
|
}
|
|
1343
|
-
|
|
1343
|
+
rt.create = (n) => new rt({
|
|
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 at 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 rt extends S {
|
|
|
1453
1453
|
return D(e.data);
|
|
1454
1454
|
}
|
|
1455
1455
|
}
|
|
1456
|
-
|
|
1456
|
+
at.create = (n) => new at({
|
|
1457
1457
|
typeName: w.ZodUndefined,
|
|
1458
1458
|
...T(n)
|
|
1459
1459
|
});
|
|
1460
|
-
class
|
|
1460
|
+
class it 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 at extends S {
|
|
|
1470
1470
|
return D(e.data);
|
|
1471
1471
|
}
|
|
1472
1472
|
}
|
|
1473
|
-
|
|
1473
|
+
it.create = (n) => new it({
|
|
1474
1474
|
typeName: w.ZodNull,
|
|
1475
1475
|
...T(n)
|
|
1476
1476
|
});
|
|
1477
|
-
class
|
|
1477
|
+
class We extends S {
|
|
1478
1478
|
constructor() {
|
|
1479
1479
|
super(...arguments), this._any = !0;
|
|
1480
1480
|
}
|
|
@@ -1482,7 +1482,7 @@ class Be extends S {
|
|
|
1482
1482
|
return D(e.data);
|
|
1483
1483
|
}
|
|
1484
1484
|
}
|
|
1485
|
-
|
|
1485
|
+
We.create = (n) => new We({
|
|
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 Le(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(Le(s));
|
|
1611
1611
|
}
|
|
1612
1612
|
return new I({
|
|
1613
1613
|
...n._def,
|
|
@@ -1615,8 +1615,8 @@ function Me(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: Le(n.element)
|
|
1619
|
+
}) : n instanceof Y ? Y.create(Le(n.unwrap())) : n instanceof ge ? ge.create(Le(n.unwrap())) : n instanceof ee ? ee.create(n.items.map((e) => Le(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 Le(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 ot 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 it extends S {
|
|
|
1973
1973
|
return this._def.options;
|
|
1974
1974
|
}
|
|
1975
1975
|
}
|
|
1976
|
-
|
|
1976
|
+
ot.create = (n, e) => new ot({
|
|
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 ut ? le(n.schema) : n instanceof q ? le(n.innerType()) : n instanceof lt ? [n.value] : n instanceof _e ? n.options : n instanceof pt ? N.objectValues(n.enum) : n instanceof ht ? le(n._def.innerType) : n instanceof at ? [void 0] : n instanceof it ? [null] : n instanceof Y ? [void 0, ...le(n.unwrap())] : n instanceof ge ? [null, ...le(n.unwrap())] : n instanceof cn || n instanceof mt ? le(n.unwrap()) : n instanceof ft ? 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 ct 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 ot extends S {
|
|
|
2099
2099
|
}));
|
|
2100
2100
|
}
|
|
2101
2101
|
}
|
|
2102
|
-
|
|
2102
|
+
ct.create = (n, e, t) => new ct({
|
|
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 dt extends S {
|
|
2159
2159
|
get keySchema() {
|
|
2160
2160
|
return this._def.keyType;
|
|
2161
2161
|
}
|
|
@@ -2183,12 +2183,12 @@ class ct 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 dt({
|
|
2187
2187
|
keyType: e,
|
|
2188
2188
|
valueType: t,
|
|
2189
2189
|
typeName: w.ZodRecord,
|
|
2190
2190
|
...T(s)
|
|
2191
|
-
}) : new
|
|
2191
|
+
}) : new dt({
|
|
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 Fe extends S {
|
|
2312
2312
|
constructor() {
|
|
2313
2313
|
super(...arguments), this.validate = this.implement;
|
|
2314
2314
|
}
|
|
@@ -2328,7 +2328,7 @@ class Ue extends S {
|
|
|
2328
2328
|
t.common.contextualErrorMap,
|
|
2329
2329
|
t.schemaErrorMap,
|
|
2330
2330
|
Et(),
|
|
2331
|
-
|
|
2331
|
+
Be
|
|
2332
2332
|
].filter((u) => !!u),
|
|
2333
2333
|
issueData: {
|
|
2334
2334
|
code: p.invalid_arguments,
|
|
@@ -2344,7 +2344,7 @@ class Ue extends S {
|
|
|
2344
2344
|
t.common.contextualErrorMap,
|
|
2345
2345
|
t.schemaErrorMap,
|
|
2346
2346
|
Et(),
|
|
2347
|
-
|
|
2347
|
+
Be
|
|
2348
2348
|
].filter((u) => !!u),
|
|
2349
2349
|
issueData: {
|
|
2350
2350
|
code: p.invalid_return_type,
|
|
@@ -2353,7 +2353,7 @@ class Ue 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 qe) {
|
|
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 Ue extends S {
|
|
|
2383
2383
|
return this._def.returns;
|
|
2384
2384
|
}
|
|
2385
2385
|
args(...e) {
|
|
2386
|
-
return new
|
|
2386
|
+
return new Fe({
|
|
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 Fe({
|
|
2393
2393
|
...this._def,
|
|
2394
2394
|
returns: e
|
|
2395
2395
|
});
|
|
@@ -2401,7 +2401,7 @@ class Ue extends S {
|
|
|
2401
2401
|
return this.parse(e);
|
|
2402
2402
|
}
|
|
2403
2403
|
static create(e, t, s) {
|
|
2404
|
-
return new
|
|
2404
|
+
return new Fe({
|
|
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 Ue extends S {
|
|
|
2409
2409
|
});
|
|
2410
2410
|
}
|
|
2411
2411
|
}
|
|
2412
|
-
class
|
|
2412
|
+
class ut extends S {
|
|
2413
2413
|
get schema() {
|
|
2414
2414
|
return this._def.getter();
|
|
2415
2415
|
}
|
|
@@ -2418,12 +2418,12 @@ class dt extends S {
|
|
|
2418
2418
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
2419
2419
|
}
|
|
2420
2420
|
}
|
|
2421
|
-
|
|
2421
|
+
ut.create = (n, e) => new ut({
|
|
2422
2422
|
getter: n,
|
|
2423
2423
|
typeName: w.ZodLazy,
|
|
2424
2424
|
...T(e)
|
|
2425
2425
|
});
|
|
2426
|
-
class
|
|
2426
|
+
class lt 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 ut extends S {
|
|
|
2439
2439
|
return this._def.value;
|
|
2440
2440
|
}
|
|
2441
2441
|
}
|
|
2442
|
-
|
|
2442
|
+
lt.create = (n, e) => new lt({
|
|
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 Tn(n, e) {
|
|
|
2453
2453
|
}
|
|
2454
2454
|
class _e extends S {
|
|
2455
2455
|
constructor() {
|
|
2456
|
-
super(...arguments),
|
|
2456
|
+
super(...arguments), Ge.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, Ge) || bn(this, Ge, new Set(this._def.values)), !$t(this, Ge).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
|
+
Ge = /* @__PURE__ */ new WeakMap();
|
|
2512
|
+
_e.create = On;
|
|
2513
|
+
class pt extends S {
|
|
2514
2514
|
constructor() {
|
|
2515
|
-
super(...arguments),
|
|
2515
|
+
super(...arguments), Xe.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 lt extends S {
|
|
|
2524
2524
|
code: p.invalid_type
|
|
2525
2525
|
}), x;
|
|
2526
2526
|
}
|
|
2527
|
-
if ($t(this,
|
|
2527
|
+
if ($t(this, Xe) || bn(this, Xe, new Set(N.getValidEnumValues(this._def.values))), !$t(this, Xe).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 lt extends S {
|
|
|
2538
2538
|
return this._def.values;
|
|
2539
2539
|
}
|
|
2540
2540
|
}
|
|
2541
|
-
|
|
2542
|
-
|
|
2541
|
+
Xe = /* @__PURE__ */ new WeakMap();
|
|
2542
|
+
pt.create = (n, e) => new pt({
|
|
2543
2543
|
values: n,
|
|
2544
2544
|
typeName: w.ZodNativeEnum,
|
|
2545
2545
|
...T(e)
|
|
2546
2546
|
});
|
|
2547
|
-
class
|
|
2547
|
+
class qe extends S {
|
|
2548
2548
|
unwrap() {
|
|
2549
2549
|
return this._def.type;
|
|
2550
2550
|
}
|
|
@@ -2563,7 +2563,7 @@ class We extends S {
|
|
|
2563
2563
|
})));
|
|
2564
2564
|
}
|
|
2565
2565
|
}
|
|
2566
|
-
|
|
2566
|
+
qe.create = (n, e) => new qe({
|
|
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 (!nt(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) => nt(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 ht 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 pt extends S {
|
|
|
2697
2697
|
return this._def.innerType;
|
|
2698
2698
|
}
|
|
2699
2699
|
}
|
|
2700
|
-
|
|
2700
|
+
ht.create = (n, e) => new ht({
|
|
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 ft extends S {
|
|
2707
2707
|
_parse(e) {
|
|
2708
2708
|
const { ctx: t } = this._processInputParams(e), s = {
|
|
2709
2709
|
...t,
|
|
@@ -2718,7 +2718,7 @@ class ht extends S {
|
|
|
2718
2718
|
...s
|
|
2719
2719
|
}
|
|
2720
2720
|
});
|
|
2721
|
-
return
|
|
2721
|
+
return st(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 ht extends S {
|
|
|
2740
2740
|
return this._def.innerType;
|
|
2741
2741
|
}
|
|
2742
2742
|
}
|
|
2743
|
-
|
|
2743
|
+
ft.create = (n, e) => new ft({
|
|
2744
2744
|
innerType: n,
|
|
2745
2745
|
typeName: w.ZodCatch,
|
|
2746
2746
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
@@ -2763,7 +2763,7 @@ Lt.create = (n) => new Lt({
|
|
|
2763
2763
|
typeName: w.ZodNaN,
|
|
2764
2764
|
...T(n)
|
|
2765
2765
|
});
|
|
2766
|
-
const
|
|
2766
|
+
const ys = Symbol("zod_brand");
|
|
2767
2767
|
class cn extends S {
|
|
2768
2768
|
_parse(e) {
|
|
2769
2769
|
const { ctx: t } = this._processInputParams(e), s = t.data;
|
|
@@ -2777,7 +2777,7 @@ class cn extends S {
|
|
|
2777
2777
|
return this._def.type;
|
|
2778
2778
|
}
|
|
2779
2779
|
}
|
|
2780
|
-
class
|
|
2780
|
+
class Ct extends S {
|
|
2781
2781
|
_parse(e) {
|
|
2782
2782
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
2783
2783
|
if (s.common.async)
|
|
@@ -2810,62 +2810,62 @@ class Nt extends S {
|
|
|
2810
2810
|
}
|
|
2811
2811
|
}
|
|
2812
2812
|
static create(e, t) {
|
|
2813
|
-
return new
|
|
2813
|
+
return new Ct({
|
|
2814
2814
|
in: e,
|
|
2815
2815
|
out: t,
|
|
2816
2816
|
typeName: w.ZodPipeline
|
|
2817
2817
|
});
|
|
2818
2818
|
}
|
|
2819
2819
|
}
|
|
2820
|
-
class
|
|
2820
|
+
class mt 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) => (nt(r) && (r.value = Object.freeze(r.value)), r);
|
|
2823
|
+
return st(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
|
+
mt.create = (n, e) => new mt({
|
|
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 ? We.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
|
+
}) : We.create();
|
|
2842
2842
|
}
|
|
2843
|
-
const
|
|
2843
|
+
const vs = {
|
|
2844
2844
|
object: I.lazycreate
|
|
2845
2845
|
};
|
|
2846
2846
|
var w;
|
|
2847
2847
|
(function(n) {
|
|
2848
2848
|
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";
|
|
2849
2849
|
})(w || (w = {}));
|
|
2850
|
-
const
|
|
2850
|
+
const ws = (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, bs = Lt.create, ks = me.create, Nn = rt.create, xs = je.create, Ts = Pt.create, Os = at.create, Ss = it.create, Zs = We.create, js = Se.create, Ns = re.create, Cs = Dt.create, Is = B.create, Es = I.create, As = I.strictCreate, Rs = ot.create, $s = Jt.create, Ps = ct.create, Ds = ee.create, Ms = dt.create, Ls = Mt.create, Vs = Ne.create, Us = Fe.create, Fs = ut.create, zs = lt.create, Bs = _e.create, Ws = pt.create, qs = qe.create, mn = q.create, Js = Y.create, Ks = ge.create, Hs = q.createWithPreprocess, Qs = Ct.create, Ys = () => Zn().optional(), Gs = () => jn().optional(), Xs = () => Nn().optional(), er = {
|
|
2853
2853
|
string: (n) => F.create({ ...n, coerce: !0 }),
|
|
2854
2854
|
number: (n) => fe.create({ ...n, coerce: !0 }),
|
|
2855
|
-
boolean: (n) =>
|
|
2855
|
+
boolean: (n) => rt.create({
|
|
2856
2856
|
...n,
|
|
2857
2857
|
coerce: !0
|
|
2858
2858
|
}),
|
|
2859
2859
|
bigint: (n) => me.create({ ...n, coerce: !0 }),
|
|
2860
2860
|
date: (n) => je.create({ ...n, coerce: !0 })
|
|
2861
|
-
},
|
|
2861
|
+
}, tr = x;
|
|
2862
2862
|
var i = /* @__PURE__ */ Object.freeze({
|
|
2863
2863
|
__proto__: null,
|
|
2864
|
-
defaultErrorMap:
|
|
2865
|
-
setErrorMap:
|
|
2864
|
+
defaultErrorMap: Be,
|
|
2865
|
+
setErrorMap: ts,
|
|
2866
2866
|
getErrorMap: Et,
|
|
2867
2867
|
makeIssue: At,
|
|
2868
|
-
EMPTY_PATH:
|
|
2868
|
+
EMPTY_PATH: ns,
|
|
2869
2869
|
addIssueToContext: f,
|
|
2870
2870
|
ParseStatus: $,
|
|
2871
2871
|
INVALID: x,
|
|
@@ -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: nt,
|
|
2877
|
+
isAsync: st,
|
|
2878
2878
|
get util() {
|
|
2879
2879
|
return N;
|
|
2880
2880
|
},
|
|
@@ -2884,98 +2884,98 @@ 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: rt,
|
|
2892
2892
|
ZodDate: je,
|
|
2893
2893
|
ZodSymbol: Pt,
|
|
2894
|
-
ZodUndefined:
|
|
2895
|
-
ZodNull:
|
|
2896
|
-
ZodAny:
|
|
2894
|
+
ZodUndefined: at,
|
|
2895
|
+
ZodNull: it,
|
|
2896
|
+
ZodAny: We,
|
|
2897
2897
|
ZodUnknown: Se,
|
|
2898
2898
|
ZodNever: re,
|
|
2899
2899
|
ZodVoid: Dt,
|
|
2900
2900
|
ZodArray: B,
|
|
2901
2901
|
ZodObject: I,
|
|
2902
|
-
ZodUnion:
|
|
2902
|
+
ZodUnion: ot,
|
|
2903
2903
|
ZodDiscriminatedUnion: Jt,
|
|
2904
|
-
ZodIntersection:
|
|
2904
|
+
ZodIntersection: ct,
|
|
2905
2905
|
ZodTuple: ee,
|
|
2906
|
-
ZodRecord:
|
|
2906
|
+
ZodRecord: dt,
|
|
2907
2907
|
ZodMap: Mt,
|
|
2908
2908
|
ZodSet: Ne,
|
|
2909
|
-
ZodFunction:
|
|
2910
|
-
ZodLazy:
|
|
2911
|
-
ZodLiteral:
|
|
2909
|
+
ZodFunction: Fe,
|
|
2910
|
+
ZodLazy: ut,
|
|
2911
|
+
ZodLiteral: lt,
|
|
2912
2912
|
ZodEnum: _e,
|
|
2913
|
-
ZodNativeEnum:
|
|
2914
|
-
ZodPromise:
|
|
2913
|
+
ZodNativeEnum: pt,
|
|
2914
|
+
ZodPromise: qe,
|
|
2915
2915
|
ZodEffects: q,
|
|
2916
2916
|
ZodTransformer: q,
|
|
2917
2917
|
ZodOptional: Y,
|
|
2918
2918
|
ZodNullable: ge,
|
|
2919
|
-
ZodDefault:
|
|
2920
|
-
ZodCatch:
|
|
2919
|
+
ZodDefault: ht,
|
|
2920
|
+
ZodCatch: ft,
|
|
2921
2921
|
ZodNaN: Lt,
|
|
2922
|
-
BRAND:
|
|
2922
|
+
BRAND: ys,
|
|
2923
2923
|
ZodBranded: cn,
|
|
2924
|
-
ZodPipeline:
|
|
2925
|
-
ZodReadonly:
|
|
2926
|
-
custom:
|
|
2924
|
+
ZodPipeline: Ct,
|
|
2925
|
+
ZodReadonly: mt,
|
|
2926
|
+
custom: Sn,
|
|
2927
2927
|
Schema: S,
|
|
2928
2928
|
ZodSchema: S,
|
|
2929
|
-
late:
|
|
2929
|
+
late: vs,
|
|
2930
2930
|
get ZodFirstPartyTypeKind() {
|
|
2931
2931
|
return w;
|
|
2932
2932
|
},
|
|
2933
|
-
coerce:
|
|
2934
|
-
any:
|
|
2935
|
-
array:
|
|
2933
|
+
coerce: er,
|
|
2934
|
+
any: Zs,
|
|
2935
|
+
array: Is,
|
|
2936
2936
|
bigint: ks,
|
|
2937
|
-
boolean:
|
|
2938
|
-
date:
|
|
2939
|
-
discriminatedUnion:
|
|
2940
|
-
effect:
|
|
2941
|
-
enum:
|
|
2942
|
-
function:
|
|
2943
|
-
instanceof:
|
|
2944
|
-
intersection:
|
|
2945
|
-
lazy:
|
|
2946
|
-
literal:
|
|
2947
|
-
map:
|
|
2948
|
-
nan:
|
|
2949
|
-
nativeEnum:
|
|
2950
|
-
never:
|
|
2951
|
-
null:
|
|
2952
|
-
nullable:
|
|
2953
|
-
number:
|
|
2954
|
-
object:
|
|
2955
|
-
oboolean:
|
|
2956
|
-
onumber:
|
|
2957
|
-
optional:
|
|
2958
|
-
ostring:
|
|
2959
|
-
pipeline:
|
|
2960
|
-
preprocess:
|
|
2961
|
-
promise:
|
|
2962
|
-
record:
|
|
2963
|
-
set:
|
|
2964
|
-
strictObject:
|
|
2965
|
-
string:
|
|
2966
|
-
symbol:
|
|
2967
|
-
transformer:
|
|
2968
|
-
tuple:
|
|
2969
|
-
undefined:
|
|
2970
|
-
union:
|
|
2971
|
-
unknown:
|
|
2972
|
-
void:
|
|
2973
|
-
NEVER:
|
|
2937
|
+
boolean: Nn,
|
|
2938
|
+
date: xs,
|
|
2939
|
+
discriminatedUnion: $s,
|
|
2940
|
+
effect: mn,
|
|
2941
|
+
enum: Bs,
|
|
2942
|
+
function: Us,
|
|
2943
|
+
instanceof: ws,
|
|
2944
|
+
intersection: Ps,
|
|
2945
|
+
lazy: Fs,
|
|
2946
|
+
literal: zs,
|
|
2947
|
+
map: Ls,
|
|
2948
|
+
nan: bs,
|
|
2949
|
+
nativeEnum: Ws,
|
|
2950
|
+
never: Ns,
|
|
2951
|
+
null: Ss,
|
|
2952
|
+
nullable: Ks,
|
|
2953
|
+
number: jn,
|
|
2954
|
+
object: Es,
|
|
2955
|
+
oboolean: Xs,
|
|
2956
|
+
onumber: Gs,
|
|
2957
|
+
optional: Js,
|
|
2958
|
+
ostring: Ys,
|
|
2959
|
+
pipeline: Qs,
|
|
2960
|
+
preprocess: Hs,
|
|
2961
|
+
promise: qs,
|
|
2962
|
+
record: Ms,
|
|
2963
|
+
set: Vs,
|
|
2964
|
+
strictObject: As,
|
|
2965
|
+
string: Zn,
|
|
2966
|
+
symbol: Ts,
|
|
2967
|
+
transformer: mn,
|
|
2968
|
+
tuple: Ds,
|
|
2969
|
+
undefined: Os,
|
|
2970
|
+
union: Rs,
|
|
2971
|
+
unknown: js,
|
|
2972
|
+
void: Cs,
|
|
2973
|
+
NEVER: tr,
|
|
2974
2974
|
ZodIssueCode: p,
|
|
2975
|
-
quotelessJson:
|
|
2975
|
+
quotelessJson: es,
|
|
2976
2976
|
ZodError: L
|
|
2977
2977
|
});
|
|
2978
|
-
|
|
2978
|
+
Xn(i);
|
|
2979
2979
|
i.object({
|
|
2980
2980
|
start: i.number(),
|
|
2981
2981
|
limit: i.number(),
|
|
@@ -2984,7 +2984,7 @@ i.object({
|
|
|
2984
2984
|
const dn = i.object({
|
|
2985
2985
|
created_at: i.string(),
|
|
2986
2986
|
updated_at: i.string()
|
|
2987
|
-
}),
|
|
2987
|
+
}), nr = i.object({
|
|
2988
2988
|
email: i.string().optional(),
|
|
2989
2989
|
email_verified: i.boolean().optional(),
|
|
2990
2990
|
name: i.string().optional(),
|
|
@@ -2993,7 +2993,7 @@ const dn = i.object({
|
|
|
2993
2993
|
phone_number: i.string().optional(),
|
|
2994
2994
|
phone_verified: i.boolean().optional(),
|
|
2995
2995
|
family_name: i.string().optional()
|
|
2996
|
-
}).catchall(i.any()),
|
|
2996
|
+
}).catchall(i.any()), sr = i.object({
|
|
2997
2997
|
connection: i.string(),
|
|
2998
2998
|
user_id: i.string(),
|
|
2999
2999
|
provider: i.string(),
|
|
@@ -3001,8 +3001,8 @@ const dn = i.object({
|
|
|
3001
3001
|
access_token: i.string().optional(),
|
|
3002
3002
|
access_token_secret: i.string().optional(),
|
|
3003
3003
|
refresh_token: i.string().optional(),
|
|
3004
|
-
profileData:
|
|
3005
|
-
}),
|
|
3004
|
+
profileData: nr.optional()
|
|
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
|
-
}),
|
|
3017
|
+
}), rr = Cn.extend({
|
|
3018
3018
|
email_verified: i.boolean().default(!1),
|
|
3019
3019
|
verify_email: i.boolean().optional(),
|
|
3020
3020
|
last_ip: i.string().optional(),
|
|
@@ -3023,15 +3023,15 @@ const dn = i.object({
|
|
|
3023
3023
|
provider: i.string().default("email"),
|
|
3024
3024
|
connection: i.string().default("email")
|
|
3025
3025
|
});
|
|
3026
|
-
|
|
3026
|
+
rr.extend(dn.shape).extend({
|
|
3027
3027
|
user_id: i.string(),
|
|
3028
3028
|
// TODO: this not might be correct if you use the username
|
|
3029
3029
|
email: i.string(),
|
|
3030
3030
|
is_social: i.boolean(),
|
|
3031
3031
|
login_count: i.number(),
|
|
3032
|
-
identities: i.array(
|
|
3032
|
+
identities: i.array(sr).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(),
|
|
@@ -3039,7 +3039,7 @@ Nn.extend({
|
|
|
3039
3039
|
last_login: i.string().optional(),
|
|
3040
3040
|
user_id: i.string()
|
|
3041
3041
|
}).catchall(i.any());
|
|
3042
|
-
const
|
|
3042
|
+
const ar = i.object({
|
|
3043
3043
|
audience: i.string().optional(),
|
|
3044
3044
|
recipient: i.string().optional(),
|
|
3045
3045
|
createUpnClaim: i.boolean().optional(),
|
|
@@ -3056,7 +3056,7 @@ const rr = i.object({
|
|
|
3056
3056
|
nameIdentifierProbes: i.array(i.string()).optional(),
|
|
3057
3057
|
authnContextClassRef: i.string().optional(),
|
|
3058
3058
|
mappings: i.record(i.string()).optional()
|
|
3059
|
-
}),
|
|
3059
|
+
}), ir = i.object({
|
|
3060
3060
|
id: i.string(),
|
|
3061
3061
|
name: i.string(),
|
|
3062
3062
|
callbacks: i.array(i.string()).openapi({
|
|
@@ -3071,8 +3071,11 @@ const rr = i.object({
|
|
|
3071
3071
|
allowed_logout_urls: i.array(i.string()).openapi({
|
|
3072
3072
|
description: "Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains."
|
|
3073
3073
|
}),
|
|
3074
|
+
allowed_clients: i.array(i.string()).openapi({
|
|
3075
|
+
description: "Ids of clients that will be allowed to perform delegation requests. Clients that will be allowed to make delegation request. By default, all your clients will be allowed. This field allows you to specify specific clients"
|
|
3076
|
+
}),
|
|
3074
3077
|
addons: i.object({
|
|
3075
|
-
samlp:
|
|
3078
|
+
samlp: ar.optional()
|
|
3076
3079
|
}).optional().openapi({
|
|
3077
3080
|
description: "Addons associated with the client. The key is the addon's package name and the value is an object with the configuration for the addon."
|
|
3078
3081
|
}),
|
|
@@ -3083,23 +3086,23 @@ const rr = i.object({
|
|
|
3083
3086
|
disable_sign_ups: i.boolean().default(!1).openapi({
|
|
3084
3087
|
description: "Prevents users from signing up using the hosted login page. This is not available in auth0"
|
|
3085
3088
|
})
|
|
3086
|
-
}),
|
|
3089
|
+
}), or = i.object({
|
|
3087
3090
|
created_at: i.string().transform((n) => n === null ? "" : n),
|
|
3088
3091
|
updated_at: i.string().transform((n) => n === null ? "" : n),
|
|
3089
|
-
...
|
|
3092
|
+
...ir.shape
|
|
3090
3093
|
});
|
|
3091
|
-
var
|
|
3092
|
-
const
|
|
3094
|
+
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 || {});
|
|
3095
|
+
const cr = i.object({
|
|
3093
3096
|
client_id: i.string(),
|
|
3094
3097
|
vendor_id: i.string().optional(),
|
|
3095
|
-
response_type: i.nativeEnum(
|
|
3096
|
-
response_mode: i.nativeEnum(
|
|
3098
|
+
response_type: i.nativeEnum(In).optional(),
|
|
3099
|
+
response_mode: i.nativeEnum(En).optional(),
|
|
3097
3100
|
redirect_uri: i.string().optional(),
|
|
3098
3101
|
audience: i.string().optional(),
|
|
3099
3102
|
state: i.string().optional(),
|
|
3100
3103
|
nonce: i.string().optional(),
|
|
3101
3104
|
scope: i.string().optional(),
|
|
3102
|
-
code_challenge_method: i.nativeEnum(
|
|
3105
|
+
code_challenge_method: i.nativeEnum(An).optional(),
|
|
3103
3106
|
code_challenge: i.string().optional(),
|
|
3104
3107
|
username: i.string().optional()
|
|
3105
3108
|
});
|
|
@@ -3119,14 +3122,36 @@ i.object({
|
|
|
3119
3122
|
url: i.string()
|
|
3120
3123
|
}).optional()
|
|
3121
3124
|
});
|
|
3122
|
-
const
|
|
3125
|
+
const dr = i.object({
|
|
3123
3126
|
id: i.string().optional(),
|
|
3124
3127
|
name: i.string(),
|
|
3125
|
-
|
|
3126
|
-
|
|
3128
|
+
strategy: i.enum([
|
|
3129
|
+
"google-oauth2",
|
|
3130
|
+
"facebook",
|
|
3131
|
+
"vipps",
|
|
3132
|
+
"apple",
|
|
3133
|
+
"email",
|
|
3134
|
+
"Username-Password-Authentication",
|
|
3135
|
+
"oidc",
|
|
3136
|
+
"oauth2",
|
|
3137
|
+
"custom"
|
|
3138
|
+
]).optional(),
|
|
3139
|
+
options: i.object({
|
|
3140
|
+
kid: i.string().optional(),
|
|
3141
|
+
team_id: i.string().optional(),
|
|
3142
|
+
realms: i.string().optional(),
|
|
3143
|
+
client_id: i.string().optional(),
|
|
3144
|
+
client_secret: i.string().optional(),
|
|
3145
|
+
app_secret: i.string().optional(),
|
|
3146
|
+
scope: i.string().optional()
|
|
3147
|
+
}).optional(),
|
|
3148
|
+
enabled_clients: i.array(i.string()).optional(),
|
|
3127
3149
|
authorization_endpoint: i.string().optional(),
|
|
3128
3150
|
response_type: i.custom().optional(),
|
|
3129
3151
|
response_mode: i.custom().optional(),
|
|
3152
|
+
// Deprecated
|
|
3153
|
+
client_id: i.string().optional(),
|
|
3154
|
+
client_secret: i.string().optional(),
|
|
3130
3155
|
private_key: i.string().optional(),
|
|
3131
3156
|
kid: i.string().optional(),
|
|
3132
3157
|
team_id: i.string().optional(),
|
|
@@ -3134,11 +3159,11 @@ const cr = i.object({
|
|
|
3134
3159
|
token_exchange_basic_auth: i.boolean().optional(),
|
|
3135
3160
|
userinfo_endpoint: i.string().optional(),
|
|
3136
3161
|
scope: i.string().optional()
|
|
3137
|
-
}),
|
|
3162
|
+
}), Rn = i.object({
|
|
3138
3163
|
id: i.string(),
|
|
3139
3164
|
created_at: i.string().transform((n) => n === null ? "" : n),
|
|
3140
3165
|
updated_at: i.string().transform((n) => n === null ? "" : n)
|
|
3141
|
-
}).extend(
|
|
3166
|
+
}).extend(dr.shape), ur = i.object({
|
|
3142
3167
|
name: i.string(),
|
|
3143
3168
|
audience: i.string(),
|
|
3144
3169
|
sender_email: i.string().email(),
|
|
@@ -3148,11 +3173,11 @@ const cr = i.object({
|
|
|
3148
3173
|
primary_color: i.string().optional(),
|
|
3149
3174
|
secondary_color: i.string().optional(),
|
|
3150
3175
|
language: i.string().optional()
|
|
3151
|
-
}),
|
|
3176
|
+
}), lr = i.object({
|
|
3152
3177
|
created_at: i.string().transform((n) => n === null ? "" : n),
|
|
3153
3178
|
updated_at: i.string().transform((n) => n === null ? "" : n),
|
|
3154
3179
|
id: i.string(),
|
|
3155
|
-
...
|
|
3180
|
+
...ur.shape
|
|
3156
3181
|
});
|
|
3157
3182
|
i.object({
|
|
3158
3183
|
logoUrl: i.string(),
|
|
@@ -3172,7 +3197,7 @@ i.object({
|
|
|
3172
3197
|
siteUrl: i.string().nullable(),
|
|
3173
3198
|
manageSubscriptionsUrl: i.string().optional()
|
|
3174
3199
|
});
|
|
3175
|
-
const
|
|
3200
|
+
const pr = i.object({
|
|
3176
3201
|
domain: i.string(),
|
|
3177
3202
|
dkim_private_key: i.string().optional(),
|
|
3178
3203
|
dkim_public_key: i.string().optional(),
|
|
@@ -3180,19 +3205,19 @@ const lr = i.object({
|
|
|
3180
3205
|
email_service: i.union([i.literal("mailgun"), i.literal("mailchannels")]).optional()
|
|
3181
3206
|
});
|
|
3182
3207
|
i.object({
|
|
3183
|
-
...
|
|
3184
|
-
domains: i.array(
|
|
3185
|
-
tenant:
|
|
3186
|
-
connections: i.array(
|
|
3208
|
+
...or.shape,
|
|
3209
|
+
domains: i.array(pr),
|
|
3210
|
+
tenant: lr,
|
|
3211
|
+
connections: i.array(Rn)
|
|
3187
3212
|
});
|
|
3188
|
-
const
|
|
3213
|
+
const hr = i.enum([
|
|
3189
3214
|
"password_reset",
|
|
3190
3215
|
"email_verification",
|
|
3191
3216
|
"otp",
|
|
3192
3217
|
"authorization_code",
|
|
3193
3218
|
"oauth2_state",
|
|
3194
3219
|
"ticket"
|
|
3195
|
-
]),
|
|
3220
|
+
]), fr = i.object({
|
|
3196
3221
|
code_id: i.string().openapi({
|
|
3197
3222
|
description: "The code that will be used in for instance an email verification flow"
|
|
3198
3223
|
}),
|
|
@@ -3202,14 +3227,14 @@ const pr = i.enum([
|
|
|
3202
3227
|
connection_id: i.string().optional().openapi({
|
|
3203
3228
|
description: "The connection that the code is connected to"
|
|
3204
3229
|
}),
|
|
3205
|
-
code_type:
|
|
3230
|
+
code_type: hr,
|
|
3206
3231
|
expires_at: i.string(),
|
|
3207
3232
|
used_at: i.string().optional(),
|
|
3208
3233
|
user_id: i.string().optional()
|
|
3209
|
-
}), fr = i.object({
|
|
3210
|
-
...hr.shape,
|
|
3211
|
-
created_at: i.string()
|
|
3212
3234
|
}), mr = i.object({
|
|
3235
|
+
...fr.shape,
|
|
3236
|
+
created_at: i.string()
|
|
3237
|
+
}), _r = i.object({
|
|
3213
3238
|
domain: i.string(),
|
|
3214
3239
|
dkim_private_key: i.string().optional(),
|
|
3215
3240
|
dkim_public_key: i.string().optional(),
|
|
@@ -3217,10 +3242,10 @@ const pr = i.enum([
|
|
|
3217
3242
|
email_service: i.enum(["mailgun", "mailchannels"])
|
|
3218
3243
|
});
|
|
3219
3244
|
dn.extend({
|
|
3220
|
-
...
|
|
3245
|
+
..._r.shape,
|
|
3221
3246
|
id: i.string()
|
|
3222
3247
|
});
|
|
3223
|
-
const
|
|
3248
|
+
const gr = i.object({
|
|
3224
3249
|
trigger_id: i.enum([
|
|
3225
3250
|
"pre-user-signup",
|
|
3226
3251
|
"post-user-registration",
|
|
@@ -3232,11 +3257,11 @@ const _r = i.object({
|
|
|
3232
3257
|
synchronous: i.boolean().default(!1),
|
|
3233
3258
|
priority: i.number().optional()
|
|
3234
3259
|
});
|
|
3235
|
-
|
|
3260
|
+
gr.extend({
|
|
3236
3261
|
...dn.shape,
|
|
3237
3262
|
hook_id: i.string()
|
|
3238
3263
|
});
|
|
3239
|
-
const
|
|
3264
|
+
const yr = i.object({
|
|
3240
3265
|
alg: i.enum([
|
|
3241
3266
|
"RS256",
|
|
3242
3267
|
"RS384",
|
|
@@ -3257,7 +3282,7 @@ const gr = i.object({
|
|
|
3257
3282
|
use: i.enum(["sig", "enc"]).optional()
|
|
3258
3283
|
});
|
|
3259
3284
|
i.object({
|
|
3260
|
-
keys: i.array(
|
|
3285
|
+
keys: i.array(yr)
|
|
3261
3286
|
});
|
|
3262
3287
|
i.object({
|
|
3263
3288
|
issuer: i.string(),
|
|
@@ -3281,22 +3306,22 @@ i.object({
|
|
|
3281
3306
|
request_parameter_supported: i.boolean(),
|
|
3282
3307
|
token_endpoint_auth_signing_alg_values_supported: i.array(i.string())
|
|
3283
3308
|
});
|
|
3284
|
-
const
|
|
3309
|
+
const vr = i.object({
|
|
3285
3310
|
auth0Client: i.string().optional(),
|
|
3286
|
-
authParams:
|
|
3311
|
+
authParams: cr,
|
|
3287
3312
|
expires_at: i.string(),
|
|
3288
3313
|
deleted_at: i.string().optional(),
|
|
3289
3314
|
ip: i.string().optional()
|
|
3290
3315
|
}).openapi({
|
|
3291
3316
|
description: "This represents a login sesion"
|
|
3292
|
-
}),
|
|
3293
|
-
...
|
|
3317
|
+
}), wr = i.object({
|
|
3318
|
+
...vr.shape,
|
|
3294
3319
|
login_id: i.string().openapi({
|
|
3295
3320
|
description: "This is is used as the state in the universal login"
|
|
3296
3321
|
}),
|
|
3297
3322
|
created_at: i.string(),
|
|
3298
3323
|
updated_at: i.string()
|
|
3299
|
-
}),
|
|
3324
|
+
}), br = i.enum([
|
|
3300
3325
|
"cls",
|
|
3301
3326
|
// CODE_LINK_SENT
|
|
3302
3327
|
"fsa",
|
|
@@ -3353,7 +3378,7 @@ const yr = i.object({
|
|
|
3353
3378
|
}).optional()
|
|
3354
3379
|
});
|
|
3355
3380
|
i.object({
|
|
3356
|
-
type:
|
|
3381
|
+
type: br,
|
|
3357
3382
|
date: i.string(),
|
|
3358
3383
|
description: i.string().optional(),
|
|
3359
3384
|
log_id: i.string().optional(),
|
|
@@ -3376,17 +3401,17 @@ i.object({
|
|
|
3376
3401
|
hostname: i.string().optional(),
|
|
3377
3402
|
auth0_client: kr.optional()
|
|
3378
3403
|
});
|
|
3379
|
-
const
|
|
3404
|
+
const xr = i.object({
|
|
3380
3405
|
user_id: i.string(),
|
|
3381
3406
|
password: i.string(),
|
|
3382
3407
|
algorithm: i.enum(["bcrypt", "argon2id"]).default("argon2id")
|
|
3383
3408
|
});
|
|
3384
3409
|
i.object({
|
|
3385
|
-
...
|
|
3410
|
+
...xr.shape,
|
|
3386
3411
|
created_at: i.string(),
|
|
3387
3412
|
updated_at: i.string()
|
|
3388
3413
|
});
|
|
3389
|
-
const
|
|
3414
|
+
const Tr = i.object({
|
|
3390
3415
|
session_id: i.string(),
|
|
3391
3416
|
client_id: i.string(),
|
|
3392
3417
|
expires_at: i.string(),
|
|
@@ -3396,7 +3421,7 @@ const xr = i.object({
|
|
|
3396
3421
|
});
|
|
3397
3422
|
i.object({
|
|
3398
3423
|
created_at: i.string(),
|
|
3399
|
-
...
|
|
3424
|
+
...Tr.shape
|
|
3400
3425
|
});
|
|
3401
3426
|
i.object({
|
|
3402
3427
|
kid: i.string().openapi({ description: "The key id of the signing key" }),
|
|
@@ -3418,8 +3443,8 @@ i.object({
|
|
|
3418
3443
|
revoked: i.boolean().optional().openapi({ description: "True if the key is revoked" }),
|
|
3419
3444
|
revoked_at: i.string().optional().openapi({ description: "The date and time when the key was revoked" })
|
|
3420
3445
|
});
|
|
3421
|
-
var
|
|
3422
|
-
const un = i.nativeEnum(
|
|
3446
|
+
var $n = /* @__PURE__ */ ((n) => (n.RefreshToken = "refresh_token", n.AuthorizationCode = "authorization_code", n.ClientCredential = "client_credentials", n.Passwordless = "passwordless", n.Password = "password", n))($n || {});
|
|
3447
|
+
const un = i.nativeEnum($n);
|
|
3423
3448
|
i.object({
|
|
3424
3449
|
grant_type: un.refine(
|
|
3425
3450
|
(n) => n === "authorization_code"
|
|
@@ -3462,7 +3487,7 @@ i.object({
|
|
|
3462
3487
|
code: i.string(),
|
|
3463
3488
|
state: i.string().optional()
|
|
3464
3489
|
});
|
|
3465
|
-
const
|
|
3490
|
+
const Or = i.object({
|
|
3466
3491
|
button_border_radius: i.number(),
|
|
3467
3492
|
button_border_weight: i.number(),
|
|
3468
3493
|
buttons_style: i.enum(["pill"]),
|
|
@@ -3472,7 +3497,7 @@ const Tr = i.object({
|
|
|
3472
3497
|
show_widget_shadow: i.boolean(),
|
|
3473
3498
|
widget_border_weight: i.number(),
|
|
3474
3499
|
widget_corner_radius: i.number()
|
|
3475
|
-
}),
|
|
3500
|
+
}), Sr = i.object({
|
|
3476
3501
|
base_focus_color: i.string(),
|
|
3477
3502
|
base_hover_color: i.string(),
|
|
3478
3503
|
body_text: i.string(),
|
|
@@ -3492,47 +3517,53 @@ const Tr = i.object({
|
|
|
3492
3517
|
success: i.string(),
|
|
3493
3518
|
widget_background: i.string(),
|
|
3494
3519
|
widget_border: i.string()
|
|
3495
|
-
}),
|
|
3520
|
+
}), Me = i.object({
|
|
3496
3521
|
bold: i.boolean(),
|
|
3497
3522
|
size: i.number()
|
|
3498
|
-
}),
|
|
3499
|
-
body_text:
|
|
3500
|
-
buttons_text:
|
|
3523
|
+
}), Zr = i.object({
|
|
3524
|
+
body_text: Me,
|
|
3525
|
+
buttons_text: Me,
|
|
3501
3526
|
font_url: i.string(),
|
|
3502
|
-
input_labels:
|
|
3503
|
-
links:
|
|
3527
|
+
input_labels: Me,
|
|
3528
|
+
links: Me,
|
|
3504
3529
|
links_style: i.enum(["normal"]),
|
|
3505
3530
|
reference_text_size: i.number(),
|
|
3506
|
-
subtitle:
|
|
3507
|
-
title:
|
|
3508
|
-
}),
|
|
3531
|
+
subtitle: Me,
|
|
3532
|
+
title: Me
|
|
3533
|
+
}), jr = i.object({
|
|
3509
3534
|
background_color: i.string(),
|
|
3510
3535
|
background_image_url: i.string(),
|
|
3511
3536
|
page_layout: i.enum(["center"])
|
|
3512
|
-
}),
|
|
3537
|
+
}), Nr = i.object({
|
|
3513
3538
|
header_text_alignment: i.enum(["center"]),
|
|
3514
3539
|
logo_height: i.number(),
|
|
3515
3540
|
logo_position: i.enum(["center"]),
|
|
3516
3541
|
logo_url: i.string(),
|
|
3517
3542
|
social_buttons_layout: i.enum(["bottom"])
|
|
3518
|
-
}),
|
|
3519
|
-
borders:
|
|
3520
|
-
colors:
|
|
3543
|
+
}), Cr = i.object({
|
|
3544
|
+
borders: Or,
|
|
3545
|
+
colors: Sr,
|
|
3521
3546
|
displayName: i.string(),
|
|
3522
|
-
fonts:
|
|
3523
|
-
page_background:
|
|
3524
|
-
widget:
|
|
3547
|
+
fonts: Zr,
|
|
3548
|
+
page_background: jr,
|
|
3549
|
+
widget: Nr
|
|
3525
3550
|
});
|
|
3526
|
-
|
|
3551
|
+
Cr.extend({
|
|
3527
3552
|
themeId: i.string()
|
|
3528
3553
|
});
|
|
3554
|
+
i.object({
|
|
3555
|
+
universal_login_experience: i.enum(["new", "classic"]).default("new"),
|
|
3556
|
+
identifier_first: i.boolean().default(!0),
|
|
3557
|
+
password_first: i.boolean().default(!1),
|
|
3558
|
+
webauthn_platform_first_factor: i.boolean()
|
|
3559
|
+
});
|
|
3529
3560
|
function ln(n) {
|
|
3530
3561
|
const [e, t] = n.split("|");
|
|
3531
3562
|
if (!e || !t)
|
|
3532
3563
|
throw new Error(`Invalid user_id: ${n}`);
|
|
3533
3564
|
return { connection: e, id: t };
|
|
3534
3565
|
}
|
|
3535
|
-
function
|
|
3566
|
+
function Pn(n) {
|
|
3536
3567
|
let e = {};
|
|
3537
3568
|
try {
|
|
3538
3569
|
e = JSON.parse(n.profileData || "{}");
|
|
@@ -3551,7 +3582,7 @@ function $n(n) {
|
|
|
3551
3582
|
}
|
|
3552
3583
|
};
|
|
3553
3584
|
}
|
|
3554
|
-
function
|
|
3585
|
+
function Ir(n) {
|
|
3555
3586
|
return async (e, t) => {
|
|
3556
3587
|
const [s, r] = await Promise.all([
|
|
3557
3588
|
n.selectFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", t).selectAll().executeTakeFirst(),
|
|
@@ -3571,7 +3602,7 @@ function Cr(n) {
|
|
|
3571
3602
|
user_id: ln(s.user_id).id,
|
|
3572
3603
|
isSocial: !!s.is_social
|
|
3573
3604
|
},
|
|
3574
|
-
...r.map(
|
|
3605
|
+
...r.map(Pn)
|
|
3575
3606
|
]
|
|
3576
3607
|
};
|
|
3577
3608
|
return R(c);
|
|
@@ -3614,10 +3645,10 @@ function Ee(n, e, t, s) {
|
|
|
3614
3645
|
}
|
|
3615
3646
|
}), e;
|
|
3616
3647
|
}
|
|
3617
|
-
function
|
|
3648
|
+
function ke(n) {
|
|
3618
3649
|
return typeof n == "string" ? parseInt(n, 10) : typeof n == "bigint" ? Number(n) : n;
|
|
3619
3650
|
}
|
|
3620
|
-
function
|
|
3651
|
+
function Er(n) {
|
|
3621
3652
|
return async (e, t) => {
|
|
3622
3653
|
let s = n.selectFrom("users").where("users.tenant_id", "=", e);
|
|
3623
3654
|
if (t.q && (s = Ee(n, s, t.q, ["email", "name"])), t.sort && t.sort.sort_by) {
|
|
@@ -3639,7 +3670,7 @@ function Ir(n) {
|
|
|
3639
3670
|
user_id: ln(l.user_id).id,
|
|
3640
3671
|
isSocial: !!l.is_social
|
|
3641
3672
|
},
|
|
3642
|
-
...j.map(
|
|
3673
|
+
...j.map(Pn)
|
|
3643
3674
|
]
|
|
3644
3675
|
});
|
|
3645
3676
|
}), { count: u } = await s.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
@@ -3647,52 +3678,52 @@ function Ir(n) {
|
|
|
3647
3678
|
users: d,
|
|
3648
3679
|
start: t.page * t.per_page,
|
|
3649
3680
|
limit: t.per_page,
|
|
3650
|
-
length:
|
|
3681
|
+
length: ke(u)
|
|
3651
3682
|
};
|
|
3652
3683
|
};
|
|
3653
3684
|
}
|
|
3654
|
-
function
|
|
3685
|
+
function Ar(n) {
|
|
3655
3686
|
return async (e, t) => (await n.deleteFrom("users").where("users.tenant_id", "=", e).where("users.linked_to", "=", t).execute(), (await n.deleteFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", t).execute()).length === 1);
|
|
3656
3687
|
}
|
|
3657
|
-
function
|
|
3688
|
+
function Rr(n) {
|
|
3658
3689
|
if (n.email_verified !== void 0)
|
|
3659
3690
|
return n.email_verified ? 1 : 0;
|
|
3660
3691
|
}
|
|
3661
|
-
function
|
|
3692
|
+
function $r(n) {
|
|
3662
3693
|
return async (e, t, s) => {
|
|
3663
3694
|
const r = {
|
|
3664
3695
|
...s,
|
|
3665
|
-
email_verified:
|
|
3696
|
+
email_verified: Rr(s),
|
|
3666
3697
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3667
3698
|
};
|
|
3668
3699
|
return (await n.updateTable("users").set(r).where("users.tenant_id", "=", e).where("users.user_id", "=", t).execute()).length === 1;
|
|
3669
3700
|
};
|
|
3670
3701
|
}
|
|
3671
|
-
function
|
|
3702
|
+
function Pr(n) {
|
|
3672
3703
|
return async (e, t, s, r) => {
|
|
3673
3704
|
const a = { linked_to: null };
|
|
3674
3705
|
return (await n.updateTable("users").set(a).where("users.tenant_id", "=", e).where("users.user_id", "=", `${s}|${r}`).where("users.linked_to", "=", `${t}`).execute()).length === 1;
|
|
3675
3706
|
};
|
|
3676
3707
|
}
|
|
3677
|
-
function
|
|
3708
|
+
function Dr(n) {
|
|
3678
3709
|
return {
|
|
3679
|
-
create:
|
|
3680
|
-
remove:
|
|
3681
|
-
get:
|
|
3682
|
-
list:
|
|
3683
|
-
update:
|
|
3710
|
+
create: Qn(n),
|
|
3711
|
+
remove: Ar(n),
|
|
3712
|
+
get: Ir(n),
|
|
3713
|
+
list: Er(n),
|
|
3714
|
+
update: $r(n),
|
|
3684
3715
|
// TODO - think about this more when other issues fixed
|
|
3685
|
-
unlink:
|
|
3716
|
+
unlink: Pr(n)
|
|
3686
3717
|
};
|
|
3687
3718
|
}
|
|
3688
|
-
const
|
|
3719
|
+
const Mr = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
3689
3720
|
let Ae = (n = 21) => {
|
|
3690
3721
|
let e = "", t = crypto.getRandomValues(new Uint8Array(n));
|
|
3691
3722
|
for (; n--; )
|
|
3692
|
-
e +=
|
|
3723
|
+
e += Mr[t[n] & 63];
|
|
3693
3724
|
return e;
|
|
3694
3725
|
};
|
|
3695
|
-
function
|
|
3726
|
+
function Lr(n) {
|
|
3696
3727
|
return async (e) => {
|
|
3697
3728
|
const t = {
|
|
3698
3729
|
id: e.id || Ae(),
|
|
@@ -3703,13 +3734,13 @@ function Mr(n) {
|
|
|
3703
3734
|
return await n.insertInto("tenants").values(t).execute(), t;
|
|
3704
3735
|
};
|
|
3705
3736
|
}
|
|
3706
|
-
function
|
|
3737
|
+
function Vr(n) {
|
|
3707
3738
|
return async (e) => {
|
|
3708
3739
|
const t = await n.selectFrom("tenants").where("tenants.id", "=", e).selectAll().executeTakeFirst();
|
|
3709
3740
|
return t ? R(t) : null;
|
|
3710
3741
|
};
|
|
3711
3742
|
}
|
|
3712
|
-
function
|
|
3743
|
+
function Ur(n) {
|
|
3713
3744
|
return async (e) => {
|
|
3714
3745
|
let t = n.selectFrom("tenants");
|
|
3715
3746
|
if (e.sort && e.sort.sort_by) {
|
|
@@ -3722,7 +3753,7 @@ function Vr(n) {
|
|
|
3722
3753
|
return {
|
|
3723
3754
|
tenants: r
|
|
3724
3755
|
};
|
|
3725
|
-
const { count: a } = await t.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), o =
|
|
3756
|
+
const { count: a } = await t.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), o = ke(a);
|
|
3726
3757
|
return {
|
|
3727
3758
|
tenants: r.map(R),
|
|
3728
3759
|
start: (e.page - 1) * e.per_page,
|
|
@@ -3731,7 +3762,7 @@ function Vr(n) {
|
|
|
3731
3762
|
};
|
|
3732
3763
|
};
|
|
3733
3764
|
}
|
|
3734
|
-
function
|
|
3765
|
+
function Fr(n) {
|
|
3735
3766
|
return async (e, t) => {
|
|
3736
3767
|
const s = {
|
|
3737
3768
|
...t,
|
|
@@ -3741,29 +3772,29 @@ function Ur(n) {
|
|
|
3741
3772
|
await n.updateTable("tenants").set(s).where("id", "=", e).execute();
|
|
3742
3773
|
};
|
|
3743
3774
|
}
|
|
3744
|
-
function
|
|
3775
|
+
function zr(n) {
|
|
3745
3776
|
return async (e) => (await n.deleteFrom("tenants").where("tenants.id", "=", e).execute()).length === 1;
|
|
3746
3777
|
}
|
|
3747
|
-
function
|
|
3778
|
+
function Br(n) {
|
|
3748
3779
|
return {
|
|
3749
|
-
create:
|
|
3750
|
-
get:
|
|
3751
|
-
list:
|
|
3752
|
-
update:
|
|
3753
|
-
remove:
|
|
3780
|
+
create: Lr(n),
|
|
3781
|
+
get: Vr(n),
|
|
3782
|
+
list: Ur(n),
|
|
3783
|
+
update: Fr(n),
|
|
3784
|
+
remove: zr(n)
|
|
3754
3785
|
};
|
|
3755
3786
|
}
|
|
3756
|
-
function
|
|
3787
|
+
function _n(n) {
|
|
3757
3788
|
return n ? JSON.stringify(n) : void 0;
|
|
3758
3789
|
}
|
|
3759
|
-
const
|
|
3760
|
-
function
|
|
3790
|
+
const Wr = 1024;
|
|
3791
|
+
function qr(n) {
|
|
3761
3792
|
return async (e, t) => {
|
|
3762
3793
|
var r, a, o;
|
|
3763
3794
|
const s = {
|
|
3764
3795
|
id: Ae(),
|
|
3765
3796
|
...t,
|
|
3766
|
-
user_agent: t.user_agent.slice(0,
|
|
3797
|
+
user_agent: t.user_agent.slice(0, Wr)
|
|
3767
3798
|
};
|
|
3768
3799
|
return await n.insertInto("logs").values({
|
|
3769
3800
|
...s,
|
|
@@ -3772,12 +3803,12 @@ function Wr(n) {
|
|
|
3772
3803
|
isMobile: t.isMobile ? 1 : 0,
|
|
3773
3804
|
tenant_id: e,
|
|
3774
3805
|
scope: (a = t.scope) == null ? void 0 : a.join(","),
|
|
3775
|
-
auth0_client:
|
|
3776
|
-
details: (o =
|
|
3806
|
+
auth0_client: _n(t.auth0_client),
|
|
3807
|
+
details: (o = _n(t.details)) == null ? void 0 : o.substring(0, 8192)
|
|
3777
3808
|
}).execute(), s;
|
|
3778
3809
|
};
|
|
3779
3810
|
}
|
|
3780
|
-
function
|
|
3811
|
+
function gn(n) {
|
|
3781
3812
|
if (!n)
|
|
3782
3813
|
return "";
|
|
3783
3814
|
try {
|
|
@@ -3786,20 +3817,20 @@ function _n(n) {
|
|
|
3786
3817
|
return n;
|
|
3787
3818
|
}
|
|
3788
3819
|
}
|
|
3789
|
-
function
|
|
3820
|
+
function Dn(n) {
|
|
3790
3821
|
return {
|
|
3791
3822
|
...n,
|
|
3792
3823
|
client_id: n.client_id,
|
|
3793
3824
|
client_name: "",
|
|
3794
|
-
auth0_client:
|
|
3795
|
-
details:
|
|
3825
|
+
auth0_client: gn(n.auth0_client),
|
|
3826
|
+
details: gn(n.details),
|
|
3796
3827
|
isMobile: !!n.isMobile,
|
|
3797
3828
|
scope: n.scope ? n.scope.split(",") : void 0,
|
|
3798
3829
|
log_id: n.id,
|
|
3799
3830
|
_id: n.id
|
|
3800
3831
|
};
|
|
3801
3832
|
}
|
|
3802
|
-
function
|
|
3833
|
+
function Jr(n) {
|
|
3803
3834
|
return async (e, t) => {
|
|
3804
3835
|
let s = n.selectFrom("logs").where("logs.tenant_id", "=", e);
|
|
3805
3836
|
t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
|
|
@@ -3814,30 +3845,30 @@ function qr(n) {
|
|
|
3814
3845
|
r = r.offset(t.page * t.per_page).limit(t.per_page);
|
|
3815
3846
|
const a = await r.selectAll().execute(), { count: o } = await s.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
3816
3847
|
return {
|
|
3817
|
-
logs: a.map(
|
|
3848
|
+
logs: a.map(Dn),
|
|
3818
3849
|
start: t.page * t.per_page,
|
|
3819
3850
|
limit: t.per_page,
|
|
3820
|
-
length:
|
|
3851
|
+
length: ke(o)
|
|
3821
3852
|
};
|
|
3822
3853
|
};
|
|
3823
3854
|
}
|
|
3824
|
-
function
|
|
3855
|
+
function Kr(n) {
|
|
3825
3856
|
return async (e, t) => {
|
|
3826
3857
|
const s = await n.selectFrom("logs").where("logs.tenant_id", "=", e).where("logs.id", "=", t).selectAll().executeTakeFirst();
|
|
3827
|
-
return s ?
|
|
3858
|
+
return s ? Dn(s) : null;
|
|
3828
3859
|
};
|
|
3829
3860
|
}
|
|
3830
|
-
function
|
|
3861
|
+
function Hr(n) {
|
|
3831
3862
|
return {
|
|
3832
|
-
create:
|
|
3833
|
-
list:
|
|
3834
|
-
get:
|
|
3863
|
+
create: qr(n),
|
|
3864
|
+
list: Jr(n),
|
|
3865
|
+
get: Kr(n)
|
|
3835
3866
|
};
|
|
3836
3867
|
}
|
|
3837
|
-
function
|
|
3868
|
+
function Qr(n) {
|
|
3838
3869
|
return async (e, t) => await n.selectFrom("sessions").where("sessions.tenant_id", "=", e).where("sessions.session_id", "=", t).where("sessions.deleted_at", "is", null).selectAll().executeTakeFirst() ?? null;
|
|
3839
3870
|
}
|
|
3840
|
-
function
|
|
3871
|
+
function Yr(n) {
|
|
3841
3872
|
return async (e, t) => {
|
|
3842
3873
|
const s = {
|
|
3843
3874
|
...t,
|
|
@@ -3847,13 +3878,13 @@ function Qr(n) {
|
|
|
3847
3878
|
return await n.insertInto("sessions").values({ ...s, tenant_id: e }).execute(), { ...t, ...s };
|
|
3848
3879
|
};
|
|
3849
3880
|
}
|
|
3850
|
-
function
|
|
3881
|
+
function Gr(n) {
|
|
3851
3882
|
return async (e, t) => !!(await n.updateTable("sessions").set({ deleted_at: (/* @__PURE__ */ new Date()).toISOString() }).where("tenant_id", "=", e).where("sessions.session_id", "=", t).where("sessions.deleted_at", "is", null).execute()).length;
|
|
3852
3883
|
}
|
|
3853
|
-
function
|
|
3884
|
+
function Xr(n) {
|
|
3854
3885
|
return async (e, t, s) => !!(await n.updateTable("sessions").set(s).where("tenant_id", "=", e).where("sessions.session_id", "=", t).where("sessions.deleted_at", "is", null).execute()).length;
|
|
3855
3886
|
}
|
|
3856
|
-
function
|
|
3887
|
+
function ea(n) {
|
|
3857
3888
|
return async (e, t) => {
|
|
3858
3889
|
let s = n.selectFrom("sessions").where("sessions.tenant_id", "=", e);
|
|
3859
3890
|
t.q && (s = Ee(n, s, t.q, ["user_id", "session_id"]));
|
|
@@ -3866,7 +3897,7 @@ function Xr(n) {
|
|
|
3866
3897
|
);
|
|
3867
3898
|
}
|
|
3868
3899
|
r = r.offset(t.page * t.per_page).limit(t.per_page);
|
|
3869
|
-
const a = await r.selectAll().execute(), { count: o } = await s.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), c =
|
|
3900
|
+
const a = await r.selectAll().execute(), { count: o } = await s.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), c = ke(o);
|
|
3870
3901
|
return {
|
|
3871
3902
|
sessions: a,
|
|
3872
3903
|
start: t.page * t.per_page,
|
|
@@ -3875,16 +3906,16 @@ function Xr(n) {
|
|
|
3875
3906
|
};
|
|
3876
3907
|
};
|
|
3877
3908
|
}
|
|
3878
|
-
function
|
|
3909
|
+
function ta(n) {
|
|
3879
3910
|
return {
|
|
3880
|
-
create:
|
|
3881
|
-
get:
|
|
3882
|
-
list:
|
|
3883
|
-
remove:
|
|
3884
|
-
update:
|
|
3911
|
+
create: Yr(n),
|
|
3912
|
+
get: Qr(n),
|
|
3913
|
+
list: ea(n),
|
|
3914
|
+
remove: Gr(n),
|
|
3915
|
+
update: Xr(n)
|
|
3885
3916
|
};
|
|
3886
3917
|
}
|
|
3887
|
-
function
|
|
3918
|
+
function na(n) {
|
|
3888
3919
|
return async (e, t) => {
|
|
3889
3920
|
const s = await n.selectFrom("tickets").where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).where("tickets.used_at", "is", null).selectAll().executeTakeFirst();
|
|
3890
3921
|
if (!s)
|
|
@@ -3914,7 +3945,7 @@ function ta(n) {
|
|
|
3914
3945
|
};
|
|
3915
3946
|
};
|
|
3916
3947
|
}
|
|
3917
|
-
function
|
|
3948
|
+
function sa(n) {
|
|
3918
3949
|
return async (e) => {
|
|
3919
3950
|
const { authParams: t, ...s } = e, r = {
|
|
3920
3951
|
...s,
|
|
@@ -3926,27 +3957,27 @@ function na(n) {
|
|
|
3926
3957
|
await n.insertInto("tickets").values(r).execute();
|
|
3927
3958
|
};
|
|
3928
3959
|
}
|
|
3929
|
-
function
|
|
3960
|
+
function ra(n) {
|
|
3930
3961
|
return async (e, t) => {
|
|
3931
3962
|
await n.updateTable("tickets").set({
|
|
3932
3963
|
used_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3933
3964
|
}).where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).execute();
|
|
3934
3965
|
};
|
|
3935
3966
|
}
|
|
3936
|
-
function
|
|
3967
|
+
function aa(n) {
|
|
3937
3968
|
return {
|
|
3938
|
-
create:
|
|
3939
|
-
get:
|
|
3940
|
-
remove:
|
|
3969
|
+
create: sa(n),
|
|
3970
|
+
get: na(n),
|
|
3971
|
+
remove: ra(n)
|
|
3941
3972
|
};
|
|
3942
3973
|
}
|
|
3943
|
-
function
|
|
3974
|
+
function ia(n) {
|
|
3944
3975
|
return async (e, t) => {
|
|
3945
3976
|
const s = await n.selectFrom("passwords").where("passwords.tenant_id", "=", e).where("passwords.user_id", "=", t).selectAll().executeTakeFirstOrThrow(), { tenant_id: r, ...a } = s;
|
|
3946
3977
|
return a;
|
|
3947
3978
|
};
|
|
3948
3979
|
}
|
|
3949
|
-
function
|
|
3980
|
+
function oa(n) {
|
|
3950
3981
|
return async (e, t) => {
|
|
3951
3982
|
const s = {
|
|
3952
3983
|
...t,
|
|
@@ -3959,20 +3990,20 @@ function ia(n) {
|
|
|
3959
3990
|
}).execute(), s;
|
|
3960
3991
|
};
|
|
3961
3992
|
}
|
|
3962
|
-
function
|
|
3993
|
+
function ca(n) {
|
|
3963
3994
|
return async (e, t) => (await n.updateTable("passwords").set({
|
|
3964
3995
|
password: t.password,
|
|
3965
3996
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3966
3997
|
}).where("tenant_id", "=", e).where("user_id", "=", t.user_id).execute()).length === 1;
|
|
3967
3998
|
}
|
|
3968
|
-
function
|
|
3999
|
+
function da(n) {
|
|
3969
4000
|
return {
|
|
3970
|
-
create:
|
|
3971
|
-
update:
|
|
3972
|
-
get:
|
|
4001
|
+
create: oa(n),
|
|
4002
|
+
update: ca(n),
|
|
4003
|
+
get: ia(n)
|
|
3973
4004
|
};
|
|
3974
4005
|
}
|
|
3975
|
-
function
|
|
4006
|
+
function ua(n) {
|
|
3976
4007
|
return async (e, t) => {
|
|
3977
4008
|
let s = n.selectFrom("codes").where("codes.tenant_id", "=", e);
|
|
3978
4009
|
t.q && (s = Ee(n, s, t.q, ["code", "login_id"]));
|
|
@@ -3980,15 +4011,15 @@ function da(n) {
|
|
|
3980
4011
|
return {
|
|
3981
4012
|
codes: a.map((d) => {
|
|
3982
4013
|
const { tenant_id: u, ...l } = d;
|
|
3983
|
-
return
|
|
4014
|
+
return mr.parse(R(l));
|
|
3984
4015
|
}),
|
|
3985
4016
|
start: t.page * t.per_page,
|
|
3986
4017
|
limit: t.per_page,
|
|
3987
|
-
length:
|
|
4018
|
+
length: ke(o)
|
|
3988
4019
|
};
|
|
3989
4020
|
};
|
|
3990
4021
|
}
|
|
3991
|
-
function
|
|
4022
|
+
function la(n) {
|
|
3992
4023
|
return async (e, t) => {
|
|
3993
4024
|
const s = {
|
|
3994
4025
|
...t,
|
|
@@ -4000,10 +4031,10 @@ function ua(n) {
|
|
|
4000
4031
|
}).execute(), s;
|
|
4001
4032
|
};
|
|
4002
4033
|
}
|
|
4003
|
-
function
|
|
4034
|
+
function pa(n) {
|
|
4004
4035
|
return async (e, t) => (await n.deleteFrom("codes").where("codes.tenant_id", "=", e).where("codes.code_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
4005
4036
|
}
|
|
4006
|
-
function
|
|
4037
|
+
function ha(n) {
|
|
4007
4038
|
return async (e, t, s) => {
|
|
4008
4039
|
let r = n.selectFrom("codes").where("codes.code_id", "=", t).where("codes.code_type", "=", s).where("codes.expires_at", ">", (/* @__PURE__ */ new Date()).toISOString());
|
|
4009
4040
|
e.length && (r = r.where("codes.tenant_id", "=", e));
|
|
@@ -4011,15 +4042,15 @@ function pa(n) {
|
|
|
4011
4042
|
return a ? R(a) : null;
|
|
4012
4043
|
};
|
|
4013
4044
|
}
|
|
4014
|
-
function
|
|
4045
|
+
function fa(n) {
|
|
4015
4046
|
return {
|
|
4016
|
-
create:
|
|
4017
|
-
list:
|
|
4018
|
-
remove:
|
|
4019
|
-
get:
|
|
4047
|
+
create: la(n),
|
|
4048
|
+
list: ua(n),
|
|
4049
|
+
remove: pa(n),
|
|
4050
|
+
get: ha(n)
|
|
4020
4051
|
};
|
|
4021
4052
|
}
|
|
4022
|
-
function
|
|
4053
|
+
function ma(n) {
|
|
4023
4054
|
return async (e, t) => {
|
|
4024
4055
|
const s = {
|
|
4025
4056
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -4038,7 +4069,7 @@ function fa(n) {
|
|
|
4038
4069
|
}).execute(), s;
|
|
4039
4070
|
};
|
|
4040
4071
|
}
|
|
4041
|
-
function
|
|
4072
|
+
function _a(n) {
|
|
4042
4073
|
return async (e) => ({
|
|
4043
4074
|
applications: (await n.selectFrom("applications").where("applications.tenant_id", "=", e).selectAll().execute()).map((a) => ({
|
|
4044
4075
|
...a,
|
|
@@ -4051,7 +4082,7 @@ function ma(n) {
|
|
|
4051
4082
|
}))
|
|
4052
4083
|
});
|
|
4053
4084
|
}
|
|
4054
|
-
function
|
|
4085
|
+
function ga(n) {
|
|
4055
4086
|
return async (e, t) => {
|
|
4056
4087
|
const s = await n.selectFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", t).selectAll().executeTakeFirst();
|
|
4057
4088
|
return s ? R({
|
|
@@ -4065,10 +4096,10 @@ function _a(n) {
|
|
|
4065
4096
|
}) : null;
|
|
4066
4097
|
};
|
|
4067
4098
|
}
|
|
4068
|
-
function
|
|
4099
|
+
function ya(n) {
|
|
4069
4100
|
return async (e, t) => (await n.deleteFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
4070
4101
|
}
|
|
4071
|
-
function
|
|
4102
|
+
function va(n) {
|
|
4072
4103
|
return async (e, t, s) => {
|
|
4073
4104
|
const r = {
|
|
4074
4105
|
...s,
|
|
@@ -4083,322 +4114,69 @@ function ya(n) {
|
|
|
4083
4114
|
return await n.updateTable("applications").set(r).where("applications.id", "=", t).where("applications.tenant_id", "=", e).execute(), !0;
|
|
4084
4115
|
};
|
|
4085
4116
|
}
|
|
4086
|
-
function
|
|
4117
|
+
function wa(n) {
|
|
4087
4118
|
return {
|
|
4088
|
-
create:
|
|
4089
|
-
list:
|
|
4090
|
-
get:
|
|
4091
|
-
remove:
|
|
4092
|
-
update:
|
|
4119
|
+
create: ma(n),
|
|
4120
|
+
list: _a(n),
|
|
4121
|
+
get: ga(n),
|
|
4122
|
+
remove: ya(n),
|
|
4123
|
+
update: va(n)
|
|
4093
4124
|
};
|
|
4094
4125
|
}
|
|
4095
|
-
function
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
};
|
|
4103
|
-
return await n.insertInto("connections").values({ ...s, tenant_id: e }).execute(), s;
|
|
4104
|
-
};
|
|
4126
|
+
function ba(n, e) {
|
|
4127
|
+
var t = {};
|
|
4128
|
+
for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && e.indexOf(s) < 0 && (t[s] = n[s]);
|
|
4129
|
+
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
4130
|
+
for (var r = 0, s = Object.getOwnPropertySymbols(n); r < s.length; r++)
|
|
4131
|
+
e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, s[r]) && (t[s[r]] = n[s[r]]);
|
|
4132
|
+
return t;
|
|
4105
4133
|
}
|
|
4106
|
-
function ka(n) {
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
|
|
4110
|
-
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();
|
|
4111
|
-
return {
|
|
4112
|
-
connections: a.map(R),
|
|
4113
|
-
start: t.page * t.per_page,
|
|
4114
|
-
limit: t.per_page,
|
|
4115
|
-
length: be(o)
|
|
4116
|
-
};
|
|
4117
|
-
};
|
|
4134
|
+
function ka(n, e) {
|
|
4135
|
+
var t;
|
|
4136
|
+
return ((t = n == null ? void 0 : n._def) === null || t === void 0 ? void 0 : t.typeName) === e;
|
|
4118
4137
|
}
|
|
4119
|
-
function
|
|
4120
|
-
|
|
4138
|
+
function Ye(n, e) {
|
|
4139
|
+
const t = n.ZodType.prototype[e];
|
|
4140
|
+
n.ZodType.prototype[e] = function(...s) {
|
|
4141
|
+
const r = t.apply(this, s);
|
|
4142
|
+
return r._def.openapi = this._def.openapi, r;
|
|
4143
|
+
};
|
|
4121
4144
|
}
|
|
4122
4145
|
function xa(n) {
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4146
|
+
if (typeof n.ZodType.prototype.openapi < "u")
|
|
4147
|
+
return;
|
|
4148
|
+
n.ZodType.prototype.openapi = function(r, a) {
|
|
4149
|
+
var o, c, d, u, l, j;
|
|
4150
|
+
const A = typeof r == "string" ? a : r, U = A ?? {}, { param: ie } = U, $e = ba(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), $e), !((u = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || u === void 0) && u.param || ie ? {
|
|
4151
|
+
param: Object.assign(Object.assign({}, (j = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || j === void 0 ? void 0 : j.param), ie)
|
|
4152
|
+
} : void 0), 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 (ka(this, "ZodObject")) {
|
|
4154
|
+
const Pe = this.extend;
|
|
4155
|
+
de.extend = function(...De) {
|
|
4156
|
+
var K, H, Q, ue, xe, Te;
|
|
4157
|
+
const Oe = Pe.apply(this, De);
|
|
4158
|
+
return Oe._def.openapi = {
|
|
4159
|
+
_internal: {
|
|
4160
|
+
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
|
|
4161
|
+
},
|
|
4162
|
+
metadata: (Te = Oe._def.openapi) === null || Te === void 0 ? void 0 : Te.metadata
|
|
4163
|
+
}, Oe;
|
|
4164
|
+
};
|
|
4165
|
+
}
|
|
4166
|
+
return de;
|
|
4167
|
+
}, Ye(n, "optional"), Ye(n, "nullable"), Ye(n, "default"), Ye(n, "transform"), Ye(n, "refine");
|
|
4168
|
+
const e = n.ZodObject.prototype.deepPartial;
|
|
4169
|
+
n.ZodObject.prototype.deepPartial = function() {
|
|
4170
|
+
const r = this._def.shape(), a = e.apply(this), o = a._def.shape();
|
|
4171
|
+
return Object.entries(o).forEach(([c, d]) => {
|
|
4172
|
+
var u, l;
|
|
4173
|
+
d._def.openapi = (l = (u = r[c]) === null || u === void 0 ? void 0 : u._def) === null || l === void 0 ? void 0 : l.openapi;
|
|
4174
|
+
}), a._def.openapi = void 0, a;
|
|
4126
4175
|
};
|
|
4127
|
-
|
|
4128
|
-
function
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
...s,
|
|
4132
|
-
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
4133
|
-
};
|
|
4134
|
-
return await n.updateTable("connections").set(r).where("connections.id", "=", t).where("connections.tenant_id", "=", e).execute(), !0;
|
|
4135
|
-
};
|
|
4136
|
-
}
|
|
4137
|
-
function Oa(n) {
|
|
4138
|
-
return {
|
|
4139
|
-
create: wa(n),
|
|
4140
|
-
get: xa(n),
|
|
4141
|
-
list: ka(n),
|
|
4142
|
-
remove: ba(n),
|
|
4143
|
-
update: Ta(n)
|
|
4144
|
-
};
|
|
4145
|
-
}
|
|
4146
|
-
function Sa(n) {
|
|
4147
|
-
return {
|
|
4148
|
-
get: async (e) => {
|
|
4149
|
-
const t = await n.selectFrom("applications").selectAll().where("id", "=", e).executeTakeFirst();
|
|
4150
|
-
if (!t)
|
|
4151
|
-
return null;
|
|
4152
|
-
const s = await n.selectFrom("tenants").selectAll().where("id", "=", t.tenant_id).executeTakeFirst();
|
|
4153
|
-
if (!s)
|
|
4154
|
-
throw new Gt(404, { message: "Tenant not found" });
|
|
4155
|
-
const r = await n.selectFrom("connections").where("tenant_id", "=", t.tenant_id).selectAll().execute(), a = await n.selectFrom("domains").where("tenant_id", "=", t.tenant_id).selectAll().execute();
|
|
4156
|
-
return {
|
|
4157
|
-
...t,
|
|
4158
|
-
connections: r.map(
|
|
4159
|
-
(c) => An.parse(R(c))
|
|
4160
|
-
),
|
|
4161
|
-
domains: a,
|
|
4162
|
-
addons: t.addons ? JSON.parse(t.addons) : {},
|
|
4163
|
-
callbacks: t.callbacks ? JSON.parse(t.callbacks) : [],
|
|
4164
|
-
allowed_origins: t.allowed_origins ? JSON.parse(t.allowed_origins) : [],
|
|
4165
|
-
web_origins: t.web_origins ? JSON.parse(t.web_origins) : [],
|
|
4166
|
-
allowed_logout_urls: t.allowed_logout_urls ? JSON.parse(t.allowed_logout_urls) : [],
|
|
4167
|
-
tenant: R(s),
|
|
4168
|
-
// this is really an integer in the database
|
|
4169
|
-
disable_sign_ups: !!t.disable_sign_ups
|
|
4170
|
-
};
|
|
4171
|
-
}
|
|
4172
|
-
};
|
|
4173
|
-
}
|
|
4174
|
-
function Za(n) {
|
|
4175
|
-
return async () => await n.selectFrom("keys").where("revoked_at", "is", null).selectAll().execute();
|
|
4176
|
-
}
|
|
4177
|
-
function ja(n) {
|
|
4178
|
-
return async (e) => {
|
|
4179
|
-
await n.insertInto("keys").values({ ...e, created_at: (/* @__PURE__ */ new Date()).toDateString() }).execute();
|
|
4180
|
-
};
|
|
4181
|
-
}
|
|
4182
|
-
function Na(n) {
|
|
4183
|
-
return async (e, t) => !!(await n.updateTable("keys").set(t).where("kid", "=", e).execute()).length;
|
|
4184
|
-
}
|
|
4185
|
-
function Ca(n) {
|
|
4186
|
-
return {
|
|
4187
|
-
create: ja(n),
|
|
4188
|
-
list: Za(n),
|
|
4189
|
-
update: Na(n)
|
|
4190
|
-
};
|
|
4191
|
-
}
|
|
4192
|
-
function Ia(n) {
|
|
4193
|
-
return async (e, t) => {
|
|
4194
|
-
const s = {
|
|
4195
|
-
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4196
|
-
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4197
|
-
tenant_id: e,
|
|
4198
|
-
id: Ae(),
|
|
4199
|
-
...t
|
|
4200
|
-
};
|
|
4201
|
-
return await n.insertInto("domains").values(s).execute(), s;
|
|
4202
|
-
};
|
|
4203
|
-
}
|
|
4204
|
-
function Ea(n) {
|
|
4205
|
-
return async (e, t) => {
|
|
4206
|
-
let s = n.selectFrom("domains").where("domains.tenant_id", "=", e);
|
|
4207
|
-
t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
|
|
4208
|
-
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();
|
|
4209
|
-
return {
|
|
4210
|
-
domains: a,
|
|
4211
|
-
start: t.page * t.per_page,
|
|
4212
|
-
limit: t.per_page,
|
|
4213
|
-
length: be(o)
|
|
4214
|
-
};
|
|
4215
|
-
};
|
|
4216
|
-
}
|
|
4217
|
-
function Aa(n) {
|
|
4218
|
-
return {
|
|
4219
|
-
create: Ia(n),
|
|
4220
|
-
list: Ea(n)
|
|
4221
|
-
};
|
|
4222
|
-
}
|
|
4223
|
-
function Ra(n) {
|
|
4224
|
-
return async (e) => {
|
|
4225
|
-
const [t] = await n.selectFrom("branding").where("branding.tenant_id", "=", e).selectAll().execute();
|
|
4226
|
-
if (!t)
|
|
4227
|
-
return null;
|
|
4228
|
-
const {
|
|
4229
|
-
tenant_id: s,
|
|
4230
|
-
colors_primary: r,
|
|
4231
|
-
colors_page_background_type: a,
|
|
4232
|
-
colors_page_background_start: o,
|
|
4233
|
-
colors_page_background_end: c,
|
|
4234
|
-
colors_page_background_angle_dev: d,
|
|
4235
|
-
font_url: u,
|
|
4236
|
-
...l
|
|
4237
|
-
} = t;
|
|
4238
|
-
return R({
|
|
4239
|
-
...l,
|
|
4240
|
-
colors: {
|
|
4241
|
-
primary: r,
|
|
4242
|
-
page_background: {
|
|
4243
|
-
type: a,
|
|
4244
|
-
start: o,
|
|
4245
|
-
end: c,
|
|
4246
|
-
angle_deg: d
|
|
4247
|
-
}
|
|
4248
|
-
},
|
|
4249
|
-
font: u ? { url: u } : void 0
|
|
4250
|
-
});
|
|
4251
|
-
};
|
|
4252
|
-
}
|
|
4253
|
-
function $a(n) {
|
|
4254
|
-
return async (e, t) => {
|
|
4255
|
-
var o, c, d, u, l, j, A, U, ie, Re, oe, ce, de, $e, Pe, K, H, Q;
|
|
4256
|
-
const { colors: s, font: r, ...a } = t;
|
|
4257
|
-
try {
|
|
4258
|
-
await n.insertInto("branding").values({
|
|
4259
|
-
...a,
|
|
4260
|
-
colors_primary: s == null ? void 0 : s.primary,
|
|
4261
|
-
colors_page_background_type: (c = (o = t.colors) == null ? void 0 : o.page_background) == null ? void 0 : c.type,
|
|
4262
|
-
colors_page_background_start: (u = (d = t.colors) == null ? void 0 : d.page_background) == null ? void 0 : u.start,
|
|
4263
|
-
colors_page_background_end: (j = (l = t.colors) == null ? void 0 : l.page_background) == null ? void 0 : j.end,
|
|
4264
|
-
colors_page_background_angle_dev: (U = (A = t.colors) == null ? void 0 : A.page_background) == null ? void 0 : U.angle_deg,
|
|
4265
|
-
font_url: (ie = t.font) == null ? void 0 : ie.url,
|
|
4266
|
-
tenant_id: e
|
|
4267
|
-
}).execute();
|
|
4268
|
-
} catch {
|
|
4269
|
-
await n.updateTable("branding").set({
|
|
4270
|
-
...a,
|
|
4271
|
-
colors_primary: s == null ? void 0 : s.primary,
|
|
4272
|
-
colors_page_background_type: (oe = (Re = t.colors) == null ? void 0 : Re.page_background) == null ? void 0 : oe.type,
|
|
4273
|
-
colors_page_background_start: (de = (ce = t.colors) == null ? void 0 : ce.page_background) == null ? void 0 : de.start,
|
|
4274
|
-
colors_page_background_end: (Pe = ($e = t.colors) == null ? void 0 : $e.page_background) == null ? void 0 : Pe.end,
|
|
4275
|
-
colors_page_background_angle_dev: (H = (K = t.colors) == null ? void 0 : K.page_background) == null ? void 0 : H.angle_deg,
|
|
4276
|
-
font_url: (Q = t.font) == null ? void 0 : Q.url
|
|
4277
|
-
}).where("tenant_id", "=", e).execute();
|
|
4278
|
-
}
|
|
4279
|
-
};
|
|
4280
|
-
}
|
|
4281
|
-
function Pa(n) {
|
|
4282
|
-
return {
|
|
4283
|
-
get: Ra(n),
|
|
4284
|
-
set: $a(n)
|
|
4285
|
-
};
|
|
4286
|
-
}
|
|
4287
|
-
function Da(n) {
|
|
4288
|
-
return async (e, t) => {
|
|
4289
|
-
let s = n.selectFrom("hooks").where("hooks.tenant_id", "=", e);
|
|
4290
|
-
t.q && (s = Ee(n, s, t.q, ["url"]));
|
|
4291
|
-
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
4292
|
-
return {
|
|
4293
|
-
hooks: a.map((d) => {
|
|
4294
|
-
const { tenant_id: u, enabled: l, synchronous: j, ...A } = d;
|
|
4295
|
-
return R({
|
|
4296
|
-
...A,
|
|
4297
|
-
enabled: !!l,
|
|
4298
|
-
synchronous: !!j
|
|
4299
|
-
});
|
|
4300
|
-
}),
|
|
4301
|
-
start: t.page * t.per_page,
|
|
4302
|
-
limit: t.per_page,
|
|
4303
|
-
length: be(o)
|
|
4304
|
-
};
|
|
4305
|
-
};
|
|
4306
|
-
}
|
|
4307
|
-
function Ma(n) {
|
|
4308
|
-
return async (e, t) => {
|
|
4309
|
-
const s = await n.selectFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).selectAll().executeTakeFirst();
|
|
4310
|
-
return s ? (s.enabled = !!s.enabled, s.synchronous = !!s.synchronous, R(s)) : null;
|
|
4311
|
-
};
|
|
4312
|
-
}
|
|
4313
|
-
function La(n) {
|
|
4314
|
-
return async (e, t) => (await n.deleteFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
4315
|
-
}
|
|
4316
|
-
function Va(n) {
|
|
4317
|
-
return async (e, t) => {
|
|
4318
|
-
const s = {
|
|
4319
|
-
hook_id: Ae(),
|
|
4320
|
-
...t,
|
|
4321
|
-
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4322
|
-
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
4323
|
-
};
|
|
4324
|
-
return await n.insertInto("hooks").values({
|
|
4325
|
-
...s,
|
|
4326
|
-
tenant_id: e
|
|
4327
|
-
}).execute(), s;
|
|
4328
|
-
};
|
|
4329
|
-
}
|
|
4330
|
-
function Ua(n) {
|
|
4331
|
-
return async (e, t, s) => {
|
|
4332
|
-
const r = {
|
|
4333
|
-
...s,
|
|
4334
|
-
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
4335
|
-
};
|
|
4336
|
-
return await n.updateTable("hooks").set(r).where("hooks.hook_id", "=", t).where("hooks.tenant_id", "=", e).execute(), !0;
|
|
4337
|
-
};
|
|
4338
|
-
}
|
|
4339
|
-
function Fa(n) {
|
|
4340
|
-
return {
|
|
4341
|
-
create: Va(n),
|
|
4342
|
-
get: Ma(n),
|
|
4343
|
-
list: Da(n),
|
|
4344
|
-
update: Ua(n),
|
|
4345
|
-
remove: La(n)
|
|
4346
|
-
};
|
|
4347
|
-
}
|
|
4348
|
-
function za(n, e) {
|
|
4349
|
-
var t = {};
|
|
4350
|
-
for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && e.indexOf(s) < 0 && (t[s] = n[s]);
|
|
4351
|
-
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
4352
|
-
for (var r = 0, s = Object.getOwnPropertySymbols(n); r < s.length; r++)
|
|
4353
|
-
e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, s[r]) && (t[s[r]] = n[s[r]]);
|
|
4354
|
-
return t;
|
|
4355
|
-
}
|
|
4356
|
-
function Ba(n, e) {
|
|
4357
|
-
var t;
|
|
4358
|
-
return ((t = n == null ? void 0 : n._def) === null || t === void 0 ? void 0 : t.typeName) === e;
|
|
4359
|
-
}
|
|
4360
|
-
function Qe(n, e) {
|
|
4361
|
-
const t = n.ZodType.prototype[e];
|
|
4362
|
-
n.ZodType.prototype[e] = function(...s) {
|
|
4363
|
-
const r = t.apply(this, s);
|
|
4364
|
-
return r._def.openapi = this._def.openapi, r;
|
|
4365
|
-
};
|
|
4366
|
-
}
|
|
4367
|
-
function Wa(n) {
|
|
4368
|
-
if (typeof n.ZodType.prototype.openapi < "u")
|
|
4369
|
-
return;
|
|
4370
|
-
n.ZodType.prototype.openapi = function(r, a) {
|
|
4371
|
-
var o, c, d, u, l, j;
|
|
4372
|
-
const A = typeof r == "string" ? a : r, U = A ?? {}, { param: ie } = U, Re = za(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 ? {
|
|
4373
|
-
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)
|
|
4374
|
-
} : 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) }));
|
|
4375
|
-
if (Ba(this, "ZodObject")) {
|
|
4376
|
-
const $e = this.extend;
|
|
4377
|
-
de.extend = function(...Pe) {
|
|
4378
|
-
var K, H, Q, ue, xe, Te;
|
|
4379
|
-
const Oe = $e.apply(this, Pe);
|
|
4380
|
-
return Oe._def.openapi = {
|
|
4381
|
-
_internal: {
|
|
4382
|
-
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
|
|
4383
|
-
},
|
|
4384
|
-
metadata: (Te = Oe._def.openapi) === null || Te === void 0 ? void 0 : Te.metadata
|
|
4385
|
-
}, Oe;
|
|
4386
|
-
};
|
|
4387
|
-
}
|
|
4388
|
-
return de;
|
|
4389
|
-
}, Qe(n, "optional"), Qe(n, "nullable"), Qe(n, "default"), Qe(n, "transform"), Qe(n, "refine");
|
|
4390
|
-
const e = n.ZodObject.prototype.deepPartial;
|
|
4391
|
-
n.ZodObject.prototype.deepPartial = function() {
|
|
4392
|
-
const r = this._def.shape(), a = e.apply(this), o = a._def.shape();
|
|
4393
|
-
return Object.entries(o).forEach(([c, d]) => {
|
|
4394
|
-
var u, l;
|
|
4395
|
-
d._def.openapi = (l = (u = r[c]) === null || u === void 0 ? void 0 : u._def) === null || l === void 0 ? void 0 : l.openapi;
|
|
4396
|
-
}), a._def.openapi = void 0, a;
|
|
4397
|
-
};
|
|
4398
|
-
const t = n.ZodObject.prototype.pick;
|
|
4399
|
-
n.ZodObject.prototype.pick = function(...r) {
|
|
4400
|
-
const a = t.apply(this, r);
|
|
4401
|
-
return a._def.openapi = void 0, a;
|
|
4176
|
+
const t = n.ZodObject.prototype.pick;
|
|
4177
|
+
n.ZodObject.prototype.pick = function(...r) {
|
|
4178
|
+
const a = t.apply(this, r);
|
|
4179
|
+
return a._def.openapi = void 0, a;
|
|
4402
4180
|
};
|
|
4403
4181
|
const s = n.ZodObject.prototype.omit;
|
|
4404
4182
|
n.ZodObject.prototype.omit = function(...r) {
|
|
@@ -4510,7 +4288,7 @@ const g = C.arrayToEnum([
|
|
|
4510
4288
|
"invalid_intersection_types",
|
|
4511
4289
|
"not_multiple_of",
|
|
4512
4290
|
"not_finite"
|
|
4513
|
-
]),
|
|
4291
|
+
]), Ta = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
4514
4292
|
class V extends Error {
|
|
4515
4293
|
constructor(e) {
|
|
4516
4294
|
super(), this.issues = [], this.addIssue = (s) => {
|
|
@@ -4571,7 +4349,7 @@ class V extends Error {
|
|
|
4571
4349
|
}
|
|
4572
4350
|
}
|
|
4573
4351
|
V.create = (n) => new V(n);
|
|
4574
|
-
const
|
|
4352
|
+
const Je = (n, e) => {
|
|
4575
4353
|
let t;
|
|
4576
4354
|
switch (n.code) {
|
|
4577
4355
|
case h.invalid_type:
|
|
@@ -4627,12 +4405,12 @@ const qe = (n, e) => {
|
|
|
4627
4405
|
}
|
|
4628
4406
|
return { message: t };
|
|
4629
4407
|
};
|
|
4630
|
-
let
|
|
4631
|
-
function
|
|
4632
|
-
|
|
4408
|
+
let Mn = Je;
|
|
4409
|
+
function Oa(n) {
|
|
4410
|
+
Mn = n;
|
|
4633
4411
|
}
|
|
4634
4412
|
function Vt() {
|
|
4635
|
-
return
|
|
4413
|
+
return Mn;
|
|
4636
4414
|
}
|
|
4637
4415
|
const Ut = (n) => {
|
|
4638
4416
|
const { data: e, path: t, errorMaps: s, issueData: r } = n, a = [...t, ...r.path || []], o = {
|
|
@@ -4654,7 +4432,7 @@ const Ut = (n) => {
|
|
|
4654
4432
|
path: a,
|
|
4655
4433
|
message: c
|
|
4656
4434
|
};
|
|
4657
|
-
},
|
|
4435
|
+
}, Sa = [];
|
|
4658
4436
|
function m(n, e) {
|
|
4659
4437
|
const t = Vt(), s = Ut({
|
|
4660
4438
|
issueData: e,
|
|
@@ -4664,7 +4442,7 @@ function m(n, e) {
|
|
|
4664
4442
|
n.common.contextualErrorMap,
|
|
4665
4443
|
n.schemaErrorMap,
|
|
4666
4444
|
t,
|
|
4667
|
-
t ===
|
|
4445
|
+
t === Je ? void 0 : Je
|
|
4668
4446
|
// then global default map
|
|
4669
4447
|
].filter((r) => !!r)
|
|
4670
4448
|
});
|
|
@@ -4684,7 +4462,7 @@ class P {
|
|
|
4684
4462
|
const s = [];
|
|
4685
4463
|
for (const r of t) {
|
|
4686
4464
|
if (r.status === "aborted")
|
|
4687
|
-
return
|
|
4465
|
+
return k;
|
|
4688
4466
|
r.status === "dirty" && e.dirty(), s.push(r.value);
|
|
4689
4467
|
}
|
|
4690
4468
|
return { status: e.value, value: s };
|
|
@@ -4705,20 +4483,20 @@ class P {
|
|
|
4705
4483
|
for (const r of t) {
|
|
4706
4484
|
const { key: a, value: o } = r;
|
|
4707
4485
|
if (a.status === "aborted" || o.status === "aborted")
|
|
4708
|
-
return
|
|
4486
|
+
return k;
|
|
4709
4487
|
a.status === "dirty" && e.dirty(), o.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof o.value < "u" || r.alwaysSet) && (s[a.value] = o.value);
|
|
4710
4488
|
}
|
|
4711
4489
|
return { status: e.value, value: s };
|
|
4712
4490
|
}
|
|
4713
4491
|
}
|
|
4714
|
-
const
|
|
4492
|
+
const k = Object.freeze({
|
|
4715
4493
|
status: "aborted"
|
|
4716
|
-
}),
|
|
4494
|
+
}), Ue = (n) => ({ status: "dirty", value: n }), M = (n) => ({ status: "valid", value: n }), rn = (n) => n.status === "aborted", an = (n) => n.status === "dirty", _t = (n) => n.status === "valid", gt = (n) => typeof Promise < "u" && n instanceof Promise;
|
|
4717
4495
|
function Ft(n, e, t, s) {
|
|
4718
4496
|
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");
|
|
4719
4497
|
return e.get(n);
|
|
4720
4498
|
}
|
|
4721
|
-
function
|
|
4499
|
+
function Ln(n, e, t, s, r) {
|
|
4722
4500
|
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");
|
|
4723
4501
|
return e.set(n, t), t;
|
|
4724
4502
|
}
|
|
@@ -4726,7 +4504,7 @@ var v;
|
|
|
4726
4504
|
(function(n) {
|
|
4727
4505
|
n.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, n.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
4728
4506
|
})(v || (v = {}));
|
|
4729
|
-
var
|
|
4507
|
+
var et, tt;
|
|
4730
4508
|
class te {
|
|
4731
4509
|
constructor(e, t, s, r) {
|
|
4732
4510
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = r;
|
|
@@ -4735,8 +4513,8 @@ class te {
|
|
|
4735
4513
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
4736
4514
|
}
|
|
4737
4515
|
}
|
|
4738
|
-
const
|
|
4739
|
-
if (
|
|
4516
|
+
const yn = (n, e) => {
|
|
4517
|
+
if (_t(e))
|
|
4740
4518
|
return { success: !0, data: e.value };
|
|
4741
4519
|
if (!n.common.issues.length)
|
|
4742
4520
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -4797,7 +4575,7 @@ class Z {
|
|
|
4797
4575
|
}
|
|
4798
4576
|
_parseSync(e) {
|
|
4799
4577
|
const t = this._parse(e);
|
|
4800
|
-
if (
|
|
4578
|
+
if (gt(t))
|
|
4801
4579
|
throw new Error("Synchronous parse encountered promise.");
|
|
4802
4580
|
return t;
|
|
4803
4581
|
}
|
|
@@ -4825,7 +4603,7 @@ class Z {
|
|
|
4825
4603
|
data: e,
|
|
4826
4604
|
parsedType: he(e)
|
|
4827
4605
|
}, a = this._parseSync({ data: e, path: r.path, parent: r });
|
|
4828
|
-
return
|
|
4606
|
+
return yn(r, a);
|
|
4829
4607
|
}
|
|
4830
4608
|
async parseAsync(e, t) {
|
|
4831
4609
|
const s = await this.safeParseAsync(e, t);
|
|
@@ -4845,8 +4623,8 @@ class Z {
|
|
|
4845
4623
|
parent: null,
|
|
4846
4624
|
data: e,
|
|
4847
4625
|
parsedType: he(e)
|
|
4848
|
-
}, r = this._parse({ data: e, path: s.path, parent: s }), a = await (
|
|
4849
|
-
return
|
|
4626
|
+
}, r = this._parse({ data: e, path: s.path, parent: s }), a = await (gt(r) ? r : Promise.resolve(r));
|
|
4627
|
+
return yn(s, a);
|
|
4850
4628
|
}
|
|
4851
4629
|
refine(e, t) {
|
|
4852
4630
|
const s = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
|
|
@@ -4864,7 +4642,7 @@ class Z {
|
|
|
4864
4642
|
_refinement(e) {
|
|
4865
4643
|
return new J({
|
|
4866
4644
|
schema: this,
|
|
4867
|
-
typeName:
|
|
4645
|
+
typeName: b.ZodEffects,
|
|
4868
4646
|
effect: { type: "refinement", refinement: e }
|
|
4869
4647
|
});
|
|
4870
4648
|
}
|
|
@@ -4875,7 +4653,7 @@ class Z {
|
|
|
4875
4653
|
return G.create(this, this._def);
|
|
4876
4654
|
}
|
|
4877
4655
|
nullable() {
|
|
4878
|
-
return
|
|
4656
|
+
return be.create(this, this._def);
|
|
4879
4657
|
}
|
|
4880
4658
|
nullish() {
|
|
4881
4659
|
return this.nullable().optional();
|
|
@@ -4884,10 +4662,10 @@ class Z {
|
|
|
4884
4662
|
return W.create(this, this._def);
|
|
4885
4663
|
}
|
|
4886
4664
|
promise() {
|
|
4887
|
-
return
|
|
4665
|
+
return He.create(this, this._def);
|
|
4888
4666
|
}
|
|
4889
4667
|
or(e) {
|
|
4890
|
-
return
|
|
4668
|
+
return bt.create([this, e], this._def);
|
|
4891
4669
|
}
|
|
4892
4670
|
and(e) {
|
|
4893
4671
|
return kt.create(this, e, this._def);
|
|
@@ -4896,33 +4674,33 @@ class Z {
|
|
|
4896
4674
|
return new J({
|
|
4897
4675
|
...O(this._def),
|
|
4898
4676
|
schema: this,
|
|
4899
|
-
typeName:
|
|
4677
|
+
typeName: b.ZodEffects,
|
|
4900
4678
|
effect: { type: "transform", transform: e }
|
|
4901
4679
|
});
|
|
4902
4680
|
}
|
|
4903
4681
|
default(e) {
|
|
4904
4682
|
const t = typeof e == "function" ? e : () => e;
|
|
4905
|
-
return new
|
|
4683
|
+
return new Zt({
|
|
4906
4684
|
...O(this._def),
|
|
4907
4685
|
innerType: this,
|
|
4908
4686
|
defaultValue: t,
|
|
4909
|
-
typeName:
|
|
4687
|
+
typeName: b.ZodDefault
|
|
4910
4688
|
});
|
|
4911
4689
|
}
|
|
4912
4690
|
brand() {
|
|
4913
4691
|
return new pn({
|
|
4914
|
-
typeName:
|
|
4692
|
+
typeName: b.ZodBranded,
|
|
4915
4693
|
type: this,
|
|
4916
4694
|
...O(this._def)
|
|
4917
4695
|
});
|
|
4918
4696
|
}
|
|
4919
4697
|
catch(e) {
|
|
4920
4698
|
const t = typeof e == "function" ? e : () => e;
|
|
4921
|
-
return new
|
|
4699
|
+
return new jt({
|
|
4922
4700
|
...O(this._def),
|
|
4923
4701
|
innerType: this,
|
|
4924
4702
|
catchValue: t,
|
|
4925
|
-
typeName:
|
|
4703
|
+
typeName: b.ZodCatch
|
|
4926
4704
|
});
|
|
4927
4705
|
}
|
|
4928
4706
|
describe(e) {
|
|
@@ -4933,10 +4711,10 @@ class Z {
|
|
|
4933
4711
|
});
|
|
4934
4712
|
}
|
|
4935
4713
|
pipe(e) {
|
|
4936
|
-
return
|
|
4714
|
+
return It.create(this, e);
|
|
4937
4715
|
}
|
|
4938
4716
|
readonly() {
|
|
4939
|
-
return
|
|
4717
|
+
return Nt.create(this);
|
|
4940
4718
|
}
|
|
4941
4719
|
isOptional() {
|
|
4942
4720
|
return this.safeParse(void 0).success;
|
|
@@ -4945,23 +4723,23 @@ class Z {
|
|
|
4945
4723
|
return this.safeParse(null).success;
|
|
4946
4724
|
}
|
|
4947
4725
|
}
|
|
4948
|
-
const
|
|
4726
|
+
const Za = /^c[^\s-]{8,}$/i, ja = /^[0-9a-z]+$/, Na = /^[0-9A-HJKMNP-TV-Z]{26}$/, Ca = /^[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, Ia = /^[a-z0-9_-]{21}$/i, Ea = /^[-+]?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)?)??$/, Aa = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ra = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
4949
4727
|
let Yt;
|
|
4950
|
-
const
|
|
4951
|
-
function
|
|
4728
|
+
const $a = /^(?:(?: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])$/, Pa = /^(([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})))$/, Da = /^([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])))", Ma = new RegExp(`^${Vn}$`);
|
|
4729
|
+
function Un(n) {
|
|
4952
4730
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
4953
4731
|
return n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
4954
4732
|
}
|
|
4955
|
-
function
|
|
4956
|
-
return new RegExp(`^${
|
|
4733
|
+
function La(n) {
|
|
4734
|
+
return new RegExp(`^${Un(n)}$`);
|
|
4957
4735
|
}
|
|
4958
|
-
function
|
|
4959
|
-
let e = `${
|
|
4736
|
+
function Fn(n) {
|
|
4737
|
+
let e = `${Vn}T${Un(n)}`;
|
|
4960
4738
|
const t = [];
|
|
4961
4739
|
return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
4962
4740
|
}
|
|
4963
|
-
function
|
|
4964
|
-
return !!((e === "v4" || !e) &&
|
|
4741
|
+
function Va(n, e) {
|
|
4742
|
+
return !!((e === "v4" || !e) && $a.test(n) || (e === "v6" || !e) && Pa.test(n));
|
|
4965
4743
|
}
|
|
4966
4744
|
class z extends Z {
|
|
4967
4745
|
_parse(e) {
|
|
@@ -4971,7 +4749,7 @@ class z extends Z {
|
|
|
4971
4749
|
code: h.invalid_type,
|
|
4972
4750
|
expected: g.string,
|
|
4973
4751
|
received: a.parsedType
|
|
4974
|
-
}),
|
|
4752
|
+
}), k;
|
|
4975
4753
|
}
|
|
4976
4754
|
const s = new P();
|
|
4977
4755
|
let r;
|
|
@@ -5012,43 +4790,43 @@ class z extends Z {
|
|
|
5012
4790
|
message: a.message
|
|
5013
4791
|
}), s.dirty());
|
|
5014
4792
|
} else if (a.kind === "email")
|
|
5015
|
-
|
|
4793
|
+
Aa.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5016
4794
|
validation: "email",
|
|
5017
4795
|
code: h.invalid_string,
|
|
5018
4796
|
message: a.message
|
|
5019
4797
|
}), s.dirty());
|
|
5020
4798
|
else if (a.kind === "emoji")
|
|
5021
|
-
Yt || (Yt = new RegExp(
|
|
4799
|
+
Yt || (Yt = new RegExp(Ra, "u")), Yt.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5022
4800
|
validation: "emoji",
|
|
5023
4801
|
code: h.invalid_string,
|
|
5024
4802
|
message: a.message
|
|
5025
4803
|
}), s.dirty());
|
|
5026
4804
|
else if (a.kind === "uuid")
|
|
5027
|
-
|
|
4805
|
+
Ca.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5028
4806
|
validation: "uuid",
|
|
5029
4807
|
code: h.invalid_string,
|
|
5030
4808
|
message: a.message
|
|
5031
4809
|
}), s.dirty());
|
|
5032
4810
|
else if (a.kind === "nanoid")
|
|
5033
|
-
|
|
4811
|
+
Ia.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5034
4812
|
validation: "nanoid",
|
|
5035
4813
|
code: h.invalid_string,
|
|
5036
4814
|
message: a.message
|
|
5037
4815
|
}), s.dirty());
|
|
5038
4816
|
else if (a.kind === "cuid")
|
|
5039
|
-
|
|
4817
|
+
Za.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5040
4818
|
validation: "cuid",
|
|
5041
4819
|
code: h.invalid_string,
|
|
5042
4820
|
message: a.message
|
|
5043
4821
|
}), s.dirty());
|
|
5044
4822
|
else if (a.kind === "cuid2")
|
|
5045
|
-
|
|
4823
|
+
ja.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5046
4824
|
validation: "cuid2",
|
|
5047
4825
|
code: h.invalid_string,
|
|
5048
4826
|
message: a.message
|
|
5049
4827
|
}), s.dirty());
|
|
5050
4828
|
else if (a.kind === "ulid")
|
|
5051
|
-
|
|
4829
|
+
Na.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5052
4830
|
validation: "ulid",
|
|
5053
4831
|
code: h.invalid_string,
|
|
5054
4832
|
message: a.message
|
|
@@ -5079,27 +4857,27 @@ class z extends Z {
|
|
|
5079
4857
|
code: h.invalid_string,
|
|
5080
4858
|
validation: { endsWith: a.value },
|
|
5081
4859
|
message: a.message
|
|
5082
|
-
}), s.dirty()) : a.kind === "datetime" ?
|
|
4860
|
+
}), s.dirty()) : a.kind === "datetime" ? Fn(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5083
4861
|
code: h.invalid_string,
|
|
5084
4862
|
validation: "datetime",
|
|
5085
4863
|
message: a.message
|
|
5086
|
-
}), s.dirty()) : a.kind === "date" ?
|
|
4864
|
+
}), s.dirty()) : a.kind === "date" ? Ma.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5087
4865
|
code: h.invalid_string,
|
|
5088
4866
|
validation: "date",
|
|
5089
4867
|
message: a.message
|
|
5090
|
-
}), s.dirty()) : a.kind === "time" ?
|
|
4868
|
+
}), s.dirty()) : a.kind === "time" ? La(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5091
4869
|
code: h.invalid_string,
|
|
5092
4870
|
validation: "time",
|
|
5093
4871
|
message: a.message
|
|
5094
|
-
}), s.dirty()) : a.kind === "duration" ?
|
|
4872
|
+
}), s.dirty()) : a.kind === "duration" ? Ea.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5095
4873
|
validation: "duration",
|
|
5096
4874
|
code: h.invalid_string,
|
|
5097
4875
|
message: a.message
|
|
5098
|
-
}), s.dirty()) : a.kind === "ip" ?
|
|
4876
|
+
}), s.dirty()) : a.kind === "ip" ? Va(e.data, a.version) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5099
4877
|
validation: "ip",
|
|
5100
4878
|
code: h.invalid_string,
|
|
5101
4879
|
message: a.message
|
|
5102
|
-
}), s.dirty()) : a.kind === "base64" ?
|
|
4880
|
+
}), s.dirty()) : a.kind === "base64" ? Da.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5103
4881
|
validation: "base64",
|
|
5104
4882
|
code: h.invalid_string,
|
|
5105
4883
|
message: a.message
|
|
@@ -5316,12 +5094,12 @@ z.create = (n) => {
|
|
|
5316
5094
|
var e;
|
|
5317
5095
|
return new z({
|
|
5318
5096
|
checks: [],
|
|
5319
|
-
typeName:
|
|
5097
|
+
typeName: b.ZodString,
|
|
5320
5098
|
coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1,
|
|
5321
5099
|
...O(n)
|
|
5322
5100
|
});
|
|
5323
5101
|
};
|
|
5324
|
-
function
|
|
5102
|
+
function Ua(n, e) {
|
|
5325
5103
|
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(".", ""));
|
|
5326
5104
|
return a % o / Math.pow(10, r);
|
|
5327
5105
|
}
|
|
@@ -5336,7 +5114,7 @@ class ye extends Z {
|
|
|
5336
5114
|
code: h.invalid_type,
|
|
5337
5115
|
expected: g.number,
|
|
5338
5116
|
received: a.parsedType
|
|
5339
|
-
}),
|
|
5117
|
+
}), k;
|
|
5340
5118
|
}
|
|
5341
5119
|
let s;
|
|
5342
5120
|
const r = new P();
|
|
@@ -5360,7 +5138,7 @@ class ye extends Z {
|
|
|
5360
5138
|
inclusive: a.inclusive,
|
|
5361
5139
|
exact: !1,
|
|
5362
5140
|
message: a.message
|
|
5363
|
-
}), r.dirty()) : a.kind === "multipleOf" ?
|
|
5141
|
+
}), r.dirty()) : a.kind === "multipleOf" ? Ua(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), m(s, {
|
|
5364
5142
|
code: h.not_multiple_of,
|
|
5365
5143
|
multipleOf: a.value,
|
|
5366
5144
|
message: a.message
|
|
@@ -5493,7 +5271,7 @@ class ye extends Z {
|
|
|
5493
5271
|
}
|
|
5494
5272
|
ye.create = (n) => new ye({
|
|
5495
5273
|
checks: [],
|
|
5496
|
-
typeName:
|
|
5274
|
+
typeName: b.ZodNumber,
|
|
5497
5275
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
5498
5276
|
...O(n)
|
|
5499
5277
|
});
|
|
@@ -5508,7 +5286,7 @@ class ve extends Z {
|
|
|
5508
5286
|
code: h.invalid_type,
|
|
5509
5287
|
expected: g.bigint,
|
|
5510
5288
|
received: a.parsedType
|
|
5511
|
-
}),
|
|
5289
|
+
}), k;
|
|
5512
5290
|
}
|
|
5513
5291
|
let s;
|
|
5514
5292
|
const r = new P();
|
|
@@ -5620,12 +5398,12 @@ ve.create = (n) => {
|
|
|
5620
5398
|
var e;
|
|
5621
5399
|
return new ve({
|
|
5622
5400
|
checks: [],
|
|
5623
|
-
typeName:
|
|
5401
|
+
typeName: b.ZodBigInt,
|
|
5624
5402
|
coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1,
|
|
5625
5403
|
...O(n)
|
|
5626
5404
|
});
|
|
5627
5405
|
};
|
|
5628
|
-
class
|
|
5406
|
+
class yt extends Z {
|
|
5629
5407
|
_parse(e) {
|
|
5630
5408
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== g.boolean) {
|
|
5631
5409
|
const s = this._getOrReturnCtx(e);
|
|
@@ -5633,13 +5411,13 @@ class gt extends Z {
|
|
|
5633
5411
|
code: h.invalid_type,
|
|
5634
5412
|
expected: g.boolean,
|
|
5635
5413
|
received: s.parsedType
|
|
5636
|
-
}),
|
|
5414
|
+
}), k;
|
|
5637
5415
|
}
|
|
5638
5416
|
return M(e.data);
|
|
5639
5417
|
}
|
|
5640
5418
|
}
|
|
5641
|
-
|
|
5642
|
-
typeName:
|
|
5419
|
+
yt.create = (n) => new yt({
|
|
5420
|
+
typeName: b.ZodBoolean,
|
|
5643
5421
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
5644
5422
|
...O(n)
|
|
5645
5423
|
});
|
|
@@ -5651,13 +5429,13 @@ class Ce extends Z {
|
|
|
5651
5429
|
code: h.invalid_type,
|
|
5652
5430
|
expected: g.date,
|
|
5653
5431
|
received: a.parsedType
|
|
5654
|
-
}),
|
|
5432
|
+
}), k;
|
|
5655
5433
|
}
|
|
5656
5434
|
if (isNaN(e.data.getTime())) {
|
|
5657
5435
|
const a = this._getOrReturnCtx(e);
|
|
5658
5436
|
return m(a, {
|
|
5659
5437
|
code: h.invalid_date
|
|
5660
|
-
}),
|
|
5438
|
+
}), k;
|
|
5661
5439
|
}
|
|
5662
5440
|
const s = new P();
|
|
5663
5441
|
let r;
|
|
@@ -5718,7 +5496,7 @@ class Ce extends Z {
|
|
|
5718
5496
|
Ce.create = (n) => new Ce({
|
|
5719
5497
|
checks: [],
|
|
5720
5498
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
5721
|
-
typeName:
|
|
5499
|
+
typeName: b.ZodDate,
|
|
5722
5500
|
...O(n)
|
|
5723
5501
|
});
|
|
5724
5502
|
class zt extends Z {
|
|
@@ -5729,16 +5507,16 @@ class zt extends Z {
|
|
|
5729
5507
|
code: h.invalid_type,
|
|
5730
5508
|
expected: g.symbol,
|
|
5731
5509
|
received: s.parsedType
|
|
5732
|
-
}),
|
|
5510
|
+
}), k;
|
|
5733
5511
|
}
|
|
5734
5512
|
return M(e.data);
|
|
5735
5513
|
}
|
|
5736
5514
|
}
|
|
5737
5515
|
zt.create = (n) => new zt({
|
|
5738
|
-
typeName:
|
|
5516
|
+
typeName: b.ZodSymbol,
|
|
5739
5517
|
...O(n)
|
|
5740
5518
|
});
|
|
5741
|
-
class
|
|
5519
|
+
class vt extends Z {
|
|
5742
5520
|
_parse(e) {
|
|
5743
5521
|
if (this._getType(e) !== g.undefined) {
|
|
5744
5522
|
const s = this._getOrReturnCtx(e);
|
|
@@ -5746,16 +5524,16 @@ class yt extends Z {
|
|
|
5746
5524
|
code: h.invalid_type,
|
|
5747
5525
|
expected: g.undefined,
|
|
5748
5526
|
received: s.parsedType
|
|
5749
|
-
}),
|
|
5527
|
+
}), k;
|
|
5750
5528
|
}
|
|
5751
5529
|
return M(e.data);
|
|
5752
5530
|
}
|
|
5753
5531
|
}
|
|
5754
|
-
|
|
5755
|
-
typeName:
|
|
5532
|
+
vt.create = (n) => new vt({
|
|
5533
|
+
typeName: b.ZodUndefined,
|
|
5756
5534
|
...O(n)
|
|
5757
5535
|
});
|
|
5758
|
-
class
|
|
5536
|
+
class wt extends Z {
|
|
5759
5537
|
_parse(e) {
|
|
5760
5538
|
if (this._getType(e) !== g.null) {
|
|
5761
5539
|
const s = this._getOrReturnCtx(e);
|
|
@@ -5763,16 +5541,16 @@ class vt extends Z {
|
|
|
5763
5541
|
code: h.invalid_type,
|
|
5764
5542
|
expected: g.null,
|
|
5765
5543
|
received: s.parsedType
|
|
5766
|
-
}),
|
|
5544
|
+
}), k;
|
|
5767
5545
|
}
|
|
5768
5546
|
return M(e.data);
|
|
5769
5547
|
}
|
|
5770
5548
|
}
|
|
5771
|
-
|
|
5772
|
-
typeName:
|
|
5549
|
+
wt.create = (n) => new wt({
|
|
5550
|
+
typeName: b.ZodNull,
|
|
5773
5551
|
...O(n)
|
|
5774
5552
|
});
|
|
5775
|
-
class
|
|
5553
|
+
class Ke extends Z {
|
|
5776
5554
|
constructor() {
|
|
5777
5555
|
super(...arguments), this._any = !0;
|
|
5778
5556
|
}
|
|
@@ -5780,8 +5558,8 @@ class Je extends Z {
|
|
|
5780
5558
|
return M(e.data);
|
|
5781
5559
|
}
|
|
5782
5560
|
}
|
|
5783
|
-
|
|
5784
|
-
typeName:
|
|
5561
|
+
Ke.create = (n) => new Ke({
|
|
5562
|
+
typeName: b.ZodAny,
|
|
5785
5563
|
...O(n)
|
|
5786
5564
|
});
|
|
5787
5565
|
class Ze extends Z {
|
|
@@ -5793,7 +5571,7 @@ class Ze extends Z {
|
|
|
5793
5571
|
}
|
|
5794
5572
|
}
|
|
5795
5573
|
Ze.create = (n) => new Ze({
|
|
5796
|
-
typeName:
|
|
5574
|
+
typeName: b.ZodUnknown,
|
|
5797
5575
|
...O(n)
|
|
5798
5576
|
});
|
|
5799
5577
|
class ae extends Z {
|
|
@@ -5803,11 +5581,11 @@ class ae extends Z {
|
|
|
5803
5581
|
code: h.invalid_type,
|
|
5804
5582
|
expected: g.never,
|
|
5805
5583
|
received: t.parsedType
|
|
5806
|
-
}),
|
|
5584
|
+
}), k;
|
|
5807
5585
|
}
|
|
5808
5586
|
}
|
|
5809
5587
|
ae.create = (n) => new ae({
|
|
5810
|
-
typeName:
|
|
5588
|
+
typeName: b.ZodNever,
|
|
5811
5589
|
...O(n)
|
|
5812
5590
|
});
|
|
5813
5591
|
class Bt extends Z {
|
|
@@ -5818,13 +5596,13 @@ class Bt extends Z {
|
|
|
5818
5596
|
code: h.invalid_type,
|
|
5819
5597
|
expected: g.void,
|
|
5820
5598
|
received: s.parsedType
|
|
5821
|
-
}),
|
|
5599
|
+
}), k;
|
|
5822
5600
|
}
|
|
5823
5601
|
return M(e.data);
|
|
5824
5602
|
}
|
|
5825
5603
|
}
|
|
5826
5604
|
Bt.create = (n) => new Bt({
|
|
5827
|
-
typeName:
|
|
5605
|
+
typeName: b.ZodVoid,
|
|
5828
5606
|
...O(n)
|
|
5829
5607
|
});
|
|
5830
5608
|
class W extends Z {
|
|
@@ -5835,7 +5613,7 @@ class W extends Z {
|
|
|
5835
5613
|
code: h.invalid_type,
|
|
5836
5614
|
expected: g.array,
|
|
5837
5615
|
received: t.parsedType
|
|
5838
|
-
}),
|
|
5616
|
+
}), k;
|
|
5839
5617
|
if (r.exactLength !== null) {
|
|
5840
5618
|
const o = t.data.length > r.exactLength.value, c = t.data.length < r.exactLength.value;
|
|
5841
5619
|
(o || c) && (m(t, {
|
|
@@ -5897,15 +5675,15 @@ W.create = (n, e) => new W({
|
|
|
5897
5675
|
minLength: null,
|
|
5898
5676
|
maxLength: null,
|
|
5899
5677
|
exactLength: null,
|
|
5900
|
-
typeName:
|
|
5678
|
+
typeName: b.ZodArray,
|
|
5901
5679
|
...O(e)
|
|
5902
5680
|
});
|
|
5903
|
-
function
|
|
5681
|
+
function Ve(n) {
|
|
5904
5682
|
if (n instanceof E) {
|
|
5905
5683
|
const e = {};
|
|
5906
5684
|
for (const t in n.shape) {
|
|
5907
5685
|
const s = n.shape[t];
|
|
5908
|
-
e[t] = G.create(
|
|
5686
|
+
e[t] = G.create(Ve(s));
|
|
5909
5687
|
}
|
|
5910
5688
|
return new E({
|
|
5911
5689
|
...n._def,
|
|
@@ -5913,8 +5691,8 @@ function Le(n) {
|
|
|
5913
5691
|
});
|
|
5914
5692
|
} else return n instanceof W ? new W({
|
|
5915
5693
|
...n._def,
|
|
5916
|
-
type:
|
|
5917
|
-
}) : n instanceof G ? G.create(
|
|
5694
|
+
type: Ve(n.element)
|
|
5695
|
+
}) : n instanceof G ? G.create(Ve(n.unwrap())) : n instanceof be ? be.create(Ve(n.unwrap())) : n instanceof ne ? ne.create(n.items.map((e) => Ve(e))) : n;
|
|
5918
5696
|
}
|
|
5919
5697
|
class E extends Z {
|
|
5920
5698
|
constructor() {
|
|
@@ -5933,7 +5711,7 @@ class E extends Z {
|
|
|
5933
5711
|
code: h.invalid_type,
|
|
5934
5712
|
expected: g.object,
|
|
5935
5713
|
received: u.parsedType
|
|
5936
|
-
}),
|
|
5714
|
+
}), k;
|
|
5937
5715
|
}
|
|
5938
5716
|
const { status: s, ctx: r } = this._processInputParams(e), { shape: a, keys: o } = this._getCached(), c = [];
|
|
5939
5717
|
if (!(this._def.catchall instanceof ae && this._def.unknownKeys === "strip"))
|
|
@@ -6060,7 +5838,7 @@ class E extends Z {
|
|
|
6060
5838
|
...this._def.shape(),
|
|
6061
5839
|
...e._def.shape()
|
|
6062
5840
|
}),
|
|
6063
|
-
typeName:
|
|
5841
|
+
typeName: b.ZodObject
|
|
6064
5842
|
});
|
|
6065
5843
|
}
|
|
6066
5844
|
// merge<
|
|
@@ -6150,7 +5928,7 @@ class E extends Z {
|
|
|
6150
5928
|
* @deprecated
|
|
6151
5929
|
*/
|
|
6152
5930
|
deepPartial() {
|
|
6153
|
-
return
|
|
5931
|
+
return Ve(this);
|
|
6154
5932
|
}
|
|
6155
5933
|
partial(e) {
|
|
6156
5934
|
const t = {};
|
|
@@ -6179,31 +5957,31 @@ class E extends Z {
|
|
|
6179
5957
|
});
|
|
6180
5958
|
}
|
|
6181
5959
|
keyof() {
|
|
6182
|
-
return
|
|
5960
|
+
return zn(C.objectKeys(this.shape));
|
|
6183
5961
|
}
|
|
6184
5962
|
}
|
|
6185
5963
|
E.create = (n, e) => new E({
|
|
6186
5964
|
shape: () => n,
|
|
6187
5965
|
unknownKeys: "strip",
|
|
6188
5966
|
catchall: ae.create(),
|
|
6189
|
-
typeName:
|
|
5967
|
+
typeName: b.ZodObject,
|
|
6190
5968
|
...O(e)
|
|
6191
5969
|
});
|
|
6192
5970
|
E.strictCreate = (n, e) => new E({
|
|
6193
5971
|
shape: () => n,
|
|
6194
5972
|
unknownKeys: "strict",
|
|
6195
5973
|
catchall: ae.create(),
|
|
6196
|
-
typeName:
|
|
5974
|
+
typeName: b.ZodObject,
|
|
6197
5975
|
...O(e)
|
|
6198
5976
|
});
|
|
6199
5977
|
E.lazycreate = (n, e) => new E({
|
|
6200
5978
|
shape: n,
|
|
6201
5979
|
unknownKeys: "strip",
|
|
6202
5980
|
catchall: ae.create(),
|
|
6203
|
-
typeName:
|
|
5981
|
+
typeName: b.ZodObject,
|
|
6204
5982
|
...O(e)
|
|
6205
5983
|
});
|
|
6206
|
-
class
|
|
5984
|
+
class bt extends Z {
|
|
6207
5985
|
_parse(e) {
|
|
6208
5986
|
const { ctx: t } = this._processInputParams(e), s = this._def.options;
|
|
6209
5987
|
function r(a) {
|
|
@@ -6217,7 +5995,7 @@ class wt extends Z {
|
|
|
6217
5995
|
return m(t, {
|
|
6218
5996
|
code: h.invalid_union,
|
|
6219
5997
|
unionErrors: o
|
|
6220
|
-
}),
|
|
5998
|
+
}), k;
|
|
6221
5999
|
}
|
|
6222
6000
|
if (t.common.async)
|
|
6223
6001
|
return Promise.all(s.map(async (a) => {
|
|
@@ -6264,19 +6042,19 @@ class wt extends Z {
|
|
|
6264
6042
|
return m(t, {
|
|
6265
6043
|
code: h.invalid_union,
|
|
6266
6044
|
unionErrors: c
|
|
6267
|
-
}),
|
|
6045
|
+
}), k;
|
|
6268
6046
|
}
|
|
6269
6047
|
}
|
|
6270
6048
|
get options() {
|
|
6271
6049
|
return this._def.options;
|
|
6272
6050
|
}
|
|
6273
6051
|
}
|
|
6274
|
-
|
|
6052
|
+
bt.create = (n, e) => new bt({
|
|
6275
6053
|
options: n,
|
|
6276
|
-
typeName:
|
|
6054
|
+
typeName: b.ZodUnion,
|
|
6277
6055
|
...O(e)
|
|
6278
6056
|
});
|
|
6279
|
-
const se = (n) => n instanceof
|
|
6057
|
+
const se = (n) => n instanceof Tt ? se(n.schema) : n instanceof J ? se(n.innerType()) : n instanceof Ot ? [n.value] : n instanceof we ? n.options : n instanceof St ? C.objectValues(n.enum) : n instanceof Zt ? se(n._def.innerType) : n instanceof vt ? [void 0] : n instanceof wt ? [null] : n instanceof G ? [void 0, ...se(n.unwrap())] : n instanceof be ? [null, ...se(n.unwrap())] : n instanceof pn || n instanceof Nt ? se(n.unwrap()) : n instanceof jt ? se(n._def.innerType) : [];
|
|
6280
6058
|
class Kt extends Z {
|
|
6281
6059
|
_parse(e) {
|
|
6282
6060
|
const { ctx: t } = this._processInputParams(e);
|
|
@@ -6285,7 +6063,7 @@ class Kt extends Z {
|
|
|
6285
6063
|
code: h.invalid_type,
|
|
6286
6064
|
expected: g.object,
|
|
6287
6065
|
received: t.parsedType
|
|
6288
|
-
}),
|
|
6066
|
+
}), k;
|
|
6289
6067
|
const s = this.discriminator, r = t.data[s], a = this.optionsMap.get(r);
|
|
6290
6068
|
return a ? t.common.async ? a._parseAsync({
|
|
6291
6069
|
data: t.data,
|
|
@@ -6299,7 +6077,7 @@ class Kt extends Z {
|
|
|
6299
6077
|
code: h.invalid_union_discriminator,
|
|
6300
6078
|
options: Array.from(this.optionsMap.keys()),
|
|
6301
6079
|
path: [s]
|
|
6302
|
-
}),
|
|
6080
|
+
}), k);
|
|
6303
6081
|
}
|
|
6304
6082
|
get discriminator() {
|
|
6305
6083
|
return this._def.discriminator;
|
|
@@ -6331,7 +6109,7 @@ class Kt extends Z {
|
|
|
6331
6109
|
}
|
|
6332
6110
|
}
|
|
6333
6111
|
return new Kt({
|
|
6334
|
-
typeName:
|
|
6112
|
+
typeName: b.ZodDiscriminatedUnion,
|
|
6335
6113
|
discriminator: e,
|
|
6336
6114
|
options: t,
|
|
6337
6115
|
optionsMap: r,
|
|
@@ -6369,11 +6147,11 @@ class kt extends Z {
|
|
|
6369
6147
|
_parse(e) {
|
|
6370
6148
|
const { status: t, ctx: s } = this._processInputParams(e), r = (a, o) => {
|
|
6371
6149
|
if (rn(a) || rn(o))
|
|
6372
|
-
return
|
|
6150
|
+
return k;
|
|
6373
6151
|
const c = on(a.value, o.value);
|
|
6374
6152
|
return c.valid ? ((an(a) || an(o)) && t.dirty(), { status: t.value, value: c.data }) : (m(s, {
|
|
6375
6153
|
code: h.invalid_intersection_types
|
|
6376
|
-
}),
|
|
6154
|
+
}), k);
|
|
6377
6155
|
};
|
|
6378
6156
|
return s.common.async ? Promise.all([
|
|
6379
6157
|
this._def.left._parseAsync({
|
|
@@ -6400,7 +6178,7 @@ class kt extends Z {
|
|
|
6400
6178
|
kt.create = (n, e, t) => new kt({
|
|
6401
6179
|
left: n,
|
|
6402
6180
|
right: e,
|
|
6403
|
-
typeName:
|
|
6181
|
+
typeName: b.ZodIntersection,
|
|
6404
6182
|
...O(t)
|
|
6405
6183
|
});
|
|
6406
6184
|
class ne extends Z {
|
|
@@ -6411,7 +6189,7 @@ class ne extends Z {
|
|
|
6411
6189
|
code: h.invalid_type,
|
|
6412
6190
|
expected: g.array,
|
|
6413
6191
|
received: s.parsedType
|
|
6414
|
-
}),
|
|
6192
|
+
}), k;
|
|
6415
6193
|
if (s.data.length < this._def.items.length)
|
|
6416
6194
|
return m(s, {
|
|
6417
6195
|
code: h.too_small,
|
|
@@ -6419,7 +6197,7 @@ class ne extends Z {
|
|
|
6419
6197
|
inclusive: !0,
|
|
6420
6198
|
exact: !1,
|
|
6421
6199
|
type: "array"
|
|
6422
|
-
}),
|
|
6200
|
+
}), k;
|
|
6423
6201
|
!this._def.rest && s.data.length > this._def.items.length && (m(s, {
|
|
6424
6202
|
code: h.too_big,
|
|
6425
6203
|
maximum: this._def.items.length,
|
|
@@ -6448,12 +6226,12 @@ ne.create = (n, e) => {
|
|
|
6448
6226
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
6449
6227
|
return new ne({
|
|
6450
6228
|
items: n,
|
|
6451
|
-
typeName:
|
|
6229
|
+
typeName: b.ZodTuple,
|
|
6452
6230
|
rest: null,
|
|
6453
6231
|
...O(e)
|
|
6454
6232
|
});
|
|
6455
6233
|
};
|
|
6456
|
-
class
|
|
6234
|
+
class xt extends Z {
|
|
6457
6235
|
get keySchema() {
|
|
6458
6236
|
return this._def.keyType;
|
|
6459
6237
|
}
|
|
@@ -6467,7 +6245,7 @@ class bt extends Z {
|
|
|
6467
6245
|
code: h.invalid_type,
|
|
6468
6246
|
expected: g.object,
|
|
6469
6247
|
received: s.parsedType
|
|
6470
|
-
}),
|
|
6248
|
+
}), k;
|
|
6471
6249
|
const r = [], a = this._def.keyType, o = this._def.valueType;
|
|
6472
6250
|
for (const c in s.data)
|
|
6473
6251
|
r.push({
|
|
@@ -6481,15 +6259,15 @@ class bt extends Z {
|
|
|
6481
6259
|
return this._def.valueType;
|
|
6482
6260
|
}
|
|
6483
6261
|
static create(e, t, s) {
|
|
6484
|
-
return t instanceof Z ? new
|
|
6262
|
+
return t instanceof Z ? new xt({
|
|
6485
6263
|
keyType: e,
|
|
6486
6264
|
valueType: t,
|
|
6487
|
-
typeName:
|
|
6265
|
+
typeName: b.ZodRecord,
|
|
6488
6266
|
...O(s)
|
|
6489
|
-
}) : new
|
|
6267
|
+
}) : new xt({
|
|
6490
6268
|
keyType: z.create(),
|
|
6491
6269
|
valueType: e,
|
|
6492
|
-
typeName:
|
|
6270
|
+
typeName: b.ZodRecord,
|
|
6493
6271
|
...O(t)
|
|
6494
6272
|
});
|
|
6495
6273
|
}
|
|
@@ -6508,7 +6286,7 @@ class Wt extends Z {
|
|
|
6508
6286
|
code: h.invalid_type,
|
|
6509
6287
|
expected: g.map,
|
|
6510
6288
|
received: s.parsedType
|
|
6511
|
-
}),
|
|
6289
|
+
}), k;
|
|
6512
6290
|
const r = this._def.keyType, a = this._def.valueType, o = [...s.data.entries()].map(([c, d], u) => ({
|
|
6513
6291
|
key: r._parse(new te(s, c, s.path, [u, "key"])),
|
|
6514
6292
|
value: a._parse(new te(s, d, s.path, [u, "value"]))
|
|
@@ -6519,7 +6297,7 @@ class Wt extends Z {
|
|
|
6519
6297
|
for (const d of o) {
|
|
6520
6298
|
const u = await d.key, l = await d.value;
|
|
6521
6299
|
if (u.status === "aborted" || l.status === "aborted")
|
|
6522
|
-
return
|
|
6300
|
+
return k;
|
|
6523
6301
|
(u.status === "dirty" || l.status === "dirty") && t.dirty(), c.set(u.value, l.value);
|
|
6524
6302
|
}
|
|
6525
6303
|
return { status: t.value, value: c };
|
|
@@ -6529,7 +6307,7 @@ class Wt extends Z {
|
|
|
6529
6307
|
for (const d of o) {
|
|
6530
6308
|
const u = d.key, l = d.value;
|
|
6531
6309
|
if (u.status === "aborted" || l.status === "aborted")
|
|
6532
|
-
return
|
|
6310
|
+
return k;
|
|
6533
6311
|
(u.status === "dirty" || l.status === "dirty") && t.dirty(), c.set(u.value, l.value);
|
|
6534
6312
|
}
|
|
6535
6313
|
return { status: t.value, value: c };
|
|
@@ -6539,7 +6317,7 @@ class Wt extends Z {
|
|
|
6539
6317
|
Wt.create = (n, e, t) => new Wt({
|
|
6540
6318
|
valueType: e,
|
|
6541
6319
|
keyType: n,
|
|
6542
|
-
typeName:
|
|
6320
|
+
typeName: b.ZodMap,
|
|
6543
6321
|
...O(t)
|
|
6544
6322
|
});
|
|
6545
6323
|
class Ie extends Z {
|
|
@@ -6550,7 +6328,7 @@ class Ie extends Z {
|
|
|
6550
6328
|
code: h.invalid_type,
|
|
6551
6329
|
expected: g.set,
|
|
6552
6330
|
received: s.parsedType
|
|
6553
|
-
}),
|
|
6331
|
+
}), k;
|
|
6554
6332
|
const r = this._def;
|
|
6555
6333
|
r.minSize !== null && s.data.size < r.minSize.value && (m(s, {
|
|
6556
6334
|
code: h.too_small,
|
|
@@ -6572,7 +6350,7 @@ class Ie extends Z {
|
|
|
6572
6350
|
const u = /* @__PURE__ */ new Set();
|
|
6573
6351
|
for (const l of d) {
|
|
6574
6352
|
if (l.status === "aborted")
|
|
6575
|
-
return
|
|
6353
|
+
return k;
|
|
6576
6354
|
l.status === "dirty" && t.dirty(), u.add(l.value);
|
|
6577
6355
|
}
|
|
6578
6356
|
return { status: t.value, value: u };
|
|
@@ -6603,10 +6381,10 @@ Ie.create = (n, e) => new Ie({
|
|
|
6603
6381
|
valueType: n,
|
|
6604
6382
|
minSize: null,
|
|
6605
6383
|
maxSize: null,
|
|
6606
|
-
typeName:
|
|
6384
|
+
typeName: b.ZodSet,
|
|
6607
6385
|
...O(e)
|
|
6608
6386
|
});
|
|
6609
|
-
class
|
|
6387
|
+
class ze extends Z {
|
|
6610
6388
|
constructor() {
|
|
6611
6389
|
super(...arguments), this.validate = this.implement;
|
|
6612
6390
|
}
|
|
@@ -6617,7 +6395,7 @@ class Fe extends Z {
|
|
|
6617
6395
|
code: h.invalid_type,
|
|
6618
6396
|
expected: g.function,
|
|
6619
6397
|
received: t.parsedType
|
|
6620
|
-
}),
|
|
6398
|
+
}), k;
|
|
6621
6399
|
function s(c, d) {
|
|
6622
6400
|
return Ut({
|
|
6623
6401
|
data: c,
|
|
@@ -6626,7 +6404,7 @@ class Fe extends Z {
|
|
|
6626
6404
|
t.common.contextualErrorMap,
|
|
6627
6405
|
t.schemaErrorMap,
|
|
6628
6406
|
Vt(),
|
|
6629
|
-
|
|
6407
|
+
Je
|
|
6630
6408
|
].filter((u) => !!u),
|
|
6631
6409
|
issueData: {
|
|
6632
6410
|
code: h.invalid_arguments,
|
|
@@ -6642,7 +6420,7 @@ class Fe extends Z {
|
|
|
6642
6420
|
t.common.contextualErrorMap,
|
|
6643
6421
|
t.schemaErrorMap,
|
|
6644
6422
|
Vt(),
|
|
6645
|
-
|
|
6423
|
+
Je
|
|
6646
6424
|
].filter((u) => !!u),
|
|
6647
6425
|
issueData: {
|
|
6648
6426
|
code: h.invalid_return_type,
|
|
@@ -6651,7 +6429,7 @@ class Fe extends Z {
|
|
|
6651
6429
|
});
|
|
6652
6430
|
}
|
|
6653
6431
|
const a = { errorMap: t.common.contextualErrorMap }, o = t.data;
|
|
6654
|
-
if (this._def.returns instanceof
|
|
6432
|
+
if (this._def.returns instanceof He) {
|
|
6655
6433
|
const c = this;
|
|
6656
6434
|
return M(async function(...d) {
|
|
6657
6435
|
const u = new V([]), l = await c._def.args.parseAsync(d, a).catch((U) => {
|
|
@@ -6681,13 +6459,13 @@ class Fe extends Z {
|
|
|
6681
6459
|
return this._def.returns;
|
|
6682
6460
|
}
|
|
6683
6461
|
args(...e) {
|
|
6684
|
-
return new
|
|
6462
|
+
return new ze({
|
|
6685
6463
|
...this._def,
|
|
6686
6464
|
args: ne.create(e).rest(Ze.create())
|
|
6687
6465
|
});
|
|
6688
6466
|
}
|
|
6689
6467
|
returns(e) {
|
|
6690
|
-
return new
|
|
6468
|
+
return new ze({
|
|
6691
6469
|
...this._def,
|
|
6692
6470
|
returns: e
|
|
6693
6471
|
});
|
|
@@ -6699,15 +6477,15 @@ class Fe extends Z {
|
|
|
6699
6477
|
return this.parse(e);
|
|
6700
6478
|
}
|
|
6701
6479
|
static create(e, t, s) {
|
|
6702
|
-
return new
|
|
6480
|
+
return new ze({
|
|
6703
6481
|
args: e || ne.create([]).rest(Ze.create()),
|
|
6704
6482
|
returns: t || Ze.create(),
|
|
6705
|
-
typeName:
|
|
6483
|
+
typeName: b.ZodFunction,
|
|
6706
6484
|
...O(s)
|
|
6707
6485
|
});
|
|
6708
6486
|
}
|
|
6709
6487
|
}
|
|
6710
|
-
class
|
|
6488
|
+
class Tt extends Z {
|
|
6711
6489
|
get schema() {
|
|
6712
6490
|
return this._def.getter();
|
|
6713
6491
|
}
|
|
@@ -6716,12 +6494,12 @@ class xt extends Z {
|
|
|
6716
6494
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
6717
6495
|
}
|
|
6718
6496
|
}
|
|
6719
|
-
|
|
6497
|
+
Tt.create = (n, e) => new Tt({
|
|
6720
6498
|
getter: n,
|
|
6721
|
-
typeName:
|
|
6499
|
+
typeName: b.ZodLazy,
|
|
6722
6500
|
...O(e)
|
|
6723
6501
|
});
|
|
6724
|
-
class
|
|
6502
|
+
class Ot extends Z {
|
|
6725
6503
|
_parse(e) {
|
|
6726
6504
|
if (e.data !== this._def.value) {
|
|
6727
6505
|
const t = this._getOrReturnCtx(e);
|
|
@@ -6729,7 +6507,7 @@ class Tt extends Z {
|
|
|
6729
6507
|
received: t.data,
|
|
6730
6508
|
code: h.invalid_literal,
|
|
6731
6509
|
expected: this._def.value
|
|
6732
|
-
}),
|
|
6510
|
+
}), k;
|
|
6733
6511
|
}
|
|
6734
6512
|
return { status: "valid", value: e.data };
|
|
6735
6513
|
}
|
|
@@ -6737,21 +6515,21 @@ class Tt extends Z {
|
|
|
6737
6515
|
return this._def.value;
|
|
6738
6516
|
}
|
|
6739
6517
|
}
|
|
6740
|
-
|
|
6518
|
+
Ot.create = (n, e) => new Ot({
|
|
6741
6519
|
value: n,
|
|
6742
|
-
typeName:
|
|
6520
|
+
typeName: b.ZodLiteral,
|
|
6743
6521
|
...O(e)
|
|
6744
6522
|
});
|
|
6745
|
-
function
|
|
6523
|
+
function zn(n, e) {
|
|
6746
6524
|
return new we({
|
|
6747
6525
|
values: n,
|
|
6748
|
-
typeName:
|
|
6526
|
+
typeName: b.ZodEnum,
|
|
6749
6527
|
...O(e)
|
|
6750
6528
|
});
|
|
6751
6529
|
}
|
|
6752
6530
|
class we extends Z {
|
|
6753
6531
|
constructor() {
|
|
6754
|
-
super(...arguments),
|
|
6532
|
+
super(...arguments), et.set(this, void 0);
|
|
6755
6533
|
}
|
|
6756
6534
|
_parse(e) {
|
|
6757
6535
|
if (typeof e.data != "string") {
|
|
@@ -6760,15 +6538,15 @@ class we extends Z {
|
|
|
6760
6538
|
expected: C.joinValues(s),
|
|
6761
6539
|
received: t.parsedType,
|
|
6762
6540
|
code: h.invalid_type
|
|
6763
|
-
}),
|
|
6541
|
+
}), k;
|
|
6764
6542
|
}
|
|
6765
|
-
if (Ft(this,
|
|
6543
|
+
if (Ft(this, et) || Ln(this, et, new Set(this._def.values)), !Ft(this, et).has(e.data)) {
|
|
6766
6544
|
const t = this._getOrReturnCtx(e), s = this._def.values;
|
|
6767
6545
|
return m(t, {
|
|
6768
6546
|
received: t.data,
|
|
6769
6547
|
code: h.invalid_enum_value,
|
|
6770
6548
|
options: s
|
|
6771
|
-
}),
|
|
6549
|
+
}), k;
|
|
6772
6550
|
}
|
|
6773
6551
|
return M(e.data);
|
|
6774
6552
|
}
|
|
@@ -6806,11 +6584,11 @@ class we extends Z {
|
|
|
6806
6584
|
});
|
|
6807
6585
|
}
|
|
6808
6586
|
}
|
|
6809
|
-
|
|
6810
|
-
we.create =
|
|
6811
|
-
class
|
|
6587
|
+
et = /* @__PURE__ */ new WeakMap();
|
|
6588
|
+
we.create = zn;
|
|
6589
|
+
class St extends Z {
|
|
6812
6590
|
constructor() {
|
|
6813
|
-
super(...arguments),
|
|
6591
|
+
super(...arguments), tt.set(this, void 0);
|
|
6814
6592
|
}
|
|
6815
6593
|
_parse(e) {
|
|
6816
6594
|
const t = C.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
|
|
@@ -6820,15 +6598,15 @@ class Ot extends Z {
|
|
|
6820
6598
|
expected: C.joinValues(r),
|
|
6821
6599
|
received: s.parsedType,
|
|
6822
6600
|
code: h.invalid_type
|
|
6823
|
-
}),
|
|
6601
|
+
}), k;
|
|
6824
6602
|
}
|
|
6825
|
-
if (Ft(this,
|
|
6603
|
+
if (Ft(this, tt) || Ln(this, tt, new Set(C.getValidEnumValues(this._def.values))), !Ft(this, tt).has(e.data)) {
|
|
6826
6604
|
const r = C.objectValues(t);
|
|
6827
6605
|
return m(s, {
|
|
6828
6606
|
received: s.data,
|
|
6829
6607
|
code: h.invalid_enum_value,
|
|
6830
6608
|
options: r
|
|
6831
|
-
}),
|
|
6609
|
+
}), k;
|
|
6832
6610
|
}
|
|
6833
6611
|
return M(e.data);
|
|
6834
6612
|
}
|
|
@@ -6836,13 +6614,13 @@ class Ot extends Z {
|
|
|
6836
6614
|
return this._def.values;
|
|
6837
6615
|
}
|
|
6838
6616
|
}
|
|
6839
|
-
|
|
6840
|
-
|
|
6617
|
+
tt = /* @__PURE__ */ new WeakMap();
|
|
6618
|
+
St.create = (n, e) => new St({
|
|
6841
6619
|
values: n,
|
|
6842
|
-
typeName:
|
|
6620
|
+
typeName: b.ZodNativeEnum,
|
|
6843
6621
|
...O(e)
|
|
6844
6622
|
});
|
|
6845
|
-
class
|
|
6623
|
+
class He extends Z {
|
|
6846
6624
|
unwrap() {
|
|
6847
6625
|
return this._def.type;
|
|
6848
6626
|
}
|
|
@@ -6853,7 +6631,7 @@ class Ke extends Z {
|
|
|
6853
6631
|
code: h.invalid_type,
|
|
6854
6632
|
expected: g.promise,
|
|
6855
6633
|
received: t.parsedType
|
|
6856
|
-
}),
|
|
6634
|
+
}), k;
|
|
6857
6635
|
const s = t.parsedType === g.promise ? t.data : Promise.resolve(t.data);
|
|
6858
6636
|
return M(s.then((r) => this._def.type.parseAsync(r, {
|
|
6859
6637
|
path: t.path,
|
|
@@ -6861,9 +6639,9 @@ class Ke extends Z {
|
|
|
6861
6639
|
})));
|
|
6862
6640
|
}
|
|
6863
6641
|
}
|
|
6864
|
-
|
|
6642
|
+
He.create = (n, e) => new He({
|
|
6865
6643
|
type: n,
|
|
6866
|
-
typeName:
|
|
6644
|
+
typeName: b.ZodPromise,
|
|
6867
6645
|
...O(e)
|
|
6868
6646
|
});
|
|
6869
6647
|
class J extends Z {
|
|
@@ -6871,7 +6649,7 @@ class J extends Z {
|
|
|
6871
6649
|
return this._def.schema;
|
|
6872
6650
|
}
|
|
6873
6651
|
sourceType() {
|
|
6874
|
-
return this._def.schema._def.typeName ===
|
|
6652
|
+
return this._def.schema._def.typeName === b.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
6875
6653
|
}
|
|
6876
6654
|
_parse(e) {
|
|
6877
6655
|
const { status: t, ctx: s } = this._processInputParams(e), r = this._def.effect || null, a = {
|
|
@@ -6887,23 +6665,23 @@ class J extends Z {
|
|
|
6887
6665
|
if (s.common.async)
|
|
6888
6666
|
return Promise.resolve(o).then(async (c) => {
|
|
6889
6667
|
if (t.value === "aborted")
|
|
6890
|
-
return
|
|
6668
|
+
return k;
|
|
6891
6669
|
const d = await this._def.schema._parseAsync({
|
|
6892
6670
|
data: c,
|
|
6893
6671
|
path: s.path,
|
|
6894
6672
|
parent: s
|
|
6895
6673
|
});
|
|
6896
|
-
return d.status === "aborted" ?
|
|
6674
|
+
return d.status === "aborted" ? k : d.status === "dirty" || t.value === "dirty" ? Ue(d.value) : d;
|
|
6897
6675
|
});
|
|
6898
6676
|
{
|
|
6899
6677
|
if (t.value === "aborted")
|
|
6900
|
-
return
|
|
6678
|
+
return k;
|
|
6901
6679
|
const c = this._def.schema._parseSync({
|
|
6902
6680
|
data: o,
|
|
6903
6681
|
path: s.path,
|
|
6904
6682
|
parent: s
|
|
6905
6683
|
});
|
|
6906
|
-
return c.status === "aborted" ?
|
|
6684
|
+
return c.status === "aborted" ? k : c.status === "dirty" || t.value === "dirty" ? Ue(c.value) : c;
|
|
6907
6685
|
}
|
|
6908
6686
|
}
|
|
6909
6687
|
if (r.type === "refinement") {
|
|
@@ -6921,9 +6699,9 @@ class J extends Z {
|
|
|
6921
6699
|
path: s.path,
|
|
6922
6700
|
parent: s
|
|
6923
6701
|
});
|
|
6924
|
-
return c.status === "aborted" ?
|
|
6702
|
+
return c.status === "aborted" ? k : (c.status === "dirty" && t.dirty(), o(c.value), { status: t.value, value: c.value });
|
|
6925
6703
|
} else
|
|
6926
|
-
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((c) => c.status === "aborted" ?
|
|
6704
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((c) => c.status === "aborted" ? k : (c.status === "dirty" && t.dirty(), o(c.value).then(() => ({ status: t.value, value: c.value }))));
|
|
6927
6705
|
}
|
|
6928
6706
|
if (r.type === "transform")
|
|
6929
6707
|
if (s.common.async === !1) {
|
|
@@ -6932,27 +6710,27 @@ class J extends Z {
|
|
|
6932
6710
|
path: s.path,
|
|
6933
6711
|
parent: s
|
|
6934
6712
|
});
|
|
6935
|
-
if (!
|
|
6713
|
+
if (!_t(o))
|
|
6936
6714
|
return o;
|
|
6937
6715
|
const c = r.transform(o.value, a);
|
|
6938
6716
|
if (c instanceof Promise)
|
|
6939
6717
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
6940
6718
|
return { status: t.value, value: c };
|
|
6941
6719
|
} else
|
|
6942
|
-
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) =>
|
|
6720
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => _t(o) ? Promise.resolve(r.transform(o.value, a)).then((c) => ({ status: t.value, value: c })) : o);
|
|
6943
6721
|
C.assertNever(r);
|
|
6944
6722
|
}
|
|
6945
6723
|
}
|
|
6946
6724
|
J.create = (n, e, t) => new J({
|
|
6947
6725
|
schema: n,
|
|
6948
|
-
typeName:
|
|
6726
|
+
typeName: b.ZodEffects,
|
|
6949
6727
|
effect: e,
|
|
6950
6728
|
...O(t)
|
|
6951
6729
|
});
|
|
6952
6730
|
J.createWithPreprocess = (n, e, t) => new J({
|
|
6953
6731
|
schema: e,
|
|
6954
6732
|
effect: { type: "preprocess", transform: n },
|
|
6955
|
-
typeName:
|
|
6733
|
+
typeName: b.ZodEffects,
|
|
6956
6734
|
...O(t)
|
|
6957
6735
|
});
|
|
6958
6736
|
class G extends Z {
|
|
@@ -6965,10 +6743,10 @@ class G extends Z {
|
|
|
6965
6743
|
}
|
|
6966
6744
|
G.create = (n, e) => new G({
|
|
6967
6745
|
innerType: n,
|
|
6968
|
-
typeName:
|
|
6746
|
+
typeName: b.ZodOptional,
|
|
6969
6747
|
...O(e)
|
|
6970
6748
|
});
|
|
6971
|
-
class
|
|
6749
|
+
class be extends Z {
|
|
6972
6750
|
_parse(e) {
|
|
6973
6751
|
return this._getType(e) === g.null ? M(null) : this._def.innerType._parse(e);
|
|
6974
6752
|
}
|
|
@@ -6976,12 +6754,12 @@ class ke extends Z {
|
|
|
6976
6754
|
return this._def.innerType;
|
|
6977
6755
|
}
|
|
6978
6756
|
}
|
|
6979
|
-
|
|
6757
|
+
be.create = (n, e) => new be({
|
|
6980
6758
|
innerType: n,
|
|
6981
|
-
typeName:
|
|
6759
|
+
typeName: b.ZodNullable,
|
|
6982
6760
|
...O(e)
|
|
6983
6761
|
});
|
|
6984
|
-
class
|
|
6762
|
+
class Zt extends Z {
|
|
6985
6763
|
_parse(e) {
|
|
6986
6764
|
const { ctx: t } = this._processInputParams(e);
|
|
6987
6765
|
let s = t.data;
|
|
@@ -6995,13 +6773,13 @@ class St extends Z {
|
|
|
6995
6773
|
return this._def.innerType;
|
|
6996
6774
|
}
|
|
6997
6775
|
}
|
|
6998
|
-
|
|
6776
|
+
Zt.create = (n, e) => new Zt({
|
|
6999
6777
|
innerType: n,
|
|
7000
|
-
typeName:
|
|
6778
|
+
typeName: b.ZodDefault,
|
|
7001
6779
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
7002
6780
|
...O(e)
|
|
7003
6781
|
});
|
|
7004
|
-
class
|
|
6782
|
+
class jt extends Z {
|
|
7005
6783
|
_parse(e) {
|
|
7006
6784
|
const { ctx: t } = this._processInputParams(e), s = {
|
|
7007
6785
|
...t,
|
|
@@ -7016,7 +6794,7 @@ class Zt extends Z {
|
|
|
7016
6794
|
...s
|
|
7017
6795
|
}
|
|
7018
6796
|
});
|
|
7019
|
-
return
|
|
6797
|
+
return gt(r) ? r.then((a) => ({
|
|
7020
6798
|
status: "valid",
|
|
7021
6799
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
7022
6800
|
get error() {
|
|
@@ -7038,9 +6816,9 @@ class Zt extends Z {
|
|
|
7038
6816
|
return this._def.innerType;
|
|
7039
6817
|
}
|
|
7040
6818
|
}
|
|
7041
|
-
|
|
6819
|
+
jt.create = (n, e) => new jt({
|
|
7042
6820
|
innerType: n,
|
|
7043
|
-
typeName:
|
|
6821
|
+
typeName: b.ZodCatch,
|
|
7044
6822
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
7045
6823
|
...O(e)
|
|
7046
6824
|
});
|
|
@@ -7052,16 +6830,16 @@ class qt extends Z {
|
|
|
7052
6830
|
code: h.invalid_type,
|
|
7053
6831
|
expected: g.nan,
|
|
7054
6832
|
received: s.parsedType
|
|
7055
|
-
}),
|
|
6833
|
+
}), k;
|
|
7056
6834
|
}
|
|
7057
6835
|
return { status: "valid", value: e.data };
|
|
7058
6836
|
}
|
|
7059
6837
|
}
|
|
7060
6838
|
qt.create = (n) => new qt({
|
|
7061
|
-
typeName:
|
|
6839
|
+
typeName: b.ZodNaN,
|
|
7062
6840
|
...O(n)
|
|
7063
6841
|
});
|
|
7064
|
-
const
|
|
6842
|
+
const Fa = Symbol("zod_brand");
|
|
7065
6843
|
class pn extends Z {
|
|
7066
6844
|
_parse(e) {
|
|
7067
6845
|
const { ctx: t } = this._processInputParams(e), s = t.data;
|
|
@@ -7075,7 +6853,7 @@ class pn extends Z {
|
|
|
7075
6853
|
return this._def.type;
|
|
7076
6854
|
}
|
|
7077
6855
|
}
|
|
7078
|
-
class
|
|
6856
|
+
class It extends Z {
|
|
7079
6857
|
_parse(e) {
|
|
7080
6858
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
7081
6859
|
if (s.common.async)
|
|
@@ -7085,7 +6863,7 @@ class Ct extends Z {
|
|
|
7085
6863
|
path: s.path,
|
|
7086
6864
|
parent: s
|
|
7087
6865
|
});
|
|
7088
|
-
return a.status === "aborted" ?
|
|
6866
|
+
return a.status === "aborted" ? k : a.status === "dirty" ? (t.dirty(), Ue(a.value)) : this._def.out._parseAsync({
|
|
7089
6867
|
data: a.value,
|
|
7090
6868
|
path: s.path,
|
|
7091
6869
|
parent: s
|
|
@@ -7097,7 +6875,7 @@ class Ct extends Z {
|
|
|
7097
6875
|
path: s.path,
|
|
7098
6876
|
parent: s
|
|
7099
6877
|
});
|
|
7100
|
-
return r.status === "aborted" ?
|
|
6878
|
+
return r.status === "aborted" ? k : r.status === "dirty" ? (t.dirty(), {
|
|
7101
6879
|
status: "dirty",
|
|
7102
6880
|
value: r.value
|
|
7103
6881
|
}) : this._def.out._parseSync({
|
|
@@ -7108,71 +6886,71 @@ class Ct extends Z {
|
|
|
7108
6886
|
}
|
|
7109
6887
|
}
|
|
7110
6888
|
static create(e, t) {
|
|
7111
|
-
return new
|
|
6889
|
+
return new It({
|
|
7112
6890
|
in: e,
|
|
7113
6891
|
out: t,
|
|
7114
|
-
typeName:
|
|
6892
|
+
typeName: b.ZodPipeline
|
|
7115
6893
|
});
|
|
7116
6894
|
}
|
|
7117
6895
|
}
|
|
7118
|
-
class
|
|
6896
|
+
class Nt extends Z {
|
|
7119
6897
|
_parse(e) {
|
|
7120
|
-
const t = this._def.innerType._parse(e), s = (r) => (
|
|
7121
|
-
return
|
|
6898
|
+
const t = this._def.innerType._parse(e), s = (r) => (_t(r) && (r.value = Object.freeze(r.value)), r);
|
|
6899
|
+
return gt(t) ? t.then((r) => s(r)) : s(t);
|
|
7122
6900
|
}
|
|
7123
6901
|
unwrap() {
|
|
7124
6902
|
return this._def.innerType;
|
|
7125
6903
|
}
|
|
7126
6904
|
}
|
|
7127
|
-
|
|
6905
|
+
Nt.create = (n, e) => new Nt({
|
|
7128
6906
|
innerType: n,
|
|
7129
|
-
typeName:
|
|
6907
|
+
typeName: b.ZodReadonly,
|
|
7130
6908
|
...O(e)
|
|
7131
6909
|
});
|
|
7132
|
-
function
|
|
7133
|
-
return n ?
|
|
6910
|
+
function Bn(n, e = {}, t) {
|
|
6911
|
+
return n ? Ke.create().superRefine((s, r) => {
|
|
7134
6912
|
var a, o;
|
|
7135
6913
|
if (!n(s)) {
|
|
7136
6914
|
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;
|
|
7137
6915
|
r.addIssue({ code: "custom", ...u, fatal: d });
|
|
7138
6916
|
}
|
|
7139
|
-
}) :
|
|
6917
|
+
}) : Ke.create();
|
|
7140
6918
|
}
|
|
7141
|
-
const
|
|
6919
|
+
const za = {
|
|
7142
6920
|
object: E.lazycreate
|
|
7143
6921
|
};
|
|
7144
|
-
var
|
|
6922
|
+
var b;
|
|
7145
6923
|
(function(n) {
|
|
7146
6924
|
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";
|
|
7147
|
-
})(
|
|
7148
|
-
const
|
|
6925
|
+
})(b || (b = {}));
|
|
6926
|
+
const Ba = (n, e = {
|
|
7149
6927
|
message: `Input not instance of ${n.name}`
|
|
7150
|
-
}) =>
|
|
6928
|
+
}) => Bn((t) => t instanceof n, e), Wn = z.create, qn = ye.create, Wa = qt.create, qa = ve.create, Jn = yt.create, Ja = Ce.create, Ka = zt.create, Ha = vt.create, Qa = wt.create, Ya = Ke.create, Ga = Ze.create, Xa = ae.create, ei = Bt.create, ti = W.create, ni = E.create, si = E.strictCreate, ri = bt.create, ai = Kt.create, ii = kt.create, oi = ne.create, ci = xt.create, di = Wt.create, ui = Ie.create, li = ze.create, pi = Tt.create, hi = Ot.create, fi = we.create, mi = St.create, _i = He.create, vn = J.create, gi = G.create, yi = be.create, vi = J.createWithPreprocess, wi = It.create, bi = () => Wn().optional(), ki = () => qn().optional(), xi = () => Jn().optional(), Ti = {
|
|
7151
6929
|
string: (n) => z.create({ ...n, coerce: !0 }),
|
|
7152
6930
|
number: (n) => ye.create({ ...n, coerce: !0 }),
|
|
7153
|
-
boolean: (n) =>
|
|
6931
|
+
boolean: (n) => yt.create({
|
|
7154
6932
|
...n,
|
|
7155
6933
|
coerce: !0
|
|
7156
6934
|
}),
|
|
7157
6935
|
bigint: (n) => ve.create({ ...n, coerce: !0 }),
|
|
7158
6936
|
date: (n) => Ce.create({ ...n, coerce: !0 })
|
|
7159
|
-
},
|
|
7160
|
-
var
|
|
6937
|
+
}, Oi = k;
|
|
6938
|
+
var Si = /* @__PURE__ */ Object.freeze({
|
|
7161
6939
|
__proto__: null,
|
|
7162
|
-
defaultErrorMap:
|
|
7163
|
-
setErrorMap:
|
|
6940
|
+
defaultErrorMap: Je,
|
|
6941
|
+
setErrorMap: Oa,
|
|
7164
6942
|
getErrorMap: Vt,
|
|
7165
6943
|
makeIssue: Ut,
|
|
7166
|
-
EMPTY_PATH:
|
|
6944
|
+
EMPTY_PATH: Sa,
|
|
7167
6945
|
addIssueToContext: m,
|
|
7168
6946
|
ParseStatus: P,
|
|
7169
|
-
INVALID:
|
|
7170
|
-
DIRTY:
|
|
6947
|
+
INVALID: k,
|
|
6948
|
+
DIRTY: Ue,
|
|
7171
6949
|
OK: M,
|
|
7172
6950
|
isAborted: rn,
|
|
7173
6951
|
isDirty: an,
|
|
7174
|
-
isValid:
|
|
7175
|
-
isAsync:
|
|
6952
|
+
isValid: _t,
|
|
6953
|
+
isAsync: gt,
|
|
7176
6954
|
get util() {
|
|
7177
6955
|
return C;
|
|
7178
6956
|
},
|
|
@@ -7182,107 +6960,107 @@ var Ki = /* @__PURE__ */ Object.freeze({
|
|
|
7182
6960
|
ZodParsedType: g,
|
|
7183
6961
|
getParsedType: he,
|
|
7184
6962
|
ZodType: Z,
|
|
7185
|
-
datetimeRegex:
|
|
6963
|
+
datetimeRegex: Fn,
|
|
7186
6964
|
ZodString: z,
|
|
7187
6965
|
ZodNumber: ye,
|
|
7188
6966
|
ZodBigInt: ve,
|
|
7189
|
-
ZodBoolean:
|
|
6967
|
+
ZodBoolean: yt,
|
|
7190
6968
|
ZodDate: Ce,
|
|
7191
6969
|
ZodSymbol: zt,
|
|
7192
|
-
ZodUndefined:
|
|
7193
|
-
ZodNull:
|
|
7194
|
-
ZodAny:
|
|
6970
|
+
ZodUndefined: vt,
|
|
6971
|
+
ZodNull: wt,
|
|
6972
|
+
ZodAny: Ke,
|
|
7195
6973
|
ZodUnknown: Ze,
|
|
7196
6974
|
ZodNever: ae,
|
|
7197
6975
|
ZodVoid: Bt,
|
|
7198
6976
|
ZodArray: W,
|
|
7199
6977
|
ZodObject: E,
|
|
7200
|
-
ZodUnion:
|
|
6978
|
+
ZodUnion: bt,
|
|
7201
6979
|
ZodDiscriminatedUnion: Kt,
|
|
7202
6980
|
ZodIntersection: kt,
|
|
7203
6981
|
ZodTuple: ne,
|
|
7204
|
-
ZodRecord:
|
|
6982
|
+
ZodRecord: xt,
|
|
7205
6983
|
ZodMap: Wt,
|
|
7206
6984
|
ZodSet: Ie,
|
|
7207
|
-
ZodFunction:
|
|
7208
|
-
ZodLazy:
|
|
7209
|
-
ZodLiteral:
|
|
6985
|
+
ZodFunction: ze,
|
|
6986
|
+
ZodLazy: Tt,
|
|
6987
|
+
ZodLiteral: Ot,
|
|
7210
6988
|
ZodEnum: we,
|
|
7211
|
-
ZodNativeEnum:
|
|
7212
|
-
ZodPromise:
|
|
6989
|
+
ZodNativeEnum: St,
|
|
6990
|
+
ZodPromise: He,
|
|
7213
6991
|
ZodEffects: J,
|
|
7214
6992
|
ZodTransformer: J,
|
|
7215
6993
|
ZodOptional: G,
|
|
7216
|
-
ZodNullable:
|
|
7217
|
-
ZodDefault:
|
|
7218
|
-
ZodCatch:
|
|
6994
|
+
ZodNullable: be,
|
|
6995
|
+
ZodDefault: Zt,
|
|
6996
|
+
ZodCatch: jt,
|
|
7219
6997
|
ZodNaN: qt,
|
|
7220
|
-
BRAND:
|
|
6998
|
+
BRAND: Fa,
|
|
7221
6999
|
ZodBranded: pn,
|
|
7222
|
-
ZodPipeline:
|
|
7223
|
-
ZodReadonly:
|
|
7224
|
-
custom:
|
|
7000
|
+
ZodPipeline: It,
|
|
7001
|
+
ZodReadonly: Nt,
|
|
7002
|
+
custom: Bn,
|
|
7225
7003
|
Schema: Z,
|
|
7226
7004
|
ZodSchema: Z,
|
|
7227
|
-
late:
|
|
7005
|
+
late: za,
|
|
7228
7006
|
get ZodFirstPartyTypeKind() {
|
|
7229
|
-
return
|
|
7007
|
+
return b;
|
|
7230
7008
|
},
|
|
7231
|
-
coerce:
|
|
7232
|
-
any:
|
|
7233
|
-
array:
|
|
7234
|
-
bigint:
|
|
7235
|
-
boolean:
|
|
7236
|
-
date:
|
|
7237
|
-
discriminatedUnion:
|
|
7238
|
-
effect:
|
|
7239
|
-
enum:
|
|
7240
|
-
function:
|
|
7241
|
-
instanceof:
|
|
7242
|
-
intersection:
|
|
7243
|
-
lazy:
|
|
7244
|
-
literal:
|
|
7245
|
-
map:
|
|
7246
|
-
nan:
|
|
7247
|
-
nativeEnum:
|
|
7248
|
-
never:
|
|
7249
|
-
null:
|
|
7250
|
-
nullable:
|
|
7251
|
-
number:
|
|
7252
|
-
object:
|
|
7253
|
-
oboolean:
|
|
7254
|
-
onumber:
|
|
7255
|
-
optional:
|
|
7256
|
-
ostring:
|
|
7257
|
-
pipeline:
|
|
7258
|
-
preprocess:
|
|
7259
|
-
promise:
|
|
7260
|
-
record:
|
|
7261
|
-
set:
|
|
7262
|
-
strictObject:
|
|
7263
|
-
string:
|
|
7264
|
-
symbol:
|
|
7265
|
-
transformer:
|
|
7266
|
-
tuple:
|
|
7267
|
-
undefined:
|
|
7268
|
-
union:
|
|
7269
|
-
unknown:
|
|
7270
|
-
void:
|
|
7271
|
-
NEVER:
|
|
7009
|
+
coerce: Ti,
|
|
7010
|
+
any: Ya,
|
|
7011
|
+
array: ti,
|
|
7012
|
+
bigint: qa,
|
|
7013
|
+
boolean: Jn,
|
|
7014
|
+
date: Ja,
|
|
7015
|
+
discriminatedUnion: ai,
|
|
7016
|
+
effect: vn,
|
|
7017
|
+
enum: fi,
|
|
7018
|
+
function: li,
|
|
7019
|
+
instanceof: Ba,
|
|
7020
|
+
intersection: ii,
|
|
7021
|
+
lazy: pi,
|
|
7022
|
+
literal: hi,
|
|
7023
|
+
map: di,
|
|
7024
|
+
nan: Wa,
|
|
7025
|
+
nativeEnum: mi,
|
|
7026
|
+
never: Xa,
|
|
7027
|
+
null: Qa,
|
|
7028
|
+
nullable: yi,
|
|
7029
|
+
number: qn,
|
|
7030
|
+
object: ni,
|
|
7031
|
+
oboolean: xi,
|
|
7032
|
+
onumber: ki,
|
|
7033
|
+
optional: gi,
|
|
7034
|
+
ostring: bi,
|
|
7035
|
+
pipeline: wi,
|
|
7036
|
+
preprocess: vi,
|
|
7037
|
+
promise: _i,
|
|
7038
|
+
record: ci,
|
|
7039
|
+
set: ui,
|
|
7040
|
+
strictObject: si,
|
|
7041
|
+
string: Wn,
|
|
7042
|
+
symbol: Ka,
|
|
7043
|
+
transformer: vn,
|
|
7044
|
+
tuple: oi,
|
|
7045
|
+
undefined: Ha,
|
|
7046
|
+
union: ri,
|
|
7047
|
+
unknown: Ga,
|
|
7048
|
+
void: ei,
|
|
7049
|
+
NEVER: Oi,
|
|
7272
7050
|
ZodIssueCode: h,
|
|
7273
|
-
quotelessJson:
|
|
7051
|
+
quotelessJson: Ta,
|
|
7274
7052
|
ZodError: V
|
|
7275
7053
|
});
|
|
7276
|
-
|
|
7277
|
-
function
|
|
7054
|
+
xa(Si);
|
|
7055
|
+
function Re(n, e = "", t = {}) {
|
|
7278
7056
|
for (let s in n)
|
|
7279
7057
|
if (Object.prototype.hasOwnProperty.call(n, s)) {
|
|
7280
7058
|
const r = e ? `${e}_${s}` : s;
|
|
7281
|
-
typeof n[s] == "object" && n[s] !== null && !Array.isArray(n[s]) ?
|
|
7059
|
+
typeof n[s] == "object" && n[s] !== null && !Array.isArray(n[s]) ? Re(n[s], r, t) : t[r] = n[s];
|
|
7282
7060
|
}
|
|
7283
7061
|
return t;
|
|
7284
7062
|
}
|
|
7285
|
-
function
|
|
7063
|
+
function hn(n, e) {
|
|
7286
7064
|
const t = {};
|
|
7287
7065
|
for (const [s, r] of Object.entries(n)) {
|
|
7288
7066
|
const a = e.find(
|
|
@@ -7300,6 +7078,261 @@ function Hi(n, e) {
|
|
|
7300
7078
|
}
|
|
7301
7079
|
return t;
|
|
7302
7080
|
}
|
|
7081
|
+
function Zi(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
|
+
function ji(n) {
|
|
7093
|
+
return async (e, t) => {
|
|
7094
|
+
let s = n.selectFrom("connections").where("connections.tenant_id", "=", e);
|
|
7095
|
+
t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
|
|
7096
|
+
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
7097
|
+
return {
|
|
7098
|
+
connections: a.map(
|
|
7099
|
+
(c) => R(hn(c, ["options"]))
|
|
7100
|
+
),
|
|
7101
|
+
start: t.page * t.per_page,
|
|
7102
|
+
limit: t.per_page,
|
|
7103
|
+
length: ke(o)
|
|
7104
|
+
};
|
|
7105
|
+
};
|
|
7106
|
+
}
|
|
7107
|
+
function Ni(n) {
|
|
7108
|
+
return async (e, t) => (await n.deleteFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
7109
|
+
}
|
|
7110
|
+
function Ci(n) {
|
|
7111
|
+
return async (e, t) => {
|
|
7112
|
+
const s = await n.selectFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).selectAll().executeTakeFirst();
|
|
7113
|
+
return s ? R(hn(s, ["options"])) : null;
|
|
7114
|
+
};
|
|
7115
|
+
}
|
|
7116
|
+
function Ii(n) {
|
|
7117
|
+
return async (e, t, s) => {
|
|
7118
|
+
const r = {
|
|
7119
|
+
...s,
|
|
7120
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7121
|
+
};
|
|
7122
|
+
return await n.updateTable("connections").set(Re(r)).where("connections.id", "=", t).where("connections.tenant_id", "=", e).execute(), !0;
|
|
7123
|
+
};
|
|
7124
|
+
}
|
|
7125
|
+
function Ei(n) {
|
|
7126
|
+
return {
|
|
7127
|
+
create: Zi(n),
|
|
7128
|
+
get: Ci(n),
|
|
7129
|
+
list: ji(n),
|
|
7130
|
+
remove: Ni(n),
|
|
7131
|
+
update: Ii(n)
|
|
7132
|
+
};
|
|
7133
|
+
}
|
|
7134
|
+
function Ai(n) {
|
|
7135
|
+
return {
|
|
7136
|
+
get: async (e) => {
|
|
7137
|
+
const t = await n.selectFrom("applications").selectAll().where("id", "=", e).executeTakeFirst();
|
|
7138
|
+
if (!t)
|
|
7139
|
+
return null;
|
|
7140
|
+
const s = await n.selectFrom("tenants").selectAll().where("id", "=", t.tenant_id).executeTakeFirst();
|
|
7141
|
+
if (!s)
|
|
7142
|
+
throw new Gt(404, { message: "Tenant not found" });
|
|
7143
|
+
const r = await n.selectFrom("connections").where("tenant_id", "=", t.tenant_id).selectAll().execute(), a = await n.selectFrom("domains").where("tenant_id", "=", t.tenant_id).selectAll().execute();
|
|
7144
|
+
return {
|
|
7145
|
+
...t,
|
|
7146
|
+
connections: r.map(
|
|
7147
|
+
(c) => Rn.parse(R(c))
|
|
7148
|
+
),
|
|
7149
|
+
domains: a,
|
|
7150
|
+
addons: t.addons ? JSON.parse(t.addons) : {},
|
|
7151
|
+
callbacks: t.callbacks ? JSON.parse(t.callbacks) : [],
|
|
7152
|
+
allowed_origins: t.allowed_origins ? JSON.parse(t.allowed_origins) : [],
|
|
7153
|
+
web_origins: t.web_origins ? JSON.parse(t.web_origins) : [],
|
|
7154
|
+
allowed_logout_urls: t.allowed_logout_urls ? JSON.parse(t.allowed_logout_urls) : [],
|
|
7155
|
+
tenant: R(s),
|
|
7156
|
+
// this is really an integer in the database
|
|
7157
|
+
disable_sign_ups: !!t.disable_sign_ups
|
|
7158
|
+
};
|
|
7159
|
+
}
|
|
7160
|
+
};
|
|
7161
|
+
}
|
|
7162
|
+
function Ri(n) {
|
|
7163
|
+
return async () => await n.selectFrom("keys").where("revoked_at", "is", null).selectAll().execute();
|
|
7164
|
+
}
|
|
7165
|
+
function $i(n) {
|
|
7166
|
+
return async (e) => {
|
|
7167
|
+
await n.insertInto("keys").values({ ...e, created_at: (/* @__PURE__ */ new Date()).toDateString() }).execute();
|
|
7168
|
+
};
|
|
7169
|
+
}
|
|
7170
|
+
function Pi(n) {
|
|
7171
|
+
return async (e, t) => !!(await n.updateTable("keys").set(t).where("kid", "=", e).execute()).length;
|
|
7172
|
+
}
|
|
7173
|
+
function Di(n) {
|
|
7174
|
+
return {
|
|
7175
|
+
create: $i(n),
|
|
7176
|
+
list: Ri(n),
|
|
7177
|
+
update: Pi(n)
|
|
7178
|
+
};
|
|
7179
|
+
}
|
|
7180
|
+
function Mi(n) {
|
|
7181
|
+
return async (e, t) => {
|
|
7182
|
+
const s = {
|
|
7183
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7184
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7185
|
+
tenant_id: e,
|
|
7186
|
+
id: Ae(),
|
|
7187
|
+
...t
|
|
7188
|
+
};
|
|
7189
|
+
return await n.insertInto("domains").values(s).execute(), s;
|
|
7190
|
+
};
|
|
7191
|
+
}
|
|
7192
|
+
function Li(n) {
|
|
7193
|
+
return async (e, t) => {
|
|
7194
|
+
let s = n.selectFrom("domains").where("domains.tenant_id", "=", e);
|
|
7195
|
+
t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
|
|
7196
|
+
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();
|
|
7197
|
+
return {
|
|
7198
|
+
domains: a,
|
|
7199
|
+
start: t.page * t.per_page,
|
|
7200
|
+
limit: t.per_page,
|
|
7201
|
+
length: ke(o)
|
|
7202
|
+
};
|
|
7203
|
+
};
|
|
7204
|
+
}
|
|
7205
|
+
function Vi(n) {
|
|
7206
|
+
return {
|
|
7207
|
+
create: Mi(n),
|
|
7208
|
+
list: Li(n)
|
|
7209
|
+
};
|
|
7210
|
+
}
|
|
7211
|
+
function Ui(n) {
|
|
7212
|
+
return async (e) => {
|
|
7213
|
+
const [t] = await n.selectFrom("branding").where("branding.tenant_id", "=", e).selectAll().execute();
|
|
7214
|
+
if (!t)
|
|
7215
|
+
return null;
|
|
7216
|
+
const {
|
|
7217
|
+
tenant_id: s,
|
|
7218
|
+
colors_primary: r,
|
|
7219
|
+
colors_page_background_type: a,
|
|
7220
|
+
colors_page_background_start: o,
|
|
7221
|
+
colors_page_background_end: c,
|
|
7222
|
+
colors_page_background_angle_dev: d,
|
|
7223
|
+
font_url: u,
|
|
7224
|
+
...l
|
|
7225
|
+
} = t;
|
|
7226
|
+
return R({
|
|
7227
|
+
...l,
|
|
7228
|
+
colors: {
|
|
7229
|
+
primary: r,
|
|
7230
|
+
page_background: {
|
|
7231
|
+
type: a,
|
|
7232
|
+
start: o,
|
|
7233
|
+
end: c,
|
|
7234
|
+
angle_deg: d
|
|
7235
|
+
}
|
|
7236
|
+
},
|
|
7237
|
+
font: u ? { url: u } : void 0
|
|
7238
|
+
});
|
|
7239
|
+
};
|
|
7240
|
+
}
|
|
7241
|
+
function Fi(n) {
|
|
7242
|
+
return async (e, t) => {
|
|
7243
|
+
var o, c, d, u, l, j, A, U, ie, $e, oe, ce, de, Pe, De, K, H, Q;
|
|
7244
|
+
const { colors: s, font: r, ...a } = t;
|
|
7245
|
+
try {
|
|
7246
|
+
await n.insertInto("branding").values({
|
|
7247
|
+
...a,
|
|
7248
|
+
colors_primary: s == null ? void 0 : s.primary,
|
|
7249
|
+
colors_page_background_type: (c = (o = t.colors) == null ? void 0 : o.page_background) == null ? void 0 : c.type,
|
|
7250
|
+
colors_page_background_start: (u = (d = t.colors) == null ? void 0 : d.page_background) == null ? void 0 : u.start,
|
|
7251
|
+
colors_page_background_end: (j = (l = t.colors) == null ? void 0 : l.page_background) == null ? void 0 : j.end,
|
|
7252
|
+
colors_page_background_angle_dev: (U = (A = t.colors) == null ? void 0 : A.page_background) == null ? void 0 : U.angle_deg,
|
|
7253
|
+
font_url: (ie = t.font) == null ? void 0 : ie.url,
|
|
7254
|
+
tenant_id: e
|
|
7255
|
+
}).execute();
|
|
7256
|
+
} catch {
|
|
7257
|
+
await n.updateTable("branding").set({
|
|
7258
|
+
...a,
|
|
7259
|
+
colors_primary: s == null ? void 0 : s.primary,
|
|
7260
|
+
colors_page_background_type: (oe = ($e = t.colors) == null ? void 0 : $e.page_background) == null ? void 0 : oe.type,
|
|
7261
|
+
colors_page_background_start: (de = (ce = t.colors) == null ? void 0 : ce.page_background) == null ? void 0 : de.start,
|
|
7262
|
+
colors_page_background_end: (De = (Pe = t.colors) == null ? void 0 : Pe.page_background) == null ? void 0 : De.end,
|
|
7263
|
+
colors_page_background_angle_dev: (H = (K = t.colors) == null ? void 0 : K.page_background) == null ? void 0 : H.angle_deg,
|
|
7264
|
+
font_url: (Q = t.font) == null ? void 0 : Q.url
|
|
7265
|
+
}).where("tenant_id", "=", e).execute();
|
|
7266
|
+
}
|
|
7267
|
+
};
|
|
7268
|
+
}
|
|
7269
|
+
function zi(n) {
|
|
7270
|
+
return {
|
|
7271
|
+
get: Ui(n),
|
|
7272
|
+
set: Fi(n)
|
|
7273
|
+
};
|
|
7274
|
+
}
|
|
7275
|
+
function Bi(n) {
|
|
7276
|
+
return async (e, t) => {
|
|
7277
|
+
let s = n.selectFrom("hooks").where("hooks.tenant_id", "=", e);
|
|
7278
|
+
t.q && (s = Ee(n, s, t.q, ["url"]));
|
|
7279
|
+
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
7280
|
+
return {
|
|
7281
|
+
hooks: a.map((d) => {
|
|
7282
|
+
const { tenant_id: u, enabled: l, synchronous: j, ...A } = d;
|
|
7283
|
+
return R({
|
|
7284
|
+
...A,
|
|
7285
|
+
enabled: !!l,
|
|
7286
|
+
synchronous: !!j
|
|
7287
|
+
});
|
|
7288
|
+
}),
|
|
7289
|
+
start: t.page * t.per_page,
|
|
7290
|
+
limit: t.per_page,
|
|
7291
|
+
length: ke(o)
|
|
7292
|
+
};
|
|
7293
|
+
};
|
|
7294
|
+
}
|
|
7295
|
+
function Wi(n) {
|
|
7296
|
+
return async (e, t) => {
|
|
7297
|
+
const s = await n.selectFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).selectAll().executeTakeFirst();
|
|
7298
|
+
return s ? (s.enabled = !!s.enabled, s.synchronous = !!s.synchronous, R(s)) : null;
|
|
7299
|
+
};
|
|
7300
|
+
}
|
|
7301
|
+
function qi(n) {
|
|
7302
|
+
return async (e, t) => (await n.deleteFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
7303
|
+
}
|
|
7304
|
+
function Ji(n) {
|
|
7305
|
+
return async (e, t) => {
|
|
7306
|
+
const s = {
|
|
7307
|
+
hook_id: Ae(),
|
|
7308
|
+
...t,
|
|
7309
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7310
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7311
|
+
};
|
|
7312
|
+
return await n.insertInto("hooks").values({
|
|
7313
|
+
...s,
|
|
7314
|
+
tenant_id: e
|
|
7315
|
+
}).execute(), s;
|
|
7316
|
+
};
|
|
7317
|
+
}
|
|
7318
|
+
function Ki(n) {
|
|
7319
|
+
return async (e, t, s) => {
|
|
7320
|
+
const r = {
|
|
7321
|
+
...s,
|
|
7322
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7323
|
+
};
|
|
7324
|
+
return await n.updateTable("hooks").set(r).where("hooks.hook_id", "=", t).where("hooks.tenant_id", "=", e).execute(), !0;
|
|
7325
|
+
};
|
|
7326
|
+
}
|
|
7327
|
+
function Hi(n) {
|
|
7328
|
+
return {
|
|
7329
|
+
create: Ji(n),
|
|
7330
|
+
get: Wi(n),
|
|
7331
|
+
list: Bi(n),
|
|
7332
|
+
update: Ki(n),
|
|
7333
|
+
remove: qi(n)
|
|
7334
|
+
};
|
|
7335
|
+
}
|
|
7303
7336
|
function Qi(n) {
|
|
7304
7337
|
return async (e, t) => {
|
|
7305
7338
|
const s = {
|
|
@@ -7308,7 +7341,7 @@ function Qi(n) {
|
|
|
7308
7341
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7309
7342
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7310
7343
|
};
|
|
7311
|
-
return await n.insertInto("themes").values({ ...
|
|
7344
|
+
return await n.insertInto("themes").values({ ...Re(s), tenant_id: e }).execute(), s;
|
|
7312
7345
|
};
|
|
7313
7346
|
}
|
|
7314
7347
|
function Yi(n) {
|
|
@@ -7322,7 +7355,7 @@ function Gi(n) {
|
|
|
7322
7355
|
}
|
|
7323
7356
|
function Xi(n) {
|
|
7324
7357
|
return async (e, t, s) => {
|
|
7325
|
-
const r =
|
|
7358
|
+
const r = Re({
|
|
7326
7359
|
...s,
|
|
7327
7360
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7328
7361
|
});
|
|
@@ -7340,8 +7373,8 @@ function eo(n) {
|
|
|
7340
7373
|
function to(n) {
|
|
7341
7374
|
return async (e, t) => {
|
|
7342
7375
|
const s = (/* @__PURE__ */ new Date()).toISOString(), r = await n.selectFrom("logins").where("logins.expires_at", ">", s).where("logins.login_id", "=", t).selectAll().executeTakeFirst();
|
|
7343
|
-
return r ?
|
|
7344
|
-
|
|
7376
|
+
return r ? wr.parse(
|
|
7377
|
+
hn(R(r), ["authParams"])
|
|
7345
7378
|
) : null;
|
|
7346
7379
|
};
|
|
7347
7380
|
}
|
|
@@ -7353,11 +7386,11 @@ function no(n) {
|
|
|
7353
7386
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7354
7387
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7355
7388
|
};
|
|
7356
|
-
return await n.insertInto("logins").values({ ...
|
|
7389
|
+
return await n.insertInto("logins").values({ ...Re(s), tenant_id: e }).execute(), s;
|
|
7357
7390
|
};
|
|
7358
7391
|
}
|
|
7359
7392
|
function so(n) {
|
|
7360
|
-
return async (e, t, s) => (await n.updateTable("logins").set(
|
|
7393
|
+
return async (e, t, s) => (await n.updateTable("logins").set(Re(s)).where("logins.login_id", "=", t).where("logins.tenant_id", "=", e).execute()).length === 1;
|
|
7361
7394
|
}
|
|
7362
7395
|
function ro(n) {
|
|
7363
7396
|
return async (e, t) => (await n.deleteFrom("logins").where("logins.tenant_id", "=", e).where("logins.login_id", "=", t).execute()).length > 0;
|
|
@@ -7370,26 +7403,56 @@ function ao(n) {
|
|
|
7370
7403
|
remove: ro(n)
|
|
7371
7404
|
};
|
|
7372
7405
|
}
|
|
7406
|
+
function io(n) {
|
|
7407
|
+
return async (e) => {
|
|
7408
|
+
const [t] = await n.selectFrom("promptSettings").where("promptSettings.tenant_id", "=", e).selectAll().execute();
|
|
7409
|
+
return R({
|
|
7410
|
+
identifier_first: !!(t != null && t.identifier_first),
|
|
7411
|
+
password_first: !!(t != null && t.password_first),
|
|
7412
|
+
webauthn_platform_first_factor: !!(t != null && t.webauthn_platform_first_factor),
|
|
7413
|
+
universal_login_experience: (t == null ? void 0 : t.universal_login_experience) || "new"
|
|
7414
|
+
});
|
|
7415
|
+
};
|
|
7416
|
+
}
|
|
7373
7417
|
function oo(n) {
|
|
7418
|
+
return async (e, t) => {
|
|
7419
|
+
try {
|
|
7420
|
+
await n.insertInto("promptSettings").values({
|
|
7421
|
+
...t,
|
|
7422
|
+
tenant_id: e
|
|
7423
|
+
}).execute();
|
|
7424
|
+
} catch {
|
|
7425
|
+
await n.updateTable("promptSettings").set(t).where("tenant_id", "=", e).execute();
|
|
7426
|
+
}
|
|
7427
|
+
};
|
|
7428
|
+
}
|
|
7429
|
+
function co(n) {
|
|
7430
|
+
return {
|
|
7431
|
+
get: io(n),
|
|
7432
|
+
set: oo(n)
|
|
7433
|
+
};
|
|
7434
|
+
}
|
|
7435
|
+
function lo(n) {
|
|
7374
7436
|
return {
|
|
7375
|
-
applications:
|
|
7376
|
-
branding:
|
|
7377
|
-
clients:
|
|
7378
|
-
codes:
|
|
7379
|
-
connections:
|
|
7380
|
-
domains:
|
|
7381
|
-
hooks:
|
|
7382
|
-
keys:
|
|
7437
|
+
applications: wa(n),
|
|
7438
|
+
branding: zi(n),
|
|
7439
|
+
clients: Ai(n),
|
|
7440
|
+
codes: fa(n),
|
|
7441
|
+
connections: Ei(n),
|
|
7442
|
+
domains: Vi(n),
|
|
7443
|
+
hooks: Hi(n),
|
|
7444
|
+
keys: Di(n),
|
|
7383
7445
|
logins: ao(n),
|
|
7384
|
-
logs:
|
|
7385
|
-
passwords:
|
|
7386
|
-
|
|
7387
|
-
|
|
7388
|
-
|
|
7446
|
+
logs: Hr(n),
|
|
7447
|
+
passwords: da(n),
|
|
7448
|
+
promptSettings: co(n),
|
|
7449
|
+
users: Dr(n),
|
|
7450
|
+
sessions: ta(n),
|
|
7451
|
+
tenants: Br(n),
|
|
7389
7452
|
themes: eo(n),
|
|
7390
|
-
tickets:
|
|
7453
|
+
tickets: aa(n)
|
|
7391
7454
|
};
|
|
7392
7455
|
}
|
|
7393
7456
|
export {
|
|
7394
|
-
|
|
7457
|
+
lo as default
|
|
7395
7458
|
};
|