@authhero/kysely-adapter 0.7.2 → 0.7.4
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 +64 -70
- package/dist/kysely-adapter.iife.js +1 -1
- package/dist/kysely-adapter.mjs +237 -259
- package/package.json +2 -2
package/dist/kysely-adapter.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var Yt = (n, e, t) =>
|
|
1
|
+
var Qn = Object.defineProperty;
|
|
2
|
+
var Hn = (n, e, t) => e in n ? Qn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var Yt = (n, e, t) => Hn(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
var Et = class extends Error {
|
|
5
5
|
constructor(e = 500, t) {
|
|
6
6
|
super(t == null ? void 0 : t.message, { cause: t == null ? void 0 : t.cause });
|
|
@@ -17,7 +17,7 @@ var Et = class extends Error {
|
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
function
|
|
20
|
+
function Yn(n) {
|
|
21
21
|
return async (e, t) => {
|
|
22
22
|
const { identities: s, ...r } = t, a = {
|
|
23
23
|
...r,
|
|
@@ -47,7 +47,7 @@ function R(n) {
|
|
|
47
47
|
e[t] === null ? delete e[t] : typeof e[t] == "object" && (Array.isArray(e[t]) ? e[t] = e[t].map(R) : e[t] = R(e[t]));
|
|
48
48
|
return e;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function Gn(n, e) {
|
|
51
51
|
var t = {};
|
|
52
52
|
for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && e.indexOf(s) < 0 && (t[s] = n[s]);
|
|
53
53
|
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -55,7 +55,7 @@ function Xn(n, e) {
|
|
|
55
55
|
e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, s[r]) && (t[s[r]] = n[s[r]]);
|
|
56
56
|
return t;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function Xn(n, e) {
|
|
59
59
|
var t;
|
|
60
60
|
return ((t = n == null ? void 0 : n._def) === null || t === void 0 ? void 0 : t.typeName) === e;
|
|
61
61
|
}
|
|
@@ -66,15 +66,15 @@ function Qe(n, e) {
|
|
|
66
66
|
return r._def.openapi = this._def.openapi, r;
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function es(n) {
|
|
70
70
|
if (typeof n.ZodType.prototype.openapi < "u")
|
|
71
71
|
return;
|
|
72
72
|
n.ZodType.prototype.openapi = function(r, a) {
|
|
73
73
|
var o, c, d, u, l, T;
|
|
74
|
-
const C = typeof r == "string" ? a : r, L = C ?? {}, { param: K } = L, re =
|
|
74
|
+
const C = typeof r == "string" ? a : r, L = C ?? {}, { param: K } = L, re = Gn(L, ["param"]), ce = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), de = Object.assign(Object.assign(Object.assign({}, (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata), re), !((u = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || u === void 0) && u.param || K ? {
|
|
75
75
|
param: Object.assign(Object.assign({}, (T = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || T === void 0 ? void 0 : T.param), K)
|
|
76
76
|
} : void 0), ue = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(ce).length > 0 ? { _internal: ce } : void 0), Object.keys(de).length > 0 ? { metadata: de } : void 0) }));
|
|
77
|
-
if (
|
|
77
|
+
if (Xn(this, "ZodObject")) {
|
|
78
78
|
const $e = this.extend;
|
|
79
79
|
ue.extend = function(...Pe) {
|
|
80
80
|
var Q, H, Y, le, Te, Oe;
|
|
@@ -145,14 +145,14 @@ var N;
|
|
|
145
145
|
}
|
|
146
146
|
n.joinValues = s, n.jsonStringifyReplacer = (r, a) => typeof a == "bigint" ? a.toString() : a;
|
|
147
147
|
})(N || (N = {}));
|
|
148
|
-
var
|
|
148
|
+
var en;
|
|
149
149
|
(function(n) {
|
|
150
150
|
n.mergeShapes = (e, t) => ({
|
|
151
151
|
...e,
|
|
152
152
|
...t
|
|
153
153
|
// second overwrites first
|
|
154
154
|
});
|
|
155
|
-
})(
|
|
155
|
+
})(en || (en = {}));
|
|
156
156
|
const _ = N.arrayToEnum([
|
|
157
157
|
"string",
|
|
158
158
|
"nan",
|
|
@@ -212,7 +212,7 @@ const _ = N.arrayToEnum([
|
|
|
212
212
|
"invalid_intersection_types",
|
|
213
213
|
"not_multiple_of",
|
|
214
214
|
"not_finite"
|
|
215
|
-
]),
|
|
215
|
+
]), ts = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
216
216
|
class V extends Error {
|
|
217
217
|
constructor(e) {
|
|
218
218
|
super(), this.issues = [], this.addIssue = (s) => {
|
|
@@ -329,12 +329,12 @@ const ze = (n, e) => {
|
|
|
329
329
|
}
|
|
330
330
|
return { message: t };
|
|
331
331
|
};
|
|
332
|
-
let
|
|
333
|
-
function
|
|
334
|
-
|
|
332
|
+
let kn = ze;
|
|
333
|
+
function ns(n) {
|
|
334
|
+
kn = n;
|
|
335
335
|
}
|
|
336
336
|
function At() {
|
|
337
|
-
return
|
|
337
|
+
return kn;
|
|
338
338
|
}
|
|
339
339
|
const Rt = (n) => {
|
|
340
340
|
const { data: e, path: t, errorMaps: s, issueData: r } = n, a = [...t, ...r.path || []], o = {
|
|
@@ -356,7 +356,7 @@ const Rt = (n) => {
|
|
|
356
356
|
path: a,
|
|
357
357
|
message: c
|
|
358
358
|
};
|
|
359
|
-
},
|
|
359
|
+
}, ss = [];
|
|
360
360
|
function f(n, e) {
|
|
361
361
|
const t = At(), s = Rt({
|
|
362
362
|
issueData: e,
|
|
@@ -415,12 +415,12 @@ class $ {
|
|
|
415
415
|
}
|
|
416
416
|
const x = Object.freeze({
|
|
417
417
|
status: "aborted"
|
|
418
|
-
}), $t = (n) => ({ status: "dirty", value: n }), D = (n) => ({ status: "valid", value: n }),
|
|
418
|
+
}), $t = (n) => ({ status: "dirty", value: n }), D = (n) => ({ status: "valid", value: n }), tn = (n) => n.status === "aborted", nn = (n) => n.status === "dirty", tt = (n) => n.status === "valid", nt = (n) => typeof Promise < "u" && n instanceof Promise;
|
|
419
419
|
function Pt(n, e, t, s) {
|
|
420
420
|
if (typeof e == "function" ? n !== e || !s : !e.has(n)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
421
421
|
return e.get(n);
|
|
422
422
|
}
|
|
423
|
-
function
|
|
423
|
+
function 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
|
}
|
|
@@ -437,7 +437,7 @@ class ee {
|
|
|
437
437
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
const
|
|
440
|
+
const mn = (n, e) => {
|
|
441
441
|
if (tt(e))
|
|
442
442
|
return { success: !0, data: e.value };
|
|
443
443
|
if (!n.common.issues.length)
|
|
@@ -527,7 +527,7 @@ class Z {
|
|
|
527
527
|
data: e,
|
|
528
528
|
parsedType: he(e)
|
|
529
529
|
}, a = this._parseSync({ data: e, path: r.path, parent: r });
|
|
530
|
-
return
|
|
530
|
+
return mn(r, a);
|
|
531
531
|
}
|
|
532
532
|
async parseAsync(e, t) {
|
|
533
533
|
const s = await this.safeParseAsync(e, t);
|
|
@@ -548,7 +548,7 @@ class Z {
|
|
|
548
548
|
data: e,
|
|
549
549
|
parsedType: he(e)
|
|
550
550
|
}, r = this._parse({ data: e, path: s.path, parent: s }), a = await (nt(r) ? r : Promise.resolve(r));
|
|
551
|
-
return
|
|
551
|
+
return mn(s, a);
|
|
552
552
|
}
|
|
553
553
|
refine(e, t) {
|
|
554
554
|
const s = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
|
|
@@ -612,7 +612,7 @@ class Z {
|
|
|
612
612
|
});
|
|
613
613
|
}
|
|
614
614
|
brand() {
|
|
615
|
-
return new
|
|
615
|
+
return new dn({
|
|
616
616
|
typeName: w.ZodBranded,
|
|
617
617
|
type: this,
|
|
618
618
|
...O(this._def)
|
|
@@ -647,23 +647,23 @@ class Z {
|
|
|
647
647
|
return this.safeParse(null).success;
|
|
648
648
|
}
|
|
649
649
|
}
|
|
650
|
-
const
|
|
650
|
+
const rs = /^c[^\s-]{8,}$/i, as = /^[0-9a-z]+$/, is = /^[0-9A-HJKMNP-TV-Z]{26}$/, os = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, cs = /^[a-z0-9_-]{21}$/i, ds = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, us = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, ls = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
651
651
|
let Gt;
|
|
652
|
-
const
|
|
653
|
-
function
|
|
652
|
+
const ps = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, hs = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, fs = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, xn = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", ms = new RegExp(`^${xn}$`);
|
|
653
|
+
function Tn(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 _s(n) {
|
|
658
|
+
return new RegExp(`^${Tn(n)}$`);
|
|
659
659
|
}
|
|
660
|
-
function
|
|
661
|
-
let e = `${
|
|
660
|
+
function On(n) {
|
|
661
|
+
let e = `${xn}T${Tn(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 gs(n, e) {
|
|
666
|
+
return !!((e === "v4" || !e) && ps.test(n) || (e === "v6" || !e) && hs.test(n));
|
|
667
667
|
}
|
|
668
668
|
class F extends Z {
|
|
669
669
|
_parse(e) {
|
|
@@ -714,43 +714,43 @@ class F extends Z {
|
|
|
714
714
|
message: r.message
|
|
715
715
|
}), t.dirty());
|
|
716
716
|
} else if (r.kind === "email")
|
|
717
|
-
|
|
717
|
+
us.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
718
718
|
validation: "email",
|
|
719
719
|
code: p.invalid_string,
|
|
720
720
|
message: r.message
|
|
721
721
|
}), t.dirty());
|
|
722
722
|
else if (r.kind === "emoji")
|
|
723
|
-
Gt || (Gt = new RegExp(
|
|
723
|
+
Gt || (Gt = new RegExp(ls, "u")), Gt.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
724
724
|
validation: "emoji",
|
|
725
725
|
code: p.invalid_string,
|
|
726
726
|
message: r.message
|
|
727
727
|
}), t.dirty());
|
|
728
728
|
else if (r.kind === "uuid")
|
|
729
|
-
|
|
729
|
+
os.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
|
+
cs.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
|
+
rs.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
|
+
as.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
|
+
is.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
754
754
|
validation: "ulid",
|
|
755
755
|
code: p.invalid_string,
|
|
756
756
|
message: r.message
|
|
@@ -781,27 +781,27 @@ class F extends Z {
|
|
|
781
781
|
code: p.invalid_string,
|
|
782
782
|
validation: { endsWith: r.value },
|
|
783
783
|
message: r.message
|
|
784
|
-
}), t.dirty()) : r.kind === "datetime" ?
|
|
784
|
+
}), t.dirty()) : r.kind === "datetime" ? On(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" ? ms.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" ? _s(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" ? ds.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" ? gs(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" ? fs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
|
|
805
805
|
validation: "base64",
|
|
806
806
|
code: p.invalid_string,
|
|
807
807
|
message: r.message
|
|
@@ -1023,7 +1023,7 @@ F.create = (n) => {
|
|
|
1023
1023
|
...O(n)
|
|
1024
1024
|
});
|
|
1025
1025
|
};
|
|
1026
|
-
function
|
|
1026
|
+
function ys(n, e) {
|
|
1027
1027
|
const t = (n.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, r = t > s ? t : s, a = parseInt(n.toFixed(r).replace(".", "")), o = parseInt(e.toFixed(r).replace(".", ""));
|
|
1028
1028
|
return a % o / Math.pow(10, r);
|
|
1029
1029
|
}
|
|
@@ -1062,7 +1062,7 @@ class me extends Z {
|
|
|
1062
1062
|
inclusive: r.inclusive,
|
|
1063
1063
|
exact: !1,
|
|
1064
1064
|
message: r.message
|
|
1065
|
-
}), s.dirty()) : r.kind === "multipleOf" ?
|
|
1065
|
+
}), s.dirty()) : r.kind === "multipleOf" ? ys(e.data, r.value) !== 0 && (t = this._getOrReturnCtx(e, t), f(t, {
|
|
1066
1066
|
code: p.not_multiple_of,
|
|
1067
1067
|
multipleOf: r.value,
|
|
1068
1068
|
message: r.message
|
|
@@ -1881,7 +1881,7 @@ class E extends Z {
|
|
|
1881
1881
|
});
|
|
1882
1882
|
}
|
|
1883
1883
|
keyof() {
|
|
1884
|
-
return
|
|
1884
|
+
return Sn(N.objectKeys(this.shape));
|
|
1885
1885
|
}
|
|
1886
1886
|
}
|
|
1887
1887
|
E.create = (n, e) => new E({
|
|
@@ -1978,7 +1978,7 @@ it.create = (n, e) => new it({
|
|
|
1978
1978
|
typeName: w.ZodUnion,
|
|
1979
1979
|
...O(e)
|
|
1980
1980
|
});
|
|
1981
|
-
const pe = (n) => n instanceof dt ? pe(n.schema) : n instanceof q ? pe(n.innerType()) : n instanceof ut ? [n.value] : n instanceof ge ? n.options : n instanceof lt ? N.objectValues(n.enum) : n instanceof pt ? pe(n._def.innerType) : n instanceof rt ? [void 0] : n instanceof at ? [null] : n instanceof G ? [void 0, ...pe(n.unwrap())] : n instanceof ye ? [null, ...pe(n.unwrap())] : n instanceof
|
|
1981
|
+
const pe = (n) => n instanceof dt ? pe(n.schema) : n instanceof q ? pe(n.innerType()) : n instanceof ut ? [n.value] : n instanceof ge ? n.options : n instanceof lt ? N.objectValues(n.enum) : n instanceof pt ? pe(n._def.innerType) : n instanceof rt ? [void 0] : n instanceof at ? [null] : n instanceof G ? [void 0, ...pe(n.unwrap())] : n instanceof ye ? [null, ...pe(n.unwrap())] : n instanceof dn || n instanceof ft ? pe(n.unwrap()) : n instanceof ht ? pe(n._def.innerType) : [];
|
|
1982
1982
|
class Kt extends Z {
|
|
1983
1983
|
_parse(e) {
|
|
1984
1984
|
const { ctx: t } = this._processInputParams(e);
|
|
@@ -2041,14 +2041,14 @@ class Kt extends Z {
|
|
|
2041
2041
|
});
|
|
2042
2042
|
}
|
|
2043
2043
|
}
|
|
2044
|
-
function
|
|
2044
|
+
function sn(n, e) {
|
|
2045
2045
|
const t = he(n), s = he(e);
|
|
2046
2046
|
if (n === e)
|
|
2047
2047
|
return { valid: !0, data: n };
|
|
2048
2048
|
if (t === _.object && s === _.object) {
|
|
2049
2049
|
const r = N.objectKeys(e), a = N.objectKeys(n).filter((c) => r.indexOf(c) !== -1), o = { ...n, ...e };
|
|
2050
2050
|
for (const c of a) {
|
|
2051
|
-
const d =
|
|
2051
|
+
const d = sn(n[c], e[c]);
|
|
2052
2052
|
if (!d.valid)
|
|
2053
2053
|
return { valid: !1 };
|
|
2054
2054
|
o[c] = d.data;
|
|
@@ -2059,7 +2059,7 @@ function rn(n, e) {
|
|
|
2059
2059
|
return { valid: !1 };
|
|
2060
2060
|
const r = [];
|
|
2061
2061
|
for (let a = 0; a < n.length; a++) {
|
|
2062
|
-
const o = n[a], c = e[a], d =
|
|
2062
|
+
const o = n[a], c = e[a], d = sn(o, c);
|
|
2063
2063
|
if (!d.valid)
|
|
2064
2064
|
return { valid: !1 };
|
|
2065
2065
|
r.push(d.data);
|
|
@@ -2070,10 +2070,10 @@ function rn(n, e) {
|
|
|
2070
2070
|
class ot extends Z {
|
|
2071
2071
|
_parse(e) {
|
|
2072
2072
|
const { status: t, ctx: s } = this._processInputParams(e), r = (a, o) => {
|
|
2073
|
-
if (
|
|
2073
|
+
if (tn(a) || tn(o))
|
|
2074
2074
|
return x;
|
|
2075
|
-
const c =
|
|
2076
|
-
return c.valid ? ((
|
|
2075
|
+
const c = sn(a.value, o.value);
|
|
2076
|
+
return c.valid ? ((nn(a) || nn(o)) && t.dirty(), { status: t.value, value: c.data }) : (f(s, {
|
|
2077
2077
|
code: p.invalid_intersection_types
|
|
2078
2078
|
}), x);
|
|
2079
2079
|
};
|
|
@@ -2444,7 +2444,7 @@ ut.create = (n, e) => new ut({
|
|
|
2444
2444
|
typeName: w.ZodLiteral,
|
|
2445
2445
|
...O(e)
|
|
2446
2446
|
});
|
|
2447
|
-
function
|
|
2447
|
+
function Sn(n, e) {
|
|
2448
2448
|
return new ge({
|
|
2449
2449
|
values: n,
|
|
2450
2450
|
typeName: w.ZodEnum,
|
|
@@ -2464,7 +2464,7 @@ class ge extends Z {
|
|
|
2464
2464
|
code: p.invalid_type
|
|
2465
2465
|
}), x;
|
|
2466
2466
|
}
|
|
2467
|
-
if (Pt(this, Ye) ||
|
|
2467
|
+
if (Pt(this, Ye) || bn(this, Ye, new Set(this._def.values)), !Pt(this, Ye).has(e.data)) {
|
|
2468
2468
|
const t = this._getOrReturnCtx(e), s = this._def.values;
|
|
2469
2469
|
return f(t, {
|
|
2470
2470
|
received: t.data,
|
|
@@ -2509,7 +2509,7 @@ class ge extends Z {
|
|
|
2509
2509
|
}
|
|
2510
2510
|
}
|
|
2511
2511
|
Ye = /* @__PURE__ */ new WeakMap();
|
|
2512
|
-
ge.create =
|
|
2512
|
+
ge.create = Sn;
|
|
2513
2513
|
class lt extends Z {
|
|
2514
2514
|
constructor() {
|
|
2515
2515
|
super(...arguments), Ge.set(this, void 0);
|
|
@@ -2524,7 +2524,7 @@ class lt extends Z {
|
|
|
2524
2524
|
code: p.invalid_type
|
|
2525
2525
|
}), x;
|
|
2526
2526
|
}
|
|
2527
|
-
if (Pt(this, Ge) ||
|
|
2527
|
+
if (Pt(this, Ge) || bn(this, Ge, new Set(N.getValidEnumValues(this._def.values))), !Pt(this, Ge).has(e.data)) {
|
|
2528
2528
|
const r = N.objectValues(t);
|
|
2529
2529
|
return f(s, {
|
|
2530
2530
|
received: s.data,
|
|
@@ -2763,8 +2763,8 @@ Vt.create = (n) => new Vt({
|
|
|
2763
2763
|
typeName: w.ZodNaN,
|
|
2764
2764
|
...O(n)
|
|
2765
2765
|
});
|
|
2766
|
-
const
|
|
2767
|
-
class
|
|
2766
|
+
const vs = Symbol("zod_brand");
|
|
2767
|
+
class dn extends Z {
|
|
2768
2768
|
_parse(e) {
|
|
2769
2769
|
const { ctx: t } = this._processInputParams(e), s = t.data;
|
|
2770
2770
|
return this._def.type._parse({
|
|
@@ -2831,7 +2831,7 @@ ft.create = (n, e) => new ft({
|
|
|
2831
2831
|
typeName: w.ZodReadonly,
|
|
2832
2832
|
...O(e)
|
|
2833
2833
|
});
|
|
2834
|
-
function
|
|
2834
|
+
function Zn(n, e = {}, t) {
|
|
2835
2835
|
return n ? Be.create().superRefine((s, r) => {
|
|
2836
2836
|
var a, o;
|
|
2837
2837
|
if (!n(s)) {
|
|
@@ -2840,16 +2840,16 @@ function jn(n, e = {}, t) {
|
|
|
2840
2840
|
}
|
|
2841
2841
|
}) : Be.create();
|
|
2842
2842
|
}
|
|
2843
|
-
const
|
|
2843
|
+
const ws = {
|
|
2844
2844
|
object: E.lazycreate
|
|
2845
2845
|
};
|
|
2846
2846
|
var w;
|
|
2847
2847
|
(function(n) {
|
|
2848
2848
|
n.ZodString = "ZodString", n.ZodNumber = "ZodNumber", n.ZodNaN = "ZodNaN", n.ZodBigInt = "ZodBigInt", n.ZodBoolean = "ZodBoolean", n.ZodDate = "ZodDate", n.ZodSymbol = "ZodSymbol", n.ZodUndefined = "ZodUndefined", n.ZodNull = "ZodNull", n.ZodAny = "ZodAny", n.ZodUnknown = "ZodUnknown", n.ZodNever = "ZodNever", n.ZodVoid = "ZodVoid", n.ZodArray = "ZodArray", n.ZodObject = "ZodObject", n.ZodUnion = "ZodUnion", n.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", n.ZodIntersection = "ZodIntersection", n.ZodTuple = "ZodTuple", n.ZodRecord = "ZodRecord", n.ZodMap = "ZodMap", n.ZodSet = "ZodSet", n.ZodFunction = "ZodFunction", n.ZodLazy = "ZodLazy", n.ZodLiteral = "ZodLiteral", n.ZodEnum = "ZodEnum", n.ZodEffects = "ZodEffects", n.ZodNativeEnum = "ZodNativeEnum", n.ZodOptional = "ZodOptional", n.ZodNullable = "ZodNullable", n.ZodDefault = "ZodDefault", n.ZodCatch = "ZodCatch", n.ZodPromise = "ZodPromise", n.ZodBranded = "ZodBranded", n.ZodPipeline = "ZodPipeline", n.ZodReadonly = "ZodReadonly";
|
|
2849
2849
|
})(w || (w = {}));
|
|
2850
|
-
const
|
|
2850
|
+
const ks = (n, e = {
|
|
2851
2851
|
message: `Input not instance of ${n.name}`
|
|
2852
|
-
}) =>
|
|
2852
|
+
}) => Zn((t) => t instanceof n, e), jn = F.create, Nn = me.create, bs = Vt.create, xs = _e.create, In = st.create, Ts = Ne.create, Os = Dt.create, Ss = rt.create, Zs = at.create, js = Be.create, Ns = Ze.create, Is = ie.create, Cs = Mt.create, Es = B.create, As = E.create, Rs = E.strictCreate, $s = it.create, Ps = Kt.create, Ds = ot.create, Ms = te.create, Ls = ct.create, Vs = Lt.create, Us = Ie.create, Fs = Ue.create, zs = dt.create, Bs = ut.create, Ws = ge.create, qs = lt.create, Js = We.create, _n = q.create, Ks = G.create, Qs = ye.create, Hs = q.createWithPreprocess, Ys = Nt.create, Gs = () => jn().optional(), Xs = () => Nn().optional(), er = () => In().optional(), tr = {
|
|
2853
2853
|
string: (n) => F.create({ ...n, coerce: !0 }),
|
|
2854
2854
|
number: (n) => me.create({ ...n, coerce: !0 }),
|
|
2855
2855
|
boolean: (n) => st.create({
|
|
@@ -2858,33 +2858,33 @@ const bs = (n, e = {
|
|
|
2858
2858
|
}),
|
|
2859
2859
|
bigint: (n) => _e.create({ ...n, coerce: !0 }),
|
|
2860
2860
|
date: (n) => Ne.create({ ...n, coerce: !0 })
|
|
2861
|
-
},
|
|
2861
|
+
}, nr = x;
|
|
2862
2862
|
var i = /* @__PURE__ */ Object.freeze({
|
|
2863
2863
|
__proto__: null,
|
|
2864
2864
|
defaultErrorMap: ze,
|
|
2865
|
-
setErrorMap:
|
|
2865
|
+
setErrorMap: ns,
|
|
2866
2866
|
getErrorMap: At,
|
|
2867
2867
|
makeIssue: Rt,
|
|
2868
|
-
EMPTY_PATH:
|
|
2868
|
+
EMPTY_PATH: ss,
|
|
2869
2869
|
addIssueToContext: f,
|
|
2870
2870
|
ParseStatus: $,
|
|
2871
2871
|
INVALID: x,
|
|
2872
2872
|
DIRTY: $t,
|
|
2873
2873
|
OK: D,
|
|
2874
|
-
isAborted:
|
|
2875
|
-
isDirty:
|
|
2874
|
+
isAborted: tn,
|
|
2875
|
+
isDirty: nn,
|
|
2876
2876
|
isValid: tt,
|
|
2877
2877
|
isAsync: nt,
|
|
2878
2878
|
get util() {
|
|
2879
2879
|
return N;
|
|
2880
2880
|
},
|
|
2881
2881
|
get objectUtil() {
|
|
2882
|
-
return
|
|
2882
|
+
return en;
|
|
2883
2883
|
},
|
|
2884
2884
|
ZodParsedType: _,
|
|
2885
2885
|
getParsedType: he,
|
|
2886
2886
|
ZodType: Z,
|
|
2887
|
-
datetimeRegex:
|
|
2887
|
+
datetimeRegex: On,
|
|
2888
2888
|
ZodString: F,
|
|
2889
2889
|
ZodNumber: me,
|
|
2890
2890
|
ZodBigInt: _e,
|
|
@@ -2919,72 +2919,72 @@ var i = /* @__PURE__ */ Object.freeze({
|
|
|
2919
2919
|
ZodDefault: pt,
|
|
2920
2920
|
ZodCatch: ht,
|
|
2921
2921
|
ZodNaN: Vt,
|
|
2922
|
-
BRAND:
|
|
2923
|
-
ZodBranded:
|
|
2922
|
+
BRAND: vs,
|
|
2923
|
+
ZodBranded: dn,
|
|
2924
2924
|
ZodPipeline: Nt,
|
|
2925
2925
|
ZodReadonly: ft,
|
|
2926
|
-
custom:
|
|
2926
|
+
custom: Zn,
|
|
2927
2927
|
Schema: Z,
|
|
2928
2928
|
ZodSchema: Z,
|
|
2929
|
-
late:
|
|
2929
|
+
late: ws,
|
|
2930
2930
|
get ZodFirstPartyTypeKind() {
|
|
2931
2931
|
return w;
|
|
2932
2932
|
},
|
|
2933
|
-
coerce:
|
|
2934
|
-
any:
|
|
2935
|
-
array:
|
|
2936
|
-
bigint:
|
|
2937
|
-
boolean:
|
|
2938
|
-
date:
|
|
2939
|
-
discriminatedUnion:
|
|
2940
|
-
effect:
|
|
2941
|
-
enum:
|
|
2942
|
-
function:
|
|
2943
|
-
instanceof:
|
|
2944
|
-
intersection:
|
|
2945
|
-
lazy:
|
|
2946
|
-
literal:
|
|
2947
|
-
map:
|
|
2948
|
-
nan:
|
|
2949
|
-
nativeEnum:
|
|
2950
|
-
never:
|
|
2951
|
-
null:
|
|
2952
|
-
nullable:
|
|
2953
|
-
number:
|
|
2954
|
-
object:
|
|
2955
|
-
oboolean:
|
|
2956
|
-
onumber:
|
|
2957
|
-
optional:
|
|
2958
|
-
ostring:
|
|
2959
|
-
pipeline:
|
|
2960
|
-
preprocess:
|
|
2961
|
-
promise:
|
|
2962
|
-
record:
|
|
2963
|
-
set:
|
|
2964
|
-
strictObject:
|
|
2965
|
-
string:
|
|
2966
|
-
symbol:
|
|
2967
|
-
transformer:
|
|
2968
|
-
tuple:
|
|
2969
|
-
undefined:
|
|
2970
|
-
union:
|
|
2971
|
-
unknown:
|
|
2972
|
-
void:
|
|
2973
|
-
NEVER:
|
|
2933
|
+
coerce: tr,
|
|
2934
|
+
any: js,
|
|
2935
|
+
array: Es,
|
|
2936
|
+
bigint: xs,
|
|
2937
|
+
boolean: In,
|
|
2938
|
+
date: Ts,
|
|
2939
|
+
discriminatedUnion: Ps,
|
|
2940
|
+
effect: _n,
|
|
2941
|
+
enum: Ws,
|
|
2942
|
+
function: Fs,
|
|
2943
|
+
instanceof: ks,
|
|
2944
|
+
intersection: Ds,
|
|
2945
|
+
lazy: zs,
|
|
2946
|
+
literal: Bs,
|
|
2947
|
+
map: Vs,
|
|
2948
|
+
nan: bs,
|
|
2949
|
+
nativeEnum: qs,
|
|
2950
|
+
never: Is,
|
|
2951
|
+
null: Zs,
|
|
2952
|
+
nullable: Qs,
|
|
2953
|
+
number: Nn,
|
|
2954
|
+
object: As,
|
|
2955
|
+
oboolean: er,
|
|
2956
|
+
onumber: Xs,
|
|
2957
|
+
optional: Ks,
|
|
2958
|
+
ostring: Gs,
|
|
2959
|
+
pipeline: Ys,
|
|
2960
|
+
preprocess: Hs,
|
|
2961
|
+
promise: Js,
|
|
2962
|
+
record: Ls,
|
|
2963
|
+
set: Us,
|
|
2964
|
+
strictObject: Rs,
|
|
2965
|
+
string: jn,
|
|
2966
|
+
symbol: Os,
|
|
2967
|
+
transformer: _n,
|
|
2968
|
+
tuple: Ms,
|
|
2969
|
+
undefined: Ss,
|
|
2970
|
+
union: $s,
|
|
2971
|
+
unknown: Ns,
|
|
2972
|
+
void: Cs,
|
|
2973
|
+
NEVER: nr,
|
|
2974
2974
|
ZodIssueCode: p,
|
|
2975
|
-
quotelessJson:
|
|
2975
|
+
quotelessJson: ts,
|
|
2976
2976
|
ZodError: V
|
|
2977
2977
|
});
|
|
2978
|
-
|
|
2978
|
+
es(i);
|
|
2979
2979
|
i.object({
|
|
2980
2980
|
start: i.number(),
|
|
2981
2981
|
limit: i.number(),
|
|
2982
2982
|
length: i.number()
|
|
2983
2983
|
});
|
|
2984
|
-
const
|
|
2984
|
+
const un = i.object({
|
|
2985
2985
|
created_at: i.string(),
|
|
2986
2986
|
updated_at: i.string()
|
|
2987
|
-
}),
|
|
2987
|
+
}), sr = i.object({
|
|
2988
2988
|
email: i.string().optional(),
|
|
2989
2989
|
email_verified: i.boolean().optional(),
|
|
2990
2990
|
name: i.string().optional(),
|
|
@@ -2993,7 +2993,7 @@ const ln = i.object({
|
|
|
2993
2993
|
phone_number: i.string().optional(),
|
|
2994
2994
|
phone_verified: i.boolean().optional(),
|
|
2995
2995
|
family_name: i.string().optional()
|
|
2996
|
-
}).catchall(i.any()),
|
|
2996
|
+
}).catchall(i.any()), rr = i.object({
|
|
2997
2997
|
connection: i.string(),
|
|
2998
2998
|
user_id: i.string(),
|
|
2999
2999
|
provider: i.string(),
|
|
@@ -3001,8 +3001,8 @@ const ln = i.object({
|
|
|
3001
3001
|
access_token: i.string().optional(),
|
|
3002
3002
|
access_token_secret: i.string().optional(),
|
|
3003
3003
|
refresh_token: i.string().optional(),
|
|
3004
|
-
profileData:
|
|
3005
|
-
}),
|
|
3004
|
+
profileData: sr.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 ln = i.object({
|
|
|
3014
3014
|
linked_to: i.string().optional(),
|
|
3015
3015
|
profileData: i.string().optional(),
|
|
3016
3016
|
user_id: i.string().optional()
|
|
3017
|
-
}),
|
|
3017
|
+
}), ar = Cn.extend({
|
|
3018
3018
|
email_verified: i.boolean().default(!1),
|
|
3019
3019
|
verify_email: i.boolean().optional(),
|
|
3020
3020
|
last_ip: i.string().optional(),
|
|
@@ -3023,15 +3023,15 @@ const ln = i.object({
|
|
|
3023
3023
|
provider: i.string().default("email"),
|
|
3024
3024
|
connection: i.string().default("email")
|
|
3025
3025
|
});
|
|
3026
|
-
|
|
3026
|
+
ar.extend(un.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(rr).optional()
|
|
3033
3033
|
});
|
|
3034
|
-
|
|
3034
|
+
Cn.extend({
|
|
3035
3035
|
email: i.string(),
|
|
3036
3036
|
login_count: i.number(),
|
|
3037
3037
|
multifactor: i.array(i.string()).optional(),
|
|
@@ -3039,27 +3039,24 @@ En.extend({
|
|
|
3039
3039
|
last_login: i.string().optional(),
|
|
3040
3040
|
user_id: i.string()
|
|
3041
3041
|
}).catchall(i.any());
|
|
3042
|
-
const
|
|
3042
|
+
const ir = i.object({
|
|
3043
3043
|
id: i.string(),
|
|
3044
3044
|
name: i.string(),
|
|
3045
|
-
callbacks: i.
|
|
3045
|
+
callbacks: i.array(i.string()).openapi({
|
|
3046
3046
|
description: "Comma-separated list of URLs whitelisted to use as a callback to the client after authentication."
|
|
3047
3047
|
}),
|
|
3048
|
-
allowed_origins: i.
|
|
3048
|
+
allowed_origins: i.array(i.string()).openapi({
|
|
3049
3049
|
description: "Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level. Query strings and hash information are not taken into account when validating these URLs."
|
|
3050
3050
|
}),
|
|
3051
|
-
web_origins: i.
|
|
3051
|
+
web_origins: i.array(i.string()).openapi({
|
|
3052
3052
|
description: "Comma-separated list of allowed origins for use with Cross-Origin Authentication, Device Flow, and web message response mode."
|
|
3053
3053
|
}),
|
|
3054
|
-
allowed_logout_urls: i.
|
|
3054
|
+
allowed_logout_urls: i.array(i.string()).openapi({
|
|
3055
3055
|
description: "Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains."
|
|
3056
3056
|
}),
|
|
3057
3057
|
addons: i.record(i.string(), i.record(i.string(), i.union([i.string(), i.number()]))).optional().openapi({
|
|
3058
3058
|
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."
|
|
3059
3059
|
}),
|
|
3060
|
-
// @deprecated. Renamed to match the auth0 API
|
|
3061
|
-
allowed_web_origins: i.string().transform((n) => n === null ? "" : n).default(""),
|
|
3062
|
-
allowed_callback_urls: i.string().transform((n) => n === null ? "" : n).default(""),
|
|
3063
3060
|
email_validation: i.enum(["enabled", "disabled", "enforced"]).default("enforced").openapi({
|
|
3064
3061
|
description: "Defines if it possible to sign in with an unverified email and if verification emails will be sent. This is not available in auth0"
|
|
3065
3062
|
}),
|
|
@@ -3067,23 +3064,22 @@ const or = i.object({
|
|
|
3067
3064
|
disable_sign_ups: i.boolean().default(!1).openapi({
|
|
3068
3065
|
description: "Prevents users from signing up using the hosted login page. This is not available in auth0"
|
|
3069
3066
|
})
|
|
3070
|
-
})
|
|
3071
|
-
i.object({
|
|
3067
|
+
}), or = i.object({
|
|
3072
3068
|
created_at: i.string().transform((n) => n === null ? "" : n),
|
|
3073
3069
|
updated_at: i.string().transform((n) => n === null ? "" : n)
|
|
3074
|
-
}).extend(
|
|
3075
|
-
var
|
|
3070
|
+
}).extend(ir.shape);
|
|
3071
|
+
var En = /* @__PURE__ */ ((n) => (n.TOKEN = "token", n.TOKEN_ID_TOKEN = "token id_token", n.CODE = "code", n))(En || {}), An = /* @__PURE__ */ ((n) => (n.QUERY = "query", n.FRAGMENT = "fragment", n.FORM_POST = "form_post", n.WEB_MESSAGE = "web_message", n.SAML_POST = "saml_post", n))(An || {}), Rn = /* @__PURE__ */ ((n) => (n.S265 = "S256", n.plain = "plain", n))(Rn || {});
|
|
3076
3072
|
const Qt = i.object({
|
|
3077
3073
|
client_id: i.string(),
|
|
3078
3074
|
vendor_id: i.string().optional(),
|
|
3079
|
-
response_type: i.nativeEnum(
|
|
3080
|
-
response_mode: i.nativeEnum(
|
|
3075
|
+
response_type: i.nativeEnum(En).optional(),
|
|
3076
|
+
response_mode: i.nativeEnum(An).optional(),
|
|
3081
3077
|
redirect_uri: i.string().optional(),
|
|
3082
3078
|
audience: i.string().optional(),
|
|
3083
3079
|
state: i.string().optional(),
|
|
3084
3080
|
nonce: i.string().optional(),
|
|
3085
3081
|
scope: i.string().optional(),
|
|
3086
|
-
code_challenge_method: i.nativeEnum(
|
|
3082
|
+
code_challenge_method: i.nativeEnum(Rn).optional(),
|
|
3087
3083
|
code_challenge: i.string().optional(),
|
|
3088
3084
|
username: i.string().optional()
|
|
3089
3085
|
});
|
|
@@ -3118,7 +3114,7 @@ const cr = i.object({
|
|
|
3118
3114
|
token_exchange_basic_auth: i.boolean().optional(),
|
|
3119
3115
|
userinfo_endpoint: i.string().optional(),
|
|
3120
3116
|
scope: i.string().optional()
|
|
3121
|
-
}),
|
|
3117
|
+
}), ln = i.object({
|
|
3122
3118
|
id: i.string(),
|
|
3123
3119
|
created_at: i.string().transform((n) => n === null ? "" : n),
|
|
3124
3120
|
updated_at: i.string().transform((n) => n === null ? "" : n)
|
|
@@ -3128,21 +3124,9 @@ const cr = i.object({
|
|
|
3128
3124
|
dkim_public_key: i.string().optional(),
|
|
3129
3125
|
email_api_key: i.string().optional(),
|
|
3130
3126
|
email_service: i.union([i.literal("mailgun"), i.literal("mailchannels")]).optional()
|
|
3131
|
-
}),
|
|
3132
|
-
|
|
3133
|
-
name: i.string(),
|
|
3127
|
+
}), $n = i.object({
|
|
3128
|
+
...or.shape,
|
|
3134
3129
|
domains: i.array(dr),
|
|
3135
|
-
allowed_callback_urls: i.array(i.string()),
|
|
3136
|
-
allowed_logout_urls: i.array(i.string()),
|
|
3137
|
-
allowed_web_origins: i.array(i.string()),
|
|
3138
|
-
email_validation: i.union([
|
|
3139
|
-
i.literal("enabled"),
|
|
3140
|
-
i.literal("disabled"),
|
|
3141
|
-
i.literal("enforced")
|
|
3142
|
-
]),
|
|
3143
|
-
tenant_id: i.string(),
|
|
3144
|
-
client_secret: i.string(),
|
|
3145
|
-
disable_sign_ups: i.boolean(),
|
|
3146
3130
|
tenant: i.object({
|
|
3147
3131
|
name: i.string(),
|
|
3148
3132
|
audience: i.string().optional(),
|
|
@@ -3155,11 +3139,11 @@ const cr = i.object({
|
|
|
3155
3139
|
language: i.string().length(2).optional()
|
|
3156
3140
|
})
|
|
3157
3141
|
});
|
|
3158
|
-
|
|
3159
|
-
connections: i.array(
|
|
3142
|
+
$n.extend({
|
|
3143
|
+
connections: i.array(ln)
|
|
3160
3144
|
});
|
|
3161
|
-
|
|
3162
|
-
connections: i.array(
|
|
3145
|
+
$n.extend({
|
|
3146
|
+
connections: i.array(ln.partial())
|
|
3163
3147
|
});
|
|
3164
3148
|
const ur = i.enum([
|
|
3165
3149
|
"password_reset",
|
|
@@ -3188,7 +3172,7 @@ const ur = i.enum([
|
|
|
3188
3172
|
email_api_key: i.string().optional(),
|
|
3189
3173
|
email_service: i.enum(["mailgun", "mailchannels"])
|
|
3190
3174
|
});
|
|
3191
|
-
|
|
3175
|
+
un.extend({
|
|
3192
3176
|
...hr.shape,
|
|
3193
3177
|
id: i.string()
|
|
3194
3178
|
});
|
|
@@ -3205,7 +3189,7 @@ const fr = i.object({
|
|
|
3205
3189
|
priority: i.number().optional()
|
|
3206
3190
|
});
|
|
3207
3191
|
fr.extend({
|
|
3208
|
-
...
|
|
3192
|
+
...un.shape,
|
|
3209
3193
|
hook_id: i.string()
|
|
3210
3194
|
});
|
|
3211
3195
|
const mr = i.object({
|
|
@@ -3418,10 +3402,10 @@ i.object({
|
|
|
3418
3402
|
siteUrl: i.string().nullable(),
|
|
3419
3403
|
manageSubscriptionsUrl: i.string().optional()
|
|
3420
3404
|
});
|
|
3421
|
-
var
|
|
3422
|
-
const
|
|
3405
|
+
var Pn = /* @__PURE__ */ ((n) => (n.RefreshToken = "refresh_token", n.AuthorizationCode = "authorization_code", n.ClientCredential = "client_credentials", n.Passwordless = "passwordless", n.Password = "password", n))(Pn || {});
|
|
3406
|
+
const pn = i.nativeEnum(Pn);
|
|
3423
3407
|
i.object({
|
|
3424
|
-
grant_type:
|
|
3408
|
+
grant_type: pn.refine(
|
|
3425
3409
|
(n) => n === "authorization_code"
|
|
3426
3410
|
/* AuthorizationCode */
|
|
3427
3411
|
),
|
|
@@ -3430,7 +3414,7 @@ i.object({
|
|
|
3430
3414
|
client_id: i.string()
|
|
3431
3415
|
});
|
|
3432
3416
|
i.object({
|
|
3433
|
-
grant_type:
|
|
3417
|
+
grant_type: pn.refine(
|
|
3434
3418
|
(n) => n === "authorization_code"
|
|
3435
3419
|
/* AuthorizationCode */
|
|
3436
3420
|
),
|
|
@@ -3440,7 +3424,7 @@ i.object({
|
|
|
3440
3424
|
redirect_uri: i.string()
|
|
3441
3425
|
});
|
|
3442
3426
|
i.object({
|
|
3443
|
-
grant_type:
|
|
3427
|
+
grant_type: pn.refine(
|
|
3444
3428
|
(n) => n === "client_credentials"
|
|
3445
3429
|
/* ClientCredential */
|
|
3446
3430
|
),
|
|
@@ -3564,13 +3548,13 @@ i.object({
|
|
|
3564
3548
|
...Cr.shape,
|
|
3565
3549
|
created_at: i.string()
|
|
3566
3550
|
});
|
|
3567
|
-
function
|
|
3551
|
+
function hn(n) {
|
|
3568
3552
|
const [e, t] = n.split("|");
|
|
3569
3553
|
if (!e || !t)
|
|
3570
3554
|
throw new Error(`Invalid user_id: ${n}`);
|
|
3571
3555
|
return { connection: e, id: t };
|
|
3572
3556
|
}
|
|
3573
|
-
function
|
|
3557
|
+
function Dn(n) {
|
|
3574
3558
|
let e = {};
|
|
3575
3559
|
try {
|
|
3576
3560
|
e = JSON.parse(n.profileData || "{}");
|
|
@@ -3580,7 +3564,7 @@ function Mn(n) {
|
|
|
3580
3564
|
return {
|
|
3581
3565
|
connection: n.connection,
|
|
3582
3566
|
provider: n.provider,
|
|
3583
|
-
user_id:
|
|
3567
|
+
user_id: hn(n.user_id).id,
|
|
3584
3568
|
isSocial: !!n.is_social,
|
|
3585
3569
|
profileData: {
|
|
3586
3570
|
email: n.email,
|
|
@@ -3606,10 +3590,10 @@ function Er(n) {
|
|
|
3606
3590
|
{
|
|
3607
3591
|
connection: s.connection,
|
|
3608
3592
|
provider: s.provider,
|
|
3609
|
-
user_id:
|
|
3593
|
+
user_id: hn(s.user_id).id,
|
|
3610
3594
|
isSocial: !!s.is_social
|
|
3611
3595
|
},
|
|
3612
|
-
...r.map(
|
|
3596
|
+
...r.map(Dn)
|
|
3613
3597
|
]
|
|
3614
3598
|
};
|
|
3615
3599
|
return R(c);
|
|
@@ -3674,10 +3658,10 @@ function Ar(n) {
|
|
|
3674
3658
|
{
|
|
3675
3659
|
connection: l.connection,
|
|
3676
3660
|
provider: l.provider,
|
|
3677
|
-
user_id:
|
|
3661
|
+
user_id: hn(l.user_id).id,
|
|
3678
3662
|
isSocial: !!l.is_social
|
|
3679
3663
|
},
|
|
3680
|
-
...T.map(
|
|
3664
|
+
...T.map(Dn)
|
|
3681
3665
|
]
|
|
3682
3666
|
});
|
|
3683
3667
|
}), { count: u } = await s.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
@@ -3714,7 +3698,7 @@ function Dr(n) {
|
|
|
3714
3698
|
}
|
|
3715
3699
|
function Mr(n) {
|
|
3716
3700
|
return {
|
|
3717
|
-
create:
|
|
3701
|
+
create: Yn(n),
|
|
3718
3702
|
remove: Rr(n),
|
|
3719
3703
|
get: Er(n),
|
|
3720
3704
|
list: Ar(n),
|
|
@@ -3791,7 +3775,7 @@ function Wr(n) {
|
|
|
3791
3775
|
remove: Br(n)
|
|
3792
3776
|
};
|
|
3793
3777
|
}
|
|
3794
|
-
function
|
|
3778
|
+
function gn(n) {
|
|
3795
3779
|
return n ? JSON.stringify(n) : void 0;
|
|
3796
3780
|
}
|
|
3797
3781
|
const qr = 1024;
|
|
@@ -3810,12 +3794,12 @@ function Jr(n) {
|
|
|
3810
3794
|
isMobile: t.isMobile ? 1 : 0,
|
|
3811
3795
|
tenant_id: e,
|
|
3812
3796
|
scope: (a = t.scope) == null ? void 0 : a.join(","),
|
|
3813
|
-
auth0_client:
|
|
3814
|
-
details: (o =
|
|
3797
|
+
auth0_client: gn(t.auth0_client),
|
|
3798
|
+
details: (o = gn(t.details)) == null ? void 0 : o.substring(0, 8192)
|
|
3815
3799
|
}).execute(), s;
|
|
3816
3800
|
};
|
|
3817
3801
|
}
|
|
3818
|
-
function
|
|
3802
|
+
function yn(n) {
|
|
3819
3803
|
if (!n)
|
|
3820
3804
|
return "";
|
|
3821
3805
|
try {
|
|
@@ -3824,13 +3808,13 @@ function vn(n) {
|
|
|
3824
3808
|
return n;
|
|
3825
3809
|
}
|
|
3826
3810
|
}
|
|
3827
|
-
function
|
|
3811
|
+
function Mn(n) {
|
|
3828
3812
|
return {
|
|
3829
3813
|
...n,
|
|
3830
3814
|
client_id: n.client_id,
|
|
3831
3815
|
client_name: "",
|
|
3832
|
-
auth0_client:
|
|
3833
|
-
details:
|
|
3816
|
+
auth0_client: yn(n.auth0_client),
|
|
3817
|
+
details: yn(n.details),
|
|
3834
3818
|
isMobile: !!n.isMobile,
|
|
3835
3819
|
scope: n.scope ? n.scope.split(",") : void 0,
|
|
3836
3820
|
log_id: n.id,
|
|
@@ -3852,7 +3836,7 @@ function Kr(n) {
|
|
|
3852
3836
|
r = r.offset(t.page * t.per_page).limit(t.per_page);
|
|
3853
3837
|
const a = await r.selectAll().execute(), { count: o } = await s.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
3854
3838
|
return {
|
|
3855
|
-
logs: a.map(
|
|
3839
|
+
logs: a.map(Mn),
|
|
3856
3840
|
start: t.page * t.per_page,
|
|
3857
3841
|
limit: t.per_page,
|
|
3858
3842
|
length: xe(o)
|
|
@@ -3862,7 +3846,7 @@ function Kr(n) {
|
|
|
3862
3846
|
function Qr(n) {
|
|
3863
3847
|
return async (e, t) => {
|
|
3864
3848
|
const s = await n.selectFrom("logs").where("logs.tenant_id", "=", e).where("logs.id", "=", t).selectAll().executeTakeFirst();
|
|
3865
|
-
return s ?
|
|
3849
|
+
return s ? Mn(s) : null;
|
|
3866
3850
|
};
|
|
3867
3851
|
}
|
|
3868
3852
|
function Hr(n) {
|
|
@@ -4176,21 +4160,17 @@ function Ta(n) {
|
|
|
4176
4160
|
const s = {
|
|
4177
4161
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4178
4162
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4179
|
-
...t
|
|
4180
|
-
|
|
4181
|
-
allowed_web_origins: t.allowed_origins,
|
|
4182
|
-
allowed_callback_urls: t.callbacks,
|
|
4183
|
-
allowed_origins: t.allowed_origins
|
|
4184
|
-
}, r = JSON.stringify(t.allowed_origins.split(",")), a = JSON.stringify(t.callbacks.split(",")), o = JSON.stringify(t.callbacks.split(","));
|
|
4163
|
+
...t
|
|
4164
|
+
}, r = JSON.stringify(t.allowed_origins), a = JSON.stringify(t.callbacks), o = JSON.stringify(t.web_origins), c = JSON.stringify(t.allowed_logout_urls);
|
|
4185
4165
|
return await n.insertInto("applications").values({
|
|
4186
4166
|
...s,
|
|
4187
4167
|
tenant_id: e,
|
|
4188
4168
|
disable_sign_ups: t.disable_sign_ups ? 1 : 0,
|
|
4189
4169
|
addons: t.addons ? JSON.stringify(t.addons) : "{}",
|
|
4190
|
-
callbacks:
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4170
|
+
callbacks: a,
|
|
4171
|
+
allowed_origins: r,
|
|
4172
|
+
web_origins: o,
|
|
4173
|
+
allowed_logout_urls: c
|
|
4194
4174
|
}).execute(), s;
|
|
4195
4175
|
};
|
|
4196
4176
|
}
|
|
@@ -4199,7 +4179,11 @@ function Oa(n) {
|
|
|
4199
4179
|
applications: (await n.selectFrom("applications").where("applications.tenant_id", "=", e).selectAll().execute()).map((a) => ({
|
|
4200
4180
|
...a,
|
|
4201
4181
|
disable_sign_ups: !!a.disable_sign_ups,
|
|
4202
|
-
addons: a.addons ? JSON.parse(a.addons) : {}
|
|
4182
|
+
addons: a.addons ? JSON.parse(a.addons) : {},
|
|
4183
|
+
callbacks: a.callbacks ? JSON.parse(a.callbacks) : [],
|
|
4184
|
+
allowed_origins: a.allowed_origins ? JSON.parse(a.allowed_origins) : [],
|
|
4185
|
+
web_origins: a.web_origins ? JSON.parse(a.web_origins) : [],
|
|
4186
|
+
allowed_logout_urls: a.allowed_logout_urls ? JSON.parse(a.allowed_logout_urls) : []
|
|
4203
4187
|
}))
|
|
4204
4188
|
});
|
|
4205
4189
|
}
|
|
@@ -4210,11 +4194,10 @@ function Sa(n) {
|
|
|
4210
4194
|
...s,
|
|
4211
4195
|
disable_sign_ups: !!s.disable_sign_ups,
|
|
4212
4196
|
addons: JSON.parse(s.addons),
|
|
4213
|
-
// TODO: add callbacks
|
|
4214
4197
|
callback: JSON.parse(s.callbacks),
|
|
4215
4198
|
allowed_origins: JSON.parse(s.allowed_origins),
|
|
4216
|
-
|
|
4217
|
-
|
|
4199
|
+
web_origins: JSON.parse(s.web_origins),
|
|
4200
|
+
allowed_logout_urls: JSON.parse(s.allowed_logout_urls)
|
|
4218
4201
|
}) : null;
|
|
4219
4202
|
};
|
|
4220
4203
|
}
|
|
@@ -4227,9 +4210,9 @@ function ja(n) {
|
|
|
4227
4210
|
...s,
|
|
4228
4211
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4229
4212
|
allowed_origins: s.allowed_origins ? JSON.stringify(s.allowed_origins) : void 0,
|
|
4230
|
-
allowed_callback_urls: s.allowed_callback_urls ? JSON.stringify(s.allowed_callback_urls) : void 0,
|
|
4231
|
-
allowed_web_origins: s.allowed_web_origins ? JSON.stringify(s.allowed_web_origins) : void 0,
|
|
4232
4213
|
callbacks: s.callbacks ? JSON.stringify(s.callbacks) : void 0,
|
|
4214
|
+
web_origins: s.web_origins ? JSON.stringify(s.web_origins) : void 0,
|
|
4215
|
+
allowed_logout_urls: s.allowed_logout_urls ? JSON.stringify(s.allowed_logout_urls) : void 0,
|
|
4233
4216
|
addons: s.addons ? JSON.stringify(s.addons) : "{}",
|
|
4234
4217
|
disable_sign_ups: s.disable_sign_ups ? 1 : 0
|
|
4235
4218
|
};
|
|
@@ -4296,9 +4279,6 @@ function $a(n) {
|
|
|
4296
4279
|
update: Ra(n)
|
|
4297
4280
|
};
|
|
4298
4281
|
}
|
|
4299
|
-
function Xt(n) {
|
|
4300
|
-
return n != null && n.length ? n.split(",").map((e) => e.trim()) : [];
|
|
4301
|
-
}
|
|
4302
4282
|
function Pa(n) {
|
|
4303
4283
|
return {
|
|
4304
4284
|
get: async (e) => {
|
|
@@ -4310,18 +4290,16 @@ function Pa(n) {
|
|
|
4310
4290
|
throw new Et(404, { message: "Tenant not found" });
|
|
4311
4291
|
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();
|
|
4312
4292
|
return {
|
|
4313
|
-
|
|
4314
|
-
name: t.name,
|
|
4293
|
+
...t,
|
|
4315
4294
|
connections: r.map(
|
|
4316
|
-
(c) =>
|
|
4295
|
+
(c) => ln.parse(R(c))
|
|
4317
4296
|
),
|
|
4318
4297
|
domains: a,
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
client_secret: t.client_secret,
|
|
4298
|
+
addons: t.addons ? JSON.parse(t.addons) : {},
|
|
4299
|
+
callbacks: t.callbacks ? JSON.parse(t.callbacks) : [],
|
|
4300
|
+
allowed_origins: t.allowed_origins ? JSON.parse(t.allowed_origins) : [],
|
|
4301
|
+
web_origins: t.web_origins ? JSON.parse(t.web_origins) : [],
|
|
4302
|
+
allowed_logout_urls: t.allowed_logout_urls ? JSON.parse(t.allowed_logout_urls) : [],
|
|
4325
4303
|
tenant: R(s),
|
|
4326
4304
|
// this is really an integer in the database
|
|
4327
4305
|
disable_sign_ups: !!t.disable_sign_ups
|
|
@@ -4646,14 +4624,14 @@ var I;
|
|
|
4646
4624
|
}
|
|
4647
4625
|
n.joinValues = s, n.jsonStringifyReplacer = (r, a) => typeof a == "bigint" ? a.toString() : a;
|
|
4648
4626
|
})(I || (I = {}));
|
|
4649
|
-
var
|
|
4627
|
+
var rn;
|
|
4650
4628
|
(function(n) {
|
|
4651
4629
|
n.mergeShapes = (e, t) => ({
|
|
4652
4630
|
...e,
|
|
4653
4631
|
...t
|
|
4654
4632
|
// second overwrites first
|
|
4655
4633
|
});
|
|
4656
|
-
})(
|
|
4634
|
+
})(rn || (rn = {}));
|
|
4657
4635
|
const g = I.arrayToEnum([
|
|
4658
4636
|
"string",
|
|
4659
4637
|
"nan",
|
|
@@ -4830,12 +4808,12 @@ const qe = (n, e) => {
|
|
|
4830
4808
|
}
|
|
4831
4809
|
return { message: t };
|
|
4832
4810
|
};
|
|
4833
|
-
let
|
|
4811
|
+
let Ln = qe;
|
|
4834
4812
|
function ii(n) {
|
|
4835
|
-
|
|
4813
|
+
Ln = n;
|
|
4836
4814
|
}
|
|
4837
4815
|
function Ut() {
|
|
4838
|
-
return
|
|
4816
|
+
return Ln;
|
|
4839
4817
|
}
|
|
4840
4818
|
const Ft = (n) => {
|
|
4841
4819
|
const { data: e, path: t, errorMaps: s, issueData: r } = n, a = [...t, ...r.path || []], o = {
|
|
@@ -4916,12 +4894,12 @@ class P {
|
|
|
4916
4894
|
}
|
|
4917
4895
|
const b = Object.freeze({
|
|
4918
4896
|
status: "aborted"
|
|
4919
|
-
}), Ve = (n) => ({ status: "dirty", value: n }), M = (n) => ({ status: "valid", value: n }),
|
|
4897
|
+
}), Ve = (n) => ({ status: "dirty", value: n }), M = (n) => ({ status: "valid", value: n }), an = (n) => n.status === "aborted", on = (n) => n.status === "dirty", mt = (n) => n.status === "valid", _t = (n) => typeof Promise < "u" && n instanceof Promise;
|
|
4920
4898
|
function zt(n, e, t, s) {
|
|
4921
4899
|
if (typeof e == "function" ? n !== e || !s : !e.has(n)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4922
4900
|
return e.get(n);
|
|
4923
4901
|
}
|
|
4924
|
-
function
|
|
4902
|
+
function Vn(n, e, t, s, r) {
|
|
4925
4903
|
if (typeof e == "function" ? n !== e || !r : !e.has(n)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
4926
4904
|
return e.set(n, t), t;
|
|
4927
4905
|
}
|
|
@@ -4938,7 +4916,7 @@ class ne {
|
|
|
4938
4916
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
4939
4917
|
}
|
|
4940
4918
|
}
|
|
4941
|
-
const
|
|
4919
|
+
const vn = (n, e) => {
|
|
4942
4920
|
if (mt(e))
|
|
4943
4921
|
return { success: !0, data: e.value };
|
|
4944
4922
|
if (!n.common.issues.length)
|
|
@@ -5028,7 +5006,7 @@ class j {
|
|
|
5028
5006
|
data: e,
|
|
5029
5007
|
parsedType: fe(e)
|
|
5030
5008
|
}, a = this._parseSync({ data: e, path: r.path, parent: r });
|
|
5031
|
-
return
|
|
5009
|
+
return vn(r, a);
|
|
5032
5010
|
}
|
|
5033
5011
|
async parseAsync(e, t) {
|
|
5034
5012
|
const s = await this.safeParseAsync(e, t);
|
|
@@ -5049,7 +5027,7 @@ class j {
|
|
|
5049
5027
|
data: e,
|
|
5050
5028
|
parsedType: fe(e)
|
|
5051
5029
|
}, r = this._parse({ data: e, path: s.path, parent: s }), a = await (_t(r) ? r : Promise.resolve(r));
|
|
5052
|
-
return
|
|
5030
|
+
return vn(s, a);
|
|
5053
5031
|
}
|
|
5054
5032
|
refine(e, t) {
|
|
5055
5033
|
const s = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
|
|
@@ -5113,7 +5091,7 @@ class j {
|
|
|
5113
5091
|
});
|
|
5114
5092
|
}
|
|
5115
5093
|
brand() {
|
|
5116
|
-
return new
|
|
5094
|
+
return new fn({
|
|
5117
5095
|
typeName: k.ZodBranded,
|
|
5118
5096
|
type: this,
|
|
5119
5097
|
...S(this._def)
|
|
@@ -5149,17 +5127,17 @@ class j {
|
|
|
5149
5127
|
}
|
|
5150
5128
|
}
|
|
5151
5129
|
const ci = /^c[^\s-]{8,}$/i, di = /^[0-9a-z]+$/, ui = /^[0-9A-HJKMNP-TV-Z]{26}$/, li = /^[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, pi = /^[a-z0-9_-]{21}$/i, hi = /^[-+]?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)?)??$/, fi = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, mi = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
5152
|
-
let
|
|
5153
|
-
const _i = /^(?:(?: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])$/, gi = /^(([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})))$/, yi = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,
|
|
5154
|
-
function
|
|
5130
|
+
let Xt;
|
|
5131
|
+
const _i = /^(?:(?: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])$/, gi = /^(([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})))$/, yi = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Un = "((\\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])))", vi = new RegExp(`^${Un}$`);
|
|
5132
|
+
function Fn(n) {
|
|
5155
5133
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
5156
5134
|
return n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
5157
5135
|
}
|
|
5158
5136
|
function wi(n) {
|
|
5159
|
-
return new RegExp(`^${
|
|
5137
|
+
return new RegExp(`^${Fn(n)}$`);
|
|
5160
5138
|
}
|
|
5161
|
-
function
|
|
5162
|
-
let e = `${
|
|
5139
|
+
function zn(n) {
|
|
5140
|
+
let e = `${Un}T${Fn(n)}`;
|
|
5163
5141
|
const t = [];
|
|
5164
5142
|
return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
5165
5143
|
}
|
|
@@ -5221,7 +5199,7 @@ class z extends j {
|
|
|
5221
5199
|
message: a.message
|
|
5222
5200
|
}), s.dirty());
|
|
5223
5201
|
else if (a.kind === "emoji")
|
|
5224
|
-
|
|
5202
|
+
Xt || (Xt = new RegExp(mi, "u")), Xt.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5225
5203
|
validation: "emoji",
|
|
5226
5204
|
code: h.invalid_string,
|
|
5227
5205
|
message: a.message
|
|
@@ -5282,7 +5260,7 @@ class z extends j {
|
|
|
5282
5260
|
code: h.invalid_string,
|
|
5283
5261
|
validation: { endsWith: a.value },
|
|
5284
5262
|
message: a.message
|
|
5285
|
-
}), s.dirty()) : a.kind === "datetime" ?
|
|
5263
|
+
}), s.dirty()) : a.kind === "datetime" ? zn(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
5286
5264
|
code: h.invalid_string,
|
|
5287
5265
|
validation: "datetime",
|
|
5288
5266
|
message: a.message
|
|
@@ -6382,7 +6360,7 @@ class A extends j {
|
|
|
6382
6360
|
});
|
|
6383
6361
|
}
|
|
6384
6362
|
keyof() {
|
|
6385
|
-
return
|
|
6363
|
+
return Bn(I.objectKeys(this.shape));
|
|
6386
6364
|
}
|
|
6387
6365
|
}
|
|
6388
6366
|
A.create = (n, e) => new A({
|
|
@@ -6479,7 +6457,7 @@ wt.create = (n, e) => new wt({
|
|
|
6479
6457
|
typeName: k.ZodUnion,
|
|
6480
6458
|
...S(e)
|
|
6481
6459
|
});
|
|
6482
|
-
const ae = (n) => n instanceof xt ? ae(n.schema) : n instanceof J ? ae(n.innerType()) : n instanceof Tt ? [n.value] : n instanceof ke ? n.options : n instanceof Ot ? I.objectValues(n.enum) : n instanceof St ? ae(n._def.innerType) : n instanceof yt ? [void 0] : n instanceof vt ? [null] : n instanceof X ? [void 0, ...ae(n.unwrap())] : n instanceof be ? [null, ...ae(n.unwrap())] : n instanceof
|
|
6460
|
+
const ae = (n) => n instanceof xt ? ae(n.schema) : n instanceof J ? ae(n.innerType()) : n instanceof Tt ? [n.value] : n instanceof ke ? n.options : n instanceof Ot ? I.objectValues(n.enum) : n instanceof St ? ae(n._def.innerType) : n instanceof yt ? [void 0] : n instanceof vt ? [null] : n instanceof X ? [void 0, ...ae(n.unwrap())] : n instanceof be ? [null, ...ae(n.unwrap())] : n instanceof fn || n instanceof jt ? ae(n.unwrap()) : n instanceof Zt ? ae(n._def.innerType) : [];
|
|
6483
6461
|
class Ht extends j {
|
|
6484
6462
|
_parse(e) {
|
|
6485
6463
|
const { ctx: t } = this._processInputParams(e);
|
|
@@ -6542,14 +6520,14 @@ class Ht extends j {
|
|
|
6542
6520
|
});
|
|
6543
6521
|
}
|
|
6544
6522
|
}
|
|
6545
|
-
function
|
|
6523
|
+
function cn(n, e) {
|
|
6546
6524
|
const t = fe(n), s = fe(e);
|
|
6547
6525
|
if (n === e)
|
|
6548
6526
|
return { valid: !0, data: n };
|
|
6549
6527
|
if (t === g.object && s === g.object) {
|
|
6550
6528
|
const r = I.objectKeys(e), a = I.objectKeys(n).filter((c) => r.indexOf(c) !== -1), o = { ...n, ...e };
|
|
6551
6529
|
for (const c of a) {
|
|
6552
|
-
const d =
|
|
6530
|
+
const d = cn(n[c], e[c]);
|
|
6553
6531
|
if (!d.valid)
|
|
6554
6532
|
return { valid: !1 };
|
|
6555
6533
|
o[c] = d.data;
|
|
@@ -6560,7 +6538,7 @@ function dn(n, e) {
|
|
|
6560
6538
|
return { valid: !1 };
|
|
6561
6539
|
const r = [];
|
|
6562
6540
|
for (let a = 0; a < n.length; a++) {
|
|
6563
|
-
const o = n[a], c = e[a], d =
|
|
6541
|
+
const o = n[a], c = e[a], d = cn(o, c);
|
|
6564
6542
|
if (!d.valid)
|
|
6565
6543
|
return { valid: !1 };
|
|
6566
6544
|
r.push(d.data);
|
|
@@ -6571,10 +6549,10 @@ function dn(n, e) {
|
|
|
6571
6549
|
class kt extends j {
|
|
6572
6550
|
_parse(e) {
|
|
6573
6551
|
const { status: t, ctx: s } = this._processInputParams(e), r = (a, o) => {
|
|
6574
|
-
if (
|
|
6552
|
+
if (an(a) || an(o))
|
|
6575
6553
|
return b;
|
|
6576
|
-
const c =
|
|
6577
|
-
return c.valid ? ((
|
|
6554
|
+
const c = cn(a.value, o.value);
|
|
6555
|
+
return c.valid ? ((on(a) || on(o)) && t.dirty(), { status: t.value, value: c.data }) : (m(s, {
|
|
6578
6556
|
code: h.invalid_intersection_types
|
|
6579
6557
|
}), b);
|
|
6580
6558
|
};
|
|
@@ -6945,7 +6923,7 @@ Tt.create = (n, e) => new Tt({
|
|
|
6945
6923
|
typeName: k.ZodLiteral,
|
|
6946
6924
|
...S(e)
|
|
6947
6925
|
});
|
|
6948
|
-
function
|
|
6926
|
+
function Bn(n, e) {
|
|
6949
6927
|
return new ke({
|
|
6950
6928
|
values: n,
|
|
6951
6929
|
typeName: k.ZodEnum,
|
|
@@ -6965,7 +6943,7 @@ class ke extends j {
|
|
|
6965
6943
|
code: h.invalid_type
|
|
6966
6944
|
}), b;
|
|
6967
6945
|
}
|
|
6968
|
-
if (zt(this, Xe) ||
|
|
6946
|
+
if (zt(this, Xe) || Vn(this, Xe, new Set(this._def.values)), !zt(this, Xe).has(e.data)) {
|
|
6969
6947
|
const t = this._getOrReturnCtx(e), s = this._def.values;
|
|
6970
6948
|
return m(t, {
|
|
6971
6949
|
received: t.data,
|
|
@@ -7010,7 +6988,7 @@ class ke extends j {
|
|
|
7010
6988
|
}
|
|
7011
6989
|
}
|
|
7012
6990
|
Xe = /* @__PURE__ */ new WeakMap();
|
|
7013
|
-
ke.create =
|
|
6991
|
+
ke.create = Bn;
|
|
7014
6992
|
class Ot extends j {
|
|
7015
6993
|
constructor() {
|
|
7016
6994
|
super(...arguments), et.set(this, void 0);
|
|
@@ -7025,7 +7003,7 @@ class Ot extends j {
|
|
|
7025
7003
|
code: h.invalid_type
|
|
7026
7004
|
}), b;
|
|
7027
7005
|
}
|
|
7028
|
-
if (zt(this, et) ||
|
|
7006
|
+
if (zt(this, et) || Vn(this, et, new Set(I.getValidEnumValues(this._def.values))), !zt(this, et).has(e.data)) {
|
|
7029
7007
|
const r = I.objectValues(t);
|
|
7030
7008
|
return m(s, {
|
|
7031
7009
|
received: s.data,
|
|
@@ -7265,7 +7243,7 @@ Jt.create = (n) => new Jt({
|
|
|
7265
7243
|
...S(n)
|
|
7266
7244
|
});
|
|
7267
7245
|
const xi = Symbol("zod_brand");
|
|
7268
|
-
class
|
|
7246
|
+
class fn extends j {
|
|
7269
7247
|
_parse(e) {
|
|
7270
7248
|
const { ctx: t } = this._processInputParams(e), s = t.data;
|
|
7271
7249
|
return this._def.type._parse({
|
|
@@ -7332,7 +7310,7 @@ jt.create = (n, e) => new jt({
|
|
|
7332
7310
|
typeName: k.ZodReadonly,
|
|
7333
7311
|
...S(e)
|
|
7334
7312
|
});
|
|
7335
|
-
function
|
|
7313
|
+
function Wn(n, e = {}, t) {
|
|
7336
7314
|
return n ? Je.create().superRefine((s, r) => {
|
|
7337
7315
|
var a, o;
|
|
7338
7316
|
if (!n(s)) {
|
|
@@ -7350,7 +7328,7 @@ var k;
|
|
|
7350
7328
|
})(k || (k = {}));
|
|
7351
7329
|
const Oi = (n, e = {
|
|
7352
7330
|
message: `Input not instance of ${n.name}`
|
|
7353
|
-
}) =>
|
|
7331
|
+
}) => Wn((t) => t instanceof n, e), qn = z.create, Jn = ve.create, Si = Jt.create, Zi = we.create, Kn = gt.create, ji = Ce.create, Ni = Bt.create, Ii = yt.create, Ci = vt.create, Ei = Je.create, Ai = je.create, Ri = oe.create, $i = Wt.create, Pi = W.create, Di = A.create, Mi = A.strictCreate, Li = wt.create, Vi = Ht.create, Ui = kt.create, Fi = se.create, zi = bt.create, Bi = qt.create, Wi = Ee.create, qi = Fe.create, Ji = xt.create, Ki = Tt.create, Qi = ke.create, Hi = Ot.create, Yi = Ke.create, wn = J.create, Gi = X.create, Xi = be.create, eo = J.createWithPreprocess, to = It.create, no = () => qn().optional(), so = () => Jn().optional(), ro = () => Kn().optional(), ao = {
|
|
7354
7332
|
string: (n) => z.create({ ...n, coerce: !0 }),
|
|
7355
7333
|
number: (n) => ve.create({ ...n, coerce: !0 }),
|
|
7356
7334
|
boolean: (n) => gt.create({
|
|
@@ -7372,20 +7350,20 @@ var oo = /* @__PURE__ */ Object.freeze({
|
|
|
7372
7350
|
INVALID: b,
|
|
7373
7351
|
DIRTY: Ve,
|
|
7374
7352
|
OK: M,
|
|
7375
|
-
isAborted:
|
|
7376
|
-
isDirty:
|
|
7353
|
+
isAborted: an,
|
|
7354
|
+
isDirty: on,
|
|
7377
7355
|
isValid: mt,
|
|
7378
7356
|
isAsync: _t,
|
|
7379
7357
|
get util() {
|
|
7380
7358
|
return I;
|
|
7381
7359
|
},
|
|
7382
7360
|
get objectUtil() {
|
|
7383
|
-
return
|
|
7361
|
+
return rn;
|
|
7384
7362
|
},
|
|
7385
7363
|
ZodParsedType: g,
|
|
7386
7364
|
getParsedType: fe,
|
|
7387
7365
|
ZodType: j,
|
|
7388
|
-
datetimeRegex:
|
|
7366
|
+
datetimeRegex: zn,
|
|
7389
7367
|
ZodString: z,
|
|
7390
7368
|
ZodNumber: ve,
|
|
7391
7369
|
ZodBigInt: we,
|
|
@@ -7421,10 +7399,10 @@ var oo = /* @__PURE__ */ Object.freeze({
|
|
|
7421
7399
|
ZodCatch: Zt,
|
|
7422
7400
|
ZodNaN: Jt,
|
|
7423
7401
|
BRAND: xi,
|
|
7424
|
-
ZodBranded:
|
|
7402
|
+
ZodBranded: fn,
|
|
7425
7403
|
ZodPipeline: It,
|
|
7426
7404
|
ZodReadonly: jt,
|
|
7427
|
-
custom:
|
|
7405
|
+
custom: Wn,
|
|
7428
7406
|
Schema: j,
|
|
7429
7407
|
ZodSchema: j,
|
|
7430
7408
|
late: Ti,
|
|
@@ -7435,10 +7413,10 @@ var oo = /* @__PURE__ */ Object.freeze({
|
|
|
7435
7413
|
any: Ei,
|
|
7436
7414
|
array: Pi,
|
|
7437
7415
|
bigint: Zi,
|
|
7438
|
-
boolean:
|
|
7416
|
+
boolean: Kn,
|
|
7439
7417
|
date: ji,
|
|
7440
7418
|
discriminatedUnion: Vi,
|
|
7441
|
-
effect:
|
|
7419
|
+
effect: wn,
|
|
7442
7420
|
enum: Qi,
|
|
7443
7421
|
function: qi,
|
|
7444
7422
|
instanceof: Oi,
|
|
@@ -7451,7 +7429,7 @@ var oo = /* @__PURE__ */ Object.freeze({
|
|
|
7451
7429
|
never: Ri,
|
|
7452
7430
|
null: Ci,
|
|
7453
7431
|
nullable: Xi,
|
|
7454
|
-
number:
|
|
7432
|
+
number: Jn,
|
|
7455
7433
|
object: Di,
|
|
7456
7434
|
oboolean: ro,
|
|
7457
7435
|
onumber: so,
|
|
@@ -7463,9 +7441,9 @@ var oo = /* @__PURE__ */ Object.freeze({
|
|
|
7463
7441
|
record: zi,
|
|
7464
7442
|
set: Wi,
|
|
7465
7443
|
strictObject: Mi,
|
|
7466
|
-
string:
|
|
7444
|
+
string: qn,
|
|
7467
7445
|
symbol: Ni,
|
|
7468
|
-
transformer:
|
|
7446
|
+
transformer: wn,
|
|
7469
7447
|
tuple: Fi,
|
|
7470
7448
|
undefined: Ii,
|
|
7471
7449
|
union: Li,
|