@authhero/kysely-adapter 9.3.0 → 9.4.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.
@@ -1,11 +1,11 @@
1
1
  var Ee = Object.defineProperty;
2
- var le = (t) => {
2
+ var de = (t) => {
3
3
  throw TypeError(t);
4
4
  };
5
- var Je = (t, e, a) => e in t ? Ee(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a;
6
- var P = (t, e, a) => Je(t, typeof e != "symbol" ? e + "" : e, a), R = (t, e, a) => e.has(t) || le("Cannot " + a);
7
- var d = (t, e, a) => (R(t, e, "read from private field"), a ? a.call(t) : e.get(t)), y = (t, e, a) => e.has(t) ? le("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, a), M = (t, e, a, r) => (R(t, e, "write to private field"), r ? r.call(t, a) : e.set(t, a), a), u = (t, e, a) => (R(t, e, "access private method"), a);
8
- import { parseUserId as Y, codeSchema as ze, connectionSchema as Ke, loginSessionSchema as Re, promptSettingSchema as Ue } from "@authhero/adapter-interfaces";
5
+ var ze = (t, e, a) => e in t ? Ee(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a;
6
+ var P = (t, e, a) => ze(t, typeof e != "symbol" ? e + "" : e, a), R = (t, e, a) => e.has(t) || de("Cannot " + a);
7
+ var l = (t, e, a) => (R(t, e, "read from private field"), a ? a.call(t) : e.get(t)), y = (t, e, a) => e.has(t) ? de("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, a), M = (t, e, a, r) => (R(t, e, "write to private field"), r ? r.call(t, a) : e.set(t, a), a), u = (t, e, a) => (R(t, e, "access private method"), a);
8
+ import { parseUserId as Y, codeSchema as Je, connectionSchema as Ke, loginSessionSchema as Re, promptSettingSchema as Ue } from "@authhero/adapter-interfaces";
9
9
  import "@hono/zod-openapi";
10
10
  var V = class extends Error {
11
11
  constructor(e = 500, a) {
@@ -83,7 +83,7 @@ function Qe(t) {
83
83
  ]);
84
84
  if (!r)
85
85
  return null;
86
- const { tenant_id: n, ...s } = r, l = {
86
+ const { tenant_id: n, ...s } = r, d = {
87
87
  ...s,
88
88
  email: r.email || "",
89
89
  email_verified: r.email_verified === 1,
@@ -100,18 +100,18 @@ function Qe(t) {
100
100
  ...o.map(fe)
101
101
  ]
102
102
  };
103
- return _(l);
103
+ return _(d);
104
104
  };
105
105
  }
106
106
  function O(t, e, a, r) {
107
107
  return a.split(/\s+/).map((n) => n.replace(/^([^:]+)=/g, "$1:")).map((n) => {
108
- let s = n.startsWith("-"), l, c, g, m;
109
- return n.startsWith("-_exists_:") ? (l = n.substring(10), g = !0, s = !0) : n.startsWith("_exists_:") ? (l = n.substring(9), g = !0, s = !1) : n.includes(":") ? (s = n.startsWith("-"), [l, c] = s ? n.substring(1).split(":") : n.split(":"), g = !1, c.startsWith(">=") ? (m = ">=", c = c.substring(2)) : c.startsWith(">") ? (m = ">", c = c.substring(1)) : c.startsWith("<=") ? (m = "<=", c = c.substring(2)) : c.startsWith("<") ? (m = "<", c = c.substring(1)) : m = "=") : (l = null, c = n, g = !1), { key: l, value: c, isNegation: s, isExistsQuery: g, operator: m };
110
- }).forEach(({ key: n, value: s, isNegation: l, isExistsQuery: c, operator: g }) => {
108
+ let s = n.startsWith("-"), d, c, g, m;
109
+ return n.startsWith("-_exists_:") ? (d = n.substring(10), g = !0, s = !0) : n.startsWith("_exists_:") ? (d = n.substring(9), g = !0, s = !1) : n.includes(":") ? (s = n.startsWith("-"), [d, c] = s ? n.substring(1).split(":") : n.split(":"), g = !1, c.startsWith(">=") ? (m = ">=", c = c.substring(2)) : c.startsWith(">") ? (m = ">", c = c.substring(1)) : c.startsWith("<=") ? (m = "<=", c = c.substring(2)) : c.startsWith("<") ? (m = "<", c = c.substring(1)) : m = "=") : (d = null, c = n, g = !1), { key: d, value: c, isNegation: s, isExistsQuery: g, operator: m };
110
+ }).forEach(({ key: n, value: s, isNegation: d, isExistsQuery: c, operator: g }) => {
111
111
  if (n)
112
112
  if (c)
113
- l ? e = e.where(n, "is", null) : e = e.where(n, "is not", null);
114
- else if (l)
113
+ d ? e = e.where(n, "is", null) : e = e.where(n, "is not", null);
114
+ else if (d)
115
115
  switch (g) {
116
116
  case ">":
117
117
  e = e.where(n, "<=", s);
@@ -154,8 +154,8 @@ function Ve(t) {
154
154
  const { ref: m } = t.dynamic;
155
155
  r = r.orderBy(m(a.sort.sort_by), a.sort.sort_order);
156
156
  }
157
- const n = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), s = n.map((m) => m.user_id), l = s.length ? await t.selectFrom("users").selectAll().where("users.tenant_id", "=", e).where("users.linked_to", "in", s).execute() : [], c = n.map((m) => {
158
- const w = l.filter(
157
+ const n = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), s = n.map((m) => m.user_id), d = s.length ? await t.selectFrom("users").selectAll().where("users.tenant_id", "=", e).where("users.linked_to", "in", s).execute() : [], c = n.map((m) => {
158
+ const w = d.filter(
159
159
  (b) => b.linked_to === m.user_id
160
160
  );
161
161
  return _({
@@ -249,16 +249,16 @@ function tt(t) {
249
249
  }) => {
250
250
  let a = t.selectFrom("tenants");
251
251
  if (e.sort && e.sort.sort_by) {
252
- const { ref: l } = t.dynamic;
253
- a = a.orderBy(l(e.sort.sort_by), e.sort.sort_order);
252
+ const { ref: d } = t.dynamic;
253
+ a = a.orderBy(d(e.sort.sort_by), e.sort.sort_order);
254
254
  }
255
- e.q && (a = a.where((l) => l.or([l("name", "like", `%${e.q}%`)])));
255
+ e.q && (a = a.where((d) => d.or([d("name", "like", `%${e.q}%`)])));
256
256
  const o = await a.offset(e.page * e.per_page).limit(e.per_page).selectAll().execute();
257
257
  if (!e.include_totals)
258
258
  return {
259
259
  tenants: o
260
260
  };
261
- const { count: n } = await a.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow(), s = x(n);
261
+ const { count: n } = await a.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), s = x(n);
262
262
  return {
263
263
  tenants: o.map(_),
264
264
  start: (e.page - 1) * e.per_page,
@@ -345,14 +345,14 @@ function it(t) {
345
345
  a.q && (r = O(t, r, a.q, ["user_id", "ip"]));
346
346
  let o = r;
347
347
  if (a.sort && a.sort.sort_by) {
348
- const { ref: l } = t.dynamic;
348
+ const { ref: d } = t.dynamic;
349
349
  o = o.orderBy(
350
- l(a.sort.sort_by),
350
+ d(a.sort.sort_by),
351
351
  a.sort.sort_order
352
352
  );
353
353
  }
354
354
  o = o.offset(a.page * a.per_page).limit(a.per_page);
355
- const n = await o.selectAll().execute(), { count: s } = await r.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow();
355
+ const n = await o.selectAll().execute(), { count: s } = await r.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
356
356
  return {
357
357
  logs: n.map(pe),
358
358
  start: a.page * a.per_page,
@@ -367,21 +367,21 @@ function ct(t) {
367
367
  return r ? pe(r) : null;
368
368
  };
369
369
  }
370
- function dt(t) {
370
+ function lt(t) {
371
371
  return {
372
372
  create: st(t),
373
373
  list: it(t),
374
374
  get: ct(t)
375
375
  };
376
376
  }
377
- function lt(t) {
377
+ function dt(t) {
378
378
  return async (e, a) => {
379
379
  const r = await t.selectFrom("sessions_2").where("sessions_2.tenant_id", "=", e).where("sessions_2.id", "=", a).where("sessions_2.revoked_at", "is", null).selectAll().executeTakeFirst();
380
380
  if (!r)
381
381
  return null;
382
- const { tenant_id: o, device: n, clients: s, ...l } = r;
382
+ const { tenant_id: o, device: n, clients: s, ...d } = r;
383
383
  return {
384
- ...l,
384
+ ...d,
385
385
  device: JSON.parse(n),
386
386
  clients: JSON.parse(s)
387
387
  };
@@ -435,7 +435,7 @@ function _t(t) {
435
435
  );
436
436
  }
437
437
  o = o.offset(a.page * a.per_page).limit(a.per_page);
438
- const n = await o.selectAll().execute(), { count: s } = await r.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), l = x(s);
438
+ const n = await o.selectAll().execute(), { count: s } = await r.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), d = x(s);
439
439
  return {
440
440
  sessions: n.map((c) => ({
441
441
  ...c,
@@ -444,14 +444,14 @@ function _t(t) {
444
444
  })),
445
445
  start: a.page * a.per_page,
446
446
  limit: a.per_page,
447
- length: l
447
+ length: d
448
448
  };
449
449
  };
450
450
  }
451
451
  function ft(t) {
452
452
  return {
453
453
  create: ut(t),
454
- get: lt(t),
454
+ get: dt(t),
455
455
  list: _t(t),
456
456
  remove: mt(t),
457
457
  update: ht(t)
@@ -504,7 +504,7 @@ function Nt(t) {
504
504
  return {
505
505
  codes: n.map((c) => {
506
506
  const { tenant_id: g, ...m } = c;
507
- return ze.parse(_(m));
507
+ return Je.parse(_(m));
508
508
  }),
509
509
  start: a.page * a.per_page,
510
510
  limit: a.per_page,
@@ -553,7 +553,7 @@ function St(t) {
553
553
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
554
554
  updated_at: (/* @__PURE__ */ new Date()).toISOString(),
555
555
  ...a
556
- }, o = JSON.stringify(a.allowed_origins), n = JSON.stringify(a.callbacks), s = JSON.stringify(a.web_origins), l = JSON.stringify(a.allowed_logout_urls), c = JSON.stringify(a.allowed_clients);
556
+ }, o = JSON.stringify(a.allowed_origins), n = JSON.stringify(a.callbacks), s = JSON.stringify(a.web_origins), d = JSON.stringify(a.allowed_logout_urls), c = JSON.stringify(a.allowed_clients);
557
557
  return await t.insertInto("applications").values({
558
558
  ...r,
559
559
  tenant_id: e,
@@ -562,7 +562,7 @@ function St(t) {
562
562
  callbacks: n,
563
563
  allowed_origins: o,
564
564
  web_origins: s,
565
- allowed_logout_urls: l,
565
+ allowed_logout_urls: d,
566
566
  allowed_clients: c
567
567
  }).execute(), r;
568
568
  };
@@ -652,12 +652,12 @@ function Pt(t) {
652
652
  ...c,
653
653
  options: JSON.parse(c.options)
654
654
  })
655
- ), { count: l } = await r.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
655
+ ), { count: d } = await r.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
656
656
  return {
657
657
  connections: s,
658
658
  start: a.page * a.per_page,
659
659
  limit: a.per_page,
660
- length: x(l)
660
+ length: x(d)
661
661
  };
662
662
  };
663
663
  }
@@ -727,7 +727,7 @@ function Et(t) {
727
727
  }
728
728
  };
729
729
  }
730
- function Jt(t) {
730
+ function zt(t) {
731
731
  return async () => await t.selectFrom("keys").where(
732
732
  (a) => a.or([
733
733
  a("revoked_at", ">", (/* @__PURE__ */ new Date()).toISOString()),
@@ -735,7 +735,7 @@ function Jt(t) {
735
735
  ])
736
736
  ).selectAll().execute();
737
737
  }
738
- function zt(t) {
738
+ function Jt(t) {
739
739
  return async (e) => {
740
740
  await t.insertInto("keys").values({ ...e, created_at: (/* @__PURE__ */ new Date()).toDateString() }).execute();
741
741
  };
@@ -745,8 +745,8 @@ function Kt(t) {
745
745
  }
746
746
  function Rt(t) {
747
747
  return {
748
- create: zt(t),
749
- list: Jt(t),
748
+ create: Jt(t),
749
+ list: zt(t),
750
750
  update: Kt(t)
751
751
  };
752
752
  }
@@ -814,7 +814,7 @@ function Gt(t) {
814
814
  colors_primary: o,
815
815
  colors_page_background_type: n,
816
816
  colors_page_background_start: s,
817
- colors_page_background_end: l,
817
+ colors_page_background_end: d,
818
818
  colors_page_background_angle_dev: c,
819
819
  font_url: g,
820
820
  ...m
@@ -826,7 +826,7 @@ function Gt(t) {
826
826
  page_background: {
827
827
  type: n,
828
828
  start: s,
829
- end: l,
829
+ end: d,
830
830
  angle_deg: c
831
831
  }
832
832
  },
@@ -836,13 +836,13 @@ function Gt(t) {
836
836
  }
837
837
  function Ht(t) {
838
838
  return async (e, a) => {
839
- var s, l, c, g, m, w, b, Z, ee, te, ae, re, ne, oe, se, ie, ce, de;
839
+ var s, d, c, g, m, w, b, Z, ee, te, ae, re, ne, oe, se, ie, ce, le;
840
840
  const { colors: r, font: o, ...n } = a;
841
841
  try {
842
842
  await t.insertInto("branding").values({
843
843
  ...n,
844
844
  colors_primary: r == null ? void 0 : r.primary,
845
- colors_page_background_type: (l = (s = a.colors) == null ? void 0 : s.page_background) == null ? void 0 : l.type,
845
+ colors_page_background_type: (d = (s = a.colors) == null ? void 0 : s.page_background) == null ? void 0 : d.type,
846
846
  colors_page_background_start: (g = (c = a.colors) == null ? void 0 : c.page_background) == null ? void 0 : g.start,
847
847
  colors_page_background_end: (w = (m = a.colors) == null ? void 0 : m.page_background) == null ? void 0 : w.end,
848
848
  colors_page_background_angle_dev: (Z = (b = a.colors) == null ? void 0 : b.page_background) == null ? void 0 : Z.angle_deg,
@@ -857,7 +857,7 @@ function Ht(t) {
857
857
  colors_page_background_start: (ne = (re = a.colors) == null ? void 0 : re.page_background) == null ? void 0 : ne.start,
858
858
  colors_page_background_end: (se = (oe = a.colors) == null ? void 0 : oe.page_background) == null ? void 0 : se.end,
859
859
  colors_page_background_angle_dev: (ce = (ie = a.colors) == null ? void 0 : ie.page_background) == null ? void 0 : ce.angle_deg,
860
- font_url: (de = a.font) == null ? void 0 : de.url
860
+ font_url: (le = a.font) == null ? void 0 : le.url
861
861
  }).where("tenant_id", "=", e).execute();
862
862
  }
863
863
  };
@@ -941,11 +941,11 @@ function ra(t) {
941
941
  remove: ea(t)
942
942
  };
943
943
  }
944
- function J(t, e = "", a = {}) {
944
+ function z(t, e = "", a = {}) {
945
945
  for (let r in t)
946
946
  if (Object.prototype.hasOwnProperty.call(t, r)) {
947
947
  const o = e ? `${e}_${r}` : r;
948
- typeof t[r] == "object" && t[r] !== null && !Array.isArray(t[r]) ? J(t[r], o, a) : a[o] = t[r];
948
+ typeof t[r] == "object" && t[r] !== null && !Array.isArray(t[r]) ? z(t[r], o, a) : a[o] = t[r];
949
949
  }
950
950
  return a;
951
951
  }
@@ -975,7 +975,7 @@ function oa(t) {
975
975
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
976
976
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
977
977
  };
978
- return await t.insertInto("themes").values({ ...J(r), tenant_id: e }).execute(), r;
978
+ return await t.insertInto("themes").values({ ...z(r), tenant_id: e }).execute(), r;
979
979
  };
980
980
  }
981
981
  function sa(t) {
@@ -989,14 +989,14 @@ function ia(t) {
989
989
  }
990
990
  function ca(t) {
991
991
  return async (e, a, r) => {
992
- const o = J({
992
+ const o = z({
993
993
  ...r,
994
994
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
995
995
  });
996
996
  return await t.updateTable("themes").set(o).where("themes.id", "=", a).where("themes.tenant_id", "=", e).execute(), !0;
997
997
  };
998
998
  }
999
- function da(t) {
999
+ function la(t) {
1000
1000
  return {
1001
1001
  create: oa(t),
1002
1002
  get: ia(t),
@@ -1004,7 +1004,7 @@ function da(t) {
1004
1004
  update: ca(t)
1005
1005
  };
1006
1006
  }
1007
- function la(t) {
1007
+ function da(t) {
1008
1008
  return async (e, a) => {
1009
1009
  const r = (/* @__PURE__ */ new Date()).toISOString(), o = await t.selectFrom("logins").where("logins.expires_at", ">", r).where("logins.login_id", "=", a).selectAll().executeTakeFirst();
1010
1010
  return o ? Re.parse(
@@ -1020,11 +1020,11 @@ function ua(t) {
1020
1020
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
1021
1021
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
1022
1022
  };
1023
- return await t.insertInto("logins").values({ ...J(r), tenant_id: e }).execute(), r;
1023
+ return await t.insertInto("logins").values({ ...z(r), tenant_id: e }).execute(), r;
1024
1024
  };
1025
1025
  }
1026
1026
  function ma(t) {
1027
- return async (e, a, r) => (await t.updateTable("logins").set(J(r)).where("logins.login_id", "=", a).where("logins.tenant_id", "=", e).execute()).length === 1;
1027
+ return async (e, a, r) => (await t.updateTable("logins").set(z(r)).where("logins.login_id", "=", a).where("logins.tenant_id", "=", e).execute()).length === 1;
1028
1028
  }
1029
1029
  function ha(t) {
1030
1030
  return async (e, a) => (await t.deleteFrom("logins").where("logins.tenant_id", "=", e).where("logins.login_id", "=", a).execute()).length > 0;
@@ -1032,7 +1032,7 @@ function ha(t) {
1032
1032
  function _a(t) {
1033
1033
  return {
1034
1034
  create: ua(t),
1035
- get: la(t),
1035
+ get: da(t),
1036
1036
  update: ma(t),
1037
1037
  remove: ha(t)
1038
1038
  };
@@ -1086,10 +1086,10 @@ function ya(t) {
1086
1086
  credentials: o,
1087
1087
  settings: n,
1088
1088
  enabled: s,
1089
- ...l
1089
+ ...d
1090
1090
  } = a;
1091
1091
  return _({
1092
- ...l,
1092
+ ...d,
1093
1093
  credentials: JSON.parse(o),
1094
1094
  settings: JSON.parse(n),
1095
1095
  enabled: !!s
@@ -1185,7 +1185,7 @@ function Sa(t) {
1185
1185
  );
1186
1186
  }
1187
1187
  o = o.offset(a.page * a.per_page).limit(a.per_page);
1188
- const n = await o.selectAll().execute(), { count: s } = await r.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), l = x(s);
1188
+ const n = await o.selectAll().execute(), { count: s } = await r.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), d = x(s);
1189
1189
  return {
1190
1190
  refresh_tokens: n.map((c) => ({
1191
1191
  ...c,
@@ -1195,7 +1195,7 @@ function Sa(t) {
1195
1195
  })),
1196
1196
  start: a.page * a.per_page,
1197
1197
  limit: a.per_page,
1198
- length: l
1198
+ length: d
1199
1199
  };
1200
1200
  };
1201
1201
  }
@@ -1214,7 +1214,7 @@ function ka(t) {
1214
1214
  function p(t) {
1215
1215
  return Object.freeze(t);
1216
1216
  }
1217
- const z = p({
1217
+ const J = p({
1218
1218
  is(t) {
1219
1219
  return t.kind === "IdentifierNode";
1220
1220
  },
@@ -1231,14 +1231,14 @@ const z = p({
1231
1231
  create(t) {
1232
1232
  return p({
1233
1233
  kind: "SchemableIdentifierNode",
1234
- identifier: z.create(t)
1234
+ identifier: J.create(t)
1235
1235
  });
1236
1236
  },
1237
1237
  createWithSchema(t, e) {
1238
1238
  return p({
1239
1239
  kind: "SchemableIdentifierNode",
1240
- schema: z.create(t),
1241
- identifier: z.create(e)
1240
+ schema: J.create(t),
1241
+ identifier: J.create(e)
1242
1242
  });
1243
1243
  }
1244
1244
  }), $a = p({
@@ -1377,7 +1377,7 @@ class Da {
1377
1377
  return this.nodeStack.pop(), p(a);
1378
1378
  }
1379
1379
  transformNodeImpl(e) {
1380
- return d(this, K)[e.kind](e);
1380
+ return l(this, K)[e.kind](e);
1381
1381
  }
1382
1382
  transformNodeList(e) {
1383
1383
  return e && p(e.map((a) => this.transformNode(a)));
@@ -2138,29 +2138,29 @@ class ja extends Da {
2138
2138
  return super.transformNodeImpl(a);
2139
2139
  const r = u(this, f, we).call(this, a);
2140
2140
  for (const s of r)
2141
- d(this, S).add(s);
2141
+ l(this, S).add(s);
2142
2142
  const o = u(this, f, ye).call(this, a);
2143
2143
  for (const s of o)
2144
- d(this, T).add(s);
2144
+ l(this, T).add(s);
2145
2145
  const n = super.transformNodeImpl(a);
2146
2146
  for (const s of o)
2147
- d(this, T).delete(s);
2147
+ l(this, T).delete(s);
2148
2148
  for (const s of r)
2149
- d(this, S).delete(s);
2149
+ l(this, S).delete(s);
2150
2150
  return n;
2151
2151
  }
2152
2152
  transformSchemableIdentifier(a) {
2153
2153
  const r = super.transformSchemableIdentifier(a);
2154
- return r.schema || !d(this, T).has(a.identifier.name) ? r : {
2154
+ return r.schema || !l(this, T).has(a.identifier.name) ? r : {
2155
2155
  ...r,
2156
- schema: z.create(d(this, j))
2156
+ schema: J.create(l(this, j))
2157
2157
  };
2158
2158
  }
2159
2159
  transformReferences(a) {
2160
2160
  const r = super.transformReferences(a);
2161
2161
  return r.table.table.schema ? r : {
2162
2162
  ...r,
2163
- table: U.createWithSchema(d(this, j), r.table.table.identifier.name)
2163
+ table: U.createWithSchema(l(this, j), r.table.table.identifier.name)
2164
2164
  };
2165
2165
  }
2166
2166
  }
@@ -2183,11 +2183,11 @@ j = new WeakMap(), T = new WeakMap(), S = new WeakMap(), f = new WeakSet(), ge =
2183
2183
  o && u(this, f, q).call(this, o.table, r);
2184
2184
  }, q = function(a, r) {
2185
2185
  const o = a.identifier.name;
2186
- !d(this, T).has(o) && !d(this, S).has(o) && r.add(o);
2186
+ !l(this, T).has(o) && !l(this, S).has(o) && r.add(o);
2187
2187
  }, Ne = function(a, r) {
2188
2188
  for (const o of a.expressions) {
2189
2189
  const n = o.name.table.table.identifier.name;
2190
- d(this, S).has(n) || r.add(n);
2190
+ l(this, S).has(n) || r.add(n);
2191
2191
  }
2192
2192
  };
2193
2193
  var L;
@@ -2197,7 +2197,7 @@ class Pa {
2197
2197
  M(this, L, new ja(e));
2198
2198
  }
2199
2199
  transformQuery(e) {
2200
- return d(this, L).transformNode(e.node);
2200
+ return l(this, L).transformNode(e.node);
2201
2201
  }
2202
2202
  async transformResult(e) {
2203
2203
  return e.result;
@@ -2226,7 +2226,7 @@ class ve {
2226
2226
  * The returned array is sorted by migration name.
2227
2227
  */
2228
2228
  async getMigrations() {
2229
- const e = await u(this, i, I).call(this, d(this, i, v)) ? await d(this, h).db.withPlugin(d(this, i, C)).selectFrom(d(this, i, v)).select(["name", "timestamp"]).execute() : [];
2229
+ const e = await u(this, i, I).call(this, l(this, i, v)) ? await l(this, h).db.withPlugin(l(this, i, C)).selectFrom(l(this, i, v)).select(["name", "timestamp"]).execute() : [];
2230
2230
  return (await u(this, i, X).call(this)).map(({ name: r, ...o }) => {
2231
2231
  const n = e.find((s) => s.name === r);
2232
2232
  return {
@@ -2313,9 +2313,9 @@ class ve {
2313
2313
  return u(this, i, A).call(this, ({ migrations: a, executedMigrations: r, pendingMigrations: o }) => {
2314
2314
  if (e === La)
2315
2315
  return { direction: "Down", step: 1 / 0 };
2316
- if (!a.find((l) => l.name === e))
2316
+ if (!a.find((d) => d.name === e))
2317
2317
  throw new Error(`migration "${e}" doesn't exist`);
2318
- const n = r.indexOf(e), s = o.findIndex((l) => l.name === e);
2318
+ const n = r.indexOf(e), s = o.findIndex((d) => d.name === e);
2319
2319
  if (n !== -1)
2320
2320
  return {
2321
2321
  direction: "Down",
@@ -2368,79 +2368,79 @@ h = new WeakMap(), i = new WeakSet(), A = async function(e) {
2368
2368
  return a instanceof Q ? a.resultSet : { error: a };
2369
2369
  }
2370
2370
  }, N = function() {
2371
- return d(this, h).migrationTableSchema;
2371
+ return l(this, h).migrationTableSchema;
2372
2372
  }, v = function() {
2373
- return d(this, h).migrationTableName ?? Aa;
2373
+ return l(this, h).migrationTableName ?? Aa;
2374
2374
  }, D = function() {
2375
- return d(this, h).migrationLockTableName ?? _e;
2375
+ return l(this, h).migrationLockTableName ?? _e;
2376
2376
  }, Ce = function() {
2377
- return d(this, h).allowUnorderedMigrations ?? Fa;
2377
+ return l(this, h).allowUnorderedMigrations ?? Fa;
2378
2378
  }, C = function() {
2379
- return d(this, i, N) ? new Pa(d(this, i, N)) : new Ma();
2379
+ return l(this, i, N) ? new Pa(l(this, i, N)) : new Ma();
2380
2380
  }, be = async function() {
2381
2381
  await u(this, i, xe).call(this), await u(this, i, Te).call(this), await u(this, i, Se).call(this), await u(this, i, Oe).call(this);
2382
2382
  }, xe = async function() {
2383
- if (d(this, i, N) && !await u(this, i, G).call(this))
2383
+ if (l(this, i, N) && !await u(this, i, G).call(this))
2384
2384
  try {
2385
- await u(this, i, F).call(this, d(this, h).db.schema.createSchema(d(this, i, N)));
2385
+ await u(this, i, F).call(this, l(this, h).db.schema.createSchema(l(this, i, N)));
2386
2386
  } catch (e) {
2387
2387
  if (!await u(this, i, G).call(this))
2388
2388
  throw e;
2389
2389
  }
2390
2390
  }, Te = async function() {
2391
- if (!await u(this, i, I).call(this, d(this, i, v)))
2391
+ if (!await u(this, i, I).call(this, l(this, i, v)))
2392
2392
  try {
2393
- d(this, i, N) && await u(this, i, F).call(this, d(this, h).db.schema.createSchema(d(this, i, N))), await u(this, i, F).call(this, d(this, h).db.schema.withPlugin(d(this, i, C)).createTable(d(this, i, v)).addColumn("name", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("timestamp", "varchar(255)", (e) => e.notNull()));
2393
+ l(this, i, N) && await u(this, i, F).call(this, l(this, h).db.schema.createSchema(l(this, i, N))), await u(this, i, F).call(this, l(this, h).db.schema.withPlugin(l(this, i, C)).createTable(l(this, i, v)).addColumn("name", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("timestamp", "varchar(255)", (e) => e.notNull()));
2394
2394
  } catch (e) {
2395
- if (!await u(this, i, I).call(this, d(this, i, v)))
2395
+ if (!await u(this, i, I).call(this, l(this, i, v)))
2396
2396
  throw e;
2397
2397
  }
2398
2398
  }, Se = async function() {
2399
- if (!await u(this, i, I).call(this, d(this, i, D)))
2399
+ if (!await u(this, i, I).call(this, l(this, i, D)))
2400
2400
  try {
2401
- await u(this, i, F).call(this, d(this, h).db.schema.withPlugin(d(this, i, C)).createTable(d(this, i, D)).addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("is_locked", "integer", (e) => e.notNull().defaultTo(0)));
2401
+ await u(this, i, F).call(this, l(this, h).db.schema.withPlugin(l(this, i, C)).createTable(l(this, i, D)).addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("is_locked", "integer", (e) => e.notNull().defaultTo(0)));
2402
2402
  } catch (e) {
2403
- if (!await u(this, i, I).call(this, d(this, i, D)))
2403
+ if (!await u(this, i, I).call(this, l(this, i, D)))
2404
2404
  throw e;
2405
2405
  }
2406
2406
  }, Oe = async function() {
2407
2407
  if (!await u(this, i, H).call(this))
2408
2408
  try {
2409
- await d(this, h).db.withPlugin(d(this, i, C)).insertInto(d(this, i, D)).values({ id: B, is_locked: 0 }).execute();
2409
+ await l(this, h).db.withPlugin(l(this, i, C)).insertInto(l(this, i, D)).values({ id: B, is_locked: 0 }).execute();
2410
2410
  } catch (e) {
2411
2411
  if (!await u(this, i, H).call(this))
2412
2412
  throw e;
2413
2413
  }
2414
2414
  }, G = async function() {
2415
- return (await d(this, h).db.introspection.getSchemas()).some((a) => a.name === d(this, i, N));
2415
+ return (await l(this, h).db.introspection.getSchemas()).some((a) => a.name === l(this, i, N));
2416
2416
  }, I = async function(e) {
2417
- const a = d(this, i, N);
2418
- return (await d(this, h).db.introspection.getTables({
2417
+ const a = l(this, i, N);
2418
+ return (await l(this, h).db.introspection.getTables({
2419
2419
  withInternalKyselyTables: !0
2420
2420
  })).some((o) => o.name === e && (!a || o.schema === a));
2421
2421
  }, H = async function() {
2422
- return !!await d(this, h).db.withPlugin(d(this, i, C)).selectFrom(d(this, i, D)).where("id", "=", B).select("id").executeTakeFirst();
2422
+ return !!await l(this, h).db.withPlugin(l(this, i, C)).selectFrom(l(this, i, D)).where("id", "=", B).select("id").executeTakeFirst();
2423
2423
  }, ke = async function(e) {
2424
- const a = d(this, h).db.getExecutor().adapter, r = p({
2425
- lockTable: d(this, h).migrationLockTableName ?? _e,
2424
+ const a = l(this, h).db.getExecutor().adapter, r = p({
2425
+ lockTable: l(this, h).migrationLockTableName ?? _e,
2426
2426
  lockRowId: B,
2427
- lockTableSchema: d(this, h).migrationTableSchema
2427
+ lockTableSchema: l(this, h).migrationTableSchema
2428
2428
  }), o = async (n) => {
2429
2429
  try {
2430
2430
  await a.acquireMigrationLock(n, r);
2431
2431
  const s = await u(this, i, $e).call(this, n);
2432
2432
  if (s.migrations.length === 0)
2433
2433
  return { results: [] };
2434
- const { direction: l, step: c } = e(s);
2435
- return c <= 0 ? { results: [] } : l === "Down" ? await u(this, i, Me).call(this, n, s, c) : l === "Up" ? await u(this, i, Ae).call(this, n, s, c) : { results: [] };
2434
+ const { direction: d, step: c } = e(s);
2435
+ return c <= 0 ? { results: [] } : d === "Down" ? await u(this, i, Me).call(this, n, s, c) : d === "Up" ? await u(this, i, Ae).call(this, n, s, c) : { results: [] };
2436
2436
  } finally {
2437
2437
  await a.releaseMigrationLock(n, r);
2438
2438
  }
2439
2439
  };
2440
- return a.supportsTransactionalDdl ? d(this, h).db.transaction().execute(o) : d(this, h).db.connection().execute(o);
2440
+ return a.supportsTransactionalDdl ? l(this, h).db.transaction().execute(o) : l(this, h).db.connection().execute(o);
2441
2441
  }, $e = async function(e) {
2442
2442
  const a = await u(this, i, X).call(this), r = await u(this, i, Ie).call(this, e);
2443
- u(this, i, je).call(this, a, r), d(this, i, Ce) || u(this, i, Pe).call(this, a, r);
2443
+ u(this, i, je).call(this, a, r), l(this, i, Ce) || u(this, i, Pe).call(this, a, r);
2444
2444
  const o = u(this, i, De).call(this, a, r);
2445
2445
  return p({
2446
2446
  migrations: a,
@@ -2451,13 +2451,13 @@ h = new WeakMap(), i = new WeakSet(), A = async function(e) {
2451
2451
  }, De = function(e, a) {
2452
2452
  return e.filter((r) => !a.includes(r.name));
2453
2453
  }, X = async function() {
2454
- const e = await d(this, h).provider.getMigrations();
2454
+ const e = await l(this, h).provider.getMigrations();
2455
2455
  return Object.keys(e).sort().map((a) => ({
2456
2456
  ...e[a],
2457
2457
  name: a
2458
2458
  }));
2459
2459
  }, Ie = async function(e) {
2460
- return (await e.withPlugin(d(this, i, C)).selectFrom(d(this, i, v)).select("name").orderBy(["timestamp", "name"]).execute()).map((r) => r.name);
2460
+ return (await e.withPlugin(l(this, i, C)).selectFrom(l(this, i, v)).select("name").orderBy(["timestamp", "name"]).execute()).map((r) => r.name);
2461
2461
  }, je = function(e, a) {
2462
2462
  for (const r of a)
2463
2463
  if (!e.some((o) => o.name === r))
@@ -2467,22 +2467,22 @@ h = new WeakMap(), i = new WeakSet(), A = async function(e) {
2467
2467
  if (e[r].name !== a[r])
2468
2468
  throw new Error(`corrupted migrations: expected previously executed migration ${a[r]} to be at index ${r} but ${e[r].name} was found in its place. New migrations must always have a name that comes alphabetically after the last executed migration.`);
2469
2469
  }, Me = async function(e, a, r) {
2470
- const o = a.executedMigrations.slice().reverse().slice(0, r).map((s) => a.migrations.find((l) => l.name === s)), n = o.map((s) => ({
2470
+ const o = a.executedMigrations.slice().reverse().slice(0, r).map((s) => a.migrations.find((d) => d.name === s)), n = o.map((s) => ({
2471
2471
  migrationName: s.name,
2472
2472
  direction: "Down",
2473
2473
  status: "NotExecuted"
2474
2474
  }));
2475
2475
  for (let s = 0; s < n.length; ++s) {
2476
- const l = o[s];
2476
+ const d = o[s];
2477
2477
  try {
2478
- l.down && (await l.down(e), await e.withPlugin(d(this, i, C)).deleteFrom(d(this, i, v)).where("name", "=", l.name).execute(), n[s] = {
2479
- migrationName: l.name,
2478
+ d.down && (await d.down(e), await e.withPlugin(l(this, i, C)).deleteFrom(l(this, i, v)).where("name", "=", d.name).execute(), n[s] = {
2479
+ migrationName: d.name,
2480
2480
  direction: "Down",
2481
2481
  status: "Success"
2482
2482
  });
2483
2483
  } catch (c) {
2484
2484
  throw n[s] = {
2485
- migrationName: l.name,
2485
+ migrationName: d.name,
2486
2486
  direction: "Down",
2487
2487
  status: "Error"
2488
2488
  }, new Q({
@@ -2499,19 +2499,19 @@ h = new WeakMap(), i = new WeakSet(), A = async function(e) {
2499
2499
  status: "NotExecuted"
2500
2500
  }));
2501
2501
  for (let s = 0; s < n.length; s++) {
2502
- const l = a.pendingMigrations[s];
2502
+ const d = a.pendingMigrations[s];
2503
2503
  try {
2504
- await l.up(e), await e.withPlugin(d(this, i, C)).insertInto(d(this, i, v)).values({
2505
- name: l.name,
2504
+ await d.up(e), await e.withPlugin(l(this, i, C)).insertInto(l(this, i, v)).values({
2505
+ name: d.name,
2506
2506
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
2507
2507
  }).execute(), n[s] = {
2508
- migrationName: l.name,
2508
+ migrationName: d.name,
2509
2509
  direction: "Up",
2510
2510
  status: "Success"
2511
2511
  };
2512
2512
  } catch (c) {
2513
2513
  throw n[s] = {
2514
- migrationName: l.name,
2514
+ migrationName: d.name,
2515
2515
  direction: "Up",
2516
2516
  status: "Error"
2517
2517
  }, new Q({
@@ -2522,7 +2522,7 @@ h = new WeakMap(), i = new WeakSet(), A = async function(e) {
2522
2522
  }
2523
2523
  return { results: n };
2524
2524
  }, F = async function(e) {
2525
- d(this, h).db.getExecutor().adapter.supportsCreateIfNotExists && (e = e.ifNotExists()), await e.execute();
2525
+ l(this, h).db.getExecutor().adapter.supportsCreateIfNotExists && (e = e.ifNotExists()), await e.execute();
2526
2526
  };
2527
2527
  var E;
2528
2528
  class Q extends Error {
@@ -2532,7 +2532,7 @@ class Q extends Error {
2532
2532
  M(this, E, a);
2533
2533
  }
2534
2534
  get resultSet() {
2535
- return d(this, E);
2535
+ return l(this, E);
2536
2536
  }
2537
2537
  }
2538
2538
  E = new WeakMap();
@@ -2613,12 +2613,12 @@ async function Ea(t) {
2613
2613
  (e) => e.references("tenants.id").onDelete("cascade").notNull()
2614
2614
  ).addColumn("domain", "varchar(255)", (e) => e.notNull()).addColumn("email_service", "varchar(255)").addColumn("email_api_key", "varchar(255)").addColumn("dkim_private_key", "varchar(2048)").addColumn("dkim_public_key", "varchar(2048)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("updated_at", "varchar(255)", (e) => e.notNull()).execute();
2615
2615
  }
2616
- async function Ja(t) {
2616
+ async function za(t) {
2617
2617
  await t.schema.dropTable("domains").execute(), await t.schema.dropTable("members").execute(), await t.schema.dropTable("users").execute(), await t.schema.dropTable("connections").execute(), await t.schema.dropTable("applications").execute(), await t.schema.dropTable("migrations").execute(), await t.schema.dropTable("tenants").execute();
2618
2618
  }
2619
- const za = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2619
+ const Ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2620
2620
  __proto__: null,
2621
- down: Ja,
2621
+ down: za,
2622
2622
  up: Ea
2623
2623
  }, Symbol.toStringTag, { value: "Module" }));
2624
2624
  async function Ka(t) {
@@ -2740,12 +2740,12 @@ async function cr(t) {
2740
2740
  (e) => e.notNull()
2741
2741
  ).execute();
2742
2742
  }
2743
- async function dr(t) {
2743
+ async function lr(t) {
2744
2744
  await t.schema.alterTable("passwords").dropColumn("password").execute();
2745
2745
  }
2746
- const lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2746
+ const dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2747
2747
  __proto__: null,
2748
- down: dr,
2748
+ down: lr,
2749
2749
  up: cr
2750
2750
  }, Symbol.toStringTag, { value: "Module" }));
2751
2751
  async function ur(t) {
@@ -2845,11 +2845,11 @@ const Lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2845
2845
  }, Symbol.toStringTag, { value: "Module" }));
2846
2846
  async function Er(t) {
2847
2847
  }
2848
- async function Jr(t) {
2848
+ async function zr(t) {
2849
2849
  }
2850
- const zr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2850
+ const Jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2851
2851
  __proto__: null,
2852
- down: Jr,
2852
+ down: zr,
2853
2853
  up: Er
2854
2854
  }, Symbol.toStringTag, { value: "Module" }));
2855
2855
  async function Kr(t) {
@@ -2927,16 +2927,16 @@ const cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2927
2927
  down: sn,
2928
2928
  up: on
2929
2929
  }, Symbol.toStringTag, { value: "Module" }));
2930
- async function dn(t) {
2930
+ async function ln(t) {
2931
2931
  await t.schema.createIndex("users_name_index").on("users").column("name").execute();
2932
2932
  }
2933
- async function ln(t) {
2933
+ async function dn(t) {
2934
2934
  await t.schema.dropIndex("users_name_index").execute();
2935
2935
  }
2936
2936
  const un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2937
2937
  __proto__: null,
2938
- down: ln,
2939
- up: dn
2938
+ down: dn,
2939
+ up: ln
2940
2940
  }, Symbol.toStringTag, { value: "Module" }));
2941
2941
  async function mn(t) {
2942
2942
  }
@@ -3040,14 +3040,14 @@ const En = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3040
3040
  down: Ln,
3041
3041
  up: Fn
3042
3042
  }, Symbol.toStringTag, { value: "Module" }));
3043
- async function Jn(t) {
3044
- }
3045
3043
  async function zn(t) {
3046
3044
  }
3045
+ async function Jn(t) {
3046
+ }
3047
3047
  const Kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3048
3048
  __proto__: null,
3049
- down: zn,
3050
- up: Jn
3049
+ down: Jn,
3050
+ up: zn
3051
3051
  }, Symbol.toStringTag, { value: "Module" }));
3052
3052
  async function Rn(t) {
3053
3053
  await t.schema.alterTable("otps").addColumn("ip", "varchar(64)").execute();
@@ -3282,12 +3282,12 @@ async function Eo(t) {
3282
3282
  (e) => e.references("applications.id").onDelete("cascade").notNull()
3283
3283
  ).addColumn("user_id", "varchar(255)", (e) => e.notNull()).addColumn("nonce", "varchar(255)").addColumn("state", "varchar(8192)").addColumn("scope", "varchar(1024)").addColumn("response_type", "varchar(256)").addColumn("response_mode", "varchar(256)").addColumn("redirect_uri", "varchar(1024)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute();
3284
3284
  }
3285
- const Jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3285
+ const zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3286
3286
  __proto__: null,
3287
3287
  down: Eo,
3288
3288
  up: Lo
3289
3289
  }, Symbol.toStringTag, { value: "Module" }));
3290
- async function zo(t) {
3290
+ async function Jo(t) {
3291
3291
  await t.schema.createIndex("IDX_logs_tenant_date_type_user").on("logs").columns(["tenant_id", "date", "type", "user_id"]).execute();
3292
3292
  }
3293
3293
  async function Ko(t) {
@@ -3296,7 +3296,7 @@ async function Ko(t) {
3296
3296
  const Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3297
3297
  __proto__: null,
3298
3298
  down: Ko,
3299
- up: zo
3299
+ up: Jo
3300
3300
  }, Symbol.toStringTag, { value: "Module" }));
3301
3301
  async function Uo(t) {
3302
3302
  }
@@ -3378,19 +3378,19 @@ async function is(t) {
3378
3378
  async function cs(t) {
3379
3379
  await t.schema.alterTable("logins").dropColumn("authParams_prompt").execute();
3380
3380
  }
3381
- const ds = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3381
+ const ls = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3382
3382
  __proto__: null,
3383
3383
  down: cs,
3384
3384
  up: is
3385
3385
  }, Symbol.toStringTag, { value: "Module" }));
3386
- async function ls(t) {
3386
+ async function ds(t) {
3387
3387
  }
3388
3388
  async function us(t) {
3389
3389
  }
3390
3390
  const ms = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3391
3391
  __proto__: null,
3392
3392
  down: us,
3393
- up: ls
3393
+ up: ds
3394
3394
  }, Symbol.toStringTag, { value: "Module" }));
3395
3395
  async function hs(t) {
3396
3396
  await t.schema.alterTable("logins").addColumn("authParams_act_as", "varchar(255)").execute();
@@ -3541,12 +3541,12 @@ async function Ls(t) {
3541
3541
  async function Es(t) {
3542
3542
  await t.schema.dropTable("sessions_2").execute(), await t.schema.dropTable("refresh_tokens_2").execute();
3543
3543
  }
3544
- const Js = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3544
+ const zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3545
3545
  __proto__: null,
3546
3546
  down: Es,
3547
3547
  up: Ls
3548
3548
  }, Symbol.toStringTag, { value: "Module" }));
3549
- async function zs(t) {
3549
+ async function Js(t) {
3550
3550
  await t.schema.createTable("custom_domains").addColumn(
3551
3551
  "custom_domain_id",
3552
3552
  "varchar(21)",
@@ -3567,7 +3567,7 @@ async function Ks(t) {
3567
3567
  const Rs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3568
3568
  __proto__: null,
3569
3569
  down: Ks,
3570
- up: zs
3570
+ up: Js
3571
3571
  }, Symbol.toStringTag, { value: "Module" }));
3572
3572
  async function Us(t) {
3573
3573
  }
@@ -3578,8 +3578,19 @@ const Qs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3578
3578
  __proto__: null,
3579
3579
  down: Bs,
3580
3580
  up: Us
3581
+ }, Symbol.toStringTag, { value: "Module" }));
3582
+ async function Vs(t) {
3583
+ await t.schema.alterTable("logins").dropColumn("authorization_url").execute(), await t.schema.alterTable("logins").addColumn("authorization_url", "varchar(2048)").execute();
3584
+ }
3585
+ async function Ws(t) {
3586
+ await t.schema.alterTable("logins").dropColumn("authorization_url").execute(), await t.schema.alterTable("logins").addColumn("authorization_url", "varchar(1024)").execute();
3587
+ }
3588
+ const qs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3589
+ __proto__: null,
3590
+ down: Ws,
3591
+ up: Vs
3581
3592
  }, Symbol.toStringTag, { value: "Module" })), Le = {
3582
- m1_init: za,
3593
+ m1_init: Ja,
3583
3594
  m2_magicLink: Ua,
3584
3595
  m3_updateAt: Va,
3585
3596
  m4_logTable: Ga,
@@ -3587,7 +3598,7 @@ const Qs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3587
3598
  m6_sessions: tr,
3588
3599
  m7_passwords: nr,
3589
3600
  m8_logsTableNewFields: ir,
3590
- m9_passwordTableNewField: lr,
3601
+ m9_passwordTableNewField: dr,
3591
3602
  n01_codesTable: hr,
3592
3603
  n11_universalLoginSession: pr,
3593
3604
  n12_userFields: wr,
@@ -3597,7 +3608,7 @@ const Qs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3597
3608
  n16_userLocale: Ir,
3598
3609
  n17_signingKeys: Mr,
3599
3610
  n18_logsFields: Lr,
3600
- n19_connectionsUserinfo: zr,
3611
+ n19_connectionsUserinfo: Jr,
3601
3612
  n20_missingFields: Ur,
3602
3613
  n21_sessionDeletedAt: Vr,
3603
3614
  n22_dropLogsFields: Gr,
@@ -3632,7 +3643,7 @@ const Qs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3632
3643
  n51_connectionid: Do,
3633
3644
  n52_cert: Po,
3634
3645
  n53_codes_primary_key: Fo,
3635
- n54_cleanup_tables: Jo,
3646
+ n54_cleanup_tables: zo,
3636
3647
  n55_logs_index: Ro,
3637
3648
  n56_application_fields: Qo,
3638
3649
  n57_prompt_settings: qo,
@@ -3640,7 +3651,7 @@ const Qs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3640
3651
  n59_connection_options: es,
3641
3652
  n60_users_metadata: rs,
3642
3653
  n61_userLocales: ss,
3643
- n62_prompt: ds,
3654
+ n62_prompt: ls,
3644
3655
  n63_connection_cleanup: ms,
3645
3656
  n64_act_as: fs,
3646
3657
  n65_code_verifier: ys,
@@ -3650,11 +3661,12 @@ const Qs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3650
3661
  n70_refresh_tokens: Ds,
3651
3662
  n71_session_new_fields: Ps,
3652
3663
  n72_session_primary_key: Fs,
3653
- n73_drop_sessions: Js,
3664
+ n73_drop_sessions: zs,
3654
3665
  n74_custom_domains: Rs,
3655
- n75_organizations: Qs
3666
+ n75_organizations: Qs,
3667
+ n76_authorization_url_length: qs
3656
3668
  };
3657
- async function Hs(t, e = !1) {
3669
+ async function Zs(t, e = !1) {
3658
3670
  e && console.log("migrating...");
3659
3671
  const a = new Fe(Le), r = new ve({
3660
3672
  db: t,
@@ -3667,7 +3679,7 @@ async function Hs(t, e = !1) {
3667
3679
  }), o)
3668
3680
  throw console.error("failed to migrate"), console.error(o), o;
3669
3681
  }
3670
- async function Xs(t) {
3682
+ async function ei(t) {
3671
3683
  console.log("migrating...");
3672
3684
  const e = new Fe(Le), a = new ve({
3673
3685
  db: t,
@@ -3678,7 +3690,7 @@ async function Xs(t) {
3678
3690
  }), r)
3679
3691
  throw console.error("failed to migrate"), console.error(r), r;
3680
3692
  }
3681
- function Ys(t) {
3693
+ function ti(t) {
3682
3694
  return {
3683
3695
  applications: It(t),
3684
3696
  branding: Xt(t),
@@ -3690,18 +3702,18 @@ function Ys(t) {
3690
3702
  hooks: ra(t),
3691
3703
  keys: Rt(t),
3692
3704
  loginSessions: _a(t),
3693
- logs: dt(t),
3705
+ logs: lt(t),
3694
3706
  passwords: wt(t),
3695
3707
  promptSettings: ga(t),
3696
3708
  refreshTokens: Oa(t),
3697
3709
  sessions: ft(t),
3698
3710
  tenants: nt(t),
3699
- themes: da(t),
3711
+ themes: la(t),
3700
3712
  users: Xe(t)
3701
3713
  };
3702
3714
  }
3703
3715
  export {
3704
- Ys as default,
3705
- Xs as migrateDown,
3706
- Hs as migrateToLatest
3716
+ ti as default,
3717
+ ei as migrateDown,
3718
+ Zs as migrateToLatest
3707
3719
  };