@authhero/kysely-adapter 0.27.0 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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, $e, Pe;
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 } : ($e = this._def.openapi) === null || $e === void 0 ? void 0 : $e._internal.extendedFrom
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 E;
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
- })(E || (E = {}));
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 = E.arrayToEnum([
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 = E.arrayToEnum([
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, E.jsonStringifyReplacer, 2);
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, E.jsonStringifyReplacer)}`;
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: ${E.joinValues(t.keys, ", ")}`;
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 ${E.joinValues(t.options)}`;
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 ${E.joinValues(t.options)}, received '${t.received}'`;
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}"` : E.assertNever(t.validation) : t.validation !== "regex" ? n = `Invalid ${t.validation}` : n = "Invalid";
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, E.assertNever(t);
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 Et({
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 $t({
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()) : E.assertNever(r);
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" ? E.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), f(n, {
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()) : E.assertNever(r);
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" && E.isInteger(e.value));
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()) : E.assertNever(r);
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()) : E.assertNever(r);
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 = E.objectKeys(e);
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 E.objectKeys(e).forEach((a) => {
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 E.objectKeys(this.shape).forEach((a) => {
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 E.objectKeys(this.shape).forEach((a) => {
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 E.objectKeys(this.shape).forEach((a) => {
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(E.objectKeys(this.shape));
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 ? E.objectValues(t.enum) : t instanceof Et ? 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 $t ? we(t._def.innerType) : [];
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 = E.objectKeys(e), s = E.objectKeys(t).filter((d) => r.indexOf(d) !== -1), o = { ...t, ...e };
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: E.joinValues(a),
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 = E.getValidEnumValues(this._def.values), a = this._getOrReturnCtx(e);
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 = E.objectValues(n);
2527
+ const r = $.objectValues(n);
2528
2528
  return f(a, {
2529
- expected: E.joinValues(r),
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(E.getValidEnumValues(this._def.values))), !rn(this, _t).has(e.data)) {
2535
- const r = E.objectValues(n);
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
- E.assertNever(r);
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 Et extends j {
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
- Et.create = (t, e) => new Et({
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 $t extends j {
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
- $t.create = (t, e) => new $t({
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, Er = A.strictCreate, $r = 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 = {
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 E;
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: Et,
2927
- ZodCatch: $t,
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: Er,
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: $r,
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 Es = i.object({
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 $s(t) {
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 Ee(t) {
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: Ee(l)
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: $s(t),
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
@@ -3768,7 +3772,7 @@ function Vs(t) {
3768
3772
  return {
3769
3773
  tenants: r
3770
3774
  };
3771
- const { count: s } = await n.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), o = Ee(s);
3775
+ const { count: s } = await n.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), o = $e(s);
3772
3776
  return {
3773
3777
  tenants: r.map(R),
3774
3778
  start: (e.page - 1) * e.per_page,
@@ -3863,7 +3867,7 @@ function Qs(t) {
3863
3867
  logs: s.map(fa),
3864
3868
  start: n.page * n.per_page,
3865
3869
  limit: n.per_page,
3866
- length: Ee(o)
3870
+ length: $e(o)
3867
3871
  };
3868
3872
  };
3869
3873
  }
@@ -3900,7 +3904,11 @@ function ti(t) {
3900
3904
  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
3905
  }
3902
3906
  function ni(t) {
3903
- return async (e, n) => {
3907
+ return async (e, n = {
3908
+ page: 0,
3909
+ per_page: 50,
3910
+ include_totals: !1
3911
+ }) => {
3904
3912
  let a = t.selectFrom("sessions").where("sessions.tenant_id", "=", e);
3905
3913
  n.q && (a = Be(t, a, n.q, ["user_id", "session_id"]));
3906
3914
  let r = a;
@@ -3912,7 +3920,7 @@ function ni(t) {
3912
3920
  );
3913
3921
  }
3914
3922
  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 = Ee(o);
3923
+ const s = await r.selectAll().execute(), { count: o } = await a.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), d = $e(o);
3916
3924
  return {
3917
3925
  sessions: s,
3918
3926
  start: n.page * n.per_page,
@@ -3963,7 +3971,11 @@ function oi(t) {
3963
3971
  };
3964
3972
  }
3965
3973
  function di(t) {
3966
- return async (e, n) => {
3974
+ return async (e, n = {
3975
+ page: 0,
3976
+ per_page: 50,
3977
+ include_totals: !1
3978
+ }) => {
3967
3979
  let a = t.selectFrom("codes").where("codes.tenant_id", "=", e);
3968
3980
  n.q && (a = Be(t, a, n.q, ["code", "login_id"]));
3969
3981
  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 +3986,7 @@ function di(t) {
3974
3986
  }),
3975
3987
  start: n.page * n.per_page,
3976
3988
  limit: n.per_page,
3977
- length: Ee(o)
3989
+ length: $e(o)
3978
3990
  };
3979
3991
  };
3980
3992
  }
@@ -4106,7 +4118,11 @@ function bi(t) {
4106
4118
  };
4107
4119
  }
4108
4120
  function wi(t) {
4109
- return async (e, n) => {
4121
+ return async (e, n = {
4122
+ page: 0,
4123
+ per_page: 50,
4124
+ include_totals: !1
4125
+ }) => {
4110
4126
  let a = t.selectFrom("connections").where("connections.tenant_id", "=", e);
4111
4127
  n.q && (a = Be(t, a, n.q, ["user_id", "ip"]));
4112
4128
  const o = (await a.offset(n.page * n.per_page).limit(n.per_page).selectAll().execute()).map(
@@ -4119,7 +4135,7 @@ function wi(t) {
4119
4135
  connections: o,
4120
4136
  start: n.page * n.per_page,
4121
4137
  limit: n.per_page,
4122
- length: Ee(d)
4138
+ length: $e(d)
4123
4139
  };
4124
4140
  };
4125
4141
  }
@@ -4225,7 +4241,7 @@ function Zi(t) {
4225
4241
  return await t.insertInto("domains").values(a).execute(), a;
4226
4242
  };
4227
4243
  }
4228
- function Ei(t) {
4244
+ function $i(t) {
4229
4245
  return async (e, n) => {
4230
4246
  let a = t.selectFrom("domains").where("domains.tenant_id", "=", e);
4231
4247
  n.q && (a = Be(t, a, n.q, ["user_id", "ip"]));
@@ -4234,14 +4250,14 @@ function Ei(t) {
4234
4250
  domains: s,
4235
4251
  start: n.page * n.per_page,
4236
4252
  limit: n.per_page,
4237
- length: Ee(o)
4253
+ length: $e(o)
4238
4254
  };
4239
4255
  };
4240
4256
  }
4241
- function $i(t) {
4257
+ function Ei(t) {
4242
4258
  return {
4243
4259
  create: Zi(t),
4244
- list: Ei(t)
4260
+ list: $i(t)
4245
4261
  };
4246
4262
  }
4247
4263
  function Pi(t) {
@@ -4309,7 +4325,11 @@ function Di(t) {
4309
4325
  };
4310
4326
  }
4311
4327
  function Mi(t) {
4312
- return async (e, n) => {
4328
+ return async (e, n = {
4329
+ page: 0,
4330
+ per_page: 50,
4331
+ include_totals: !1
4332
+ }) => {
4313
4333
  let a = t.selectFrom("hooks").where("hooks.tenant_id", "=", e);
4314
4334
  n.q && (a = Be(t, a, n.q, ["url"]));
4315
4335
  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 +4344,7 @@ function Mi(t) {
4324
4344
  }),
4325
4345
  start: n.page * n.per_page,
4326
4346
  limit: n.per_page,
4327
- length: Ee(o)
4347
+ length: $e(o)
4328
4348
  };
4329
4349
  };
4330
4350
  }
@@ -4407,11 +4427,11 @@ function Ki(t) {
4407
4427
  if (Bi(this, "ZodObject")) {
4408
4428
  const We = this.extend;
4409
4429
  ve.extend = function(...qe) {
4410
- var ee, te, ne, be, $e, Pe;
4430
+ var ee, te, ne, be, Ee, Pe;
4411
4431
  const Ae = We.apply(this, qe);
4412
4432
  return Ae._def.openapi = {
4413
4433
  _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 } : ($e = this._def.openapi) === null || $e === void 0 ? void 0 : $e._internal.extendedFrom
4434
+ 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
4435
  },
4416
4436
  metadata: (Pe = Ae._def.openapi) === null || Pe === void 0 ? void 0 : Pe.metadata
4417
4437
  }, Ae;
@@ -4439,7 +4459,7 @@ function Ki(t) {
4439
4459
  };
4440
4460
  }
4441
4461
  new Set(".\\+*[^]$()");
4442
- var $;
4462
+ var E;
4443
4463
  (function(t) {
4444
4464
  t.assertEqual = (r) => r;
4445
4465
  function e(r) {
@@ -4474,7 +4494,7 @@ var $;
4474
4494
  return r.map((o) => typeof o == "string" ? `'${o}'` : o).join(s);
4475
4495
  }
4476
4496
  t.joinValues = a, t.jsonStringifyReplacer = (r, s) => typeof s == "bigint" ? s.toString() : s;
4477
- })($ || ($ = {}));
4497
+ })(E || (E = {}));
4478
4498
  var Zn;
4479
4499
  (function(t) {
4480
4500
  t.mergeShapes = (e, n) => ({
@@ -4483,7 +4503,7 @@ var Zn;
4483
4503
  // second overwrites first
4484
4504
  });
4485
4505
  })(Zn || (Zn = {}));
4486
- const y = $.arrayToEnum([
4506
+ const y = E.arrayToEnum([
4487
4507
  "string",
4488
4508
  "nan",
4489
4509
  "number",
@@ -4525,7 +4545,7 @@ const y = $.arrayToEnum([
4525
4545
  default:
4526
4546
  return y.unknown;
4527
4547
  }
4528
- }, p = $.arrayToEnum([
4548
+ }, p = E.arrayToEnum([
4529
4549
  "invalid_type",
4530
4550
  "invalid_literal",
4531
4551
  "custom",
@@ -4587,7 +4607,7 @@ class J extends Error {
4587
4607
  return this.message;
4588
4608
  }
4589
4609
  get message() {
4590
- return JSON.stringify(this.issues, $.jsonStringifyReplacer, 2);
4610
+ return JSON.stringify(this.issues, E.jsonStringifyReplacer, 2);
4591
4611
  }
4592
4612
  get isEmpty() {
4593
4613
  return this.issues.length === 0;
@@ -4610,19 +4630,19 @@ const dt = (t, e) => {
4610
4630
  t.received === y.undefined ? n = "Required" : n = `Expected ${t.expected}, received ${t.received}`;
4611
4631
  break;
4612
4632
  case p.invalid_literal:
4613
- n = `Invalid literal value, expected ${JSON.stringify(t.expected, $.jsonStringifyReplacer)}`;
4633
+ n = `Invalid literal value, expected ${JSON.stringify(t.expected, E.jsonStringifyReplacer)}`;
4614
4634
  break;
4615
4635
  case p.unrecognized_keys:
4616
- n = `Unrecognized key(s) in object: ${$.joinValues(t.keys, ", ")}`;
4636
+ n = `Unrecognized key(s) in object: ${E.joinValues(t.keys, ", ")}`;
4617
4637
  break;
4618
4638
  case p.invalid_union:
4619
4639
  n = "Invalid input";
4620
4640
  break;
4621
4641
  case p.invalid_union_discriminator:
4622
- n = `Invalid discriminator value. Expected ${$.joinValues(t.options)}`;
4642
+ n = `Invalid discriminator value. Expected ${E.joinValues(t.options)}`;
4623
4643
  break;
4624
4644
  case p.invalid_enum_value:
4625
- n = `Invalid enum value. Expected ${$.joinValues(t.options)}, received '${t.received}'`;
4645
+ n = `Invalid enum value. Expected ${E.joinValues(t.options)}, received '${t.received}'`;
4626
4646
  break;
4627
4647
  case p.invalid_arguments:
4628
4648
  n = "Invalid function arguments";
@@ -4634,7 +4654,7 @@ const dt = (t, e) => {
4634
4654
  n = "Invalid date";
4635
4655
  break;
4636
4656
  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}"` : $.assertNever(t.validation) : t.validation !== "regex" ? n = `Invalid ${t.validation}` : n = "Invalid";
4657
+ 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
4658
  break;
4639
4659
  case p.too_small:
4640
4660
  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 +4675,7 @@ const dt = (t, e) => {
4655
4675
  n = "Number must be finite";
4656
4676
  break;
4657
4677
  default:
4658
- n = e.defaultError, $.assertNever(t);
4678
+ n = e.defaultError, E.assertNever(t);
4659
4679
  }
4660
4680
  return { message: n };
4661
4681
  };
@@ -4745,7 +4765,7 @@ class F {
4745
4765
  }
4746
4766
  const k = Object.freeze({
4747
4767
  status: "aborted"
4748
- }), tt = (t) => ({ status: "dirty", value: t }), B = (t) => ({ status: "valid", value: t }), En = (t) => t.status === "aborted", $n = (t) => t.status === "dirty", At = (t) => t.status === "valid", Dt = (t) => typeof Promise < "u" && t instanceof Promise;
4768
+ }), 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
4769
  function hn(t, e, n, a) {
4750
4770
  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
4771
  return e.get(t);
@@ -5135,7 +5155,7 @@ class Q extends I {
5135
5155
  validation: "base64",
5136
5156
  code: p.invalid_string,
5137
5157
  message: s.message
5138
- }), a.dirty()) : $.assertNever(s);
5158
+ }), a.dirty()) : E.assertNever(s);
5139
5159
  return { status: a.value, value: e.data };
5140
5160
  }
5141
5161
  _regex(e, n, a) {
@@ -5373,7 +5393,7 @@ class Se extends I {
5373
5393
  let a;
5374
5394
  const r = new F();
5375
5395
  for (const s of this._def.checks)
5376
- s.kind === "int" ? $.isInteger(e.data) || (a = this._getOrReturnCtx(e, a), _(a, {
5396
+ s.kind === "int" ? E.isInteger(e.data) || (a = this._getOrReturnCtx(e, a), _(a, {
5377
5397
  code: p.invalid_type,
5378
5398
  expected: "integer",
5379
5399
  received: "float",
@@ -5399,7 +5419,7 @@ class Se extends I {
5399
5419
  }), r.dirty()) : s.kind === "finite" ? Number.isFinite(e.data) || (a = this._getOrReturnCtx(e, a), _(a, {
5400
5420
  code: p.not_finite,
5401
5421
  message: s.message
5402
- }), r.dirty()) : $.assertNever(s);
5422
+ }), r.dirty()) : E.assertNever(s);
5403
5423
  return { status: r.value, value: e.data };
5404
5424
  }
5405
5425
  gte(e, n) {
@@ -5511,7 +5531,7 @@ class Se extends I {
5511
5531
  return e;
5512
5532
  }
5513
5533
  get isInt() {
5514
- return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && $.isInteger(e.value));
5534
+ return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && E.isInteger(e.value));
5515
5535
  }
5516
5536
  get isFinite() {
5517
5537
  let e = null, n = null;
@@ -5561,7 +5581,7 @@ class je extends I {
5561
5581
  code: p.not_multiple_of,
5562
5582
  multipleOf: s.value,
5563
5583
  message: s.message
5564
- }), r.dirty()) : $.assertNever(s);
5584
+ }), r.dirty()) : E.assertNever(s);
5565
5585
  return { status: r.value, value: e.data };
5566
5586
  }
5567
5587
  gte(e, n) {
@@ -5708,7 +5728,7 @@ class Fe extends I {
5708
5728
  exact: !1,
5709
5729
  maximum: s.value,
5710
5730
  type: "date"
5711
- }), a.dirty()) : $.assertNever(s);
5731
+ }), a.dirty()) : E.assertNever(s);
5712
5732
  return {
5713
5733
  status: a.value,
5714
5734
  value: new Date(e.data.getTime())
@@ -5955,7 +5975,7 @@ class D extends I {
5955
5975
  _getCached() {
5956
5976
  if (this._cached !== null)
5957
5977
  return this._cached;
5958
- const e = this._def.shape(), n = $.objectKeys(e);
5978
+ const e = this._def.shape(), n = E.objectKeys(e);
5959
5979
  return this._cached = { shape: e, keys: n };
5960
5980
  }
5961
5981
  _parse(e) {
@@ -6162,7 +6182,7 @@ class D extends I {
6162
6182
  }
6163
6183
  pick(e) {
6164
6184
  const n = {};
6165
- return $.objectKeys(e).forEach((a) => {
6185
+ return E.objectKeys(e).forEach((a) => {
6166
6186
  e[a] && this.shape[a] && (n[a] = this.shape[a]);
6167
6187
  }), new D({
6168
6188
  ...this._def,
@@ -6171,7 +6191,7 @@ class D extends I {
6171
6191
  }
6172
6192
  omit(e) {
6173
6193
  const n = {};
6174
- return $.objectKeys(this.shape).forEach((a) => {
6194
+ return E.objectKeys(this.shape).forEach((a) => {
6175
6195
  e[a] || (n[a] = this.shape[a]);
6176
6196
  }), new D({
6177
6197
  ...this._def,
@@ -6186,7 +6206,7 @@ class D extends I {
6186
6206
  }
6187
6207
  partial(e) {
6188
6208
  const n = {};
6189
- return $.objectKeys(this.shape).forEach((a) => {
6209
+ return E.objectKeys(this.shape).forEach((a) => {
6190
6210
  const r = this.shape[a];
6191
6211
  e && !e[a] ? n[a] = r : n[a] = r.optional();
6192
6212
  }), new D({
@@ -6196,7 +6216,7 @@ class D extends I {
6196
6216
  }
6197
6217
  required(e) {
6198
6218
  const n = {};
6199
- return $.objectKeys(this.shape).forEach((a) => {
6219
+ return E.objectKeys(this.shape).forEach((a) => {
6200
6220
  if (e && !e[a])
6201
6221
  n[a] = this.shape[a];
6202
6222
  else {
@@ -6211,7 +6231,7 @@ class D extends I {
6211
6231
  });
6212
6232
  }
6213
6233
  keyof() {
6214
- return wa($.objectKeys(this.shape));
6234
+ return wa(E.objectKeys(this.shape));
6215
6235
  }
6216
6236
  }
6217
6237
  D.create = (t, e) => new D({
@@ -6308,7 +6328,7 @@ zt.create = (t, e) => new zt({
6308
6328
  typeName: N.ZodUnion,
6309
6329
  ...S(e)
6310
6330
  });
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 ? $.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) : [];
6331
+ 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
6332
  class vn extends I {
6313
6333
  _parse(e) {
6314
6334
  const { ctx: n } = this._processInputParams(e);
@@ -6376,7 +6396,7 @@ function Pn(t, e) {
6376
6396
  if (t === e)
6377
6397
  return { valid: !0, data: t };
6378
6398
  if (n === y.object && a === y.object) {
6379
- const r = $.objectKeys(e), s = $.objectKeys(t).filter((d) => r.indexOf(d) !== -1), o = { ...t, ...e };
6399
+ const r = E.objectKeys(e), s = E.objectKeys(t).filter((d) => r.indexOf(d) !== -1), o = { ...t, ...e };
6380
6400
  for (const d of s) {
6381
6401
  const c = Pn(t[d], e[d]);
6382
6402
  if (!c.valid)
@@ -6400,10 +6420,10 @@ function Pn(t, e) {
6400
6420
  class Ut extends I {
6401
6421
  _parse(e) {
6402
6422
  const { status: n, ctx: a } = this._processInputParams(e), r = (s, o) => {
6403
- if (En(s) || En(o))
6423
+ if ($n(s) || $n(o))
6404
6424
  return k;
6405
6425
  const d = Pn(s.value, o.value);
6406
- return d.valid ? (($n(s) || $n(o)) && n.dirty(), { status: n.value, value: d.data }) : (_(a, {
6426
+ return d.valid ? ((En(s) || En(o)) && n.dirty(), { status: n.value, value: d.data }) : (_(a, {
6407
6427
  code: p.invalid_intersection_types
6408
6428
  }), k);
6409
6429
  };
@@ -6789,7 +6809,7 @@ class Ie extends I {
6789
6809
  if (typeof e.data != "string") {
6790
6810
  const n = this._getOrReturnCtx(e), a = this._def.values;
6791
6811
  return _(n, {
6792
- expected: $.joinValues(a),
6812
+ expected: E.joinValues(a),
6793
6813
  received: n.parsedType,
6794
6814
  code: p.invalid_type
6795
6815
  }), k;
@@ -6845,17 +6865,17 @@ class Kt extends I {
6845
6865
  super(...arguments), yt.set(this, void 0);
6846
6866
  }
6847
6867
  _parse(e) {
6848
- const n = $.getValidEnumValues(this._def.values), a = this._getOrReturnCtx(e);
6868
+ const n = E.getValidEnumValues(this._def.values), a = this._getOrReturnCtx(e);
6849
6869
  if (a.parsedType !== y.string && a.parsedType !== y.number) {
6850
- const r = $.objectValues(n);
6870
+ const r = E.objectValues(n);
6851
6871
  return _(a, {
6852
- expected: $.joinValues(r),
6872
+ expected: E.joinValues(r),
6853
6873
  received: a.parsedType,
6854
6874
  code: p.invalid_type
6855
6875
  }), k;
6856
6876
  }
6857
- if (hn(this, yt) || ga(this, yt, new Set($.getValidEnumValues(this._def.values))), !hn(this, yt).has(e.data)) {
6858
- const r = $.objectValues(n);
6877
+ if (hn(this, yt) || ga(this, yt, new Set(E.getValidEnumValues(this._def.values))), !hn(this, yt).has(e.data)) {
6878
+ const r = E.objectValues(n);
6859
6879
  return _(a, {
6860
6880
  received: a.data,
6861
6881
  code: p.invalid_enum_value,
@@ -6972,7 +6992,7 @@ class X extends I {
6972
6992
  return { status: n.value, value: d };
6973
6993
  } else
6974
6994
  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
- $.assertNever(r);
6995
+ E.assertNever(r);
6976
6996
  }
6977
6997
  }
6978
6998
  X.create = (t, e, n) => new X({
@@ -7179,7 +7199,7 @@ var N;
7179
7199
  })(N || (N = {}));
7180
7200
  const po = (t, e = {
7181
7201
  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, Eo = fn.create, $o = 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 = {
7202
+ }) => 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
7203
  string: (t) => Q.create({ ...t, coerce: !0 }),
7184
7204
  number: (t) => Se.create({ ...t, coerce: !0 }),
7185
7205
  boolean: (t) => Mt.create({
@@ -7201,12 +7221,12 @@ var Qo = /* @__PURE__ */ Object.freeze({
7201
7221
  INVALID: k,
7202
7222
  DIRTY: tt,
7203
7223
  OK: B,
7204
- isAborted: En,
7205
- isDirty: $n,
7224
+ isAborted: $n,
7225
+ isDirty: En,
7206
7226
  isValid: At,
7207
7227
  isAsync: Dt,
7208
7228
  get util() {
7209
- return $;
7229
+ return E;
7210
7230
  },
7211
7231
  get objectUtil() {
7212
7232
  return Zn;
@@ -7274,7 +7294,7 @@ var Qo = /* @__PURE__ */ Object.freeze({
7274
7294
  intersection: jo,
7275
7295
  lazy: Ao,
7276
7296
  literal: Do,
7277
- map: Eo,
7297
+ map: $o,
7278
7298
  nan: mo,
7279
7299
  nativeEnum: Ro,
7280
7300
  never: xo,
@@ -7290,7 +7310,7 @@ var Qo = /* @__PURE__ */ Object.freeze({
7290
7310
  preprocess: Fo,
7291
7311
  promise: Lo,
7292
7312
  record: Zo,
7293
- set: $o,
7313
+ set: Eo,
7294
7314
  strictObject: To,
7295
7315
  string: Na,
7296
7316
  symbol: go,
@@ -7425,7 +7445,7 @@ function Hn(t) {
7425
7445
  function dd(t) {
7426
7446
  return async (e, n) => {
7427
7447
  try {
7428
- const a = Es.parse(n);
7448
+ const a = $s.parse(n);
7429
7449
  await t.insertInto("prompt_settings").values({
7430
7450
  ...Hn(a),
7431
7451
  tenant_id: e
@@ -8498,7 +8518,7 @@ class bd {
8498
8518
  }
8499
8519
  }
8500
8520
  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, Ea, $a, Pa, Aa, Da, Mn, et, Rn, Ma, Ra, La, Ln, za, Ua, Fa, Va, Ba, bt;
8521
+ 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
8522
  class Ia {
8503
8523
  constructor(e) {
8504
8524
  ae(this, m);
@@ -8648,7 +8668,7 @@ class Ia {
8648
8668
  }
8649
8669
  P = new WeakMap(), m = new WeakSet(), vt = async function(e) {
8650
8670
  try {
8651
- return await T(this, m, Ea).call(this), await T(this, m, Ma).call(this, e);
8671
+ return await T(this, m, $a).call(this), await T(this, m, Ma).call(this, e);
8652
8672
  } catch (n) {
8653
8673
  return n instanceof Cn ? n.resultSet : { error: n };
8654
8674
  }
@@ -8662,9 +8682,9 @@ P = new WeakMap(), m = new WeakSet(), vt = async function(e) {
8662
8682
  return v(this, P).allowUnorderedMigrations ?? xd;
8663
8683
  }, pe = function() {
8664
8684
  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
8685
  }, $a = async function() {
8686
+ 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);
8687
+ }, Ea = async function() {
8668
8688
  if (v(this, m, ue) && !await T(this, m, Mn).call(this))
8669
8689
  try {
8670
8690
  await T(this, m, bt).call(this, v(this, P).db.schema.createSchema(v(this, m, ue)));
@@ -8921,12 +8941,12 @@ async function Id(t) {
8921
8941
  }
8922
8942
  async function Zd(t) {
8923
8943
  }
8924
- const Ed = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8944
+ const $d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8925
8945
  __proto__: null,
8926
8946
  down: Zd,
8927
8947
  up: Id
8928
8948
  }, Symbol.toStringTag, { value: "Module" }));
8929
- async function $d(t) {
8949
+ async function Ed(t) {
8930
8950
  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
8951
  "tenant_id_constraint",
8932
8952
  ["tenant_id"],
@@ -8941,7 +8961,7 @@ async function Pd(t) {
8941
8961
  const Ad = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8942
8962
  __proto__: null,
8943
8963
  down: Pd,
8944
- up: $d
8964
+ up: Ed
8945
8965
  }, Symbol.toStringTag, { value: "Module" }));
8946
8966
  async function Dd(t) {
8947
8967
  }
@@ -9156,12 +9176,12 @@ async function Ic(t) {
9156
9176
  }
9157
9177
  async function Zc(t) {
9158
9178
  }
9159
- const Ec = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9179
+ const $c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9160
9180
  __proto__: null,
9161
9181
  down: Zc,
9162
9182
  up: Ic
9163
9183
  }, Symbol.toStringTag, { value: "Module" }));
9164
- async function $c(t) {
9184
+ async function Ec(t) {
9165
9185
  await t.schema.alterTable("logs").dropColumn("category").execute();
9166
9186
  }
9167
9187
  async function Pc(t) {
@@ -9170,7 +9190,7 @@ async function Pc(t) {
9170
9190
  const Ac = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9171
9191
  __proto__: null,
9172
9192
  down: Pc,
9173
- up: $c
9193
+ up: Ec
9174
9194
  }, Symbol.toStringTag, { value: "Module" }));
9175
9195
  async function Dc(t) {
9176
9196
  await t.schema.alterTable("users").dropColumn("tags").execute();
@@ -9355,19 +9375,19 @@ async function Il(t) {
9355
9375
  async function Zl(t) {
9356
9376
  await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(255)").execute();
9357
9377
  }
9358
- const El = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9378
+ const $l = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9359
9379
  __proto__: null,
9360
9380
  down: Zl,
9361
9381
  up: Il
9362
9382
  }, Symbol.toStringTag, { value: "Module" }));
9363
- async function $l(t) {
9383
+ async function El(t) {
9364
9384
  }
9365
9385
  async function Pl(t) {
9366
9386
  }
9367
9387
  const Al = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9368
9388
  __proto__: null,
9369
9389
  down: Pl,
9370
- up: $l
9390
+ up: El
9371
9391
  }, Symbol.toStringTag, { value: "Module" }));
9372
9392
  async function Dl(t) {
9373
9393
  await t.schema.createTable("hooks").addColumn("hook_id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
@@ -9618,19 +9638,19 @@ async function Iu(t) {
9618
9638
  async function Zu(t) {
9619
9639
  await t.schema.dropTable("prompt_settings").execute();
9620
9640
  }
9621
- const Eu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9641
+ const $u = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9622
9642
  __proto__: null,
9623
9643
  down: Zu,
9624
9644
  up: Iu
9625
9645
  }, Symbol.toStringTag, { value: "Module" }));
9626
- async function $u(t) {
9646
+ async function Eu(t) {
9627
9647
  }
9628
9648
  async function Pu(t) {
9629
9649
  }
9630
9650
  const Au = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9631
9651
  __proto__: null,
9632
9652
  down: Pu,
9633
- up: $u
9653
+ up: Eu
9634
9654
  }, Symbol.toStringTag, { value: "Module" }));
9635
9655
  async function Du(t) {
9636
9656
  }
@@ -9753,7 +9773,7 @@ const uh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9753
9773
  }, Symbol.toStringTag, { value: "Module" })), Ja = {
9754
9774
  m1_init: Td,
9755
9775
  m2_magicLink: jd,
9756
- m3_updateAt: Ed,
9776
+ m3_updateAt: $d,
9757
9777
  m4_logTable: Ad,
9758
9778
  m5_userProfile: Rd,
9759
9779
  m6_sessions: Ud,
@@ -9771,7 +9791,7 @@ const uh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9771
9791
  n18_logsFields: Nc,
9772
9792
  n19_connectionsUserinfo: Tc,
9773
9793
  n20_missingFields: jc,
9774
- n21_sessionDeletedAt: Ec,
9794
+ n21_sessionDeletedAt: $c,
9775
9795
  n22_dropLogsFields: Ac,
9776
9796
  n23_dropUsersFields: Rc,
9777
9797
  n24_logsIndexes: Uc,
@@ -9789,7 +9809,7 @@ const uh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9789
9809
  n36_authenticationCodes: Nl,
9790
9810
  n37_disableSignUps: Tl,
9791
9811
  n38_otpIpAddress: jl,
9792
- n39_increaseUserAgentLength: El,
9812
+ n39_increaseUserAgentLength: $l,
9793
9813
  n40_userId: Al,
9794
9814
  n41_hooks: Rl,
9795
9815
  n42_userIdIndexes: Ul,
@@ -9807,7 +9827,7 @@ const uh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9807
9827
  n54_cleanup_tables: Nu,
9808
9828
  n55_logs_index: Tu,
9809
9829
  n56_application_fields: ju,
9810
- n57_prompt_settings: Eu,
9830
+ n57_prompt_settings: $u,
9811
9831
  n58_connection_client_id: Au,
9812
9832
  n59_connection_options: Ru,
9813
9833
  n60_users_metadata: Uu,
@@ -9852,7 +9872,7 @@ function fh(t) {
9852
9872
  codes: pi(t),
9853
9873
  connections: Ci(t),
9854
9874
  emailProviders: pd(t),
9855
- domains: $i(t),
9875
+ domains: Ei(t),
9856
9876
  hooks: Fi(t),
9857
9877
  keys: Ii(t),
9858
9878
  logins: id(t),