@authhero/kysely-adapter 0.8.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kysely-adapter.cjs +1 -1
- package/dist/kysely-adapter.d.ts +262 -27
- package/dist/kysely-adapter.iife.js +1 -1
- package/dist/kysely-adapter.mjs +1028 -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,26 @@ 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(["google-oauth2", "facebook", "vipps", "apple", "email"]).optional(),
|
|
3129
|
+
options: i.object({
|
|
3130
|
+
kid: i.string().optional(),
|
|
3131
|
+
team_id: i.string().optional(),
|
|
3132
|
+
realms: i.string().optional(),
|
|
3133
|
+
client_id: i.string().optional(),
|
|
3134
|
+
client_secret: i.string().optional(),
|
|
3135
|
+
app_secret: i.string().optional(),
|
|
3136
|
+
scope: i.string().optional()
|
|
3137
|
+
}),
|
|
3138
|
+
enabled_clients: i.array(i.string()).optional(),
|
|
3127
3139
|
authorization_endpoint: i.string().optional(),
|
|
3128
3140
|
response_type: i.custom().optional(),
|
|
3129
3141
|
response_mode: i.custom().optional(),
|
|
3142
|
+
// Deprecated
|
|
3143
|
+
client_id: i.string().optional(),
|
|
3144
|
+
client_secret: i.string().optional(),
|
|
3130
3145
|
private_key: i.string().optional(),
|
|
3131
3146
|
kid: i.string().optional(),
|
|
3132
3147
|
team_id: i.string().optional(),
|
|
@@ -3134,11 +3149,11 @@ const cr = i.object({
|
|
|
3134
3149
|
token_exchange_basic_auth: i.boolean().optional(),
|
|
3135
3150
|
userinfo_endpoint: i.string().optional(),
|
|
3136
3151
|
scope: i.string().optional()
|
|
3137
|
-
}),
|
|
3152
|
+
}), Rn = i.object({
|
|
3138
3153
|
id: i.string(),
|
|
3139
3154
|
created_at: i.string().transform((n) => n === null ? "" : n),
|
|
3140
3155
|
updated_at: i.string().transform((n) => n === null ? "" : n)
|
|
3141
|
-
}).extend(
|
|
3156
|
+
}).extend(dr.shape), ur = i.object({
|
|
3142
3157
|
name: i.string(),
|
|
3143
3158
|
audience: i.string(),
|
|
3144
3159
|
sender_email: i.string().email(),
|
|
@@ -3148,11 +3163,11 @@ const cr = i.object({
|
|
|
3148
3163
|
primary_color: i.string().optional(),
|
|
3149
3164
|
secondary_color: i.string().optional(),
|
|
3150
3165
|
language: i.string().optional()
|
|
3151
|
-
}),
|
|
3166
|
+
}), lr = i.object({
|
|
3152
3167
|
created_at: i.string().transform((n) => n === null ? "" : n),
|
|
3153
3168
|
updated_at: i.string().transform((n) => n === null ? "" : n),
|
|
3154
3169
|
id: i.string(),
|
|
3155
|
-
...
|
|
3170
|
+
...ur.shape
|
|
3156
3171
|
});
|
|
3157
3172
|
i.object({
|
|
3158
3173
|
logoUrl: i.string(),
|
|
@@ -3172,7 +3187,7 @@ i.object({
|
|
|
3172
3187
|
siteUrl: i.string().nullable(),
|
|
3173
3188
|
manageSubscriptionsUrl: i.string().optional()
|
|
3174
3189
|
});
|
|
3175
|
-
const
|
|
3190
|
+
const pr = i.object({
|
|
3176
3191
|
domain: i.string(),
|
|
3177
3192
|
dkim_private_key: i.string().optional(),
|
|
3178
3193
|
dkim_public_key: i.string().optional(),
|
|
@@ -3180,19 +3195,19 @@ const lr = i.object({
|
|
|
3180
3195
|
email_service: i.union([i.literal("mailgun"), i.literal("mailchannels")]).optional()
|
|
3181
3196
|
});
|
|
3182
3197
|
i.object({
|
|
3183
|
-
...
|
|
3184
|
-
domains: i.array(
|
|
3185
|
-
tenant:
|
|
3186
|
-
connections: i.array(
|
|
3198
|
+
...or.shape,
|
|
3199
|
+
domains: i.array(pr),
|
|
3200
|
+
tenant: lr,
|
|
3201
|
+
connections: i.array(Rn)
|
|
3187
3202
|
});
|
|
3188
|
-
const
|
|
3203
|
+
const hr = i.enum([
|
|
3189
3204
|
"password_reset",
|
|
3190
3205
|
"email_verification",
|
|
3191
3206
|
"otp",
|
|
3192
3207
|
"authorization_code",
|
|
3193
3208
|
"oauth2_state",
|
|
3194
3209
|
"ticket"
|
|
3195
|
-
]),
|
|
3210
|
+
]), fr = i.object({
|
|
3196
3211
|
code_id: i.string().openapi({
|
|
3197
3212
|
description: "The code that will be used in for instance an email verification flow"
|
|
3198
3213
|
}),
|
|
@@ -3202,14 +3217,14 @@ const pr = i.enum([
|
|
|
3202
3217
|
connection_id: i.string().optional().openapi({
|
|
3203
3218
|
description: "The connection that the code is connected to"
|
|
3204
3219
|
}),
|
|
3205
|
-
code_type:
|
|
3220
|
+
code_type: hr,
|
|
3206
3221
|
expires_at: i.string(),
|
|
3207
3222
|
used_at: i.string().optional(),
|
|
3208
3223
|
user_id: i.string().optional()
|
|
3209
|
-
}), fr = i.object({
|
|
3210
|
-
...hr.shape,
|
|
3211
|
-
created_at: i.string()
|
|
3212
3224
|
}), mr = i.object({
|
|
3225
|
+
...fr.shape,
|
|
3226
|
+
created_at: i.string()
|
|
3227
|
+
}), _r = i.object({
|
|
3213
3228
|
domain: i.string(),
|
|
3214
3229
|
dkim_private_key: i.string().optional(),
|
|
3215
3230
|
dkim_public_key: i.string().optional(),
|
|
@@ -3217,10 +3232,10 @@ const pr = i.enum([
|
|
|
3217
3232
|
email_service: i.enum(["mailgun", "mailchannels"])
|
|
3218
3233
|
});
|
|
3219
3234
|
dn.extend({
|
|
3220
|
-
...
|
|
3235
|
+
..._r.shape,
|
|
3221
3236
|
id: i.string()
|
|
3222
3237
|
});
|
|
3223
|
-
const
|
|
3238
|
+
const gr = i.object({
|
|
3224
3239
|
trigger_id: i.enum([
|
|
3225
3240
|
"pre-user-signup",
|
|
3226
3241
|
"post-user-registration",
|
|
@@ -3232,11 +3247,11 @@ const _r = i.object({
|
|
|
3232
3247
|
synchronous: i.boolean().default(!1),
|
|
3233
3248
|
priority: i.number().optional()
|
|
3234
3249
|
});
|
|
3235
|
-
|
|
3250
|
+
gr.extend({
|
|
3236
3251
|
...dn.shape,
|
|
3237
3252
|
hook_id: i.string()
|
|
3238
3253
|
});
|
|
3239
|
-
const
|
|
3254
|
+
const yr = i.object({
|
|
3240
3255
|
alg: i.enum([
|
|
3241
3256
|
"RS256",
|
|
3242
3257
|
"RS384",
|
|
@@ -3257,7 +3272,7 @@ const gr = i.object({
|
|
|
3257
3272
|
use: i.enum(["sig", "enc"]).optional()
|
|
3258
3273
|
});
|
|
3259
3274
|
i.object({
|
|
3260
|
-
keys: i.array(
|
|
3275
|
+
keys: i.array(yr)
|
|
3261
3276
|
});
|
|
3262
3277
|
i.object({
|
|
3263
3278
|
issuer: i.string(),
|
|
@@ -3281,22 +3296,22 @@ i.object({
|
|
|
3281
3296
|
request_parameter_supported: i.boolean(),
|
|
3282
3297
|
token_endpoint_auth_signing_alg_values_supported: i.array(i.string())
|
|
3283
3298
|
});
|
|
3284
|
-
const
|
|
3299
|
+
const vr = i.object({
|
|
3285
3300
|
auth0Client: i.string().optional(),
|
|
3286
|
-
authParams:
|
|
3301
|
+
authParams: cr,
|
|
3287
3302
|
expires_at: i.string(),
|
|
3288
3303
|
deleted_at: i.string().optional(),
|
|
3289
3304
|
ip: i.string().optional()
|
|
3290
3305
|
}).openapi({
|
|
3291
3306
|
description: "This represents a login sesion"
|
|
3292
|
-
}),
|
|
3293
|
-
...
|
|
3307
|
+
}), wr = i.object({
|
|
3308
|
+
...vr.shape,
|
|
3294
3309
|
login_id: i.string().openapi({
|
|
3295
3310
|
description: "This is is used as the state in the universal login"
|
|
3296
3311
|
}),
|
|
3297
3312
|
created_at: i.string(),
|
|
3298
3313
|
updated_at: i.string()
|
|
3299
|
-
}),
|
|
3314
|
+
}), br = i.enum([
|
|
3300
3315
|
"cls",
|
|
3301
3316
|
// CODE_LINK_SENT
|
|
3302
3317
|
"fsa",
|
|
@@ -3353,7 +3368,7 @@ const yr = i.object({
|
|
|
3353
3368
|
}).optional()
|
|
3354
3369
|
});
|
|
3355
3370
|
i.object({
|
|
3356
|
-
type:
|
|
3371
|
+
type: br,
|
|
3357
3372
|
date: i.string(),
|
|
3358
3373
|
description: i.string().optional(),
|
|
3359
3374
|
log_id: i.string().optional(),
|
|
@@ -3376,17 +3391,17 @@ i.object({
|
|
|
3376
3391
|
hostname: i.string().optional(),
|
|
3377
3392
|
auth0_client: kr.optional()
|
|
3378
3393
|
});
|
|
3379
|
-
const
|
|
3394
|
+
const xr = i.object({
|
|
3380
3395
|
user_id: i.string(),
|
|
3381
3396
|
password: i.string(),
|
|
3382
3397
|
algorithm: i.enum(["bcrypt", "argon2id"]).default("argon2id")
|
|
3383
3398
|
});
|
|
3384
3399
|
i.object({
|
|
3385
|
-
...
|
|
3400
|
+
...xr.shape,
|
|
3386
3401
|
created_at: i.string(),
|
|
3387
3402
|
updated_at: i.string()
|
|
3388
3403
|
});
|
|
3389
|
-
const
|
|
3404
|
+
const Tr = i.object({
|
|
3390
3405
|
session_id: i.string(),
|
|
3391
3406
|
client_id: i.string(),
|
|
3392
3407
|
expires_at: i.string(),
|
|
@@ -3396,7 +3411,7 @@ const xr = i.object({
|
|
|
3396
3411
|
});
|
|
3397
3412
|
i.object({
|
|
3398
3413
|
created_at: i.string(),
|
|
3399
|
-
...
|
|
3414
|
+
...Tr.shape
|
|
3400
3415
|
});
|
|
3401
3416
|
i.object({
|
|
3402
3417
|
kid: i.string().openapi({ description: "The key id of the signing key" }),
|
|
@@ -3418,8 +3433,8 @@ i.object({
|
|
|
3418
3433
|
revoked: i.boolean().optional().openapi({ description: "True if the key is revoked" }),
|
|
3419
3434
|
revoked_at: i.string().optional().openapi({ description: "The date and time when the key was revoked" })
|
|
3420
3435
|
});
|
|
3421
|
-
var
|
|
3422
|
-
const un = i.nativeEnum(
|
|
3436
|
+
var $n = /* @__PURE__ */ ((n) => (n.RefreshToken = "refresh_token", n.AuthorizationCode = "authorization_code", n.ClientCredential = "client_credentials", n.Passwordless = "passwordless", n.Password = "password", n))($n || {});
|
|
3437
|
+
const un = i.nativeEnum($n);
|
|
3423
3438
|
i.object({
|
|
3424
3439
|
grant_type: un.refine(
|
|
3425
3440
|
(n) => n === "authorization_code"
|
|
@@ -3462,7 +3477,7 @@ i.object({
|
|
|
3462
3477
|
code: i.string(),
|
|
3463
3478
|
state: i.string().optional()
|
|
3464
3479
|
});
|
|
3465
|
-
const
|
|
3480
|
+
const Or = i.object({
|
|
3466
3481
|
button_border_radius: i.number(),
|
|
3467
3482
|
button_border_weight: i.number(),
|
|
3468
3483
|
buttons_style: i.enum(["pill"]),
|
|
@@ -3472,7 +3487,7 @@ const Tr = i.object({
|
|
|
3472
3487
|
show_widget_shadow: i.boolean(),
|
|
3473
3488
|
widget_border_weight: i.number(),
|
|
3474
3489
|
widget_corner_radius: i.number()
|
|
3475
|
-
}),
|
|
3490
|
+
}), Sr = i.object({
|
|
3476
3491
|
base_focus_color: i.string(),
|
|
3477
3492
|
base_hover_color: i.string(),
|
|
3478
3493
|
body_text: i.string(),
|
|
@@ -3492,47 +3507,53 @@ const Tr = i.object({
|
|
|
3492
3507
|
success: i.string(),
|
|
3493
3508
|
widget_background: i.string(),
|
|
3494
3509
|
widget_border: i.string()
|
|
3495
|
-
}),
|
|
3510
|
+
}), Me = i.object({
|
|
3496
3511
|
bold: i.boolean(),
|
|
3497
3512
|
size: i.number()
|
|
3498
|
-
}),
|
|
3499
|
-
body_text:
|
|
3500
|
-
buttons_text:
|
|
3513
|
+
}), Zr = i.object({
|
|
3514
|
+
body_text: Me,
|
|
3515
|
+
buttons_text: Me,
|
|
3501
3516
|
font_url: i.string(),
|
|
3502
|
-
input_labels:
|
|
3503
|
-
links:
|
|
3517
|
+
input_labels: Me,
|
|
3518
|
+
links: Me,
|
|
3504
3519
|
links_style: i.enum(["normal"]),
|
|
3505
3520
|
reference_text_size: i.number(),
|
|
3506
|
-
subtitle:
|
|
3507
|
-
title:
|
|
3508
|
-
}),
|
|
3521
|
+
subtitle: Me,
|
|
3522
|
+
title: Me
|
|
3523
|
+
}), jr = i.object({
|
|
3509
3524
|
background_color: i.string(),
|
|
3510
3525
|
background_image_url: i.string(),
|
|
3511
3526
|
page_layout: i.enum(["center"])
|
|
3512
|
-
}),
|
|
3527
|
+
}), Nr = i.object({
|
|
3513
3528
|
header_text_alignment: i.enum(["center"]),
|
|
3514
3529
|
logo_height: i.number(),
|
|
3515
3530
|
logo_position: i.enum(["center"]),
|
|
3516
3531
|
logo_url: i.string(),
|
|
3517
3532
|
social_buttons_layout: i.enum(["bottom"])
|
|
3518
|
-
}),
|
|
3519
|
-
borders:
|
|
3520
|
-
colors:
|
|
3533
|
+
}), Cr = i.object({
|
|
3534
|
+
borders: Or,
|
|
3535
|
+
colors: Sr,
|
|
3521
3536
|
displayName: i.string(),
|
|
3522
|
-
fonts:
|
|
3523
|
-
page_background:
|
|
3524
|
-
widget:
|
|
3537
|
+
fonts: Zr,
|
|
3538
|
+
page_background: jr,
|
|
3539
|
+
widget: Nr
|
|
3525
3540
|
});
|
|
3526
|
-
|
|
3541
|
+
Cr.extend({
|
|
3527
3542
|
themeId: i.string()
|
|
3528
3543
|
});
|
|
3544
|
+
i.object({
|
|
3545
|
+
universal_login_experience: i.enum(["new", "classic"]).default("new"),
|
|
3546
|
+
identifier_first: i.boolean().default(!0),
|
|
3547
|
+
password_first: i.boolean().default(!1),
|
|
3548
|
+
webauthn_platform_first_factor: i.boolean()
|
|
3549
|
+
});
|
|
3529
3550
|
function ln(n) {
|
|
3530
3551
|
const [e, t] = n.split("|");
|
|
3531
3552
|
if (!e || !t)
|
|
3532
3553
|
throw new Error(`Invalid user_id: ${n}`);
|
|
3533
3554
|
return { connection: e, id: t };
|
|
3534
3555
|
}
|
|
3535
|
-
function
|
|
3556
|
+
function Pn(n) {
|
|
3536
3557
|
let e = {};
|
|
3537
3558
|
try {
|
|
3538
3559
|
e = JSON.parse(n.profileData || "{}");
|
|
@@ -3551,7 +3572,7 @@ function $n(n) {
|
|
|
3551
3572
|
}
|
|
3552
3573
|
};
|
|
3553
3574
|
}
|
|
3554
|
-
function
|
|
3575
|
+
function Ir(n) {
|
|
3555
3576
|
return async (e, t) => {
|
|
3556
3577
|
const [s, r] = await Promise.all([
|
|
3557
3578
|
n.selectFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", t).selectAll().executeTakeFirst(),
|
|
@@ -3571,7 +3592,7 @@ function Cr(n) {
|
|
|
3571
3592
|
user_id: ln(s.user_id).id,
|
|
3572
3593
|
isSocial: !!s.is_social
|
|
3573
3594
|
},
|
|
3574
|
-
...r.map(
|
|
3595
|
+
...r.map(Pn)
|
|
3575
3596
|
]
|
|
3576
3597
|
};
|
|
3577
3598
|
return R(c);
|
|
@@ -3614,10 +3635,10 @@ function Ee(n, e, t, s) {
|
|
|
3614
3635
|
}
|
|
3615
3636
|
}), e;
|
|
3616
3637
|
}
|
|
3617
|
-
function
|
|
3638
|
+
function ke(n) {
|
|
3618
3639
|
return typeof n == "string" ? parseInt(n, 10) : typeof n == "bigint" ? Number(n) : n;
|
|
3619
3640
|
}
|
|
3620
|
-
function
|
|
3641
|
+
function Er(n) {
|
|
3621
3642
|
return async (e, t) => {
|
|
3622
3643
|
let s = n.selectFrom("users").where("users.tenant_id", "=", e);
|
|
3623
3644
|
if (t.q && (s = Ee(n, s, t.q, ["email", "name"])), t.sort && t.sort.sort_by) {
|
|
@@ -3639,7 +3660,7 @@ function Ir(n) {
|
|
|
3639
3660
|
user_id: ln(l.user_id).id,
|
|
3640
3661
|
isSocial: !!l.is_social
|
|
3641
3662
|
},
|
|
3642
|
-
...j.map(
|
|
3663
|
+
...j.map(Pn)
|
|
3643
3664
|
]
|
|
3644
3665
|
});
|
|
3645
3666
|
}), { count: u } = await s.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
@@ -3647,52 +3668,52 @@ function Ir(n) {
|
|
|
3647
3668
|
users: d,
|
|
3648
3669
|
start: t.page * t.per_page,
|
|
3649
3670
|
limit: t.per_page,
|
|
3650
|
-
length:
|
|
3671
|
+
length: ke(u)
|
|
3651
3672
|
};
|
|
3652
3673
|
};
|
|
3653
3674
|
}
|
|
3654
|
-
function
|
|
3675
|
+
function Ar(n) {
|
|
3655
3676
|
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
3677
|
}
|
|
3657
|
-
function
|
|
3678
|
+
function Rr(n) {
|
|
3658
3679
|
if (n.email_verified !== void 0)
|
|
3659
3680
|
return n.email_verified ? 1 : 0;
|
|
3660
3681
|
}
|
|
3661
|
-
function
|
|
3682
|
+
function $r(n) {
|
|
3662
3683
|
return async (e, t, s) => {
|
|
3663
3684
|
const r = {
|
|
3664
3685
|
...s,
|
|
3665
|
-
email_verified:
|
|
3686
|
+
email_verified: Rr(s),
|
|
3666
3687
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3667
3688
|
};
|
|
3668
3689
|
return (await n.updateTable("users").set(r).where("users.tenant_id", "=", e).where("users.user_id", "=", t).execute()).length === 1;
|
|
3669
3690
|
};
|
|
3670
3691
|
}
|
|
3671
|
-
function
|
|
3692
|
+
function Pr(n) {
|
|
3672
3693
|
return async (e, t, s, r) => {
|
|
3673
3694
|
const a = { linked_to: null };
|
|
3674
3695
|
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
3696
|
};
|
|
3676
3697
|
}
|
|
3677
|
-
function
|
|
3698
|
+
function Dr(n) {
|
|
3678
3699
|
return {
|
|
3679
|
-
create:
|
|
3680
|
-
remove:
|
|
3681
|
-
get:
|
|
3682
|
-
list:
|
|
3683
|
-
update:
|
|
3700
|
+
create: Qn(n),
|
|
3701
|
+
remove: Ar(n),
|
|
3702
|
+
get: Ir(n),
|
|
3703
|
+
list: Er(n),
|
|
3704
|
+
update: $r(n),
|
|
3684
3705
|
// TODO - think about this more when other issues fixed
|
|
3685
|
-
unlink:
|
|
3706
|
+
unlink: Pr(n)
|
|
3686
3707
|
};
|
|
3687
3708
|
}
|
|
3688
|
-
const
|
|
3709
|
+
const Mr = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
3689
3710
|
let Ae = (n = 21) => {
|
|
3690
3711
|
let e = "", t = crypto.getRandomValues(new Uint8Array(n));
|
|
3691
3712
|
for (; n--; )
|
|
3692
|
-
e +=
|
|
3713
|
+
e += Mr[t[n] & 63];
|
|
3693
3714
|
return e;
|
|
3694
3715
|
};
|
|
3695
|
-
function
|
|
3716
|
+
function Lr(n) {
|
|
3696
3717
|
return async (e) => {
|
|
3697
3718
|
const t = {
|
|
3698
3719
|
id: e.id || Ae(),
|
|
@@ -3703,13 +3724,13 @@ function Mr(n) {
|
|
|
3703
3724
|
return await n.insertInto("tenants").values(t).execute(), t;
|
|
3704
3725
|
};
|
|
3705
3726
|
}
|
|
3706
|
-
function
|
|
3727
|
+
function Vr(n) {
|
|
3707
3728
|
return async (e) => {
|
|
3708
3729
|
const t = await n.selectFrom("tenants").where("tenants.id", "=", e).selectAll().executeTakeFirst();
|
|
3709
3730
|
return t ? R(t) : null;
|
|
3710
3731
|
};
|
|
3711
3732
|
}
|
|
3712
|
-
function
|
|
3733
|
+
function Ur(n) {
|
|
3713
3734
|
return async (e) => {
|
|
3714
3735
|
let t = n.selectFrom("tenants");
|
|
3715
3736
|
if (e.sort && e.sort.sort_by) {
|
|
@@ -3722,7 +3743,7 @@ function Vr(n) {
|
|
|
3722
3743
|
return {
|
|
3723
3744
|
tenants: r
|
|
3724
3745
|
};
|
|
3725
|
-
const { count: a } = await t.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), o =
|
|
3746
|
+
const { count: a } = await t.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), o = ke(a);
|
|
3726
3747
|
return {
|
|
3727
3748
|
tenants: r.map(R),
|
|
3728
3749
|
start: (e.page - 1) * e.per_page,
|
|
@@ -3731,7 +3752,7 @@ function Vr(n) {
|
|
|
3731
3752
|
};
|
|
3732
3753
|
};
|
|
3733
3754
|
}
|
|
3734
|
-
function
|
|
3755
|
+
function Fr(n) {
|
|
3735
3756
|
return async (e, t) => {
|
|
3736
3757
|
const s = {
|
|
3737
3758
|
...t,
|
|
@@ -3741,29 +3762,29 @@ function Ur(n) {
|
|
|
3741
3762
|
await n.updateTable("tenants").set(s).where("id", "=", e).execute();
|
|
3742
3763
|
};
|
|
3743
3764
|
}
|
|
3744
|
-
function
|
|
3765
|
+
function zr(n) {
|
|
3745
3766
|
return async (e) => (await n.deleteFrom("tenants").where("tenants.id", "=", e).execute()).length === 1;
|
|
3746
3767
|
}
|
|
3747
|
-
function
|
|
3768
|
+
function Br(n) {
|
|
3748
3769
|
return {
|
|
3749
|
-
create:
|
|
3750
|
-
get:
|
|
3751
|
-
list:
|
|
3752
|
-
update:
|
|
3753
|
-
remove:
|
|
3770
|
+
create: Lr(n),
|
|
3771
|
+
get: Vr(n),
|
|
3772
|
+
list: Ur(n),
|
|
3773
|
+
update: Fr(n),
|
|
3774
|
+
remove: zr(n)
|
|
3754
3775
|
};
|
|
3755
3776
|
}
|
|
3756
|
-
function
|
|
3777
|
+
function _n(n) {
|
|
3757
3778
|
return n ? JSON.stringify(n) : void 0;
|
|
3758
3779
|
}
|
|
3759
|
-
const
|
|
3760
|
-
function
|
|
3780
|
+
const Wr = 1024;
|
|
3781
|
+
function qr(n) {
|
|
3761
3782
|
return async (e, t) => {
|
|
3762
3783
|
var r, a, o;
|
|
3763
3784
|
const s = {
|
|
3764
3785
|
id: Ae(),
|
|
3765
3786
|
...t,
|
|
3766
|
-
user_agent: t.user_agent.slice(0,
|
|
3787
|
+
user_agent: t.user_agent.slice(0, Wr)
|
|
3767
3788
|
};
|
|
3768
3789
|
return await n.insertInto("logs").values({
|
|
3769
3790
|
...s,
|
|
@@ -3772,12 +3793,12 @@ function Wr(n) {
|
|
|
3772
3793
|
isMobile: t.isMobile ? 1 : 0,
|
|
3773
3794
|
tenant_id: e,
|
|
3774
3795
|
scope: (a = t.scope) == null ? void 0 : a.join(","),
|
|
3775
|
-
auth0_client:
|
|
3776
|
-
details: (o =
|
|
3796
|
+
auth0_client: _n(t.auth0_client),
|
|
3797
|
+
details: (o = _n(t.details)) == null ? void 0 : o.substring(0, 8192)
|
|
3777
3798
|
}).execute(), s;
|
|
3778
3799
|
};
|
|
3779
3800
|
}
|
|
3780
|
-
function
|
|
3801
|
+
function gn(n) {
|
|
3781
3802
|
if (!n)
|
|
3782
3803
|
return "";
|
|
3783
3804
|
try {
|
|
@@ -3786,20 +3807,20 @@ function _n(n) {
|
|
|
3786
3807
|
return n;
|
|
3787
3808
|
}
|
|
3788
3809
|
}
|
|
3789
|
-
function
|
|
3810
|
+
function Dn(n) {
|
|
3790
3811
|
return {
|
|
3791
3812
|
...n,
|
|
3792
3813
|
client_id: n.client_id,
|
|
3793
3814
|
client_name: "",
|
|
3794
|
-
auth0_client:
|
|
3795
|
-
details:
|
|
3815
|
+
auth0_client: gn(n.auth0_client),
|
|
3816
|
+
details: gn(n.details),
|
|
3796
3817
|
isMobile: !!n.isMobile,
|
|
3797
3818
|
scope: n.scope ? n.scope.split(",") : void 0,
|
|
3798
3819
|
log_id: n.id,
|
|
3799
3820
|
_id: n.id
|
|
3800
3821
|
};
|
|
3801
3822
|
}
|
|
3802
|
-
function
|
|
3823
|
+
function Jr(n) {
|
|
3803
3824
|
return async (e, t) => {
|
|
3804
3825
|
let s = n.selectFrom("logs").where("logs.tenant_id", "=", e);
|
|
3805
3826
|
t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
|
|
@@ -3814,30 +3835,30 @@ function qr(n) {
|
|
|
3814
3835
|
r = r.offset(t.page * t.per_page).limit(t.per_page);
|
|
3815
3836
|
const a = await r.selectAll().execute(), { count: o } = await s.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
3816
3837
|
return {
|
|
3817
|
-
logs: a.map(
|
|
3838
|
+
logs: a.map(Dn),
|
|
3818
3839
|
start: t.page * t.per_page,
|
|
3819
3840
|
limit: t.per_page,
|
|
3820
|
-
length:
|
|
3841
|
+
length: ke(o)
|
|
3821
3842
|
};
|
|
3822
3843
|
};
|
|
3823
3844
|
}
|
|
3824
|
-
function
|
|
3845
|
+
function Kr(n) {
|
|
3825
3846
|
return async (e, t) => {
|
|
3826
3847
|
const s = await n.selectFrom("logs").where("logs.tenant_id", "=", e).where("logs.id", "=", t).selectAll().executeTakeFirst();
|
|
3827
|
-
return s ?
|
|
3848
|
+
return s ? Dn(s) : null;
|
|
3828
3849
|
};
|
|
3829
3850
|
}
|
|
3830
|
-
function
|
|
3851
|
+
function Hr(n) {
|
|
3831
3852
|
return {
|
|
3832
|
-
create:
|
|
3833
|
-
list:
|
|
3834
|
-
get:
|
|
3853
|
+
create: qr(n),
|
|
3854
|
+
list: Jr(n),
|
|
3855
|
+
get: Kr(n)
|
|
3835
3856
|
};
|
|
3836
3857
|
}
|
|
3837
|
-
function
|
|
3858
|
+
function Qr(n) {
|
|
3838
3859
|
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
3860
|
}
|
|
3840
|
-
function
|
|
3861
|
+
function Yr(n) {
|
|
3841
3862
|
return async (e, t) => {
|
|
3842
3863
|
const s = {
|
|
3843
3864
|
...t,
|
|
@@ -3847,13 +3868,13 @@ function Qr(n) {
|
|
|
3847
3868
|
return await n.insertInto("sessions").values({ ...s, tenant_id: e }).execute(), { ...t, ...s };
|
|
3848
3869
|
};
|
|
3849
3870
|
}
|
|
3850
|
-
function
|
|
3871
|
+
function Gr(n) {
|
|
3851
3872
|
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
3873
|
}
|
|
3853
|
-
function
|
|
3874
|
+
function Xr(n) {
|
|
3854
3875
|
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
3876
|
}
|
|
3856
|
-
function
|
|
3877
|
+
function ea(n) {
|
|
3857
3878
|
return async (e, t) => {
|
|
3858
3879
|
let s = n.selectFrom("sessions").where("sessions.tenant_id", "=", e);
|
|
3859
3880
|
t.q && (s = Ee(n, s, t.q, ["user_id", "session_id"]));
|
|
@@ -3866,7 +3887,7 @@ function Xr(n) {
|
|
|
3866
3887
|
);
|
|
3867
3888
|
}
|
|
3868
3889
|
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 =
|
|
3890
|
+
const a = await r.selectAll().execute(), { count: o } = await s.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), c = ke(o);
|
|
3870
3891
|
return {
|
|
3871
3892
|
sessions: a,
|
|
3872
3893
|
start: t.page * t.per_page,
|
|
@@ -3875,16 +3896,16 @@ function Xr(n) {
|
|
|
3875
3896
|
};
|
|
3876
3897
|
};
|
|
3877
3898
|
}
|
|
3878
|
-
function
|
|
3899
|
+
function ta(n) {
|
|
3879
3900
|
return {
|
|
3880
|
-
create:
|
|
3881
|
-
get:
|
|
3882
|
-
list:
|
|
3883
|
-
remove:
|
|
3884
|
-
update:
|
|
3901
|
+
create: Yr(n),
|
|
3902
|
+
get: Qr(n),
|
|
3903
|
+
list: ea(n),
|
|
3904
|
+
remove: Gr(n),
|
|
3905
|
+
update: Xr(n)
|
|
3885
3906
|
};
|
|
3886
3907
|
}
|
|
3887
|
-
function
|
|
3908
|
+
function na(n) {
|
|
3888
3909
|
return async (e, t) => {
|
|
3889
3910
|
const s = await n.selectFrom("tickets").where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).where("tickets.used_at", "is", null).selectAll().executeTakeFirst();
|
|
3890
3911
|
if (!s)
|
|
@@ -3914,7 +3935,7 @@ function ta(n) {
|
|
|
3914
3935
|
};
|
|
3915
3936
|
};
|
|
3916
3937
|
}
|
|
3917
|
-
function
|
|
3938
|
+
function sa(n) {
|
|
3918
3939
|
return async (e) => {
|
|
3919
3940
|
const { authParams: t, ...s } = e, r = {
|
|
3920
3941
|
...s,
|
|
@@ -3926,27 +3947,27 @@ function na(n) {
|
|
|
3926
3947
|
await n.insertInto("tickets").values(r).execute();
|
|
3927
3948
|
};
|
|
3928
3949
|
}
|
|
3929
|
-
function
|
|
3950
|
+
function ra(n) {
|
|
3930
3951
|
return async (e, t) => {
|
|
3931
3952
|
await n.updateTable("tickets").set({
|
|
3932
3953
|
used_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3933
3954
|
}).where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).execute();
|
|
3934
3955
|
};
|
|
3935
3956
|
}
|
|
3936
|
-
function
|
|
3957
|
+
function aa(n) {
|
|
3937
3958
|
return {
|
|
3938
|
-
create:
|
|
3939
|
-
get:
|
|
3940
|
-
remove:
|
|
3959
|
+
create: sa(n),
|
|
3960
|
+
get: na(n),
|
|
3961
|
+
remove: ra(n)
|
|
3941
3962
|
};
|
|
3942
3963
|
}
|
|
3943
|
-
function
|
|
3964
|
+
function ia(n) {
|
|
3944
3965
|
return async (e, t) => {
|
|
3945
3966
|
const s = await n.selectFrom("passwords").where("passwords.tenant_id", "=", e).where("passwords.user_id", "=", t).selectAll().executeTakeFirstOrThrow(), { tenant_id: r, ...a } = s;
|
|
3946
3967
|
return a;
|
|
3947
3968
|
};
|
|
3948
3969
|
}
|
|
3949
|
-
function
|
|
3970
|
+
function oa(n) {
|
|
3950
3971
|
return async (e, t) => {
|
|
3951
3972
|
const s = {
|
|
3952
3973
|
...t,
|
|
@@ -3959,20 +3980,20 @@ function ia(n) {
|
|
|
3959
3980
|
}).execute(), s;
|
|
3960
3981
|
};
|
|
3961
3982
|
}
|
|
3962
|
-
function
|
|
3983
|
+
function ca(n) {
|
|
3963
3984
|
return async (e, t) => (await n.updateTable("passwords").set({
|
|
3964
3985
|
password: t.password,
|
|
3965
3986
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3966
3987
|
}).where("tenant_id", "=", e).where("user_id", "=", t.user_id).execute()).length === 1;
|
|
3967
3988
|
}
|
|
3968
|
-
function
|
|
3989
|
+
function da(n) {
|
|
3969
3990
|
return {
|
|
3970
|
-
create:
|
|
3971
|
-
update:
|
|
3972
|
-
get:
|
|
3991
|
+
create: oa(n),
|
|
3992
|
+
update: ca(n),
|
|
3993
|
+
get: ia(n)
|
|
3973
3994
|
};
|
|
3974
3995
|
}
|
|
3975
|
-
function
|
|
3996
|
+
function ua(n) {
|
|
3976
3997
|
return async (e, t) => {
|
|
3977
3998
|
let s = n.selectFrom("codes").where("codes.tenant_id", "=", e);
|
|
3978
3999
|
t.q && (s = Ee(n, s, t.q, ["code", "login_id"]));
|
|
@@ -3980,15 +4001,15 @@ function da(n) {
|
|
|
3980
4001
|
return {
|
|
3981
4002
|
codes: a.map((d) => {
|
|
3982
4003
|
const { tenant_id: u, ...l } = d;
|
|
3983
|
-
return
|
|
4004
|
+
return mr.parse(R(l));
|
|
3984
4005
|
}),
|
|
3985
4006
|
start: t.page * t.per_page,
|
|
3986
4007
|
limit: t.per_page,
|
|
3987
|
-
length:
|
|
4008
|
+
length: ke(o)
|
|
3988
4009
|
};
|
|
3989
4010
|
};
|
|
3990
4011
|
}
|
|
3991
|
-
function
|
|
4012
|
+
function la(n) {
|
|
3992
4013
|
return async (e, t) => {
|
|
3993
4014
|
const s = {
|
|
3994
4015
|
...t,
|
|
@@ -4000,10 +4021,10 @@ function ua(n) {
|
|
|
4000
4021
|
}).execute(), s;
|
|
4001
4022
|
};
|
|
4002
4023
|
}
|
|
4003
|
-
function
|
|
4024
|
+
function pa(n) {
|
|
4004
4025
|
return async (e, t) => (await n.deleteFrom("codes").where("codes.tenant_id", "=", e).where("codes.code_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
4005
4026
|
}
|
|
4006
|
-
function
|
|
4027
|
+
function ha(n) {
|
|
4007
4028
|
return async (e, t, s) => {
|
|
4008
4029
|
let r = n.selectFrom("codes").where("codes.code_id", "=", t).where("codes.code_type", "=", s).where("codes.expires_at", ">", (/* @__PURE__ */ new Date()).toISOString());
|
|
4009
4030
|
e.length && (r = r.where("codes.tenant_id", "=", e));
|
|
@@ -4011,15 +4032,15 @@ function pa(n) {
|
|
|
4011
4032
|
return a ? R(a) : null;
|
|
4012
4033
|
};
|
|
4013
4034
|
}
|
|
4014
|
-
function
|
|
4035
|
+
function fa(n) {
|
|
4015
4036
|
return {
|
|
4016
|
-
create:
|
|
4017
|
-
list:
|
|
4018
|
-
remove:
|
|
4019
|
-
get:
|
|
4037
|
+
create: la(n),
|
|
4038
|
+
list: ua(n),
|
|
4039
|
+
remove: pa(n),
|
|
4040
|
+
get: ha(n)
|
|
4020
4041
|
};
|
|
4021
4042
|
}
|
|
4022
|
-
function
|
|
4043
|
+
function ma(n) {
|
|
4023
4044
|
return async (e, t) => {
|
|
4024
4045
|
const s = {
|
|
4025
4046
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -4038,7 +4059,7 @@ function fa(n) {
|
|
|
4038
4059
|
}).execute(), s;
|
|
4039
4060
|
};
|
|
4040
4061
|
}
|
|
4041
|
-
function
|
|
4062
|
+
function _a(n) {
|
|
4042
4063
|
return async (e) => ({
|
|
4043
4064
|
applications: (await n.selectFrom("applications").where("applications.tenant_id", "=", e).selectAll().execute()).map((a) => ({
|
|
4044
4065
|
...a,
|
|
@@ -4051,7 +4072,7 @@ function ma(n) {
|
|
|
4051
4072
|
}))
|
|
4052
4073
|
});
|
|
4053
4074
|
}
|
|
4054
|
-
function
|
|
4075
|
+
function ga(n) {
|
|
4055
4076
|
return async (e, t) => {
|
|
4056
4077
|
const s = await n.selectFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", t).selectAll().executeTakeFirst();
|
|
4057
4078
|
return s ? R({
|
|
@@ -4065,10 +4086,10 @@ function _a(n) {
|
|
|
4065
4086
|
}) : null;
|
|
4066
4087
|
};
|
|
4067
4088
|
}
|
|
4068
|
-
function
|
|
4089
|
+
function ya(n) {
|
|
4069
4090
|
return async (e, t) => (await n.deleteFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
4070
4091
|
}
|
|
4071
|
-
function
|
|
4092
|
+
function va(n) {
|
|
4072
4093
|
return async (e, t, s) => {
|
|
4073
4094
|
const r = {
|
|
4074
4095
|
...s,
|
|
@@ -4083,322 +4104,69 @@ function ya(n) {
|
|
|
4083
4104
|
return await n.updateTable("applications").set(r).where("applications.id", "=", t).where("applications.tenant_id", "=", e).execute(), !0;
|
|
4084
4105
|
};
|
|
4085
4106
|
}
|
|
4086
|
-
function
|
|
4107
|
+
function wa(n) {
|
|
4087
4108
|
return {
|
|
4088
|
-
create:
|
|
4089
|
-
list:
|
|
4090
|
-
get:
|
|
4091
|
-
remove:
|
|
4092
|
-
update:
|
|
4109
|
+
create: ma(n),
|
|
4110
|
+
list: _a(n),
|
|
4111
|
+
get: ga(n),
|
|
4112
|
+
remove: ya(n),
|
|
4113
|
+
update: va(n)
|
|
4093
4114
|
};
|
|
4094
4115
|
}
|
|
4095
|
-
function
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
};
|
|
4103
|
-
return await n.insertInto("connections").values({ ...s, tenant_id: e }).execute(), s;
|
|
4104
|
-
};
|
|
4116
|
+
function ba(n, e) {
|
|
4117
|
+
var t = {};
|
|
4118
|
+
for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && e.indexOf(s) < 0 && (t[s] = n[s]);
|
|
4119
|
+
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
4120
|
+
for (var r = 0, s = Object.getOwnPropertySymbols(n); r < s.length; r++)
|
|
4121
|
+
e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, s[r]) && (t[s[r]] = n[s[r]]);
|
|
4122
|
+
return t;
|
|
4105
4123
|
}
|
|
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
|
-
};
|
|
4124
|
+
function ka(n, e) {
|
|
4125
|
+
var t;
|
|
4126
|
+
return ((t = n == null ? void 0 : n._def) === null || t === void 0 ? void 0 : t.typeName) === e;
|
|
4118
4127
|
}
|
|
4119
|
-
function
|
|
4120
|
-
|
|
4128
|
+
function Ye(n, e) {
|
|
4129
|
+
const t = n.ZodType.prototype[e];
|
|
4130
|
+
n.ZodType.prototype[e] = function(...s) {
|
|
4131
|
+
const r = t.apply(this, s);
|
|
4132
|
+
return r._def.openapi = this._def.openapi, r;
|
|
4133
|
+
};
|
|
4121
4134
|
}
|
|
4122
4135
|
function xa(n) {
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4136
|
+
if (typeof n.ZodType.prototype.openapi < "u")
|
|
4137
|
+
return;
|
|
4138
|
+
n.ZodType.prototype.openapi = function(r, a) {
|
|
4139
|
+
var o, c, d, u, l, j;
|
|
4140
|
+
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 ? {
|
|
4141
|
+
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)
|
|
4142
|
+
} : 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) }));
|
|
4143
|
+
if (ka(this, "ZodObject")) {
|
|
4144
|
+
const Pe = this.extend;
|
|
4145
|
+
de.extend = function(...De) {
|
|
4146
|
+
var K, H, Q, ue, xe, Te;
|
|
4147
|
+
const Oe = Pe.apply(this, De);
|
|
4148
|
+
return Oe._def.openapi = {
|
|
4149
|
+
_internal: {
|
|
4150
|
+
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
|
|
4151
|
+
},
|
|
4152
|
+
metadata: (Te = Oe._def.openapi) === null || Te === void 0 ? void 0 : Te.metadata
|
|
4153
|
+
}, Oe;
|
|
4154
|
+
};
|
|
4155
|
+
}
|
|
4156
|
+
return de;
|
|
4157
|
+
}, Ye(n, "optional"), Ye(n, "nullable"), Ye(n, "default"), Ye(n, "transform"), Ye(n, "refine");
|
|
4158
|
+
const e = n.ZodObject.prototype.deepPartial;
|
|
4159
|
+
n.ZodObject.prototype.deepPartial = function() {
|
|
4160
|
+
const r = this._def.shape(), a = e.apply(this), o = a._def.shape();
|
|
4161
|
+
return Object.entries(o).forEach(([c, d]) => {
|
|
4162
|
+
var u, l;
|
|
4163
|
+
d._def.openapi = (l = (u = r[c]) === null || u === void 0 ? void 0 : u._def) === null || l === void 0 ? void 0 : l.openapi;
|
|
4164
|
+
}), a._def.openapi = void 0, a;
|
|
4126
4165
|
};
|
|
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;
|
|
4166
|
+
const t = n.ZodObject.prototype.pick;
|
|
4167
|
+
n.ZodObject.prototype.pick = function(...r) {
|
|
4168
|
+
const a = t.apply(this, r);
|
|
4169
|
+
return a._def.openapi = void 0, a;
|
|
4402
4170
|
};
|
|
4403
4171
|
const s = n.ZodObject.prototype.omit;
|
|
4404
4172
|
n.ZodObject.prototype.omit = function(...r) {
|
|
@@ -4510,7 +4278,7 @@ const g = C.arrayToEnum([
|
|
|
4510
4278
|
"invalid_intersection_types",
|
|
4511
4279
|
"not_multiple_of",
|
|
4512
4280
|
"not_finite"
|
|
4513
|
-
]),
|
|
4281
|
+
]), Ta = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
4514
4282
|
class V extends Error {
|
|
4515
4283
|
constructor(e) {
|
|
4516
4284
|
super(), this.issues = [], this.addIssue = (s) => {
|
|
@@ -4571,7 +4339,7 @@ class V extends Error {
|
|
|
4571
4339
|
}
|
|
4572
4340
|
}
|
|
4573
4341
|
V.create = (n) => new V(n);
|
|
4574
|
-
const
|
|
4342
|
+
const Je = (n, e) => {
|
|
4575
4343
|
let t;
|
|
4576
4344
|
switch (n.code) {
|
|
4577
4345
|
case h.invalid_type:
|
|
@@ -4627,12 +4395,12 @@ const qe = (n, e) => {
|
|
|
4627
4395
|
}
|
|
4628
4396
|
return { message: t };
|
|
4629
4397
|
};
|
|
4630
|
-
let
|
|
4631
|
-
function
|
|
4632
|
-
|
|
4398
|
+
let Mn = Je;
|
|
4399
|
+
function Oa(n) {
|
|
4400
|
+
Mn = n;
|
|
4633
4401
|
}
|
|
4634
4402
|
function Vt() {
|
|
4635
|
-
return
|
|
4403
|
+
return Mn;
|
|
4636
4404
|
}
|
|
4637
4405
|
const Ut = (n) => {
|
|
4638
4406
|
const { data: e, path: t, errorMaps: s, issueData: r } = n, a = [...t, ...r.path || []], o = {
|
|
@@ -4654,7 +4422,7 @@ const Ut = (n) => {
|
|
|
4654
4422
|
path: a,
|
|
4655
4423
|
message: c
|
|
4656
4424
|
};
|
|
4657
|
-
},
|
|
4425
|
+
}, Sa = [];
|
|
4658
4426
|
function m(n, e) {
|
|
4659
4427
|
const t = Vt(), s = Ut({
|
|
4660
4428
|
issueData: e,
|
|
@@ -4664,7 +4432,7 @@ function m(n, e) {
|
|
|
4664
4432
|
n.common.contextualErrorMap,
|
|
4665
4433
|
n.schemaErrorMap,
|
|
4666
4434
|
t,
|
|
4667
|
-
t ===
|
|
4435
|
+
t === Je ? void 0 : Je
|
|
4668
4436
|
// then global default map
|
|
4669
4437
|
].filter((r) => !!r)
|
|
4670
4438
|
});
|
|
@@ -4684,7 +4452,7 @@ class P {
|
|
|
4684
4452
|
const s = [];
|
|
4685
4453
|
for (const r of t) {
|
|
4686
4454
|
if (r.status === "aborted")
|
|
4687
|
-
return
|
|
4455
|
+
return k;
|
|
4688
4456
|
r.status === "dirty" && e.dirty(), s.push(r.value);
|
|
4689
4457
|
}
|
|
4690
4458
|
return { status: e.value, value: s };
|
|
@@ -4705,20 +4473,20 @@ class P {
|
|
|
4705
4473
|
for (const r of t) {
|
|
4706
4474
|
const { key: a, value: o } = r;
|
|
4707
4475
|
if (a.status === "aborted" || o.status === "aborted")
|
|
4708
|
-
return
|
|
4476
|
+
return k;
|
|
4709
4477
|
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
4478
|
}
|
|
4711
4479
|
return { status: e.value, value: s };
|
|
4712
4480
|
}
|
|
4713
4481
|
}
|
|
4714
|
-
const
|
|
4482
|
+
const k = Object.freeze({
|
|
4715
4483
|
status: "aborted"
|
|
4716
|
-
}),
|
|
4484
|
+
}), 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
4485
|
function Ft(n, e, t, s) {
|
|
4718
4486
|
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
4487
|
return e.get(n);
|
|
4720
4488
|
}
|
|
4721
|
-
function
|
|
4489
|
+
function Ln(n, e, t, s, r) {
|
|
4722
4490
|
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
4491
|
return e.set(n, t), t;
|
|
4724
4492
|
}
|
|
@@ -4726,7 +4494,7 @@ var v;
|
|
|
4726
4494
|
(function(n) {
|
|
4727
4495
|
n.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, n.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
4728
4496
|
})(v || (v = {}));
|
|
4729
|
-
var
|
|
4497
|
+
var et, tt;
|
|
4730
4498
|
class te {
|
|
4731
4499
|
constructor(e, t, s, r) {
|
|
4732
4500
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = r;
|
|
@@ -4735,8 +4503,8 @@ class te {
|
|
|
4735
4503
|
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
4504
|
}
|
|
4737
4505
|
}
|
|
4738
|
-
const
|
|
4739
|
-
if (
|
|
4506
|
+
const yn = (n, e) => {
|
|
4507
|
+
if (_t(e))
|
|
4740
4508
|
return { success: !0, data: e.value };
|
|
4741
4509
|
if (!n.common.issues.length)
|
|
4742
4510
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -4797,7 +4565,7 @@ class Z {
|
|
|
4797
4565
|
}
|
|
4798
4566
|
_parseSync(e) {
|
|
4799
4567
|
const t = this._parse(e);
|
|
4800
|
-
if (
|
|
4568
|
+
if (gt(t))
|
|
4801
4569
|
throw new Error("Synchronous parse encountered promise.");
|
|
4802
4570
|
return t;
|
|
4803
4571
|
}
|
|
@@ -4825,7 +4593,7 @@ class Z {
|
|
|
4825
4593
|
data: e,
|
|
4826
4594
|
parsedType: he(e)
|
|
4827
4595
|
}, a = this._parseSync({ data: e, path: r.path, parent: r });
|
|
4828
|
-
return
|
|
4596
|
+
return yn(r, a);
|
|
4829
4597
|
}
|
|
4830
4598
|
async parseAsync(e, t) {
|
|
4831
4599
|
const s = await this.safeParseAsync(e, t);
|
|
@@ -4845,8 +4613,8 @@ class Z {
|
|
|
4845
4613
|
parent: null,
|
|
4846
4614
|
data: e,
|
|
4847
4615
|
parsedType: he(e)
|
|
4848
|
-
}, r = this._parse({ data: e, path: s.path, parent: s }), a = await (
|
|
4849
|
-
return
|
|
4616
|
+
}, r = this._parse({ data: e, path: s.path, parent: s }), a = await (gt(r) ? r : Promise.resolve(r));
|
|
4617
|
+
return yn(s, a);
|
|
4850
4618
|
}
|
|
4851
4619
|
refine(e, t) {
|
|
4852
4620
|
const s = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
|
|
@@ -4864,7 +4632,7 @@ class Z {
|
|
|
4864
4632
|
_refinement(e) {
|
|
4865
4633
|
return new J({
|
|
4866
4634
|
schema: this,
|
|
4867
|
-
typeName:
|
|
4635
|
+
typeName: b.ZodEffects,
|
|
4868
4636
|
effect: { type: "refinement", refinement: e }
|
|
4869
4637
|
});
|
|
4870
4638
|
}
|
|
@@ -4875,7 +4643,7 @@ class Z {
|
|
|
4875
4643
|
return G.create(this, this._def);
|
|
4876
4644
|
}
|
|
4877
4645
|
nullable() {
|
|
4878
|
-
return
|
|
4646
|
+
return be.create(this, this._def);
|
|
4879
4647
|
}
|
|
4880
4648
|
nullish() {
|
|
4881
4649
|
return this.nullable().optional();
|
|
@@ -4884,10 +4652,10 @@ class Z {
|
|
|
4884
4652
|
return W.create(this, this._def);
|
|
4885
4653
|
}
|
|
4886
4654
|
promise() {
|
|
4887
|
-
return
|
|
4655
|
+
return He.create(this, this._def);
|
|
4888
4656
|
}
|
|
4889
4657
|
or(e) {
|
|
4890
|
-
return
|
|
4658
|
+
return bt.create([this, e], this._def);
|
|
4891
4659
|
}
|
|
4892
4660
|
and(e) {
|
|
4893
4661
|
return kt.create(this, e, this._def);
|
|
@@ -4896,33 +4664,33 @@ class Z {
|
|
|
4896
4664
|
return new J({
|
|
4897
4665
|
...O(this._def),
|
|
4898
4666
|
schema: this,
|
|
4899
|
-
typeName:
|
|
4667
|
+
typeName: b.ZodEffects,
|
|
4900
4668
|
effect: { type: "transform", transform: e }
|
|
4901
4669
|
});
|
|
4902
4670
|
}
|
|
4903
4671
|
default(e) {
|
|
4904
4672
|
const t = typeof e == "function" ? e : () => e;
|
|
4905
|
-
return new
|
|
4673
|
+
return new Zt({
|
|
4906
4674
|
...O(this._def),
|
|
4907
4675
|
innerType: this,
|
|
4908
4676
|
defaultValue: t,
|
|
4909
|
-
typeName:
|
|
4677
|
+
typeName: b.ZodDefault
|
|
4910
4678
|
});
|
|
4911
4679
|
}
|
|
4912
4680
|
brand() {
|
|
4913
4681
|
return new pn({
|
|
4914
|
-
typeName:
|
|
4682
|
+
typeName: b.ZodBranded,
|
|
4915
4683
|
type: this,
|
|
4916
4684
|
...O(this._def)
|
|
4917
4685
|
});
|
|
4918
4686
|
}
|
|
4919
4687
|
catch(e) {
|
|
4920
4688
|
const t = typeof e == "function" ? e : () => e;
|
|
4921
|
-
return new
|
|
4689
|
+
return new jt({
|
|
4922
4690
|
...O(this._def),
|
|
4923
4691
|
innerType: this,
|
|
4924
4692
|
catchValue: t,
|
|
4925
|
-
typeName:
|
|
4693
|
+
typeName: b.ZodCatch
|
|
4926
4694
|
});
|
|
4927
4695
|
}
|
|
4928
4696
|
describe(e) {
|
|
@@ -4933,10 +4701,10 @@ class Z {
|
|
|
4933
4701
|
});
|
|
4934
4702
|
}
|
|
4935
4703
|
pipe(e) {
|
|
4936
|
-
return
|
|
4704
|
+
return It.create(this, e);
|
|
4937
4705
|
}
|
|
4938
4706
|
readonly() {
|
|
4939
|
-
return
|
|
4707
|
+
return Nt.create(this);
|
|
4940
4708
|
}
|
|
4941
4709
|
isOptional() {
|
|
4942
4710
|
return this.safeParse(void 0).success;
|
|
@@ -4945,23 +4713,23 @@ class Z {
|
|
|
4945
4713
|
return this.safeParse(null).success;
|
|
4946
4714
|
}
|
|
4947
4715
|
}
|
|
4948
|
-
const
|
|
4716
|
+
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
4717
|
let Yt;
|
|
4950
|
-
const
|
|
4951
|
-
function
|
|
4718
|
+
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}$`);
|
|
4719
|
+
function Un(n) {
|
|
4952
4720
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
4953
4721
|
return n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
4954
4722
|
}
|
|
4955
|
-
function
|
|
4956
|
-
return new RegExp(`^${
|
|
4723
|
+
function La(n) {
|
|
4724
|
+
return new RegExp(`^${Un(n)}$`);
|
|
4957
4725
|
}
|
|
4958
|
-
function
|
|
4959
|
-
let e = `${
|
|
4726
|
+
function Fn(n) {
|
|
4727
|
+
let e = `${Vn}T${Un(n)}`;
|
|
4960
4728
|
const t = [];
|
|
4961
4729
|
return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
4962
4730
|
}
|
|
4963
|
-
function
|
|
4964
|
-
return !!((e === "v4" || !e) &&
|
|
4731
|
+
function Va(n, e) {
|
|
4732
|
+
return !!((e === "v4" || !e) && $a.test(n) || (e === "v6" || !e) && Pa.test(n));
|
|
4965
4733
|
}
|
|
4966
4734
|
class z extends Z {
|
|
4967
4735
|
_parse(e) {
|
|
@@ -4971,7 +4739,7 @@ class z extends Z {
|
|
|
4971
4739
|
code: h.invalid_type,
|
|
4972
4740
|
expected: g.string,
|
|
4973
4741
|
received: a.parsedType
|
|
4974
|
-
}),
|
|
4742
|
+
}), k;
|
|
4975
4743
|
}
|
|
4976
4744
|
const s = new P();
|
|
4977
4745
|
let r;
|
|
@@ -5012,43 +4780,43 @@ class z extends Z {
|
|
|
5012
4780
|
message: a.message
|
|
5013
4781
|
}), s.dirty());
|
|
5014
4782
|
} else if (a.kind === "email")
|
|
5015
|
-
|
|
4783
|
+
Aa.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5016
4784
|
validation: "email",
|
|
5017
4785
|
code: h.invalid_string,
|
|
5018
4786
|
message: a.message
|
|
5019
4787
|
}), s.dirty());
|
|
5020
4788
|
else if (a.kind === "emoji")
|
|
5021
|
-
Yt || (Yt = new RegExp(
|
|
4789
|
+
Yt || (Yt = new RegExp(Ra, "u")), Yt.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5022
4790
|
validation: "emoji",
|
|
5023
4791
|
code: h.invalid_string,
|
|
5024
4792
|
message: a.message
|
|
5025
4793
|
}), s.dirty());
|
|
5026
4794
|
else if (a.kind === "uuid")
|
|
5027
|
-
|
|
4795
|
+
Ca.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5028
4796
|
validation: "uuid",
|
|
5029
4797
|
code: h.invalid_string,
|
|
5030
4798
|
message: a.message
|
|
5031
4799
|
}), s.dirty());
|
|
5032
4800
|
else if (a.kind === "nanoid")
|
|
5033
|
-
|
|
4801
|
+
Ia.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5034
4802
|
validation: "nanoid",
|
|
5035
4803
|
code: h.invalid_string,
|
|
5036
4804
|
message: a.message
|
|
5037
4805
|
}), s.dirty());
|
|
5038
4806
|
else if (a.kind === "cuid")
|
|
5039
|
-
|
|
4807
|
+
Za.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5040
4808
|
validation: "cuid",
|
|
5041
4809
|
code: h.invalid_string,
|
|
5042
4810
|
message: a.message
|
|
5043
4811
|
}), s.dirty());
|
|
5044
4812
|
else if (a.kind === "cuid2")
|
|
5045
|
-
|
|
4813
|
+
ja.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5046
4814
|
validation: "cuid2",
|
|
5047
4815
|
code: h.invalid_string,
|
|
5048
4816
|
message: a.message
|
|
5049
4817
|
}), s.dirty());
|
|
5050
4818
|
else if (a.kind === "ulid")
|
|
5051
|
-
|
|
4819
|
+
Na.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5052
4820
|
validation: "ulid",
|
|
5053
4821
|
code: h.invalid_string,
|
|
5054
4822
|
message: a.message
|
|
@@ -5079,27 +4847,27 @@ class z extends Z {
|
|
|
5079
4847
|
code: h.invalid_string,
|
|
5080
4848
|
validation: { endsWith: a.value },
|
|
5081
4849
|
message: a.message
|
|
5082
|
-
}), s.dirty()) : a.kind === "datetime" ?
|
|
4850
|
+
}), s.dirty()) : a.kind === "datetime" ? Fn(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5083
4851
|
code: h.invalid_string,
|
|
5084
4852
|
validation: "datetime",
|
|
5085
4853
|
message: a.message
|
|
5086
|
-
}), s.dirty()) : a.kind === "date" ?
|
|
4854
|
+
}), s.dirty()) : a.kind === "date" ? Ma.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5087
4855
|
code: h.invalid_string,
|
|
5088
4856
|
validation: "date",
|
|
5089
4857
|
message: a.message
|
|
5090
|
-
}), s.dirty()) : a.kind === "time" ?
|
|
4858
|
+
}), s.dirty()) : a.kind === "time" ? La(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5091
4859
|
code: h.invalid_string,
|
|
5092
4860
|
validation: "time",
|
|
5093
4861
|
message: a.message
|
|
5094
|
-
}), s.dirty()) : a.kind === "duration" ?
|
|
4862
|
+
}), s.dirty()) : a.kind === "duration" ? Ea.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5095
4863
|
validation: "duration",
|
|
5096
4864
|
code: h.invalid_string,
|
|
5097
4865
|
message: a.message
|
|
5098
|
-
}), s.dirty()) : a.kind === "ip" ?
|
|
4866
|
+
}), s.dirty()) : a.kind === "ip" ? Va(e.data, a.version) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5099
4867
|
validation: "ip",
|
|
5100
4868
|
code: h.invalid_string,
|
|
5101
4869
|
message: a.message
|
|
5102
|
-
}), s.dirty()) : a.kind === "base64" ?
|
|
4870
|
+
}), s.dirty()) : a.kind === "base64" ? Da.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5103
4871
|
validation: "base64",
|
|
5104
4872
|
code: h.invalid_string,
|
|
5105
4873
|
message: a.message
|
|
@@ -5316,12 +5084,12 @@ z.create = (n) => {
|
|
|
5316
5084
|
var e;
|
|
5317
5085
|
return new z({
|
|
5318
5086
|
checks: [],
|
|
5319
|
-
typeName:
|
|
5087
|
+
typeName: b.ZodString,
|
|
5320
5088
|
coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1,
|
|
5321
5089
|
...O(n)
|
|
5322
5090
|
});
|
|
5323
5091
|
};
|
|
5324
|
-
function
|
|
5092
|
+
function Ua(n, e) {
|
|
5325
5093
|
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
5094
|
return a % o / Math.pow(10, r);
|
|
5327
5095
|
}
|
|
@@ -5336,7 +5104,7 @@ class ye extends Z {
|
|
|
5336
5104
|
code: h.invalid_type,
|
|
5337
5105
|
expected: g.number,
|
|
5338
5106
|
received: a.parsedType
|
|
5339
|
-
}),
|
|
5107
|
+
}), k;
|
|
5340
5108
|
}
|
|
5341
5109
|
let s;
|
|
5342
5110
|
const r = new P();
|
|
@@ -5360,7 +5128,7 @@ class ye extends Z {
|
|
|
5360
5128
|
inclusive: a.inclusive,
|
|
5361
5129
|
exact: !1,
|
|
5362
5130
|
message: a.message
|
|
5363
|
-
}), r.dirty()) : a.kind === "multipleOf" ?
|
|
5131
|
+
}), r.dirty()) : a.kind === "multipleOf" ? Ua(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), m(s, {
|
|
5364
5132
|
code: h.not_multiple_of,
|
|
5365
5133
|
multipleOf: a.value,
|
|
5366
5134
|
message: a.message
|
|
@@ -5493,7 +5261,7 @@ class ye extends Z {
|
|
|
5493
5261
|
}
|
|
5494
5262
|
ye.create = (n) => new ye({
|
|
5495
5263
|
checks: [],
|
|
5496
|
-
typeName:
|
|
5264
|
+
typeName: b.ZodNumber,
|
|
5497
5265
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
5498
5266
|
...O(n)
|
|
5499
5267
|
});
|
|
@@ -5508,7 +5276,7 @@ class ve extends Z {
|
|
|
5508
5276
|
code: h.invalid_type,
|
|
5509
5277
|
expected: g.bigint,
|
|
5510
5278
|
received: a.parsedType
|
|
5511
|
-
}),
|
|
5279
|
+
}), k;
|
|
5512
5280
|
}
|
|
5513
5281
|
let s;
|
|
5514
5282
|
const r = new P();
|
|
@@ -5620,12 +5388,12 @@ ve.create = (n) => {
|
|
|
5620
5388
|
var e;
|
|
5621
5389
|
return new ve({
|
|
5622
5390
|
checks: [],
|
|
5623
|
-
typeName:
|
|
5391
|
+
typeName: b.ZodBigInt,
|
|
5624
5392
|
coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1,
|
|
5625
5393
|
...O(n)
|
|
5626
5394
|
});
|
|
5627
5395
|
};
|
|
5628
|
-
class
|
|
5396
|
+
class yt extends Z {
|
|
5629
5397
|
_parse(e) {
|
|
5630
5398
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== g.boolean) {
|
|
5631
5399
|
const s = this._getOrReturnCtx(e);
|
|
@@ -5633,13 +5401,13 @@ class gt extends Z {
|
|
|
5633
5401
|
code: h.invalid_type,
|
|
5634
5402
|
expected: g.boolean,
|
|
5635
5403
|
received: s.parsedType
|
|
5636
|
-
}),
|
|
5404
|
+
}), k;
|
|
5637
5405
|
}
|
|
5638
5406
|
return M(e.data);
|
|
5639
5407
|
}
|
|
5640
5408
|
}
|
|
5641
|
-
|
|
5642
|
-
typeName:
|
|
5409
|
+
yt.create = (n) => new yt({
|
|
5410
|
+
typeName: b.ZodBoolean,
|
|
5643
5411
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
5644
5412
|
...O(n)
|
|
5645
5413
|
});
|
|
@@ -5651,13 +5419,13 @@ class Ce extends Z {
|
|
|
5651
5419
|
code: h.invalid_type,
|
|
5652
5420
|
expected: g.date,
|
|
5653
5421
|
received: a.parsedType
|
|
5654
|
-
}),
|
|
5422
|
+
}), k;
|
|
5655
5423
|
}
|
|
5656
5424
|
if (isNaN(e.data.getTime())) {
|
|
5657
5425
|
const a = this._getOrReturnCtx(e);
|
|
5658
5426
|
return m(a, {
|
|
5659
5427
|
code: h.invalid_date
|
|
5660
|
-
}),
|
|
5428
|
+
}), k;
|
|
5661
5429
|
}
|
|
5662
5430
|
const s = new P();
|
|
5663
5431
|
let r;
|
|
@@ -5718,7 +5486,7 @@ class Ce extends Z {
|
|
|
5718
5486
|
Ce.create = (n) => new Ce({
|
|
5719
5487
|
checks: [],
|
|
5720
5488
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
5721
|
-
typeName:
|
|
5489
|
+
typeName: b.ZodDate,
|
|
5722
5490
|
...O(n)
|
|
5723
5491
|
});
|
|
5724
5492
|
class zt extends Z {
|
|
@@ -5729,16 +5497,16 @@ class zt extends Z {
|
|
|
5729
5497
|
code: h.invalid_type,
|
|
5730
5498
|
expected: g.symbol,
|
|
5731
5499
|
received: s.parsedType
|
|
5732
|
-
}),
|
|
5500
|
+
}), k;
|
|
5733
5501
|
}
|
|
5734
5502
|
return M(e.data);
|
|
5735
5503
|
}
|
|
5736
5504
|
}
|
|
5737
5505
|
zt.create = (n) => new zt({
|
|
5738
|
-
typeName:
|
|
5506
|
+
typeName: b.ZodSymbol,
|
|
5739
5507
|
...O(n)
|
|
5740
5508
|
});
|
|
5741
|
-
class
|
|
5509
|
+
class vt extends Z {
|
|
5742
5510
|
_parse(e) {
|
|
5743
5511
|
if (this._getType(e) !== g.undefined) {
|
|
5744
5512
|
const s = this._getOrReturnCtx(e);
|
|
@@ -5746,16 +5514,16 @@ class yt extends Z {
|
|
|
5746
5514
|
code: h.invalid_type,
|
|
5747
5515
|
expected: g.undefined,
|
|
5748
5516
|
received: s.parsedType
|
|
5749
|
-
}),
|
|
5517
|
+
}), k;
|
|
5750
5518
|
}
|
|
5751
5519
|
return M(e.data);
|
|
5752
5520
|
}
|
|
5753
5521
|
}
|
|
5754
|
-
|
|
5755
|
-
typeName:
|
|
5522
|
+
vt.create = (n) => new vt({
|
|
5523
|
+
typeName: b.ZodUndefined,
|
|
5756
5524
|
...O(n)
|
|
5757
5525
|
});
|
|
5758
|
-
class
|
|
5526
|
+
class wt extends Z {
|
|
5759
5527
|
_parse(e) {
|
|
5760
5528
|
if (this._getType(e) !== g.null) {
|
|
5761
5529
|
const s = this._getOrReturnCtx(e);
|
|
@@ -5763,16 +5531,16 @@ class vt extends Z {
|
|
|
5763
5531
|
code: h.invalid_type,
|
|
5764
5532
|
expected: g.null,
|
|
5765
5533
|
received: s.parsedType
|
|
5766
|
-
}),
|
|
5534
|
+
}), k;
|
|
5767
5535
|
}
|
|
5768
5536
|
return M(e.data);
|
|
5769
5537
|
}
|
|
5770
5538
|
}
|
|
5771
|
-
|
|
5772
|
-
typeName:
|
|
5539
|
+
wt.create = (n) => new wt({
|
|
5540
|
+
typeName: b.ZodNull,
|
|
5773
5541
|
...O(n)
|
|
5774
5542
|
});
|
|
5775
|
-
class
|
|
5543
|
+
class Ke extends Z {
|
|
5776
5544
|
constructor() {
|
|
5777
5545
|
super(...arguments), this._any = !0;
|
|
5778
5546
|
}
|
|
@@ -5780,8 +5548,8 @@ class Je extends Z {
|
|
|
5780
5548
|
return M(e.data);
|
|
5781
5549
|
}
|
|
5782
5550
|
}
|
|
5783
|
-
|
|
5784
|
-
typeName:
|
|
5551
|
+
Ke.create = (n) => new Ke({
|
|
5552
|
+
typeName: b.ZodAny,
|
|
5785
5553
|
...O(n)
|
|
5786
5554
|
});
|
|
5787
5555
|
class Ze extends Z {
|
|
@@ -5793,7 +5561,7 @@ class Ze extends Z {
|
|
|
5793
5561
|
}
|
|
5794
5562
|
}
|
|
5795
5563
|
Ze.create = (n) => new Ze({
|
|
5796
|
-
typeName:
|
|
5564
|
+
typeName: b.ZodUnknown,
|
|
5797
5565
|
...O(n)
|
|
5798
5566
|
});
|
|
5799
5567
|
class ae extends Z {
|
|
@@ -5803,11 +5571,11 @@ class ae extends Z {
|
|
|
5803
5571
|
code: h.invalid_type,
|
|
5804
5572
|
expected: g.never,
|
|
5805
5573
|
received: t.parsedType
|
|
5806
|
-
}),
|
|
5574
|
+
}), k;
|
|
5807
5575
|
}
|
|
5808
5576
|
}
|
|
5809
5577
|
ae.create = (n) => new ae({
|
|
5810
|
-
typeName:
|
|
5578
|
+
typeName: b.ZodNever,
|
|
5811
5579
|
...O(n)
|
|
5812
5580
|
});
|
|
5813
5581
|
class Bt extends Z {
|
|
@@ -5818,13 +5586,13 @@ class Bt extends Z {
|
|
|
5818
5586
|
code: h.invalid_type,
|
|
5819
5587
|
expected: g.void,
|
|
5820
5588
|
received: s.parsedType
|
|
5821
|
-
}),
|
|
5589
|
+
}), k;
|
|
5822
5590
|
}
|
|
5823
5591
|
return M(e.data);
|
|
5824
5592
|
}
|
|
5825
5593
|
}
|
|
5826
5594
|
Bt.create = (n) => new Bt({
|
|
5827
|
-
typeName:
|
|
5595
|
+
typeName: b.ZodVoid,
|
|
5828
5596
|
...O(n)
|
|
5829
5597
|
});
|
|
5830
5598
|
class W extends Z {
|
|
@@ -5835,7 +5603,7 @@ class W extends Z {
|
|
|
5835
5603
|
code: h.invalid_type,
|
|
5836
5604
|
expected: g.array,
|
|
5837
5605
|
received: t.parsedType
|
|
5838
|
-
}),
|
|
5606
|
+
}), k;
|
|
5839
5607
|
if (r.exactLength !== null) {
|
|
5840
5608
|
const o = t.data.length > r.exactLength.value, c = t.data.length < r.exactLength.value;
|
|
5841
5609
|
(o || c) && (m(t, {
|
|
@@ -5897,15 +5665,15 @@ W.create = (n, e) => new W({
|
|
|
5897
5665
|
minLength: null,
|
|
5898
5666
|
maxLength: null,
|
|
5899
5667
|
exactLength: null,
|
|
5900
|
-
typeName:
|
|
5668
|
+
typeName: b.ZodArray,
|
|
5901
5669
|
...O(e)
|
|
5902
5670
|
});
|
|
5903
|
-
function
|
|
5671
|
+
function Ve(n) {
|
|
5904
5672
|
if (n instanceof E) {
|
|
5905
5673
|
const e = {};
|
|
5906
5674
|
for (const t in n.shape) {
|
|
5907
5675
|
const s = n.shape[t];
|
|
5908
|
-
e[t] = G.create(
|
|
5676
|
+
e[t] = G.create(Ve(s));
|
|
5909
5677
|
}
|
|
5910
5678
|
return new E({
|
|
5911
5679
|
...n._def,
|
|
@@ -5913,8 +5681,8 @@ function Le(n) {
|
|
|
5913
5681
|
});
|
|
5914
5682
|
} else return n instanceof W ? new W({
|
|
5915
5683
|
...n._def,
|
|
5916
|
-
type:
|
|
5917
|
-
}) : n instanceof G ? G.create(
|
|
5684
|
+
type: Ve(n.element)
|
|
5685
|
+
}) : 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
5686
|
}
|
|
5919
5687
|
class E extends Z {
|
|
5920
5688
|
constructor() {
|
|
@@ -5933,7 +5701,7 @@ class E extends Z {
|
|
|
5933
5701
|
code: h.invalid_type,
|
|
5934
5702
|
expected: g.object,
|
|
5935
5703
|
received: u.parsedType
|
|
5936
|
-
}),
|
|
5704
|
+
}), k;
|
|
5937
5705
|
}
|
|
5938
5706
|
const { status: s, ctx: r } = this._processInputParams(e), { shape: a, keys: o } = this._getCached(), c = [];
|
|
5939
5707
|
if (!(this._def.catchall instanceof ae && this._def.unknownKeys === "strip"))
|
|
@@ -6060,7 +5828,7 @@ class E extends Z {
|
|
|
6060
5828
|
...this._def.shape(),
|
|
6061
5829
|
...e._def.shape()
|
|
6062
5830
|
}),
|
|
6063
|
-
typeName:
|
|
5831
|
+
typeName: b.ZodObject
|
|
6064
5832
|
});
|
|
6065
5833
|
}
|
|
6066
5834
|
// merge<
|
|
@@ -6150,7 +5918,7 @@ class E extends Z {
|
|
|
6150
5918
|
* @deprecated
|
|
6151
5919
|
*/
|
|
6152
5920
|
deepPartial() {
|
|
6153
|
-
return
|
|
5921
|
+
return Ve(this);
|
|
6154
5922
|
}
|
|
6155
5923
|
partial(e) {
|
|
6156
5924
|
const t = {};
|
|
@@ -6179,31 +5947,31 @@ class E extends Z {
|
|
|
6179
5947
|
});
|
|
6180
5948
|
}
|
|
6181
5949
|
keyof() {
|
|
6182
|
-
return
|
|
5950
|
+
return zn(C.objectKeys(this.shape));
|
|
6183
5951
|
}
|
|
6184
5952
|
}
|
|
6185
5953
|
E.create = (n, e) => new E({
|
|
6186
5954
|
shape: () => n,
|
|
6187
5955
|
unknownKeys: "strip",
|
|
6188
5956
|
catchall: ae.create(),
|
|
6189
|
-
typeName:
|
|
5957
|
+
typeName: b.ZodObject,
|
|
6190
5958
|
...O(e)
|
|
6191
5959
|
});
|
|
6192
5960
|
E.strictCreate = (n, e) => new E({
|
|
6193
5961
|
shape: () => n,
|
|
6194
5962
|
unknownKeys: "strict",
|
|
6195
5963
|
catchall: ae.create(),
|
|
6196
|
-
typeName:
|
|
5964
|
+
typeName: b.ZodObject,
|
|
6197
5965
|
...O(e)
|
|
6198
5966
|
});
|
|
6199
5967
|
E.lazycreate = (n, e) => new E({
|
|
6200
5968
|
shape: n,
|
|
6201
5969
|
unknownKeys: "strip",
|
|
6202
5970
|
catchall: ae.create(),
|
|
6203
|
-
typeName:
|
|
5971
|
+
typeName: b.ZodObject,
|
|
6204
5972
|
...O(e)
|
|
6205
5973
|
});
|
|
6206
|
-
class
|
|
5974
|
+
class bt extends Z {
|
|
6207
5975
|
_parse(e) {
|
|
6208
5976
|
const { ctx: t } = this._processInputParams(e), s = this._def.options;
|
|
6209
5977
|
function r(a) {
|
|
@@ -6217,7 +5985,7 @@ class wt extends Z {
|
|
|
6217
5985
|
return m(t, {
|
|
6218
5986
|
code: h.invalid_union,
|
|
6219
5987
|
unionErrors: o
|
|
6220
|
-
}),
|
|
5988
|
+
}), k;
|
|
6221
5989
|
}
|
|
6222
5990
|
if (t.common.async)
|
|
6223
5991
|
return Promise.all(s.map(async (a) => {
|
|
@@ -6264,19 +6032,19 @@ class wt extends Z {
|
|
|
6264
6032
|
return m(t, {
|
|
6265
6033
|
code: h.invalid_union,
|
|
6266
6034
|
unionErrors: c
|
|
6267
|
-
}),
|
|
6035
|
+
}), k;
|
|
6268
6036
|
}
|
|
6269
6037
|
}
|
|
6270
6038
|
get options() {
|
|
6271
6039
|
return this._def.options;
|
|
6272
6040
|
}
|
|
6273
6041
|
}
|
|
6274
|
-
|
|
6042
|
+
bt.create = (n, e) => new bt({
|
|
6275
6043
|
options: n,
|
|
6276
|
-
typeName:
|
|
6044
|
+
typeName: b.ZodUnion,
|
|
6277
6045
|
...O(e)
|
|
6278
6046
|
});
|
|
6279
|
-
const se = (n) => n instanceof
|
|
6047
|
+
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
6048
|
class Kt extends Z {
|
|
6281
6049
|
_parse(e) {
|
|
6282
6050
|
const { ctx: t } = this._processInputParams(e);
|
|
@@ -6285,7 +6053,7 @@ class Kt extends Z {
|
|
|
6285
6053
|
code: h.invalid_type,
|
|
6286
6054
|
expected: g.object,
|
|
6287
6055
|
received: t.parsedType
|
|
6288
|
-
}),
|
|
6056
|
+
}), k;
|
|
6289
6057
|
const s = this.discriminator, r = t.data[s], a = this.optionsMap.get(r);
|
|
6290
6058
|
return a ? t.common.async ? a._parseAsync({
|
|
6291
6059
|
data: t.data,
|
|
@@ -6299,7 +6067,7 @@ class Kt extends Z {
|
|
|
6299
6067
|
code: h.invalid_union_discriminator,
|
|
6300
6068
|
options: Array.from(this.optionsMap.keys()),
|
|
6301
6069
|
path: [s]
|
|
6302
|
-
}),
|
|
6070
|
+
}), k);
|
|
6303
6071
|
}
|
|
6304
6072
|
get discriminator() {
|
|
6305
6073
|
return this._def.discriminator;
|
|
@@ -6331,7 +6099,7 @@ class Kt extends Z {
|
|
|
6331
6099
|
}
|
|
6332
6100
|
}
|
|
6333
6101
|
return new Kt({
|
|
6334
|
-
typeName:
|
|
6102
|
+
typeName: b.ZodDiscriminatedUnion,
|
|
6335
6103
|
discriminator: e,
|
|
6336
6104
|
options: t,
|
|
6337
6105
|
optionsMap: r,
|
|
@@ -6369,11 +6137,11 @@ class kt extends Z {
|
|
|
6369
6137
|
_parse(e) {
|
|
6370
6138
|
const { status: t, ctx: s } = this._processInputParams(e), r = (a, o) => {
|
|
6371
6139
|
if (rn(a) || rn(o))
|
|
6372
|
-
return
|
|
6140
|
+
return k;
|
|
6373
6141
|
const c = on(a.value, o.value);
|
|
6374
6142
|
return c.valid ? ((an(a) || an(o)) && t.dirty(), { status: t.value, value: c.data }) : (m(s, {
|
|
6375
6143
|
code: h.invalid_intersection_types
|
|
6376
|
-
}),
|
|
6144
|
+
}), k);
|
|
6377
6145
|
};
|
|
6378
6146
|
return s.common.async ? Promise.all([
|
|
6379
6147
|
this._def.left._parseAsync({
|
|
@@ -6400,7 +6168,7 @@ class kt extends Z {
|
|
|
6400
6168
|
kt.create = (n, e, t) => new kt({
|
|
6401
6169
|
left: n,
|
|
6402
6170
|
right: e,
|
|
6403
|
-
typeName:
|
|
6171
|
+
typeName: b.ZodIntersection,
|
|
6404
6172
|
...O(t)
|
|
6405
6173
|
});
|
|
6406
6174
|
class ne extends Z {
|
|
@@ -6411,7 +6179,7 @@ class ne extends Z {
|
|
|
6411
6179
|
code: h.invalid_type,
|
|
6412
6180
|
expected: g.array,
|
|
6413
6181
|
received: s.parsedType
|
|
6414
|
-
}),
|
|
6182
|
+
}), k;
|
|
6415
6183
|
if (s.data.length < this._def.items.length)
|
|
6416
6184
|
return m(s, {
|
|
6417
6185
|
code: h.too_small,
|
|
@@ -6419,7 +6187,7 @@ class ne extends Z {
|
|
|
6419
6187
|
inclusive: !0,
|
|
6420
6188
|
exact: !1,
|
|
6421
6189
|
type: "array"
|
|
6422
|
-
}),
|
|
6190
|
+
}), k;
|
|
6423
6191
|
!this._def.rest && s.data.length > this._def.items.length && (m(s, {
|
|
6424
6192
|
code: h.too_big,
|
|
6425
6193
|
maximum: this._def.items.length,
|
|
@@ -6448,12 +6216,12 @@ ne.create = (n, e) => {
|
|
|
6448
6216
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
6449
6217
|
return new ne({
|
|
6450
6218
|
items: n,
|
|
6451
|
-
typeName:
|
|
6219
|
+
typeName: b.ZodTuple,
|
|
6452
6220
|
rest: null,
|
|
6453
6221
|
...O(e)
|
|
6454
6222
|
});
|
|
6455
6223
|
};
|
|
6456
|
-
class
|
|
6224
|
+
class xt extends Z {
|
|
6457
6225
|
get keySchema() {
|
|
6458
6226
|
return this._def.keyType;
|
|
6459
6227
|
}
|
|
@@ -6467,7 +6235,7 @@ class bt extends Z {
|
|
|
6467
6235
|
code: h.invalid_type,
|
|
6468
6236
|
expected: g.object,
|
|
6469
6237
|
received: s.parsedType
|
|
6470
|
-
}),
|
|
6238
|
+
}), k;
|
|
6471
6239
|
const r = [], a = this._def.keyType, o = this._def.valueType;
|
|
6472
6240
|
for (const c in s.data)
|
|
6473
6241
|
r.push({
|
|
@@ -6481,15 +6249,15 @@ class bt extends Z {
|
|
|
6481
6249
|
return this._def.valueType;
|
|
6482
6250
|
}
|
|
6483
6251
|
static create(e, t, s) {
|
|
6484
|
-
return t instanceof Z ? new
|
|
6252
|
+
return t instanceof Z ? new xt({
|
|
6485
6253
|
keyType: e,
|
|
6486
6254
|
valueType: t,
|
|
6487
|
-
typeName:
|
|
6255
|
+
typeName: b.ZodRecord,
|
|
6488
6256
|
...O(s)
|
|
6489
|
-
}) : new
|
|
6257
|
+
}) : new xt({
|
|
6490
6258
|
keyType: z.create(),
|
|
6491
6259
|
valueType: e,
|
|
6492
|
-
typeName:
|
|
6260
|
+
typeName: b.ZodRecord,
|
|
6493
6261
|
...O(t)
|
|
6494
6262
|
});
|
|
6495
6263
|
}
|
|
@@ -6508,7 +6276,7 @@ class Wt extends Z {
|
|
|
6508
6276
|
code: h.invalid_type,
|
|
6509
6277
|
expected: g.map,
|
|
6510
6278
|
received: s.parsedType
|
|
6511
|
-
}),
|
|
6279
|
+
}), k;
|
|
6512
6280
|
const r = this._def.keyType, a = this._def.valueType, o = [...s.data.entries()].map(([c, d], u) => ({
|
|
6513
6281
|
key: r._parse(new te(s, c, s.path, [u, "key"])),
|
|
6514
6282
|
value: a._parse(new te(s, d, s.path, [u, "value"]))
|
|
@@ -6519,7 +6287,7 @@ class Wt extends Z {
|
|
|
6519
6287
|
for (const d of o) {
|
|
6520
6288
|
const u = await d.key, l = await d.value;
|
|
6521
6289
|
if (u.status === "aborted" || l.status === "aborted")
|
|
6522
|
-
return
|
|
6290
|
+
return k;
|
|
6523
6291
|
(u.status === "dirty" || l.status === "dirty") && t.dirty(), c.set(u.value, l.value);
|
|
6524
6292
|
}
|
|
6525
6293
|
return { status: t.value, value: c };
|
|
@@ -6529,7 +6297,7 @@ class Wt extends Z {
|
|
|
6529
6297
|
for (const d of o) {
|
|
6530
6298
|
const u = d.key, l = d.value;
|
|
6531
6299
|
if (u.status === "aborted" || l.status === "aborted")
|
|
6532
|
-
return
|
|
6300
|
+
return k;
|
|
6533
6301
|
(u.status === "dirty" || l.status === "dirty") && t.dirty(), c.set(u.value, l.value);
|
|
6534
6302
|
}
|
|
6535
6303
|
return { status: t.value, value: c };
|
|
@@ -6539,7 +6307,7 @@ class Wt extends Z {
|
|
|
6539
6307
|
Wt.create = (n, e, t) => new Wt({
|
|
6540
6308
|
valueType: e,
|
|
6541
6309
|
keyType: n,
|
|
6542
|
-
typeName:
|
|
6310
|
+
typeName: b.ZodMap,
|
|
6543
6311
|
...O(t)
|
|
6544
6312
|
});
|
|
6545
6313
|
class Ie extends Z {
|
|
@@ -6550,7 +6318,7 @@ class Ie extends Z {
|
|
|
6550
6318
|
code: h.invalid_type,
|
|
6551
6319
|
expected: g.set,
|
|
6552
6320
|
received: s.parsedType
|
|
6553
|
-
}),
|
|
6321
|
+
}), k;
|
|
6554
6322
|
const r = this._def;
|
|
6555
6323
|
r.minSize !== null && s.data.size < r.minSize.value && (m(s, {
|
|
6556
6324
|
code: h.too_small,
|
|
@@ -6572,7 +6340,7 @@ class Ie extends Z {
|
|
|
6572
6340
|
const u = /* @__PURE__ */ new Set();
|
|
6573
6341
|
for (const l of d) {
|
|
6574
6342
|
if (l.status === "aborted")
|
|
6575
|
-
return
|
|
6343
|
+
return k;
|
|
6576
6344
|
l.status === "dirty" && t.dirty(), u.add(l.value);
|
|
6577
6345
|
}
|
|
6578
6346
|
return { status: t.value, value: u };
|
|
@@ -6603,10 +6371,10 @@ Ie.create = (n, e) => new Ie({
|
|
|
6603
6371
|
valueType: n,
|
|
6604
6372
|
minSize: null,
|
|
6605
6373
|
maxSize: null,
|
|
6606
|
-
typeName:
|
|
6374
|
+
typeName: b.ZodSet,
|
|
6607
6375
|
...O(e)
|
|
6608
6376
|
});
|
|
6609
|
-
class
|
|
6377
|
+
class ze extends Z {
|
|
6610
6378
|
constructor() {
|
|
6611
6379
|
super(...arguments), this.validate = this.implement;
|
|
6612
6380
|
}
|
|
@@ -6617,7 +6385,7 @@ class Fe extends Z {
|
|
|
6617
6385
|
code: h.invalid_type,
|
|
6618
6386
|
expected: g.function,
|
|
6619
6387
|
received: t.parsedType
|
|
6620
|
-
}),
|
|
6388
|
+
}), k;
|
|
6621
6389
|
function s(c, d) {
|
|
6622
6390
|
return Ut({
|
|
6623
6391
|
data: c,
|
|
@@ -6626,7 +6394,7 @@ class Fe extends Z {
|
|
|
6626
6394
|
t.common.contextualErrorMap,
|
|
6627
6395
|
t.schemaErrorMap,
|
|
6628
6396
|
Vt(),
|
|
6629
|
-
|
|
6397
|
+
Je
|
|
6630
6398
|
].filter((u) => !!u),
|
|
6631
6399
|
issueData: {
|
|
6632
6400
|
code: h.invalid_arguments,
|
|
@@ -6642,7 +6410,7 @@ class Fe extends Z {
|
|
|
6642
6410
|
t.common.contextualErrorMap,
|
|
6643
6411
|
t.schemaErrorMap,
|
|
6644
6412
|
Vt(),
|
|
6645
|
-
|
|
6413
|
+
Je
|
|
6646
6414
|
].filter((u) => !!u),
|
|
6647
6415
|
issueData: {
|
|
6648
6416
|
code: h.invalid_return_type,
|
|
@@ -6651,7 +6419,7 @@ class Fe extends Z {
|
|
|
6651
6419
|
});
|
|
6652
6420
|
}
|
|
6653
6421
|
const a = { errorMap: t.common.contextualErrorMap }, o = t.data;
|
|
6654
|
-
if (this._def.returns instanceof
|
|
6422
|
+
if (this._def.returns instanceof He) {
|
|
6655
6423
|
const c = this;
|
|
6656
6424
|
return M(async function(...d) {
|
|
6657
6425
|
const u = new V([]), l = await c._def.args.parseAsync(d, a).catch((U) => {
|
|
@@ -6681,13 +6449,13 @@ class Fe extends Z {
|
|
|
6681
6449
|
return this._def.returns;
|
|
6682
6450
|
}
|
|
6683
6451
|
args(...e) {
|
|
6684
|
-
return new
|
|
6452
|
+
return new ze({
|
|
6685
6453
|
...this._def,
|
|
6686
6454
|
args: ne.create(e).rest(Ze.create())
|
|
6687
6455
|
});
|
|
6688
6456
|
}
|
|
6689
6457
|
returns(e) {
|
|
6690
|
-
return new
|
|
6458
|
+
return new ze({
|
|
6691
6459
|
...this._def,
|
|
6692
6460
|
returns: e
|
|
6693
6461
|
});
|
|
@@ -6699,15 +6467,15 @@ class Fe extends Z {
|
|
|
6699
6467
|
return this.parse(e);
|
|
6700
6468
|
}
|
|
6701
6469
|
static create(e, t, s) {
|
|
6702
|
-
return new
|
|
6470
|
+
return new ze({
|
|
6703
6471
|
args: e || ne.create([]).rest(Ze.create()),
|
|
6704
6472
|
returns: t || Ze.create(),
|
|
6705
|
-
typeName:
|
|
6473
|
+
typeName: b.ZodFunction,
|
|
6706
6474
|
...O(s)
|
|
6707
6475
|
});
|
|
6708
6476
|
}
|
|
6709
6477
|
}
|
|
6710
|
-
class
|
|
6478
|
+
class Tt extends Z {
|
|
6711
6479
|
get schema() {
|
|
6712
6480
|
return this._def.getter();
|
|
6713
6481
|
}
|
|
@@ -6716,12 +6484,12 @@ class xt extends Z {
|
|
|
6716
6484
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
6717
6485
|
}
|
|
6718
6486
|
}
|
|
6719
|
-
|
|
6487
|
+
Tt.create = (n, e) => new Tt({
|
|
6720
6488
|
getter: n,
|
|
6721
|
-
typeName:
|
|
6489
|
+
typeName: b.ZodLazy,
|
|
6722
6490
|
...O(e)
|
|
6723
6491
|
});
|
|
6724
|
-
class
|
|
6492
|
+
class Ot extends Z {
|
|
6725
6493
|
_parse(e) {
|
|
6726
6494
|
if (e.data !== this._def.value) {
|
|
6727
6495
|
const t = this._getOrReturnCtx(e);
|
|
@@ -6729,7 +6497,7 @@ class Tt extends Z {
|
|
|
6729
6497
|
received: t.data,
|
|
6730
6498
|
code: h.invalid_literal,
|
|
6731
6499
|
expected: this._def.value
|
|
6732
|
-
}),
|
|
6500
|
+
}), k;
|
|
6733
6501
|
}
|
|
6734
6502
|
return { status: "valid", value: e.data };
|
|
6735
6503
|
}
|
|
@@ -6737,21 +6505,21 @@ class Tt extends Z {
|
|
|
6737
6505
|
return this._def.value;
|
|
6738
6506
|
}
|
|
6739
6507
|
}
|
|
6740
|
-
|
|
6508
|
+
Ot.create = (n, e) => new Ot({
|
|
6741
6509
|
value: n,
|
|
6742
|
-
typeName:
|
|
6510
|
+
typeName: b.ZodLiteral,
|
|
6743
6511
|
...O(e)
|
|
6744
6512
|
});
|
|
6745
|
-
function
|
|
6513
|
+
function zn(n, e) {
|
|
6746
6514
|
return new we({
|
|
6747
6515
|
values: n,
|
|
6748
|
-
typeName:
|
|
6516
|
+
typeName: b.ZodEnum,
|
|
6749
6517
|
...O(e)
|
|
6750
6518
|
});
|
|
6751
6519
|
}
|
|
6752
6520
|
class we extends Z {
|
|
6753
6521
|
constructor() {
|
|
6754
|
-
super(...arguments),
|
|
6522
|
+
super(...arguments), et.set(this, void 0);
|
|
6755
6523
|
}
|
|
6756
6524
|
_parse(e) {
|
|
6757
6525
|
if (typeof e.data != "string") {
|
|
@@ -6760,15 +6528,15 @@ class we extends Z {
|
|
|
6760
6528
|
expected: C.joinValues(s),
|
|
6761
6529
|
received: t.parsedType,
|
|
6762
6530
|
code: h.invalid_type
|
|
6763
|
-
}),
|
|
6531
|
+
}), k;
|
|
6764
6532
|
}
|
|
6765
|
-
if (Ft(this,
|
|
6533
|
+
if (Ft(this, et) || Ln(this, et, new Set(this._def.values)), !Ft(this, et).has(e.data)) {
|
|
6766
6534
|
const t = this._getOrReturnCtx(e), s = this._def.values;
|
|
6767
6535
|
return m(t, {
|
|
6768
6536
|
received: t.data,
|
|
6769
6537
|
code: h.invalid_enum_value,
|
|
6770
6538
|
options: s
|
|
6771
|
-
}),
|
|
6539
|
+
}), k;
|
|
6772
6540
|
}
|
|
6773
6541
|
return M(e.data);
|
|
6774
6542
|
}
|
|
@@ -6806,11 +6574,11 @@ class we extends Z {
|
|
|
6806
6574
|
});
|
|
6807
6575
|
}
|
|
6808
6576
|
}
|
|
6809
|
-
|
|
6810
|
-
we.create =
|
|
6811
|
-
class
|
|
6577
|
+
et = /* @__PURE__ */ new WeakMap();
|
|
6578
|
+
we.create = zn;
|
|
6579
|
+
class St extends Z {
|
|
6812
6580
|
constructor() {
|
|
6813
|
-
super(...arguments),
|
|
6581
|
+
super(...arguments), tt.set(this, void 0);
|
|
6814
6582
|
}
|
|
6815
6583
|
_parse(e) {
|
|
6816
6584
|
const t = C.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
|
|
@@ -6820,15 +6588,15 @@ class Ot extends Z {
|
|
|
6820
6588
|
expected: C.joinValues(r),
|
|
6821
6589
|
received: s.parsedType,
|
|
6822
6590
|
code: h.invalid_type
|
|
6823
|
-
}),
|
|
6591
|
+
}), k;
|
|
6824
6592
|
}
|
|
6825
|
-
if (Ft(this,
|
|
6593
|
+
if (Ft(this, tt) || Ln(this, tt, new Set(C.getValidEnumValues(this._def.values))), !Ft(this, tt).has(e.data)) {
|
|
6826
6594
|
const r = C.objectValues(t);
|
|
6827
6595
|
return m(s, {
|
|
6828
6596
|
received: s.data,
|
|
6829
6597
|
code: h.invalid_enum_value,
|
|
6830
6598
|
options: r
|
|
6831
|
-
}),
|
|
6599
|
+
}), k;
|
|
6832
6600
|
}
|
|
6833
6601
|
return M(e.data);
|
|
6834
6602
|
}
|
|
@@ -6836,13 +6604,13 @@ class Ot extends Z {
|
|
|
6836
6604
|
return this._def.values;
|
|
6837
6605
|
}
|
|
6838
6606
|
}
|
|
6839
|
-
|
|
6840
|
-
|
|
6607
|
+
tt = /* @__PURE__ */ new WeakMap();
|
|
6608
|
+
St.create = (n, e) => new St({
|
|
6841
6609
|
values: n,
|
|
6842
|
-
typeName:
|
|
6610
|
+
typeName: b.ZodNativeEnum,
|
|
6843
6611
|
...O(e)
|
|
6844
6612
|
});
|
|
6845
|
-
class
|
|
6613
|
+
class He extends Z {
|
|
6846
6614
|
unwrap() {
|
|
6847
6615
|
return this._def.type;
|
|
6848
6616
|
}
|
|
@@ -6853,7 +6621,7 @@ class Ke extends Z {
|
|
|
6853
6621
|
code: h.invalid_type,
|
|
6854
6622
|
expected: g.promise,
|
|
6855
6623
|
received: t.parsedType
|
|
6856
|
-
}),
|
|
6624
|
+
}), k;
|
|
6857
6625
|
const s = t.parsedType === g.promise ? t.data : Promise.resolve(t.data);
|
|
6858
6626
|
return M(s.then((r) => this._def.type.parseAsync(r, {
|
|
6859
6627
|
path: t.path,
|
|
@@ -6861,9 +6629,9 @@ class Ke extends Z {
|
|
|
6861
6629
|
})));
|
|
6862
6630
|
}
|
|
6863
6631
|
}
|
|
6864
|
-
|
|
6632
|
+
He.create = (n, e) => new He({
|
|
6865
6633
|
type: n,
|
|
6866
|
-
typeName:
|
|
6634
|
+
typeName: b.ZodPromise,
|
|
6867
6635
|
...O(e)
|
|
6868
6636
|
});
|
|
6869
6637
|
class J extends Z {
|
|
@@ -6871,7 +6639,7 @@ class J extends Z {
|
|
|
6871
6639
|
return this._def.schema;
|
|
6872
6640
|
}
|
|
6873
6641
|
sourceType() {
|
|
6874
|
-
return this._def.schema._def.typeName ===
|
|
6642
|
+
return this._def.schema._def.typeName === b.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
6875
6643
|
}
|
|
6876
6644
|
_parse(e) {
|
|
6877
6645
|
const { status: t, ctx: s } = this._processInputParams(e), r = this._def.effect || null, a = {
|
|
@@ -6887,23 +6655,23 @@ class J extends Z {
|
|
|
6887
6655
|
if (s.common.async)
|
|
6888
6656
|
return Promise.resolve(o).then(async (c) => {
|
|
6889
6657
|
if (t.value === "aborted")
|
|
6890
|
-
return
|
|
6658
|
+
return k;
|
|
6891
6659
|
const d = await this._def.schema._parseAsync({
|
|
6892
6660
|
data: c,
|
|
6893
6661
|
path: s.path,
|
|
6894
6662
|
parent: s
|
|
6895
6663
|
});
|
|
6896
|
-
return d.status === "aborted" ?
|
|
6664
|
+
return d.status === "aborted" ? k : d.status === "dirty" || t.value === "dirty" ? Ue(d.value) : d;
|
|
6897
6665
|
});
|
|
6898
6666
|
{
|
|
6899
6667
|
if (t.value === "aborted")
|
|
6900
|
-
return
|
|
6668
|
+
return k;
|
|
6901
6669
|
const c = this._def.schema._parseSync({
|
|
6902
6670
|
data: o,
|
|
6903
6671
|
path: s.path,
|
|
6904
6672
|
parent: s
|
|
6905
6673
|
});
|
|
6906
|
-
return c.status === "aborted" ?
|
|
6674
|
+
return c.status === "aborted" ? k : c.status === "dirty" || t.value === "dirty" ? Ue(c.value) : c;
|
|
6907
6675
|
}
|
|
6908
6676
|
}
|
|
6909
6677
|
if (r.type === "refinement") {
|
|
@@ -6921,9 +6689,9 @@ class J extends Z {
|
|
|
6921
6689
|
path: s.path,
|
|
6922
6690
|
parent: s
|
|
6923
6691
|
});
|
|
6924
|
-
return c.status === "aborted" ?
|
|
6692
|
+
return c.status === "aborted" ? k : (c.status === "dirty" && t.dirty(), o(c.value), { status: t.value, value: c.value });
|
|
6925
6693
|
} else
|
|
6926
|
-
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((c) => c.status === "aborted" ?
|
|
6694
|
+
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
6695
|
}
|
|
6928
6696
|
if (r.type === "transform")
|
|
6929
6697
|
if (s.common.async === !1) {
|
|
@@ -6932,27 +6700,27 @@ class J extends Z {
|
|
|
6932
6700
|
path: s.path,
|
|
6933
6701
|
parent: s
|
|
6934
6702
|
});
|
|
6935
|
-
if (!
|
|
6703
|
+
if (!_t(o))
|
|
6936
6704
|
return o;
|
|
6937
6705
|
const c = r.transform(o.value, a);
|
|
6938
6706
|
if (c instanceof Promise)
|
|
6939
6707
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
6940
6708
|
return { status: t.value, value: c };
|
|
6941
6709
|
} else
|
|
6942
|
-
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) =>
|
|
6710
|
+
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
6711
|
C.assertNever(r);
|
|
6944
6712
|
}
|
|
6945
6713
|
}
|
|
6946
6714
|
J.create = (n, e, t) => new J({
|
|
6947
6715
|
schema: n,
|
|
6948
|
-
typeName:
|
|
6716
|
+
typeName: b.ZodEffects,
|
|
6949
6717
|
effect: e,
|
|
6950
6718
|
...O(t)
|
|
6951
6719
|
});
|
|
6952
6720
|
J.createWithPreprocess = (n, e, t) => new J({
|
|
6953
6721
|
schema: e,
|
|
6954
6722
|
effect: { type: "preprocess", transform: n },
|
|
6955
|
-
typeName:
|
|
6723
|
+
typeName: b.ZodEffects,
|
|
6956
6724
|
...O(t)
|
|
6957
6725
|
});
|
|
6958
6726
|
class G extends Z {
|
|
@@ -6965,10 +6733,10 @@ class G extends Z {
|
|
|
6965
6733
|
}
|
|
6966
6734
|
G.create = (n, e) => new G({
|
|
6967
6735
|
innerType: n,
|
|
6968
|
-
typeName:
|
|
6736
|
+
typeName: b.ZodOptional,
|
|
6969
6737
|
...O(e)
|
|
6970
6738
|
});
|
|
6971
|
-
class
|
|
6739
|
+
class be extends Z {
|
|
6972
6740
|
_parse(e) {
|
|
6973
6741
|
return this._getType(e) === g.null ? M(null) : this._def.innerType._parse(e);
|
|
6974
6742
|
}
|
|
@@ -6976,12 +6744,12 @@ class ke extends Z {
|
|
|
6976
6744
|
return this._def.innerType;
|
|
6977
6745
|
}
|
|
6978
6746
|
}
|
|
6979
|
-
|
|
6747
|
+
be.create = (n, e) => new be({
|
|
6980
6748
|
innerType: n,
|
|
6981
|
-
typeName:
|
|
6749
|
+
typeName: b.ZodNullable,
|
|
6982
6750
|
...O(e)
|
|
6983
6751
|
});
|
|
6984
|
-
class
|
|
6752
|
+
class Zt extends Z {
|
|
6985
6753
|
_parse(e) {
|
|
6986
6754
|
const { ctx: t } = this._processInputParams(e);
|
|
6987
6755
|
let s = t.data;
|
|
@@ -6995,13 +6763,13 @@ class St extends Z {
|
|
|
6995
6763
|
return this._def.innerType;
|
|
6996
6764
|
}
|
|
6997
6765
|
}
|
|
6998
|
-
|
|
6766
|
+
Zt.create = (n, e) => new Zt({
|
|
6999
6767
|
innerType: n,
|
|
7000
|
-
typeName:
|
|
6768
|
+
typeName: b.ZodDefault,
|
|
7001
6769
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
7002
6770
|
...O(e)
|
|
7003
6771
|
});
|
|
7004
|
-
class
|
|
6772
|
+
class jt extends Z {
|
|
7005
6773
|
_parse(e) {
|
|
7006
6774
|
const { ctx: t } = this._processInputParams(e), s = {
|
|
7007
6775
|
...t,
|
|
@@ -7016,7 +6784,7 @@ class Zt extends Z {
|
|
|
7016
6784
|
...s
|
|
7017
6785
|
}
|
|
7018
6786
|
});
|
|
7019
|
-
return
|
|
6787
|
+
return gt(r) ? r.then((a) => ({
|
|
7020
6788
|
status: "valid",
|
|
7021
6789
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
7022
6790
|
get error() {
|
|
@@ -7038,9 +6806,9 @@ class Zt extends Z {
|
|
|
7038
6806
|
return this._def.innerType;
|
|
7039
6807
|
}
|
|
7040
6808
|
}
|
|
7041
|
-
|
|
6809
|
+
jt.create = (n, e) => new jt({
|
|
7042
6810
|
innerType: n,
|
|
7043
|
-
typeName:
|
|
6811
|
+
typeName: b.ZodCatch,
|
|
7044
6812
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
7045
6813
|
...O(e)
|
|
7046
6814
|
});
|
|
@@ -7052,16 +6820,16 @@ class qt extends Z {
|
|
|
7052
6820
|
code: h.invalid_type,
|
|
7053
6821
|
expected: g.nan,
|
|
7054
6822
|
received: s.parsedType
|
|
7055
|
-
}),
|
|
6823
|
+
}), k;
|
|
7056
6824
|
}
|
|
7057
6825
|
return { status: "valid", value: e.data };
|
|
7058
6826
|
}
|
|
7059
6827
|
}
|
|
7060
6828
|
qt.create = (n) => new qt({
|
|
7061
|
-
typeName:
|
|
6829
|
+
typeName: b.ZodNaN,
|
|
7062
6830
|
...O(n)
|
|
7063
6831
|
});
|
|
7064
|
-
const
|
|
6832
|
+
const Fa = Symbol("zod_brand");
|
|
7065
6833
|
class pn extends Z {
|
|
7066
6834
|
_parse(e) {
|
|
7067
6835
|
const { ctx: t } = this._processInputParams(e), s = t.data;
|
|
@@ -7075,7 +6843,7 @@ class pn extends Z {
|
|
|
7075
6843
|
return this._def.type;
|
|
7076
6844
|
}
|
|
7077
6845
|
}
|
|
7078
|
-
class
|
|
6846
|
+
class It extends Z {
|
|
7079
6847
|
_parse(e) {
|
|
7080
6848
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
7081
6849
|
if (s.common.async)
|
|
@@ -7085,7 +6853,7 @@ class Ct extends Z {
|
|
|
7085
6853
|
path: s.path,
|
|
7086
6854
|
parent: s
|
|
7087
6855
|
});
|
|
7088
|
-
return a.status === "aborted" ?
|
|
6856
|
+
return a.status === "aborted" ? k : a.status === "dirty" ? (t.dirty(), Ue(a.value)) : this._def.out._parseAsync({
|
|
7089
6857
|
data: a.value,
|
|
7090
6858
|
path: s.path,
|
|
7091
6859
|
parent: s
|
|
@@ -7097,7 +6865,7 @@ class Ct extends Z {
|
|
|
7097
6865
|
path: s.path,
|
|
7098
6866
|
parent: s
|
|
7099
6867
|
});
|
|
7100
|
-
return r.status === "aborted" ?
|
|
6868
|
+
return r.status === "aborted" ? k : r.status === "dirty" ? (t.dirty(), {
|
|
7101
6869
|
status: "dirty",
|
|
7102
6870
|
value: r.value
|
|
7103
6871
|
}) : this._def.out._parseSync({
|
|
@@ -7108,71 +6876,71 @@ class Ct extends Z {
|
|
|
7108
6876
|
}
|
|
7109
6877
|
}
|
|
7110
6878
|
static create(e, t) {
|
|
7111
|
-
return new
|
|
6879
|
+
return new It({
|
|
7112
6880
|
in: e,
|
|
7113
6881
|
out: t,
|
|
7114
|
-
typeName:
|
|
6882
|
+
typeName: b.ZodPipeline
|
|
7115
6883
|
});
|
|
7116
6884
|
}
|
|
7117
6885
|
}
|
|
7118
|
-
class
|
|
6886
|
+
class Nt extends Z {
|
|
7119
6887
|
_parse(e) {
|
|
7120
|
-
const t = this._def.innerType._parse(e), s = (r) => (
|
|
7121
|
-
return
|
|
6888
|
+
const t = this._def.innerType._parse(e), s = (r) => (_t(r) && (r.value = Object.freeze(r.value)), r);
|
|
6889
|
+
return gt(t) ? t.then((r) => s(r)) : s(t);
|
|
7122
6890
|
}
|
|
7123
6891
|
unwrap() {
|
|
7124
6892
|
return this._def.innerType;
|
|
7125
6893
|
}
|
|
7126
6894
|
}
|
|
7127
|
-
|
|
6895
|
+
Nt.create = (n, e) => new Nt({
|
|
7128
6896
|
innerType: n,
|
|
7129
|
-
typeName:
|
|
6897
|
+
typeName: b.ZodReadonly,
|
|
7130
6898
|
...O(e)
|
|
7131
6899
|
});
|
|
7132
|
-
function
|
|
7133
|
-
return n ?
|
|
6900
|
+
function Bn(n, e = {}, t) {
|
|
6901
|
+
return n ? Ke.create().superRefine((s, r) => {
|
|
7134
6902
|
var a, o;
|
|
7135
6903
|
if (!n(s)) {
|
|
7136
6904
|
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
6905
|
r.addIssue({ code: "custom", ...u, fatal: d });
|
|
7138
6906
|
}
|
|
7139
|
-
}) :
|
|
6907
|
+
}) : Ke.create();
|
|
7140
6908
|
}
|
|
7141
|
-
const
|
|
6909
|
+
const za = {
|
|
7142
6910
|
object: E.lazycreate
|
|
7143
6911
|
};
|
|
7144
|
-
var
|
|
6912
|
+
var b;
|
|
7145
6913
|
(function(n) {
|
|
7146
6914
|
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
|
|
6915
|
+
})(b || (b = {}));
|
|
6916
|
+
const Ba = (n, e = {
|
|
7149
6917
|
message: `Input not instance of ${n.name}`
|
|
7150
|
-
}) =>
|
|
6918
|
+
}) => 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
6919
|
string: (n) => z.create({ ...n, coerce: !0 }),
|
|
7152
6920
|
number: (n) => ye.create({ ...n, coerce: !0 }),
|
|
7153
|
-
boolean: (n) =>
|
|
6921
|
+
boolean: (n) => yt.create({
|
|
7154
6922
|
...n,
|
|
7155
6923
|
coerce: !0
|
|
7156
6924
|
}),
|
|
7157
6925
|
bigint: (n) => ve.create({ ...n, coerce: !0 }),
|
|
7158
6926
|
date: (n) => Ce.create({ ...n, coerce: !0 })
|
|
7159
|
-
},
|
|
7160
|
-
var
|
|
6927
|
+
}, Oi = k;
|
|
6928
|
+
var Si = /* @__PURE__ */ Object.freeze({
|
|
7161
6929
|
__proto__: null,
|
|
7162
|
-
defaultErrorMap:
|
|
7163
|
-
setErrorMap:
|
|
6930
|
+
defaultErrorMap: Je,
|
|
6931
|
+
setErrorMap: Oa,
|
|
7164
6932
|
getErrorMap: Vt,
|
|
7165
6933
|
makeIssue: Ut,
|
|
7166
|
-
EMPTY_PATH:
|
|
6934
|
+
EMPTY_PATH: Sa,
|
|
7167
6935
|
addIssueToContext: m,
|
|
7168
6936
|
ParseStatus: P,
|
|
7169
|
-
INVALID:
|
|
7170
|
-
DIRTY:
|
|
6937
|
+
INVALID: k,
|
|
6938
|
+
DIRTY: Ue,
|
|
7171
6939
|
OK: M,
|
|
7172
6940
|
isAborted: rn,
|
|
7173
6941
|
isDirty: an,
|
|
7174
|
-
isValid:
|
|
7175
|
-
isAsync:
|
|
6942
|
+
isValid: _t,
|
|
6943
|
+
isAsync: gt,
|
|
7176
6944
|
get util() {
|
|
7177
6945
|
return C;
|
|
7178
6946
|
},
|
|
@@ -7182,107 +6950,107 @@ var Ki = /* @__PURE__ */ Object.freeze({
|
|
|
7182
6950
|
ZodParsedType: g,
|
|
7183
6951
|
getParsedType: he,
|
|
7184
6952
|
ZodType: Z,
|
|
7185
|
-
datetimeRegex:
|
|
6953
|
+
datetimeRegex: Fn,
|
|
7186
6954
|
ZodString: z,
|
|
7187
6955
|
ZodNumber: ye,
|
|
7188
6956
|
ZodBigInt: ve,
|
|
7189
|
-
ZodBoolean:
|
|
6957
|
+
ZodBoolean: yt,
|
|
7190
6958
|
ZodDate: Ce,
|
|
7191
6959
|
ZodSymbol: zt,
|
|
7192
|
-
ZodUndefined:
|
|
7193
|
-
ZodNull:
|
|
7194
|
-
ZodAny:
|
|
6960
|
+
ZodUndefined: vt,
|
|
6961
|
+
ZodNull: wt,
|
|
6962
|
+
ZodAny: Ke,
|
|
7195
6963
|
ZodUnknown: Ze,
|
|
7196
6964
|
ZodNever: ae,
|
|
7197
6965
|
ZodVoid: Bt,
|
|
7198
6966
|
ZodArray: W,
|
|
7199
6967
|
ZodObject: E,
|
|
7200
|
-
ZodUnion:
|
|
6968
|
+
ZodUnion: bt,
|
|
7201
6969
|
ZodDiscriminatedUnion: Kt,
|
|
7202
6970
|
ZodIntersection: kt,
|
|
7203
6971
|
ZodTuple: ne,
|
|
7204
|
-
ZodRecord:
|
|
6972
|
+
ZodRecord: xt,
|
|
7205
6973
|
ZodMap: Wt,
|
|
7206
6974
|
ZodSet: Ie,
|
|
7207
|
-
ZodFunction:
|
|
7208
|
-
ZodLazy:
|
|
7209
|
-
ZodLiteral:
|
|
6975
|
+
ZodFunction: ze,
|
|
6976
|
+
ZodLazy: Tt,
|
|
6977
|
+
ZodLiteral: Ot,
|
|
7210
6978
|
ZodEnum: we,
|
|
7211
|
-
ZodNativeEnum:
|
|
7212
|
-
ZodPromise:
|
|
6979
|
+
ZodNativeEnum: St,
|
|
6980
|
+
ZodPromise: He,
|
|
7213
6981
|
ZodEffects: J,
|
|
7214
6982
|
ZodTransformer: J,
|
|
7215
6983
|
ZodOptional: G,
|
|
7216
|
-
ZodNullable:
|
|
7217
|
-
ZodDefault:
|
|
7218
|
-
ZodCatch:
|
|
6984
|
+
ZodNullable: be,
|
|
6985
|
+
ZodDefault: Zt,
|
|
6986
|
+
ZodCatch: jt,
|
|
7219
6987
|
ZodNaN: qt,
|
|
7220
|
-
BRAND:
|
|
6988
|
+
BRAND: Fa,
|
|
7221
6989
|
ZodBranded: pn,
|
|
7222
|
-
ZodPipeline:
|
|
7223
|
-
ZodReadonly:
|
|
7224
|
-
custom:
|
|
6990
|
+
ZodPipeline: It,
|
|
6991
|
+
ZodReadonly: Nt,
|
|
6992
|
+
custom: Bn,
|
|
7225
6993
|
Schema: Z,
|
|
7226
6994
|
ZodSchema: Z,
|
|
7227
|
-
late:
|
|
6995
|
+
late: za,
|
|
7228
6996
|
get ZodFirstPartyTypeKind() {
|
|
7229
|
-
return
|
|
6997
|
+
return b;
|
|
7230
6998
|
},
|
|
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:
|
|
6999
|
+
coerce: Ti,
|
|
7000
|
+
any: Ya,
|
|
7001
|
+
array: ti,
|
|
7002
|
+
bigint: qa,
|
|
7003
|
+
boolean: Jn,
|
|
7004
|
+
date: Ja,
|
|
7005
|
+
discriminatedUnion: ai,
|
|
7006
|
+
effect: vn,
|
|
7007
|
+
enum: fi,
|
|
7008
|
+
function: li,
|
|
7009
|
+
instanceof: Ba,
|
|
7010
|
+
intersection: ii,
|
|
7011
|
+
lazy: pi,
|
|
7012
|
+
literal: hi,
|
|
7013
|
+
map: di,
|
|
7014
|
+
nan: Wa,
|
|
7015
|
+
nativeEnum: mi,
|
|
7016
|
+
never: Xa,
|
|
7017
|
+
null: Qa,
|
|
7018
|
+
nullable: yi,
|
|
7019
|
+
number: qn,
|
|
7020
|
+
object: ni,
|
|
7021
|
+
oboolean: xi,
|
|
7022
|
+
onumber: ki,
|
|
7023
|
+
optional: gi,
|
|
7024
|
+
ostring: bi,
|
|
7025
|
+
pipeline: wi,
|
|
7026
|
+
preprocess: vi,
|
|
7027
|
+
promise: _i,
|
|
7028
|
+
record: ci,
|
|
7029
|
+
set: ui,
|
|
7030
|
+
strictObject: si,
|
|
7031
|
+
string: Wn,
|
|
7032
|
+
symbol: Ka,
|
|
7033
|
+
transformer: vn,
|
|
7034
|
+
tuple: oi,
|
|
7035
|
+
undefined: Ha,
|
|
7036
|
+
union: ri,
|
|
7037
|
+
unknown: Ga,
|
|
7038
|
+
void: ei,
|
|
7039
|
+
NEVER: Oi,
|
|
7272
7040
|
ZodIssueCode: h,
|
|
7273
|
-
quotelessJson:
|
|
7041
|
+
quotelessJson: Ta,
|
|
7274
7042
|
ZodError: V
|
|
7275
7043
|
});
|
|
7276
|
-
|
|
7277
|
-
function
|
|
7044
|
+
xa(Si);
|
|
7045
|
+
function Re(n, e = "", t = {}) {
|
|
7278
7046
|
for (let s in n)
|
|
7279
7047
|
if (Object.prototype.hasOwnProperty.call(n, s)) {
|
|
7280
7048
|
const r = e ? `${e}_${s}` : s;
|
|
7281
|
-
typeof n[s] == "object" && n[s] !== null && !Array.isArray(n[s]) ?
|
|
7049
|
+
typeof n[s] == "object" && n[s] !== null && !Array.isArray(n[s]) ? Re(n[s], r, t) : t[r] = n[s];
|
|
7282
7050
|
}
|
|
7283
7051
|
return t;
|
|
7284
7052
|
}
|
|
7285
|
-
function
|
|
7053
|
+
function hn(n, e) {
|
|
7286
7054
|
const t = {};
|
|
7287
7055
|
for (const [s, r] of Object.entries(n)) {
|
|
7288
7056
|
const a = e.find(
|
|
@@ -7300,6 +7068,261 @@ function Hi(n, e) {
|
|
|
7300
7068
|
}
|
|
7301
7069
|
return t;
|
|
7302
7070
|
}
|
|
7071
|
+
function Zi(n) {
|
|
7072
|
+
return async (e, t) => {
|
|
7073
|
+
const s = {
|
|
7074
|
+
id: Ae(),
|
|
7075
|
+
...t,
|
|
7076
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7077
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7078
|
+
};
|
|
7079
|
+
return await n.insertInto("connections").values({ ...Re(s), tenant_id: e }).execute(), s;
|
|
7080
|
+
};
|
|
7081
|
+
}
|
|
7082
|
+
function ji(n) {
|
|
7083
|
+
return async (e, t) => {
|
|
7084
|
+
let s = n.selectFrom("connections").where("connections.tenant_id", "=", e);
|
|
7085
|
+
t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
|
|
7086
|
+
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();
|
|
7087
|
+
return {
|
|
7088
|
+
connections: a.map(
|
|
7089
|
+
(c) => R(hn(c, ["options"]))
|
|
7090
|
+
),
|
|
7091
|
+
start: t.page * t.per_page,
|
|
7092
|
+
limit: t.per_page,
|
|
7093
|
+
length: ke(o)
|
|
7094
|
+
};
|
|
7095
|
+
};
|
|
7096
|
+
}
|
|
7097
|
+
function Ni(n) {
|
|
7098
|
+
return async (e, t) => (await n.deleteFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
7099
|
+
}
|
|
7100
|
+
function Ci(n) {
|
|
7101
|
+
return async (e, t) => {
|
|
7102
|
+
const s = await n.selectFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).selectAll().executeTakeFirst();
|
|
7103
|
+
return s ? R(hn(s, ["options"])) : null;
|
|
7104
|
+
};
|
|
7105
|
+
}
|
|
7106
|
+
function Ii(n) {
|
|
7107
|
+
return async (e, t, s) => {
|
|
7108
|
+
const r = {
|
|
7109
|
+
...s,
|
|
7110
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7111
|
+
};
|
|
7112
|
+
return await n.updateTable("connections").set(Re(r)).where("connections.id", "=", t).where("connections.tenant_id", "=", e).execute(), !0;
|
|
7113
|
+
};
|
|
7114
|
+
}
|
|
7115
|
+
function Ei(n) {
|
|
7116
|
+
return {
|
|
7117
|
+
create: Zi(n),
|
|
7118
|
+
get: Ci(n),
|
|
7119
|
+
list: ji(n),
|
|
7120
|
+
remove: Ni(n),
|
|
7121
|
+
update: Ii(n)
|
|
7122
|
+
};
|
|
7123
|
+
}
|
|
7124
|
+
function Ai(n) {
|
|
7125
|
+
return {
|
|
7126
|
+
get: async (e) => {
|
|
7127
|
+
const t = await n.selectFrom("applications").selectAll().where("id", "=", e).executeTakeFirst();
|
|
7128
|
+
if (!t)
|
|
7129
|
+
return null;
|
|
7130
|
+
const s = await n.selectFrom("tenants").selectAll().where("id", "=", t.tenant_id).executeTakeFirst();
|
|
7131
|
+
if (!s)
|
|
7132
|
+
throw new Gt(404, { message: "Tenant not found" });
|
|
7133
|
+
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();
|
|
7134
|
+
return {
|
|
7135
|
+
...t,
|
|
7136
|
+
connections: r.map(
|
|
7137
|
+
(c) => Rn.parse(R(c))
|
|
7138
|
+
),
|
|
7139
|
+
domains: a,
|
|
7140
|
+
addons: t.addons ? JSON.parse(t.addons) : {},
|
|
7141
|
+
callbacks: t.callbacks ? JSON.parse(t.callbacks) : [],
|
|
7142
|
+
allowed_origins: t.allowed_origins ? JSON.parse(t.allowed_origins) : [],
|
|
7143
|
+
web_origins: t.web_origins ? JSON.parse(t.web_origins) : [],
|
|
7144
|
+
allowed_logout_urls: t.allowed_logout_urls ? JSON.parse(t.allowed_logout_urls) : [],
|
|
7145
|
+
tenant: R(s),
|
|
7146
|
+
// this is really an integer in the database
|
|
7147
|
+
disable_sign_ups: !!t.disable_sign_ups
|
|
7148
|
+
};
|
|
7149
|
+
}
|
|
7150
|
+
};
|
|
7151
|
+
}
|
|
7152
|
+
function Ri(n) {
|
|
7153
|
+
return async () => await n.selectFrom("keys").where("revoked_at", "is", null).selectAll().execute();
|
|
7154
|
+
}
|
|
7155
|
+
function $i(n) {
|
|
7156
|
+
return async (e) => {
|
|
7157
|
+
await n.insertInto("keys").values({ ...e, created_at: (/* @__PURE__ */ new Date()).toDateString() }).execute();
|
|
7158
|
+
};
|
|
7159
|
+
}
|
|
7160
|
+
function Pi(n) {
|
|
7161
|
+
return async (e, t) => !!(await n.updateTable("keys").set(t).where("kid", "=", e).execute()).length;
|
|
7162
|
+
}
|
|
7163
|
+
function Di(n) {
|
|
7164
|
+
return {
|
|
7165
|
+
create: $i(n),
|
|
7166
|
+
list: Ri(n),
|
|
7167
|
+
update: Pi(n)
|
|
7168
|
+
};
|
|
7169
|
+
}
|
|
7170
|
+
function Mi(n) {
|
|
7171
|
+
return async (e, t) => {
|
|
7172
|
+
const s = {
|
|
7173
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7174
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7175
|
+
tenant_id: e,
|
|
7176
|
+
id: Ae(),
|
|
7177
|
+
...t
|
|
7178
|
+
};
|
|
7179
|
+
return await n.insertInto("domains").values(s).execute(), s;
|
|
7180
|
+
};
|
|
7181
|
+
}
|
|
7182
|
+
function Li(n) {
|
|
7183
|
+
return async (e, t) => {
|
|
7184
|
+
let s = n.selectFrom("domains").where("domains.tenant_id", "=", e);
|
|
7185
|
+
t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
|
|
7186
|
+
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();
|
|
7187
|
+
return {
|
|
7188
|
+
domains: a,
|
|
7189
|
+
start: t.page * t.per_page,
|
|
7190
|
+
limit: t.per_page,
|
|
7191
|
+
length: ke(o)
|
|
7192
|
+
};
|
|
7193
|
+
};
|
|
7194
|
+
}
|
|
7195
|
+
function Vi(n) {
|
|
7196
|
+
return {
|
|
7197
|
+
create: Mi(n),
|
|
7198
|
+
list: Li(n)
|
|
7199
|
+
};
|
|
7200
|
+
}
|
|
7201
|
+
function Ui(n) {
|
|
7202
|
+
return async (e) => {
|
|
7203
|
+
const [t] = await n.selectFrom("branding").where("branding.tenant_id", "=", e).selectAll().execute();
|
|
7204
|
+
if (!t)
|
|
7205
|
+
return null;
|
|
7206
|
+
const {
|
|
7207
|
+
tenant_id: s,
|
|
7208
|
+
colors_primary: r,
|
|
7209
|
+
colors_page_background_type: a,
|
|
7210
|
+
colors_page_background_start: o,
|
|
7211
|
+
colors_page_background_end: c,
|
|
7212
|
+
colors_page_background_angle_dev: d,
|
|
7213
|
+
font_url: u,
|
|
7214
|
+
...l
|
|
7215
|
+
} = t;
|
|
7216
|
+
return R({
|
|
7217
|
+
...l,
|
|
7218
|
+
colors: {
|
|
7219
|
+
primary: r,
|
|
7220
|
+
page_background: {
|
|
7221
|
+
type: a,
|
|
7222
|
+
start: o,
|
|
7223
|
+
end: c,
|
|
7224
|
+
angle_deg: d
|
|
7225
|
+
}
|
|
7226
|
+
},
|
|
7227
|
+
font: u ? { url: u } : void 0
|
|
7228
|
+
});
|
|
7229
|
+
};
|
|
7230
|
+
}
|
|
7231
|
+
function Fi(n) {
|
|
7232
|
+
return async (e, t) => {
|
|
7233
|
+
var o, c, d, u, l, j, A, U, ie, $e, oe, ce, de, Pe, De, K, H, Q;
|
|
7234
|
+
const { colors: s, font: r, ...a } = t;
|
|
7235
|
+
try {
|
|
7236
|
+
await n.insertInto("branding").values({
|
|
7237
|
+
...a,
|
|
7238
|
+
colors_primary: s == null ? void 0 : s.primary,
|
|
7239
|
+
colors_page_background_type: (c = (o = t.colors) == null ? void 0 : o.page_background) == null ? void 0 : c.type,
|
|
7240
|
+
colors_page_background_start: (u = (d = t.colors) == null ? void 0 : d.page_background) == null ? void 0 : u.start,
|
|
7241
|
+
colors_page_background_end: (j = (l = t.colors) == null ? void 0 : l.page_background) == null ? void 0 : j.end,
|
|
7242
|
+
colors_page_background_angle_dev: (U = (A = t.colors) == null ? void 0 : A.page_background) == null ? void 0 : U.angle_deg,
|
|
7243
|
+
font_url: (ie = t.font) == null ? void 0 : ie.url,
|
|
7244
|
+
tenant_id: e
|
|
7245
|
+
}).execute();
|
|
7246
|
+
} catch {
|
|
7247
|
+
await n.updateTable("branding").set({
|
|
7248
|
+
...a,
|
|
7249
|
+
colors_primary: s == null ? void 0 : s.primary,
|
|
7250
|
+
colors_page_background_type: (oe = ($e = t.colors) == null ? void 0 : $e.page_background) == null ? void 0 : oe.type,
|
|
7251
|
+
colors_page_background_start: (de = (ce = t.colors) == null ? void 0 : ce.page_background) == null ? void 0 : de.start,
|
|
7252
|
+
colors_page_background_end: (De = (Pe = t.colors) == null ? void 0 : Pe.page_background) == null ? void 0 : De.end,
|
|
7253
|
+
colors_page_background_angle_dev: (H = (K = t.colors) == null ? void 0 : K.page_background) == null ? void 0 : H.angle_deg,
|
|
7254
|
+
font_url: (Q = t.font) == null ? void 0 : Q.url
|
|
7255
|
+
}).where("tenant_id", "=", e).execute();
|
|
7256
|
+
}
|
|
7257
|
+
};
|
|
7258
|
+
}
|
|
7259
|
+
function zi(n) {
|
|
7260
|
+
return {
|
|
7261
|
+
get: Ui(n),
|
|
7262
|
+
set: Fi(n)
|
|
7263
|
+
};
|
|
7264
|
+
}
|
|
7265
|
+
function Bi(n) {
|
|
7266
|
+
return async (e, t) => {
|
|
7267
|
+
let s = n.selectFrom("hooks").where("hooks.tenant_id", "=", e);
|
|
7268
|
+
t.q && (s = Ee(n, s, t.q, ["url"]));
|
|
7269
|
+
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();
|
|
7270
|
+
return {
|
|
7271
|
+
hooks: a.map((d) => {
|
|
7272
|
+
const { tenant_id: u, enabled: l, synchronous: j, ...A } = d;
|
|
7273
|
+
return R({
|
|
7274
|
+
...A,
|
|
7275
|
+
enabled: !!l,
|
|
7276
|
+
synchronous: !!j
|
|
7277
|
+
});
|
|
7278
|
+
}),
|
|
7279
|
+
start: t.page * t.per_page,
|
|
7280
|
+
limit: t.per_page,
|
|
7281
|
+
length: ke(o)
|
|
7282
|
+
};
|
|
7283
|
+
};
|
|
7284
|
+
}
|
|
7285
|
+
function Wi(n) {
|
|
7286
|
+
return async (e, t) => {
|
|
7287
|
+
const s = await n.selectFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).selectAll().executeTakeFirst();
|
|
7288
|
+
return s ? (s.enabled = !!s.enabled, s.synchronous = !!s.synchronous, R(s)) : null;
|
|
7289
|
+
};
|
|
7290
|
+
}
|
|
7291
|
+
function qi(n) {
|
|
7292
|
+
return async (e, t) => (await n.deleteFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
7293
|
+
}
|
|
7294
|
+
function Ji(n) {
|
|
7295
|
+
return async (e, t) => {
|
|
7296
|
+
const s = {
|
|
7297
|
+
hook_id: Ae(),
|
|
7298
|
+
...t,
|
|
7299
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7300
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7301
|
+
};
|
|
7302
|
+
return await n.insertInto("hooks").values({
|
|
7303
|
+
...s,
|
|
7304
|
+
tenant_id: e
|
|
7305
|
+
}).execute(), s;
|
|
7306
|
+
};
|
|
7307
|
+
}
|
|
7308
|
+
function Ki(n) {
|
|
7309
|
+
return async (e, t, s) => {
|
|
7310
|
+
const r = {
|
|
7311
|
+
...s,
|
|
7312
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7313
|
+
};
|
|
7314
|
+
return await n.updateTable("hooks").set(r).where("hooks.hook_id", "=", t).where("hooks.tenant_id", "=", e).execute(), !0;
|
|
7315
|
+
};
|
|
7316
|
+
}
|
|
7317
|
+
function Hi(n) {
|
|
7318
|
+
return {
|
|
7319
|
+
create: Ji(n),
|
|
7320
|
+
get: Wi(n),
|
|
7321
|
+
list: Bi(n),
|
|
7322
|
+
update: Ki(n),
|
|
7323
|
+
remove: qi(n)
|
|
7324
|
+
};
|
|
7325
|
+
}
|
|
7303
7326
|
function Qi(n) {
|
|
7304
7327
|
return async (e, t) => {
|
|
7305
7328
|
const s = {
|
|
@@ -7308,7 +7331,7 @@ function Qi(n) {
|
|
|
7308
7331
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7309
7332
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7310
7333
|
};
|
|
7311
|
-
return await n.insertInto("themes").values({ ...
|
|
7334
|
+
return await n.insertInto("themes").values({ ...Re(s), tenant_id: e }).execute(), s;
|
|
7312
7335
|
};
|
|
7313
7336
|
}
|
|
7314
7337
|
function Yi(n) {
|
|
@@ -7322,7 +7345,7 @@ function Gi(n) {
|
|
|
7322
7345
|
}
|
|
7323
7346
|
function Xi(n) {
|
|
7324
7347
|
return async (e, t, s) => {
|
|
7325
|
-
const r =
|
|
7348
|
+
const r = Re({
|
|
7326
7349
|
...s,
|
|
7327
7350
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7328
7351
|
});
|
|
@@ -7340,8 +7363,8 @@ function eo(n) {
|
|
|
7340
7363
|
function to(n) {
|
|
7341
7364
|
return async (e, t) => {
|
|
7342
7365
|
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
|
-
|
|
7366
|
+
return r ? wr.parse(
|
|
7367
|
+
hn(R(r), ["authParams"])
|
|
7345
7368
|
) : null;
|
|
7346
7369
|
};
|
|
7347
7370
|
}
|
|
@@ -7353,11 +7376,11 @@ function no(n) {
|
|
|
7353
7376
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7354
7377
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7355
7378
|
};
|
|
7356
|
-
return await n.insertInto("logins").values({ ...
|
|
7379
|
+
return await n.insertInto("logins").values({ ...Re(s), tenant_id: e }).execute(), s;
|
|
7357
7380
|
};
|
|
7358
7381
|
}
|
|
7359
7382
|
function so(n) {
|
|
7360
|
-
return async (e, t, s) => (await n.updateTable("logins").set(
|
|
7383
|
+
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
7384
|
}
|
|
7362
7385
|
function ro(n) {
|
|
7363
7386
|
return async (e, t) => (await n.deleteFrom("logins").where("logins.tenant_id", "=", e).where("logins.login_id", "=", t).execute()).length > 0;
|
|
@@ -7370,26 +7393,56 @@ function ao(n) {
|
|
|
7370
7393
|
remove: ro(n)
|
|
7371
7394
|
};
|
|
7372
7395
|
}
|
|
7396
|
+
function io(n) {
|
|
7397
|
+
return async (e) => {
|
|
7398
|
+
const [t] = await n.selectFrom("promptSettings").where("promptSettings.tenant_id", "=", e).selectAll().execute();
|
|
7399
|
+
return R({
|
|
7400
|
+
identifier_first: !!(t != null && t.identifier_first),
|
|
7401
|
+
password_first: !!(t != null && t.password_first),
|
|
7402
|
+
webauthn_platform_first_factor: !!(t != null && t.webauthn_platform_first_factor),
|
|
7403
|
+
universal_login_experience: (t == null ? void 0 : t.universal_login_experience) || "new"
|
|
7404
|
+
});
|
|
7405
|
+
};
|
|
7406
|
+
}
|
|
7373
7407
|
function oo(n) {
|
|
7408
|
+
return async (e, t) => {
|
|
7409
|
+
try {
|
|
7410
|
+
await n.insertInto("promptSettings").values({
|
|
7411
|
+
...t,
|
|
7412
|
+
tenant_id: e
|
|
7413
|
+
}).execute();
|
|
7414
|
+
} catch {
|
|
7415
|
+
await n.updateTable("promptSettings").set(t).where("tenant_id", "=", e).execute();
|
|
7416
|
+
}
|
|
7417
|
+
};
|
|
7418
|
+
}
|
|
7419
|
+
function co(n) {
|
|
7420
|
+
return {
|
|
7421
|
+
get: io(n),
|
|
7422
|
+
set: oo(n)
|
|
7423
|
+
};
|
|
7424
|
+
}
|
|
7425
|
+
function lo(n) {
|
|
7374
7426
|
return {
|
|
7375
|
-
applications:
|
|
7376
|
-
branding:
|
|
7377
|
-
clients:
|
|
7378
|
-
codes:
|
|
7379
|
-
connections:
|
|
7380
|
-
domains:
|
|
7381
|
-
hooks:
|
|
7382
|
-
keys:
|
|
7427
|
+
applications: wa(n),
|
|
7428
|
+
branding: zi(n),
|
|
7429
|
+
clients: Ai(n),
|
|
7430
|
+
codes: fa(n),
|
|
7431
|
+
connections: Ei(n),
|
|
7432
|
+
domains: Vi(n),
|
|
7433
|
+
hooks: Hi(n),
|
|
7434
|
+
keys: Di(n),
|
|
7383
7435
|
logins: ao(n),
|
|
7384
|
-
logs:
|
|
7385
|
-
passwords:
|
|
7386
|
-
|
|
7387
|
-
|
|
7388
|
-
|
|
7436
|
+
logs: Hr(n),
|
|
7437
|
+
passwords: da(n),
|
|
7438
|
+
promptSettings: co(n),
|
|
7439
|
+
users: Dr(n),
|
|
7440
|
+
sessions: ta(n),
|
|
7441
|
+
tenants: Br(n),
|
|
7389
7442
|
themes: eo(n),
|
|
7390
|
-
tickets:
|
|
7443
|
+
tickets: aa(n)
|
|
7391
7444
|
};
|
|
7392
7445
|
}
|
|
7393
7446
|
export {
|
|
7394
|
-
|
|
7447
|
+
lo as default
|
|
7395
7448
|
};
|