@authhero/kysely-adapter 0.23.0 → 0.24.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.
@@ -1,10 +1,10 @@
1
- var Ga = Object.defineProperty;
2
- var Kn = (t) => {
1
+ var qa = Object.defineProperty;
2
+ var Bn = (t) => {
3
3
  throw TypeError(t);
4
4
  };
5
- var Ha = (t, e, n) => e in t ? Ga(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
6
- var ut = (t, e, n) => Ha(t, typeof e != "symbol" ? e + "" : e, n), bn = (t, e, n) => e.has(t) || Kn("Cannot " + n);
7
- var v = (t, e, n) => (bn(t, e, "read from private field"), n ? n.call(t) : e.get(t)), ae = (t, e, n) => e.has(t) ? Kn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), ht = (t, e, n, a) => (bn(t, e, "write to private field"), a ? a.call(t, n) : e.set(t, n), n), T = (t, e, n) => (bn(t, e, "access private method"), n);
5
+ var Qa = (t, e, n) => e in t ? qa(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
6
+ var ut = (t, e, n) => Qa(t, typeof e != "symbol" ? e + "" : e, n), bn = (t, e, n) => e.has(t) || Bn("Cannot " + n);
7
+ var v = (t, e, n) => (bn(t, e, "read from private field"), n ? n.call(t) : e.get(t)), ae = (t, e, n) => e.has(t) ? Bn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), ht = (t, e, n, a) => (bn(t, e, "write to private field"), a ? a.call(t, n) : e.set(t, n), n), T = (t, e, n) => (bn(t, e, "access private method"), n);
8
8
  var Tn = class extends Error {
9
9
  constructor(e = 500, n) {
10
10
  super(n == null ? void 0 : n.message, { cause: n == null ? void 0 : n.cause });
@@ -21,7 +21,7 @@ var Tn = class extends Error {
21
21
  });
22
22
  }
23
23
  };
24
- function Ya(t) {
24
+ function Ga(t) {
25
25
  return async (e, n) => {
26
26
  const { identities: a, ...r } = n, s = {
27
27
  ...r,
@@ -47,13 +47,13 @@ function Ya(t) {
47
47
  };
48
48
  };
49
49
  }
50
- function M(t) {
50
+ function R(t) {
51
51
  const e = { ...t };
52
52
  for (const n in e)
53
- e[n] === null ? delete e[n] : typeof e[n] == "object" && (Array.isArray(e[n]) ? e[n] = e[n].map(M) : e[n] = M(e[n]));
53
+ e[n] === null ? delete e[n] : typeof e[n] == "object" && (Array.isArray(e[n]) ? e[n] = e[n].map(R) : e[n] = R(e[n]));
54
54
  return e;
55
55
  }
56
- function Xa(t, e) {
56
+ function Ha(t, e) {
57
57
  var n = {};
58
58
  for (var a in t) Object.prototype.hasOwnProperty.call(t, a) && e.indexOf(a) < 0 && (n[a] = t[a]);
59
59
  if (t != null && typeof Object.getOwnPropertySymbols == "function")
@@ -61,7 +61,7 @@ function Xa(t, e) {
61
61
  e.indexOf(a[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, a[r]) && (n[a[r]] = t[a[r]]);
62
62
  return n;
63
63
  }
64
- function er(t, e) {
64
+ function Ya(t, e) {
65
65
  var n;
66
66
  return ((n = t == null ? void 0 : t._def) === null || n === void 0 ? void 0 : n.typeName) === e;
67
67
  }
@@ -72,15 +72,15 @@ function pt(t, e) {
72
72
  return r._def.openapi = this._def.openapi, r;
73
73
  };
74
74
  }
75
- function tr(t) {
75
+ function Xa(t) {
76
76
  if (typeof t.ZodType.prototype.openapi < "u")
77
77
  return;
78
78
  t.ZodType.prototype.openapi = function(r, s) {
79
79
  var o, d, c, l, u, Z;
80
- const R = typeof r == "string" ? s : r, W = R ?? {}, { param: _e } = W, Je = Xa(W, ["param"]), ge = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), ye = Object.assign(Object.assign(Object.assign({}, (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata), Je), !((l = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata) === null || l === void 0) && l.param || _e ? {
80
+ const M = typeof r == "string" ? s : r, W = M ?? {}, { param: _e } = W, Je = Ha(W, ["param"]), ge = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), ye = Object.assign(Object.assign(Object.assign({}, (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata), Je), !((l = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata) === null || l === void 0) && l.param || _e ? {
81
81
  param: Object.assign(Object.assign({}, (Z = (u = this._def.openapi) === null || u === void 0 ? void 0 : u.metadata) === null || Z === void 0 ? void 0 : Z.param), _e)
82
82
  } : void 0), ve = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(ge).length > 0 ? { _internal: ge } : void 0), Object.keys(ye).length > 0 ? { metadata: ye } : void 0) }));
83
- if (er(this, "ZodObject")) {
83
+ if (Ya(this, "ZodObject")) {
84
84
  const We = this.extend;
85
85
  ve.extend = function(...qe) {
86
86
  var ee, te, ne, be, $e, Pe;
@@ -218,7 +218,7 @@ const g = E.arrayToEnum([
218
218
  "invalid_intersection_types",
219
219
  "not_multiple_of",
220
220
  "not_finite"
221
- ]), nr = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
221
+ ]), er = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
222
222
  class K extends Error {
223
223
  constructor(e) {
224
224
  super(), this.issues = [], this.addIssue = (a) => {
@@ -335,12 +335,12 @@ const st = (t, e) => {
335
335
  }
336
336
  return { message: n };
337
337
  };
338
- let ea = st;
339
- function ar(t) {
340
- ea = t;
338
+ let Xn = st;
339
+ function tr(t) {
340
+ Xn = t;
341
341
  }
342
342
  function tn() {
343
- return ea;
343
+ return Xn;
344
344
  }
345
345
  const nn = (t) => {
346
346
  const { data: e, path: n, errorMaps: a, issueData: r } = t, s = [...n, ...r.path || []], o = {
@@ -362,7 +362,7 @@ const nn = (t) => {
362
362
  path: s,
363
363
  message: d
364
364
  };
365
- }, rr = [];
365
+ }, nr = [];
366
366
  function f(t, e) {
367
367
  const n = tn(), a = nn({
368
368
  issueData: e,
@@ -426,7 +426,7 @@ function rn(t, e, n, a) {
426
426
  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");
427
427
  return e.get(t);
428
428
  }
429
- function ta(t, e, n, a, r) {
429
+ function ea(t, e, n, a, r) {
430
430
  if (typeof e == "function" ? t !== e || !r : !e.has(t)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
431
431
  return e.set(t, n), n;
432
432
  }
@@ -443,7 +443,7 @@ class ie {
443
443
  return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
444
444
  }
445
445
  }
446
- const Jn = (t, e) => {
446
+ const Kn = (t, e) => {
447
447
  if (wt(e))
448
448
  return { success: !0, data: e.value };
449
449
  if (!t.common.issues.length)
@@ -533,7 +533,7 @@ class j {
533
533
  data: e,
534
534
  parsedType: xe(e)
535
535
  }, s = this._parseSync({ data: e, path: r.path, parent: r });
536
- return Jn(r, s);
536
+ return Kn(r, s);
537
537
  }
538
538
  async parseAsync(e, n) {
539
539
  const a = await this.safeParseAsync(e, n);
@@ -554,7 +554,7 @@ class j {
554
554
  data: e,
555
555
  parsedType: xe(e)
556
556
  }, r = this._parse({ data: e, path: a.path, parent: a }), s = await (xt(r) ? r : Promise.resolve(r));
557
- return Jn(a, s);
557
+ return Kn(a, s);
558
558
  }
559
559
  refine(e, n) {
560
560
  const a = (r) => typeof n == "string" || typeof n > "u" ? { message: n } : typeof n == "function" ? n(r) : n;
@@ -653,23 +653,23 @@ class j {
653
653
  return this.safeParse(null).success;
654
654
  }
655
655
  }
656
- const sr = /^c[^\s-]{8,}$/i, ir = /^[0-9a-z]+$/, or = /^[0-9A-HJKMNP-TV-Z]{26}$/, dr = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, cr = /^[a-z0-9_-]{21}$/i, lr = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, ur = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, hr = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
656
+ const ar = /^c[^\s-]{8,}$/i, rr = /^[0-9a-z]+$/, sr = /^[0-9A-HJKMNP-TV-Z]{26}$/, ir = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, or = /^[a-z0-9_-]{21}$/i, dr = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, cr = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, lr = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
657
657
  let wn;
658
- const pr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, mr = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, fr = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, na = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", _r = new RegExp(`^${na}$`);
659
- function aa(t) {
658
+ const ur = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, hr = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, pr = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, ta = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", mr = new RegExp(`^${ta}$`);
659
+ function na(t) {
660
660
  let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
661
661
  return t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`), e;
662
662
  }
663
- function gr(t) {
664
- return new RegExp(`^${aa(t)}$`);
663
+ function fr(t) {
664
+ return new RegExp(`^${na(t)}$`);
665
665
  }
666
- function ra(t) {
667
- let e = `${na}T${aa(t)}`;
666
+ function aa(t) {
667
+ let e = `${ta}T${na(t)}`;
668
668
  const n = [];
669
669
  return n.push(t.local ? "Z?" : "Z"), t.offset && n.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${n.join("|")})`, new RegExp(`^${e}$`);
670
670
  }
671
- function yr(t, e) {
672
- return !!((e === "v4" || !e) && pr.test(t) || (e === "v6" || !e) && mr.test(t));
671
+ function _r(t, e) {
672
+ return !!((e === "v4" || !e) && ur.test(t) || (e === "v6" || !e) && hr.test(t));
673
673
  }
674
674
  class q extends j {
675
675
  _parse(e) {
@@ -720,43 +720,43 @@ class q extends j {
720
720
  message: r.message
721
721
  }), n.dirty());
722
722
  } else if (r.kind === "email")
723
- ur.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
723
+ cr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
724
724
  validation: "email",
725
725
  code: h.invalid_string,
726
726
  message: r.message
727
727
  }), n.dirty());
728
728
  else if (r.kind === "emoji")
729
- wn || (wn = new RegExp(hr, "u")), wn.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
729
+ wn || (wn = new RegExp(lr, "u")), wn.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
730
730
  validation: "emoji",
731
731
  code: h.invalid_string,
732
732
  message: r.message
733
733
  }), n.dirty());
734
734
  else if (r.kind === "uuid")
735
- dr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
735
+ ir.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
736
736
  validation: "uuid",
737
737
  code: h.invalid_string,
738
738
  message: r.message
739
739
  }), n.dirty());
740
740
  else if (r.kind === "nanoid")
741
- cr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
741
+ or.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
742
742
  validation: "nanoid",
743
743
  code: h.invalid_string,
744
744
  message: r.message
745
745
  }), n.dirty());
746
746
  else if (r.kind === "cuid")
747
- sr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
747
+ ar.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
748
748
  validation: "cuid",
749
749
  code: h.invalid_string,
750
750
  message: r.message
751
751
  }), n.dirty());
752
752
  else if (r.kind === "cuid2")
753
- ir.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
753
+ rr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
754
754
  validation: "cuid2",
755
755
  code: h.invalid_string,
756
756
  message: r.message
757
757
  }), n.dirty());
758
758
  else if (r.kind === "ulid")
759
- or.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
759
+ sr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
760
760
  validation: "ulid",
761
761
  code: h.invalid_string,
762
762
  message: r.message
@@ -787,27 +787,27 @@ class q extends j {
787
787
  code: h.invalid_string,
788
788
  validation: { endsWith: r.value },
789
789
  message: r.message
790
- }), n.dirty()) : r.kind === "datetime" ? ra(r).test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
790
+ }), n.dirty()) : r.kind === "datetime" ? aa(r).test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
791
791
  code: h.invalid_string,
792
792
  validation: "datetime",
793
793
  message: r.message
794
- }), n.dirty()) : r.kind === "date" ? _r.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
794
+ }), n.dirty()) : r.kind === "date" ? mr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
795
795
  code: h.invalid_string,
796
796
  validation: "date",
797
797
  message: r.message
798
- }), n.dirty()) : r.kind === "time" ? gr(r).test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
798
+ }), n.dirty()) : r.kind === "time" ? fr(r).test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
799
799
  code: h.invalid_string,
800
800
  validation: "time",
801
801
  message: r.message
802
- }), n.dirty()) : r.kind === "duration" ? lr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
802
+ }), n.dirty()) : r.kind === "duration" ? dr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
803
803
  validation: "duration",
804
804
  code: h.invalid_string,
805
805
  message: r.message
806
- }), n.dirty()) : r.kind === "ip" ? yr(e.data, r.version) || (a = this._getOrReturnCtx(e, a), f(a, {
806
+ }), n.dirty()) : r.kind === "ip" ? _r(e.data, r.version) || (a = this._getOrReturnCtx(e, a), f(a, {
807
807
  validation: "ip",
808
808
  code: h.invalid_string,
809
809
  message: r.message
810
- }), n.dirty()) : r.kind === "base64" ? fr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
810
+ }), n.dirty()) : r.kind === "base64" ? pr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
811
811
  validation: "base64",
812
812
  code: h.invalid_string,
813
813
  message: r.message
@@ -1029,7 +1029,7 @@ q.create = (t) => {
1029
1029
  ...O(t)
1030
1030
  });
1031
1031
  };
1032
- function vr(t, e) {
1032
+ function gr(t, e) {
1033
1033
  const n = (t.toString().split(".")[1] || "").length, a = (e.toString().split(".")[1] || "").length, r = n > a ? n : a, s = parseInt(t.toFixed(r).replace(".", "")), o = parseInt(e.toFixed(r).replace(".", ""));
1034
1034
  return s % o / Math.pow(10, r);
1035
1035
  }
@@ -1068,7 +1068,7 @@ class ke extends j {
1068
1068
  inclusive: r.inclusive,
1069
1069
  exact: !1,
1070
1070
  message: r.message
1071
- }), a.dirty()) : r.kind === "multipleOf" ? vr(e.data, r.value) !== 0 && (n = this._getOrReturnCtx(e, n), f(n, {
1071
+ }), a.dirty()) : r.kind === "multipleOf" ? gr(e.data, r.value) !== 0 && (n = this._getOrReturnCtx(e, n), f(n, {
1072
1072
  code: h.not_multiple_of,
1073
1073
  multipleOf: r.value,
1074
1074
  message: r.message
@@ -1492,7 +1492,7 @@ it.create = (t) => new it({
1492
1492
  typeName: x.ZodAny,
1493
1493
  ...O(t)
1494
1494
  });
1495
- class Me extends j {
1495
+ class Re extends j {
1496
1496
  constructor() {
1497
1497
  super(...arguments), this._unknown = !0;
1498
1498
  }
@@ -1500,7 +1500,7 @@ class Me extends j {
1500
1500
  return V(e.data);
1501
1501
  }
1502
1502
  }
1503
- Me.create = (t) => new Me({
1503
+ Re.create = (t) => new Re({
1504
1504
  typeName: x.ZodUnknown,
1505
1505
  ...O(t)
1506
1506
  });
@@ -1887,7 +1887,7 @@ class A extends j {
1887
1887
  });
1888
1888
  }
1889
1889
  keyof() {
1890
- return sa(E.objectKeys(this.shape));
1890
+ return ra(E.objectKeys(this.shape));
1891
1891
  }
1892
1892
  }
1893
1893
  A.create = (t, e) => new A({
@@ -2362,11 +2362,11 @@ class nt extends j {
2362
2362
  if (this._def.returns instanceof ot) {
2363
2363
  const d = this;
2364
2364
  return V(async function(...c) {
2365
- const l = new K([]), u = await d._def.args.parseAsync(c, s).catch((R) => {
2366
- throw l.addIssue(a(c, R)), l;
2365
+ const l = new K([]), u = await d._def.args.parseAsync(c, s).catch((M) => {
2366
+ throw l.addIssue(a(c, M)), l;
2367
2367
  }), Z = await Reflect.apply(o, this, u);
2368
- return await d._def.returns._def.type.parseAsync(Z, s).catch((R) => {
2369
- throw l.addIssue(r(Z, R)), l;
2368
+ return await d._def.returns._def.type.parseAsync(Z, s).catch((M) => {
2369
+ throw l.addIssue(r(Z, M)), l;
2370
2370
  });
2371
2371
  });
2372
2372
  } else {
@@ -2391,7 +2391,7 @@ class nt extends j {
2391
2391
  args(...e) {
2392
2392
  return new nt({
2393
2393
  ...this._def,
2394
- args: oe.create(e).rest(Me.create())
2394
+ args: oe.create(e).rest(Re.create())
2395
2395
  });
2396
2396
  }
2397
2397
  returns(e) {
@@ -2408,8 +2408,8 @@ class nt extends j {
2408
2408
  }
2409
2409
  static create(e, n, a) {
2410
2410
  return new nt({
2411
- args: e || oe.create([]).rest(Me.create()),
2412
- returns: n || Me.create(),
2411
+ args: e || oe.create([]).rest(Re.create()),
2412
+ returns: n || Re.create(),
2413
2413
  typeName: x.ZodFunction,
2414
2414
  ...O(a)
2415
2415
  });
@@ -2450,7 +2450,7 @@ It.create = (t, e) => new It({
2450
2450
  typeName: x.ZodLiteral,
2451
2451
  ...O(e)
2452
2452
  });
2453
- function sa(t, e) {
2453
+ function ra(t, e) {
2454
2454
  return new Te({
2455
2455
  values: t,
2456
2456
  typeName: x.ZodEnum,
@@ -2470,7 +2470,7 @@ class Te extends j {
2470
2470
  code: h.invalid_type
2471
2471
  }), C;
2472
2472
  }
2473
- if (rn(this, ft) || ta(this, ft, new Set(this._def.values)), !rn(this, ft).has(e.data)) {
2473
+ if (rn(this, ft) || ea(this, ft, new Set(this._def.values)), !rn(this, ft).has(e.data)) {
2474
2474
  const n = this._getOrReturnCtx(e), a = this._def.values;
2475
2475
  return f(n, {
2476
2476
  received: n.data,
@@ -2515,7 +2515,7 @@ class Te extends j {
2515
2515
  }
2516
2516
  }
2517
2517
  ft = /* @__PURE__ */ new WeakMap();
2518
- Te.create = sa;
2518
+ Te.create = ra;
2519
2519
  class Zt extends j {
2520
2520
  constructor() {
2521
2521
  super(...arguments), _t.set(this, void 0);
@@ -2530,7 +2530,7 @@ class Zt extends j {
2530
2530
  code: h.invalid_type
2531
2531
  }), C;
2532
2532
  }
2533
- if (rn(this, _t) || ta(this, _t, new Set(E.getValidEnumValues(this._def.values))), !rn(this, _t).has(e.data)) {
2533
+ if (rn(this, _t) || ea(this, _t, new Set(E.getValidEnumValues(this._def.values))), !rn(this, _t).has(e.data)) {
2534
2534
  const r = E.objectValues(n);
2535
2535
  return f(a, {
2536
2536
  received: a.data,
@@ -2769,7 +2769,7 @@ cn.create = (t) => new cn({
2769
2769
  typeName: x.ZodNaN,
2770
2770
  ...O(t)
2771
2771
  });
2772
- const br = Symbol("zod_brand");
2772
+ const yr = Symbol("zod_brand");
2773
2773
  class zn extends j {
2774
2774
  _parse(e) {
2775
2775
  const { ctx: n } = this._processInputParams(e), a = n.data;
@@ -2837,7 +2837,7 @@ Pt.create = (t, e) => new Pt({
2837
2837
  typeName: x.ZodReadonly,
2838
2838
  ...O(e)
2839
2839
  });
2840
- function ia(t, e = {}, n) {
2840
+ function sa(t, e = {}, n) {
2841
2841
  return t ? it.create().superRefine((a, r) => {
2842
2842
  var s, o;
2843
2843
  if (!t(a)) {
@@ -2846,16 +2846,16 @@ function ia(t, e = {}, n) {
2846
2846
  }
2847
2847
  }) : it.create();
2848
2848
  }
2849
- const wr = {
2849
+ const vr = {
2850
2850
  object: A.lazycreate
2851
2851
  };
2852
2852
  var x;
2853
2853
  (function(t) {
2854
2854
  t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
2855
2855
  })(x || (x = {}));
2856
- const xr = (t, e = {
2856
+ const br = (t, e = {
2857
2857
  message: `Input not instance of ${t.name}`
2858
- }) => ia((n) => n instanceof t, e), oa = q.create, da = ke.create, Nr = cn.create, kr = Ce.create, ca = Nt.create, Cr = ze.create, Tr = sn.create, Or = kt.create, Sr = Ct.create, jr = it.create, Ir = Me.create, Zr = me.create, Er = on.create, $r = G.create, Pr = A.create, Ar = A.strictCreate, Dr = Tt.create, Rr = yn.create, Mr = Ot.create, Lr = oe.create, zr = St.create, Ur = dn.create, Fr = Ue.create, Vr = nt.create, Br = jt.create, Kr = It.create, Jr = Te.create, Wr = Zt.create, qr = ot.create, Wn = Y.create, Qr = re.create, Gr = Oe.create, Hr = Y.createWithPreprocess, Yr = Ht.create, Xr = () => oa().optional(), es = () => da().optional(), ts = () => ca().optional(), ns = {
2858
+ }) => sa((n) => n instanceof t, e), ia = q.create, oa = ke.create, wr = cn.create, xr = Ce.create, da = Nt.create, Nr = ze.create, kr = sn.create, Cr = kt.create, Tr = Ct.create, Or = it.create, Sr = Re.create, jr = me.create, Ir = on.create, Zr = G.create, Er = A.create, $r = A.strictCreate, Pr = Tt.create, Ar = yn.create, Dr = Ot.create, Mr = oe.create, Rr = St.create, Lr = dn.create, zr = Ue.create, Ur = nt.create, Fr = jt.create, Vr = It.create, Br = Te.create, Kr = Zt.create, Jr = ot.create, Jn = Y.create, Wr = re.create, qr = Oe.create, Qr = Y.createWithPreprocess, Gr = Ht.create, Hr = () => ia().optional(), Yr = () => oa().optional(), Xr = () => da().optional(), es = {
2859
2859
  string: (t) => q.create({ ...t, coerce: !0 }),
2860
2860
  number: (t) => ke.create({ ...t, coerce: !0 }),
2861
2861
  boolean: (t) => Nt.create({
@@ -2864,14 +2864,14 @@ const xr = (t, e = {
2864
2864
  }),
2865
2865
  bigint: (t) => Ce.create({ ...t, coerce: !0 }),
2866
2866
  date: (t) => ze.create({ ...t, coerce: !0 })
2867
- }, as = C;
2867
+ }, ts = C;
2868
2868
  var i = /* @__PURE__ */ Object.freeze({
2869
2869
  __proto__: null,
2870
2870
  defaultErrorMap: st,
2871
- setErrorMap: ar,
2871
+ setErrorMap: tr,
2872
2872
  getErrorMap: tn,
2873
2873
  makeIssue: nn,
2874
- EMPTY_PATH: rr,
2874
+ EMPTY_PATH: nr,
2875
2875
  addIssueToContext: f,
2876
2876
  ParseStatus: U,
2877
2877
  INVALID: C,
@@ -2890,7 +2890,7 @@ var i = /* @__PURE__ */ Object.freeze({
2890
2890
  ZodParsedType: g,
2891
2891
  getParsedType: xe,
2892
2892
  ZodType: j,
2893
- datetimeRegex: ra,
2893
+ datetimeRegex: aa,
2894
2894
  ZodString: q,
2895
2895
  ZodNumber: ke,
2896
2896
  ZodBigInt: Ce,
@@ -2900,7 +2900,7 @@ var i = /* @__PURE__ */ Object.freeze({
2900
2900
  ZodUndefined: kt,
2901
2901
  ZodNull: Ct,
2902
2902
  ZodAny: it,
2903
- ZodUnknown: Me,
2903
+ ZodUnknown: Re,
2904
2904
  ZodNever: me,
2905
2905
  ZodVoid: on,
2906
2906
  ZodArray: G,
@@ -2925,63 +2925,63 @@ var i = /* @__PURE__ */ Object.freeze({
2925
2925
  ZodDefault: Et,
2926
2926
  ZodCatch: $t,
2927
2927
  ZodNaN: cn,
2928
- BRAND: br,
2928
+ BRAND: yr,
2929
2929
  ZodBranded: zn,
2930
2930
  ZodPipeline: Ht,
2931
2931
  ZodReadonly: Pt,
2932
- custom: ia,
2932
+ custom: sa,
2933
2933
  Schema: j,
2934
2934
  ZodSchema: j,
2935
- late: wr,
2935
+ late: vr,
2936
2936
  get ZodFirstPartyTypeKind() {
2937
2937
  return x;
2938
2938
  },
2939
- coerce: ns,
2940
- any: jr,
2941
- array: $r,
2942
- bigint: kr,
2943
- boolean: ca,
2944
- date: Cr,
2945
- discriminatedUnion: Rr,
2946
- effect: Wn,
2947
- enum: Jr,
2948
- function: Vr,
2949
- instanceof: xr,
2950
- intersection: Mr,
2951
- lazy: Br,
2952
- literal: Kr,
2953
- map: Ur,
2954
- nan: Nr,
2955
- nativeEnum: Wr,
2956
- never: Zr,
2957
- null: Sr,
2958
- nullable: Gr,
2959
- number: da,
2960
- object: Pr,
2961
- oboolean: ts,
2962
- onumber: es,
2963
- optional: Qr,
2964
- ostring: Xr,
2965
- pipeline: Yr,
2966
- preprocess: Hr,
2967
- promise: qr,
2968
- record: zr,
2969
- set: Fr,
2970
- strictObject: Ar,
2971
- string: oa,
2972
- symbol: Tr,
2973
- transformer: Wn,
2974
- tuple: Lr,
2975
- undefined: Or,
2976
- union: Dr,
2977
- unknown: Ir,
2978
- void: Er,
2979
- NEVER: as,
2939
+ coerce: es,
2940
+ any: Or,
2941
+ array: Zr,
2942
+ bigint: xr,
2943
+ boolean: da,
2944
+ date: Nr,
2945
+ discriminatedUnion: Ar,
2946
+ effect: Jn,
2947
+ enum: Br,
2948
+ function: Ur,
2949
+ instanceof: br,
2950
+ intersection: Dr,
2951
+ lazy: Fr,
2952
+ literal: Vr,
2953
+ map: Lr,
2954
+ nan: wr,
2955
+ nativeEnum: Kr,
2956
+ never: jr,
2957
+ null: Tr,
2958
+ nullable: qr,
2959
+ number: oa,
2960
+ object: Er,
2961
+ oboolean: Xr,
2962
+ onumber: Yr,
2963
+ optional: Wr,
2964
+ ostring: Hr,
2965
+ pipeline: Gr,
2966
+ preprocess: Qr,
2967
+ promise: Jr,
2968
+ record: Rr,
2969
+ set: zr,
2970
+ strictObject: $r,
2971
+ string: ia,
2972
+ symbol: kr,
2973
+ transformer: Jn,
2974
+ tuple: Mr,
2975
+ undefined: Cr,
2976
+ union: Pr,
2977
+ unknown: Sr,
2978
+ void: Ir,
2979
+ NEVER: ts,
2980
2980
  ZodIssueCode: h,
2981
- quotelessJson: nr,
2981
+ quotelessJson: er,
2982
2982
  ZodError: K
2983
2983
  });
2984
- tr(i);
2984
+ Xa(i);
2985
2985
  i.object({
2986
2986
  start: i.number(),
2987
2987
  limit: i.number(),
@@ -2990,7 +2990,7 @@ i.object({
2990
2990
  const Un = i.object({
2991
2991
  created_at: i.string(),
2992
2992
  updated_at: i.string()
2993
- }), rs = i.object({
2993
+ }), ns = i.object({
2994
2994
  email: i.string().optional(),
2995
2995
  email_verified: i.boolean().optional(),
2996
2996
  name: i.string().optional(),
@@ -2999,7 +2999,7 @@ const Un = i.object({
2999
2999
  phone_number: i.string().optional(),
3000
3000
  phone_verified: i.boolean().optional(),
3001
3001
  family_name: i.string().optional()
3002
- }).catchall(i.any()), ss = i.object({
3002
+ }).catchall(i.any()), as = i.object({
3003
3003
  connection: i.string(),
3004
3004
  user_id: i.string(),
3005
3005
  provider: i.string(),
@@ -3007,8 +3007,8 @@ const Un = i.object({
3007
3007
  access_token: i.string().optional(),
3008
3008
  access_token_secret: i.string().optional(),
3009
3009
  refresh_token: i.string().optional(),
3010
- profileData: rs.optional()
3011
- }), la = i.object({
3010
+ profileData: ns.optional()
3011
+ }), ca = i.object({
3012
3012
  email: i.string().optional(),
3013
3013
  username: i.string().optional(),
3014
3014
  given_name: i.string().optional(),
@@ -3022,7 +3022,7 @@ const Un = i.object({
3022
3022
  user_id: i.string().optional(),
3023
3023
  app_metadata: i.any().default({}).optional(),
3024
3024
  user_metadata: i.any().default({}).optional()
3025
- }), is = la.extend({
3025
+ }), rs = ca.extend({
3026
3026
  email_verified: i.boolean().default(!1),
3027
3027
  verify_email: i.boolean().optional(),
3028
3028
  last_ip: i.string().optional(),
@@ -3032,16 +3032,16 @@ const Un = i.object({
3032
3032
  connection: i.string().default("email")
3033
3033
  });
3034
3034
  i.object({
3035
- ...is.shape,
3035
+ ...rs.shape,
3036
3036
  ...Un.shape,
3037
3037
  user_id: i.string(),
3038
3038
  // TODO: this not might be correct if you use the username
3039
3039
  email: i.string(),
3040
3040
  is_social: i.boolean(),
3041
3041
  login_count: i.number(),
3042
- identities: i.array(ss).optional()
3042
+ identities: i.array(as).optional()
3043
3043
  });
3044
- la.extend({
3044
+ ca.extend({
3045
3045
  email: i.string(),
3046
3046
  login_count: i.number(),
3047
3047
  multifactor: i.array(i.string()).optional(),
@@ -3049,14 +3049,14 @@ la.extend({
3049
3049
  last_login: i.string().optional(),
3050
3050
  user_id: i.string()
3051
3051
  }).catchall(i.any());
3052
- const os = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
3053
- let ds = (t = 21) => {
3052
+ const ss = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
3053
+ let is = (t = 21) => {
3054
3054
  let e = "", n = crypto.getRandomValues(new Uint8Array(t));
3055
3055
  for (; t--; )
3056
- e += os[n[t] & 63];
3056
+ e += ss[n[t] & 63];
3057
3057
  return e;
3058
3058
  };
3059
- const cs = i.object({
3059
+ const os = i.object({
3060
3060
  audience: i.string().optional(),
3061
3061
  recipient: i.string().optional(),
3062
3062
  createUpnClaim: i.boolean().optional(),
@@ -3073,7 +3073,7 @@ const cs = i.object({
3073
3073
  nameIdentifierProbes: i.array(i.string()).optional(),
3074
3074
  authnContextClassRef: i.string().optional(),
3075
3075
  mappings: i.record(i.string()).optional()
3076
- }), ls = i.object({
3076
+ }), ds = i.object({
3077
3077
  id: i.string(),
3078
3078
  name: i.string(),
3079
3079
  callbacks: i.array(i.string()).default([]).optional().openapi({
@@ -3092,36 +3092,36 @@ const cs = i.object({
3092
3092
  description: "Ids of clients that will be allowed to perform delegation requests. Clients that will be allowed to make delegation request. By default, all your clients will be allowed. This field allows you to specify specific clients"
3093
3093
  }),
3094
3094
  addons: i.object({
3095
- samlp: cs.optional()
3095
+ samlp: os.optional()
3096
3096
  }).default({}).optional().openapi({
3097
3097
  description: "Addons associated with the client. The key is the addon's package name and the value is an object with the configuration for the addon."
3098
3098
  }),
3099
3099
  email_validation: i.enum(["enabled", "disabled", "enforced"]).default("enforced").optional().openapi({
3100
3100
  description: "Defines if it possible to sign in with an unverified email and if verification emails will be sent. This is not available in auth0"
3101
3101
  }),
3102
- client_secret: i.string().default(() => ds()).optional(),
3102
+ client_secret: i.string().default(() => is()).optional(),
3103
3103
  disable_sign_ups: i.boolean().optional().default(!1).openapi({
3104
3104
  description: "Prevents users from signing up using the hosted login page. This is not available in auth0"
3105
3105
  })
3106
- }), us = i.object({
3106
+ }), cs = i.object({
3107
3107
  created_at: i.string().transform((t) => t === null ? "" : t),
3108
3108
  updated_at: i.string().transform((t) => t === null ? "" : t),
3109
- ...ls.shape
3109
+ ...ds.shape
3110
3110
  });
3111
- var ua = /* @__PURE__ */ ((t) => (t.TOKEN = "token", t.TOKEN_ID_TOKEN = "token id_token", t.CODE = "code", t))(ua || {}), ha = /* @__PURE__ */ ((t) => (t.QUERY = "query", t.FRAGMENT = "fragment", t.FORM_POST = "form_post", t.WEB_MESSAGE = "web_message", t.SAML_POST = "saml_post", t))(ha || {}), pa = /* @__PURE__ */ ((t) => (t.S265 = "S256", t.plain = "plain", t))(pa || {});
3112
- const hs = i.object({
3111
+ var la = /* @__PURE__ */ ((t) => (t.TOKEN = "token", t.TOKEN_ID_TOKEN = "token id_token", t.CODE = "code", t))(la || {}), ua = /* @__PURE__ */ ((t) => (t.QUERY = "query", t.FRAGMENT = "fragment", t.FORM_POST = "form_post", t.WEB_MESSAGE = "web_message", t.SAML_POST = "saml_post", t))(ua || {}), ha = /* @__PURE__ */ ((t) => (t.S265 = "S256", t.plain = "plain", t))(ha || {});
3112
+ const ls = i.object({
3113
3113
  client_id: i.string(),
3114
3114
  vendor_id: i.string().optional(),
3115
3115
  act_as: i.string().optional(),
3116
- response_type: i.nativeEnum(ua).optional(),
3117
- response_mode: i.nativeEnum(ha).optional(),
3116
+ response_type: i.nativeEnum(la).optional(),
3117
+ response_mode: i.nativeEnum(ua).optional(),
3118
3118
  redirect_uri: i.string().optional(),
3119
3119
  audience: i.string().optional(),
3120
3120
  state: i.string().optional(),
3121
3121
  nonce: i.string().optional(),
3122
3122
  scope: i.string().optional(),
3123
3123
  prompt: i.string().optional(),
3124
- code_challenge_method: i.nativeEnum(pa).optional(),
3124
+ code_challenge_method: i.nativeEnum(ha).optional(),
3125
3125
  code_challenge: i.string().optional(),
3126
3126
  username: i.string().optional(),
3127
3127
  ui_locales: i.string().optional()
@@ -3142,7 +3142,7 @@ i.object({
3142
3142
  url: i.string()
3143
3143
  }).optional()
3144
3144
  });
3145
- const ps = i.object({
3145
+ const us = i.object({
3146
3146
  id: i.string().optional(),
3147
3147
  name: i.string(),
3148
3148
  strategy: i.enum([
@@ -3178,11 +3178,11 @@ const ps = i.object({
3178
3178
  enabled_clients: i.array(i.string()).default([]).optional(),
3179
3179
  response_type: i.custom().optional(),
3180
3180
  response_mode: i.custom().optional()
3181
- }), ma = i.object({
3181
+ }), pa = i.object({
3182
3182
  id: i.string(),
3183
3183
  created_at: i.string().transform((t) => t === null ? "" : t),
3184
3184
  updated_at: i.string().transform((t) => t === null ? "" : t)
3185
- }).extend(ps.shape), ms = i.object({
3185
+ }).extend(us.shape), hs = i.object({
3186
3186
  name: i.string(),
3187
3187
  audience: i.string(),
3188
3188
  sender_email: i.string().email(),
@@ -3192,11 +3192,11 @@ const ps = i.object({
3192
3192
  primary_color: i.string().optional(),
3193
3193
  secondary_color: i.string().optional(),
3194
3194
  language: i.string().optional()
3195
- }), fs = i.object({
3195
+ }), ps = i.object({
3196
3196
  created_at: i.string().transform((t) => t === null ? "" : t),
3197
3197
  updated_at: i.string().transform((t) => t === null ? "" : t),
3198
3198
  id: i.string(),
3199
- ...ms.shape
3199
+ ...hs.shape
3200
3200
  });
3201
3201
  i.object({
3202
3202
  logoUrl: i.string(),
@@ -3216,7 +3216,7 @@ i.object({
3216
3216
  siteUrl: i.string().nullable(),
3217
3217
  manageSubscriptionsUrl: i.string().optional()
3218
3218
  });
3219
- const _s = i.object({
3219
+ const ms = i.object({
3220
3220
  domain: i.string(),
3221
3221
  dkim_private_key: i.string().optional(),
3222
3222
  dkim_public_key: i.string().optional(),
@@ -3224,19 +3224,19 @@ const _s = i.object({
3224
3224
  email_service: i.union([i.literal("mailgun"), i.literal("mailchannels")]).optional()
3225
3225
  });
3226
3226
  i.object({
3227
- ...us.shape,
3228
- domains: i.array(_s),
3229
- tenant: fs,
3230
- connections: i.array(ma)
3227
+ ...cs.shape,
3228
+ domains: i.array(ms),
3229
+ tenant: ps,
3230
+ connections: i.array(pa)
3231
3231
  });
3232
- const gs = i.enum([
3232
+ const fs = i.enum([
3233
3233
  "password_reset",
3234
3234
  "email_verification",
3235
3235
  "otp",
3236
3236
  "authorization_code",
3237
3237
  "oauth2_state",
3238
3238
  "ticket"
3239
- ]), ys = i.object({
3239
+ ]), _s = i.object({
3240
3240
  code_id: i.string().openapi({
3241
3241
  description: "The code that will be used in for instance an email verification flow"
3242
3242
  }),
@@ -3246,15 +3246,14 @@ const gs = i.enum([
3246
3246
  connection_id: i.string().optional().openapi({
3247
3247
  description: "The connection that the code is connected to"
3248
3248
  }),
3249
- code_type: gs,
3250
- code_verifier: i.string().optional(),
3249
+ code_type: fs,
3251
3250
  expires_at: i.string(),
3252
3251
  used_at: i.string().optional(),
3253
3252
  user_id: i.string().optional()
3254
- }), vs = i.object({
3255
- ...ys.shape,
3253
+ }), gs = i.object({
3254
+ ..._s.shape,
3256
3255
  created_at: i.string()
3257
- }), bs = i.object({
3256
+ }), ys = i.object({
3258
3257
  domain: i.string(),
3259
3258
  dkim_private_key: i.string().optional(),
3260
3259
  dkim_public_key: i.string().optional(),
@@ -3262,10 +3261,10 @@ const gs = i.enum([
3262
3261
  email_service: i.enum(["mailgun", "mailchannels"])
3263
3262
  });
3264
3263
  Un.extend({
3265
- ...bs.shape,
3264
+ ...ys.shape,
3266
3265
  id: i.string()
3267
3266
  });
3268
- const ws = i.object({
3267
+ const vs = i.object({
3269
3268
  trigger_id: i.enum([
3270
3269
  "pre-user-signup",
3271
3270
  "post-user-registration",
@@ -3277,11 +3276,11 @@ const ws = i.object({
3277
3276
  synchronous: i.boolean().default(!1),
3278
3277
  priority: i.number().optional()
3279
3278
  });
3280
- ws.extend({
3279
+ vs.extend({
3281
3280
  ...Un.shape,
3282
3281
  hook_id: i.string()
3283
3282
  });
3284
- const xs = i.object({
3283
+ const bs = i.object({
3285
3284
  alg: i.enum([
3286
3285
  "RS256",
3287
3286
  "RS384",
@@ -3302,7 +3301,7 @@ const xs = i.object({
3302
3301
  use: i.enum(["sig", "enc"]).optional()
3303
3302
  });
3304
3303
  i.object({
3305
- keys: i.array(xs)
3304
+ keys: i.array(bs)
3306
3305
  });
3307
3306
  i.object({
3308
3307
  issuer: i.string(),
@@ -3326,23 +3325,23 @@ i.object({
3326
3325
  request_parameter_supported: i.boolean(),
3327
3326
  token_endpoint_auth_signing_alg_values_supported: i.array(i.string())
3328
3327
  });
3329
- const Ns = i.object({
3328
+ const ws = i.object({
3330
3329
  auth0Client: i.string().optional(),
3331
- authParams: hs,
3330
+ authParams: ls,
3332
3331
  expires_at: i.string(),
3333
3332
  deleted_at: i.string().optional(),
3334
3333
  ip: i.string().optional(),
3335
3334
  useragent: i.string().optional()
3336
3335
  }).openapi({
3337
3336
  description: "This represents a login sesion"
3338
- }), ks = i.object({
3339
- ...Ns.shape,
3337
+ }), xs = i.object({
3338
+ ...ws.shape,
3340
3339
  login_id: i.string().openapi({
3341
3340
  description: "This is is used as the state in the universal login"
3342
3341
  }),
3343
3342
  created_at: i.string(),
3344
3343
  updated_at: i.string()
3345
- }), Cs = i.enum([
3344
+ }), Ns = i.enum([
3346
3345
  "cls",
3347
3346
  // CODE_LINK_SENT
3348
3347
  "fsa",
@@ -3391,7 +3390,7 @@ const Ns = i.object({
3391
3390
  // SUCCESS_VERIFICATION_EMAIL
3392
3391
  "svr"
3393
3392
  // SUCCESS_VERIFICATION_EMAIL_REQUEST
3394
- ]), Ts = i.object({
3393
+ ]), ks = i.object({
3395
3394
  name: i.string(),
3396
3395
  version: i.string(),
3397
3396
  env: i.object({
@@ -3399,7 +3398,7 @@ const Ns = i.object({
3399
3398
  }).optional()
3400
3399
  });
3401
3400
  i.object({
3402
- type: Cs,
3401
+ type: Ns,
3403
3402
  date: i.string(),
3404
3403
  description: i.string().optional(),
3405
3404
  log_id: i.string().optional(),
@@ -3420,19 +3419,19 @@ i.object({
3420
3419
  strategy: i.string().optional(),
3421
3420
  strategy_type: i.string().optional(),
3422
3421
  hostname: i.string().optional(),
3423
- auth0_client: Ts.optional()
3422
+ auth0_client: ks.optional()
3424
3423
  });
3425
- const Os = i.object({
3424
+ const Cs = i.object({
3426
3425
  user_id: i.string(),
3427
3426
  password: i.string(),
3428
3427
  algorithm: i.enum(["bcrypt", "argon2id"]).default("argon2id")
3429
3428
  });
3430
3429
  i.object({
3431
- ...Os.shape,
3430
+ ...Cs.shape,
3432
3431
  created_at: i.string(),
3433
3432
  updated_at: i.string()
3434
3433
  });
3435
- const Ss = i.object({
3434
+ const Ts = i.object({
3436
3435
  session_id: i.string(),
3437
3436
  client_id: i.string(),
3438
3437
  expires_at: i.string(),
@@ -3442,7 +3441,7 @@ const Ss = i.object({
3442
3441
  });
3443
3442
  i.object({
3444
3443
  created_at: i.string(),
3445
- ...Ss.shape
3444
+ ...Ts.shape
3446
3445
  });
3447
3446
  i.object({
3448
3447
  kid: i.string().openapi({ description: "The key id of the signing key" }),
@@ -3464,37 +3463,6 @@ i.object({
3464
3463
  revoked: i.boolean().optional().openapi({ description: "True if the key is revoked" }),
3465
3464
  revoked_at: i.string().optional().openapi({ description: "The date and time when the key was revoked" })
3466
3465
  });
3467
- var fa = /* @__PURE__ */ ((t) => (t.RefreshToken = "refresh_token", t.AuthorizationCode = "authorization_code", t.ClientCredential = "client_credentials", t.Passwordless = "passwordless", t.Password = "password", t))(fa || {});
3468
- const Fn = i.nativeEnum(fa);
3469
- i.object({
3470
- grant_type: Fn.refine(
3471
- (t) => t === "authorization_code"
3472
- /* AuthorizationCode */
3473
- ),
3474
- code: i.string(),
3475
- client_secret: i.string(),
3476
- client_id: i.string()
3477
- });
3478
- i.object({
3479
- grant_type: Fn.refine(
3480
- (t) => t === "authorization_code"
3481
- /* AuthorizationCode */
3482
- ),
3483
- code: i.string(),
3484
- code_verifier: i.string(),
3485
- client_id: i.string().optional(),
3486
- redirect_uri: i.string()
3487
- });
3488
- i.object({
3489
- grant_type: Fn.refine(
3490
- (t) => t === "client_credentials"
3491
- /* ClientCredential */
3492
- ),
3493
- scope: i.string().optional(),
3494
- client_secret: i.string(),
3495
- client_id: i.string(),
3496
- audience: i.string().optional()
3497
- });
3498
3466
  i.object({
3499
3467
  access_token: i.string(),
3500
3468
  id_token: i.string().optional(),
@@ -3508,7 +3476,7 @@ i.object({
3508
3476
  code: i.string(),
3509
3477
  state: i.string().optional()
3510
3478
  });
3511
- const js = i.object({
3479
+ const Os = i.object({
3512
3480
  button_border_radius: i.number(),
3513
3481
  button_border_weight: i.number(),
3514
3482
  buttons_style: i.enum(["pill"]),
@@ -3518,7 +3486,7 @@ const js = i.object({
3518
3486
  show_widget_shadow: i.boolean(),
3519
3487
  widget_border_weight: i.number(),
3520
3488
  widget_corner_radius: i.number()
3521
- }), Is = i.object({
3489
+ }), Ss = i.object({
3522
3490
  base_focus_color: i.string(),
3523
3491
  base_hover_color: i.string(),
3524
3492
  body_text: i.string(),
@@ -3541,7 +3509,7 @@ const js = i.object({
3541
3509
  }), Qe = i.object({
3542
3510
  bold: i.boolean(),
3543
3511
  size: i.number()
3544
- }), Zs = i.object({
3512
+ }), js = i.object({
3545
3513
  body_text: Qe,
3546
3514
  buttons_text: Qe,
3547
3515
  font_url: i.string(),
@@ -3551,28 +3519,28 @@ const js = i.object({
3551
3519
  reference_text_size: i.number(),
3552
3520
  subtitle: Qe,
3553
3521
  title: Qe
3554
- }), Es = i.object({
3522
+ }), Is = i.object({
3555
3523
  background_color: i.string(),
3556
3524
  background_image_url: i.string(),
3557
3525
  page_layout: i.enum(["center"])
3558
- }), $s = i.object({
3526
+ }), Zs = i.object({
3559
3527
  header_text_alignment: i.enum(["center"]),
3560
3528
  logo_height: i.number(),
3561
3529
  logo_position: i.enum(["center"]),
3562
3530
  logo_url: i.string(),
3563
3531
  social_buttons_layout: i.enum(["bottom"])
3564
- }), Ps = i.object({
3565
- borders: js,
3566
- colors: Is,
3532
+ }), Es = i.object({
3533
+ borders: Os,
3534
+ colors: Ss,
3567
3535
  displayName: i.string(),
3568
- fonts: Zs,
3569
- page_background: Es,
3570
- widget: $s
3536
+ fonts: js,
3537
+ page_background: Is,
3538
+ widget: Zs
3571
3539
  });
3572
- Ps.extend({
3540
+ Es.extend({
3573
3541
  themeId: i.string()
3574
3542
  });
3575
- const As = i.object({
3543
+ const $s = i.object({
3576
3544
  universal_login_experience: i.enum(["new", "classic"]).default("new"),
3577
3545
  identifier_first: i.boolean().default(!0),
3578
3546
  password_first: i.boolean().default(!1),
@@ -3609,13 +3577,13 @@ i.object({
3609
3577
  ]),
3610
3578
  settings: i.object({}).optional()
3611
3579
  });
3612
- function Vn(t) {
3580
+ function Fn(t) {
3613
3581
  const [e, n] = t.split("|");
3614
3582
  if (!e || !n)
3615
3583
  throw new Error(`Invalid user_id: ${t}`);
3616
3584
  return { connection: e, id: n };
3617
3585
  }
3618
- function _a(t) {
3586
+ function ma(t) {
3619
3587
  let e = {};
3620
3588
  try {
3621
3589
  e = JSON.parse(t.profileData || "{}");
@@ -3625,7 +3593,7 @@ function _a(t) {
3625
3593
  return {
3626
3594
  connection: t.connection,
3627
3595
  provider: t.provider,
3628
- user_id: Vn(t.user_id).id,
3596
+ user_id: Fn(t.user_id).id,
3629
3597
  isSocial: !!t.is_social,
3630
3598
  profileData: {
3631
3599
  email: t.email,
@@ -3634,7 +3602,7 @@ function _a(t) {
3634
3602
  }
3635
3603
  };
3636
3604
  }
3637
- function Ds(t) {
3605
+ function Ps(t) {
3638
3606
  return async (e, n) => {
3639
3607
  const [a, r] = await Promise.all([
3640
3608
  t.selectFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", n).selectAll().executeTakeFirst(),
@@ -3653,19 +3621,19 @@ function Ds(t) {
3653
3621
  {
3654
3622
  connection: a.connection,
3655
3623
  provider: a.provider,
3656
- user_id: Vn(a.user_id).id,
3624
+ user_id: Fn(a.user_id).id,
3657
3625
  isSocial: !!a.is_social
3658
3626
  },
3659
- ...r.map(_a)
3627
+ ...r.map(ma)
3660
3628
  ]
3661
3629
  };
3662
- return M(d);
3630
+ return R(d);
3663
3631
  };
3664
3632
  }
3665
3633
  function Be(t, e, n, a) {
3666
3634
  return n.split(/\s+/).map((s) => s.replace(/^([^:]+)=/g, "$1:")).map((s) => {
3667
3635
  let o = s.startsWith("-"), d, c, l, u;
3668
- return s.startsWith("-_exists_:") ? (d = s.substring(10), l = !0, o = !0) : s.startsWith("_exists_:") ? (d = s.substring(9), l = !0, o = !1) : s.includes(":") ? (o = s.startsWith("-"), [d, c] = o ? s.substring(1).split(":") : s.split(":"), l = !1, c.startsWith(">=") ? (u = ">=", c = c.substring(2)) : c.startsWith(">") ? (u = ">", c = c.substring(1)) : c.startsWith("<=") ? (console.log("value", c), u = "<=", c = c.substring(2)) : c.startsWith("<") ? (u = "<", c = c.substring(1)) : u = "=") : (d = null, c = s, l = !1), { key: d, value: c, isNegation: o, isExistsQuery: l, operator: u };
3636
+ return s.startsWith("-_exists_:") ? (d = s.substring(10), l = !0, o = !0) : s.startsWith("_exists_:") ? (d = s.substring(9), l = !0, o = !1) : s.includes(":") ? (o = s.startsWith("-"), [d, c] = o ? s.substring(1).split(":") : s.split(":"), l = !1, c.startsWith(">=") ? (u = ">=", c = c.substring(2)) : c.startsWith(">") ? (u = ">", c = c.substring(1)) : c.startsWith("<=") ? (u = "<=", c = c.substring(2)) : c.startsWith("<") ? (u = "<", c = c.substring(1)) : u = "=") : (d = null, c = s, l = !1), { key: d, value: c, isNegation: o, isExistsQuery: l, operator: u };
3669
3637
  }).forEach(({ key: s, value: o, isNegation: d, isExistsQuery: c, operator: l }) => {
3670
3638
  if (s)
3671
3639
  if (c)
@@ -3693,7 +3661,7 @@ function Be(t, e, n, a) {
3693
3661
  const { ref: u } = t.dynamic;
3694
3662
  e = e.where(
3695
3663
  (Z) => Z.or(
3696
- a.map((R) => Z(u(R), "like", `%${o}%`))
3664
+ a.map((M) => Z(u(M), "like", `%${o}%`))
3697
3665
  )
3698
3666
  );
3699
3667
  }
@@ -3702,7 +3670,7 @@ function Be(t, e, n, a) {
3702
3670
  function Ee(t) {
3703
3671
  return typeof t == "string" ? parseInt(t, 10) : typeof t == "bigint" ? Number(t) : t;
3704
3672
  }
3705
- function Rs(t) {
3673
+ function As(t) {
3706
3674
  return async (e, n) => {
3707
3675
  let a = t.selectFrom("users").where("users.tenant_id", "=", e);
3708
3676
  if (n.q && (a = Be(t, a, n.q, ["email", "name"])), n.sort && n.sort.sort_by) {
@@ -3711,9 +3679,9 @@ function Rs(t) {
3711
3679
  }
3712
3680
  const s = await a.offset(n.page * n.per_page).limit(n.per_page).selectAll().execute(), o = s.map((u) => u.user_id), d = o.length ? await t.selectFrom("users").selectAll().where("users.tenant_id", "=", e).where("users.linked_to", "in", o).execute() : [], c = s.map((u) => {
3713
3681
  const Z = d.filter(
3714
- (R) => R.linked_to === u.user_id
3682
+ (M) => M.linked_to === u.user_id
3715
3683
  );
3716
- return M({
3684
+ return R({
3717
3685
  ...u,
3718
3686
  email_verified: u.email_verified === 1,
3719
3687
  is_social: u.is_social === 1,
@@ -3723,10 +3691,10 @@ function Rs(t) {
3723
3691
  {
3724
3692
  connection: u.connection,
3725
3693
  provider: u.provider,
3726
- user_id: Vn(u.user_id).id,
3694
+ user_id: Fn(u.user_id).id,
3727
3695
  isSocial: !!u.is_social
3728
3696
  },
3729
- ...Z.map(_a)
3697
+ ...Z.map(ma)
3730
3698
  ]
3731
3699
  });
3732
3700
  }), { count: l } = await a.select((u) => u.fn.countAll().as("count")).executeTakeFirstOrThrow();
@@ -3738,48 +3706,48 @@ function Rs(t) {
3738
3706
  };
3739
3707
  };
3740
3708
  }
3741
- function Ms(t) {
3709
+ function Ds(t) {
3742
3710
  return async (e, n) => (await t.deleteFrom("users").where("users.tenant_id", "=", e).where("users.linked_to", "=", n).execute(), (await t.deleteFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", n).execute()).length === 1);
3743
3711
  }
3744
- function Ls(t) {
3712
+ function Ms(t) {
3745
3713
  if (t.email_verified !== void 0)
3746
3714
  return t.email_verified ? 1 : 0;
3747
3715
  }
3748
- function zs(t) {
3716
+ function Rs(t) {
3749
3717
  return async (e, n, a) => {
3750
3718
  const r = {
3751
3719
  ...a,
3752
- email_verified: Ls(a),
3720
+ email_verified: Ms(a),
3753
3721
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
3754
3722
  };
3755
3723
  return a.app_metadata && (r.app_metadata = JSON.stringify(a.app_metadata)), a.user_metadata && (r.user_metadata = JSON.stringify(a.user_metadata)), (await t.updateTable("users").set(r).where("users.tenant_id", "=", e).where("users.user_id", "=", n).execute()).length === 1;
3756
3724
  };
3757
3725
  }
3758
- function Us(t) {
3726
+ function Ls(t) {
3759
3727
  return async (e, n, a, r) => {
3760
3728
  const s = { linked_to: null };
3761
3729
  return (await t.updateTable("users").set(s).where("users.tenant_id", "=", e).where("users.user_id", "=", `${a}|${r}`).where("users.linked_to", "=", `${n}`).execute()).length === 1;
3762
3730
  };
3763
3731
  }
3764
- function Fs(t) {
3732
+ function zs(t) {
3765
3733
  return {
3766
- create: Ya(t),
3767
- remove: Ms(t),
3768
- get: Ds(t),
3769
- list: Rs(t),
3770
- update: zs(t),
3734
+ create: Ga(t),
3735
+ remove: Ds(t),
3736
+ get: Ps(t),
3737
+ list: As(t),
3738
+ update: Rs(t),
3771
3739
  // TODO - think about this more when other issues fixed
3772
- unlink: Us(t)
3740
+ unlink: Ls(t)
3773
3741
  };
3774
3742
  }
3775
- const Vs = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
3743
+ const Us = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
3776
3744
  let Ke = (t = 21) => {
3777
3745
  let e = "", n = crypto.getRandomValues(new Uint8Array(t));
3778
3746
  for (; t--; )
3779
- e += Vs[n[t] & 63];
3747
+ e += Us[n[t] & 63];
3780
3748
  return e;
3781
3749
  };
3782
- function Bs(t) {
3750
+ function Fs(t) {
3783
3751
  return async (e) => {
3784
3752
  const n = {
3785
3753
  id: e.id || Ke(),
@@ -3790,13 +3758,13 @@ function Bs(t) {
3790
3758
  return await t.insertInto("tenants").values(n).execute(), n;
3791
3759
  };
3792
3760
  }
3793
- function Ks(t) {
3761
+ function Vs(t) {
3794
3762
  return async (e) => {
3795
3763
  const n = await t.selectFrom("tenants").where("tenants.id", "=", e).selectAll().executeTakeFirst();
3796
- return n ? M(n) : null;
3764
+ return n ? R(n) : null;
3797
3765
  };
3798
3766
  }
3799
- function Js(t) {
3767
+ function Bs(t) {
3800
3768
  return async (e) => {
3801
3769
  let n = t.selectFrom("tenants");
3802
3770
  if (e.sort && e.sort.sort_by) {
@@ -3811,14 +3779,14 @@ function Js(t) {
3811
3779
  };
3812
3780
  const { count: s } = await n.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), o = Ee(s);
3813
3781
  return {
3814
- tenants: r.map(M),
3782
+ tenants: r.map(R),
3815
3783
  start: (e.page - 1) * e.per_page,
3816
3784
  limit: e.per_page,
3817
3785
  length: o
3818
3786
  };
3819
3787
  };
3820
3788
  }
3821
- function Ws(t) {
3789
+ function Ks(t) {
3822
3790
  return async (e, n) => {
3823
3791
  const a = {
3824
3792
  ...n,
@@ -3828,29 +3796,29 @@ function Ws(t) {
3828
3796
  await t.updateTable("tenants").set(a).where("id", "=", e).execute();
3829
3797
  };
3830
3798
  }
3831
- function qs(t) {
3799
+ function Js(t) {
3832
3800
  return async (e) => (await t.deleteFrom("tenants").where("tenants.id", "=", e).execute()).length === 1;
3833
3801
  }
3834
- function Qs(t) {
3802
+ function Ws(t) {
3835
3803
  return {
3836
- create: Bs(t),
3837
- get: Ks(t),
3838
- list: Js(t),
3839
- update: Ws(t),
3840
- remove: qs(t)
3804
+ create: Fs(t),
3805
+ get: Vs(t),
3806
+ list: Bs(t),
3807
+ update: Ks(t),
3808
+ remove: Js(t)
3841
3809
  };
3842
3810
  }
3843
- function qn(t) {
3811
+ function Wn(t) {
3844
3812
  return t ? JSON.stringify(t) : void 0;
3845
3813
  }
3846
- const Gs = 1024;
3847
- function Hs(t) {
3814
+ const qs = 1024;
3815
+ function Qs(t) {
3848
3816
  return async (e, n) => {
3849
3817
  var r, s, o;
3850
3818
  const a = {
3851
3819
  id: Ke(),
3852
3820
  ...n,
3853
- user_agent: n.user_agent.slice(0, Gs)
3821
+ user_agent: n.user_agent.slice(0, qs)
3854
3822
  };
3855
3823
  return await t.insertInto("logs").values({
3856
3824
  ...a,
@@ -3859,12 +3827,12 @@ function Hs(t) {
3859
3827
  isMobile: n.isMobile ? 1 : 0,
3860
3828
  tenant_id: e,
3861
3829
  scope: (s = n.scope) == null ? void 0 : s.join(","),
3862
- auth0_client: qn(n.auth0_client),
3863
- details: (o = qn(n.details)) == null ? void 0 : o.substring(0, 8192)
3830
+ auth0_client: Wn(n.auth0_client),
3831
+ details: (o = Wn(n.details)) == null ? void 0 : o.substring(0, 8192)
3864
3832
  }).execute(), a;
3865
3833
  };
3866
3834
  }
3867
- function Qn(t) {
3835
+ function qn(t) {
3868
3836
  if (!t)
3869
3837
  return "";
3870
3838
  try {
@@ -3873,20 +3841,20 @@ function Qn(t) {
3873
3841
  return t;
3874
3842
  }
3875
3843
  }
3876
- function ga(t) {
3844
+ function fa(t) {
3877
3845
  return {
3878
3846
  ...t,
3879
3847
  client_id: t.client_id,
3880
3848
  client_name: "",
3881
- auth0_client: Qn(t.auth0_client),
3882
- details: Qn(t.details),
3849
+ auth0_client: qn(t.auth0_client),
3850
+ details: qn(t.details),
3883
3851
  isMobile: !!t.isMobile,
3884
3852
  scope: t.scope ? t.scope.split(",") : void 0,
3885
3853
  log_id: t.id,
3886
3854
  _id: t.id
3887
3855
  };
3888
3856
  }
3889
- function Ys(t) {
3857
+ function Gs(t) {
3890
3858
  return async (e, n) => {
3891
3859
  let a = t.selectFrom("logs").where("logs.tenant_id", "=", e);
3892
3860
  n.q && (a = Be(t, a, n.q, ["user_id", "ip"]));
@@ -3901,30 +3869,30 @@ function Ys(t) {
3901
3869
  r = r.offset(n.page * n.per_page).limit(n.per_page);
3902
3870
  const s = await r.selectAll().execute(), { count: o } = await a.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
3903
3871
  return {
3904
- logs: s.map(ga),
3872
+ logs: s.map(fa),
3905
3873
  start: n.page * n.per_page,
3906
3874
  limit: n.per_page,
3907
3875
  length: Ee(o)
3908
3876
  };
3909
3877
  };
3910
3878
  }
3911
- function Xs(t) {
3879
+ function Hs(t) {
3912
3880
  return async (e, n) => {
3913
3881
  const a = await t.selectFrom("logs").where("logs.tenant_id", "=", e).where("logs.id", "=", n).selectAll().executeTakeFirst();
3914
- return a ? ga(a) : null;
3882
+ return a ? fa(a) : null;
3915
3883
  };
3916
3884
  }
3917
- function ei(t) {
3885
+ function Ys(t) {
3918
3886
  return {
3919
- create: Hs(t),
3920
- list: Ys(t),
3921
- get: Xs(t)
3887
+ create: Qs(t),
3888
+ list: Gs(t),
3889
+ get: Hs(t)
3922
3890
  };
3923
3891
  }
3924
- function ti(t) {
3892
+ function Xs(t) {
3925
3893
  return async (e, n) => await t.selectFrom("sessions").where("sessions.tenant_id", "=", e).where("sessions.session_id", "=", n).where("sessions.deleted_at", "is", null).selectAll().executeTakeFirst() ?? null;
3926
3894
  }
3927
- function ni(t) {
3895
+ function ei(t) {
3928
3896
  return async (e, n) => {
3929
3897
  const a = {
3930
3898
  ...n,
@@ -3934,13 +3902,13 @@ function ni(t) {
3934
3902
  return await t.insertInto("sessions").values({ ...a, tenant_id: e }).execute(), { ...n, ...a };
3935
3903
  };
3936
3904
  }
3937
- function ai(t) {
3905
+ function ti(t) {
3938
3906
  return async (e, n) => !!(await t.updateTable("sessions").set({ deleted_at: (/* @__PURE__ */ new Date()).toISOString() }).where("tenant_id", "=", e).where("sessions.session_id", "=", n).where("sessions.deleted_at", "is", null).execute()).length;
3939
3907
  }
3940
- function ri(t) {
3908
+ function ni(t) {
3941
3909
  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;
3942
3910
  }
3943
- function si(t) {
3911
+ function ai(t) {
3944
3912
  return async (e, n) => {
3945
3913
  let a = t.selectFrom("sessions").where("sessions.tenant_id", "=", e);
3946
3914
  n.q && (a = Be(t, a, n.q, ["user_id", "session_id"]));
@@ -3962,22 +3930,22 @@ function si(t) {
3962
3930
  };
3963
3931
  };
3964
3932
  }
3965
- function ii(t) {
3933
+ function ri(t) {
3966
3934
  return {
3967
- create: ni(t),
3968
- get: ti(t),
3969
- list: si(t),
3970
- remove: ai(t),
3971
- update: ri(t)
3935
+ create: ei(t),
3936
+ get: Xs(t),
3937
+ list: ai(t),
3938
+ remove: ti(t),
3939
+ update: ni(t)
3972
3940
  };
3973
3941
  }
3974
- function oi(t) {
3942
+ function si(t) {
3975
3943
  return async (e, n) => {
3976
3944
  const a = await t.selectFrom("passwords").where("passwords.tenant_id", "=", e).where("passwords.user_id", "=", n).selectAll().executeTakeFirstOrThrow(), { tenant_id: r, ...s } = a;
3977
3945
  return s;
3978
3946
  };
3979
3947
  }
3980
- function di(t) {
3948
+ function ii(t) {
3981
3949
  return async (e, n) => {
3982
3950
  const a = {
3983
3951
  ...n,
@@ -3990,20 +3958,20 @@ function di(t) {
3990
3958
  }).execute(), a;
3991
3959
  };
3992
3960
  }
3993
- function ci(t) {
3961
+ function oi(t) {
3994
3962
  return async (e, n) => (await t.updateTable("passwords").set({
3995
3963
  password: n.password,
3996
3964
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
3997
3965
  }).where("tenant_id", "=", e).where("user_id", "=", n.user_id).execute()).length === 1;
3998
3966
  }
3999
- function li(t) {
3967
+ function di(t) {
4000
3968
  return {
4001
- create: di(t),
4002
- update: ci(t),
4003
- get: oi(t)
3969
+ create: ii(t),
3970
+ update: oi(t),
3971
+ get: si(t)
4004
3972
  };
4005
3973
  }
4006
- function ui(t) {
3974
+ function ci(t) {
4007
3975
  return async (e, n) => {
4008
3976
  let a = t.selectFrom("codes").where("codes.tenant_id", "=", e);
4009
3977
  n.q && (a = Be(t, a, n.q, ["code", "login_id"]));
@@ -4011,7 +3979,7 @@ function ui(t) {
4011
3979
  return {
4012
3980
  codes: s.map((c) => {
4013
3981
  const { tenant_id: l, ...u } = c;
4014
- return vs.parse(M(u));
3982
+ return gs.parse(R(u));
4015
3983
  }),
4016
3984
  start: n.page * n.per_page,
4017
3985
  limit: n.per_page,
@@ -4019,7 +3987,7 @@ function ui(t) {
4019
3987
  };
4020
3988
  };
4021
3989
  }
4022
- function hi(t) {
3990
+ function li(t) {
4023
3991
  return async (e, n) => {
4024
3992
  const a = {
4025
3993
  ...n,
@@ -4031,26 +3999,26 @@ function hi(t) {
4031
3999
  }).execute(), a;
4032
4000
  };
4033
4001
  }
4034
- function pi(t) {
4002
+ function ui(t) {
4035
4003
  return async (e, n) => (await t.deleteFrom("codes").where("codes.tenant_id", "=", e).where("codes.code_id", "=", n).executeTakeFirst()).numDeletedRows > 0;
4036
4004
  }
4037
- function mi(t) {
4005
+ function hi(t) {
4038
4006
  return async (e, n, a) => {
4039
- let r = t.selectFrom("codes").where("codes.code_id", "=", n).where("codes.code_type", "=", a).where("codes.expires_at", ">", (/* @__PURE__ */ new Date()).toISOString());
4007
+ let r = t.selectFrom("codes").where("codes.code_id", "=", n).where("codes.code_type", "=", a);
4040
4008
  e.length && (r = r.where("codes.tenant_id", "=", e));
4041
4009
  const s = await r.selectAll().executeTakeFirst();
4042
- return s ? M(s) : null;
4010
+ return s ? R(s) : null;
4043
4011
  };
4044
4012
  }
4045
- function fi(t) {
4013
+ function pi(t) {
4046
4014
  return {
4047
- create: hi(t),
4048
- list: ui(t),
4049
- remove: pi(t),
4050
- get: mi(t)
4015
+ create: li(t),
4016
+ list: ci(t),
4017
+ remove: ui(t),
4018
+ get: hi(t)
4051
4019
  };
4052
4020
  }
4053
- function _i(t) {
4021
+ function mi(t) {
4054
4022
  return async (e, n) => {
4055
4023
  const a = {
4056
4024
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
@@ -4070,7 +4038,7 @@ function _i(t) {
4070
4038
  }).execute(), a;
4071
4039
  };
4072
4040
  }
4073
- function gi(t) {
4041
+ function fi(t) {
4074
4042
  return async (e) => ({
4075
4043
  applications: (await t.selectFrom("applications").where("applications.tenant_id", "=", e).selectAll().execute()).map((s) => ({
4076
4044
  ...s,
@@ -4084,10 +4052,10 @@ function gi(t) {
4084
4052
  }))
4085
4053
  });
4086
4054
  }
4087
- function yi(t) {
4055
+ function _i(t) {
4088
4056
  return async (e, n) => {
4089
4057
  const a = await t.selectFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", n).selectAll().executeTakeFirst();
4090
- return a ? M({
4058
+ return a ? R({
4091
4059
  ...a,
4092
4060
  disable_sign_ups: !!a.disable_sign_ups,
4093
4061
  addons: JSON.parse(a.addons),
@@ -4098,10 +4066,10 @@ function yi(t) {
4098
4066
  }) : null;
4099
4067
  };
4100
4068
  }
4101
- function vi(t) {
4069
+ function gi(t) {
4102
4070
  return async (e, n) => (await t.deleteFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", n).executeTakeFirst()).numDeletedRows > 0;
4103
4071
  }
4104
- function bi(t) {
4072
+ function yi(t) {
4105
4073
  return async (e, n, a) => {
4106
4074
  const r = {
4107
4075
  ...a,
@@ -4117,16 +4085,16 @@ function bi(t) {
4117
4085
  return await t.updateTable("applications").set(r).where("applications.id", "=", n).where("applications.tenant_id", "=", e).execute(), !0;
4118
4086
  };
4119
4087
  }
4120
- function wi(t) {
4088
+ function vi(t) {
4121
4089
  return {
4122
- create: _i(t),
4123
- list: gi(t),
4124
- get: yi(t),
4125
- remove: vi(t),
4126
- update: bi(t)
4090
+ create: mi(t),
4091
+ list: fi(t),
4092
+ get: _i(t),
4093
+ remove: gi(t),
4094
+ update: yi(t)
4127
4095
  };
4128
4096
  }
4129
- function xi(t) {
4097
+ function bi(t) {
4130
4098
  return async (e, n) => {
4131
4099
  const a = {
4132
4100
  id: Ke(),
@@ -4142,7 +4110,7 @@ function xi(t) {
4142
4110
  }).execute(), a;
4143
4111
  };
4144
4112
  }
4145
- function Ni(t, e) {
4113
+ function wi(t, e) {
4146
4114
  var n = {};
4147
4115
  for (var a in t) Object.prototype.hasOwnProperty.call(t, a) && e.indexOf(a) < 0 && (n[a] = t[a]);
4148
4116
  if (t != null && typeof Object.getOwnPropertySymbols == "function")
@@ -4150,7 +4118,7 @@ function Ni(t, e) {
4150
4118
  e.indexOf(a[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, a[r]) && (n[a[r]] = t[a[r]]);
4151
4119
  return n;
4152
4120
  }
4153
- function ki(t, e) {
4121
+ function xi(t, e) {
4154
4122
  var n;
4155
4123
  return ((n = t == null ? void 0 : t._def) === null || n === void 0 ? void 0 : n.typeName) === e;
4156
4124
  }
@@ -4161,15 +4129,15 @@ function mt(t, e) {
4161
4129
  return r._def.openapi = this._def.openapi, r;
4162
4130
  };
4163
4131
  }
4164
- function Ci(t) {
4132
+ function Ni(t) {
4165
4133
  if (typeof t.ZodType.prototype.openapi < "u")
4166
4134
  return;
4167
4135
  t.ZodType.prototype.openapi = function(r, s) {
4168
4136
  var o, d, c, l, u, Z;
4169
- const R = typeof r == "string" ? s : r, W = R ?? {}, { param: _e } = W, Je = Ni(W, ["param"]), ge = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), ye = Object.assign(Object.assign(Object.assign({}, (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata), Je), !((l = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata) === null || l === void 0) && l.param || _e ? {
4137
+ const M = typeof r == "string" ? s : r, W = M ?? {}, { param: _e } = W, Je = wi(W, ["param"]), ge = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), ye = Object.assign(Object.assign(Object.assign({}, (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata), Je), !((l = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata) === null || l === void 0) && l.param || _e ? {
4170
4138
  param: Object.assign(Object.assign({}, (Z = (u = this._def.openapi) === null || u === void 0 ? void 0 : u.metadata) === null || Z === void 0 ? void 0 : Z.param), _e)
4171
4139
  } : void 0), ve = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(ge).length > 0 ? { _internal: ge } : void 0), Object.keys(ye).length > 0 ? { metadata: ye } : void 0) }));
4172
- if (ki(this, "ZodObject")) {
4140
+ if (xi(this, "ZodObject")) {
4173
4141
  const We = this.extend;
4174
4142
  ve.extend = function(...qe) {
4175
4143
  var ee, te, ne, be, $e, Pe;
@@ -4307,7 +4275,7 @@ const y = $.arrayToEnum([
4307
4275
  "invalid_intersection_types",
4308
4276
  "not_multiple_of",
4309
4277
  "not_finite"
4310
- ]), Ti = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
4278
+ ]), ki = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
4311
4279
  class J extends Error {
4312
4280
  constructor(e) {
4313
4281
  super(), this.issues = [], this.addIssue = (a) => {
@@ -4424,12 +4392,12 @@ const dt = (t, e) => {
4424
4392
  }
4425
4393
  return { message: n };
4426
4394
  };
4427
- let ya = dt;
4428
- function Oi(t) {
4429
- ya = t;
4395
+ let _a = dt;
4396
+ function Ci(t) {
4397
+ _a = t;
4430
4398
  }
4431
4399
  function ln() {
4432
- return ya;
4400
+ return _a;
4433
4401
  }
4434
4402
  const un = (t) => {
4435
4403
  const { data: e, path: n, errorMaps: a, issueData: r } = t, s = [...n, ...r.path || []], o = {
@@ -4451,7 +4419,7 @@ const un = (t) => {
4451
4419
  path: s,
4452
4420
  message: d
4453
4421
  };
4454
- }, Si = [];
4422
+ }, Ti = [];
4455
4423
  function _(t, e) {
4456
4424
  const n = ln(), a = un({
4457
4425
  issueData: e,
@@ -4515,7 +4483,7 @@ function hn(t, e, n, a) {
4515
4483
  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");
4516
4484
  return e.get(t);
4517
4485
  }
4518
- function va(t, e, n, a, r) {
4486
+ function ga(t, e, n, a, r) {
4519
4487
  if (typeof e == "function" ? t !== e || !r : !e.has(t)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
4520
4488
  return e.set(t, n), n;
4521
4489
  }
@@ -4532,7 +4500,7 @@ class de {
4532
4500
  return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
4533
4501
  }
4534
4502
  }
4535
- const Gn = (t, e) => {
4503
+ const Qn = (t, e) => {
4536
4504
  if (At(e))
4537
4505
  return { success: !0, data: e.value };
4538
4506
  if (!t.common.issues.length)
@@ -4622,7 +4590,7 @@ class I {
4622
4590
  data: e,
4623
4591
  parsedType: Ne(e)
4624
4592
  }, s = this._parseSync({ data: e, path: r.path, parent: r });
4625
- return Gn(r, s);
4593
+ return Qn(r, s);
4626
4594
  }
4627
4595
  async parseAsync(e, n) {
4628
4596
  const a = await this.safeParseAsync(e, n);
@@ -4643,7 +4611,7 @@ class I {
4643
4611
  data: e,
4644
4612
  parsedType: Ne(e)
4645
4613
  }, r = this._parse({ data: e, path: a.path, parent: a }), s = await (Dt(r) ? r : Promise.resolve(r));
4646
- return Gn(a, s);
4614
+ return Qn(a, s);
4647
4615
  }
4648
4616
  refine(e, n) {
4649
4617
  const a = (r) => typeof n == "string" || typeof n > "u" ? { message: n } : typeof n == "function" ? n(r) : n;
@@ -4707,7 +4675,7 @@ class I {
4707
4675
  });
4708
4676
  }
4709
4677
  brand() {
4710
- return new Bn({
4678
+ return new Vn({
4711
4679
  typeName: N.ZodBranded,
4712
4680
  type: this,
4713
4681
  ...S(this._def)
@@ -4742,23 +4710,23 @@ class I {
4742
4710
  return this.safeParse(null).success;
4743
4711
  }
4744
4712
  }
4745
- const ji = /^c[^\s-]{8,}$/i, Ii = /^[0-9a-z]+$/, Zi = /^[0-9A-HJKMNP-TV-Z]{26}$/, Ei = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, $i = /^[a-z0-9_-]{21}$/i, Pi = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Ai = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Di = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
4713
+ const Oi = /^c[^\s-]{8,}$/i, Si = /^[0-9a-z]+$/, ji = /^[0-9A-HJKMNP-TV-Z]{26}$/, Ii = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Zi = /^[a-z0-9_-]{21}$/i, Ei = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, $i = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Pi = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
4746
4714
  let xn;
4747
- const Ri = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Mi = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, Li = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, ba = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", zi = new RegExp(`^${ba}$`);
4748
- function wa(t) {
4715
+ const Ai = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Di = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, Mi = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, ya = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Ri = new RegExp(`^${ya}$`);
4716
+ function va(t) {
4749
4717
  let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
4750
4718
  return t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`), e;
4751
4719
  }
4752
- function Ui(t) {
4753
- return new RegExp(`^${wa(t)}$`);
4720
+ function Li(t) {
4721
+ return new RegExp(`^${va(t)}$`);
4754
4722
  }
4755
- function xa(t) {
4756
- let e = `${ba}T${wa(t)}`;
4723
+ function ba(t) {
4724
+ let e = `${ya}T${va(t)}`;
4757
4725
  const n = [];
4758
4726
  return n.push(t.local ? "Z?" : "Z"), t.offset && n.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${n.join("|")})`, new RegExp(`^${e}$`);
4759
4727
  }
4760
- function Fi(t, e) {
4761
- return !!((e === "v4" || !e) && Ri.test(t) || (e === "v6" || !e) && Mi.test(t));
4728
+ function zi(t, e) {
4729
+ return !!((e === "v4" || !e) && Ai.test(t) || (e === "v6" || !e) && Di.test(t));
4762
4730
  }
4763
4731
  class Q extends I {
4764
4732
  _parse(e) {
@@ -4809,43 +4777,43 @@ class Q extends I {
4809
4777
  message: s.message
4810
4778
  }), a.dirty());
4811
4779
  } else if (s.kind === "email")
4812
- Ai.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4780
+ $i.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4813
4781
  validation: "email",
4814
4782
  code: p.invalid_string,
4815
4783
  message: s.message
4816
4784
  }), a.dirty());
4817
4785
  else if (s.kind === "emoji")
4818
- xn || (xn = new RegExp(Di, "u")), xn.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4786
+ xn || (xn = new RegExp(Pi, "u")), xn.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4819
4787
  validation: "emoji",
4820
4788
  code: p.invalid_string,
4821
4789
  message: s.message
4822
4790
  }), a.dirty());
4823
4791
  else if (s.kind === "uuid")
4824
- Ei.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4792
+ Ii.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4825
4793
  validation: "uuid",
4826
4794
  code: p.invalid_string,
4827
4795
  message: s.message
4828
4796
  }), a.dirty());
4829
4797
  else if (s.kind === "nanoid")
4830
- $i.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4798
+ Zi.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4831
4799
  validation: "nanoid",
4832
4800
  code: p.invalid_string,
4833
4801
  message: s.message
4834
4802
  }), a.dirty());
4835
4803
  else if (s.kind === "cuid")
4836
- ji.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4804
+ Oi.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4837
4805
  validation: "cuid",
4838
4806
  code: p.invalid_string,
4839
4807
  message: s.message
4840
4808
  }), a.dirty());
4841
4809
  else if (s.kind === "cuid2")
4842
- Ii.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4810
+ Si.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4843
4811
  validation: "cuid2",
4844
4812
  code: p.invalid_string,
4845
4813
  message: s.message
4846
4814
  }), a.dirty());
4847
4815
  else if (s.kind === "ulid")
4848
- Zi.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4816
+ ji.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4849
4817
  validation: "ulid",
4850
4818
  code: p.invalid_string,
4851
4819
  message: s.message
@@ -4876,27 +4844,27 @@ class Q extends I {
4876
4844
  code: p.invalid_string,
4877
4845
  validation: { endsWith: s.value },
4878
4846
  message: s.message
4879
- }), a.dirty()) : s.kind === "datetime" ? xa(s).test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4847
+ }), a.dirty()) : s.kind === "datetime" ? ba(s).test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4880
4848
  code: p.invalid_string,
4881
4849
  validation: "datetime",
4882
4850
  message: s.message
4883
- }), a.dirty()) : s.kind === "date" ? zi.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4851
+ }), a.dirty()) : s.kind === "date" ? Ri.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4884
4852
  code: p.invalid_string,
4885
4853
  validation: "date",
4886
4854
  message: s.message
4887
- }), a.dirty()) : s.kind === "time" ? Ui(s).test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4855
+ }), a.dirty()) : s.kind === "time" ? Li(s).test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4888
4856
  code: p.invalid_string,
4889
4857
  validation: "time",
4890
4858
  message: s.message
4891
- }), a.dirty()) : s.kind === "duration" ? Pi.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4859
+ }), a.dirty()) : s.kind === "duration" ? Ei.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4892
4860
  validation: "duration",
4893
4861
  code: p.invalid_string,
4894
4862
  message: s.message
4895
- }), a.dirty()) : s.kind === "ip" ? Fi(e.data, s.version) || (r = this._getOrReturnCtx(e, r), _(r, {
4863
+ }), a.dirty()) : s.kind === "ip" ? zi(e.data, s.version) || (r = this._getOrReturnCtx(e, r), _(r, {
4896
4864
  validation: "ip",
4897
4865
  code: p.invalid_string,
4898
4866
  message: s.message
4899
- }), a.dirty()) : s.kind === "base64" ? Li.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4867
+ }), a.dirty()) : s.kind === "base64" ? Mi.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4900
4868
  validation: "base64",
4901
4869
  code: p.invalid_string,
4902
4870
  message: s.message
@@ -5118,7 +5086,7 @@ Q.create = (t) => {
5118
5086
  ...S(t)
5119
5087
  });
5120
5088
  };
5121
- function Vi(t, e) {
5089
+ function Ui(t, e) {
5122
5090
  const n = (t.toString().split(".")[1] || "").length, a = (e.toString().split(".")[1] || "").length, r = n > a ? n : a, s = parseInt(t.toFixed(r).replace(".", "")), o = parseInt(e.toFixed(r).replace(".", ""));
5123
5091
  return s % o / Math.pow(10, r);
5124
5092
  }
@@ -5157,7 +5125,7 @@ class Se extends I {
5157
5125
  inclusive: s.inclusive,
5158
5126
  exact: !1,
5159
5127
  message: s.message
5160
- }), r.dirty()) : s.kind === "multipleOf" ? Vi(e.data, s.value) !== 0 && (a = this._getOrReturnCtx(e, a), _(a, {
5128
+ }), r.dirty()) : s.kind === "multipleOf" ? Ui(e.data, s.value) !== 0 && (a = this._getOrReturnCtx(e, a), _(a, {
5161
5129
  code: p.not_multiple_of,
5162
5130
  multipleOf: s.value,
5163
5131
  message: s.message
@@ -5422,7 +5390,7 @@ je.create = (t) => {
5422
5390
  ...S(t)
5423
5391
  });
5424
5392
  };
5425
- class Rt extends I {
5393
+ class Mt extends I {
5426
5394
  _parse(e) {
5427
5395
  if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== y.boolean) {
5428
5396
  const a = this._getOrReturnCtx(e);
@@ -5435,7 +5403,7 @@ class Rt extends I {
5435
5403
  return B(e.data);
5436
5404
  }
5437
5405
  }
5438
- Rt.create = (t) => new Rt({
5406
+ Mt.create = (t) => new Mt({
5439
5407
  typeName: N.ZodBoolean,
5440
5408
  coerce: (t == null ? void 0 : t.coerce) || !1,
5441
5409
  ...S(t)
@@ -5535,7 +5503,7 @@ pn.create = (t) => new pn({
5535
5503
  typeName: N.ZodSymbol,
5536
5504
  ...S(t)
5537
5505
  });
5538
- class Mt extends I {
5506
+ class Rt extends I {
5539
5507
  _parse(e) {
5540
5508
  if (this._getType(e) !== y.undefined) {
5541
5509
  const a = this._getOrReturnCtx(e);
@@ -5548,7 +5516,7 @@ class Mt extends I {
5548
5516
  return B(e.data);
5549
5517
  }
5550
5518
  }
5551
- Mt.create = (t) => new Mt({
5519
+ Rt.create = (t) => new Rt({
5552
5520
  typeName: N.ZodUndefined,
5553
5521
  ...S(t)
5554
5522
  });
@@ -5776,10 +5744,10 @@ class D extends I {
5776
5744
  return r.common.async ? Promise.resolve().then(async () => {
5777
5745
  const l = [];
5778
5746
  for (const u of c) {
5779
- const Z = await u.key, R = await u.value;
5747
+ const Z = await u.key, M = await u.value;
5780
5748
  l.push({
5781
5749
  key: Z,
5782
- value: R,
5750
+ value: M,
5783
5751
  alwaysSet: u.alwaysSet
5784
5752
  });
5785
5753
  }
@@ -5976,7 +5944,7 @@ class D extends I {
5976
5944
  });
5977
5945
  }
5978
5946
  keyof() {
5979
- return Na($.objectKeys(this.shape));
5947
+ return wa($.objectKeys(this.shape));
5980
5948
  }
5981
5949
  }
5982
5950
  D.create = (t, e) => new D({
@@ -6073,7 +6041,7 @@ zt.create = (t, e) => new zt({
6073
6041
  typeName: N.ZodUnion,
6074
6042
  ...S(e)
6075
6043
  });
6076
- 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 Mt ? [void 0] : t instanceof Lt ? [null] : t instanceof se ? [void 0, ...le(t.unwrap())] : t instanceof Ze ? [null, ...le(t.unwrap())] : t instanceof Bn || t instanceof qt ? le(t.unwrap()) : t instanceof Wt ? le(t._def.innerType) : [];
6044
+ 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) : [];
6077
6045
  class vn extends I {
6078
6046
  _parse(e) {
6079
6047
  const { ctx: n } = this._processInputParams(e);
@@ -6539,7 +6507,7 @@ Bt.create = (t, e) => new Bt({
6539
6507
  typeName: N.ZodLiteral,
6540
6508
  ...S(e)
6541
6509
  });
6542
- function Na(t, e) {
6510
+ function wa(t, e) {
6543
6511
  return new Ie({
6544
6512
  values: t,
6545
6513
  typeName: N.ZodEnum,
@@ -6559,7 +6527,7 @@ class Ie extends I {
6559
6527
  code: p.invalid_type
6560
6528
  }), k;
6561
6529
  }
6562
- if (hn(this, gt) || va(this, gt, new Set(this._def.values)), !hn(this, gt).has(e.data)) {
6530
+ if (hn(this, gt) || ga(this, gt, new Set(this._def.values)), !hn(this, gt).has(e.data)) {
6563
6531
  const n = this._getOrReturnCtx(e), a = this._def.values;
6564
6532
  return _(n, {
6565
6533
  received: n.data,
@@ -6604,7 +6572,7 @@ class Ie extends I {
6604
6572
  }
6605
6573
  }
6606
6574
  gt = /* @__PURE__ */ new WeakMap();
6607
- Ie.create = Na;
6575
+ Ie.create = wa;
6608
6576
  class Kt extends I {
6609
6577
  constructor() {
6610
6578
  super(...arguments), yt.set(this, void 0);
@@ -6619,7 +6587,7 @@ class Kt extends I {
6619
6587
  code: p.invalid_type
6620
6588
  }), k;
6621
6589
  }
6622
- if (hn(this, yt) || va(this, yt, new Set($.getValidEnumValues(this._def.values))), !hn(this, yt).has(e.data)) {
6590
+ if (hn(this, yt) || ga(this, yt, new Set($.getValidEnumValues(this._def.values))), !hn(this, yt).has(e.data)) {
6623
6591
  const r = $.objectValues(n);
6624
6592
  return _(a, {
6625
6593
  received: a.data,
@@ -6858,8 +6826,8 @@ _n.create = (t) => new _n({
6858
6826
  typeName: N.ZodNaN,
6859
6827
  ...S(t)
6860
6828
  });
6861
- const Bi = Symbol("zod_brand");
6862
- class Bn extends I {
6829
+ const Fi = Symbol("zod_brand");
6830
+ class Vn extends I {
6863
6831
  _parse(e) {
6864
6832
  const { ctx: n } = this._processInputParams(e), a = n.data;
6865
6833
  return this._def.type._parse({
@@ -6926,7 +6894,7 @@ qt.create = (t, e) => new qt({
6926
6894
  typeName: N.ZodReadonly,
6927
6895
  ...S(e)
6928
6896
  });
6929
- function ka(t, e = {}, n) {
6897
+ function xa(t, e = {}, n) {
6930
6898
  return t ? ct.create().superRefine((a, r) => {
6931
6899
  var s, o;
6932
6900
  if (!t(a)) {
@@ -6935,32 +6903,32 @@ function ka(t, e = {}, n) {
6935
6903
  }
6936
6904
  }) : ct.create();
6937
6905
  }
6938
- const Ki = {
6906
+ const Vi = {
6939
6907
  object: D.lazycreate
6940
6908
  };
6941
6909
  var N;
6942
6910
  (function(t) {
6943
6911
  t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
6944
6912
  })(N || (N = {}));
6945
- const Ji = (t, e = {
6913
+ const Bi = (t, e = {
6946
6914
  message: `Input not instance of ${t.name}`
6947
- }) => ka((n) => n instanceof t, e), Ca = Q.create, Ta = Se.create, Wi = _n.create, qi = je.create, Oa = Rt.create, Qi = Fe.create, Gi = pn.create, Hi = Mt.create, Yi = Lt.create, Xi = ct.create, eo = Le.create, to = fe.create, no = mn.create, ao = H.create, ro = D.create, so = D.strictCreate, io = zt.create, oo = vn.create, co = Ut.create, lo = ce.create, uo = Ft.create, ho = fn.create, po = Ve.create, mo = at.create, fo = Vt.create, _o = Bt.create, go = Ie.create, yo = Kt.create, vo = lt.create, Hn = X.create, bo = se.create, wo = Ze.create, xo = X.createWithPreprocess, No = Yt.create, ko = () => Ca().optional(), Co = () => Ta().optional(), To = () => Oa().optional(), Oo = {
6915
+ }) => xa((n) => n instanceof t, e), Na = Q.create, ka = Se.create, Ki = _n.create, Ji = je.create, Ca = Mt.create, Wi = Fe.create, qi = pn.create, Qi = Rt.create, Gi = Lt.create, Hi = ct.create, Yi = Le.create, Xi = fe.create, eo = mn.create, to = H.create, no = D.create, ao = D.strictCreate, ro = zt.create, so = vn.create, io = Ut.create, oo = ce.create, co = Ft.create, lo = fn.create, uo = Ve.create, ho = at.create, po = Vt.create, mo = Bt.create, fo = Ie.create, _o = Kt.create, go = lt.create, Gn = X.create, yo = se.create, vo = Ze.create, bo = X.createWithPreprocess, wo = Yt.create, xo = () => Na().optional(), No = () => ka().optional(), ko = () => Ca().optional(), Co = {
6948
6916
  string: (t) => Q.create({ ...t, coerce: !0 }),
6949
6917
  number: (t) => Se.create({ ...t, coerce: !0 }),
6950
- boolean: (t) => Rt.create({
6918
+ boolean: (t) => Mt.create({
6951
6919
  ...t,
6952
6920
  coerce: !0
6953
6921
  }),
6954
6922
  bigint: (t) => je.create({ ...t, coerce: !0 }),
6955
6923
  date: (t) => Fe.create({ ...t, coerce: !0 })
6956
- }, So = k;
6957
- var jo = /* @__PURE__ */ Object.freeze({
6924
+ }, To = k;
6925
+ var Oo = /* @__PURE__ */ Object.freeze({
6958
6926
  __proto__: null,
6959
6927
  defaultErrorMap: dt,
6960
- setErrorMap: Oi,
6928
+ setErrorMap: Ci,
6961
6929
  getErrorMap: ln,
6962
6930
  makeIssue: un,
6963
- EMPTY_PATH: Si,
6931
+ EMPTY_PATH: Ti,
6964
6932
  addIssueToContext: _,
6965
6933
  ParseStatus: F,
6966
6934
  INVALID: k,
@@ -6979,14 +6947,14 @@ var jo = /* @__PURE__ */ Object.freeze({
6979
6947
  ZodParsedType: y,
6980
6948
  getParsedType: Ne,
6981
6949
  ZodType: I,
6982
- datetimeRegex: xa,
6950
+ datetimeRegex: ba,
6983
6951
  ZodString: Q,
6984
6952
  ZodNumber: Se,
6985
6953
  ZodBigInt: je,
6986
- ZodBoolean: Rt,
6954
+ ZodBoolean: Mt,
6987
6955
  ZodDate: Fe,
6988
6956
  ZodSymbol: pn,
6989
- ZodUndefined: Mt,
6957
+ ZodUndefined: Rt,
6990
6958
  ZodNull: Lt,
6991
6959
  ZodAny: ct,
6992
6960
  ZodUnknown: Le,
@@ -7014,63 +6982,63 @@ var jo = /* @__PURE__ */ Object.freeze({
7014
6982
  ZodDefault: Jt,
7015
6983
  ZodCatch: Wt,
7016
6984
  ZodNaN: _n,
7017
- BRAND: Bi,
7018
- ZodBranded: Bn,
6985
+ BRAND: Fi,
6986
+ ZodBranded: Vn,
7019
6987
  ZodPipeline: Yt,
7020
6988
  ZodReadonly: qt,
7021
- custom: ka,
6989
+ custom: xa,
7022
6990
  Schema: I,
7023
6991
  ZodSchema: I,
7024
- late: Ki,
6992
+ late: Vi,
7025
6993
  get ZodFirstPartyTypeKind() {
7026
6994
  return N;
7027
6995
  },
7028
- coerce: Oo,
7029
- any: Xi,
7030
- array: ao,
7031
- bigint: qi,
7032
- boolean: Oa,
7033
- date: Qi,
7034
- discriminatedUnion: oo,
7035
- effect: Hn,
7036
- enum: go,
7037
- function: mo,
7038
- instanceof: Ji,
7039
- intersection: co,
7040
- lazy: fo,
7041
- literal: _o,
7042
- map: ho,
7043
- nan: Wi,
7044
- nativeEnum: yo,
7045
- never: to,
7046
- null: Yi,
7047
- nullable: wo,
7048
- number: Ta,
7049
- object: ro,
7050
- oboolean: To,
7051
- onumber: Co,
7052
- optional: bo,
7053
- ostring: ko,
7054
- pipeline: No,
7055
- preprocess: xo,
7056
- promise: vo,
7057
- record: uo,
7058
- set: po,
7059
- strictObject: so,
7060
- string: Ca,
7061
- symbol: Gi,
7062
- transformer: Hn,
7063
- tuple: lo,
7064
- undefined: Hi,
7065
- union: io,
7066
- unknown: eo,
7067
- void: no,
7068
- NEVER: So,
6996
+ coerce: Co,
6997
+ any: Hi,
6998
+ array: to,
6999
+ bigint: Ji,
7000
+ boolean: Ca,
7001
+ date: Wi,
7002
+ discriminatedUnion: so,
7003
+ effect: Gn,
7004
+ enum: fo,
7005
+ function: ho,
7006
+ instanceof: Bi,
7007
+ intersection: io,
7008
+ lazy: po,
7009
+ literal: mo,
7010
+ map: lo,
7011
+ nan: Ki,
7012
+ nativeEnum: _o,
7013
+ never: Xi,
7014
+ null: Gi,
7015
+ nullable: vo,
7016
+ number: ka,
7017
+ object: no,
7018
+ oboolean: ko,
7019
+ onumber: No,
7020
+ optional: yo,
7021
+ ostring: xo,
7022
+ pipeline: wo,
7023
+ preprocess: bo,
7024
+ promise: go,
7025
+ record: co,
7026
+ set: uo,
7027
+ strictObject: ao,
7028
+ string: Na,
7029
+ symbol: qi,
7030
+ transformer: Gn,
7031
+ tuple: oo,
7032
+ undefined: Qi,
7033
+ union: ro,
7034
+ unknown: Yi,
7035
+ void: eo,
7036
+ NEVER: To,
7069
7037
  ZodIssueCode: p,
7070
- quotelessJson: Ti,
7038
+ quotelessJson: ki,
7071
7039
  ZodError: J
7072
7040
  });
7073
- Ci(jo);
7041
+ Ni(Oo);
7074
7042
  function Xt(t, e = "", n = {}) {
7075
7043
  for (let a in t)
7076
7044
  if (Object.prototype.hasOwnProperty.call(t, a)) {
@@ -7079,7 +7047,7 @@ function Xt(t, e = "", n = {}) {
7079
7047
  }
7080
7048
  return n;
7081
7049
  }
7082
- function Sa(t, e) {
7050
+ function Ta(t, e) {
7083
7051
  const n = {};
7084
7052
  for (const [a, r] of Object.entries(t)) {
7085
7053
  const s = e.find(
@@ -7097,12 +7065,12 @@ function Sa(t, e) {
7097
7065
  }
7098
7066
  return n;
7099
7067
  }
7100
- function Io(t) {
7068
+ function So(t) {
7101
7069
  return async (e, n) => {
7102
7070
  let a = t.selectFrom("connections").where("connections.tenant_id", "=", e);
7103
7071
  n.q && (a = Be(t, a, n.q, ["user_id", "ip"]));
7104
7072
  const o = (await a.offset(n.page * n.per_page).limit(n.per_page).selectAll().execute()).map(
7105
- (c) => M(Sa(c, ["options"]))
7073
+ (c) => R(Ta(c, ["options"]))
7106
7074
  ), { count: d } = await a.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
7107
7075
  return {
7108
7076
  connections: o,
@@ -7112,19 +7080,19 @@ function Io(t) {
7112
7080
  };
7113
7081
  };
7114
7082
  }
7115
- function Zo(t) {
7083
+ function jo(t) {
7116
7084
  return async (e, n) => (await t.deleteFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", n).executeTakeFirst()).numDeletedRows > 0;
7117
7085
  }
7118
- function Eo(t) {
7086
+ function Io(t) {
7119
7087
  return async (e, n) => {
7120
7088
  const a = await t.selectFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", n).selectAll().executeTakeFirst();
7121
- return a ? M({
7089
+ return a ? R({
7122
7090
  ...a,
7123
7091
  options: JSON.parse(a.options)
7124
7092
  }) : null;
7125
7093
  };
7126
7094
  }
7127
- function $o(t) {
7095
+ function Zo(t) {
7128
7096
  return async (e, n, a) => {
7129
7097
  const r = {
7130
7098
  ...a,
@@ -7136,16 +7104,16 @@ function $o(t) {
7136
7104
  }).where("connections.id", "=", n).where("connections.tenant_id", "=", e).execute(), !0;
7137
7105
  };
7138
7106
  }
7139
- function Po(t) {
7107
+ function Eo(t) {
7140
7108
  return {
7141
- create: xi(t),
7142
- get: Eo(t),
7143
- list: Io(t),
7144
- remove: Zo(t),
7145
- update: $o(t)
7109
+ create: bi(t),
7110
+ get: Io(t),
7111
+ list: So(t),
7112
+ remove: jo(t),
7113
+ update: Zo(t)
7146
7114
  };
7147
7115
  }
7148
- function Ao(t) {
7116
+ function $o(t) {
7149
7117
  return {
7150
7118
  get: async (e) => {
7151
7119
  const n = await t.selectFrom("applications").selectAll().where("id", "=", e).executeTakeFirst();
@@ -7158,8 +7126,8 @@ function Ao(t) {
7158
7126
  return {
7159
7127
  ...n,
7160
7128
  connections: r.map(
7161
- (d) => ma.parse(
7162
- M({
7129
+ (d) => pa.parse(
7130
+ R({
7163
7131
  ...d,
7164
7132
  options: d.options ? JSON.parse(d.options) : {}
7165
7133
  })
@@ -7172,14 +7140,14 @@ function Ao(t) {
7172
7140
  web_origins: n.web_origins ? JSON.parse(n.web_origins) : [],
7173
7141
  allowed_logout_urls: n.allowed_logout_urls ? JSON.parse(n.allowed_logout_urls) : [],
7174
7142
  allowed_clients: n.allowed_clients ? JSON.parse(n.allowed_clients) : [],
7175
- tenant: M(a),
7143
+ tenant: R(a),
7176
7144
  // this is really an integer in the database
7177
7145
  disable_sign_ups: !!n.disable_sign_ups
7178
7146
  };
7179
7147
  }
7180
7148
  };
7181
7149
  }
7182
- function Do(t) {
7150
+ function Po(t) {
7183
7151
  return async () => await t.selectFrom("keys").where(
7184
7152
  (n) => n.or([
7185
7153
  n("revoked_at", ">", (/* @__PURE__ */ new Date()).toISOString()),
@@ -7187,22 +7155,22 @@ function Do(t) {
7187
7155
  ])
7188
7156
  ).selectAll().execute();
7189
7157
  }
7190
- function Ro(t) {
7158
+ function Ao(t) {
7191
7159
  return async (e) => {
7192
7160
  await t.insertInto("keys").values({ ...e, created_at: (/* @__PURE__ */ new Date()).toDateString() }).execute();
7193
7161
  };
7194
7162
  }
7195
- function Mo(t) {
7163
+ function Do(t) {
7196
7164
  return async (e, n) => !!(await t.updateTable("keys").set(n).where("kid", "=", e).execute()).length;
7197
7165
  }
7198
- function Lo(t) {
7166
+ function Mo(t) {
7199
7167
  return {
7200
- create: Ro(t),
7201
- list: Do(t),
7202
- update: Mo(t)
7168
+ create: Ao(t),
7169
+ list: Po(t),
7170
+ update: Do(t)
7203
7171
  };
7204
7172
  }
7205
- function zo(t) {
7173
+ function Ro(t) {
7206
7174
  return async (e, n) => {
7207
7175
  const a = {
7208
7176
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
@@ -7214,7 +7182,7 @@ function zo(t) {
7214
7182
  return await t.insertInto("domains").values(a).execute(), a;
7215
7183
  };
7216
7184
  }
7217
- function Uo(t) {
7185
+ function Lo(t) {
7218
7186
  return async (e, n) => {
7219
7187
  let a = t.selectFrom("domains").where("domains.tenant_id", "=", e);
7220
7188
  n.q && (a = Be(t, a, n.q, ["user_id", "ip"]));
@@ -7227,13 +7195,13 @@ function Uo(t) {
7227
7195
  };
7228
7196
  };
7229
7197
  }
7230
- function Fo(t) {
7198
+ function zo(t) {
7231
7199
  return {
7232
- create: zo(t),
7233
- list: Uo(t)
7200
+ create: Ro(t),
7201
+ list: Lo(t)
7234
7202
  };
7235
7203
  }
7236
- function Vo(t) {
7204
+ function Uo(t) {
7237
7205
  return async (e) => {
7238
7206
  const [n] = await t.selectFrom("branding").where("branding.tenant_id", "=", e).selectAll().execute();
7239
7207
  if (!n)
@@ -7248,7 +7216,7 @@ function Vo(t) {
7248
7216
  font_url: l,
7249
7217
  ...u
7250
7218
  } = n;
7251
- return M({
7219
+ return R({
7252
7220
  ...u,
7253
7221
  colors: {
7254
7222
  primary: r,
@@ -7263,9 +7231,9 @@ function Vo(t) {
7263
7231
  });
7264
7232
  };
7265
7233
  }
7266
- function Bo(t) {
7234
+ function Fo(t) {
7267
7235
  return async (e, n) => {
7268
- var o, d, c, l, u, Z, R, W, _e, Je, ge, ye, ve, We, qe, ee, te, ne;
7236
+ var o, d, c, l, u, Z, M, W, _e, Je, ge, ye, ve, We, qe, ee, te, ne;
7269
7237
  const { colors: a, font: r, ...s } = n;
7270
7238
  try {
7271
7239
  await t.insertInto("branding").values({
@@ -7274,7 +7242,7 @@ function Bo(t) {
7274
7242
  colors_page_background_type: (d = (o = n.colors) == null ? void 0 : o.page_background) == null ? void 0 : d.type,
7275
7243
  colors_page_background_start: (l = (c = n.colors) == null ? void 0 : c.page_background) == null ? void 0 : l.start,
7276
7244
  colors_page_background_end: (Z = (u = n.colors) == null ? void 0 : u.page_background) == null ? void 0 : Z.end,
7277
- colors_page_background_angle_dev: (W = (R = n.colors) == null ? void 0 : R.page_background) == null ? void 0 : W.angle_deg,
7245
+ colors_page_background_angle_dev: (W = (M = n.colors) == null ? void 0 : M.page_background) == null ? void 0 : W.angle_deg,
7278
7246
  font_url: (_e = n.font) == null ? void 0 : _e.url,
7279
7247
  tenant_id: e
7280
7248
  }).execute();
@@ -7291,22 +7259,22 @@ function Bo(t) {
7291
7259
  }
7292
7260
  };
7293
7261
  }
7294
- function Ko(t) {
7262
+ function Vo(t) {
7295
7263
  return {
7296
- get: Vo(t),
7297
- set: Bo(t)
7264
+ get: Uo(t),
7265
+ set: Fo(t)
7298
7266
  };
7299
7267
  }
7300
- function Jo(t) {
7268
+ function Bo(t) {
7301
7269
  return async (e, n) => {
7302
7270
  let a = t.selectFrom("hooks").where("hooks.tenant_id", "=", e);
7303
7271
  n.q && (a = Be(t, a, n.q, ["url"]));
7304
7272
  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();
7305
7273
  return {
7306
7274
  hooks: s.map((c) => {
7307
- const { tenant_id: l, enabled: u, synchronous: Z, ...R } = c;
7308
- return M({
7309
- ...R,
7275
+ const { tenant_id: l, enabled: u, synchronous: Z, ...M } = c;
7276
+ return R({
7277
+ ...M,
7310
7278
  enabled: !!u,
7311
7279
  synchronous: !!Z
7312
7280
  });
@@ -7317,20 +7285,20 @@ function Jo(t) {
7317
7285
  };
7318
7286
  };
7319
7287
  }
7320
- function Wo(t) {
7288
+ function Ko(t) {
7321
7289
  return async (e, n) => {
7322
7290
  const a = await t.selectFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", n).selectAll().executeTakeFirst();
7323
- return a ? M({
7291
+ return a ? R({
7324
7292
  ...a,
7325
7293
  enabled: !!a.enabled,
7326
7294
  synchronous: !!a.synchronous
7327
7295
  }) : null;
7328
7296
  };
7329
7297
  }
7330
- function qo(t) {
7298
+ function Jo(t) {
7331
7299
  return async (e, n) => (await t.deleteFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", n).executeTakeFirst()).numDeletedRows > 0;
7332
7300
  }
7333
- function Qo(t) {
7301
+ function Wo(t) {
7334
7302
  return async (e, n) => {
7335
7303
  const a = {
7336
7304
  hook_id: Ke(),
@@ -7346,7 +7314,7 @@ function Qo(t) {
7346
7314
  }).execute(), a;
7347
7315
  };
7348
7316
  }
7349
- function Go(t) {
7317
+ function qo(t) {
7350
7318
  return async (e, n, a) => {
7351
7319
  const r = {
7352
7320
  ...a,
@@ -7357,16 +7325,16 @@ function Go(t) {
7357
7325
  return await t.updateTable("hooks").set(r).where("hooks.hook_id", "=", n).where("hooks.tenant_id", "=", e).execute(), !0;
7358
7326
  };
7359
7327
  }
7360
- function Ho(t) {
7328
+ function Qo(t) {
7361
7329
  return {
7362
- create: Qo(t),
7363
- get: Wo(t),
7364
- list: Jo(t),
7365
- update: Go(t),
7366
- remove: qo(t)
7330
+ create: Wo(t),
7331
+ get: Ko(t),
7332
+ list: Bo(t),
7333
+ update: qo(t),
7334
+ remove: Jo(t)
7367
7335
  };
7368
7336
  }
7369
- function Yo(t) {
7337
+ function Go(t) {
7370
7338
  return async (e, n) => {
7371
7339
  const a = {
7372
7340
  themeId: Ke(),
@@ -7377,16 +7345,16 @@ function Yo(t) {
7377
7345
  return await t.insertInto("themes").values({ ...Xt(a), tenant_id: e }).execute(), a;
7378
7346
  };
7379
7347
  }
7380
- function Xo(t) {
7348
+ function Ho(t) {
7381
7349
  return async (e, n) => (await t.deleteFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", n).executeTakeFirst()).numDeletedRows > 0;
7382
7350
  }
7383
- function ed(t) {
7351
+ function Yo(t) {
7384
7352
  return async (e, n) => {
7385
7353
  const a = await t.selectFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", n).selectAll().executeTakeFirst();
7386
- return a ? M(a) : null;
7354
+ return a ? R(a) : null;
7387
7355
  };
7388
7356
  }
7389
- function td(t) {
7357
+ function Xo(t) {
7390
7358
  return async (e, n, a) => {
7391
7359
  const r = Xt({
7392
7360
  ...a,
@@ -7395,23 +7363,23 @@ function td(t) {
7395
7363
  return await t.updateTable("themes").set(r).where("themes.id", "=", n).where("themes.tenant_id", "=", e).execute(), !0;
7396
7364
  };
7397
7365
  }
7398
- function nd(t) {
7366
+ function ed(t) {
7399
7367
  return {
7400
- create: Yo(t),
7401
- get: ed(t),
7402
- remove: Xo(t),
7403
- update: td(t)
7368
+ create: Go(t),
7369
+ get: Yo(t),
7370
+ remove: Ho(t),
7371
+ update: Xo(t)
7404
7372
  };
7405
7373
  }
7406
- function ad(t) {
7374
+ function td(t) {
7407
7375
  return async (e, n) => {
7408
7376
  const a = (/* @__PURE__ */ new Date()).toISOString(), r = await t.selectFrom("logins").where("logins.expires_at", ">", a).where("logins.login_id", "=", n).selectAll().executeTakeFirst();
7409
- return r ? ks.parse(
7410
- Sa(M(r), ["authParams"])
7377
+ return r ? xs.parse(
7378
+ Ta(R(r), ["authParams"])
7411
7379
  ) : null;
7412
7380
  };
7413
7381
  }
7414
- function rd(t) {
7382
+ function nd(t) {
7415
7383
  return async (e, n) => {
7416
7384
  const a = {
7417
7385
  login_id: Ke(),
@@ -7422,24 +7390,24 @@ function rd(t) {
7422
7390
  return await t.insertInto("logins").values({ ...Xt(a), tenant_id: e }).execute(), a;
7423
7391
  };
7424
7392
  }
7425
- function sd(t) {
7393
+ function ad(t) {
7426
7394
  return async (e, n, a) => (await t.updateTable("logins").set(Xt(a)).where("logins.login_id", "=", n).where("logins.tenant_id", "=", e).execute()).length === 1;
7427
7395
  }
7428
- function id(t) {
7396
+ function rd(t) {
7429
7397
  return async (e, n) => (await t.deleteFrom("logins").where("logins.tenant_id", "=", e).where("logins.login_id", "=", n).execute()).length > 0;
7430
7398
  }
7431
- function od(t) {
7399
+ function sd(t) {
7432
7400
  return {
7433
- create: rd(t),
7434
- get: ad(t),
7435
- update: sd(t),
7436
- remove: id(t)
7401
+ create: nd(t),
7402
+ get: td(t),
7403
+ update: ad(t),
7404
+ remove: rd(t)
7437
7405
  };
7438
7406
  }
7439
- function dd(t) {
7407
+ function id(t) {
7440
7408
  return async (e) => {
7441
7409
  const [n] = await t.selectFrom("prompt_settings").where("prompt_settings.tenant_id", "=", e).selectAll().execute();
7442
- return M({
7410
+ return R({
7443
7411
  identifier_first: !!(n != null && n.identifier_first),
7444
7412
  password_first: !!(n != null && n.password_first),
7445
7413
  webauthn_platform_first_factor: !!(n != null && n.webauthn_platform_first_factor),
@@ -7447,8 +7415,8 @@ function dd(t) {
7447
7415
  });
7448
7416
  };
7449
7417
  }
7450
- function Yn(t) {
7451
- return M({
7418
+ function Hn(t) {
7419
+ return R({
7452
7420
  ...t,
7453
7421
  webauthn_platform_first_factor: t.webauthn_platform_first_factor ? !!t.webauthn_platform_first_factor : void 0,
7454
7422
  identifier_first: t.identifier_first ? !!t.identifier_first : void 0,
@@ -7456,26 +7424,26 @@ function Yn(t) {
7456
7424
  universal_login_experience: t.universal_login_experience
7457
7425
  });
7458
7426
  }
7459
- function cd(t) {
7427
+ function od(t) {
7460
7428
  return async (e, n) => {
7461
7429
  try {
7462
- const a = As.parse(n);
7430
+ const a = $s.parse(n);
7463
7431
  await t.insertInto("prompt_settings").values({
7464
- ...Yn(a),
7432
+ ...Hn(a),
7465
7433
  tenant_id: e
7466
7434
  }).execute();
7467
7435
  } catch {
7468
- await t.updateTable("prompt_settings").set(Yn(n)).where("tenant_id", "=", e).execute();
7436
+ await t.updateTable("prompt_settings").set(Hn(n)).where("tenant_id", "=", e).execute();
7469
7437
  }
7470
7438
  };
7471
7439
  }
7472
- function ld(t) {
7440
+ function dd(t) {
7473
7441
  return {
7474
- get: dd(t),
7475
- set: cd(t)
7442
+ get: id(t),
7443
+ set: od(t)
7476
7444
  };
7477
7445
  }
7478
- function ud(t) {
7446
+ function cd(t) {
7479
7447
  return async (e) => {
7480
7448
  const [n] = await t.selectFrom("email_providers").where("email_providers.tenant_id", "=", e).selectAll().execute();
7481
7449
  if (!n)
@@ -7487,7 +7455,7 @@ function ud(t) {
7487
7455
  enabled: o,
7488
7456
  ...d
7489
7457
  } = n;
7490
- return M({
7458
+ return R({
7491
7459
  ...d,
7492
7460
  credentials: JSON.parse(r),
7493
7461
  settings: JSON.parse(s),
@@ -7495,7 +7463,7 @@ function ud(t) {
7495
7463
  });
7496
7464
  };
7497
7465
  }
7498
- function hd(t) {
7466
+ function ld(t) {
7499
7467
  return async (e, n) => {
7500
7468
  const { credentials: a, settings: r, enabled: s, ...o } = n;
7501
7469
  await t.updateTable("email_providers").set({
@@ -7506,7 +7474,7 @@ function hd(t) {
7506
7474
  }).where("tenant_id", "=", e).execute();
7507
7475
  };
7508
7476
  }
7509
- function pd(t) {
7477
+ function ud(t) {
7510
7478
  return async (e, n) => {
7511
7479
  const { credentials: a, settings: r, enabled: s, ...o } = n;
7512
7480
  await t.insertInto("email_providers").values({
@@ -7520,14 +7488,14 @@ function pd(t) {
7520
7488
  }).execute();
7521
7489
  };
7522
7490
  }
7523
- function md(t) {
7491
+ function hd(t) {
7524
7492
  return {
7525
- get: ud(t),
7526
- create: pd(t),
7527
- update: hd(t)
7493
+ get: cd(t),
7494
+ create: ud(t),
7495
+ update: ld(t)
7528
7496
  };
7529
7497
  }
7530
- function fd(t) {
7498
+ function pd(t) {
7531
7499
  return t[t.length - 1];
7532
7500
  }
7533
7501
  function z(t) {
@@ -7560,7 +7528,7 @@ const en = z({
7560
7528
  identifier: en.create(e)
7561
7529
  });
7562
7530
  }
7563
- }), _d = z({
7531
+ }), md = z({
7564
7532
  is(t) {
7565
7533
  return t.kind === "AliasNode";
7566
7534
  },
@@ -7589,7 +7557,7 @@ const en = z({
7589
7557
  }
7590
7558
  });
7591
7559
  var gn;
7592
- class gd {
7560
+ class fd {
7593
7561
  constructor() {
7594
7562
  ut(this, "nodeStack", []);
7595
7563
  ae(this, gn, z({
@@ -8423,7 +8391,7 @@ class gd {
8423
8391
  }
8424
8392
  }
8425
8393
  gn = new WeakMap();
8426
- const yd = z({
8394
+ const _d = z({
8427
8395
  AlterTableNode: !0,
8428
8396
  CreateIndexNode: !0,
8429
8397
  CreateSchemaNode: !0,
@@ -8442,30 +8410,30 @@ const yd = z({
8442
8410
  UpdateQueryNode: !0,
8443
8411
  MergeQueryNode: !0
8444
8412
  });
8445
- var rt, De, Re, L, ja, Ia, Za, Ye, Dn, Ea;
8446
- class vd extends gd {
8413
+ var rt, De, Me, L, Oa, Sa, ja, Ye, Dn, Ia;
8414
+ class gd extends fd {
8447
8415
  constructor(n) {
8448
8416
  super();
8449
8417
  ae(this, L);
8450
8418
  ae(this, rt);
8451
8419
  ae(this, De, /* @__PURE__ */ new Set());
8452
- ae(this, Re, /* @__PURE__ */ new Set());
8420
+ ae(this, Me, /* @__PURE__ */ new Set());
8453
8421
  ht(this, rt, n);
8454
8422
  }
8455
8423
  transformNodeImpl(n) {
8456
- if (!T(this, L, ja).call(this, n))
8424
+ if (!T(this, L, Oa).call(this, n))
8457
8425
  return super.transformNodeImpl(n);
8458
- const a = T(this, L, Za).call(this, n);
8426
+ const a = T(this, L, ja).call(this, n);
8459
8427
  for (const o of a)
8460
- v(this, Re).add(o);
8461
- const r = T(this, L, Ia).call(this, n);
8428
+ v(this, Me).add(o);
8429
+ const r = T(this, L, Sa).call(this, n);
8462
8430
  for (const o of r)
8463
8431
  v(this, De).add(o);
8464
8432
  const s = super.transformNodeImpl(n);
8465
8433
  for (const o of r)
8466
8434
  v(this, De).delete(o);
8467
8435
  for (const o of a)
8468
- v(this, Re).delete(o);
8436
+ v(this, Me).delete(o);
8469
8437
  return s;
8470
8438
  }
8471
8439
  transformSchemableIdentifier(n) {
@@ -8483,9 +8451,9 @@ class vd extends gd {
8483
8451
  };
8484
8452
  }
8485
8453
  }
8486
- rt = new WeakMap(), De = new WeakMap(), Re = new WeakMap(), L = new WeakSet(), ja = function(n) {
8487
- return n.kind in yd;
8488
- }, Ia = function(n) {
8454
+ rt = new WeakMap(), De = new WeakMap(), Me = new WeakMap(), L = new WeakSet(), Oa = function(n) {
8455
+ return n.kind in _d;
8456
+ }, Sa = function(n) {
8489
8457
  const a = /* @__PURE__ */ new Set();
8490
8458
  if ("name" in n && n.name && An.is(n.name) && T(this, L, Dn).call(this, n.name, a), "from" in n && n.from)
8491
8459
  for (const r of n.from.froms)
@@ -8494,26 +8462,26 @@ rt = new WeakMap(), De = new WeakMap(), Re = new WeakMap(), L = new WeakSet(), j
8494
8462
  for (const r of n.joins)
8495
8463
  T(this, L, Ye).call(this, r.table, a);
8496
8464
  return "using" in n && n.using && T(this, L, Ye).call(this, n.using, a), a;
8497
- }, Za = function(n) {
8465
+ }, ja = function(n) {
8498
8466
  const a = /* @__PURE__ */ new Set();
8499
- return "with" in n && n.with && T(this, L, Ea).call(this, n.with, a), a;
8467
+ return "with" in n && n.with && T(this, L, Ia).call(this, n.with, a), a;
8500
8468
  }, Ye = function(n, a) {
8501
- const r = Nn.is(n) ? n : _d.is(n) && Nn.is(n.node) ? n.node : null;
8469
+ const r = Nn.is(n) ? n : md.is(n) && Nn.is(n.node) ? n.node : null;
8502
8470
  r && T(this, L, Dn).call(this, r.table, a);
8503
8471
  }, Dn = function(n, a) {
8504
8472
  const r = n.identifier.name;
8505
- !v(this, De).has(r) && !v(this, Re).has(r) && a.add(r);
8506
- }, Ea = function(n, a) {
8473
+ !v(this, De).has(r) && !v(this, Me).has(r) && a.add(r);
8474
+ }, Ia = function(n, a) {
8507
8475
  for (const r of n.expressions) {
8508
8476
  const s = r.name.table.table.identifier.name;
8509
- v(this, Re).has(s) || a.add(s);
8477
+ v(this, Me).has(s) || a.add(s);
8510
8478
  }
8511
8479
  };
8512
8480
  var Qt;
8513
- class bd {
8481
+ class yd {
8514
8482
  constructor(e) {
8515
8483
  ae(this, Qt);
8516
- ht(this, Qt, new vd(e));
8484
+ ht(this, Qt, new gd(e));
8517
8485
  }
8518
8486
  transformQuery(e) {
8519
8487
  return v(this, Qt).transformNode(e.node);
@@ -8523,7 +8491,7 @@ class bd {
8523
8491
  }
8524
8492
  }
8525
8493
  Qt = new WeakMap();
8526
- class wd {
8494
+ class vd {
8527
8495
  transformQuery(e) {
8528
8496
  return e.node;
8529
8497
  }
@@ -8531,9 +8499,9 @@ class wd {
8531
8499
  return e.result;
8532
8500
  }
8533
8501
  }
8534
- const xd = "kysely_migration", Xn = "kysely_migration_lock", Nd = !1, kn = "migration_lock", kd = z({ __noMigrations__: !0 });
8535
- var P, m, vt, ue, he, Xe, Pa, pe, Aa, Da, Ra, Ma, La, Rn, et, Mn, za, Ua, Fa, Ln, Va, Ba, Ka, Ja, Wa, bt;
8536
- class $a {
8502
+ const bd = "kysely_migration", Yn = "kysely_migration_lock", wd = !1, kn = "migration_lock", xd = z({ __noMigrations__: !0 });
8503
+ var P, m, vt, ue, he, Xe, Ea, pe, $a, Pa, Aa, Da, Ma, Mn, et, Rn, Ra, La, za, Ln, Ua, Fa, Va, Ba, Ka, bt;
8504
+ class Za {
8537
8505
  constructor(e) {
8538
8506
  ae(this, m);
8539
8507
  ae(this, P);
@@ -8630,7 +8598,7 @@ class $a {
8630
8598
  */
8631
8599
  async migrateTo(e) {
8632
8600
  return T(this, m, vt).call(this, ({ migrations: n, executedMigrations: a, pendingMigrations: r }) => {
8633
- if (e === kd)
8601
+ if (e === xd)
8634
8602
  return { direction: "Down", step: 1 / 0 };
8635
8603
  if (!n.find((d) => d.name === e))
8636
8604
  throw new Error(`migration "${e}" doesn't exist`);
@@ -8682,31 +8650,31 @@ class $a {
8682
8650
  }
8683
8651
  P = new WeakMap(), m = new WeakSet(), vt = async function(e) {
8684
8652
  try {
8685
- return await T(this, m, Aa).call(this), await T(this, m, za).call(this, e);
8653
+ return await T(this, m, $a).call(this), await T(this, m, Ra).call(this, e);
8686
8654
  } catch (n) {
8687
8655
  return n instanceof Cn ? n.resultSet : { error: n };
8688
8656
  }
8689
8657
  }, ue = function() {
8690
8658
  return v(this, P).migrationTableSchema;
8691
8659
  }, he = function() {
8692
- return v(this, P).migrationTableName ?? xd;
8660
+ return v(this, P).migrationTableName ?? bd;
8693
8661
  }, Xe = function() {
8694
- return v(this, P).migrationLockTableName ?? Xn;
8695
- }, Pa = function() {
8696
- return v(this, P).allowUnorderedMigrations ?? Nd;
8662
+ return v(this, P).migrationLockTableName ?? Yn;
8663
+ }, Ea = function() {
8664
+ return v(this, P).allowUnorderedMigrations ?? wd;
8697
8665
  }, pe = function() {
8698
- return v(this, m, ue) ? new bd(v(this, m, ue)) : new wd();
8699
- }, Aa = async function() {
8700
- await T(this, m, Da).call(this), await T(this, m, Ra).call(this), await T(this, m, Ma).call(this), await T(this, m, La).call(this);
8701
- }, Da = async function() {
8702
- if (v(this, m, ue) && !await T(this, m, Rn).call(this))
8666
+ return v(this, m, ue) ? new yd(v(this, m, ue)) : new vd();
8667
+ }, $a = async function() {
8668
+ await T(this, m, Pa).call(this), await T(this, m, Aa).call(this), await T(this, m, Da).call(this), await T(this, m, Ma).call(this);
8669
+ }, Pa = async function() {
8670
+ if (v(this, m, ue) && !await T(this, m, Mn).call(this))
8703
8671
  try {
8704
8672
  await T(this, m, bt).call(this, v(this, P).db.schema.createSchema(v(this, m, ue)));
8705
8673
  } catch (e) {
8706
- if (!await T(this, m, Rn).call(this))
8674
+ if (!await T(this, m, Mn).call(this))
8707
8675
  throw e;
8708
8676
  }
8709
- }, Ra = async function() {
8677
+ }, Aa = async function() {
8710
8678
  if (!await T(this, m, et).call(this, v(this, m, he)))
8711
8679
  try {
8712
8680
  v(this, m, ue) && await T(this, m, bt).call(this, v(this, P).db.schema.createSchema(v(this, m, ue))), await T(this, m, bt).call(this, v(this, P).db.schema.withPlugin(v(this, m, pe)).createTable(v(this, m, he)).addColumn("name", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("timestamp", "varchar(255)", (e) => e.notNull()));
@@ -8714,7 +8682,7 @@ P = new WeakMap(), m = new WeakSet(), vt = async function(e) {
8714
8682
  if (!await T(this, m, et).call(this, v(this, m, he)))
8715
8683
  throw e;
8716
8684
  }
8717
- }, Ma = async function() {
8685
+ }, Da = async function() {
8718
8686
  if (!await T(this, m, et).call(this, v(this, m, Xe)))
8719
8687
  try {
8720
8688
  await T(this, m, bt).call(this, v(this, P).db.schema.withPlugin(v(this, m, pe)).createTable(v(this, m, Xe)).addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("is_locked", "integer", (e) => e.notNull().defaultTo(0)));
@@ -8722,52 +8690,52 @@ P = new WeakMap(), m = new WeakSet(), vt = async function(e) {
8722
8690
  if (!await T(this, m, et).call(this, v(this, m, Xe)))
8723
8691
  throw e;
8724
8692
  }
8725
- }, La = async function() {
8726
- if (!await T(this, m, Mn).call(this))
8693
+ }, Ma = async function() {
8694
+ if (!await T(this, m, Rn).call(this))
8727
8695
  try {
8728
8696
  await v(this, P).db.withPlugin(v(this, m, pe)).insertInto(v(this, m, Xe)).values({ id: kn, is_locked: 0 }).execute();
8729
8697
  } catch (e) {
8730
- if (!await T(this, m, Mn).call(this))
8698
+ if (!await T(this, m, Rn).call(this))
8731
8699
  throw e;
8732
8700
  }
8733
- }, Rn = async function() {
8701
+ }, Mn = async function() {
8734
8702
  return (await v(this, P).db.introspection.getSchemas()).some((n) => n.name === v(this, m, ue));
8735
8703
  }, et = async function(e) {
8736
8704
  const n = v(this, m, ue);
8737
8705
  return (await v(this, P).db.introspection.getTables({
8738
8706
  withInternalKyselyTables: !0
8739
8707
  })).some((r) => r.name === e && (!n || r.schema === n));
8740
- }, Mn = async function() {
8708
+ }, Rn = async function() {
8741
8709
  return !!await v(this, P).db.withPlugin(v(this, m, pe)).selectFrom(v(this, m, Xe)).where("id", "=", kn).select("id").executeTakeFirst();
8742
- }, za = async function(e) {
8710
+ }, Ra = async function(e) {
8743
8711
  const n = v(this, P).db.getExecutor().adapter, a = z({
8744
- lockTable: v(this, P).migrationLockTableName ?? Xn,
8712
+ lockTable: v(this, P).migrationLockTableName ?? Yn,
8745
8713
  lockRowId: kn,
8746
8714
  lockTableSchema: v(this, P).migrationTableSchema
8747
8715
  }), r = async (s) => {
8748
8716
  try {
8749
8717
  await n.acquireMigrationLock(s, a);
8750
- const o = await T(this, m, Ua).call(this, s);
8718
+ const o = await T(this, m, La).call(this, s);
8751
8719
  if (o.migrations.length === 0)
8752
8720
  return { results: [] };
8753
8721
  const { direction: d, step: c } = e(o);
8754
- return c <= 0 ? { results: [] } : d === "Down" ? await T(this, m, Ja).call(this, s, o, c) : d === "Up" ? await T(this, m, Wa).call(this, s, o, c) : { results: [] };
8722
+ return c <= 0 ? { results: [] } : d === "Down" ? await T(this, m, Ba).call(this, s, o, c) : d === "Up" ? await T(this, m, Ka).call(this, s, o, c) : { results: [] };
8755
8723
  } finally {
8756
8724
  await n.releaseMigrationLock(s, a);
8757
8725
  }
8758
8726
  };
8759
8727
  return n.supportsTransactionalDdl ? v(this, P).db.transaction().execute(r) : v(this, P).db.connection().execute(r);
8760
- }, Ua = async function(e) {
8761
- const n = await T(this, m, Ln).call(this), a = await T(this, m, Va).call(this, e);
8762
- T(this, m, Ba).call(this, n, a), v(this, m, Pa) || T(this, m, Ka).call(this, n, a);
8763
- const r = T(this, m, Fa).call(this, n, a);
8728
+ }, La = async function(e) {
8729
+ const n = await T(this, m, Ln).call(this), a = await T(this, m, Ua).call(this, e);
8730
+ T(this, m, Fa).call(this, n, a), v(this, m, Ea) || T(this, m, Va).call(this, n, a);
8731
+ const r = T(this, m, za).call(this, n, a);
8764
8732
  return z({
8765
8733
  migrations: n,
8766
8734
  executedMigrations: a,
8767
- lastMigration: fd(a),
8735
+ lastMigration: pd(a),
8768
8736
  pendingMigrations: r
8769
8737
  });
8770
- }, Fa = function(e, n) {
8738
+ }, za = function(e, n) {
8771
8739
  return e.filter((a) => !n.includes(a.name));
8772
8740
  }, Ln = async function() {
8773
8741
  const e = await v(this, P).provider.getMigrations();
@@ -8775,17 +8743,17 @@ P = new WeakMap(), m = new WeakSet(), vt = async function(e) {
8775
8743
  ...e[n],
8776
8744
  name: n
8777
8745
  }));
8778
- }, Va = async function(e) {
8746
+ }, Ua = async function(e) {
8779
8747
  return (await e.withPlugin(v(this, m, pe)).selectFrom(v(this, m, he)).select("name").orderBy(["timestamp", "name"]).execute()).map((a) => a.name);
8780
- }, Ba = function(e, n) {
8748
+ }, Fa = function(e, n) {
8781
8749
  for (const a of n)
8782
8750
  if (!e.some((r) => r.name === a))
8783
8751
  throw new Error(`corrupted migrations: previously executed migration ${a} is missing`);
8784
- }, Ka = function(e, n) {
8752
+ }, Va = function(e, n) {
8785
8753
  for (let a = 0; a < n.length; ++a)
8786
8754
  if (e[a].name !== n[a])
8787
8755
  throw new Error(`corrupted migrations: expected previously executed migration ${n[a]} to be at index ${a} but ${e[a].name} was found in its place. New migrations must always have a name that comes alphabetically after the last executed migration.`);
8788
- }, Ja = async function(e, n, a) {
8756
+ }, Ba = async function(e, n, a) {
8789
8757
  const r = n.executedMigrations.slice().reverse().slice(0, a).map((o) => n.migrations.find((d) => d.name === o)), s = r.map((o) => ({
8790
8758
  migrationName: o.name,
8791
8759
  direction: "Down",
@@ -8811,7 +8779,7 @@ P = new WeakMap(), m = new WeakSet(), vt = async function(e) {
8811
8779
  }
8812
8780
  }
8813
8781
  return { results: s };
8814
- }, Wa = async function(e, n, a) {
8782
+ }, Ka = async function(e, n, a) {
8815
8783
  const s = n.pendingMigrations.slice(0, a).map((o) => ({
8816
8784
  migrationName: o.name,
8817
8785
  direction: "Up",
@@ -8855,7 +8823,7 @@ class Cn extends Error {
8855
8823
  }
8856
8824
  }
8857
8825
  Gt = new WeakMap();
8858
- class qa {
8826
+ class Ja {
8859
8827
  constructor(e) {
8860
8828
  ut(this, "migrations");
8861
8829
  this.migrations = e;
@@ -8864,7 +8832,7 @@ class qa {
8864
8832
  return this.migrations;
8865
8833
  }
8866
8834
  }
8867
- async function Cd(t) {
8835
+ async function Nd(t) {
8868
8836
  await t.schema.createTable("tenants").addColumn("id", "varchar(255)", (e) => e.primaryKey()).addColumn("name", "varchar(255)").addColumn("audience", "varchar(255)").addColumn("sender_email", "varchar(255)").addColumn("sender_name", "varchar(255)").addColumn("language", "varchar(255)").addColumn("logo", "varchar(255)").addColumn("primary_color", "varchar(255)").addColumn("secondary_color", "varchar(255)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("updated_at", "varchar(255)", (e) => e.notNull()).execute(), await t.schema.createTable("users").addColumn("user_id", "varchar(255)", (e) => e.notNull()).addColumn(
8869
8837
  "tenant_id",
8870
8838
  "varchar(255)",
@@ -8932,35 +8900,35 @@ async function Cd(t) {
8932
8900
  (e) => e.references("tenants.id").onDelete("cascade").notNull()
8933
8901
  ).addColumn("domain", "varchar(255)", (e) => e.notNull()).addColumn("email_service", "varchar(255)").addColumn("email_api_key", "varchar(255)").addColumn("dkim_private_key", "varchar(2048)").addColumn("dkim_public_key", "varchar(2048)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("updated_at", "varchar(255)", (e) => e.notNull()).execute();
8934
8902
  }
8935
- async function Td(t) {
8903
+ async function kd(t) {
8936
8904
  await t.schema.dropTable("domains").execute(), await t.schema.dropTable("members").execute(), await t.schema.dropTable("users").execute(), await t.schema.dropTable("connections").execute(), await t.schema.dropTable("applications").execute(), await t.schema.dropTable("migrations").execute(), await t.schema.dropTable("tenants").execute();
8937
8905
  }
8938
- const Od = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8906
+ const Cd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8939
8907
  __proto__: null,
8940
- down: Td,
8941
- up: Cd
8908
+ down: kd,
8909
+ up: Nd
8942
8910
  }, Symbol.toStringTag, { value: "Module" }));
8943
- async function Sd(t) {
8911
+ async function Td(t) {
8944
8912
  await t.schema.alterTable("tenants").addColumn("support_url", "varchar(255)").execute();
8945
8913
  }
8946
- async function jd(t) {
8914
+ async function Od(t) {
8947
8915
  await t.schema.alterTable("tenants").dropColumn("support_url").execute();
8948
8916
  }
8949
- const Id = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8917
+ const Sd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8950
8918
  __proto__: null,
8951
- down: jd,
8952
- up: Sd
8919
+ down: Od,
8920
+ up: Td
8953
8921
  }, Symbol.toStringTag, { value: "Module" }));
8954
- async function Zd(t) {
8922
+ async function jd(t) {
8955
8923
  }
8956
- async function Ed(t) {
8924
+ async function Id(t) {
8957
8925
  }
8958
- const $d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8926
+ const Zd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8959
8927
  __proto__: null,
8960
- down: Ed,
8961
- up: Zd
8928
+ down: Id,
8929
+ up: jd
8962
8930
  }, Symbol.toStringTag, { value: "Module" }));
8963
- async function Pd(t) {
8931
+ async function Ed(t) {
8964
8932
  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(
8965
8933
  "tenant_id_constraint",
8966
8934
  ["tenant_id"],
@@ -8969,24 +8937,24 @@ async function Pd(t) {
8969
8937
  (e) => e.onDelete("cascade")
8970
8938
  ).addColumn("ip", "varchar(255)").addColumn("type", "varchar(8)", (e) => e.notNull()).addColumn("date", "varchar(25)", (e) => e.notNull()).addColumn("client_id", "varchar(255)").addColumn("client_name", "varchar(255)").addColumn("user_agent", "varchar(255)").addColumn("description", "varchar(255)").addColumn("details", "varchar(2048)").execute();
8971
8939
  }
8972
- async function Ad(t) {
8940
+ async function $d(t) {
8973
8941
  await t.schema.dropTable("logs").execute();
8974
8942
  }
8975
- const Dd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8943
+ const Pd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8976
8944
  __proto__: null,
8977
- down: Ad,
8978
- up: Pd
8945
+ down: $d,
8946
+ up: Ed
8979
8947
  }, Symbol.toStringTag, { value: "Module" }));
8980
- async function Rd(t) {
8948
+ async function Ad(t) {
8981
8949
  }
8982
- async function Md(t) {
8950
+ async function Dd(t) {
8983
8951
  }
8984
- const Ld = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8952
+ const Md = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8985
8953
  __proto__: null,
8986
- down: Md,
8987
- up: Rd
8954
+ down: Dd,
8955
+ up: Ad
8988
8956
  }, Symbol.toStringTag, { value: "Module" }));
8989
- async function zd(t) {
8957
+ async function Rd(t) {
8990
8958
  await t.schema.createTable("sessions").addColumn("session_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
8991
8959
  "client_id",
8992
8960
  "varchar(255)",
@@ -9015,15 +8983,15 @@ async function zd(t) {
9015
8983
  (e) => e.references("applications.id").onDelete("cascade").notNull()
9016
8984
  ).addColumn("code", "varchar(255)", (e) => e.notNull()).addColumn("email", "varchar(255)", (e) => e.notNull()).addColumn("user_id", "varchar(255)").addColumn("send", "varchar(255)").addColumn("nonce", "varchar(255)").addColumn("state", "varchar(1024)").addColumn("scope", "varchar(1024)").addColumn("response_type", "varchar(256)").addColumn("response_mode", "varchar(256)").addColumn("redirect_uri", "varchar(1024)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute(), await t.schema.createIndex("otps_email_index").on("otps").column("email").execute(), await t.schema.createIndex("otps_expires_at_index").on("otps").column("expires_at").execute();
9017
8985
  }
9018
- async function Ud(t) {
8986
+ async function Ld(t) {
9019
8987
  await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("tickets").execute(), await t.schema.dropTable("otps").execute();
9020
8988
  }
9021
- const Fd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8989
+ const zd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9022
8990
  __proto__: null,
9023
- down: Ud,
9024
- up: zd
8991
+ down: Ld,
8992
+ up: Rd
9025
8993
  }, Symbol.toStringTag, { value: "Module" }));
9026
- async function Vd(t) {
8994
+ async function Ud(t) {
9027
8995
  await t.schema.createTable("passwords").addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
9028
8996
  "user_id_constraint",
9029
8997
  ["user_id", "tenant_id"],
@@ -9038,24 +9006,24 @@ async function Vd(t) {
9038
9006
  (e) => e.onDelete("cascade")
9039
9007
  ).addColumn("type", "varchar(255)", (e) => e.notNull()).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute(), await t.schema.createIndex("codes_expires_at_index").on("codes").column("expires_at").execute();
9040
9008
  }
9041
- async function Bd(t) {
9009
+ async function Fd(t) {
9042
9010
  await t.schema.dropTable("passwords").execute(), await t.schema.dropTable("codes").execute();
9043
9011
  }
9044
- const Kd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9012
+ const Vd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9045
9013
  __proto__: null,
9046
- down: Bd,
9047
- up: Vd
9014
+ down: Fd,
9015
+ up: Ud
9048
9016
  }, Symbol.toStringTag, { value: "Module" }));
9049
- async function Jd(t) {
9017
+ async function Bd(t) {
9050
9018
  }
9051
- async function Wd(t) {
9019
+ async function Kd(t) {
9052
9020
  }
9053
- const qd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9021
+ const Jd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9054
9022
  __proto__: null,
9055
- down: Wd,
9056
- up: Jd
9023
+ down: Kd,
9024
+ up: Bd
9057
9025
  }, Symbol.toStringTag, { value: "Module" }));
9058
- async function Qd(t) {
9026
+ async function Wd(t) {
9059
9027
  await t.schema.alterTable("passwords").addColumn(
9060
9028
  "password",
9061
9029
  "varchar(255)",
@@ -9063,288 +9031,288 @@ async function Qd(t) {
9063
9031
  (e) => e.notNull()
9064
9032
  ).execute();
9065
9033
  }
9066
- async function Gd(t) {
9034
+ async function qd(t) {
9067
9035
  await t.schema.alterTable("passwords").dropColumn("password").execute();
9068
9036
  }
9069
- const Hd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9037
+ const Qd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9070
9038
  __proto__: null,
9071
- down: Gd,
9072
- up: Qd
9039
+ down: qd,
9040
+ up: Wd
9073
9041
  }, Symbol.toStringTag, { value: "Module" }));
9074
- async function Yd(t) {
9042
+ async function Gd(t) {
9075
9043
  }
9076
- async function Xd(t) {
9044
+ async function Hd(t) {
9077
9045
  }
9078
- const ec = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9046
+ const Yd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9079
9047
  __proto__: null,
9080
- down: Xd,
9081
- up: Yd
9048
+ down: Hd,
9049
+ up: Gd
9082
9050
  }, Symbol.toStringTag, { value: "Module" }));
9083
- async function tc(t) {
9051
+ async function Xd(t) {
9084
9052
  }
9085
- async function nc(t) {
9053
+ async function ec(t) {
9086
9054
  }
9087
- const ac = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9055
+ const tc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9088
9056
  __proto__: null,
9089
- down: nc,
9090
- up: tc
9057
+ down: ec,
9058
+ up: Xd
9091
9059
  }, Symbol.toStringTag, { value: "Module" }));
9092
- async function rc(t) {
9060
+ async function nc(t) {
9093
9061
  }
9094
- async function sc(t) {
9062
+ async function ac(t) {
9095
9063
  }
9096
- const ic = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9064
+ const rc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9097
9065
  __proto__: null,
9098
- down: sc,
9099
- up: rc
9066
+ down: ac,
9067
+ up: nc
9100
9068
  }, Symbol.toStringTag, { value: "Module" }));
9101
- async function oc(t) {
9069
+ async function sc(t) {
9102
9070
  await t.schema.createIndex("users_email_index").on("users").column("email").execute();
9103
9071
  }
9104
- async function dc(t) {
9072
+ async function ic(t) {
9105
9073
  await t.schema.dropIndex("users_email_index").execute();
9106
9074
  }
9107
- const cc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9075
+ const oc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9108
9076
  __proto__: null,
9109
- down: dc,
9110
- up: oc
9077
+ down: ic,
9078
+ up: sc
9111
9079
  }, Symbol.toStringTag, { value: "Module" }));
9112
- async function lc(t) {
9080
+ async function dc(t) {
9113
9081
  await t.schema.alterTable("users").addColumn("profileData", "varchar(2048)").execute();
9114
9082
  }
9115
- async function uc(t) {
9083
+ async function cc(t) {
9116
9084
  await t.schema.alterTable("users").dropColumn("profileData").execute();
9117
9085
  }
9118
- const hc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9086
+ const lc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9119
9087
  __proto__: null,
9120
- down: uc,
9121
- up: lc
9088
+ down: cc,
9089
+ up: dc
9122
9090
  }, Symbol.toStringTag, { value: "Module" }));
9123
- async function pc(t) {
9091
+ async function uc(t) {
9124
9092
  await t.schema.createIndex("users_linked_to_index").on("users").column("linked_to").execute();
9125
9093
  }
9126
- async function mc(t) {
9094
+ async function hc(t) {
9127
9095
  await t.schema.dropIndex("users_linked_to_index");
9128
9096
  }
9129
- const fc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9097
+ const pc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9130
9098
  __proto__: null,
9131
- down: mc,
9132
- up: pc
9099
+ down: hc,
9100
+ up: uc
9133
9101
  }, Symbol.toStringTag, { value: "Module" }));
9134
- async function _c(t) {
9102
+ async function mc(t) {
9135
9103
  await t.schema.alterTable("users").addColumn("locale", "varchar(255)").execute();
9136
9104
  }
9137
- async function gc(t) {
9105
+ async function fc(t) {
9138
9106
  await t.schema.alterTable("users").dropColumn("locale").execute();
9139
9107
  }
9140
- const yc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9108
+ const _c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9141
9109
  __proto__: null,
9142
- down: gc,
9143
- up: _c
9110
+ down: fc,
9111
+ up: mc
9144
9112
  }, Symbol.toStringTag, { value: "Module" }));
9145
- async function vc(t) {
9113
+ async function gc(t) {
9146
9114
  await t.schema.createTable("keys").addColumn("kid", "varchar(255)", (e) => e.primaryKey()).addColumn(
9147
9115
  "tenant_id",
9148
9116
  "varchar(255)",
9149
9117
  (e) => e.references("tenants.id").onDelete("cascade")
9150
9118
  ).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("revoked_at", "varchar(255)").addColumn("cert", "varchar(2048)").addColumn("pkcs7", "varchar(2048)").addColumn("fingerprint", "varchar(256)").addColumn("thumbprint", "varchar(256)").addColumn("current_since", "varchar(256)").addColumn("current_until", "varchar(256)").execute();
9151
9119
  }
9152
- async function bc(t) {
9120
+ async function yc(t) {
9153
9121
  await t.schema.dropTable("keys").execute();
9154
9122
  }
9155
- const wc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9123
+ const vc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9156
9124
  __proto__: null,
9157
- down: bc,
9158
- up: vc
9125
+ down: yc,
9126
+ up: gc
9159
9127
  }, Symbol.toStringTag, { value: "Module" }));
9160
- async function xc(t) {
9128
+ async function bc(t) {
9161
9129
  }
9162
- async function Nc(t) {
9130
+ async function wc(t) {
9163
9131
  }
9164
- const kc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9132
+ const xc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9165
9133
  __proto__: null,
9166
- down: Nc,
9167
- up: xc
9134
+ down: wc,
9135
+ up: bc
9168
9136
  }, Symbol.toStringTag, { value: "Module" }));
9169
- async function Cc(t) {
9137
+ async function Nc(t) {
9170
9138
  }
9171
- async function Tc(t) {
9139
+ async function kc(t) {
9172
9140
  }
9173
- const Oc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9141
+ const Cc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9174
9142
  __proto__: null,
9175
- down: Tc,
9176
- up: Cc
9143
+ down: kc,
9144
+ up: Nc
9177
9145
  }, Symbol.toStringTag, { value: "Module" }));
9178
- async function Sc(t) {
9146
+ async function Tc(t) {
9179
9147
  await t.schema.alterTable("otps").addColumn("audience", "varchar(255)").execute();
9180
9148
  }
9181
- async function jc(t) {
9149
+ async function Oc(t) {
9182
9150
  await t.schema.alterTable("otps").dropColumn("audience").execute();
9183
9151
  }
9184
- const Ic = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9152
+ const Sc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9185
9153
  __proto__: null,
9186
- down: jc,
9187
- up: Sc
9154
+ down: Oc,
9155
+ up: Tc
9188
9156
  }, Symbol.toStringTag, { value: "Module" }));
9189
- async function Zc(t) {
9157
+ async function jc(t) {
9190
9158
  }
9191
- async function Ec(t) {
9159
+ async function Ic(t) {
9192
9160
  }
9193
- const $c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9161
+ const Zc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9194
9162
  __proto__: null,
9195
- down: Ec,
9196
- up: Zc
9163
+ down: Ic,
9164
+ up: jc
9197
9165
  }, Symbol.toStringTag, { value: "Module" }));
9198
- async function Pc(t) {
9166
+ async function Ec(t) {
9199
9167
  await t.schema.alterTable("logs").dropColumn("category").execute();
9200
9168
  }
9201
- async function Ac(t) {
9169
+ async function $c(t) {
9202
9170
  await t.schema.alterTable("logs").addColumn("category", "varchar(255)", (e) => e.notNull()).execute();
9203
9171
  }
9204
- const Dc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9172
+ const Pc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9205
9173
  __proto__: null,
9206
- down: Ac,
9207
- up: Pc
9174
+ down: $c,
9175
+ up: Ec
9208
9176
  }, Symbol.toStringTag, { value: "Module" }));
9209
- async function Rc(t) {
9177
+ async function Ac(t) {
9210
9178
  await t.schema.alterTable("users").dropColumn("tags").execute();
9211
9179
  }
9212
- async function Mc(t) {
9180
+ async function Dc(t) {
9213
9181
  await t.schema.alterTable("users").addColumn("tags", "varchar(255)").execute();
9214
9182
  }
9215
- const Lc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9183
+ const Mc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9216
9184
  __proto__: null,
9217
- down: Mc,
9218
- up: Rc
9185
+ down: Dc,
9186
+ up: Ac
9219
9187
  }, Symbol.toStringTag, { value: "Module" }));
9220
- async function zc(t) {
9188
+ async function Rc(t) {
9221
9189
  await t.schema.createIndex("logs_user_id").on("logs").column("user_id").execute(), await t.schema.createIndex("logs_tenant_id").on("logs").column("tenant_id").execute(), await t.schema.createIndex("logs_date").on("logs").column("date").execute();
9222
9190
  }
9223
- async function Uc(t) {
9191
+ async function Lc(t) {
9224
9192
  await t.schema.dropIndex("logs_user_id"), await t.schema.dropIndex("logs_tenant_id"), await t.schema.dropIndex("logs_date");
9225
9193
  }
9226
- const Fc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9194
+ const zc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9227
9195
  __proto__: null,
9228
- down: Uc,
9229
- up: zc
9196
+ down: Lc,
9197
+ up: Rc
9230
9198
  }, Symbol.toStringTag, { value: "Module" }));
9231
- async function Vc(t) {
9199
+ async function Uc(t) {
9232
9200
  await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(8192)").execute();
9233
9201
  }
9234
- async function Bc(t) {
9202
+ async function Fc(t) {
9235
9203
  await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(2048)").execute();
9236
9204
  }
9237
- const Kc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9205
+ const Vc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9238
9206
  __proto__: null,
9239
- down: Bc,
9240
- up: Vc
9207
+ down: Fc,
9208
+ up: Uc
9241
9209
  }, Symbol.toStringTag, { value: "Module" }));
9242
- async function Jc(t) {
9210
+ async function Bc(t) {
9243
9211
  await t.schema.alterTable("logs").addColumn("user_name", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("auth0_client", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("isMobile", "boolean").execute(), await t.schema.alterTable("logs").addColumn("connection", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("connection_id", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("audience", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("scope", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("strategy", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("strategy_type", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("hostname", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("session_connection", "varchar(255)").execute();
9244
9212
  }
9245
- async function Wc(t) {
9213
+ async function Kc(t) {
9246
9214
  await t.schema.alterTable("logs").dropColumn("user_name").execute(), await t.schema.alterTable("logs").dropColumn("auth0_client").execute(), await t.schema.alterTable("logs").dropColumn("isMobile").execute(), await t.schema.alterTable("logs").dropColumn("connection").execute(), await t.schema.alterTable("logs").dropColumn("connection_id").execute(), await t.schema.alterTable("logs").dropColumn("audience").execute(), await t.schema.alterTable("logs").dropColumn("scope").execute(), await t.schema.alterTable("logs").dropColumn("strategy").execute(), await t.schema.alterTable("logs").dropColumn("strategy_type").execute(), await t.schema.alterTable("logs").dropColumn("hostname").execute(), await t.schema.alterTable("logs").dropColumn("session_connection").execute();
9247
9215
  }
9248
- const qc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9216
+ const Jc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9249
9217
  __proto__: null,
9250
- down: Wc,
9251
- up: Jc
9218
+ down: Kc,
9219
+ up: Bc
9252
9220
  }, Symbol.toStringTag, { value: "Module" }));
9253
- async function Qc(t) {
9221
+ async function Wc(t) {
9254
9222
  await t.schema.createIndex("users_name_index").on("users").column("name").execute();
9255
9223
  }
9256
- async function Gc(t) {
9224
+ async function qc(t) {
9257
9225
  await t.schema.dropIndex("users_name_index").execute();
9258
9226
  }
9259
- const Hc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9227
+ const Qc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9260
9228
  __proto__: null,
9261
- down: Gc,
9262
- up: Qc
9229
+ down: qc,
9230
+ up: Wc
9263
9231
  }, Symbol.toStringTag, { value: "Module" }));
9264
- async function Yc(t) {
9232
+ async function Gc(t) {
9265
9233
  }
9266
- async function Xc(t) {
9234
+ async function Hc(t) {
9267
9235
  await t.schema.alterTable("users").dropConstraint("unique_email_provider").execute();
9268
9236
  }
9269
- const el = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9237
+ const Yc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9270
9238
  __proto__: null,
9271
- down: Xc,
9272
- up: Yc
9239
+ down: Hc,
9240
+ up: Gc
9273
9241
  }, Symbol.toStringTag, { value: "Module" }));
9274
- async function tl(t) {
9242
+ async function Xc(t) {
9275
9243
  await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(8192)").execute();
9276
9244
  }
9277
- async function nl(t) {
9245
+ async function el(t) {
9278
9246
  await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(1024)").execute();
9279
9247
  }
9280
- const al = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9248
+ const tl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9281
9249
  __proto__: null,
9282
- down: nl,
9283
- up: tl
9250
+ down: el,
9251
+ up: Xc
9284
9252
  }, Symbol.toStringTag, { value: "Module" }));
9285
- async function rl(t) {
9253
+ async function nl(t) {
9286
9254
  await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(8192)").execute();
9287
9255
  }
9288
- async function sl(t) {
9256
+ async function al(t) {
9289
9257
  await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(1024)").execute();
9290
9258
  }
9291
- const il = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9259
+ const rl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9292
9260
  __proto__: null,
9293
- down: sl,
9294
- up: rl
9261
+ down: al,
9262
+ up: nl
9295
9263
  }, Symbol.toStringTag, { value: "Module" }));
9296
- async function ol(t) {
9264
+ async function sl(t) {
9297
9265
  await t.schema.createTable("branding").addColumn(
9298
9266
  "tenant_id",
9299
9267
  "varchar(255)",
9300
9268
  (e) => e.references("tenants.id").onDelete("cascade").notNull().primaryKey()
9301
9269
  ).addColumn("logo_url", "varchar(512)").addColumn("favicon_url", "varchar(512)").addColumn("font_url", "varchar(512)").addColumn("colors_primary", "varchar(8)").addColumn("colors_page_background_type", "varchar(32)").addColumn("colors_page_background_start", "varchar(8)").addColumn("colors_page_background_end", "varchar(8)").addColumn("colors_page_background_angle_dev", "integer").execute();
9302
9270
  }
9303
- async function dl(t) {
9271
+ async function il(t) {
9304
9272
  await t.schema.dropTable("branding").execute();
9305
9273
  }
9306
- const cl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9274
+ const ol = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9307
9275
  __proto__: null,
9308
- down: dl,
9309
- up: ol
9276
+ down: il,
9277
+ up: sl
9310
9278
  }, Symbol.toStringTag, { value: "Module" }));
9311
- async function ll(t) {
9279
+ async function dl(t) {
9312
9280
  }
9313
- async function ul(t) {
9281
+ async function cl(t) {
9314
9282
  }
9315
- const hl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9283
+ const ll = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9316
9284
  __proto__: null,
9317
- down: ul,
9318
- up: ll
9285
+ down: cl,
9286
+ up: dl
9319
9287
  }, Symbol.toStringTag, { value: "Module" }));
9320
- async function pl(t) {
9288
+ async function ul(t) {
9321
9289
  }
9322
- async function ml(t) {
9290
+ async function hl(t) {
9323
9291
  }
9324
- const fl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9292
+ const pl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9325
9293
  __proto__: null,
9326
- down: ml,
9327
- up: pl
9294
+ down: hl,
9295
+ up: ul
9328
9296
  }, Symbol.toStringTag, { value: "Module" }));
9329
- async function _l(t) {
9297
+ async function ml(t) {
9330
9298
  }
9331
- async function gl(t) {
9299
+ async function fl(t) {
9332
9300
  }
9333
- const yl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9301
+ const _l = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9334
9302
  __proto__: null,
9335
- down: gl,
9336
- up: _l
9303
+ down: fl,
9304
+ up: ml
9337
9305
  }, Symbol.toStringTag, { value: "Module" }));
9338
- async function vl(t) {
9306
+ async function gl(t) {
9339
9307
  }
9340
- async function bl(t) {
9308
+ async function yl(t) {
9341
9309
  }
9342
- const wl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9310
+ const vl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9343
9311
  __proto__: null,
9344
- down: bl,
9345
- up: vl
9312
+ down: yl,
9313
+ up: gl
9346
9314
  }, Symbol.toStringTag, { value: "Module" }));
9347
- async function xl(t) {
9315
+ async function bl(t) {
9348
9316
  await t.schema.createTable("authentication_codes").addColumn(
9349
9317
  "tenant_id",
9350
9318
  "varchar(255)",
@@ -9355,55 +9323,55 @@ async function xl(t) {
9355
9323
  (e) => e.references("applications.id").onDelete("cascade").notNull()
9356
9324
  ).addColumn("user_id", "varchar(255)", (e) => e.notNull()).addColumn("nonce", "varchar(255)").addColumn("state", "varchar(8192)").addColumn("scope", "varchar(1024)").addColumn("response_type", "varchar(256)").addColumn("response_mode", "varchar(256)").addColumn("redirect_uri", "varchar(1024)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute();
9357
9325
  }
9358
- async function Nl(t) {
9326
+ async function wl(t) {
9359
9327
  await t.schema.dropTable("authentication_codes").execute();
9360
9328
  }
9361
- const kl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9329
+ const xl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9362
9330
  __proto__: null,
9363
- down: Nl,
9364
- up: xl
9331
+ down: wl,
9332
+ up: bl
9365
9333
  }, Symbol.toStringTag, { value: "Module" }));
9366
- async function Cl(t) {
9334
+ async function Nl(t) {
9367
9335
  }
9368
- async function Tl(t) {
9336
+ async function kl(t) {
9369
9337
  }
9370
- const Ol = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9338
+ const Cl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9371
9339
  __proto__: null,
9372
- down: Tl,
9373
- up: Cl
9340
+ down: kl,
9341
+ up: Nl
9374
9342
  }, Symbol.toStringTag, { value: "Module" }));
9375
- async function Sl(t) {
9343
+ async function Tl(t) {
9376
9344
  await t.schema.alterTable("otps").addColumn("ip", "varchar(64)").execute();
9377
9345
  }
9378
- async function jl(t) {
9346
+ async function Ol(t) {
9379
9347
  await t.schema.alterTable("otps").dropColumn("ip").execute();
9380
9348
  }
9381
- const Il = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9349
+ const Sl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9382
9350
  __proto__: null,
9383
- down: jl,
9384
- up: Sl
9351
+ down: Ol,
9352
+ up: Tl
9385
9353
  }, Symbol.toStringTag, { value: "Module" }));
9386
- async function Zl(t) {
9354
+ async function jl(t) {
9387
9355
  await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(1024)").execute();
9388
9356
  }
9389
- async function El(t) {
9357
+ async function Il(t) {
9390
9358
  await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(255)").execute();
9391
9359
  }
9392
- const $l = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9360
+ const Zl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9393
9361
  __proto__: null,
9394
- down: El,
9395
- up: Zl
9362
+ down: Il,
9363
+ up: jl
9396
9364
  }, Symbol.toStringTag, { value: "Module" }));
9397
- async function Pl(t) {
9365
+ async function El(t) {
9398
9366
  }
9399
- async function Al(t) {
9367
+ async function $l(t) {
9400
9368
  }
9401
- const Dl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9369
+ const Pl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9402
9370
  __proto__: null,
9403
- down: Al,
9404
- up: Pl
9371
+ down: $l,
9372
+ up: El
9405
9373
  }, Symbol.toStringTag, { value: "Module" }));
9406
- async function Rl(t) {
9374
+ async function Al(t) {
9407
9375
  await t.schema.createTable("hooks").addColumn("hook_id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
9408
9376
  "tenant_id",
9409
9377
  "varchar(255)",
@@ -9414,33 +9382,33 @@ async function Rl(t) {
9414
9382
  (e) => e.defaultTo(!1).notNull()
9415
9383
  ).addColumn("priority", "integer").execute();
9416
9384
  }
9417
- async function Ml(t) {
9385
+ async function Dl(t) {
9418
9386
  await t.schema.dropTable("hooks").execute();
9419
9387
  }
9420
- const Ll = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9388
+ const Ml = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9421
9389
  __proto__: null,
9422
- down: Ml,
9423
- up: Rl
9390
+ down: Dl,
9391
+ up: Al
9424
9392
  }, Symbol.toStringTag, { value: "Module" }));
9425
- async function zl(t) {
9393
+ async function Rl(t) {
9426
9394
  }
9427
- async function Ul(t) {
9395
+ async function Ll(t) {
9428
9396
  }
9429
- const Fl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9397
+ const zl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9430
9398
  __proto__: null,
9431
- down: Ul,
9432
- up: zl
9399
+ down: Ll,
9400
+ up: Rl
9433
9401
  }, Symbol.toStringTag, { value: "Module" }));
9434
- async function Vl(t) {
9402
+ async function Ul(t) {
9435
9403
  }
9436
- async function Bl(t) {
9404
+ async function Fl(t) {
9437
9405
  }
9438
- const Kl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9406
+ const Vl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9439
9407
  __proto__: null,
9440
- down: Bl,
9441
- up: Vl
9408
+ down: Fl,
9409
+ up: Ul
9442
9410
  }, Symbol.toStringTag, { value: "Module" }));
9443
- async function Jl(t) {
9411
+ async function Bl(t) {
9444
9412
  await t.schema.createTable("logins").addColumn("login_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
9445
9413
  "tenant_id",
9446
9414
  "varchar(255)",
@@ -9457,7 +9425,7 @@ async function Jl(t) {
9457
9425
  (e) => e.onDelete("cascade")
9458
9426
  ).addColumn("code_type", "varchar(255)", (e) => e.notNull()).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute();
9459
9427
  }
9460
- async function Wl(t) {
9428
+ async function Kl(t) {
9461
9429
  await t.schema.dropTable("logins").execute(), await t.schema.alterTable("passwords").dropColumn("algorithm").execute(), await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("id", "varchar(255)", (e) => e.primaryKey()).addColumn("code", "varchar(255)", (e) => e.notNull()).addColumn("user_id", "varchar(255)").addColumn("tenant_id", "varchar(255)").addForeignKeyConstraint(
9462
9430
  "codes_user_id_tenant_id_constraint",
9463
9431
  ["user_id", "tenant_id"],
@@ -9466,90 +9434,90 @@ async function Wl(t) {
9466
9434
  (e) => e.onDelete("cascade")
9467
9435
  ).addColumn("type", "varchar(255)", (e) => e.notNull()).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute();
9468
9436
  }
9469
- const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9437
+ const Jl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9470
9438
  __proto__: null,
9471
- down: Wl,
9472
- up: Jl
9439
+ down: Kl,
9440
+ up: Bl
9473
9441
  }, Symbol.toStringTag, { value: "Module" }));
9474
- async function Ql(t) {
9442
+ async function Wl(t) {
9475
9443
  }
9476
- async function Gl(t) {
9444
+ async function ql(t) {
9477
9445
  }
9478
- const Hl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9446
+ const Ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9479
9447
  __proto__: null,
9480
- down: Gl,
9481
- up: Ql
9448
+ down: ql,
9449
+ up: Wl
9482
9450
  }, Symbol.toStringTag, { value: "Module" }));
9483
- async function Yl(t) {
9451
+ async function Gl(t) {
9484
9452
  await t.schema.alterTable("logins").addColumn("auth0Client", "varchar(256)").execute();
9485
9453
  }
9486
- async function Xl(t) {
9454
+ async function Hl(t) {
9487
9455
  await t.schema.alterTable("logins").dropColumn("auth0Client").execute();
9488
9456
  }
9489
- const eu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9457
+ const Yl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9490
9458
  __proto__: null,
9491
- down: Xl,
9492
- up: Yl
9459
+ down: Hl,
9460
+ up: Gl
9493
9461
  }, Symbol.toStringTag, { value: "Module" }));
9494
- async function tu(t) {
9462
+ async function Xl(t) {
9495
9463
  await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(8192)").execute();
9496
9464
  }
9497
- async function nu(t) {
9465
+ async function eu(t) {
9498
9466
  await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(511)").execute();
9499
9467
  }
9500
- const au = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9468
+ const tu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9501
9469
  __proto__: null,
9502
- down: nu,
9503
- up: tu
9470
+ down: eu,
9471
+ up: Xl
9504
9472
  }, Symbol.toStringTag, { value: "Module" }));
9505
- async function ru(t) {
9473
+ async function nu(t) {
9506
9474
  }
9507
- async function su(t) {
9475
+ async function au(t) {
9508
9476
  }
9509
- const iu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9477
+ const ru = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9510
9478
  __proto__: null,
9511
- down: su,
9512
- up: ru
9479
+ down: au,
9480
+ up: nu
9513
9481
  }, Symbol.toStringTag, { value: "Module" }));
9514
- async function ou(t) {
9482
+ async function su(t) {
9515
9483
  }
9516
- async function du(t) {
9484
+ async function iu(t) {
9517
9485
  }
9518
- const cu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9486
+ const ou = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9519
9487
  __proto__: null,
9520
- down: du,
9521
- up: ou
9488
+ down: iu,
9489
+ up: su
9522
9490
  }, Symbol.toStringTag, { value: "Module" }));
9523
- async function lu(t) {
9491
+ async function du(t) {
9524
9492
  await t.schema.alterTable("logins").addColumn("authParams_nonce", "varchar(255)").execute();
9525
9493
  }
9526
- async function uu(t) {
9494
+ async function cu(t) {
9527
9495
  await t.schema.alterTable("logins").dropColumn("nonce").execute();
9528
9496
  }
9529
- const hu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9497
+ const lu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9530
9498
  __proto__: null,
9531
- down: uu,
9532
- up: lu
9499
+ down: cu,
9500
+ up: du
9533
9501
  }, Symbol.toStringTag, { value: "Module" }));
9534
- async function pu(t) {
9502
+ async function uu(t) {
9535
9503
  }
9536
- async function mu(t) {
9504
+ async function hu(t) {
9537
9505
  }
9538
- const fu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9506
+ const pu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9539
9507
  __proto__: null,
9540
- down: mu,
9541
- up: pu
9508
+ down: hu,
9509
+ up: uu
9542
9510
  }, Symbol.toStringTag, { value: "Module" }));
9543
- async function _u(t) {
9511
+ async function mu(t) {
9544
9512
  }
9545
- async function gu(t) {
9513
+ async function fu(t) {
9546
9514
  }
9547
- const yu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9515
+ const _u = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9548
9516
  __proto__: null,
9549
- down: gu,
9550
- up: _u
9517
+ down: fu,
9518
+ up: mu
9551
9519
  }, Symbol.toStringTag, { value: "Module" }));
9552
- async function vu(t) {
9520
+ async function gu(t) {
9553
9521
  await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.notNull()).addColumn(
9554
9522
  "tenant_id",
9555
9523
  "varchar(255)",
@@ -9565,7 +9533,7 @@ async function vu(t) {
9565
9533
  "code_type"
9566
9534
  ]).execute();
9567
9535
  }
9568
- async function bu(t) {
9536
+ async function yu(t) {
9569
9537
  await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
9570
9538
  "tenant_id",
9571
9539
  "varchar(255)",
@@ -9578,15 +9546,15 @@ async function bu(t) {
9578
9546
  (e) => e.onDelete("cascade")
9579
9547
  ).addColumn("code_type", "varchar(255)", (e) => e.notNull()).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute();
9580
9548
  }
9581
- const wu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9549
+ const vu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9582
9550
  __proto__: null,
9583
- down: bu,
9584
- up: vu
9551
+ down: yu,
9552
+ up: gu
9585
9553
  }, Symbol.toStringTag, { value: "Module" }));
9586
- async function xu(t) {
9554
+ async function bu(t) {
9587
9555
  await t.schema.dropTable("otps").execute(), await t.schema.dropTable("authentication_codes").execute();
9588
9556
  }
9589
- async function Nu(t) {
9557
+ async function wu(t) {
9590
9558
  await t.schema.alterTable("keys").addColumn("private_key", "varchar(2048)").addColumn("public_key", "varchar(2048)").execute(), await t.schema.createTable("otps").addColumn(
9591
9559
  "tenant_id",
9592
9560
  "varchar(255)",
@@ -9605,32 +9573,32 @@ async function Nu(t) {
9605
9573
  (e) => e.references("applications.id").onDelete("cascade").notNull()
9606
9574
  ).addColumn("user_id", "varchar(255)", (e) => e.notNull()).addColumn("nonce", "varchar(255)").addColumn("state", "varchar(8192)").addColumn("scope", "varchar(1024)").addColumn("response_type", "varchar(256)").addColumn("response_mode", "varchar(256)").addColumn("redirect_uri", "varchar(1024)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute();
9607
9575
  }
9608
- const ku = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9576
+ const xu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9609
9577
  __proto__: null,
9610
- down: Nu,
9611
- up: xu
9578
+ down: wu,
9579
+ up: bu
9612
9580
  }, Symbol.toStringTag, { value: "Module" }));
9613
- async function Cu(t) {
9581
+ async function Nu(t) {
9614
9582
  await t.schema.createIndex("IDX_logs_tenant_date_type_user").on("logs").columns(["tenant_id", "date", "type", "user_id"]).execute();
9615
9583
  }
9616
- async function Tu(t) {
9584
+ async function ku(t) {
9617
9585
  await t.schema.dropIndex("IDX_logs_tenant_date_type_user").on("logs").execute();
9618
9586
  }
9619
- const Ou = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9587
+ const Cu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9620
9588
  __proto__: null,
9621
- down: Tu,
9622
- up: Cu
9589
+ down: ku,
9590
+ up: Nu
9623
9591
  }, Symbol.toStringTag, { value: "Module" }));
9624
- async function Su(t) {
9592
+ async function Tu(t) {
9625
9593
  }
9626
- async function ju(t) {
9594
+ async function Ou(t) {
9627
9595
  }
9628
- const Iu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9596
+ const Su = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9629
9597
  __proto__: null,
9630
- down: ju,
9631
- up: Su
9598
+ down: Ou,
9599
+ up: Tu
9632
9600
  }, Symbol.toStringTag, { value: "Module" }));
9633
- async function Zu(t) {
9601
+ async function ju(t) {
9634
9602
  await t.schema.createTable("prompt_settings").addColumn("tenant_id", "varchar(64)", (e) => e.primaryKey()).addColumn(
9635
9603
  "universal_login_experience",
9636
9604
  "varchar(16)",
@@ -9649,95 +9617,95 @@ async function Zu(t) {
9649
9617
  (e) => e.defaultTo(!1).notNull()
9650
9618
  ).execute();
9651
9619
  }
9652
- async function Eu(t) {
9620
+ async function Iu(t) {
9653
9621
  await t.schema.dropTable("prompt_settings").execute();
9654
9622
  }
9655
- const $u = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9623
+ const Zu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9656
9624
  __proto__: null,
9657
- down: Eu,
9658
- up: Zu
9625
+ down: Iu,
9626
+ up: ju
9659
9627
  }, Symbol.toStringTag, { value: "Module" }));
9660
- async function Pu(t) {
9628
+ async function Eu(t) {
9661
9629
  }
9662
- async function Au(t) {
9630
+ async function $u(t) {
9663
9631
  }
9664
- const Du = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9632
+ const Pu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9665
9633
  __proto__: null,
9666
- down: Au,
9667
- up: Pu
9634
+ down: $u,
9635
+ up: Eu
9668
9636
  }, Symbol.toStringTag, { value: "Module" }));
9669
- async function Ru(t) {
9637
+ async function Au(t) {
9670
9638
  }
9671
- async function Mu(t) {
9639
+ async function Du(t) {
9672
9640
  }
9673
- const Lu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9641
+ const Mu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9674
9642
  __proto__: null,
9675
- down: Mu,
9676
- up: Ru
9643
+ down: Du,
9644
+ up: Au
9677
9645
  }, Symbol.toStringTag, { value: "Module" }));
9678
- async function zu(t) {
9646
+ async function Ru(t) {
9679
9647
  }
9680
- async function Uu(t) {
9648
+ async function Lu(t) {
9681
9649
  }
9682
- const Fu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9650
+ const zu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9683
9651
  __proto__: null,
9684
- down: Uu,
9685
- up: zu
9652
+ down: Lu,
9653
+ up: Ru
9686
9654
  }, Symbol.toStringTag, { value: "Module" }));
9687
- async function Vu(t) {
9655
+ async function Uu(t) {
9688
9656
  await t.schema.alterTable("logins").addColumn("authParams_ui_locales", "varchar(32)").execute();
9689
9657
  }
9690
- async function Bu(t) {
9658
+ async function Fu(t) {
9691
9659
  await t.schema.alterTable("logins").dropColumn("authParams_ui_locales").execute();
9692
9660
  }
9693
- const Ku = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9661
+ const Vu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9694
9662
  __proto__: null,
9695
- down: Bu,
9696
- up: Vu
9663
+ down: Fu,
9664
+ up: Uu
9697
9665
  }, Symbol.toStringTag, { value: "Module" }));
9698
- async function Ju(t) {
9666
+ async function Bu(t) {
9699
9667
  await t.schema.alterTable("logins").addColumn("authParams_prompt", "varchar(16)").execute();
9700
9668
  }
9701
- async function Wu(t) {
9669
+ async function Ku(t) {
9702
9670
  await t.schema.alterTable("logins").dropColumn("authParams_prompt").execute();
9703
9671
  }
9704
- const qu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9672
+ const Ju = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9705
9673
  __proto__: null,
9706
- down: Wu,
9707
- up: Ju
9674
+ down: Ku,
9675
+ up: Bu
9708
9676
  }, Symbol.toStringTag, { value: "Module" }));
9709
- async function Qu(t) {
9677
+ async function Wu(t) {
9710
9678
  }
9711
- async function Gu(t) {
9679
+ async function qu(t) {
9712
9680
  }
9713
- const Hu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9681
+ const Qu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9714
9682
  __proto__: null,
9715
- down: Gu,
9716
- up: Qu
9683
+ down: qu,
9684
+ up: Wu
9717
9685
  }, Symbol.toStringTag, { value: "Module" }));
9718
- async function Yu(t) {
9686
+ async function Gu(t) {
9719
9687
  await t.schema.alterTable("logins").addColumn("authParams_act_as", "varchar(255)").execute();
9720
9688
  }
9721
- async function Xu(t) {
9689
+ async function Hu(t) {
9722
9690
  await t.schema.alterTable("logins").dropColumn("authParam_act_as").execute();
9723
9691
  }
9724
- const eh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9692
+ const Yu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9725
9693
  __proto__: null,
9726
- down: Xu,
9727
- up: Yu
9694
+ down: Hu,
9695
+ up: Gu
9728
9696
  }, Symbol.toStringTag, { value: "Module" }));
9729
- async function th(t) {
9697
+ async function Xu(t) {
9730
9698
  await t.schema.alterTable("codes").addColumn("code_verifier", "varchar(128)").execute();
9731
9699
  }
9732
- async function nh(t) {
9700
+ async function eh(t) {
9733
9701
  await t.schema.alterTable("codes").dropColumn("code_verifier").execute();
9734
9702
  }
9735
- const ah = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9703
+ const th = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9736
9704
  __proto__: null,
9737
- down: nh,
9738
- up: th
9705
+ down: eh,
9706
+ up: Xu
9739
9707
  }, Symbol.toStringTag, { value: "Module" }));
9740
- async function rh(t) {
9708
+ async function nh(t) {
9741
9709
  await t.schema.createTable("email_providers").addColumn("tenant_id", "varchar(255)", (e) => e.primaryKey()).addColumn("name", "varchar(255)", (e) => e.notNull()).addColumn("enabled", "boolean", (e) => e.notNull()).addColumn("default_from_address", "varchar(255)").addColumn(
9742
9710
  "credentials",
9743
9711
  "varchar(2048)",
@@ -9748,18 +9716,18 @@ async function rh(t) {
9748
9716
  (e) => e.notNull().defaultTo("{}")
9749
9717
  ).addColumn("created_at", "varchar(29)", (e) => e.notNull()).addColumn("updated_at", "varchar(29)", (e) => e.notNull()).execute();
9750
9718
  }
9751
- async function sh(t) {
9719
+ async function ah(t) {
9752
9720
  await t.schema.dropTable("email_providers").execute();
9753
9721
  }
9754
- const ih = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9722
+ const rh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9755
9723
  __proto__: null,
9756
- down: sh,
9757
- up: rh
9724
+ down: ah,
9725
+ up: nh
9758
9726
  }, Symbol.toStringTag, { value: "Module" }));
9759
- async function oh(t) {
9727
+ async function sh(t) {
9760
9728
  await t.schema.dropTable("tickets").execute();
9761
9729
  }
9762
- async function dh(t) {
9730
+ async function ih(t) {
9763
9731
  await t.schema.createTable("tickets").addColumn(
9764
9732
  "tenant_id",
9765
9733
  "varchar(255)",
@@ -9770,93 +9738,93 @@ async function dh(t) {
9770
9738
  (e) => e.references("applications.id").onDelete("cascade").notNull()
9771
9739
  ).addColumn("email", "varchar(255)", (e) => e.notNull()).addColumn("nonce", "varchar(255)").addColumn("state", "varchar(1024)").addColumn("scope", "varchar(1024)").addColumn("response_type", "varchar(256)").addColumn("response_mode", "varchar(256)").addColumn("redirect_uri", "varchar(1024)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute();
9772
9740
  }
9773
- const ch = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9741
+ const oh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9774
9742
  __proto__: null,
9775
- down: dh,
9776
- up: oh
9743
+ down: ih,
9744
+ up: sh
9777
9745
  }, Symbol.toStringTag, { value: "Module" }));
9778
- async function lh(t) {
9746
+ async function dh(t) {
9779
9747
  }
9780
- async function uh(t) {
9748
+ async function ch(t) {
9781
9749
  await t.schema.alterTable("logins").dropColumn("ip").dropColumn("useragent").execute();
9782
9750
  }
9783
- const hh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9751
+ const lh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9784
9752
  __proto__: null,
9785
- down: uh,
9786
- up: lh
9787
- }, Symbol.toStringTag, { value: "Module" })), Qa = {
9788
- m1_init: Od,
9789
- m2_magicLink: Id,
9790
- m3_updateAt: $d,
9791
- m4_logTable: Dd,
9792
- m5_userProfile: Ld,
9793
- m6_sessions: Fd,
9794
- m7_passwords: Kd,
9795
- m8_logsTableNewFields: qd,
9796
- m9_passwordTableNewField: Hd,
9797
- n01_codesTable: ec,
9798
- n11_universalLoginSession: ac,
9799
- n12_userFields: ic,
9800
- n13_userEmailIndex: cc,
9801
- n14_profileDataField: hc,
9802
- n15_userEmailIndex: fc,
9803
- n16_userLocale: yc,
9804
- n17_signingKeys: wc,
9805
- n18_logsFields: kc,
9806
- n19_connectionsUserinfo: Oc,
9807
- n20_missingFields: Ic,
9808
- n21_sessionDeletedAt: $c,
9809
- n22_dropLogsFields: Dc,
9810
- n23_dropUsersFields: Lc,
9811
- n24_logsIndexes: Fc,
9812
- n25_logDescMaxLength: Kc,
9813
- n26_logsTableExtraFields: qc,
9814
- n27_usersTableNameIndex: Hc,
9815
- n28_usersEmailConstrain: el,
9816
- n29_increaseOtpStateLength: al,
9817
- n30_increaseTicketStateLength: il,
9818
- n31_branding: cl,
9819
- n32_indexesAndNotNull: hl,
9820
- n33_vendorIdInUniversalLoginSession: fl,
9821
- n34_auth0ClientInUniversalLoginSession: yl,
9822
- n35_increaseUniversalSessionStateLength: wl,
9823
- n36_authenticationCodes: kl,
9824
- n37_disableSignUps: Ol,
9825
- n38_otpIpAddress: Il,
9826
- n39_increaseUserAgentLength: $l,
9827
- n40_userId: Dl,
9828
- n41_hooks: Ll,
9829
- n42_userIdIndexes: Fl,
9830
- n43_userIdIndexes: Kl,
9831
- n44_codes: ql,
9832
- n45_hookProperties: Hl,
9833
- n46_loginAuth0Client: eu,
9834
- n47_loginAuth0Client: au,
9835
- n48_saml: iu,
9836
- n49_removeFields: cu,
9837
- n50_authParamsNonce: hu,
9838
- n51_connectionid: fu,
9839
- n52_cert: yu,
9840
- n53_codes_primary_key: wu,
9841
- n54_cleanup_tables: ku,
9842
- n55_logs_index: Ou,
9843
- n56_application_fields: Iu,
9844
- n57_prompt_settings: $u,
9845
- n58_connection_client_id: Du,
9846
- n59_connection_options: Lu,
9847
- n60_users_metadata: Fu,
9848
- n61_userLocales: Ku,
9849
- n62_prompt: qu,
9850
- n63_connection_cleanup: Hu,
9851
- n64_act_as: eh,
9852
- n65_code_verifier: ah,
9853
- n66_email_providers: ih,
9854
- n67_drop_tickets: ch,
9855
- n68_login_useragents: hh
9753
+ down: ch,
9754
+ up: dh
9755
+ }, Symbol.toStringTag, { value: "Module" })), Wa = {
9756
+ m1_init: Cd,
9757
+ m2_magicLink: Sd,
9758
+ m3_updateAt: Zd,
9759
+ m4_logTable: Pd,
9760
+ m5_userProfile: Md,
9761
+ m6_sessions: zd,
9762
+ m7_passwords: Vd,
9763
+ m8_logsTableNewFields: Jd,
9764
+ m9_passwordTableNewField: Qd,
9765
+ n01_codesTable: Yd,
9766
+ n11_universalLoginSession: tc,
9767
+ n12_userFields: rc,
9768
+ n13_userEmailIndex: oc,
9769
+ n14_profileDataField: lc,
9770
+ n15_userEmailIndex: pc,
9771
+ n16_userLocale: _c,
9772
+ n17_signingKeys: vc,
9773
+ n18_logsFields: xc,
9774
+ n19_connectionsUserinfo: Cc,
9775
+ n20_missingFields: Sc,
9776
+ n21_sessionDeletedAt: Zc,
9777
+ n22_dropLogsFields: Pc,
9778
+ n23_dropUsersFields: Mc,
9779
+ n24_logsIndexes: zc,
9780
+ n25_logDescMaxLength: Vc,
9781
+ n26_logsTableExtraFields: Jc,
9782
+ n27_usersTableNameIndex: Qc,
9783
+ n28_usersEmailConstrain: Yc,
9784
+ n29_increaseOtpStateLength: tl,
9785
+ n30_increaseTicketStateLength: rl,
9786
+ n31_branding: ol,
9787
+ n32_indexesAndNotNull: ll,
9788
+ n33_vendorIdInUniversalLoginSession: pl,
9789
+ n34_auth0ClientInUniversalLoginSession: _l,
9790
+ n35_increaseUniversalSessionStateLength: vl,
9791
+ n36_authenticationCodes: xl,
9792
+ n37_disableSignUps: Cl,
9793
+ n38_otpIpAddress: Sl,
9794
+ n39_increaseUserAgentLength: Zl,
9795
+ n40_userId: Pl,
9796
+ n41_hooks: Ml,
9797
+ n42_userIdIndexes: zl,
9798
+ n43_userIdIndexes: Vl,
9799
+ n44_codes: Jl,
9800
+ n45_hookProperties: Ql,
9801
+ n46_loginAuth0Client: Yl,
9802
+ n47_loginAuth0Client: tu,
9803
+ n48_saml: ru,
9804
+ n49_removeFields: ou,
9805
+ n50_authParamsNonce: lu,
9806
+ n51_connectionid: pu,
9807
+ n52_cert: _u,
9808
+ n53_codes_primary_key: vu,
9809
+ n54_cleanup_tables: xu,
9810
+ n55_logs_index: Cu,
9811
+ n56_application_fields: Su,
9812
+ n57_prompt_settings: Zu,
9813
+ n58_connection_client_id: Pu,
9814
+ n59_connection_options: Mu,
9815
+ n60_users_metadata: zu,
9816
+ n61_userLocales: Vu,
9817
+ n62_prompt: Ju,
9818
+ n63_connection_cleanup: Qu,
9819
+ n64_act_as: Yu,
9820
+ n65_code_verifier: th,
9821
+ n66_email_providers: rh,
9822
+ n67_drop_tickets: oh,
9823
+ n68_login_useragents: lh
9856
9824
  };
9857
- async function mh(t, e = !1) {
9825
+ async function hh(t, e = !1) {
9858
9826
  e && console.log("migrating...");
9859
- const n = new qa(Qa), a = new $a({
9827
+ const n = new Ja(Wa), a = new Za({
9860
9828
  db: t,
9861
9829
  provider: n
9862
9830
  }), { error: r, results: s } = await a.migrateToLatest();
@@ -9867,9 +9835,9 @@ async function mh(t, e = !1) {
9867
9835
  }), r)
9868
9836
  throw console.error("failed to migrate"), console.error(r), r;
9869
9837
  }
9870
- async function fh(t) {
9838
+ async function ph(t) {
9871
9839
  console.log("migrating...");
9872
- const e = new qa(Qa), n = new $a({
9840
+ const e = new Ja(Wa), n = new Za({
9873
9841
  db: t,
9874
9842
  provider: e
9875
9843
  }), { error: a, results: r } = await n.migrateDown();
@@ -9878,29 +9846,29 @@ async function fh(t) {
9878
9846
  }), a)
9879
9847
  throw console.error("failed to migrate"), console.error(a), a;
9880
9848
  }
9881
- function _h(t) {
9849
+ function mh(t) {
9882
9850
  return {
9883
- applications: wi(t),
9884
- branding: Ko(t),
9885
- clients: Ao(t),
9886
- codes: fi(t),
9887
- connections: Po(t),
9888
- emailProviders: md(t),
9889
- domains: Fo(t),
9890
- hooks: Ho(t),
9891
- keys: Lo(t),
9892
- logins: od(t),
9893
- logs: ei(t),
9894
- passwords: li(t),
9895
- promptSettings: ld(t),
9896
- users: Fs(t),
9897
- sessions: ii(t),
9898
- tenants: Qs(t),
9899
- themes: nd(t)
9851
+ applications: vi(t),
9852
+ branding: Vo(t),
9853
+ clients: $o(t),
9854
+ codes: pi(t),
9855
+ connections: Eo(t),
9856
+ emailProviders: hd(t),
9857
+ domains: zo(t),
9858
+ hooks: Qo(t),
9859
+ keys: Mo(t),
9860
+ logins: sd(t),
9861
+ logs: Ys(t),
9862
+ passwords: di(t),
9863
+ promptSettings: dd(t),
9864
+ users: zs(t),
9865
+ sessions: ri(t),
9866
+ tenants: Ws(t),
9867
+ themes: ed(t)
9900
9868
  };
9901
9869
  }
9902
9870
  export {
9903
- _h as default,
9904
- fh as migrateDown,
9905
- mh as migrateToLatest
9871
+ mh as default,
9872
+ ph as migrateDown,
9873
+ hh as migrateToLatest
9906
9874
  };