@authhero/kysely-adapter 0.11.0 → 0.11.2
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 +68 -0
- package/dist/kysely-adapter.iife.js +1 -1
- package/dist/kysely-adapter.mjs +361 -352
- package/package.json +2 -2
package/dist/kysely-adapter.mjs
CHANGED
|
@@ -70,13 +70,13 @@ 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
|
-
var o,
|
|
74
|
-
const A = typeof r == "string" ? a : r, U = A ?? {}, { param: ie } = U, Re = Gn(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),
|
|
73
|
+
var o, d, c, u, l, j;
|
|
74
|
+
const A = typeof r == "string" ? a : r, U = A ?? {}, { param: ie } = U, Re = Gn(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), de = Object.assign(Object.assign(Object.assign({}, (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata), Re), !((u = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.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
|
-
} : void 0),
|
|
76
|
+
} : void 0), ce = 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(de).length > 0 ? { metadata: de } : void 0) }));
|
|
77
77
|
if (Xn(this, "ZodObject")) {
|
|
78
78
|
const $e = this.extend;
|
|
79
|
-
|
|
79
|
+
ce.extend = function(...Pe) {
|
|
80
80
|
var K, H, Q, ue, xe, Te;
|
|
81
81
|
const Oe = $e.apply(this, Pe);
|
|
82
82
|
return Oe._def.openapi = {
|
|
@@ -87,14 +87,14 @@ function es(n) {
|
|
|
87
87
|
}, Oe;
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
|
-
return
|
|
90
|
+
return ce;
|
|
91
91
|
}, He(n, "optional"), He(n, "nullable"), He(n, "default"), He(n, "transform"), He(n, "refine");
|
|
92
92
|
const e = n.ZodObject.prototype.deepPartial;
|
|
93
93
|
n.ZodObject.prototype.deepPartial = function() {
|
|
94
94
|
const r = this._def.shape(), a = e.apply(this), o = a._def.shape();
|
|
95
|
-
return Object.entries(o).forEach(([
|
|
95
|
+
return Object.entries(o).forEach(([d, c]) => {
|
|
96
96
|
var u, l;
|
|
97
|
-
|
|
97
|
+
c._def.openapi = (l = (u = r[d]) === null || u === void 0 ? void 0 : u._def) === null || l === void 0 ? void 0 : l.openapi;
|
|
98
98
|
}), a._def.openapi = void 0, a;
|
|
99
99
|
};
|
|
100
100
|
const t = n.ZodObject.prototype.pick;
|
|
@@ -124,9 +124,9 @@ var N;
|
|
|
124
124
|
a[o] = o;
|
|
125
125
|
return a;
|
|
126
126
|
}, n.getValidEnumValues = (r) => {
|
|
127
|
-
const a = n.objectKeys(r).filter((
|
|
128
|
-
for (const
|
|
129
|
-
o[
|
|
127
|
+
const a = n.objectKeys(r).filter((d) => typeof r[r[d]] != "number"), o = {};
|
|
128
|
+
for (const d of a)
|
|
129
|
+
o[d] = r[d];
|
|
130
130
|
return n.objectValues(o);
|
|
131
131
|
}, n.objectValues = (r) => n.objectKeys(r).map(function(a) {
|
|
132
132
|
return r[a];
|
|
@@ -240,10 +240,10 @@ class L extends Error {
|
|
|
240
240
|
else if (o.path.length === 0)
|
|
241
241
|
s._errors.push(t(o));
|
|
242
242
|
else {
|
|
243
|
-
let
|
|
244
|
-
for (;
|
|
245
|
-
const u = o.path[
|
|
246
|
-
|
|
243
|
+
let d = s, c = 0;
|
|
244
|
+
for (; c < o.path.length; ) {
|
|
245
|
+
const u = o.path[c];
|
|
246
|
+
c === o.path.length - 1 ? (d[u] = d[u] || { _errors: [] }, d[u]._errors.push(t(o))) : d[u] = d[u] || { _errors: [] }, d = d[u], c++;
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
};
|
|
@@ -347,14 +347,14 @@ const At = (n) => {
|
|
|
347
347
|
path: a,
|
|
348
348
|
message: r.message
|
|
349
349
|
};
|
|
350
|
-
let
|
|
351
|
-
const
|
|
352
|
-
for (const u of
|
|
353
|
-
|
|
350
|
+
let d = "";
|
|
351
|
+
const c = s.filter((u) => !!u).slice().reverse();
|
|
352
|
+
for (const u of c)
|
|
353
|
+
d = u(o, { data: e, defaultError: d }).message;
|
|
354
354
|
return {
|
|
355
355
|
...r,
|
|
356
356
|
path: a,
|
|
357
|
-
message:
|
|
357
|
+
message: d
|
|
358
358
|
};
|
|
359
359
|
}, ss = [];
|
|
360
360
|
function f(n, e) {
|
|
@@ -459,9 +459,9 @@ function T(n) {
|
|
|
459
459
|
if (e && (t || s))
|
|
460
460
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
461
461
|
return e ? { errorMap: e, description: r } : { errorMap: (a, o) => {
|
|
462
|
-
var
|
|
462
|
+
var d, c;
|
|
463
463
|
const { message: u } = n;
|
|
464
|
-
return a.code === "invalid_enum_value" ? { message: u ?? o.defaultError } : typeof o.data > "u" ? { message: (
|
|
464
|
+
return a.code === "invalid_enum_value" ? { message: u ?? o.defaultError } : typeof o.data > "u" ? { message: (d = u ?? s) !== null && d !== void 0 ? d : o.defaultError } : a.code !== "invalid_type" ? { message: o.defaultError } : { message: (c = u ?? t) !== null && c !== void 0 ? c : o.defaultError };
|
|
465
465
|
}, description: r };
|
|
466
466
|
}
|
|
467
467
|
class S {
|
|
@@ -553,11 +553,11 @@ class S {
|
|
|
553
553
|
refine(e, t) {
|
|
554
554
|
const s = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
|
|
555
555
|
return this._refinement((r, a) => {
|
|
556
|
-
const o = e(r),
|
|
556
|
+
const o = e(r), d = () => a.addIssue({
|
|
557
557
|
code: p.custom,
|
|
558
558
|
...s(r)
|
|
559
559
|
});
|
|
560
|
-
return typeof Promise < "u" && o instanceof Promise ? o.then((
|
|
560
|
+
return typeof Promise < "u" && o instanceof Promise ? o.then((c) => c ? !0 : (d(), !1)) : o ? !0 : (d(), !1);
|
|
561
561
|
});
|
|
562
562
|
}
|
|
563
563
|
refinement(e, t) {
|
|
@@ -612,7 +612,7 @@ class S {
|
|
|
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
|
...T(this._def)
|
|
@@ -647,7 +647,7 @@ class S {
|
|
|
647
647
|
return this.safeParse(null).success;
|
|
648
648
|
}
|
|
649
649
|
}
|
|
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,
|
|
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, ds = /^[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)?)??$/, 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 Qt;
|
|
652
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}=))?$/, 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])))", ms = new RegExp(`^${kn}$`);
|
|
653
653
|
function xn(n) {
|
|
@@ -732,7 +732,7 @@ class F extends S {
|
|
|
732
732
|
message: r.message
|
|
733
733
|
}), t.dirty());
|
|
734
734
|
else if (r.kind === "nanoid")
|
|
735
|
-
|
|
735
|
+
ds.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
|
|
@@ -793,7 +793,7 @@ class F extends 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
|
|
@@ -1539,10 +1539,10 @@ class B extends S {
|
|
|
1539
1539
|
received: t.parsedType
|
|
1540
1540
|
}), x;
|
|
1541
1541
|
if (r.exactLength !== null) {
|
|
1542
|
-
const o = t.data.length > r.exactLength.value,
|
|
1543
|
-
(o ||
|
|
1542
|
+
const o = t.data.length > r.exactLength.value, d = t.data.length < r.exactLength.value;
|
|
1543
|
+
(o || d) && (f(t, {
|
|
1544
1544
|
code: o ? p.too_big : p.too_small,
|
|
1545
|
-
minimum:
|
|
1545
|
+
minimum: d ? r.exactLength.value : void 0,
|
|
1546
1546
|
maximum: o ? r.exactLength.value : void 0,
|
|
1547
1547
|
type: "array",
|
|
1548
1548
|
inclusive: !0,
|
|
@@ -1565,8 +1565,8 @@ class B extends S {
|
|
|
1565
1565
|
exact: !1,
|
|
1566
1566
|
message: r.maxLength.message
|
|
1567
1567
|
}), s.dirty()), t.common.async)
|
|
1568
|
-
return Promise.all([...t.data].map((o,
|
|
1569
|
-
const a = [...t.data].map((o,
|
|
1568
|
+
return Promise.all([...t.data].map((o, d) => r.type._parseAsync(new X(t, o, t.path, d)))).then((o) => $.mergeArray(s, o));
|
|
1569
|
+
const a = [...t.data].map((o, d) => r.type._parseSync(new X(t, o, t.path, d)));
|
|
1570
1570
|
return $.mergeArray(s, a);
|
|
1571
1571
|
}
|
|
1572
1572
|
get element() {
|
|
@@ -1630,47 +1630,47 @@ class I extends S {
|
|
|
1630
1630
|
}
|
|
1631
1631
|
_parse(e) {
|
|
1632
1632
|
if (this._getType(e) !== _.object) {
|
|
1633
|
-
const
|
|
1634
|
-
return f(
|
|
1633
|
+
const c = this._getOrReturnCtx(e);
|
|
1634
|
+
return f(c, {
|
|
1635
1635
|
code: p.invalid_type,
|
|
1636
1636
|
expected: _.object,
|
|
1637
|
-
received:
|
|
1637
|
+
received: c.parsedType
|
|
1638
1638
|
}), x;
|
|
1639
1639
|
}
|
|
1640
1640
|
const { status: t, ctx: s } = this._processInputParams(e), { shape: r, keys: a } = this._getCached(), o = [];
|
|
1641
1641
|
if (!(this._def.catchall instanceof re && this._def.unknownKeys === "strip"))
|
|
1642
|
-
for (const
|
|
1643
|
-
a.includes(
|
|
1644
|
-
const
|
|
1645
|
-
for (const
|
|
1646
|
-
const u = r[
|
|
1647
|
-
|
|
1648
|
-
key: { status: "valid", value:
|
|
1649
|
-
value: u._parse(new X(s, l, s.path,
|
|
1650
|
-
alwaysSet:
|
|
1642
|
+
for (const c in s.data)
|
|
1643
|
+
a.includes(c) || o.push(c);
|
|
1644
|
+
const d = [];
|
|
1645
|
+
for (const c of a) {
|
|
1646
|
+
const u = r[c], l = s.data[c];
|
|
1647
|
+
d.push({
|
|
1648
|
+
key: { status: "valid", value: c },
|
|
1649
|
+
value: u._parse(new X(s, l, s.path, c)),
|
|
1650
|
+
alwaysSet: c in s.data
|
|
1651
1651
|
});
|
|
1652
1652
|
}
|
|
1653
1653
|
if (this._def.catchall instanceof re) {
|
|
1654
|
-
const
|
|
1655
|
-
if (
|
|
1654
|
+
const c = this._def.unknownKeys;
|
|
1655
|
+
if (c === "passthrough")
|
|
1656
1656
|
for (const u of o)
|
|
1657
|
-
|
|
1657
|
+
d.push({
|
|
1658
1658
|
key: { status: "valid", value: u },
|
|
1659
1659
|
value: { status: "valid", value: s.data[u] }
|
|
1660
1660
|
});
|
|
1661
|
-
else if (
|
|
1661
|
+
else if (c === "strict")
|
|
1662
1662
|
o.length > 0 && (f(s, {
|
|
1663
1663
|
code: p.unrecognized_keys,
|
|
1664
1664
|
keys: o
|
|
1665
1665
|
}), t.dirty());
|
|
1666
|
-
else if (
|
|
1666
|
+
else if (c !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
1667
1667
|
} else {
|
|
1668
|
-
const
|
|
1668
|
+
const c = this._def.catchall;
|
|
1669
1669
|
for (const u of o) {
|
|
1670
1670
|
const l = s.data[u];
|
|
1671
|
-
|
|
1671
|
+
d.push({
|
|
1672
1672
|
key: { status: "valid", value: u },
|
|
1673
|
-
value:
|
|
1673
|
+
value: c._parse(
|
|
1674
1674
|
new X(s, l, s.path, u)
|
|
1675
1675
|
//, ctx.child(key), value, getParsedType(value)
|
|
1676
1676
|
),
|
|
@@ -1679,17 +1679,17 @@ class I extends S {
|
|
|
1679
1679
|
}
|
|
1680
1680
|
}
|
|
1681
1681
|
return s.common.async ? Promise.resolve().then(async () => {
|
|
1682
|
-
const
|
|
1683
|
-
for (const u of
|
|
1682
|
+
const c = [];
|
|
1683
|
+
for (const u of d) {
|
|
1684
1684
|
const l = await u.key, j = await u.value;
|
|
1685
|
-
|
|
1685
|
+
c.push({
|
|
1686
1686
|
key: l,
|
|
1687
1687
|
value: j,
|
|
1688
1688
|
alwaysSet: u.alwaysSet
|
|
1689
1689
|
});
|
|
1690
1690
|
}
|
|
1691
|
-
return
|
|
1692
|
-
}).then((
|
|
1691
|
+
return c;
|
|
1692
|
+
}).then((c) => $.mergeObjectSync(t, c)) : $.mergeObjectSync(t, d);
|
|
1693
1693
|
}
|
|
1694
1694
|
get shape() {
|
|
1695
1695
|
return this._def.shape();
|
|
@@ -1700,12 +1700,12 @@ class I extends S {
|
|
|
1700
1700
|
unknownKeys: "strict",
|
|
1701
1701
|
...e !== void 0 ? {
|
|
1702
1702
|
errorMap: (t, s) => {
|
|
1703
|
-
var r, a, o,
|
|
1704
|
-
const
|
|
1703
|
+
var r, a, o, d;
|
|
1704
|
+
const c = (o = (a = (r = this._def).errorMap) === null || a === void 0 ? void 0 : a.call(r, t, s).message) !== null && o !== void 0 ? o : s.defaultError;
|
|
1705
1705
|
return t.code === "unrecognized_keys" ? {
|
|
1706
|
-
message: (
|
|
1706
|
+
message: (d = y.errToObj(e).message) !== null && d !== void 0 ? d : c
|
|
1707
1707
|
} : {
|
|
1708
|
-
message:
|
|
1708
|
+
message: c
|
|
1709
1709
|
};
|
|
1710
1710
|
}
|
|
1711
1711
|
} : {}
|
|
@@ -1909,13 +1909,13 @@ class it extends S {
|
|
|
1909
1909
|
_parse(e) {
|
|
1910
1910
|
const { ctx: t } = this._processInputParams(e), s = this._def.options;
|
|
1911
1911
|
function r(a) {
|
|
1912
|
-
for (const
|
|
1913
|
-
if (
|
|
1914
|
-
return
|
|
1915
|
-
for (const
|
|
1916
|
-
if (
|
|
1917
|
-
return t.common.issues.push(...
|
|
1918
|
-
const o = a.map((
|
|
1912
|
+
for (const d of a)
|
|
1913
|
+
if (d.result.status === "valid")
|
|
1914
|
+
return d.result;
|
|
1915
|
+
for (const d of a)
|
|
1916
|
+
if (d.result.status === "dirty")
|
|
1917
|
+
return t.common.issues.push(...d.ctx.common.issues), d.result;
|
|
1918
|
+
const o = a.map((d) => new L(d.ctx.common.issues));
|
|
1919
1919
|
return f(t, {
|
|
1920
1920
|
code: p.invalid_union,
|
|
1921
1921
|
unionErrors: o
|
|
@@ -1943,7 +1943,7 @@ class it extends S {
|
|
|
1943
1943
|
{
|
|
1944
1944
|
let a;
|
|
1945
1945
|
const o = [];
|
|
1946
|
-
for (const
|
|
1946
|
+
for (const c of s) {
|
|
1947
1947
|
const u = {
|
|
1948
1948
|
...t,
|
|
1949
1949
|
common: {
|
|
@@ -1951,7 +1951,7 @@ class it extends S {
|
|
|
1951
1951
|
issues: []
|
|
1952
1952
|
},
|
|
1953
1953
|
parent: null
|
|
1954
|
-
}, l =
|
|
1954
|
+
}, l = c._parseSync({
|
|
1955
1955
|
data: t.data,
|
|
1956
1956
|
path: t.path,
|
|
1957
1957
|
parent: u
|
|
@@ -1962,10 +1962,10 @@ class it extends S {
|
|
|
1962
1962
|
}
|
|
1963
1963
|
if (a)
|
|
1964
1964
|
return t.common.issues.push(...a.ctx.common.issues), a.result;
|
|
1965
|
-
const
|
|
1965
|
+
const d = o.map((c) => new L(c));
|
|
1966
1966
|
return f(t, {
|
|
1967
1967
|
code: p.invalid_union,
|
|
1968
|
-
unionErrors:
|
|
1968
|
+
unionErrors: d
|
|
1969
1969
|
}), x;
|
|
1970
1970
|
}
|
|
1971
1971
|
}
|
|
@@ -1978,7 +1978,7 @@ it.create = (n, e) => new it({
|
|
|
1978
1978
|
typeName: w.ZodUnion,
|
|
1979
1979
|
...T(e)
|
|
1980
1980
|
});
|
|
1981
|
-
const le = (n) => n instanceof
|
|
1981
|
+
const le = (n) => n instanceof ct ? le(n.schema) : n instanceof q ? le(n.innerType()) : n instanceof ut ? [n.value] : n instanceof _e ? n.options : n instanceof lt ? N.objectValues(n.enum) : n instanceof pt ? le(n._def.innerType) : n instanceof rt ? [void 0] : n instanceof at ? [null] : n instanceof Y ? [void 0, ...le(n.unwrap())] : n instanceof ge ? [null, ...le(n.unwrap())] : n instanceof dn || n instanceof ft ? le(n.unwrap()) : n instanceof ht ? le(n._def.innerType) : [];
|
|
1982
1982
|
class Jt extends S {
|
|
1983
1983
|
_parse(e) {
|
|
1984
1984
|
const { ctx: t } = this._processInputParams(e);
|
|
@@ -2026,10 +2026,10 @@ class Jt extends S {
|
|
|
2026
2026
|
const o = le(a.shape[e]);
|
|
2027
2027
|
if (!o.length)
|
|
2028
2028
|
throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
|
|
2029
|
-
for (const
|
|
2030
|
-
if (r.has(
|
|
2031
|
-
throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(
|
|
2032
|
-
r.set(
|
|
2029
|
+
for (const d of o) {
|
|
2030
|
+
if (r.has(d))
|
|
2031
|
+
throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);
|
|
2032
|
+
r.set(d, a);
|
|
2033
2033
|
}
|
|
2034
2034
|
}
|
|
2035
2035
|
return new Jt({
|
|
@@ -2046,12 +2046,12 @@ function nn(n, e) {
|
|
|
2046
2046
|
if (n === e)
|
|
2047
2047
|
return { valid: !0, data: n };
|
|
2048
2048
|
if (t === _.object && s === _.object) {
|
|
2049
|
-
const r = N.objectKeys(e), a = N.objectKeys(n).filter((
|
|
2050
|
-
for (const
|
|
2051
|
-
const
|
|
2052
|
-
if (!
|
|
2049
|
+
const r = N.objectKeys(e), a = N.objectKeys(n).filter((d) => r.indexOf(d) !== -1), o = { ...n, ...e };
|
|
2050
|
+
for (const d of a) {
|
|
2051
|
+
const c = nn(n[d], e[d]);
|
|
2052
|
+
if (!c.valid)
|
|
2053
2053
|
return { valid: !1 };
|
|
2054
|
-
o[
|
|
2054
|
+
o[d] = c.data;
|
|
2055
2055
|
}
|
|
2056
2056
|
return { valid: !0, data: o };
|
|
2057
2057
|
} else if (t === _.array && s === _.array) {
|
|
@@ -2059,10 +2059,10 @@ function nn(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],
|
|
2063
|
-
if (!
|
|
2062
|
+
const o = n[a], d = e[a], c = nn(o, d);
|
|
2063
|
+
if (!c.valid)
|
|
2064
2064
|
return { valid: !1 };
|
|
2065
|
-
r.push(
|
|
2065
|
+
r.push(c.data);
|
|
2066
2066
|
}
|
|
2067
2067
|
return { valid: !0, data: r };
|
|
2068
2068
|
} else return t === _.date && s === _.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
|
|
@@ -2072,8 +2072,8 @@ class ot extends S {
|
|
|
2072
2072
|
const { status: t, ctx: s } = this._processInputParams(e), r = (a, o) => {
|
|
2073
2073
|
if (en(a) || en(o))
|
|
2074
2074
|
return x;
|
|
2075
|
-
const
|
|
2076
|
-
return
|
|
2075
|
+
const d = nn(a.value, o.value);
|
|
2076
|
+
return d.valid ? ((tn(a) || tn(o)) && t.dirty(), { status: t.value, value: d.data }) : (f(s, {
|
|
2077
2077
|
code: p.invalid_intersection_types
|
|
2078
2078
|
}), x);
|
|
2079
2079
|
};
|
|
@@ -2130,8 +2130,8 @@ class ee extends S {
|
|
|
2130
2130
|
type: "array"
|
|
2131
2131
|
}), t.dirty());
|
|
2132
2132
|
const r = [...s.data].map((a, o) => {
|
|
2133
|
-
const
|
|
2134
|
-
return
|
|
2133
|
+
const d = this._def.items[o] || this._def.rest;
|
|
2134
|
+
return d ? d._parse(new X(s, a, s.path, o)) : null;
|
|
2135
2135
|
}).filter((a) => !!a);
|
|
2136
2136
|
return s.common.async ? Promise.all(r).then((a) => $.mergeArray(t, a)) : $.mergeArray(t, r);
|
|
2137
2137
|
}
|
|
@@ -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
|
}
|
|
@@ -2171,11 +2171,11 @@ class ct extends S {
|
|
|
2171
2171
|
received: s.parsedType
|
|
2172
2172
|
}), x;
|
|
2173
2173
|
const r = [], a = this._def.keyType, o = this._def.valueType;
|
|
2174
|
-
for (const
|
|
2174
|
+
for (const d in s.data)
|
|
2175
2175
|
r.push({
|
|
2176
|
-
key: a._parse(new X(s,
|
|
2177
|
-
value: o._parse(new X(s, s.data[
|
|
2178
|
-
alwaysSet:
|
|
2176
|
+
key: a._parse(new X(s, d, s.path, d)),
|
|
2177
|
+
value: o._parse(new X(s, s.data[d], s.path, d)),
|
|
2178
|
+
alwaysSet: d in s.data
|
|
2179
2179
|
});
|
|
2180
2180
|
return s.common.async ? $.mergeObjectAsync(t, r) : $.mergeObjectSync(t, r);
|
|
2181
2181
|
}
|
|
@@ -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,
|
|
@@ -2211,30 +2211,30 @@ class Mt extends S {
|
|
|
2211
2211
|
expected: _.map,
|
|
2212
2212
|
received: s.parsedType
|
|
2213
2213
|
}), x;
|
|
2214
|
-
const r = this._def.keyType, a = this._def.valueType, o = [...s.data.entries()].map(([
|
|
2215
|
-
key: r._parse(new X(s,
|
|
2216
|
-
value: a._parse(new X(s,
|
|
2214
|
+
const r = this._def.keyType, a = this._def.valueType, o = [...s.data.entries()].map(([d, c], u) => ({
|
|
2215
|
+
key: r._parse(new X(s, d, s.path, [u, "key"])),
|
|
2216
|
+
value: a._parse(new X(s, c, s.path, [u, "value"]))
|
|
2217
2217
|
}));
|
|
2218
2218
|
if (s.common.async) {
|
|
2219
|
-
const
|
|
2219
|
+
const d = /* @__PURE__ */ new Map();
|
|
2220
2220
|
return Promise.resolve().then(async () => {
|
|
2221
|
-
for (const
|
|
2222
|
-
const u = await
|
|
2221
|
+
for (const c of o) {
|
|
2222
|
+
const u = await c.key, l = await c.value;
|
|
2223
2223
|
if (u.status === "aborted" || l.status === "aborted")
|
|
2224
2224
|
return x;
|
|
2225
|
-
(u.status === "dirty" || l.status === "dirty") && t.dirty(),
|
|
2225
|
+
(u.status === "dirty" || l.status === "dirty") && t.dirty(), d.set(u.value, l.value);
|
|
2226
2226
|
}
|
|
2227
|
-
return { status: t.value, value:
|
|
2227
|
+
return { status: t.value, value: d };
|
|
2228
2228
|
});
|
|
2229
2229
|
} else {
|
|
2230
|
-
const
|
|
2231
|
-
for (const
|
|
2232
|
-
const u =
|
|
2230
|
+
const d = /* @__PURE__ */ new Map();
|
|
2231
|
+
for (const c of o) {
|
|
2232
|
+
const u = c.key, l = c.value;
|
|
2233
2233
|
if (u.status === "aborted" || l.status === "aborted")
|
|
2234
2234
|
return x;
|
|
2235
|
-
(u.status === "dirty" || l.status === "dirty") && t.dirty(),
|
|
2235
|
+
(u.status === "dirty" || l.status === "dirty") && t.dirty(), d.set(u.value, l.value);
|
|
2236
2236
|
}
|
|
2237
|
-
return { status: t.value, value:
|
|
2237
|
+
return { status: t.value, value: d };
|
|
2238
2238
|
}
|
|
2239
2239
|
}
|
|
2240
2240
|
}
|
|
@@ -2270,17 +2270,17 @@ class Ne extends S {
|
|
|
2270
2270
|
message: r.maxSize.message
|
|
2271
2271
|
}), t.dirty());
|
|
2272
2272
|
const a = this._def.valueType;
|
|
2273
|
-
function o(
|
|
2273
|
+
function o(c) {
|
|
2274
2274
|
const u = /* @__PURE__ */ new Set();
|
|
2275
|
-
for (const l of
|
|
2275
|
+
for (const l of c) {
|
|
2276
2276
|
if (l.status === "aborted")
|
|
2277
2277
|
return x;
|
|
2278
2278
|
l.status === "dirty" && t.dirty(), u.add(l.value);
|
|
2279
2279
|
}
|
|
2280
2280
|
return { status: t.value, value: u };
|
|
2281
2281
|
}
|
|
2282
|
-
const
|
|
2283
|
-
return s.common.async ? Promise.all(
|
|
2282
|
+
const d = [...s.data.values()].map((c, u) => a._parse(new X(s, c, s.path, u)));
|
|
2283
|
+
return s.common.async ? Promise.all(d).then((c) => o(c)) : o(d);
|
|
2284
2284
|
}
|
|
2285
2285
|
min(e, t) {
|
|
2286
2286
|
return new Ne({
|
|
@@ -2320,9 +2320,9 @@ class Ue extends S {
|
|
|
2320
2320
|
expected: _.function,
|
|
2321
2321
|
received: t.parsedType
|
|
2322
2322
|
}), x;
|
|
2323
|
-
function s(
|
|
2323
|
+
function s(d, c) {
|
|
2324
2324
|
return At({
|
|
2325
|
-
data:
|
|
2325
|
+
data: d,
|
|
2326
2326
|
path: t.path,
|
|
2327
2327
|
errorMaps: [
|
|
2328
2328
|
t.common.contextualErrorMap,
|
|
@@ -2332,13 +2332,13 @@ class Ue extends S {
|
|
|
2332
2332
|
].filter((u) => !!u),
|
|
2333
2333
|
issueData: {
|
|
2334
2334
|
code: p.invalid_arguments,
|
|
2335
|
-
argumentsError:
|
|
2335
|
+
argumentsError: c
|
|
2336
2336
|
}
|
|
2337
2337
|
});
|
|
2338
2338
|
}
|
|
2339
|
-
function r(
|
|
2339
|
+
function r(d, c) {
|
|
2340
2340
|
return At({
|
|
2341
|
-
data:
|
|
2341
|
+
data: d,
|
|
2342
2342
|
path: t.path,
|
|
2343
2343
|
errorMaps: [
|
|
2344
2344
|
t.common.contextualErrorMap,
|
|
@@ -2348,28 +2348,28 @@ class Ue extends S {
|
|
|
2348
2348
|
].filter((u) => !!u),
|
|
2349
2349
|
issueData: {
|
|
2350
2350
|
code: p.invalid_return_type,
|
|
2351
|
-
returnTypeError:
|
|
2351
|
+
returnTypeError: c
|
|
2352
2352
|
}
|
|
2353
2353
|
});
|
|
2354
2354
|
}
|
|
2355
2355
|
const a = { errorMap: t.common.contextualErrorMap }, o = t.data;
|
|
2356
2356
|
if (this._def.returns instanceof We) {
|
|
2357
|
-
const
|
|
2358
|
-
return D(async function(...
|
|
2359
|
-
const u = new L([]), l = await
|
|
2360
|
-
throw u.addIssue(s(
|
|
2357
|
+
const d = this;
|
|
2358
|
+
return D(async function(...c) {
|
|
2359
|
+
const u = new L([]), l = await d._def.args.parseAsync(c, a).catch((A) => {
|
|
2360
|
+
throw u.addIssue(s(c, A)), u;
|
|
2361
2361
|
}), j = await Reflect.apply(o, this, l);
|
|
2362
|
-
return await
|
|
2362
|
+
return await d._def.returns._def.type.parseAsync(j, a).catch((A) => {
|
|
2363
2363
|
throw u.addIssue(r(j, A)), u;
|
|
2364
2364
|
});
|
|
2365
2365
|
});
|
|
2366
2366
|
} else {
|
|
2367
|
-
const
|
|
2368
|
-
return D(function(...
|
|
2369
|
-
const u =
|
|
2367
|
+
const d = this;
|
|
2368
|
+
return D(function(...c) {
|
|
2369
|
+
const u = d._def.args.safeParse(c, a);
|
|
2370
2370
|
if (!u.success)
|
|
2371
|
-
throw new L([s(
|
|
2372
|
-
const l = Reflect.apply(o, this, u.data), j =
|
|
2371
|
+
throw new L([s(c, u.error)]);
|
|
2372
|
+
const l = Reflect.apply(o, this, u.data), j = d._def.returns.safeParse(l, a);
|
|
2373
2373
|
if (!j.success)
|
|
2374
2374
|
throw new L([r(l, j.error)]);
|
|
2375
2375
|
return j.data;
|
|
@@ -2409,7 +2409,7 @@ class Ue extends S {
|
|
|
2409
2409
|
});
|
|
2410
2410
|
}
|
|
2411
2411
|
}
|
|
2412
|
-
class
|
|
2412
|
+
class ct extends S {
|
|
2413
2413
|
get schema() {
|
|
2414
2414
|
return this._def.getter();
|
|
2415
2415
|
}
|
|
@@ -2418,7 +2418,7 @@ 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
|
+
ct.create = (n, e) => new ct({
|
|
2422
2422
|
getter: n,
|
|
2423
2423
|
typeName: w.ZodLazy,
|
|
2424
2424
|
...T(e)
|
|
@@ -2587,45 +2587,45 @@ class q extends S {
|
|
|
2587
2587
|
if (a.addIssue = a.addIssue.bind(a), r.type === "preprocess") {
|
|
2588
2588
|
const o = r.transform(s.data, a);
|
|
2589
2589
|
if (s.common.async)
|
|
2590
|
-
return Promise.resolve(o).then(async (
|
|
2590
|
+
return Promise.resolve(o).then(async (d) => {
|
|
2591
2591
|
if (t.value === "aborted")
|
|
2592
2592
|
return x;
|
|
2593
|
-
const
|
|
2594
|
-
data:
|
|
2593
|
+
const c = await this._def.schema._parseAsync({
|
|
2594
|
+
data: d,
|
|
2595
2595
|
path: s.path,
|
|
2596
2596
|
parent: s
|
|
2597
2597
|
});
|
|
2598
|
-
return
|
|
2598
|
+
return c.status === "aborted" ? x : c.status === "dirty" || t.value === "dirty" ? Rt(c.value) : c;
|
|
2599
2599
|
});
|
|
2600
2600
|
{
|
|
2601
2601
|
if (t.value === "aborted")
|
|
2602
2602
|
return x;
|
|
2603
|
-
const
|
|
2603
|
+
const d = this._def.schema._parseSync({
|
|
2604
2604
|
data: o,
|
|
2605
2605
|
path: s.path,
|
|
2606
2606
|
parent: s
|
|
2607
2607
|
});
|
|
2608
|
-
return
|
|
2608
|
+
return d.status === "aborted" ? x : d.status === "dirty" || t.value === "dirty" ? Rt(d.value) : d;
|
|
2609
2609
|
}
|
|
2610
2610
|
}
|
|
2611
2611
|
if (r.type === "refinement") {
|
|
2612
|
-
const o = (
|
|
2613
|
-
const
|
|
2612
|
+
const o = (d) => {
|
|
2613
|
+
const c = r.refinement(d, a);
|
|
2614
2614
|
if (s.common.async)
|
|
2615
|
-
return Promise.resolve(
|
|
2616
|
-
if (
|
|
2615
|
+
return Promise.resolve(c);
|
|
2616
|
+
if (c instanceof Promise)
|
|
2617
2617
|
throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2618
|
-
return
|
|
2618
|
+
return d;
|
|
2619
2619
|
};
|
|
2620
2620
|
if (s.common.async === !1) {
|
|
2621
|
-
const
|
|
2621
|
+
const d = this._def.schema._parseSync({
|
|
2622
2622
|
data: s.data,
|
|
2623
2623
|
path: s.path,
|
|
2624
2624
|
parent: s
|
|
2625
2625
|
});
|
|
2626
|
-
return
|
|
2626
|
+
return d.status === "aborted" ? x : (d.status === "dirty" && t.dirty(), o(d.value), { status: t.value, value: d.value });
|
|
2627
2627
|
} else
|
|
2628
|
-
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((
|
|
2628
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((d) => d.status === "aborted" ? x : (d.status === "dirty" && t.dirty(), o(d.value).then(() => ({ status: t.value, value: d.value }))));
|
|
2629
2629
|
}
|
|
2630
2630
|
if (r.type === "transform")
|
|
2631
2631
|
if (s.common.async === !1) {
|
|
@@ -2636,12 +2636,12 @@ class q extends S {
|
|
|
2636
2636
|
});
|
|
2637
2637
|
if (!tt(o))
|
|
2638
2638
|
return o;
|
|
2639
|
-
const
|
|
2640
|
-
if (
|
|
2639
|
+
const d = r.transform(o.value, a);
|
|
2640
|
+
if (d instanceof Promise)
|
|
2641
2641
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2642
|
-
return { status: t.value, value:
|
|
2642
|
+
return { status: t.value, value: d };
|
|
2643
2643
|
} else
|
|
2644
|
-
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => tt(o) ? Promise.resolve(r.transform(o.value, a)).then((
|
|
2644
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => tt(o) ? Promise.resolve(r.transform(o.value, a)).then((d) => ({ status: t.value, value: d })) : o);
|
|
2645
2645
|
N.assertNever(r);
|
|
2646
2646
|
}
|
|
2647
2647
|
}
|
|
@@ -2764,7 +2764,7 @@ Lt.create = (n) => new Lt({
|
|
|
2764
2764
|
...T(n)
|
|
2765
2765
|
});
|
|
2766
2766
|
const vs = Symbol("zod_brand");
|
|
2767
|
-
class
|
|
2767
|
+
class dn extends S {
|
|
2768
2768
|
_parse(e) {
|
|
2769
2769
|
const { ctx: t } = this._processInputParams(e), s = t.data;
|
|
2770
2770
|
return this._def.type._parse({
|
|
@@ -2835,8 +2835,8 @@ function Sn(n, e = {}, t) {
|
|
|
2835
2835
|
return n ? Be.create().superRefine((s, r) => {
|
|
2836
2836
|
var a, o;
|
|
2837
2837
|
if (!n(s)) {
|
|
2838
|
-
const
|
|
2839
|
-
r.addIssue({ code: "custom", ...u, fatal:
|
|
2838
|
+
const d = typeof e == "function" ? e(s) : typeof e == "string" ? { message: e } : e, c = (o = (a = d.fatal) !== null && a !== void 0 ? a : t) !== null && o !== void 0 ? o : !0, u = typeof d == "string" ? { message: d } : d;
|
|
2839
|
+
r.addIssue({ code: "custom", ...u, fatal: c });
|
|
2840
2840
|
}
|
|
2841
2841
|
}) : Be.create();
|
|
2842
2842
|
}
|
|
@@ -2849,7 +2849,7 @@ var w;
|
|
|
2849
2849
|
})(w || (w = {}));
|
|
2850
2850
|
const bs = (n, e = {
|
|
2851
2851
|
message: `Input not instance of ${n.name}`
|
|
2852
|
-
}) => Sn((t) => t instanceof n, e), Zn = F.create, jn = fe.create, ks = Lt.create, xs = me.create, Nn = st.create, Ts = je.create, Os = Pt.create, Ss = rt.create, Zs = at.create, js = Be.create, Ns = Se.create, Cs = re.create, Is = Dt.create, Es = B.create, As = I.create, Rs = I.strictCreate, $s = it.create, Ps = Jt.create, Ds = ot.create, Ms = ee.create, Ls =
|
|
2852
|
+
}) => Sn((t) => t instanceof n, e), Zn = F.create, jn = fe.create, ks = Lt.create, xs = me.create, Nn = st.create, Ts = je.create, Os = Pt.create, Ss = rt.create, Zs = at.create, js = Be.create, Ns = Se.create, Cs = re.create, Is = Dt.create, Es = B.create, As = I.create, Rs = I.strictCreate, $s = it.create, Ps = Jt.create, Ds = ot.create, Ms = ee.create, Ls = dt.create, Vs = Mt.create, Us = Ne.create, Fs = Ue.create, zs = ct.create, Bs = ut.create, Ws = _e.create, qs = lt.create, Js = We.create, fn = q.create, Ks = Y.create, Hs = ge.create, Qs = q.createWithPreprocess, Ys = Nt.create, Gs = () => Zn().optional(), Xs = () => jn().optional(), er = () => Nn().optional(), tr = {
|
|
2853
2853
|
string: (n) => F.create({ ...n, coerce: !0 }),
|
|
2854
2854
|
number: (n) => fe.create({ ...n, coerce: !0 }),
|
|
2855
2855
|
boolean: (n) => st.create({
|
|
@@ -2903,11 +2903,11 @@ var i = /* @__PURE__ */ Object.freeze({
|
|
|
2903
2903
|
ZodDiscriminatedUnion: Jt,
|
|
2904
2904
|
ZodIntersection: ot,
|
|
2905
2905
|
ZodTuple: ee,
|
|
2906
|
-
ZodRecord:
|
|
2906
|
+
ZodRecord: dt,
|
|
2907
2907
|
ZodMap: Mt,
|
|
2908
2908
|
ZodSet: Ne,
|
|
2909
2909
|
ZodFunction: Ue,
|
|
2910
|
-
ZodLazy:
|
|
2910
|
+
ZodLazy: ct,
|
|
2911
2911
|
ZodLiteral: ut,
|
|
2912
2912
|
ZodEnum: _e,
|
|
2913
2913
|
ZodNativeEnum: lt,
|
|
@@ -2920,7 +2920,7 @@ var i = /* @__PURE__ */ Object.freeze({
|
|
|
2920
2920
|
ZodCatch: ht,
|
|
2921
2921
|
ZodNaN: Lt,
|
|
2922
2922
|
BRAND: vs,
|
|
2923
|
-
ZodBranded:
|
|
2923
|
+
ZodBranded: dn,
|
|
2924
2924
|
ZodPipeline: Nt,
|
|
2925
2925
|
ZodReadonly: ft,
|
|
2926
2926
|
custom: Sn,
|
|
@@ -2981,7 +2981,7 @@ i.object({
|
|
|
2981
2981
|
limit: i.number(),
|
|
2982
2982
|
length: i.number()
|
|
2983
2983
|
});
|
|
2984
|
-
const
|
|
2984
|
+
const cn = i.object({
|
|
2985
2985
|
created_at: i.string(),
|
|
2986
2986
|
updated_at: i.string()
|
|
2987
2987
|
}), sr = i.object({
|
|
@@ -3023,7 +3023,7 @@ const dn = i.object({
|
|
|
3023
3023
|
provider: i.string().default("email"),
|
|
3024
3024
|
connection: i.string().default("email")
|
|
3025
3025
|
});
|
|
3026
|
-
ar.extend(
|
|
3026
|
+
ar.extend(cn.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(),
|
|
@@ -3046,7 +3046,7 @@ let or = (n = 21) => {
|
|
|
3046
3046
|
e += ir[t[n] & 63];
|
|
3047
3047
|
return e;
|
|
3048
3048
|
};
|
|
3049
|
-
const
|
|
3049
|
+
const dr = i.object({
|
|
3050
3050
|
audience: i.string().optional(),
|
|
3051
3051
|
recipient: i.string().optional(),
|
|
3052
3052
|
createUpnClaim: i.boolean().optional(),
|
|
@@ -3063,7 +3063,7 @@ const cr = i.object({
|
|
|
3063
3063
|
nameIdentifierProbes: i.array(i.string()).optional(),
|
|
3064
3064
|
authnContextClassRef: i.string().optional(),
|
|
3065
3065
|
mappings: i.record(i.string()).optional()
|
|
3066
|
-
}),
|
|
3066
|
+
}), cr = i.object({
|
|
3067
3067
|
id: i.string(),
|
|
3068
3068
|
name: i.string(),
|
|
3069
3069
|
callbacks: i.array(i.string()).default([]).optional().openapi({
|
|
@@ -3082,7 +3082,7 @@ const cr = i.object({
|
|
|
3082
3082
|
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"
|
|
3083
3083
|
}),
|
|
3084
3084
|
addons: i.object({
|
|
3085
|
-
samlp:
|
|
3085
|
+
samlp: dr.optional()
|
|
3086
3086
|
}).default({}).optional().openapi({
|
|
3087
3087
|
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."
|
|
3088
3088
|
}),
|
|
@@ -3096,7 +3096,7 @@ const cr = i.object({
|
|
|
3096
3096
|
}), ur = i.object({
|
|
3097
3097
|
created_at: i.string().transform((n) => n === null ? "" : n),
|
|
3098
3098
|
updated_at: i.string().transform((n) => n === null ? "" : n),
|
|
3099
|
-
...
|
|
3099
|
+
...cr.shape
|
|
3100
3100
|
});
|
|
3101
3101
|
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 || {});
|
|
3102
3102
|
const lr = i.object({
|
|
@@ -3152,7 +3152,11 @@ const pr = i.object({
|
|
|
3152
3152
|
app_secret: i.string().optional(),
|
|
3153
3153
|
scope: i.string().optional(),
|
|
3154
3154
|
authorization_endpoint: i.string().default("").optional(),
|
|
3155
|
-
token_endpoint: i.string().default("").optional()
|
|
3155
|
+
token_endpoint: i.string().default("").optional(),
|
|
3156
|
+
userinfo_endpoint: i.string().default("").optional(),
|
|
3157
|
+
jwks_uri: i.string().default("").optional(),
|
|
3158
|
+
discovery_url: i.string().default("").optional(),
|
|
3159
|
+
issuer: i.string().default("").optional()
|
|
3156
3160
|
}).default({}).optional(),
|
|
3157
3161
|
enabled_clients: i.array(i.string()).default([]).optional(),
|
|
3158
3162
|
response_type: i.custom().optional(),
|
|
@@ -3239,7 +3243,7 @@ const _r = i.enum([
|
|
|
3239
3243
|
email_api_key: i.string().optional(),
|
|
3240
3244
|
email_service: i.enum(["mailgun", "mailchannels"])
|
|
3241
3245
|
});
|
|
3242
|
-
|
|
3246
|
+
cn.extend({
|
|
3243
3247
|
...vr.shape,
|
|
3244
3248
|
id: i.string()
|
|
3245
3249
|
});
|
|
@@ -3256,7 +3260,7 @@ const wr = i.object({
|
|
|
3256
3260
|
priority: i.number().optional()
|
|
3257
3261
|
});
|
|
3258
3262
|
wr.extend({
|
|
3259
|
-
...
|
|
3263
|
+
...cn.shape,
|
|
3260
3264
|
hook_id: i.string()
|
|
3261
3265
|
});
|
|
3262
3266
|
const br = i.object({
|
|
@@ -3588,7 +3592,7 @@ function $r(n) {
|
|
|
3588
3592
|
]);
|
|
3589
3593
|
if (!s)
|
|
3590
3594
|
return null;
|
|
3591
|
-
const { tenant_id: a, ...o } = s,
|
|
3595
|
+
const { tenant_id: a, ...o } = s, d = {
|
|
3592
3596
|
...o,
|
|
3593
3597
|
email: s.email || "",
|
|
3594
3598
|
email_verified: s.email_verified === 1,
|
|
@@ -3603,18 +3607,18 @@ function $r(n) {
|
|
|
3603
3607
|
...r.map(Pn)
|
|
3604
3608
|
]
|
|
3605
3609
|
};
|
|
3606
|
-
return R(
|
|
3610
|
+
return R(d);
|
|
3607
3611
|
};
|
|
3608
3612
|
}
|
|
3609
3613
|
function Ee(n, e, t, s) {
|
|
3610
3614
|
return t.split(/\s+/).map((a) => a.replace(/^([^:]+)=/g, "$1:")).map((a) => {
|
|
3611
|
-
let o = a.startsWith("-"),
|
|
3612
|
-
return a.startsWith("-_exists_:") ? (
|
|
3613
|
-
}).forEach(({ key: a, value: o, isNegation:
|
|
3615
|
+
let o = a.startsWith("-"), d, c, u, l;
|
|
3616
|
+
return a.startsWith("-_exists_:") ? (d = a.substring(10), u = !0, o = !0) : a.startsWith("_exists_:") ? (d = a.substring(9), u = !0, o = !1) : a.includes(":") ? (o = a.startsWith("-"), [d, c] = o ? a.substring(1).split(":") : a.split(":"), u = !1, c.startsWith(">=") ? (l = ">=", c = c.substring(2)) : c.startsWith(">") ? (l = ">", c = c.substring(1)) : c.startsWith("<=") ? (console.log("value", c), l = "<=", c = c.substring(2)) : c.startsWith("<") ? (l = "<", c = c.substring(1)) : l = "=") : (d = null, c = a, u = !1), { key: d, value: c, isNegation: o, isExistsQuery: u, operator: l };
|
|
3617
|
+
}).forEach(({ key: a, value: o, isNegation: d, isExistsQuery: c, operator: u }) => {
|
|
3614
3618
|
if (a)
|
|
3615
|
-
if (
|
|
3616
|
-
|
|
3617
|
-
else if (
|
|
3619
|
+
if (c)
|
|
3620
|
+
d ? e = e.where(a, "is", null) : e = e.where(a, "is not", null);
|
|
3621
|
+
else if (d)
|
|
3618
3622
|
switch (u) {
|
|
3619
3623
|
case ">":
|
|
3620
3624
|
e = e.where(a, "<=", o);
|
|
@@ -3653,8 +3657,8 @@ function Pr(n) {
|
|
|
3653
3657
|
const { ref: l } = n.dynamic;
|
|
3654
3658
|
s = s.orderBy(l(t.sort.sort_by), t.sort.sort_order);
|
|
3655
3659
|
}
|
|
3656
|
-
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), o = a.map((l) => l.user_id),
|
|
3657
|
-
const j =
|
|
3660
|
+
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), o = a.map((l) => l.user_id), d = o.length ? await n.selectFrom("users").selectAll().where("users.tenant_id", "=", e).where("users.linked_to", "in", o).execute() : [], c = a.map((l) => {
|
|
3661
|
+
const j = d.filter(
|
|
3658
3662
|
(A) => A.linked_to === l.user_id
|
|
3659
3663
|
);
|
|
3660
3664
|
return R({
|
|
@@ -3673,7 +3677,7 @@ function Pr(n) {
|
|
|
3673
3677
|
});
|
|
3674
3678
|
}), { count: u } = await s.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
3675
3679
|
return {
|
|
3676
|
-
users:
|
|
3680
|
+
users: c,
|
|
3677
3681
|
start: t.page * t.per_page,
|
|
3678
3682
|
limit: t.per_page,
|
|
3679
3683
|
length: ke(u)
|
|
@@ -3742,16 +3746,16 @@ function Wr(n) {
|
|
|
3742
3746
|
return async (e) => {
|
|
3743
3747
|
let t = n.selectFrom("tenants");
|
|
3744
3748
|
if (e.sort && e.sort.sort_by) {
|
|
3745
|
-
const { ref:
|
|
3746
|
-
t = t.orderBy(
|
|
3749
|
+
const { ref: d } = n.dynamic;
|
|
3750
|
+
t = t.orderBy(d(e.sort.sort_by), e.sort.sort_order);
|
|
3747
3751
|
}
|
|
3748
|
-
e.q && (t = t.where((
|
|
3752
|
+
e.q && (t = t.where((d) => d.or([d("name", "like", `%${e.q}%`)])));
|
|
3749
3753
|
const r = await t.offset(e.page * e.per_page).limit(e.per_page).selectAll().execute();
|
|
3750
3754
|
if (!e.include_totals)
|
|
3751
3755
|
return {
|
|
3752
3756
|
tenants: r
|
|
3753
3757
|
};
|
|
3754
|
-
const { count: a } = await t.select((
|
|
3758
|
+
const { count: a } = await t.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), o = ke(a);
|
|
3755
3759
|
return {
|
|
3756
3760
|
tenants: r.map(R),
|
|
3757
3761
|
start: (e.page - 1) * e.per_page,
|
|
@@ -3834,14 +3838,14 @@ function Yr(n) {
|
|
|
3834
3838
|
t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
|
|
3835
3839
|
let r = s;
|
|
3836
3840
|
if (t.sort && t.sort.sort_by) {
|
|
3837
|
-
const { ref:
|
|
3841
|
+
const { ref: d } = n.dynamic;
|
|
3838
3842
|
r = r.orderBy(
|
|
3839
|
-
|
|
3843
|
+
d(t.sort.sort_by),
|
|
3840
3844
|
t.sort.sort_order
|
|
3841
3845
|
);
|
|
3842
3846
|
}
|
|
3843
3847
|
r = r.offset(t.page * t.per_page).limit(t.per_page);
|
|
3844
|
-
const a = await r.selectAll().execute(), { count: o } = await s.select((
|
|
3848
|
+
const a = await r.selectAll().execute(), { count: o } = await s.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
3845
3849
|
return {
|
|
3846
3850
|
logs: a.map(Dn),
|
|
3847
3851
|
start: t.page * t.per_page,
|
|
@@ -3888,19 +3892,19 @@ function ra(n) {
|
|
|
3888
3892
|
t.q && (s = Ee(n, s, t.q, ["user_id", "session_id"]));
|
|
3889
3893
|
let r = s;
|
|
3890
3894
|
if (t.sort && t.sort.sort_by) {
|
|
3891
|
-
const { ref:
|
|
3895
|
+
const { ref: c } = n.dynamic;
|
|
3892
3896
|
r = r.orderBy(
|
|
3893
|
-
|
|
3897
|
+
c(t.sort.sort_by),
|
|
3894
3898
|
t.sort.sort_order
|
|
3895
3899
|
);
|
|
3896
3900
|
}
|
|
3897
3901
|
r = r.offset(t.page * t.per_page).limit(t.per_page);
|
|
3898
|
-
const a = await r.selectAll().execute(), { count: o } = await s.select((
|
|
3902
|
+
const a = await r.selectAll().execute(), { count: o } = await s.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), d = ke(o);
|
|
3899
3903
|
return {
|
|
3900
3904
|
sessions: a,
|
|
3901
3905
|
start: t.page * t.per_page,
|
|
3902
3906
|
limit: t.per_page,
|
|
3903
|
-
length:
|
|
3907
|
+
length: d
|
|
3904
3908
|
};
|
|
3905
3909
|
};
|
|
3906
3910
|
}
|
|
@@ -3922,8 +3926,8 @@ function ia(n) {
|
|
|
3922
3926
|
nonce: r,
|
|
3923
3927
|
state: a,
|
|
3924
3928
|
scope: o,
|
|
3925
|
-
response_type:
|
|
3926
|
-
response_mode:
|
|
3929
|
+
response_type: d,
|
|
3930
|
+
response_mode: c,
|
|
3927
3931
|
redirect_uri: u,
|
|
3928
3932
|
...l
|
|
3929
3933
|
} = s;
|
|
@@ -3933,8 +3937,8 @@ function ia(n) {
|
|
|
3933
3937
|
nonce: r,
|
|
3934
3938
|
state: a,
|
|
3935
3939
|
scope: o,
|
|
3936
|
-
response_type:
|
|
3937
|
-
response_mode:
|
|
3940
|
+
response_type: d,
|
|
3941
|
+
response_mode: c,
|
|
3938
3942
|
redirect_uri: u
|
|
3939
3943
|
},
|
|
3940
3944
|
created_at: new Date(s.created_at),
|
|
@@ -3955,18 +3959,18 @@ function oa(n) {
|
|
|
3955
3959
|
await n.insertInto("tickets").values(r).execute();
|
|
3956
3960
|
};
|
|
3957
3961
|
}
|
|
3958
|
-
function
|
|
3962
|
+
function da(n) {
|
|
3959
3963
|
return async (e, t) => {
|
|
3960
3964
|
await n.updateTable("tickets").set({
|
|
3961
3965
|
used_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3962
3966
|
}).where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).execute();
|
|
3963
3967
|
};
|
|
3964
3968
|
}
|
|
3965
|
-
function
|
|
3969
|
+
function ca(n) {
|
|
3966
3970
|
return {
|
|
3967
3971
|
create: oa(n),
|
|
3968
3972
|
get: ia(n),
|
|
3969
|
-
remove:
|
|
3973
|
+
remove: da(n)
|
|
3970
3974
|
};
|
|
3971
3975
|
}
|
|
3972
3976
|
function ua(n) {
|
|
@@ -4005,10 +4009,10 @@ function fa(n) {
|
|
|
4005
4009
|
return async (e, t) => {
|
|
4006
4010
|
let s = n.selectFrom("codes").where("codes.tenant_id", "=", e);
|
|
4007
4011
|
t.q && (s = Ee(n, s, t.q, ["code", "login_id"]));
|
|
4008
|
-
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((
|
|
4012
|
+
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();
|
|
4009
4013
|
return {
|
|
4010
|
-
codes: a.map((
|
|
4011
|
-
const { tenant_id: u, ...l } =
|
|
4014
|
+
codes: a.map((c) => {
|
|
4015
|
+
const { tenant_id: u, ...l } = c;
|
|
4012
4016
|
return yr.parse(R(l));
|
|
4013
4017
|
}),
|
|
4014
4018
|
start: t.page * t.per_page,
|
|
@@ -4054,7 +4058,7 @@ function va(n) {
|
|
|
4054
4058
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4055
4059
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4056
4060
|
...t
|
|
4057
|
-
}, r = JSON.stringify(t.allowed_origins), a = JSON.stringify(t.callbacks), o = JSON.stringify(t.web_origins),
|
|
4061
|
+
}, r = JSON.stringify(t.allowed_origins), a = JSON.stringify(t.callbacks), o = JSON.stringify(t.web_origins), d = JSON.stringify(t.allowed_logout_urls), c = JSON.stringify(t.allowed_clients);
|
|
4058
4062
|
return await n.insertInto("applications").values({
|
|
4059
4063
|
...s,
|
|
4060
4064
|
tenant_id: e,
|
|
@@ -4063,8 +4067,8 @@ function va(n) {
|
|
|
4063
4067
|
callbacks: a,
|
|
4064
4068
|
allowed_origins: r,
|
|
4065
4069
|
web_origins: o,
|
|
4066
|
-
allowed_logout_urls:
|
|
4067
|
-
allowed_clients:
|
|
4070
|
+
allowed_logout_urls: d,
|
|
4071
|
+
allowed_clients: c
|
|
4068
4072
|
}).execute(), s;
|
|
4069
4073
|
};
|
|
4070
4074
|
}
|
|
@@ -4163,13 +4167,13 @@ function ja(n) {
|
|
|
4163
4167
|
if (typeof n.ZodType.prototype.openapi < "u")
|
|
4164
4168
|
return;
|
|
4165
4169
|
n.ZodType.prototype.openapi = function(r, a) {
|
|
4166
|
-
var o,
|
|
4167
|
-
const A = typeof r == "string" ? a : r, U = A ?? {}, { param: ie } = U, Re = Sa(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),
|
|
4170
|
+
var o, d, c, u, l, j;
|
|
4171
|
+
const A = typeof r == "string" ? a : r, U = A ?? {}, { param: ie } = U, Re = Sa(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), de = Object.assign(Object.assign(Object.assign({}, (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata), Re), !((u = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata) === null || u === void 0) && u.param || ie ? {
|
|
4168
4172
|
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)
|
|
4169
|
-
} : void 0),
|
|
4173
|
+
} : void 0), ce = 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(de).length > 0 ? { metadata: de } : void 0) }));
|
|
4170
4174
|
if (Za(this, "ZodObject")) {
|
|
4171
4175
|
const $e = this.extend;
|
|
4172
|
-
|
|
4176
|
+
ce.extend = function(...Pe) {
|
|
4173
4177
|
var K, H, Q, ue, xe, Te;
|
|
4174
4178
|
const Oe = $e.apply(this, Pe);
|
|
4175
4179
|
return Oe._def.openapi = {
|
|
@@ -4180,14 +4184,14 @@ function ja(n) {
|
|
|
4180
4184
|
}, Oe;
|
|
4181
4185
|
};
|
|
4182
4186
|
}
|
|
4183
|
-
return
|
|
4187
|
+
return ce;
|
|
4184
4188
|
}, Qe(n, "optional"), Qe(n, "nullable"), Qe(n, "default"), Qe(n, "transform"), Qe(n, "refine");
|
|
4185
4189
|
const e = n.ZodObject.prototype.deepPartial;
|
|
4186
4190
|
n.ZodObject.prototype.deepPartial = function() {
|
|
4187
4191
|
const r = this._def.shape(), a = e.apply(this), o = a._def.shape();
|
|
4188
|
-
return Object.entries(o).forEach(([
|
|
4192
|
+
return Object.entries(o).forEach(([d, c]) => {
|
|
4189
4193
|
var u, l;
|
|
4190
|
-
|
|
4194
|
+
c._def.openapi = (l = (u = r[d]) === null || u === void 0 ? void 0 : u._def) === null || l === void 0 ? void 0 : l.openapi;
|
|
4191
4195
|
}), a._def.openapi = void 0, a;
|
|
4192
4196
|
};
|
|
4193
4197
|
const t = n.ZodObject.prototype.pick;
|
|
@@ -4217,9 +4221,9 @@ var C;
|
|
|
4217
4221
|
a[o] = o;
|
|
4218
4222
|
return a;
|
|
4219
4223
|
}, n.getValidEnumValues = (r) => {
|
|
4220
|
-
const a = n.objectKeys(r).filter((
|
|
4221
|
-
for (const
|
|
4222
|
-
o[
|
|
4224
|
+
const a = n.objectKeys(r).filter((d) => typeof r[r[d]] != "number"), o = {};
|
|
4225
|
+
for (const d of a)
|
|
4226
|
+
o[d] = r[d];
|
|
4223
4227
|
return n.objectValues(o);
|
|
4224
4228
|
}, n.objectValues = (r) => n.objectKeys(r).map(function(a) {
|
|
4225
4229
|
return r[a];
|
|
@@ -4333,10 +4337,10 @@ class V extends Error {
|
|
|
4333
4337
|
else if (o.path.length === 0)
|
|
4334
4338
|
s._errors.push(t(o));
|
|
4335
4339
|
else {
|
|
4336
|
-
let
|
|
4337
|
-
for (;
|
|
4338
|
-
const u = o.path[
|
|
4339
|
-
|
|
4340
|
+
let d = s, c = 0;
|
|
4341
|
+
for (; c < o.path.length; ) {
|
|
4342
|
+
const u = o.path[c];
|
|
4343
|
+
c === o.path.length - 1 ? (d[u] = d[u] || { _errors: [] }, d[u]._errors.push(t(o))) : d[u] = d[u] || { _errors: [] }, d = d[u], c++;
|
|
4340
4344
|
}
|
|
4341
4345
|
}
|
|
4342
4346
|
};
|
|
@@ -4440,14 +4444,14 @@ const Ut = (n) => {
|
|
|
4440
4444
|
path: a,
|
|
4441
4445
|
message: r.message
|
|
4442
4446
|
};
|
|
4443
|
-
let
|
|
4444
|
-
const
|
|
4445
|
-
for (const u of
|
|
4446
|
-
|
|
4447
|
+
let d = "";
|
|
4448
|
+
const c = s.filter((u) => !!u).slice().reverse();
|
|
4449
|
+
for (const u of c)
|
|
4450
|
+
d = u(o, { data: e, defaultError: d }).message;
|
|
4447
4451
|
return {
|
|
4448
4452
|
...r,
|
|
4449
4453
|
path: a,
|
|
4450
|
-
message:
|
|
4454
|
+
message: d
|
|
4451
4455
|
};
|
|
4452
4456
|
}, Ia = [];
|
|
4453
4457
|
function m(n, e) {
|
|
@@ -4551,10 +4555,10 @@ function O(n) {
|
|
|
4551
4555
|
const { errorMap: e, invalid_type_error: t, required_error: s, description: r } = n;
|
|
4552
4556
|
if (e && (t || s))
|
|
4553
4557
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
4554
|
-
return e ? { errorMap: e, description: r } : { errorMap: (o,
|
|
4555
|
-
var
|
|
4558
|
+
return e ? { errorMap: e, description: r } : { errorMap: (o, d) => {
|
|
4559
|
+
var c, u;
|
|
4556
4560
|
const { message: l } = n;
|
|
4557
|
-
return o.code === "invalid_enum_value" ? { message: l ??
|
|
4561
|
+
return o.code === "invalid_enum_value" ? { message: l ?? d.defaultError } : typeof d.data > "u" ? { message: (c = l ?? s) !== null && c !== void 0 ? c : d.defaultError } : o.code !== "invalid_type" ? { message: d.defaultError } : { message: (u = l ?? t) !== null && u !== void 0 ? u : d.defaultError };
|
|
4558
4562
|
}, description: r };
|
|
4559
4563
|
}
|
|
4560
4564
|
class Z {
|
|
@@ -4646,11 +4650,11 @@ class Z {
|
|
|
4646
4650
|
refine(e, t) {
|
|
4647
4651
|
const s = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
|
|
4648
4652
|
return this._refinement((r, a) => {
|
|
4649
|
-
const o = e(r),
|
|
4653
|
+
const o = e(r), d = () => a.addIssue({
|
|
4650
4654
|
code: h.custom,
|
|
4651
4655
|
...s(r)
|
|
4652
4656
|
});
|
|
4653
|
-
return typeof Promise < "u" && o instanceof Promise ? o.then((
|
|
4657
|
+
return typeof Promise < "u" && o instanceof Promise ? o.then((c) => c ? !0 : (d(), !1)) : o ? !0 : (d(), !1);
|
|
4654
4658
|
});
|
|
4655
4659
|
}
|
|
4656
4660
|
refinement(e, t) {
|
|
@@ -4790,15 +4794,15 @@ class z extends Z {
|
|
|
4790
4794
|
message: a.message
|
|
4791
4795
|
}), s.dirty());
|
|
4792
4796
|
else if (a.kind === "length") {
|
|
4793
|
-
const o = e.data.length > a.value,
|
|
4794
|
-
(o ||
|
|
4797
|
+
const o = e.data.length > a.value, d = e.data.length < a.value;
|
|
4798
|
+
(o || d) && (r = this._getOrReturnCtx(e, r), o ? m(r, {
|
|
4795
4799
|
code: h.too_big,
|
|
4796
4800
|
maximum: a.value,
|
|
4797
4801
|
type: "string",
|
|
4798
4802
|
inclusive: !0,
|
|
4799
4803
|
exact: !0,
|
|
4800
4804
|
message: a.message
|
|
4801
|
-
}) :
|
|
4805
|
+
}) : d && m(r, {
|
|
4802
4806
|
code: h.too_small,
|
|
4803
4807
|
minimum: a.value,
|
|
4804
4808
|
type: "string",
|
|
@@ -5632,10 +5636,10 @@ class W extends Z {
|
|
|
5632
5636
|
received: t.parsedType
|
|
5633
5637
|
}), k;
|
|
5634
5638
|
if (r.exactLength !== null) {
|
|
5635
|
-
const o = t.data.length > r.exactLength.value,
|
|
5636
|
-
(o ||
|
|
5639
|
+
const o = t.data.length > r.exactLength.value, d = t.data.length < r.exactLength.value;
|
|
5640
|
+
(o || d) && (m(t, {
|
|
5637
5641
|
code: o ? h.too_big : h.too_small,
|
|
5638
|
-
minimum:
|
|
5642
|
+
minimum: d ? r.exactLength.value : void 0,
|
|
5639
5643
|
maximum: o ? r.exactLength.value : void 0,
|
|
5640
5644
|
type: "array",
|
|
5641
5645
|
inclusive: !0,
|
|
@@ -5658,8 +5662,8 @@ class W extends Z {
|
|
|
5658
5662
|
exact: !1,
|
|
5659
5663
|
message: r.maxLength.message
|
|
5660
5664
|
}), s.dirty()), t.common.async)
|
|
5661
|
-
return Promise.all([...t.data].map((o,
|
|
5662
|
-
const a = [...t.data].map((o,
|
|
5665
|
+
return Promise.all([...t.data].map((o, d) => r.type._parseAsync(new te(t, o, t.path, d)))).then((o) => P.mergeArray(s, o));
|
|
5666
|
+
const a = [...t.data].map((o, d) => r.type._parseSync(new te(t, o, t.path, d)));
|
|
5663
5667
|
return P.mergeArray(s, a);
|
|
5664
5668
|
}
|
|
5665
5669
|
get element() {
|
|
@@ -5730,14 +5734,14 @@ class E extends Z {
|
|
|
5730
5734
|
received: u.parsedType
|
|
5731
5735
|
}), k;
|
|
5732
5736
|
}
|
|
5733
|
-
const { status: s, ctx: r } = this._processInputParams(e), { shape: a, keys: o } = this._getCached(),
|
|
5737
|
+
const { status: s, ctx: r } = this._processInputParams(e), { shape: a, keys: o } = this._getCached(), d = [];
|
|
5734
5738
|
if (!(this._def.catchall instanceof ae && this._def.unknownKeys === "strip"))
|
|
5735
5739
|
for (const u in r.data)
|
|
5736
|
-
o.includes(u) ||
|
|
5737
|
-
const
|
|
5740
|
+
o.includes(u) || d.push(u);
|
|
5741
|
+
const c = [];
|
|
5738
5742
|
for (const u of o) {
|
|
5739
5743
|
const l = a[u], j = r.data[u];
|
|
5740
|
-
|
|
5744
|
+
c.push({
|
|
5741
5745
|
key: { status: "valid", value: u },
|
|
5742
5746
|
value: l._parse(new te(r, j, r.path, u)),
|
|
5743
5747
|
alwaysSet: u in r.data
|
|
@@ -5746,22 +5750,22 @@ class E extends Z {
|
|
|
5746
5750
|
if (this._def.catchall instanceof ae) {
|
|
5747
5751
|
const u = this._def.unknownKeys;
|
|
5748
5752
|
if (u === "passthrough")
|
|
5749
|
-
for (const l of
|
|
5750
|
-
|
|
5753
|
+
for (const l of d)
|
|
5754
|
+
c.push({
|
|
5751
5755
|
key: { status: "valid", value: l },
|
|
5752
5756
|
value: { status: "valid", value: r.data[l] }
|
|
5753
5757
|
});
|
|
5754
5758
|
else if (u === "strict")
|
|
5755
|
-
|
|
5759
|
+
d.length > 0 && (m(r, {
|
|
5756
5760
|
code: h.unrecognized_keys,
|
|
5757
|
-
keys:
|
|
5761
|
+
keys: d
|
|
5758
5762
|
}), s.dirty());
|
|
5759
5763
|
else if (u !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
5760
5764
|
} else {
|
|
5761
5765
|
const u = this._def.catchall;
|
|
5762
|
-
for (const l of
|
|
5766
|
+
for (const l of d) {
|
|
5763
5767
|
const j = r.data[l];
|
|
5764
|
-
|
|
5768
|
+
c.push({
|
|
5765
5769
|
key: { status: "valid", value: l },
|
|
5766
5770
|
value: u._parse(
|
|
5767
5771
|
new te(r, j, r.path, l)
|
|
@@ -5773,7 +5777,7 @@ class E extends Z {
|
|
|
5773
5777
|
}
|
|
5774
5778
|
return r.common.async ? Promise.resolve().then(async () => {
|
|
5775
5779
|
const u = [];
|
|
5776
|
-
for (const l of
|
|
5780
|
+
for (const l of c) {
|
|
5777
5781
|
const j = await l.key, A = await l.value;
|
|
5778
5782
|
u.push({
|
|
5779
5783
|
key: j,
|
|
@@ -5782,7 +5786,7 @@ class E extends Z {
|
|
|
5782
5786
|
});
|
|
5783
5787
|
}
|
|
5784
5788
|
return u;
|
|
5785
|
-
}).then((u) => P.mergeObjectSync(s, u)) : P.mergeObjectSync(s,
|
|
5789
|
+
}).then((u) => P.mergeObjectSync(s, u)) : P.mergeObjectSync(s, c);
|
|
5786
5790
|
}
|
|
5787
5791
|
get shape() {
|
|
5788
5792
|
return this._def.shape();
|
|
@@ -5793,12 +5797,12 @@ class E extends Z {
|
|
|
5793
5797
|
unknownKeys: "strict",
|
|
5794
5798
|
...e !== void 0 ? {
|
|
5795
5799
|
errorMap: (t, s) => {
|
|
5796
|
-
var r, a, o,
|
|
5797
|
-
const
|
|
5800
|
+
var r, a, o, d;
|
|
5801
|
+
const c = (o = (a = (r = this._def).errorMap) === null || a === void 0 ? void 0 : a.call(r, t, s).message) !== null && o !== void 0 ? o : s.defaultError;
|
|
5798
5802
|
return t.code === "unrecognized_keys" ? {
|
|
5799
|
-
message: (
|
|
5803
|
+
message: (d = v.errToObj(e).message) !== null && d !== void 0 ? d : c
|
|
5800
5804
|
} : {
|
|
5801
|
-
message:
|
|
5805
|
+
message: c
|
|
5802
5806
|
};
|
|
5803
5807
|
}
|
|
5804
5808
|
} : {}
|
|
@@ -6002,13 +6006,13 @@ class wt extends Z {
|
|
|
6002
6006
|
_parse(e) {
|
|
6003
6007
|
const { ctx: t } = this._processInputParams(e), s = this._def.options;
|
|
6004
6008
|
function r(a) {
|
|
6005
|
-
for (const
|
|
6006
|
-
if (
|
|
6007
|
-
return
|
|
6008
|
-
for (const
|
|
6009
|
-
if (
|
|
6010
|
-
return t.common.issues.push(...
|
|
6011
|
-
const o = a.map((
|
|
6009
|
+
for (const d of a)
|
|
6010
|
+
if (d.result.status === "valid")
|
|
6011
|
+
return d.result;
|
|
6012
|
+
for (const d of a)
|
|
6013
|
+
if (d.result.status === "dirty")
|
|
6014
|
+
return t.common.issues.push(...d.ctx.common.issues), d.result;
|
|
6015
|
+
const o = a.map((d) => new V(d.ctx.common.issues));
|
|
6012
6016
|
return m(t, {
|
|
6013
6017
|
code: h.invalid_union,
|
|
6014
6018
|
unionErrors: o
|
|
@@ -6036,7 +6040,7 @@ class wt extends Z {
|
|
|
6036
6040
|
{
|
|
6037
6041
|
let a;
|
|
6038
6042
|
const o = [];
|
|
6039
|
-
for (const
|
|
6043
|
+
for (const c of s) {
|
|
6040
6044
|
const u = {
|
|
6041
6045
|
...t,
|
|
6042
6046
|
common: {
|
|
@@ -6044,7 +6048,7 @@ class wt extends Z {
|
|
|
6044
6048
|
issues: []
|
|
6045
6049
|
},
|
|
6046
6050
|
parent: null
|
|
6047
|
-
}, l =
|
|
6051
|
+
}, l = c._parseSync({
|
|
6048
6052
|
data: t.data,
|
|
6049
6053
|
path: t.path,
|
|
6050
6054
|
parent: u
|
|
@@ -6055,10 +6059,10 @@ class wt extends Z {
|
|
|
6055
6059
|
}
|
|
6056
6060
|
if (a)
|
|
6057
6061
|
return t.common.issues.push(...a.ctx.common.issues), a.result;
|
|
6058
|
-
const
|
|
6062
|
+
const d = o.map((c) => new V(c));
|
|
6059
6063
|
return m(t, {
|
|
6060
6064
|
code: h.invalid_union,
|
|
6061
|
-
unionErrors:
|
|
6065
|
+
unionErrors: d
|
|
6062
6066
|
}), k;
|
|
6063
6067
|
}
|
|
6064
6068
|
}
|
|
@@ -6119,10 +6123,10 @@ class Kt extends Z {
|
|
|
6119
6123
|
const o = se(a.shape[e]);
|
|
6120
6124
|
if (!o.length)
|
|
6121
6125
|
throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
|
|
6122
|
-
for (const
|
|
6123
|
-
if (r.has(
|
|
6124
|
-
throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(
|
|
6125
|
-
r.set(
|
|
6126
|
+
for (const d of o) {
|
|
6127
|
+
if (r.has(d))
|
|
6128
|
+
throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);
|
|
6129
|
+
r.set(d, a);
|
|
6126
6130
|
}
|
|
6127
6131
|
}
|
|
6128
6132
|
return new Kt({
|
|
@@ -6139,12 +6143,12 @@ function on(n, e) {
|
|
|
6139
6143
|
if (n === e)
|
|
6140
6144
|
return { valid: !0, data: n };
|
|
6141
6145
|
if (t === g.object && s === g.object) {
|
|
6142
|
-
const r = C.objectKeys(e), a = C.objectKeys(n).filter((
|
|
6143
|
-
for (const
|
|
6144
|
-
const
|
|
6145
|
-
if (!
|
|
6146
|
+
const r = C.objectKeys(e), a = C.objectKeys(n).filter((d) => r.indexOf(d) !== -1), o = { ...n, ...e };
|
|
6147
|
+
for (const d of a) {
|
|
6148
|
+
const c = on(n[d], e[d]);
|
|
6149
|
+
if (!c.valid)
|
|
6146
6150
|
return { valid: !1 };
|
|
6147
|
-
o[
|
|
6151
|
+
o[d] = c.data;
|
|
6148
6152
|
}
|
|
6149
6153
|
return { valid: !0, data: o };
|
|
6150
6154
|
} else if (t === g.array && s === g.array) {
|
|
@@ -6152,10 +6156,10 @@ function on(n, e) {
|
|
|
6152
6156
|
return { valid: !1 };
|
|
6153
6157
|
const r = [];
|
|
6154
6158
|
for (let a = 0; a < n.length; a++) {
|
|
6155
|
-
const o = n[a],
|
|
6156
|
-
if (!
|
|
6159
|
+
const o = n[a], d = e[a], c = on(o, d);
|
|
6160
|
+
if (!c.valid)
|
|
6157
6161
|
return { valid: !1 };
|
|
6158
|
-
r.push(
|
|
6162
|
+
r.push(c.data);
|
|
6159
6163
|
}
|
|
6160
6164
|
return { valid: !0, data: r };
|
|
6161
6165
|
} else return t === g.date && s === g.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
|
|
@@ -6165,8 +6169,8 @@ class bt extends Z {
|
|
|
6165
6169
|
const { status: t, ctx: s } = this._processInputParams(e), r = (a, o) => {
|
|
6166
6170
|
if (rn(a) || rn(o))
|
|
6167
6171
|
return k;
|
|
6168
|
-
const
|
|
6169
|
-
return
|
|
6172
|
+
const d = on(a.value, o.value);
|
|
6173
|
+
return d.valid ? ((an(a) || an(o)) && t.dirty(), { status: t.value, value: d.data }) : (m(s, {
|
|
6170
6174
|
code: h.invalid_intersection_types
|
|
6171
6175
|
}), k);
|
|
6172
6176
|
};
|
|
@@ -6222,9 +6226,9 @@ class ne extends Z {
|
|
|
6222
6226
|
exact: !1,
|
|
6223
6227
|
type: "array"
|
|
6224
6228
|
}), t.dirty());
|
|
6225
|
-
const a = [...s.data].map((o,
|
|
6226
|
-
const
|
|
6227
|
-
return
|
|
6229
|
+
const a = [...s.data].map((o, d) => {
|
|
6230
|
+
const c = this._def.items[d] || this._def.rest;
|
|
6231
|
+
return c ? c._parse(new te(s, o, s.path, d)) : null;
|
|
6228
6232
|
}).filter((o) => !!o);
|
|
6229
6233
|
return s.common.async ? Promise.all(a).then((o) => P.mergeArray(t, o)) : P.mergeArray(t, a);
|
|
6230
6234
|
}
|
|
@@ -6264,11 +6268,11 @@ class kt extends Z {
|
|
|
6264
6268
|
received: s.parsedType
|
|
6265
6269
|
}), k;
|
|
6266
6270
|
const r = [], a = this._def.keyType, o = this._def.valueType;
|
|
6267
|
-
for (const
|
|
6271
|
+
for (const d in s.data)
|
|
6268
6272
|
r.push({
|
|
6269
|
-
key: a._parse(new te(s,
|
|
6270
|
-
value: o._parse(new te(s, s.data[
|
|
6271
|
-
alwaysSet:
|
|
6273
|
+
key: a._parse(new te(s, d, s.path, d)),
|
|
6274
|
+
value: o._parse(new te(s, s.data[d], s.path, d)),
|
|
6275
|
+
alwaysSet: d in s.data
|
|
6272
6276
|
});
|
|
6273
6277
|
return s.common.async ? P.mergeObjectAsync(t, r) : P.mergeObjectSync(t, r);
|
|
6274
6278
|
}
|
|
@@ -6304,30 +6308,30 @@ class Wt extends Z {
|
|
|
6304
6308
|
expected: g.map,
|
|
6305
6309
|
received: s.parsedType
|
|
6306
6310
|
}), k;
|
|
6307
|
-
const r = this._def.keyType, a = this._def.valueType, o = [...s.data.entries()].map(([
|
|
6308
|
-
key: r._parse(new te(s,
|
|
6309
|
-
value: a._parse(new te(s,
|
|
6311
|
+
const r = this._def.keyType, a = this._def.valueType, o = [...s.data.entries()].map(([d, c], u) => ({
|
|
6312
|
+
key: r._parse(new te(s, d, s.path, [u, "key"])),
|
|
6313
|
+
value: a._parse(new te(s, c, s.path, [u, "value"]))
|
|
6310
6314
|
}));
|
|
6311
6315
|
if (s.common.async) {
|
|
6312
|
-
const
|
|
6316
|
+
const d = /* @__PURE__ */ new Map();
|
|
6313
6317
|
return Promise.resolve().then(async () => {
|
|
6314
|
-
for (const
|
|
6315
|
-
const u = await
|
|
6318
|
+
for (const c of o) {
|
|
6319
|
+
const u = await c.key, l = await c.value;
|
|
6316
6320
|
if (u.status === "aborted" || l.status === "aborted")
|
|
6317
6321
|
return k;
|
|
6318
|
-
(u.status === "dirty" || l.status === "dirty") && t.dirty(),
|
|
6322
|
+
(u.status === "dirty" || l.status === "dirty") && t.dirty(), d.set(u.value, l.value);
|
|
6319
6323
|
}
|
|
6320
|
-
return { status: t.value, value:
|
|
6324
|
+
return { status: t.value, value: d };
|
|
6321
6325
|
});
|
|
6322
6326
|
} else {
|
|
6323
|
-
const
|
|
6324
|
-
for (const
|
|
6325
|
-
const u =
|
|
6327
|
+
const d = /* @__PURE__ */ new Map();
|
|
6328
|
+
for (const c of o) {
|
|
6329
|
+
const u = c.key, l = c.value;
|
|
6326
6330
|
if (u.status === "aborted" || l.status === "aborted")
|
|
6327
6331
|
return k;
|
|
6328
|
-
(u.status === "dirty" || l.status === "dirty") && t.dirty(),
|
|
6332
|
+
(u.status === "dirty" || l.status === "dirty") && t.dirty(), d.set(u.value, l.value);
|
|
6329
6333
|
}
|
|
6330
|
-
return { status: t.value, value:
|
|
6334
|
+
return { status: t.value, value: d };
|
|
6331
6335
|
}
|
|
6332
6336
|
}
|
|
6333
6337
|
}
|
|
@@ -6363,17 +6367,17 @@ class Ie extends Z {
|
|
|
6363
6367
|
message: r.maxSize.message
|
|
6364
6368
|
}), t.dirty());
|
|
6365
6369
|
const a = this._def.valueType;
|
|
6366
|
-
function o(
|
|
6370
|
+
function o(c) {
|
|
6367
6371
|
const u = /* @__PURE__ */ new Set();
|
|
6368
|
-
for (const l of
|
|
6372
|
+
for (const l of c) {
|
|
6369
6373
|
if (l.status === "aborted")
|
|
6370
6374
|
return k;
|
|
6371
6375
|
l.status === "dirty" && t.dirty(), u.add(l.value);
|
|
6372
6376
|
}
|
|
6373
6377
|
return { status: t.value, value: u };
|
|
6374
6378
|
}
|
|
6375
|
-
const
|
|
6376
|
-
return s.common.async ? Promise.all(
|
|
6379
|
+
const d = [...s.data.values()].map((c, u) => a._parse(new te(s, c, s.path, u)));
|
|
6380
|
+
return s.common.async ? Promise.all(d).then((c) => o(c)) : o(d);
|
|
6377
6381
|
}
|
|
6378
6382
|
min(e, t) {
|
|
6379
6383
|
return new Ie({
|
|
@@ -6413,9 +6417,9 @@ class Fe extends Z {
|
|
|
6413
6417
|
expected: g.function,
|
|
6414
6418
|
received: t.parsedType
|
|
6415
6419
|
}), k;
|
|
6416
|
-
function s(
|
|
6420
|
+
function s(d, c) {
|
|
6417
6421
|
return Ut({
|
|
6418
|
-
data:
|
|
6422
|
+
data: d,
|
|
6419
6423
|
path: t.path,
|
|
6420
6424
|
errorMaps: [
|
|
6421
6425
|
t.common.contextualErrorMap,
|
|
@@ -6425,13 +6429,13 @@ class Fe extends Z {
|
|
|
6425
6429
|
].filter((u) => !!u),
|
|
6426
6430
|
issueData: {
|
|
6427
6431
|
code: h.invalid_arguments,
|
|
6428
|
-
argumentsError:
|
|
6432
|
+
argumentsError: c
|
|
6429
6433
|
}
|
|
6430
6434
|
});
|
|
6431
6435
|
}
|
|
6432
|
-
function r(
|
|
6436
|
+
function r(d, c) {
|
|
6433
6437
|
return Ut({
|
|
6434
|
-
data:
|
|
6438
|
+
data: d,
|
|
6435
6439
|
path: t.path,
|
|
6436
6440
|
errorMaps: [
|
|
6437
6441
|
t.common.contextualErrorMap,
|
|
@@ -6441,28 +6445,28 @@ class Fe extends Z {
|
|
|
6441
6445
|
].filter((u) => !!u),
|
|
6442
6446
|
issueData: {
|
|
6443
6447
|
code: h.invalid_return_type,
|
|
6444
|
-
returnTypeError:
|
|
6448
|
+
returnTypeError: c
|
|
6445
6449
|
}
|
|
6446
6450
|
});
|
|
6447
6451
|
}
|
|
6448
6452
|
const a = { errorMap: t.common.contextualErrorMap }, o = t.data;
|
|
6449
6453
|
if (this._def.returns instanceof Ke) {
|
|
6450
|
-
const
|
|
6451
|
-
return M(async function(...
|
|
6452
|
-
const u = new V([]), l = await
|
|
6453
|
-
throw u.addIssue(s(
|
|
6454
|
+
const d = this;
|
|
6455
|
+
return M(async function(...c) {
|
|
6456
|
+
const u = new V([]), l = await d._def.args.parseAsync(c, a).catch((U) => {
|
|
6457
|
+
throw u.addIssue(s(c, U)), u;
|
|
6454
6458
|
}), j = await Reflect.apply(o, this, l);
|
|
6455
|
-
return await
|
|
6459
|
+
return await d._def.returns._def.type.parseAsync(j, a).catch((U) => {
|
|
6456
6460
|
throw u.addIssue(r(j, U)), u;
|
|
6457
6461
|
});
|
|
6458
6462
|
});
|
|
6459
6463
|
} else {
|
|
6460
|
-
const
|
|
6461
|
-
return M(function(...
|
|
6462
|
-
const u =
|
|
6464
|
+
const d = this;
|
|
6465
|
+
return M(function(...c) {
|
|
6466
|
+
const u = d._def.args.safeParse(c, a);
|
|
6463
6467
|
if (!u.success)
|
|
6464
|
-
throw new V([s(
|
|
6465
|
-
const l = Reflect.apply(o, this, u.data), j =
|
|
6468
|
+
throw new V([s(c, u.error)]);
|
|
6469
|
+
const l = Reflect.apply(o, this, u.data), j = d._def.returns.safeParse(l, a);
|
|
6466
6470
|
if (!j.success)
|
|
6467
6471
|
throw new V([r(l, j.error)]);
|
|
6468
6472
|
return j.data;
|
|
@@ -6680,45 +6684,45 @@ class J extends Z {
|
|
|
6680
6684
|
if (a.addIssue = a.addIssue.bind(a), r.type === "preprocess") {
|
|
6681
6685
|
const o = r.transform(s.data, a);
|
|
6682
6686
|
if (s.common.async)
|
|
6683
|
-
return Promise.resolve(o).then(async (
|
|
6687
|
+
return Promise.resolve(o).then(async (d) => {
|
|
6684
6688
|
if (t.value === "aborted")
|
|
6685
6689
|
return k;
|
|
6686
|
-
const
|
|
6687
|
-
data:
|
|
6690
|
+
const c = await this._def.schema._parseAsync({
|
|
6691
|
+
data: d,
|
|
6688
6692
|
path: s.path,
|
|
6689
6693
|
parent: s
|
|
6690
6694
|
});
|
|
6691
|
-
return
|
|
6695
|
+
return c.status === "aborted" ? k : c.status === "dirty" || t.value === "dirty" ? Ve(c.value) : c;
|
|
6692
6696
|
});
|
|
6693
6697
|
{
|
|
6694
6698
|
if (t.value === "aborted")
|
|
6695
6699
|
return k;
|
|
6696
|
-
const
|
|
6700
|
+
const d = this._def.schema._parseSync({
|
|
6697
6701
|
data: o,
|
|
6698
6702
|
path: s.path,
|
|
6699
6703
|
parent: s
|
|
6700
6704
|
});
|
|
6701
|
-
return
|
|
6705
|
+
return d.status === "aborted" ? k : d.status === "dirty" || t.value === "dirty" ? Ve(d.value) : d;
|
|
6702
6706
|
}
|
|
6703
6707
|
}
|
|
6704
6708
|
if (r.type === "refinement") {
|
|
6705
|
-
const o = (
|
|
6706
|
-
const
|
|
6709
|
+
const o = (d) => {
|
|
6710
|
+
const c = r.refinement(d, a);
|
|
6707
6711
|
if (s.common.async)
|
|
6708
|
-
return Promise.resolve(
|
|
6709
|
-
if (
|
|
6712
|
+
return Promise.resolve(c);
|
|
6713
|
+
if (c instanceof Promise)
|
|
6710
6714
|
throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
6711
|
-
return
|
|
6715
|
+
return d;
|
|
6712
6716
|
};
|
|
6713
6717
|
if (s.common.async === !1) {
|
|
6714
|
-
const
|
|
6718
|
+
const d = this._def.schema._parseSync({
|
|
6715
6719
|
data: s.data,
|
|
6716
6720
|
path: s.path,
|
|
6717
6721
|
parent: s
|
|
6718
6722
|
});
|
|
6719
|
-
return
|
|
6723
|
+
return d.status === "aborted" ? k : (d.status === "dirty" && t.dirty(), o(d.value), { status: t.value, value: d.value });
|
|
6720
6724
|
} else
|
|
6721
|
-
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((
|
|
6725
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((d) => d.status === "aborted" ? k : (d.status === "dirty" && t.dirty(), o(d.value).then(() => ({ status: t.value, value: d.value }))));
|
|
6722
6726
|
}
|
|
6723
6727
|
if (r.type === "transform")
|
|
6724
6728
|
if (s.common.async === !1) {
|
|
@@ -6729,12 +6733,12 @@ class J extends Z {
|
|
|
6729
6733
|
});
|
|
6730
6734
|
if (!mt(o))
|
|
6731
6735
|
return o;
|
|
6732
|
-
const
|
|
6733
|
-
if (
|
|
6736
|
+
const d = r.transform(o.value, a);
|
|
6737
|
+
if (d instanceof Promise)
|
|
6734
6738
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
6735
|
-
return { status: t.value, value:
|
|
6739
|
+
return { status: t.value, value: d };
|
|
6736
6740
|
} else
|
|
6737
|
-
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => mt(o) ? Promise.resolve(r.transform(o.value, a)).then((
|
|
6741
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((o) => mt(o) ? Promise.resolve(r.transform(o.value, a)).then((d) => ({ status: t.value, value: d })) : o);
|
|
6738
6742
|
C.assertNever(r);
|
|
6739
6743
|
}
|
|
6740
6744
|
}
|
|
@@ -6928,8 +6932,8 @@ function Bn(n, e = {}, t) {
|
|
|
6928
6932
|
return n ? Je.create().superRefine((s, r) => {
|
|
6929
6933
|
var a, o;
|
|
6930
6934
|
if (!n(s)) {
|
|
6931
|
-
const
|
|
6932
|
-
r.addIssue({ code: "custom", ...u, fatal:
|
|
6935
|
+
const d = typeof e == "function" ? e(s) : typeof e == "string" ? { message: e } : e, c = (o = (a = d.fatal) !== null && a !== void 0 ? a : t) !== null && o !== void 0 ? o : !0, u = typeof d == "string" ? { message: d } : d;
|
|
6936
|
+
r.addIssue({ code: "custom", ...u, fatal: c });
|
|
6933
6937
|
}
|
|
6934
6938
|
}) : Je.create();
|
|
6935
6939
|
}
|
|
@@ -6942,7 +6946,7 @@ var b;
|
|
|
6942
6946
|
})(b || (b = {}));
|
|
6943
6947
|
const Ha = (n, e = {
|
|
6944
6948
|
message: `Input not instance of ${n.name}`
|
|
6945
|
-
}) => Bn((t) => t instanceof n, e), Wn = z.create, qn = ye.create, Qa = qt.create, Ya = ve.create, Jn = gt.create, Ga = Ce.create, Xa = zt.create, ei = yt.create, ti = vt.create, ni = Je.create, si = Ze.create, ri = ae.create, ai = Bt.create, ii = W.create, oi = E.create,
|
|
6949
|
+
}) => Bn((t) => t instanceof n, e), Wn = z.create, qn = ye.create, Qa = qt.create, Ya = ve.create, Jn = gt.create, Ga = Ce.create, Xa = zt.create, ei = yt.create, ti = vt.create, ni = Je.create, si = Ze.create, ri = ae.create, ai = Bt.create, ii = W.create, oi = E.create, di = E.strictCreate, ci = wt.create, ui = Kt.create, li = bt.create, pi = ne.create, hi = kt.create, fi = Wt.create, mi = Ie.create, _i = Fe.create, gi = xt.create, yi = Tt.create, vi = we.create, wi = Ot.create, bi = Ke.create, yn = J.create, ki = G.create, xi = be.create, Ti = J.createWithPreprocess, Oi = Ct.create, Si = () => Wn().optional(), Zi = () => qn().optional(), ji = () => Jn().optional(), Ni = {
|
|
6946
6950
|
string: (n) => z.create({ ...n, coerce: !0 }),
|
|
6947
6951
|
number: (n) => ye.create({ ...n, coerce: !0 }),
|
|
6948
6952
|
boolean: (n) => gt.create({
|
|
@@ -7054,13 +7058,13 @@ var Ii = /* @__PURE__ */ Object.freeze({
|
|
|
7054
7058
|
promise: bi,
|
|
7055
7059
|
record: hi,
|
|
7056
7060
|
set: mi,
|
|
7057
|
-
strictObject:
|
|
7061
|
+
strictObject: di,
|
|
7058
7062
|
string: Wn,
|
|
7059
7063
|
symbol: Xa,
|
|
7060
7064
|
transformer: yn,
|
|
7061
7065
|
tuple: pi,
|
|
7062
7066
|
undefined: ei,
|
|
7063
|
-
union:
|
|
7067
|
+
union: ci,
|
|
7064
7068
|
unknown: si,
|
|
7065
7069
|
void: ai,
|
|
7066
7070
|
NEVER: Ci,
|
|
@@ -7099,10 +7103,10 @@ function Ei(n) {
|
|
|
7099
7103
|
return async (e, t) => {
|
|
7100
7104
|
let s = n.selectFrom("connections").where("connections.tenant_id", "=", e);
|
|
7101
7105
|
t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
|
|
7102
|
-
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((
|
|
7106
|
+
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();
|
|
7103
7107
|
return {
|
|
7104
7108
|
connections: a.map(
|
|
7105
|
-
(
|
|
7109
|
+
(d) => R(Kn(d, ["options"]))
|
|
7106
7110
|
),
|
|
7107
7111
|
start: t.page * t.per_page,
|
|
7108
7112
|
limit: t.per_page,
|
|
@@ -7156,7 +7160,12 @@ function Di(n) {
|
|
|
7156
7160
|
return {
|
|
7157
7161
|
...t,
|
|
7158
7162
|
connections: r.map(
|
|
7159
|
-
(
|
|
7163
|
+
(d) => Rn.parse(
|
|
7164
|
+
R({
|
|
7165
|
+
...d,
|
|
7166
|
+
options: d.options ? JSON.parse(d.options) : {}
|
|
7167
|
+
})
|
|
7168
|
+
)
|
|
7160
7169
|
),
|
|
7161
7170
|
domains: a,
|
|
7162
7171
|
addons: t.addons ? JSON.parse(t.addons) : {},
|
|
@@ -7206,7 +7215,7 @@ function zi(n) {
|
|
|
7206
7215
|
return async (e, t) => {
|
|
7207
7216
|
let s = n.selectFrom("domains").where("domains.tenant_id", "=", e);
|
|
7208
7217
|
t.q && (s = Ee(n, s, t.q, ["user_id", "ip"]));
|
|
7209
|
-
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((
|
|
7218
|
+
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();
|
|
7210
7219
|
return {
|
|
7211
7220
|
domains: a,
|
|
7212
7221
|
start: t.page * t.per_page,
|
|
@@ -7231,8 +7240,8 @@ function Wi(n) {
|
|
|
7231
7240
|
colors_primary: r,
|
|
7232
7241
|
colors_page_background_type: a,
|
|
7233
7242
|
colors_page_background_start: o,
|
|
7234
|
-
colors_page_background_end:
|
|
7235
|
-
colors_page_background_angle_dev:
|
|
7243
|
+
colors_page_background_end: d,
|
|
7244
|
+
colors_page_background_angle_dev: c,
|
|
7236
7245
|
font_url: u,
|
|
7237
7246
|
...l
|
|
7238
7247
|
} = t;
|
|
@@ -7243,8 +7252,8 @@ function Wi(n) {
|
|
|
7243
7252
|
page_background: {
|
|
7244
7253
|
type: a,
|
|
7245
7254
|
start: o,
|
|
7246
|
-
end:
|
|
7247
|
-
angle_deg:
|
|
7255
|
+
end: d,
|
|
7256
|
+
angle_deg: c
|
|
7248
7257
|
}
|
|
7249
7258
|
},
|
|
7250
7259
|
font: u ? { url: u } : void 0
|
|
@@ -7253,14 +7262,14 @@ function Wi(n) {
|
|
|
7253
7262
|
}
|
|
7254
7263
|
function qi(n) {
|
|
7255
7264
|
return async (e, t) => {
|
|
7256
|
-
var o,
|
|
7265
|
+
var o, d, c, u, l, j, A, U, ie, Re, oe, de, ce, $e, Pe, K, H, Q;
|
|
7257
7266
|
const { colors: s, font: r, ...a } = t;
|
|
7258
7267
|
try {
|
|
7259
7268
|
await n.insertInto("branding").values({
|
|
7260
7269
|
...a,
|
|
7261
7270
|
colors_primary: s == null ? void 0 : s.primary,
|
|
7262
|
-
colors_page_background_type: (
|
|
7263
|
-
colors_page_background_start: (u = (
|
|
7271
|
+
colors_page_background_type: (d = (o = t.colors) == null ? void 0 : o.page_background) == null ? void 0 : d.type,
|
|
7272
|
+
colors_page_background_start: (u = (c = t.colors) == null ? void 0 : c.page_background) == null ? void 0 : u.start,
|
|
7264
7273
|
colors_page_background_end: (j = (l = t.colors) == null ? void 0 : l.page_background) == null ? void 0 : j.end,
|
|
7265
7274
|
colors_page_background_angle_dev: (U = (A = t.colors) == null ? void 0 : A.page_background) == null ? void 0 : U.angle_deg,
|
|
7266
7275
|
font_url: (ie = t.font) == null ? void 0 : ie.url,
|
|
@@ -7271,7 +7280,7 @@ function qi(n) {
|
|
|
7271
7280
|
...a,
|
|
7272
7281
|
colors_primary: s == null ? void 0 : s.primary,
|
|
7273
7282
|
colors_page_background_type: (oe = (Re = t.colors) == null ? void 0 : Re.page_background) == null ? void 0 : oe.type,
|
|
7274
|
-
colors_page_background_start: (
|
|
7283
|
+
colors_page_background_start: (ce = (de = t.colors) == null ? void 0 : de.page_background) == null ? void 0 : ce.start,
|
|
7275
7284
|
colors_page_background_end: (Pe = ($e = t.colors) == null ? void 0 : $e.page_background) == null ? void 0 : Pe.end,
|
|
7276
7285
|
colors_page_background_angle_dev: (H = (K = t.colors) == null ? void 0 : K.page_background) == null ? void 0 : H.angle_deg,
|
|
7277
7286
|
font_url: (Q = t.font) == null ? void 0 : Q.url
|
|
@@ -7289,10 +7298,10 @@ function Ki(n) {
|
|
|
7289
7298
|
return async (e, t) => {
|
|
7290
7299
|
let s = n.selectFrom("hooks").where("hooks.tenant_id", "=", e);
|
|
7291
7300
|
t.q && (s = Ee(n, s, t.q, ["url"]));
|
|
7292
|
-
const a = await s.offset(t.page * t.per_page).limit(t.per_page).selectAll().execute(), { count: o } = await s.select((
|
|
7301
|
+
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();
|
|
7293
7302
|
return {
|
|
7294
|
-
hooks: a.map((
|
|
7295
|
-
const { tenant_id: u, enabled: l, synchronous: j, ...A } =
|
|
7303
|
+
hooks: a.map((c) => {
|
|
7304
|
+
const { tenant_id: u, enabled: l, synchronous: j, ...A } = c;
|
|
7296
7305
|
return R({
|
|
7297
7306
|
...A,
|
|
7298
7307
|
enabled: !!l,
|
|
@@ -7473,7 +7482,7 @@ function mo(n) {
|
|
|
7473
7482
|
sessions: aa(n),
|
|
7474
7483
|
tenants: Kr(n),
|
|
7475
7484
|
themes: ro(n),
|
|
7476
|
-
tickets:
|
|
7485
|
+
tickets: ca(n)
|
|
7477
7486
|
};
|
|
7478
7487
|
}
|
|
7479
7488
|
export {
|