@authhero/kysely-adapter 10.16.0 → 10.17.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,7 +83,7 @@ function qe(t) {
83
83
  ]);
84
84
  if (!r)
85
85
  return null;
86
- const { tenant_id: o, ...s } = r, l = {
86
+ const { tenant_id: o, ...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
  ...n.map(pe)
101
101
  ]
102
102
  };
103
- return f(l);
103
+ return f(d);
104
104
  };
105
105
  }
106
106
  function T(t, e, a, r) {
107
107
  return a.split(/\s+/).map((o) => o.replace(/^([^:]+)=/g, "$1:")).map((o) => {
108
- let s = o.startsWith("-"), l, d, h, m;
109
- return o.startsWith("-_exists_:") ? (l = o.substring(10), h = !0, s = !0) : o.startsWith("_exists_:") ? (l = o.substring(9), h = !0, s = !1) : o.includes(":") ? (s = o.startsWith("-"), [l, d] = s ? o.substring(1).split(":") : o.split(":"), h = !1, d.startsWith(">=") ? (m = ">=", d = d.substring(2)) : d.startsWith(">") ? (m = ">", d = d.substring(1)) : d.startsWith("<=") ? (m = "<=", d = d.substring(2)) : d.startsWith("<") ? (m = "<", d = d.substring(1)) : m = "=") : (l = null, d = o, h = !1), { key: l, value: d, isNegation: s, isExistsQuery: h, operator: m };
110
- }).forEach(({ key: o, value: s, isNegation: l, isExistsQuery: d, operator: h }) => {
108
+ let s = o.startsWith("-"), d, l, h, m;
109
+ return o.startsWith("-_exists_:") ? (d = o.substring(10), h = !0, s = !0) : o.startsWith("_exists_:") ? (d = o.substring(9), h = !0, s = !1) : o.includes(":") ? (s = o.startsWith("-"), [d, l] = s ? o.substring(1).split(":") : o.split(":"), h = !1, l.startsWith(">=") ? (m = ">=", l = l.substring(2)) : l.startsWith(">") ? (m = ">", l = l.substring(1)) : l.startsWith("<=") ? (m = "<=", l = l.substring(2)) : l.startsWith("<") ? (m = "<", l = l.substring(1)) : m = "=") : (d = null, l = o, h = !1), { key: d, value: l, isNegation: s, isExistsQuery: h, operator: m };
110
+ }).forEach(({ key: o, value: s, isNegation: d, isExistsQuery: l, operator: h }) => {
111
111
  if (o)
112
- if (d)
113
- l ? e = e.where(o, "is", null) : e = e.where(o, "is not", null);
114
- else if (l)
112
+ if (l)
113
+ d ? e = e.where(o, "is", null) : e = e.where(o, "is not", null);
114
+ else if (d)
115
115
  switch (h) {
116
116
  case ">":
117
117
  e = e.where(o, "<=", 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 o = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), s = o.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() : [], d = o.map((m) => {
158
- const w = l.filter(
157
+ const o = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), s = o.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() : [], l = o.map((m) => {
158
+ const w = d.filter(
159
159
  (x) => x.linked_to === m.user_id
160
160
  );
161
161
  return f({
@@ -176,7 +176,7 @@ function Ve(t) {
176
176
  });
177
177
  }), { count: h } = await r.select((m) => m.fn.countAll().as("count")).executeTakeFirstOrThrow();
178
178
  return {
179
- users: d,
179
+ users: l,
180
180
  start: a.page * a.per_page,
181
181
  limit: a.per_page,
182
182
  length: b(h)
@@ -186,11 +186,11 @@ function Ve(t) {
186
186
  function We(t) {
187
187
  return async (e, a) => (await t.deleteFrom("users").where("users.tenant_id", "=", e).where("users.linked_to", "=", a).execute(), (await t.deleteFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", a).execute()).length === 1);
188
188
  }
189
- function j(t, e = "", a = {}) {
189
+ function P(t, e = "", a = {}) {
190
190
  for (let r in t)
191
191
  if (Object.prototype.hasOwnProperty.call(t, r)) {
192
192
  const n = e ? `${e}_${r}` : r, o = t[r];
193
- typeof o == "object" && o !== null && !Array.isArray(o) ? j(o, n, a) : typeof o == "boolean" ? a[n] = o ? 1 : 0 : a[n] = o;
193
+ typeof o == "object" && o !== null && !Array.isArray(o) ? P(o, n, a) : typeof o == "boolean" ? a[n] = o ? 1 : 0 : a[n] = o;
194
194
  }
195
195
  return a;
196
196
  }
@@ -214,7 +214,7 @@ function Ge(t, e) {
214
214
  }
215
215
  function He(t) {
216
216
  return async (e, a, r) => {
217
- const n = j({
217
+ const n = P({
218
218
  ...r,
219
219
  updated_at: (/* @__PURE__ */ new Date()).toISOString(),
220
220
  app_metadata: r.app_metadata ? JSON.stringify(r.app_metadata) : void 0,
@@ -272,16 +272,16 @@ function at(t) {
272
272
  }) => {
273
273
  let a = t.selectFrom("tenants");
274
274
  if (e.sort && e.sort.sort_by) {
275
- const { ref: l } = t.dynamic;
276
- a = a.orderBy(l(e.sort.sort_by), e.sort.sort_order);
275
+ const { ref: d } = t.dynamic;
276
+ a = a.orderBy(d(e.sort.sort_by), e.sort.sort_order);
277
277
  }
278
- e.q && (a = a.where((l) => l.or([l("name", "like", `%${e.q}%`)])));
278
+ e.q && (a = a.where((d) => d.or([d("name", "like", `%${e.q}%`)])));
279
279
  const n = await a.offset(e.page * e.per_page).limit(e.per_page).selectAll().execute();
280
280
  if (!e.include_totals)
281
281
  return {
282
282
  tenants: n
283
283
  };
284
- const { count: o } = await a.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow(), s = b(o);
284
+ const { count: o } = await a.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), s = b(o);
285
285
  return {
286
286
  tenants: n.map(f),
287
287
  start: (e.page - 1) * e.per_page,
@@ -358,7 +358,7 @@ function ge(t) {
358
358
  _id: t.id
359
359
  };
360
360
  }
361
- function dt(t) {
361
+ function lt(t) {
362
362
  return async (e, a = {
363
363
  page: 0,
364
364
  per_page: 50,
@@ -368,14 +368,14 @@ function dt(t) {
368
368
  a.q && (r = T(t, r, a.q, ["user_id", "ip"]));
369
369
  let n = r;
370
370
  if (a.sort && a.sort.sort_by) {
371
- const { ref: l } = t.dynamic;
371
+ const { ref: d } = t.dynamic;
372
372
  n = n.orderBy(
373
- l(a.sort.sort_by),
373
+ d(a.sort.sort_by),
374
374
  a.sort.sort_order
375
375
  );
376
376
  }
377
377
  n = n.offset(a.page * a.per_page).limit(a.per_page);
378
- const o = await n.selectAll().execute(), { count: s } = await r.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow();
378
+ const o = await n.selectAll().execute(), { count: s } = await r.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
379
379
  return {
380
380
  logs: o.map(ge),
381
381
  start: a.page * a.per_page,
@@ -384,7 +384,7 @@ function dt(t) {
384
384
  };
385
385
  };
386
386
  }
387
- function lt(t) {
387
+ function dt(t) {
388
388
  return async (e, a) => {
389
389
  const r = await t.selectFrom("logs").where("logs.tenant_id", "=", e).where("logs.id", "=", a).selectAll().executeTakeFirst();
390
390
  return r ? ge(r) : null;
@@ -393,8 +393,8 @@ function lt(t) {
393
393
  function ct(t) {
394
394
  return {
395
395
  create: it(t),
396
- list: dt(t),
397
- get: lt(t)
396
+ list: lt(t),
397
+ get: dt(t)
398
398
  };
399
399
  }
400
400
  function ut(t) {
@@ -402,9 +402,9 @@ function ut(t) {
402
402
  const r = await t.selectFrom("sessions").where("sessions.tenant_id", "=", e).where("sessions.id", "=", a).selectAll().executeTakeFirst();
403
403
  if (!r)
404
404
  return null;
405
- const { tenant_id: n, device: o, clients: s, ...l } = r;
405
+ const { tenant_id: n, device: o, clients: s, ...d } = r;
406
406
  return {
407
- ...l,
407
+ ...d,
408
408
  device: JSON.parse(o),
409
409
  clients: JSON.parse(s)
410
410
  };
@@ -451,23 +451,23 @@ function ft(t) {
451
451
  a.q && (r = T(t, r, a.q, ["user_id", "session_id"]));
452
452
  let n = r;
453
453
  if (a.sort && a.sort.sort_by) {
454
- const { ref: d } = t.dynamic;
454
+ const { ref: l } = t.dynamic;
455
455
  n = n.orderBy(
456
- d(a.sort.sort_by),
456
+ l(a.sort.sort_by),
457
457
  a.sort.sort_order
458
458
  );
459
459
  }
460
460
  n = n.offset(a.page * a.per_page).limit(a.per_page);
461
- const o = await n.selectAll().execute(), { count: s } = await r.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), l = b(s);
461
+ const o = await n.selectAll().execute(), { count: s } = await r.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow(), d = b(s);
462
462
  return {
463
- sessions: o.map((d) => ({
464
- ...d,
465
- device: JSON.parse(d.device),
466
- clients: JSON.parse(d.clients)
463
+ sessions: o.map((l) => ({
464
+ ...l,
465
+ device: JSON.parse(l.device),
466
+ clients: JSON.parse(l.clients)
467
467
  })),
468
468
  start: a.page * a.per_page,
469
469
  limit: a.per_page,
470
- length: l
470
+ length: d
471
471
  };
472
472
  };
473
473
  }
@@ -523,10 +523,10 @@ function Nt(t) {
523
523
  }) => {
524
524
  let r = t.selectFrom("codes").where("codes.tenant_id", "=", e);
525
525
  a.q && (r = T(t, r, a.q, ["code", "login_id"]));
526
- const o = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), { count: s } = await r.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
526
+ const o = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), { count: s } = await r.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow();
527
527
  return {
528
- codes: o.map((d) => {
529
- const { tenant_id: h, ...m } = d;
528
+ codes: o.map((l) => {
529
+ const { tenant_id: h, ...m } = l;
530
530
  return Ke.parse(f(m));
531
531
  }),
532
532
  start: a.page * a.per_page,
@@ -576,7 +576,7 @@ function Ot(t) {
576
576
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
577
577
  updated_at: (/* @__PURE__ */ new Date()).toISOString(),
578
578
  ...a
579
- }, n = JSON.stringify(a.allowed_origins), o = JSON.stringify(a.callbacks), s = JSON.stringify(a.web_origins), l = JSON.stringify(a.allowed_logout_urls), d = JSON.stringify(a.allowed_clients);
579
+ }, n = JSON.stringify(a.allowed_origins), o = JSON.stringify(a.callbacks), s = JSON.stringify(a.web_origins), d = JSON.stringify(a.allowed_logout_urls), l = JSON.stringify(a.allowed_clients);
580
580
  return await t.insertInto("applications").values({
581
581
  ...r,
582
582
  tenant_id: e,
@@ -585,8 +585,8 @@ function Ot(t) {
585
585
  callbacks: o,
586
586
  allowed_origins: n,
587
587
  web_origins: s,
588
- allowed_logout_urls: l,
589
- allowed_clients: d
588
+ allowed_logout_urls: d,
589
+ allowed_clients: l
590
590
  }).execute(), r;
591
591
  };
592
592
  }
@@ -637,7 +637,7 @@ function It(t) {
637
637
  return await t.updateTable("applications").set(n).where("applications.id", "=", a).where("applications.tenant_id", "=", e).execute(), !0;
638
638
  };
639
639
  }
640
- function Pt(t) {
640
+ function jt(t) {
641
641
  return {
642
642
  create: Ot(t),
643
643
  list: kt(t),
@@ -646,7 +646,7 @@ function Pt(t) {
646
646
  update: It(t)
647
647
  };
648
648
  }
649
- function jt(t) {
649
+ function Pt(t) {
650
650
  return async (e, a) => {
651
651
  const r = {
652
652
  id: S(),
@@ -671,16 +671,16 @@ function Mt(t) {
671
671
  let r = t.selectFrom("connections").where("connections.tenant_id", "=", e);
672
672
  a.q && (r = T(t, r, a.q, ["user_id", "ip"]));
673
673
  const s = (await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute()).map(
674
- (d) => f({
675
- ...d,
676
- options: JSON.parse(d.options)
674
+ (l) => f({
675
+ ...l,
676
+ options: JSON.parse(l.options)
677
677
  })
678
- ), { count: l } = await r.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
678
+ ), { count: d } = await r.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow();
679
679
  return {
680
680
  connections: s,
681
681
  start: a.page * a.per_page,
682
682
  limit: a.per_page,
683
- length: b(l)
683
+ length: b(d)
684
684
  };
685
685
  };
686
686
  }
@@ -710,7 +710,7 @@ function Lt(t) {
710
710
  }
711
711
  function zt(t) {
712
712
  return {
713
- create: jt(t),
713
+ create: Pt(t),
714
714
  get: At(t),
715
715
  list: Mt(t),
716
716
  remove: Ft(t),
@@ -847,8 +847,8 @@ function Xt(t) {
847
847
  colors_primary: n,
848
848
  colors_page_background_type: o,
849
849
  colors_page_background_start: s,
850
- colors_page_background_end: l,
851
- colors_page_background_angle_dev: d,
850
+ colors_page_background_end: d,
851
+ colors_page_background_angle_dev: l,
852
852
  font_url: h,
853
853
  ...m
854
854
  } = a;
@@ -859,8 +859,8 @@ function Xt(t) {
859
859
  page_background: {
860
860
  type: o,
861
861
  start: s,
862
- end: l,
863
- angle_deg: d
862
+ end: d,
863
+ angle_deg: l
864
864
  }
865
865
  },
866
866
  font: h ? { url: h } : void 0
@@ -869,14 +869,14 @@ function Xt(t) {
869
869
  }
870
870
  function Yt(t) {
871
871
  return async (e, a) => {
872
- var s, l, d, h, m, w, x, ee, te, ae, re, ne, oe, se, ie, de, le, ce;
872
+ var s, d, l, h, m, w, x, ee, te, ae, re, ne, oe, se, ie, le, de, ce;
873
873
  const { colors: r, font: n, ...o } = a;
874
874
  try {
875
875
  await t.insertInto("branding").values({
876
876
  ...o,
877
877
  colors_primary: r == null ? void 0 : r.primary,
878
- colors_page_background_type: (l = (s = a.colors) == null ? void 0 : s.page_background) == null ? void 0 : l.type,
879
- colors_page_background_start: (h = (d = a.colors) == null ? void 0 : d.page_background) == null ? void 0 : h.start,
878
+ colors_page_background_type: (d = (s = a.colors) == null ? void 0 : s.page_background) == null ? void 0 : d.type,
879
+ colors_page_background_start: (h = (l = a.colors) == null ? void 0 : l.page_background) == null ? void 0 : h.start,
880
880
  colors_page_background_end: (w = (m = a.colors) == null ? void 0 : m.page_background) == null ? void 0 : w.end,
881
881
  colors_page_background_angle_dev: (ee = (x = a.colors) == null ? void 0 : x.page_background) == null ? void 0 : ee.angle_deg,
882
882
  font_url: (te = a.font) == null ? void 0 : te.url,
@@ -889,7 +889,7 @@ function Yt(t) {
889
889
  colors_page_background_type: (re = (ae = a.colors) == null ? void 0 : ae.page_background) == null ? void 0 : re.type,
890
890
  colors_page_background_start: (oe = (ne = a.colors) == null ? void 0 : ne.page_background) == null ? void 0 : oe.start,
891
891
  colors_page_background_end: (ie = (se = a.colors) == null ? void 0 : se.page_background) == null ? void 0 : ie.end,
892
- colors_page_background_angle_dev: (le = (de = a.colors) == null ? void 0 : de.page_background) == null ? void 0 : le.angle_deg,
892
+ colors_page_background_angle_dev: (de = (le = a.colors) == null ? void 0 : le.page_background) == null ? void 0 : de.angle_deg,
893
893
  font_url: (ce = a.font) == null ? void 0 : ce.url
894
894
  }).where("tenant_id", "=", e).execute();
895
895
  }
@@ -909,10 +909,10 @@ function ea(t) {
909
909
  }) => {
910
910
  let r = t.selectFrom("hooks").where("hooks.tenant_id", "=", e);
911
911
  a.q && (r = T(t, r, a.q, ["url", "form_id"]));
912
- const o = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), { count: s } = await r.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
912
+ const o = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), { count: s } = await r.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow();
913
913
  return {
914
- hooks: o.map((d) => {
915
- const { tenant_id: h, enabled: m, synchronous: w, ...x } = d;
914
+ hooks: o.map((l) => {
915
+ const { tenant_id: h, enabled: m, synchronous: w, ...x } = l;
916
916
  return f({
917
917
  ...x,
918
918
  enabled: !!m,
@@ -982,21 +982,21 @@ function sa(t) {
982
982
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
983
983
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
984
984
  };
985
- return await t.insertInto("themes").values({ ...j(r), tenant_id: e }).execute(), r;
985
+ return await t.insertInto("themes").values({ ...P(r), tenant_id: e }).execute(), r;
986
986
  };
987
987
  }
988
988
  function ia(t) {
989
989
  return async (e, a) => (await t.deleteFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", a).executeTakeFirst()).numDeletedRows > 0;
990
990
  }
991
- function da(t) {
991
+ function la(t) {
992
992
  return async (e, a) => {
993
993
  const r = await t.selectFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", a).selectAll().executeTakeFirst();
994
994
  return r ? f(r) : null;
995
995
  };
996
996
  }
997
- function la(t) {
997
+ function da(t) {
998
998
  return async (e, a, r) => {
999
- const n = j({
999
+ const n = P({
1000
1000
  ...r,
1001
1001
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
1002
1002
  });
@@ -1006,9 +1006,9 @@ function la(t) {
1006
1006
  function ca(t) {
1007
1007
  return {
1008
1008
  create: sa(t),
1009
- get: da(t),
1009
+ get: la(t),
1010
1010
  remove: ia(t),
1011
- update: la(t)
1011
+ update: da(t)
1012
1012
  };
1013
1013
  }
1014
1014
  function ua(t) {
@@ -1037,14 +1037,14 @@ function ma(t) {
1037
1037
  login_completed: !!a.login_completed
1038
1038
  };
1039
1039
  return await t.insertInto("login_sessions").values({
1040
- ...j(r),
1040
+ ...P(r),
1041
1041
  tenant_id: e
1042
1042
  }).execute(), r;
1043
1043
  };
1044
1044
  }
1045
1045
  function ha(t) {
1046
1046
  return async (e, a, r) => (await t.updateTable("login_sessions").set(
1047
- j({
1047
+ P({
1048
1048
  ...r
1049
1049
  })
1050
1050
  ).where("login_sessions.id", "=", a).where("login_sessions.tenant_id", "=", e).execute()).length === 1;
@@ -1109,10 +1109,10 @@ function wa(t) {
1109
1109
  credentials: n,
1110
1110
  settings: o,
1111
1111
  enabled: s,
1112
- ...l
1112
+ ...d
1113
1113
  } = a;
1114
1114
  return f({
1115
- ...l,
1115
+ ...d,
1116
1116
  credentials: JSON.parse(n),
1117
1117
  settings: JSON.parse(o),
1118
1118
  enabled: !!s
@@ -1201,24 +1201,24 @@ function Oa(t) {
1201
1201
  a.q && (r = T(t, r, a.q, ["token", "session_id"]));
1202
1202
  let n = r;
1203
1203
  if (a.sort && a.sort.sort_by) {
1204
- const { ref: d } = t.dynamic;
1204
+ const { ref: l } = t.dynamic;
1205
1205
  n = n.orderBy(
1206
- d(a.sort.sort_by),
1206
+ l(a.sort.sort_by),
1207
1207
  a.sort.sort_order
1208
1208
  );
1209
1209
  }
1210
1210
  n = n.offset(a.page * a.per_page).limit(a.per_page);
1211
- const o = await n.selectAll().execute(), { count: s } = await r.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), l = b(s);
1211
+ const o = await n.selectAll().execute(), { count: s } = await r.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow(), d = b(s);
1212
1212
  return {
1213
- refresh_tokens: o.map((d) => ({
1214
- ...d,
1215
- rotating: !!d.rotating,
1216
- device: d.device ? JSON.parse(d.device) : {},
1217
- resource_servers: d.resource_servers ? JSON.parse(d.resource_servers) : []
1213
+ refresh_tokens: o.map((l) => ({
1214
+ ...l,
1215
+ rotating: !!l.rotating,
1216
+ device: l.device ? JSON.parse(l.device) : {},
1217
+ resource_servers: l.resource_servers ? JSON.parse(l.resource_servers) : []
1218
1218
  })),
1219
1219
  start: a.page * a.per_page,
1220
1220
  limit: a.per_page,
1221
- length: l
1221
+ length: d
1222
1222
  };
1223
1223
  };
1224
1224
  }
@@ -1282,8 +1282,8 @@ function Ia(t) {
1282
1282
  }) => {
1283
1283
  let r = t.selectFrom("forms").where("tenant_id", "=", e);
1284
1284
  a != null && a.q && (r = T(t, r, a.q, []));
1285
- const s = (await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute()).map((d) => {
1286
- const h = { ...d };
1285
+ const s = (await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute()).map((l) => {
1286
+ const h = { ...l };
1287
1287
  if (typeof h.nodes == "string")
1288
1288
  try {
1289
1289
  h.nodes = JSON.parse(h.nodes);
@@ -1300,22 +1300,22 @@ function Ia(t) {
1300
1300
  } catch {
1301
1301
  }
1302
1302
  return K.parse(f(h));
1303
- }), { count: l } = await r.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
1303
+ }), { count: d } = await r.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow();
1304
1304
  return {
1305
1305
  forms: s,
1306
1306
  start: a.page * a.per_page,
1307
1307
  limit: a.per_page,
1308
- length: b(l)
1308
+ length: b(d)
1309
1309
  };
1310
1310
  };
1311
1311
  }
1312
- function Pa(t) {
1312
+ function ja(t) {
1313
1313
  return async (e, a) => {
1314
1314
  const { numDeletedRows: r } = await t.deleteFrom("forms").where("id", "=", a).where("tenant_id", "=", e).executeTakeFirst();
1315
1315
  return r > 0;
1316
1316
  };
1317
1317
  }
1318
- function ja(t) {
1318
+ function Pa(t) {
1319
1319
  return async (e, a) => {
1320
1320
  const r = await t.selectFrom("forms").selectAll().where("forms.id", "=", a).where("tenant_id", "=", e).executeTakeFirst();
1321
1321
  if (!r) return null;
@@ -1352,9 +1352,9 @@ function Ma(t) {
1352
1352
  function Fa(t) {
1353
1353
  return {
1354
1354
  create: Da(t),
1355
- get: ja(t),
1355
+ get: Pa(t),
1356
1356
  list: Ia(t),
1357
- remove: Pa(t),
1357
+ remove: ja(t),
1358
1358
  update: Ma(t)
1359
1359
  };
1360
1360
  }
@@ -2273,15 +2273,15 @@ const Ja = g({
2273
2273
  UpdateQueryNode: !0,
2274
2274
  MergeQueryNode: !0
2275
2275
  });
2276
- var P, O, k, p, ye, we, ve, $, G, Ne;
2276
+ var j, O, k, p, ye, we, ve, $, G, Ne;
2277
2277
  class Ea extends za {
2278
2278
  constructor(a) {
2279
2279
  super();
2280
2280
  y(this, p);
2281
- y(this, P);
2281
+ y(this, j);
2282
2282
  y(this, O, /* @__PURE__ */ new Set());
2283
2283
  y(this, k, /* @__PURE__ */ new Set());
2284
- F(this, P, a);
2284
+ F(this, j, a);
2285
2285
  }
2286
2286
  transformNodeImpl(a) {
2287
2287
  if (!u(this, p, ye).call(this, a))
@@ -2303,18 +2303,18 @@ class Ea extends za {
2303
2303
  const r = super.transformSchemableIdentifier(a);
2304
2304
  return r.schema || !c(this, O).has(a.identifier.name) ? r : {
2305
2305
  ...r,
2306
- schema: E.create(c(this, P))
2306
+ schema: E.create(c(this, j))
2307
2307
  };
2308
2308
  }
2309
2309
  transformReferences(a) {
2310
2310
  const r = super.transformReferences(a);
2311
2311
  return r.table.table.schema ? r : {
2312
2312
  ...r,
2313
- table: B.createWithSchema(c(this, P), r.table.table.identifier.name)
2313
+ table: B.createWithSchema(c(this, j), r.table.table.identifier.name)
2314
2314
  };
2315
2315
  }
2316
2316
  }
2317
- P = new WeakMap(), O = new WeakMap(), k = new WeakMap(), p = new WeakSet(), ye = function(a) {
2317
+ j = new WeakMap(), O = new WeakMap(), k = new WeakMap(), p = new WeakSet(), ye = function(a) {
2318
2318
  return a.kind in Ja;
2319
2319
  }, we = function(a) {
2320
2320
  const r = /* @__PURE__ */ new Set();
@@ -2363,7 +2363,7 @@ class Ra {
2363
2363
  }
2364
2364
  }
2365
2365
  const Ua = "kysely_migration", fe = "kysely_migration_lock", Ba = !1, Q = "migration_lock", Qa = g({ __noMigrations__: !0 });
2366
- var _, i, A, v, N, D, be, C, xe, Te, Se, Oe, ke, H, I, X, $e, De, Ie, Y, Pe, je, Me, Fe, Ae, L;
2366
+ var _, i, A, v, N, D, be, C, xe, Te, Se, Oe, ke, H, I, X, $e, De, Ie, Y, je, Pe, Me, Fe, Ae, L;
2367
2367
  class Ce {
2368
2368
  constructor(e) {
2369
2369
  y(this, i);
@@ -2463,9 +2463,9 @@ class Ce {
2463
2463
  return u(this, i, A).call(this, ({ migrations: a, executedMigrations: r, pendingMigrations: n }) => {
2464
2464
  if (e === Qa)
2465
2465
  return { direction: "Down", step: 1 / 0 };
2466
- if (!a.find((l) => l.name === e))
2466
+ if (!a.find((d) => d.name === e))
2467
2467
  throw new Error(`migration "${e}" doesn't exist`);
2468
- const o = r.indexOf(e), s = n.findIndex((l) => l.name === e);
2468
+ const o = r.indexOf(e), s = n.findIndex((d) => d.name === e);
2469
2469
  if (o !== -1)
2470
2470
  return {
2471
2471
  direction: "Down",
@@ -2581,16 +2581,16 @@ _ = new WeakMap(), i = new WeakSet(), A = async function(e) {
2581
2581
  const s = await u(this, i, De).call(this, o);
2582
2582
  if (s.migrations.length === 0)
2583
2583
  return { results: [] };
2584
- const { direction: l, step: d } = e(s);
2585
- return d <= 0 ? { results: [] } : l === "Down" ? await u(this, i, Fe).call(this, o, s, d) : l === "Up" ? await u(this, i, Ae).call(this, o, s, d) : { results: [] };
2584
+ const { direction: d, step: l } = e(s);
2585
+ return l <= 0 ? { results: [] } : d === "Down" ? await u(this, i, Fe).call(this, o, s, l) : d === "Up" ? await u(this, i, Ae).call(this, o, s, l) : { results: [] };
2586
2586
  } finally {
2587
2587
  await a.releaseMigrationLock(o, r);
2588
2588
  }
2589
2589
  };
2590
2590
  return a.supportsTransactionalDdl ? c(this, _).db.transaction().execute(n) : c(this, _).db.connection().execute(n);
2591
2591
  }, De = async function(e) {
2592
- const a = await u(this, i, Y).call(this), r = await u(this, i, Pe).call(this, e);
2593
- u(this, i, je).call(this, a, r), c(this, i, be) || u(this, i, Me).call(this, a, r);
2592
+ const a = await u(this, i, Y).call(this), r = await u(this, i, je).call(this, e);
2593
+ u(this, i, Pe).call(this, a, r), c(this, i, be) || u(this, i, Me).call(this, a, r);
2594
2594
  const n = u(this, i, Ie).call(this, a, r);
2595
2595
  return g({
2596
2596
  migrations: a,
@@ -2606,9 +2606,9 @@ _ = new WeakMap(), i = new WeakSet(), A = async function(e) {
2606
2606
  ...e[a],
2607
2607
  name: a
2608
2608
  }));
2609
- }, Pe = async function(e) {
2609
+ }, je = async function(e) {
2610
2610
  return (await e.withPlugin(c(this, i, C)).selectFrom(c(this, i, N)).select("name").orderBy(["timestamp", "name"]).execute()).map((r) => r.name);
2611
- }, je = function(e, a) {
2611
+ }, Pe = function(e, a) {
2612
2612
  for (const r of a)
2613
2613
  if (!e.some((n) => n.name === r))
2614
2614
  throw new Error(`corrupted migrations: previously executed migration ${r} is missing`);
@@ -2617,26 +2617,26 @@ _ = new WeakMap(), i = new WeakSet(), A = async function(e) {
2617
2617
  if (e[r].name !== a[r])
2618
2618
  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.`);
2619
2619
  }, Fe = async function(e, a, r) {
2620
- const n = a.executedMigrations.slice().reverse().slice(0, r).map((s) => a.migrations.find((l) => l.name === s)), o = n.map((s) => ({
2620
+ const n = a.executedMigrations.slice().reverse().slice(0, r).map((s) => a.migrations.find((d) => d.name === s)), o = n.map((s) => ({
2621
2621
  migrationName: s.name,
2622
2622
  direction: "Down",
2623
2623
  status: "NotExecuted"
2624
2624
  }));
2625
2625
  for (let s = 0; s < o.length; ++s) {
2626
- const l = n[s];
2626
+ const d = n[s];
2627
2627
  try {
2628
- l.down && (await l.down(e), await e.withPlugin(c(this, i, C)).deleteFrom(c(this, i, N)).where("name", "=", l.name).execute(), o[s] = {
2629
- migrationName: l.name,
2628
+ d.down && (await d.down(e), await e.withPlugin(c(this, i, C)).deleteFrom(c(this, i, N)).where("name", "=", d.name).execute(), o[s] = {
2629
+ migrationName: d.name,
2630
2630
  direction: "Down",
2631
2631
  status: "Success"
2632
2632
  });
2633
- } catch (d) {
2633
+ } catch (l) {
2634
2634
  throw o[s] = {
2635
- migrationName: l.name,
2635
+ migrationName: d.name,
2636
2636
  direction: "Down",
2637
2637
  status: "Error"
2638
2638
  }, new q({
2639
- error: d,
2639
+ error: l,
2640
2640
  results: o
2641
2641
  });
2642
2642
  }
@@ -2649,23 +2649,23 @@ _ = new WeakMap(), i = new WeakSet(), A = async function(e) {
2649
2649
  status: "NotExecuted"
2650
2650
  }));
2651
2651
  for (let s = 0; s < o.length; s++) {
2652
- const l = a.pendingMigrations[s];
2652
+ const d = a.pendingMigrations[s];
2653
2653
  try {
2654
- await l.up(e), await e.withPlugin(c(this, i, C)).insertInto(c(this, i, N)).values({
2655
- name: l.name,
2654
+ await d.up(e), await e.withPlugin(c(this, i, C)).insertInto(c(this, i, N)).values({
2655
+ name: d.name,
2656
2656
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
2657
2657
  }).execute(), o[s] = {
2658
- migrationName: l.name,
2658
+ migrationName: d.name,
2659
2659
  direction: "Up",
2660
2660
  status: "Success"
2661
2661
  };
2662
- } catch (d) {
2662
+ } catch (l) {
2663
2663
  throw o[s] = {
2664
- migrationName: l.name,
2664
+ migrationName: d.name,
2665
2665
  direction: "Up",
2666
2666
  status: "Error"
2667
2667
  }, new q({
2668
- error: d,
2668
+ error: l,
2669
2669
  results: o
2670
2670
  });
2671
2671
  }
@@ -2846,12 +2846,12 @@ async function ir(t) {
2846
2846
  (e) => e.references("applications.id").onDelete("cascade").notNull()
2847
2847
  ).addColumn("code", "varchar(255)", (e) => e.notNull()).addColumn("email", "varchar(255)", (e) => e.notNull()).addColumn("user_id", "varchar(255)").addColumn("send", "varchar(255)").addColumn("nonce", "varchar(255)").addColumn("state", "varchar(1024)").addColumn("scope", "varchar(1024)").addColumn("response_type", "varchar(256)").addColumn("response_mode", "varchar(256)").addColumn("redirect_uri", "varchar(1024)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute(), await t.schema.createIndex("otps_email_index").on("otps").column("email").execute(), await t.schema.createIndex("otps_expires_at_index").on("otps").column("expires_at").execute();
2848
2848
  }
2849
- async function dr(t) {
2849
+ async function lr(t) {
2850
2850
  await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("tickets").execute(), await t.schema.dropTable("otps").execute();
2851
2851
  }
2852
- const lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2852
+ const dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2853
2853
  __proto__: null,
2854
- down: dr,
2854
+ down: lr,
2855
2855
  up: ir
2856
2856
  }, Symbol.toStringTag, { value: "Module" }));
2857
2857
  async function cr(t) {
@@ -2943,12 +2943,12 @@ const Dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2943
2943
  async function Ir(t) {
2944
2944
  await t.schema.alterTable("users").addColumn("profileData", "varchar(2048)").execute();
2945
2945
  }
2946
- async function Pr(t) {
2946
+ async function jr(t) {
2947
2947
  await t.schema.alterTable("users").dropColumn("profileData").execute();
2948
2948
  }
2949
- const jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2949
+ const Pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2950
2950
  __proto__: null,
2951
- down: Pr,
2951
+ down: jr,
2952
2952
  up: Ir
2953
2953
  }, Symbol.toStringTag, { value: "Module" }));
2954
2954
  async function Mr(t) {
@@ -3048,16 +3048,16 @@ const sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3048
3048
  down: on,
3049
3049
  up: nn
3050
3050
  }, Symbol.toStringTag, { value: "Module" }));
3051
- async function dn(t) {
3051
+ async function ln(t) {
3052
3052
  await t.schema.createIndex("logs_user_id").on("logs").column("user_id").execute(), await t.schema.createIndex("logs_tenant_id").on("logs").column("tenant_id").execute(), await t.schema.createIndex("logs_date").on("logs").column("date").execute();
3053
3053
  }
3054
- async function ln(t) {
3054
+ async function dn(t) {
3055
3055
  await t.schema.dropIndex("logs_user_id"), await t.schema.dropIndex("logs_tenant_id"), await t.schema.dropIndex("logs_date");
3056
3056
  }
3057
3057
  const cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3058
3058
  __proto__: null,
3059
- down: ln,
3060
- up: dn
3059
+ down: dn,
3060
+ up: ln
3061
3061
  }, Symbol.toStringTag, { value: "Module" }));
3062
3062
  async function un(t) {
3063
3063
  await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(8192)").execute();
@@ -3139,14 +3139,14 @@ const In = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3139
3139
  down: Dn,
3140
3140
  up: $n
3141
3141
  }, Symbol.toStringTag, { value: "Module" }));
3142
- async function Pn(t) {
3143
- }
3144
3142
  async function jn(t) {
3145
3143
  }
3144
+ async function Pn(t) {
3145
+ }
3146
3146
  const Mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3147
3147
  __proto__: null,
3148
- down: jn,
3149
- up: Pn
3148
+ down: Pn,
3149
+ up: jn
3150
3150
  }, Symbol.toStringTag, { value: "Module" }));
3151
3151
  async function Fn(t) {
3152
3152
  }
@@ -3346,12 +3346,12 @@ async function Do(t) {
3346
3346
  }
3347
3347
  async function Io(t) {
3348
3348
  }
3349
- const Po = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3349
+ const jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3350
3350
  __proto__: null,
3351
3351
  down: Io,
3352
3352
  up: Do
3353
3353
  }, Symbol.toStringTag, { value: "Module" }));
3354
- async function jo(t) {
3354
+ async function Po(t) {
3355
3355
  await t.schema.alterTable("logins").addColumn("authParams_nonce", "varchar(255)").execute();
3356
3356
  }
3357
3357
  async function Mo(t) {
@@ -3360,7 +3360,7 @@ async function Mo(t) {
3360
3360
  const Fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3361
3361
  __proto__: null,
3362
3362
  down: Mo,
3363
- up: jo
3363
+ up: Po
3364
3364
  }, Symbol.toStringTag, { value: "Module" }));
3365
3365
  async function Ao(t) {
3366
3366
  }
@@ -3501,19 +3501,19 @@ async function ss(t) {
3501
3501
  }
3502
3502
  async function is(t) {
3503
3503
  }
3504
- const ds = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3504
+ const ls = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3505
3505
  __proto__: null,
3506
3506
  down: is,
3507
3507
  up: ss
3508
3508
  }, Symbol.toStringTag, { value: "Module" }));
3509
- async function ls(t) {
3509
+ async function ds(t) {
3510
3510
  }
3511
3511
  async function cs(t) {
3512
3512
  }
3513
3513
  const us = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3514
3514
  __proto__: null,
3515
3515
  down: cs,
3516
- up: ls
3516
+ up: ds
3517
3517
  }, Symbol.toStringTag, { value: "Module" }));
3518
3518
  async function ms(t) {
3519
3519
  await t.schema.alterTable("logins").addColumn("authParams_ui_locales", "varchar(32)").execute();
@@ -3601,12 +3601,12 @@ async function Is(t) {
3601
3601
  (e) => e.references("applications.id").onDelete("cascade").notNull()
3602
3602
  ).addColumn("email", "varchar(255)", (e) => e.notNull()).addColumn("nonce", "varchar(255)").addColumn("state", "varchar(1024)").addColumn("scope", "varchar(1024)").addColumn("response_type", "varchar(256)").addColumn("response_mode", "varchar(256)").addColumn("redirect_uri", "varchar(1024)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute();
3603
3603
  }
3604
- const Ps = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3604
+ const js = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3605
3605
  __proto__: null,
3606
3606
  down: Is,
3607
3607
  up: Ds
3608
3608
  }, Symbol.toStringTag, { value: "Module" }));
3609
- async function js(t) {
3609
+ async function Ps(t) {
3610
3610
  }
3611
3611
  async function Ms(t) {
3612
3612
  await t.schema.alterTable("logins").dropColumn("ip").dropColumn("useragent").execute();
@@ -3614,7 +3614,7 @@ async function Ms(t) {
3614
3614
  const Fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3615
3615
  __proto__: null,
3616
3616
  down: Ms,
3617
- up: js
3617
+ up: Ps
3618
3618
  }, Symbol.toStringTag, { value: "Module" }));
3619
3619
  async function As(t) {
3620
3620
  await t.schema.createTable("refresh_tokens").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn(
@@ -3783,12 +3783,12 @@ async function si(t) {
3783
3783
  async function ii(t) {
3784
3784
  await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("login_sessions").execute(), await t.schema.dropTable("refresh_tokens").execute();
3785
3785
  }
3786
- const di = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3786
+ const li = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3787
3787
  __proto__: null,
3788
3788
  down: ii,
3789
3789
  up: si
3790
3790
  }, Symbol.toStringTag, { value: "Module" }));
3791
- async function li(t) {
3791
+ async function di(t) {
3792
3792
  await t.schema.dropTable("logins").execute(), await t.schema.dropTable("sessions_2").execute(), await t.schema.dropTable("refresh_tokens_2").execute();
3793
3793
  }
3794
3794
  async function ci(t) {
@@ -3796,7 +3796,7 @@ async function ci(t) {
3796
3796
  const ui = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3797
3797
  __proto__: null,
3798
3798
  down: ci,
3799
- up: li
3799
+ up: di
3800
3800
  }, Symbol.toStringTag, { value: "Module" }));
3801
3801
  async function mi(t) {
3802
3802
  await t.schema.dropTable("custom_domains").execute(), await t.schema.createTable("custom_domains").addColumn(
@@ -3862,13 +3862,28 @@ const Si = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3862
3862
  __proto__: null,
3863
3863
  down: Ti,
3864
3864
  up: xi
3865
+ }, Symbol.toStringTag, { value: "Module" }));
3866
+ async function Oi(t) {
3867
+ await t.schema.alterTable("sessions").addColumn(
3868
+ "login_session_id",
3869
+ "varchar(21)",
3870
+ (e) => e.references("login_sessions.id").onDelete("set null")
3871
+ ).execute();
3872
+ }
3873
+ async function ki(t) {
3874
+ await t.schema.alterTable("sessions").dropColumn("login_session_id").execute();
3875
+ }
3876
+ const $i = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3877
+ __proto__: null,
3878
+ down: ki,
3879
+ up: Oi
3865
3880
  }, Symbol.toStringTag, { value: "Module" })), ze = {
3866
3881
  m1_init: Wa,
3867
3882
  m2_magicLink: Xa,
3868
3883
  m3_updateAt: er,
3869
3884
  m4_logTable: rr,
3870
3885
  m5_userProfile: sr,
3871
- m6_sessions: lr,
3886
+ m6_sessions: dr,
3872
3887
  m7_passwords: mr,
3873
3888
  m8_logsTableNewFields: fr,
3874
3889
  m9_passwordTableNewField: yr,
@@ -3876,7 +3891,7 @@ const Si = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3876
3891
  n11_universalLoginSession: xr,
3877
3892
  n12_userFields: Or,
3878
3893
  n13_userEmailIndex: Dr,
3879
- n14_profileDataField: jr,
3894
+ n14_profileDataField: Pr,
3880
3895
  n15_userEmailIndex: Ar,
3881
3896
  n16_userLocale: Jr,
3882
3897
  n17_signingKeys: Rr,
@@ -3911,7 +3926,7 @@ const Si = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3911
3926
  n46_loginAuth0Client: bo,
3912
3927
  n47_loginAuth0Client: So,
3913
3928
  n48_saml: $o,
3914
- n49_removeFields: Po,
3929
+ n49_removeFields: jo,
3915
3930
  n50_authParamsNonce: Fo,
3916
3931
  n51_connectionid: zo,
3917
3932
  n52_cert: Ko,
@@ -3921,7 +3936,7 @@ const Si = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3921
3936
  n56_application_fields: Zo,
3922
3937
  n57_prompt_settings: as,
3923
3938
  n58_connection_client_id: os,
3924
- n59_connection_options: ds,
3939
+ n59_connection_options: ls,
3925
3940
  n60_users_metadata: us,
3926
3941
  n61_userLocales: _s,
3927
3942
  n62_prompt: gs,
@@ -3929,7 +3944,7 @@ const Si = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3929
3944
  n64_act_as: bs,
3930
3945
  n65_code_verifier: Ss,
3931
3946
  n66_email_providers: $s,
3932
- n67_drop_tickets: Ps,
3947
+ n67_drop_tickets: js,
3933
3948
  n68_login_useragents: Fs,
3934
3949
  n70_refresh_tokens: zs,
3935
3950
  n71_session_new_fields: Ks,
@@ -3939,15 +3954,16 @@ const Si = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3939
3954
  n75_organizations: Zs,
3940
3955
  n76_authorization_url_length: ai,
3941
3956
  n77_drop_sessions: oi,
3942
- n78_login_sessions: di,
3957
+ n78_login_sessions: li,
3943
3958
  n79_drop_sessions_2: ui,
3944
3959
  n80_recreate_custom_domains: _i,
3945
3960
  n81_phone: gi,
3946
3961
  n82_forms: vi,
3947
3962
  n83_addFormsIdToHooks: bi,
3948
- n84_login_completed: Si
3963
+ n84_login_completed: Si,
3964
+ n85_add_login_session_id_to_sessions: $i
3949
3965
  };
3950
- async function Ii(t, e = !1) {
3966
+ async function Mi(t, e = !1) {
3951
3967
  e && console.log("migrating...");
3952
3968
  const a = new Le(ze), r = new Ce({
3953
3969
  db: t,
@@ -3960,7 +3976,7 @@ async function Ii(t, e = !1) {
3960
3976
  }), n)
3961
3977
  throw console.error("failed to migrate"), console.error(n), n;
3962
3978
  }
3963
- async function Pi(t) {
3979
+ async function Fi(t) {
3964
3980
  console.log("migrating...");
3965
3981
  const e = new Le(ze), a = new Ce({
3966
3982
  db: t,
@@ -3971,9 +3987,9 @@ async function Pi(t) {
3971
3987
  }), r)
3972
3988
  throw console.error("failed to migrate"), console.error(r), r;
3973
3989
  }
3974
- function ji(t) {
3990
+ function Ai(t) {
3975
3991
  return {
3976
- applications: Pt(t),
3992
+ applications: jt(t),
3977
3993
  branding: Zt(t),
3978
3994
  cleanup: $a(t),
3979
3995
  clients: Jt(t),
@@ -3996,7 +4012,7 @@ function ji(t) {
3996
4012
  };
3997
4013
  }
3998
4014
  export {
3999
- ji as default,
4000
- Pi as migrateDown,
4001
- Ii as migrateToLatest
4015
+ Ai as default,
4016
+ Fi as migrateDown,
4017
+ Mi as migrateToLatest
4002
4018
  };