@authhero/kysely-adapter 0.7.2 → 0.7.3
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.iife.js +1 -1
- package/dist/kysely-adapter.mjs +541 -536
- package/package.json +1 -1
package/dist/kysely-adapter.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var Yt = (n, e, t) =>
|
|
1
|
+
var Yn = Object.defineProperty;
|
|
2
|
+
var Gn = (n, e, t) => e in n ? Yn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var Yt = (n, e, t) => Gn(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
var Et = 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 Et = class extends Error {
|
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
function
|
|
20
|
+
function Xn(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 es(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,7 +55,7 @@ function Xn(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 ts(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
|
}
|
|
@@ -66,15 +66,15 @@ function Qe(n, e) {
|
|
|
66
66
|
return r._def.openapi = this._def.openapi, r;
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function ns(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, T;
|
|
74
|
-
const C = typeof r == "string" ? a : r, L = C ?? {}, { param:
|
|
75
|
-
param: Object.assign(Object.assign({}, (T = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || T === void 0 ? void 0 : T.param),
|
|
74
|
+
const C = typeof r == "string" ? a : r, L = C ?? {}, { param: J } = L, re = es(L, ["param"]), ce = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), de = Object.assign(Object.assign(Object.assign({}, (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 || J ? {
|
|
75
|
+
param: Object.assign(Object.assign({}, (T = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || T === void 0 ? void 0 : T.param), J)
|
|
76
76
|
} : void 0), ue = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(ce).length > 0 ? { _internal: ce } : void 0), Object.keys(de).length > 0 ? { metadata: de } : void 0) }));
|
|
77
|
-
if (
|
|
77
|
+
if (ts(this, "ZodObject")) {
|
|
78
78
|
const $e = this.extend;
|
|
79
79
|
ue.extend = function(...Pe) {
|
|
80
80
|
var Q, H, Y, le, Te, Oe;
|
|
@@ -145,14 +145,14 @@ var N;
|
|
|
145
145
|
}
|
|
146
146
|
n.joinValues = s, n.jsonStringifyReplacer = (r, a) => typeof a == "bigint" ? a.toString() : a;
|
|
147
147
|
})(N || (N = {}));
|
|
148
|
-
var
|
|
148
|
+
var nn;
|
|
149
149
|
(function(n) {
|
|
150
150
|
n.mergeShapes = (e, t) => ({
|
|
151
151
|
...e,
|
|
152
152
|
...t
|
|
153
153
|
// second overwrites first
|
|
154
154
|
});
|
|
155
|
-
})(
|
|
155
|
+
})(nn || (nn = {}));
|
|
156
156
|
const _ = N.arrayToEnum([
|
|
157
157
|
"string",
|
|
158
158
|
"nan",
|
|
@@ -212,7 +212,7 @@ const _ = N.arrayToEnum([
|
|
|
212
212
|
"invalid_intersection_types",
|
|
213
213
|
"not_multiple_of",
|
|
214
214
|
"not_finite"
|
|
215
|
-
]),
|
|
215
|
+
]), ss = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
216
216
|
class V extends Error {
|
|
217
217
|
constructor(e) {
|
|
218
218
|
super(), this.issues = [], this.addIssue = (s) => {
|
|
@@ -329,12 +329,12 @@ const ze = (n, e) => {
|
|
|
329
329
|
}
|
|
330
330
|
return { message: t };
|
|
331
331
|
};
|
|
332
|
-
let
|
|
333
|
-
function
|
|
334
|
-
|
|
332
|
+
let xn = ze;
|
|
333
|
+
function rs(n) {
|
|
334
|
+
xn = n;
|
|
335
335
|
}
|
|
336
336
|
function At() {
|
|
337
|
-
return
|
|
337
|
+
return xn;
|
|
338
338
|
}
|
|
339
339
|
const Rt = (n) => {
|
|
340
340
|
const { data: e, path: t, errorMaps: s, issueData: r } = n, a = [...t, ...r.path || []], o = {
|
|
@@ -356,7 +356,7 @@ const Rt = (n) => {
|
|
|
356
356
|
path: a,
|
|
357
357
|
message: c
|
|
358
358
|
};
|
|
359
|
-
},
|
|
359
|
+
}, as = [];
|
|
360
360
|
function f(n, e) {
|
|
361
361
|
const t = At(), s = Rt({
|
|
362
362
|
issueData: e,
|
|
@@ -415,12 +415,12 @@ class $ {
|
|
|
415
415
|
}
|
|
416
416
|
const x = Object.freeze({
|
|
417
417
|
status: "aborted"
|
|
418
|
-
}), $t = (n) => ({ status: "dirty", value: n }), D = (n) => ({ status: "valid", value: n }),
|
|
418
|
+
}), $t = (n) => ({ status: "dirty", value: n }), D = (n) => ({ status: "valid", value: n }), sn = (n) => n.status === "aborted", rn = (n) => n.status === "dirty", tt = (n) => n.status === "valid", nt = (n) => typeof Promise < "u" && n instanceof Promise;
|
|
419
419
|
function Pt(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 Tn(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
|
}
|
|
@@ -437,7 +437,7 @@ class ee {
|
|
|
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
|
|
440
|
+
const gn = (n, e) => {
|
|
441
441
|
if (tt(e))
|
|
442
442
|
return { success: !0, data: e.value };
|
|
443
443
|
if (!n.common.issues.length)
|
|
@@ -527,7 +527,7 @@ class Z {
|
|
|
527
527
|
data: e,
|
|
528
528
|
parsedType: he(e)
|
|
529
529
|
}, a = this._parseSync({ data: e, path: r.path, parent: r });
|
|
530
|
-
return
|
|
530
|
+
return gn(r, a);
|
|
531
531
|
}
|
|
532
532
|
async parseAsync(e, t) {
|
|
533
533
|
const s = await this.safeParseAsync(e, t);
|
|
@@ -548,7 +548,7 @@ class Z {
|
|
|
548
548
|
data: e,
|
|
549
549
|
parsedType: he(e)
|
|
550
550
|
}, r = this._parse({ data: e, path: s.path, parent: s }), a = await (nt(r) ? r : Promise.resolve(r));
|
|
551
|
-
return
|
|
551
|
+
return gn(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;
|
|
@@ -612,7 +612,7 @@ class Z {
|
|
|
612
612
|
});
|
|
613
613
|
}
|
|
614
614
|
brand() {
|
|
615
|
-
return new
|
|
615
|
+
return new ln({
|
|
616
616
|
typeName: w.ZodBranded,
|
|
617
617
|
type: this,
|
|
618
618
|
...O(this._def)
|
|
@@ -647,23 +647,23 @@ class Z {
|
|
|
647
647
|
return this.safeParse(null).success;
|
|
648
648
|
}
|
|
649
649
|
}
|
|
650
|
-
const
|
|
650
|
+
const is = /^c[^\s-]{8,}$/i, os = /^[0-9a-z]+$/, cs = /^[0-9A-HJKMNP-TV-Z]{26}$/, ds = /^[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, us = /^[a-z0-9_-]{21}$/i, ls = /^[-+]?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)?)??$/, ps = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, hs = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
651
651
|
let Gt;
|
|
652
|
-
const
|
|
653
|
-
function
|
|
652
|
+
const fs = /^(?:(?: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])$/, ms = /^(([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})))$/, _s = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, On = "((\\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])))", gs = new RegExp(`^${On}$`);
|
|
653
|
+
function Sn(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 ys(n) {
|
|
658
|
+
return new RegExp(`^${Sn(n)}$`);
|
|
659
659
|
}
|
|
660
|
-
function
|
|
661
|
-
let e = `${
|
|
660
|
+
function Zn(n) {
|
|
661
|
+
let e = `${On}T${Sn(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 vs(n, e) {
|
|
666
|
+
return !!((e === "v4" || !e) && fs.test(n) || (e === "v6" || !e) && ms.test(n));
|
|
667
667
|
}
|
|
668
668
|
class F extends Z {
|
|
669
669
|
_parse(e) {
|
|
@@ -714,43 +714,43 @@ class F extends Z {
|
|
|
714
714
|
message: r.message
|
|
715
715
|
}), t.dirty());
|
|
716
716
|
} else if (r.kind === "email")
|
|
717
|
-
|
|
717
|
+
ps.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
|
-
Gt || (Gt = new RegExp(
|
|
723
|
+
Gt || (Gt = new RegExp(hs, "u")), Gt.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
|
+
ds.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
|
+
us.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
|
+
is.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
|
+
os.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
|
+
cs.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 Z {
|
|
|
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" ? Zn(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" ? gs.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" ? ys(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" ? ls.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" ? vs(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" ? _s.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
|
...O(n)
|
|
1024
1024
|
});
|
|
1025
1025
|
};
|
|
1026
|
-
function
|
|
1026
|
+
function ws(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 me extends Z {
|
|
|
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" ? ws(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
|
|
@@ -1881,7 +1881,7 @@ class E extends Z {
|
|
|
1881
1881
|
});
|
|
1882
1882
|
}
|
|
1883
1883
|
keyof() {
|
|
1884
|
-
return
|
|
1884
|
+
return jn(N.objectKeys(this.shape));
|
|
1885
1885
|
}
|
|
1886
1886
|
}
|
|
1887
1887
|
E.create = (n, e) => new E({
|
|
@@ -1978,8 +1978,8 @@ it.create = (n, e) => new it({
|
|
|
1978
1978
|
typeName: w.ZodUnion,
|
|
1979
1979
|
...O(e)
|
|
1980
1980
|
});
|
|
1981
|
-
const pe = (n) => n instanceof dt ? pe(n.schema) : n instanceof q ? pe(n.innerType()) : n instanceof ut ? [n.value] : n instanceof ge ? n.options : n instanceof lt ? N.objectValues(n.enum) : n instanceof pt ? pe(n._def.innerType) : n instanceof rt ? [void 0] : n instanceof at ? [null] : n instanceof G ? [void 0, ...pe(n.unwrap())] : n instanceof ye ? [null, ...pe(n.unwrap())] : n instanceof
|
|
1982
|
-
class
|
|
1981
|
+
const pe = (n) => n instanceof dt ? pe(n.schema) : n instanceof q ? pe(n.innerType()) : n instanceof ut ? [n.value] : n instanceof ge ? n.options : n instanceof lt ? N.objectValues(n.enum) : n instanceof pt ? pe(n._def.innerType) : n instanceof rt ? [void 0] : n instanceof at ? [null] : n instanceof G ? [void 0, ...pe(n.unwrap())] : n instanceof ye ? [null, ...pe(n.unwrap())] : n instanceof ln || n instanceof ft ? pe(n.unwrap()) : n instanceof ht ? pe(n._def.innerType) : [];
|
|
1982
|
+
class Jt extends Z {
|
|
1983
1983
|
_parse(e) {
|
|
1984
1984
|
const { ctx: t } = this._processInputParams(e);
|
|
1985
1985
|
if (t.parsedType !== _.object)
|
|
@@ -2032,7 +2032,7 @@ class Kt extends Z {
|
|
|
2032
2032
|
r.set(c, a);
|
|
2033
2033
|
}
|
|
2034
2034
|
}
|
|
2035
|
-
return new
|
|
2035
|
+
return new Jt({
|
|
2036
2036
|
typeName: w.ZodDiscriminatedUnion,
|
|
2037
2037
|
discriminator: e,
|
|
2038
2038
|
options: t,
|
|
@@ -2041,14 +2041,14 @@ class Kt extends Z {
|
|
|
2041
2041
|
});
|
|
2042
2042
|
}
|
|
2043
2043
|
}
|
|
2044
|
-
function
|
|
2044
|
+
function an(n, e) {
|
|
2045
2045
|
const t = he(n), s = he(e);
|
|
2046
2046
|
if (n === e)
|
|
2047
2047
|
return { valid: !0, data: n };
|
|
2048
2048
|
if (t === _.object && s === _.object) {
|
|
2049
2049
|
const r = N.objectKeys(e), a = N.objectKeys(n).filter((c) => r.indexOf(c) !== -1), o = { ...n, ...e };
|
|
2050
2050
|
for (const c of a) {
|
|
2051
|
-
const d =
|
|
2051
|
+
const d = an(n[c], e[c]);
|
|
2052
2052
|
if (!d.valid)
|
|
2053
2053
|
return { valid: !1 };
|
|
2054
2054
|
o[c] = d.data;
|
|
@@ -2059,7 +2059,7 @@ function rn(n, e) {
|
|
|
2059
2059
|
return { valid: !1 };
|
|
2060
2060
|
const r = [];
|
|
2061
2061
|
for (let a = 0; a < n.length; a++) {
|
|
2062
|
-
const o = n[a], c = e[a], d =
|
|
2062
|
+
const o = n[a], c = e[a], d = an(o, c);
|
|
2063
2063
|
if (!d.valid)
|
|
2064
2064
|
return { valid: !1 };
|
|
2065
2065
|
r.push(d.data);
|
|
@@ -2070,10 +2070,10 @@ function rn(n, e) {
|
|
|
2070
2070
|
class ot extends Z {
|
|
2071
2071
|
_parse(e) {
|
|
2072
2072
|
const { status: t, ctx: s } = this._processInputParams(e), r = (a, o) => {
|
|
2073
|
-
if (
|
|
2073
|
+
if (sn(a) || sn(o))
|
|
2074
2074
|
return x;
|
|
2075
|
-
const c =
|
|
2076
|
-
return c.valid ? ((
|
|
2075
|
+
const c = an(a.value, o.value);
|
|
2076
|
+
return c.valid ? ((rn(a) || rn(o)) && t.dirty(), { status: t.value, value: c.data }) : (f(s, {
|
|
2077
2077
|
code: p.invalid_intersection_types
|
|
2078
2078
|
}), x);
|
|
2079
2079
|
};
|
|
@@ -2444,7 +2444,7 @@ ut.create = (n, e) => new ut({
|
|
|
2444
2444
|
typeName: w.ZodLiteral,
|
|
2445
2445
|
...O(e)
|
|
2446
2446
|
});
|
|
2447
|
-
function
|
|
2447
|
+
function jn(n, e) {
|
|
2448
2448
|
return new ge({
|
|
2449
2449
|
values: n,
|
|
2450
2450
|
typeName: w.ZodEnum,
|
|
@@ -2464,7 +2464,7 @@ class ge extends Z {
|
|
|
2464
2464
|
code: p.invalid_type
|
|
2465
2465
|
}), x;
|
|
2466
2466
|
}
|
|
2467
|
-
if (Pt(this, Ye) ||
|
|
2467
|
+
if (Pt(this, Ye) || Tn(this, Ye, new Set(this._def.values)), !Pt(this, Ye).has(e.data)) {
|
|
2468
2468
|
const t = this._getOrReturnCtx(e), s = this._def.values;
|
|
2469
2469
|
return f(t, {
|
|
2470
2470
|
received: t.data,
|
|
@@ -2509,7 +2509,7 @@ class ge extends Z {
|
|
|
2509
2509
|
}
|
|
2510
2510
|
}
|
|
2511
2511
|
Ye = /* @__PURE__ */ new WeakMap();
|
|
2512
|
-
ge.create =
|
|
2512
|
+
ge.create = jn;
|
|
2513
2513
|
class lt extends Z {
|
|
2514
2514
|
constructor() {
|
|
2515
2515
|
super(...arguments), Ge.set(this, void 0);
|
|
@@ -2524,7 +2524,7 @@ class lt extends Z {
|
|
|
2524
2524
|
code: p.invalid_type
|
|
2525
2525
|
}), x;
|
|
2526
2526
|
}
|
|
2527
|
-
if (Pt(this, Ge) ||
|
|
2527
|
+
if (Pt(this, Ge) || Tn(this, Ge, new Set(N.getValidEnumValues(this._def.values))), !Pt(this, Ge).has(e.data)) {
|
|
2528
2528
|
const r = N.objectValues(t);
|
|
2529
2529
|
return f(s, {
|
|
2530
2530
|
received: s.data,
|
|
@@ -2763,8 +2763,8 @@ Vt.create = (n) => new Vt({
|
|
|
2763
2763
|
typeName: w.ZodNaN,
|
|
2764
2764
|
...O(n)
|
|
2765
2765
|
});
|
|
2766
|
-
const
|
|
2767
|
-
class
|
|
2766
|
+
const ks = Symbol("zod_brand");
|
|
2767
|
+
class ln extends Z {
|
|
2768
2768
|
_parse(e) {
|
|
2769
2769
|
const { ctx: t } = this._processInputParams(e), s = t.data;
|
|
2770
2770
|
return this._def.type._parse({
|
|
@@ -2831,7 +2831,7 @@ ft.create = (n, e) => new ft({
|
|
|
2831
2831
|
typeName: w.ZodReadonly,
|
|
2832
2832
|
...O(e)
|
|
2833
2833
|
});
|
|
2834
|
-
function
|
|
2834
|
+
function Nn(n, e = {}, t) {
|
|
2835
2835
|
return n ? Be.create().superRefine((s, r) => {
|
|
2836
2836
|
var a, o;
|
|
2837
2837
|
if (!n(s)) {
|
|
@@ -2840,16 +2840,16 @@ function jn(n, e = {}, t) {
|
|
|
2840
2840
|
}
|
|
2841
2841
|
}) : Be.create();
|
|
2842
2842
|
}
|
|
2843
|
-
const
|
|
2843
|
+
const bs = {
|
|
2844
2844
|
object: E.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 xs = (n, e = {
|
|
2851
2851
|
message: `Input not instance of ${n.name}`
|
|
2852
|
-
}) =>
|
|
2852
|
+
}) => Nn((t) => t instanceof n, e), In = F.create, Cn = me.create, Ts = Vt.create, Os = _e.create, En = st.create, Ss = Ne.create, Zs = Dt.create, js = rt.create, Ns = at.create, Is = Be.create, Cs = Ze.create, Es = ie.create, As = Mt.create, Rs = B.create, $s = E.create, Ps = E.strictCreate, Ds = it.create, Ms = Jt.create, Ls = ot.create, Vs = te.create, Us = ct.create, Fs = Lt.create, zs = Ie.create, Bs = Ue.create, Ws = dt.create, qs = ut.create, Ks = ge.create, Js = lt.create, Qs = We.create, yn = q.create, Hs = G.create, Ys = ye.create, Gs = q.createWithPreprocess, Xs = Nt.create, er = () => In().optional(), tr = () => Cn().optional(), nr = () => En().optional(), sr = {
|
|
2853
2853
|
string: (n) => F.create({ ...n, coerce: !0 }),
|
|
2854
2854
|
number: (n) => me.create({ ...n, coerce: !0 }),
|
|
2855
2855
|
boolean: (n) => st.create({
|
|
@@ -2858,33 +2858,33 @@ const bs = (n, e = {
|
|
|
2858
2858
|
}),
|
|
2859
2859
|
bigint: (n) => _e.create({ ...n, coerce: !0 }),
|
|
2860
2860
|
date: (n) => Ne.create({ ...n, coerce: !0 })
|
|
2861
|
-
},
|
|
2861
|
+
}, rr = x;
|
|
2862
2862
|
var i = /* @__PURE__ */ Object.freeze({
|
|
2863
2863
|
__proto__: null,
|
|
2864
2864
|
defaultErrorMap: ze,
|
|
2865
|
-
setErrorMap:
|
|
2865
|
+
setErrorMap: rs,
|
|
2866
2866
|
getErrorMap: At,
|
|
2867
2867
|
makeIssue: Rt,
|
|
2868
|
-
EMPTY_PATH:
|
|
2868
|
+
EMPTY_PATH: as,
|
|
2869
2869
|
addIssueToContext: f,
|
|
2870
2870
|
ParseStatus: $,
|
|
2871
2871
|
INVALID: x,
|
|
2872
2872
|
DIRTY: $t,
|
|
2873
2873
|
OK: D,
|
|
2874
|
-
isAborted:
|
|
2875
|
-
isDirty:
|
|
2874
|
+
isAborted: sn,
|
|
2875
|
+
isDirty: rn,
|
|
2876
2876
|
isValid: tt,
|
|
2877
2877
|
isAsync: nt,
|
|
2878
2878
|
get util() {
|
|
2879
2879
|
return N;
|
|
2880
2880
|
},
|
|
2881
2881
|
get objectUtil() {
|
|
2882
|
-
return
|
|
2882
|
+
return nn;
|
|
2883
2883
|
},
|
|
2884
2884
|
ZodParsedType: _,
|
|
2885
2885
|
getParsedType: he,
|
|
2886
2886
|
ZodType: Z,
|
|
2887
|
-
datetimeRegex:
|
|
2887
|
+
datetimeRegex: Zn,
|
|
2888
2888
|
ZodString: F,
|
|
2889
2889
|
ZodNumber: me,
|
|
2890
2890
|
ZodBigInt: _e,
|
|
@@ -2900,7 +2900,7 @@ var i = /* @__PURE__ */ Object.freeze({
|
|
|
2900
2900
|
ZodArray: B,
|
|
2901
2901
|
ZodObject: E,
|
|
2902
2902
|
ZodUnion: it,
|
|
2903
|
-
ZodDiscriminatedUnion:
|
|
2903
|
+
ZodDiscriminatedUnion: Jt,
|
|
2904
2904
|
ZodIntersection: ot,
|
|
2905
2905
|
ZodTuple: te,
|
|
2906
2906
|
ZodRecord: ct,
|
|
@@ -2919,72 +2919,72 @@ var i = /* @__PURE__ */ Object.freeze({
|
|
|
2919
2919
|
ZodDefault: pt,
|
|
2920
2920
|
ZodCatch: ht,
|
|
2921
2921
|
ZodNaN: Vt,
|
|
2922
|
-
BRAND:
|
|
2923
|
-
ZodBranded:
|
|
2922
|
+
BRAND: ks,
|
|
2923
|
+
ZodBranded: ln,
|
|
2924
2924
|
ZodPipeline: Nt,
|
|
2925
2925
|
ZodReadonly: ft,
|
|
2926
|
-
custom:
|
|
2926
|
+
custom: Nn,
|
|
2927
2927
|
Schema: Z,
|
|
2928
2928
|
ZodSchema: Z,
|
|
2929
|
-
late:
|
|
2929
|
+
late: bs,
|
|
2930
2930
|
get ZodFirstPartyTypeKind() {
|
|
2931
2931
|
return w;
|
|
2932
2932
|
},
|
|
2933
|
-
coerce:
|
|
2934
|
-
any:
|
|
2935
|
-
array:
|
|
2936
|
-
bigint:
|
|
2937
|
-
boolean:
|
|
2938
|
-
date:
|
|
2939
|
-
discriminatedUnion:
|
|
2940
|
-
effect:
|
|
2941
|
-
enum:
|
|
2942
|
-
function:
|
|
2943
|
-
instanceof:
|
|
2944
|
-
intersection:
|
|
2945
|
-
lazy:
|
|
2946
|
-
literal:
|
|
2947
|
-
map:
|
|
2948
|
-
nan:
|
|
2933
|
+
coerce: sr,
|
|
2934
|
+
any: Is,
|
|
2935
|
+
array: Rs,
|
|
2936
|
+
bigint: Os,
|
|
2937
|
+
boolean: En,
|
|
2938
|
+
date: Ss,
|
|
2939
|
+
discriminatedUnion: Ms,
|
|
2940
|
+
effect: yn,
|
|
2941
|
+
enum: Ks,
|
|
2942
|
+
function: Bs,
|
|
2943
|
+
instanceof: xs,
|
|
2944
|
+
intersection: Ls,
|
|
2945
|
+
lazy: Ws,
|
|
2946
|
+
literal: qs,
|
|
2947
|
+
map: Fs,
|
|
2948
|
+
nan: Ts,
|
|
2949
2949
|
nativeEnum: Js,
|
|
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:
|
|
2950
|
+
never: Es,
|
|
2951
|
+
null: Ns,
|
|
2952
|
+
nullable: Ys,
|
|
2953
|
+
number: Cn,
|
|
2954
|
+
object: $s,
|
|
2955
|
+
oboolean: nr,
|
|
2956
|
+
onumber: tr,
|
|
2957
|
+
optional: Hs,
|
|
2958
|
+
ostring: er,
|
|
2959
|
+
pipeline: Xs,
|
|
2960
|
+
preprocess: Gs,
|
|
2961
|
+
promise: Qs,
|
|
2962
|
+
record: Us,
|
|
2963
|
+
set: zs,
|
|
2964
|
+
strictObject: Ps,
|
|
2965
|
+
string: In,
|
|
2966
|
+
symbol: Zs,
|
|
2967
|
+
transformer: yn,
|
|
2968
|
+
tuple: Vs,
|
|
2969
|
+
undefined: js,
|
|
2970
|
+
union: Ds,
|
|
2971
|
+
unknown: Cs,
|
|
2972
|
+
void: As,
|
|
2973
|
+
NEVER: rr,
|
|
2974
2974
|
ZodIssueCode: p,
|
|
2975
|
-
quotelessJson:
|
|
2975
|
+
quotelessJson: ss,
|
|
2976
2976
|
ZodError: V
|
|
2977
2977
|
});
|
|
2978
|
-
|
|
2978
|
+
ns(i);
|
|
2979
2979
|
i.object({
|
|
2980
2980
|
start: i.number(),
|
|
2981
2981
|
limit: i.number(),
|
|
2982
2982
|
length: i.number()
|
|
2983
2983
|
});
|
|
2984
|
-
const
|
|
2984
|
+
const pn = i.object({
|
|
2985
2985
|
created_at: i.string(),
|
|
2986
2986
|
updated_at: i.string()
|
|
2987
|
-
}),
|
|
2987
|
+
}), ar = 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 ln = 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()), ir = i.object({
|
|
2997
2997
|
connection: i.string(),
|
|
2998
2998
|
user_id: i.string(),
|
|
2999
2999
|
provider: i.string(),
|
|
@@ -3001,8 +3001,8 @@ const ln = 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: ar.optional()
|
|
3005
|
+
}), An = 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 ln = i.object({
|
|
|
3014
3014
|
linked_to: i.string().optional(),
|
|
3015
3015
|
profileData: i.string().optional(),
|
|
3016
3016
|
user_id: i.string().optional()
|
|
3017
|
-
}),
|
|
3017
|
+
}), or = An.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 ln = i.object({
|
|
|
3023
3023
|
provider: i.string().default("email"),
|
|
3024
3024
|
connection: i.string().default("email")
|
|
3025
3025
|
});
|
|
3026
|
-
|
|
3026
|
+
or.extend(pn.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(ir).optional()
|
|
3033
3033
|
});
|
|
3034
|
-
|
|
3034
|
+
An.extend({
|
|
3035
3035
|
email: i.string(),
|
|
3036
3036
|
login_count: i.number(),
|
|
3037
3037
|
multifactor: i.array(i.string()).optional(),
|
|
@@ -3039,7 +3039,7 @@ En.extend({
|
|
|
3039
3039
|
last_login: i.string().optional(),
|
|
3040
3040
|
user_id: i.string()
|
|
3041
3041
|
}).catchall(i.any());
|
|
3042
|
-
const
|
|
3042
|
+
const cr = i.object({
|
|
3043
3043
|
id: i.string(),
|
|
3044
3044
|
name: i.string(),
|
|
3045
3045
|
callbacks: i.string().transform((n) => n === null ? "" : n).default("").openapi({
|
|
@@ -3071,19 +3071,19 @@ const or = i.object({
|
|
|
3071
3071
|
i.object({
|
|
3072
3072
|
created_at: i.string().transform((n) => n === null ? "" : n),
|
|
3073
3073
|
updated_at: i.string().transform((n) => n === null ? "" : n)
|
|
3074
|
-
}).extend(
|
|
3075
|
-
var
|
|
3074
|
+
}).extend(cr.shape);
|
|
3075
|
+
var Rn = /* @__PURE__ */ ((n) => (n.TOKEN = "token", n.TOKEN_ID_TOKEN = "token id_token", n.CODE = "code", n))(Rn || {}), $n = /* @__PURE__ */ ((n) => (n.QUERY = "query", n.FRAGMENT = "fragment", n.FORM_POST = "form_post", n.WEB_MESSAGE = "web_message", n.SAML_POST = "saml_post", n))($n || {}), Pn = /* @__PURE__ */ ((n) => (n.S265 = "S256", n.plain = "plain", n))(Pn || {});
|
|
3076
3076
|
const Qt = i.object({
|
|
3077
3077
|
client_id: i.string(),
|
|
3078
3078
|
vendor_id: i.string().optional(),
|
|
3079
|
-
response_type: i.nativeEnum(
|
|
3080
|
-
response_mode: i.nativeEnum(
|
|
3079
|
+
response_type: i.nativeEnum(Rn).optional(),
|
|
3080
|
+
response_mode: i.nativeEnum($n).optional(),
|
|
3081
3081
|
redirect_uri: i.string().optional(),
|
|
3082
3082
|
audience: i.string().optional(),
|
|
3083
3083
|
state: i.string().optional(),
|
|
3084
3084
|
nonce: i.string().optional(),
|
|
3085
3085
|
scope: i.string().optional(),
|
|
3086
|
-
code_challenge_method: i.nativeEnum(
|
|
3086
|
+
code_challenge_method: i.nativeEnum(Pn).optional(),
|
|
3087
3087
|
code_challenge: i.string().optional(),
|
|
3088
3088
|
username: i.string().optional()
|
|
3089
3089
|
});
|
|
@@ -3103,7 +3103,7 @@ i.object({
|
|
|
3103
3103
|
url: i.string()
|
|
3104
3104
|
}).optional()
|
|
3105
3105
|
});
|
|
3106
|
-
const
|
|
3106
|
+
const dr = i.object({
|
|
3107
3107
|
id: i.string().optional(),
|
|
3108
3108
|
name: i.string(),
|
|
3109
3109
|
client_id: i.string().optional(),
|
|
@@ -3118,20 +3118,20 @@ const cr = i.object({
|
|
|
3118
3118
|
token_exchange_basic_auth: i.boolean().optional(),
|
|
3119
3119
|
userinfo_endpoint: i.string().optional(),
|
|
3120
3120
|
scope: i.string().optional()
|
|
3121
|
-
}),
|
|
3121
|
+
}), hn = i.object({
|
|
3122
3122
|
id: i.string(),
|
|
3123
3123
|
created_at: i.string().transform((n) => n === null ? "" : n),
|
|
3124
3124
|
updated_at: i.string().transform((n) => n === null ? "" : n)
|
|
3125
|
-
}).extend(
|
|
3125
|
+
}).extend(dr.shape), ur = i.object({
|
|
3126
3126
|
domain: i.string(),
|
|
3127
3127
|
dkim_private_key: i.string().optional(),
|
|
3128
3128
|
dkim_public_key: i.string().optional(),
|
|
3129
3129
|
email_api_key: i.string().optional(),
|
|
3130
3130
|
email_service: i.union([i.literal("mailgun"), i.literal("mailchannels")]).optional()
|
|
3131
|
-
}),
|
|
3131
|
+
}), Dn = i.object({
|
|
3132
3132
|
id: i.string(),
|
|
3133
3133
|
name: i.string(),
|
|
3134
|
-
domains: i.array(
|
|
3134
|
+
domains: i.array(ur),
|
|
3135
3135
|
allowed_callback_urls: i.array(i.string()),
|
|
3136
3136
|
allowed_logout_urls: i.array(i.string()),
|
|
3137
3137
|
allowed_web_origins: i.array(i.string()),
|
|
@@ -3155,44 +3155,44 @@ const cr = i.object({
|
|
|
3155
3155
|
language: i.string().length(2).optional()
|
|
3156
3156
|
})
|
|
3157
3157
|
});
|
|
3158
|
-
|
|
3159
|
-
connections: i.array(
|
|
3158
|
+
Dn.extend({
|
|
3159
|
+
connections: i.array(hn)
|
|
3160
3160
|
});
|
|
3161
|
-
|
|
3162
|
-
connections: i.array(
|
|
3161
|
+
Dn.extend({
|
|
3162
|
+
connections: i.array(hn.partial())
|
|
3163
3163
|
});
|
|
3164
|
-
const
|
|
3164
|
+
const lr = i.enum([
|
|
3165
3165
|
"password_reset",
|
|
3166
3166
|
"email_verification",
|
|
3167
3167
|
"otp",
|
|
3168
3168
|
"oauth2",
|
|
3169
3169
|
"oauth2_state",
|
|
3170
3170
|
"ticket"
|
|
3171
|
-
]),
|
|
3171
|
+
]), pr = i.object({
|
|
3172
3172
|
code_id: i.string().openapi({
|
|
3173
3173
|
description: "The code that will be used in for instance an email verification flow"
|
|
3174
3174
|
}),
|
|
3175
3175
|
login_id: i.string().openapi({
|
|
3176
3176
|
description: "The id of the login session that the code is connected to"
|
|
3177
3177
|
}),
|
|
3178
|
-
code_type:
|
|
3178
|
+
code_type: lr,
|
|
3179
3179
|
expires_at: i.string(),
|
|
3180
3180
|
used_at: i.string().optional()
|
|
3181
|
-
}), pr = i.object({
|
|
3182
|
-
...lr.shape,
|
|
3183
|
-
created_at: i.string()
|
|
3184
3181
|
}), hr = i.object({
|
|
3182
|
+
...pr.shape,
|
|
3183
|
+
created_at: i.string()
|
|
3184
|
+
}), fr = i.object({
|
|
3185
3185
|
domain: i.string(),
|
|
3186
3186
|
dkim_private_key: i.string().optional(),
|
|
3187
3187
|
dkim_public_key: i.string().optional(),
|
|
3188
3188
|
email_api_key: i.string().optional(),
|
|
3189
3189
|
email_service: i.enum(["mailgun", "mailchannels"])
|
|
3190
3190
|
});
|
|
3191
|
-
|
|
3192
|
-
...
|
|
3191
|
+
pn.extend({
|
|
3192
|
+
...fr.shape,
|
|
3193
3193
|
id: i.string()
|
|
3194
3194
|
});
|
|
3195
|
-
const
|
|
3195
|
+
const mr = i.object({
|
|
3196
3196
|
trigger_id: i.enum([
|
|
3197
3197
|
"pre-user-signup",
|
|
3198
3198
|
"post-user-registration",
|
|
@@ -3204,11 +3204,11 @@ const fr = i.object({
|
|
|
3204
3204
|
synchronous: i.boolean().default(!1),
|
|
3205
3205
|
priority: i.number().optional()
|
|
3206
3206
|
});
|
|
3207
|
-
|
|
3208
|
-
...
|
|
3207
|
+
mr.extend({
|
|
3208
|
+
...pn.shape,
|
|
3209
3209
|
hook_id: i.string()
|
|
3210
3210
|
});
|
|
3211
|
-
const
|
|
3211
|
+
const _r = i.object({
|
|
3212
3212
|
alg: i.string(),
|
|
3213
3213
|
e: i.string(),
|
|
3214
3214
|
kid: i.string(),
|
|
@@ -3217,7 +3217,7 @@ const mr = i.object({
|
|
|
3217
3217
|
use: i.string().optional()
|
|
3218
3218
|
});
|
|
3219
3219
|
i.object({
|
|
3220
|
-
keys: i.array(
|
|
3220
|
+
keys: i.array(_r)
|
|
3221
3221
|
});
|
|
3222
3222
|
i.object({
|
|
3223
3223
|
issuer: i.string(),
|
|
@@ -3241,7 +3241,7 @@ i.object({
|
|
|
3241
3241
|
request_parameter_supported: i.boolean(),
|
|
3242
3242
|
token_endpoint_auth_signing_alg_values_supported: i.array(i.string())
|
|
3243
3243
|
});
|
|
3244
|
-
const
|
|
3244
|
+
const gr = i.object({
|
|
3245
3245
|
auth0Client: i.string().optional(),
|
|
3246
3246
|
authParams: Qt,
|
|
3247
3247
|
expires_at: i.string(),
|
|
@@ -3249,14 +3249,14 @@ const _r = i.object({
|
|
|
3249
3249
|
ip: i.string().optional()
|
|
3250
3250
|
}).openapi({
|
|
3251
3251
|
description: "This represents a login sesion"
|
|
3252
|
-
}),
|
|
3253
|
-
...
|
|
3252
|
+
}), yr = i.object({
|
|
3253
|
+
...gr.shape,
|
|
3254
3254
|
login_id: i.string().openapi({
|
|
3255
3255
|
description: "This is is used as the state in the universal login"
|
|
3256
3256
|
}),
|
|
3257
3257
|
created_at: i.string(),
|
|
3258
3258
|
updated_at: i.string()
|
|
3259
|
-
}),
|
|
3259
|
+
}), vr = i.enum([
|
|
3260
3260
|
"cls",
|
|
3261
3261
|
// CODE_LINK_SENT
|
|
3262
3262
|
"fsa",
|
|
@@ -3305,7 +3305,7 @@ const _r = i.object({
|
|
|
3305
3305
|
// SUCCESS_VERIFICATION_EMAIL
|
|
3306
3306
|
"svr"
|
|
3307
3307
|
// SUCCESS_VERIFICATION_EMAIL_REQUEST
|
|
3308
|
-
]),
|
|
3308
|
+
]), wr = i.object({
|
|
3309
3309
|
name: i.string(),
|
|
3310
3310
|
version: i.string(),
|
|
3311
3311
|
env: i.object({
|
|
@@ -3313,7 +3313,7 @@ const _r = i.object({
|
|
|
3313
3313
|
}).optional()
|
|
3314
3314
|
});
|
|
3315
3315
|
i.object({
|
|
3316
|
-
type:
|
|
3316
|
+
type: vr,
|
|
3317
3317
|
date: i.string(),
|
|
3318
3318
|
description: i.string().optional(),
|
|
3319
3319
|
log_id: i.string().optional(),
|
|
@@ -3334,19 +3334,19 @@ i.object({
|
|
|
3334
3334
|
strategy: i.string().optional(),
|
|
3335
3335
|
strategy_type: i.string().optional(),
|
|
3336
3336
|
hostname: i.string().optional(),
|
|
3337
|
-
auth0_client:
|
|
3337
|
+
auth0_client: wr.optional()
|
|
3338
3338
|
});
|
|
3339
|
-
const
|
|
3339
|
+
const kr = i.object({
|
|
3340
3340
|
user_id: i.string(),
|
|
3341
3341
|
password: i.string(),
|
|
3342
3342
|
algorithm: i.enum(["bcrypt", "argon2id"]).default("argon2id")
|
|
3343
3343
|
});
|
|
3344
3344
|
i.object({
|
|
3345
|
-
...
|
|
3345
|
+
...kr.shape,
|
|
3346
3346
|
created_at: i.string(),
|
|
3347
3347
|
updated_at: i.string()
|
|
3348
3348
|
});
|
|
3349
|
-
const
|
|
3349
|
+
const br = i.object({
|
|
3350
3350
|
session_id: i.string(),
|
|
3351
3351
|
client_id: i.string(),
|
|
3352
3352
|
expires_at: i.string(),
|
|
@@ -3356,7 +3356,7 @@ const kr = i.object({
|
|
|
3356
3356
|
});
|
|
3357
3357
|
i.object({
|
|
3358
3358
|
created_at: i.string(),
|
|
3359
|
-
...
|
|
3359
|
+
...br.shape
|
|
3360
3360
|
});
|
|
3361
3361
|
i.object({
|
|
3362
3362
|
private_key: i.string(),
|
|
@@ -3385,7 +3385,7 @@ i.object({
|
|
|
3385
3385
|
revoked: i.boolean().optional().openapi({ description: "True if the key is revoked" }),
|
|
3386
3386
|
revoked_at: i.string().optional().openapi({ description: "The date and time when the key was revoked" })
|
|
3387
3387
|
});
|
|
3388
|
-
const
|
|
3388
|
+
const xr = i.object({
|
|
3389
3389
|
name: i.string(),
|
|
3390
3390
|
audience: i.string(),
|
|
3391
3391
|
sender_email: i.string().email(),
|
|
@@ -3396,7 +3396,7 @@ const br = i.object({
|
|
|
3396
3396
|
secondary_color: i.string().optional(),
|
|
3397
3397
|
language: i.string().optional()
|
|
3398
3398
|
});
|
|
3399
|
-
|
|
3399
|
+
xr.extend({
|
|
3400
3400
|
created_at: i.string().transform((n) => n === null ? "" : n),
|
|
3401
3401
|
updated_at: i.string().transform((n) => n === null ? "" : n)
|
|
3402
3402
|
});
|
|
@@ -3418,10 +3418,10 @@ i.object({
|
|
|
3418
3418
|
siteUrl: i.string().nullable(),
|
|
3419
3419
|
manageSubscriptionsUrl: i.string().optional()
|
|
3420
3420
|
});
|
|
3421
|
-
var
|
|
3422
|
-
const
|
|
3421
|
+
var Mn = /* @__PURE__ */ ((n) => (n.RefreshToken = "refresh_token", n.AuthorizationCode = "authorization_code", n.ClientCredential = "client_credentials", n.Passwordless = "passwordless", n.Password = "password", n))(Mn || {});
|
|
3422
|
+
const fn = i.nativeEnum(Mn);
|
|
3423
3423
|
i.object({
|
|
3424
|
-
grant_type:
|
|
3424
|
+
grant_type: fn.refine(
|
|
3425
3425
|
(n) => n === "authorization_code"
|
|
3426
3426
|
/* AuthorizationCode */
|
|
3427
3427
|
),
|
|
@@ -3430,7 +3430,7 @@ i.object({
|
|
|
3430
3430
|
client_id: i.string()
|
|
3431
3431
|
});
|
|
3432
3432
|
i.object({
|
|
3433
|
-
grant_type:
|
|
3433
|
+
grant_type: fn.refine(
|
|
3434
3434
|
(n) => n === "authorization_code"
|
|
3435
3435
|
/* AuthorizationCode */
|
|
3436
3436
|
),
|
|
@@ -3440,7 +3440,7 @@ i.object({
|
|
|
3440
3440
|
redirect_uri: i.string()
|
|
3441
3441
|
});
|
|
3442
3442
|
i.object({
|
|
3443
|
-
grant_type:
|
|
3443
|
+
grant_type: fn.refine(
|
|
3444
3444
|
(n) => n === "client_credentials"
|
|
3445
3445
|
/* ClientCredential */
|
|
3446
3446
|
),
|
|
@@ -3462,7 +3462,7 @@ i.object({
|
|
|
3462
3462
|
code: i.string(),
|
|
3463
3463
|
state: i.string().optional()
|
|
3464
3464
|
});
|
|
3465
|
-
const
|
|
3465
|
+
const Tr = i.object({
|
|
3466
3466
|
button_border_radius: i.number(),
|
|
3467
3467
|
button_border_weight: i.number(),
|
|
3468
3468
|
buttons_style: i.enum(["pill"]),
|
|
@@ -3472,7 +3472,7 @@ const xr = i.object({
|
|
|
3472
3472
|
show_widget_shadow: i.boolean(),
|
|
3473
3473
|
widget_border_weight: i.number(),
|
|
3474
3474
|
widget_corner_radius: i.number()
|
|
3475
|
-
}),
|
|
3475
|
+
}), Or = i.object({
|
|
3476
3476
|
base_focus_color: i.string(),
|
|
3477
3477
|
base_hover_color: i.string(),
|
|
3478
3478
|
body_text: i.string(),
|
|
@@ -3495,7 +3495,7 @@ const xr = i.object({
|
|
|
3495
3495
|
}), De = i.object({
|
|
3496
3496
|
bold: i.boolean(),
|
|
3497
3497
|
size: i.number()
|
|
3498
|
-
}),
|
|
3498
|
+
}), Sr = i.object({
|
|
3499
3499
|
body_text: De,
|
|
3500
3500
|
buttons_text: De,
|
|
3501
3501
|
font_url: i.string(),
|
|
@@ -3505,39 +3505,39 @@ const xr = i.object({
|
|
|
3505
3505
|
reference_text_size: i.number(),
|
|
3506
3506
|
subtitle: De,
|
|
3507
3507
|
title: De
|
|
3508
|
-
}),
|
|
3508
|
+
}), Zr = i.object({
|
|
3509
3509
|
background_color: i.string(),
|
|
3510
3510
|
background_image_url: i.string(),
|
|
3511
3511
|
page_layout: i.enum(["center"])
|
|
3512
|
-
}),
|
|
3512
|
+
}), jr = i.object({
|
|
3513
3513
|
header_text_alignment: i.enum(["center"]),
|
|
3514
3514
|
logo_height: i.number(),
|
|
3515
3515
|
logo_position: i.enum(["center"]),
|
|
3516
3516
|
logo_url: i.string(),
|
|
3517
3517
|
social_buttons_layout: i.enum(["bottom"])
|
|
3518
|
-
}),
|
|
3519
|
-
borders:
|
|
3520
|
-
colors:
|
|
3518
|
+
}), Nr = i.object({
|
|
3519
|
+
borders: Tr,
|
|
3520
|
+
colors: Or,
|
|
3521
3521
|
displayName: i.string(),
|
|
3522
|
-
fonts:
|
|
3523
|
-
page_background:
|
|
3524
|
-
widget:
|
|
3522
|
+
fonts: Sr,
|
|
3523
|
+
page_background: Zr,
|
|
3524
|
+
widget: jr
|
|
3525
3525
|
});
|
|
3526
|
-
|
|
3526
|
+
Nr.extend({
|
|
3527
3527
|
themeId: i.string()
|
|
3528
3528
|
});
|
|
3529
|
-
const
|
|
3529
|
+
const Ir = i.object({
|
|
3530
3530
|
id: i.string(),
|
|
3531
3531
|
expires_at: i.string(),
|
|
3532
3532
|
auth0Client: i.string().optional(),
|
|
3533
3533
|
authParams: Qt
|
|
3534
3534
|
});
|
|
3535
3535
|
i.object({
|
|
3536
|
-
...
|
|
3536
|
+
...Ir.shape,
|
|
3537
3537
|
created_at: i.string(),
|
|
3538
3538
|
updated_at: i.string()
|
|
3539
3539
|
});
|
|
3540
|
-
const
|
|
3540
|
+
const Cr = i.object({
|
|
3541
3541
|
id: i.string(),
|
|
3542
3542
|
email: i.string(),
|
|
3543
3543
|
code: i.string(),
|
|
@@ -3550,9 +3550,9 @@ const Ir = i.object({
|
|
|
3550
3550
|
});
|
|
3551
3551
|
i.object({
|
|
3552
3552
|
created_at: i.string(),
|
|
3553
|
-
...
|
|
3553
|
+
...Cr.shape
|
|
3554
3554
|
});
|
|
3555
|
-
const
|
|
3555
|
+
const Er = i.object({
|
|
3556
3556
|
authParams: Qt,
|
|
3557
3557
|
code: i.string(),
|
|
3558
3558
|
user_id: i.string(),
|
|
@@ -3561,16 +3561,16 @@ const Cr = i.object({
|
|
|
3561
3561
|
used_at: i.string().optional()
|
|
3562
3562
|
});
|
|
3563
3563
|
i.object({
|
|
3564
|
-
...
|
|
3564
|
+
...Er.shape,
|
|
3565
3565
|
created_at: i.string()
|
|
3566
3566
|
});
|
|
3567
|
-
function
|
|
3567
|
+
function mn(n) {
|
|
3568
3568
|
const [e, t] = n.split("|");
|
|
3569
3569
|
if (!e || !t)
|
|
3570
3570
|
throw new Error(`Invalid user_id: ${n}`);
|
|
3571
3571
|
return { connection: e, id: t };
|
|
3572
3572
|
}
|
|
3573
|
-
function
|
|
3573
|
+
function Ln(n) {
|
|
3574
3574
|
let e = {};
|
|
3575
3575
|
try {
|
|
3576
3576
|
e = JSON.parse(n.profileData || "{}");
|
|
@@ -3580,7 +3580,7 @@ function Mn(n) {
|
|
|
3580
3580
|
return {
|
|
3581
3581
|
connection: n.connection,
|
|
3582
3582
|
provider: n.provider,
|
|
3583
|
-
user_id:
|
|
3583
|
+
user_id: mn(n.user_id).id,
|
|
3584
3584
|
isSocial: !!n.is_social,
|
|
3585
3585
|
profileData: {
|
|
3586
3586
|
email: n.email,
|
|
@@ -3589,7 +3589,7 @@ function Mn(n) {
|
|
|
3589
3589
|
}
|
|
3590
3590
|
};
|
|
3591
3591
|
}
|
|
3592
|
-
function
|
|
3592
|
+
function Ar(n) {
|
|
3593
3593
|
return async (e, t) => {
|
|
3594
3594
|
const [s, r] = await Promise.all([
|
|
3595
3595
|
n.selectFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", t).selectAll().executeTakeFirst(),
|
|
@@ -3606,10 +3606,10 @@ function Er(n) {
|
|
|
3606
3606
|
{
|
|
3607
3607
|
connection: s.connection,
|
|
3608
3608
|
provider: s.provider,
|
|
3609
|
-
user_id:
|
|
3609
|
+
user_id: mn(s.user_id).id,
|
|
3610
3610
|
isSocial: !!s.is_social
|
|
3611
3611
|
},
|
|
3612
|
-
...r.map(
|
|
3612
|
+
...r.map(Ln)
|
|
3613
3613
|
]
|
|
3614
3614
|
};
|
|
3615
3615
|
return R(c);
|
|
@@ -3655,7 +3655,7 @@ function Ae(n, e, t, s) {
|
|
|
3655
3655
|
function xe(n) {
|
|
3656
3656
|
return typeof n == "string" ? parseInt(n, 10) : typeof n == "bigint" ? Number(n) : n;
|
|
3657
3657
|
}
|
|
3658
|
-
function
|
|
3658
|
+
function Rr(n) {
|
|
3659
3659
|
return async (e, t) => {
|
|
3660
3660
|
let s = n.selectFrom("users").where("users.tenant_id", "=", e);
|
|
3661
3661
|
if (t.q && (s = Ae(n, s, t.q, ["email", "name"])), t.sort && t.sort.sort_by) {
|
|
@@ -3674,10 +3674,10 @@ function Ar(n) {
|
|
|
3674
3674
|
{
|
|
3675
3675
|
connection: l.connection,
|
|
3676
3676
|
provider: l.provider,
|
|
3677
|
-
user_id:
|
|
3677
|
+
user_id: mn(l.user_id).id,
|
|
3678
3678
|
isSocial: !!l.is_social
|
|
3679
3679
|
},
|
|
3680
|
-
...T.map(
|
|
3680
|
+
...T.map(Ln)
|
|
3681
3681
|
]
|
|
3682
3682
|
});
|
|
3683
3683
|
}), { count: u } = await s.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
@@ -3689,48 +3689,48 @@ function Ar(n) {
|
|
|
3689
3689
|
};
|
|
3690
3690
|
};
|
|
3691
3691
|
}
|
|
3692
|
-
function
|
|
3692
|
+
function $r(n) {
|
|
3693
3693
|
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);
|
|
3694
3694
|
}
|
|
3695
|
-
function
|
|
3695
|
+
function Pr(n) {
|
|
3696
3696
|
if (n.email_verified !== void 0)
|
|
3697
3697
|
return n.email_verified ? 1 : 0;
|
|
3698
3698
|
}
|
|
3699
|
-
function
|
|
3699
|
+
function Dr(n) {
|
|
3700
3700
|
return async (e, t, s) => {
|
|
3701
3701
|
const r = {
|
|
3702
3702
|
...s,
|
|
3703
|
-
email_verified:
|
|
3703
|
+
email_verified: Pr(s),
|
|
3704
3704
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3705
3705
|
};
|
|
3706
3706
|
return (await n.updateTable("users").set(r).where("users.tenant_id", "=", e).where("users.user_id", "=", t).execute()).length === 1;
|
|
3707
3707
|
};
|
|
3708
3708
|
}
|
|
3709
|
-
function
|
|
3709
|
+
function Mr(n) {
|
|
3710
3710
|
return async (e, t, s, r) => {
|
|
3711
3711
|
const a = { linked_to: null };
|
|
3712
3712
|
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;
|
|
3713
3713
|
};
|
|
3714
3714
|
}
|
|
3715
|
-
function
|
|
3715
|
+
function Lr(n) {
|
|
3716
3716
|
return {
|
|
3717
|
-
create:
|
|
3718
|
-
remove:
|
|
3719
|
-
get:
|
|
3720
|
-
list:
|
|
3721
|
-
update:
|
|
3717
|
+
create: Xn(n),
|
|
3718
|
+
remove: $r(n),
|
|
3719
|
+
get: Ar(n),
|
|
3720
|
+
list: Rr(n),
|
|
3721
|
+
update: Dr(n),
|
|
3722
3722
|
// TODO - think about this more when other issues fixed
|
|
3723
|
-
unlink:
|
|
3723
|
+
unlink: Mr(n)
|
|
3724
3724
|
};
|
|
3725
3725
|
}
|
|
3726
|
-
const
|
|
3726
|
+
const Vr = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
3727
3727
|
let Re = (n = 21) => {
|
|
3728
3728
|
let e = "", t = crypto.getRandomValues(new Uint8Array(n));
|
|
3729
3729
|
for (; n--; )
|
|
3730
|
-
e +=
|
|
3730
|
+
e += Vr[t[n] & 63];
|
|
3731
3731
|
return e;
|
|
3732
3732
|
};
|
|
3733
|
-
function
|
|
3733
|
+
function Ur(n) {
|
|
3734
3734
|
return async (e) => {
|
|
3735
3735
|
const t = {
|
|
3736
3736
|
id: e.id || Re(),
|
|
@@ -3741,13 +3741,13 @@ function Vr(n) {
|
|
|
3741
3741
|
return await n.insertInto("tenants").values(t).execute(), t;
|
|
3742
3742
|
};
|
|
3743
3743
|
}
|
|
3744
|
-
function
|
|
3744
|
+
function Fr(n) {
|
|
3745
3745
|
return async (e) => {
|
|
3746
3746
|
const t = await n.selectFrom("tenants").where("tenants.id", "=", e).selectAll().executeTakeFirst();
|
|
3747
3747
|
return t ? R(t) : null;
|
|
3748
3748
|
};
|
|
3749
3749
|
}
|
|
3750
|
-
function
|
|
3750
|
+
function zr(n) {
|
|
3751
3751
|
return async (e) => {
|
|
3752
3752
|
let t = n.selectFrom("tenants");
|
|
3753
3753
|
if (e.sort && e.sort.sort_by) {
|
|
@@ -3769,7 +3769,7 @@ function Fr(n) {
|
|
|
3769
3769
|
};
|
|
3770
3770
|
};
|
|
3771
3771
|
}
|
|
3772
|
-
function
|
|
3772
|
+
function Br(n) {
|
|
3773
3773
|
return async (e, t) => {
|
|
3774
3774
|
const s = {
|
|
3775
3775
|
...t,
|
|
@@ -3779,29 +3779,29 @@ function zr(n) {
|
|
|
3779
3779
|
await n.updateTable("tenants").set(s).where("id", "=", e).execute();
|
|
3780
3780
|
};
|
|
3781
3781
|
}
|
|
3782
|
-
function
|
|
3782
|
+
function Wr(n) {
|
|
3783
3783
|
return async (e) => (await n.deleteFrom("tenants").where("tenants.id", "=", e).execute()).length === 1;
|
|
3784
3784
|
}
|
|
3785
|
-
function
|
|
3785
|
+
function qr(n) {
|
|
3786
3786
|
return {
|
|
3787
|
-
create:
|
|
3788
|
-
get:
|
|
3789
|
-
list:
|
|
3790
|
-
update:
|
|
3791
|
-
remove:
|
|
3787
|
+
create: Ur(n),
|
|
3788
|
+
get: Fr(n),
|
|
3789
|
+
list: zr(n),
|
|
3790
|
+
update: Br(n),
|
|
3791
|
+
remove: Wr(n)
|
|
3792
3792
|
};
|
|
3793
3793
|
}
|
|
3794
|
-
function
|
|
3794
|
+
function vn(n) {
|
|
3795
3795
|
return n ? JSON.stringify(n) : void 0;
|
|
3796
3796
|
}
|
|
3797
|
-
const
|
|
3797
|
+
const Kr = 1024;
|
|
3798
3798
|
function Jr(n) {
|
|
3799
3799
|
return async (e, t) => {
|
|
3800
3800
|
var r, a, o;
|
|
3801
3801
|
const s = {
|
|
3802
3802
|
id: Re(),
|
|
3803
3803
|
...t,
|
|
3804
|
-
user_agent: t.user_agent.slice(0,
|
|
3804
|
+
user_agent: t.user_agent.slice(0, Kr)
|
|
3805
3805
|
};
|
|
3806
3806
|
return await n.insertInto("logs").values({
|
|
3807
3807
|
...s,
|
|
@@ -3810,12 +3810,12 @@ function Jr(n) {
|
|
|
3810
3810
|
isMobile: t.isMobile ? 1 : 0,
|
|
3811
3811
|
tenant_id: e,
|
|
3812
3812
|
scope: (a = t.scope) == null ? void 0 : a.join(","),
|
|
3813
|
-
auth0_client:
|
|
3814
|
-
details: (o =
|
|
3813
|
+
auth0_client: vn(t.auth0_client),
|
|
3814
|
+
details: (o = vn(t.details)) == null ? void 0 : o.substring(0, 8192)
|
|
3815
3815
|
}).execute(), s;
|
|
3816
3816
|
};
|
|
3817
3817
|
}
|
|
3818
|
-
function
|
|
3818
|
+
function wn(n) {
|
|
3819
3819
|
if (!n)
|
|
3820
3820
|
return "";
|
|
3821
3821
|
try {
|
|
@@ -3824,20 +3824,20 @@ function vn(n) {
|
|
|
3824
3824
|
return n;
|
|
3825
3825
|
}
|
|
3826
3826
|
}
|
|
3827
|
-
function
|
|
3827
|
+
function Vn(n) {
|
|
3828
3828
|
return {
|
|
3829
3829
|
...n,
|
|
3830
3830
|
client_id: n.client_id,
|
|
3831
3831
|
client_name: "",
|
|
3832
|
-
auth0_client:
|
|
3833
|
-
details:
|
|
3832
|
+
auth0_client: wn(n.auth0_client),
|
|
3833
|
+
details: wn(n.details),
|
|
3834
3834
|
isMobile: !!n.isMobile,
|
|
3835
3835
|
scope: n.scope ? n.scope.split(",") : void 0,
|
|
3836
3836
|
log_id: n.id,
|
|
3837
3837
|
_id: n.id
|
|
3838
3838
|
};
|
|
3839
3839
|
}
|
|
3840
|
-
function
|
|
3840
|
+
function Qr(n) {
|
|
3841
3841
|
return async (e, t) => {
|
|
3842
3842
|
let s = n.selectFrom("logs").where("logs.tenant_id", "=", e);
|
|
3843
3843
|
t.q && (s = Ae(n, s, t.q, ["user_id", "ip"]));
|
|
@@ -3852,30 +3852,30 @@ function Kr(n) {
|
|
|
3852
3852
|
r = r.offset(t.page * t.per_page).limit(t.per_page);
|
|
3853
3853
|
const a = await r.selectAll().execute(), { count: o } = await s.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
3854
3854
|
return {
|
|
3855
|
-
logs: a.map(
|
|
3855
|
+
logs: a.map(Vn),
|
|
3856
3856
|
start: t.page * t.per_page,
|
|
3857
3857
|
limit: t.per_page,
|
|
3858
3858
|
length: xe(o)
|
|
3859
3859
|
};
|
|
3860
3860
|
};
|
|
3861
3861
|
}
|
|
3862
|
-
function
|
|
3862
|
+
function Hr(n) {
|
|
3863
3863
|
return async (e, t) => {
|
|
3864
3864
|
const s = await n.selectFrom("logs").where("logs.tenant_id", "=", e).where("logs.id", "=", t).selectAll().executeTakeFirst();
|
|
3865
|
-
return s ?
|
|
3865
|
+
return s ? Vn(s) : null;
|
|
3866
3866
|
};
|
|
3867
3867
|
}
|
|
3868
|
-
function
|
|
3868
|
+
function Yr(n) {
|
|
3869
3869
|
return {
|
|
3870
3870
|
create: Jr(n),
|
|
3871
|
-
list:
|
|
3872
|
-
get:
|
|
3871
|
+
list: Qr(n),
|
|
3872
|
+
get: Hr(n)
|
|
3873
3873
|
};
|
|
3874
3874
|
}
|
|
3875
|
-
function
|
|
3875
|
+
function Gr(n) {
|
|
3876
3876
|
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;
|
|
3877
3877
|
}
|
|
3878
|
-
function
|
|
3878
|
+
function Xr(n) {
|
|
3879
3879
|
return async (e, t) => {
|
|
3880
3880
|
const s = {
|
|
3881
3881
|
...t,
|
|
@@ -3885,13 +3885,13 @@ function Gr(n) {
|
|
|
3885
3885
|
return await n.insertInto("sessions").values({ ...s, tenant_id: e }).execute(), { ...t, ...s };
|
|
3886
3886
|
};
|
|
3887
3887
|
}
|
|
3888
|
-
function
|
|
3888
|
+
function ea(n) {
|
|
3889
3889
|
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;
|
|
3890
3890
|
}
|
|
3891
|
-
function
|
|
3891
|
+
function ta(n) {
|
|
3892
3892
|
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;
|
|
3893
3893
|
}
|
|
3894
|
-
function
|
|
3894
|
+
function na(n) {
|
|
3895
3895
|
return async (e, t) => {
|
|
3896
3896
|
let s = n.selectFrom("sessions").where("sessions.tenant_id", "=", e);
|
|
3897
3897
|
t.q && (s = Ae(n, s, t.q, ["user_id", "session_id"]));
|
|
@@ -3913,16 +3913,16 @@ function ta(n) {
|
|
|
3913
3913
|
};
|
|
3914
3914
|
};
|
|
3915
3915
|
}
|
|
3916
|
-
function
|
|
3916
|
+
function sa(n) {
|
|
3917
3917
|
return {
|
|
3918
|
-
create:
|
|
3919
|
-
get:
|
|
3920
|
-
list:
|
|
3921
|
-
remove:
|
|
3922
|
-
update:
|
|
3918
|
+
create: Xr(n),
|
|
3919
|
+
get: Gr(n),
|
|
3920
|
+
list: na(n),
|
|
3921
|
+
remove: ea(n),
|
|
3922
|
+
update: ta(n)
|
|
3923
3923
|
};
|
|
3924
3924
|
}
|
|
3925
|
-
function
|
|
3925
|
+
function ra(n) {
|
|
3926
3926
|
return async (e, t) => {
|
|
3927
3927
|
const s = await n.selectFrom("tickets").where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).where("tickets.used_at", "is", null).selectAll().executeTakeFirst();
|
|
3928
3928
|
if (!s)
|
|
@@ -3952,7 +3952,7 @@ function sa(n) {
|
|
|
3952
3952
|
};
|
|
3953
3953
|
};
|
|
3954
3954
|
}
|
|
3955
|
-
function
|
|
3955
|
+
function aa(n) {
|
|
3956
3956
|
return async (e) => {
|
|
3957
3957
|
const { authParams: t, ...s } = e, r = {
|
|
3958
3958
|
...s,
|
|
@@ -3964,21 +3964,21 @@ function ra(n) {
|
|
|
3964
3964
|
await n.insertInto("tickets").values(r).execute();
|
|
3965
3965
|
};
|
|
3966
3966
|
}
|
|
3967
|
-
function
|
|
3967
|
+
function ia(n) {
|
|
3968
3968
|
return async (e, t) => {
|
|
3969
3969
|
await n.updateTable("tickets").set({
|
|
3970
3970
|
used_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3971
3971
|
}).where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).execute();
|
|
3972
3972
|
};
|
|
3973
3973
|
}
|
|
3974
|
-
function
|
|
3974
|
+
function oa(n) {
|
|
3975
3975
|
return {
|
|
3976
|
-
create:
|
|
3977
|
-
get:
|
|
3978
|
-
remove:
|
|
3976
|
+
create: aa(n),
|
|
3977
|
+
get: ra(n),
|
|
3978
|
+
remove: ia(n)
|
|
3979
3979
|
};
|
|
3980
3980
|
}
|
|
3981
|
-
function
|
|
3981
|
+
function ca(n) {
|
|
3982
3982
|
return async (e, t) => {
|
|
3983
3983
|
const s = (/* @__PURE__ */ new Date()).toISOString();
|
|
3984
3984
|
return (await n.selectFrom("otps").where("otps.tenant_id", "=", e).where("otps.email", "=", t).where("otps.expires_at", ">", s).where("otps.used_at", "is", null).selectAll().execute()).map((a) => {
|
|
@@ -4009,7 +4009,7 @@ function oa(n) {
|
|
|
4009
4009
|
});
|
|
4010
4010
|
};
|
|
4011
4011
|
}
|
|
4012
|
-
function
|
|
4012
|
+
function da(n) {
|
|
4013
4013
|
return async (e, t) => {
|
|
4014
4014
|
const { authParams: s, ...r } = t;
|
|
4015
4015
|
await n.insertInto("otps").values({
|
|
@@ -4022,25 +4022,25 @@ function ca(n) {
|
|
|
4022
4022
|
}).execute();
|
|
4023
4023
|
};
|
|
4024
4024
|
}
|
|
4025
|
-
function
|
|
4025
|
+
function ua(n) {
|
|
4026
4026
|
return async (e, t) => (await n.updateTable("otps").set({
|
|
4027
4027
|
used_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
4028
4028
|
}).where("otps.tenant_id", "=", e).where("otps.id", "=", t).execute()).length > 0;
|
|
4029
4029
|
}
|
|
4030
|
-
function
|
|
4030
|
+
function la(n) {
|
|
4031
4031
|
return {
|
|
4032
|
-
create:
|
|
4033
|
-
list:
|
|
4034
|
-
remove:
|
|
4032
|
+
create: da(n),
|
|
4033
|
+
list: ca(n),
|
|
4034
|
+
remove: ua(n)
|
|
4035
4035
|
};
|
|
4036
4036
|
}
|
|
4037
|
-
function
|
|
4037
|
+
function pa(n) {
|
|
4038
4038
|
return async (e, t) => {
|
|
4039
4039
|
const s = await n.selectFrom("passwords").where("passwords.tenant_id", "=", e).where("passwords.user_id", "=", t).selectAll().executeTakeFirstOrThrow(), { tenant_id: r, ...a } = s;
|
|
4040
4040
|
return a;
|
|
4041
4041
|
};
|
|
4042
4042
|
}
|
|
4043
|
-
function
|
|
4043
|
+
function ha(n) {
|
|
4044
4044
|
return async (e, t) => {
|
|
4045
4045
|
const s = {
|
|
4046
4046
|
...t,
|
|
@@ -4053,20 +4053,20 @@ function pa(n) {
|
|
|
4053
4053
|
}).execute(), s;
|
|
4054
4054
|
};
|
|
4055
4055
|
}
|
|
4056
|
-
function
|
|
4056
|
+
function fa(n) {
|
|
4057
4057
|
return async (e, t) => (await n.updateTable("passwords").set({
|
|
4058
4058
|
password: t.password,
|
|
4059
4059
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
4060
4060
|
}).where("tenant_id", "=", e).where("user_id", "=", t.user_id).execute()).length === 1;
|
|
4061
4061
|
}
|
|
4062
|
-
function
|
|
4062
|
+
function ma(n) {
|
|
4063
4063
|
return {
|
|
4064
|
-
create:
|
|
4065
|
-
update:
|
|
4066
|
-
get:
|
|
4064
|
+
create: ha(n),
|
|
4065
|
+
update: fa(n),
|
|
4066
|
+
get: pa(n)
|
|
4067
4067
|
};
|
|
4068
4068
|
}
|
|
4069
|
-
function
|
|
4069
|
+
function _a(n) {
|
|
4070
4070
|
return async (e, t) => {
|
|
4071
4071
|
let s = n.selectFrom("codes").where("codes.tenant_id", "=", e);
|
|
4072
4072
|
t.q && (s = Ae(n, s, t.q, ["code", "login_id"]));
|
|
@@ -4074,7 +4074,7 @@ function ma(n) {
|
|
|
4074
4074
|
return {
|
|
4075
4075
|
codes: a.map((d) => {
|
|
4076
4076
|
const { tenant_id: u, ...l } = d;
|
|
4077
|
-
return
|
|
4077
|
+
return hr.parse(R(l));
|
|
4078
4078
|
}),
|
|
4079
4079
|
start: t.page * t.per_page,
|
|
4080
4080
|
limit: t.per_page,
|
|
@@ -4082,7 +4082,7 @@ function ma(n) {
|
|
|
4082
4082
|
};
|
|
4083
4083
|
};
|
|
4084
4084
|
}
|
|
4085
|
-
function
|
|
4085
|
+
function ga(n) {
|
|
4086
4086
|
return async (e, t) => {
|
|
4087
4087
|
const s = {
|
|
4088
4088
|
...t,
|
|
@@ -4094,24 +4094,24 @@ function _a(n) {
|
|
|
4094
4094
|
}).execute(), s;
|
|
4095
4095
|
};
|
|
4096
4096
|
}
|
|
4097
|
-
function
|
|
4097
|
+
function ya(n) {
|
|
4098
4098
|
return async (e, t) => (await n.deleteFrom("codes").where("codes.tenant_id", "=", e).where("codes.code_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
4099
4099
|
}
|
|
4100
|
-
function
|
|
4100
|
+
function va(n) {
|
|
4101
4101
|
return async (e, t, s) => {
|
|
4102
4102
|
const r = await n.selectFrom("codes").where("codes.tenant_id", "=", e).where("codes.code_id", "=", t).where("codes.code_type", "=", s).selectAll().executeTakeFirst();
|
|
4103
4103
|
return r ? R(r) : null;
|
|
4104
4104
|
};
|
|
4105
4105
|
}
|
|
4106
|
-
function
|
|
4106
|
+
function wa(n) {
|
|
4107
4107
|
return {
|
|
4108
|
-
create:
|
|
4109
|
-
list:
|
|
4110
|
-
remove:
|
|
4111
|
-
get:
|
|
4108
|
+
create: ga(n),
|
|
4109
|
+
list: _a(n),
|
|
4110
|
+
remove: ya(n),
|
|
4111
|
+
get: va(n)
|
|
4112
4112
|
};
|
|
4113
4113
|
}
|
|
4114
|
-
function
|
|
4114
|
+
function ka(n) {
|
|
4115
4115
|
return async (e) => {
|
|
4116
4116
|
const t = (/* @__PURE__ */ new Date()).toISOString(), s = await n.selectFrom("universal_login_sessions").where("universal_login_sessions.expires_at", ">", t).where("universal_login_sessions.id", "=", e).selectAll().executeTakeFirst();
|
|
4117
4117
|
if (!s) return null;
|
|
@@ -4126,14 +4126,14 @@ function wa(n) {
|
|
|
4126
4126
|
code_challenge_method: T,
|
|
4127
4127
|
code_challenge: C,
|
|
4128
4128
|
username: L,
|
|
4129
|
-
vendor_id:
|
|
4129
|
+
vendor_id: J,
|
|
4130
4130
|
...re
|
|
4131
4131
|
} = s;
|
|
4132
4132
|
return {
|
|
4133
4133
|
...re,
|
|
4134
4134
|
authParams: {
|
|
4135
4135
|
client_id: re.client_id,
|
|
4136
|
-
vendor_id:
|
|
4136
|
+
vendor_id: J,
|
|
4137
4137
|
response_type: r,
|
|
4138
4138
|
response_mode: a,
|
|
4139
4139
|
redirect_uri: o,
|
|
@@ -4149,7 +4149,7 @@ function wa(n) {
|
|
|
4149
4149
|
};
|
|
4150
4150
|
};
|
|
4151
4151
|
}
|
|
4152
|
-
function
|
|
4152
|
+
function ba(n) {
|
|
4153
4153
|
return async (e, t) => {
|
|
4154
4154
|
const { authParams: s, ...r } = t, a = {
|
|
4155
4155
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -4158,20 +4158,25 @@ function ka(n) {
|
|
|
4158
4158
|
return await n.insertInto("universal_login_sessions").values({ ...s, ...r, ...a, tenant_id: e }).execute(), { ...t, ...a };
|
|
4159
4159
|
};
|
|
4160
4160
|
}
|
|
4161
|
-
function
|
|
4161
|
+
function xa(n) {
|
|
4162
4162
|
return async (e, t, s) => {
|
|
4163
4163
|
const { authParams: r, ...a } = s;
|
|
4164
4164
|
return (await n.updateTable("universal_login_sessions").set({ ...r, ...a }).where("id", "=", t).where("tenant_id", "=", e).execute()).length === 1;
|
|
4165
4165
|
};
|
|
4166
4166
|
}
|
|
4167
|
-
function
|
|
4167
|
+
function Ta(n) {
|
|
4168
4168
|
return {
|
|
4169
|
-
create:
|
|
4170
|
-
get:
|
|
4171
|
-
update:
|
|
4169
|
+
create: ba(n),
|
|
4170
|
+
get: ka(n),
|
|
4171
|
+
update: xa(n)
|
|
4172
4172
|
};
|
|
4173
4173
|
}
|
|
4174
|
-
function
|
|
4174
|
+
function Xt(n) {
|
|
4175
|
+
return JSON.stringify(
|
|
4176
|
+
n.split(",").map((e) => e.trim()).filter((e) => e.length)
|
|
4177
|
+
);
|
|
4178
|
+
}
|
|
4179
|
+
function Oa(n) {
|
|
4175
4180
|
return async (e, t) => {
|
|
4176
4181
|
const s = {
|
|
4177
4182
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -4181,7 +4186,7 @@ function Ta(n) {
|
|
|
4181
4186
|
allowed_web_origins: t.allowed_origins,
|
|
4182
4187
|
allowed_callback_urls: t.callbacks,
|
|
4183
4188
|
allowed_origins: t.allowed_origins
|
|
4184
|
-
}, r =
|
|
4189
|
+
}, r = Xt(t.allowed_origins), a = Xt(t.callbacks), o = Xt(t.callbacks);
|
|
4185
4190
|
return await n.insertInto("applications").values({
|
|
4186
4191
|
...s,
|
|
4187
4192
|
tenant_id: e,
|
|
@@ -4194,7 +4199,7 @@ function Ta(n) {
|
|
|
4194
4199
|
}).execute(), s;
|
|
4195
4200
|
};
|
|
4196
4201
|
}
|
|
4197
|
-
function
|
|
4202
|
+
function Sa(n) {
|
|
4198
4203
|
return async (e) => ({
|
|
4199
4204
|
applications: (await n.selectFrom("applications").where("applications.tenant_id", "=", e).selectAll().execute()).map((a) => ({
|
|
4200
4205
|
...a,
|
|
@@ -4203,7 +4208,7 @@ function Oa(n) {
|
|
|
4203
4208
|
}))
|
|
4204
4209
|
});
|
|
4205
4210
|
}
|
|
4206
|
-
function
|
|
4211
|
+
function Za(n) {
|
|
4207
4212
|
return async (e, t) => {
|
|
4208
4213
|
const s = await n.selectFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", t).selectAll().executeTakeFirst();
|
|
4209
4214
|
return s ? R({
|
|
@@ -4218,10 +4223,10 @@ function Sa(n) {
|
|
|
4218
4223
|
}) : null;
|
|
4219
4224
|
};
|
|
4220
4225
|
}
|
|
4221
|
-
function
|
|
4226
|
+
function ja(n) {
|
|
4222
4227
|
return async (e, t) => (await n.deleteFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
4223
4228
|
}
|
|
4224
|
-
function
|
|
4229
|
+
function Na(n) {
|
|
4225
4230
|
return async (e, t, s) => {
|
|
4226
4231
|
const r = {
|
|
4227
4232
|
...s,
|
|
@@ -4236,16 +4241,16 @@ function ja(n) {
|
|
|
4236
4241
|
return await n.updateTable("applications").set(r).where("applications.id", "=", t).where("applications.tenant_id", "=", e).execute(), !0;
|
|
4237
4242
|
};
|
|
4238
4243
|
}
|
|
4239
|
-
function
|
|
4244
|
+
function Ia(n) {
|
|
4240
4245
|
return {
|
|
4241
|
-
create:
|
|
4242
|
-
list:
|
|
4243
|
-
get:
|
|
4244
|
-
remove:
|
|
4245
|
-
update:
|
|
4246
|
+
create: Oa(n),
|
|
4247
|
+
list: Sa(n),
|
|
4248
|
+
get: Za(n),
|
|
4249
|
+
remove: ja(n),
|
|
4250
|
+
update: Na(n)
|
|
4246
4251
|
};
|
|
4247
4252
|
}
|
|
4248
|
-
function
|
|
4253
|
+
function Ca(n) {
|
|
4249
4254
|
return async (e, t) => {
|
|
4250
4255
|
const s = {
|
|
4251
4256
|
id: Re(),
|
|
@@ -4256,7 +4261,7 @@ function Ia(n) {
|
|
|
4256
4261
|
return await n.insertInto("connections").values({ ...s, tenant_id: e }).execute(), s;
|
|
4257
4262
|
};
|
|
4258
4263
|
}
|
|
4259
|
-
function
|
|
4264
|
+
function Ea(n) {
|
|
4260
4265
|
return async (e, t) => {
|
|
4261
4266
|
let s = n.selectFrom("connections").where("connections.tenant_id", "=", e);
|
|
4262
4267
|
t.q && (s = Ae(n, s, t.q, ["user_id", "ip"]));
|
|
@@ -4269,16 +4274,16 @@ function Ca(n) {
|
|
|
4269
4274
|
};
|
|
4270
4275
|
};
|
|
4271
4276
|
}
|
|
4272
|
-
function
|
|
4277
|
+
function Aa(n) {
|
|
4273
4278
|
return async (e, t) => (await n.deleteFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
4274
4279
|
}
|
|
4275
|
-
function
|
|
4280
|
+
function Ra(n) {
|
|
4276
4281
|
return async (e, t) => {
|
|
4277
4282
|
const s = await n.selectFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).selectAll().executeTakeFirst();
|
|
4278
4283
|
return s ? R(s) : null;
|
|
4279
4284
|
};
|
|
4280
4285
|
}
|
|
4281
|
-
function
|
|
4286
|
+
function $a(n) {
|
|
4282
4287
|
return async (e, t, s) => {
|
|
4283
4288
|
const r = {
|
|
4284
4289
|
...s,
|
|
@@ -4287,19 +4292,19 @@ function Ra(n) {
|
|
|
4287
4292
|
return await n.updateTable("connections").set(r).where("connections.id", "=", t).where("connections.tenant_id", "=", e).execute(), !0;
|
|
4288
4293
|
};
|
|
4289
4294
|
}
|
|
4290
|
-
function
|
|
4295
|
+
function Pa(n) {
|
|
4291
4296
|
return {
|
|
4292
|
-
create:
|
|
4293
|
-
get:
|
|
4294
|
-
list:
|
|
4295
|
-
remove:
|
|
4296
|
-
update:
|
|
4297
|
+
create: Ca(n),
|
|
4298
|
+
get: Ra(n),
|
|
4299
|
+
list: Ea(n),
|
|
4300
|
+
remove: Aa(n),
|
|
4301
|
+
update: $a(n)
|
|
4297
4302
|
};
|
|
4298
4303
|
}
|
|
4299
|
-
function
|
|
4304
|
+
function en(n) {
|
|
4300
4305
|
return n != null && n.length ? n.split(",").map((e) => e.trim()) : [];
|
|
4301
4306
|
}
|
|
4302
|
-
function
|
|
4307
|
+
function Da(n) {
|
|
4303
4308
|
return {
|
|
4304
4309
|
get: async (e) => {
|
|
4305
4310
|
const t = await n.selectFrom("applications").selectAll().where("id", "=", e).executeTakeFirst();
|
|
@@ -4313,13 +4318,13 @@ function Pa(n) {
|
|
|
4313
4318
|
id: t.id,
|
|
4314
4319
|
name: t.name,
|
|
4315
4320
|
connections: r.map(
|
|
4316
|
-
(c) =>
|
|
4321
|
+
(c) => hn.parse(R(c))
|
|
4317
4322
|
),
|
|
4318
4323
|
domains: a,
|
|
4319
4324
|
tenant_id: s.id,
|
|
4320
|
-
allowed_callback_urls:
|
|
4321
|
-
allowed_logout_urls:
|
|
4322
|
-
allowed_web_origins:
|
|
4325
|
+
allowed_callback_urls: en(t.allowed_callback_urls),
|
|
4326
|
+
allowed_logout_urls: en(t.allowed_logout_urls),
|
|
4327
|
+
allowed_web_origins: en(t.allowed_web_origins),
|
|
4323
4328
|
email_validation: t.email_validation,
|
|
4324
4329
|
client_secret: t.client_secret,
|
|
4325
4330
|
tenant: R(s),
|
|
@@ -4329,25 +4334,25 @@ function Pa(n) {
|
|
|
4329
4334
|
}
|
|
4330
4335
|
};
|
|
4331
4336
|
}
|
|
4332
|
-
function
|
|
4337
|
+
function Ma(n) {
|
|
4333
4338
|
return async () => await n.selectFrom("keys").where("revoked_at", "is", null).selectAll().execute();
|
|
4334
4339
|
}
|
|
4335
|
-
function
|
|
4340
|
+
function La(n) {
|
|
4336
4341
|
return async (e) => {
|
|
4337
4342
|
await n.insertInto("keys").values(e).execute();
|
|
4338
4343
|
};
|
|
4339
4344
|
}
|
|
4340
|
-
function
|
|
4345
|
+
function Va(n) {
|
|
4341
4346
|
return async (e, t) => !!(await n.updateTable("keys").set({ revoked_at: t.toISOString() }).where("kid", "=", e).execute()).length;
|
|
4342
4347
|
}
|
|
4343
|
-
function
|
|
4348
|
+
function Ua(n) {
|
|
4344
4349
|
return {
|
|
4345
|
-
create:
|
|
4346
|
-
list:
|
|
4347
|
-
revoke:
|
|
4350
|
+
create: La(n),
|
|
4351
|
+
list: Ma(n),
|
|
4352
|
+
revoke: Va(n)
|
|
4348
4353
|
};
|
|
4349
4354
|
}
|
|
4350
|
-
function
|
|
4355
|
+
function Fa(n) {
|
|
4351
4356
|
return async (e, t) => {
|
|
4352
4357
|
const s = {
|
|
4353
4358
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -4359,7 +4364,7 @@ function Ua(n) {
|
|
|
4359
4364
|
return await n.insertInto("domains").values(s).execute(), s;
|
|
4360
4365
|
};
|
|
4361
4366
|
}
|
|
4362
|
-
function
|
|
4367
|
+
function za(n) {
|
|
4363
4368
|
return async (e, t) => {
|
|
4364
4369
|
let s = n.selectFrom("domains").where("domains.tenant_id", "=", e);
|
|
4365
4370
|
t.q && (s = Ae(n, s, t.q, ["user_id", "ip"]));
|
|
@@ -4372,13 +4377,13 @@ function Fa(n) {
|
|
|
4372
4377
|
};
|
|
4373
4378
|
};
|
|
4374
4379
|
}
|
|
4375
|
-
function
|
|
4380
|
+
function Ba(n) {
|
|
4376
4381
|
return {
|
|
4377
|
-
create:
|
|
4378
|
-
list:
|
|
4382
|
+
create: Fa(n),
|
|
4383
|
+
list: za(n)
|
|
4379
4384
|
};
|
|
4380
4385
|
}
|
|
4381
|
-
function
|
|
4386
|
+
function Wa(n) {
|
|
4382
4387
|
return async (e) => {
|
|
4383
4388
|
const [t] = await n.selectFrom("branding").where("branding.tenant_id", "=", e).selectAll().execute();
|
|
4384
4389
|
if (!t)
|
|
@@ -4408,9 +4413,9 @@ function Ba(n) {
|
|
|
4408
4413
|
});
|
|
4409
4414
|
};
|
|
4410
4415
|
}
|
|
4411
|
-
function
|
|
4416
|
+
function qa(n) {
|
|
4412
4417
|
return async (e, t) => {
|
|
4413
|
-
var o, c, d, u, l, T, C, L,
|
|
4418
|
+
var o, c, d, u, l, T, C, L, J, re, ce, de, ue, $e, Pe, Q, H, Y;
|
|
4414
4419
|
const { colors: s, font: r, ...a } = t;
|
|
4415
4420
|
try {
|
|
4416
4421
|
await n.insertInto("branding").values({
|
|
@@ -4420,7 +4425,7 @@ function Wa(n) {
|
|
|
4420
4425
|
colors_page_background_start: (u = (d = t.colors) == null ? void 0 : d.page_background) == null ? void 0 : u.start,
|
|
4421
4426
|
colors_page_background_end: (T = (l = t.colors) == null ? void 0 : l.page_background) == null ? void 0 : T.end,
|
|
4422
4427
|
colors_page_background_angle_dev: (L = (C = t.colors) == null ? void 0 : C.page_background) == null ? void 0 : L.angle_deg,
|
|
4423
|
-
font_url: (
|
|
4428
|
+
font_url: (J = t.font) == null ? void 0 : J.url,
|
|
4424
4429
|
tenant_id: e
|
|
4425
4430
|
}).execute();
|
|
4426
4431
|
} catch {
|
|
@@ -4436,10 +4441,10 @@ function Wa(n) {
|
|
|
4436
4441
|
}
|
|
4437
4442
|
};
|
|
4438
4443
|
}
|
|
4439
|
-
function
|
|
4444
|
+
function Ka(n) {
|
|
4440
4445
|
return {
|
|
4441
|
-
get:
|
|
4442
|
-
set:
|
|
4446
|
+
get: Wa(n),
|
|
4447
|
+
set: qa(n)
|
|
4443
4448
|
};
|
|
4444
4449
|
}
|
|
4445
4450
|
function Ja(n) {
|
|
@@ -4471,7 +4476,7 @@ function Ja(n) {
|
|
|
4471
4476
|
};
|
|
4472
4477
|
};
|
|
4473
4478
|
}
|
|
4474
|
-
function
|
|
4479
|
+
function Qa(n) {
|
|
4475
4480
|
return async (e, t) => {
|
|
4476
4481
|
const { authParams: s, ...r } = t;
|
|
4477
4482
|
await n.insertInto("authentication_codes").values({
|
|
@@ -4481,13 +4486,13 @@ function Ka(n) {
|
|
|
4481
4486
|
}).execute();
|
|
4482
4487
|
};
|
|
4483
4488
|
}
|
|
4484
|
-
function
|
|
4489
|
+
function Ha(n) {
|
|
4485
4490
|
return {
|
|
4486
|
-
create:
|
|
4491
|
+
create: Qa(n),
|
|
4487
4492
|
get: Ja(n)
|
|
4488
4493
|
};
|
|
4489
4494
|
}
|
|
4490
|
-
function
|
|
4495
|
+
function Ya(n) {
|
|
4491
4496
|
return async (e, t) => {
|
|
4492
4497
|
let s = n.selectFrom("hooks").where("hooks.tenant_id", "=", e);
|
|
4493
4498
|
t.q && (s = Ae(n, s, t.q, ["url"]));
|
|
@@ -4507,16 +4512,16 @@ function Ha(n) {
|
|
|
4507
4512
|
};
|
|
4508
4513
|
};
|
|
4509
4514
|
}
|
|
4510
|
-
function
|
|
4515
|
+
function Ga(n) {
|
|
4511
4516
|
return async (e, t) => {
|
|
4512
4517
|
const s = await n.selectFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).selectAll().executeTakeFirst();
|
|
4513
4518
|
return s ? (s.enabled = !!s.enabled, s.synchronous = !!s.synchronous, R(s)) : null;
|
|
4514
4519
|
};
|
|
4515
4520
|
}
|
|
4516
|
-
function
|
|
4521
|
+
function Xa(n) {
|
|
4517
4522
|
return async (e, t) => (await n.deleteFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
4518
4523
|
}
|
|
4519
|
-
function
|
|
4524
|
+
function ei(n) {
|
|
4520
4525
|
return async (e, t) => {
|
|
4521
4526
|
const s = {
|
|
4522
4527
|
hook_id: Re(),
|
|
@@ -4530,7 +4535,7 @@ function Xa(n) {
|
|
|
4530
4535
|
}).execute(), s;
|
|
4531
4536
|
};
|
|
4532
4537
|
}
|
|
4533
|
-
function
|
|
4538
|
+
function ti(n) {
|
|
4534
4539
|
return async (e, t, s) => {
|
|
4535
4540
|
const r = {
|
|
4536
4541
|
...s,
|
|
@@ -4539,16 +4544,16 @@ function ei(n) {
|
|
|
4539
4544
|
return await n.updateTable("hooks").set(r).where("hooks.hook_id", "=", t).where("hooks.tenant_id", "=", e).execute(), !0;
|
|
4540
4545
|
};
|
|
4541
4546
|
}
|
|
4542
|
-
function
|
|
4547
|
+
function ni(n) {
|
|
4543
4548
|
return {
|
|
4544
|
-
create:
|
|
4545
|
-
get:
|
|
4546
|
-
list:
|
|
4547
|
-
update:
|
|
4548
|
-
remove:
|
|
4549
|
+
create: ei(n),
|
|
4550
|
+
get: Ga(n),
|
|
4551
|
+
list: Ya(n),
|
|
4552
|
+
update: ti(n),
|
|
4553
|
+
remove: Xa(n)
|
|
4549
4554
|
};
|
|
4550
4555
|
}
|
|
4551
|
-
function
|
|
4556
|
+
function si(n, e) {
|
|
4552
4557
|
var t = {};
|
|
4553
4558
|
for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && e.indexOf(s) < 0 && (t[s] = n[s]);
|
|
4554
4559
|
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -4556,7 +4561,7 @@ function ni(n, e) {
|
|
|
4556
4561
|
e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, s[r]) && (t[s[r]] = n[s[r]]);
|
|
4557
4562
|
return t;
|
|
4558
4563
|
}
|
|
4559
|
-
function
|
|
4564
|
+
function ri(n, e) {
|
|
4560
4565
|
var t;
|
|
4561
4566
|
return ((t = n == null ? void 0 : n._def) === null || t === void 0 ? void 0 : t.typeName) === e;
|
|
4562
4567
|
}
|
|
@@ -4567,15 +4572,15 @@ function He(n, e) {
|
|
|
4567
4572
|
return r._def.openapi = this._def.openapi, r;
|
|
4568
4573
|
};
|
|
4569
4574
|
}
|
|
4570
|
-
function
|
|
4575
|
+
function ai(n) {
|
|
4571
4576
|
if (typeof n.ZodType.prototype.openapi < "u")
|
|
4572
4577
|
return;
|
|
4573
4578
|
n.ZodType.prototype.openapi = function(r, a) {
|
|
4574
4579
|
var o, c, d, u, l, T;
|
|
4575
|
-
const C = typeof r == "string" ? a : r, L = C ?? {}, { param:
|
|
4576
|
-
param: Object.assign(Object.assign({}, (T = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || T === void 0 ? void 0 : T.param),
|
|
4580
|
+
const C = typeof r == "string" ? a : r, L = C ?? {}, { param: J } = L, re = si(L, ["param"]), ce = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), de = Object.assign(Object.assign(Object.assign({}, (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 || J ? {
|
|
4581
|
+
param: Object.assign(Object.assign({}, (T = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || T === void 0 ? void 0 : T.param), J)
|
|
4577
4582
|
} : void 0), ue = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(ce).length > 0 ? { _internal: ce } : void 0), Object.keys(de).length > 0 ? { metadata: de } : void 0) }));
|
|
4578
|
-
if (
|
|
4583
|
+
if (ri(this, "ZodObject")) {
|
|
4579
4584
|
const $e = this.extend;
|
|
4580
4585
|
ue.extend = function(...Pe) {
|
|
4581
4586
|
var Q, H, Y, le, Te, Oe;
|
|
@@ -4646,14 +4651,14 @@ var I;
|
|
|
4646
4651
|
}
|
|
4647
4652
|
n.joinValues = s, n.jsonStringifyReplacer = (r, a) => typeof a == "bigint" ? a.toString() : a;
|
|
4648
4653
|
})(I || (I = {}));
|
|
4649
|
-
var
|
|
4654
|
+
var on;
|
|
4650
4655
|
(function(n) {
|
|
4651
4656
|
n.mergeShapes = (e, t) => ({
|
|
4652
4657
|
...e,
|
|
4653
4658
|
...t
|
|
4654
4659
|
// second overwrites first
|
|
4655
4660
|
});
|
|
4656
|
-
})(
|
|
4661
|
+
})(on || (on = {}));
|
|
4657
4662
|
const g = I.arrayToEnum([
|
|
4658
4663
|
"string",
|
|
4659
4664
|
"nan",
|
|
@@ -4713,7 +4718,7 @@ const g = I.arrayToEnum([
|
|
|
4713
4718
|
"invalid_intersection_types",
|
|
4714
4719
|
"not_multiple_of",
|
|
4715
4720
|
"not_finite"
|
|
4716
|
-
]),
|
|
4721
|
+
]), ii = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
4717
4722
|
class U extends Error {
|
|
4718
4723
|
constructor(e) {
|
|
4719
4724
|
super(), this.issues = [], this.addIssue = (s) => {
|
|
@@ -4830,12 +4835,12 @@ const qe = (n, e) => {
|
|
|
4830
4835
|
}
|
|
4831
4836
|
return { message: t };
|
|
4832
4837
|
};
|
|
4833
|
-
let
|
|
4834
|
-
function
|
|
4835
|
-
|
|
4838
|
+
let Un = qe;
|
|
4839
|
+
function oi(n) {
|
|
4840
|
+
Un = n;
|
|
4836
4841
|
}
|
|
4837
4842
|
function Ut() {
|
|
4838
|
-
return
|
|
4843
|
+
return Un;
|
|
4839
4844
|
}
|
|
4840
4845
|
const Ft = (n) => {
|
|
4841
4846
|
const { data: e, path: t, errorMaps: s, issueData: r } = n, a = [...t, ...r.path || []], o = {
|
|
@@ -4857,7 +4862,7 @@ const Ft = (n) => {
|
|
|
4857
4862
|
path: a,
|
|
4858
4863
|
message: c
|
|
4859
4864
|
};
|
|
4860
|
-
},
|
|
4865
|
+
}, ci = [];
|
|
4861
4866
|
function m(n, e) {
|
|
4862
4867
|
const t = Ut(), s = Ft({
|
|
4863
4868
|
issueData: e,
|
|
@@ -4916,12 +4921,12 @@ class P {
|
|
|
4916
4921
|
}
|
|
4917
4922
|
const b = Object.freeze({
|
|
4918
4923
|
status: "aborted"
|
|
4919
|
-
}), Ve = (n) => ({ status: "dirty", value: n }), M = (n) => ({ status: "valid", value: n }),
|
|
4924
|
+
}), Ve = (n) => ({ status: "dirty", value: n }), M = (n) => ({ status: "valid", value: n }), cn = (n) => n.status === "aborted", dn = (n) => n.status === "dirty", mt = (n) => n.status === "valid", _t = (n) => typeof Promise < "u" && n instanceof Promise;
|
|
4920
4925
|
function zt(n, e, t, s) {
|
|
4921
4926
|
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");
|
|
4922
4927
|
return e.get(n);
|
|
4923
4928
|
}
|
|
4924
|
-
function
|
|
4929
|
+
function Fn(n, e, t, s, r) {
|
|
4925
4930
|
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");
|
|
4926
4931
|
return e.set(n, t), t;
|
|
4927
4932
|
}
|
|
@@ -4938,7 +4943,7 @@ class ne {
|
|
|
4938
4943
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
4939
4944
|
}
|
|
4940
4945
|
}
|
|
4941
|
-
const
|
|
4946
|
+
const kn = (n, e) => {
|
|
4942
4947
|
if (mt(e))
|
|
4943
4948
|
return { success: !0, data: e.value };
|
|
4944
4949
|
if (!n.common.issues.length)
|
|
@@ -5028,7 +5033,7 @@ class j {
|
|
|
5028
5033
|
data: e,
|
|
5029
5034
|
parsedType: fe(e)
|
|
5030
5035
|
}, a = this._parseSync({ data: e, path: r.path, parent: r });
|
|
5031
|
-
return
|
|
5036
|
+
return kn(r, a);
|
|
5032
5037
|
}
|
|
5033
5038
|
async parseAsync(e, t) {
|
|
5034
5039
|
const s = await this.safeParseAsync(e, t);
|
|
@@ -5049,7 +5054,7 @@ class j {
|
|
|
5049
5054
|
data: e,
|
|
5050
5055
|
parsedType: fe(e)
|
|
5051
5056
|
}, r = this._parse({ data: e, path: s.path, parent: s }), a = await (_t(r) ? r : Promise.resolve(r));
|
|
5052
|
-
return
|
|
5057
|
+
return kn(s, a);
|
|
5053
5058
|
}
|
|
5054
5059
|
refine(e, t) {
|
|
5055
5060
|
const s = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
|
|
@@ -5065,7 +5070,7 @@ class j {
|
|
|
5065
5070
|
return this._refinement((s, r) => e(s) ? !0 : (r.addIssue(typeof t == "function" ? t(s, r) : t), !1));
|
|
5066
5071
|
}
|
|
5067
5072
|
_refinement(e) {
|
|
5068
|
-
return new
|
|
5073
|
+
return new K({
|
|
5069
5074
|
schema: this,
|
|
5070
5075
|
typeName: k.ZodEffects,
|
|
5071
5076
|
effect: { type: "refinement", refinement: e }
|
|
@@ -5087,7 +5092,7 @@ class j {
|
|
|
5087
5092
|
return W.create(this, this._def);
|
|
5088
5093
|
}
|
|
5089
5094
|
promise() {
|
|
5090
|
-
return
|
|
5095
|
+
return Je.create(this, this._def);
|
|
5091
5096
|
}
|
|
5092
5097
|
or(e) {
|
|
5093
5098
|
return wt.create([this, e], this._def);
|
|
@@ -5096,7 +5101,7 @@ class j {
|
|
|
5096
5101
|
return kt.create(this, e, this._def);
|
|
5097
5102
|
}
|
|
5098
5103
|
transform(e) {
|
|
5099
|
-
return new
|
|
5104
|
+
return new K({
|
|
5100
5105
|
...S(this._def),
|
|
5101
5106
|
schema: this,
|
|
5102
5107
|
typeName: k.ZodEffects,
|
|
@@ -5113,7 +5118,7 @@ class j {
|
|
|
5113
5118
|
});
|
|
5114
5119
|
}
|
|
5115
5120
|
brand() {
|
|
5116
|
-
return new
|
|
5121
|
+
return new _n({
|
|
5117
5122
|
typeName: k.ZodBranded,
|
|
5118
5123
|
type: this,
|
|
5119
5124
|
...S(this._def)
|
|
@@ -5148,23 +5153,23 @@ class j {
|
|
|
5148
5153
|
return this.safeParse(null).success;
|
|
5149
5154
|
}
|
|
5150
5155
|
}
|
|
5151
|
-
const
|
|
5152
|
-
let
|
|
5153
|
-
const
|
|
5154
|
-
function
|
|
5156
|
+
const di = /^c[^\s-]{8,}$/i, ui = /^[0-9a-z]+$/, li = /^[0-9A-HJKMNP-TV-Z]{26}$/, pi = /^[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, hi = /^[a-z0-9_-]{21}$/i, fi = /^[-+]?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)?)??$/, mi = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, _i = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
5157
|
+
let tn;
|
|
5158
|
+
const gi = /^(?:(?: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])$/, yi = /^(([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})))$/, vi = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, zn = "((\\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])))", wi = new RegExp(`^${zn}$`);
|
|
5159
|
+
function Bn(n) {
|
|
5155
5160
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
5156
5161
|
return n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
5157
5162
|
}
|
|
5158
|
-
function
|
|
5159
|
-
return new RegExp(`^${
|
|
5163
|
+
function ki(n) {
|
|
5164
|
+
return new RegExp(`^${Bn(n)}$`);
|
|
5160
5165
|
}
|
|
5161
|
-
function
|
|
5162
|
-
let e = `${
|
|
5166
|
+
function Wn(n) {
|
|
5167
|
+
let e = `${zn}T${Bn(n)}`;
|
|
5163
5168
|
const t = [];
|
|
5164
5169
|
return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
5165
5170
|
}
|
|
5166
|
-
function
|
|
5167
|
-
return !!((e === "v4" || !e) &&
|
|
5171
|
+
function bi(n, e) {
|
|
5172
|
+
return !!((e === "v4" || !e) && gi.test(n) || (e === "v6" || !e) && yi.test(n));
|
|
5168
5173
|
}
|
|
5169
5174
|
class z extends j {
|
|
5170
5175
|
_parse(e) {
|
|
@@ -5215,43 +5220,43 @@ class z extends j {
|
|
|
5215
5220
|
message: a.message
|
|
5216
5221
|
}), s.dirty());
|
|
5217
5222
|
} else if (a.kind === "email")
|
|
5218
|
-
|
|
5223
|
+
mi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5219
5224
|
validation: "email",
|
|
5220
5225
|
code: h.invalid_string,
|
|
5221
5226
|
message: a.message
|
|
5222
5227
|
}), s.dirty());
|
|
5223
5228
|
else if (a.kind === "emoji")
|
|
5224
|
-
|
|
5229
|
+
tn || (tn = new RegExp(_i, "u")), tn.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5225
5230
|
validation: "emoji",
|
|
5226
5231
|
code: h.invalid_string,
|
|
5227
5232
|
message: a.message
|
|
5228
5233
|
}), s.dirty());
|
|
5229
5234
|
else if (a.kind === "uuid")
|
|
5230
|
-
|
|
5235
|
+
pi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5231
5236
|
validation: "uuid",
|
|
5232
5237
|
code: h.invalid_string,
|
|
5233
5238
|
message: a.message
|
|
5234
5239
|
}), s.dirty());
|
|
5235
5240
|
else if (a.kind === "nanoid")
|
|
5236
|
-
|
|
5241
|
+
hi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5237
5242
|
validation: "nanoid",
|
|
5238
5243
|
code: h.invalid_string,
|
|
5239
5244
|
message: a.message
|
|
5240
5245
|
}), s.dirty());
|
|
5241
5246
|
else if (a.kind === "cuid")
|
|
5242
|
-
|
|
5247
|
+
di.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5243
5248
|
validation: "cuid",
|
|
5244
5249
|
code: h.invalid_string,
|
|
5245
5250
|
message: a.message
|
|
5246
5251
|
}), s.dirty());
|
|
5247
5252
|
else if (a.kind === "cuid2")
|
|
5248
|
-
|
|
5253
|
+
ui.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5249
5254
|
validation: "cuid2",
|
|
5250
5255
|
code: h.invalid_string,
|
|
5251
5256
|
message: a.message
|
|
5252
5257
|
}), s.dirty());
|
|
5253
5258
|
else if (a.kind === "ulid")
|
|
5254
|
-
|
|
5259
|
+
li.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5255
5260
|
validation: "ulid",
|
|
5256
5261
|
code: h.invalid_string,
|
|
5257
5262
|
message: a.message
|
|
@@ -5282,27 +5287,27 @@ class z extends j {
|
|
|
5282
5287
|
code: h.invalid_string,
|
|
5283
5288
|
validation: { endsWith: a.value },
|
|
5284
5289
|
message: a.message
|
|
5285
|
-
}), s.dirty()) : a.kind === "datetime" ?
|
|
5290
|
+
}), s.dirty()) : a.kind === "datetime" ? Wn(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5286
5291
|
code: h.invalid_string,
|
|
5287
5292
|
validation: "datetime",
|
|
5288
5293
|
message: a.message
|
|
5289
|
-
}), s.dirty()) : a.kind === "date" ?
|
|
5294
|
+
}), s.dirty()) : a.kind === "date" ? wi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5290
5295
|
code: h.invalid_string,
|
|
5291
5296
|
validation: "date",
|
|
5292
5297
|
message: a.message
|
|
5293
|
-
}), s.dirty()) : a.kind === "time" ?
|
|
5298
|
+
}), s.dirty()) : a.kind === "time" ? ki(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5294
5299
|
code: h.invalid_string,
|
|
5295
5300
|
validation: "time",
|
|
5296
5301
|
message: a.message
|
|
5297
|
-
}), s.dirty()) : a.kind === "duration" ?
|
|
5302
|
+
}), s.dirty()) : a.kind === "duration" ? fi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5298
5303
|
validation: "duration",
|
|
5299
5304
|
code: h.invalid_string,
|
|
5300
5305
|
message: a.message
|
|
5301
|
-
}), s.dirty()) : a.kind === "ip" ?
|
|
5306
|
+
}), s.dirty()) : a.kind === "ip" ? bi(e.data, a.version) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5302
5307
|
validation: "ip",
|
|
5303
5308
|
code: h.invalid_string,
|
|
5304
5309
|
message: a.message
|
|
5305
|
-
}), s.dirty()) : a.kind === "base64" ?
|
|
5310
|
+
}), s.dirty()) : a.kind === "base64" ? vi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5306
5311
|
validation: "base64",
|
|
5307
5312
|
code: h.invalid_string,
|
|
5308
5313
|
message: a.message
|
|
@@ -5524,7 +5529,7 @@ z.create = (n) => {
|
|
|
5524
5529
|
...S(n)
|
|
5525
5530
|
});
|
|
5526
5531
|
};
|
|
5527
|
-
function
|
|
5532
|
+
function xi(n, e) {
|
|
5528
5533
|
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(".", ""));
|
|
5529
5534
|
return a % o / Math.pow(10, r);
|
|
5530
5535
|
}
|
|
@@ -5563,7 +5568,7 @@ class ve extends j {
|
|
|
5563
5568
|
inclusive: a.inclusive,
|
|
5564
5569
|
exact: !1,
|
|
5565
5570
|
message: a.message
|
|
5566
|
-
}), r.dirty()) : a.kind === "multipleOf" ?
|
|
5571
|
+
}), r.dirty()) : a.kind === "multipleOf" ? xi(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), m(s, {
|
|
5567
5572
|
code: h.not_multiple_of,
|
|
5568
5573
|
multipleOf: a.value,
|
|
5569
5574
|
message: a.message
|
|
@@ -5975,7 +5980,7 @@ vt.create = (n) => new vt({
|
|
|
5975
5980
|
typeName: k.ZodNull,
|
|
5976
5981
|
...S(n)
|
|
5977
5982
|
});
|
|
5978
|
-
class
|
|
5983
|
+
class Ke extends j {
|
|
5979
5984
|
constructor() {
|
|
5980
5985
|
super(...arguments), this._any = !0;
|
|
5981
5986
|
}
|
|
@@ -5983,7 +5988,7 @@ class Je extends j {
|
|
|
5983
5988
|
return M(e.data);
|
|
5984
5989
|
}
|
|
5985
5990
|
}
|
|
5986
|
-
|
|
5991
|
+
Ke.create = (n) => new Ke({
|
|
5987
5992
|
typeName: k.ZodAny,
|
|
5988
5993
|
...S(n)
|
|
5989
5994
|
});
|
|
@@ -6382,7 +6387,7 @@ class A extends j {
|
|
|
6382
6387
|
});
|
|
6383
6388
|
}
|
|
6384
6389
|
keyof() {
|
|
6385
|
-
return
|
|
6390
|
+
return qn(I.objectKeys(this.shape));
|
|
6386
6391
|
}
|
|
6387
6392
|
}
|
|
6388
6393
|
A.create = (n, e) => new A({
|
|
@@ -6479,7 +6484,7 @@ wt.create = (n, e) => new wt({
|
|
|
6479
6484
|
typeName: k.ZodUnion,
|
|
6480
6485
|
...S(e)
|
|
6481
6486
|
});
|
|
6482
|
-
const ae = (n) => n instanceof xt ? ae(n.schema) : n instanceof
|
|
6487
|
+
const ae = (n) => n instanceof xt ? ae(n.schema) : n instanceof K ? ae(n.innerType()) : n instanceof Tt ? [n.value] : n instanceof ke ? n.options : n instanceof Ot ? I.objectValues(n.enum) : n instanceof St ? ae(n._def.innerType) : n instanceof yt ? [void 0] : n instanceof vt ? [null] : n instanceof X ? [void 0, ...ae(n.unwrap())] : n instanceof be ? [null, ...ae(n.unwrap())] : n instanceof _n || n instanceof jt ? ae(n.unwrap()) : n instanceof Zt ? ae(n._def.innerType) : [];
|
|
6483
6488
|
class Ht extends j {
|
|
6484
6489
|
_parse(e) {
|
|
6485
6490
|
const { ctx: t } = this._processInputParams(e);
|
|
@@ -6542,14 +6547,14 @@ class Ht extends j {
|
|
|
6542
6547
|
});
|
|
6543
6548
|
}
|
|
6544
6549
|
}
|
|
6545
|
-
function
|
|
6550
|
+
function un(n, e) {
|
|
6546
6551
|
const t = fe(n), s = fe(e);
|
|
6547
6552
|
if (n === e)
|
|
6548
6553
|
return { valid: !0, data: n };
|
|
6549
6554
|
if (t === g.object && s === g.object) {
|
|
6550
6555
|
const r = I.objectKeys(e), a = I.objectKeys(n).filter((c) => r.indexOf(c) !== -1), o = { ...n, ...e };
|
|
6551
6556
|
for (const c of a) {
|
|
6552
|
-
const d =
|
|
6557
|
+
const d = un(n[c], e[c]);
|
|
6553
6558
|
if (!d.valid)
|
|
6554
6559
|
return { valid: !1 };
|
|
6555
6560
|
o[c] = d.data;
|
|
@@ -6560,7 +6565,7 @@ function dn(n, e) {
|
|
|
6560
6565
|
return { valid: !1 };
|
|
6561
6566
|
const r = [];
|
|
6562
6567
|
for (let a = 0; a < n.length; a++) {
|
|
6563
|
-
const o = n[a], c = e[a], d =
|
|
6568
|
+
const o = n[a], c = e[a], d = un(o, c);
|
|
6564
6569
|
if (!d.valid)
|
|
6565
6570
|
return { valid: !1 };
|
|
6566
6571
|
r.push(d.data);
|
|
@@ -6571,10 +6576,10 @@ function dn(n, e) {
|
|
|
6571
6576
|
class kt extends j {
|
|
6572
6577
|
_parse(e) {
|
|
6573
6578
|
const { status: t, ctx: s } = this._processInputParams(e), r = (a, o) => {
|
|
6574
|
-
if (
|
|
6579
|
+
if (cn(a) || cn(o))
|
|
6575
6580
|
return b;
|
|
6576
|
-
const c =
|
|
6577
|
-
return c.valid ? ((
|
|
6581
|
+
const c = un(a.value, o.value);
|
|
6582
|
+
return c.valid ? ((dn(a) || dn(o)) && t.dirty(), { status: t.value, value: c.data }) : (m(s, {
|
|
6578
6583
|
code: h.invalid_intersection_types
|
|
6579
6584
|
}), b);
|
|
6580
6585
|
};
|
|
@@ -6854,7 +6859,7 @@ class Fe extends j {
|
|
|
6854
6859
|
});
|
|
6855
6860
|
}
|
|
6856
6861
|
const a = { errorMap: t.common.contextualErrorMap }, o = t.data;
|
|
6857
|
-
if (this._def.returns instanceof
|
|
6862
|
+
if (this._def.returns instanceof Je) {
|
|
6858
6863
|
const c = this;
|
|
6859
6864
|
return M(async function(...d) {
|
|
6860
6865
|
const u = new U([]), l = await c._def.args.parseAsync(d, a).catch((L) => {
|
|
@@ -6945,7 +6950,7 @@ Tt.create = (n, e) => new Tt({
|
|
|
6945
6950
|
typeName: k.ZodLiteral,
|
|
6946
6951
|
...S(e)
|
|
6947
6952
|
});
|
|
6948
|
-
function
|
|
6953
|
+
function qn(n, e) {
|
|
6949
6954
|
return new ke({
|
|
6950
6955
|
values: n,
|
|
6951
6956
|
typeName: k.ZodEnum,
|
|
@@ -6965,7 +6970,7 @@ class ke extends j {
|
|
|
6965
6970
|
code: h.invalid_type
|
|
6966
6971
|
}), b;
|
|
6967
6972
|
}
|
|
6968
|
-
if (zt(this, Xe) ||
|
|
6973
|
+
if (zt(this, Xe) || Fn(this, Xe, new Set(this._def.values)), !zt(this, Xe).has(e.data)) {
|
|
6969
6974
|
const t = this._getOrReturnCtx(e), s = this._def.values;
|
|
6970
6975
|
return m(t, {
|
|
6971
6976
|
received: t.data,
|
|
@@ -7010,7 +7015,7 @@ class ke extends j {
|
|
|
7010
7015
|
}
|
|
7011
7016
|
}
|
|
7012
7017
|
Xe = /* @__PURE__ */ new WeakMap();
|
|
7013
|
-
ke.create =
|
|
7018
|
+
ke.create = qn;
|
|
7014
7019
|
class Ot extends j {
|
|
7015
7020
|
constructor() {
|
|
7016
7021
|
super(...arguments), et.set(this, void 0);
|
|
@@ -7025,7 +7030,7 @@ class Ot extends j {
|
|
|
7025
7030
|
code: h.invalid_type
|
|
7026
7031
|
}), b;
|
|
7027
7032
|
}
|
|
7028
|
-
if (zt(this, et) ||
|
|
7033
|
+
if (zt(this, et) || Fn(this, et, new Set(I.getValidEnumValues(this._def.values))), !zt(this, et).has(e.data)) {
|
|
7029
7034
|
const r = I.objectValues(t);
|
|
7030
7035
|
return m(s, {
|
|
7031
7036
|
received: s.data,
|
|
@@ -7045,7 +7050,7 @@ Ot.create = (n, e) => new Ot({
|
|
|
7045
7050
|
typeName: k.ZodNativeEnum,
|
|
7046
7051
|
...S(e)
|
|
7047
7052
|
});
|
|
7048
|
-
class
|
|
7053
|
+
class Je extends j {
|
|
7049
7054
|
unwrap() {
|
|
7050
7055
|
return this._def.type;
|
|
7051
7056
|
}
|
|
@@ -7064,12 +7069,12 @@ class Ke extends j {
|
|
|
7064
7069
|
})));
|
|
7065
7070
|
}
|
|
7066
7071
|
}
|
|
7067
|
-
|
|
7072
|
+
Je.create = (n, e) => new Je({
|
|
7068
7073
|
type: n,
|
|
7069
7074
|
typeName: k.ZodPromise,
|
|
7070
7075
|
...S(e)
|
|
7071
7076
|
});
|
|
7072
|
-
class
|
|
7077
|
+
class K extends j {
|
|
7073
7078
|
innerType() {
|
|
7074
7079
|
return this._def.schema;
|
|
7075
7080
|
}
|
|
@@ -7146,13 +7151,13 @@ class J extends j {
|
|
|
7146
7151
|
I.assertNever(r);
|
|
7147
7152
|
}
|
|
7148
7153
|
}
|
|
7149
|
-
|
|
7154
|
+
K.create = (n, e, t) => new K({
|
|
7150
7155
|
schema: n,
|
|
7151
7156
|
typeName: k.ZodEffects,
|
|
7152
7157
|
effect: e,
|
|
7153
7158
|
...S(t)
|
|
7154
7159
|
});
|
|
7155
|
-
|
|
7160
|
+
K.createWithPreprocess = (n, e, t) => new K({
|
|
7156
7161
|
schema: e,
|
|
7157
7162
|
effect: { type: "preprocess", transform: n },
|
|
7158
7163
|
typeName: k.ZodEffects,
|
|
@@ -7247,7 +7252,7 @@ Zt.create = (n, e) => new Zt({
|
|
|
7247
7252
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
7248
7253
|
...S(e)
|
|
7249
7254
|
});
|
|
7250
|
-
class
|
|
7255
|
+
class Kt extends j {
|
|
7251
7256
|
_parse(e) {
|
|
7252
7257
|
if (this._getType(e) !== g.nan) {
|
|
7253
7258
|
const s = this._getOrReturnCtx(e);
|
|
@@ -7260,12 +7265,12 @@ class Jt extends j {
|
|
|
7260
7265
|
return { status: "valid", value: e.data };
|
|
7261
7266
|
}
|
|
7262
7267
|
}
|
|
7263
|
-
|
|
7268
|
+
Kt.create = (n) => new Kt({
|
|
7264
7269
|
typeName: k.ZodNaN,
|
|
7265
7270
|
...S(n)
|
|
7266
7271
|
});
|
|
7267
|
-
const
|
|
7268
|
-
class
|
|
7272
|
+
const Ti = Symbol("zod_brand");
|
|
7273
|
+
class _n extends j {
|
|
7269
7274
|
_parse(e) {
|
|
7270
7275
|
const { ctx: t } = this._processInputParams(e), s = t.data;
|
|
7271
7276
|
return this._def.type._parse({
|
|
@@ -7332,25 +7337,25 @@ jt.create = (n, e) => new jt({
|
|
|
7332
7337
|
typeName: k.ZodReadonly,
|
|
7333
7338
|
...S(e)
|
|
7334
7339
|
});
|
|
7335
|
-
function
|
|
7336
|
-
return n ?
|
|
7340
|
+
function Kn(n, e = {}, t) {
|
|
7341
|
+
return n ? Ke.create().superRefine((s, r) => {
|
|
7337
7342
|
var a, o;
|
|
7338
7343
|
if (!n(s)) {
|
|
7339
7344
|
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;
|
|
7340
7345
|
r.addIssue({ code: "custom", ...u, fatal: d });
|
|
7341
7346
|
}
|
|
7342
|
-
}) :
|
|
7347
|
+
}) : Ke.create();
|
|
7343
7348
|
}
|
|
7344
|
-
const
|
|
7349
|
+
const Oi = {
|
|
7345
7350
|
object: A.lazycreate
|
|
7346
7351
|
};
|
|
7347
7352
|
var k;
|
|
7348
7353
|
(function(n) {
|
|
7349
7354
|
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";
|
|
7350
7355
|
})(k || (k = {}));
|
|
7351
|
-
const
|
|
7356
|
+
const Si = (n, e = {
|
|
7352
7357
|
message: `Input not instance of ${n.name}`
|
|
7353
|
-
}) =>
|
|
7358
|
+
}) => Kn((t) => t instanceof n, e), Jn = z.create, Qn = ve.create, Zi = Kt.create, ji = we.create, Hn = gt.create, Ni = Ce.create, Ii = Bt.create, Ci = yt.create, Ei = vt.create, Ai = Ke.create, Ri = je.create, $i = oe.create, Pi = Wt.create, Di = W.create, Mi = A.create, Li = A.strictCreate, Vi = wt.create, Ui = Ht.create, Fi = kt.create, zi = se.create, Bi = bt.create, Wi = qt.create, qi = Ee.create, Ki = Fe.create, Ji = xt.create, Qi = Tt.create, Hi = ke.create, Yi = Ot.create, Gi = Je.create, bn = K.create, Xi = X.create, eo = be.create, to = K.createWithPreprocess, no = It.create, so = () => Jn().optional(), ro = () => Qn().optional(), ao = () => Hn().optional(), io = {
|
|
7354
7359
|
string: (n) => z.create({ ...n, coerce: !0 }),
|
|
7355
7360
|
number: (n) => ve.create({ ...n, coerce: !0 }),
|
|
7356
7361
|
boolean: (n) => gt.create({
|
|
@@ -7359,33 +7364,33 @@ const Oi = (n, e = {
|
|
|
7359
7364
|
}),
|
|
7360
7365
|
bigint: (n) => we.create({ ...n, coerce: !0 }),
|
|
7361
7366
|
date: (n) => Ce.create({ ...n, coerce: !0 })
|
|
7362
|
-
},
|
|
7363
|
-
var
|
|
7367
|
+
}, oo = b;
|
|
7368
|
+
var co = /* @__PURE__ */ Object.freeze({
|
|
7364
7369
|
__proto__: null,
|
|
7365
7370
|
defaultErrorMap: qe,
|
|
7366
|
-
setErrorMap:
|
|
7371
|
+
setErrorMap: oi,
|
|
7367
7372
|
getErrorMap: Ut,
|
|
7368
7373
|
makeIssue: Ft,
|
|
7369
|
-
EMPTY_PATH:
|
|
7374
|
+
EMPTY_PATH: ci,
|
|
7370
7375
|
addIssueToContext: m,
|
|
7371
7376
|
ParseStatus: P,
|
|
7372
7377
|
INVALID: b,
|
|
7373
7378
|
DIRTY: Ve,
|
|
7374
7379
|
OK: M,
|
|
7375
|
-
isAborted:
|
|
7376
|
-
isDirty:
|
|
7380
|
+
isAborted: cn,
|
|
7381
|
+
isDirty: dn,
|
|
7377
7382
|
isValid: mt,
|
|
7378
7383
|
isAsync: _t,
|
|
7379
7384
|
get util() {
|
|
7380
7385
|
return I;
|
|
7381
7386
|
},
|
|
7382
7387
|
get objectUtil() {
|
|
7383
|
-
return
|
|
7388
|
+
return on;
|
|
7384
7389
|
},
|
|
7385
7390
|
ZodParsedType: g,
|
|
7386
7391
|
getParsedType: fe,
|
|
7387
7392
|
ZodType: j,
|
|
7388
|
-
datetimeRegex:
|
|
7393
|
+
datetimeRegex: Wn,
|
|
7389
7394
|
ZodString: z,
|
|
7390
7395
|
ZodNumber: ve,
|
|
7391
7396
|
ZodBigInt: we,
|
|
@@ -7394,7 +7399,7 @@ var oo = /* @__PURE__ */ Object.freeze({
|
|
|
7394
7399
|
ZodSymbol: Bt,
|
|
7395
7400
|
ZodUndefined: yt,
|
|
7396
7401
|
ZodNull: vt,
|
|
7397
|
-
ZodAny:
|
|
7402
|
+
ZodAny: Ke,
|
|
7398
7403
|
ZodUnknown: je,
|
|
7399
7404
|
ZodNever: oe,
|
|
7400
7405
|
ZodVoid: Wt,
|
|
@@ -7412,71 +7417,71 @@ var oo = /* @__PURE__ */ Object.freeze({
|
|
|
7412
7417
|
ZodLiteral: Tt,
|
|
7413
7418
|
ZodEnum: ke,
|
|
7414
7419
|
ZodNativeEnum: Ot,
|
|
7415
|
-
ZodPromise:
|
|
7416
|
-
ZodEffects:
|
|
7417
|
-
ZodTransformer:
|
|
7420
|
+
ZodPromise: Je,
|
|
7421
|
+
ZodEffects: K,
|
|
7422
|
+
ZodTransformer: K,
|
|
7418
7423
|
ZodOptional: X,
|
|
7419
7424
|
ZodNullable: be,
|
|
7420
7425
|
ZodDefault: St,
|
|
7421
7426
|
ZodCatch: Zt,
|
|
7422
|
-
ZodNaN:
|
|
7423
|
-
BRAND:
|
|
7424
|
-
ZodBranded:
|
|
7427
|
+
ZodNaN: Kt,
|
|
7428
|
+
BRAND: Ti,
|
|
7429
|
+
ZodBranded: _n,
|
|
7425
7430
|
ZodPipeline: It,
|
|
7426
7431
|
ZodReadonly: jt,
|
|
7427
|
-
custom:
|
|
7432
|
+
custom: Kn,
|
|
7428
7433
|
Schema: j,
|
|
7429
7434
|
ZodSchema: j,
|
|
7430
|
-
late:
|
|
7435
|
+
late: Oi,
|
|
7431
7436
|
get ZodFirstPartyTypeKind() {
|
|
7432
7437
|
return k;
|
|
7433
7438
|
},
|
|
7434
|
-
coerce:
|
|
7435
|
-
any:
|
|
7436
|
-
array:
|
|
7437
|
-
bigint:
|
|
7438
|
-
boolean:
|
|
7439
|
-
date:
|
|
7440
|
-
discriminatedUnion:
|
|
7441
|
-
effect:
|
|
7442
|
-
enum:
|
|
7443
|
-
function:
|
|
7444
|
-
instanceof:
|
|
7445
|
-
intersection:
|
|
7439
|
+
coerce: io,
|
|
7440
|
+
any: Ai,
|
|
7441
|
+
array: Di,
|
|
7442
|
+
bigint: ji,
|
|
7443
|
+
boolean: Hn,
|
|
7444
|
+
date: Ni,
|
|
7445
|
+
discriminatedUnion: Ui,
|
|
7446
|
+
effect: bn,
|
|
7447
|
+
enum: Hi,
|
|
7448
|
+
function: Ki,
|
|
7449
|
+
instanceof: Si,
|
|
7450
|
+
intersection: Fi,
|
|
7446
7451
|
lazy: Ji,
|
|
7447
|
-
literal:
|
|
7448
|
-
map:
|
|
7449
|
-
nan:
|
|
7450
|
-
nativeEnum:
|
|
7451
|
-
never:
|
|
7452
|
-
null:
|
|
7453
|
-
nullable:
|
|
7454
|
-
number:
|
|
7455
|
-
object:
|
|
7456
|
-
oboolean:
|
|
7457
|
-
onumber:
|
|
7458
|
-
optional:
|
|
7459
|
-
ostring:
|
|
7460
|
-
pipeline:
|
|
7461
|
-
preprocess:
|
|
7462
|
-
promise:
|
|
7463
|
-
record:
|
|
7464
|
-
set:
|
|
7465
|
-
strictObject:
|
|
7452
|
+
literal: Qi,
|
|
7453
|
+
map: Wi,
|
|
7454
|
+
nan: Zi,
|
|
7455
|
+
nativeEnum: Yi,
|
|
7456
|
+
never: $i,
|
|
7457
|
+
null: Ei,
|
|
7458
|
+
nullable: eo,
|
|
7459
|
+
number: Qn,
|
|
7460
|
+
object: Mi,
|
|
7461
|
+
oboolean: ao,
|
|
7462
|
+
onumber: ro,
|
|
7463
|
+
optional: Xi,
|
|
7464
|
+
ostring: so,
|
|
7465
|
+
pipeline: no,
|
|
7466
|
+
preprocess: to,
|
|
7467
|
+
promise: Gi,
|
|
7468
|
+
record: Bi,
|
|
7469
|
+
set: qi,
|
|
7470
|
+
strictObject: Li,
|
|
7466
7471
|
string: Jn,
|
|
7467
|
-
symbol:
|
|
7468
|
-
transformer:
|
|
7469
|
-
tuple:
|
|
7470
|
-
undefined:
|
|
7471
|
-
union:
|
|
7472
|
-
unknown:
|
|
7473
|
-
void:
|
|
7474
|
-
NEVER:
|
|
7472
|
+
symbol: Ii,
|
|
7473
|
+
transformer: bn,
|
|
7474
|
+
tuple: zi,
|
|
7475
|
+
undefined: Ci,
|
|
7476
|
+
union: Vi,
|
|
7477
|
+
unknown: Ri,
|
|
7478
|
+
void: Pi,
|
|
7479
|
+
NEVER: oo,
|
|
7475
7480
|
ZodIssueCode: h,
|
|
7476
|
-
quotelessJson:
|
|
7481
|
+
quotelessJson: ii,
|
|
7477
7482
|
ZodError: U
|
|
7478
7483
|
});
|
|
7479
|
-
|
|
7484
|
+
ai(co);
|
|
7480
7485
|
function Ct(n, e = "", t = {}) {
|
|
7481
7486
|
for (let s in n)
|
|
7482
7487
|
if (Object.prototype.hasOwnProperty.call(n, s)) {
|
|
@@ -7485,7 +7490,7 @@ function Ct(n, e = "", t = {}) {
|
|
|
7485
7490
|
}
|
|
7486
7491
|
return t;
|
|
7487
7492
|
}
|
|
7488
|
-
function
|
|
7493
|
+
function uo(n, e) {
|
|
7489
7494
|
const t = {};
|
|
7490
7495
|
for (const [s, r] of Object.entries(n)) {
|
|
7491
7496
|
const a = e.find(
|
|
@@ -7503,7 +7508,7 @@ function co(n, e) {
|
|
|
7503
7508
|
}
|
|
7504
7509
|
return t;
|
|
7505
7510
|
}
|
|
7506
|
-
function
|
|
7511
|
+
function lo(n) {
|
|
7507
7512
|
return async (e, t) => {
|
|
7508
7513
|
const s = {
|
|
7509
7514
|
themeId: Re(),
|
|
@@ -7514,16 +7519,16 @@ function uo(n) {
|
|
|
7514
7519
|
return await n.insertInto("themes").values({ ...Ct(s), tenant_id: e }).execute(), s;
|
|
7515
7520
|
};
|
|
7516
7521
|
}
|
|
7517
|
-
function
|
|
7522
|
+
function po(n) {
|
|
7518
7523
|
return async (e, t) => (await n.deleteFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
7519
7524
|
}
|
|
7520
|
-
function
|
|
7525
|
+
function ho(n) {
|
|
7521
7526
|
return async (e, t) => {
|
|
7522
7527
|
const s = await n.selectFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", t).selectAll().executeTakeFirst();
|
|
7523
7528
|
return s ? R(s) : null;
|
|
7524
7529
|
};
|
|
7525
7530
|
}
|
|
7526
|
-
function
|
|
7531
|
+
function fo(n) {
|
|
7527
7532
|
return async (e, t, s) => {
|
|
7528
7533
|
const r = Ct({
|
|
7529
7534
|
...s,
|
|
@@ -7532,23 +7537,23 @@ function ho(n) {
|
|
|
7532
7537
|
return await n.updateTable("themes").set(r).where("themes.id", "=", t).where("themes.tenant_id", "=", e).execute(), !0;
|
|
7533
7538
|
};
|
|
7534
7539
|
}
|
|
7535
|
-
function
|
|
7540
|
+
function mo(n) {
|
|
7536
7541
|
return {
|
|
7537
|
-
create:
|
|
7538
|
-
get:
|
|
7539
|
-
remove:
|
|
7540
|
-
update:
|
|
7542
|
+
create: lo(n),
|
|
7543
|
+
get: ho(n),
|
|
7544
|
+
remove: po(n),
|
|
7545
|
+
update: fo(n)
|
|
7541
7546
|
};
|
|
7542
7547
|
}
|
|
7543
|
-
function
|
|
7548
|
+
function _o(n) {
|
|
7544
7549
|
return async (e, t) => {
|
|
7545
7550
|
const s = (/* @__PURE__ */ new Date()).toISOString(), r = await n.selectFrom("logins").where("logins.expires_at", ">", s).where("logins.login_id", "=", t).selectAll().executeTakeFirst();
|
|
7546
|
-
return r ?
|
|
7547
|
-
|
|
7551
|
+
return r ? yr.parse(
|
|
7552
|
+
uo(R(r), ["authParams"])
|
|
7548
7553
|
) : null;
|
|
7549
7554
|
};
|
|
7550
7555
|
}
|
|
7551
|
-
function
|
|
7556
|
+
function go(n) {
|
|
7552
7557
|
return async (e, t) => {
|
|
7553
7558
|
const s = {
|
|
7554
7559
|
login_id: Re(),
|
|
@@ -7559,43 +7564,43 @@ function _o(n) {
|
|
|
7559
7564
|
return await n.insertInto("logins").values({ ...Ct(s), tenant_id: e }).execute(), s;
|
|
7560
7565
|
};
|
|
7561
7566
|
}
|
|
7562
|
-
function
|
|
7567
|
+
function yo(n) {
|
|
7563
7568
|
return async (e, t, s) => (await n.updateTable("logins").set(Ct(s)).where("logins.login_id", "=", t).where("logins.tenant_id", "=", e).execute()).length === 1;
|
|
7564
7569
|
}
|
|
7565
|
-
function
|
|
7570
|
+
function vo(n) {
|
|
7566
7571
|
return async (e, t) => (await n.deleteFrom("logins").where("logins.tenant_id", "=", e).where("logins.login_id", "=", t).execute()).length > 0;
|
|
7567
7572
|
}
|
|
7568
|
-
function
|
|
7573
|
+
function wo(n) {
|
|
7569
7574
|
return {
|
|
7570
|
-
create:
|
|
7571
|
-
get:
|
|
7572
|
-
update:
|
|
7573
|
-
remove:
|
|
7575
|
+
create: go(n),
|
|
7576
|
+
get: _o(n),
|
|
7577
|
+
update: yo(n),
|
|
7578
|
+
remove: vo(n)
|
|
7574
7579
|
};
|
|
7575
7580
|
}
|
|
7576
|
-
function
|
|
7581
|
+
function bo(n) {
|
|
7577
7582
|
return {
|
|
7578
|
-
applications:
|
|
7579
|
-
authenticationCodes:
|
|
7580
|
-
branding:
|
|
7581
|
-
clients:
|
|
7582
|
-
codes:
|
|
7583
|
-
connections:
|
|
7584
|
-
domains:
|
|
7585
|
-
hooks:
|
|
7586
|
-
keys:
|
|
7587
|
-
logins:
|
|
7588
|
-
logs:
|
|
7589
|
-
OTP:
|
|
7590
|
-
passwords:
|
|
7591
|
-
users:
|
|
7592
|
-
sessions:
|
|
7593
|
-
tenants:
|
|
7594
|
-
themes:
|
|
7595
|
-
tickets:
|
|
7596
|
-
universalLoginSessions:
|
|
7583
|
+
applications: Ia(n),
|
|
7584
|
+
authenticationCodes: Ha(n),
|
|
7585
|
+
branding: Ka(n),
|
|
7586
|
+
clients: Da(n),
|
|
7587
|
+
codes: wa(n),
|
|
7588
|
+
connections: Pa(n),
|
|
7589
|
+
domains: Ba(n),
|
|
7590
|
+
hooks: ni(n),
|
|
7591
|
+
keys: Ua(n),
|
|
7592
|
+
logins: wo(n),
|
|
7593
|
+
logs: Yr(n),
|
|
7594
|
+
OTP: la(n),
|
|
7595
|
+
passwords: ma(n),
|
|
7596
|
+
users: Lr(n),
|
|
7597
|
+
sessions: sa(n),
|
|
7598
|
+
tenants: qr(n),
|
|
7599
|
+
themes: mo(n),
|
|
7600
|
+
tickets: oa(n),
|
|
7601
|
+
universalLoginSessions: Ta(n)
|
|
7597
7602
|
};
|
|
7598
7603
|
}
|
|
7599
7604
|
export {
|
|
7600
|
-
|
|
7605
|
+
bo as default
|
|
7601
7606
|
};
|