@authhero/kysely-adapter 0.27.0 → 0.28.1
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 +9 -9
- package/dist/kysely-adapter.mjs +161 -133
- package/package.json +2 -2
package/dist/kysely-adapter.mjs
CHANGED
|
@@ -84,11 +84,11 @@ function Ya(t) {
|
|
|
84
84
|
if (Ha(this, "ZodObject")) {
|
|
85
85
|
const We = this.extend;
|
|
86
86
|
ve.extend = function(...qe) {
|
|
87
|
-
var ee, te, ne, be,
|
|
87
|
+
var ee, te, ne, be, Ee, Pe;
|
|
88
88
|
const Ae = We.apply(this, qe);
|
|
89
89
|
return Ae._def.openapi = {
|
|
90
90
|
_internal: {
|
|
91
|
-
extendedFrom: !((te = (ee = this._def.openapi) === null || ee === void 0 ? void 0 : ee._internal) === null || te === void 0) && te.refId ? { refId: (be = (ne = this._def.openapi) === null || ne === void 0 ? void 0 : ne._internal) === null || be === void 0 ? void 0 : be.refId, schema: this } : (
|
|
91
|
+
extendedFrom: !((te = (ee = this._def.openapi) === null || ee === void 0 ? void 0 : ee._internal) === null || te === void 0) && te.refId ? { refId: (be = (ne = this._def.openapi) === null || ne === void 0 ? void 0 : ne._internal) === null || be === void 0 ? void 0 : be.refId, schema: this } : (Ee = this._def.openapi) === null || Ee === void 0 ? void 0 : Ee._internal.extendedFrom
|
|
92
92
|
},
|
|
93
93
|
metadata: (Pe = Ae._def.openapi) === null || Pe === void 0 ? void 0 : Pe.metadata
|
|
94
94
|
}, Ae;
|
|
@@ -116,7 +116,7 @@ function Ya(t) {
|
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
118
|
new Set(".\\+*[^]$()");
|
|
119
|
-
var
|
|
119
|
+
var $;
|
|
120
120
|
(function(t) {
|
|
121
121
|
t.assertEqual = (r) => r;
|
|
122
122
|
function e(r) {
|
|
@@ -151,7 +151,7 @@ var E;
|
|
|
151
151
|
return r.map((o) => typeof o == "string" ? `'${o}'` : o).join(s);
|
|
152
152
|
}
|
|
153
153
|
t.joinValues = a, t.jsonStringifyReplacer = (r, s) => typeof s == "bigint" ? s.toString() : s;
|
|
154
|
-
})(
|
|
154
|
+
})($ || ($ = {}));
|
|
155
155
|
var On;
|
|
156
156
|
(function(t) {
|
|
157
157
|
t.mergeShapes = (e, n) => ({
|
|
@@ -160,7 +160,7 @@ var On;
|
|
|
160
160
|
// second overwrites first
|
|
161
161
|
});
|
|
162
162
|
})(On || (On = {}));
|
|
163
|
-
const g =
|
|
163
|
+
const g = $.arrayToEnum([
|
|
164
164
|
"string",
|
|
165
165
|
"nan",
|
|
166
166
|
"number",
|
|
@@ -202,7 +202,7 @@ const g = E.arrayToEnum([
|
|
|
202
202
|
default:
|
|
203
203
|
return g.unknown;
|
|
204
204
|
}
|
|
205
|
-
}, h =
|
|
205
|
+
}, h = $.arrayToEnum([
|
|
206
206
|
"invalid_type",
|
|
207
207
|
"invalid_literal",
|
|
208
208
|
"custom",
|
|
@@ -264,7 +264,7 @@ class K extends Error {
|
|
|
264
264
|
return this.message;
|
|
265
265
|
}
|
|
266
266
|
get message() {
|
|
267
|
-
return JSON.stringify(this.issues,
|
|
267
|
+
return JSON.stringify(this.issues, $.jsonStringifyReplacer, 2);
|
|
268
268
|
}
|
|
269
269
|
get isEmpty() {
|
|
270
270
|
return this.issues.length === 0;
|
|
@@ -287,19 +287,19 @@ const st = (t, e) => {
|
|
|
287
287
|
t.received === g.undefined ? n = "Required" : n = `Expected ${t.expected}, received ${t.received}`;
|
|
288
288
|
break;
|
|
289
289
|
case h.invalid_literal:
|
|
290
|
-
n = `Invalid literal value, expected ${JSON.stringify(t.expected,
|
|
290
|
+
n = `Invalid literal value, expected ${JSON.stringify(t.expected, $.jsonStringifyReplacer)}`;
|
|
291
291
|
break;
|
|
292
292
|
case h.unrecognized_keys:
|
|
293
|
-
n = `Unrecognized key(s) in object: ${
|
|
293
|
+
n = `Unrecognized key(s) in object: ${$.joinValues(t.keys, ", ")}`;
|
|
294
294
|
break;
|
|
295
295
|
case h.invalid_union:
|
|
296
296
|
n = "Invalid input";
|
|
297
297
|
break;
|
|
298
298
|
case h.invalid_union_discriminator:
|
|
299
|
-
n = `Invalid discriminator value. Expected ${
|
|
299
|
+
n = `Invalid discriminator value. Expected ${$.joinValues(t.options)}`;
|
|
300
300
|
break;
|
|
301
301
|
case h.invalid_enum_value:
|
|
302
|
-
n = `Invalid enum value. Expected ${
|
|
302
|
+
n = `Invalid enum value. Expected ${$.joinValues(t.options)}, received '${t.received}'`;
|
|
303
303
|
break;
|
|
304
304
|
case h.invalid_arguments:
|
|
305
305
|
n = "Invalid function arguments";
|
|
@@ -311,7 +311,7 @@ const st = (t, e) => {
|
|
|
311
311
|
n = "Invalid date";
|
|
312
312
|
break;
|
|
313
313
|
case h.invalid_string:
|
|
314
|
-
typeof t.validation == "object" ? "includes" in t.validation ? (n = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (n = `${n} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? n = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? n = `Invalid input: must end with "${t.validation.endsWith}"` :
|
|
314
|
+
typeof t.validation == "object" ? "includes" in t.validation ? (n = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (n = `${n} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? n = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? n = `Invalid input: must end with "${t.validation.endsWith}"` : $.assertNever(t.validation) : t.validation !== "regex" ? n = `Invalid ${t.validation}` : n = "Invalid";
|
|
315
315
|
break;
|
|
316
316
|
case h.too_small:
|
|
317
317
|
t.type === "array" ? n = `Array must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "more than"} ${t.minimum} element(s)` : t.type === "string" ? n = `String must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "over"} ${t.minimum} character(s)` : t.type === "number" ? n = `Number must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${t.minimum}` : t.type === "date" ? n = `Date must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(t.minimum))}` : n = "Invalid input";
|
|
@@ -332,7 +332,7 @@ const st = (t, e) => {
|
|
|
332
332
|
n = "Number must be finite";
|
|
333
333
|
break;
|
|
334
334
|
default:
|
|
335
|
-
n = e.defaultError,
|
|
335
|
+
n = e.defaultError, $.assertNever(t);
|
|
336
336
|
}
|
|
337
337
|
return { message: n };
|
|
338
338
|
};
|
|
@@ -611,7 +611,7 @@ class j {
|
|
|
611
611
|
}
|
|
612
612
|
default(e) {
|
|
613
613
|
const n = typeof e == "function" ? e : () => e;
|
|
614
|
-
return new
|
|
614
|
+
return new $t({
|
|
615
615
|
...O(this._def),
|
|
616
616
|
innerType: this,
|
|
617
617
|
defaultValue: n,
|
|
@@ -627,7 +627,7 @@ class j {
|
|
|
627
627
|
}
|
|
628
628
|
catch(e) {
|
|
629
629
|
const n = typeof e == "function" ? e : () => e;
|
|
630
|
-
return new
|
|
630
|
+
return new Et({
|
|
631
631
|
...O(this._def),
|
|
632
632
|
innerType: this,
|
|
633
633
|
catchValue: n,
|
|
@@ -812,7 +812,7 @@ class q extends j {
|
|
|
812
812
|
validation: "base64",
|
|
813
813
|
code: h.invalid_string,
|
|
814
814
|
message: r.message
|
|
815
|
-
}), n.dirty()) :
|
|
815
|
+
}), n.dirty()) : $.assertNever(r);
|
|
816
816
|
return { status: n.value, value: e.data };
|
|
817
817
|
}
|
|
818
818
|
_regex(e, n, a) {
|
|
@@ -1050,7 +1050,7 @@ class ke extends j {
|
|
|
1050
1050
|
let n;
|
|
1051
1051
|
const a = new U();
|
|
1052
1052
|
for (const r of this._def.checks)
|
|
1053
|
-
r.kind === "int" ?
|
|
1053
|
+
r.kind === "int" ? $.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), f(n, {
|
|
1054
1054
|
code: h.invalid_type,
|
|
1055
1055
|
expected: "integer",
|
|
1056
1056
|
received: "float",
|
|
@@ -1076,7 +1076,7 @@ class ke extends j {
|
|
|
1076
1076
|
}), a.dirty()) : r.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), f(n, {
|
|
1077
1077
|
code: h.not_finite,
|
|
1078
1078
|
message: r.message
|
|
1079
|
-
}), a.dirty()) :
|
|
1079
|
+
}), a.dirty()) : $.assertNever(r);
|
|
1080
1080
|
return { status: a.value, value: e.data };
|
|
1081
1081
|
}
|
|
1082
1082
|
gte(e, n) {
|
|
@@ -1188,7 +1188,7 @@ class ke extends j {
|
|
|
1188
1188
|
return e;
|
|
1189
1189
|
}
|
|
1190
1190
|
get isInt() {
|
|
1191
|
-
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" &&
|
|
1191
|
+
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && $.isInteger(e.value));
|
|
1192
1192
|
}
|
|
1193
1193
|
get isFinite() {
|
|
1194
1194
|
let e = null, n = null;
|
|
@@ -1238,7 +1238,7 @@ class Ce extends j {
|
|
|
1238
1238
|
code: h.not_multiple_of,
|
|
1239
1239
|
multipleOf: r.value,
|
|
1240
1240
|
message: r.message
|
|
1241
|
-
}), a.dirty()) :
|
|
1241
|
+
}), a.dirty()) : $.assertNever(r);
|
|
1242
1242
|
return { status: a.value, value: e.data };
|
|
1243
1243
|
}
|
|
1244
1244
|
gte(e, n) {
|
|
@@ -1385,7 +1385,7 @@ class ze extends j {
|
|
|
1385
1385
|
exact: !1,
|
|
1386
1386
|
maximum: r.value,
|
|
1387
1387
|
type: "date"
|
|
1388
|
-
}), n.dirty()) :
|
|
1388
|
+
}), n.dirty()) : $.assertNever(r);
|
|
1389
1389
|
return {
|
|
1390
1390
|
status: n.value,
|
|
1391
1391
|
value: new Date(e.data.getTime())
|
|
@@ -1632,7 +1632,7 @@ class A extends j {
|
|
|
1632
1632
|
_getCached() {
|
|
1633
1633
|
if (this._cached !== null)
|
|
1634
1634
|
return this._cached;
|
|
1635
|
-
const e = this._def.shape(), n =
|
|
1635
|
+
const e = this._def.shape(), n = $.objectKeys(e);
|
|
1636
1636
|
return this._cached = { shape: e, keys: n };
|
|
1637
1637
|
}
|
|
1638
1638
|
_parse(e) {
|
|
@@ -1839,7 +1839,7 @@ class A extends j {
|
|
|
1839
1839
|
}
|
|
1840
1840
|
pick(e) {
|
|
1841
1841
|
const n = {};
|
|
1842
|
-
return
|
|
1842
|
+
return $.objectKeys(e).forEach((a) => {
|
|
1843
1843
|
e[a] && this.shape[a] && (n[a] = this.shape[a]);
|
|
1844
1844
|
}), new A({
|
|
1845
1845
|
...this._def,
|
|
@@ -1848,7 +1848,7 @@ class A extends j {
|
|
|
1848
1848
|
}
|
|
1849
1849
|
omit(e) {
|
|
1850
1850
|
const n = {};
|
|
1851
|
-
return
|
|
1851
|
+
return $.objectKeys(this.shape).forEach((a) => {
|
|
1852
1852
|
e[a] || (n[a] = this.shape[a]);
|
|
1853
1853
|
}), new A({
|
|
1854
1854
|
...this._def,
|
|
@@ -1863,7 +1863,7 @@ class A extends j {
|
|
|
1863
1863
|
}
|
|
1864
1864
|
partial(e) {
|
|
1865
1865
|
const n = {};
|
|
1866
|
-
return
|
|
1866
|
+
return $.objectKeys(this.shape).forEach((a) => {
|
|
1867
1867
|
const r = this.shape[a];
|
|
1868
1868
|
e && !e[a] ? n[a] = r : n[a] = r.optional();
|
|
1869
1869
|
}), new A({
|
|
@@ -1873,7 +1873,7 @@ class A extends j {
|
|
|
1873
1873
|
}
|
|
1874
1874
|
required(e) {
|
|
1875
1875
|
const n = {};
|
|
1876
|
-
return
|
|
1876
|
+
return $.objectKeys(this.shape).forEach((a) => {
|
|
1877
1877
|
if (e && !e[a])
|
|
1878
1878
|
n[a] = this.shape[a];
|
|
1879
1879
|
else {
|
|
@@ -1888,7 +1888,7 @@ class A extends j {
|
|
|
1888
1888
|
});
|
|
1889
1889
|
}
|
|
1890
1890
|
keyof() {
|
|
1891
|
-
return ra(
|
|
1891
|
+
return ra($.objectKeys(this.shape));
|
|
1892
1892
|
}
|
|
1893
1893
|
}
|
|
1894
1894
|
A.create = (t, e) => new A({
|
|
@@ -1985,7 +1985,7 @@ Tt.create = (t, e) => new Tt({
|
|
|
1985
1985
|
typeName: x.ZodUnion,
|
|
1986
1986
|
...O(e)
|
|
1987
1987
|
});
|
|
1988
|
-
const we = (t) => t instanceof jt ? we(t.schema) : t instanceof Y ? we(t.innerType()) : t instanceof It ? [t.value] : t instanceof Te ? t.options : t instanceof Zt ?
|
|
1988
|
+
const we = (t) => t instanceof jt ? we(t.schema) : t instanceof Y ? we(t.innerType()) : t instanceof It ? [t.value] : t instanceof Te ? t.options : t instanceof Zt ? $.objectValues(t.enum) : t instanceof $t ? we(t._def.innerType) : t instanceof kt ? [void 0] : t instanceof Ct ? [null] : t instanceof re ? [void 0, ...we(t.unwrap())] : t instanceof Oe ? [null, ...we(t.unwrap())] : t instanceof zn || t instanceof Pt ? we(t.unwrap()) : t instanceof Et ? we(t._def.innerType) : [];
|
|
1989
1989
|
class yn extends j {
|
|
1990
1990
|
_parse(e) {
|
|
1991
1991
|
const { ctx: n } = this._processInputParams(e);
|
|
@@ -2053,7 +2053,7 @@ function In(t, e) {
|
|
|
2053
2053
|
if (t === e)
|
|
2054
2054
|
return { valid: !0, data: t };
|
|
2055
2055
|
if (n === g.object && a === g.object) {
|
|
2056
|
-
const r =
|
|
2056
|
+
const r = $.objectKeys(e), s = $.objectKeys(t).filter((d) => r.indexOf(d) !== -1), o = { ...t, ...e };
|
|
2057
2057
|
for (const d of s) {
|
|
2058
2058
|
const c = In(t[d], e[d]);
|
|
2059
2059
|
if (!c.valid)
|
|
@@ -2466,7 +2466,7 @@ class Te extends j {
|
|
|
2466
2466
|
if (typeof e.data != "string") {
|
|
2467
2467
|
const n = this._getOrReturnCtx(e), a = this._def.values;
|
|
2468
2468
|
return f(n, {
|
|
2469
|
-
expected:
|
|
2469
|
+
expected: $.joinValues(a),
|
|
2470
2470
|
received: n.parsedType,
|
|
2471
2471
|
code: h.invalid_type
|
|
2472
2472
|
}), C;
|
|
@@ -2522,17 +2522,17 @@ class Zt extends j {
|
|
|
2522
2522
|
super(...arguments), _t.set(this, void 0);
|
|
2523
2523
|
}
|
|
2524
2524
|
_parse(e) {
|
|
2525
|
-
const n =
|
|
2525
|
+
const n = $.getValidEnumValues(this._def.values), a = this._getOrReturnCtx(e);
|
|
2526
2526
|
if (a.parsedType !== g.string && a.parsedType !== g.number) {
|
|
2527
|
-
const r =
|
|
2527
|
+
const r = $.objectValues(n);
|
|
2528
2528
|
return f(a, {
|
|
2529
|
-
expected:
|
|
2529
|
+
expected: $.joinValues(r),
|
|
2530
2530
|
received: a.parsedType,
|
|
2531
2531
|
code: h.invalid_type
|
|
2532
2532
|
}), C;
|
|
2533
2533
|
}
|
|
2534
|
-
if (rn(this, _t) || ea(this, _t, new Set(
|
|
2535
|
-
const r =
|
|
2534
|
+
if (rn(this, _t) || ea(this, _t, new Set($.getValidEnumValues(this._def.values))), !rn(this, _t).has(e.data)) {
|
|
2535
|
+
const r = $.objectValues(n);
|
|
2536
2536
|
return f(a, {
|
|
2537
2537
|
received: a.data,
|
|
2538
2538
|
code: h.invalid_enum_value,
|
|
@@ -2649,7 +2649,7 @@ class Y extends j {
|
|
|
2649
2649
|
return { status: n.value, value: d };
|
|
2650
2650
|
} else
|
|
2651
2651
|
return this._def.schema._parseAsync({ data: a.data, path: a.path, parent: a }).then((o) => wt(o) ? Promise.resolve(r.transform(o.value, s)).then((d) => ({ status: n.value, value: d })) : o);
|
|
2652
|
-
|
|
2652
|
+
$.assertNever(r);
|
|
2653
2653
|
}
|
|
2654
2654
|
}
|
|
2655
2655
|
Y.create = (t, e, n) => new Y({
|
|
@@ -2690,7 +2690,7 @@ Oe.create = (t, e) => new Oe({
|
|
|
2690
2690
|
typeName: x.ZodNullable,
|
|
2691
2691
|
...O(e)
|
|
2692
2692
|
});
|
|
2693
|
-
class
|
|
2693
|
+
class $t extends j {
|
|
2694
2694
|
_parse(e) {
|
|
2695
2695
|
const { ctx: n } = this._processInputParams(e);
|
|
2696
2696
|
let a = n.data;
|
|
@@ -2704,13 +2704,13 @@ class Et extends j {
|
|
|
2704
2704
|
return this._def.innerType;
|
|
2705
2705
|
}
|
|
2706
2706
|
}
|
|
2707
|
-
|
|
2707
|
+
$t.create = (t, e) => new $t({
|
|
2708
2708
|
innerType: t,
|
|
2709
2709
|
typeName: x.ZodDefault,
|
|
2710
2710
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2711
2711
|
...O(e)
|
|
2712
2712
|
});
|
|
2713
|
-
class
|
|
2713
|
+
class Et extends j {
|
|
2714
2714
|
_parse(e) {
|
|
2715
2715
|
const { ctx: n } = this._processInputParams(e), a = {
|
|
2716
2716
|
...n,
|
|
@@ -2747,7 +2747,7 @@ class $t extends j {
|
|
|
2747
2747
|
return this._def.innerType;
|
|
2748
2748
|
}
|
|
2749
2749
|
}
|
|
2750
|
-
|
|
2750
|
+
Et.create = (t, e) => new Et({
|
|
2751
2751
|
innerType: t,
|
|
2752
2752
|
typeName: x.ZodCatch,
|
|
2753
2753
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
@@ -2856,7 +2856,7 @@ var x;
|
|
|
2856
2856
|
})(x || (x = {}));
|
|
2857
2857
|
const vr = (t, e = {
|
|
2858
2858
|
message: `Input not instance of ${t.name}`
|
|
2859
|
-
}) => sa((n) => n instanceof t, e), ia = q.create, oa = ke.create, br = cn.create, wr = Ce.create, da = Nt.create, xr = ze.create, Nr = sn.create, kr = kt.create, Cr = Ct.create, Tr = it.create, Or = Re.create, Sr = me.create, jr = on.create, Ir = G.create, Zr = A.create,
|
|
2859
|
+
}) => sa((n) => n instanceof t, e), ia = q.create, oa = ke.create, br = cn.create, wr = Ce.create, da = Nt.create, xr = ze.create, Nr = sn.create, kr = kt.create, Cr = Ct.create, Tr = it.create, Or = Re.create, Sr = me.create, jr = on.create, Ir = G.create, Zr = A.create, $r = A.strictCreate, Er = Tt.create, Pr = yn.create, Ar = Ot.create, Dr = oe.create, Mr = St.create, Rr = dn.create, Lr = Ue.create, zr = nt.create, Ur = jt.create, Fr = It.create, Vr = Te.create, Br = Zt.create, Kr = ot.create, Jn = Y.create, Jr = re.create, Wr = Oe.create, qr = Y.createWithPreprocess, Qr = Ht.create, Gr = () => ia().optional(), Hr = () => oa().optional(), Yr = () => da().optional(), Xr = {
|
|
2860
2860
|
string: (t) => q.create({ ...t, coerce: !0 }),
|
|
2861
2861
|
number: (t) => ke.create({ ...t, coerce: !0 }),
|
|
2862
2862
|
boolean: (t) => Nt.create({
|
|
@@ -2883,7 +2883,7 @@ var i = /* @__PURE__ */ Object.freeze({
|
|
|
2883
2883
|
isValid: wt,
|
|
2884
2884
|
isAsync: xt,
|
|
2885
2885
|
get util() {
|
|
2886
|
-
return
|
|
2886
|
+
return $;
|
|
2887
2887
|
},
|
|
2888
2888
|
get objectUtil() {
|
|
2889
2889
|
return On;
|
|
@@ -2923,8 +2923,8 @@ var i = /* @__PURE__ */ Object.freeze({
|
|
|
2923
2923
|
ZodTransformer: Y,
|
|
2924
2924
|
ZodOptional: re,
|
|
2925
2925
|
ZodNullable: Oe,
|
|
2926
|
-
ZodDefault:
|
|
2927
|
-
ZodCatch:
|
|
2926
|
+
ZodDefault: $t,
|
|
2927
|
+
ZodCatch: Et,
|
|
2928
2928
|
ZodNaN: cn,
|
|
2929
2929
|
BRAND: gr,
|
|
2930
2930
|
ZodBranded: zn,
|
|
@@ -2968,13 +2968,13 @@ var i = /* @__PURE__ */ Object.freeze({
|
|
|
2968
2968
|
promise: Kr,
|
|
2969
2969
|
record: Mr,
|
|
2970
2970
|
set: Lr,
|
|
2971
|
-
strictObject:
|
|
2971
|
+
strictObject: $r,
|
|
2972
2972
|
string: ia,
|
|
2973
2973
|
symbol: Nr,
|
|
2974
2974
|
transformer: Jn,
|
|
2975
2975
|
tuple: Dr,
|
|
2976
2976
|
undefined: kr,
|
|
2977
|
-
union:
|
|
2977
|
+
union: Er,
|
|
2978
2978
|
unknown: Or,
|
|
2979
2979
|
void: jr,
|
|
2980
2980
|
NEVER: es,
|
|
@@ -3531,7 +3531,7 @@ const Ts = i.object({
|
|
|
3531
3531
|
Zs.extend({
|
|
3532
3532
|
themeId: i.string()
|
|
3533
3533
|
});
|
|
3534
|
-
const
|
|
3534
|
+
const $s = i.object({
|
|
3535
3535
|
universal_login_experience: i.enum(["new", "classic"]).default("new"),
|
|
3536
3536
|
identifier_first: i.boolean().default(!0),
|
|
3537
3537
|
password_first: i.boolean().default(!1),
|
|
@@ -3593,7 +3593,7 @@ function ma(t) {
|
|
|
3593
3593
|
}
|
|
3594
3594
|
};
|
|
3595
3595
|
}
|
|
3596
|
-
function
|
|
3596
|
+
function Es(t) {
|
|
3597
3597
|
return async (e, n) => {
|
|
3598
3598
|
const [a, r] = await Promise.all([
|
|
3599
3599
|
t.selectFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", n).selectAll().executeTakeFirst(),
|
|
@@ -3658,11 +3658,15 @@ function Be(t, e, n, a) {
|
|
|
3658
3658
|
}
|
|
3659
3659
|
}), e;
|
|
3660
3660
|
}
|
|
3661
|
-
function
|
|
3661
|
+
function $e(t) {
|
|
3662
3662
|
return typeof t == "string" ? parseInt(t, 10) : typeof t == "bigint" ? Number(t) : t;
|
|
3663
3663
|
}
|
|
3664
3664
|
function Ps(t) {
|
|
3665
|
-
return async (e, n
|
|
3665
|
+
return async (e, n = {
|
|
3666
|
+
page: 0,
|
|
3667
|
+
per_page: 50,
|
|
3668
|
+
include_totals: !1
|
|
3669
|
+
}) => {
|
|
3666
3670
|
let a = t.selectFrom("users").where("users.tenant_id", "=", e);
|
|
3667
3671
|
if (n.q && (a = Be(t, a, n.q, ["email", "name"])), n.sort && n.sort.sort_by) {
|
|
3668
3672
|
const { ref: u } = t.dynamic;
|
|
@@ -3693,7 +3697,7 @@ function Ps(t) {
|
|
|
3693
3697
|
users: c,
|
|
3694
3698
|
start: n.page * n.per_page,
|
|
3695
3699
|
limit: n.per_page,
|
|
3696
|
-
length:
|
|
3700
|
+
length: $e(l)
|
|
3697
3701
|
};
|
|
3698
3702
|
};
|
|
3699
3703
|
}
|
|
@@ -3724,7 +3728,7 @@ function Ls(t) {
|
|
|
3724
3728
|
return {
|
|
3725
3729
|
create: Qa(t),
|
|
3726
3730
|
remove: As(t),
|
|
3727
|
-
get:
|
|
3731
|
+
get: Es(t),
|
|
3728
3732
|
list: Ps(t),
|
|
3729
3733
|
update: Ms(t),
|
|
3730
3734
|
// TODO - think about this more when other issues fixed
|
|
@@ -3756,7 +3760,11 @@ function Fs(t) {
|
|
|
3756
3760
|
};
|
|
3757
3761
|
}
|
|
3758
3762
|
function Vs(t) {
|
|
3759
|
-
return async (e
|
|
3763
|
+
return async (e = {
|
|
3764
|
+
page: 0,
|
|
3765
|
+
per_page: 50,
|
|
3766
|
+
include_totals: !1
|
|
3767
|
+
}) => {
|
|
3760
3768
|
let n = t.selectFrom("tenants");
|
|
3761
3769
|
if (e.sort && e.sort.sort_by) {
|
|
3762
3770
|
const { ref: d } = t.dynamic;
|
|
@@ -3768,7 +3776,7 @@ function Vs(t) {
|
|
|
3768
3776
|
return {
|
|
3769
3777
|
tenants: r
|
|
3770
3778
|
};
|
|
3771
|
-
const { count: s } = await n.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), o =
|
|
3779
|
+
const { count: s } = await n.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), o = $e(s);
|
|
3772
3780
|
return {
|
|
3773
3781
|
tenants: r.map(R),
|
|
3774
3782
|
start: (e.page - 1) * e.per_page,
|
|
@@ -3846,7 +3854,11 @@ function fa(t) {
|
|
|
3846
3854
|
};
|
|
3847
3855
|
}
|
|
3848
3856
|
function Qs(t) {
|
|
3849
|
-
return async (e, n
|
|
3857
|
+
return async (e, n = {
|
|
3858
|
+
page: 0,
|
|
3859
|
+
per_page: 50,
|
|
3860
|
+
include_totals: !1
|
|
3861
|
+
}) => {
|
|
3850
3862
|
let a = t.selectFrom("logs").where("logs.tenant_id", "=", e);
|
|
3851
3863
|
n.q && (a = Be(t, a, n.q, ["user_id", "ip"]));
|
|
3852
3864
|
let r = a;
|
|
@@ -3863,7 +3875,7 @@ function Qs(t) {
|
|
|
3863
3875
|
logs: s.map(fa),
|
|
3864
3876
|
start: n.page * n.per_page,
|
|
3865
3877
|
limit: n.per_page,
|
|
3866
|
-
length:
|
|
3878
|
+
length: $e(o)
|
|
3867
3879
|
};
|
|
3868
3880
|
};
|
|
3869
3881
|
}
|
|
@@ -3900,7 +3912,11 @@ function ti(t) {
|
|
|
3900
3912
|
return async (e, n, a) => !!(await t.updateTable("sessions").set(a).where("tenant_id", "=", e).where("sessions.session_id", "=", n).where("sessions.deleted_at", "is", null).execute()).length;
|
|
3901
3913
|
}
|
|
3902
3914
|
function ni(t) {
|
|
3903
|
-
return async (e, n
|
|
3915
|
+
return async (e, n = {
|
|
3916
|
+
page: 0,
|
|
3917
|
+
per_page: 50,
|
|
3918
|
+
include_totals: !1
|
|
3919
|
+
}) => {
|
|
3904
3920
|
let a = t.selectFrom("sessions").where("sessions.tenant_id", "=", e);
|
|
3905
3921
|
n.q && (a = Be(t, a, n.q, ["user_id", "session_id"]));
|
|
3906
3922
|
let r = a;
|
|
@@ -3912,7 +3928,7 @@ function ni(t) {
|
|
|
3912
3928
|
);
|
|
3913
3929
|
}
|
|
3914
3930
|
r = r.offset(n.page * n.per_page).limit(n.per_page);
|
|
3915
|
-
const s = await r.selectAll().execute(), { count: o } = await a.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), d =
|
|
3931
|
+
const s = await r.selectAll().execute(), { count: o } = await a.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), d = $e(o);
|
|
3916
3932
|
return {
|
|
3917
3933
|
sessions: s,
|
|
3918
3934
|
start: n.page * n.per_page,
|
|
@@ -3963,7 +3979,11 @@ function oi(t) {
|
|
|
3963
3979
|
};
|
|
3964
3980
|
}
|
|
3965
3981
|
function di(t) {
|
|
3966
|
-
return async (e, n
|
|
3982
|
+
return async (e, n = {
|
|
3983
|
+
page: 0,
|
|
3984
|
+
per_page: 50,
|
|
3985
|
+
include_totals: !1
|
|
3986
|
+
}) => {
|
|
3967
3987
|
let a = t.selectFrom("codes").where("codes.tenant_id", "=", e);
|
|
3968
3988
|
n.q && (a = Be(t, a, n.q, ["code", "login_id"]));
|
|
3969
3989
|
const s = await a.offset(n.page * n.per_page).limit(n.per_page).selectAll().execute(), { count: o } = await a.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
@@ -3974,7 +3994,7 @@ function di(t) {
|
|
|
3974
3994
|
}),
|
|
3975
3995
|
start: n.page * n.per_page,
|
|
3976
3996
|
limit: n.per_page,
|
|
3977
|
-
length:
|
|
3997
|
+
length: $e(o)
|
|
3978
3998
|
};
|
|
3979
3999
|
};
|
|
3980
4000
|
}
|
|
@@ -4106,7 +4126,11 @@ function bi(t) {
|
|
|
4106
4126
|
};
|
|
4107
4127
|
}
|
|
4108
4128
|
function wi(t) {
|
|
4109
|
-
return async (e, n
|
|
4129
|
+
return async (e, n = {
|
|
4130
|
+
page: 0,
|
|
4131
|
+
per_page: 50,
|
|
4132
|
+
include_totals: !1
|
|
4133
|
+
}) => {
|
|
4110
4134
|
let a = t.selectFrom("connections").where("connections.tenant_id", "=", e);
|
|
4111
4135
|
n.q && (a = Be(t, a, n.q, ["user_id", "ip"]));
|
|
4112
4136
|
const o = (await a.offset(n.page * n.per_page).limit(n.per_page).selectAll().execute()).map(
|
|
@@ -4119,7 +4143,7 @@ function wi(t) {
|
|
|
4119
4143
|
connections: o,
|
|
4120
4144
|
start: n.page * n.per_page,
|
|
4121
4145
|
limit: n.per_page,
|
|
4122
|
-
length:
|
|
4146
|
+
length: $e(d)
|
|
4123
4147
|
};
|
|
4124
4148
|
};
|
|
4125
4149
|
}
|
|
@@ -4225,7 +4249,7 @@ function Zi(t) {
|
|
|
4225
4249
|
return await t.insertInto("domains").values(a).execute(), a;
|
|
4226
4250
|
};
|
|
4227
4251
|
}
|
|
4228
|
-
function
|
|
4252
|
+
function $i(t) {
|
|
4229
4253
|
return async (e, n) => {
|
|
4230
4254
|
let a = t.selectFrom("domains").where("domains.tenant_id", "=", e);
|
|
4231
4255
|
n.q && (a = Be(t, a, n.q, ["user_id", "ip"]));
|
|
@@ -4234,14 +4258,14 @@ function Ei(t) {
|
|
|
4234
4258
|
domains: s,
|
|
4235
4259
|
start: n.page * n.per_page,
|
|
4236
4260
|
limit: n.per_page,
|
|
4237
|
-
length:
|
|
4261
|
+
length: $e(o)
|
|
4238
4262
|
};
|
|
4239
4263
|
};
|
|
4240
4264
|
}
|
|
4241
|
-
function
|
|
4265
|
+
function Ei(t) {
|
|
4242
4266
|
return {
|
|
4243
4267
|
create: Zi(t),
|
|
4244
|
-
list:
|
|
4268
|
+
list: $i(t)
|
|
4245
4269
|
};
|
|
4246
4270
|
}
|
|
4247
4271
|
function Pi(t) {
|
|
@@ -4309,7 +4333,11 @@ function Di(t) {
|
|
|
4309
4333
|
};
|
|
4310
4334
|
}
|
|
4311
4335
|
function Mi(t) {
|
|
4312
|
-
return async (e, n
|
|
4336
|
+
return async (e, n = {
|
|
4337
|
+
page: 0,
|
|
4338
|
+
per_page: 50,
|
|
4339
|
+
include_totals: !1
|
|
4340
|
+
}) => {
|
|
4313
4341
|
let a = t.selectFrom("hooks").where("hooks.tenant_id", "=", e);
|
|
4314
4342
|
n.q && (a = Be(t, a, n.q, ["url"]));
|
|
4315
4343
|
const s = await a.offset(n.page * n.per_page).limit(n.per_page).selectAll().execute(), { count: o } = await a.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
@@ -4324,7 +4352,7 @@ function Mi(t) {
|
|
|
4324
4352
|
}),
|
|
4325
4353
|
start: n.page * n.per_page,
|
|
4326
4354
|
limit: n.per_page,
|
|
4327
|
-
length:
|
|
4355
|
+
length: $e(o)
|
|
4328
4356
|
};
|
|
4329
4357
|
};
|
|
4330
4358
|
}
|
|
@@ -4407,11 +4435,11 @@ function Ki(t) {
|
|
|
4407
4435
|
if (Bi(this, "ZodObject")) {
|
|
4408
4436
|
const We = this.extend;
|
|
4409
4437
|
ve.extend = function(...qe) {
|
|
4410
|
-
var ee, te, ne, be,
|
|
4438
|
+
var ee, te, ne, be, Ee, Pe;
|
|
4411
4439
|
const Ae = We.apply(this, qe);
|
|
4412
4440
|
return Ae._def.openapi = {
|
|
4413
4441
|
_internal: {
|
|
4414
|
-
extendedFrom: !((te = (ee = this._def.openapi) === null || ee === void 0 ? void 0 : ee._internal) === null || te === void 0) && te.refId ? { refId: (be = (ne = this._def.openapi) === null || ne === void 0 ? void 0 : ne._internal) === null || be === void 0 ? void 0 : be.refId, schema: this } : (
|
|
4442
|
+
extendedFrom: !((te = (ee = this._def.openapi) === null || ee === void 0 ? void 0 : ee._internal) === null || te === void 0) && te.refId ? { refId: (be = (ne = this._def.openapi) === null || ne === void 0 ? void 0 : ne._internal) === null || be === void 0 ? void 0 : be.refId, schema: this } : (Ee = this._def.openapi) === null || Ee === void 0 ? void 0 : Ee._internal.extendedFrom
|
|
4415
4443
|
},
|
|
4416
4444
|
metadata: (Pe = Ae._def.openapi) === null || Pe === void 0 ? void 0 : Pe.metadata
|
|
4417
4445
|
}, Ae;
|
|
@@ -4439,7 +4467,7 @@ function Ki(t) {
|
|
|
4439
4467
|
};
|
|
4440
4468
|
}
|
|
4441
4469
|
new Set(".\\+*[^]$()");
|
|
4442
|
-
var
|
|
4470
|
+
var E;
|
|
4443
4471
|
(function(t) {
|
|
4444
4472
|
t.assertEqual = (r) => r;
|
|
4445
4473
|
function e(r) {
|
|
@@ -4474,7 +4502,7 @@ var $;
|
|
|
4474
4502
|
return r.map((o) => typeof o == "string" ? `'${o}'` : o).join(s);
|
|
4475
4503
|
}
|
|
4476
4504
|
t.joinValues = a, t.jsonStringifyReplacer = (r, s) => typeof s == "bigint" ? s.toString() : s;
|
|
4477
|
-
})(
|
|
4505
|
+
})(E || (E = {}));
|
|
4478
4506
|
var Zn;
|
|
4479
4507
|
(function(t) {
|
|
4480
4508
|
t.mergeShapes = (e, n) => ({
|
|
@@ -4483,7 +4511,7 @@ var Zn;
|
|
|
4483
4511
|
// second overwrites first
|
|
4484
4512
|
});
|
|
4485
4513
|
})(Zn || (Zn = {}));
|
|
4486
|
-
const y =
|
|
4514
|
+
const y = E.arrayToEnum([
|
|
4487
4515
|
"string",
|
|
4488
4516
|
"nan",
|
|
4489
4517
|
"number",
|
|
@@ -4525,7 +4553,7 @@ const y = $.arrayToEnum([
|
|
|
4525
4553
|
default:
|
|
4526
4554
|
return y.unknown;
|
|
4527
4555
|
}
|
|
4528
|
-
}, p =
|
|
4556
|
+
}, p = E.arrayToEnum([
|
|
4529
4557
|
"invalid_type",
|
|
4530
4558
|
"invalid_literal",
|
|
4531
4559
|
"custom",
|
|
@@ -4587,7 +4615,7 @@ class J extends Error {
|
|
|
4587
4615
|
return this.message;
|
|
4588
4616
|
}
|
|
4589
4617
|
get message() {
|
|
4590
|
-
return JSON.stringify(this.issues,
|
|
4618
|
+
return JSON.stringify(this.issues, E.jsonStringifyReplacer, 2);
|
|
4591
4619
|
}
|
|
4592
4620
|
get isEmpty() {
|
|
4593
4621
|
return this.issues.length === 0;
|
|
@@ -4610,19 +4638,19 @@ const dt = (t, e) => {
|
|
|
4610
4638
|
t.received === y.undefined ? n = "Required" : n = `Expected ${t.expected}, received ${t.received}`;
|
|
4611
4639
|
break;
|
|
4612
4640
|
case p.invalid_literal:
|
|
4613
|
-
n = `Invalid literal value, expected ${JSON.stringify(t.expected,
|
|
4641
|
+
n = `Invalid literal value, expected ${JSON.stringify(t.expected, E.jsonStringifyReplacer)}`;
|
|
4614
4642
|
break;
|
|
4615
4643
|
case p.unrecognized_keys:
|
|
4616
|
-
n = `Unrecognized key(s) in object: ${
|
|
4644
|
+
n = `Unrecognized key(s) in object: ${E.joinValues(t.keys, ", ")}`;
|
|
4617
4645
|
break;
|
|
4618
4646
|
case p.invalid_union:
|
|
4619
4647
|
n = "Invalid input";
|
|
4620
4648
|
break;
|
|
4621
4649
|
case p.invalid_union_discriminator:
|
|
4622
|
-
n = `Invalid discriminator value. Expected ${
|
|
4650
|
+
n = `Invalid discriminator value. Expected ${E.joinValues(t.options)}`;
|
|
4623
4651
|
break;
|
|
4624
4652
|
case p.invalid_enum_value:
|
|
4625
|
-
n = `Invalid enum value. Expected ${
|
|
4653
|
+
n = `Invalid enum value. Expected ${E.joinValues(t.options)}, received '${t.received}'`;
|
|
4626
4654
|
break;
|
|
4627
4655
|
case p.invalid_arguments:
|
|
4628
4656
|
n = "Invalid function arguments";
|
|
@@ -4634,7 +4662,7 @@ const dt = (t, e) => {
|
|
|
4634
4662
|
n = "Invalid date";
|
|
4635
4663
|
break;
|
|
4636
4664
|
case p.invalid_string:
|
|
4637
|
-
typeof t.validation == "object" ? "includes" in t.validation ? (n = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (n = `${n} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? n = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? n = `Invalid input: must end with "${t.validation.endsWith}"` :
|
|
4665
|
+
typeof t.validation == "object" ? "includes" in t.validation ? (n = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (n = `${n} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? n = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? n = `Invalid input: must end with "${t.validation.endsWith}"` : E.assertNever(t.validation) : t.validation !== "regex" ? n = `Invalid ${t.validation}` : n = "Invalid";
|
|
4638
4666
|
break;
|
|
4639
4667
|
case p.too_small:
|
|
4640
4668
|
t.type === "array" ? n = `Array must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "more than"} ${t.minimum} element(s)` : t.type === "string" ? n = `String must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "over"} ${t.minimum} character(s)` : t.type === "number" ? n = `Number must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${t.minimum}` : t.type === "date" ? n = `Date must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(t.minimum))}` : n = "Invalid input";
|
|
@@ -4655,7 +4683,7 @@ const dt = (t, e) => {
|
|
|
4655
4683
|
n = "Number must be finite";
|
|
4656
4684
|
break;
|
|
4657
4685
|
default:
|
|
4658
|
-
n = e.defaultError,
|
|
4686
|
+
n = e.defaultError, E.assertNever(t);
|
|
4659
4687
|
}
|
|
4660
4688
|
return { message: n };
|
|
4661
4689
|
};
|
|
@@ -4745,7 +4773,7 @@ class F {
|
|
|
4745
4773
|
}
|
|
4746
4774
|
const k = Object.freeze({
|
|
4747
4775
|
status: "aborted"
|
|
4748
|
-
}), tt = (t) => ({ status: "dirty", value: t }), B = (t) => ({ status: "valid", value: t }),
|
|
4776
|
+
}), tt = (t) => ({ status: "dirty", value: t }), B = (t) => ({ status: "valid", value: t }), $n = (t) => t.status === "aborted", En = (t) => t.status === "dirty", At = (t) => t.status === "valid", Dt = (t) => typeof Promise < "u" && t instanceof Promise;
|
|
4749
4777
|
function hn(t, e, n, a) {
|
|
4750
4778
|
if (typeof e == "function" ? t !== e || !a : !e.has(t)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4751
4779
|
return e.get(t);
|
|
@@ -5135,7 +5163,7 @@ class Q extends I {
|
|
|
5135
5163
|
validation: "base64",
|
|
5136
5164
|
code: p.invalid_string,
|
|
5137
5165
|
message: s.message
|
|
5138
|
-
}), a.dirty()) :
|
|
5166
|
+
}), a.dirty()) : E.assertNever(s);
|
|
5139
5167
|
return { status: a.value, value: e.data };
|
|
5140
5168
|
}
|
|
5141
5169
|
_regex(e, n, a) {
|
|
@@ -5373,7 +5401,7 @@ class Se extends I {
|
|
|
5373
5401
|
let a;
|
|
5374
5402
|
const r = new F();
|
|
5375
5403
|
for (const s of this._def.checks)
|
|
5376
|
-
s.kind === "int" ?
|
|
5404
|
+
s.kind === "int" ? E.isInteger(e.data) || (a = this._getOrReturnCtx(e, a), _(a, {
|
|
5377
5405
|
code: p.invalid_type,
|
|
5378
5406
|
expected: "integer",
|
|
5379
5407
|
received: "float",
|
|
@@ -5399,7 +5427,7 @@ class Se extends I {
|
|
|
5399
5427
|
}), r.dirty()) : s.kind === "finite" ? Number.isFinite(e.data) || (a = this._getOrReturnCtx(e, a), _(a, {
|
|
5400
5428
|
code: p.not_finite,
|
|
5401
5429
|
message: s.message
|
|
5402
|
-
}), r.dirty()) :
|
|
5430
|
+
}), r.dirty()) : E.assertNever(s);
|
|
5403
5431
|
return { status: r.value, value: e.data };
|
|
5404
5432
|
}
|
|
5405
5433
|
gte(e, n) {
|
|
@@ -5511,7 +5539,7 @@ class Se extends I {
|
|
|
5511
5539
|
return e;
|
|
5512
5540
|
}
|
|
5513
5541
|
get isInt() {
|
|
5514
|
-
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" &&
|
|
5542
|
+
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && E.isInteger(e.value));
|
|
5515
5543
|
}
|
|
5516
5544
|
get isFinite() {
|
|
5517
5545
|
let e = null, n = null;
|
|
@@ -5561,7 +5589,7 @@ class je extends I {
|
|
|
5561
5589
|
code: p.not_multiple_of,
|
|
5562
5590
|
multipleOf: s.value,
|
|
5563
5591
|
message: s.message
|
|
5564
|
-
}), r.dirty()) :
|
|
5592
|
+
}), r.dirty()) : E.assertNever(s);
|
|
5565
5593
|
return { status: r.value, value: e.data };
|
|
5566
5594
|
}
|
|
5567
5595
|
gte(e, n) {
|
|
@@ -5708,7 +5736,7 @@ class Fe extends I {
|
|
|
5708
5736
|
exact: !1,
|
|
5709
5737
|
maximum: s.value,
|
|
5710
5738
|
type: "date"
|
|
5711
|
-
}), a.dirty()) :
|
|
5739
|
+
}), a.dirty()) : E.assertNever(s);
|
|
5712
5740
|
return {
|
|
5713
5741
|
status: a.value,
|
|
5714
5742
|
value: new Date(e.data.getTime())
|
|
@@ -5955,7 +5983,7 @@ class D extends I {
|
|
|
5955
5983
|
_getCached() {
|
|
5956
5984
|
if (this._cached !== null)
|
|
5957
5985
|
return this._cached;
|
|
5958
|
-
const e = this._def.shape(), n =
|
|
5986
|
+
const e = this._def.shape(), n = E.objectKeys(e);
|
|
5959
5987
|
return this._cached = { shape: e, keys: n };
|
|
5960
5988
|
}
|
|
5961
5989
|
_parse(e) {
|
|
@@ -6162,7 +6190,7 @@ class D extends I {
|
|
|
6162
6190
|
}
|
|
6163
6191
|
pick(e) {
|
|
6164
6192
|
const n = {};
|
|
6165
|
-
return
|
|
6193
|
+
return E.objectKeys(e).forEach((a) => {
|
|
6166
6194
|
e[a] && this.shape[a] && (n[a] = this.shape[a]);
|
|
6167
6195
|
}), new D({
|
|
6168
6196
|
...this._def,
|
|
@@ -6171,7 +6199,7 @@ class D extends I {
|
|
|
6171
6199
|
}
|
|
6172
6200
|
omit(e) {
|
|
6173
6201
|
const n = {};
|
|
6174
|
-
return
|
|
6202
|
+
return E.objectKeys(this.shape).forEach((a) => {
|
|
6175
6203
|
e[a] || (n[a] = this.shape[a]);
|
|
6176
6204
|
}), new D({
|
|
6177
6205
|
...this._def,
|
|
@@ -6186,7 +6214,7 @@ class D extends I {
|
|
|
6186
6214
|
}
|
|
6187
6215
|
partial(e) {
|
|
6188
6216
|
const n = {};
|
|
6189
|
-
return
|
|
6217
|
+
return E.objectKeys(this.shape).forEach((a) => {
|
|
6190
6218
|
const r = this.shape[a];
|
|
6191
6219
|
e && !e[a] ? n[a] = r : n[a] = r.optional();
|
|
6192
6220
|
}), new D({
|
|
@@ -6196,7 +6224,7 @@ class D extends I {
|
|
|
6196
6224
|
}
|
|
6197
6225
|
required(e) {
|
|
6198
6226
|
const n = {};
|
|
6199
|
-
return
|
|
6227
|
+
return E.objectKeys(this.shape).forEach((a) => {
|
|
6200
6228
|
if (e && !e[a])
|
|
6201
6229
|
n[a] = this.shape[a];
|
|
6202
6230
|
else {
|
|
@@ -6211,7 +6239,7 @@ class D extends I {
|
|
|
6211
6239
|
});
|
|
6212
6240
|
}
|
|
6213
6241
|
keyof() {
|
|
6214
|
-
return wa(
|
|
6242
|
+
return wa(E.objectKeys(this.shape));
|
|
6215
6243
|
}
|
|
6216
6244
|
}
|
|
6217
6245
|
D.create = (t, e) => new D({
|
|
@@ -6308,7 +6336,7 @@ zt.create = (t, e) => new zt({
|
|
|
6308
6336
|
typeName: N.ZodUnion,
|
|
6309
6337
|
...S(e)
|
|
6310
6338
|
});
|
|
6311
|
-
const le = (t) => t instanceof Vt ? le(t.schema) : t instanceof X ? le(t.innerType()) : t instanceof Bt ? [t.value] : t instanceof Ie ? t.options : t instanceof Kt ?
|
|
6339
|
+
const le = (t) => t instanceof Vt ? le(t.schema) : t instanceof X ? le(t.innerType()) : t instanceof Bt ? [t.value] : t instanceof Ie ? t.options : t instanceof Kt ? E.objectValues(t.enum) : t instanceof Jt ? le(t._def.innerType) : t instanceof Rt ? [void 0] : t instanceof Lt ? [null] : t instanceof se ? [void 0, ...le(t.unwrap())] : t instanceof Ze ? [null, ...le(t.unwrap())] : t instanceof Vn || t instanceof qt ? le(t.unwrap()) : t instanceof Wt ? le(t._def.innerType) : [];
|
|
6312
6340
|
class vn extends I {
|
|
6313
6341
|
_parse(e) {
|
|
6314
6342
|
const { ctx: n } = this._processInputParams(e);
|
|
@@ -6376,7 +6404,7 @@ function Pn(t, e) {
|
|
|
6376
6404
|
if (t === e)
|
|
6377
6405
|
return { valid: !0, data: t };
|
|
6378
6406
|
if (n === y.object && a === y.object) {
|
|
6379
|
-
const r =
|
|
6407
|
+
const r = E.objectKeys(e), s = E.objectKeys(t).filter((d) => r.indexOf(d) !== -1), o = { ...t, ...e };
|
|
6380
6408
|
for (const d of s) {
|
|
6381
6409
|
const c = Pn(t[d], e[d]);
|
|
6382
6410
|
if (!c.valid)
|
|
@@ -6400,10 +6428,10 @@ function Pn(t, e) {
|
|
|
6400
6428
|
class Ut extends I {
|
|
6401
6429
|
_parse(e) {
|
|
6402
6430
|
const { status: n, ctx: a } = this._processInputParams(e), r = (s, o) => {
|
|
6403
|
-
if (
|
|
6431
|
+
if ($n(s) || $n(o))
|
|
6404
6432
|
return k;
|
|
6405
6433
|
const d = Pn(s.value, o.value);
|
|
6406
|
-
return d.valid ? ((
|
|
6434
|
+
return d.valid ? ((En(s) || En(o)) && n.dirty(), { status: n.value, value: d.data }) : (_(a, {
|
|
6407
6435
|
code: p.invalid_intersection_types
|
|
6408
6436
|
}), k);
|
|
6409
6437
|
};
|
|
@@ -6789,7 +6817,7 @@ class Ie extends I {
|
|
|
6789
6817
|
if (typeof e.data != "string") {
|
|
6790
6818
|
const n = this._getOrReturnCtx(e), a = this._def.values;
|
|
6791
6819
|
return _(n, {
|
|
6792
|
-
expected:
|
|
6820
|
+
expected: E.joinValues(a),
|
|
6793
6821
|
received: n.parsedType,
|
|
6794
6822
|
code: p.invalid_type
|
|
6795
6823
|
}), k;
|
|
@@ -6845,17 +6873,17 @@ class Kt extends I {
|
|
|
6845
6873
|
super(...arguments), yt.set(this, void 0);
|
|
6846
6874
|
}
|
|
6847
6875
|
_parse(e) {
|
|
6848
|
-
const n =
|
|
6876
|
+
const n = E.getValidEnumValues(this._def.values), a = this._getOrReturnCtx(e);
|
|
6849
6877
|
if (a.parsedType !== y.string && a.parsedType !== y.number) {
|
|
6850
|
-
const r =
|
|
6878
|
+
const r = E.objectValues(n);
|
|
6851
6879
|
return _(a, {
|
|
6852
|
-
expected:
|
|
6880
|
+
expected: E.joinValues(r),
|
|
6853
6881
|
received: a.parsedType,
|
|
6854
6882
|
code: p.invalid_type
|
|
6855
6883
|
}), k;
|
|
6856
6884
|
}
|
|
6857
|
-
if (hn(this, yt) || ga(this, yt, new Set(
|
|
6858
|
-
const r =
|
|
6885
|
+
if (hn(this, yt) || ga(this, yt, new Set(E.getValidEnumValues(this._def.values))), !hn(this, yt).has(e.data)) {
|
|
6886
|
+
const r = E.objectValues(n);
|
|
6859
6887
|
return _(a, {
|
|
6860
6888
|
received: a.data,
|
|
6861
6889
|
code: p.invalid_enum_value,
|
|
@@ -6972,7 +7000,7 @@ class X extends I {
|
|
|
6972
7000
|
return { status: n.value, value: d };
|
|
6973
7001
|
} else
|
|
6974
7002
|
return this._def.schema._parseAsync({ data: a.data, path: a.path, parent: a }).then((o) => At(o) ? Promise.resolve(r.transform(o.value, s)).then((d) => ({ status: n.value, value: d })) : o);
|
|
6975
|
-
|
|
7003
|
+
E.assertNever(r);
|
|
6976
7004
|
}
|
|
6977
7005
|
}
|
|
6978
7006
|
X.create = (t, e, n) => new X({
|
|
@@ -7179,7 +7207,7 @@ var N;
|
|
|
7179
7207
|
})(N || (N = {}));
|
|
7180
7208
|
const po = (t, e = {
|
|
7181
7209
|
message: `Input not instance of ${t.name}`
|
|
7182
|
-
}) => xa((n) => n instanceof t, e), Na = Q.create, ka = Se.create, mo = _n.create, fo = je.create, Ca = Mt.create, _o = Fe.create, go = pn.create, yo = Rt.create, vo = Lt.create, bo = ct.create, wo = Le.create, xo = fe.create, No = mn.create, ko = H.create, Co = D.create, To = D.strictCreate, Oo = zt.create, So = vn.create, jo = Ut.create, Io = ce.create, Zo = Ft.create,
|
|
7210
|
+
}) => xa((n) => n instanceof t, e), Na = Q.create, ka = Se.create, mo = _n.create, fo = je.create, Ca = Mt.create, _o = Fe.create, go = pn.create, yo = Rt.create, vo = Lt.create, bo = ct.create, wo = Le.create, xo = fe.create, No = mn.create, ko = H.create, Co = D.create, To = D.strictCreate, Oo = zt.create, So = vn.create, jo = Ut.create, Io = ce.create, Zo = Ft.create, $o = fn.create, Eo = Ve.create, Po = at.create, Ao = Vt.create, Do = Bt.create, Mo = Ie.create, Ro = Kt.create, Lo = lt.create, Gn = X.create, zo = se.create, Uo = Ze.create, Fo = X.createWithPreprocess, Vo = Yt.create, Bo = () => Na().optional(), Ko = () => ka().optional(), Jo = () => Ca().optional(), Wo = {
|
|
7183
7211
|
string: (t) => Q.create({ ...t, coerce: !0 }),
|
|
7184
7212
|
number: (t) => Se.create({ ...t, coerce: !0 }),
|
|
7185
7213
|
boolean: (t) => Mt.create({
|
|
@@ -7201,12 +7229,12 @@ var Qo = /* @__PURE__ */ Object.freeze({
|
|
|
7201
7229
|
INVALID: k,
|
|
7202
7230
|
DIRTY: tt,
|
|
7203
7231
|
OK: B,
|
|
7204
|
-
isAborted:
|
|
7205
|
-
isDirty:
|
|
7232
|
+
isAborted: $n,
|
|
7233
|
+
isDirty: En,
|
|
7206
7234
|
isValid: At,
|
|
7207
7235
|
isAsync: Dt,
|
|
7208
7236
|
get util() {
|
|
7209
|
-
return
|
|
7237
|
+
return E;
|
|
7210
7238
|
},
|
|
7211
7239
|
get objectUtil() {
|
|
7212
7240
|
return Zn;
|
|
@@ -7274,7 +7302,7 @@ var Qo = /* @__PURE__ */ Object.freeze({
|
|
|
7274
7302
|
intersection: jo,
|
|
7275
7303
|
lazy: Ao,
|
|
7276
7304
|
literal: Do,
|
|
7277
|
-
map:
|
|
7305
|
+
map: $o,
|
|
7278
7306
|
nan: mo,
|
|
7279
7307
|
nativeEnum: Ro,
|
|
7280
7308
|
never: xo,
|
|
@@ -7290,7 +7318,7 @@ var Qo = /* @__PURE__ */ Object.freeze({
|
|
|
7290
7318
|
preprocess: Fo,
|
|
7291
7319
|
promise: Lo,
|
|
7292
7320
|
record: Zo,
|
|
7293
|
-
set:
|
|
7321
|
+
set: Eo,
|
|
7294
7322
|
strictObject: To,
|
|
7295
7323
|
string: Na,
|
|
7296
7324
|
symbol: go,
|
|
@@ -7425,7 +7453,7 @@ function Hn(t) {
|
|
|
7425
7453
|
function dd(t) {
|
|
7426
7454
|
return async (e, n) => {
|
|
7427
7455
|
try {
|
|
7428
|
-
const a =
|
|
7456
|
+
const a = $s.parse(n);
|
|
7429
7457
|
await t.insertInto("prompt_settings").values({
|
|
7430
7458
|
...Hn(a),
|
|
7431
7459
|
tenant_id: e
|
|
@@ -8498,7 +8526,7 @@ class bd {
|
|
|
8498
8526
|
}
|
|
8499
8527
|
}
|
|
8500
8528
|
const wd = "kysely_migration", Yn = "kysely_migration_lock", xd = !1, kn = "migration_lock", Nd = z({ __noMigrations__: !0 });
|
|
8501
|
-
var P, m, vt, ue, he, Xe, Za, pe,
|
|
8529
|
+
var P, m, vt, ue, he, Xe, Za, pe, $a, Ea, Pa, Aa, Da, Mn, et, Rn, Ma, Ra, La, Ln, za, Ua, Fa, Va, Ba, bt;
|
|
8502
8530
|
class Ia {
|
|
8503
8531
|
constructor(e) {
|
|
8504
8532
|
ae(this, m);
|
|
@@ -8648,7 +8676,7 @@ class Ia {
|
|
|
8648
8676
|
}
|
|
8649
8677
|
P = new WeakMap(), m = new WeakSet(), vt = async function(e) {
|
|
8650
8678
|
try {
|
|
8651
|
-
return await T(this, m,
|
|
8679
|
+
return await T(this, m, $a).call(this), await T(this, m, Ma).call(this, e);
|
|
8652
8680
|
} catch (n) {
|
|
8653
8681
|
return n instanceof Cn ? n.resultSet : { error: n };
|
|
8654
8682
|
}
|
|
@@ -8662,9 +8690,9 @@ P = new WeakMap(), m = new WeakSet(), vt = async function(e) {
|
|
|
8662
8690
|
return v(this, P).allowUnorderedMigrations ?? xd;
|
|
8663
8691
|
}, pe = function() {
|
|
8664
8692
|
return v(this, m, ue) ? new vd(v(this, m, ue)) : new bd();
|
|
8665
|
-
}, Ea = async function() {
|
|
8666
|
-
await T(this, m, $a).call(this), await T(this, m, Pa).call(this), await T(this, m, Aa).call(this), await T(this, m, Da).call(this);
|
|
8667
8693
|
}, $a = async function() {
|
|
8694
|
+
await T(this, m, Ea).call(this), await T(this, m, Pa).call(this), await T(this, m, Aa).call(this), await T(this, m, Da).call(this);
|
|
8695
|
+
}, Ea = async function() {
|
|
8668
8696
|
if (v(this, m, ue) && !await T(this, m, Mn).call(this))
|
|
8669
8697
|
try {
|
|
8670
8698
|
await T(this, m, bt).call(this, v(this, P).db.schema.createSchema(v(this, m, ue)));
|
|
@@ -8921,12 +8949,12 @@ async function Id(t) {
|
|
|
8921
8949
|
}
|
|
8922
8950
|
async function Zd(t) {
|
|
8923
8951
|
}
|
|
8924
|
-
const
|
|
8952
|
+
const $d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8925
8953
|
__proto__: null,
|
|
8926
8954
|
down: Zd,
|
|
8927
8955
|
up: Id
|
|
8928
8956
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
8929
|
-
async function
|
|
8957
|
+
async function Ed(t) {
|
|
8930
8958
|
await t.schema.createTable("logs").addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("category", "varchar(255)", (e) => e.notNull()).addColumn("tenant_id", "varchar(64)").addColumn("user_id", "varchar(64)").addForeignKeyConstraint(
|
|
8931
8959
|
"tenant_id_constraint",
|
|
8932
8960
|
["tenant_id"],
|
|
@@ -8941,7 +8969,7 @@ async function Pd(t) {
|
|
|
8941
8969
|
const Ad = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8942
8970
|
__proto__: null,
|
|
8943
8971
|
down: Pd,
|
|
8944
|
-
up:
|
|
8972
|
+
up: Ed
|
|
8945
8973
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
8946
8974
|
async function Dd(t) {
|
|
8947
8975
|
}
|
|
@@ -9156,12 +9184,12 @@ async function Ic(t) {
|
|
|
9156
9184
|
}
|
|
9157
9185
|
async function Zc(t) {
|
|
9158
9186
|
}
|
|
9159
|
-
const
|
|
9187
|
+
const $c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9160
9188
|
__proto__: null,
|
|
9161
9189
|
down: Zc,
|
|
9162
9190
|
up: Ic
|
|
9163
9191
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
9164
|
-
async function
|
|
9192
|
+
async function Ec(t) {
|
|
9165
9193
|
await t.schema.alterTable("logs").dropColumn("category").execute();
|
|
9166
9194
|
}
|
|
9167
9195
|
async function Pc(t) {
|
|
@@ -9170,7 +9198,7 @@ async function Pc(t) {
|
|
|
9170
9198
|
const Ac = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9171
9199
|
__proto__: null,
|
|
9172
9200
|
down: Pc,
|
|
9173
|
-
up:
|
|
9201
|
+
up: Ec
|
|
9174
9202
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
9175
9203
|
async function Dc(t) {
|
|
9176
9204
|
await t.schema.alterTable("users").dropColumn("tags").execute();
|
|
@@ -9355,19 +9383,19 @@ async function Il(t) {
|
|
|
9355
9383
|
async function Zl(t) {
|
|
9356
9384
|
await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(255)").execute();
|
|
9357
9385
|
}
|
|
9358
|
-
const
|
|
9386
|
+
const $l = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9359
9387
|
__proto__: null,
|
|
9360
9388
|
down: Zl,
|
|
9361
9389
|
up: Il
|
|
9362
9390
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
9363
|
-
async function
|
|
9391
|
+
async function El(t) {
|
|
9364
9392
|
}
|
|
9365
9393
|
async function Pl(t) {
|
|
9366
9394
|
}
|
|
9367
9395
|
const Al = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9368
9396
|
__proto__: null,
|
|
9369
9397
|
down: Pl,
|
|
9370
|
-
up:
|
|
9398
|
+
up: El
|
|
9371
9399
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
9372
9400
|
async function Dl(t) {
|
|
9373
9401
|
await t.schema.createTable("hooks").addColumn("hook_id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
|
|
@@ -9618,19 +9646,19 @@ async function Iu(t) {
|
|
|
9618
9646
|
async function Zu(t) {
|
|
9619
9647
|
await t.schema.dropTable("prompt_settings").execute();
|
|
9620
9648
|
}
|
|
9621
|
-
const
|
|
9649
|
+
const $u = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9622
9650
|
__proto__: null,
|
|
9623
9651
|
down: Zu,
|
|
9624
9652
|
up: Iu
|
|
9625
9653
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
9626
|
-
async function
|
|
9654
|
+
async function Eu(t) {
|
|
9627
9655
|
}
|
|
9628
9656
|
async function Pu(t) {
|
|
9629
9657
|
}
|
|
9630
9658
|
const Au = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9631
9659
|
__proto__: null,
|
|
9632
9660
|
down: Pu,
|
|
9633
|
-
up:
|
|
9661
|
+
up: Eu
|
|
9634
9662
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
9635
9663
|
async function Du(t) {
|
|
9636
9664
|
}
|
|
@@ -9753,7 +9781,7 @@ const uh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
9753
9781
|
}, Symbol.toStringTag, { value: "Module" })), Ja = {
|
|
9754
9782
|
m1_init: Td,
|
|
9755
9783
|
m2_magicLink: jd,
|
|
9756
|
-
m3_updateAt:
|
|
9784
|
+
m3_updateAt: $d,
|
|
9757
9785
|
m4_logTable: Ad,
|
|
9758
9786
|
m5_userProfile: Rd,
|
|
9759
9787
|
m6_sessions: Ud,
|
|
@@ -9771,7 +9799,7 @@ const uh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
9771
9799
|
n18_logsFields: Nc,
|
|
9772
9800
|
n19_connectionsUserinfo: Tc,
|
|
9773
9801
|
n20_missingFields: jc,
|
|
9774
|
-
n21_sessionDeletedAt:
|
|
9802
|
+
n21_sessionDeletedAt: $c,
|
|
9775
9803
|
n22_dropLogsFields: Ac,
|
|
9776
9804
|
n23_dropUsersFields: Rc,
|
|
9777
9805
|
n24_logsIndexes: Uc,
|
|
@@ -9789,7 +9817,7 @@ const uh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
9789
9817
|
n36_authenticationCodes: Nl,
|
|
9790
9818
|
n37_disableSignUps: Tl,
|
|
9791
9819
|
n38_otpIpAddress: jl,
|
|
9792
|
-
n39_increaseUserAgentLength:
|
|
9820
|
+
n39_increaseUserAgentLength: $l,
|
|
9793
9821
|
n40_userId: Al,
|
|
9794
9822
|
n41_hooks: Rl,
|
|
9795
9823
|
n42_userIdIndexes: Ul,
|
|
@@ -9807,7 +9835,7 @@ const uh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
9807
9835
|
n54_cleanup_tables: Nu,
|
|
9808
9836
|
n55_logs_index: Tu,
|
|
9809
9837
|
n56_application_fields: ju,
|
|
9810
|
-
n57_prompt_settings:
|
|
9838
|
+
n57_prompt_settings: $u,
|
|
9811
9839
|
n58_connection_client_id: Au,
|
|
9812
9840
|
n59_connection_options: Ru,
|
|
9813
9841
|
n60_users_metadata: Uu,
|
|
@@ -9852,7 +9880,7 @@ function fh(t) {
|
|
|
9852
9880
|
codes: pi(t),
|
|
9853
9881
|
connections: Ci(t),
|
|
9854
9882
|
emailProviders: pd(t),
|
|
9855
|
-
domains:
|
|
9883
|
+
domains: Ei(t),
|
|
9856
9884
|
hooks: Fi(t),
|
|
9857
9885
|
keys: Ii(t),
|
|
9858
9886
|
logins: id(t),
|