@authhero/kysely-adapter 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kysely-adapter.cjs +1 -1
- package/dist/kysely-adapter.d.ts +262 -27
- package/dist/kysely-adapter.iife.js +1 -1
- package/dist/kysely-adapter.mjs +1046 -981
- package/package.json +2 -2
package/dist/kysely-adapter.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var Kn = Object.defineProperty;
|
|
2
|
+
var Hn = (n, e, t) => e in n ? Kn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var Ht = (n, e, t) => Hn(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
var Gt = class extends Error {
|
|
5
5
|
constructor(e = 500, t) {
|
|
6
6
|
super(t == null ? void 0 : t.message, { cause: t == null ? void 0 : t.cause });
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
Ht(this, "res");
|
|
8
|
+
Ht(this, "status");
|
|
9
9
|
this.res = t == null ? void 0 : t.res, this.status = e;
|
|
10
10
|
}
|
|
11
11
|
getResponse() {
|
|
@@ -47,7 +47,7 @@ function R(n) {
|
|
|
47
47
|
e[t] === null ? delete e[t] : typeof e[t] == "object" && (Array.isArray(e[t]) ? e[t] = e[t].map(R) : e[t] = R(e[t]));
|
|
48
48
|
return e;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function Yn(n, e) {
|
|
51
51
|
var t = {};
|
|
52
52
|
for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && e.indexOf(s) < 0 && (t[s] = n[s]);
|
|
53
53
|
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -55,7 +55,7 @@ function Hn(n, e) {
|
|
|
55
55
|
e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, s[r]) && (t[s[r]] = n[s[r]]);
|
|
56
56
|
return t;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function Gn(n, e) {
|
|
59
59
|
var t;
|
|
60
60
|
return ((t = n == null ? void 0 : n._def) === null || t === void 0 ? void 0 : t.typeName) === e;
|
|
61
61
|
}
|
|
@@ -66,22 +66,22 @@ function Qe(n, e) {
|
|
|
66
66
|
return r._def.openapi = this._def.openapi, r;
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function Xn(n) {
|
|
70
70
|
if (typeof n.ZodType.prototype.openapi < "u")
|
|
71
71
|
return;
|
|
72
72
|
n.ZodType.prototype.openapi = function(r, a) {
|
|
73
73
|
var o, c, d, u, l, j;
|
|
74
|
-
const A = typeof r == "string" ? a : r, U = A ?? {}, { param: ie } = U,
|
|
74
|
+
const A = typeof r == "string" ? a : r, U = A ?? {}, { param: ie } = U, $e = Yn(U, ["param"]), oe = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), ce = Object.assign(Object.assign(Object.assign({}, (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata), $e), !((u = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || u === void 0) && u.param || ie ? {
|
|
75
75
|
param: Object.assign(Object.assign({}, (j = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || j === void 0 ? void 0 : j.param), ie)
|
|
76
76
|
} : void 0), de = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(oe).length > 0 ? { _internal: oe } : void 0), Object.keys(ce).length > 0 ? { metadata: ce } : void 0) }));
|
|
77
|
-
if (
|
|
78
|
-
const
|
|
79
|
-
de.extend = function(...
|
|
80
|
-
var K,
|
|
81
|
-
const Oe =
|
|
77
|
+
if (Gn(this, "ZodObject")) {
|
|
78
|
+
const Pe = this.extend;
|
|
79
|
+
de.extend = function(...De) {
|
|
80
|
+
var K, H, Q, ue, xe, Te;
|
|
81
|
+
const Oe = Pe.apply(this, De);
|
|
82
82
|
return Oe._def.openapi = {
|
|
83
83
|
_internal: {
|
|
84
|
-
extendedFrom: !((
|
|
84
|
+
extendedFrom: !((H = (K = this._def.openapi) === null || K === void 0 ? void 0 : K._internal) === null || H === void 0) && H.refId ? { refId: (ue = (Q = this._def.openapi) === null || Q === void 0 ? void 0 : Q._internal) === null || ue === void 0 ? void 0 : ue.refId, schema: this } : (xe = this._def.openapi) === null || xe === void 0 ? void 0 : xe._internal.extendedFrom
|
|
85
85
|
},
|
|
86
86
|
metadata: (Te = Oe._def.openapi) === null || Te === void 0 ? void 0 : Te.metadata
|
|
87
87
|
}, Oe;
|
|
@@ -212,7 +212,7 @@ const _ = N.arrayToEnum([
|
|
|
212
212
|
"invalid_intersection_types",
|
|
213
213
|
"not_multiple_of",
|
|
214
214
|
"not_finite"
|
|
215
|
-
]),
|
|
215
|
+
]), es = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
216
216
|
class L extends Error {
|
|
217
217
|
constructor(e) {
|
|
218
218
|
super(), this.issues = [], this.addIssue = (s) => {
|
|
@@ -273,7 +273,7 @@ class L extends Error {
|
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
L.create = (n) => new L(n);
|
|
276
|
-
const
|
|
276
|
+
const Be = (n, e) => {
|
|
277
277
|
let t;
|
|
278
278
|
switch (n.code) {
|
|
279
279
|
case p.invalid_type:
|
|
@@ -329,12 +329,12 @@ const ze = (n, e) => {
|
|
|
329
329
|
}
|
|
330
330
|
return { message: t };
|
|
331
331
|
};
|
|
332
|
-
let
|
|
333
|
-
function
|
|
334
|
-
|
|
332
|
+
let wn = Be;
|
|
333
|
+
function ts(n) {
|
|
334
|
+
wn = n;
|
|
335
335
|
}
|
|
336
336
|
function Et() {
|
|
337
|
-
return
|
|
337
|
+
return wn;
|
|
338
338
|
}
|
|
339
339
|
const At = (n) => {
|
|
340
340
|
const { data: e, path: t, errorMaps: s, issueData: r } = n, a = [...t, ...r.path || []], o = {
|
|
@@ -356,7 +356,7 @@ const At = (n) => {
|
|
|
356
356
|
path: a,
|
|
357
357
|
message: c
|
|
358
358
|
};
|
|
359
|
-
},
|
|
359
|
+
}, ns = [];
|
|
360
360
|
function f(n, e) {
|
|
361
361
|
const t = Et(), s = At({
|
|
362
362
|
issueData: e,
|
|
@@ -366,7 +366,7 @@ function f(n, e) {
|
|
|
366
366
|
n.common.contextualErrorMap,
|
|
367
367
|
n.schemaErrorMap,
|
|
368
368
|
t,
|
|
369
|
-
t ===
|
|
369
|
+
t === Be ? void 0 : Be
|
|
370
370
|
// then global default map
|
|
371
371
|
].filter((r) => !!r)
|
|
372
372
|
});
|
|
@@ -415,12 +415,12 @@ class $ {
|
|
|
415
415
|
}
|
|
416
416
|
const x = Object.freeze({
|
|
417
417
|
status: "aborted"
|
|
418
|
-
}), Rt = (n) => ({ status: "dirty", value: n }), D = (n) => ({ status: "valid", value: n }), en = (n) => n.status === "aborted", tn = (n) => n.status === "dirty",
|
|
418
|
+
}), Rt = (n) => ({ status: "dirty", value: n }), D = (n) => ({ status: "valid", value: n }), en = (n) => n.status === "aborted", tn = (n) => n.status === "dirty", nt = (n) => n.status === "valid", st = (n) => typeof Promise < "u" && n instanceof Promise;
|
|
419
419
|
function $t(n, e, t, s) {
|
|
420
420
|
if (typeof e == "function" ? n !== e || !s : !e.has(n)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
421
421
|
return e.get(n);
|
|
422
422
|
}
|
|
423
|
-
function
|
|
423
|
+
function bn(n, e, t, s, r) {
|
|
424
424
|
if (typeof e == "function" ? n !== e || !r : !e.has(n)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
425
425
|
return e.set(n, t), t;
|
|
426
426
|
}
|
|
@@ -428,7 +428,7 @@ var y;
|
|
|
428
428
|
(function(n) {
|
|
429
429
|
n.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, n.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
430
430
|
})(y || (y = {}));
|
|
431
|
-
var
|
|
431
|
+
var Ge, Xe;
|
|
432
432
|
class X {
|
|
433
433
|
constructor(e, t, s, r) {
|
|
434
434
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = r;
|
|
@@ -437,8 +437,8 @@ class X {
|
|
|
437
437
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
const
|
|
441
|
-
if (
|
|
440
|
+
const fn = (n, e) => {
|
|
441
|
+
if (nt(e))
|
|
442
442
|
return { success: !0, data: e.value };
|
|
443
443
|
if (!n.common.issues.length)
|
|
444
444
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -499,7 +499,7 @@ class S {
|
|
|
499
499
|
}
|
|
500
500
|
_parseSync(e) {
|
|
501
501
|
const t = this._parse(e);
|
|
502
|
-
if (
|
|
502
|
+
if (st(t))
|
|
503
503
|
throw new Error("Synchronous parse encountered promise.");
|
|
504
504
|
return t;
|
|
505
505
|
}
|
|
@@ -527,7 +527,7 @@ class S {
|
|
|
527
527
|
data: e,
|
|
528
528
|
parsedType: pe(e)
|
|
529
529
|
}, a = this._parseSync({ data: e, path: r.path, parent: r });
|
|
530
|
-
return
|
|
530
|
+
return fn(r, a);
|
|
531
531
|
}
|
|
532
532
|
async parseAsync(e, t) {
|
|
533
533
|
const s = await this.safeParseAsync(e, t);
|
|
@@ -547,8 +547,8 @@ class S {
|
|
|
547
547
|
parent: null,
|
|
548
548
|
data: e,
|
|
549
549
|
parsedType: pe(e)
|
|
550
|
-
}, r = this._parse({ data: e, path: s.path, parent: s }), a = await (
|
|
551
|
-
return
|
|
550
|
+
}, r = this._parse({ data: e, path: s.path, parent: s }), a = await (st(r) ? r : Promise.resolve(r));
|
|
551
|
+
return fn(s, a);
|
|
552
552
|
}
|
|
553
553
|
refine(e, t) {
|
|
554
554
|
const s = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
|
|
@@ -586,13 +586,13 @@ class S {
|
|
|
586
586
|
return B.create(this, this._def);
|
|
587
587
|
}
|
|
588
588
|
promise() {
|
|
589
|
-
return
|
|
589
|
+
return qe.create(this, this._def);
|
|
590
590
|
}
|
|
591
591
|
or(e) {
|
|
592
|
-
return
|
|
592
|
+
return ot.create([this, e], this._def);
|
|
593
593
|
}
|
|
594
594
|
and(e) {
|
|
595
|
-
return
|
|
595
|
+
return ct.create(this, e, this._def);
|
|
596
596
|
}
|
|
597
597
|
transform(e) {
|
|
598
598
|
return new q({
|
|
@@ -604,7 +604,7 @@ class S {
|
|
|
604
604
|
}
|
|
605
605
|
default(e) {
|
|
606
606
|
const t = typeof e == "function" ? e : () => e;
|
|
607
|
-
return new
|
|
607
|
+
return new ht({
|
|
608
608
|
...T(this._def),
|
|
609
609
|
innerType: this,
|
|
610
610
|
defaultValue: t,
|
|
@@ -620,7 +620,7 @@ class S {
|
|
|
620
620
|
}
|
|
621
621
|
catch(e) {
|
|
622
622
|
const t = typeof e == "function" ? e : () => e;
|
|
623
|
-
return new
|
|
623
|
+
return new ft({
|
|
624
624
|
...T(this._def),
|
|
625
625
|
innerType: this,
|
|
626
626
|
catchValue: t,
|
|
@@ -635,10 +635,10 @@ class S {
|
|
|
635
635
|
});
|
|
636
636
|
}
|
|
637
637
|
pipe(e) {
|
|
638
|
-
return
|
|
638
|
+
return Ct.create(this, e);
|
|
639
639
|
}
|
|
640
640
|
readonly() {
|
|
641
|
-
return
|
|
641
|
+
return mt.create(this);
|
|
642
642
|
}
|
|
643
643
|
isOptional() {
|
|
644
644
|
return this.safeParse(void 0).success;
|
|
@@ -647,23 +647,23 @@ class S {
|
|
|
647
647
|
return this.safeParse(null).success;
|
|
648
648
|
}
|
|
649
649
|
}
|
|
650
|
-
const
|
|
651
|
-
let
|
|
652
|
-
const
|
|
653
|
-
function
|
|
650
|
+
const ss = /^c[^\s-]{8,}$/i, rs = /^[0-9a-z]+$/, as = /^[0-9A-HJKMNP-TV-Z]{26}$/, is = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, os = /^[a-z0-9_-]{21}$/i, cs = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, ds = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, us = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
651
|
+
let Qt;
|
|
652
|
+
const ls = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, ps = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, hs = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, kn = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", fs = new RegExp(`^${kn}$`);
|
|
653
|
+
function xn(n) {
|
|
654
654
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
655
655
|
return n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
656
656
|
}
|
|
657
|
-
function
|
|
658
|
-
return new RegExp(`^${
|
|
657
|
+
function ms(n) {
|
|
658
|
+
return new RegExp(`^${xn(n)}$`);
|
|
659
659
|
}
|
|
660
|
-
function
|
|
661
|
-
let e = `${kn}T${
|
|
660
|
+
function Tn(n) {
|
|
661
|
+
let e = `${kn}T${xn(n)}`;
|
|
662
662
|
const t = [];
|
|
663
663
|
return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
664
664
|
}
|
|
665
|
-
function
|
|
666
|
-
return !!((e === "v4" || !e) &&
|
|
665
|
+
function _s(n, e) {
|
|
666
|
+
return !!((e === "v4" || !e) && ls.test(n) || (e === "v6" || !e) && ps.test(n));
|
|
667
667
|
}
|
|
668
668
|
class F extends S {
|
|
669
669
|
_parse(e) {
|
|
@@ -714,43 +714,43 @@ class F extends S {
|
|
|
714
714
|
message: r.message
|
|
715
715
|
}), t.dirty());
|
|
716
716
|
} else if (r.kind === "email")
|
|
717
|
-
|
|
717
|
+
ds.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
718
718
|
validation: "email",
|
|
719
719
|
code: p.invalid_string,
|
|
720
720
|
message: r.message
|
|
721
721
|
}), t.dirty());
|
|
722
722
|
else if (r.kind === "emoji")
|
|
723
|
-
|
|
723
|
+
Qt || (Qt = new RegExp(us, "u")), Qt.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
724
724
|
validation: "emoji",
|
|
725
725
|
code: p.invalid_string,
|
|
726
726
|
message: r.message
|
|
727
727
|
}), t.dirty());
|
|
728
728
|
else if (r.kind === "uuid")
|
|
729
|
-
|
|
729
|
+
is.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
730
730
|
validation: "uuid",
|
|
731
731
|
code: p.invalid_string,
|
|
732
732
|
message: r.message
|
|
733
733
|
}), t.dirty());
|
|
734
734
|
else if (r.kind === "nanoid")
|
|
735
|
-
|
|
735
|
+
os.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
736
736
|
validation: "nanoid",
|
|
737
737
|
code: p.invalid_string,
|
|
738
738
|
message: r.message
|
|
739
739
|
}), t.dirty());
|
|
740
740
|
else if (r.kind === "cuid")
|
|
741
|
-
|
|
741
|
+
ss.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
742
742
|
validation: "cuid",
|
|
743
743
|
code: p.invalid_string,
|
|
744
744
|
message: r.message
|
|
745
745
|
}), t.dirty());
|
|
746
746
|
else if (r.kind === "cuid2")
|
|
747
|
-
|
|
747
|
+
rs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
748
748
|
validation: "cuid2",
|
|
749
749
|
code: p.invalid_string,
|
|
750
750
|
message: r.message
|
|
751
751
|
}), t.dirty());
|
|
752
752
|
else if (r.kind === "ulid")
|
|
753
|
-
|
|
753
|
+
as.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
754
754
|
validation: "ulid",
|
|
755
755
|
code: p.invalid_string,
|
|
756
756
|
message: r.message
|
|
@@ -781,27 +781,27 @@ class F extends S {
|
|
|
781
781
|
code: p.invalid_string,
|
|
782
782
|
validation: { endsWith: r.value },
|
|
783
783
|
message: r.message
|
|
784
|
-
}), t.dirty()) : r.kind === "datetime" ?
|
|
784
|
+
}), t.dirty()) : r.kind === "datetime" ? Tn(r).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
785
785
|
code: p.invalid_string,
|
|
786
786
|
validation: "datetime",
|
|
787
787
|
message: r.message
|
|
788
|
-
}), t.dirty()) : r.kind === "date" ?
|
|
788
|
+
}), t.dirty()) : r.kind === "date" ? fs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
789
789
|
code: p.invalid_string,
|
|
790
790
|
validation: "date",
|
|
791
791
|
message: r.message
|
|
792
|
-
}), t.dirty()) : r.kind === "time" ?
|
|
792
|
+
}), t.dirty()) : r.kind === "time" ? ms(r).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
793
793
|
code: p.invalid_string,
|
|
794
794
|
validation: "time",
|
|
795
795
|
message: r.message
|
|
796
|
-
}), t.dirty()) : r.kind === "duration" ?
|
|
796
|
+
}), t.dirty()) : r.kind === "duration" ? cs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
797
797
|
validation: "duration",
|
|
798
798
|
code: p.invalid_string,
|
|
799
799
|
message: r.message
|
|
800
|
-
}), t.dirty()) : r.kind === "ip" ?
|
|
800
|
+
}), t.dirty()) : r.kind === "ip" ? _s(e.data, r.version) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
801
801
|
validation: "ip",
|
|
802
802
|
code: p.invalid_string,
|
|
803
803
|
message: r.message
|
|
804
|
-
}), t.dirty()) : r.kind === "base64" ?
|
|
804
|
+
}), t.dirty()) : r.kind === "base64" ? hs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
805
805
|
validation: "base64",
|
|
806
806
|
code: p.invalid_string,
|
|
807
807
|
message: r.message
|
|
@@ -1023,7 +1023,7 @@ F.create = (n) => {
|
|
|
1023
1023
|
...T(n)
|
|
1024
1024
|
});
|
|
1025
1025
|
};
|
|
1026
|
-
function
|
|
1026
|
+
function gs(n, e) {
|
|
1027
1027
|
const t = (n.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, r = t > s ? t : s, a = parseInt(n.toFixed(r).replace(".", "")), o = parseInt(e.toFixed(r).replace(".", ""));
|
|
1028
1028
|
return a % o / Math.pow(10, r);
|
|
1029
1029
|
}
|
|
@@ -1062,7 +1062,7 @@ class fe extends S {
|
|
|
1062
1062
|
inclusive: r.inclusive,
|
|
1063
1063
|
exact: !1,
|
|
1064
1064
|
message: r.message
|
|
1065
|
-
}), s.dirty()) : r.kind === "multipleOf" ?
|
|
1065
|
+
}), s.dirty()) : r.kind === "multipleOf" ? gs(e.data, r.value) !== 0 && (t = this._getOrReturnCtx(e, t), f(t, {
|
|
1066
1066
|
code: p.not_multiple_of,
|
|
1067
1067
|
multipleOf: r.value,
|
|
1068
1068
|
message: r.message
|
|
@@ -1327,7 +1327,7 @@ me.create = (n) => {
|
|
|
1327
1327
|
...T(n)
|
|
1328
1328
|
});
|
|
1329
1329
|
};
|
|
1330
|
-
class
|
|
1330
|
+
class rt extends S {
|
|
1331
1331
|
_parse(e) {
|
|
1332
1332
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== _.boolean) {
|
|
1333
1333
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1340,7 +1340,7 @@ class st extends S {
|
|
|
1340
1340
|
return D(e.data);
|
|
1341
1341
|
}
|
|
1342
1342
|
}
|
|
1343
|
-
|
|
1343
|
+
rt.create = (n) => new rt({
|
|
1344
1344
|
typeName: w.ZodBoolean,
|
|
1345
1345
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
1346
1346
|
...T(n)
|
|
@@ -1440,7 +1440,7 @@ Pt.create = (n) => new Pt({
|
|
|
1440
1440
|
typeName: w.ZodSymbol,
|
|
1441
1441
|
...T(n)
|
|
1442
1442
|
});
|
|
1443
|
-
class
|
|
1443
|
+
class at extends S {
|
|
1444
1444
|
_parse(e) {
|
|
1445
1445
|
if (this._getType(e) !== _.undefined) {
|
|
1446
1446
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1453,11 +1453,11 @@ class rt extends S {
|
|
|
1453
1453
|
return D(e.data);
|
|
1454
1454
|
}
|
|
1455
1455
|
}
|
|
1456
|
-
|
|
1456
|
+
at.create = (n) => new at({
|
|
1457
1457
|
typeName: w.ZodUndefined,
|
|
1458
1458
|
...T(n)
|
|
1459
1459
|
});
|
|
1460
|
-
class
|
|
1460
|
+
class it extends S {
|
|
1461
1461
|
_parse(e) {
|
|
1462
1462
|
if (this._getType(e) !== _.null) {
|
|
1463
1463
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1470,11 +1470,11 @@ class at extends S {
|
|
|
1470
1470
|
return D(e.data);
|
|
1471
1471
|
}
|
|
1472
1472
|
}
|
|
1473
|
-
|
|
1473
|
+
it.create = (n) => new it({
|
|
1474
1474
|
typeName: w.ZodNull,
|
|
1475
1475
|
...T(n)
|
|
1476
1476
|
});
|
|
1477
|
-
class
|
|
1477
|
+
class We extends S {
|
|
1478
1478
|
constructor() {
|
|
1479
1479
|
super(...arguments), this._any = !0;
|
|
1480
1480
|
}
|
|
@@ -1482,7 +1482,7 @@ class Be extends S {
|
|
|
1482
1482
|
return D(e.data);
|
|
1483
1483
|
}
|
|
1484
1484
|
}
|
|
1485
|
-
|
|
1485
|
+
We.create = (n) => new We({
|
|
1486
1486
|
typeName: w.ZodAny,
|
|
1487
1487
|
...T(n)
|
|
1488
1488
|
});
|
|
@@ -1602,12 +1602,12 @@ B.create = (n, e) => new B({
|
|
|
1602
1602
|
typeName: w.ZodArray,
|
|
1603
1603
|
...T(e)
|
|
1604
1604
|
});
|
|
1605
|
-
function
|
|
1605
|
+
function Le(n) {
|
|
1606
1606
|
if (n instanceof I) {
|
|
1607
1607
|
const e = {};
|
|
1608
1608
|
for (const t in n.shape) {
|
|
1609
1609
|
const s = n.shape[t];
|
|
1610
|
-
e[t] = Y.create(
|
|
1610
|
+
e[t] = Y.create(Le(s));
|
|
1611
1611
|
}
|
|
1612
1612
|
return new I({
|
|
1613
1613
|
...n._def,
|
|
@@ -1615,8 +1615,8 @@ function Me(n) {
|
|
|
1615
1615
|
});
|
|
1616
1616
|
} else return n instanceof B ? new B({
|
|
1617
1617
|
...n._def,
|
|
1618
|
-
type:
|
|
1619
|
-
}) : n instanceof Y ? Y.create(
|
|
1618
|
+
type: Le(n.element)
|
|
1619
|
+
}) : n instanceof Y ? Y.create(Le(n.unwrap())) : n instanceof ge ? ge.create(Le(n.unwrap())) : n instanceof ee ? ee.create(n.items.map((e) => Le(e))) : n;
|
|
1620
1620
|
}
|
|
1621
1621
|
class I extends S {
|
|
1622
1622
|
constructor() {
|
|
@@ -1852,7 +1852,7 @@ class I extends S {
|
|
|
1852
1852
|
* @deprecated
|
|
1853
1853
|
*/
|
|
1854
1854
|
deepPartial() {
|
|
1855
|
-
return
|
|
1855
|
+
return Le(this);
|
|
1856
1856
|
}
|
|
1857
1857
|
partial(e) {
|
|
1858
1858
|
const t = {};
|
|
@@ -1881,7 +1881,7 @@ class I extends S {
|
|
|
1881
1881
|
});
|
|
1882
1882
|
}
|
|
1883
1883
|
keyof() {
|
|
1884
|
-
return
|
|
1884
|
+
return On(N.objectKeys(this.shape));
|
|
1885
1885
|
}
|
|
1886
1886
|
}
|
|
1887
1887
|
I.create = (n, e) => new I({
|
|
@@ -1905,7 +1905,7 @@ I.lazycreate = (n, e) => new I({
|
|
|
1905
1905
|
typeName: w.ZodObject,
|
|
1906
1906
|
...T(e)
|
|
1907
1907
|
});
|
|
1908
|
-
class
|
|
1908
|
+
class ot extends S {
|
|
1909
1909
|
_parse(e) {
|
|
1910
1910
|
const { ctx: t } = this._processInputParams(e), s = this._def.options;
|
|
1911
1911
|
function r(a) {
|
|
@@ -1973,12 +1973,12 @@ class it extends S {
|
|
|
1973
1973
|
return this._def.options;
|
|
1974
1974
|
}
|
|
1975
1975
|
}
|
|
1976
|
-
|
|
1976
|
+
ot.create = (n, e) => new ot({
|
|
1977
1977
|
options: n,
|
|
1978
1978
|
typeName: w.ZodUnion,
|
|
1979
1979
|
...T(e)
|
|
1980
1980
|
});
|
|
1981
|
-
const le = (n) => n instanceof
|
|
1981
|
+
const le = (n) => n instanceof ut ? le(n.schema) : n instanceof q ? le(n.innerType()) : n instanceof lt ? [n.value] : n instanceof _e ? n.options : n instanceof pt ? N.objectValues(n.enum) : n instanceof ht ? le(n._def.innerType) : n instanceof at ? [void 0] : n instanceof it ? [null] : n instanceof Y ? [void 0, ...le(n.unwrap())] : n instanceof ge ? [null, ...le(n.unwrap())] : n instanceof cn || n instanceof mt ? le(n.unwrap()) : n instanceof ft ? le(n._def.innerType) : [];
|
|
1982
1982
|
class Jt extends S {
|
|
1983
1983
|
_parse(e) {
|
|
1984
1984
|
const { ctx: t } = this._processInputParams(e);
|
|
@@ -2067,7 +2067,7 @@ function nn(n, e) {
|
|
|
2067
2067
|
return { valid: !0, data: r };
|
|
2068
2068
|
} else return t === _.date && s === _.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
|
|
2069
2069
|
}
|
|
2070
|
-
class
|
|
2070
|
+
class ct extends S {
|
|
2071
2071
|
_parse(e) {
|
|
2072
2072
|
const { status: t, ctx: s } = this._processInputParams(e), r = (a, o) => {
|
|
2073
2073
|
if (en(a) || en(o))
|
|
@@ -2099,7 +2099,7 @@ class ot extends S {
|
|
|
2099
2099
|
}));
|
|
2100
2100
|
}
|
|
2101
2101
|
}
|
|
2102
|
-
|
|
2102
|
+
ct.create = (n, e, t) => new ct({
|
|
2103
2103
|
left: n,
|
|
2104
2104
|
right: e,
|
|
2105
2105
|
typeName: w.ZodIntersection,
|
|
@@ -2155,7 +2155,7 @@ ee.create = (n, e) => {
|
|
|
2155
2155
|
...T(e)
|
|
2156
2156
|
});
|
|
2157
2157
|
};
|
|
2158
|
-
class
|
|
2158
|
+
class dt extends S {
|
|
2159
2159
|
get keySchema() {
|
|
2160
2160
|
return this._def.keyType;
|
|
2161
2161
|
}
|
|
@@ -2183,12 +2183,12 @@ class ct extends S {
|
|
|
2183
2183
|
return this._def.valueType;
|
|
2184
2184
|
}
|
|
2185
2185
|
static create(e, t, s) {
|
|
2186
|
-
return t instanceof S ? new
|
|
2186
|
+
return t instanceof S ? new dt({
|
|
2187
2187
|
keyType: e,
|
|
2188
2188
|
valueType: t,
|
|
2189
2189
|
typeName: w.ZodRecord,
|
|
2190
2190
|
...T(s)
|
|
2191
|
-
}) : new
|
|
2191
|
+
}) : new dt({
|
|
2192
2192
|
keyType: F.create(),
|
|
2193
2193
|
valueType: e,
|
|
2194
2194
|
typeName: w.ZodRecord,
|
|
@@ -2308,7 +2308,7 @@ Ne.create = (n, e) => new Ne({
|
|
|
2308
2308
|
typeName: w.ZodSet,
|
|
2309
2309
|
...T(e)
|
|
2310
2310
|
});
|
|
2311
|
-
class
|
|
2311
|
+
class Fe extends S {
|
|
2312
2312
|
constructor() {
|
|
2313
2313
|
super(...arguments), this.validate = this.implement;
|
|
2314
2314
|
}
|
|
@@ -2328,7 +2328,7 @@ class Ue extends S {
|
|
|
2328
2328
|
t.common.contextualErrorMap,
|
|
2329
2329
|
t.schemaErrorMap,
|
|
2330
2330
|
Et(),
|
|
2331
|
-
|
|
2331
|
+
Be
|
|
2332
2332
|
].filter((u) => !!u),
|
|
2333
2333
|
issueData: {
|
|
2334
2334
|
code: p.invalid_arguments,
|
|
@@ -2344,7 +2344,7 @@ class Ue extends S {
|
|
|
2344
2344
|
t.common.contextualErrorMap,
|
|
2345
2345
|
t.schemaErrorMap,
|
|
2346
2346
|
Et(),
|
|
2347
|
-
|
|
2347
|
+
Be
|
|
2348
2348
|
].filter((u) => !!u),
|
|
2349
2349
|
issueData: {
|
|
2350
2350
|
code: p.invalid_return_type,
|
|
@@ -2353,7 +2353,7 @@ class Ue extends S {
|
|
|
2353
2353
|
});
|
|
2354
2354
|
}
|
|
2355
2355
|
const a = { errorMap: t.common.contextualErrorMap }, o = t.data;
|
|
2356
|
-
if (this._def.returns instanceof
|
|
2356
|
+
if (this._def.returns instanceof qe) {
|
|
2357
2357
|
const c = this;
|
|
2358
2358
|
return D(async function(...d) {
|
|
2359
2359
|
const u = new L([]), l = await c._def.args.parseAsync(d, a).catch((A) => {
|
|
@@ -2383,13 +2383,13 @@ class Ue extends S {
|
|
|
2383
2383
|
return this._def.returns;
|
|
2384
2384
|
}
|
|
2385
2385
|
args(...e) {
|
|
2386
|
-
return new
|
|
2386
|
+
return new Fe({
|
|
2387
2387
|
...this._def,
|
|
2388
2388
|
args: ee.create(e).rest(Se.create())
|
|
2389
2389
|
});
|
|
2390
2390
|
}
|
|
2391
2391
|
returns(e) {
|
|
2392
|
-
return new
|
|
2392
|
+
return new Fe({
|
|
2393
2393
|
...this._def,
|
|
2394
2394
|
returns: e
|
|
2395
2395
|
});
|
|
@@ -2401,7 +2401,7 @@ class Ue extends S {
|
|
|
2401
2401
|
return this.parse(e);
|
|
2402
2402
|
}
|
|
2403
2403
|
static create(e, t, s) {
|
|
2404
|
-
return new
|
|
2404
|
+
return new Fe({
|
|
2405
2405
|
args: e || ee.create([]).rest(Se.create()),
|
|
2406
2406
|
returns: t || Se.create(),
|
|
2407
2407
|
typeName: w.ZodFunction,
|
|
@@ -2409,7 +2409,7 @@ class Ue extends S {
|
|
|
2409
2409
|
});
|
|
2410
2410
|
}
|
|
2411
2411
|
}
|
|
2412
|
-
class
|
|
2412
|
+
class ut extends S {
|
|
2413
2413
|
get schema() {
|
|
2414
2414
|
return this._def.getter();
|
|
2415
2415
|
}
|
|
@@ -2418,12 +2418,12 @@ class dt extends S {
|
|
|
2418
2418
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
2419
2419
|
}
|
|
2420
2420
|
}
|
|
2421
|
-
|
|
2421
|
+
ut.create = (n, e) => new ut({
|
|
2422
2422
|
getter: n,
|
|
2423
2423
|
typeName: w.ZodLazy,
|
|
2424
2424
|
...T(e)
|
|
2425
2425
|
});
|
|
2426
|
-
class
|
|
2426
|
+
class lt extends S {
|
|
2427
2427
|
_parse(e) {
|
|
2428
2428
|
if (e.data !== this._def.value) {
|
|
2429
2429
|
const t = this._getOrReturnCtx(e);
|
|
@@ -2439,12 +2439,12 @@ class ut extends S {
|
|
|
2439
2439
|
return this._def.value;
|
|
2440
2440
|
}
|
|
2441
2441
|
}
|
|
2442
|
-
|
|
2442
|
+
lt.create = (n, e) => new lt({
|
|
2443
2443
|
value: n,
|
|
2444
2444
|
typeName: w.ZodLiteral,
|
|
2445
2445
|
...T(e)
|
|
2446
2446
|
});
|
|
2447
|
-
function
|
|
2447
|
+
function On(n, e) {
|
|
2448
2448
|
return new _e({
|
|
2449
2449
|
values: n,
|
|
2450
2450
|
typeName: w.ZodEnum,
|
|
@@ -2453,7 +2453,7 @@ function Tn(n, e) {
|
|
|
2453
2453
|
}
|
|
2454
2454
|
class _e extends S {
|
|
2455
2455
|
constructor() {
|
|
2456
|
-
super(...arguments),
|
|
2456
|
+
super(...arguments), Ge.set(this, void 0);
|
|
2457
2457
|
}
|
|
2458
2458
|
_parse(e) {
|
|
2459
2459
|
if (typeof e.data != "string") {
|
|
@@ -2464,7 +2464,7 @@ class _e extends S {
|
|
|
2464
2464
|
code: p.invalid_type
|
|
2465
2465
|
}), x;
|
|
2466
2466
|
}
|
|
2467
|
-
if ($t(this,
|
|
2467
|
+
if ($t(this, Ge) || bn(this, Ge, new Set(this._def.values)), !$t(this, Ge).has(e.data)) {
|
|
2468
2468
|
const t = this._getOrReturnCtx(e), s = this._def.values;
|
|
2469
2469
|
return f(t, {
|
|
2470
2470
|
received: t.data,
|
|
@@ -2508,11 +2508,11 @@ class _e extends S {
|
|
|
2508
2508
|
});
|
|
2509
2509
|
}
|
|
2510
2510
|
}
|
|
2511
|
-
|
|
2512
|
-
_e.create =
|
|
2513
|
-
class
|
|
2511
|
+
Ge = /* @__PURE__ */ new WeakMap();
|
|
2512
|
+
_e.create = On;
|
|
2513
|
+
class pt extends S {
|
|
2514
2514
|
constructor() {
|
|
2515
|
-
super(...arguments),
|
|
2515
|
+
super(...arguments), Xe.set(this, void 0);
|
|
2516
2516
|
}
|
|
2517
2517
|
_parse(e) {
|
|
2518
2518
|
const t = N.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
|
|
@@ -2524,7 +2524,7 @@ class lt extends S {
|
|
|
2524
2524
|
code: p.invalid_type
|
|
2525
2525
|
}), x;
|
|
2526
2526
|
}
|
|
2527
|
-
if ($t(this,
|
|
2527
|
+
if ($t(this, Xe) || bn(this, Xe, new Set(N.getValidEnumValues(this._def.values))), !$t(this, Xe).has(e.data)) {
|
|
2528
2528
|
const r = N.objectValues(t);
|
|
2529
2529
|
return f(s, {
|
|
2530
2530
|
received: s.data,
|
|
@@ -2538,13 +2538,13 @@ class lt extends S {
|
|
|
2538
2538
|
return this._def.values;
|
|
2539
2539
|
}
|
|
2540
2540
|
}
|
|
2541
|
-
|
|
2542
|
-
|
|
2541
|
+
Xe = /* @__PURE__ */ new WeakMap();
|
|
2542
|
+
pt.create = (n, e) => new pt({
|
|
2543
2543
|
values: n,
|
|
2544
2544
|
typeName: w.ZodNativeEnum,
|
|
2545
2545
|
...T(e)
|
|
2546
2546
|
});
|
|
2547
|
-
class
|
|
2547
|
+
class qe extends S {
|
|
2548
2548
|
unwrap() {
|
|
2549
2549
|
return this._def.type;
|
|
2550
2550
|
}
|
|
@@ -2563,7 +2563,7 @@ class We extends S {
|
|
|
2563
2563
|
})));
|
|
2564
2564
|
}
|
|
2565
2565
|
}
|
|
2566
|
-
|
|
2566
|
+
qe.create = (n, e) => new qe({
|
|
2567
2567
|
type: n,
|
|
2568
2568
|
typeName: w.ZodPromise,
|
|
2569
2569
|
...T(e)
|
|
@@ -2634,14 +2634,14 @@ class q extends S {
|
|
|
2634
2634
|
path: s.path,
|
|
2635
2635
|
parent: s
|
|
2636
2636
|
});
|
|
2637
|
-
if (!
|
|
2637
|
+
if (!nt(o))
|
|
2638
2638
|
return o;
|
|
2639
2639
|
const c = r.transform(o.value, a);
|
|
2640
2640
|
if (c instanceof Promise)
|
|
2641
2641
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2642
2642
|
return { status: t.value, value: c };
|
|
2643
2643
|
} else
|
|
2644
|
-
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) =>
|
|
2644
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => nt(o) ? Promise.resolve(r.transform(o.value, a)).then((c) => ({ status: t.value, value: c })) : o);
|
|
2645
2645
|
N.assertNever(r);
|
|
2646
2646
|
}
|
|
2647
2647
|
}
|
|
@@ -2683,7 +2683,7 @@ ge.create = (n, e) => new ge({
|
|
|
2683
2683
|
typeName: w.ZodNullable,
|
|
2684
2684
|
...T(e)
|
|
2685
2685
|
});
|
|
2686
|
-
class
|
|
2686
|
+
class ht extends S {
|
|
2687
2687
|
_parse(e) {
|
|
2688
2688
|
const { ctx: t } = this._processInputParams(e);
|
|
2689
2689
|
let s = t.data;
|
|
@@ -2697,13 +2697,13 @@ class pt extends S {
|
|
|
2697
2697
|
return this._def.innerType;
|
|
2698
2698
|
}
|
|
2699
2699
|
}
|
|
2700
|
-
|
|
2700
|
+
ht.create = (n, e) => new ht({
|
|
2701
2701
|
innerType: n,
|
|
2702
2702
|
typeName: w.ZodDefault,
|
|
2703
2703
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2704
2704
|
...T(e)
|
|
2705
2705
|
});
|
|
2706
|
-
class
|
|
2706
|
+
class ft extends S {
|
|
2707
2707
|
_parse(e) {
|
|
2708
2708
|
const { ctx: t } = this._processInputParams(e), s = {
|
|
2709
2709
|
...t,
|
|
@@ -2718,7 +2718,7 @@ class ht extends S {
|
|
|
2718
2718
|
...s
|
|
2719
2719
|
}
|
|
2720
2720
|
});
|
|
2721
|
-
return
|
|
2721
|
+
return st(r) ? r.then((a) => ({
|
|
2722
2722
|
status: "valid",
|
|
2723
2723
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
2724
2724
|
get error() {
|
|
@@ -2740,7 +2740,7 @@ class ht extends S {
|
|
|
2740
2740
|
return this._def.innerType;
|
|
2741
2741
|
}
|
|
2742
2742
|
}
|
|
2743
|
-
|
|
2743
|
+
ft.create = (n, e) => new ft({
|
|
2744
2744
|
innerType: n,
|
|
2745
2745
|
typeName: w.ZodCatch,
|
|
2746
2746
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
@@ -2763,7 +2763,7 @@ Lt.create = (n) => new Lt({
|
|
|
2763
2763
|
typeName: w.ZodNaN,
|
|
2764
2764
|
...T(n)
|
|
2765
2765
|
});
|
|
2766
|
-
const
|
|
2766
|
+
const ys = Symbol("zod_brand");
|
|
2767
2767
|
class cn extends S {
|
|
2768
2768
|
_parse(e) {
|
|
2769
2769
|
const { ctx: t } = this._processInputParams(e), s = t.data;
|
|
@@ -2777,7 +2777,7 @@ class cn extends S {
|
|
|
2777
2777
|
return this._def.type;
|
|
2778
2778
|
}
|
|
2779
2779
|
}
|
|
2780
|
-
class
|
|
2780
|
+
class Ct extends S {
|
|
2781
2781
|
_parse(e) {
|
|
2782
2782
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
2783
2783
|
if (s.common.async)
|
|
@@ -2810,62 +2810,62 @@ class Nt extends S {
|
|
|
2810
2810
|
}
|
|
2811
2811
|
}
|
|
2812
2812
|
static create(e, t) {
|
|
2813
|
-
return new
|
|
2813
|
+
return new Ct({
|
|
2814
2814
|
in: e,
|
|
2815
2815
|
out: t,
|
|
2816
2816
|
typeName: w.ZodPipeline
|
|
2817
2817
|
});
|
|
2818
2818
|
}
|
|
2819
2819
|
}
|
|
2820
|
-
class
|
|
2820
|
+
class mt extends S {
|
|
2821
2821
|
_parse(e) {
|
|
2822
|
-
const t = this._def.innerType._parse(e), s = (r) => (
|
|
2823
|
-
return
|
|
2822
|
+
const t = this._def.innerType._parse(e), s = (r) => (nt(r) && (r.value = Object.freeze(r.value)), r);
|
|
2823
|
+
return st(t) ? t.then((r) => s(r)) : s(t);
|
|
2824
2824
|
}
|
|
2825
2825
|
unwrap() {
|
|
2826
2826
|
return this._def.innerType;
|
|
2827
2827
|
}
|
|
2828
2828
|
}
|
|
2829
|
-
|
|
2829
|
+
mt.create = (n, e) => new mt({
|
|
2830
2830
|
innerType: n,
|
|
2831
2831
|
typeName: w.ZodReadonly,
|
|
2832
2832
|
...T(e)
|
|
2833
2833
|
});
|
|
2834
|
-
function
|
|
2835
|
-
return n ?
|
|
2834
|
+
function Sn(n, e = {}, t) {
|
|
2835
|
+
return n ? We.create().superRefine((s, r) => {
|
|
2836
2836
|
var a, o;
|
|
2837
2837
|
if (!n(s)) {
|
|
2838
2838
|
const c = typeof e == "function" ? e(s) : typeof e == "string" ? { message: e } : e, d = (o = (a = c.fatal) !== null && a !== void 0 ? a : t) !== null && o !== void 0 ? o : !0, u = typeof c == "string" ? { message: c } : c;
|
|
2839
2839
|
r.addIssue({ code: "custom", ...u, fatal: d });
|
|
2840
2840
|
}
|
|
2841
|
-
}) :
|
|
2841
|
+
}) : We.create();
|
|
2842
2842
|
}
|
|
2843
|
-
const
|
|
2843
|
+
const vs = {
|
|
2844
2844
|
object: I.lazycreate
|
|
2845
2845
|
};
|
|
2846
2846
|
var w;
|
|
2847
2847
|
(function(n) {
|
|
2848
2848
|
n.ZodString = "ZodString", n.ZodNumber = "ZodNumber", n.ZodNaN = "ZodNaN", n.ZodBigInt = "ZodBigInt", n.ZodBoolean = "ZodBoolean", n.ZodDate = "ZodDate", n.ZodSymbol = "ZodSymbol", n.ZodUndefined = "ZodUndefined", n.ZodNull = "ZodNull", n.ZodAny = "ZodAny", n.ZodUnknown = "ZodUnknown", n.ZodNever = "ZodNever", n.ZodVoid = "ZodVoid", n.ZodArray = "ZodArray", n.ZodObject = "ZodObject", n.ZodUnion = "ZodUnion", n.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", n.ZodIntersection = "ZodIntersection", n.ZodTuple = "ZodTuple", n.ZodRecord = "ZodRecord", n.ZodMap = "ZodMap", n.ZodSet = "ZodSet", n.ZodFunction = "ZodFunction", n.ZodLazy = "ZodLazy", n.ZodLiteral = "ZodLiteral", n.ZodEnum = "ZodEnum", n.ZodEffects = "ZodEffects", n.ZodNativeEnum = "ZodNativeEnum", n.ZodOptional = "ZodOptional", n.ZodNullable = "ZodNullable", n.ZodDefault = "ZodDefault", n.ZodCatch = "ZodCatch", n.ZodPromise = "ZodPromise", n.ZodBranded = "ZodBranded", n.ZodPipeline = "ZodPipeline", n.ZodReadonly = "ZodReadonly";
|
|
2849
2849
|
})(w || (w = {}));
|
|
2850
|
-
const
|
|
2850
|
+
const ws = (n, e = {
|
|
2851
2851
|
message: `Input not instance of ${n.name}`
|
|
2852
|
-
}) =>
|
|
2852
|
+
}) => Sn((t) => t instanceof n, e), Zn = F.create, jn = fe.create, bs = Lt.create, ks = me.create, Nn = rt.create, xs = je.create, Ts = Pt.create, Os = at.create, Ss = it.create, Zs = We.create, js = Se.create, Ns = re.create, Cs = Dt.create, Is = B.create, Es = I.create, As = I.strictCreate, Rs = ot.create, $s = Jt.create, Ps = ct.create, Ds = ee.create, Ms = dt.create, Ls = Mt.create, Vs = Ne.create, Us = Fe.create, Fs = ut.create, zs = lt.create, Bs = _e.create, Ws = pt.create, qs = qe.create, mn = q.create, Js = Y.create, Ks = ge.create, Hs = q.createWithPreprocess, Qs = Ct.create, Ys = () => Zn().optional(), Gs = () => jn().optional(), Xs = () => Nn().optional(), er = {
|
|
2853
2853
|
string: (n) => F.create({ ...n, coerce: !0 }),
|
|
2854
2854
|
number: (n) => fe.create({ ...n, coerce: !0 }),
|
|
2855
|
-
boolean: (n) =>
|
|
2855
|
+
boolean: (n) => rt.create({
|
|
2856
2856
|
...n,
|
|
2857
2857
|
coerce: !0
|
|
2858
2858
|
}),
|
|
2859
2859
|
bigint: (n) => me.create({ ...n, coerce: !0 }),
|
|
2860
2860
|
date: (n) => je.create({ ...n, coerce: !0 })
|
|
2861
|
-
},
|
|
2861
|
+
}, tr = x;
|
|
2862
2862
|
var i = /* @__PURE__ */ Object.freeze({
|
|
2863
2863
|
__proto__: null,
|
|
2864
|
-
defaultErrorMap:
|
|
2865
|
-
setErrorMap:
|
|
2864
|
+
defaultErrorMap: Be,
|
|
2865
|
+
setErrorMap: ts,
|
|
2866
2866
|
getErrorMap: Et,
|
|
2867
2867
|
makeIssue: At,
|
|
2868
|
-
EMPTY_PATH:
|
|
2868
|
+
EMPTY_PATH: ns,
|
|
2869
2869
|
addIssueToContext: f,
|
|
2870
2870
|
ParseStatus: $,
|
|
2871
2871
|
INVALID: x,
|
|
@@ -2873,8 +2873,8 @@ var i = /* @__PURE__ */ Object.freeze({
|
|
|
2873
2873
|
OK: D,
|
|
2874
2874
|
isAborted: en,
|
|
2875
2875
|
isDirty: tn,
|
|
2876
|
-
isValid:
|
|
2877
|
-
isAsync:
|
|
2876
|
+
isValid: nt,
|
|
2877
|
+
isAsync: st,
|
|
2878
2878
|
get util() {
|
|
2879
2879
|
return N;
|
|
2880
2880
|
},
|
|
@@ -2884,98 +2884,98 @@ var i = /* @__PURE__ */ Object.freeze({
|
|
|
2884
2884
|
ZodParsedType: _,
|
|
2885
2885
|
getParsedType: pe,
|
|
2886
2886
|
ZodType: S,
|
|
2887
|
-
datetimeRegex:
|
|
2887
|
+
datetimeRegex: Tn,
|
|
2888
2888
|
ZodString: F,
|
|
2889
2889
|
ZodNumber: fe,
|
|
2890
2890
|
ZodBigInt: me,
|
|
2891
|
-
ZodBoolean:
|
|
2891
|
+
ZodBoolean: rt,
|
|
2892
2892
|
ZodDate: je,
|
|
2893
2893
|
ZodSymbol: Pt,
|
|
2894
|
-
ZodUndefined:
|
|
2895
|
-
ZodNull:
|
|
2896
|
-
ZodAny:
|
|
2894
|
+
ZodUndefined: at,
|
|
2895
|
+
ZodNull: it,
|
|
2896
|
+
ZodAny: We,
|
|
2897
2897
|
ZodUnknown: Se,
|
|
2898
2898
|
ZodNever: re,
|
|
2899
2899
|
ZodVoid: Dt,
|
|
2900
2900
|
ZodArray: B,
|
|
2901
2901
|
ZodObject: I,
|
|
2902
|
-
ZodUnion:
|
|
2902
|
+
ZodUnion: ot,
|
|
2903
2903
|
ZodDiscriminatedUnion: Jt,
|
|
2904
|
-
ZodIntersection:
|
|
2904
|
+
ZodIntersection: ct,
|
|
2905
2905
|
ZodTuple: ee,
|
|
2906
|
-
ZodRecord:
|
|
2906
|
+
ZodRecord: dt,
|
|
2907
2907
|
ZodMap: Mt,
|
|
2908
2908
|
ZodSet: Ne,
|
|
2909
|
-
ZodFunction:
|
|
2910
|
-
ZodLazy:
|
|
2911
|
-
ZodLiteral:
|
|
2909
|
+
ZodFunction: Fe,
|
|
2910
|
+
ZodLazy: ut,
|
|
2911
|
+
ZodLiteral: lt,
|
|
2912
2912
|
ZodEnum: _e,
|
|
2913
|
-
ZodNativeEnum:
|
|
2914
|
-
ZodPromise:
|
|
2913
|
+
ZodNativeEnum: pt,
|
|
2914
|
+
ZodPromise: qe,
|
|
2915
2915
|
ZodEffects: q,
|
|
2916
2916
|
ZodTransformer: q,
|
|
2917
2917
|
ZodOptional: Y,
|
|
2918
2918
|
ZodNullable: ge,
|
|
2919
|
-
ZodDefault:
|
|
2920
|
-
ZodCatch:
|
|
2919
|
+
ZodDefault: ht,
|
|
2920
|
+
ZodCatch: ft,
|
|
2921
2921
|
ZodNaN: Lt,
|
|
2922
|
-
BRAND:
|
|
2922
|
+
BRAND: ys,
|
|
2923
2923
|
ZodBranded: cn,
|
|
2924
|
-
ZodPipeline:
|
|
2925
|
-
ZodReadonly:
|
|
2926
|
-
custom:
|
|
2924
|
+
ZodPipeline: Ct,
|
|
2925
|
+
ZodReadonly: mt,
|
|
2926
|
+
custom: Sn,
|
|
2927
2927
|
Schema: S,
|
|
2928
2928
|
ZodSchema: S,
|
|
2929
|
-
late:
|
|
2929
|
+
late: vs,
|
|
2930
2930
|
get ZodFirstPartyTypeKind() {
|
|
2931
2931
|
return w;
|
|
2932
2932
|
},
|
|
2933
|
-
coerce:
|
|
2934
|
-
any:
|
|
2935
|
-
array:
|
|
2933
|
+
coerce: er,
|
|
2934
|
+
any: Zs,
|
|
2935
|
+
array: Is,
|
|
2936
2936
|
bigint: ks,
|
|
2937
|
-
boolean:
|
|
2938
|
-
date:
|
|
2939
|
-
discriminatedUnion:
|
|
2940
|
-
effect:
|
|
2941
|
-
enum:
|
|
2942
|
-
function:
|
|
2943
|
-
instanceof:
|
|
2944
|
-
intersection:
|
|
2945
|
-
lazy:
|
|
2946
|
-
literal:
|
|
2947
|
-
map:
|
|
2948
|
-
nan:
|
|
2949
|
-
nativeEnum:
|
|
2950
|
-
never:
|
|
2951
|
-
null:
|
|
2952
|
-
nullable:
|
|
2953
|
-
number:
|
|
2954
|
-
object:
|
|
2955
|
-
oboolean:
|
|
2956
|
-
onumber:
|
|
2957
|
-
optional:
|
|
2958
|
-
ostring:
|
|
2937
|
+
boolean: Nn,
|
|
2938
|
+
date: xs,
|
|
2939
|
+
discriminatedUnion: $s,
|
|
2940
|
+
effect: mn,
|
|
2941
|
+
enum: Bs,
|
|
2942
|
+
function: Us,
|
|
2943
|
+
instanceof: ws,
|
|
2944
|
+
intersection: Ps,
|
|
2945
|
+
lazy: Fs,
|
|
2946
|
+
literal: zs,
|
|
2947
|
+
map: Ls,
|
|
2948
|
+
nan: bs,
|
|
2949
|
+
nativeEnum: Ws,
|
|
2950
|
+
never: Ns,
|
|
2951
|
+
null: Ss,
|
|
2952
|
+
nullable: Ks,
|
|
2953
|
+
number: jn,
|
|
2954
|
+
object: Es,
|
|
2955
|
+
oboolean: Xs,
|
|
2956
|
+
onumber: Gs,
|
|
2957
|
+
optional: Js,
|
|
2958
|
+
ostring: Ys,
|
|
2959
2959
|
pipeline: Qs,
|
|
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:
|
|
2960
|
+
preprocess: Hs,
|
|
2961
|
+
promise: qs,
|
|
2962
|
+
record: Ms,
|
|
2963
|
+
set: Vs,
|
|
2964
|
+
strictObject: As,
|
|
2965
|
+
string: Zn,
|
|
2966
|
+
symbol: Ts,
|
|
2967
|
+
transformer: mn,
|
|
2968
|
+
tuple: Ds,
|
|
2969
|
+
undefined: Os,
|
|
2970
|
+
union: Rs,
|
|
2971
|
+
unknown: js,
|
|
2972
|
+
void: Cs,
|
|
2973
|
+
NEVER: tr,
|
|
2974
2974
|
ZodIssueCode: p,
|
|
2975
|
-
quotelessJson:
|
|
2975
|
+
quotelessJson: es,
|
|
2976
2976
|
ZodError: L
|
|
2977
2977
|
});
|
|
2978
|
-
|
|
2978
|
+
Xn(i);
|
|
2979
2979
|
i.object({
|
|
2980
2980
|
start: i.number(),
|
|
2981
2981
|
limit: i.number(),
|
|
@@ -2984,7 +2984,7 @@ i.object({
|
|
|
2984
2984
|
const dn = i.object({
|
|
2985
2985
|
created_at: i.string(),
|
|
2986
2986
|
updated_at: i.string()
|
|
2987
|
-
}),
|
|
2987
|
+
}), nr = i.object({
|
|
2988
2988
|
email: i.string().optional(),
|
|
2989
2989
|
email_verified: i.boolean().optional(),
|
|
2990
2990
|
name: i.string().optional(),
|
|
@@ -2993,7 +2993,7 @@ const dn = i.object({
|
|
|
2993
2993
|
phone_number: i.string().optional(),
|
|
2994
2994
|
phone_verified: i.boolean().optional(),
|
|
2995
2995
|
family_name: i.string().optional()
|
|
2996
|
-
}).catchall(i.any()),
|
|
2996
|
+
}).catchall(i.any()), sr = i.object({
|
|
2997
2997
|
connection: i.string(),
|
|
2998
2998
|
user_id: i.string(),
|
|
2999
2999
|
provider: i.string(),
|
|
@@ -3001,8 +3001,8 @@ const dn = i.object({
|
|
|
3001
3001
|
access_token: i.string().optional(),
|
|
3002
3002
|
access_token_secret: i.string().optional(),
|
|
3003
3003
|
refresh_token: i.string().optional(),
|
|
3004
|
-
profileData:
|
|
3005
|
-
}),
|
|
3004
|
+
profileData: nr.optional()
|
|
3005
|
+
}), Cn = i.object({
|
|
3006
3006
|
email: i.string().optional(),
|
|
3007
3007
|
username: i.string().optional(),
|
|
3008
3008
|
given_name: i.string().optional(),
|
|
@@ -3014,7 +3014,7 @@ const dn = i.object({
|
|
|
3014
3014
|
linked_to: i.string().optional(),
|
|
3015
3015
|
profileData: i.string().optional(),
|
|
3016
3016
|
user_id: i.string().optional()
|
|
3017
|
-
}),
|
|
3017
|
+
}), rr = Cn.extend({
|
|
3018
3018
|
email_verified: i.boolean().default(!1),
|
|
3019
3019
|
verify_email: i.boolean().optional(),
|
|
3020
3020
|
last_ip: i.string().optional(),
|
|
@@ -3023,15 +3023,15 @@ const dn = i.object({
|
|
|
3023
3023
|
provider: i.string().default("email"),
|
|
3024
3024
|
connection: i.string().default("email")
|
|
3025
3025
|
});
|
|
3026
|
-
|
|
3026
|
+
rr.extend(dn.shape).extend({
|
|
3027
3027
|
user_id: i.string(),
|
|
3028
3028
|
// TODO: this not might be correct if you use the username
|
|
3029
3029
|
email: i.string(),
|
|
3030
3030
|
is_social: i.boolean(),
|
|
3031
3031
|
login_count: i.number(),
|
|
3032
|
-
identities: i.array(
|
|
3032
|
+
identities: i.array(sr).optional()
|
|
3033
3033
|
});
|
|
3034
|
-
|
|
3034
|
+
Cn.extend({
|
|
3035
3035
|
email: i.string(),
|
|
3036
3036
|
login_count: i.number(),
|
|
3037
3037
|
multifactor: i.array(i.string()).optional(),
|
|
@@ -3039,7 +3039,7 @@ Nn.extend({
|
|
|
3039
3039
|
last_login: i.string().optional(),
|
|
3040
3040
|
user_id: i.string()
|
|
3041
3041
|
}).catchall(i.any());
|
|
3042
|
-
const
|
|
3042
|
+
const ar = i.object({
|
|
3043
3043
|
audience: i.string().optional(),
|
|
3044
3044
|
recipient: i.string().optional(),
|
|
3045
3045
|
createUpnClaim: i.boolean().optional(),
|
|
@@ -3056,7 +3056,7 @@ const rr = i.object({
|
|
|
3056
3056
|
nameIdentifierProbes: i.array(i.string()).optional(),
|
|
3057
3057
|
authnContextClassRef: i.string().optional(),
|
|
3058
3058
|
mappings: i.record(i.string()).optional()
|
|
3059
|
-
}),
|
|
3059
|
+
}), ir = i.object({
|
|
3060
3060
|
id: i.string(),
|
|
3061
3061
|
name: i.string(),
|
|
3062
3062
|
callbacks: i.array(i.string()).openapi({
|
|
@@ -3071,8 +3071,11 @@ const rr = i.object({
|
|
|
3071
3071
|
allowed_logout_urls: i.array(i.string()).openapi({
|
|
3072
3072
|
description: "Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains."
|
|
3073
3073
|
}),
|
|
3074
|
+
allowed_clients: i.array(i.string()).openapi({
|
|
3075
|
+
description: "Ids of clients that will be allowed to perform delegation requests. Clients that will be allowed to make delegation request. By default, all your clients will be allowed. This field allows you to specify specific clients"
|
|
3076
|
+
}),
|
|
3074
3077
|
addons: i.object({
|
|
3075
|
-
samlp:
|
|
3078
|
+
samlp: ar.optional()
|
|
3076
3079
|
}).optional().openapi({
|
|
3077
3080
|
description: "Addons associated with the client. The key is the addon's package name and the value is an object with the configuration for the addon."
|
|
3078
3081
|
}),
|
|
@@ -3083,23 +3086,23 @@ const rr = i.object({
|
|
|
3083
3086
|
disable_sign_ups: i.boolean().default(!1).openapi({
|
|
3084
3087
|
description: "Prevents users from signing up using the hosted login page. This is not available in auth0"
|
|
3085
3088
|
})
|
|
3086
|
-
}),
|
|
3089
|
+
}), or = i.object({
|
|
3087
3090
|
created_at: i.string().transform((n) => n === null ? "" : n),
|
|
3088
3091
|
updated_at: i.string().transform((n) => n === null ? "" : n),
|
|
3089
|
-
...
|
|
3092
|
+
...ir.shape
|
|
3090
3093
|
});
|
|
3091
|
-
var
|
|
3092
|
-
const
|
|
3094
|
+
var In = /* @__PURE__ */ ((n) => (n.TOKEN = "token", n.TOKEN_ID_TOKEN = "token id_token", n.CODE = "code", n))(In || {}), En = /* @__PURE__ */ ((n) => (n.QUERY = "query", n.FRAGMENT = "fragment", n.FORM_POST = "form_post", n.WEB_MESSAGE = "web_message", n.SAML_POST = "saml_post", n))(En || {}), An = /* @__PURE__ */ ((n) => (n.S265 = "S256", n.plain = "plain", n))(An || {});
|
|
3095
|
+
const cr = i.object({
|
|
3093
3096
|
client_id: i.string(),
|
|
3094
3097
|
vendor_id: i.string().optional(),
|
|
3095
|
-
response_type: i.nativeEnum(
|
|
3096
|
-
response_mode: i.nativeEnum(
|
|
3098
|
+
response_type: i.nativeEnum(In).optional(),
|
|
3099
|
+
response_mode: i.nativeEnum(En).optional(),
|
|
3097
3100
|
redirect_uri: i.string().optional(),
|
|
3098
3101
|
audience: i.string().optional(),
|
|
3099
3102
|
state: i.string().optional(),
|
|
3100
3103
|
nonce: i.string().optional(),
|
|
3101
3104
|
scope: i.string().optional(),
|
|
3102
|
-
code_challenge_method: i.nativeEnum(
|
|
3105
|
+
code_challenge_method: i.nativeEnum(An).optional(),
|
|
3103
3106
|
code_challenge: i.string().optional(),
|
|
3104
3107
|
username: i.string().optional()
|
|
3105
3108
|
});
|
|
@@ -3119,14 +3122,26 @@ i.object({
|
|
|
3119
3122
|
url: i.string()
|
|
3120
3123
|
}).optional()
|
|
3121
3124
|
});
|
|
3122
|
-
const
|
|
3125
|
+
const dr = i.object({
|
|
3123
3126
|
id: i.string().optional(),
|
|
3124
3127
|
name: i.string(),
|
|
3125
|
-
|
|
3126
|
-
|
|
3128
|
+
strategy: i.enum(["google-oauth2", "facebook", "vipps", "apple", "email"]).optional(),
|
|
3129
|
+
options: i.object({
|
|
3130
|
+
kid: i.string().optional(),
|
|
3131
|
+
team_id: i.string().optional(),
|
|
3132
|
+
realms: i.string().optional(),
|
|
3133
|
+
client_id: i.string().optional(),
|
|
3134
|
+
client_secret: i.string().optional(),
|
|
3135
|
+
app_secret: i.string().optional(),
|
|
3136
|
+
scope: i.string().optional()
|
|
3137
|
+
}),
|
|
3138
|
+
enabled_clients: i.array(i.string()).optional(),
|
|
3127
3139
|
authorization_endpoint: i.string().optional(),
|
|
3128
3140
|
response_type: i.custom().optional(),
|
|
3129
3141
|
response_mode: i.custom().optional(),
|
|
3142
|
+
// Deprecated
|
|
3143
|
+
client_id: i.string().optional(),
|
|
3144
|
+
client_secret: i.string().optional(),
|
|
3130
3145
|
private_key: i.string().optional(),
|
|
3131
3146
|
kid: i.string().optional(),
|
|
3132
3147
|
team_id: i.string().optional(),
|
|
@@ -3134,11 +3149,11 @@ const cr = i.object({
|
|
|
3134
3149
|
token_exchange_basic_auth: i.boolean().optional(),
|
|
3135
3150
|
userinfo_endpoint: i.string().optional(),
|
|
3136
3151
|
scope: i.string().optional()
|
|
3137
|
-
}),
|
|
3152
|
+
}), Rn = i.object({
|
|
3138
3153
|
id: i.string(),
|
|
3139
3154
|
created_at: i.string().transform((n) => n === null ? "" : n),
|
|
3140
3155
|
updated_at: i.string().transform((n) => n === null ? "" : n)
|
|
3141
|
-
}).extend(
|
|
3156
|
+
}).extend(dr.shape), ur = i.object({
|
|
3142
3157
|
name: i.string(),
|
|
3143
3158
|
audience: i.string(),
|
|
3144
3159
|
sender_email: i.string().email(),
|
|
@@ -3148,11 +3163,11 @@ const cr = i.object({
|
|
|
3148
3163
|
primary_color: i.string().optional(),
|
|
3149
3164
|
secondary_color: i.string().optional(),
|
|
3150
3165
|
language: i.string().optional()
|
|
3151
|
-
}),
|
|
3166
|
+
}), lr = i.object({
|
|
3152
3167
|
created_at: i.string().transform((n) => n === null ? "" : n),
|
|
3153
3168
|
updated_at: i.string().transform((n) => n === null ? "" : n),
|
|
3154
3169
|
id: i.string(),
|
|
3155
|
-
...
|
|
3170
|
+
...ur.shape
|
|
3156
3171
|
});
|
|
3157
3172
|
i.object({
|
|
3158
3173
|
logoUrl: i.string(),
|
|
@@ -3172,7 +3187,7 @@ i.object({
|
|
|
3172
3187
|
siteUrl: i.string().nullable(),
|
|
3173
3188
|
manageSubscriptionsUrl: i.string().optional()
|
|
3174
3189
|
});
|
|
3175
|
-
const
|
|
3190
|
+
const pr = i.object({
|
|
3176
3191
|
domain: i.string(),
|
|
3177
3192
|
dkim_private_key: i.string().optional(),
|
|
3178
3193
|
dkim_public_key: i.string().optional(),
|
|
@@ -3180,19 +3195,19 @@ const lr = i.object({
|
|
|
3180
3195
|
email_service: i.union([i.literal("mailgun"), i.literal("mailchannels")]).optional()
|
|
3181
3196
|
});
|
|
3182
3197
|
i.object({
|
|
3183
|
-
...
|
|
3184
|
-
domains: i.array(
|
|
3185
|
-
tenant:
|
|
3186
|
-
connections: i.array(
|
|
3198
|
+
...or.shape,
|
|
3199
|
+
domains: i.array(pr),
|
|
3200
|
+
tenant: lr,
|
|
3201
|
+
connections: i.array(Rn)
|
|
3187
3202
|
});
|
|
3188
|
-
const
|
|
3203
|
+
const hr = i.enum([
|
|
3189
3204
|
"password_reset",
|
|
3190
3205
|
"email_verification",
|
|
3191
3206
|
"otp",
|
|
3192
3207
|
"authorization_code",
|
|
3193
3208
|
"oauth2_state",
|
|
3194
3209
|
"ticket"
|
|
3195
|
-
]),
|
|
3210
|
+
]), fr = i.object({
|
|
3196
3211
|
code_id: i.string().openapi({
|
|
3197
3212
|
description: "The code that will be used in for instance an email verification flow"
|
|
3198
3213
|
}),
|
|
@@ -3202,14 +3217,14 @@ const pr = i.enum([
|
|
|
3202
3217
|
connection_id: i.string().optional().openapi({
|
|
3203
3218
|
description: "The connection that the code is connected to"
|
|
3204
3219
|
}),
|
|
3205
|
-
code_type:
|
|
3220
|
+
code_type: hr,
|
|
3206
3221
|
expires_at: i.string(),
|
|
3207
3222
|
used_at: i.string().optional(),
|
|
3208
3223
|
user_id: i.string().optional()
|
|
3209
|
-
}), fr = i.object({
|
|
3210
|
-
...hr.shape,
|
|
3211
|
-
created_at: i.string()
|
|
3212
3224
|
}), mr = i.object({
|
|
3225
|
+
...fr.shape,
|
|
3226
|
+
created_at: i.string()
|
|
3227
|
+
}), _r = i.object({
|
|
3213
3228
|
domain: i.string(),
|
|
3214
3229
|
dkim_private_key: i.string().optional(),
|
|
3215
3230
|
dkim_public_key: i.string().optional(),
|
|
@@ -3217,10 +3232,10 @@ const pr = i.enum([
|
|
|
3217
3232
|
email_service: i.enum(["mailgun", "mailchannels"])
|
|
3218
3233
|
});
|
|
3219
3234
|
dn.extend({
|
|
3220
|
-
...
|
|
3235
|
+
..._r.shape,
|
|
3221
3236
|
id: i.string()
|
|
3222
3237
|
});
|
|
3223
|
-
const
|
|
3238
|
+
const gr = i.object({
|
|
3224
3239
|
trigger_id: i.enum([
|
|
3225
3240
|
"pre-user-signup",
|
|
3226
3241
|
"post-user-registration",
|
|
@@ -3232,20 +3247,32 @@ const _r = i.object({
|
|
|
3232
3247
|
synchronous: i.boolean().default(!1),
|
|
3233
3248
|
priority: i.number().optional()
|
|
3234
3249
|
});
|
|
3235
|
-
|
|
3250
|
+
gr.extend({
|
|
3236
3251
|
...dn.shape,
|
|
3237
3252
|
hook_id: i.string()
|
|
3238
3253
|
});
|
|
3239
|
-
const
|
|
3240
|
-
alg: i.
|
|
3254
|
+
const yr = i.object({
|
|
3255
|
+
alg: i.enum([
|
|
3256
|
+
"RS256",
|
|
3257
|
+
"RS384",
|
|
3258
|
+
"RS512",
|
|
3259
|
+
"ES256",
|
|
3260
|
+
"ES384",
|
|
3261
|
+
"ES512",
|
|
3262
|
+
"HS256",
|
|
3263
|
+
"HS384",
|
|
3264
|
+
"HS512"
|
|
3265
|
+
]),
|
|
3241
3266
|
e: i.string(),
|
|
3242
3267
|
kid: i.string(),
|
|
3243
|
-
kty: i.
|
|
3268
|
+
kty: i.enum(["RSA", "EC", "oct"]),
|
|
3244
3269
|
n: i.string(),
|
|
3245
|
-
|
|
3270
|
+
x5t: i.string().optional(),
|
|
3271
|
+
x5c: i.array(i.string()).optional(),
|
|
3272
|
+
use: i.enum(["sig", "enc"]).optional()
|
|
3246
3273
|
});
|
|
3247
3274
|
i.object({
|
|
3248
|
-
keys: i.array(
|
|
3275
|
+
keys: i.array(yr)
|
|
3249
3276
|
});
|
|
3250
3277
|
i.object({
|
|
3251
3278
|
issuer: i.string(),
|
|
@@ -3269,22 +3296,22 @@ i.object({
|
|
|
3269
3296
|
request_parameter_supported: i.boolean(),
|
|
3270
3297
|
token_endpoint_auth_signing_alg_values_supported: i.array(i.string())
|
|
3271
3298
|
});
|
|
3272
|
-
const
|
|
3299
|
+
const vr = i.object({
|
|
3273
3300
|
auth0Client: i.string().optional(),
|
|
3274
|
-
authParams:
|
|
3301
|
+
authParams: cr,
|
|
3275
3302
|
expires_at: i.string(),
|
|
3276
3303
|
deleted_at: i.string().optional(),
|
|
3277
3304
|
ip: i.string().optional()
|
|
3278
3305
|
}).openapi({
|
|
3279
3306
|
description: "This represents a login sesion"
|
|
3280
|
-
}),
|
|
3281
|
-
...
|
|
3307
|
+
}), wr = i.object({
|
|
3308
|
+
...vr.shape,
|
|
3282
3309
|
login_id: i.string().openapi({
|
|
3283
3310
|
description: "This is is used as the state in the universal login"
|
|
3284
3311
|
}),
|
|
3285
3312
|
created_at: i.string(),
|
|
3286
3313
|
updated_at: i.string()
|
|
3287
|
-
}),
|
|
3314
|
+
}), br = i.enum([
|
|
3288
3315
|
"cls",
|
|
3289
3316
|
// CODE_LINK_SENT
|
|
3290
3317
|
"fsa",
|
|
@@ -3341,7 +3368,7 @@ const yr = i.object({
|
|
|
3341
3368
|
}).optional()
|
|
3342
3369
|
});
|
|
3343
3370
|
i.object({
|
|
3344
|
-
type:
|
|
3371
|
+
type: br,
|
|
3345
3372
|
date: i.string(),
|
|
3346
3373
|
description: i.string().optional(),
|
|
3347
3374
|
log_id: i.string().optional(),
|
|
@@ -3364,17 +3391,17 @@ i.object({
|
|
|
3364
3391
|
hostname: i.string().optional(),
|
|
3365
3392
|
auth0_client: kr.optional()
|
|
3366
3393
|
});
|
|
3367
|
-
const
|
|
3394
|
+
const xr = i.object({
|
|
3368
3395
|
user_id: i.string(),
|
|
3369
3396
|
password: i.string(),
|
|
3370
3397
|
algorithm: i.enum(["bcrypt", "argon2id"]).default("argon2id")
|
|
3371
3398
|
});
|
|
3372
3399
|
i.object({
|
|
3373
|
-
...
|
|
3400
|
+
...xr.shape,
|
|
3374
3401
|
created_at: i.string(),
|
|
3375
3402
|
updated_at: i.string()
|
|
3376
3403
|
});
|
|
3377
|
-
const
|
|
3404
|
+
const Tr = i.object({
|
|
3378
3405
|
session_id: i.string(),
|
|
3379
3406
|
client_id: i.string(),
|
|
3380
3407
|
expires_at: i.string(),
|
|
@@ -3384,7 +3411,7 @@ const xr = i.object({
|
|
|
3384
3411
|
});
|
|
3385
3412
|
i.object({
|
|
3386
3413
|
created_at: i.string(),
|
|
3387
|
-
...
|
|
3414
|
+
...Tr.shape
|
|
3388
3415
|
});
|
|
3389
3416
|
i.object({
|
|
3390
3417
|
kid: i.string().openapi({ description: "The key id of the signing key" }),
|
|
@@ -3406,8 +3433,8 @@ i.object({
|
|
|
3406
3433
|
revoked: i.boolean().optional().openapi({ description: "True if the key is revoked" }),
|
|
3407
3434
|
revoked_at: i.string().optional().openapi({ description: "The date and time when the key was revoked" })
|
|
3408
3435
|
});
|
|
3409
|
-
var
|
|
3410
|
-
const un = i.nativeEnum(
|
|
3436
|
+
var $n = /* @__PURE__ */ ((n) => (n.RefreshToken = "refresh_token", n.AuthorizationCode = "authorization_code", n.ClientCredential = "client_credentials", n.Passwordless = "passwordless", n.Password = "password", n))($n || {});
|
|
3437
|
+
const un = i.nativeEnum($n);
|
|
3411
3438
|
i.object({
|
|
3412
3439
|
grant_type: un.refine(
|
|
3413
3440
|
(n) => n === "authorization_code"
|
|
@@ -3450,7 +3477,7 @@ i.object({
|
|
|
3450
3477
|
code: i.string(),
|
|
3451
3478
|
state: i.string().optional()
|
|
3452
3479
|
});
|
|
3453
|
-
const
|
|
3480
|
+
const Or = i.object({
|
|
3454
3481
|
button_border_radius: i.number(),
|
|
3455
3482
|
button_border_weight: i.number(),
|
|
3456
3483
|
buttons_style: i.enum(["pill"]),
|
|
@@ -3460,7 +3487,7 @@ const Tr = i.object({
|
|
|
3460
3487
|
show_widget_shadow: i.boolean(),
|
|
3461
3488
|
widget_border_weight: i.number(),
|
|
3462
3489
|
widget_corner_radius: i.number()
|
|
3463
|
-
}),
|
|
3490
|
+
}), Sr = i.object({
|
|
3464
3491
|
base_focus_color: i.string(),
|
|
3465
3492
|
base_hover_color: i.string(),
|
|
3466
3493
|
body_text: i.string(),
|
|
@@ -3480,47 +3507,53 @@ const Tr = i.object({
|
|
|
3480
3507
|
success: i.string(),
|
|
3481
3508
|
widget_background: i.string(),
|
|
3482
3509
|
widget_border: i.string()
|
|
3483
|
-
}),
|
|
3510
|
+
}), Me = i.object({
|
|
3484
3511
|
bold: i.boolean(),
|
|
3485
3512
|
size: i.number()
|
|
3486
|
-
}),
|
|
3487
|
-
body_text:
|
|
3488
|
-
buttons_text:
|
|
3513
|
+
}), Zr = i.object({
|
|
3514
|
+
body_text: Me,
|
|
3515
|
+
buttons_text: Me,
|
|
3489
3516
|
font_url: i.string(),
|
|
3490
|
-
input_labels:
|
|
3491
|
-
links:
|
|
3517
|
+
input_labels: Me,
|
|
3518
|
+
links: Me,
|
|
3492
3519
|
links_style: i.enum(["normal"]),
|
|
3493
3520
|
reference_text_size: i.number(),
|
|
3494
|
-
subtitle:
|
|
3495
|
-
title:
|
|
3496
|
-
}),
|
|
3521
|
+
subtitle: Me,
|
|
3522
|
+
title: Me
|
|
3523
|
+
}), jr = i.object({
|
|
3497
3524
|
background_color: i.string(),
|
|
3498
3525
|
background_image_url: i.string(),
|
|
3499
3526
|
page_layout: i.enum(["center"])
|
|
3500
|
-
}),
|
|
3527
|
+
}), Nr = i.object({
|
|
3501
3528
|
header_text_alignment: i.enum(["center"]),
|
|
3502
3529
|
logo_height: i.number(),
|
|
3503
3530
|
logo_position: i.enum(["center"]),
|
|
3504
3531
|
logo_url: i.string(),
|
|
3505
3532
|
social_buttons_layout: i.enum(["bottom"])
|
|
3506
|
-
}),
|
|
3507
|
-
borders:
|
|
3508
|
-
colors:
|
|
3533
|
+
}), Cr = i.object({
|
|
3534
|
+
borders: Or,
|
|
3535
|
+
colors: Sr,
|
|
3509
3536
|
displayName: i.string(),
|
|
3510
|
-
fonts:
|
|
3511
|
-
page_background:
|
|
3512
|
-
widget:
|
|
3537
|
+
fonts: Zr,
|
|
3538
|
+
page_background: jr,
|
|
3539
|
+
widget: Nr
|
|
3513
3540
|
});
|
|
3514
|
-
|
|
3541
|
+
Cr.extend({
|
|
3515
3542
|
themeId: i.string()
|
|
3516
3543
|
});
|
|
3544
|
+
i.object({
|
|
3545
|
+
universal_login_experience: i.enum(["new", "classic"]).default("new"),
|
|
3546
|
+
identifier_first: i.boolean().default(!0),
|
|
3547
|
+
password_first: i.boolean().default(!1),
|
|
3548
|
+
webauthn_platform_first_factor: i.boolean()
|
|
3549
|
+
});
|
|
3517
3550
|
function ln(n) {
|
|
3518
3551
|
const [e, t] = n.split("|");
|
|
3519
3552
|
if (!e || !t)
|
|
3520
3553
|
throw new Error(`Invalid user_id: ${n}`);
|
|
3521
3554
|
return { connection: e, id: t };
|
|
3522
3555
|
}
|
|
3523
|
-
function
|
|
3556
|
+
function Pn(n) {
|
|
3524
3557
|
let e = {};
|
|
3525
3558
|
try {
|
|
3526
3559
|
e = JSON.parse(n.profileData || "{}");
|
|
@@ -3539,7 +3572,7 @@ function $n(n) {
|
|
|
3539
3572
|
}
|
|
3540
3573
|
};
|
|
3541
3574
|
}
|
|
3542
|
-
function
|
|
3575
|
+
function Ir(n) {
|
|
3543
3576
|
return async (e, t) => {
|
|
3544
3577
|
const [s, r] = await Promise.all([
|
|
3545
3578
|
n.selectFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", t).selectAll().executeTakeFirst(),
|
|
@@ -3559,7 +3592,7 @@ function Cr(n) {
|
|
|
3559
3592
|
user_id: ln(s.user_id).id,
|
|
3560
3593
|
isSocial: !!s.is_social
|
|
3561
3594
|
},
|
|
3562
|
-
...r.map(
|
|
3595
|
+
...r.map(Pn)
|
|
3563
3596
|
]
|
|
3564
3597
|
};
|
|
3565
3598
|
return R(c);
|
|
@@ -3602,10 +3635,10 @@ function Ee(n, e, t, s) {
|
|
|
3602
3635
|
}
|
|
3603
3636
|
}), e;
|
|
3604
3637
|
}
|
|
3605
|
-
function
|
|
3638
|
+
function ke(n) {
|
|
3606
3639
|
return typeof n == "string" ? parseInt(n, 10) : typeof n == "bigint" ? Number(n) : n;
|
|
3607
3640
|
}
|
|
3608
|
-
function
|
|
3641
|
+
function Er(n) {
|
|
3609
3642
|
return async (e, t) => {
|
|
3610
3643
|
let s = n.selectFrom("users").where("users.tenant_id", "=", e);
|
|
3611
3644
|
if (t.q && (s = Ee(n, s, t.q, ["email", "name"])), t.sort && t.sort.sort_by) {
|
|
@@ -3627,7 +3660,7 @@ function Ir(n) {
|
|
|
3627
3660
|
user_id: ln(l.user_id).id,
|
|
3628
3661
|
isSocial: !!l.is_social
|
|
3629
3662
|
},
|
|
3630
|
-
...j.map(
|
|
3663
|
+
...j.map(Pn)
|
|
3631
3664
|
]
|
|
3632
3665
|
});
|
|
3633
3666
|
}), { count: u } = await s.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
@@ -3635,52 +3668,52 @@ function Ir(n) {
|
|
|
3635
3668
|
users: d,
|
|
3636
3669
|
start: t.page * t.per_page,
|
|
3637
3670
|
limit: t.per_page,
|
|
3638
|
-
length:
|
|
3671
|
+
length: ke(u)
|
|
3639
3672
|
};
|
|
3640
3673
|
};
|
|
3641
3674
|
}
|
|
3642
|
-
function
|
|
3675
|
+
function Ar(n) {
|
|
3643
3676
|
return async (e, t) => (await n.deleteFrom("users").where("users.tenant_id", "=", e).where("users.linked_to", "=", t).execute(), (await n.deleteFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", t).execute()).length === 1);
|
|
3644
3677
|
}
|
|
3645
|
-
function
|
|
3678
|
+
function Rr(n) {
|
|
3646
3679
|
if (n.email_verified !== void 0)
|
|
3647
3680
|
return n.email_verified ? 1 : 0;
|
|
3648
3681
|
}
|
|
3649
|
-
function
|
|
3682
|
+
function $r(n) {
|
|
3650
3683
|
return async (e, t, s) => {
|
|
3651
3684
|
const r = {
|
|
3652
3685
|
...s,
|
|
3653
|
-
email_verified:
|
|
3686
|
+
email_verified: Rr(s),
|
|
3654
3687
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3655
3688
|
};
|
|
3656
3689
|
return (await n.updateTable("users").set(r).where("users.tenant_id", "=", e).where("users.user_id", "=", t).execute()).length === 1;
|
|
3657
3690
|
};
|
|
3658
3691
|
}
|
|
3659
|
-
function
|
|
3692
|
+
function Pr(n) {
|
|
3660
3693
|
return async (e, t, s, r) => {
|
|
3661
3694
|
const a = { linked_to: null };
|
|
3662
3695
|
return (await n.updateTable("users").set(a).where("users.tenant_id", "=", e).where("users.user_id", "=", `${s}|${r}`).where("users.linked_to", "=", `${t}`).execute()).length === 1;
|
|
3663
3696
|
};
|
|
3664
3697
|
}
|
|
3665
|
-
function
|
|
3698
|
+
function Dr(n) {
|
|
3666
3699
|
return {
|
|
3667
3700
|
create: Qn(n),
|
|
3668
|
-
remove:
|
|
3669
|
-
get:
|
|
3670
|
-
list:
|
|
3671
|
-
update:
|
|
3701
|
+
remove: Ar(n),
|
|
3702
|
+
get: Ir(n),
|
|
3703
|
+
list: Er(n),
|
|
3704
|
+
update: $r(n),
|
|
3672
3705
|
// TODO - think about this more when other issues fixed
|
|
3673
|
-
unlink:
|
|
3706
|
+
unlink: Pr(n)
|
|
3674
3707
|
};
|
|
3675
3708
|
}
|
|
3676
|
-
const
|
|
3709
|
+
const Mr = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
3677
3710
|
let Ae = (n = 21) => {
|
|
3678
3711
|
let e = "", t = crypto.getRandomValues(new Uint8Array(n));
|
|
3679
3712
|
for (; n--; )
|
|
3680
|
-
e +=
|
|
3713
|
+
e += Mr[t[n] & 63];
|
|
3681
3714
|
return e;
|
|
3682
3715
|
};
|
|
3683
|
-
function
|
|
3716
|
+
function Lr(n) {
|
|
3684
3717
|
return async (e) => {
|
|
3685
3718
|
const t = {
|
|
3686
3719
|
id: e.id || Ae(),
|
|
@@ -3691,13 +3724,13 @@ function Mr(n) {
|
|
|
3691
3724
|
return await n.insertInto("tenants").values(t).execute(), t;
|
|
3692
3725
|
};
|
|
3693
3726
|
}
|
|
3694
|
-
function
|
|
3727
|
+
function Vr(n) {
|
|
3695
3728
|
return async (e) => {
|
|
3696
3729
|
const t = await n.selectFrom("tenants").where("tenants.id", "=", e).selectAll().executeTakeFirst();
|
|
3697
3730
|
return t ? R(t) : null;
|
|
3698
3731
|
};
|
|
3699
3732
|
}
|
|
3700
|
-
function
|
|
3733
|
+
function Ur(n) {
|
|
3701
3734
|
return async (e) => {
|
|
3702
3735
|
let t = n.selectFrom("tenants");
|
|
3703
3736
|
if (e.sort && e.sort.sort_by) {
|
|
@@ -3710,7 +3743,7 @@ function Vr(n) {
|
|
|
3710
3743
|
return {
|
|
3711
3744
|
tenants: r
|
|
3712
3745
|
};
|
|
3713
|
-
const { count: a } = await t.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), o =
|
|
3746
|
+
const { count: a } = await t.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), o = ke(a);
|
|
3714
3747
|
return {
|
|
3715
3748
|
tenants: r.map(R),
|
|
3716
3749
|
start: (e.page - 1) * e.per_page,
|
|
@@ -3719,7 +3752,7 @@ function Vr(n) {
|
|
|
3719
3752
|
};
|
|
3720
3753
|
};
|
|
3721
3754
|
}
|
|
3722
|
-
function
|
|
3755
|
+
function Fr(n) {
|
|
3723
3756
|
return async (e, t) => {
|
|
3724
3757
|
const s = {
|
|
3725
3758
|
...t,
|
|
@@ -3729,29 +3762,29 @@ function Ur(n) {
|
|
|
3729
3762
|
await n.updateTable("tenants").set(s).where("id", "=", e).execute();
|
|
3730
3763
|
};
|
|
3731
3764
|
}
|
|
3732
|
-
function
|
|
3765
|
+
function zr(n) {
|
|
3733
3766
|
return async (e) => (await n.deleteFrom("tenants").where("tenants.id", "=", e).execute()).length === 1;
|
|
3734
3767
|
}
|
|
3735
|
-
function
|
|
3768
|
+
function Br(n) {
|
|
3736
3769
|
return {
|
|
3737
|
-
create:
|
|
3738
|
-
get:
|
|
3739
|
-
list:
|
|
3740
|
-
update:
|
|
3741
|
-
remove:
|
|
3770
|
+
create: Lr(n),
|
|
3771
|
+
get: Vr(n),
|
|
3772
|
+
list: Ur(n),
|
|
3773
|
+
update: Fr(n),
|
|
3774
|
+
remove: zr(n)
|
|
3742
3775
|
};
|
|
3743
3776
|
}
|
|
3744
|
-
function
|
|
3777
|
+
function _n(n) {
|
|
3745
3778
|
return n ? JSON.stringify(n) : void 0;
|
|
3746
3779
|
}
|
|
3747
|
-
const
|
|
3748
|
-
function
|
|
3780
|
+
const Wr = 1024;
|
|
3781
|
+
function qr(n) {
|
|
3749
3782
|
return async (e, t) => {
|
|
3750
3783
|
var r, a, o;
|
|
3751
3784
|
const s = {
|
|
3752
3785
|
id: Ae(),
|
|
3753
3786
|
...t,
|
|
3754
|
-
user_agent: t.user_agent.slice(0,
|
|
3787
|
+
user_agent: t.user_agent.slice(0, Wr)
|
|
3755
3788
|
};
|
|
3756
3789
|
return await n.insertInto("logs").values({
|
|
3757
3790
|
...s,
|
|
@@ -3760,12 +3793,12 @@ function Wr(n) {
|
|
|
3760
3793
|
isMobile: t.isMobile ? 1 : 0,
|
|
3761
3794
|
tenant_id: e,
|
|
3762
3795
|
scope: (a = t.scope) == null ? void 0 : a.join(","),
|
|
3763
|
-
auth0_client:
|
|
3764
|
-
details: (o =
|
|
3796
|
+
auth0_client: _n(t.auth0_client),
|
|
3797
|
+
details: (o = _n(t.details)) == null ? void 0 : o.substring(0, 8192)
|
|
3765
3798
|
}).execute(), s;
|
|
3766
3799
|
};
|
|
3767
3800
|
}
|
|
3768
|
-
function
|
|
3801
|
+
function gn(n) {
|
|
3769
3802
|
if (!n)
|
|
3770
3803
|
return "";
|
|
3771
3804
|
try {
|
|
@@ -3774,20 +3807,20 @@ function _n(n) {
|
|
|
3774
3807
|
return n;
|
|
3775
3808
|
}
|
|
3776
3809
|
}
|
|
3777
|
-
function
|
|
3810
|
+
function Dn(n) {
|
|
3778
3811
|
return {
|
|
3779
3812
|
...n,
|
|
3780
3813
|
client_id: n.client_id,
|
|
3781
3814
|
client_name: "",
|
|
3782
|
-
auth0_client:
|
|
3783
|
-
details:
|
|
3815
|
+
auth0_client: gn(n.auth0_client),
|
|
3816
|
+
details: gn(n.details),
|
|
3784
3817
|
isMobile: !!n.isMobile,
|
|
3785
3818
|
scope: n.scope ? n.scope.split(",") : void 0,
|
|
3786
3819
|
log_id: n.id,
|
|
3787
3820
|
_id: n.id
|
|
3788
3821
|
};
|
|
3789
3822
|
}
|
|
3790
|
-
function
|
|
3823
|
+
function Jr(n) {
|
|
3791
3824
|
return async (e, t) => {
|
|
3792
3825
|
let s = n.selectFrom("logs").where("logs.tenant_id", "=", e);
|
|
3793
3826
|
t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
|
|
@@ -3802,30 +3835,30 @@ function qr(n) {
|
|
|
3802
3835
|
r = r.offset(t.page * t.per_page).limit(t.per_page);
|
|
3803
3836
|
const a = await r.selectAll().execute(), { count: o } = await s.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
3804
3837
|
return {
|
|
3805
|
-
logs: a.map(
|
|
3838
|
+
logs: a.map(Dn),
|
|
3806
3839
|
start: t.page * t.per_page,
|
|
3807
3840
|
limit: t.per_page,
|
|
3808
|
-
length:
|
|
3841
|
+
length: ke(o)
|
|
3809
3842
|
};
|
|
3810
3843
|
};
|
|
3811
3844
|
}
|
|
3812
|
-
function
|
|
3845
|
+
function Kr(n) {
|
|
3813
3846
|
return async (e, t) => {
|
|
3814
3847
|
const s = await n.selectFrom("logs").where("logs.tenant_id", "=", e).where("logs.id", "=", t).selectAll().executeTakeFirst();
|
|
3815
|
-
return s ?
|
|
3848
|
+
return s ? Dn(s) : null;
|
|
3816
3849
|
};
|
|
3817
3850
|
}
|
|
3818
|
-
function
|
|
3851
|
+
function Hr(n) {
|
|
3819
3852
|
return {
|
|
3820
|
-
create:
|
|
3821
|
-
list:
|
|
3822
|
-
get:
|
|
3853
|
+
create: qr(n),
|
|
3854
|
+
list: Jr(n),
|
|
3855
|
+
get: Kr(n)
|
|
3823
3856
|
};
|
|
3824
3857
|
}
|
|
3825
3858
|
function Qr(n) {
|
|
3826
3859
|
return async (e, t) => await n.selectFrom("sessions").where("sessions.tenant_id", "=", e).where("sessions.session_id", "=", t).where("sessions.deleted_at", "is", null).selectAll().executeTakeFirst() ?? null;
|
|
3827
3860
|
}
|
|
3828
|
-
function
|
|
3861
|
+
function Yr(n) {
|
|
3829
3862
|
return async (e, t) => {
|
|
3830
3863
|
const s = {
|
|
3831
3864
|
...t,
|
|
@@ -3835,13 +3868,13 @@ function Hr(n) {
|
|
|
3835
3868
|
return await n.insertInto("sessions").values({ ...s, tenant_id: e }).execute(), { ...t, ...s };
|
|
3836
3869
|
};
|
|
3837
3870
|
}
|
|
3838
|
-
function
|
|
3871
|
+
function Gr(n) {
|
|
3839
3872
|
return async (e, t) => !!(await n.updateTable("sessions").set({ deleted_at: (/* @__PURE__ */ new Date()).toISOString() }).where("tenant_id", "=", e).where("sessions.session_id", "=", t).where("sessions.deleted_at", "is", null).execute()).length;
|
|
3840
3873
|
}
|
|
3841
|
-
function
|
|
3874
|
+
function Xr(n) {
|
|
3842
3875
|
return async (e, t, s) => !!(await n.updateTable("sessions").set(s).where("tenant_id", "=", e).where("sessions.session_id", "=", t).where("sessions.deleted_at", "is", null).execute()).length;
|
|
3843
3876
|
}
|
|
3844
|
-
function
|
|
3877
|
+
function ea(n) {
|
|
3845
3878
|
return async (e, t) => {
|
|
3846
3879
|
let s = n.selectFrom("sessions").where("sessions.tenant_id", "=", e);
|
|
3847
3880
|
t.q && (s = Ee(n, s, t.q, ["user_id", "session_id"]));
|
|
@@ -3854,7 +3887,7 @@ function Xr(n) {
|
|
|
3854
3887
|
);
|
|
3855
3888
|
}
|
|
3856
3889
|
r = r.offset(t.page * t.per_page).limit(t.per_page);
|
|
3857
|
-
const a = await r.selectAll().execute(), { count: o } = await s.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), c =
|
|
3890
|
+
const a = await r.selectAll().execute(), { count: o } = await s.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), c = ke(o);
|
|
3858
3891
|
return {
|
|
3859
3892
|
sessions: a,
|
|
3860
3893
|
start: t.page * t.per_page,
|
|
@@ -3863,16 +3896,16 @@ function Xr(n) {
|
|
|
3863
3896
|
};
|
|
3864
3897
|
};
|
|
3865
3898
|
}
|
|
3866
|
-
function
|
|
3899
|
+
function ta(n) {
|
|
3867
3900
|
return {
|
|
3868
|
-
create:
|
|
3901
|
+
create: Yr(n),
|
|
3869
3902
|
get: Qr(n),
|
|
3870
|
-
list:
|
|
3871
|
-
remove:
|
|
3872
|
-
update:
|
|
3903
|
+
list: ea(n),
|
|
3904
|
+
remove: Gr(n),
|
|
3905
|
+
update: Xr(n)
|
|
3873
3906
|
};
|
|
3874
3907
|
}
|
|
3875
|
-
function
|
|
3908
|
+
function na(n) {
|
|
3876
3909
|
return async (e, t) => {
|
|
3877
3910
|
const s = await n.selectFrom("tickets").where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).where("tickets.used_at", "is", null).selectAll().executeTakeFirst();
|
|
3878
3911
|
if (!s)
|
|
@@ -3902,7 +3935,7 @@ function ta(n) {
|
|
|
3902
3935
|
};
|
|
3903
3936
|
};
|
|
3904
3937
|
}
|
|
3905
|
-
function
|
|
3938
|
+
function sa(n) {
|
|
3906
3939
|
return async (e) => {
|
|
3907
3940
|
const { authParams: t, ...s } = e, r = {
|
|
3908
3941
|
...s,
|
|
@@ -3914,27 +3947,27 @@ function na(n) {
|
|
|
3914
3947
|
await n.insertInto("tickets").values(r).execute();
|
|
3915
3948
|
};
|
|
3916
3949
|
}
|
|
3917
|
-
function
|
|
3950
|
+
function ra(n) {
|
|
3918
3951
|
return async (e, t) => {
|
|
3919
3952
|
await n.updateTable("tickets").set({
|
|
3920
3953
|
used_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3921
3954
|
}).where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).execute();
|
|
3922
3955
|
};
|
|
3923
3956
|
}
|
|
3924
|
-
function
|
|
3957
|
+
function aa(n) {
|
|
3925
3958
|
return {
|
|
3926
|
-
create:
|
|
3927
|
-
get:
|
|
3928
|
-
remove:
|
|
3959
|
+
create: sa(n),
|
|
3960
|
+
get: na(n),
|
|
3961
|
+
remove: ra(n)
|
|
3929
3962
|
};
|
|
3930
3963
|
}
|
|
3931
|
-
function
|
|
3964
|
+
function ia(n) {
|
|
3932
3965
|
return async (e, t) => {
|
|
3933
3966
|
const s = await n.selectFrom("passwords").where("passwords.tenant_id", "=", e).where("passwords.user_id", "=", t).selectAll().executeTakeFirstOrThrow(), { tenant_id: r, ...a } = s;
|
|
3934
3967
|
return a;
|
|
3935
3968
|
};
|
|
3936
3969
|
}
|
|
3937
|
-
function
|
|
3970
|
+
function oa(n) {
|
|
3938
3971
|
return async (e, t) => {
|
|
3939
3972
|
const s = {
|
|
3940
3973
|
...t,
|
|
@@ -3947,20 +3980,20 @@ function ia(n) {
|
|
|
3947
3980
|
}).execute(), s;
|
|
3948
3981
|
};
|
|
3949
3982
|
}
|
|
3950
|
-
function
|
|
3983
|
+
function ca(n) {
|
|
3951
3984
|
return async (e, t) => (await n.updateTable("passwords").set({
|
|
3952
3985
|
password: t.password,
|
|
3953
3986
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3954
3987
|
}).where("tenant_id", "=", e).where("user_id", "=", t.user_id).execute()).length === 1;
|
|
3955
3988
|
}
|
|
3956
|
-
function
|
|
3989
|
+
function da(n) {
|
|
3957
3990
|
return {
|
|
3958
|
-
create:
|
|
3959
|
-
update:
|
|
3960
|
-
get:
|
|
3991
|
+
create: oa(n),
|
|
3992
|
+
update: ca(n),
|
|
3993
|
+
get: ia(n)
|
|
3961
3994
|
};
|
|
3962
3995
|
}
|
|
3963
|
-
function
|
|
3996
|
+
function ua(n) {
|
|
3964
3997
|
return async (e, t) => {
|
|
3965
3998
|
let s = n.selectFrom("codes").where("codes.tenant_id", "=", e);
|
|
3966
3999
|
t.q && (s = Ee(n, s, t.q, ["code", "login_id"]));
|
|
@@ -3968,15 +4001,15 @@ function da(n) {
|
|
|
3968
4001
|
return {
|
|
3969
4002
|
codes: a.map((d) => {
|
|
3970
4003
|
const { tenant_id: u, ...l } = d;
|
|
3971
|
-
return
|
|
4004
|
+
return mr.parse(R(l));
|
|
3972
4005
|
}),
|
|
3973
4006
|
start: t.page * t.per_page,
|
|
3974
4007
|
limit: t.per_page,
|
|
3975
|
-
length:
|
|
4008
|
+
length: ke(o)
|
|
3976
4009
|
};
|
|
3977
4010
|
};
|
|
3978
4011
|
}
|
|
3979
|
-
function
|
|
4012
|
+
function la(n) {
|
|
3980
4013
|
return async (e, t) => {
|
|
3981
4014
|
const s = {
|
|
3982
4015
|
...t,
|
|
@@ -3988,10 +4021,10 @@ function ua(n) {
|
|
|
3988
4021
|
}).execute(), s;
|
|
3989
4022
|
};
|
|
3990
4023
|
}
|
|
3991
|
-
function
|
|
4024
|
+
function pa(n) {
|
|
3992
4025
|
return async (e, t) => (await n.deleteFrom("codes").where("codes.tenant_id", "=", e).where("codes.code_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
3993
4026
|
}
|
|
3994
|
-
function
|
|
4027
|
+
function ha(n) {
|
|
3995
4028
|
return async (e, t, s) => {
|
|
3996
4029
|
let r = n.selectFrom("codes").where("codes.code_id", "=", t).where("codes.code_type", "=", s).where("codes.expires_at", ">", (/* @__PURE__ */ new Date()).toISOString());
|
|
3997
4030
|
e.length && (r = r.where("codes.tenant_id", "=", e));
|
|
@@ -3999,15 +4032,15 @@ function pa(n) {
|
|
|
3999
4032
|
return a ? R(a) : null;
|
|
4000
4033
|
};
|
|
4001
4034
|
}
|
|
4002
|
-
function
|
|
4035
|
+
function fa(n) {
|
|
4003
4036
|
return {
|
|
4004
|
-
create:
|
|
4005
|
-
list:
|
|
4006
|
-
remove:
|
|
4007
|
-
get:
|
|
4037
|
+
create: la(n),
|
|
4038
|
+
list: ua(n),
|
|
4039
|
+
remove: pa(n),
|
|
4040
|
+
get: ha(n)
|
|
4008
4041
|
};
|
|
4009
4042
|
}
|
|
4010
|
-
function
|
|
4043
|
+
function ma(n) {
|
|
4011
4044
|
return async (e, t) => {
|
|
4012
4045
|
const s = {
|
|
4013
4046
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -4026,7 +4059,7 @@ function fa(n) {
|
|
|
4026
4059
|
}).execute(), s;
|
|
4027
4060
|
};
|
|
4028
4061
|
}
|
|
4029
|
-
function
|
|
4062
|
+
function _a(n) {
|
|
4030
4063
|
return async (e) => ({
|
|
4031
4064
|
applications: (await n.selectFrom("applications").where("applications.tenant_id", "=", e).selectAll().execute()).map((a) => ({
|
|
4032
4065
|
...a,
|
|
@@ -4039,7 +4072,7 @@ function ma(n) {
|
|
|
4039
4072
|
}))
|
|
4040
4073
|
});
|
|
4041
4074
|
}
|
|
4042
|
-
function
|
|
4075
|
+
function ga(n) {
|
|
4043
4076
|
return async (e, t) => {
|
|
4044
4077
|
const s = await n.selectFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", t).selectAll().executeTakeFirst();
|
|
4045
4078
|
return s ? R({
|
|
@@ -4053,10 +4086,10 @@ function _a(n) {
|
|
|
4053
4086
|
}) : null;
|
|
4054
4087
|
};
|
|
4055
4088
|
}
|
|
4056
|
-
function
|
|
4089
|
+
function ya(n) {
|
|
4057
4090
|
return async (e, t) => (await n.deleteFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
4058
4091
|
}
|
|
4059
|
-
function
|
|
4092
|
+
function va(n) {
|
|
4060
4093
|
return async (e, t, s) => {
|
|
4061
4094
|
const r = {
|
|
4062
4095
|
...s,
|
|
@@ -4071,327 +4104,74 @@ function ya(n) {
|
|
|
4071
4104
|
return await n.updateTable("applications").set(r).where("applications.id", "=", t).where("applications.tenant_id", "=", e).execute(), !0;
|
|
4072
4105
|
};
|
|
4073
4106
|
}
|
|
4074
|
-
function
|
|
4107
|
+
function wa(n) {
|
|
4075
4108
|
return {
|
|
4076
|
-
create:
|
|
4077
|
-
list:
|
|
4078
|
-
get:
|
|
4079
|
-
remove:
|
|
4080
|
-
update:
|
|
4109
|
+
create: ma(n),
|
|
4110
|
+
list: _a(n),
|
|
4111
|
+
get: ga(n),
|
|
4112
|
+
remove: ya(n),
|
|
4113
|
+
update: va(n)
|
|
4081
4114
|
};
|
|
4082
4115
|
}
|
|
4083
|
-
function
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
};
|
|
4091
|
-
return await n.insertInto("connections").values({ ...s, tenant_id: e }).execute(), s;
|
|
4092
|
-
};
|
|
4116
|
+
function ba(n, e) {
|
|
4117
|
+
var t = {};
|
|
4118
|
+
for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && e.indexOf(s) < 0 && (t[s] = n[s]);
|
|
4119
|
+
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
4120
|
+
for (var r = 0, s = Object.getOwnPropertySymbols(n); r < s.length; r++)
|
|
4121
|
+
e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, s[r]) && (t[s[r]] = n[s[r]]);
|
|
4122
|
+
return t;
|
|
4093
4123
|
}
|
|
4094
|
-
function ka(n) {
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
|
|
4098
|
-
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
4099
|
-
return {
|
|
4100
|
-
connections: a.map(R),
|
|
4101
|
-
start: t.page * t.per_page,
|
|
4102
|
-
limit: t.per_page,
|
|
4103
|
-
length: be(o)
|
|
4104
|
-
};
|
|
4105
|
-
};
|
|
4124
|
+
function ka(n, e) {
|
|
4125
|
+
var t;
|
|
4126
|
+
return ((t = n == null ? void 0 : n._def) === null || t === void 0 ? void 0 : t.typeName) === e;
|
|
4106
4127
|
}
|
|
4107
|
-
function
|
|
4108
|
-
|
|
4128
|
+
function Ye(n, e) {
|
|
4129
|
+
const t = n.ZodType.prototype[e];
|
|
4130
|
+
n.ZodType.prototype[e] = function(...s) {
|
|
4131
|
+
const r = t.apply(this, s);
|
|
4132
|
+
return r._def.openapi = this._def.openapi, r;
|
|
4133
|
+
};
|
|
4109
4134
|
}
|
|
4110
4135
|
function xa(n) {
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4136
|
+
if (typeof n.ZodType.prototype.openapi < "u")
|
|
4137
|
+
return;
|
|
4138
|
+
n.ZodType.prototype.openapi = function(r, a) {
|
|
4139
|
+
var o, c, d, u, l, j;
|
|
4140
|
+
const A = typeof r == "string" ? a : r, U = A ?? {}, { param: ie } = U, $e = ba(U, ["param"]), oe = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), ce = Object.assign(Object.assign(Object.assign({}, (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata), $e), !((u = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || u === void 0) && u.param || ie ? {
|
|
4141
|
+
param: Object.assign(Object.assign({}, (j = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || j === void 0 ? void 0 : j.param), ie)
|
|
4142
|
+
} : void 0), de = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(oe).length > 0 ? { _internal: oe } : void 0), Object.keys(ce).length > 0 ? { metadata: ce } : void 0) }));
|
|
4143
|
+
if (ka(this, "ZodObject")) {
|
|
4144
|
+
const Pe = this.extend;
|
|
4145
|
+
de.extend = function(...De) {
|
|
4146
|
+
var K, H, Q, ue, xe, Te;
|
|
4147
|
+
const Oe = Pe.apply(this, De);
|
|
4148
|
+
return Oe._def.openapi = {
|
|
4149
|
+
_internal: {
|
|
4150
|
+
extendedFrom: !((H = (K = this._def.openapi) === null || K === void 0 ? void 0 : K._internal) === null || H === void 0) && H.refId ? { refId: (ue = (Q = this._def.openapi) === null || Q === void 0 ? void 0 : Q._internal) === null || ue === void 0 ? void 0 : ue.refId, schema: this } : (xe = this._def.openapi) === null || xe === void 0 ? void 0 : xe._internal.extendedFrom
|
|
4151
|
+
},
|
|
4152
|
+
metadata: (Te = Oe._def.openapi) === null || Te === void 0 ? void 0 : Te.metadata
|
|
4153
|
+
}, Oe;
|
|
4154
|
+
};
|
|
4155
|
+
}
|
|
4156
|
+
return de;
|
|
4157
|
+
}, Ye(n, "optional"), Ye(n, "nullable"), Ye(n, "default"), Ye(n, "transform"), Ye(n, "refine");
|
|
4158
|
+
const e = n.ZodObject.prototype.deepPartial;
|
|
4159
|
+
n.ZodObject.prototype.deepPartial = function() {
|
|
4160
|
+
const r = this._def.shape(), a = e.apply(this), o = a._def.shape();
|
|
4161
|
+
return Object.entries(o).forEach(([c, d]) => {
|
|
4162
|
+
var u, l;
|
|
4163
|
+
d._def.openapi = (l = (u = r[c]) === null || u === void 0 ? void 0 : u._def) === null || l === void 0 ? void 0 : l.openapi;
|
|
4164
|
+
}), a._def.openapi = void 0, a;
|
|
4114
4165
|
};
|
|
4115
|
-
|
|
4116
|
-
function
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
...s,
|
|
4120
|
-
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
4121
|
-
};
|
|
4122
|
-
return await n.updateTable("connections").set(r).where("connections.id", "=", t).where("connections.tenant_id", "=", e).execute(), !0;
|
|
4166
|
+
const t = n.ZodObject.prototype.pick;
|
|
4167
|
+
n.ZodObject.prototype.pick = function(...r) {
|
|
4168
|
+
const a = t.apply(this, r);
|
|
4169
|
+
return a._def.openapi = void 0, a;
|
|
4123
4170
|
};
|
|
4124
|
-
|
|
4125
|
-
function
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
get: xa(n),
|
|
4129
|
-
list: ka(n),
|
|
4130
|
-
remove: ba(n),
|
|
4131
|
-
update: Ta(n)
|
|
4132
|
-
};
|
|
4133
|
-
}
|
|
4134
|
-
function Sa(n) {
|
|
4135
|
-
return {
|
|
4136
|
-
get: async (e) => {
|
|
4137
|
-
const t = await n.selectFrom("applications").selectAll().where("id", "=", e).executeTakeFirst();
|
|
4138
|
-
if (!t)
|
|
4139
|
-
return null;
|
|
4140
|
-
const s = await n.selectFrom("tenants").selectAll().where("id", "=", t.tenant_id).executeTakeFirst();
|
|
4141
|
-
if (!s)
|
|
4142
|
-
throw new Gt(404, { message: "Tenant not found" });
|
|
4143
|
-
const r = await n.selectFrom("connections").where("tenant_id", "=", t.tenant_id).selectAll().execute(), a = await n.selectFrom("domains").where("tenant_id", "=", t.tenant_id).selectAll().execute();
|
|
4144
|
-
return {
|
|
4145
|
-
...t,
|
|
4146
|
-
connections: r.map(
|
|
4147
|
-
(c) => An.parse(R(c))
|
|
4148
|
-
),
|
|
4149
|
-
domains: a,
|
|
4150
|
-
addons: t.addons ? JSON.parse(t.addons) : {},
|
|
4151
|
-
callbacks: t.callbacks ? JSON.parse(t.callbacks) : [],
|
|
4152
|
-
allowed_origins: t.allowed_origins ? JSON.parse(t.allowed_origins) : [],
|
|
4153
|
-
web_origins: t.web_origins ? JSON.parse(t.web_origins) : [],
|
|
4154
|
-
allowed_logout_urls: t.allowed_logout_urls ? JSON.parse(t.allowed_logout_urls) : [],
|
|
4155
|
-
tenant: R(s),
|
|
4156
|
-
// this is really an integer in the database
|
|
4157
|
-
disable_sign_ups: !!t.disable_sign_ups
|
|
4158
|
-
};
|
|
4159
|
-
}
|
|
4160
|
-
};
|
|
4161
|
-
}
|
|
4162
|
-
function Za(n) {
|
|
4163
|
-
return async () => await n.selectFrom("keys").where("revoked_at", "is", null).selectAll().execute();
|
|
4164
|
-
}
|
|
4165
|
-
function ja(n) {
|
|
4166
|
-
return async (e) => {
|
|
4167
|
-
await n.insertInto("keys").values({ ...e, created_at: (/* @__PURE__ */ new Date()).toDateString() }).execute();
|
|
4168
|
-
};
|
|
4169
|
-
}
|
|
4170
|
-
function Na(n) {
|
|
4171
|
-
return async (e, t) => !!(await n.updateTable("keys").set(t).where("kid", "=", e).execute()).length;
|
|
4172
|
-
}
|
|
4173
|
-
function Ca(n) {
|
|
4174
|
-
return {
|
|
4175
|
-
create: ja(n),
|
|
4176
|
-
list: Za(n),
|
|
4177
|
-
update: Na(n)
|
|
4178
|
-
};
|
|
4179
|
-
}
|
|
4180
|
-
function Ia(n) {
|
|
4181
|
-
return async (e, t) => {
|
|
4182
|
-
const s = {
|
|
4183
|
-
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4184
|
-
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4185
|
-
tenant_id: e,
|
|
4186
|
-
id: Ae(),
|
|
4187
|
-
...t
|
|
4188
|
-
};
|
|
4189
|
-
return await n.insertInto("domains").values(s).execute(), s;
|
|
4190
|
-
};
|
|
4191
|
-
}
|
|
4192
|
-
function Ea(n) {
|
|
4193
|
-
return async (e, t) => {
|
|
4194
|
-
let s = n.selectFrom("domains").where("domains.tenant_id", "=", e);
|
|
4195
|
-
t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
|
|
4196
|
-
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
4197
|
-
return {
|
|
4198
|
-
domains: a,
|
|
4199
|
-
start: t.page * t.per_page,
|
|
4200
|
-
limit: t.per_page,
|
|
4201
|
-
length: be(o)
|
|
4202
|
-
};
|
|
4203
|
-
};
|
|
4204
|
-
}
|
|
4205
|
-
function Aa(n) {
|
|
4206
|
-
return {
|
|
4207
|
-
create: Ia(n),
|
|
4208
|
-
list: Ea(n)
|
|
4209
|
-
};
|
|
4210
|
-
}
|
|
4211
|
-
function Ra(n) {
|
|
4212
|
-
return async (e) => {
|
|
4213
|
-
const [t] = await n.selectFrom("branding").where("branding.tenant_id", "=", e).selectAll().execute();
|
|
4214
|
-
if (!t)
|
|
4215
|
-
return null;
|
|
4216
|
-
const {
|
|
4217
|
-
tenant_id: s,
|
|
4218
|
-
colors_primary: r,
|
|
4219
|
-
colors_page_background_type: a,
|
|
4220
|
-
colors_page_background_start: o,
|
|
4221
|
-
colors_page_background_end: c,
|
|
4222
|
-
colors_page_background_angle_dev: d,
|
|
4223
|
-
font_url: u,
|
|
4224
|
-
...l
|
|
4225
|
-
} = t;
|
|
4226
|
-
return R({
|
|
4227
|
-
...l,
|
|
4228
|
-
colors: {
|
|
4229
|
-
primary: r,
|
|
4230
|
-
page_background: {
|
|
4231
|
-
type: a,
|
|
4232
|
-
start: o,
|
|
4233
|
-
end: c,
|
|
4234
|
-
angle_deg: d
|
|
4235
|
-
}
|
|
4236
|
-
},
|
|
4237
|
-
font: u ? { url: u } : void 0
|
|
4238
|
-
});
|
|
4239
|
-
};
|
|
4240
|
-
}
|
|
4241
|
-
function $a(n) {
|
|
4242
|
-
return async (e, t) => {
|
|
4243
|
-
var o, c, d, u, l, j, A, U, ie, Re, oe, ce, de, $e, Pe, K, Q, H;
|
|
4244
|
-
const { colors: s, font: r, ...a } = t;
|
|
4245
|
-
try {
|
|
4246
|
-
await n.insertInto("branding").values({
|
|
4247
|
-
...a,
|
|
4248
|
-
colors_primary: s == null ? void 0 : s.primary,
|
|
4249
|
-
colors_page_background_type: (c = (o = t.colors) == null ? void 0 : o.page_background) == null ? void 0 : c.type,
|
|
4250
|
-
colors_page_background_start: (u = (d = t.colors) == null ? void 0 : d.page_background) == null ? void 0 : u.start,
|
|
4251
|
-
colors_page_background_end: (j = (l = t.colors) == null ? void 0 : l.page_background) == null ? void 0 : j.end,
|
|
4252
|
-
colors_page_background_angle_dev: (U = (A = t.colors) == null ? void 0 : A.page_background) == null ? void 0 : U.angle_deg,
|
|
4253
|
-
font_url: (ie = t.font) == null ? void 0 : ie.url,
|
|
4254
|
-
tenant_id: e
|
|
4255
|
-
}).execute();
|
|
4256
|
-
} catch {
|
|
4257
|
-
await n.updateTable("branding").set({
|
|
4258
|
-
...a,
|
|
4259
|
-
colors_primary: s == null ? void 0 : s.primary,
|
|
4260
|
-
colors_page_background_type: (oe = (Re = t.colors) == null ? void 0 : Re.page_background) == null ? void 0 : oe.type,
|
|
4261
|
-
colors_page_background_start: (de = (ce = t.colors) == null ? void 0 : ce.page_background) == null ? void 0 : de.start,
|
|
4262
|
-
colors_page_background_end: (Pe = ($e = t.colors) == null ? void 0 : $e.page_background) == null ? void 0 : Pe.end,
|
|
4263
|
-
colors_page_background_angle_dev: (Q = (K = t.colors) == null ? void 0 : K.page_background) == null ? void 0 : Q.angle_deg,
|
|
4264
|
-
font_url: (H = t.font) == null ? void 0 : H.url
|
|
4265
|
-
}).where("tenant_id", "=", e).execute();
|
|
4266
|
-
}
|
|
4267
|
-
};
|
|
4268
|
-
}
|
|
4269
|
-
function Pa(n) {
|
|
4270
|
-
return {
|
|
4271
|
-
get: Ra(n),
|
|
4272
|
-
set: $a(n)
|
|
4273
|
-
};
|
|
4274
|
-
}
|
|
4275
|
-
function Da(n) {
|
|
4276
|
-
return async (e, t) => {
|
|
4277
|
-
let s = n.selectFrom("hooks").where("hooks.tenant_id", "=", e);
|
|
4278
|
-
t.q && (s = Ee(n, s, t.q, ["url"]));
|
|
4279
|
-
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
4280
|
-
return {
|
|
4281
|
-
hooks: a.map((d) => {
|
|
4282
|
-
const { tenant_id: u, enabled: l, synchronous: j, ...A } = d;
|
|
4283
|
-
return R({
|
|
4284
|
-
...A,
|
|
4285
|
-
enabled: !!l,
|
|
4286
|
-
synchronous: !!j
|
|
4287
|
-
});
|
|
4288
|
-
}),
|
|
4289
|
-
start: t.page * t.per_page,
|
|
4290
|
-
limit: t.per_page,
|
|
4291
|
-
length: be(o)
|
|
4292
|
-
};
|
|
4293
|
-
};
|
|
4294
|
-
}
|
|
4295
|
-
function Ma(n) {
|
|
4296
|
-
return async (e, t) => {
|
|
4297
|
-
const s = await n.selectFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).selectAll().executeTakeFirst();
|
|
4298
|
-
return s ? (s.enabled = !!s.enabled, s.synchronous = !!s.synchronous, R(s)) : null;
|
|
4299
|
-
};
|
|
4300
|
-
}
|
|
4301
|
-
function La(n) {
|
|
4302
|
-
return async (e, t) => (await n.deleteFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
4303
|
-
}
|
|
4304
|
-
function Va(n) {
|
|
4305
|
-
return async (e, t) => {
|
|
4306
|
-
const s = {
|
|
4307
|
-
hook_id: Ae(),
|
|
4308
|
-
...t,
|
|
4309
|
-
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4310
|
-
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
4311
|
-
};
|
|
4312
|
-
return await n.insertInto("hooks").values({
|
|
4313
|
-
...s,
|
|
4314
|
-
tenant_id: e
|
|
4315
|
-
}).execute(), s;
|
|
4316
|
-
};
|
|
4317
|
-
}
|
|
4318
|
-
function Ua(n) {
|
|
4319
|
-
return async (e, t, s) => {
|
|
4320
|
-
const r = {
|
|
4321
|
-
...s,
|
|
4322
|
-
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
4323
|
-
};
|
|
4324
|
-
return await n.updateTable("hooks").set(r).where("hooks.hook_id", "=", t).where("hooks.tenant_id", "=", e).execute(), !0;
|
|
4325
|
-
};
|
|
4326
|
-
}
|
|
4327
|
-
function Fa(n) {
|
|
4328
|
-
return {
|
|
4329
|
-
create: Va(n),
|
|
4330
|
-
get: Ma(n),
|
|
4331
|
-
list: Da(n),
|
|
4332
|
-
update: Ua(n),
|
|
4333
|
-
remove: La(n)
|
|
4334
|
-
};
|
|
4335
|
-
}
|
|
4336
|
-
function za(n, e) {
|
|
4337
|
-
var t = {};
|
|
4338
|
-
for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && e.indexOf(s) < 0 && (t[s] = n[s]);
|
|
4339
|
-
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
4340
|
-
for (var r = 0, s = Object.getOwnPropertySymbols(n); r < s.length; r++)
|
|
4341
|
-
e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, s[r]) && (t[s[r]] = n[s[r]]);
|
|
4342
|
-
return t;
|
|
4343
|
-
}
|
|
4344
|
-
function Ba(n, e) {
|
|
4345
|
-
var t;
|
|
4346
|
-
return ((t = n == null ? void 0 : n._def) === null || t === void 0 ? void 0 : t.typeName) === e;
|
|
4347
|
-
}
|
|
4348
|
-
function He(n, e) {
|
|
4349
|
-
const t = n.ZodType.prototype[e];
|
|
4350
|
-
n.ZodType.prototype[e] = function(...s) {
|
|
4351
|
-
const r = t.apply(this, s);
|
|
4352
|
-
return r._def.openapi = this._def.openapi, r;
|
|
4353
|
-
};
|
|
4354
|
-
}
|
|
4355
|
-
function Wa(n) {
|
|
4356
|
-
if (typeof n.ZodType.prototype.openapi < "u")
|
|
4357
|
-
return;
|
|
4358
|
-
n.ZodType.prototype.openapi = function(r, a) {
|
|
4359
|
-
var o, c, d, u, l, j;
|
|
4360
|
-
const A = typeof r == "string" ? a : r, U = A ?? {}, { param: ie } = U, Re = za(U, ["param"]), oe = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), ce = Object.assign(Object.assign(Object.assign({}, (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata), Re), !((u = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || u === void 0) && u.param || ie ? {
|
|
4361
|
-
param: Object.assign(Object.assign({}, (j = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || j === void 0 ? void 0 : j.param), ie)
|
|
4362
|
-
} : void 0), de = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(oe).length > 0 ? { _internal: oe } : void 0), Object.keys(ce).length > 0 ? { metadata: ce } : void 0) }));
|
|
4363
|
-
if (Ba(this, "ZodObject")) {
|
|
4364
|
-
const $e = this.extend;
|
|
4365
|
-
de.extend = function(...Pe) {
|
|
4366
|
-
var K, Q, H, ue, xe, Te;
|
|
4367
|
-
const Oe = $e.apply(this, Pe);
|
|
4368
|
-
return Oe._def.openapi = {
|
|
4369
|
-
_internal: {
|
|
4370
|
-
extendedFrom: !((Q = (K = this._def.openapi) === null || K === void 0 ? void 0 : K._internal) === null || Q === void 0) && Q.refId ? { refId: (ue = (H = this._def.openapi) === null || H === void 0 ? void 0 : H._internal) === null || ue === void 0 ? void 0 : ue.refId, schema: this } : (xe = this._def.openapi) === null || xe === void 0 ? void 0 : xe._internal.extendedFrom
|
|
4371
|
-
},
|
|
4372
|
-
metadata: (Te = Oe._def.openapi) === null || Te === void 0 ? void 0 : Te.metadata
|
|
4373
|
-
}, Oe;
|
|
4374
|
-
};
|
|
4375
|
-
}
|
|
4376
|
-
return de;
|
|
4377
|
-
}, He(n, "optional"), He(n, "nullable"), He(n, "default"), He(n, "transform"), He(n, "refine");
|
|
4378
|
-
const e = n.ZodObject.prototype.deepPartial;
|
|
4379
|
-
n.ZodObject.prototype.deepPartial = function() {
|
|
4380
|
-
const r = this._def.shape(), a = e.apply(this), o = a._def.shape();
|
|
4381
|
-
return Object.entries(o).forEach(([c, d]) => {
|
|
4382
|
-
var u, l;
|
|
4383
|
-
d._def.openapi = (l = (u = r[c]) === null || u === void 0 ? void 0 : u._def) === null || l === void 0 ? void 0 : l.openapi;
|
|
4384
|
-
}), a._def.openapi = void 0, a;
|
|
4385
|
-
};
|
|
4386
|
-
const t = n.ZodObject.prototype.pick;
|
|
4387
|
-
n.ZodObject.prototype.pick = function(...r) {
|
|
4388
|
-
const a = t.apply(this, r);
|
|
4389
|
-
return a._def.openapi = void 0, a;
|
|
4390
|
-
};
|
|
4391
|
-
const s = n.ZodObject.prototype.omit;
|
|
4392
|
-
n.ZodObject.prototype.omit = function(...r) {
|
|
4393
|
-
const a = s.apply(this, r);
|
|
4394
|
-
return a._def.openapi = void 0, a;
|
|
4171
|
+
const s = n.ZodObject.prototype.omit;
|
|
4172
|
+
n.ZodObject.prototype.omit = function(...r) {
|
|
4173
|
+
const a = s.apply(this, r);
|
|
4174
|
+
return a._def.openapi = void 0, a;
|
|
4395
4175
|
};
|
|
4396
4176
|
}
|
|
4397
4177
|
new Set(".\\+*[^]$()");
|
|
@@ -4498,7 +4278,7 @@ const g = C.arrayToEnum([
|
|
|
4498
4278
|
"invalid_intersection_types",
|
|
4499
4279
|
"not_multiple_of",
|
|
4500
4280
|
"not_finite"
|
|
4501
|
-
]),
|
|
4281
|
+
]), Ta = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
4502
4282
|
class V extends Error {
|
|
4503
4283
|
constructor(e) {
|
|
4504
4284
|
super(), this.issues = [], this.addIssue = (s) => {
|
|
@@ -4559,7 +4339,7 @@ class V extends Error {
|
|
|
4559
4339
|
}
|
|
4560
4340
|
}
|
|
4561
4341
|
V.create = (n) => new V(n);
|
|
4562
|
-
const
|
|
4342
|
+
const Je = (n, e) => {
|
|
4563
4343
|
let t;
|
|
4564
4344
|
switch (n.code) {
|
|
4565
4345
|
case h.invalid_type:
|
|
@@ -4615,12 +4395,12 @@ const qe = (n, e) => {
|
|
|
4615
4395
|
}
|
|
4616
4396
|
return { message: t };
|
|
4617
4397
|
};
|
|
4618
|
-
let
|
|
4619
|
-
function
|
|
4620
|
-
|
|
4398
|
+
let Mn = Je;
|
|
4399
|
+
function Oa(n) {
|
|
4400
|
+
Mn = n;
|
|
4621
4401
|
}
|
|
4622
4402
|
function Vt() {
|
|
4623
|
-
return
|
|
4403
|
+
return Mn;
|
|
4624
4404
|
}
|
|
4625
4405
|
const Ut = (n) => {
|
|
4626
4406
|
const { data: e, path: t, errorMaps: s, issueData: r } = n, a = [...t, ...r.path || []], o = {
|
|
@@ -4642,7 +4422,7 @@ const Ut = (n) => {
|
|
|
4642
4422
|
path: a,
|
|
4643
4423
|
message: c
|
|
4644
4424
|
};
|
|
4645
|
-
},
|
|
4425
|
+
}, Sa = [];
|
|
4646
4426
|
function m(n, e) {
|
|
4647
4427
|
const t = Vt(), s = Ut({
|
|
4648
4428
|
issueData: e,
|
|
@@ -4652,7 +4432,7 @@ function m(n, e) {
|
|
|
4652
4432
|
n.common.contextualErrorMap,
|
|
4653
4433
|
n.schemaErrorMap,
|
|
4654
4434
|
t,
|
|
4655
|
-
t ===
|
|
4435
|
+
t === Je ? void 0 : Je
|
|
4656
4436
|
// then global default map
|
|
4657
4437
|
].filter((r) => !!r)
|
|
4658
4438
|
});
|
|
@@ -4672,7 +4452,7 @@ class P {
|
|
|
4672
4452
|
const s = [];
|
|
4673
4453
|
for (const r of t) {
|
|
4674
4454
|
if (r.status === "aborted")
|
|
4675
|
-
return
|
|
4455
|
+
return k;
|
|
4676
4456
|
r.status === "dirty" && e.dirty(), s.push(r.value);
|
|
4677
4457
|
}
|
|
4678
4458
|
return { status: e.value, value: s };
|
|
@@ -4693,20 +4473,20 @@ class P {
|
|
|
4693
4473
|
for (const r of t) {
|
|
4694
4474
|
const { key: a, value: o } = r;
|
|
4695
4475
|
if (a.status === "aborted" || o.status === "aborted")
|
|
4696
|
-
return
|
|
4476
|
+
return k;
|
|
4697
4477
|
a.status === "dirty" && e.dirty(), o.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof o.value < "u" || r.alwaysSet) && (s[a.value] = o.value);
|
|
4698
4478
|
}
|
|
4699
4479
|
return { status: e.value, value: s };
|
|
4700
4480
|
}
|
|
4701
4481
|
}
|
|
4702
|
-
const
|
|
4482
|
+
const k = Object.freeze({
|
|
4703
4483
|
status: "aborted"
|
|
4704
|
-
}),
|
|
4484
|
+
}), Ue = (n) => ({ status: "dirty", value: n }), M = (n) => ({ status: "valid", value: n }), rn = (n) => n.status === "aborted", an = (n) => n.status === "dirty", _t = (n) => n.status === "valid", gt = (n) => typeof Promise < "u" && n instanceof Promise;
|
|
4705
4485
|
function Ft(n, e, t, s) {
|
|
4706
4486
|
if (typeof e == "function" ? n !== e || !s : !e.has(n)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4707
4487
|
return e.get(n);
|
|
4708
4488
|
}
|
|
4709
|
-
function
|
|
4489
|
+
function Ln(n, e, t, s, r) {
|
|
4710
4490
|
if (typeof e == "function" ? n !== e || !r : !e.has(n)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
4711
4491
|
return e.set(n, t), t;
|
|
4712
4492
|
}
|
|
@@ -4714,7 +4494,7 @@ var v;
|
|
|
4714
4494
|
(function(n) {
|
|
4715
4495
|
n.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, n.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
4716
4496
|
})(v || (v = {}));
|
|
4717
|
-
var
|
|
4497
|
+
var et, tt;
|
|
4718
4498
|
class te {
|
|
4719
4499
|
constructor(e, t, s, r) {
|
|
4720
4500
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = r;
|
|
@@ -4723,8 +4503,8 @@ class te {
|
|
|
4723
4503
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
4724
4504
|
}
|
|
4725
4505
|
}
|
|
4726
|
-
const
|
|
4727
|
-
if (
|
|
4506
|
+
const yn = (n, e) => {
|
|
4507
|
+
if (_t(e))
|
|
4728
4508
|
return { success: !0, data: e.value };
|
|
4729
4509
|
if (!n.common.issues.length)
|
|
4730
4510
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -4785,7 +4565,7 @@ class Z {
|
|
|
4785
4565
|
}
|
|
4786
4566
|
_parseSync(e) {
|
|
4787
4567
|
const t = this._parse(e);
|
|
4788
|
-
if (
|
|
4568
|
+
if (gt(t))
|
|
4789
4569
|
throw new Error("Synchronous parse encountered promise.");
|
|
4790
4570
|
return t;
|
|
4791
4571
|
}
|
|
@@ -4813,7 +4593,7 @@ class Z {
|
|
|
4813
4593
|
data: e,
|
|
4814
4594
|
parsedType: he(e)
|
|
4815
4595
|
}, a = this._parseSync({ data: e, path: r.path, parent: r });
|
|
4816
|
-
return
|
|
4596
|
+
return yn(r, a);
|
|
4817
4597
|
}
|
|
4818
4598
|
async parseAsync(e, t) {
|
|
4819
4599
|
const s = await this.safeParseAsync(e, t);
|
|
@@ -4833,8 +4613,8 @@ class Z {
|
|
|
4833
4613
|
parent: null,
|
|
4834
4614
|
data: e,
|
|
4835
4615
|
parsedType: he(e)
|
|
4836
|
-
}, r = this._parse({ data: e, path: s.path, parent: s }), a = await (
|
|
4837
|
-
return
|
|
4616
|
+
}, r = this._parse({ data: e, path: s.path, parent: s }), a = await (gt(r) ? r : Promise.resolve(r));
|
|
4617
|
+
return yn(s, a);
|
|
4838
4618
|
}
|
|
4839
4619
|
refine(e, t) {
|
|
4840
4620
|
const s = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
|
|
@@ -4852,7 +4632,7 @@ class Z {
|
|
|
4852
4632
|
_refinement(e) {
|
|
4853
4633
|
return new J({
|
|
4854
4634
|
schema: this,
|
|
4855
|
-
typeName:
|
|
4635
|
+
typeName: b.ZodEffects,
|
|
4856
4636
|
effect: { type: "refinement", refinement: e }
|
|
4857
4637
|
});
|
|
4858
4638
|
}
|
|
@@ -4863,7 +4643,7 @@ class Z {
|
|
|
4863
4643
|
return G.create(this, this._def);
|
|
4864
4644
|
}
|
|
4865
4645
|
nullable() {
|
|
4866
|
-
return
|
|
4646
|
+
return be.create(this, this._def);
|
|
4867
4647
|
}
|
|
4868
4648
|
nullish() {
|
|
4869
4649
|
return this.nullable().optional();
|
|
@@ -4872,10 +4652,10 @@ class Z {
|
|
|
4872
4652
|
return W.create(this, this._def);
|
|
4873
4653
|
}
|
|
4874
4654
|
promise() {
|
|
4875
|
-
return
|
|
4655
|
+
return He.create(this, this._def);
|
|
4876
4656
|
}
|
|
4877
4657
|
or(e) {
|
|
4878
|
-
return
|
|
4658
|
+
return bt.create([this, e], this._def);
|
|
4879
4659
|
}
|
|
4880
4660
|
and(e) {
|
|
4881
4661
|
return kt.create(this, e, this._def);
|
|
@@ -4884,33 +4664,33 @@ class Z {
|
|
|
4884
4664
|
return new J({
|
|
4885
4665
|
...O(this._def),
|
|
4886
4666
|
schema: this,
|
|
4887
|
-
typeName:
|
|
4667
|
+
typeName: b.ZodEffects,
|
|
4888
4668
|
effect: { type: "transform", transform: e }
|
|
4889
4669
|
});
|
|
4890
4670
|
}
|
|
4891
4671
|
default(e) {
|
|
4892
4672
|
const t = typeof e == "function" ? e : () => e;
|
|
4893
|
-
return new
|
|
4673
|
+
return new Zt({
|
|
4894
4674
|
...O(this._def),
|
|
4895
4675
|
innerType: this,
|
|
4896
4676
|
defaultValue: t,
|
|
4897
|
-
typeName:
|
|
4677
|
+
typeName: b.ZodDefault
|
|
4898
4678
|
});
|
|
4899
4679
|
}
|
|
4900
4680
|
brand() {
|
|
4901
4681
|
return new pn({
|
|
4902
|
-
typeName:
|
|
4682
|
+
typeName: b.ZodBranded,
|
|
4903
4683
|
type: this,
|
|
4904
4684
|
...O(this._def)
|
|
4905
4685
|
});
|
|
4906
4686
|
}
|
|
4907
4687
|
catch(e) {
|
|
4908
4688
|
const t = typeof e == "function" ? e : () => e;
|
|
4909
|
-
return new
|
|
4689
|
+
return new jt({
|
|
4910
4690
|
...O(this._def),
|
|
4911
4691
|
innerType: this,
|
|
4912
4692
|
catchValue: t,
|
|
4913
|
-
typeName:
|
|
4693
|
+
typeName: b.ZodCatch
|
|
4914
4694
|
});
|
|
4915
4695
|
}
|
|
4916
4696
|
describe(e) {
|
|
@@ -4921,10 +4701,10 @@ class Z {
|
|
|
4921
4701
|
});
|
|
4922
4702
|
}
|
|
4923
4703
|
pipe(e) {
|
|
4924
|
-
return
|
|
4704
|
+
return It.create(this, e);
|
|
4925
4705
|
}
|
|
4926
4706
|
readonly() {
|
|
4927
|
-
return
|
|
4707
|
+
return Nt.create(this);
|
|
4928
4708
|
}
|
|
4929
4709
|
isOptional() {
|
|
4930
4710
|
return this.safeParse(void 0).success;
|
|
@@ -4933,23 +4713,23 @@ class Z {
|
|
|
4933
4713
|
return this.safeParse(null).success;
|
|
4934
4714
|
}
|
|
4935
4715
|
}
|
|
4936
|
-
const
|
|
4716
|
+
const Za = /^c[^\s-]{8,}$/i, ja = /^[0-9a-z]+$/, Na = /^[0-9A-HJKMNP-TV-Z]{26}$/, Ca = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Ia = /^[a-z0-9_-]{21}$/i, Ea = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Aa = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ra = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
4937
4717
|
let Yt;
|
|
4938
|
-
const
|
|
4939
|
-
function
|
|
4718
|
+
const $a = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Pa = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, Da = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Vn = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Ma = new RegExp(`^${Vn}$`);
|
|
4719
|
+
function Un(n) {
|
|
4940
4720
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
4941
4721
|
return n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
4942
4722
|
}
|
|
4943
|
-
function
|
|
4944
|
-
return new RegExp(`^${
|
|
4723
|
+
function La(n) {
|
|
4724
|
+
return new RegExp(`^${Un(n)}$`);
|
|
4945
4725
|
}
|
|
4946
|
-
function
|
|
4947
|
-
let e = `${
|
|
4726
|
+
function Fn(n) {
|
|
4727
|
+
let e = `${Vn}T${Un(n)}`;
|
|
4948
4728
|
const t = [];
|
|
4949
4729
|
return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
4950
4730
|
}
|
|
4951
|
-
function
|
|
4952
|
-
return !!((e === "v4" || !e) &&
|
|
4731
|
+
function Va(n, e) {
|
|
4732
|
+
return !!((e === "v4" || !e) && $a.test(n) || (e === "v6" || !e) && Pa.test(n));
|
|
4953
4733
|
}
|
|
4954
4734
|
class z extends Z {
|
|
4955
4735
|
_parse(e) {
|
|
@@ -4959,7 +4739,7 @@ class z extends Z {
|
|
|
4959
4739
|
code: h.invalid_type,
|
|
4960
4740
|
expected: g.string,
|
|
4961
4741
|
received: a.parsedType
|
|
4962
|
-
}),
|
|
4742
|
+
}), k;
|
|
4963
4743
|
}
|
|
4964
4744
|
const s = new P();
|
|
4965
4745
|
let r;
|
|
@@ -5000,43 +4780,43 @@ class z extends Z {
|
|
|
5000
4780
|
message: a.message
|
|
5001
4781
|
}), s.dirty());
|
|
5002
4782
|
} else if (a.kind === "email")
|
|
5003
|
-
|
|
4783
|
+
Aa.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5004
4784
|
validation: "email",
|
|
5005
4785
|
code: h.invalid_string,
|
|
5006
4786
|
message: a.message
|
|
5007
4787
|
}), s.dirty());
|
|
5008
4788
|
else if (a.kind === "emoji")
|
|
5009
|
-
Yt || (Yt = new RegExp(
|
|
4789
|
+
Yt || (Yt = new RegExp(Ra, "u")), Yt.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5010
4790
|
validation: "emoji",
|
|
5011
4791
|
code: h.invalid_string,
|
|
5012
4792
|
message: a.message
|
|
5013
4793
|
}), s.dirty());
|
|
5014
4794
|
else if (a.kind === "uuid")
|
|
5015
|
-
|
|
4795
|
+
Ca.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5016
4796
|
validation: "uuid",
|
|
5017
4797
|
code: h.invalid_string,
|
|
5018
4798
|
message: a.message
|
|
5019
4799
|
}), s.dirty());
|
|
5020
4800
|
else if (a.kind === "nanoid")
|
|
5021
|
-
|
|
4801
|
+
Ia.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5022
4802
|
validation: "nanoid",
|
|
5023
4803
|
code: h.invalid_string,
|
|
5024
4804
|
message: a.message
|
|
5025
4805
|
}), s.dirty());
|
|
5026
4806
|
else if (a.kind === "cuid")
|
|
5027
|
-
|
|
4807
|
+
Za.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5028
4808
|
validation: "cuid",
|
|
5029
4809
|
code: h.invalid_string,
|
|
5030
4810
|
message: a.message
|
|
5031
4811
|
}), s.dirty());
|
|
5032
4812
|
else if (a.kind === "cuid2")
|
|
5033
|
-
|
|
4813
|
+
ja.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5034
4814
|
validation: "cuid2",
|
|
5035
4815
|
code: h.invalid_string,
|
|
5036
4816
|
message: a.message
|
|
5037
4817
|
}), s.dirty());
|
|
5038
4818
|
else if (a.kind === "ulid")
|
|
5039
|
-
|
|
4819
|
+
Na.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5040
4820
|
validation: "ulid",
|
|
5041
4821
|
code: h.invalid_string,
|
|
5042
4822
|
message: a.message
|
|
@@ -5067,27 +4847,27 @@ class z extends Z {
|
|
|
5067
4847
|
code: h.invalid_string,
|
|
5068
4848
|
validation: { endsWith: a.value },
|
|
5069
4849
|
message: a.message
|
|
5070
|
-
}), s.dirty()) : a.kind === "datetime" ?
|
|
4850
|
+
}), s.dirty()) : a.kind === "datetime" ? Fn(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5071
4851
|
code: h.invalid_string,
|
|
5072
4852
|
validation: "datetime",
|
|
5073
4853
|
message: a.message
|
|
5074
|
-
}), s.dirty()) : a.kind === "date" ?
|
|
4854
|
+
}), s.dirty()) : a.kind === "date" ? Ma.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5075
4855
|
code: h.invalid_string,
|
|
5076
4856
|
validation: "date",
|
|
5077
4857
|
message: a.message
|
|
5078
|
-
}), s.dirty()) : a.kind === "time" ?
|
|
4858
|
+
}), s.dirty()) : a.kind === "time" ? La(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5079
4859
|
code: h.invalid_string,
|
|
5080
4860
|
validation: "time",
|
|
5081
4861
|
message: a.message
|
|
5082
|
-
}), s.dirty()) : a.kind === "duration" ?
|
|
4862
|
+
}), s.dirty()) : a.kind === "duration" ? Ea.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5083
4863
|
validation: "duration",
|
|
5084
4864
|
code: h.invalid_string,
|
|
5085
4865
|
message: a.message
|
|
5086
|
-
}), s.dirty()) : a.kind === "ip" ?
|
|
4866
|
+
}), s.dirty()) : a.kind === "ip" ? Va(e.data, a.version) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5087
4867
|
validation: "ip",
|
|
5088
4868
|
code: h.invalid_string,
|
|
5089
4869
|
message: a.message
|
|
5090
|
-
}), s.dirty()) : a.kind === "base64" ?
|
|
4870
|
+
}), s.dirty()) : a.kind === "base64" ? Da.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5091
4871
|
validation: "base64",
|
|
5092
4872
|
code: h.invalid_string,
|
|
5093
4873
|
message: a.message
|
|
@@ -5304,12 +5084,12 @@ z.create = (n) => {
|
|
|
5304
5084
|
var e;
|
|
5305
5085
|
return new z({
|
|
5306
5086
|
checks: [],
|
|
5307
|
-
typeName:
|
|
5087
|
+
typeName: b.ZodString,
|
|
5308
5088
|
coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1,
|
|
5309
5089
|
...O(n)
|
|
5310
5090
|
});
|
|
5311
5091
|
};
|
|
5312
|
-
function
|
|
5092
|
+
function Ua(n, e) {
|
|
5313
5093
|
const t = (n.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, r = t > s ? t : s, a = parseInt(n.toFixed(r).replace(".", "")), o = parseInt(e.toFixed(r).replace(".", ""));
|
|
5314
5094
|
return a % o / Math.pow(10, r);
|
|
5315
5095
|
}
|
|
@@ -5324,7 +5104,7 @@ class ye extends Z {
|
|
|
5324
5104
|
code: h.invalid_type,
|
|
5325
5105
|
expected: g.number,
|
|
5326
5106
|
received: a.parsedType
|
|
5327
|
-
}),
|
|
5107
|
+
}), k;
|
|
5328
5108
|
}
|
|
5329
5109
|
let s;
|
|
5330
5110
|
const r = new P();
|
|
@@ -5348,7 +5128,7 @@ class ye extends Z {
|
|
|
5348
5128
|
inclusive: a.inclusive,
|
|
5349
5129
|
exact: !1,
|
|
5350
5130
|
message: a.message
|
|
5351
|
-
}), r.dirty()) : a.kind === "multipleOf" ?
|
|
5131
|
+
}), r.dirty()) : a.kind === "multipleOf" ? Ua(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), m(s, {
|
|
5352
5132
|
code: h.not_multiple_of,
|
|
5353
5133
|
multipleOf: a.value,
|
|
5354
5134
|
message: a.message
|
|
@@ -5481,7 +5261,7 @@ class ye extends Z {
|
|
|
5481
5261
|
}
|
|
5482
5262
|
ye.create = (n) => new ye({
|
|
5483
5263
|
checks: [],
|
|
5484
|
-
typeName:
|
|
5264
|
+
typeName: b.ZodNumber,
|
|
5485
5265
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
5486
5266
|
...O(n)
|
|
5487
5267
|
});
|
|
@@ -5496,7 +5276,7 @@ class ve extends Z {
|
|
|
5496
5276
|
code: h.invalid_type,
|
|
5497
5277
|
expected: g.bigint,
|
|
5498
5278
|
received: a.parsedType
|
|
5499
|
-
}),
|
|
5279
|
+
}), k;
|
|
5500
5280
|
}
|
|
5501
5281
|
let s;
|
|
5502
5282
|
const r = new P();
|
|
@@ -5608,12 +5388,12 @@ ve.create = (n) => {
|
|
|
5608
5388
|
var e;
|
|
5609
5389
|
return new ve({
|
|
5610
5390
|
checks: [],
|
|
5611
|
-
typeName:
|
|
5391
|
+
typeName: b.ZodBigInt,
|
|
5612
5392
|
coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1,
|
|
5613
5393
|
...O(n)
|
|
5614
5394
|
});
|
|
5615
5395
|
};
|
|
5616
|
-
class
|
|
5396
|
+
class yt extends Z {
|
|
5617
5397
|
_parse(e) {
|
|
5618
5398
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== g.boolean) {
|
|
5619
5399
|
const s = this._getOrReturnCtx(e);
|
|
@@ -5621,13 +5401,13 @@ class gt extends Z {
|
|
|
5621
5401
|
code: h.invalid_type,
|
|
5622
5402
|
expected: g.boolean,
|
|
5623
5403
|
received: s.parsedType
|
|
5624
|
-
}),
|
|
5404
|
+
}), k;
|
|
5625
5405
|
}
|
|
5626
5406
|
return M(e.data);
|
|
5627
5407
|
}
|
|
5628
5408
|
}
|
|
5629
|
-
|
|
5630
|
-
typeName:
|
|
5409
|
+
yt.create = (n) => new yt({
|
|
5410
|
+
typeName: b.ZodBoolean,
|
|
5631
5411
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
5632
5412
|
...O(n)
|
|
5633
5413
|
});
|
|
@@ -5639,13 +5419,13 @@ class Ce extends Z {
|
|
|
5639
5419
|
code: h.invalid_type,
|
|
5640
5420
|
expected: g.date,
|
|
5641
5421
|
received: a.parsedType
|
|
5642
|
-
}),
|
|
5422
|
+
}), k;
|
|
5643
5423
|
}
|
|
5644
5424
|
if (isNaN(e.data.getTime())) {
|
|
5645
5425
|
const a = this._getOrReturnCtx(e);
|
|
5646
5426
|
return m(a, {
|
|
5647
5427
|
code: h.invalid_date
|
|
5648
|
-
}),
|
|
5428
|
+
}), k;
|
|
5649
5429
|
}
|
|
5650
5430
|
const s = new P();
|
|
5651
5431
|
let r;
|
|
@@ -5706,7 +5486,7 @@ class Ce extends Z {
|
|
|
5706
5486
|
Ce.create = (n) => new Ce({
|
|
5707
5487
|
checks: [],
|
|
5708
5488
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
5709
|
-
typeName:
|
|
5489
|
+
typeName: b.ZodDate,
|
|
5710
5490
|
...O(n)
|
|
5711
5491
|
});
|
|
5712
5492
|
class zt extends Z {
|
|
@@ -5717,16 +5497,16 @@ class zt extends Z {
|
|
|
5717
5497
|
code: h.invalid_type,
|
|
5718
5498
|
expected: g.symbol,
|
|
5719
5499
|
received: s.parsedType
|
|
5720
|
-
}),
|
|
5500
|
+
}), k;
|
|
5721
5501
|
}
|
|
5722
5502
|
return M(e.data);
|
|
5723
5503
|
}
|
|
5724
5504
|
}
|
|
5725
5505
|
zt.create = (n) => new zt({
|
|
5726
|
-
typeName:
|
|
5506
|
+
typeName: b.ZodSymbol,
|
|
5727
5507
|
...O(n)
|
|
5728
5508
|
});
|
|
5729
|
-
class
|
|
5509
|
+
class vt extends Z {
|
|
5730
5510
|
_parse(e) {
|
|
5731
5511
|
if (this._getType(e) !== g.undefined) {
|
|
5732
5512
|
const s = this._getOrReturnCtx(e);
|
|
@@ -5734,16 +5514,16 @@ class yt extends Z {
|
|
|
5734
5514
|
code: h.invalid_type,
|
|
5735
5515
|
expected: g.undefined,
|
|
5736
5516
|
received: s.parsedType
|
|
5737
|
-
}),
|
|
5517
|
+
}), k;
|
|
5738
5518
|
}
|
|
5739
5519
|
return M(e.data);
|
|
5740
5520
|
}
|
|
5741
5521
|
}
|
|
5742
|
-
|
|
5743
|
-
typeName:
|
|
5522
|
+
vt.create = (n) => new vt({
|
|
5523
|
+
typeName: b.ZodUndefined,
|
|
5744
5524
|
...O(n)
|
|
5745
5525
|
});
|
|
5746
|
-
class
|
|
5526
|
+
class wt extends Z {
|
|
5747
5527
|
_parse(e) {
|
|
5748
5528
|
if (this._getType(e) !== g.null) {
|
|
5749
5529
|
const s = this._getOrReturnCtx(e);
|
|
@@ -5751,16 +5531,16 @@ class vt extends Z {
|
|
|
5751
5531
|
code: h.invalid_type,
|
|
5752
5532
|
expected: g.null,
|
|
5753
5533
|
received: s.parsedType
|
|
5754
|
-
}),
|
|
5534
|
+
}), k;
|
|
5755
5535
|
}
|
|
5756
5536
|
return M(e.data);
|
|
5757
5537
|
}
|
|
5758
5538
|
}
|
|
5759
|
-
|
|
5760
|
-
typeName:
|
|
5539
|
+
wt.create = (n) => new wt({
|
|
5540
|
+
typeName: b.ZodNull,
|
|
5761
5541
|
...O(n)
|
|
5762
5542
|
});
|
|
5763
|
-
class
|
|
5543
|
+
class Ke extends Z {
|
|
5764
5544
|
constructor() {
|
|
5765
5545
|
super(...arguments), this._any = !0;
|
|
5766
5546
|
}
|
|
@@ -5768,8 +5548,8 @@ class Je extends Z {
|
|
|
5768
5548
|
return M(e.data);
|
|
5769
5549
|
}
|
|
5770
5550
|
}
|
|
5771
|
-
|
|
5772
|
-
typeName:
|
|
5551
|
+
Ke.create = (n) => new Ke({
|
|
5552
|
+
typeName: b.ZodAny,
|
|
5773
5553
|
...O(n)
|
|
5774
5554
|
});
|
|
5775
5555
|
class Ze extends Z {
|
|
@@ -5781,7 +5561,7 @@ class Ze extends Z {
|
|
|
5781
5561
|
}
|
|
5782
5562
|
}
|
|
5783
5563
|
Ze.create = (n) => new Ze({
|
|
5784
|
-
typeName:
|
|
5564
|
+
typeName: b.ZodUnknown,
|
|
5785
5565
|
...O(n)
|
|
5786
5566
|
});
|
|
5787
5567
|
class ae extends Z {
|
|
@@ -5791,11 +5571,11 @@ class ae extends Z {
|
|
|
5791
5571
|
code: h.invalid_type,
|
|
5792
5572
|
expected: g.never,
|
|
5793
5573
|
received: t.parsedType
|
|
5794
|
-
}),
|
|
5574
|
+
}), k;
|
|
5795
5575
|
}
|
|
5796
5576
|
}
|
|
5797
5577
|
ae.create = (n) => new ae({
|
|
5798
|
-
typeName:
|
|
5578
|
+
typeName: b.ZodNever,
|
|
5799
5579
|
...O(n)
|
|
5800
5580
|
});
|
|
5801
5581
|
class Bt extends Z {
|
|
@@ -5806,13 +5586,13 @@ class Bt extends Z {
|
|
|
5806
5586
|
code: h.invalid_type,
|
|
5807
5587
|
expected: g.void,
|
|
5808
5588
|
received: s.parsedType
|
|
5809
|
-
}),
|
|
5589
|
+
}), k;
|
|
5810
5590
|
}
|
|
5811
5591
|
return M(e.data);
|
|
5812
5592
|
}
|
|
5813
5593
|
}
|
|
5814
5594
|
Bt.create = (n) => new Bt({
|
|
5815
|
-
typeName:
|
|
5595
|
+
typeName: b.ZodVoid,
|
|
5816
5596
|
...O(n)
|
|
5817
5597
|
});
|
|
5818
5598
|
class W extends Z {
|
|
@@ -5823,7 +5603,7 @@ class W extends Z {
|
|
|
5823
5603
|
code: h.invalid_type,
|
|
5824
5604
|
expected: g.array,
|
|
5825
5605
|
received: t.parsedType
|
|
5826
|
-
}),
|
|
5606
|
+
}), k;
|
|
5827
5607
|
if (r.exactLength !== null) {
|
|
5828
5608
|
const o = t.data.length > r.exactLength.value, c = t.data.length < r.exactLength.value;
|
|
5829
5609
|
(o || c) && (m(t, {
|
|
@@ -5885,15 +5665,15 @@ W.create = (n, e) => new W({
|
|
|
5885
5665
|
minLength: null,
|
|
5886
5666
|
maxLength: null,
|
|
5887
5667
|
exactLength: null,
|
|
5888
|
-
typeName:
|
|
5668
|
+
typeName: b.ZodArray,
|
|
5889
5669
|
...O(e)
|
|
5890
5670
|
});
|
|
5891
|
-
function
|
|
5671
|
+
function Ve(n) {
|
|
5892
5672
|
if (n instanceof E) {
|
|
5893
5673
|
const e = {};
|
|
5894
5674
|
for (const t in n.shape) {
|
|
5895
5675
|
const s = n.shape[t];
|
|
5896
|
-
e[t] = G.create(
|
|
5676
|
+
e[t] = G.create(Ve(s));
|
|
5897
5677
|
}
|
|
5898
5678
|
return new E({
|
|
5899
5679
|
...n._def,
|
|
@@ -5901,8 +5681,8 @@ function Le(n) {
|
|
|
5901
5681
|
});
|
|
5902
5682
|
} else return n instanceof W ? new W({
|
|
5903
5683
|
...n._def,
|
|
5904
|
-
type:
|
|
5905
|
-
}) : n instanceof G ? G.create(
|
|
5684
|
+
type: Ve(n.element)
|
|
5685
|
+
}) : n instanceof G ? G.create(Ve(n.unwrap())) : n instanceof be ? be.create(Ve(n.unwrap())) : n instanceof ne ? ne.create(n.items.map((e) => Ve(e))) : n;
|
|
5906
5686
|
}
|
|
5907
5687
|
class E extends Z {
|
|
5908
5688
|
constructor() {
|
|
@@ -5921,7 +5701,7 @@ class E extends Z {
|
|
|
5921
5701
|
code: h.invalid_type,
|
|
5922
5702
|
expected: g.object,
|
|
5923
5703
|
received: u.parsedType
|
|
5924
|
-
}),
|
|
5704
|
+
}), k;
|
|
5925
5705
|
}
|
|
5926
5706
|
const { status: s, ctx: r } = this._processInputParams(e), { shape: a, keys: o } = this._getCached(), c = [];
|
|
5927
5707
|
if (!(this._def.catchall instanceof ae && this._def.unknownKeys === "strip"))
|
|
@@ -6048,7 +5828,7 @@ class E extends Z {
|
|
|
6048
5828
|
...this._def.shape(),
|
|
6049
5829
|
...e._def.shape()
|
|
6050
5830
|
}),
|
|
6051
|
-
typeName:
|
|
5831
|
+
typeName: b.ZodObject
|
|
6052
5832
|
});
|
|
6053
5833
|
}
|
|
6054
5834
|
// merge<
|
|
@@ -6138,7 +5918,7 @@ class E extends Z {
|
|
|
6138
5918
|
* @deprecated
|
|
6139
5919
|
*/
|
|
6140
5920
|
deepPartial() {
|
|
6141
|
-
return
|
|
5921
|
+
return Ve(this);
|
|
6142
5922
|
}
|
|
6143
5923
|
partial(e) {
|
|
6144
5924
|
const t = {};
|
|
@@ -6167,31 +5947,31 @@ class E extends Z {
|
|
|
6167
5947
|
});
|
|
6168
5948
|
}
|
|
6169
5949
|
keyof() {
|
|
6170
|
-
return
|
|
5950
|
+
return zn(C.objectKeys(this.shape));
|
|
6171
5951
|
}
|
|
6172
5952
|
}
|
|
6173
5953
|
E.create = (n, e) => new E({
|
|
6174
5954
|
shape: () => n,
|
|
6175
5955
|
unknownKeys: "strip",
|
|
6176
5956
|
catchall: ae.create(),
|
|
6177
|
-
typeName:
|
|
5957
|
+
typeName: b.ZodObject,
|
|
6178
5958
|
...O(e)
|
|
6179
5959
|
});
|
|
6180
5960
|
E.strictCreate = (n, e) => new E({
|
|
6181
5961
|
shape: () => n,
|
|
6182
5962
|
unknownKeys: "strict",
|
|
6183
5963
|
catchall: ae.create(),
|
|
6184
|
-
typeName:
|
|
5964
|
+
typeName: b.ZodObject,
|
|
6185
5965
|
...O(e)
|
|
6186
5966
|
});
|
|
6187
5967
|
E.lazycreate = (n, e) => new E({
|
|
6188
5968
|
shape: n,
|
|
6189
5969
|
unknownKeys: "strip",
|
|
6190
5970
|
catchall: ae.create(),
|
|
6191
|
-
typeName:
|
|
5971
|
+
typeName: b.ZodObject,
|
|
6192
5972
|
...O(e)
|
|
6193
5973
|
});
|
|
6194
|
-
class
|
|
5974
|
+
class bt extends Z {
|
|
6195
5975
|
_parse(e) {
|
|
6196
5976
|
const { ctx: t } = this._processInputParams(e), s = this._def.options;
|
|
6197
5977
|
function r(a) {
|
|
@@ -6205,7 +5985,7 @@ class wt extends Z {
|
|
|
6205
5985
|
return m(t, {
|
|
6206
5986
|
code: h.invalid_union,
|
|
6207
5987
|
unionErrors: o
|
|
6208
|
-
}),
|
|
5988
|
+
}), k;
|
|
6209
5989
|
}
|
|
6210
5990
|
if (t.common.async)
|
|
6211
5991
|
return Promise.all(s.map(async (a) => {
|
|
@@ -6252,19 +6032,19 @@ class wt extends Z {
|
|
|
6252
6032
|
return m(t, {
|
|
6253
6033
|
code: h.invalid_union,
|
|
6254
6034
|
unionErrors: c
|
|
6255
|
-
}),
|
|
6035
|
+
}), k;
|
|
6256
6036
|
}
|
|
6257
6037
|
}
|
|
6258
6038
|
get options() {
|
|
6259
6039
|
return this._def.options;
|
|
6260
6040
|
}
|
|
6261
6041
|
}
|
|
6262
|
-
|
|
6042
|
+
bt.create = (n, e) => new bt({
|
|
6263
6043
|
options: n,
|
|
6264
|
-
typeName:
|
|
6044
|
+
typeName: b.ZodUnion,
|
|
6265
6045
|
...O(e)
|
|
6266
6046
|
});
|
|
6267
|
-
const se = (n) => n instanceof
|
|
6047
|
+
const se = (n) => n instanceof Tt ? se(n.schema) : n instanceof J ? se(n.innerType()) : n instanceof Ot ? [n.value] : n instanceof we ? n.options : n instanceof St ? C.objectValues(n.enum) : n instanceof Zt ? se(n._def.innerType) : n instanceof vt ? [void 0] : n instanceof wt ? [null] : n instanceof G ? [void 0, ...se(n.unwrap())] : n instanceof be ? [null, ...se(n.unwrap())] : n instanceof pn || n instanceof Nt ? se(n.unwrap()) : n instanceof jt ? se(n._def.innerType) : [];
|
|
6268
6048
|
class Kt extends Z {
|
|
6269
6049
|
_parse(e) {
|
|
6270
6050
|
const { ctx: t } = this._processInputParams(e);
|
|
@@ -6273,7 +6053,7 @@ class Kt extends Z {
|
|
|
6273
6053
|
code: h.invalid_type,
|
|
6274
6054
|
expected: g.object,
|
|
6275
6055
|
received: t.parsedType
|
|
6276
|
-
}),
|
|
6056
|
+
}), k;
|
|
6277
6057
|
const s = this.discriminator, r = t.data[s], a = this.optionsMap.get(r);
|
|
6278
6058
|
return a ? t.common.async ? a._parseAsync({
|
|
6279
6059
|
data: t.data,
|
|
@@ -6287,7 +6067,7 @@ class Kt extends Z {
|
|
|
6287
6067
|
code: h.invalid_union_discriminator,
|
|
6288
6068
|
options: Array.from(this.optionsMap.keys()),
|
|
6289
6069
|
path: [s]
|
|
6290
|
-
}),
|
|
6070
|
+
}), k);
|
|
6291
6071
|
}
|
|
6292
6072
|
get discriminator() {
|
|
6293
6073
|
return this._def.discriminator;
|
|
@@ -6319,7 +6099,7 @@ class Kt extends Z {
|
|
|
6319
6099
|
}
|
|
6320
6100
|
}
|
|
6321
6101
|
return new Kt({
|
|
6322
|
-
typeName:
|
|
6102
|
+
typeName: b.ZodDiscriminatedUnion,
|
|
6323
6103
|
discriminator: e,
|
|
6324
6104
|
options: t,
|
|
6325
6105
|
optionsMap: r,
|
|
@@ -6357,11 +6137,11 @@ class kt extends Z {
|
|
|
6357
6137
|
_parse(e) {
|
|
6358
6138
|
const { status: t, ctx: s } = this._processInputParams(e), r = (a, o) => {
|
|
6359
6139
|
if (rn(a) || rn(o))
|
|
6360
|
-
return
|
|
6140
|
+
return k;
|
|
6361
6141
|
const c = on(a.value, o.value);
|
|
6362
6142
|
return c.valid ? ((an(a) || an(o)) && t.dirty(), { status: t.value, value: c.data }) : (m(s, {
|
|
6363
6143
|
code: h.invalid_intersection_types
|
|
6364
|
-
}),
|
|
6144
|
+
}), k);
|
|
6365
6145
|
};
|
|
6366
6146
|
return s.common.async ? Promise.all([
|
|
6367
6147
|
this._def.left._parseAsync({
|
|
@@ -6388,7 +6168,7 @@ class kt extends Z {
|
|
|
6388
6168
|
kt.create = (n, e, t) => new kt({
|
|
6389
6169
|
left: n,
|
|
6390
6170
|
right: e,
|
|
6391
|
-
typeName:
|
|
6171
|
+
typeName: b.ZodIntersection,
|
|
6392
6172
|
...O(t)
|
|
6393
6173
|
});
|
|
6394
6174
|
class ne extends Z {
|
|
@@ -6399,7 +6179,7 @@ class ne extends Z {
|
|
|
6399
6179
|
code: h.invalid_type,
|
|
6400
6180
|
expected: g.array,
|
|
6401
6181
|
received: s.parsedType
|
|
6402
|
-
}),
|
|
6182
|
+
}), k;
|
|
6403
6183
|
if (s.data.length < this._def.items.length)
|
|
6404
6184
|
return m(s, {
|
|
6405
6185
|
code: h.too_small,
|
|
@@ -6407,7 +6187,7 @@ class ne extends Z {
|
|
|
6407
6187
|
inclusive: !0,
|
|
6408
6188
|
exact: !1,
|
|
6409
6189
|
type: "array"
|
|
6410
|
-
}),
|
|
6190
|
+
}), k;
|
|
6411
6191
|
!this._def.rest && s.data.length > this._def.items.length && (m(s, {
|
|
6412
6192
|
code: h.too_big,
|
|
6413
6193
|
maximum: this._def.items.length,
|
|
@@ -6436,12 +6216,12 @@ ne.create = (n, e) => {
|
|
|
6436
6216
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
6437
6217
|
return new ne({
|
|
6438
6218
|
items: n,
|
|
6439
|
-
typeName:
|
|
6219
|
+
typeName: b.ZodTuple,
|
|
6440
6220
|
rest: null,
|
|
6441
6221
|
...O(e)
|
|
6442
6222
|
});
|
|
6443
6223
|
};
|
|
6444
|
-
class
|
|
6224
|
+
class xt extends Z {
|
|
6445
6225
|
get keySchema() {
|
|
6446
6226
|
return this._def.keyType;
|
|
6447
6227
|
}
|
|
@@ -6455,7 +6235,7 @@ class bt extends Z {
|
|
|
6455
6235
|
code: h.invalid_type,
|
|
6456
6236
|
expected: g.object,
|
|
6457
6237
|
received: s.parsedType
|
|
6458
|
-
}),
|
|
6238
|
+
}), k;
|
|
6459
6239
|
const r = [], a = this._def.keyType, o = this._def.valueType;
|
|
6460
6240
|
for (const c in s.data)
|
|
6461
6241
|
r.push({
|
|
@@ -6469,15 +6249,15 @@ class bt extends Z {
|
|
|
6469
6249
|
return this._def.valueType;
|
|
6470
6250
|
}
|
|
6471
6251
|
static create(e, t, s) {
|
|
6472
|
-
return t instanceof Z ? new
|
|
6252
|
+
return t instanceof Z ? new xt({
|
|
6473
6253
|
keyType: e,
|
|
6474
6254
|
valueType: t,
|
|
6475
|
-
typeName:
|
|
6255
|
+
typeName: b.ZodRecord,
|
|
6476
6256
|
...O(s)
|
|
6477
|
-
}) : new
|
|
6257
|
+
}) : new xt({
|
|
6478
6258
|
keyType: z.create(),
|
|
6479
6259
|
valueType: e,
|
|
6480
|
-
typeName:
|
|
6260
|
+
typeName: b.ZodRecord,
|
|
6481
6261
|
...O(t)
|
|
6482
6262
|
});
|
|
6483
6263
|
}
|
|
@@ -6496,7 +6276,7 @@ class Wt extends Z {
|
|
|
6496
6276
|
code: h.invalid_type,
|
|
6497
6277
|
expected: g.map,
|
|
6498
6278
|
received: s.parsedType
|
|
6499
|
-
}),
|
|
6279
|
+
}), k;
|
|
6500
6280
|
const r = this._def.keyType, a = this._def.valueType, o = [...s.data.entries()].map(([c, d], u) => ({
|
|
6501
6281
|
key: r._parse(new te(s, c, s.path, [u, "key"])),
|
|
6502
6282
|
value: a._parse(new te(s, d, s.path, [u, "value"]))
|
|
@@ -6507,7 +6287,7 @@ class Wt extends Z {
|
|
|
6507
6287
|
for (const d of o) {
|
|
6508
6288
|
const u = await d.key, l = await d.value;
|
|
6509
6289
|
if (u.status === "aborted" || l.status === "aborted")
|
|
6510
|
-
return
|
|
6290
|
+
return k;
|
|
6511
6291
|
(u.status === "dirty" || l.status === "dirty") && t.dirty(), c.set(u.value, l.value);
|
|
6512
6292
|
}
|
|
6513
6293
|
return { status: t.value, value: c };
|
|
@@ -6517,7 +6297,7 @@ class Wt extends Z {
|
|
|
6517
6297
|
for (const d of o) {
|
|
6518
6298
|
const u = d.key, l = d.value;
|
|
6519
6299
|
if (u.status === "aborted" || l.status === "aborted")
|
|
6520
|
-
return
|
|
6300
|
+
return k;
|
|
6521
6301
|
(u.status === "dirty" || l.status === "dirty") && t.dirty(), c.set(u.value, l.value);
|
|
6522
6302
|
}
|
|
6523
6303
|
return { status: t.value, value: c };
|
|
@@ -6527,7 +6307,7 @@ class Wt extends Z {
|
|
|
6527
6307
|
Wt.create = (n, e, t) => new Wt({
|
|
6528
6308
|
valueType: e,
|
|
6529
6309
|
keyType: n,
|
|
6530
|
-
typeName:
|
|
6310
|
+
typeName: b.ZodMap,
|
|
6531
6311
|
...O(t)
|
|
6532
6312
|
});
|
|
6533
6313
|
class Ie extends Z {
|
|
@@ -6538,7 +6318,7 @@ class Ie extends Z {
|
|
|
6538
6318
|
code: h.invalid_type,
|
|
6539
6319
|
expected: g.set,
|
|
6540
6320
|
received: s.parsedType
|
|
6541
|
-
}),
|
|
6321
|
+
}), k;
|
|
6542
6322
|
const r = this._def;
|
|
6543
6323
|
r.minSize !== null && s.data.size < r.minSize.value && (m(s, {
|
|
6544
6324
|
code: h.too_small,
|
|
@@ -6560,7 +6340,7 @@ class Ie extends Z {
|
|
|
6560
6340
|
const u = /* @__PURE__ */ new Set();
|
|
6561
6341
|
for (const l of d) {
|
|
6562
6342
|
if (l.status === "aborted")
|
|
6563
|
-
return
|
|
6343
|
+
return k;
|
|
6564
6344
|
l.status === "dirty" && t.dirty(), u.add(l.value);
|
|
6565
6345
|
}
|
|
6566
6346
|
return { status: t.value, value: u };
|
|
@@ -6591,10 +6371,10 @@ Ie.create = (n, e) => new Ie({
|
|
|
6591
6371
|
valueType: n,
|
|
6592
6372
|
minSize: null,
|
|
6593
6373
|
maxSize: null,
|
|
6594
|
-
typeName:
|
|
6374
|
+
typeName: b.ZodSet,
|
|
6595
6375
|
...O(e)
|
|
6596
6376
|
});
|
|
6597
|
-
class
|
|
6377
|
+
class ze extends Z {
|
|
6598
6378
|
constructor() {
|
|
6599
6379
|
super(...arguments), this.validate = this.implement;
|
|
6600
6380
|
}
|
|
@@ -6605,7 +6385,7 @@ class Fe extends Z {
|
|
|
6605
6385
|
code: h.invalid_type,
|
|
6606
6386
|
expected: g.function,
|
|
6607
6387
|
received: t.parsedType
|
|
6608
|
-
}),
|
|
6388
|
+
}), k;
|
|
6609
6389
|
function s(c, d) {
|
|
6610
6390
|
return Ut({
|
|
6611
6391
|
data: c,
|
|
@@ -6614,7 +6394,7 @@ class Fe extends Z {
|
|
|
6614
6394
|
t.common.contextualErrorMap,
|
|
6615
6395
|
t.schemaErrorMap,
|
|
6616
6396
|
Vt(),
|
|
6617
|
-
|
|
6397
|
+
Je
|
|
6618
6398
|
].filter((u) => !!u),
|
|
6619
6399
|
issueData: {
|
|
6620
6400
|
code: h.invalid_arguments,
|
|
@@ -6630,7 +6410,7 @@ class Fe extends Z {
|
|
|
6630
6410
|
t.common.contextualErrorMap,
|
|
6631
6411
|
t.schemaErrorMap,
|
|
6632
6412
|
Vt(),
|
|
6633
|
-
|
|
6413
|
+
Je
|
|
6634
6414
|
].filter((u) => !!u),
|
|
6635
6415
|
issueData: {
|
|
6636
6416
|
code: h.invalid_return_type,
|
|
@@ -6639,7 +6419,7 @@ class Fe extends Z {
|
|
|
6639
6419
|
});
|
|
6640
6420
|
}
|
|
6641
6421
|
const a = { errorMap: t.common.contextualErrorMap }, o = t.data;
|
|
6642
|
-
if (this._def.returns instanceof
|
|
6422
|
+
if (this._def.returns instanceof He) {
|
|
6643
6423
|
const c = this;
|
|
6644
6424
|
return M(async function(...d) {
|
|
6645
6425
|
const u = new V([]), l = await c._def.args.parseAsync(d, a).catch((U) => {
|
|
@@ -6669,13 +6449,13 @@ class Fe extends Z {
|
|
|
6669
6449
|
return this._def.returns;
|
|
6670
6450
|
}
|
|
6671
6451
|
args(...e) {
|
|
6672
|
-
return new
|
|
6452
|
+
return new ze({
|
|
6673
6453
|
...this._def,
|
|
6674
6454
|
args: ne.create(e).rest(Ze.create())
|
|
6675
6455
|
});
|
|
6676
6456
|
}
|
|
6677
6457
|
returns(e) {
|
|
6678
|
-
return new
|
|
6458
|
+
return new ze({
|
|
6679
6459
|
...this._def,
|
|
6680
6460
|
returns: e
|
|
6681
6461
|
});
|
|
@@ -6687,15 +6467,15 @@ class Fe extends Z {
|
|
|
6687
6467
|
return this.parse(e);
|
|
6688
6468
|
}
|
|
6689
6469
|
static create(e, t, s) {
|
|
6690
|
-
return new
|
|
6470
|
+
return new ze({
|
|
6691
6471
|
args: e || ne.create([]).rest(Ze.create()),
|
|
6692
6472
|
returns: t || Ze.create(),
|
|
6693
|
-
typeName:
|
|
6473
|
+
typeName: b.ZodFunction,
|
|
6694
6474
|
...O(s)
|
|
6695
6475
|
});
|
|
6696
6476
|
}
|
|
6697
6477
|
}
|
|
6698
|
-
class
|
|
6478
|
+
class Tt extends Z {
|
|
6699
6479
|
get schema() {
|
|
6700
6480
|
return this._def.getter();
|
|
6701
6481
|
}
|
|
@@ -6704,12 +6484,12 @@ class xt extends Z {
|
|
|
6704
6484
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
6705
6485
|
}
|
|
6706
6486
|
}
|
|
6707
|
-
|
|
6487
|
+
Tt.create = (n, e) => new Tt({
|
|
6708
6488
|
getter: n,
|
|
6709
|
-
typeName:
|
|
6489
|
+
typeName: b.ZodLazy,
|
|
6710
6490
|
...O(e)
|
|
6711
6491
|
});
|
|
6712
|
-
class
|
|
6492
|
+
class Ot extends Z {
|
|
6713
6493
|
_parse(e) {
|
|
6714
6494
|
if (e.data !== this._def.value) {
|
|
6715
6495
|
const t = this._getOrReturnCtx(e);
|
|
@@ -6717,7 +6497,7 @@ class Tt extends Z {
|
|
|
6717
6497
|
received: t.data,
|
|
6718
6498
|
code: h.invalid_literal,
|
|
6719
6499
|
expected: this._def.value
|
|
6720
|
-
}),
|
|
6500
|
+
}), k;
|
|
6721
6501
|
}
|
|
6722
6502
|
return { status: "valid", value: e.data };
|
|
6723
6503
|
}
|
|
@@ -6725,21 +6505,21 @@ class Tt extends Z {
|
|
|
6725
6505
|
return this._def.value;
|
|
6726
6506
|
}
|
|
6727
6507
|
}
|
|
6728
|
-
|
|
6508
|
+
Ot.create = (n, e) => new Ot({
|
|
6729
6509
|
value: n,
|
|
6730
|
-
typeName:
|
|
6510
|
+
typeName: b.ZodLiteral,
|
|
6731
6511
|
...O(e)
|
|
6732
6512
|
});
|
|
6733
|
-
function
|
|
6513
|
+
function zn(n, e) {
|
|
6734
6514
|
return new we({
|
|
6735
6515
|
values: n,
|
|
6736
|
-
typeName:
|
|
6516
|
+
typeName: b.ZodEnum,
|
|
6737
6517
|
...O(e)
|
|
6738
6518
|
});
|
|
6739
6519
|
}
|
|
6740
6520
|
class we extends Z {
|
|
6741
6521
|
constructor() {
|
|
6742
|
-
super(...arguments),
|
|
6522
|
+
super(...arguments), et.set(this, void 0);
|
|
6743
6523
|
}
|
|
6744
6524
|
_parse(e) {
|
|
6745
6525
|
if (typeof e.data != "string") {
|
|
@@ -6748,15 +6528,15 @@ class we extends Z {
|
|
|
6748
6528
|
expected: C.joinValues(s),
|
|
6749
6529
|
received: t.parsedType,
|
|
6750
6530
|
code: h.invalid_type
|
|
6751
|
-
}),
|
|
6531
|
+
}), k;
|
|
6752
6532
|
}
|
|
6753
|
-
if (Ft(this,
|
|
6533
|
+
if (Ft(this, et) || Ln(this, et, new Set(this._def.values)), !Ft(this, et).has(e.data)) {
|
|
6754
6534
|
const t = this._getOrReturnCtx(e), s = this._def.values;
|
|
6755
6535
|
return m(t, {
|
|
6756
6536
|
received: t.data,
|
|
6757
6537
|
code: h.invalid_enum_value,
|
|
6758
6538
|
options: s
|
|
6759
|
-
}),
|
|
6539
|
+
}), k;
|
|
6760
6540
|
}
|
|
6761
6541
|
return M(e.data);
|
|
6762
6542
|
}
|
|
@@ -6794,11 +6574,11 @@ class we extends Z {
|
|
|
6794
6574
|
});
|
|
6795
6575
|
}
|
|
6796
6576
|
}
|
|
6797
|
-
|
|
6798
|
-
we.create =
|
|
6799
|
-
class
|
|
6577
|
+
et = /* @__PURE__ */ new WeakMap();
|
|
6578
|
+
we.create = zn;
|
|
6579
|
+
class St extends Z {
|
|
6800
6580
|
constructor() {
|
|
6801
|
-
super(...arguments),
|
|
6581
|
+
super(...arguments), tt.set(this, void 0);
|
|
6802
6582
|
}
|
|
6803
6583
|
_parse(e) {
|
|
6804
6584
|
const t = C.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
|
|
@@ -6808,15 +6588,15 @@ class Ot extends Z {
|
|
|
6808
6588
|
expected: C.joinValues(r),
|
|
6809
6589
|
received: s.parsedType,
|
|
6810
6590
|
code: h.invalid_type
|
|
6811
|
-
}),
|
|
6591
|
+
}), k;
|
|
6812
6592
|
}
|
|
6813
|
-
if (Ft(this,
|
|
6593
|
+
if (Ft(this, tt) || Ln(this, tt, new Set(C.getValidEnumValues(this._def.values))), !Ft(this, tt).has(e.data)) {
|
|
6814
6594
|
const r = C.objectValues(t);
|
|
6815
6595
|
return m(s, {
|
|
6816
6596
|
received: s.data,
|
|
6817
6597
|
code: h.invalid_enum_value,
|
|
6818
6598
|
options: r
|
|
6819
|
-
}),
|
|
6599
|
+
}), k;
|
|
6820
6600
|
}
|
|
6821
6601
|
return M(e.data);
|
|
6822
6602
|
}
|
|
@@ -6824,13 +6604,13 @@ class Ot extends Z {
|
|
|
6824
6604
|
return this._def.values;
|
|
6825
6605
|
}
|
|
6826
6606
|
}
|
|
6827
|
-
|
|
6828
|
-
|
|
6607
|
+
tt = /* @__PURE__ */ new WeakMap();
|
|
6608
|
+
St.create = (n, e) => new St({
|
|
6829
6609
|
values: n,
|
|
6830
|
-
typeName:
|
|
6610
|
+
typeName: b.ZodNativeEnum,
|
|
6831
6611
|
...O(e)
|
|
6832
6612
|
});
|
|
6833
|
-
class
|
|
6613
|
+
class He extends Z {
|
|
6834
6614
|
unwrap() {
|
|
6835
6615
|
return this._def.type;
|
|
6836
6616
|
}
|
|
@@ -6841,7 +6621,7 @@ class Ke extends Z {
|
|
|
6841
6621
|
code: h.invalid_type,
|
|
6842
6622
|
expected: g.promise,
|
|
6843
6623
|
received: t.parsedType
|
|
6844
|
-
}),
|
|
6624
|
+
}), k;
|
|
6845
6625
|
const s = t.parsedType === g.promise ? t.data : Promise.resolve(t.data);
|
|
6846
6626
|
return M(s.then((r) => this._def.type.parseAsync(r, {
|
|
6847
6627
|
path: t.path,
|
|
@@ -6849,9 +6629,9 @@ class Ke extends Z {
|
|
|
6849
6629
|
})));
|
|
6850
6630
|
}
|
|
6851
6631
|
}
|
|
6852
|
-
|
|
6632
|
+
He.create = (n, e) => new He({
|
|
6853
6633
|
type: n,
|
|
6854
|
-
typeName:
|
|
6634
|
+
typeName: b.ZodPromise,
|
|
6855
6635
|
...O(e)
|
|
6856
6636
|
});
|
|
6857
6637
|
class J extends Z {
|
|
@@ -6859,7 +6639,7 @@ class J extends Z {
|
|
|
6859
6639
|
return this._def.schema;
|
|
6860
6640
|
}
|
|
6861
6641
|
sourceType() {
|
|
6862
|
-
return this._def.schema._def.typeName ===
|
|
6642
|
+
return this._def.schema._def.typeName === b.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
6863
6643
|
}
|
|
6864
6644
|
_parse(e) {
|
|
6865
6645
|
const { status: t, ctx: s } = this._processInputParams(e), r = this._def.effect || null, a = {
|
|
@@ -6875,23 +6655,23 @@ class J extends Z {
|
|
|
6875
6655
|
if (s.common.async)
|
|
6876
6656
|
return Promise.resolve(o).then(async (c) => {
|
|
6877
6657
|
if (t.value === "aborted")
|
|
6878
|
-
return
|
|
6658
|
+
return k;
|
|
6879
6659
|
const d = await this._def.schema._parseAsync({
|
|
6880
6660
|
data: c,
|
|
6881
6661
|
path: s.path,
|
|
6882
6662
|
parent: s
|
|
6883
6663
|
});
|
|
6884
|
-
return d.status === "aborted" ?
|
|
6664
|
+
return d.status === "aborted" ? k : d.status === "dirty" || t.value === "dirty" ? Ue(d.value) : d;
|
|
6885
6665
|
});
|
|
6886
6666
|
{
|
|
6887
6667
|
if (t.value === "aborted")
|
|
6888
|
-
return
|
|
6668
|
+
return k;
|
|
6889
6669
|
const c = this._def.schema._parseSync({
|
|
6890
6670
|
data: o,
|
|
6891
6671
|
path: s.path,
|
|
6892
6672
|
parent: s
|
|
6893
6673
|
});
|
|
6894
|
-
return c.status === "aborted" ?
|
|
6674
|
+
return c.status === "aborted" ? k : c.status === "dirty" || t.value === "dirty" ? Ue(c.value) : c;
|
|
6895
6675
|
}
|
|
6896
6676
|
}
|
|
6897
6677
|
if (r.type === "refinement") {
|
|
@@ -6909,9 +6689,9 @@ class J extends Z {
|
|
|
6909
6689
|
path: s.path,
|
|
6910
6690
|
parent: s
|
|
6911
6691
|
});
|
|
6912
|
-
return c.status === "aborted" ?
|
|
6692
|
+
return c.status === "aborted" ? k : (c.status === "dirty" && t.dirty(), o(c.value), { status: t.value, value: c.value });
|
|
6913
6693
|
} else
|
|
6914
|
-
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((c) => c.status === "aborted" ?
|
|
6694
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((c) => c.status === "aborted" ? k : (c.status === "dirty" && t.dirty(), o(c.value).then(() => ({ status: t.value, value: c.value }))));
|
|
6915
6695
|
}
|
|
6916
6696
|
if (r.type === "transform")
|
|
6917
6697
|
if (s.common.async === !1) {
|
|
@@ -6920,27 +6700,27 @@ class J extends Z {
|
|
|
6920
6700
|
path: s.path,
|
|
6921
6701
|
parent: s
|
|
6922
6702
|
});
|
|
6923
|
-
if (!
|
|
6703
|
+
if (!_t(o))
|
|
6924
6704
|
return o;
|
|
6925
6705
|
const c = r.transform(o.value, a);
|
|
6926
6706
|
if (c instanceof Promise)
|
|
6927
6707
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
6928
6708
|
return { status: t.value, value: c };
|
|
6929
6709
|
} else
|
|
6930
|
-
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) =>
|
|
6710
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => _t(o) ? Promise.resolve(r.transform(o.value, a)).then((c) => ({ status: t.value, value: c })) : o);
|
|
6931
6711
|
C.assertNever(r);
|
|
6932
6712
|
}
|
|
6933
6713
|
}
|
|
6934
6714
|
J.create = (n, e, t) => new J({
|
|
6935
6715
|
schema: n,
|
|
6936
|
-
typeName:
|
|
6716
|
+
typeName: b.ZodEffects,
|
|
6937
6717
|
effect: e,
|
|
6938
6718
|
...O(t)
|
|
6939
6719
|
});
|
|
6940
6720
|
J.createWithPreprocess = (n, e, t) => new J({
|
|
6941
6721
|
schema: e,
|
|
6942
6722
|
effect: { type: "preprocess", transform: n },
|
|
6943
|
-
typeName:
|
|
6723
|
+
typeName: b.ZodEffects,
|
|
6944
6724
|
...O(t)
|
|
6945
6725
|
});
|
|
6946
6726
|
class G extends Z {
|
|
@@ -6953,10 +6733,10 @@ class G extends Z {
|
|
|
6953
6733
|
}
|
|
6954
6734
|
G.create = (n, e) => new G({
|
|
6955
6735
|
innerType: n,
|
|
6956
|
-
typeName:
|
|
6736
|
+
typeName: b.ZodOptional,
|
|
6957
6737
|
...O(e)
|
|
6958
6738
|
});
|
|
6959
|
-
class
|
|
6739
|
+
class be extends Z {
|
|
6960
6740
|
_parse(e) {
|
|
6961
6741
|
return this._getType(e) === g.null ? M(null) : this._def.innerType._parse(e);
|
|
6962
6742
|
}
|
|
@@ -6964,12 +6744,12 @@ class ke extends Z {
|
|
|
6964
6744
|
return this._def.innerType;
|
|
6965
6745
|
}
|
|
6966
6746
|
}
|
|
6967
|
-
|
|
6747
|
+
be.create = (n, e) => new be({
|
|
6968
6748
|
innerType: n,
|
|
6969
|
-
typeName:
|
|
6749
|
+
typeName: b.ZodNullable,
|
|
6970
6750
|
...O(e)
|
|
6971
6751
|
});
|
|
6972
|
-
class
|
|
6752
|
+
class Zt extends Z {
|
|
6973
6753
|
_parse(e) {
|
|
6974
6754
|
const { ctx: t } = this._processInputParams(e);
|
|
6975
6755
|
let s = t.data;
|
|
@@ -6983,13 +6763,13 @@ class St extends Z {
|
|
|
6983
6763
|
return this._def.innerType;
|
|
6984
6764
|
}
|
|
6985
6765
|
}
|
|
6986
|
-
|
|
6766
|
+
Zt.create = (n, e) => new Zt({
|
|
6987
6767
|
innerType: n,
|
|
6988
|
-
typeName:
|
|
6768
|
+
typeName: b.ZodDefault,
|
|
6989
6769
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
6990
6770
|
...O(e)
|
|
6991
6771
|
});
|
|
6992
|
-
class
|
|
6772
|
+
class jt extends Z {
|
|
6993
6773
|
_parse(e) {
|
|
6994
6774
|
const { ctx: t } = this._processInputParams(e), s = {
|
|
6995
6775
|
...t,
|
|
@@ -7004,7 +6784,7 @@ class Zt extends Z {
|
|
|
7004
6784
|
...s
|
|
7005
6785
|
}
|
|
7006
6786
|
});
|
|
7007
|
-
return
|
|
6787
|
+
return gt(r) ? r.then((a) => ({
|
|
7008
6788
|
status: "valid",
|
|
7009
6789
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
7010
6790
|
get error() {
|
|
@@ -7026,9 +6806,9 @@ class Zt extends Z {
|
|
|
7026
6806
|
return this._def.innerType;
|
|
7027
6807
|
}
|
|
7028
6808
|
}
|
|
7029
|
-
|
|
6809
|
+
jt.create = (n, e) => new jt({
|
|
7030
6810
|
innerType: n,
|
|
7031
|
-
typeName:
|
|
6811
|
+
typeName: b.ZodCatch,
|
|
7032
6812
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
7033
6813
|
...O(e)
|
|
7034
6814
|
});
|
|
@@ -7040,16 +6820,16 @@ class qt extends Z {
|
|
|
7040
6820
|
code: h.invalid_type,
|
|
7041
6821
|
expected: g.nan,
|
|
7042
6822
|
received: s.parsedType
|
|
7043
|
-
}),
|
|
6823
|
+
}), k;
|
|
7044
6824
|
}
|
|
7045
6825
|
return { status: "valid", value: e.data };
|
|
7046
6826
|
}
|
|
7047
6827
|
}
|
|
7048
6828
|
qt.create = (n) => new qt({
|
|
7049
|
-
typeName:
|
|
6829
|
+
typeName: b.ZodNaN,
|
|
7050
6830
|
...O(n)
|
|
7051
6831
|
});
|
|
7052
|
-
const
|
|
6832
|
+
const Fa = Symbol("zod_brand");
|
|
7053
6833
|
class pn extends Z {
|
|
7054
6834
|
_parse(e) {
|
|
7055
6835
|
const { ctx: t } = this._processInputParams(e), s = t.data;
|
|
@@ -7063,7 +6843,7 @@ class pn extends Z {
|
|
|
7063
6843
|
return this._def.type;
|
|
7064
6844
|
}
|
|
7065
6845
|
}
|
|
7066
|
-
class
|
|
6846
|
+
class It extends Z {
|
|
7067
6847
|
_parse(e) {
|
|
7068
6848
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
7069
6849
|
if (s.common.async)
|
|
@@ -7073,7 +6853,7 @@ class Ct extends Z {
|
|
|
7073
6853
|
path: s.path,
|
|
7074
6854
|
parent: s
|
|
7075
6855
|
});
|
|
7076
|
-
return a.status === "aborted" ?
|
|
6856
|
+
return a.status === "aborted" ? k : a.status === "dirty" ? (t.dirty(), Ue(a.value)) : this._def.out._parseAsync({
|
|
7077
6857
|
data: a.value,
|
|
7078
6858
|
path: s.path,
|
|
7079
6859
|
parent: s
|
|
@@ -7085,7 +6865,7 @@ class Ct extends Z {
|
|
|
7085
6865
|
path: s.path,
|
|
7086
6866
|
parent: s
|
|
7087
6867
|
});
|
|
7088
|
-
return r.status === "aborted" ?
|
|
6868
|
+
return r.status === "aborted" ? k : r.status === "dirty" ? (t.dirty(), {
|
|
7089
6869
|
status: "dirty",
|
|
7090
6870
|
value: r.value
|
|
7091
6871
|
}) : this._def.out._parseSync({
|
|
@@ -7096,71 +6876,71 @@ class Ct extends Z {
|
|
|
7096
6876
|
}
|
|
7097
6877
|
}
|
|
7098
6878
|
static create(e, t) {
|
|
7099
|
-
return new
|
|
6879
|
+
return new It({
|
|
7100
6880
|
in: e,
|
|
7101
6881
|
out: t,
|
|
7102
|
-
typeName:
|
|
6882
|
+
typeName: b.ZodPipeline
|
|
7103
6883
|
});
|
|
7104
6884
|
}
|
|
7105
6885
|
}
|
|
7106
|
-
class
|
|
6886
|
+
class Nt extends Z {
|
|
7107
6887
|
_parse(e) {
|
|
7108
|
-
const t = this._def.innerType._parse(e), s = (r) => (
|
|
7109
|
-
return
|
|
6888
|
+
const t = this._def.innerType._parse(e), s = (r) => (_t(r) && (r.value = Object.freeze(r.value)), r);
|
|
6889
|
+
return gt(t) ? t.then((r) => s(r)) : s(t);
|
|
7110
6890
|
}
|
|
7111
6891
|
unwrap() {
|
|
7112
6892
|
return this._def.innerType;
|
|
7113
6893
|
}
|
|
7114
6894
|
}
|
|
7115
|
-
|
|
6895
|
+
Nt.create = (n, e) => new Nt({
|
|
7116
6896
|
innerType: n,
|
|
7117
|
-
typeName:
|
|
6897
|
+
typeName: b.ZodReadonly,
|
|
7118
6898
|
...O(e)
|
|
7119
6899
|
});
|
|
7120
|
-
function
|
|
7121
|
-
return n ?
|
|
6900
|
+
function Bn(n, e = {}, t) {
|
|
6901
|
+
return n ? Ke.create().superRefine((s, r) => {
|
|
7122
6902
|
var a, o;
|
|
7123
6903
|
if (!n(s)) {
|
|
7124
6904
|
const c = typeof e == "function" ? e(s) : typeof e == "string" ? { message: e } : e, d = (o = (a = c.fatal) !== null && a !== void 0 ? a : t) !== null && o !== void 0 ? o : !0, u = typeof c == "string" ? { message: c } : c;
|
|
7125
6905
|
r.addIssue({ code: "custom", ...u, fatal: d });
|
|
7126
6906
|
}
|
|
7127
|
-
}) :
|
|
6907
|
+
}) : Ke.create();
|
|
7128
6908
|
}
|
|
7129
|
-
const
|
|
6909
|
+
const za = {
|
|
7130
6910
|
object: E.lazycreate
|
|
7131
6911
|
};
|
|
7132
|
-
var
|
|
6912
|
+
var b;
|
|
7133
6913
|
(function(n) {
|
|
7134
6914
|
n.ZodString = "ZodString", n.ZodNumber = "ZodNumber", n.ZodNaN = "ZodNaN", n.ZodBigInt = "ZodBigInt", n.ZodBoolean = "ZodBoolean", n.ZodDate = "ZodDate", n.ZodSymbol = "ZodSymbol", n.ZodUndefined = "ZodUndefined", n.ZodNull = "ZodNull", n.ZodAny = "ZodAny", n.ZodUnknown = "ZodUnknown", n.ZodNever = "ZodNever", n.ZodVoid = "ZodVoid", n.ZodArray = "ZodArray", n.ZodObject = "ZodObject", n.ZodUnion = "ZodUnion", n.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", n.ZodIntersection = "ZodIntersection", n.ZodTuple = "ZodTuple", n.ZodRecord = "ZodRecord", n.ZodMap = "ZodMap", n.ZodSet = "ZodSet", n.ZodFunction = "ZodFunction", n.ZodLazy = "ZodLazy", n.ZodLiteral = "ZodLiteral", n.ZodEnum = "ZodEnum", n.ZodEffects = "ZodEffects", n.ZodNativeEnum = "ZodNativeEnum", n.ZodOptional = "ZodOptional", n.ZodNullable = "ZodNullable", n.ZodDefault = "ZodDefault", n.ZodCatch = "ZodCatch", n.ZodPromise = "ZodPromise", n.ZodBranded = "ZodBranded", n.ZodPipeline = "ZodPipeline", n.ZodReadonly = "ZodReadonly";
|
|
7135
|
-
})(
|
|
7136
|
-
const
|
|
6915
|
+
})(b || (b = {}));
|
|
6916
|
+
const Ba = (n, e = {
|
|
7137
6917
|
message: `Input not instance of ${n.name}`
|
|
7138
|
-
}) =>
|
|
6918
|
+
}) => Bn((t) => t instanceof n, e), Wn = z.create, qn = ye.create, Wa = qt.create, qa = ve.create, Jn = yt.create, Ja = Ce.create, Ka = zt.create, Ha = vt.create, Qa = wt.create, Ya = Ke.create, Ga = Ze.create, Xa = ae.create, ei = Bt.create, ti = W.create, ni = E.create, si = E.strictCreate, ri = bt.create, ai = Kt.create, ii = kt.create, oi = ne.create, ci = xt.create, di = Wt.create, ui = Ie.create, li = ze.create, pi = Tt.create, hi = Ot.create, fi = we.create, mi = St.create, _i = He.create, vn = J.create, gi = G.create, yi = be.create, vi = J.createWithPreprocess, wi = It.create, bi = () => Wn().optional(), ki = () => qn().optional(), xi = () => Jn().optional(), Ti = {
|
|
7139
6919
|
string: (n) => z.create({ ...n, coerce: !0 }),
|
|
7140
6920
|
number: (n) => ye.create({ ...n, coerce: !0 }),
|
|
7141
|
-
boolean: (n) =>
|
|
6921
|
+
boolean: (n) => yt.create({
|
|
7142
6922
|
...n,
|
|
7143
6923
|
coerce: !0
|
|
7144
6924
|
}),
|
|
7145
6925
|
bigint: (n) => ve.create({ ...n, coerce: !0 }),
|
|
7146
6926
|
date: (n) => Ce.create({ ...n, coerce: !0 })
|
|
7147
|
-
},
|
|
7148
|
-
var
|
|
6927
|
+
}, Oi = k;
|
|
6928
|
+
var Si = /* @__PURE__ */ Object.freeze({
|
|
7149
6929
|
__proto__: null,
|
|
7150
|
-
defaultErrorMap:
|
|
7151
|
-
setErrorMap:
|
|
6930
|
+
defaultErrorMap: Je,
|
|
6931
|
+
setErrorMap: Oa,
|
|
7152
6932
|
getErrorMap: Vt,
|
|
7153
6933
|
makeIssue: Ut,
|
|
7154
|
-
EMPTY_PATH:
|
|
6934
|
+
EMPTY_PATH: Sa,
|
|
7155
6935
|
addIssueToContext: m,
|
|
7156
6936
|
ParseStatus: P,
|
|
7157
|
-
INVALID:
|
|
7158
|
-
DIRTY:
|
|
6937
|
+
INVALID: k,
|
|
6938
|
+
DIRTY: Ue,
|
|
7159
6939
|
OK: M,
|
|
7160
6940
|
isAborted: rn,
|
|
7161
6941
|
isDirty: an,
|
|
7162
|
-
isValid:
|
|
7163
|
-
isAsync:
|
|
6942
|
+
isValid: _t,
|
|
6943
|
+
isAsync: gt,
|
|
7164
6944
|
get util() {
|
|
7165
6945
|
return C;
|
|
7166
6946
|
},
|
|
@@ -7170,107 +6950,107 @@ var Ki = /* @__PURE__ */ Object.freeze({
|
|
|
7170
6950
|
ZodParsedType: g,
|
|
7171
6951
|
getParsedType: he,
|
|
7172
6952
|
ZodType: Z,
|
|
7173
|
-
datetimeRegex:
|
|
6953
|
+
datetimeRegex: Fn,
|
|
7174
6954
|
ZodString: z,
|
|
7175
6955
|
ZodNumber: ye,
|
|
7176
6956
|
ZodBigInt: ve,
|
|
7177
|
-
ZodBoolean:
|
|
6957
|
+
ZodBoolean: yt,
|
|
7178
6958
|
ZodDate: Ce,
|
|
7179
6959
|
ZodSymbol: zt,
|
|
7180
|
-
ZodUndefined:
|
|
7181
|
-
ZodNull:
|
|
7182
|
-
ZodAny:
|
|
6960
|
+
ZodUndefined: vt,
|
|
6961
|
+
ZodNull: wt,
|
|
6962
|
+
ZodAny: Ke,
|
|
7183
6963
|
ZodUnknown: Ze,
|
|
7184
6964
|
ZodNever: ae,
|
|
7185
6965
|
ZodVoid: Bt,
|
|
7186
6966
|
ZodArray: W,
|
|
7187
6967
|
ZodObject: E,
|
|
7188
|
-
ZodUnion:
|
|
6968
|
+
ZodUnion: bt,
|
|
7189
6969
|
ZodDiscriminatedUnion: Kt,
|
|
7190
6970
|
ZodIntersection: kt,
|
|
7191
6971
|
ZodTuple: ne,
|
|
7192
|
-
ZodRecord:
|
|
6972
|
+
ZodRecord: xt,
|
|
7193
6973
|
ZodMap: Wt,
|
|
7194
6974
|
ZodSet: Ie,
|
|
7195
|
-
ZodFunction:
|
|
7196
|
-
ZodLazy:
|
|
7197
|
-
ZodLiteral:
|
|
6975
|
+
ZodFunction: ze,
|
|
6976
|
+
ZodLazy: Tt,
|
|
6977
|
+
ZodLiteral: Ot,
|
|
7198
6978
|
ZodEnum: we,
|
|
7199
|
-
ZodNativeEnum:
|
|
7200
|
-
ZodPromise:
|
|
6979
|
+
ZodNativeEnum: St,
|
|
6980
|
+
ZodPromise: He,
|
|
7201
6981
|
ZodEffects: J,
|
|
7202
6982
|
ZodTransformer: J,
|
|
7203
6983
|
ZodOptional: G,
|
|
7204
|
-
ZodNullable:
|
|
7205
|
-
ZodDefault:
|
|
7206
|
-
ZodCatch:
|
|
6984
|
+
ZodNullable: be,
|
|
6985
|
+
ZodDefault: Zt,
|
|
6986
|
+
ZodCatch: jt,
|
|
7207
6987
|
ZodNaN: qt,
|
|
7208
|
-
BRAND:
|
|
6988
|
+
BRAND: Fa,
|
|
7209
6989
|
ZodBranded: pn,
|
|
7210
|
-
ZodPipeline:
|
|
7211
|
-
ZodReadonly:
|
|
7212
|
-
custom:
|
|
6990
|
+
ZodPipeline: It,
|
|
6991
|
+
ZodReadonly: Nt,
|
|
6992
|
+
custom: Bn,
|
|
7213
6993
|
Schema: Z,
|
|
7214
6994
|
ZodSchema: Z,
|
|
7215
|
-
late:
|
|
6995
|
+
late: za,
|
|
7216
6996
|
get ZodFirstPartyTypeKind() {
|
|
7217
|
-
return
|
|
6997
|
+
return b;
|
|
7218
6998
|
},
|
|
7219
|
-
coerce:
|
|
7220
|
-
any:
|
|
7221
|
-
array:
|
|
7222
|
-
bigint:
|
|
7223
|
-
boolean:
|
|
7224
|
-
date:
|
|
7225
|
-
discriminatedUnion:
|
|
7226
|
-
effect:
|
|
7227
|
-
enum:
|
|
7228
|
-
function:
|
|
7229
|
-
instanceof:
|
|
7230
|
-
intersection:
|
|
7231
|
-
lazy:
|
|
7232
|
-
literal:
|
|
7233
|
-
map:
|
|
7234
|
-
nan:
|
|
7235
|
-
nativeEnum:
|
|
7236
|
-
never:
|
|
7237
|
-
null:
|
|
7238
|
-
nullable:
|
|
7239
|
-
number:
|
|
7240
|
-
object:
|
|
7241
|
-
oboolean:
|
|
7242
|
-
onumber:
|
|
7243
|
-
optional:
|
|
7244
|
-
ostring:
|
|
7245
|
-
pipeline:
|
|
7246
|
-
preprocess:
|
|
7247
|
-
promise:
|
|
7248
|
-
record:
|
|
7249
|
-
set:
|
|
7250
|
-
strictObject:
|
|
7251
|
-
string:
|
|
7252
|
-
symbol:
|
|
7253
|
-
transformer:
|
|
7254
|
-
tuple:
|
|
7255
|
-
undefined:
|
|
7256
|
-
union:
|
|
7257
|
-
unknown:
|
|
7258
|
-
void:
|
|
7259
|
-
NEVER:
|
|
6999
|
+
coerce: Ti,
|
|
7000
|
+
any: Ya,
|
|
7001
|
+
array: ti,
|
|
7002
|
+
bigint: qa,
|
|
7003
|
+
boolean: Jn,
|
|
7004
|
+
date: Ja,
|
|
7005
|
+
discriminatedUnion: ai,
|
|
7006
|
+
effect: vn,
|
|
7007
|
+
enum: fi,
|
|
7008
|
+
function: li,
|
|
7009
|
+
instanceof: Ba,
|
|
7010
|
+
intersection: ii,
|
|
7011
|
+
lazy: pi,
|
|
7012
|
+
literal: hi,
|
|
7013
|
+
map: di,
|
|
7014
|
+
nan: Wa,
|
|
7015
|
+
nativeEnum: mi,
|
|
7016
|
+
never: Xa,
|
|
7017
|
+
null: Qa,
|
|
7018
|
+
nullable: yi,
|
|
7019
|
+
number: qn,
|
|
7020
|
+
object: ni,
|
|
7021
|
+
oboolean: xi,
|
|
7022
|
+
onumber: ki,
|
|
7023
|
+
optional: gi,
|
|
7024
|
+
ostring: bi,
|
|
7025
|
+
pipeline: wi,
|
|
7026
|
+
preprocess: vi,
|
|
7027
|
+
promise: _i,
|
|
7028
|
+
record: ci,
|
|
7029
|
+
set: ui,
|
|
7030
|
+
strictObject: si,
|
|
7031
|
+
string: Wn,
|
|
7032
|
+
symbol: Ka,
|
|
7033
|
+
transformer: vn,
|
|
7034
|
+
tuple: oi,
|
|
7035
|
+
undefined: Ha,
|
|
7036
|
+
union: ri,
|
|
7037
|
+
unknown: Ga,
|
|
7038
|
+
void: ei,
|
|
7039
|
+
NEVER: Oi,
|
|
7260
7040
|
ZodIssueCode: h,
|
|
7261
|
-
quotelessJson:
|
|
7041
|
+
quotelessJson: Ta,
|
|
7262
7042
|
ZodError: V
|
|
7263
7043
|
});
|
|
7264
|
-
|
|
7265
|
-
function
|
|
7044
|
+
xa(Si);
|
|
7045
|
+
function Re(n, e = "", t = {}) {
|
|
7266
7046
|
for (let s in n)
|
|
7267
7047
|
if (Object.prototype.hasOwnProperty.call(n, s)) {
|
|
7268
7048
|
const r = e ? `${e}_${s}` : s;
|
|
7269
|
-
typeof n[s] == "object" && n[s] !== null && !Array.isArray(n[s]) ?
|
|
7049
|
+
typeof n[s] == "object" && n[s] !== null && !Array.isArray(n[s]) ? Re(n[s], r, t) : t[r] = n[s];
|
|
7270
7050
|
}
|
|
7271
7051
|
return t;
|
|
7272
7052
|
}
|
|
7273
|
-
function
|
|
7053
|
+
function hn(n, e) {
|
|
7274
7054
|
const t = {};
|
|
7275
7055
|
for (const [s, r] of Object.entries(n)) {
|
|
7276
7056
|
const a = e.find(
|
|
@@ -7288,7 +7068,262 @@ function Qi(n, e) {
|
|
|
7288
7068
|
}
|
|
7289
7069
|
return t;
|
|
7290
7070
|
}
|
|
7071
|
+
function Zi(n) {
|
|
7072
|
+
return async (e, t) => {
|
|
7073
|
+
const s = {
|
|
7074
|
+
id: Ae(),
|
|
7075
|
+
...t,
|
|
7076
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7077
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7078
|
+
};
|
|
7079
|
+
return await n.insertInto("connections").values({ ...Re(s), tenant_id: e }).execute(), s;
|
|
7080
|
+
};
|
|
7081
|
+
}
|
|
7082
|
+
function ji(n) {
|
|
7083
|
+
return async (e, t) => {
|
|
7084
|
+
let s = n.selectFrom("connections").where("connections.tenant_id", "=", e);
|
|
7085
|
+
t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
|
|
7086
|
+
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
7087
|
+
return {
|
|
7088
|
+
connections: a.map(
|
|
7089
|
+
(c) => R(hn(c, ["options"]))
|
|
7090
|
+
),
|
|
7091
|
+
start: t.page * t.per_page,
|
|
7092
|
+
limit: t.per_page,
|
|
7093
|
+
length: ke(o)
|
|
7094
|
+
};
|
|
7095
|
+
};
|
|
7096
|
+
}
|
|
7097
|
+
function Ni(n) {
|
|
7098
|
+
return async (e, t) => (await n.deleteFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
7099
|
+
}
|
|
7100
|
+
function Ci(n) {
|
|
7101
|
+
return async (e, t) => {
|
|
7102
|
+
const s = await n.selectFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).selectAll().executeTakeFirst();
|
|
7103
|
+
return s ? R(hn(s, ["options"])) : null;
|
|
7104
|
+
};
|
|
7105
|
+
}
|
|
7106
|
+
function Ii(n) {
|
|
7107
|
+
return async (e, t, s) => {
|
|
7108
|
+
const r = {
|
|
7109
|
+
...s,
|
|
7110
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7111
|
+
};
|
|
7112
|
+
return await n.updateTable("connections").set(Re(r)).where("connections.id", "=", t).where("connections.tenant_id", "=", e).execute(), !0;
|
|
7113
|
+
};
|
|
7114
|
+
}
|
|
7115
|
+
function Ei(n) {
|
|
7116
|
+
return {
|
|
7117
|
+
create: Zi(n),
|
|
7118
|
+
get: Ci(n),
|
|
7119
|
+
list: ji(n),
|
|
7120
|
+
remove: Ni(n),
|
|
7121
|
+
update: Ii(n)
|
|
7122
|
+
};
|
|
7123
|
+
}
|
|
7124
|
+
function Ai(n) {
|
|
7125
|
+
return {
|
|
7126
|
+
get: async (e) => {
|
|
7127
|
+
const t = await n.selectFrom("applications").selectAll().where("id", "=", e).executeTakeFirst();
|
|
7128
|
+
if (!t)
|
|
7129
|
+
return null;
|
|
7130
|
+
const s = await n.selectFrom("tenants").selectAll().where("id", "=", t.tenant_id).executeTakeFirst();
|
|
7131
|
+
if (!s)
|
|
7132
|
+
throw new Gt(404, { message: "Tenant not found" });
|
|
7133
|
+
const r = await n.selectFrom("connections").where("tenant_id", "=", t.tenant_id).selectAll().execute(), a = await n.selectFrom("domains").where("tenant_id", "=", t.tenant_id).selectAll().execute();
|
|
7134
|
+
return {
|
|
7135
|
+
...t,
|
|
7136
|
+
connections: r.map(
|
|
7137
|
+
(c) => Rn.parse(R(c))
|
|
7138
|
+
),
|
|
7139
|
+
domains: a,
|
|
7140
|
+
addons: t.addons ? JSON.parse(t.addons) : {},
|
|
7141
|
+
callbacks: t.callbacks ? JSON.parse(t.callbacks) : [],
|
|
7142
|
+
allowed_origins: t.allowed_origins ? JSON.parse(t.allowed_origins) : [],
|
|
7143
|
+
web_origins: t.web_origins ? JSON.parse(t.web_origins) : [],
|
|
7144
|
+
allowed_logout_urls: t.allowed_logout_urls ? JSON.parse(t.allowed_logout_urls) : [],
|
|
7145
|
+
tenant: R(s),
|
|
7146
|
+
// this is really an integer in the database
|
|
7147
|
+
disable_sign_ups: !!t.disable_sign_ups
|
|
7148
|
+
};
|
|
7149
|
+
}
|
|
7150
|
+
};
|
|
7151
|
+
}
|
|
7152
|
+
function Ri(n) {
|
|
7153
|
+
return async () => await n.selectFrom("keys").where("revoked_at", "is", null).selectAll().execute();
|
|
7154
|
+
}
|
|
7155
|
+
function $i(n) {
|
|
7156
|
+
return async (e) => {
|
|
7157
|
+
await n.insertInto("keys").values({ ...e, created_at: (/* @__PURE__ */ new Date()).toDateString() }).execute();
|
|
7158
|
+
};
|
|
7159
|
+
}
|
|
7160
|
+
function Pi(n) {
|
|
7161
|
+
return async (e, t) => !!(await n.updateTable("keys").set(t).where("kid", "=", e).execute()).length;
|
|
7162
|
+
}
|
|
7163
|
+
function Di(n) {
|
|
7164
|
+
return {
|
|
7165
|
+
create: $i(n),
|
|
7166
|
+
list: Ri(n),
|
|
7167
|
+
update: Pi(n)
|
|
7168
|
+
};
|
|
7169
|
+
}
|
|
7170
|
+
function Mi(n) {
|
|
7171
|
+
return async (e, t) => {
|
|
7172
|
+
const s = {
|
|
7173
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7174
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7175
|
+
tenant_id: e,
|
|
7176
|
+
id: Ae(),
|
|
7177
|
+
...t
|
|
7178
|
+
};
|
|
7179
|
+
return await n.insertInto("domains").values(s).execute(), s;
|
|
7180
|
+
};
|
|
7181
|
+
}
|
|
7182
|
+
function Li(n) {
|
|
7183
|
+
return async (e, t) => {
|
|
7184
|
+
let s = n.selectFrom("domains").where("domains.tenant_id", "=", e);
|
|
7185
|
+
t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
|
|
7186
|
+
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
7187
|
+
return {
|
|
7188
|
+
domains: a,
|
|
7189
|
+
start: t.page * t.per_page,
|
|
7190
|
+
limit: t.per_page,
|
|
7191
|
+
length: ke(o)
|
|
7192
|
+
};
|
|
7193
|
+
};
|
|
7194
|
+
}
|
|
7195
|
+
function Vi(n) {
|
|
7196
|
+
return {
|
|
7197
|
+
create: Mi(n),
|
|
7198
|
+
list: Li(n)
|
|
7199
|
+
};
|
|
7200
|
+
}
|
|
7201
|
+
function Ui(n) {
|
|
7202
|
+
return async (e) => {
|
|
7203
|
+
const [t] = await n.selectFrom("branding").where("branding.tenant_id", "=", e).selectAll().execute();
|
|
7204
|
+
if (!t)
|
|
7205
|
+
return null;
|
|
7206
|
+
const {
|
|
7207
|
+
tenant_id: s,
|
|
7208
|
+
colors_primary: r,
|
|
7209
|
+
colors_page_background_type: a,
|
|
7210
|
+
colors_page_background_start: o,
|
|
7211
|
+
colors_page_background_end: c,
|
|
7212
|
+
colors_page_background_angle_dev: d,
|
|
7213
|
+
font_url: u,
|
|
7214
|
+
...l
|
|
7215
|
+
} = t;
|
|
7216
|
+
return R({
|
|
7217
|
+
...l,
|
|
7218
|
+
colors: {
|
|
7219
|
+
primary: r,
|
|
7220
|
+
page_background: {
|
|
7221
|
+
type: a,
|
|
7222
|
+
start: o,
|
|
7223
|
+
end: c,
|
|
7224
|
+
angle_deg: d
|
|
7225
|
+
}
|
|
7226
|
+
},
|
|
7227
|
+
font: u ? { url: u } : void 0
|
|
7228
|
+
});
|
|
7229
|
+
};
|
|
7230
|
+
}
|
|
7231
|
+
function Fi(n) {
|
|
7232
|
+
return async (e, t) => {
|
|
7233
|
+
var o, c, d, u, l, j, A, U, ie, $e, oe, ce, de, Pe, De, K, H, Q;
|
|
7234
|
+
const { colors: s, font: r, ...a } = t;
|
|
7235
|
+
try {
|
|
7236
|
+
await n.insertInto("branding").values({
|
|
7237
|
+
...a,
|
|
7238
|
+
colors_primary: s == null ? void 0 : s.primary,
|
|
7239
|
+
colors_page_background_type: (c = (o = t.colors) == null ? void 0 : o.page_background) == null ? void 0 : c.type,
|
|
7240
|
+
colors_page_background_start: (u = (d = t.colors) == null ? void 0 : d.page_background) == null ? void 0 : u.start,
|
|
7241
|
+
colors_page_background_end: (j = (l = t.colors) == null ? void 0 : l.page_background) == null ? void 0 : j.end,
|
|
7242
|
+
colors_page_background_angle_dev: (U = (A = t.colors) == null ? void 0 : A.page_background) == null ? void 0 : U.angle_deg,
|
|
7243
|
+
font_url: (ie = t.font) == null ? void 0 : ie.url,
|
|
7244
|
+
tenant_id: e
|
|
7245
|
+
}).execute();
|
|
7246
|
+
} catch {
|
|
7247
|
+
await n.updateTable("branding").set({
|
|
7248
|
+
...a,
|
|
7249
|
+
colors_primary: s == null ? void 0 : s.primary,
|
|
7250
|
+
colors_page_background_type: (oe = ($e = t.colors) == null ? void 0 : $e.page_background) == null ? void 0 : oe.type,
|
|
7251
|
+
colors_page_background_start: (de = (ce = t.colors) == null ? void 0 : ce.page_background) == null ? void 0 : de.start,
|
|
7252
|
+
colors_page_background_end: (De = (Pe = t.colors) == null ? void 0 : Pe.page_background) == null ? void 0 : De.end,
|
|
7253
|
+
colors_page_background_angle_dev: (H = (K = t.colors) == null ? void 0 : K.page_background) == null ? void 0 : H.angle_deg,
|
|
7254
|
+
font_url: (Q = t.font) == null ? void 0 : Q.url
|
|
7255
|
+
}).where("tenant_id", "=", e).execute();
|
|
7256
|
+
}
|
|
7257
|
+
};
|
|
7258
|
+
}
|
|
7259
|
+
function zi(n) {
|
|
7260
|
+
return {
|
|
7261
|
+
get: Ui(n),
|
|
7262
|
+
set: Fi(n)
|
|
7263
|
+
};
|
|
7264
|
+
}
|
|
7265
|
+
function Bi(n) {
|
|
7266
|
+
return async (e, t) => {
|
|
7267
|
+
let s = n.selectFrom("hooks").where("hooks.tenant_id", "=", e);
|
|
7268
|
+
t.q && (s = Ee(n, s, t.q, ["url"]));
|
|
7269
|
+
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
7270
|
+
return {
|
|
7271
|
+
hooks: a.map((d) => {
|
|
7272
|
+
const { tenant_id: u, enabled: l, synchronous: j, ...A } = d;
|
|
7273
|
+
return R({
|
|
7274
|
+
...A,
|
|
7275
|
+
enabled: !!l,
|
|
7276
|
+
synchronous: !!j
|
|
7277
|
+
});
|
|
7278
|
+
}),
|
|
7279
|
+
start: t.page * t.per_page,
|
|
7280
|
+
limit: t.per_page,
|
|
7281
|
+
length: ke(o)
|
|
7282
|
+
};
|
|
7283
|
+
};
|
|
7284
|
+
}
|
|
7285
|
+
function Wi(n) {
|
|
7286
|
+
return async (e, t) => {
|
|
7287
|
+
const s = await n.selectFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).selectAll().executeTakeFirst();
|
|
7288
|
+
return s ? (s.enabled = !!s.enabled, s.synchronous = !!s.synchronous, R(s)) : null;
|
|
7289
|
+
};
|
|
7290
|
+
}
|
|
7291
|
+
function qi(n) {
|
|
7292
|
+
return async (e, t) => (await n.deleteFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
|
|
7293
|
+
}
|
|
7294
|
+
function Ji(n) {
|
|
7295
|
+
return async (e, t) => {
|
|
7296
|
+
const s = {
|
|
7297
|
+
hook_id: Ae(),
|
|
7298
|
+
...t,
|
|
7299
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7300
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7301
|
+
};
|
|
7302
|
+
return await n.insertInto("hooks").values({
|
|
7303
|
+
...s,
|
|
7304
|
+
tenant_id: e
|
|
7305
|
+
}).execute(), s;
|
|
7306
|
+
};
|
|
7307
|
+
}
|
|
7308
|
+
function Ki(n) {
|
|
7309
|
+
return async (e, t, s) => {
|
|
7310
|
+
const r = {
|
|
7311
|
+
...s,
|
|
7312
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7313
|
+
};
|
|
7314
|
+
return await n.updateTable("hooks").set(r).where("hooks.hook_id", "=", t).where("hooks.tenant_id", "=", e).execute(), !0;
|
|
7315
|
+
};
|
|
7316
|
+
}
|
|
7291
7317
|
function Hi(n) {
|
|
7318
|
+
return {
|
|
7319
|
+
create: Ji(n),
|
|
7320
|
+
get: Wi(n),
|
|
7321
|
+
list: Bi(n),
|
|
7322
|
+
update: Ki(n),
|
|
7323
|
+
remove: qi(n)
|
|
7324
|
+
};
|
|
7325
|
+
}
|
|
7326
|
+
function Qi(n) {
|
|
7292
7327
|
return async (e, t) => {
|
|
7293
7328
|
const s = {
|
|
7294
7329
|
themeId: Ae(),
|
|
@@ -7296,7 +7331,7 @@ function Hi(n) {
|
|
|
7296
7331
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7297
7332
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7298
7333
|
};
|
|
7299
|
-
return await n.insertInto("themes").values({ ...
|
|
7334
|
+
return await n.insertInto("themes").values({ ...Re(s), tenant_id: e }).execute(), s;
|
|
7300
7335
|
};
|
|
7301
7336
|
}
|
|
7302
7337
|
function Yi(n) {
|
|
@@ -7310,7 +7345,7 @@ function Gi(n) {
|
|
|
7310
7345
|
}
|
|
7311
7346
|
function Xi(n) {
|
|
7312
7347
|
return async (e, t, s) => {
|
|
7313
|
-
const r =
|
|
7348
|
+
const r = Re({
|
|
7314
7349
|
...s,
|
|
7315
7350
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7316
7351
|
});
|
|
@@ -7319,7 +7354,7 @@ function Xi(n) {
|
|
|
7319
7354
|
}
|
|
7320
7355
|
function eo(n) {
|
|
7321
7356
|
return {
|
|
7322
|
-
create:
|
|
7357
|
+
create: Qi(n),
|
|
7323
7358
|
get: Gi(n),
|
|
7324
7359
|
remove: Yi(n),
|
|
7325
7360
|
update: Xi(n)
|
|
@@ -7328,8 +7363,8 @@ function eo(n) {
|
|
|
7328
7363
|
function to(n) {
|
|
7329
7364
|
return async (e, t) => {
|
|
7330
7365
|
const s = (/* @__PURE__ */ new Date()).toISOString(), r = await n.selectFrom("logins").where("logins.expires_at", ">", s).where("logins.login_id", "=", t).selectAll().executeTakeFirst();
|
|
7331
|
-
return r ?
|
|
7332
|
-
|
|
7366
|
+
return r ? wr.parse(
|
|
7367
|
+
hn(R(r), ["authParams"])
|
|
7333
7368
|
) : null;
|
|
7334
7369
|
};
|
|
7335
7370
|
}
|
|
@@ -7341,11 +7376,11 @@ function no(n) {
|
|
|
7341
7376
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7342
7377
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7343
7378
|
};
|
|
7344
|
-
return await n.insertInto("logins").values({ ...
|
|
7379
|
+
return await n.insertInto("logins").values({ ...Re(s), tenant_id: e }).execute(), s;
|
|
7345
7380
|
};
|
|
7346
7381
|
}
|
|
7347
7382
|
function so(n) {
|
|
7348
|
-
return async (e, t, s) => (await n.updateTable("logins").set(
|
|
7383
|
+
return async (e, t, s) => (await n.updateTable("logins").set(Re(s)).where("logins.login_id", "=", t).where("logins.tenant_id", "=", e).execute()).length === 1;
|
|
7349
7384
|
}
|
|
7350
7385
|
function ro(n) {
|
|
7351
7386
|
return async (e, t) => (await n.deleteFrom("logins").where("logins.tenant_id", "=", e).where("logins.login_id", "=", t).execute()).length > 0;
|
|
@@ -7358,26 +7393,56 @@ function ao(n) {
|
|
|
7358
7393
|
remove: ro(n)
|
|
7359
7394
|
};
|
|
7360
7395
|
}
|
|
7396
|
+
function io(n) {
|
|
7397
|
+
return async (e) => {
|
|
7398
|
+
const [t] = await n.selectFrom("promptSettings").where("promptSettings.tenant_id", "=", e).selectAll().execute();
|
|
7399
|
+
return R({
|
|
7400
|
+
identifier_first: !!(t != null && t.identifier_first),
|
|
7401
|
+
password_first: !!(t != null && t.password_first),
|
|
7402
|
+
webauthn_platform_first_factor: !!(t != null && t.webauthn_platform_first_factor),
|
|
7403
|
+
universal_login_experience: (t == null ? void 0 : t.universal_login_experience) || "new"
|
|
7404
|
+
});
|
|
7405
|
+
};
|
|
7406
|
+
}
|
|
7361
7407
|
function oo(n) {
|
|
7408
|
+
return async (e, t) => {
|
|
7409
|
+
try {
|
|
7410
|
+
await n.insertInto("promptSettings").values({
|
|
7411
|
+
...t,
|
|
7412
|
+
tenant_id: e
|
|
7413
|
+
}).execute();
|
|
7414
|
+
} catch {
|
|
7415
|
+
await n.updateTable("promptSettings").set(t).where("tenant_id", "=", e).execute();
|
|
7416
|
+
}
|
|
7417
|
+
};
|
|
7418
|
+
}
|
|
7419
|
+
function co(n) {
|
|
7420
|
+
return {
|
|
7421
|
+
get: io(n),
|
|
7422
|
+
set: oo(n)
|
|
7423
|
+
};
|
|
7424
|
+
}
|
|
7425
|
+
function lo(n) {
|
|
7362
7426
|
return {
|
|
7363
|
-
applications:
|
|
7364
|
-
branding:
|
|
7365
|
-
clients:
|
|
7366
|
-
codes:
|
|
7367
|
-
connections:
|
|
7368
|
-
domains:
|
|
7369
|
-
hooks:
|
|
7370
|
-
keys:
|
|
7427
|
+
applications: wa(n),
|
|
7428
|
+
branding: zi(n),
|
|
7429
|
+
clients: Ai(n),
|
|
7430
|
+
codes: fa(n),
|
|
7431
|
+
connections: Ei(n),
|
|
7432
|
+
domains: Vi(n),
|
|
7433
|
+
hooks: Hi(n),
|
|
7434
|
+
keys: Di(n),
|
|
7371
7435
|
logins: ao(n),
|
|
7372
|
-
logs:
|
|
7373
|
-
passwords:
|
|
7374
|
-
|
|
7375
|
-
|
|
7376
|
-
|
|
7436
|
+
logs: Hr(n),
|
|
7437
|
+
passwords: da(n),
|
|
7438
|
+
promptSettings: co(n),
|
|
7439
|
+
users: Dr(n),
|
|
7440
|
+
sessions: ta(n),
|
|
7441
|
+
tenants: Br(n),
|
|
7377
7442
|
themes: eo(n),
|
|
7378
|
-
tickets:
|
|
7443
|
+
tickets: aa(n)
|
|
7379
7444
|
};
|
|
7380
7445
|
}
|
|
7381
7446
|
export {
|
|
7382
|
-
|
|
7447
|
+
lo as default
|
|
7383
7448
|
};
|