@authhero/kysely-adapter 0.7.3 → 0.7.5

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,6 +1,6 @@
1
- var Yn = Object.defineProperty;
2
- var Gn = (n, e, t) => e in n ? Yn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var Yt = (n, e, t) => Gn(n, typeof e != "symbol" ? e + "" : e, t);
1
+ var Kn = Object.defineProperty;
2
+ var Qn = (n, e, t) => e in n ? Kn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
+ var Yt = (n, e, t) => Qn(n, typeof e != "symbol" ? e + "" : e, t);
4
4
  var Et = class extends Error {
5
5
  constructor(e = 500, t) {
6
6
  super(t == null ? void 0 : t.message, { cause: t == null ? void 0 : t.cause });
@@ -17,7 +17,7 @@ var Et = class extends Error {
17
17
  });
18
18
  }
19
19
  };
20
- function Xn(n) {
20
+ function Hn(n) {
21
21
  return async (e, t) => {
22
22
  const { identities: s, ...r } = t, a = {
23
23
  ...r,
@@ -47,7 +47,7 @@ function R(n) {
47
47
  e[t] === null ? delete e[t] : typeof e[t] == "object" && (Array.isArray(e[t]) ? e[t] = e[t].map(R) : e[t] = R(e[t]));
48
48
  return e;
49
49
  }
50
- function es(n, e) {
50
+ function Yn(n, e) {
51
51
  var t = {};
52
52
  for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && e.indexOf(s) < 0 && (t[s] = n[s]);
53
53
  if (n != null && typeof Object.getOwnPropertySymbols == "function")
@@ -55,7 +55,7 @@ function es(n, e) {
55
55
  e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, s[r]) && (t[s[r]] = n[s[r]]);
56
56
  return t;
57
57
  }
58
- function ts(n, e) {
58
+ function Gn(n, e) {
59
59
  var t;
60
60
  return ((t = n == null ? void 0 : n._def) === null || t === void 0 ? void 0 : t.typeName) === e;
61
61
  }
@@ -66,15 +66,15 @@ function Qe(n, e) {
66
66
  return r._def.openapi = this._def.openapi, r;
67
67
  };
68
68
  }
69
- function ns(n) {
69
+ function Xn(n) {
70
70
  if (typeof n.ZodType.prototype.openapi < "u")
71
71
  return;
72
72
  n.ZodType.prototype.openapi = function(r, a) {
73
73
  var o, c, d, u, l, T;
74
- const C = typeof r == "string" ? a : r, L = C ?? {}, { param: J } = L, re = es(L, ["param"]), ce = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), de = Object.assign(Object.assign(Object.assign({}, (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata), re), !((u = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || u === void 0) && u.param || J ? {
75
- param: Object.assign(Object.assign({}, (T = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || T === void 0 ? void 0 : T.param), J)
74
+ const C = typeof r == "string" ? a : r, L = C ?? {}, { param: K } = L, re = Yn(L, ["param"]), ce = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), de = Object.assign(Object.assign(Object.assign({}, (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata), re), !((u = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || u === void 0) && u.param || K ? {
75
+ param: Object.assign(Object.assign({}, (T = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || T === void 0 ? void 0 : T.param), K)
76
76
  } : void 0), ue = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(ce).length > 0 ? { _internal: ce } : void 0), Object.keys(de).length > 0 ? { metadata: de } : void 0) }));
77
- if (ts(this, "ZodObject")) {
77
+ if (Gn(this, "ZodObject")) {
78
78
  const $e = this.extend;
79
79
  ue.extend = function(...Pe) {
80
80
  var Q, H, Y, le, Te, Oe;
@@ -145,14 +145,14 @@ var N;
145
145
  }
146
146
  n.joinValues = s, n.jsonStringifyReplacer = (r, a) => typeof a == "bigint" ? a.toString() : a;
147
147
  })(N || (N = {}));
148
- var nn;
148
+ var en;
149
149
  (function(n) {
150
150
  n.mergeShapes = (e, t) => ({
151
151
  ...e,
152
152
  ...t
153
153
  // second overwrites first
154
154
  });
155
- })(nn || (nn = {}));
155
+ })(en || (en = {}));
156
156
  const _ = N.arrayToEnum([
157
157
  "string",
158
158
  "nan",
@@ -212,7 +212,7 @@ const _ = N.arrayToEnum([
212
212
  "invalid_intersection_types",
213
213
  "not_multiple_of",
214
214
  "not_finite"
215
- ]), ss = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
215
+ ]), es = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
216
216
  class V extends Error {
217
217
  constructor(e) {
218
218
  super(), this.issues = [], this.addIssue = (s) => {
@@ -329,12 +329,12 @@ const ze = (n, e) => {
329
329
  }
330
330
  return { message: t };
331
331
  };
332
- let xn = ze;
333
- function rs(n) {
334
- xn = n;
332
+ let wn = ze;
333
+ function ts(n) {
334
+ wn = n;
335
335
  }
336
336
  function At() {
337
- return xn;
337
+ return wn;
338
338
  }
339
339
  const Rt = (n) => {
340
340
  const { data: e, path: t, errorMaps: s, issueData: r } = n, a = [...t, ...r.path || []], o = {
@@ -356,7 +356,7 @@ const Rt = (n) => {
356
356
  path: a,
357
357
  message: c
358
358
  };
359
- }, as = [];
359
+ }, ns = [];
360
360
  function f(n, e) {
361
361
  const t = At(), s = Rt({
362
362
  issueData: e,
@@ -415,12 +415,12 @@ class $ {
415
415
  }
416
416
  const x = Object.freeze({
417
417
  status: "aborted"
418
- }), $t = (n) => ({ status: "dirty", value: n }), D = (n) => ({ status: "valid", value: n }), sn = (n) => n.status === "aborted", rn = (n) => n.status === "dirty", tt = (n) => n.status === "valid", nt = (n) => typeof Promise < "u" && n instanceof Promise;
418
+ }), $t = (n) => ({ status: "dirty", value: n }), D = (n) => ({ status: "valid", value: n }), tn = (n) => n.status === "aborted", nn = (n) => n.status === "dirty", tt = (n) => n.status === "valid", nt = (n) => typeof Promise < "u" && n instanceof Promise;
419
419
  function Pt(n, e, t, s) {
420
420
  if (typeof e == "function" ? n !== e || !s : !e.has(n)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
421
421
  return e.get(n);
422
422
  }
423
- function Tn(n, e, t, s, r) {
423
+ function kn(n, e, t, s, r) {
424
424
  if (typeof e == "function" ? n !== e || !r : !e.has(n)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
425
425
  return e.set(n, t), t;
426
426
  }
@@ -437,7 +437,7 @@ class ee {
437
437
  return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
438
438
  }
439
439
  }
440
- const gn = (n, e) => {
440
+ const fn = (n, e) => {
441
441
  if (tt(e))
442
442
  return { success: !0, data: e.value };
443
443
  if (!n.common.issues.length)
@@ -527,7 +527,7 @@ class Z {
527
527
  data: e,
528
528
  parsedType: he(e)
529
529
  }, a = this._parseSync({ data: e, path: r.path, parent: r });
530
- return gn(r, a);
530
+ return fn(r, a);
531
531
  }
532
532
  async parseAsync(e, t) {
533
533
  const s = await this.safeParseAsync(e, t);
@@ -548,7 +548,7 @@ class Z {
548
548
  data: e,
549
549
  parsedType: he(e)
550
550
  }, r = this._parse({ data: e, path: s.path, parent: s }), a = await (nt(r) ? r : Promise.resolve(r));
551
- return gn(s, a);
551
+ return fn(s, a);
552
552
  }
553
553
  refine(e, t) {
554
554
  const s = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
@@ -612,7 +612,7 @@ class Z {
612
612
  });
613
613
  }
614
614
  brand() {
615
- return new ln({
615
+ return new dn({
616
616
  typeName: w.ZodBranded,
617
617
  type: this,
618
618
  ...O(this._def)
@@ -647,23 +647,23 @@ class Z {
647
647
  return this.safeParse(null).success;
648
648
  }
649
649
  }
650
- const is = /^c[^\s-]{8,}$/i, os = /^[0-9a-z]+$/, cs = /^[0-9A-HJKMNP-TV-Z]{26}$/, ds = /^[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, us = /^[a-z0-9_-]{21}$/i, ls = /^[-+]?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)?)??$/, ps = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, hs = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
650
+ const ss = /^c[^\s-]{8,}$/i, rs = /^[0-9a-z]+$/, as = /^[0-9A-HJKMNP-TV-Z]{26}$/, is = /^[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, os = /^[a-z0-9_-]{21}$/i, cs = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, ds = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, us = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
651
651
  let Gt;
652
- const fs = /^(?:(?: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])$/, ms = /^(([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})))$/, _s = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, On = "((\\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])))", gs = new RegExp(`^${On}$`);
653
- function Sn(n) {
652
+ const ls = /^(?:(?: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])$/, ps = /^(([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})))$/, hs = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, bn = "((\\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])))", fs = new RegExp(`^${bn}$`);
653
+ function xn(n) {
654
654
  let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
655
655
  return n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`), e;
656
656
  }
657
- function ys(n) {
658
- return new RegExp(`^${Sn(n)}$`);
657
+ function ms(n) {
658
+ return new RegExp(`^${xn(n)}$`);
659
659
  }
660
- function Zn(n) {
661
- let e = `${On}T${Sn(n)}`;
660
+ function Tn(n) {
661
+ let e = `${bn}T${xn(n)}`;
662
662
  const t = [];
663
663
  return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
664
664
  }
665
- function vs(n, e) {
666
- return !!((e === "v4" || !e) && fs.test(n) || (e === "v6" || !e) && ms.test(n));
665
+ function _s(n, e) {
666
+ return !!((e === "v4" || !e) && ls.test(n) || (e === "v6" || !e) && ps.test(n));
667
667
  }
668
668
  class F extends Z {
669
669
  _parse(e) {
@@ -714,43 +714,43 @@ class F extends Z {
714
714
  message: r.message
715
715
  }), t.dirty());
716
716
  } else if (r.kind === "email")
717
- ps.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
717
+ ds.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
718
718
  validation: "email",
719
719
  code: p.invalid_string,
720
720
  message: r.message
721
721
  }), t.dirty());
722
722
  else if (r.kind === "emoji")
723
- Gt || (Gt = new RegExp(hs, "u")), Gt.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
723
+ Gt || (Gt = new RegExp(us, "u")), Gt.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
724
724
  validation: "emoji",
725
725
  code: p.invalid_string,
726
726
  message: r.message
727
727
  }), t.dirty());
728
728
  else if (r.kind === "uuid")
729
- ds.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
729
+ is.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
730
730
  validation: "uuid",
731
731
  code: p.invalid_string,
732
732
  message: r.message
733
733
  }), t.dirty());
734
734
  else if (r.kind === "nanoid")
735
- us.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
735
+ os.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
736
736
  validation: "nanoid",
737
737
  code: p.invalid_string,
738
738
  message: r.message
739
739
  }), t.dirty());
740
740
  else if (r.kind === "cuid")
741
- is.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
741
+ ss.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
742
742
  validation: "cuid",
743
743
  code: p.invalid_string,
744
744
  message: r.message
745
745
  }), t.dirty());
746
746
  else if (r.kind === "cuid2")
747
- os.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
747
+ rs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
748
748
  validation: "cuid2",
749
749
  code: p.invalid_string,
750
750
  message: r.message
751
751
  }), t.dirty());
752
752
  else if (r.kind === "ulid")
753
- cs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
753
+ as.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
754
754
  validation: "ulid",
755
755
  code: p.invalid_string,
756
756
  message: r.message
@@ -781,27 +781,27 @@ class F extends Z {
781
781
  code: p.invalid_string,
782
782
  validation: { endsWith: r.value },
783
783
  message: r.message
784
- }), t.dirty()) : r.kind === "datetime" ? Zn(r).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
784
+ }), t.dirty()) : r.kind === "datetime" ? Tn(r).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
785
785
  code: p.invalid_string,
786
786
  validation: "datetime",
787
787
  message: r.message
788
- }), t.dirty()) : r.kind === "date" ? gs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
788
+ }), t.dirty()) : r.kind === "date" ? fs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
789
789
  code: p.invalid_string,
790
790
  validation: "date",
791
791
  message: r.message
792
- }), t.dirty()) : r.kind === "time" ? ys(r).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
792
+ }), t.dirty()) : r.kind === "time" ? ms(r).test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
793
793
  code: p.invalid_string,
794
794
  validation: "time",
795
795
  message: r.message
796
- }), t.dirty()) : r.kind === "duration" ? ls.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
796
+ }), t.dirty()) : r.kind === "duration" ? cs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
797
797
  validation: "duration",
798
798
  code: p.invalid_string,
799
799
  message: r.message
800
- }), t.dirty()) : r.kind === "ip" ? vs(e.data, r.version) || (s = this._getOrReturnCtx(e, s), f(s, {
800
+ }), t.dirty()) : r.kind === "ip" ? _s(e.data, r.version) || (s = this._getOrReturnCtx(e, s), f(s, {
801
801
  validation: "ip",
802
802
  code: p.invalid_string,
803
803
  message: r.message
804
- }), t.dirty()) : r.kind === "base64" ? _s.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
804
+ }), t.dirty()) : r.kind === "base64" ? hs.test(e.data) || (s = this._getOrReturnCtx(e, s), f(s, {
805
805
  validation: "base64",
806
806
  code: p.invalid_string,
807
807
  message: r.message
@@ -1023,7 +1023,7 @@ F.create = (n) => {
1023
1023
  ...O(n)
1024
1024
  });
1025
1025
  };
1026
- function ws(n, e) {
1026
+ function gs(n, e) {
1027
1027
  const t = (n.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, r = t > s ? t : s, a = parseInt(n.toFixed(r).replace(".", "")), o = parseInt(e.toFixed(r).replace(".", ""));
1028
1028
  return a % o / Math.pow(10, r);
1029
1029
  }
@@ -1062,7 +1062,7 @@ class me extends Z {
1062
1062
  inclusive: r.inclusive,
1063
1063
  exact: !1,
1064
1064
  message: r.message
1065
- }), s.dirty()) : r.kind === "multipleOf" ? ws(e.data, r.value) !== 0 && (t = this._getOrReturnCtx(e, t), f(t, {
1065
+ }), s.dirty()) : r.kind === "multipleOf" ? gs(e.data, r.value) !== 0 && (t = this._getOrReturnCtx(e, t), f(t, {
1066
1066
  code: p.not_multiple_of,
1067
1067
  multipleOf: r.value,
1068
1068
  message: r.message
@@ -1881,7 +1881,7 @@ class E extends Z {
1881
1881
  });
1882
1882
  }
1883
1883
  keyof() {
1884
- return jn(N.objectKeys(this.shape));
1884
+ return On(N.objectKeys(this.shape));
1885
1885
  }
1886
1886
  }
1887
1887
  E.create = (n, e) => new E({
@@ -1978,8 +1978,8 @@ it.create = (n, e) => new it({
1978
1978
  typeName: w.ZodUnion,
1979
1979
  ...O(e)
1980
1980
  });
1981
- const pe = (n) => n instanceof dt ? pe(n.schema) : n instanceof q ? pe(n.innerType()) : n instanceof ut ? [n.value] : n instanceof ge ? n.options : n instanceof lt ? N.objectValues(n.enum) : n instanceof pt ? pe(n._def.innerType) : n instanceof rt ? [void 0] : n instanceof at ? [null] : n instanceof G ? [void 0, ...pe(n.unwrap())] : n instanceof ye ? [null, ...pe(n.unwrap())] : n instanceof ln || n instanceof ft ? pe(n.unwrap()) : n instanceof ht ? pe(n._def.innerType) : [];
1982
- class Jt extends Z {
1981
+ const pe = (n) => n instanceof dt ? pe(n.schema) : n instanceof q ? pe(n.innerType()) : n instanceof ut ? [n.value] : n instanceof ge ? n.options : n instanceof lt ? N.objectValues(n.enum) : n instanceof pt ? pe(n._def.innerType) : n instanceof rt ? [void 0] : n instanceof at ? [null] : n instanceof G ? [void 0, ...pe(n.unwrap())] : n instanceof ye ? [null, ...pe(n.unwrap())] : n instanceof dn || n instanceof ft ? pe(n.unwrap()) : n instanceof ht ? pe(n._def.innerType) : [];
1982
+ class Kt extends Z {
1983
1983
  _parse(e) {
1984
1984
  const { ctx: t } = this._processInputParams(e);
1985
1985
  if (t.parsedType !== _.object)
@@ -2032,7 +2032,7 @@ class Jt extends Z {
2032
2032
  r.set(c, a);
2033
2033
  }
2034
2034
  }
2035
- return new Jt({
2035
+ return new Kt({
2036
2036
  typeName: w.ZodDiscriminatedUnion,
2037
2037
  discriminator: e,
2038
2038
  options: t,
@@ -2041,14 +2041,14 @@ class Jt extends Z {
2041
2041
  });
2042
2042
  }
2043
2043
  }
2044
- function an(n, e) {
2044
+ function sn(n, e) {
2045
2045
  const t = he(n), s = he(e);
2046
2046
  if (n === e)
2047
2047
  return { valid: !0, data: n };
2048
2048
  if (t === _.object && s === _.object) {
2049
2049
  const r = N.objectKeys(e), a = N.objectKeys(n).filter((c) => r.indexOf(c) !== -1), o = { ...n, ...e };
2050
2050
  for (const c of a) {
2051
- const d = an(n[c], e[c]);
2051
+ const d = sn(n[c], e[c]);
2052
2052
  if (!d.valid)
2053
2053
  return { valid: !1 };
2054
2054
  o[c] = d.data;
@@ -2059,7 +2059,7 @@ function an(n, e) {
2059
2059
  return { valid: !1 };
2060
2060
  const r = [];
2061
2061
  for (let a = 0; a < n.length; a++) {
2062
- const o = n[a], c = e[a], d = an(o, c);
2062
+ const o = n[a], c = e[a], d = sn(o, c);
2063
2063
  if (!d.valid)
2064
2064
  return { valid: !1 };
2065
2065
  r.push(d.data);
@@ -2070,10 +2070,10 @@ function an(n, e) {
2070
2070
  class ot extends Z {
2071
2071
  _parse(e) {
2072
2072
  const { status: t, ctx: s } = this._processInputParams(e), r = (a, o) => {
2073
- if (sn(a) || sn(o))
2073
+ if (tn(a) || tn(o))
2074
2074
  return x;
2075
- const c = an(a.value, o.value);
2076
- return c.valid ? ((rn(a) || rn(o)) && t.dirty(), { status: t.value, value: c.data }) : (f(s, {
2075
+ const c = sn(a.value, o.value);
2076
+ return c.valid ? ((nn(a) || nn(o)) && t.dirty(), { status: t.value, value: c.data }) : (f(s, {
2077
2077
  code: p.invalid_intersection_types
2078
2078
  }), x);
2079
2079
  };
@@ -2444,7 +2444,7 @@ ut.create = (n, e) => new ut({
2444
2444
  typeName: w.ZodLiteral,
2445
2445
  ...O(e)
2446
2446
  });
2447
- function jn(n, e) {
2447
+ function On(n, e) {
2448
2448
  return new ge({
2449
2449
  values: n,
2450
2450
  typeName: w.ZodEnum,
@@ -2464,7 +2464,7 @@ class ge extends Z {
2464
2464
  code: p.invalid_type
2465
2465
  }), x;
2466
2466
  }
2467
- if (Pt(this, Ye) || Tn(this, Ye, new Set(this._def.values)), !Pt(this, Ye).has(e.data)) {
2467
+ if (Pt(this, Ye) || kn(this, Ye, new Set(this._def.values)), !Pt(this, Ye).has(e.data)) {
2468
2468
  const t = this._getOrReturnCtx(e), s = this._def.values;
2469
2469
  return f(t, {
2470
2470
  received: t.data,
@@ -2509,7 +2509,7 @@ class ge extends Z {
2509
2509
  }
2510
2510
  }
2511
2511
  Ye = /* @__PURE__ */ new WeakMap();
2512
- ge.create = jn;
2512
+ ge.create = On;
2513
2513
  class lt extends Z {
2514
2514
  constructor() {
2515
2515
  super(...arguments), Ge.set(this, void 0);
@@ -2524,7 +2524,7 @@ class lt extends Z {
2524
2524
  code: p.invalid_type
2525
2525
  }), x;
2526
2526
  }
2527
- if (Pt(this, Ge) || Tn(this, Ge, new Set(N.getValidEnumValues(this._def.values))), !Pt(this, Ge).has(e.data)) {
2527
+ if (Pt(this, Ge) || kn(this, Ge, new Set(N.getValidEnumValues(this._def.values))), !Pt(this, Ge).has(e.data)) {
2528
2528
  const r = N.objectValues(t);
2529
2529
  return f(s, {
2530
2530
  received: s.data,
@@ -2763,8 +2763,8 @@ Vt.create = (n) => new Vt({
2763
2763
  typeName: w.ZodNaN,
2764
2764
  ...O(n)
2765
2765
  });
2766
- const ks = Symbol("zod_brand");
2767
- class ln extends Z {
2766
+ const ys = Symbol("zod_brand");
2767
+ class dn extends Z {
2768
2768
  _parse(e) {
2769
2769
  const { ctx: t } = this._processInputParams(e), s = t.data;
2770
2770
  return this._def.type._parse({
@@ -2831,7 +2831,7 @@ ft.create = (n, e) => new ft({
2831
2831
  typeName: w.ZodReadonly,
2832
2832
  ...O(e)
2833
2833
  });
2834
- function Nn(n, e = {}, t) {
2834
+ function Sn(n, e = {}, t) {
2835
2835
  return n ? Be.create().superRefine((s, r) => {
2836
2836
  var a, o;
2837
2837
  if (!n(s)) {
@@ -2840,16 +2840,16 @@ function Nn(n, e = {}, t) {
2840
2840
  }
2841
2841
  }) : Be.create();
2842
2842
  }
2843
- const bs = {
2843
+ const vs = {
2844
2844
  object: E.lazycreate
2845
2845
  };
2846
2846
  var w;
2847
2847
  (function(n) {
2848
2848
  n.ZodString = "ZodString", n.ZodNumber = "ZodNumber", n.ZodNaN = "ZodNaN", n.ZodBigInt = "ZodBigInt", n.ZodBoolean = "ZodBoolean", n.ZodDate = "ZodDate", n.ZodSymbol = "ZodSymbol", n.ZodUndefined = "ZodUndefined", n.ZodNull = "ZodNull", n.ZodAny = "ZodAny", n.ZodUnknown = "ZodUnknown", n.ZodNever = "ZodNever", n.ZodVoid = "ZodVoid", n.ZodArray = "ZodArray", n.ZodObject = "ZodObject", n.ZodUnion = "ZodUnion", n.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", n.ZodIntersection = "ZodIntersection", n.ZodTuple = "ZodTuple", n.ZodRecord = "ZodRecord", n.ZodMap = "ZodMap", n.ZodSet = "ZodSet", n.ZodFunction = "ZodFunction", n.ZodLazy = "ZodLazy", n.ZodLiteral = "ZodLiteral", n.ZodEnum = "ZodEnum", n.ZodEffects = "ZodEffects", n.ZodNativeEnum = "ZodNativeEnum", n.ZodOptional = "ZodOptional", n.ZodNullable = "ZodNullable", n.ZodDefault = "ZodDefault", n.ZodCatch = "ZodCatch", n.ZodPromise = "ZodPromise", n.ZodBranded = "ZodBranded", n.ZodPipeline = "ZodPipeline", n.ZodReadonly = "ZodReadonly";
2849
2849
  })(w || (w = {}));
2850
- const xs = (n, e = {
2850
+ const ws = (n, e = {
2851
2851
  message: `Input not instance of ${n.name}`
2852
- }) => Nn((t) => t instanceof n, e), In = F.create, Cn = me.create, Ts = Vt.create, Os = _e.create, En = st.create, Ss = Ne.create, Zs = Dt.create, js = rt.create, Ns = at.create, Is = Be.create, Cs = Ze.create, Es = ie.create, As = Mt.create, Rs = B.create, $s = E.create, Ps = E.strictCreate, Ds = it.create, Ms = Jt.create, Ls = ot.create, Vs = te.create, Us = ct.create, Fs = Lt.create, zs = Ie.create, Bs = Ue.create, Ws = dt.create, qs = ut.create, Ks = ge.create, Js = lt.create, Qs = We.create, yn = q.create, Hs = G.create, Ys = ye.create, Gs = q.createWithPreprocess, Xs = Nt.create, er = () => In().optional(), tr = () => Cn().optional(), nr = () => En().optional(), sr = {
2852
+ }) => Sn((t) => t instanceof n, e), Zn = F.create, jn = me.create, ks = Vt.create, bs = _e.create, Nn = st.create, xs = Ne.create, Ts = Dt.create, Os = rt.create, Ss = at.create, Zs = Be.create, js = Ze.create, Ns = ie.create, Is = Mt.create, Cs = B.create, Es = E.create, As = E.strictCreate, Rs = it.create, $s = Kt.create, Ps = ot.create, Ds = te.create, Ms = ct.create, Ls = Lt.create, Vs = Ie.create, Us = Ue.create, Fs = dt.create, zs = ut.create, Bs = ge.create, Ws = lt.create, qs = We.create, mn = q.create, Js = G.create, Ks = ye.create, Qs = q.createWithPreprocess, Hs = Nt.create, Ys = () => Zn().optional(), Gs = () => jn().optional(), Xs = () => Nn().optional(), er = {
2853
2853
  string: (n) => F.create({ ...n, coerce: !0 }),
2854
2854
  number: (n) => me.create({ ...n, coerce: !0 }),
2855
2855
  boolean: (n) => st.create({
@@ -2858,33 +2858,33 @@ const xs = (n, e = {
2858
2858
  }),
2859
2859
  bigint: (n) => _e.create({ ...n, coerce: !0 }),
2860
2860
  date: (n) => Ne.create({ ...n, coerce: !0 })
2861
- }, rr = x;
2861
+ }, tr = x;
2862
2862
  var i = /* @__PURE__ */ Object.freeze({
2863
2863
  __proto__: null,
2864
2864
  defaultErrorMap: ze,
2865
- setErrorMap: rs,
2865
+ setErrorMap: ts,
2866
2866
  getErrorMap: At,
2867
2867
  makeIssue: Rt,
2868
- EMPTY_PATH: as,
2868
+ EMPTY_PATH: ns,
2869
2869
  addIssueToContext: f,
2870
2870
  ParseStatus: $,
2871
2871
  INVALID: x,
2872
2872
  DIRTY: $t,
2873
2873
  OK: D,
2874
- isAborted: sn,
2875
- isDirty: rn,
2874
+ isAborted: tn,
2875
+ isDirty: nn,
2876
2876
  isValid: tt,
2877
2877
  isAsync: nt,
2878
2878
  get util() {
2879
2879
  return N;
2880
2880
  },
2881
2881
  get objectUtil() {
2882
- return nn;
2882
+ return en;
2883
2883
  },
2884
2884
  ZodParsedType: _,
2885
2885
  getParsedType: he,
2886
2886
  ZodType: Z,
2887
- datetimeRegex: Zn,
2887
+ datetimeRegex: Tn,
2888
2888
  ZodString: F,
2889
2889
  ZodNumber: me,
2890
2890
  ZodBigInt: _e,
@@ -2900,7 +2900,7 @@ var i = /* @__PURE__ */ Object.freeze({
2900
2900
  ZodArray: B,
2901
2901
  ZodObject: E,
2902
2902
  ZodUnion: it,
2903
- ZodDiscriminatedUnion: Jt,
2903
+ ZodDiscriminatedUnion: Kt,
2904
2904
  ZodIntersection: ot,
2905
2905
  ZodTuple: te,
2906
2906
  ZodRecord: ct,
@@ -2919,72 +2919,72 @@ var i = /* @__PURE__ */ Object.freeze({
2919
2919
  ZodDefault: pt,
2920
2920
  ZodCatch: ht,
2921
2921
  ZodNaN: Vt,
2922
- BRAND: ks,
2923
- ZodBranded: ln,
2922
+ BRAND: ys,
2923
+ ZodBranded: dn,
2924
2924
  ZodPipeline: Nt,
2925
2925
  ZodReadonly: ft,
2926
- custom: Nn,
2926
+ custom: Sn,
2927
2927
  Schema: Z,
2928
2928
  ZodSchema: Z,
2929
- late: bs,
2929
+ late: vs,
2930
2930
  get ZodFirstPartyTypeKind() {
2931
2931
  return w;
2932
2932
  },
2933
- coerce: sr,
2934
- any: Is,
2935
- array: Rs,
2936
- bigint: Os,
2937
- boolean: En,
2938
- date: Ss,
2939
- discriminatedUnion: Ms,
2940
- effect: yn,
2941
- enum: Ks,
2942
- function: Bs,
2943
- instanceof: xs,
2944
- intersection: Ls,
2945
- lazy: Ws,
2946
- literal: qs,
2947
- map: Fs,
2948
- nan: Ts,
2949
- nativeEnum: Js,
2950
- never: Es,
2951
- null: Ns,
2952
- nullable: Ys,
2953
- number: Cn,
2954
- object: $s,
2955
- oboolean: nr,
2956
- onumber: tr,
2957
- optional: Hs,
2958
- ostring: er,
2959
- pipeline: Xs,
2960
- preprocess: Gs,
2961
- promise: Qs,
2962
- record: Us,
2963
- set: zs,
2964
- strictObject: Ps,
2965
- string: In,
2966
- symbol: Zs,
2967
- transformer: yn,
2968
- tuple: Vs,
2969
- undefined: js,
2970
- union: Ds,
2971
- unknown: Cs,
2972
- void: As,
2973
- NEVER: rr,
2933
+ coerce: er,
2934
+ any: Zs,
2935
+ array: Cs,
2936
+ bigint: bs,
2937
+ boolean: Nn,
2938
+ date: xs,
2939
+ discriminatedUnion: $s,
2940
+ effect: mn,
2941
+ enum: Bs,
2942
+ function: Us,
2943
+ instanceof: ws,
2944
+ intersection: Ps,
2945
+ lazy: Fs,
2946
+ literal: zs,
2947
+ map: Ls,
2948
+ nan: ks,
2949
+ nativeEnum: Ws,
2950
+ never: Ns,
2951
+ null: Ss,
2952
+ nullable: Ks,
2953
+ number: jn,
2954
+ object: Es,
2955
+ oboolean: Xs,
2956
+ onumber: Gs,
2957
+ optional: Js,
2958
+ ostring: Ys,
2959
+ pipeline: Hs,
2960
+ preprocess: Qs,
2961
+ promise: qs,
2962
+ record: Ms,
2963
+ set: Vs,
2964
+ strictObject: As,
2965
+ string: Zn,
2966
+ symbol: Ts,
2967
+ transformer: mn,
2968
+ tuple: Ds,
2969
+ undefined: Os,
2970
+ union: Rs,
2971
+ unknown: js,
2972
+ void: Is,
2973
+ NEVER: tr,
2974
2974
  ZodIssueCode: p,
2975
- quotelessJson: ss,
2975
+ quotelessJson: es,
2976
2976
  ZodError: V
2977
2977
  });
2978
- ns(i);
2978
+ Xn(i);
2979
2979
  i.object({
2980
2980
  start: i.number(),
2981
2981
  limit: i.number(),
2982
2982
  length: i.number()
2983
2983
  });
2984
- const pn = i.object({
2984
+ const un = i.object({
2985
2985
  created_at: i.string(),
2986
2986
  updated_at: i.string()
2987
- }), ar = i.object({
2987
+ }), nr = i.object({
2988
2988
  email: i.string().optional(),
2989
2989
  email_verified: i.boolean().optional(),
2990
2990
  name: i.string().optional(),
@@ -2993,7 +2993,7 @@ const pn = i.object({
2993
2993
  phone_number: i.string().optional(),
2994
2994
  phone_verified: i.boolean().optional(),
2995
2995
  family_name: i.string().optional()
2996
- }).catchall(i.any()), ir = i.object({
2996
+ }).catchall(i.any()), sr = i.object({
2997
2997
  connection: i.string(),
2998
2998
  user_id: i.string(),
2999
2999
  provider: i.string(),
@@ -3001,8 +3001,8 @@ const pn = i.object({
3001
3001
  access_token: i.string().optional(),
3002
3002
  access_token_secret: i.string().optional(),
3003
3003
  refresh_token: i.string().optional(),
3004
- profileData: ar.optional()
3005
- }), An = i.object({
3004
+ profileData: nr.optional()
3005
+ }), In = i.object({
3006
3006
  email: i.string().optional(),
3007
3007
  username: i.string().optional(),
3008
3008
  given_name: i.string().optional(),
@@ -3014,7 +3014,7 @@ const pn = i.object({
3014
3014
  linked_to: i.string().optional(),
3015
3015
  profileData: i.string().optional(),
3016
3016
  user_id: i.string().optional()
3017
- }), or = An.extend({
3017
+ }), rr = In.extend({
3018
3018
  email_verified: i.boolean().default(!1),
3019
3019
  verify_email: i.boolean().optional(),
3020
3020
  last_ip: i.string().optional(),
@@ -3023,15 +3023,15 @@ const pn = i.object({
3023
3023
  provider: i.string().default("email"),
3024
3024
  connection: i.string().default("email")
3025
3025
  });
3026
- or.extend(pn.shape).extend({
3026
+ rr.extend(un.shape).extend({
3027
3027
  user_id: i.string(),
3028
3028
  // TODO: this not might be correct if you use the username
3029
3029
  email: i.string(),
3030
3030
  is_social: i.boolean(),
3031
3031
  login_count: i.number(),
3032
- identities: i.array(ir).optional()
3032
+ identities: i.array(sr).optional()
3033
3033
  });
3034
- An.extend({
3034
+ In.extend({
3035
3035
  email: i.string(),
3036
3036
  login_count: i.number(),
3037
3037
  multifactor: i.array(i.string()).optional(),
@@ -3039,27 +3039,24 @@ An.extend({
3039
3039
  last_login: i.string().optional(),
3040
3040
  user_id: i.string()
3041
3041
  }).catchall(i.any());
3042
- const cr = i.object({
3042
+ const ar = i.object({
3043
3043
  id: i.string(),
3044
3044
  name: i.string(),
3045
- callbacks: i.string().transform((n) => n === null ? "" : n).default("").openapi({
3045
+ callbacks: i.array(i.string()).openapi({
3046
3046
  description: "Comma-separated list of URLs whitelisted to use as a callback to the client after authentication."
3047
3047
  }),
3048
- allowed_origins: i.string().transform((n) => n === null ? "" : n).default("").openapi({
3048
+ allowed_origins: i.array(i.string()).openapi({
3049
3049
  description: "Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level. Query strings and hash information are not taken into account when validating these URLs."
3050
3050
  }),
3051
- web_origins: i.string().transform((n) => n === null ? "" : n).default("").openapi({
3051
+ web_origins: i.array(i.string()).openapi({
3052
3052
  description: "Comma-separated list of allowed origins for use with Cross-Origin Authentication, Device Flow, and web message response mode."
3053
3053
  }),
3054
- allowed_logout_urls: i.string().transform((n) => n === null ? "" : n).default("").openapi({
3054
+ allowed_logout_urls: i.array(i.string()).openapi({
3055
3055
  description: "Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains."
3056
3056
  }),
3057
3057
  addons: i.record(i.string(), i.record(i.string(), i.union([i.string(), i.number()]))).optional().openapi({
3058
3058
  description: "Addons associated with the client. The key is the addon's package name and the value is an object with the configuration for the addon."
3059
3059
  }),
3060
- // @deprecated. Renamed to match the auth0 API
3061
- allowed_web_origins: i.string().transform((n) => n === null ? "" : n).default(""),
3062
- allowed_callback_urls: i.string().transform((n) => n === null ? "" : n).default(""),
3063
3060
  email_validation: i.enum(["enabled", "disabled", "enforced"]).default("enforced").openapi({
3064
3061
  description: "Defines if it possible to sign in with an unverified email and if verification emails will be sent. This is not available in auth0"
3065
3062
  }),
@@ -3067,23 +3064,23 @@ const cr = i.object({
3067
3064
  disable_sign_ups: i.boolean().default(!1).openapi({
3068
3065
  description: "Prevents users from signing up using the hosted login page. This is not available in auth0"
3069
3066
  })
3070
- });
3071
- i.object({
3067
+ }), ir = i.object({
3072
3068
  created_at: i.string().transform((n) => n === null ? "" : n),
3073
- updated_at: i.string().transform((n) => n === null ? "" : n)
3074
- }).extend(cr.shape);
3075
- var Rn = /* @__PURE__ */ ((n) => (n.TOKEN = "token", n.TOKEN_ID_TOKEN = "token id_token", n.CODE = "code", n))(Rn || {}), $n = /* @__PURE__ */ ((n) => (n.QUERY = "query", n.FRAGMENT = "fragment", n.FORM_POST = "form_post", n.WEB_MESSAGE = "web_message", n.SAML_POST = "saml_post", n))($n || {}), Pn = /* @__PURE__ */ ((n) => (n.S265 = "S256", n.plain = "plain", n))(Pn || {});
3069
+ updated_at: i.string().transform((n) => n === null ? "" : n),
3070
+ ...ar.shape
3071
+ });
3072
+ var Cn = /* @__PURE__ */ ((n) => (n.TOKEN = "token", n.TOKEN_ID_TOKEN = "token id_token", n.CODE = "code", n))(Cn || {}), En = /* @__PURE__ */ ((n) => (n.QUERY = "query", n.FRAGMENT = "fragment", n.FORM_POST = "form_post", n.WEB_MESSAGE = "web_message", n.SAML_POST = "saml_post", n))(En || {}), An = /* @__PURE__ */ ((n) => (n.S265 = "S256", n.plain = "plain", n))(An || {});
3076
3073
  const Qt = i.object({
3077
3074
  client_id: i.string(),
3078
3075
  vendor_id: i.string().optional(),
3079
- response_type: i.nativeEnum(Rn).optional(),
3080
- response_mode: i.nativeEnum($n).optional(),
3076
+ response_type: i.nativeEnum(Cn).optional(),
3077
+ response_mode: i.nativeEnum(En).optional(),
3081
3078
  redirect_uri: i.string().optional(),
3082
3079
  audience: i.string().optional(),
3083
3080
  state: i.string().optional(),
3084
3081
  nonce: i.string().optional(),
3085
3082
  scope: i.string().optional(),
3086
- code_challenge_method: i.nativeEnum(Pn).optional(),
3083
+ code_challenge_method: i.nativeEnum(An).optional(),
3087
3084
  code_challenge: i.string().optional(),
3088
3085
  username: i.string().optional()
3089
3086
  });
@@ -3103,7 +3100,7 @@ i.object({
3103
3100
  url: i.string()
3104
3101
  }).optional()
3105
3102
  });
3106
- const dr = i.object({
3103
+ const or = i.object({
3107
3104
  id: i.string().optional(),
3108
3105
  name: i.string(),
3109
3106
  client_id: i.string().optional(),
@@ -3118,48 +3115,56 @@ const dr = i.object({
3118
3115
  token_exchange_basic_auth: i.boolean().optional(),
3119
3116
  userinfo_endpoint: i.string().optional(),
3120
3117
  scope: i.string().optional()
3121
- }), hn = i.object({
3118
+ }), Rn = i.object({
3122
3119
  id: i.string(),
3123
3120
  created_at: i.string().transform((n) => n === null ? "" : n),
3124
3121
  updated_at: i.string().transform((n) => n === null ? "" : n)
3125
- }).extend(dr.shape), ur = i.object({
3122
+ }).extend(or.shape), cr = i.object({
3123
+ name: i.string(),
3124
+ audience: i.string(),
3125
+ sender_email: i.string().email(),
3126
+ sender_name: i.string(),
3127
+ support_url: i.string().url().optional(),
3128
+ logo: i.string().url().optional(),
3129
+ primary_color: i.string().optional(),
3130
+ secondary_color: i.string().optional(),
3131
+ language: i.string().optional()
3132
+ }), dr = i.object({
3133
+ created_at: i.string().transform((n) => n === null ? "" : n),
3134
+ updated_at: i.string().transform((n) => n === null ? "" : n),
3135
+ id: i.string(),
3136
+ ...cr.shape
3137
+ });
3138
+ i.object({
3139
+ logoUrl: i.string(),
3140
+ loginBackgroundImage: i.string().nullish(),
3141
+ style: i.object({
3142
+ primaryColor: i.string(),
3143
+ buttonTextColor: i.string(),
3144
+ primaryHoverColor: i.string()
3145
+ }),
3146
+ supportEmail: i.string().nullable(),
3147
+ supportUrl: i.string().nullable(),
3148
+ name: i.string(),
3149
+ showGreyishBackground: i.boolean().optional(),
3150
+ termsAndConditionsUrl: i.string().nullable(),
3151
+ companyName: i.string().optional(),
3152
+ checkoutHideSocial: i.boolean().optional(),
3153
+ siteUrl: i.string().nullable(),
3154
+ manageSubscriptionsUrl: i.string().optional()
3155
+ });
3156
+ const ur = i.object({
3126
3157
  domain: i.string(),
3127
3158
  dkim_private_key: i.string().optional(),
3128
3159
  dkim_public_key: i.string().optional(),
3129
3160
  email_api_key: i.string().optional(),
3130
3161
  email_service: i.union([i.literal("mailgun"), i.literal("mailchannels")]).optional()
3131
- }), Dn = i.object({
3132
- id: i.string(),
3133
- name: i.string(),
3134
- domains: i.array(ur),
3135
- allowed_callback_urls: i.array(i.string()),
3136
- allowed_logout_urls: i.array(i.string()),
3137
- allowed_web_origins: i.array(i.string()),
3138
- email_validation: i.union([
3139
- i.literal("enabled"),
3140
- i.literal("disabled"),
3141
- i.literal("enforced")
3142
- ]),
3143
- tenant_id: i.string(),
3144
- client_secret: i.string(),
3145
- disable_sign_ups: i.boolean(),
3146
- tenant: i.object({
3147
- name: i.string(),
3148
- audience: i.string().optional(),
3149
- logo: i.string().optional(),
3150
- primary_color: i.string().optional(),
3151
- secondary_color: i.string().optional(),
3152
- sender_email: i.string(),
3153
- sender_name: i.string(),
3154
- support_url: i.string().optional(),
3155
- language: i.string().length(2).optional()
3156
- })
3157
3162
  });
3158
- Dn.extend({
3159
- connections: i.array(hn)
3160
- });
3161
- Dn.extend({
3162
- connections: i.array(hn.partial())
3163
+ i.object({
3164
+ ...ir.shape,
3165
+ domains: i.array(ur),
3166
+ tenant: dr,
3167
+ connections: i.array(Rn)
3163
3168
  });
3164
3169
  const lr = i.enum([
3165
3170
  "password_reset",
@@ -3188,7 +3193,7 @@ const lr = i.enum([
3188
3193
  email_api_key: i.string().optional(),
3189
3194
  email_service: i.enum(["mailgun", "mailchannels"])
3190
3195
  });
3191
- pn.extend({
3196
+ un.extend({
3192
3197
  ...fr.shape,
3193
3198
  id: i.string()
3194
3199
  });
@@ -3205,7 +3210,7 @@ const mr = i.object({
3205
3210
  priority: i.number().optional()
3206
3211
  });
3207
3212
  mr.extend({
3208
- ...pn.shape,
3213
+ ...un.shape,
3209
3214
  hook_id: i.string()
3210
3215
  });
3211
3216
  const _r = i.object({
@@ -3385,43 +3390,10 @@ i.object({
3385
3390
  revoked: i.boolean().optional().openapi({ description: "True if the key is revoked" }),
3386
3391
  revoked_at: i.string().optional().openapi({ description: "The date and time when the key was revoked" })
3387
3392
  });
3388
- const xr = i.object({
3389
- name: i.string(),
3390
- audience: i.string(),
3391
- sender_email: i.string().email(),
3392
- sender_name: i.string(),
3393
- support_url: i.string().url().optional(),
3394
- logo: i.string().url().optional(),
3395
- primary_color: i.string().optional(),
3396
- secondary_color: i.string().optional(),
3397
- language: i.string().optional()
3398
- });
3399
- xr.extend({
3400
- created_at: i.string().transform((n) => n === null ? "" : n),
3401
- updated_at: i.string().transform((n) => n === null ? "" : n)
3402
- });
3403
- i.object({
3404
- logoUrl: i.string(),
3405
- loginBackgroundImage: i.string().nullish(),
3406
- style: i.object({
3407
- primaryColor: i.string(),
3408
- buttonTextColor: i.string(),
3409
- primaryHoverColor: i.string()
3410
- }),
3411
- supportEmail: i.string().nullable(),
3412
- supportUrl: i.string().nullable(),
3413
- name: i.string(),
3414
- showGreyishBackground: i.boolean().optional(),
3415
- termsAndConditionsUrl: i.string().nullable(),
3416
- companyName: i.string().optional(),
3417
- checkoutHideSocial: i.boolean().optional(),
3418
- siteUrl: i.string().nullable(),
3419
- manageSubscriptionsUrl: i.string().optional()
3420
- });
3421
- var Mn = /* @__PURE__ */ ((n) => (n.RefreshToken = "refresh_token", n.AuthorizationCode = "authorization_code", n.ClientCredential = "client_credentials", n.Passwordless = "passwordless", n.Password = "password", n))(Mn || {});
3422
- const fn = i.nativeEnum(Mn);
3393
+ var $n = /* @__PURE__ */ ((n) => (n.RefreshToken = "refresh_token", n.AuthorizationCode = "authorization_code", n.ClientCredential = "client_credentials", n.Passwordless = "passwordless", n.Password = "password", n))($n || {});
3394
+ const ln = i.nativeEnum($n);
3423
3395
  i.object({
3424
- grant_type: fn.refine(
3396
+ grant_type: ln.refine(
3425
3397
  (n) => n === "authorization_code"
3426
3398
  /* AuthorizationCode */
3427
3399
  ),
@@ -3430,7 +3402,7 @@ i.object({
3430
3402
  client_id: i.string()
3431
3403
  });
3432
3404
  i.object({
3433
- grant_type: fn.refine(
3405
+ grant_type: ln.refine(
3434
3406
  (n) => n === "authorization_code"
3435
3407
  /* AuthorizationCode */
3436
3408
  ),
@@ -3440,7 +3412,7 @@ i.object({
3440
3412
  redirect_uri: i.string()
3441
3413
  });
3442
3414
  i.object({
3443
- grant_type: fn.refine(
3415
+ grant_type: ln.refine(
3444
3416
  (n) => n === "client_credentials"
3445
3417
  /* ClientCredential */
3446
3418
  ),
@@ -3462,7 +3434,7 @@ i.object({
3462
3434
  code: i.string(),
3463
3435
  state: i.string().optional()
3464
3436
  });
3465
- const Tr = i.object({
3437
+ const xr = i.object({
3466
3438
  button_border_radius: i.number(),
3467
3439
  button_border_weight: i.number(),
3468
3440
  buttons_style: i.enum(["pill"]),
@@ -3472,7 +3444,7 @@ const Tr = i.object({
3472
3444
  show_widget_shadow: i.boolean(),
3473
3445
  widget_border_weight: i.number(),
3474
3446
  widget_corner_radius: i.number()
3475
- }), Or = i.object({
3447
+ }), Tr = i.object({
3476
3448
  base_focus_color: i.string(),
3477
3449
  base_hover_color: i.string(),
3478
3450
  body_text: i.string(),
@@ -3495,7 +3467,7 @@ const Tr = i.object({
3495
3467
  }), De = i.object({
3496
3468
  bold: i.boolean(),
3497
3469
  size: i.number()
3498
- }), Sr = i.object({
3470
+ }), Or = i.object({
3499
3471
  body_text: De,
3500
3472
  buttons_text: De,
3501
3473
  font_url: i.string(),
@@ -3505,39 +3477,39 @@ const Tr = i.object({
3505
3477
  reference_text_size: i.number(),
3506
3478
  subtitle: De,
3507
3479
  title: De
3508
- }), Zr = i.object({
3480
+ }), Sr = i.object({
3509
3481
  background_color: i.string(),
3510
3482
  background_image_url: i.string(),
3511
3483
  page_layout: i.enum(["center"])
3512
- }), jr = i.object({
3484
+ }), Zr = i.object({
3513
3485
  header_text_alignment: i.enum(["center"]),
3514
3486
  logo_height: i.number(),
3515
3487
  logo_position: i.enum(["center"]),
3516
3488
  logo_url: i.string(),
3517
3489
  social_buttons_layout: i.enum(["bottom"])
3518
- }), Nr = i.object({
3519
- borders: Tr,
3520
- colors: Or,
3490
+ }), jr = i.object({
3491
+ borders: xr,
3492
+ colors: Tr,
3521
3493
  displayName: i.string(),
3522
- fonts: Sr,
3523
- page_background: Zr,
3524
- widget: jr
3494
+ fonts: Or,
3495
+ page_background: Sr,
3496
+ widget: Zr
3525
3497
  });
3526
- Nr.extend({
3498
+ jr.extend({
3527
3499
  themeId: i.string()
3528
3500
  });
3529
- const Ir = i.object({
3501
+ const Nr = i.object({
3530
3502
  id: i.string(),
3531
3503
  expires_at: i.string(),
3532
3504
  auth0Client: i.string().optional(),
3533
3505
  authParams: Qt
3534
3506
  });
3535
3507
  i.object({
3536
- ...Ir.shape,
3508
+ ...Nr.shape,
3537
3509
  created_at: i.string(),
3538
3510
  updated_at: i.string()
3539
3511
  });
3540
- const Cr = i.object({
3512
+ const Ir = i.object({
3541
3513
  id: i.string(),
3542
3514
  email: i.string(),
3543
3515
  code: i.string(),
@@ -3550,9 +3522,9 @@ const Cr = i.object({
3550
3522
  });
3551
3523
  i.object({
3552
3524
  created_at: i.string(),
3553
- ...Cr.shape
3525
+ ...Ir.shape
3554
3526
  });
3555
- const Er = i.object({
3527
+ const Cr = i.object({
3556
3528
  authParams: Qt,
3557
3529
  code: i.string(),
3558
3530
  user_id: i.string(),
@@ -3561,16 +3533,16 @@ const Er = i.object({
3561
3533
  used_at: i.string().optional()
3562
3534
  });
3563
3535
  i.object({
3564
- ...Er.shape,
3536
+ ...Cr.shape,
3565
3537
  created_at: i.string()
3566
3538
  });
3567
- function mn(n) {
3539
+ function pn(n) {
3568
3540
  const [e, t] = n.split("|");
3569
3541
  if (!e || !t)
3570
3542
  throw new Error(`Invalid user_id: ${n}`);
3571
3543
  return { connection: e, id: t };
3572
3544
  }
3573
- function Ln(n) {
3545
+ function Pn(n) {
3574
3546
  let e = {};
3575
3547
  try {
3576
3548
  e = JSON.parse(n.profileData || "{}");
@@ -3580,7 +3552,7 @@ function Ln(n) {
3580
3552
  return {
3581
3553
  connection: n.connection,
3582
3554
  provider: n.provider,
3583
- user_id: mn(n.user_id).id,
3555
+ user_id: pn(n.user_id).id,
3584
3556
  isSocial: !!n.is_social,
3585
3557
  profileData: {
3586
3558
  email: n.email,
@@ -3589,7 +3561,7 @@ function Ln(n) {
3589
3561
  }
3590
3562
  };
3591
3563
  }
3592
- function Ar(n) {
3564
+ function Er(n) {
3593
3565
  return async (e, t) => {
3594
3566
  const [s, r] = await Promise.all([
3595
3567
  n.selectFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", t).selectAll().executeTakeFirst(),
@@ -3606,10 +3578,10 @@ function Ar(n) {
3606
3578
  {
3607
3579
  connection: s.connection,
3608
3580
  provider: s.provider,
3609
- user_id: mn(s.user_id).id,
3581
+ user_id: pn(s.user_id).id,
3610
3582
  isSocial: !!s.is_social
3611
3583
  },
3612
- ...r.map(Ln)
3584
+ ...r.map(Pn)
3613
3585
  ]
3614
3586
  };
3615
3587
  return R(c);
@@ -3655,7 +3627,7 @@ function Ae(n, e, t, s) {
3655
3627
  function xe(n) {
3656
3628
  return typeof n == "string" ? parseInt(n, 10) : typeof n == "bigint" ? Number(n) : n;
3657
3629
  }
3658
- function Rr(n) {
3630
+ function Ar(n) {
3659
3631
  return async (e, t) => {
3660
3632
  let s = n.selectFrom("users").where("users.tenant_id", "=", e);
3661
3633
  if (t.q && (s = Ae(n, s, t.q, ["email", "name"])), t.sort && t.sort.sort_by) {
@@ -3674,10 +3646,10 @@ function Rr(n) {
3674
3646
  {
3675
3647
  connection: l.connection,
3676
3648
  provider: l.provider,
3677
- user_id: mn(l.user_id).id,
3649
+ user_id: pn(l.user_id).id,
3678
3650
  isSocial: !!l.is_social
3679
3651
  },
3680
- ...T.map(Ln)
3652
+ ...T.map(Pn)
3681
3653
  ]
3682
3654
  });
3683
3655
  }), { count: u } = await s.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow();
@@ -3689,48 +3661,48 @@ function Rr(n) {
3689
3661
  };
3690
3662
  };
3691
3663
  }
3692
- function $r(n) {
3664
+ function Rr(n) {
3693
3665
  return async (e, t) => (await n.deleteFrom("users").where("users.tenant_id", "=", e).where("users.linked_to", "=", t).execute(), (await n.deleteFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", t).execute()).length === 1);
3694
3666
  }
3695
- function Pr(n) {
3667
+ function $r(n) {
3696
3668
  if (n.email_verified !== void 0)
3697
3669
  return n.email_verified ? 1 : 0;
3698
3670
  }
3699
- function Dr(n) {
3671
+ function Pr(n) {
3700
3672
  return async (e, t, s) => {
3701
3673
  const r = {
3702
3674
  ...s,
3703
- email_verified: Pr(s),
3675
+ email_verified: $r(s),
3704
3676
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
3705
3677
  };
3706
3678
  return (await n.updateTable("users").set(r).where("users.tenant_id", "=", e).where("users.user_id", "=", t).execute()).length === 1;
3707
3679
  };
3708
3680
  }
3709
- function Mr(n) {
3681
+ function Dr(n) {
3710
3682
  return async (e, t, s, r) => {
3711
3683
  const a = { linked_to: null };
3712
3684
  return (await n.updateTable("users").set(a).where("users.tenant_id", "=", e).where("users.user_id", "=", `${s}|${r}`).where("users.linked_to", "=", `${t}`).execute()).length === 1;
3713
3685
  };
3714
3686
  }
3715
- function Lr(n) {
3687
+ function Mr(n) {
3716
3688
  return {
3717
- create: Xn(n),
3718
- remove: $r(n),
3719
- get: Ar(n),
3720
- list: Rr(n),
3721
- update: Dr(n),
3689
+ create: Hn(n),
3690
+ remove: Rr(n),
3691
+ get: Er(n),
3692
+ list: Ar(n),
3693
+ update: Pr(n),
3722
3694
  // TODO - think about this more when other issues fixed
3723
- unlink: Mr(n)
3695
+ unlink: Dr(n)
3724
3696
  };
3725
3697
  }
3726
- const Vr = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
3698
+ const Lr = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
3727
3699
  let Re = (n = 21) => {
3728
3700
  let e = "", t = crypto.getRandomValues(new Uint8Array(n));
3729
3701
  for (; n--; )
3730
- e += Vr[t[n] & 63];
3702
+ e += Lr[t[n] & 63];
3731
3703
  return e;
3732
3704
  };
3733
- function Ur(n) {
3705
+ function Vr(n) {
3734
3706
  return async (e) => {
3735
3707
  const t = {
3736
3708
  id: e.id || Re(),
@@ -3741,13 +3713,13 @@ function Ur(n) {
3741
3713
  return await n.insertInto("tenants").values(t).execute(), t;
3742
3714
  };
3743
3715
  }
3744
- function Fr(n) {
3716
+ function Ur(n) {
3745
3717
  return async (e) => {
3746
3718
  const t = await n.selectFrom("tenants").where("tenants.id", "=", e).selectAll().executeTakeFirst();
3747
3719
  return t ? R(t) : null;
3748
3720
  };
3749
3721
  }
3750
- function zr(n) {
3722
+ function Fr(n) {
3751
3723
  return async (e) => {
3752
3724
  let t = n.selectFrom("tenants");
3753
3725
  if (e.sort && e.sort.sort_by) {
@@ -3769,7 +3741,7 @@ function zr(n) {
3769
3741
  };
3770
3742
  };
3771
3743
  }
3772
- function Br(n) {
3744
+ function zr(n) {
3773
3745
  return async (e, t) => {
3774
3746
  const s = {
3775
3747
  ...t,
@@ -3779,29 +3751,29 @@ function Br(n) {
3779
3751
  await n.updateTable("tenants").set(s).where("id", "=", e).execute();
3780
3752
  };
3781
3753
  }
3782
- function Wr(n) {
3754
+ function Br(n) {
3783
3755
  return async (e) => (await n.deleteFrom("tenants").where("tenants.id", "=", e).execute()).length === 1;
3784
3756
  }
3785
- function qr(n) {
3757
+ function Wr(n) {
3786
3758
  return {
3787
- create: Ur(n),
3788
- get: Fr(n),
3789
- list: zr(n),
3790
- update: Br(n),
3791
- remove: Wr(n)
3759
+ create: Vr(n),
3760
+ get: Ur(n),
3761
+ list: Fr(n),
3762
+ update: zr(n),
3763
+ remove: Br(n)
3792
3764
  };
3793
3765
  }
3794
- function vn(n) {
3766
+ function _n(n) {
3795
3767
  return n ? JSON.stringify(n) : void 0;
3796
3768
  }
3797
- const Kr = 1024;
3769
+ const qr = 1024;
3798
3770
  function Jr(n) {
3799
3771
  return async (e, t) => {
3800
3772
  var r, a, o;
3801
3773
  const s = {
3802
3774
  id: Re(),
3803
3775
  ...t,
3804
- user_agent: t.user_agent.slice(0, Kr)
3776
+ user_agent: t.user_agent.slice(0, qr)
3805
3777
  };
3806
3778
  return await n.insertInto("logs").values({
3807
3779
  ...s,
@@ -3810,12 +3782,12 @@ function Jr(n) {
3810
3782
  isMobile: t.isMobile ? 1 : 0,
3811
3783
  tenant_id: e,
3812
3784
  scope: (a = t.scope) == null ? void 0 : a.join(","),
3813
- auth0_client: vn(t.auth0_client),
3814
- details: (o = vn(t.details)) == null ? void 0 : o.substring(0, 8192)
3785
+ auth0_client: _n(t.auth0_client),
3786
+ details: (o = _n(t.details)) == null ? void 0 : o.substring(0, 8192)
3815
3787
  }).execute(), s;
3816
3788
  };
3817
3789
  }
3818
- function wn(n) {
3790
+ function gn(n) {
3819
3791
  if (!n)
3820
3792
  return "";
3821
3793
  try {
@@ -3824,20 +3796,20 @@ function wn(n) {
3824
3796
  return n;
3825
3797
  }
3826
3798
  }
3827
- function Vn(n) {
3799
+ function Dn(n) {
3828
3800
  return {
3829
3801
  ...n,
3830
3802
  client_id: n.client_id,
3831
3803
  client_name: "",
3832
- auth0_client: wn(n.auth0_client),
3833
- details: wn(n.details),
3804
+ auth0_client: gn(n.auth0_client),
3805
+ details: gn(n.details),
3834
3806
  isMobile: !!n.isMobile,
3835
3807
  scope: n.scope ? n.scope.split(",") : void 0,
3836
3808
  log_id: n.id,
3837
3809
  _id: n.id
3838
3810
  };
3839
3811
  }
3840
- function Qr(n) {
3812
+ function Kr(n) {
3841
3813
  return async (e, t) => {
3842
3814
  let s = n.selectFrom("logs").where("logs.tenant_id", "=", e);
3843
3815
  t.q && (s = Ae(n, s, t.q, ["user_id", "ip"]));
@@ -3852,30 +3824,30 @@ function Qr(n) {
3852
3824
  r = r.offset(t.page * t.per_page).limit(t.per_page);
3853
3825
  const a = await r.selectAll().execute(), { count: o } = await s.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
3854
3826
  return {
3855
- logs: a.map(Vn),
3827
+ logs: a.map(Dn),
3856
3828
  start: t.page * t.per_page,
3857
3829
  limit: t.per_page,
3858
3830
  length: xe(o)
3859
3831
  };
3860
3832
  };
3861
3833
  }
3862
- function Hr(n) {
3834
+ function Qr(n) {
3863
3835
  return async (e, t) => {
3864
3836
  const s = await n.selectFrom("logs").where("logs.tenant_id", "=", e).where("logs.id", "=", t).selectAll().executeTakeFirst();
3865
- return s ? Vn(s) : null;
3837
+ return s ? Dn(s) : null;
3866
3838
  };
3867
3839
  }
3868
- function Yr(n) {
3840
+ function Hr(n) {
3869
3841
  return {
3870
3842
  create: Jr(n),
3871
- list: Qr(n),
3872
- get: Hr(n)
3843
+ list: Kr(n),
3844
+ get: Qr(n)
3873
3845
  };
3874
3846
  }
3875
- function Gr(n) {
3847
+ function Yr(n) {
3876
3848
  return async (e, t) => await n.selectFrom("sessions").where("sessions.tenant_id", "=", e).where("sessions.session_id", "=", t).where("sessions.deleted_at", "is", null).selectAll().executeTakeFirst() ?? null;
3877
3849
  }
3878
- function Xr(n) {
3850
+ function Gr(n) {
3879
3851
  return async (e, t) => {
3880
3852
  const s = {
3881
3853
  ...t,
@@ -3885,13 +3857,13 @@ function Xr(n) {
3885
3857
  return await n.insertInto("sessions").values({ ...s, tenant_id: e }).execute(), { ...t, ...s };
3886
3858
  };
3887
3859
  }
3888
- function ea(n) {
3860
+ function Xr(n) {
3889
3861
  return async (e, t) => !!(await n.updateTable("sessions").set({ deleted_at: (/* @__PURE__ */ new Date()).toISOString() }).where("tenant_id", "=", e).where("sessions.session_id", "=", t).where("sessions.deleted_at", "is", null).execute()).length;
3890
3862
  }
3891
- function ta(n) {
3863
+ function ea(n) {
3892
3864
  return async (e, t, s) => !!(await n.updateTable("sessions").set(s).where("tenant_id", "=", e).where("sessions.session_id", "=", t).where("sessions.deleted_at", "is", null).execute()).length;
3893
3865
  }
3894
- function na(n) {
3866
+ function ta(n) {
3895
3867
  return async (e, t) => {
3896
3868
  let s = n.selectFrom("sessions").where("sessions.tenant_id", "=", e);
3897
3869
  t.q && (s = Ae(n, s, t.q, ["user_id", "session_id"]));
@@ -3913,16 +3885,16 @@ function na(n) {
3913
3885
  };
3914
3886
  };
3915
3887
  }
3916
- function sa(n) {
3888
+ function na(n) {
3917
3889
  return {
3918
- create: Xr(n),
3919
- get: Gr(n),
3920
- list: na(n),
3921
- remove: ea(n),
3922
- update: ta(n)
3890
+ create: Gr(n),
3891
+ get: Yr(n),
3892
+ list: ta(n),
3893
+ remove: Xr(n),
3894
+ update: ea(n)
3923
3895
  };
3924
3896
  }
3925
- function ra(n) {
3897
+ function sa(n) {
3926
3898
  return async (e, t) => {
3927
3899
  const s = await n.selectFrom("tickets").where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).where("tickets.used_at", "is", null).selectAll().executeTakeFirst();
3928
3900
  if (!s)
@@ -3952,7 +3924,7 @@ function ra(n) {
3952
3924
  };
3953
3925
  };
3954
3926
  }
3955
- function aa(n) {
3927
+ function ra(n) {
3956
3928
  return async (e) => {
3957
3929
  const { authParams: t, ...s } = e, r = {
3958
3930
  ...s,
@@ -3964,21 +3936,21 @@ function aa(n) {
3964
3936
  await n.insertInto("tickets").values(r).execute();
3965
3937
  };
3966
3938
  }
3967
- function ia(n) {
3939
+ function aa(n) {
3968
3940
  return async (e, t) => {
3969
3941
  await n.updateTable("tickets").set({
3970
3942
  used_at: (/* @__PURE__ */ new Date()).toISOString()
3971
3943
  }).where("tickets.tenant_id", "=", e).where("tickets.id", "=", t).execute();
3972
3944
  };
3973
3945
  }
3974
- function oa(n) {
3946
+ function ia(n) {
3975
3947
  return {
3976
- create: aa(n),
3977
- get: ra(n),
3978
- remove: ia(n)
3948
+ create: ra(n),
3949
+ get: sa(n),
3950
+ remove: aa(n)
3979
3951
  };
3980
3952
  }
3981
- function ca(n) {
3953
+ function oa(n) {
3982
3954
  return async (e, t) => {
3983
3955
  const s = (/* @__PURE__ */ new Date()).toISOString();
3984
3956
  return (await n.selectFrom("otps").where("otps.tenant_id", "=", e).where("otps.email", "=", t).where("otps.expires_at", ">", s).where("otps.used_at", "is", null).selectAll().execute()).map((a) => {
@@ -4009,7 +3981,7 @@ function ca(n) {
4009
3981
  });
4010
3982
  };
4011
3983
  }
4012
- function da(n) {
3984
+ function ca(n) {
4013
3985
  return async (e, t) => {
4014
3986
  const { authParams: s, ...r } = t;
4015
3987
  await n.insertInto("otps").values({
@@ -4022,25 +3994,25 @@ function da(n) {
4022
3994
  }).execute();
4023
3995
  };
4024
3996
  }
4025
- function ua(n) {
3997
+ function da(n) {
4026
3998
  return async (e, t) => (await n.updateTable("otps").set({
4027
3999
  used_at: (/* @__PURE__ */ new Date()).toISOString()
4028
4000
  }).where("otps.tenant_id", "=", e).where("otps.id", "=", t).execute()).length > 0;
4029
4001
  }
4030
- function la(n) {
4002
+ function ua(n) {
4031
4003
  return {
4032
- create: da(n),
4033
- list: ca(n),
4034
- remove: ua(n)
4004
+ create: ca(n),
4005
+ list: oa(n),
4006
+ remove: da(n)
4035
4007
  };
4036
4008
  }
4037
- function pa(n) {
4009
+ function la(n) {
4038
4010
  return async (e, t) => {
4039
4011
  const s = await n.selectFrom("passwords").where("passwords.tenant_id", "=", e).where("passwords.user_id", "=", t).selectAll().executeTakeFirstOrThrow(), { tenant_id: r, ...a } = s;
4040
4012
  return a;
4041
4013
  };
4042
4014
  }
4043
- function ha(n) {
4015
+ function pa(n) {
4044
4016
  return async (e, t) => {
4045
4017
  const s = {
4046
4018
  ...t,
@@ -4053,20 +4025,20 @@ function ha(n) {
4053
4025
  }).execute(), s;
4054
4026
  };
4055
4027
  }
4056
- function fa(n) {
4028
+ function ha(n) {
4057
4029
  return async (e, t) => (await n.updateTable("passwords").set({
4058
4030
  password: t.password,
4059
4031
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
4060
4032
  }).where("tenant_id", "=", e).where("user_id", "=", t.user_id).execute()).length === 1;
4061
4033
  }
4062
- function ma(n) {
4034
+ function fa(n) {
4063
4035
  return {
4064
- create: ha(n),
4065
- update: fa(n),
4066
- get: pa(n)
4036
+ create: pa(n),
4037
+ update: ha(n),
4038
+ get: la(n)
4067
4039
  };
4068
4040
  }
4069
- function _a(n) {
4041
+ function ma(n) {
4070
4042
  return async (e, t) => {
4071
4043
  let s = n.selectFrom("codes").where("codes.tenant_id", "=", e);
4072
4044
  t.q && (s = Ae(n, s, t.q, ["code", "login_id"]));
@@ -4082,7 +4054,7 @@ function _a(n) {
4082
4054
  };
4083
4055
  };
4084
4056
  }
4085
- function ga(n) {
4057
+ function _a(n) {
4086
4058
  return async (e, t) => {
4087
4059
  const s = {
4088
4060
  ...t,
@@ -4094,24 +4066,24 @@ function ga(n) {
4094
4066
  }).execute(), s;
4095
4067
  };
4096
4068
  }
4097
- function ya(n) {
4069
+ function ga(n) {
4098
4070
  return async (e, t) => (await n.deleteFrom("codes").where("codes.tenant_id", "=", e).where("codes.code_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
4099
4071
  }
4100
- function va(n) {
4072
+ function ya(n) {
4101
4073
  return async (e, t, s) => {
4102
4074
  const r = await n.selectFrom("codes").where("codes.tenant_id", "=", e).where("codes.code_id", "=", t).where("codes.code_type", "=", s).selectAll().executeTakeFirst();
4103
4075
  return r ? R(r) : null;
4104
4076
  };
4105
4077
  }
4106
- function wa(n) {
4078
+ function va(n) {
4107
4079
  return {
4108
- create: ga(n),
4109
- list: _a(n),
4110
- remove: ya(n),
4111
- get: va(n)
4080
+ create: _a(n),
4081
+ list: ma(n),
4082
+ remove: ga(n),
4083
+ get: ya(n)
4112
4084
  };
4113
4085
  }
4114
- function ka(n) {
4086
+ function wa(n) {
4115
4087
  return async (e) => {
4116
4088
  const t = (/* @__PURE__ */ new Date()).toISOString(), s = await n.selectFrom("universal_login_sessions").where("universal_login_sessions.expires_at", ">", t).where("universal_login_sessions.id", "=", e).selectAll().executeTakeFirst();
4117
4089
  if (!s) return null;
@@ -4126,14 +4098,14 @@ function ka(n) {
4126
4098
  code_challenge_method: T,
4127
4099
  code_challenge: C,
4128
4100
  username: L,
4129
- vendor_id: J,
4101
+ vendor_id: K,
4130
4102
  ...re
4131
4103
  } = s;
4132
4104
  return {
4133
4105
  ...re,
4134
4106
  authParams: {
4135
4107
  client_id: re.client_id,
4136
- vendor_id: J,
4108
+ vendor_id: K,
4137
4109
  response_type: r,
4138
4110
  response_mode: a,
4139
4111
  redirect_uri: o,
@@ -4149,7 +4121,7 @@ function ka(n) {
4149
4121
  };
4150
4122
  };
4151
4123
  }
4152
- function ba(n) {
4124
+ function ka(n) {
4153
4125
  return async (e, t) => {
4154
4126
  const { authParams: s, ...r } = t, a = {
4155
4127
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
@@ -4158,99 +4130,93 @@ function ba(n) {
4158
4130
  return await n.insertInto("universal_login_sessions").values({ ...s, ...r, ...a, tenant_id: e }).execute(), { ...t, ...a };
4159
4131
  };
4160
4132
  }
4161
- function xa(n) {
4133
+ function ba(n) {
4162
4134
  return async (e, t, s) => {
4163
4135
  const { authParams: r, ...a } = s;
4164
4136
  return (await n.updateTable("universal_login_sessions").set({ ...r, ...a }).where("id", "=", t).where("tenant_id", "=", e).execute()).length === 1;
4165
4137
  };
4166
4138
  }
4167
- function Ta(n) {
4139
+ function xa(n) {
4168
4140
  return {
4169
- create: ba(n),
4170
- get: ka(n),
4171
- update: xa(n)
4141
+ create: ka(n),
4142
+ get: wa(n),
4143
+ update: ba(n)
4172
4144
  };
4173
4145
  }
4174
- function Xt(n) {
4175
- return JSON.stringify(
4176
- n.split(",").map((e) => e.trim()).filter((e) => e.length)
4177
- );
4178
- }
4179
- function Oa(n) {
4146
+ function Ta(n) {
4180
4147
  return async (e, t) => {
4181
4148
  const s = {
4182
4149
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
4183
4150
  updated_at: (/* @__PURE__ */ new Date()).toISOString(),
4184
- ...t,
4185
- // TODO: remove fallbacks
4186
- allowed_web_origins: t.allowed_origins,
4187
- allowed_callback_urls: t.callbacks,
4188
- allowed_origins: t.allowed_origins
4189
- }, r = Xt(t.allowed_origins), a = Xt(t.callbacks), o = Xt(t.callbacks);
4151
+ ...t
4152
+ }, r = JSON.stringify(t.allowed_origins), a = JSON.stringify(t.callbacks), o = JSON.stringify(t.web_origins), c = JSON.stringify(t.allowed_logout_urls);
4190
4153
  return await n.insertInto("applications").values({
4191
4154
  ...s,
4192
4155
  tenant_id: e,
4193
4156
  disable_sign_ups: t.disable_sign_ups ? 1 : 0,
4194
4157
  addons: t.addons ? JSON.stringify(t.addons) : "{}",
4195
- callbacks: o,
4196
- allowed_web_origins: r,
4197
- allowed_callback_urls: a,
4198
- allowed_origins: r
4158
+ callbacks: a,
4159
+ allowed_origins: r,
4160
+ web_origins: o,
4161
+ allowed_logout_urls: c
4199
4162
  }).execute(), s;
4200
4163
  };
4201
4164
  }
4202
- function Sa(n) {
4165
+ function Oa(n) {
4203
4166
  return async (e) => ({
4204
4167
  applications: (await n.selectFrom("applications").where("applications.tenant_id", "=", e).selectAll().execute()).map((a) => ({
4205
4168
  ...a,
4206
4169
  disable_sign_ups: !!a.disable_sign_ups,
4207
- addons: a.addons ? JSON.parse(a.addons) : {}
4170
+ addons: a.addons ? JSON.parse(a.addons) : {},
4171
+ callbacks: a.callbacks ? JSON.parse(a.callbacks) : [],
4172
+ allowed_origins: a.allowed_origins ? JSON.parse(a.allowed_origins) : [],
4173
+ web_origins: a.web_origins ? JSON.parse(a.web_origins) : [],
4174
+ allowed_logout_urls: a.allowed_logout_urls ? JSON.parse(a.allowed_logout_urls) : []
4208
4175
  }))
4209
4176
  });
4210
4177
  }
4211
- function Za(n) {
4178
+ function Sa(n) {
4212
4179
  return async (e, t) => {
4213
4180
  const s = await n.selectFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", t).selectAll().executeTakeFirst();
4214
4181
  return s ? R({
4215
4182
  ...s,
4216
4183
  disable_sign_ups: !!s.disable_sign_ups,
4217
4184
  addons: JSON.parse(s.addons),
4218
- // TODO: add callbacks
4219
4185
  callback: JSON.parse(s.callbacks),
4220
4186
  allowed_origins: JSON.parse(s.allowed_origins),
4221
- allowed_callback_urls: JSON.parse(s.allowed_callback_urls),
4222
- allowed_web_origins: JSON.parse(s.allowed_web_origins)
4187
+ web_origins: JSON.parse(s.web_origins),
4188
+ allowed_logout_urls: JSON.parse(s.allowed_logout_urls)
4223
4189
  }) : null;
4224
4190
  };
4225
4191
  }
4226
- function ja(n) {
4192
+ function Za(n) {
4227
4193
  return async (e, t) => (await n.deleteFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", t).executeTakeFirst()).numDeletedRows > 0;
4228
4194
  }
4229
- function Na(n) {
4195
+ function ja(n) {
4230
4196
  return async (e, t, s) => {
4231
4197
  const r = {
4232
4198
  ...s,
4233
4199
  updated_at: (/* @__PURE__ */ new Date()).toISOString(),
4234
4200
  allowed_origins: s.allowed_origins ? JSON.stringify(s.allowed_origins) : void 0,
4235
- allowed_callback_urls: s.allowed_callback_urls ? JSON.stringify(s.allowed_callback_urls) : void 0,
4236
- allowed_web_origins: s.allowed_web_origins ? JSON.stringify(s.allowed_web_origins) : void 0,
4237
4201
  callbacks: s.callbacks ? JSON.stringify(s.callbacks) : void 0,
4202
+ web_origins: s.web_origins ? JSON.stringify(s.web_origins) : void 0,
4203
+ allowed_logout_urls: s.allowed_logout_urls ? JSON.stringify(s.allowed_logout_urls) : void 0,
4238
4204
  addons: s.addons ? JSON.stringify(s.addons) : "{}",
4239
4205
  disable_sign_ups: s.disable_sign_ups ? 1 : 0
4240
4206
  };
4241
4207
  return await n.updateTable("applications").set(r).where("applications.id", "=", t).where("applications.tenant_id", "=", e).execute(), !0;
4242
4208
  };
4243
4209
  }
4244
- function Ia(n) {
4210
+ function Na(n) {
4245
4211
  return {
4246
- create: Oa(n),
4247
- list: Sa(n),
4248
- get: Za(n),
4249
- remove: ja(n),
4250
- update: Na(n)
4212
+ create: Ta(n),
4213
+ list: Oa(n),
4214
+ get: Sa(n),
4215
+ remove: Za(n),
4216
+ update: ja(n)
4251
4217
  };
4252
4218
  }
4253
- function Ca(n) {
4219
+ function Ia(n) {
4254
4220
  return async (e, t) => {
4255
4221
  const s = {
4256
4222
  id: Re(),
@@ -4261,7 +4227,7 @@ function Ca(n) {
4261
4227
  return await n.insertInto("connections").values({ ...s, tenant_id: e }).execute(), s;
4262
4228
  };
4263
4229
  }
4264
- function Ea(n) {
4230
+ function Ca(n) {
4265
4231
  return async (e, t) => {
4266
4232
  let s = n.selectFrom("connections").where("connections.tenant_id", "=", e);
4267
4233
  t.q && (s = Ae(n, s, t.q, ["user_id", "ip"]));
@@ -4274,16 +4240,16 @@ function Ea(n) {
4274
4240
  };
4275
4241
  };
4276
4242
  }
4277
- function Aa(n) {
4243
+ function Ea(n) {
4278
4244
  return async (e, t) => (await n.deleteFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).executeTakeFirst()).numDeletedRows > 0;
4279
4245
  }
4280
- function Ra(n) {
4246
+ function Aa(n) {
4281
4247
  return async (e, t) => {
4282
4248
  const s = await n.selectFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", t).selectAll().executeTakeFirst();
4283
4249
  return s ? R(s) : null;
4284
4250
  };
4285
4251
  }
4286
- function $a(n) {
4252
+ function Ra(n) {
4287
4253
  return async (e, t, s) => {
4288
4254
  const r = {
4289
4255
  ...s,
@@ -4292,19 +4258,16 @@ function $a(n) {
4292
4258
  return await n.updateTable("connections").set(r).where("connections.id", "=", t).where("connections.tenant_id", "=", e).execute(), !0;
4293
4259
  };
4294
4260
  }
4295
- function Pa(n) {
4261
+ function $a(n) {
4296
4262
  return {
4297
- create: Ca(n),
4298
- get: Ra(n),
4299
- list: Ea(n),
4300
- remove: Aa(n),
4301
- update: $a(n)
4263
+ create: Ia(n),
4264
+ get: Aa(n),
4265
+ list: Ca(n),
4266
+ remove: Ea(n),
4267
+ update: Ra(n)
4302
4268
  };
4303
4269
  }
4304
- function en(n) {
4305
- return n != null && n.length ? n.split(",").map((e) => e.trim()) : [];
4306
- }
4307
- function Da(n) {
4270
+ function Pa(n) {
4308
4271
  return {
4309
4272
  get: async (e) => {
4310
4273
  const t = await n.selectFrom("applications").selectAll().where("id", "=", e).executeTakeFirst();
@@ -4315,18 +4278,16 @@ function Da(n) {
4315
4278
  throw new Et(404, { message: "Tenant not found" });
4316
4279
  const r = await n.selectFrom("connections").where("tenant_id", "=", t.tenant_id).selectAll().execute(), a = await n.selectFrom("domains").where("tenant_id", "=", t.tenant_id).selectAll().execute();
4317
4280
  return {
4318
- id: t.id,
4319
- name: t.name,
4281
+ ...t,
4320
4282
  connections: r.map(
4321
- (c) => hn.parse(R(c))
4283
+ (c) => Rn.parse(R(c))
4322
4284
  ),
4323
4285
  domains: a,
4324
- tenant_id: s.id,
4325
- allowed_callback_urls: en(t.allowed_callback_urls),
4326
- allowed_logout_urls: en(t.allowed_logout_urls),
4327
- allowed_web_origins: en(t.allowed_web_origins),
4328
- email_validation: t.email_validation,
4329
- client_secret: t.client_secret,
4286
+ addons: t.addons ? JSON.parse(t.addons) : {},
4287
+ callbacks: t.callbacks ? JSON.parse(t.callbacks) : [],
4288
+ allowed_origins: t.allowed_origins ? JSON.parse(t.allowed_origins) : [],
4289
+ web_origins: t.web_origins ? JSON.parse(t.web_origins) : [],
4290
+ allowed_logout_urls: t.allowed_logout_urls ? JSON.parse(t.allowed_logout_urls) : [],
4330
4291
  tenant: R(s),
4331
4292
  // this is really an integer in the database
4332
4293
  disable_sign_ups: !!t.disable_sign_ups
@@ -4334,25 +4295,25 @@ function Da(n) {
4334
4295
  }
4335
4296
  };
4336
4297
  }
4337
- function Ma(n) {
4298
+ function Da(n) {
4338
4299
  return async () => await n.selectFrom("keys").where("revoked_at", "is", null).selectAll().execute();
4339
4300
  }
4340
- function La(n) {
4301
+ function Ma(n) {
4341
4302
  return async (e) => {
4342
4303
  await n.insertInto("keys").values(e).execute();
4343
4304
  };
4344
4305
  }
4345
- function Va(n) {
4306
+ function La(n) {
4346
4307
  return async (e, t) => !!(await n.updateTable("keys").set({ revoked_at: t.toISOString() }).where("kid", "=", e).execute()).length;
4347
4308
  }
4348
- function Ua(n) {
4309
+ function Va(n) {
4349
4310
  return {
4350
- create: La(n),
4351
- list: Ma(n),
4352
- revoke: Va(n)
4311
+ create: Ma(n),
4312
+ list: Da(n),
4313
+ revoke: La(n)
4353
4314
  };
4354
4315
  }
4355
- function Fa(n) {
4316
+ function Ua(n) {
4356
4317
  return async (e, t) => {
4357
4318
  const s = {
4358
4319
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
@@ -4364,7 +4325,7 @@ function Fa(n) {
4364
4325
  return await n.insertInto("domains").values(s).execute(), s;
4365
4326
  };
4366
4327
  }
4367
- function za(n) {
4328
+ function Fa(n) {
4368
4329
  return async (e, t) => {
4369
4330
  let s = n.selectFrom("domains").where("domains.tenant_id", "=", e);
4370
4331
  t.q && (s = Ae(n, s, t.q, ["user_id", "ip"]));
@@ -4377,13 +4338,13 @@ function za(n) {
4377
4338
  };
4378
4339
  };
4379
4340
  }
4380
- function Ba(n) {
4341
+ function za(n) {
4381
4342
  return {
4382
- create: Fa(n),
4383
- list: za(n)
4343
+ create: Ua(n),
4344
+ list: Fa(n)
4384
4345
  };
4385
4346
  }
4386
- function Wa(n) {
4347
+ function Ba(n) {
4387
4348
  return async (e) => {
4388
4349
  const [t] = await n.selectFrom("branding").where("branding.tenant_id", "=", e).selectAll().execute();
4389
4350
  if (!t)
@@ -4413,9 +4374,9 @@ function Wa(n) {
4413
4374
  });
4414
4375
  };
4415
4376
  }
4416
- function qa(n) {
4377
+ function Wa(n) {
4417
4378
  return async (e, t) => {
4418
- var o, c, d, u, l, T, C, L, J, re, ce, de, ue, $e, Pe, Q, H, Y;
4379
+ var o, c, d, u, l, T, C, L, K, re, ce, de, ue, $e, Pe, Q, H, Y;
4419
4380
  const { colors: s, font: r, ...a } = t;
4420
4381
  try {
4421
4382
  await n.insertInto("branding").values({
@@ -4425,7 +4386,7 @@ function qa(n) {
4425
4386
  colors_page_background_start: (u = (d = t.colors) == null ? void 0 : d.page_background) == null ? void 0 : u.start,
4426
4387
  colors_page_background_end: (T = (l = t.colors) == null ? void 0 : l.page_background) == null ? void 0 : T.end,
4427
4388
  colors_page_background_angle_dev: (L = (C = t.colors) == null ? void 0 : C.page_background) == null ? void 0 : L.angle_deg,
4428
- font_url: (J = t.font) == null ? void 0 : J.url,
4389
+ font_url: (K = t.font) == null ? void 0 : K.url,
4429
4390
  tenant_id: e
4430
4391
  }).execute();
4431
4392
  } catch {
@@ -4441,10 +4402,10 @@ function qa(n) {
4441
4402
  }
4442
4403
  };
4443
4404
  }
4444
- function Ka(n) {
4405
+ function qa(n) {
4445
4406
  return {
4446
- get: Wa(n),
4447
- set: qa(n)
4407
+ get: Ba(n),
4408
+ set: Wa(n)
4448
4409
  };
4449
4410
  }
4450
4411
  function Ja(n) {
@@ -4476,7 +4437,7 @@ function Ja(n) {
4476
4437
  };
4477
4438
  };
4478
4439
  }
4479
- function Qa(n) {
4440
+ function Ka(n) {
4480
4441
  return async (e, t) => {
4481
4442
  const { authParams: s, ...r } = t;
4482
4443
  await n.insertInto("authentication_codes").values({
@@ -4486,13 +4447,13 @@ function Qa(n) {
4486
4447
  }).execute();
4487
4448
  };
4488
4449
  }
4489
- function Ha(n) {
4450
+ function Qa(n) {
4490
4451
  return {
4491
- create: Qa(n),
4452
+ create: Ka(n),
4492
4453
  get: Ja(n)
4493
4454
  };
4494
4455
  }
4495
- function Ya(n) {
4456
+ function Ha(n) {
4496
4457
  return async (e, t) => {
4497
4458
  let s = n.selectFrom("hooks").where("hooks.tenant_id", "=", e);
4498
4459
  t.q && (s = Ae(n, s, t.q, ["url"]));
@@ -4512,16 +4473,16 @@ function Ya(n) {
4512
4473
  };
4513
4474
  };
4514
4475
  }
4515
- function Ga(n) {
4476
+ function Ya(n) {
4516
4477
  return async (e, t) => {
4517
4478
  const s = await n.selectFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).selectAll().executeTakeFirst();
4518
4479
  return s ? (s.enabled = !!s.enabled, s.synchronous = !!s.synchronous, R(s)) : null;
4519
4480
  };
4520
4481
  }
4521
- function Xa(n) {
4482
+ function Ga(n) {
4522
4483
  return async (e, t) => (await n.deleteFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
4523
4484
  }
4524
- function ei(n) {
4485
+ function Xa(n) {
4525
4486
  return async (e, t) => {
4526
4487
  const s = {
4527
4488
  hook_id: Re(),
@@ -4535,7 +4496,7 @@ function ei(n) {
4535
4496
  }).execute(), s;
4536
4497
  };
4537
4498
  }
4538
- function ti(n) {
4499
+ function ei(n) {
4539
4500
  return async (e, t, s) => {
4540
4501
  const r = {
4541
4502
  ...s,
@@ -4544,16 +4505,16 @@ function ti(n) {
4544
4505
  return await n.updateTable("hooks").set(r).where("hooks.hook_id", "=", t).where("hooks.tenant_id", "=", e).execute(), !0;
4545
4506
  };
4546
4507
  }
4547
- function ni(n) {
4508
+ function ti(n) {
4548
4509
  return {
4549
- create: ei(n),
4550
- get: Ga(n),
4551
- list: Ya(n),
4552
- update: ti(n),
4553
- remove: Xa(n)
4510
+ create: Xa(n),
4511
+ get: Ya(n),
4512
+ list: Ha(n),
4513
+ update: ei(n),
4514
+ remove: Ga(n)
4554
4515
  };
4555
4516
  }
4556
- function si(n, e) {
4517
+ function ni(n, e) {
4557
4518
  var t = {};
4558
4519
  for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && e.indexOf(s) < 0 && (t[s] = n[s]);
4559
4520
  if (n != null && typeof Object.getOwnPropertySymbols == "function")
@@ -4561,7 +4522,7 @@ function si(n, e) {
4561
4522
  e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, s[r]) && (t[s[r]] = n[s[r]]);
4562
4523
  return t;
4563
4524
  }
4564
- function ri(n, e) {
4525
+ function si(n, e) {
4565
4526
  var t;
4566
4527
  return ((t = n == null ? void 0 : n._def) === null || t === void 0 ? void 0 : t.typeName) === e;
4567
4528
  }
@@ -4572,15 +4533,15 @@ function He(n, e) {
4572
4533
  return r._def.openapi = this._def.openapi, r;
4573
4534
  };
4574
4535
  }
4575
- function ai(n) {
4536
+ function ri(n) {
4576
4537
  if (typeof n.ZodType.prototype.openapi < "u")
4577
4538
  return;
4578
4539
  n.ZodType.prototype.openapi = function(r, a) {
4579
4540
  var o, c, d, u, l, T;
4580
- const C = typeof r == "string" ? a : r, L = C ?? {}, { param: J } = L, re = si(L, ["param"]), ce = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), de = Object.assign(Object.assign(Object.assign({}, (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata), re), !((u = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || u === void 0) && u.param || J ? {
4581
- param: Object.assign(Object.assign({}, (T = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || T === void 0 ? void 0 : T.param), J)
4541
+ const C = typeof r == "string" ? a : r, L = C ?? {}, { param: K } = L, re = ni(L, ["param"]), ce = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), de = Object.assign(Object.assign(Object.assign({}, (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata), re), !((u = (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata) === null || u === void 0) && u.param || K ? {
4542
+ param: Object.assign(Object.assign({}, (T = (l = this._def.openapi) === null || l === void 0 ? void 0 : l.metadata) === null || T === void 0 ? void 0 : T.param), K)
4582
4543
  } : void 0), ue = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(ce).length > 0 ? { _internal: ce } : void 0), Object.keys(de).length > 0 ? { metadata: de } : void 0) }));
4583
- if (ri(this, "ZodObject")) {
4544
+ if (si(this, "ZodObject")) {
4584
4545
  const $e = this.extend;
4585
4546
  ue.extend = function(...Pe) {
4586
4547
  var Q, H, Y, le, Te, Oe;
@@ -4651,14 +4612,14 @@ var I;
4651
4612
  }
4652
4613
  n.joinValues = s, n.jsonStringifyReplacer = (r, a) => typeof a == "bigint" ? a.toString() : a;
4653
4614
  })(I || (I = {}));
4654
- var on;
4615
+ var rn;
4655
4616
  (function(n) {
4656
4617
  n.mergeShapes = (e, t) => ({
4657
4618
  ...e,
4658
4619
  ...t
4659
4620
  // second overwrites first
4660
4621
  });
4661
- })(on || (on = {}));
4622
+ })(rn || (rn = {}));
4662
4623
  const g = I.arrayToEnum([
4663
4624
  "string",
4664
4625
  "nan",
@@ -4718,7 +4679,7 @@ const g = I.arrayToEnum([
4718
4679
  "invalid_intersection_types",
4719
4680
  "not_multiple_of",
4720
4681
  "not_finite"
4721
- ]), ii = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
4682
+ ]), ai = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
4722
4683
  class U extends Error {
4723
4684
  constructor(e) {
4724
4685
  super(), this.issues = [], this.addIssue = (s) => {
@@ -4835,12 +4796,12 @@ const qe = (n, e) => {
4835
4796
  }
4836
4797
  return { message: t };
4837
4798
  };
4838
- let Un = qe;
4839
- function oi(n) {
4840
- Un = n;
4799
+ let Mn = qe;
4800
+ function ii(n) {
4801
+ Mn = n;
4841
4802
  }
4842
4803
  function Ut() {
4843
- return Un;
4804
+ return Mn;
4844
4805
  }
4845
4806
  const Ft = (n) => {
4846
4807
  const { data: e, path: t, errorMaps: s, issueData: r } = n, a = [...t, ...r.path || []], o = {
@@ -4862,7 +4823,7 @@ const Ft = (n) => {
4862
4823
  path: a,
4863
4824
  message: c
4864
4825
  };
4865
- }, ci = [];
4826
+ }, oi = [];
4866
4827
  function m(n, e) {
4867
4828
  const t = Ut(), s = Ft({
4868
4829
  issueData: e,
@@ -4921,12 +4882,12 @@ class P {
4921
4882
  }
4922
4883
  const b = Object.freeze({
4923
4884
  status: "aborted"
4924
- }), Ve = (n) => ({ status: "dirty", value: n }), M = (n) => ({ status: "valid", value: n }), cn = (n) => n.status === "aborted", dn = (n) => n.status === "dirty", mt = (n) => n.status === "valid", _t = (n) => typeof Promise < "u" && n instanceof Promise;
4885
+ }), Ve = (n) => ({ status: "dirty", value: n }), M = (n) => ({ status: "valid", value: n }), an = (n) => n.status === "aborted", on = (n) => n.status === "dirty", mt = (n) => n.status === "valid", _t = (n) => typeof Promise < "u" && n instanceof Promise;
4925
4886
  function zt(n, e, t, s) {
4926
4887
  if (typeof e == "function" ? n !== e || !s : !e.has(n)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4927
4888
  return e.get(n);
4928
4889
  }
4929
- function Fn(n, e, t, s, r) {
4890
+ function Ln(n, e, t, s, r) {
4930
4891
  if (typeof e == "function" ? n !== e || !r : !e.has(n)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
4931
4892
  return e.set(n, t), t;
4932
4893
  }
@@ -4943,7 +4904,7 @@ class ne {
4943
4904
  return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
4944
4905
  }
4945
4906
  }
4946
- const kn = (n, e) => {
4907
+ const yn = (n, e) => {
4947
4908
  if (mt(e))
4948
4909
  return { success: !0, data: e.value };
4949
4910
  if (!n.common.issues.length)
@@ -5033,7 +4994,7 @@ class j {
5033
4994
  data: e,
5034
4995
  parsedType: fe(e)
5035
4996
  }, a = this._parseSync({ data: e, path: r.path, parent: r });
5036
- return kn(r, a);
4997
+ return yn(r, a);
5037
4998
  }
5038
4999
  async parseAsync(e, t) {
5039
5000
  const s = await this.safeParseAsync(e, t);
@@ -5054,7 +5015,7 @@ class j {
5054
5015
  data: e,
5055
5016
  parsedType: fe(e)
5056
5017
  }, r = this._parse({ data: e, path: s.path, parent: s }), a = await (_t(r) ? r : Promise.resolve(r));
5057
- return kn(s, a);
5018
+ return yn(s, a);
5058
5019
  }
5059
5020
  refine(e, t) {
5060
5021
  const s = (r) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(r) : t;
@@ -5070,7 +5031,7 @@ class j {
5070
5031
  return this._refinement((s, r) => e(s) ? !0 : (r.addIssue(typeof t == "function" ? t(s, r) : t), !1));
5071
5032
  }
5072
5033
  _refinement(e) {
5073
- return new K({
5034
+ return new J({
5074
5035
  schema: this,
5075
5036
  typeName: k.ZodEffects,
5076
5037
  effect: { type: "refinement", refinement: e }
@@ -5092,7 +5053,7 @@ class j {
5092
5053
  return W.create(this, this._def);
5093
5054
  }
5094
5055
  promise() {
5095
- return Je.create(this, this._def);
5056
+ return Ke.create(this, this._def);
5096
5057
  }
5097
5058
  or(e) {
5098
5059
  return wt.create([this, e], this._def);
@@ -5101,7 +5062,7 @@ class j {
5101
5062
  return kt.create(this, e, this._def);
5102
5063
  }
5103
5064
  transform(e) {
5104
- return new K({
5065
+ return new J({
5105
5066
  ...S(this._def),
5106
5067
  schema: this,
5107
5068
  typeName: k.ZodEffects,
@@ -5118,7 +5079,7 @@ class j {
5118
5079
  });
5119
5080
  }
5120
5081
  brand() {
5121
- return new _n({
5082
+ return new hn({
5122
5083
  typeName: k.ZodBranded,
5123
5084
  type: this,
5124
5085
  ...S(this._def)
@@ -5153,23 +5114,23 @@ class j {
5153
5114
  return this.safeParse(null).success;
5154
5115
  }
5155
5116
  }
5156
- const di = /^c[^\s-]{8,}$/i, ui = /^[0-9a-z]+$/, li = /^[0-9A-HJKMNP-TV-Z]{26}$/, pi = /^[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, hi = /^[a-z0-9_-]{21}$/i, fi = /^[-+]?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)?)??$/, mi = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, _i = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
5157
- let tn;
5158
- const gi = /^(?:(?: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])$/, yi = /^(([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})))$/, vi = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, zn = "((\\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])))", wi = new RegExp(`^${zn}$`);
5159
- function Bn(n) {
5117
+ const ci = /^c[^\s-]{8,}$/i, di = /^[0-9a-z]+$/, ui = /^[0-9A-HJKMNP-TV-Z]{26}$/, li = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, pi = /^[a-z0-9_-]{21}$/i, hi = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, fi = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, mi = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
5118
+ let Xt;
5119
+ const _i = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, gi = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, yi = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Vn = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", vi = new RegExp(`^${Vn}$`);
5120
+ function Un(n) {
5160
5121
  let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
5161
5122
  return n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`), e;
5162
5123
  }
5163
- function ki(n) {
5164
- return new RegExp(`^${Bn(n)}$`);
5124
+ function wi(n) {
5125
+ return new RegExp(`^${Un(n)}$`);
5165
5126
  }
5166
- function Wn(n) {
5167
- let e = `${zn}T${Bn(n)}`;
5127
+ function Fn(n) {
5128
+ let e = `${Vn}T${Un(n)}`;
5168
5129
  const t = [];
5169
5130
  return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
5170
5131
  }
5171
- function bi(n, e) {
5172
- return !!((e === "v4" || !e) && gi.test(n) || (e === "v6" || !e) && yi.test(n));
5132
+ function ki(n, e) {
5133
+ return !!((e === "v4" || !e) && _i.test(n) || (e === "v6" || !e) && gi.test(n));
5173
5134
  }
5174
5135
  class z extends j {
5175
5136
  _parse(e) {
@@ -5220,43 +5181,43 @@ class z extends j {
5220
5181
  message: a.message
5221
5182
  }), s.dirty());
5222
5183
  } else if (a.kind === "email")
5223
- mi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5184
+ fi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5224
5185
  validation: "email",
5225
5186
  code: h.invalid_string,
5226
5187
  message: a.message
5227
5188
  }), s.dirty());
5228
5189
  else if (a.kind === "emoji")
5229
- tn || (tn = new RegExp(_i, "u")), tn.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5190
+ Xt || (Xt = new RegExp(mi, "u")), Xt.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5230
5191
  validation: "emoji",
5231
5192
  code: h.invalid_string,
5232
5193
  message: a.message
5233
5194
  }), s.dirty());
5234
5195
  else if (a.kind === "uuid")
5235
- pi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5196
+ li.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5236
5197
  validation: "uuid",
5237
5198
  code: h.invalid_string,
5238
5199
  message: a.message
5239
5200
  }), s.dirty());
5240
5201
  else if (a.kind === "nanoid")
5241
- hi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5202
+ pi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5242
5203
  validation: "nanoid",
5243
5204
  code: h.invalid_string,
5244
5205
  message: a.message
5245
5206
  }), s.dirty());
5246
5207
  else if (a.kind === "cuid")
5247
- di.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5208
+ ci.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5248
5209
  validation: "cuid",
5249
5210
  code: h.invalid_string,
5250
5211
  message: a.message
5251
5212
  }), s.dirty());
5252
5213
  else if (a.kind === "cuid2")
5253
- ui.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5214
+ di.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5254
5215
  validation: "cuid2",
5255
5216
  code: h.invalid_string,
5256
5217
  message: a.message
5257
5218
  }), s.dirty());
5258
5219
  else if (a.kind === "ulid")
5259
- li.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5220
+ ui.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5260
5221
  validation: "ulid",
5261
5222
  code: h.invalid_string,
5262
5223
  message: a.message
@@ -5287,27 +5248,27 @@ class z extends j {
5287
5248
  code: h.invalid_string,
5288
5249
  validation: { endsWith: a.value },
5289
5250
  message: a.message
5290
- }), s.dirty()) : a.kind === "datetime" ? Wn(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5251
+ }), s.dirty()) : a.kind === "datetime" ? Fn(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5291
5252
  code: h.invalid_string,
5292
5253
  validation: "datetime",
5293
5254
  message: a.message
5294
- }), s.dirty()) : a.kind === "date" ? wi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5255
+ }), s.dirty()) : a.kind === "date" ? vi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5295
5256
  code: h.invalid_string,
5296
5257
  validation: "date",
5297
5258
  message: a.message
5298
- }), s.dirty()) : a.kind === "time" ? ki(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5259
+ }), s.dirty()) : a.kind === "time" ? wi(a).test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5299
5260
  code: h.invalid_string,
5300
5261
  validation: "time",
5301
5262
  message: a.message
5302
- }), s.dirty()) : a.kind === "duration" ? fi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5263
+ }), s.dirty()) : a.kind === "duration" ? hi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5303
5264
  validation: "duration",
5304
5265
  code: h.invalid_string,
5305
5266
  message: a.message
5306
- }), s.dirty()) : a.kind === "ip" ? bi(e.data, a.version) || (r = this._getOrReturnCtx(e, r), m(r, {
5267
+ }), s.dirty()) : a.kind === "ip" ? ki(e.data, a.version) || (r = this._getOrReturnCtx(e, r), m(r, {
5307
5268
  validation: "ip",
5308
5269
  code: h.invalid_string,
5309
5270
  message: a.message
5310
- }), s.dirty()) : a.kind === "base64" ? vi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5271
+ }), s.dirty()) : a.kind === "base64" ? yi.test(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
5311
5272
  validation: "base64",
5312
5273
  code: h.invalid_string,
5313
5274
  message: a.message
@@ -5529,7 +5490,7 @@ z.create = (n) => {
5529
5490
  ...S(n)
5530
5491
  });
5531
5492
  };
5532
- function xi(n, e) {
5493
+ function bi(n, e) {
5533
5494
  const t = (n.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, r = t > s ? t : s, a = parseInt(n.toFixed(r).replace(".", "")), o = parseInt(e.toFixed(r).replace(".", ""));
5534
5495
  return a % o / Math.pow(10, r);
5535
5496
  }
@@ -5568,7 +5529,7 @@ class ve extends j {
5568
5529
  inclusive: a.inclusive,
5569
5530
  exact: !1,
5570
5531
  message: a.message
5571
- }), r.dirty()) : a.kind === "multipleOf" ? xi(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), m(s, {
5532
+ }), r.dirty()) : a.kind === "multipleOf" ? bi(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), m(s, {
5572
5533
  code: h.not_multiple_of,
5573
5534
  multipleOf: a.value,
5574
5535
  message: a.message
@@ -5980,7 +5941,7 @@ vt.create = (n) => new vt({
5980
5941
  typeName: k.ZodNull,
5981
5942
  ...S(n)
5982
5943
  });
5983
- class Ke extends j {
5944
+ class Je extends j {
5984
5945
  constructor() {
5985
5946
  super(...arguments), this._any = !0;
5986
5947
  }
@@ -5988,7 +5949,7 @@ class Ke extends j {
5988
5949
  return M(e.data);
5989
5950
  }
5990
5951
  }
5991
- Ke.create = (n) => new Ke({
5952
+ Je.create = (n) => new Je({
5992
5953
  typeName: k.ZodAny,
5993
5954
  ...S(n)
5994
5955
  });
@@ -6387,7 +6348,7 @@ class A extends j {
6387
6348
  });
6388
6349
  }
6389
6350
  keyof() {
6390
- return qn(I.objectKeys(this.shape));
6351
+ return zn(I.objectKeys(this.shape));
6391
6352
  }
6392
6353
  }
6393
6354
  A.create = (n, e) => new A({
@@ -6484,7 +6445,7 @@ wt.create = (n, e) => new wt({
6484
6445
  typeName: k.ZodUnion,
6485
6446
  ...S(e)
6486
6447
  });
6487
- const ae = (n) => n instanceof xt ? ae(n.schema) : n instanceof K ? ae(n.innerType()) : n instanceof Tt ? [n.value] : n instanceof ke ? n.options : n instanceof Ot ? I.objectValues(n.enum) : n instanceof St ? ae(n._def.innerType) : n instanceof yt ? [void 0] : n instanceof vt ? [null] : n instanceof X ? [void 0, ...ae(n.unwrap())] : n instanceof be ? [null, ...ae(n.unwrap())] : n instanceof _n || n instanceof jt ? ae(n.unwrap()) : n instanceof Zt ? ae(n._def.innerType) : [];
6448
+ const ae = (n) => n instanceof xt ? ae(n.schema) : n instanceof J ? ae(n.innerType()) : n instanceof Tt ? [n.value] : n instanceof ke ? n.options : n instanceof Ot ? I.objectValues(n.enum) : n instanceof St ? ae(n._def.innerType) : n instanceof yt ? [void 0] : n instanceof vt ? [null] : n instanceof X ? [void 0, ...ae(n.unwrap())] : n instanceof be ? [null, ...ae(n.unwrap())] : n instanceof hn || n instanceof jt ? ae(n.unwrap()) : n instanceof Zt ? ae(n._def.innerType) : [];
6488
6449
  class Ht extends j {
6489
6450
  _parse(e) {
6490
6451
  const { ctx: t } = this._processInputParams(e);
@@ -6547,14 +6508,14 @@ class Ht extends j {
6547
6508
  });
6548
6509
  }
6549
6510
  }
6550
- function un(n, e) {
6511
+ function cn(n, e) {
6551
6512
  const t = fe(n), s = fe(e);
6552
6513
  if (n === e)
6553
6514
  return { valid: !0, data: n };
6554
6515
  if (t === g.object && s === g.object) {
6555
6516
  const r = I.objectKeys(e), a = I.objectKeys(n).filter((c) => r.indexOf(c) !== -1), o = { ...n, ...e };
6556
6517
  for (const c of a) {
6557
- const d = un(n[c], e[c]);
6518
+ const d = cn(n[c], e[c]);
6558
6519
  if (!d.valid)
6559
6520
  return { valid: !1 };
6560
6521
  o[c] = d.data;
@@ -6565,7 +6526,7 @@ function un(n, e) {
6565
6526
  return { valid: !1 };
6566
6527
  const r = [];
6567
6528
  for (let a = 0; a < n.length; a++) {
6568
- const o = n[a], c = e[a], d = un(o, c);
6529
+ const o = n[a], c = e[a], d = cn(o, c);
6569
6530
  if (!d.valid)
6570
6531
  return { valid: !1 };
6571
6532
  r.push(d.data);
@@ -6576,10 +6537,10 @@ function un(n, e) {
6576
6537
  class kt extends j {
6577
6538
  _parse(e) {
6578
6539
  const { status: t, ctx: s } = this._processInputParams(e), r = (a, o) => {
6579
- if (cn(a) || cn(o))
6540
+ if (an(a) || an(o))
6580
6541
  return b;
6581
- const c = un(a.value, o.value);
6582
- return c.valid ? ((dn(a) || dn(o)) && t.dirty(), { status: t.value, value: c.data }) : (m(s, {
6542
+ const c = cn(a.value, o.value);
6543
+ return c.valid ? ((on(a) || on(o)) && t.dirty(), { status: t.value, value: c.data }) : (m(s, {
6583
6544
  code: h.invalid_intersection_types
6584
6545
  }), b);
6585
6546
  };
@@ -6859,7 +6820,7 @@ class Fe extends j {
6859
6820
  });
6860
6821
  }
6861
6822
  const a = { errorMap: t.common.contextualErrorMap }, o = t.data;
6862
- if (this._def.returns instanceof Je) {
6823
+ if (this._def.returns instanceof Ke) {
6863
6824
  const c = this;
6864
6825
  return M(async function(...d) {
6865
6826
  const u = new U([]), l = await c._def.args.parseAsync(d, a).catch((L) => {
@@ -6950,7 +6911,7 @@ Tt.create = (n, e) => new Tt({
6950
6911
  typeName: k.ZodLiteral,
6951
6912
  ...S(e)
6952
6913
  });
6953
- function qn(n, e) {
6914
+ function zn(n, e) {
6954
6915
  return new ke({
6955
6916
  values: n,
6956
6917
  typeName: k.ZodEnum,
@@ -6970,7 +6931,7 @@ class ke extends j {
6970
6931
  code: h.invalid_type
6971
6932
  }), b;
6972
6933
  }
6973
- if (zt(this, Xe) || Fn(this, Xe, new Set(this._def.values)), !zt(this, Xe).has(e.data)) {
6934
+ if (zt(this, Xe) || Ln(this, Xe, new Set(this._def.values)), !zt(this, Xe).has(e.data)) {
6974
6935
  const t = this._getOrReturnCtx(e), s = this._def.values;
6975
6936
  return m(t, {
6976
6937
  received: t.data,
@@ -7015,7 +6976,7 @@ class ke extends j {
7015
6976
  }
7016
6977
  }
7017
6978
  Xe = /* @__PURE__ */ new WeakMap();
7018
- ke.create = qn;
6979
+ ke.create = zn;
7019
6980
  class Ot extends j {
7020
6981
  constructor() {
7021
6982
  super(...arguments), et.set(this, void 0);
@@ -7030,7 +6991,7 @@ class Ot extends j {
7030
6991
  code: h.invalid_type
7031
6992
  }), b;
7032
6993
  }
7033
- if (zt(this, et) || Fn(this, et, new Set(I.getValidEnumValues(this._def.values))), !zt(this, et).has(e.data)) {
6994
+ if (zt(this, et) || Ln(this, et, new Set(I.getValidEnumValues(this._def.values))), !zt(this, et).has(e.data)) {
7034
6995
  const r = I.objectValues(t);
7035
6996
  return m(s, {
7036
6997
  received: s.data,
@@ -7050,7 +7011,7 @@ Ot.create = (n, e) => new Ot({
7050
7011
  typeName: k.ZodNativeEnum,
7051
7012
  ...S(e)
7052
7013
  });
7053
- class Je extends j {
7014
+ class Ke extends j {
7054
7015
  unwrap() {
7055
7016
  return this._def.type;
7056
7017
  }
@@ -7069,12 +7030,12 @@ class Je extends j {
7069
7030
  })));
7070
7031
  }
7071
7032
  }
7072
- Je.create = (n, e) => new Je({
7033
+ Ke.create = (n, e) => new Ke({
7073
7034
  type: n,
7074
7035
  typeName: k.ZodPromise,
7075
7036
  ...S(e)
7076
7037
  });
7077
- class K extends j {
7038
+ class J extends j {
7078
7039
  innerType() {
7079
7040
  return this._def.schema;
7080
7041
  }
@@ -7151,13 +7112,13 @@ class K extends j {
7151
7112
  I.assertNever(r);
7152
7113
  }
7153
7114
  }
7154
- K.create = (n, e, t) => new K({
7115
+ J.create = (n, e, t) => new J({
7155
7116
  schema: n,
7156
7117
  typeName: k.ZodEffects,
7157
7118
  effect: e,
7158
7119
  ...S(t)
7159
7120
  });
7160
- K.createWithPreprocess = (n, e, t) => new K({
7121
+ J.createWithPreprocess = (n, e, t) => new J({
7161
7122
  schema: e,
7162
7123
  effect: { type: "preprocess", transform: n },
7163
7124
  typeName: k.ZodEffects,
@@ -7252,7 +7213,7 @@ Zt.create = (n, e) => new Zt({
7252
7213
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
7253
7214
  ...S(e)
7254
7215
  });
7255
- class Kt extends j {
7216
+ class Jt extends j {
7256
7217
  _parse(e) {
7257
7218
  if (this._getType(e) !== g.nan) {
7258
7219
  const s = this._getOrReturnCtx(e);
@@ -7265,12 +7226,12 @@ class Kt extends j {
7265
7226
  return { status: "valid", value: e.data };
7266
7227
  }
7267
7228
  }
7268
- Kt.create = (n) => new Kt({
7229
+ Jt.create = (n) => new Jt({
7269
7230
  typeName: k.ZodNaN,
7270
7231
  ...S(n)
7271
7232
  });
7272
- const Ti = Symbol("zod_brand");
7273
- class _n extends j {
7233
+ const xi = Symbol("zod_brand");
7234
+ class hn extends j {
7274
7235
  _parse(e) {
7275
7236
  const { ctx: t } = this._processInputParams(e), s = t.data;
7276
7237
  return this._def.type._parse({
@@ -7337,25 +7298,25 @@ jt.create = (n, e) => new jt({
7337
7298
  typeName: k.ZodReadonly,
7338
7299
  ...S(e)
7339
7300
  });
7340
- function Kn(n, e = {}, t) {
7341
- return n ? Ke.create().superRefine((s, r) => {
7301
+ function Bn(n, e = {}, t) {
7302
+ return n ? Je.create().superRefine((s, r) => {
7342
7303
  var a, o;
7343
7304
  if (!n(s)) {
7344
7305
  const c = typeof e == "function" ? e(s) : typeof e == "string" ? { message: e } : e, d = (o = (a = c.fatal) !== null && a !== void 0 ? a : t) !== null && o !== void 0 ? o : !0, u = typeof c == "string" ? { message: c } : c;
7345
7306
  r.addIssue({ code: "custom", ...u, fatal: d });
7346
7307
  }
7347
- }) : Ke.create();
7308
+ }) : Je.create();
7348
7309
  }
7349
- const Oi = {
7310
+ const Ti = {
7350
7311
  object: A.lazycreate
7351
7312
  };
7352
7313
  var k;
7353
7314
  (function(n) {
7354
7315
  n.ZodString = "ZodString", n.ZodNumber = "ZodNumber", n.ZodNaN = "ZodNaN", n.ZodBigInt = "ZodBigInt", n.ZodBoolean = "ZodBoolean", n.ZodDate = "ZodDate", n.ZodSymbol = "ZodSymbol", n.ZodUndefined = "ZodUndefined", n.ZodNull = "ZodNull", n.ZodAny = "ZodAny", n.ZodUnknown = "ZodUnknown", n.ZodNever = "ZodNever", n.ZodVoid = "ZodVoid", n.ZodArray = "ZodArray", n.ZodObject = "ZodObject", n.ZodUnion = "ZodUnion", n.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", n.ZodIntersection = "ZodIntersection", n.ZodTuple = "ZodTuple", n.ZodRecord = "ZodRecord", n.ZodMap = "ZodMap", n.ZodSet = "ZodSet", n.ZodFunction = "ZodFunction", n.ZodLazy = "ZodLazy", n.ZodLiteral = "ZodLiteral", n.ZodEnum = "ZodEnum", n.ZodEffects = "ZodEffects", n.ZodNativeEnum = "ZodNativeEnum", n.ZodOptional = "ZodOptional", n.ZodNullable = "ZodNullable", n.ZodDefault = "ZodDefault", n.ZodCatch = "ZodCatch", n.ZodPromise = "ZodPromise", n.ZodBranded = "ZodBranded", n.ZodPipeline = "ZodPipeline", n.ZodReadonly = "ZodReadonly";
7355
7316
  })(k || (k = {}));
7356
- const Si = (n, e = {
7317
+ const Oi = (n, e = {
7357
7318
  message: `Input not instance of ${n.name}`
7358
- }) => Kn((t) => t instanceof n, e), Jn = z.create, Qn = ve.create, Zi = Kt.create, ji = we.create, Hn = gt.create, Ni = Ce.create, Ii = Bt.create, Ci = yt.create, Ei = vt.create, Ai = Ke.create, Ri = je.create, $i = oe.create, Pi = Wt.create, Di = W.create, Mi = A.create, Li = A.strictCreate, Vi = wt.create, Ui = Ht.create, Fi = kt.create, zi = se.create, Bi = bt.create, Wi = qt.create, qi = Ee.create, Ki = Fe.create, Ji = xt.create, Qi = Tt.create, Hi = ke.create, Yi = Ot.create, Gi = Je.create, bn = K.create, Xi = X.create, eo = be.create, to = K.createWithPreprocess, no = It.create, so = () => Jn().optional(), ro = () => Qn().optional(), ao = () => Hn().optional(), io = {
7319
+ }) => Bn((t) => t instanceof n, e), Wn = z.create, qn = ve.create, Si = Jt.create, Zi = we.create, Jn = gt.create, ji = Ce.create, Ni = Bt.create, Ii = yt.create, Ci = vt.create, Ei = Je.create, Ai = je.create, Ri = oe.create, $i = Wt.create, Pi = W.create, Di = A.create, Mi = A.strictCreate, Li = wt.create, Vi = Ht.create, Ui = kt.create, Fi = se.create, zi = bt.create, Bi = qt.create, Wi = Ee.create, qi = Fe.create, Ji = xt.create, Ki = Tt.create, Qi = ke.create, Hi = Ot.create, Yi = Ke.create, vn = J.create, Gi = X.create, Xi = be.create, eo = J.createWithPreprocess, to = It.create, no = () => Wn().optional(), so = () => qn().optional(), ro = () => Jn().optional(), ao = {
7359
7320
  string: (n) => z.create({ ...n, coerce: !0 }),
7360
7321
  number: (n) => ve.create({ ...n, coerce: !0 }),
7361
7322
  boolean: (n) => gt.create({
@@ -7364,33 +7325,33 @@ const Si = (n, e = {
7364
7325
  }),
7365
7326
  bigint: (n) => we.create({ ...n, coerce: !0 }),
7366
7327
  date: (n) => Ce.create({ ...n, coerce: !0 })
7367
- }, oo = b;
7368
- var co = /* @__PURE__ */ Object.freeze({
7328
+ }, io = b;
7329
+ var oo = /* @__PURE__ */ Object.freeze({
7369
7330
  __proto__: null,
7370
7331
  defaultErrorMap: qe,
7371
- setErrorMap: oi,
7332
+ setErrorMap: ii,
7372
7333
  getErrorMap: Ut,
7373
7334
  makeIssue: Ft,
7374
- EMPTY_PATH: ci,
7335
+ EMPTY_PATH: oi,
7375
7336
  addIssueToContext: m,
7376
7337
  ParseStatus: P,
7377
7338
  INVALID: b,
7378
7339
  DIRTY: Ve,
7379
7340
  OK: M,
7380
- isAborted: cn,
7381
- isDirty: dn,
7341
+ isAborted: an,
7342
+ isDirty: on,
7382
7343
  isValid: mt,
7383
7344
  isAsync: _t,
7384
7345
  get util() {
7385
7346
  return I;
7386
7347
  },
7387
7348
  get objectUtil() {
7388
- return on;
7349
+ return rn;
7389
7350
  },
7390
7351
  ZodParsedType: g,
7391
7352
  getParsedType: fe,
7392
7353
  ZodType: j,
7393
- datetimeRegex: Wn,
7354
+ datetimeRegex: Fn,
7394
7355
  ZodString: z,
7395
7356
  ZodNumber: ve,
7396
7357
  ZodBigInt: we,
@@ -7399,7 +7360,7 @@ var co = /* @__PURE__ */ Object.freeze({
7399
7360
  ZodSymbol: Bt,
7400
7361
  ZodUndefined: yt,
7401
7362
  ZodNull: vt,
7402
- ZodAny: Ke,
7363
+ ZodAny: Je,
7403
7364
  ZodUnknown: je,
7404
7365
  ZodNever: oe,
7405
7366
  ZodVoid: Wt,
@@ -7417,71 +7378,71 @@ var co = /* @__PURE__ */ Object.freeze({
7417
7378
  ZodLiteral: Tt,
7418
7379
  ZodEnum: ke,
7419
7380
  ZodNativeEnum: Ot,
7420
- ZodPromise: Je,
7421
- ZodEffects: K,
7422
- ZodTransformer: K,
7381
+ ZodPromise: Ke,
7382
+ ZodEffects: J,
7383
+ ZodTransformer: J,
7423
7384
  ZodOptional: X,
7424
7385
  ZodNullable: be,
7425
7386
  ZodDefault: St,
7426
7387
  ZodCatch: Zt,
7427
- ZodNaN: Kt,
7428
- BRAND: Ti,
7429
- ZodBranded: _n,
7388
+ ZodNaN: Jt,
7389
+ BRAND: xi,
7390
+ ZodBranded: hn,
7430
7391
  ZodPipeline: It,
7431
7392
  ZodReadonly: jt,
7432
- custom: Kn,
7393
+ custom: Bn,
7433
7394
  Schema: j,
7434
7395
  ZodSchema: j,
7435
- late: Oi,
7396
+ late: Ti,
7436
7397
  get ZodFirstPartyTypeKind() {
7437
7398
  return k;
7438
7399
  },
7439
- coerce: io,
7440
- any: Ai,
7441
- array: Di,
7442
- bigint: ji,
7443
- boolean: Hn,
7444
- date: Ni,
7445
- discriminatedUnion: Ui,
7446
- effect: bn,
7447
- enum: Hi,
7448
- function: Ki,
7449
- instanceof: Si,
7450
- intersection: Fi,
7400
+ coerce: ao,
7401
+ any: Ei,
7402
+ array: Pi,
7403
+ bigint: Zi,
7404
+ boolean: Jn,
7405
+ date: ji,
7406
+ discriminatedUnion: Vi,
7407
+ effect: vn,
7408
+ enum: Qi,
7409
+ function: qi,
7410
+ instanceof: Oi,
7411
+ intersection: Ui,
7451
7412
  lazy: Ji,
7452
- literal: Qi,
7453
- map: Wi,
7454
- nan: Zi,
7455
- nativeEnum: Yi,
7456
- never: $i,
7457
- null: Ei,
7458
- nullable: eo,
7459
- number: Qn,
7460
- object: Mi,
7461
- oboolean: ao,
7462
- onumber: ro,
7463
- optional: Xi,
7464
- ostring: so,
7465
- pipeline: no,
7466
- preprocess: to,
7467
- promise: Gi,
7468
- record: Bi,
7469
- set: qi,
7470
- strictObject: Li,
7471
- string: Jn,
7472
- symbol: Ii,
7473
- transformer: bn,
7474
- tuple: zi,
7475
- undefined: Ci,
7476
- union: Vi,
7477
- unknown: Ri,
7478
- void: Pi,
7479
- NEVER: oo,
7413
+ literal: Ki,
7414
+ map: Bi,
7415
+ nan: Si,
7416
+ nativeEnum: Hi,
7417
+ never: Ri,
7418
+ null: Ci,
7419
+ nullable: Xi,
7420
+ number: qn,
7421
+ object: Di,
7422
+ oboolean: ro,
7423
+ onumber: so,
7424
+ optional: Gi,
7425
+ ostring: no,
7426
+ pipeline: to,
7427
+ preprocess: eo,
7428
+ promise: Yi,
7429
+ record: zi,
7430
+ set: Wi,
7431
+ strictObject: Mi,
7432
+ string: Wn,
7433
+ symbol: Ni,
7434
+ transformer: vn,
7435
+ tuple: Fi,
7436
+ undefined: Ii,
7437
+ union: Li,
7438
+ unknown: Ai,
7439
+ void: $i,
7440
+ NEVER: io,
7480
7441
  ZodIssueCode: h,
7481
- quotelessJson: ii,
7442
+ quotelessJson: ai,
7482
7443
  ZodError: U
7483
7444
  });
7484
- ai(co);
7445
+ ri(oo);
7485
7446
  function Ct(n, e = "", t = {}) {
7486
7447
  for (let s in n)
7487
7448
  if (Object.prototype.hasOwnProperty.call(n, s)) {
@@ -7490,7 +7451,7 @@ function Ct(n, e = "", t = {}) {
7490
7451
  }
7491
7452
  return t;
7492
7453
  }
7493
- function uo(n, e) {
7454
+ function co(n, e) {
7494
7455
  const t = {};
7495
7456
  for (const [s, r] of Object.entries(n)) {
7496
7457
  const a = e.find(
@@ -7508,7 +7469,7 @@ function uo(n, e) {
7508
7469
  }
7509
7470
  return t;
7510
7471
  }
7511
- function lo(n) {
7472
+ function uo(n) {
7512
7473
  return async (e, t) => {
7513
7474
  const s = {
7514
7475
  themeId: Re(),
@@ -7519,16 +7480,16 @@ function lo(n) {
7519
7480
  return await n.insertInto("themes").values({ ...Ct(s), tenant_id: e }).execute(), s;
7520
7481
  };
7521
7482
  }
7522
- function po(n) {
7483
+ function lo(n) {
7523
7484
  return async (e, t) => (await n.deleteFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", t).executeTakeFirst()).numDeletedRows > 0;
7524
7485
  }
7525
- function ho(n) {
7486
+ function po(n) {
7526
7487
  return async (e, t) => {
7527
7488
  const s = await n.selectFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", t).selectAll().executeTakeFirst();
7528
7489
  return s ? R(s) : null;
7529
7490
  };
7530
7491
  }
7531
- function fo(n) {
7492
+ function ho(n) {
7532
7493
  return async (e, t, s) => {
7533
7494
  const r = Ct({
7534
7495
  ...s,
@@ -7537,23 +7498,23 @@ function fo(n) {
7537
7498
  return await n.updateTable("themes").set(r).where("themes.id", "=", t).where("themes.tenant_id", "=", e).execute(), !0;
7538
7499
  };
7539
7500
  }
7540
- function mo(n) {
7501
+ function fo(n) {
7541
7502
  return {
7542
- create: lo(n),
7543
- get: ho(n),
7544
- remove: po(n),
7545
- update: fo(n)
7503
+ create: uo(n),
7504
+ get: po(n),
7505
+ remove: lo(n),
7506
+ update: ho(n)
7546
7507
  };
7547
7508
  }
7548
- function _o(n) {
7509
+ function mo(n) {
7549
7510
  return async (e, t) => {
7550
7511
  const s = (/* @__PURE__ */ new Date()).toISOString(), r = await n.selectFrom("logins").where("logins.expires_at", ">", s).where("logins.login_id", "=", t).selectAll().executeTakeFirst();
7551
7512
  return r ? yr.parse(
7552
- uo(R(r), ["authParams"])
7513
+ co(R(r), ["authParams"])
7553
7514
  ) : null;
7554
7515
  };
7555
7516
  }
7556
- function go(n) {
7517
+ function _o(n) {
7557
7518
  return async (e, t) => {
7558
7519
  const s = {
7559
7520
  login_id: Re(),
@@ -7564,43 +7525,43 @@ function go(n) {
7564
7525
  return await n.insertInto("logins").values({ ...Ct(s), tenant_id: e }).execute(), s;
7565
7526
  };
7566
7527
  }
7567
- function yo(n) {
7528
+ function go(n) {
7568
7529
  return async (e, t, s) => (await n.updateTable("logins").set(Ct(s)).where("logins.login_id", "=", t).where("logins.tenant_id", "=", e).execute()).length === 1;
7569
7530
  }
7570
- function vo(n) {
7531
+ function yo(n) {
7571
7532
  return async (e, t) => (await n.deleteFrom("logins").where("logins.tenant_id", "=", e).where("logins.login_id", "=", t).execute()).length > 0;
7572
7533
  }
7573
- function wo(n) {
7534
+ function vo(n) {
7574
7535
  return {
7575
- create: go(n),
7576
- get: _o(n),
7577
- update: yo(n),
7578
- remove: vo(n)
7536
+ create: _o(n),
7537
+ get: mo(n),
7538
+ update: go(n),
7539
+ remove: yo(n)
7579
7540
  };
7580
7541
  }
7581
- function bo(n) {
7542
+ function ko(n) {
7582
7543
  return {
7583
- applications: Ia(n),
7584
- authenticationCodes: Ha(n),
7585
- branding: Ka(n),
7586
- clients: Da(n),
7587
- codes: wa(n),
7588
- connections: Pa(n),
7589
- domains: Ba(n),
7590
- hooks: ni(n),
7591
- keys: Ua(n),
7592
- logins: wo(n),
7593
- logs: Yr(n),
7594
- OTP: la(n),
7595
- passwords: ma(n),
7596
- users: Lr(n),
7597
- sessions: sa(n),
7598
- tenants: qr(n),
7599
- themes: mo(n),
7600
- tickets: oa(n),
7601
- universalLoginSessions: Ta(n)
7544
+ applications: Na(n),
7545
+ authenticationCodes: Qa(n),
7546
+ branding: qa(n),
7547
+ clients: Pa(n),
7548
+ codes: va(n),
7549
+ connections: $a(n),
7550
+ domains: za(n),
7551
+ hooks: ti(n),
7552
+ keys: Va(n),
7553
+ logins: vo(n),
7554
+ logs: Hr(n),
7555
+ OTP: ua(n),
7556
+ passwords: fa(n),
7557
+ users: Mr(n),
7558
+ sessions: na(n),
7559
+ tenants: Wr(n),
7560
+ themes: fo(n),
7561
+ tickets: ia(n),
7562
+ universalLoginSessions: xa(n)
7602
7563
  };
7603
7564
  }
7604
7565
  export {
7605
- bo as default
7566
+ ko as default
7606
7567
  };