@authhero/kysely-adapter 0.20.1 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -83,14 +83,14 @@ function ta(t) {
83
83
  if (ea(this, "ZodObject")) {
84
84
  const Je = this.extend;
85
85
  ve.extend = function(...qe) {
86
- var ee, te, ne, be, $e, Ae;
87
- const Pe = Je.apply(this, qe);
88
- return Pe._def.openapi = {
86
+ var ee, te, ne, be, $e, Pe;
87
+ const Ae = Je.apply(this, qe);
88
+ return Ae._def.openapi = {
89
89
  _internal: {
90
90
  extendedFrom: !((te = (ee = this._def.openapi) === null || ee === void 0 ? void 0 : ee._internal) === null || te === void 0) && te.refId ? { refId: (be = (ne = this._def.openapi) === null || ne === void 0 ? void 0 : ne._internal) === null || be === void 0 ? void 0 : be.refId, schema: this } : ($e = this._def.openapi) === null || $e === void 0 ? void 0 : $e._internal.extendedFrom
91
91
  },
92
- metadata: (Ae = Pe._def.openapi) === null || Ae === void 0 ? void 0 : Ae.metadata
93
- }, Pe;
92
+ metadata: (Pe = Ae._def.openapi) === null || Pe === void 0 ? void 0 : Pe.metadata
93
+ }, Ae;
94
94
  };
95
95
  }
96
96
  return ve;
@@ -644,7 +644,7 @@ class j {
644
644
  return Ht.create(this, e);
645
645
  }
646
646
  readonly() {
647
- return At.create(this);
647
+ return Pt.create(this);
648
648
  }
649
649
  isOptional() {
650
650
  return this.safeParse(void 0).success;
@@ -1609,13 +1609,13 @@ G.create = (t, e) => new G({
1609
1609
  ...O(e)
1610
1610
  });
1611
1611
  function Ge(t) {
1612
- if (t instanceof P) {
1612
+ if (t instanceof A) {
1613
1613
  const e = {};
1614
1614
  for (const n in t.shape) {
1615
1615
  const r = t.shape[n];
1616
1616
  e[n] = ae.create(Ge(r));
1617
1617
  }
1618
- return new P({
1618
+ return new A({
1619
1619
  ...t._def,
1620
1620
  shape: () => e
1621
1621
  });
@@ -1624,7 +1624,7 @@ function Ge(t) {
1624
1624
  type: Ge(t.element)
1625
1625
  }) : t instanceof ae ? ae.create(Ge(t.unwrap())) : t instanceof Oe ? Oe.create(Ge(t.unwrap())) : t instanceof oe ? oe.create(t.items.map((e) => Ge(e))) : t;
1626
1626
  }
1627
- class P extends j {
1627
+ class A extends j {
1628
1628
  constructor() {
1629
1629
  super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
1630
1630
  }
@@ -1701,7 +1701,7 @@ class P extends j {
1701
1701
  return this._def.shape();
1702
1702
  }
1703
1703
  strict(e) {
1704
- return b.errToObj, new P({
1704
+ return b.errToObj, new A({
1705
1705
  ...this._def,
1706
1706
  unknownKeys: "strict",
1707
1707
  ...e !== void 0 ? {
@@ -1718,13 +1718,13 @@ class P extends j {
1718
1718
  });
1719
1719
  }
1720
1720
  strip() {
1721
- return new P({
1721
+ return new A({
1722
1722
  ...this._def,
1723
1723
  unknownKeys: "strip"
1724
1724
  });
1725
1725
  }
1726
1726
  passthrough() {
1727
- return new P({
1727
+ return new A({
1728
1728
  ...this._def,
1729
1729
  unknownKeys: "passthrough"
1730
1730
  });
@@ -1747,7 +1747,7 @@ class P extends j {
1747
1747
  // }) as any;
1748
1748
  // };
1749
1749
  extend(e) {
1750
- return new P({
1750
+ return new A({
1751
1751
  ...this._def,
1752
1752
  shape: () => ({
1753
1753
  ...this._def.shape(),
@@ -1761,7 +1761,7 @@ class P extends j {
1761
1761
  * upgrade if you are experiencing issues.
1762
1762
  */
1763
1763
  merge(e) {
1764
- return new P({
1764
+ return new A({
1765
1765
  unknownKeys: e._def.unknownKeys,
1766
1766
  catchall: e._def.catchall,
1767
1767
  shape: () => ({
@@ -1831,7 +1831,7 @@ class P extends j {
1831
1831
  // return merged;
1832
1832
  // }
1833
1833
  catchall(e) {
1834
- return new P({
1834
+ return new A({
1835
1835
  ...this._def,
1836
1836
  catchall: e
1837
1837
  });
@@ -1840,7 +1840,7 @@ class P extends j {
1840
1840
  const n = {};
1841
1841
  return E.objectKeys(e).forEach((r) => {
1842
1842
  e[r] && this.shape[r] && (n[r] = this.shape[r]);
1843
- }), new P({
1843
+ }), new A({
1844
1844
  ...this._def,
1845
1845
  shape: () => n
1846
1846
  });
@@ -1849,7 +1849,7 @@ class P extends j {
1849
1849
  const n = {};
1850
1850
  return E.objectKeys(this.shape).forEach((r) => {
1851
1851
  e[r] || (n[r] = this.shape[r]);
1852
- }), new P({
1852
+ }), new A({
1853
1853
  ...this._def,
1854
1854
  shape: () => n
1855
1855
  });
@@ -1865,7 +1865,7 @@ class P extends j {
1865
1865
  return E.objectKeys(this.shape).forEach((r) => {
1866
1866
  const a = this.shape[r];
1867
1867
  e && !e[r] ? n[r] = a : n[r] = a.optional();
1868
- }), new P({
1868
+ }), new A({
1869
1869
  ...this._def,
1870
1870
  shape: () => n
1871
1871
  });
@@ -1881,7 +1881,7 @@ class P extends j {
1881
1881
  a = a._def.innerType;
1882
1882
  n[r] = a;
1883
1883
  }
1884
- }), new P({
1884
+ }), new A({
1885
1885
  ...this._def,
1886
1886
  shape: () => n
1887
1887
  });
@@ -1890,21 +1890,21 @@ class P extends j {
1890
1890
  return sr(E.objectKeys(this.shape));
1891
1891
  }
1892
1892
  }
1893
- P.create = (t, e) => new P({
1893
+ A.create = (t, e) => new A({
1894
1894
  shape: () => t,
1895
1895
  unknownKeys: "strip",
1896
1896
  catchall: me.create(),
1897
1897
  typeName: x.ZodObject,
1898
1898
  ...O(e)
1899
1899
  });
1900
- P.strictCreate = (t, e) => new P({
1900
+ A.strictCreate = (t, e) => new A({
1901
1901
  shape: () => t,
1902
1902
  unknownKeys: "strict",
1903
1903
  catchall: me.create(),
1904
1904
  typeName: x.ZodObject,
1905
1905
  ...O(e)
1906
1906
  });
1907
- P.lazycreate = (t, e) => new P({
1907
+ A.lazycreate = (t, e) => new A({
1908
1908
  shape: t,
1909
1909
  unknownKeys: "strip",
1910
1910
  catchall: me.create(),
@@ -1984,7 +1984,7 @@ Ct.create = (t, e) => new Ct({
1984
1984
  typeName: x.ZodUnion,
1985
1985
  ...O(e)
1986
1986
  });
1987
- const we = (t) => t instanceof jt ? we(t.schema) : t instanceof Y ? we(t.innerType()) : t instanceof It ? [t.value] : t instanceof Ce ? t.options : t instanceof Zt ? E.objectValues(t.enum) : t instanceof Et ? we(t._def.innerType) : t instanceof kt ? [void 0] : t instanceof Tt ? [null] : t instanceof ae ? [void 0, ...we(t.unwrap())] : t instanceof Oe ? [null, ...we(t.unwrap())] : t instanceof zn || t instanceof At ? we(t.unwrap()) : t instanceof $t ? we(t._def.innerType) : [];
1987
+ const we = (t) => t instanceof jt ? we(t.schema) : t instanceof Y ? we(t.innerType()) : t instanceof It ? [t.value] : t instanceof Ce ? t.options : t instanceof Zt ? E.objectValues(t.enum) : t instanceof Et ? we(t._def.innerType) : t instanceof kt ? [void 0] : t instanceof Tt ? [null] : t instanceof ae ? [void 0, ...we(t.unwrap())] : t instanceof Oe ? [null, ...we(t.unwrap())] : t instanceof zn || t instanceof Pt ? we(t.unwrap()) : t instanceof $t ? we(t._def.innerType) : [];
1988
1988
  class yn extends j {
1989
1989
  _parse(e) {
1990
1990
  const { ctx: n } = this._processInputParams(e);
@@ -2823,7 +2823,7 @@ class Ht extends j {
2823
2823
  });
2824
2824
  }
2825
2825
  }
2826
- class At extends j {
2826
+ class Pt extends j {
2827
2827
  _parse(e) {
2828
2828
  const n = this._def.innerType._parse(e), r = (a) => (wt(a) && (a.value = Object.freeze(a.value)), a);
2829
2829
  return xt(n) ? n.then((a) => r(a)) : r(n);
@@ -2832,7 +2832,7 @@ class At extends j {
2832
2832
  return this._def.innerType;
2833
2833
  }
2834
2834
  }
2835
- At.create = (t, e) => new At({
2835
+ Pt.create = (t, e) => new Pt({
2836
2836
  innerType: t,
2837
2837
  typeName: x.ZodReadonly,
2838
2838
  ...O(e)
@@ -2847,7 +2847,7 @@ function ir(t, e = {}, n) {
2847
2847
  }) : it.create();
2848
2848
  }
2849
2849
  const wa = {
2850
- object: P.lazycreate
2850
+ object: A.lazycreate
2851
2851
  };
2852
2852
  var x;
2853
2853
  (function(t) {
@@ -2855,7 +2855,7 @@ var x;
2855
2855
  })(x || (x = {}));
2856
2856
  const xa = (t, e = {
2857
2857
  message: `Input not instance of ${t.name}`
2858
- }) => ir((n) => n instanceof t, e), or = q.create, dr = ke.create, Na = cn.create, ka = Te.create, cr = Nt.create, Ta = ze.create, Ca = sn.create, Oa = kt.create, Sa = Tt.create, ja = it.create, Ia = Me.create, Za = me.create, Ea = on.create, $a = G.create, Aa = P.create, Pa = P.strictCreate, Da = Ct.create, Ra = yn.create, Ma = Ot.create, La = oe.create, za = St.create, Ua = dn.create, Fa = Ue.create, Va = nt.create, Ba = jt.create, Ka = It.create, Wa = Ce.create, Ja = Zt.create, qa = ot.create, Jn = Y.create, Qa = ae.create, Ga = Oe.create, Ha = Y.createWithPreprocess, Ya = Ht.create, Xa = () => or().optional(), es = () => dr().optional(), ts = () => cr().optional(), ns = {
2858
+ }) => ir((n) => n instanceof t, e), or = q.create, dr = ke.create, Na = cn.create, ka = Te.create, cr = Nt.create, Ta = ze.create, Ca = sn.create, Oa = kt.create, Sa = Tt.create, ja = it.create, Ia = Me.create, Za = me.create, Ea = on.create, $a = G.create, Pa = A.create, Aa = A.strictCreate, Da = Ct.create, Ra = yn.create, Ma = Ot.create, La = oe.create, za = St.create, Ua = dn.create, Fa = Ue.create, Va = nt.create, Ba = jt.create, Ka = It.create, Wa = Ce.create, Ja = Zt.create, qa = ot.create, Jn = Y.create, Qa = ae.create, Ga = Oe.create, Ha = Y.createWithPreprocess, Ya = Ht.create, Xa = () => or().optional(), es = () => dr().optional(), ts = () => cr().optional(), ns = {
2859
2859
  string: (t) => q.create({ ...t, coerce: !0 }),
2860
2860
  number: (t) => ke.create({ ...t, coerce: !0 }),
2861
2861
  boolean: (t) => Nt.create({
@@ -2904,7 +2904,7 @@ var i = /* @__PURE__ */ Object.freeze({
2904
2904
  ZodNever: me,
2905
2905
  ZodVoid: on,
2906
2906
  ZodArray: G,
2907
- ZodObject: P,
2907
+ ZodObject: A,
2908
2908
  ZodUnion: Ct,
2909
2909
  ZodDiscriminatedUnion: yn,
2910
2910
  ZodIntersection: Ot,
@@ -2928,7 +2928,7 @@ var i = /* @__PURE__ */ Object.freeze({
2928
2928
  BRAND: ba,
2929
2929
  ZodBranded: zn,
2930
2930
  ZodPipeline: Ht,
2931
- ZodReadonly: At,
2931
+ ZodReadonly: Pt,
2932
2932
  custom: ir,
2933
2933
  Schema: j,
2934
2934
  ZodSchema: j,
@@ -2957,7 +2957,7 @@ var i = /* @__PURE__ */ Object.freeze({
2957
2957
  null: Sa,
2958
2958
  nullable: Ga,
2959
2959
  number: dr,
2960
- object: Aa,
2960
+ object: Pa,
2961
2961
  oboolean: ts,
2962
2962
  onumber: es,
2963
2963
  optional: Qa,
@@ -2967,7 +2967,7 @@ var i = /* @__PURE__ */ Object.freeze({
2967
2967
  promise: qa,
2968
2968
  record: za,
2969
2969
  set: Fa,
2970
- strictObject: Pa,
2970
+ strictObject: Aa,
2971
2971
  string: or,
2972
2972
  symbol: Ca,
2973
2973
  transformer: Jn,
@@ -3247,6 +3247,7 @@ const gs = i.enum([
3247
3247
  description: "The connection that the code is connected to"
3248
3248
  }),
3249
3249
  code_type: gs,
3250
+ code_verifier: i.string().optional(),
3250
3251
  expires_at: i.string(),
3251
3252
  used_at: i.string().optional(),
3252
3253
  user_id: i.string().optional()
@@ -3559,7 +3560,7 @@ const js = i.object({
3559
3560
  logo_position: i.enum(["center"]),
3560
3561
  logo_url: i.string(),
3561
3562
  social_buttons_layout: i.enum(["bottom"])
3562
- }), As = i.object({
3563
+ }), Ps = i.object({
3563
3564
  borders: js,
3564
3565
  colors: Is,
3565
3566
  displayName: i.string(),
@@ -3567,10 +3568,10 @@ const js = i.object({
3567
3568
  page_background: Es,
3568
3569
  widget: $s
3569
3570
  });
3570
- As.extend({
3571
+ Ps.extend({
3571
3572
  themeId: i.string()
3572
3573
  });
3573
- const Ps = i.object({
3574
+ const As = i.object({
3574
3575
  universal_login_experience: i.enum(["new", "classic"]).default("new"),
3575
3576
  identifier_first: i.boolean().default(!0),
3576
3577
  password_first: i.boolean().default(!1),
@@ -4195,14 +4196,14 @@ function ji(t) {
4195
4196
  if (Si(this, "ZodObject")) {
4196
4197
  const Je = this.extend;
4197
4198
  ve.extend = function(...qe) {
4198
- var ee, te, ne, be, $e, Ae;
4199
- const Pe = Je.apply(this, qe);
4200
- return Pe._def.openapi = {
4199
+ var ee, te, ne, be, $e, Pe;
4200
+ const Ae = Je.apply(this, qe);
4201
+ return Ae._def.openapi = {
4201
4202
  _internal: {
4202
4203
  extendedFrom: !((te = (ee = this._def.openapi) === null || ee === void 0 ? void 0 : ee._internal) === null || te === void 0) && te.refId ? { refId: (be = (ne = this._def.openapi) === null || ne === void 0 ? void 0 : ne._internal) === null || be === void 0 ? void 0 : be.refId, schema: this } : ($e = this._def.openapi) === null || $e === void 0 ? void 0 : $e._internal.extendedFrom
4203
4204
  },
4204
- metadata: (Ae = Pe._def.openapi) === null || Ae === void 0 ? void 0 : Ae.metadata
4205
- }, Pe;
4205
+ metadata: (Pe = Ae._def.openapi) === null || Pe === void 0 ? void 0 : Pe.metadata
4206
+ }, Ae;
4206
4207
  };
4207
4208
  }
4208
4209
  return ve;
@@ -4533,7 +4534,7 @@ class F {
4533
4534
  }
4534
4535
  const k = Object.freeze({
4535
4536
  status: "aborted"
4536
- }), tt = (t) => ({ status: "dirty", value: t }), B = (t) => ({ status: "valid", value: t }), En = (t) => t.status === "aborted", $n = (t) => t.status === "dirty", Pt = (t) => t.status === "valid", Dt = (t) => typeof Promise < "u" && t instanceof Promise;
4537
+ }), tt = (t) => ({ status: "dirty", value: t }), B = (t) => ({ status: "valid", value: t }), En = (t) => t.status === "aborted", $n = (t) => t.status === "dirty", At = (t) => t.status === "valid", Dt = (t) => typeof Promise < "u" && t instanceof Promise;
4537
4538
  function hn(t, e, n, r) {
4538
4539
  if (typeof e == "function" ? t !== e || !r : !e.has(t)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4539
4540
  return e.get(t);
@@ -4556,7 +4557,7 @@ class de {
4556
4557
  }
4557
4558
  }
4558
4559
  const Gn = (t, e) => {
4559
- if (Pt(e))
4560
+ if (At(e))
4560
4561
  return { success: !0, data: e.value };
4561
4562
  if (!t.common.issues.length)
4562
4563
  throw new Error("Validation failed but no issues detected.");
@@ -4765,7 +4766,7 @@ class I {
4765
4766
  return this.safeParse(null).success;
4766
4767
  }
4767
4768
  }
4768
- const $i = /^c[^\s-]{8,}$/i, Ai = /^[0-9a-z]+$/, Pi = /^[0-9A-HJKMNP-TV-Z]{26}$/, Di = /^[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, Ri = /^[a-z0-9_-]{21}$/i, Mi = /^[-+]?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)?)??$/, Li = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, zi = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
4769
+ const $i = /^c[^\s-]{8,}$/i, Pi = /^[0-9a-z]+$/, Ai = /^[0-9A-HJKMNP-TV-Z]{26}$/, Di = /^[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, Ri = /^[a-z0-9_-]{21}$/i, Mi = /^[-+]?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)?)??$/, Li = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, zi = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
4769
4770
  let xn;
4770
4771
  const Ui = /^(?:(?: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])$/, Fi = /^(([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}=))?$/, br = "((\\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])))", Bi = new RegExp(`^${br}$`);
4771
4772
  function wr(t) {
@@ -4862,13 +4863,13 @@ class Q extends I {
4862
4863
  message: s.message
4863
4864
  }), r.dirty());
4864
4865
  else if (s.kind === "cuid2")
4865
- Ai.test(e.data) || (a = this._getOrReturnCtx(e, a), _(a, {
4866
+ Pi.test(e.data) || (a = this._getOrReturnCtx(e, a), _(a, {
4866
4867
  validation: "cuid2",
4867
4868
  code: p.invalid_string,
4868
4869
  message: s.message
4869
4870
  }), r.dirty());
4870
4871
  else if (s.kind === "ulid")
4871
- Pi.test(e.data) || (a = this._getOrReturnCtx(e, a), _(a, {
4872
+ Ai.test(e.data) || (a = this._getOrReturnCtx(e, a), _(a, {
4872
4873
  validation: "ulid",
4873
4874
  code: p.invalid_string,
4874
4875
  message: s.message
@@ -6159,14 +6160,14 @@ class vn extends I {
6159
6160
  });
6160
6161
  }
6161
6162
  }
6162
- function An(t, e) {
6163
+ function Pn(t, e) {
6163
6164
  const n = Ne(t), r = Ne(e);
6164
6165
  if (t === e)
6165
6166
  return { valid: !0, data: t };
6166
6167
  if (n === y.object && r === y.object) {
6167
6168
  const a = $.objectKeys(e), s = $.objectKeys(t).filter((d) => a.indexOf(d) !== -1), o = { ...t, ...e };
6168
6169
  for (const d of s) {
6169
- const c = An(t[d], e[d]);
6170
+ const c = Pn(t[d], e[d]);
6170
6171
  if (!c.valid)
6171
6172
  return { valid: !1 };
6172
6173
  o[d] = c.data;
@@ -6177,7 +6178,7 @@ function An(t, e) {
6177
6178
  return { valid: !1 };
6178
6179
  const a = [];
6179
6180
  for (let s = 0; s < t.length; s++) {
6180
- const o = t[s], d = e[s], c = An(o, d);
6181
+ const o = t[s], d = e[s], c = Pn(o, d);
6181
6182
  if (!c.valid)
6182
6183
  return { valid: !1 };
6183
6184
  a.push(c.data);
@@ -6190,7 +6191,7 @@ class Ut extends I {
6190
6191
  const { status: n, ctx: r } = this._processInputParams(e), a = (s, o) => {
6191
6192
  if (En(s) || En(o))
6192
6193
  return k;
6193
- const d = An(s.value, o.value);
6194
+ const d = Pn(s.value, o.value);
6194
6195
  return d.valid ? (($n(s) || $n(o)) && n.dirty(), { status: n.value, value: d.data }) : (_(r, {
6195
6196
  code: p.invalid_intersection_types
6196
6197
  }), k);
@@ -6752,14 +6753,14 @@ class X extends I {
6752
6753
  path: r.path,
6753
6754
  parent: r
6754
6755
  });
6755
- if (!Pt(o))
6756
+ if (!At(o))
6756
6757
  return o;
6757
6758
  const d = a.transform(o.value, s);
6758
6759
  if (d instanceof Promise)
6759
6760
  throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
6760
6761
  return { status: n.value, value: d };
6761
6762
  } else
6762
- return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((o) => Pt(o) ? Promise.resolve(a.transform(o.value, s)).then((d) => ({ status: n.value, value: d })) : o);
6763
+ return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((o) => At(o) ? Promise.resolve(a.transform(o.value, s)).then((d) => ({ status: n.value, value: d })) : o);
6763
6764
  $.assertNever(a);
6764
6765
  }
6765
6766
  }
@@ -6937,7 +6938,7 @@ class Yt extends I {
6937
6938
  }
6938
6939
  class qt extends I {
6939
6940
  _parse(e) {
6940
- const n = this._def.innerType._parse(e), r = (a) => (Pt(a) && (a.value = Object.freeze(a.value)), a);
6941
+ const n = this._def.innerType._parse(e), r = (a) => (At(a) && (a.value = Object.freeze(a.value)), a);
6941
6942
  return Dt(n) ? n.then((a) => r(a)) : r(n);
6942
6943
  }
6943
6944
  unwrap() {
@@ -6991,7 +6992,7 @@ var $o = /* @__PURE__ */ Object.freeze({
6991
6992
  OK: B,
6992
6993
  isAborted: En,
6993
6994
  isDirty: $n,
6994
- isValid: Pt,
6995
+ isValid: At,
6995
6996
  isAsync: Dt,
6996
6997
  get util() {
6997
6998
  return $;
@@ -7120,7 +7121,7 @@ function Sr(t, e) {
7120
7121
  }
7121
7122
  return n;
7122
7123
  }
7123
- function Ao(t) {
7124
+ function Po(t) {
7124
7125
  return async (e, n) => {
7125
7126
  let r = t.selectFrom("connections").where("connections.tenant_id", "=", e);
7126
7127
  n.q && (r = Be(t, r, n.q, ["user_id", "ip"]));
@@ -7135,7 +7136,7 @@ function Ao(t) {
7135
7136
  };
7136
7137
  };
7137
7138
  }
7138
- function Po(t) {
7139
+ function Ao(t) {
7139
7140
  return async (e, n) => (await t.deleteFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", n).executeTakeFirst()).numDeletedRows > 0;
7140
7141
  }
7141
7142
  function Do(t) {
@@ -7163,8 +7164,8 @@ function Mo(t) {
7163
7164
  return {
7164
7165
  create: Ci(t),
7165
7166
  get: Do(t),
7166
- list: Ao(t),
7167
- remove: Po(t),
7167
+ list: Po(t),
7168
+ remove: Ao(t),
7168
7169
  update: Ro(t)
7169
7170
  };
7170
7171
  }
@@ -7482,7 +7483,7 @@ function Yn(t) {
7482
7483
  function pd(t) {
7483
7484
  return async (e, n) => {
7484
7485
  try {
7485
- const r = Ps.parse(n);
7486
+ const r = As.parse(n);
7486
7487
  await t.insertInto("prompt_settings").values({
7487
7488
  ...Yn(r),
7488
7489
  tenant_id: e
@@ -7514,7 +7515,7 @@ const en = z({
7514
7515
  name: t
7515
7516
  });
7516
7517
  }
7517
- }), Pn = z({
7518
+ }), An = z({
7518
7519
  is(t) {
7519
7520
  return t.kind === "SchemableIdentifierNode";
7520
7521
  },
@@ -7549,13 +7550,13 @@ const en = z({
7549
7550
  create(t) {
7550
7551
  return z({
7551
7552
  kind: "TableNode",
7552
- table: Pn.create(t)
7553
+ table: An.create(t)
7553
7554
  });
7554
7555
  },
7555
7556
  createWithSchema(t, e) {
7556
7557
  return z({
7557
7558
  kind: "TableNode",
7558
- table: Pn.createWithSchema(t, e)
7559
+ table: An.createWithSchema(t, e)
7559
7560
  });
7560
7561
  }
7561
7562
  });
@@ -8458,7 +8459,7 @@ at = new WeakMap(), De = new WeakMap(), Re = new WeakMap(), L = new WeakSet(), j
8458
8459
  return n.kind in yd;
8459
8460
  }, Ir = function(n) {
8460
8461
  const r = /* @__PURE__ */ new Set();
8461
- if ("name" in n && n.name && Pn.is(n.name) && C(this, L, Dn).call(this, n.name, r), "from" in n && n.from)
8462
+ if ("name" in n && n.name && An.is(n.name) && C(this, L, Dn).call(this, n.name, r), "from" in n && n.from)
8462
8463
  for (const a of n.from.froms)
8463
8464
  C(this, L, Ye).call(this, a, r);
8464
8465
  if ("into" in n && n.into && C(this, L, Ye).call(this, n.into, r), "table" in n && n.table && C(this, L, Ye).call(this, n.table, r), "joins" in n && n.joins)
@@ -8503,12 +8504,12 @@ class wd {
8503
8504
  }
8504
8505
  }
8505
8506
  const xd = "kysely_migration", Xn = "kysely_migration_lock", Nd = !1, kn = "migration_lock", kd = z({ __noMigrations__: !0 });
8506
- var A, m, vt, ue, he, Xe, Ar, pe, Pr, Dr, Rr, Mr, Lr, Rn, et, Mn, zr, Ur, Fr, Ln, Vr, Br, Kr, Wr, Jr, bt;
8507
+ var P, m, vt, ue, he, Xe, Pr, pe, Ar, Dr, Rr, Mr, Lr, Rn, et, Mn, zr, Ur, Fr, Ln, Vr, Br, Kr, Wr, Jr, bt;
8507
8508
  class $r {
8508
8509
  constructor(e) {
8509
8510
  re(this, m);
8510
- re(this, A);
8511
- ht(this, A, z(e));
8511
+ re(this, P);
8512
+ ht(this, P, z(e));
8512
8513
  }
8513
8514
  /**
8514
8515
  * Returns a {@link MigrationInfo} object for each migration.
@@ -8516,7 +8517,7 @@ class $r {
8516
8517
  * The returned array is sorted by migration name.
8517
8518
  */
8518
8519
  async getMigrations() {
8519
- const e = await C(this, m, et).call(this, v(this, m, he)) ? await v(this, A).db.withPlugin(v(this, m, pe)).selectFrom(v(this, m, he)).select(["name", "timestamp"]).execute() : [];
8520
+ const e = await C(this, m, et).call(this, v(this, m, he)) ? await v(this, P).db.withPlugin(v(this, m, pe)).selectFrom(v(this, m, he)).select(["name", "timestamp"]).execute() : [];
8520
8521
  return (await C(this, m, Ln).call(this)).map(({ name: r, ...a }) => {
8521
8522
  const s = e.find((o) => o.name === r);
8522
8523
  return {
@@ -8651,28 +8652,28 @@ class $r {
8651
8652
  return C(this, m, vt).call(this, () => ({ direction: "Down", step: 1 }));
8652
8653
  }
8653
8654
  }
8654
- A = new WeakMap(), m = new WeakSet(), vt = async function(e) {
8655
+ P = new WeakMap(), m = new WeakSet(), vt = async function(e) {
8655
8656
  try {
8656
- return await C(this, m, Pr).call(this), await C(this, m, zr).call(this, e);
8657
+ return await C(this, m, Ar).call(this), await C(this, m, zr).call(this, e);
8657
8658
  } catch (n) {
8658
8659
  return n instanceof Tn ? n.resultSet : { error: n };
8659
8660
  }
8660
8661
  }, ue = function() {
8661
- return v(this, A).migrationTableSchema;
8662
+ return v(this, P).migrationTableSchema;
8662
8663
  }, he = function() {
8663
- return v(this, A).migrationTableName ?? xd;
8664
+ return v(this, P).migrationTableName ?? xd;
8664
8665
  }, Xe = function() {
8665
- return v(this, A).migrationLockTableName ?? Xn;
8666
- }, Ar = function() {
8667
- return v(this, A).allowUnorderedMigrations ?? Nd;
8666
+ return v(this, P).migrationLockTableName ?? Xn;
8667
+ }, Pr = function() {
8668
+ return v(this, P).allowUnorderedMigrations ?? Nd;
8668
8669
  }, pe = function() {
8669
8670
  return v(this, m, ue) ? new bd(v(this, m, ue)) : new wd();
8670
- }, Pr = async function() {
8671
+ }, Ar = async function() {
8671
8672
  await C(this, m, Dr).call(this), await C(this, m, Rr).call(this), await C(this, m, Mr).call(this), await C(this, m, Lr).call(this);
8672
8673
  }, Dr = async function() {
8673
8674
  if (v(this, m, ue) && !await C(this, m, Rn).call(this))
8674
8675
  try {
8675
- await C(this, m, bt).call(this, v(this, A).db.schema.createSchema(v(this, m, ue)));
8676
+ await C(this, m, bt).call(this, v(this, P).db.schema.createSchema(v(this, m, ue)));
8676
8677
  } catch (e) {
8677
8678
  if (!await C(this, m, Rn).call(this))
8678
8679
  throw e;
@@ -8680,7 +8681,7 @@ A = new WeakMap(), m = new WeakSet(), vt = async function(e) {
8680
8681
  }, Rr = async function() {
8681
8682
  if (!await C(this, m, et).call(this, v(this, m, he)))
8682
8683
  try {
8683
- v(this, m, ue) && await C(this, m, bt).call(this, v(this, A).db.schema.createSchema(v(this, m, ue))), await C(this, m, bt).call(this, v(this, A).db.schema.withPlugin(v(this, m, pe)).createTable(v(this, m, he)).addColumn("name", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("timestamp", "varchar(255)", (e) => e.notNull()));
8684
+ v(this, m, ue) && await C(this, m, bt).call(this, v(this, P).db.schema.createSchema(v(this, m, ue))), await C(this, m, bt).call(this, v(this, P).db.schema.withPlugin(v(this, m, pe)).createTable(v(this, m, he)).addColumn("name", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("timestamp", "varchar(255)", (e) => e.notNull()));
8684
8685
  } catch (e) {
8685
8686
  if (!await C(this, m, et).call(this, v(this, m, he)))
8686
8687
  throw e;
@@ -8688,7 +8689,7 @@ A = new WeakMap(), m = new WeakSet(), vt = async function(e) {
8688
8689
  }, Mr = async function() {
8689
8690
  if (!await C(this, m, et).call(this, v(this, m, Xe)))
8690
8691
  try {
8691
- await C(this, m, bt).call(this, v(this, A).db.schema.withPlugin(v(this, m, pe)).createTable(v(this, m, Xe)).addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("is_locked", "integer", (e) => e.notNull().defaultTo(0)));
8692
+ await C(this, m, bt).call(this, v(this, P).db.schema.withPlugin(v(this, m, pe)).createTable(v(this, m, Xe)).addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("is_locked", "integer", (e) => e.notNull().defaultTo(0)));
8692
8693
  } catch (e) {
8693
8694
  if (!await C(this, m, et).call(this, v(this, m, Xe)))
8694
8695
  throw e;
@@ -8696,25 +8697,25 @@ A = new WeakMap(), m = new WeakSet(), vt = async function(e) {
8696
8697
  }, Lr = async function() {
8697
8698
  if (!await C(this, m, Mn).call(this))
8698
8699
  try {
8699
- await v(this, A).db.withPlugin(v(this, m, pe)).insertInto(v(this, m, Xe)).values({ id: kn, is_locked: 0 }).execute();
8700
+ await v(this, P).db.withPlugin(v(this, m, pe)).insertInto(v(this, m, Xe)).values({ id: kn, is_locked: 0 }).execute();
8700
8701
  } catch (e) {
8701
8702
  if (!await C(this, m, Mn).call(this))
8702
8703
  throw e;
8703
8704
  }
8704
8705
  }, Rn = async function() {
8705
- return (await v(this, A).db.introspection.getSchemas()).some((n) => n.name === v(this, m, ue));
8706
+ return (await v(this, P).db.introspection.getSchemas()).some((n) => n.name === v(this, m, ue));
8706
8707
  }, et = async function(e) {
8707
8708
  const n = v(this, m, ue);
8708
- return (await v(this, A).db.introspection.getTables({
8709
+ return (await v(this, P).db.introspection.getTables({
8709
8710
  withInternalKyselyTables: !0
8710
8711
  })).some((a) => a.name === e && (!n || a.schema === n));
8711
8712
  }, Mn = async function() {
8712
- return !!await v(this, A).db.withPlugin(v(this, m, pe)).selectFrom(v(this, m, Xe)).where("id", "=", kn).select("id").executeTakeFirst();
8713
+ return !!await v(this, P).db.withPlugin(v(this, m, pe)).selectFrom(v(this, m, Xe)).where("id", "=", kn).select("id").executeTakeFirst();
8713
8714
  }, zr = async function(e) {
8714
- const n = v(this, A).db.getExecutor().adapter, r = z({
8715
- lockTable: v(this, A).migrationLockTableName ?? Xn,
8715
+ const n = v(this, P).db.getExecutor().adapter, r = z({
8716
+ lockTable: v(this, P).migrationLockTableName ?? Xn,
8716
8717
  lockRowId: kn,
8717
- lockTableSchema: v(this, A).migrationTableSchema
8718
+ lockTableSchema: v(this, P).migrationTableSchema
8718
8719
  }), a = async (s) => {
8719
8720
  try {
8720
8721
  await n.acquireMigrationLock(s, r);
@@ -8727,10 +8728,10 @@ A = new WeakMap(), m = new WeakSet(), vt = async function(e) {
8727
8728
  await n.releaseMigrationLock(s, r);
8728
8729
  }
8729
8730
  };
8730
- return n.supportsTransactionalDdl ? v(this, A).db.transaction().execute(a) : v(this, A).db.connection().execute(a);
8731
+ return n.supportsTransactionalDdl ? v(this, P).db.transaction().execute(a) : v(this, P).db.connection().execute(a);
8731
8732
  }, Ur = async function(e) {
8732
8733
  const n = await C(this, m, Ln).call(this), r = await C(this, m, Vr).call(this, e);
8733
- C(this, m, Br).call(this, n, r), v(this, m, Ar) || C(this, m, Kr).call(this, n, r);
8734
+ C(this, m, Br).call(this, n, r), v(this, m, Pr) || C(this, m, Kr).call(this, n, r);
8734
8735
  const a = C(this, m, Fr).call(this, n, r);
8735
8736
  return z({
8736
8737
  migrations: n,
@@ -8741,7 +8742,7 @@ A = new WeakMap(), m = new WeakSet(), vt = async function(e) {
8741
8742
  }, Fr = function(e, n) {
8742
8743
  return e.filter((r) => !n.includes(r.name));
8743
8744
  }, Ln = async function() {
8744
- const e = await v(this, A).provider.getMigrations();
8745
+ const e = await v(this, P).provider.getMigrations();
8745
8746
  return Object.keys(e).sort().map((n) => ({
8746
8747
  ...e[n],
8747
8748
  name: n
@@ -8812,7 +8813,7 @@ A = new WeakMap(), m = new WeakSet(), vt = async function(e) {
8812
8813
  }
8813
8814
  return { results: s };
8814
8815
  }, bt = async function(e) {
8815
- v(this, A).db.getExecutor().adapter.supportsCreateIfNotExists && (e = e.ifNotExists()), await e.execute();
8816
+ v(this, P).db.getExecutor().adapter.supportsCreateIfNotExists && (e = e.ifNotExists()), await e.execute();
8816
8817
  };
8817
8818
  var Gt;
8818
8819
  class Tn extends Error {
@@ -8931,7 +8932,7 @@ const $d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8931
8932
  down: Ed,
8932
8933
  up: Zd
8933
8934
  }, Symbol.toStringTag, { value: "Module" }));
8934
- async function Ad(t) {
8935
+ async function Pd(t) {
8935
8936
  await t.schema.createTable("logs").addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("category", "varchar(255)", (e) => e.notNull()).addColumn("tenant_id", "varchar(64)").addColumn("user_id", "varchar(64)").addForeignKeyConstraint(
8936
8937
  "tenant_id_constraint",
8937
8938
  ["tenant_id"],
@@ -8940,13 +8941,13 @@ async function Ad(t) {
8940
8941
  (e) => e.onDelete("cascade")
8941
8942
  ).addColumn("ip", "varchar(255)").addColumn("type", "varchar(8)", (e) => e.notNull()).addColumn("date", "varchar(25)", (e) => e.notNull()).addColumn("client_id", "varchar(255)").addColumn("client_name", "varchar(255)").addColumn("user_agent", "varchar(255)").addColumn("description", "varchar(255)").addColumn("details", "varchar(2048)").execute();
8942
8943
  }
8943
- async function Pd(t) {
8944
+ async function Ad(t) {
8944
8945
  await t.schema.dropTable("logs").execute();
8945
8946
  }
8946
8947
  const Dd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8947
8948
  __proto__: null,
8948
- down: Pd,
8949
- up: Ad
8949
+ down: Ad,
8950
+ up: Pd
8950
8951
  }, Symbol.toStringTag, { value: "Module" }));
8951
8952
  async function Rd(t) {
8952
8953
  }
@@ -9166,16 +9167,16 @@ const $c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9166
9167
  down: Ec,
9167
9168
  up: Zc
9168
9169
  }, Symbol.toStringTag, { value: "Module" }));
9169
- async function Ac(t) {
9170
+ async function Pc(t) {
9170
9171
  await t.schema.alterTable("logs").dropColumn("category").execute();
9171
9172
  }
9172
- async function Pc(t) {
9173
+ async function Ac(t) {
9173
9174
  await t.schema.alterTable("logs").addColumn("category", "varchar(255)", (e) => e.notNull()).execute();
9174
9175
  }
9175
9176
  const Dc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9176
9177
  __proto__: null,
9177
- down: Pc,
9178
- up: Ac
9178
+ down: Ac,
9179
+ up: Pc
9179
9180
  }, Symbol.toStringTag, { value: "Module" }));
9180
9181
  async function Rc(t) {
9181
9182
  await t.schema.alterTable("users").dropColumn("tags").execute();
@@ -9365,14 +9366,14 @@ const $l = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9365
9366
  down: El,
9366
9367
  up: Zl
9367
9368
  }, Symbol.toStringTag, { value: "Module" }));
9368
- async function Al(t) {
9369
- }
9370
9369
  async function Pl(t) {
9371
9370
  }
9371
+ async function Al(t) {
9372
+ }
9372
9373
  const Dl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9373
9374
  __proto__: null,
9374
- down: Pl,
9375
- up: Al
9375
+ down: Al,
9376
+ up: Pl
9376
9377
  }, Symbol.toStringTag, { value: "Module" }));
9377
9378
  async function Rl(t) {
9378
9379
  await t.schema.createTable("hooks").addColumn("hook_id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
@@ -9628,14 +9629,14 @@ const $u = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9628
9629
  down: Eu,
9629
9630
  up: Zu
9630
9631
  }, Symbol.toStringTag, { value: "Module" }));
9631
- async function Au(t) {
9632
- }
9633
9632
  async function Pu(t) {
9634
9633
  }
9634
+ async function Au(t) {
9635
+ }
9635
9636
  const Du = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9636
9637
  __proto__: null,
9637
- down: Pu,
9638
- up: Au
9638
+ down: Au,
9639
+ up: Pu
9639
9640
  }, Symbol.toStringTag, { value: "Module" }));
9640
9641
  async function Ru(t) {
9641
9642
  }
@@ -9696,6 +9697,17 @@ const eh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9696
9697
  __proto__: null,
9697
9698
  down: Xu,
9698
9699
  up: Yu
9700
+ }, Symbol.toStringTag, { value: "Module" }));
9701
+ async function th(t) {
9702
+ await t.schema.alterTable("codes").addColumn("code_verifier", "varchar(64)").execute();
9703
+ }
9704
+ async function nh(t) {
9705
+ await t.schema.alterTable("codes").dropColumn("code_verifier").execute();
9706
+ }
9707
+ const rh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9708
+ __proto__: null,
9709
+ down: nh,
9710
+ up: th
9699
9711
  }, Symbol.toStringTag, { value: "Module" })), Qr = {
9700
9712
  m1_init: Od,
9701
9713
  m2_magicLink: Id,
@@ -9760,9 +9772,10 @@ const eh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9760
9772
  n61_userLocales: Ku,
9761
9773
  n62_prompt: qu,
9762
9774
  n63_connection_cleanup: Hu,
9763
- n64_act_as: eh
9775
+ n64_act_as: eh,
9776
+ n65_code_verifier: rh
9764
9777
  };
9765
- async function nh(t, e = !1) {
9778
+ async function sh(t, e = !1) {
9766
9779
  e && console.log("migrating...");
9767
9780
  const n = new qr(Qr), r = new $r({
9768
9781
  db: t,
@@ -9775,7 +9788,7 @@ async function nh(t, e = !1) {
9775
9788
  }), a)
9776
9789
  throw console.error("failed to migrate"), console.error(a), a;
9777
9790
  }
9778
- async function rh(t) {
9791
+ async function ih(t) {
9779
9792
  console.log("migrating...");
9780
9793
  const e = new qr(Qr), n = new $r({
9781
9794
  db: t,
@@ -9786,7 +9799,7 @@ async function rh(t) {
9786
9799
  }), r)
9787
9800
  throw console.error("failed to migrate"), console.error(r), r;
9788
9801
  }
9789
- function ah(t) {
9802
+ function oh(t) {
9790
9803
  return {
9791
9804
  applications: Ti(t),
9792
9805
  branding: Qo(t),
@@ -9808,7 +9821,7 @@ function ah(t) {
9808
9821
  };
9809
9822
  }
9810
9823
  export {
9811
- ah as default,
9812
- rh as migrateDown,
9813
- nh as migrateToLatest
9824
+ oh as default,
9825
+ ih as migrateDown,
9826
+ sh as migrateToLatest
9814
9827
  };