@authhero/kysely-adapter 10.15.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.
@@ -3,15 +3,15 @@ var ue = (t) => {
3
3
  throw TypeError(t);
4
4
  };
5
5
  var Ee = (t, e, a) => e in t ? Je(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a;
6
- var j = (t, e, a) => Ee(t, typeof e != "symbol" ? e + "" : e, a), U = (t, e, a) => e.has(t) || ue("Cannot " + a);
7
- var l = (t, e, a) => (U(t, e, "read from private field"), a ? a.call(t) : e.get(t)), y = (t, e, a) => e.has(t) ? ue("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, a), M = (t, e, a, r) => (U(t, e, "write to private field"), r ? r.call(t, a) : e.set(t, a), a), u = (t, e, a) => (U(t, e, "access private method"), a);
6
+ var M = (t, e, a) => Ee(t, typeof e != "symbol" ? e + "" : e, a), U = (t, e, a) => e.has(t) || ue("Cannot " + a);
7
+ var c = (t, e, a) => (U(t, e, "read from private field"), a ? a.call(t) : e.get(t)), y = (t, e, a) => e.has(t) ? ue("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, a), F = (t, e, a, r) => (U(t, e, "write to private field"), r ? r.call(t, a) : e.set(t, a), a), u = (t, e, a) => (U(t, e, "access private method"), a);
8
8
  import { parseUserId as Z, codeSchema as Ke, connectionSchema as Re, loginSessionSchema as Ue, promptSettingSchema as Be, formSchema as K } from "@authhero/adapter-interfaces";
9
9
  import "@hono/zod-openapi";
10
10
  var V = class extends Error {
11
11
  constructor(e = 500, a) {
12
12
  super(a == null ? void 0 : a.message, { cause: a == null ? void 0 : a.cause });
13
- j(this, "res");
14
- j(this, "status");
13
+ M(this, "res");
14
+ M(this, "status");
15
15
  this.res = a == null ? void 0 : a.res, this.status = e;
16
16
  }
17
17
  getResponse() {
@@ -83,7 +83,7 @@ function qe(t) {
83
83
  ]);
84
84
  if (!r)
85
85
  return null;
86
- const { tenant_id: o, ...s } = r, c = {
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(c);
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("-"), c, d, h, m;
109
- return o.startsWith("-_exists_:") ? (c = o.substring(10), h = !0, s = !0) : o.startsWith("_exists_:") ? (c = o.substring(9), h = !0, s = !1) : o.includes(":") ? (s = o.startsWith("-"), [c, 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 = "=") : (c = null, d = o, h = !1), { key: c, value: d, isNegation: s, isExistsQuery: h, operator: m };
110
- }).forEach(({ key: o, value: s, isNegation: c, 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
- c ? e = e.where(o, "is", null) : e = e.where(o, "is not", null);
114
- else if (c)
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), c = 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 = c.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,18 +186,41 @@ 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 Ge(t) {
190
- if (t.email_verified !== void 0)
191
- return t.email_verified ? 1 : 0;
189
+ function P(t, e = "", a = {}) {
190
+ for (let r in t)
191
+ if (Object.prototype.hasOwnProperty.call(t, r)) {
192
+ const n = e ? `${e}_${r}` : r, o = t[r];
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
+ }
195
+ return a;
196
+ }
197
+ function Ge(t, e) {
198
+ const a = {};
199
+ for (const [r, n] of Object.entries(t)) {
200
+ const o = e.find(
201
+ (s) => r.startsWith(`${s}_`)
202
+ );
203
+ if (!o)
204
+ a[r] = n;
205
+ else {
206
+ const s = r.slice(o.length + 1);
207
+ a[o] = {
208
+ ...a[o],
209
+ [s]: n
210
+ };
211
+ }
212
+ }
213
+ return a;
192
214
  }
193
215
  function He(t) {
194
216
  return async (e, a, r) => {
195
- const n = {
217
+ const n = P({
196
218
  ...r,
197
- email_verified: Ge(r),
198
- updated_at: (/* @__PURE__ */ new Date()).toISOString()
199
- };
200
- return r.app_metadata && (n.app_metadata = JSON.stringify(r.app_metadata)), r.user_metadata && (n.user_metadata = JSON.stringify(r.user_metadata)), (await t.updateTable("users").set(n).where("users.tenant_id", "=", e).where("users.user_id", "=", a).execute()).length === 1;
219
+ updated_at: (/* @__PURE__ */ new Date()).toISOString(),
220
+ app_metadata: r.app_metadata ? JSON.stringify(r.app_metadata) : void 0,
221
+ user_metadata: r.user_metadata ? JSON.stringify(r.user_metadata) : void 0
222
+ });
223
+ return (await t.updateTable("users").set(n).where("users.tenant_id", "=", e).where("users.user_id", "=", a).execute()).length === 1;
201
224
  };
202
225
  }
203
226
  function Xe(t) {
@@ -249,16 +272,16 @@ function at(t) {
249
272
  }) => {
250
273
  let a = t.selectFrom("tenants");
251
274
  if (e.sort && e.sort.sort_by) {
252
- const { ref: c } = t.dynamic;
253
- a = a.orderBy(c(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);
254
277
  }
255
- e.q && (a = a.where((c) => c.or([c("name", "like", `%${e.q}%`)])));
278
+ e.q && (a = a.where((d) => d.or([d("name", "like", `%${e.q}%`)])));
256
279
  const n = await a.offset(e.page * e.per_page).limit(e.per_page).selectAll().execute();
257
280
  if (!e.include_totals)
258
281
  return {
259
282
  tenants: n
260
283
  };
261
- const { count: o } = await a.select((c) => c.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);
262
285
  return {
263
286
  tenants: n.map(f),
264
287
  start: (e.page - 1) * e.per_page,
@@ -335,7 +358,7 @@ function ge(t) {
335
358
  _id: t.id
336
359
  };
337
360
  }
338
- function dt(t) {
361
+ function lt(t) {
339
362
  return async (e, a = {
340
363
  page: 0,
341
364
  per_page: 50,
@@ -345,14 +368,14 @@ function dt(t) {
345
368
  a.q && (r = T(t, r, a.q, ["user_id", "ip"]));
346
369
  let n = r;
347
370
  if (a.sort && a.sort.sort_by) {
348
- const { ref: c } = t.dynamic;
371
+ const { ref: d } = t.dynamic;
349
372
  n = n.orderBy(
350
- c(a.sort.sort_by),
373
+ d(a.sort.sort_by),
351
374
  a.sort.sort_order
352
375
  );
353
376
  }
354
377
  n = n.offset(a.page * a.per_page).limit(a.per_page);
355
- const o = await n.selectAll().execute(), { count: s } = await r.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
378
+ const o = await n.selectAll().execute(), { count: s } = await r.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
356
379
  return {
357
380
  logs: o.map(ge),
358
381
  start: a.page * a.per_page,
@@ -361,17 +384,17 @@ function dt(t) {
361
384
  };
362
385
  };
363
386
  }
364
- function ct(t) {
387
+ function dt(t) {
365
388
  return async (e, a) => {
366
389
  const r = await t.selectFrom("logs").where("logs.tenant_id", "=", e).where("logs.id", "=", a).selectAll().executeTakeFirst();
367
390
  return r ? ge(r) : null;
368
391
  };
369
392
  }
370
- function lt(t) {
393
+ function ct(t) {
371
394
  return {
372
395
  create: it(t),
373
- list: dt(t),
374
- get: ct(t)
396
+ list: lt(t),
397
+ get: dt(t)
375
398
  };
376
399
  }
377
400
  function ut(t) {
@@ -379,9 +402,9 @@ function ut(t) {
379
402
  const r = await t.selectFrom("sessions").where("sessions.tenant_id", "=", e).where("sessions.id", "=", a).selectAll().executeTakeFirst();
380
403
  if (!r)
381
404
  return null;
382
- const { tenant_id: n, device: o, clients: s, ...c } = r;
405
+ const { tenant_id: n, device: o, clients: s, ...d } = r;
383
406
  return {
384
- ...c,
407
+ ...d,
385
408
  device: JSON.parse(o),
386
409
  clients: JSON.parse(s)
387
410
  };
@@ -428,23 +451,23 @@ function ft(t) {
428
451
  a.q && (r = T(t, r, a.q, ["user_id", "session_id"]));
429
452
  let n = r;
430
453
  if (a.sort && a.sort.sort_by) {
431
- const { ref: d } = t.dynamic;
454
+ const { ref: l } = t.dynamic;
432
455
  n = n.orderBy(
433
- d(a.sort.sort_by),
456
+ l(a.sort.sort_by),
434
457
  a.sort.sort_order
435
458
  );
436
459
  }
437
460
  n = n.offset(a.page * a.per_page).limit(a.per_page);
438
- const o = await n.selectAll().execute(), { count: s } = await r.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), c = b(s);
461
+ const o = await n.selectAll().execute(), { count: s } = await r.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow(), d = b(s);
439
462
  return {
440
- sessions: o.map((d) => ({
441
- ...d,
442
- device: JSON.parse(d.device),
443
- clients: JSON.parse(d.clients)
463
+ sessions: o.map((l) => ({
464
+ ...l,
465
+ device: JSON.parse(l.device),
466
+ clients: JSON.parse(l.clients)
444
467
  })),
445
468
  start: a.page * a.per_page,
446
469
  limit: a.per_page,
447
- length: c
470
+ length: d
448
471
  };
449
472
  };
450
473
  }
@@ -500,10 +523,10 @@ function Nt(t) {
500
523
  }) => {
501
524
  let r = t.selectFrom("codes").where("codes.tenant_id", "=", e);
502
525
  a.q && (r = T(t, r, a.q, ["code", "login_id"]));
503
- 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();
504
527
  return {
505
- codes: o.map((d) => {
506
- const { tenant_id: h, ...m } = d;
528
+ codes: o.map((l) => {
529
+ const { tenant_id: h, ...m } = l;
507
530
  return Ke.parse(f(m));
508
531
  }),
509
532
  start: a.page * a.per_page,
@@ -553,7 +576,7 @@ function Ot(t) {
553
576
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
554
577
  updated_at: (/* @__PURE__ */ new Date()).toISOString(),
555
578
  ...a
556
- }, n = JSON.stringify(a.allowed_origins), o = JSON.stringify(a.callbacks), s = JSON.stringify(a.web_origins), c = 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);
557
580
  return await t.insertInto("applications").values({
558
581
  ...r,
559
582
  tenant_id: e,
@@ -562,8 +585,8 @@ function Ot(t) {
562
585
  callbacks: o,
563
586
  allowed_origins: n,
564
587
  web_origins: s,
565
- allowed_logout_urls: c,
566
- allowed_clients: d
588
+ allowed_logout_urls: d,
589
+ allowed_clients: l
567
590
  }).execute(), r;
568
591
  };
569
592
  }
@@ -614,7 +637,7 @@ function It(t) {
614
637
  return await t.updateTable("applications").set(n).where("applications.id", "=", a).where("applications.tenant_id", "=", e).execute(), !0;
615
638
  };
616
639
  }
617
- function Pt(t) {
640
+ function jt(t) {
618
641
  return {
619
642
  create: Ot(t),
620
643
  list: kt(t),
@@ -623,7 +646,7 @@ function Pt(t) {
623
646
  update: It(t)
624
647
  };
625
648
  }
626
- function jt(t) {
649
+ function Pt(t) {
627
650
  return async (e, a) => {
628
651
  const r = {
629
652
  id: S(),
@@ -648,16 +671,16 @@ function Mt(t) {
648
671
  let r = t.selectFrom("connections").where("connections.tenant_id", "=", e);
649
672
  a.q && (r = T(t, r, a.q, ["user_id", "ip"]));
650
673
  const s = (await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute()).map(
651
- (d) => f({
652
- ...d,
653
- options: JSON.parse(d.options)
674
+ (l) => f({
675
+ ...l,
676
+ options: JSON.parse(l.options)
654
677
  })
655
- ), { count: c } = await r.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
678
+ ), { count: d } = await r.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow();
656
679
  return {
657
680
  connections: s,
658
681
  start: a.page * a.per_page,
659
682
  limit: a.per_page,
660
- length: b(c)
683
+ length: b(d)
661
684
  };
662
685
  };
663
686
  }
@@ -687,7 +710,7 @@ function Lt(t) {
687
710
  }
688
711
  function zt(t) {
689
712
  return {
690
- create: jt(t),
713
+ create: Pt(t),
691
714
  get: At(t),
692
715
  list: Mt(t),
693
716
  remove: Ft(t),
@@ -824,8 +847,8 @@ function Xt(t) {
824
847
  colors_primary: n,
825
848
  colors_page_background_type: o,
826
849
  colors_page_background_start: s,
827
- colors_page_background_end: c,
828
- colors_page_background_angle_dev: d,
850
+ colors_page_background_end: d,
851
+ colors_page_background_angle_dev: l,
829
852
  font_url: h,
830
853
  ...m
831
854
  } = a;
@@ -836,8 +859,8 @@ function Xt(t) {
836
859
  page_background: {
837
860
  type: o,
838
861
  start: s,
839
- end: c,
840
- angle_deg: d
862
+ end: d,
863
+ angle_deg: l
841
864
  }
842
865
  },
843
866
  font: h ? { url: h } : void 0
@@ -846,14 +869,14 @@ function Xt(t) {
846
869
  }
847
870
  function Yt(t) {
848
871
  return async (e, a) => {
849
- var s, c, d, h, m, w, x, ee, te, ae, re, ne, oe, se, ie, de, ce, le;
872
+ var s, d, l, h, m, w, x, ee, te, ae, re, ne, oe, se, ie, le, de, ce;
850
873
  const { colors: r, font: n, ...o } = a;
851
874
  try {
852
875
  await t.insertInto("branding").values({
853
876
  ...o,
854
877
  colors_primary: r == null ? void 0 : r.primary,
855
- colors_page_background_type: (c = (s = a.colors) == null ? void 0 : s.page_background) == null ? void 0 : c.type,
856
- 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,
857
880
  colors_page_background_end: (w = (m = a.colors) == null ? void 0 : m.page_background) == null ? void 0 : w.end,
858
881
  colors_page_background_angle_dev: (ee = (x = a.colors) == null ? void 0 : x.page_background) == null ? void 0 : ee.angle_deg,
859
882
  font_url: (te = a.font) == null ? void 0 : te.url,
@@ -866,8 +889,8 @@ function Yt(t) {
866
889
  colors_page_background_type: (re = (ae = a.colors) == null ? void 0 : ae.page_background) == null ? void 0 : re.type,
867
890
  colors_page_background_start: (oe = (ne = a.colors) == null ? void 0 : ne.page_background) == null ? void 0 : oe.start,
868
891
  colors_page_background_end: (ie = (se = a.colors) == null ? void 0 : se.page_background) == null ? void 0 : ie.end,
869
- colors_page_background_angle_dev: (ce = (de = a.colors) == null ? void 0 : de.page_background) == null ? void 0 : ce.angle_deg,
870
- font_url: (le = a.font) == null ? void 0 : le.url
892
+ colors_page_background_angle_dev: (de = (le = a.colors) == null ? void 0 : le.page_background) == null ? void 0 : de.angle_deg,
893
+ font_url: (ce = a.font) == null ? void 0 : ce.url
871
894
  }).where("tenant_id", "=", e).execute();
872
895
  }
873
896
  };
@@ -886,10 +909,10 @@ function ea(t) {
886
909
  }) => {
887
910
  let r = t.selectFrom("hooks").where("hooks.tenant_id", "=", e);
888
911
  a.q && (r = T(t, r, a.q, ["url", "form_id"]));
889
- 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();
890
913
  return {
891
- hooks: o.map((d) => {
892
- 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;
893
916
  return f({
894
917
  ...x,
895
918
  enabled: !!m,
@@ -951,33 +974,7 @@ function oa(t) {
951
974
  remove: aa(t)
952
975
  };
953
976
  }
954
- function J(t, e = "", a = {}) {
955
- for (let r in t)
956
- if (Object.prototype.hasOwnProperty.call(t, r)) {
957
- const n = e ? `${e}_${r}` : r;
958
- typeof t[r] == "object" && t[r] !== null && !Array.isArray(t[r]) ? J(t[r], n, a) : a[n] = t[r];
959
- }
960
- return a;
961
- }
962
- function sa(t, e) {
963
- const a = {};
964
- for (const [r, n] of Object.entries(t)) {
965
- const o = e.find(
966
- (s) => r.startsWith(`${s}_`)
967
- );
968
- if (!o)
969
- a[r] = n;
970
- else {
971
- const s = r.slice(o.length + 1);
972
- a[o] = {
973
- ...a[o],
974
- [s]: n
975
- };
976
- }
977
- }
978
- return a;
979
- }
980
- function ia(t) {
977
+ function sa(t) {
981
978
  return async (e, a) => {
982
979
  const r = {
983
980
  themeId: S(),
@@ -985,44 +982,50 @@ function ia(t) {
985
982
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
986
983
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
987
984
  };
988
- 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;
989
986
  };
990
987
  }
991
- function da(t) {
988
+ function ia(t) {
992
989
  return async (e, a) => (await t.deleteFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", a).executeTakeFirst()).numDeletedRows > 0;
993
990
  }
994
- function ca(t) {
991
+ function la(t) {
995
992
  return async (e, a) => {
996
993
  const r = await t.selectFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", a).selectAll().executeTakeFirst();
997
994
  return r ? f(r) : null;
998
995
  };
999
996
  }
1000
- function la(t) {
997
+ function da(t) {
1001
998
  return async (e, a, r) => {
1002
- const n = J({
999
+ const n = P({
1003
1000
  ...r,
1004
1001
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
1005
1002
  });
1006
1003
  return await t.updateTable("themes").set(n).where("themes.id", "=", a).where("themes.tenant_id", "=", e).execute(), !0;
1007
1004
  };
1008
1005
  }
1009
- function ua(t) {
1006
+ function ca(t) {
1010
1007
  return {
1011
- create: ia(t),
1012
- get: ca(t),
1013
- remove: da(t),
1014
- update: la(t)
1008
+ create: sa(t),
1009
+ get: la(t),
1010
+ remove: ia(t),
1011
+ update: da(t)
1015
1012
  };
1016
1013
  }
1017
- function ma(t) {
1014
+ function ua(t) {
1018
1015
  return async (e, a) => {
1019
1016
  const r = (/* @__PURE__ */ new Date()).toISOString(), n = await t.selectFrom("login_sessions").where("login_sessions.expires_at", ">", r).where("login_sessions.id", "=", a).selectAll().executeTakeFirst();
1020
1017
  return n ? Ue.parse(
1021
- sa(f(n), ["authParams"])
1018
+ Ge(
1019
+ f({
1020
+ ...n,
1021
+ login_completed: !!n.login_completed
1022
+ }),
1023
+ ["authParams"]
1024
+ )
1022
1025
  ) : null;
1023
1026
  };
1024
1027
  }
1025
- function ha(t) {
1028
+ function ma(t) {
1026
1029
  return async (e, a) => {
1027
1030
  var n;
1028
1031
  const r = {
@@ -1030,26 +1033,34 @@ function ha(t) {
1030
1033
  ...a,
1031
1034
  authorization_url: (n = a.authorization_url) == null ? void 0 : n.slice(0, 1024),
1032
1035
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
1033
- updated_at: (/* @__PURE__ */ new Date()).toISOString()
1036
+ updated_at: (/* @__PURE__ */ new Date()).toISOString(),
1037
+ login_completed: !!a.login_completed
1034
1038
  };
1035
- return await t.insertInto("login_sessions").values({ ...J(r), tenant_id: e }).execute(), r;
1039
+ return await t.insertInto("login_sessions").values({
1040
+ ...P(r),
1041
+ tenant_id: e
1042
+ }).execute(), r;
1036
1043
  };
1037
1044
  }
1038
- function _a(t) {
1039
- return async (e, a, r) => (await t.updateTable("login_sessions").set(J(r)).where("login_sessions.id", "=", a).where("login_sessions.tenant_id", "=", e).execute()).length === 1;
1045
+ function ha(t) {
1046
+ return async (e, a, r) => (await t.updateTable("login_sessions").set(
1047
+ P({
1048
+ ...r
1049
+ })
1050
+ ).where("login_sessions.id", "=", a).where("login_sessions.tenant_id", "=", e).execute()).length === 1;
1040
1051
  }
1041
- function fa(t) {
1052
+ function _a(t) {
1042
1053
  return async (e, a) => (await t.deleteFrom("login_sessions").where("login_sessions.tenant_id", "=", e).where("login_sessions.id", "=", a).execute()).length > 0;
1043
1054
  }
1044
- function pa(t) {
1055
+ function fa(t) {
1045
1056
  return {
1046
- create: ha(t),
1047
- get: ma(t),
1048
- update: _a(t),
1049
- remove: fa(t)
1057
+ create: ma(t),
1058
+ get: ua(t),
1059
+ update: ha(t),
1060
+ remove: _a(t)
1050
1061
  };
1051
1062
  }
1052
- function ga(t) {
1063
+ function pa(t) {
1053
1064
  return async (e) => {
1054
1065
  const [a] = await t.selectFrom("prompt_settings").where("prompt_settings.tenant_id", "=", e).selectAll().execute();
1055
1066
  return f({
@@ -1069,7 +1080,7 @@ function _e(t) {
1069
1080
  universal_login_experience: t.universal_login_experience
1070
1081
  });
1071
1082
  }
1072
- function ya(t) {
1083
+ function ga(t) {
1073
1084
  return async (e, a) => {
1074
1085
  try {
1075
1086
  const r = Be.parse(a);
@@ -1082,13 +1093,13 @@ function ya(t) {
1082
1093
  }
1083
1094
  };
1084
1095
  }
1085
- function wa(t) {
1096
+ function ya(t) {
1086
1097
  return {
1087
- get: ga(t),
1088
- set: ya(t)
1098
+ get: pa(t),
1099
+ set: ga(t)
1089
1100
  };
1090
1101
  }
1091
- function va(t) {
1102
+ function wa(t) {
1092
1103
  return async (e) => {
1093
1104
  const [a] = await t.selectFrom("email_providers").where("email_providers.tenant_id", "=", e).selectAll().execute();
1094
1105
  if (!a)
@@ -1098,17 +1109,17 @@ function va(t) {
1098
1109
  credentials: n,
1099
1110
  settings: o,
1100
1111
  enabled: s,
1101
- ...c
1112
+ ...d
1102
1113
  } = a;
1103
1114
  return f({
1104
- ...c,
1115
+ ...d,
1105
1116
  credentials: JSON.parse(n),
1106
1117
  settings: JSON.parse(o),
1107
1118
  enabled: !!s
1108
1119
  });
1109
1120
  };
1110
1121
  }
1111
- function Na(t) {
1122
+ function va(t) {
1112
1123
  return async (e, a) => {
1113
1124
  const { credentials: r, settings: n, enabled: o, ...s } = a;
1114
1125
  await t.updateTable("email_providers").set({
@@ -1119,7 +1130,7 @@ function Na(t) {
1119
1130
  }).where("tenant_id", "=", e).execute();
1120
1131
  };
1121
1132
  }
1122
- function Ca(t) {
1133
+ function Na(t) {
1123
1134
  return async (e, a) => {
1124
1135
  const { credentials: r, settings: n, enabled: o, ...s } = a;
1125
1136
  await t.insertInto("email_providers").values({
@@ -1133,14 +1144,14 @@ function Ca(t) {
1133
1144
  }).execute();
1134
1145
  };
1135
1146
  }
1136
- function ba(t) {
1147
+ function Ca(t) {
1137
1148
  return {
1138
- get: va(t),
1139
- create: Ca(t),
1140
- update: Na(t)
1149
+ get: wa(t),
1150
+ create: Na(t),
1151
+ update: va(t)
1141
1152
  };
1142
1153
  }
1143
- function xa(t) {
1154
+ function ba(t) {
1144
1155
  return async (e, a) => {
1145
1156
  const r = await t.selectFrom("refresh_tokens").where("refresh_tokens.tenant_id", "=", e).where("refresh_tokens.id", "=", a).selectAll().executeTakeFirst();
1146
1157
  return r ? {
@@ -1151,7 +1162,7 @@ function xa(t) {
1151
1162
  } : null;
1152
1163
  };
1153
1164
  }
1154
- function Ta(t) {
1165
+ function xa(t) {
1155
1166
  return async (e, a) => {
1156
1167
  const r = {
1157
1168
  ...a,
@@ -1166,10 +1177,10 @@ function Ta(t) {
1166
1177
  }).execute(), { ...a, ...r };
1167
1178
  };
1168
1179
  }
1169
- function Sa(t) {
1180
+ function Ta(t) {
1170
1181
  return async (e, a) => !!(await t.deleteFrom("refresh_tokens").where("tenant_id", "=", e).where("refresh_tokens.id", "=", a).execute()).length;
1171
1182
  }
1172
- function Oa(t) {
1183
+ function Sa(t) {
1173
1184
  return async (e, a, r) => {
1174
1185
  const n = {
1175
1186
  ...r,
@@ -1180,7 +1191,7 @@ function Oa(t) {
1180
1191
  return !!(await t.updateTable("refresh_tokens").set(n).where("tenant_id", "=", e).where("refresh_tokens.id", "=", a).execute()).length;
1181
1192
  };
1182
1193
  }
1183
- function ka(t) {
1194
+ function Oa(t) {
1184
1195
  return async (e, a = {
1185
1196
  page: 0,
1186
1197
  per_page: 50,
@@ -1190,37 +1201,37 @@ function ka(t) {
1190
1201
  a.q && (r = T(t, r, a.q, ["token", "session_id"]));
1191
1202
  let n = r;
1192
1203
  if (a.sort && a.sort.sort_by) {
1193
- const { ref: d } = t.dynamic;
1204
+ const { ref: l } = t.dynamic;
1194
1205
  n = n.orderBy(
1195
- d(a.sort.sort_by),
1206
+ l(a.sort.sort_by),
1196
1207
  a.sort.sort_order
1197
1208
  );
1198
1209
  }
1199
1210
  n = n.offset(a.page * a.per_page).limit(a.per_page);
1200
- const o = await n.selectAll().execute(), { count: s } = await r.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), c = b(s);
1211
+ const o = await n.selectAll().execute(), { count: s } = await r.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow(), d = b(s);
1201
1212
  return {
1202
- refresh_tokens: o.map((d) => ({
1203
- ...d,
1204
- rotating: !!d.rotating,
1205
- device: d.device ? JSON.parse(d.device) : {},
1206
- 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) : []
1207
1218
  })),
1208
1219
  start: a.page * a.per_page,
1209
1220
  limit: a.per_page,
1210
- length: c
1221
+ length: d
1211
1222
  };
1212
1223
  };
1213
1224
  }
1214
- function $a(t) {
1225
+ function ka(t) {
1215
1226
  return {
1216
- create: Ta(t),
1217
- get: xa(t),
1218
- list: ka(t),
1219
- remove: Sa(t),
1220
- update: Oa(t)
1227
+ create: xa(t),
1228
+ get: ba(t),
1229
+ list: Oa(t),
1230
+ remove: Ta(t),
1231
+ update: Sa(t)
1221
1232
  };
1222
1233
  }
1223
- function Da(t) {
1234
+ function $a(t) {
1224
1235
  return async () => {
1225
1236
  const e = new Date(Date.now() - 864e5).toISOString(), a = new Date(
1226
1237
  Date.now() - 1e3 * 60 * 60 * 24 * 7
@@ -1245,7 +1256,7 @@ function Da(t) {
1245
1256
  ).execute(), console.log("cleanup complete");
1246
1257
  };
1247
1258
  }
1248
- function Ia(t) {
1259
+ function Da(t) {
1249
1260
  return async (e, a) => {
1250
1261
  const r = K.parse({
1251
1262
  id: S(),
@@ -1263,7 +1274,7 @@ function Ia(t) {
1263
1274
  }).execute(), K.parse(r);
1264
1275
  };
1265
1276
  }
1266
- function Pa(t) {
1277
+ function Ia(t) {
1267
1278
  return async (e, a = {
1268
1279
  page: 0,
1269
1280
  per_page: 50,
@@ -1271,8 +1282,8 @@ function Pa(t) {
1271
1282
  }) => {
1272
1283
  let r = t.selectFrom("forms").where("tenant_id", "=", e);
1273
1284
  a != null && a.q && (r = T(t, r, a.q, []));
1274
- const s = (await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute()).map((d) => {
1275
- 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 };
1276
1287
  if (typeof h.nodes == "string")
1277
1288
  try {
1278
1289
  h.nodes = JSON.parse(h.nodes);
@@ -1289,12 +1300,12 @@ function Pa(t) {
1289
1300
  } catch {
1290
1301
  }
1291
1302
  return K.parse(f(h));
1292
- }), { count: c } = await r.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
1303
+ }), { count: d } = await r.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow();
1293
1304
  return {
1294
1305
  forms: s,
1295
1306
  start: a.page * a.per_page,
1296
1307
  limit: a.per_page,
1297
- length: b(c)
1308
+ length: b(d)
1298
1309
  };
1299
1310
  };
1300
1311
  }
@@ -1304,7 +1315,7 @@ function ja(t) {
1304
1315
  return r > 0;
1305
1316
  };
1306
1317
  }
1307
- function Ma(t) {
1318
+ function Pa(t) {
1308
1319
  return async (e, a) => {
1309
1320
  const r = await t.selectFrom("forms").selectAll().where("forms.id", "=", a).where("tenant_id", "=", e).executeTakeFirst();
1310
1321
  if (!r) return null;
@@ -1327,7 +1338,7 @@ function Ma(t) {
1327
1338
  return K.parse(f(n));
1328
1339
  };
1329
1340
  }
1330
- function Fa(t) {
1341
+ function Ma(t) {
1331
1342
  return async (e, a, r) => {
1332
1343
  const n = {
1333
1344
  ...r,
@@ -1338,16 +1349,16 @@ function Fa(t) {
1338
1349
  return o > 0;
1339
1350
  };
1340
1351
  }
1341
- function Aa(t) {
1352
+ function Fa(t) {
1342
1353
  return {
1343
- create: Ia(t),
1344
- get: Ma(t),
1345
- list: Pa(t),
1354
+ create: Da(t),
1355
+ get: Pa(t),
1356
+ list: Ia(t),
1346
1357
  remove: ja(t),
1347
- update: Fa(t)
1358
+ update: Ma(t)
1348
1359
  };
1349
1360
  }
1350
- function La(t) {
1361
+ function Aa(t) {
1351
1362
  return t[t.length - 1];
1352
1363
  }
1353
1364
  function g(t) {
@@ -1380,7 +1391,7 @@ const E = g({
1380
1391
  identifier: E.create(e)
1381
1392
  });
1382
1393
  }
1383
- }), za = g({
1394
+ }), La = g({
1384
1395
  is(t) {
1385
1396
  return t.kind === "AliasNode";
1386
1397
  },
@@ -1409,9 +1420,9 @@ const E = g({
1409
1420
  }
1410
1421
  });
1411
1422
  var R;
1412
- class Ja {
1423
+ class za {
1413
1424
  constructor() {
1414
- j(this, "nodeStack", []);
1425
+ M(this, "nodeStack", []);
1415
1426
  y(this, R, g({
1416
1427
  AliasNode: this.transformAlias.bind(this),
1417
1428
  ColumnNode: this.transformColumn.bind(this),
@@ -1516,7 +1527,7 @@ class Ja {
1516
1527
  return this.nodeStack.pop(), g(a);
1517
1528
  }
1518
1529
  transformNodeImpl(e) {
1519
- return l(this, R)[e.kind](e);
1530
+ return c(this, R)[e.kind](e);
1520
1531
  }
1521
1532
  transformNodeList(e) {
1522
1533
  return e && g(e.map((a) => this.transformNode(a)));
@@ -2243,7 +2254,7 @@ class Ja {
2243
2254
  }
2244
2255
  }
2245
2256
  R = new WeakMap();
2246
- const Ea = g({
2257
+ const Ja = g({
2247
2258
  AlterTableNode: !0,
2248
2259
  CreateIndexNode: !0,
2249
2260
  CreateSchemaNode: !0,
@@ -2262,49 +2273,49 @@ const Ea = g({
2262
2273
  UpdateQueryNode: !0,
2263
2274
  MergeQueryNode: !0
2264
2275
  });
2265
- var P, O, k, p, ye, we, ve, $, G, Ne;
2266
- class Ka extends Ja {
2276
+ var j, O, k, p, ye, we, ve, $, G, Ne;
2277
+ class Ea extends za {
2267
2278
  constructor(a) {
2268
2279
  super();
2269
2280
  y(this, p);
2270
- y(this, P);
2281
+ y(this, j);
2271
2282
  y(this, O, /* @__PURE__ */ new Set());
2272
2283
  y(this, k, /* @__PURE__ */ new Set());
2273
- M(this, P, a);
2284
+ F(this, j, a);
2274
2285
  }
2275
2286
  transformNodeImpl(a) {
2276
2287
  if (!u(this, p, ye).call(this, a))
2277
2288
  return super.transformNodeImpl(a);
2278
2289
  const r = u(this, p, ve).call(this, a);
2279
2290
  for (const s of r)
2280
- l(this, k).add(s);
2291
+ c(this, k).add(s);
2281
2292
  const n = u(this, p, we).call(this, a);
2282
2293
  for (const s of n)
2283
- l(this, O).add(s);
2294
+ c(this, O).add(s);
2284
2295
  const o = super.transformNodeImpl(a);
2285
2296
  for (const s of n)
2286
- l(this, O).delete(s);
2297
+ c(this, O).delete(s);
2287
2298
  for (const s of r)
2288
- l(this, k).delete(s);
2299
+ c(this, k).delete(s);
2289
2300
  return o;
2290
2301
  }
2291
2302
  transformSchemableIdentifier(a) {
2292
2303
  const r = super.transformSchemableIdentifier(a);
2293
- return r.schema || !l(this, O).has(a.identifier.name) ? r : {
2304
+ return r.schema || !c(this, O).has(a.identifier.name) ? r : {
2294
2305
  ...r,
2295
- schema: E.create(l(this, P))
2306
+ schema: E.create(c(this, j))
2296
2307
  };
2297
2308
  }
2298
2309
  transformReferences(a) {
2299
2310
  const r = super.transformReferences(a);
2300
2311
  return r.table.table.schema ? r : {
2301
2312
  ...r,
2302
- table: B.createWithSchema(l(this, P), r.table.table.identifier.name)
2313
+ table: B.createWithSchema(c(this, j), r.table.table.identifier.name)
2303
2314
  };
2304
2315
  }
2305
2316
  }
2306
- P = new WeakMap(), O = new WeakMap(), k = new WeakMap(), p = new WeakSet(), ye = function(a) {
2307
- return a.kind in Ea;
2317
+ j = new WeakMap(), O = new WeakMap(), k = new WeakMap(), p = new WeakSet(), ye = function(a) {
2318
+ return a.kind in Ja;
2308
2319
  }, we = function(a) {
2309
2320
  const r = /* @__PURE__ */ new Set();
2310
2321
  if ("name" in a && a.name && W.is(a.name) && u(this, p, G).call(this, a.name, r), "from" in a && a.from)
@@ -2318,32 +2329,32 @@ P = new WeakMap(), O = new WeakMap(), k = new WeakMap(), p = new WeakSet(), ye =
2318
2329
  const r = /* @__PURE__ */ new Set();
2319
2330
  return "with" in a && a.with && u(this, p, Ne).call(this, a.with, r), r;
2320
2331
  }, $ = function(a, r) {
2321
- const n = B.is(a) ? a : za.is(a) && B.is(a.node) ? a.node : null;
2332
+ const n = B.is(a) ? a : La.is(a) && B.is(a.node) ? a.node : null;
2322
2333
  n && u(this, p, G).call(this, n.table, r);
2323
2334
  }, G = function(a, r) {
2324
2335
  const n = a.identifier.name;
2325
- !l(this, O).has(n) && !l(this, k).has(n) && r.add(n);
2336
+ !c(this, O).has(n) && !c(this, k).has(n) && r.add(n);
2326
2337
  }, Ne = function(a, r) {
2327
2338
  for (const n of a.expressions) {
2328
2339
  const o = n.name.table.table.identifier.name;
2329
- l(this, k).has(o) || r.add(o);
2340
+ c(this, k).has(o) || r.add(o);
2330
2341
  }
2331
2342
  };
2332
- var L;
2333
- class Ra {
2343
+ var z;
2344
+ class Ka {
2334
2345
  constructor(e) {
2335
- y(this, L);
2336
- M(this, L, new Ka(e));
2346
+ y(this, z);
2347
+ F(this, z, new Ea(e));
2337
2348
  }
2338
2349
  transformQuery(e) {
2339
- return l(this, L).transformNode(e.node);
2350
+ return c(this, z).transformNode(e.node);
2340
2351
  }
2341
2352
  async transformResult(e) {
2342
2353
  return e.result;
2343
2354
  }
2344
2355
  }
2345
- L = new WeakMap();
2346
- class Ua {
2356
+ z = new WeakMap();
2357
+ class Ra {
2347
2358
  transformQuery(e) {
2348
2359
  return e.node;
2349
2360
  }
@@ -2351,13 +2362,13 @@ class Ua {
2351
2362
  return e.result;
2352
2363
  }
2353
2364
  }
2354
- const Ba = "kysely_migration", fe = "kysely_migration_lock", Qa = !1, Q = "migration_lock", qa = g({ __noMigrations__: !0 });
2355
- var _, i, F, v, N, D, be, C, xe, Te, Se, Oe, ke, H, I, X, $e, De, Ie, Y, Pe, je, Me, Fe, Ae, A;
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, je, Pe, Me, Fe, Ae, L;
2356
2367
  class Ce {
2357
2368
  constructor(e) {
2358
2369
  y(this, i);
2359
2370
  y(this, _);
2360
- M(this, _, g(e));
2371
+ F(this, _, g(e));
2361
2372
  }
2362
2373
  /**
2363
2374
  * Returns a {@link MigrationInfo} object for each migration.
@@ -2365,7 +2376,7 @@ class Ce {
2365
2376
  * The returned array is sorted by migration name.
2366
2377
  */
2367
2378
  async getMigrations() {
2368
- const e = await u(this, i, I).call(this, l(this, i, N)) ? await l(this, _).db.withPlugin(l(this, i, C)).selectFrom(l(this, i, N)).select(["name", "timestamp"]).execute() : [];
2379
+ const e = await u(this, i, I).call(this, c(this, i, N)) ? await c(this, _).db.withPlugin(c(this, i, C)).selectFrom(c(this, i, N)).select(["name", "timestamp"]).execute() : [];
2369
2380
  return (await u(this, i, Y).call(this)).map(({ name: r, ...n }) => {
2370
2381
  const o = e.find((s) => s.name === r);
2371
2382
  return {
@@ -2423,7 +2434,7 @@ class Ce {
2423
2434
  * ```
2424
2435
  */
2425
2436
  async migrateToLatest() {
2426
- return u(this, i, F).call(this, () => ({ direction: "Up", step: 1 / 0 }));
2437
+ return u(this, i, A).call(this, () => ({ direction: "Up", step: 1 / 0 }));
2427
2438
  }
2428
2439
  /**
2429
2440
  * Migrate up/down to a specific migration.
@@ -2449,12 +2460,12 @@ class Ce {
2449
2460
  * ```
2450
2461
  */
2451
2462
  async migrateTo(e) {
2452
- return u(this, i, F).call(this, ({ migrations: a, executedMigrations: r, pendingMigrations: n }) => {
2453
- if (e === qa)
2463
+ return u(this, i, A).call(this, ({ migrations: a, executedMigrations: r, pendingMigrations: n }) => {
2464
+ if (e === Qa)
2454
2465
  return { direction: "Down", step: 1 / 0 };
2455
- if (!a.find((c) => c.name === e))
2466
+ if (!a.find((d) => d.name === e))
2456
2467
  throw new Error(`migration "${e}" doesn't exist`);
2457
- const o = r.indexOf(e), s = n.findIndex((c) => c.name === e);
2468
+ const o = r.indexOf(e), s = n.findIndex((d) => d.name === e);
2458
2469
  if (o !== -1)
2459
2470
  return {
2460
2471
  direction: "Down",
@@ -2480,7 +2491,7 @@ class Ce {
2480
2491
  * ```
2481
2492
  */
2482
2493
  async migrateUp() {
2483
- return u(this, i, F).call(this, () => ({ direction: "Up", step: 1 }));
2494
+ return u(this, i, A).call(this, () => ({ direction: "Up", step: 1 }));
2484
2495
  }
2485
2496
  /**
2486
2497
  * Migrate one step down.
@@ -2497,107 +2508,107 @@ class Ce {
2497
2508
  * ```
2498
2509
  */
2499
2510
  async migrateDown() {
2500
- return u(this, i, F).call(this, () => ({ direction: "Down", step: 1 }));
2511
+ return u(this, i, A).call(this, () => ({ direction: "Down", step: 1 }));
2501
2512
  }
2502
2513
  }
2503
- _ = new WeakMap(), i = new WeakSet(), F = async function(e) {
2514
+ _ = new WeakMap(), i = new WeakSet(), A = async function(e) {
2504
2515
  try {
2505
2516
  return await u(this, i, xe).call(this), await u(this, i, $e).call(this, e);
2506
2517
  } catch (a) {
2507
2518
  return a instanceof q ? a.resultSet : { error: a };
2508
2519
  }
2509
2520
  }, v = function() {
2510
- return l(this, _).migrationTableSchema;
2521
+ return c(this, _).migrationTableSchema;
2511
2522
  }, N = function() {
2512
- return l(this, _).migrationTableName ?? Ba;
2523
+ return c(this, _).migrationTableName ?? Ua;
2513
2524
  }, D = function() {
2514
- return l(this, _).migrationLockTableName ?? fe;
2525
+ return c(this, _).migrationLockTableName ?? fe;
2515
2526
  }, be = function() {
2516
- return l(this, _).allowUnorderedMigrations ?? Qa;
2527
+ return c(this, _).allowUnorderedMigrations ?? Ba;
2517
2528
  }, C = function() {
2518
- return l(this, i, v) ? new Ra(l(this, i, v)) : new Ua();
2529
+ return c(this, i, v) ? new Ka(c(this, i, v)) : new Ra();
2519
2530
  }, xe = async function() {
2520
2531
  await u(this, i, Te).call(this), await u(this, i, Se).call(this), await u(this, i, Oe).call(this), await u(this, i, ke).call(this);
2521
2532
  }, Te = async function() {
2522
- if (l(this, i, v) && !await u(this, i, H).call(this))
2533
+ if (c(this, i, v) && !await u(this, i, H).call(this))
2523
2534
  try {
2524
- await u(this, i, A).call(this, l(this, _).db.schema.createSchema(l(this, i, v)));
2535
+ await u(this, i, L).call(this, c(this, _).db.schema.createSchema(c(this, i, v)));
2525
2536
  } catch (e) {
2526
2537
  if (!await u(this, i, H).call(this))
2527
2538
  throw e;
2528
2539
  }
2529
2540
  }, Se = async function() {
2530
- if (!await u(this, i, I).call(this, l(this, i, N)))
2541
+ if (!await u(this, i, I).call(this, c(this, i, N)))
2531
2542
  try {
2532
- l(this, i, v) && await u(this, i, A).call(this, l(this, _).db.schema.createSchema(l(this, i, v))), await u(this, i, A).call(this, l(this, _).db.schema.withPlugin(l(this, i, C)).createTable(l(this, i, N)).addColumn("name", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("timestamp", "varchar(255)", (e) => e.notNull()));
2543
+ c(this, i, v) && await u(this, i, L).call(this, c(this, _).db.schema.createSchema(c(this, i, v))), await u(this, i, L).call(this, c(this, _).db.schema.withPlugin(c(this, i, C)).createTable(c(this, i, N)).addColumn("name", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("timestamp", "varchar(255)", (e) => e.notNull()));
2533
2544
  } catch (e) {
2534
- if (!await u(this, i, I).call(this, l(this, i, N)))
2545
+ if (!await u(this, i, I).call(this, c(this, i, N)))
2535
2546
  throw e;
2536
2547
  }
2537
2548
  }, Oe = async function() {
2538
- if (!await u(this, i, I).call(this, l(this, i, D)))
2549
+ if (!await u(this, i, I).call(this, c(this, i, D)))
2539
2550
  try {
2540
- await u(this, i, A).call(this, l(this, _).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)));
2551
+ await u(this, i, L).call(this, c(this, _).db.schema.withPlugin(c(this, i, C)).createTable(c(this, i, D)).addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("is_locked", "integer", (e) => e.notNull().defaultTo(0)));
2541
2552
  } catch (e) {
2542
- if (!await u(this, i, I).call(this, l(this, i, D)))
2553
+ if (!await u(this, i, I).call(this, c(this, i, D)))
2543
2554
  throw e;
2544
2555
  }
2545
2556
  }, ke = async function() {
2546
2557
  if (!await u(this, i, X).call(this))
2547
2558
  try {
2548
- await l(this, _).db.withPlugin(l(this, i, C)).insertInto(l(this, i, D)).values({ id: Q, is_locked: 0 }).execute();
2559
+ await c(this, _).db.withPlugin(c(this, i, C)).insertInto(c(this, i, D)).values({ id: Q, is_locked: 0 }).execute();
2549
2560
  } catch (e) {
2550
2561
  if (!await u(this, i, X).call(this))
2551
2562
  throw e;
2552
2563
  }
2553
2564
  }, H = async function() {
2554
- return (await l(this, _).db.introspection.getSchemas()).some((a) => a.name === l(this, i, v));
2565
+ return (await c(this, _).db.introspection.getSchemas()).some((a) => a.name === c(this, i, v));
2555
2566
  }, I = async function(e) {
2556
- const a = l(this, i, v);
2557
- return (await l(this, _).db.introspection.getTables({
2567
+ const a = c(this, i, v);
2568
+ return (await c(this, _).db.introspection.getTables({
2558
2569
  withInternalKyselyTables: !0
2559
2570
  })).some((n) => n.name === e && (!a || n.schema === a));
2560
2571
  }, X = async function() {
2561
- return !!await l(this, _).db.withPlugin(l(this, i, C)).selectFrom(l(this, i, D)).where("id", "=", Q).select("id").executeTakeFirst();
2572
+ return !!await c(this, _).db.withPlugin(c(this, i, C)).selectFrom(c(this, i, D)).where("id", "=", Q).select("id").executeTakeFirst();
2562
2573
  }, $e = async function(e) {
2563
- const a = l(this, _).db.getExecutor().adapter, r = g({
2564
- lockTable: l(this, _).migrationLockTableName ?? fe,
2574
+ const a = c(this, _).db.getExecutor().adapter, r = g({
2575
+ lockTable: c(this, _).migrationLockTableName ?? fe,
2565
2576
  lockRowId: Q,
2566
- lockTableSchema: l(this, _).migrationTableSchema
2577
+ lockTableSchema: c(this, _).migrationTableSchema
2567
2578
  }), n = async (o) => {
2568
2579
  try {
2569
2580
  await a.acquireMigrationLock(o, r);
2570
2581
  const s = await u(this, i, De).call(this, o);
2571
2582
  if (s.migrations.length === 0)
2572
2583
  return { results: [] };
2573
- const { direction: c, step: d } = e(s);
2574
- return d <= 0 ? { results: [] } : c === "Down" ? await u(this, i, Fe).call(this, o, s, d) : c === "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: [] };
2575
2586
  } finally {
2576
2587
  await a.releaseMigrationLock(o, r);
2577
2588
  }
2578
2589
  };
2579
- return a.supportsTransactionalDdl ? l(this, _).db.transaction().execute(n) : l(this, _).db.connection().execute(n);
2590
+ return a.supportsTransactionalDdl ? c(this, _).db.transaction().execute(n) : c(this, _).db.connection().execute(n);
2580
2591
  }, De = async function(e) {
2581
- const a = await u(this, i, Y).call(this), r = await u(this, i, Pe).call(this, e);
2582
- u(this, i, je).call(this, a, r), l(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);
2583
2594
  const n = u(this, i, Ie).call(this, a, r);
2584
2595
  return g({
2585
2596
  migrations: a,
2586
2597
  executedMigrations: r,
2587
- lastMigration: La(r),
2598
+ lastMigration: Aa(r),
2588
2599
  pendingMigrations: n
2589
2600
  });
2590
2601
  }, Ie = function(e, a) {
2591
2602
  return e.filter((r) => !a.includes(r.name));
2592
2603
  }, Y = async function() {
2593
- const e = await l(this, _).provider.getMigrations();
2604
+ const e = await c(this, _).provider.getMigrations();
2594
2605
  return Object.keys(e).sort().map((a) => ({
2595
2606
  ...e[a],
2596
2607
  name: a
2597
2608
  }));
2598
- }, Pe = async function(e) {
2599
- return (await e.withPlugin(l(this, i, C)).selectFrom(l(this, i, N)).select("name").orderBy(["timestamp", "name"]).execute()).map((r) => r.name);
2600
- }, je = function(e, a) {
2609
+ }, je = async function(e) {
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
+ }, Pe = function(e, a) {
2601
2612
  for (const r of a)
2602
2613
  if (!e.some((n) => n.name === r))
2603
2614
  throw new Error(`corrupted migrations: previously executed migration ${r} is missing`);
@@ -2606,26 +2617,26 @@ _ = new WeakMap(), i = new WeakSet(), F = async function(e) {
2606
2617
  if (e[r].name !== a[r])
2607
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.`);
2608
2619
  }, Fe = async function(e, a, r) {
2609
- const n = a.executedMigrations.slice().reverse().slice(0, r).map((s) => a.migrations.find((c) => c.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) => ({
2610
2621
  migrationName: s.name,
2611
2622
  direction: "Down",
2612
2623
  status: "NotExecuted"
2613
2624
  }));
2614
2625
  for (let s = 0; s < o.length; ++s) {
2615
- const c = n[s];
2626
+ const d = n[s];
2616
2627
  try {
2617
- c.down && (await c.down(e), await e.withPlugin(l(this, i, C)).deleteFrom(l(this, i, N)).where("name", "=", c.name).execute(), o[s] = {
2618
- migrationName: c.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,
2619
2630
  direction: "Down",
2620
2631
  status: "Success"
2621
2632
  });
2622
- } catch (d) {
2633
+ } catch (l) {
2623
2634
  throw o[s] = {
2624
- migrationName: c.name,
2635
+ migrationName: d.name,
2625
2636
  direction: "Down",
2626
2637
  status: "Error"
2627
2638
  }, new q({
2628
- error: d,
2639
+ error: l,
2629
2640
  results: o
2630
2641
  });
2631
2642
  }
@@ -2638,53 +2649,53 @@ _ = new WeakMap(), i = new WeakSet(), F = async function(e) {
2638
2649
  status: "NotExecuted"
2639
2650
  }));
2640
2651
  for (let s = 0; s < o.length; s++) {
2641
- const c = a.pendingMigrations[s];
2652
+ const d = a.pendingMigrations[s];
2642
2653
  try {
2643
- await c.up(e), await e.withPlugin(l(this, i, C)).insertInto(l(this, i, N)).values({
2644
- name: c.name,
2654
+ await d.up(e), await e.withPlugin(c(this, i, C)).insertInto(c(this, i, N)).values({
2655
+ name: d.name,
2645
2656
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
2646
2657
  }).execute(), o[s] = {
2647
- migrationName: c.name,
2658
+ migrationName: d.name,
2648
2659
  direction: "Up",
2649
2660
  status: "Success"
2650
2661
  };
2651
- } catch (d) {
2662
+ } catch (l) {
2652
2663
  throw o[s] = {
2653
- migrationName: c.name,
2664
+ migrationName: d.name,
2654
2665
  direction: "Up",
2655
2666
  status: "Error"
2656
2667
  }, new q({
2657
- error: d,
2668
+ error: l,
2658
2669
  results: o
2659
2670
  });
2660
2671
  }
2661
2672
  }
2662
2673
  return { results: o };
2663
- }, A = async function(e) {
2664
- l(this, _).db.getExecutor().adapter.supportsCreateIfNotExists && (e = e.ifNotExists()), await e.execute();
2674
+ }, L = async function(e) {
2675
+ c(this, _).db.getExecutor().adapter.supportsCreateIfNotExists && (e = e.ifNotExists()), await e.execute();
2665
2676
  };
2666
- var z;
2677
+ var J;
2667
2678
  class q extends Error {
2668
2679
  constructor(a) {
2669
2680
  super();
2670
- y(this, z);
2671
- M(this, z, a);
2681
+ y(this, J);
2682
+ F(this, J, a);
2672
2683
  }
2673
2684
  get resultSet() {
2674
- return l(this, z);
2685
+ return c(this, J);
2675
2686
  }
2676
2687
  }
2677
- z = new WeakMap();
2688
+ J = new WeakMap();
2678
2689
  class Le {
2679
2690
  constructor(e) {
2680
- j(this, "migrations");
2691
+ M(this, "migrations");
2681
2692
  this.migrations = e;
2682
2693
  }
2683
2694
  async getMigrations() {
2684
2695
  return this.migrations;
2685
2696
  }
2686
2697
  }
2687
- async function Va(t) {
2698
+ async function qa(t) {
2688
2699
  await t.schema.createTable("tenants").addColumn("id", "varchar(255)", (e) => e.primaryKey()).addColumn("name", "varchar(255)").addColumn("audience", "varchar(255)").addColumn("sender_email", "varchar(255)").addColumn("sender_name", "varchar(255)").addColumn("language", "varchar(255)").addColumn("logo", "varchar(255)").addColumn("primary_color", "varchar(255)").addColumn("secondary_color", "varchar(255)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("updated_at", "varchar(255)", (e) => e.notNull()).execute(), await t.schema.createTable("users").addColumn("user_id", "varchar(255)", (e) => e.notNull()).addColumn(
2689
2700
  "tenant_id",
2690
2701
  "varchar(255)",
@@ -2756,35 +2767,35 @@ async function Va(t) {
2756
2767
  (e) => e.references("tenants.id").onDelete("cascade").notNull()
2757
2768
  ).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();
2758
2769
  }
2759
- async function Wa(t) {
2770
+ async function Va(t) {
2760
2771
  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();
2761
2772
  }
2762
- const Ga = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2773
+ const Wa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2763
2774
  __proto__: null,
2764
- down: Wa,
2765
- up: Va
2775
+ down: Va,
2776
+ up: qa
2766
2777
  }, Symbol.toStringTag, { value: "Module" }));
2767
- async function Ha(t) {
2778
+ async function Ga(t) {
2768
2779
  await t.schema.alterTable("tenants").addColumn("support_url", "varchar(255)").execute();
2769
2780
  }
2770
- async function Xa(t) {
2781
+ async function Ha(t) {
2771
2782
  await t.schema.alterTable("tenants").dropColumn("support_url").execute();
2772
2783
  }
2773
- const Ya = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2784
+ const Xa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2774
2785
  __proto__: null,
2775
- down: Xa,
2776
- up: Ha
2786
+ down: Ha,
2787
+ up: Ga
2777
2788
  }, Symbol.toStringTag, { value: "Module" }));
2778
- async function Za(t) {
2789
+ async function Ya(t) {
2779
2790
  }
2780
- async function er(t) {
2791
+ async function Za(t) {
2781
2792
  }
2782
- const tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2793
+ const er = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2783
2794
  __proto__: null,
2784
- down: er,
2785
- up: Za
2795
+ down: Za,
2796
+ up: Ya
2786
2797
  }, Symbol.toStringTag, { value: "Module" }));
2787
- async function ar(t) {
2798
+ async function tr(t) {
2788
2799
  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(
2789
2800
  "tenant_id_constraint",
2790
2801
  ["tenant_id"],
@@ -2793,24 +2804,24 @@ async function ar(t) {
2793
2804
  (e) => e.onDelete("cascade")
2794
2805
  ).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();
2795
2806
  }
2796
- async function rr(t) {
2807
+ async function ar(t) {
2797
2808
  await t.schema.dropTable("logs").execute();
2798
2809
  }
2799
- const nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2810
+ const rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2800
2811
  __proto__: null,
2801
- down: rr,
2802
- up: ar
2812
+ down: ar,
2813
+ up: tr
2803
2814
  }, Symbol.toStringTag, { value: "Module" }));
2804
- async function or(t) {
2815
+ async function nr(t) {
2805
2816
  }
2806
- async function sr(t) {
2817
+ async function or(t) {
2807
2818
  }
2808
- const ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2819
+ const sr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2809
2820
  __proto__: null,
2810
- down: sr,
2811
- up: or
2821
+ down: or,
2822
+ up: nr
2812
2823
  }, Symbol.toStringTag, { value: "Module" }));
2813
- async function dr(t) {
2824
+ async function ir(t) {
2814
2825
  await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
2815
2826
  "user_id_constraint",
2816
2827
  ["user_id", "tenant_id"],
@@ -2835,15 +2846,15 @@ async function dr(t) {
2835
2846
  (e) => e.references("applications.id").onDelete("cascade").notNull()
2836
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();
2837
2848
  }
2838
- async function cr(t) {
2849
+ async function lr(t) {
2839
2850
  await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("tickets").execute(), await t.schema.dropTable("otps").execute();
2840
2851
  }
2841
- const lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2852
+ const dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2842
2853
  __proto__: null,
2843
- down: cr,
2844
- up: dr
2854
+ down: lr,
2855
+ up: ir
2845
2856
  }, Symbol.toStringTag, { value: "Module" }));
2846
- async function ur(t) {
2857
+ async function cr(t) {
2847
2858
  await t.schema.createTable("passwords").addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addPrimaryKeyConstraint("passwords_pkey", ["user_id", "tenant_id"]).addForeignKeyConstraint(
2848
2859
  "user_id_constraint",
2849
2860
  ["user_id", "tenant_id"],
@@ -2858,24 +2869,24 @@ async function ur(t) {
2858
2869
  (e) => e.onDelete("cascade")
2859
2870
  ).addColumn("type", "varchar(255)", (e) => e.notNull()).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute(), await t.schema.createIndex("codes_expires_at_index").on("codes").column("expires_at").execute();
2860
2871
  }
2861
- async function mr(t) {
2872
+ async function ur(t) {
2862
2873
  await t.schema.dropTable("passwords").execute(), await t.schema.dropTable("codes").execute();
2863
2874
  }
2864
- const hr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2875
+ const mr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2865
2876
  __proto__: null,
2866
- down: mr,
2867
- up: ur
2877
+ down: ur,
2878
+ up: cr
2868
2879
  }, Symbol.toStringTag, { value: "Module" }));
2869
- async function _r(t) {
2880
+ async function hr(t) {
2870
2881
  }
2871
- async function fr(t) {
2882
+ async function _r(t) {
2872
2883
  }
2873
- const pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2884
+ const fr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2874
2885
  __proto__: null,
2875
- down: fr,
2876
- up: _r
2886
+ down: _r,
2887
+ up: hr
2877
2888
  }, Symbol.toStringTag, { value: "Module" }));
2878
- async function gr(t) {
2889
+ async function pr(t) {
2879
2890
  await t.schema.alterTable("passwords").addColumn(
2880
2891
  "password",
2881
2892
  "varchar(255)",
@@ -2883,288 +2894,288 @@ async function gr(t) {
2883
2894
  (e) => e.notNull()
2884
2895
  ).execute();
2885
2896
  }
2886
- async function yr(t) {
2897
+ async function gr(t) {
2887
2898
  await t.schema.alterTable("passwords").dropColumn("password").execute();
2888
2899
  }
2889
- const wr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2900
+ const yr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2890
2901
  __proto__: null,
2891
- down: yr,
2892
- up: gr
2902
+ down: gr,
2903
+ up: pr
2893
2904
  }, Symbol.toStringTag, { value: "Module" }));
2894
- async function vr(t) {
2905
+ async function wr(t) {
2895
2906
  }
2896
- async function Nr(t) {
2907
+ async function vr(t) {
2897
2908
  }
2898
- const Cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2909
+ const Nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2899
2910
  __proto__: null,
2900
- down: Nr,
2901
- up: vr
2911
+ down: vr,
2912
+ up: wr
2902
2913
  }, Symbol.toStringTag, { value: "Module" }));
2903
- async function br(t) {
2914
+ async function Cr(t) {
2904
2915
  }
2905
- async function xr(t) {
2916
+ async function br(t) {
2906
2917
  }
2907
- const Tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2918
+ const xr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2908
2919
  __proto__: null,
2909
- down: xr,
2910
- up: br
2920
+ down: br,
2921
+ up: Cr
2911
2922
  }, Symbol.toStringTag, { value: "Module" }));
2912
- async function Sr(t) {
2923
+ async function Tr(t) {
2913
2924
  }
2914
- async function Or(t) {
2925
+ async function Sr(t) {
2915
2926
  }
2916
- const kr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2927
+ const Or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2917
2928
  __proto__: null,
2918
- down: Or,
2919
- up: Sr
2929
+ down: Sr,
2930
+ up: Tr
2920
2931
  }, Symbol.toStringTag, { value: "Module" }));
2921
- async function $r(t) {
2932
+ async function kr(t) {
2922
2933
  await t.schema.createIndex("users_email_index").on("users").column("email").execute();
2923
2934
  }
2924
- async function Dr(t) {
2935
+ async function $r(t) {
2925
2936
  await t.schema.dropIndex("users_email_index").execute();
2926
2937
  }
2927
- const Ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2938
+ const Dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2928
2939
  __proto__: null,
2929
- down: Dr,
2930
- up: $r
2940
+ down: $r,
2941
+ up: kr
2931
2942
  }, Symbol.toStringTag, { value: "Module" }));
2932
- async function Pr(t) {
2943
+ async function Ir(t) {
2933
2944
  await t.schema.alterTable("users").addColumn("profileData", "varchar(2048)").execute();
2934
2945
  }
2935
2946
  async function jr(t) {
2936
2947
  await t.schema.alterTable("users").dropColumn("profileData").execute();
2937
2948
  }
2938
- const Mr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2949
+ const Pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2939
2950
  __proto__: null,
2940
2951
  down: jr,
2941
- up: Pr
2952
+ up: Ir
2942
2953
  }, Symbol.toStringTag, { value: "Module" }));
2943
- async function Fr(t) {
2954
+ async function Mr(t) {
2944
2955
  await t.schema.createIndex("users_linked_to_index").on("users").column("linked_to").execute();
2945
2956
  }
2946
- async function Ar(t) {
2957
+ async function Fr(t) {
2947
2958
  await t.schema.dropIndex("users_linked_to_index");
2948
2959
  }
2949
- const Lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2960
+ const Ar = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2950
2961
  __proto__: null,
2951
- down: Ar,
2952
- up: Fr
2962
+ down: Fr,
2963
+ up: Mr
2953
2964
  }, Symbol.toStringTag, { value: "Module" }));
2954
- async function zr(t) {
2965
+ async function Lr(t) {
2955
2966
  await t.schema.alterTable("users").addColumn("locale", "varchar(255)").execute();
2956
2967
  }
2957
- async function Jr(t) {
2968
+ async function zr(t) {
2958
2969
  await t.schema.alterTable("users").dropColumn("locale").execute();
2959
2970
  }
2960
- const Er = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2971
+ const Jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2961
2972
  __proto__: null,
2962
- down: Jr,
2963
- up: zr
2973
+ down: zr,
2974
+ up: Lr
2964
2975
  }, Symbol.toStringTag, { value: "Module" }));
2965
- async function Kr(t) {
2976
+ async function Er(t) {
2966
2977
  await t.schema.createTable("keys").addColumn("kid", "varchar(255)", (e) => e.primaryKey()).addColumn(
2967
2978
  "tenant_id",
2968
2979
  "varchar(255)",
2969
2980
  (e) => e.references("tenants.id").onDelete("cascade")
2970
2981
  ).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("revoked_at", "varchar(255)").addColumn("cert", "varchar(2048)").addColumn("pkcs7", "varchar(2048)").addColumn("fingerprint", "varchar(256)").addColumn("thumbprint", "varchar(256)").addColumn("current_since", "varchar(256)").addColumn("current_until", "varchar(256)").execute();
2971
2982
  }
2972
- async function Rr(t) {
2983
+ async function Kr(t) {
2973
2984
  await t.schema.dropTable("keys").execute();
2974
2985
  }
2975
- const Ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2986
+ const Rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2976
2987
  __proto__: null,
2977
- down: Rr,
2978
- up: Kr
2988
+ down: Kr,
2989
+ up: Er
2979
2990
  }, Symbol.toStringTag, { value: "Module" }));
2980
- async function Br(t) {
2991
+ async function Ur(t) {
2981
2992
  }
2982
- async function Qr(t) {
2993
+ async function Br(t) {
2983
2994
  }
2984
- const qr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2995
+ const Qr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2985
2996
  __proto__: null,
2986
- down: Qr,
2987
- up: Br
2997
+ down: Br,
2998
+ up: Ur
2988
2999
  }, Symbol.toStringTag, { value: "Module" }));
2989
- async function Vr(t) {
3000
+ async function qr(t) {
2990
3001
  }
2991
- async function Wr(t) {
3002
+ async function Vr(t) {
2992
3003
  }
2993
- const Gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3004
+ const Wr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2994
3005
  __proto__: null,
2995
- down: Wr,
2996
- up: Vr
3006
+ down: Vr,
3007
+ up: qr
2997
3008
  }, Symbol.toStringTag, { value: "Module" }));
2998
- async function Hr(t) {
3009
+ async function Gr(t) {
2999
3010
  await t.schema.alterTable("otps").addColumn("audience", "varchar(255)").execute();
3000
3011
  }
3001
- async function Xr(t) {
3012
+ async function Hr(t) {
3002
3013
  await t.schema.alterTable("otps").dropColumn("audience").execute();
3003
3014
  }
3004
- const Yr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3015
+ const Xr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3005
3016
  __proto__: null,
3006
- down: Xr,
3007
- up: Hr
3017
+ down: Hr,
3018
+ up: Gr
3008
3019
  }, Symbol.toStringTag, { value: "Module" }));
3009
- async function Zr(t) {
3020
+ async function Yr(t) {
3010
3021
  }
3011
- async function en(t) {
3022
+ async function Zr(t) {
3012
3023
  }
3013
- const tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3024
+ const en = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3014
3025
  __proto__: null,
3015
- down: en,
3016
- up: Zr
3026
+ down: Zr,
3027
+ up: Yr
3017
3028
  }, Symbol.toStringTag, { value: "Module" }));
3018
- async function an(t) {
3029
+ async function tn(t) {
3019
3030
  await t.schema.alterTable("logs").dropColumn("category").execute();
3020
3031
  }
3021
- async function rn(t) {
3032
+ async function an(t) {
3022
3033
  await t.schema.alterTable("logs").addColumn("category", "varchar(255)", (e) => e.notNull()).execute();
3023
3034
  }
3024
- const nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3035
+ const rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3025
3036
  __proto__: null,
3026
- down: rn,
3027
- up: an
3037
+ down: an,
3038
+ up: tn
3028
3039
  }, Symbol.toStringTag, { value: "Module" }));
3029
- async function on(t) {
3040
+ async function nn(t) {
3030
3041
  await t.schema.alterTable("users").dropColumn("tags").execute();
3031
3042
  }
3032
- async function sn(t) {
3043
+ async function on(t) {
3033
3044
  await t.schema.alterTable("users").addColumn("tags", "varchar(255)").execute();
3034
3045
  }
3035
- const dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3046
+ const sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3036
3047
  __proto__: null,
3037
- down: sn,
3038
- up: on
3048
+ down: on,
3049
+ up: nn
3039
3050
  }, Symbol.toStringTag, { value: "Module" }));
3040
- async function cn(t) {
3051
+ async function ln(t) {
3041
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();
3042
3053
  }
3043
- async function ln(t) {
3054
+ async function dn(t) {
3044
3055
  await t.schema.dropIndex("logs_user_id"), await t.schema.dropIndex("logs_tenant_id"), await t.schema.dropIndex("logs_date");
3045
3056
  }
3046
- const un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3057
+ const cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3047
3058
  __proto__: null,
3048
- down: ln,
3049
- up: cn
3059
+ down: dn,
3060
+ up: ln
3050
3061
  }, Symbol.toStringTag, { value: "Module" }));
3051
- async function mn(t) {
3062
+ async function un(t) {
3052
3063
  await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(8192)").execute();
3053
3064
  }
3054
- async function hn(t) {
3065
+ async function mn(t) {
3055
3066
  await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(2048)").execute();
3056
3067
  }
3057
- const _n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3068
+ const hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3058
3069
  __proto__: null,
3059
- down: hn,
3060
- up: mn
3070
+ down: mn,
3071
+ up: un
3061
3072
  }, Symbol.toStringTag, { value: "Module" }));
3062
- async function fn(t) {
3073
+ async function _n(t) {
3063
3074
  await t.schema.alterTable("logs").addColumn("user_name", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("auth0_client", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("isMobile", "boolean").execute(), await t.schema.alterTable("logs").addColumn("connection", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("connection_id", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("audience", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("scope", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("strategy", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("strategy_type", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("hostname", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("session_connection", "varchar(255)").execute();
3064
3075
  }
3065
- async function pn(t) {
3076
+ async function fn(t) {
3066
3077
  await t.schema.alterTable("logs").dropColumn("user_name").execute(), await t.schema.alterTable("logs").dropColumn("auth0_client").execute(), await t.schema.alterTable("logs").dropColumn("isMobile").execute(), await t.schema.alterTable("logs").dropColumn("connection").execute(), await t.schema.alterTable("logs").dropColumn("connection_id").execute(), await t.schema.alterTable("logs").dropColumn("audience").execute(), await t.schema.alterTable("logs").dropColumn("scope").execute(), await t.schema.alterTable("logs").dropColumn("strategy").execute(), await t.schema.alterTable("logs").dropColumn("strategy_type").execute(), await t.schema.alterTable("logs").dropColumn("hostname").execute(), await t.schema.alterTable("logs").dropColumn("session_connection").execute();
3067
3078
  }
3068
- const gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3079
+ const pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3069
3080
  __proto__: null,
3070
- down: pn,
3071
- up: fn
3081
+ down: fn,
3082
+ up: _n
3072
3083
  }, Symbol.toStringTag, { value: "Module" }));
3073
- async function yn(t) {
3084
+ async function gn(t) {
3074
3085
  await t.schema.createIndex("users_name_index").on("users").column("name").execute();
3075
3086
  }
3076
- async function wn(t) {
3087
+ async function yn(t) {
3077
3088
  await t.schema.dropIndex("users_name_index").execute();
3078
3089
  }
3079
- const vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3090
+ const wn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3080
3091
  __proto__: null,
3081
- down: wn,
3082
- up: yn
3092
+ down: yn,
3093
+ up: gn
3083
3094
  }, Symbol.toStringTag, { value: "Module" }));
3084
- async function Nn(t) {
3095
+ async function vn(t) {
3085
3096
  }
3086
- async function Cn(t) {
3097
+ async function Nn(t) {
3087
3098
  await t.schema.alterTable("users").dropConstraint("unique_email_provider").execute();
3088
3099
  }
3089
- const bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3100
+ const Cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3090
3101
  __proto__: null,
3091
- down: Cn,
3092
- up: Nn
3102
+ down: Nn,
3103
+ up: vn
3093
3104
  }, Symbol.toStringTag, { value: "Module" }));
3094
- async function xn(t) {
3105
+ async function bn(t) {
3095
3106
  await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(8192)").execute();
3096
3107
  }
3097
- async function Tn(t) {
3108
+ async function xn(t) {
3098
3109
  await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(1024)").execute();
3099
3110
  }
3100
- const Sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3111
+ const Tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3101
3112
  __proto__: null,
3102
- down: Tn,
3103
- up: xn
3113
+ down: xn,
3114
+ up: bn
3104
3115
  }, Symbol.toStringTag, { value: "Module" }));
3105
- async function On(t) {
3116
+ async function Sn(t) {
3106
3117
  await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(8192)").execute();
3107
3118
  }
3108
- async function kn(t) {
3119
+ async function On(t) {
3109
3120
  await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(1024)").execute();
3110
3121
  }
3111
- const $n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3122
+ const kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3112
3123
  __proto__: null,
3113
- down: kn,
3114
- up: On
3124
+ down: On,
3125
+ up: Sn
3115
3126
  }, Symbol.toStringTag, { value: "Module" }));
3116
- async function Dn(t) {
3127
+ async function $n(t) {
3117
3128
  await t.schema.createTable("branding").addColumn(
3118
3129
  "tenant_id",
3119
3130
  "varchar(255)",
3120
3131
  (e) => e.references("tenants.id").onDelete("cascade").notNull().primaryKey()
3121
3132
  ).addColumn("logo_url", "varchar(512)").addColumn("favicon_url", "varchar(512)").addColumn("font_url", "varchar(512)").addColumn("colors_primary", "varchar(8)").addColumn("colors_page_background_type", "varchar(32)").addColumn("colors_page_background_start", "varchar(8)").addColumn("colors_page_background_end", "varchar(8)").addColumn("colors_page_background_angle_dev", "integer").execute();
3122
3133
  }
3123
- async function In(t) {
3134
+ async function Dn(t) {
3124
3135
  await t.schema.dropTable("branding").execute();
3125
3136
  }
3126
- const Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3137
+ const In = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3127
3138
  __proto__: null,
3128
- down: In,
3129
- up: Dn
3139
+ down: Dn,
3140
+ up: $n
3130
3141
  }, Symbol.toStringTag, { value: "Module" }));
3131
3142
  async function jn(t) {
3132
3143
  }
3133
- async function Mn(t) {
3144
+ async function Pn(t) {
3134
3145
  }
3135
- const Fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3146
+ const Mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3136
3147
  __proto__: null,
3137
- down: Mn,
3148
+ down: Pn,
3138
3149
  up: jn
3139
3150
  }, Symbol.toStringTag, { value: "Module" }));
3140
- async function An(t) {
3151
+ async function Fn(t) {
3141
3152
  }
3142
- async function Ln(t) {
3153
+ async function An(t) {
3143
3154
  }
3144
- const zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3155
+ const Ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3145
3156
  __proto__: null,
3146
- down: Ln,
3147
- up: An
3157
+ down: An,
3158
+ up: Fn
3148
3159
  }, Symbol.toStringTag, { value: "Module" }));
3149
- async function Jn(t) {
3160
+ async function zn(t) {
3150
3161
  }
3151
- async function En(t) {
3162
+ async function Jn(t) {
3152
3163
  }
3153
- const Kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3164
+ const En = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3154
3165
  __proto__: null,
3155
- down: En,
3156
- up: Jn
3166
+ down: Jn,
3167
+ up: zn
3157
3168
  }, Symbol.toStringTag, { value: "Module" }));
3158
- async function Rn(t) {
3169
+ async function Kn(t) {
3159
3170
  }
3160
- async function Un(t) {
3171
+ async function Rn(t) {
3161
3172
  }
3162
- const Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3173
+ const Un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3163
3174
  __proto__: null,
3164
- down: Un,
3165
- up: Rn
3175
+ down: Rn,
3176
+ up: Kn
3166
3177
  }, Symbol.toStringTag, { value: "Module" }));
3167
- async function Qn(t) {
3178
+ async function Bn(t) {
3168
3179
  await t.schema.createTable("authentication_codes").addColumn(
3169
3180
  "tenant_id",
3170
3181
  "varchar(255)",
@@ -3175,55 +3186,55 @@ async function Qn(t) {
3175
3186
  (e) => e.references("applications.id").onDelete("cascade").notNull()
3176
3187
  ).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();
3177
3188
  }
3178
- async function qn(t) {
3189
+ async function Qn(t) {
3179
3190
  await t.schema.dropTable("authentication_codes").execute();
3180
3191
  }
3181
- const Vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3192
+ const qn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3182
3193
  __proto__: null,
3183
- down: qn,
3184
- up: Qn
3194
+ down: Qn,
3195
+ up: Bn
3185
3196
  }, Symbol.toStringTag, { value: "Module" }));
3186
- async function Wn(t) {
3197
+ async function Vn(t) {
3187
3198
  }
3188
- async function Gn(t) {
3199
+ async function Wn(t) {
3189
3200
  }
3190
- const Hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3201
+ const Gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3191
3202
  __proto__: null,
3192
- down: Gn,
3193
- up: Wn
3203
+ down: Wn,
3204
+ up: Vn
3194
3205
  }, Symbol.toStringTag, { value: "Module" }));
3195
- async function Xn(t) {
3206
+ async function Hn(t) {
3196
3207
  await t.schema.alterTable("otps").addColumn("ip", "varchar(64)").execute();
3197
3208
  }
3198
- async function Yn(t) {
3209
+ async function Xn(t) {
3199
3210
  await t.schema.alterTable("otps").dropColumn("ip").execute();
3200
3211
  }
3201
- const Zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3212
+ const Yn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3202
3213
  __proto__: null,
3203
- down: Yn,
3204
- up: Xn
3214
+ down: Xn,
3215
+ up: Hn
3205
3216
  }, Symbol.toStringTag, { value: "Module" }));
3206
- async function eo(t) {
3217
+ async function Zn(t) {
3207
3218
  await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(1024)").execute();
3208
3219
  }
3209
- async function to(t) {
3220
+ async function eo(t) {
3210
3221
  await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(255)").execute();
3211
3222
  }
3212
- const ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3223
+ const to = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3213
3224
  __proto__: null,
3214
- down: to,
3215
- up: eo
3225
+ down: eo,
3226
+ up: Zn
3216
3227
  }, Symbol.toStringTag, { value: "Module" }));
3217
- async function ro(t) {
3228
+ async function ao(t) {
3218
3229
  }
3219
- async function no(t) {
3230
+ async function ro(t) {
3220
3231
  }
3221
- const oo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3232
+ const no = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3222
3233
  __proto__: null,
3223
- down: no,
3224
- up: ro
3234
+ down: ro,
3235
+ up: ao
3225
3236
  }, Symbol.toStringTag, { value: "Module" }));
3226
- async function so(t) {
3237
+ async function oo(t) {
3227
3238
  await t.schema.createTable("hooks").addColumn("hook_id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
3228
3239
  "tenant_id",
3229
3240
  "varchar(255)",
@@ -3234,33 +3245,33 @@ async function so(t) {
3234
3245
  (e) => e.defaultTo(!1).notNull()
3235
3246
  ).addColumn("priority", "integer").execute();
3236
3247
  }
3237
- async function io(t) {
3248
+ async function so(t) {
3238
3249
  await t.schema.dropTable("hooks").execute();
3239
3250
  }
3240
- const co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3251
+ const io = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3241
3252
  __proto__: null,
3242
- down: io,
3243
- up: so
3253
+ down: so,
3254
+ up: oo
3244
3255
  }, Symbol.toStringTag, { value: "Module" }));
3245
3256
  async function lo(t) {
3246
3257
  }
3247
- async function uo(t) {
3258
+ async function co(t) {
3248
3259
  }
3249
- const mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3260
+ const uo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3250
3261
  __proto__: null,
3251
- down: uo,
3262
+ down: co,
3252
3263
  up: lo
3253
3264
  }, Symbol.toStringTag, { value: "Module" }));
3254
- async function ho(t) {
3265
+ async function mo(t) {
3255
3266
  }
3256
- async function _o(t) {
3267
+ async function ho(t) {
3257
3268
  }
3258
- const fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3269
+ const _o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3259
3270
  __proto__: null,
3260
- down: _o,
3261
- up: ho
3271
+ down: ho,
3272
+ up: mo
3262
3273
  }, Symbol.toStringTag, { value: "Module" }));
3263
- async function po(t) {
3274
+ async function fo(t) {
3264
3275
  await t.schema.createTable("logins").addColumn("login_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
3265
3276
  "tenant_id",
3266
3277
  "varchar(255)",
@@ -3277,7 +3288,7 @@ async function po(t) {
3277
3288
  (e) => e.onDelete("cascade")
3278
3289
  ).addColumn("code_type", "varchar(255)", (e) => e.notNull()).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute();
3279
3290
  }
3280
- async function go(t) {
3291
+ async function po(t) {
3281
3292
  await t.schema.dropTable("logins").execute(), await t.schema.alterTable("passwords").dropColumn("algorithm").execute(), await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("id", "varchar(255)", (e) => e.primaryKey()).addColumn("code", "varchar(255)", (e) => e.notNull()).addColumn("user_id", "varchar(255)").addColumn("tenant_id", "varchar(255)").addForeignKeyConstraint(
3282
3293
  "codes_user_id_tenant_id_constraint",
3283
3294
  ["user_id", "tenant_id"],
@@ -3286,90 +3297,90 @@ async function go(t) {
3286
3297
  (e) => e.onDelete("cascade")
3287
3298
  ).addColumn("type", "varchar(255)", (e) => e.notNull()).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute();
3288
3299
  }
3289
- const yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3300
+ const go = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3290
3301
  __proto__: null,
3291
- down: go,
3292
- up: po
3302
+ down: po,
3303
+ up: fo
3293
3304
  }, Symbol.toStringTag, { value: "Module" }));
3294
- async function wo(t) {
3305
+ async function yo(t) {
3295
3306
  }
3296
- async function vo(t) {
3307
+ async function wo(t) {
3297
3308
  }
3298
- const No = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3309
+ const vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3299
3310
  __proto__: null,
3300
- down: vo,
3301
- up: wo
3311
+ down: wo,
3312
+ up: yo
3302
3313
  }, Symbol.toStringTag, { value: "Module" }));
3303
- async function Co(t) {
3314
+ async function No(t) {
3304
3315
  await t.schema.alterTable("logins").addColumn("auth0Client", "varchar(256)").execute();
3305
3316
  }
3306
- async function bo(t) {
3317
+ async function Co(t) {
3307
3318
  await t.schema.alterTable("logins").dropColumn("auth0Client").execute();
3308
3319
  }
3309
- const xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3320
+ const bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3310
3321
  __proto__: null,
3311
- down: bo,
3312
- up: Co
3322
+ down: Co,
3323
+ up: No
3313
3324
  }, Symbol.toStringTag, { value: "Module" }));
3314
- async function To(t) {
3325
+ async function xo(t) {
3315
3326
  await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(8192)").execute();
3316
3327
  }
3317
- async function So(t) {
3328
+ async function To(t) {
3318
3329
  await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(511)").execute();
3319
3330
  }
3320
- const Oo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3331
+ const So = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3321
3332
  __proto__: null,
3322
- down: So,
3323
- up: To
3333
+ down: To,
3334
+ up: xo
3324
3335
  }, Symbol.toStringTag, { value: "Module" }));
3325
- async function ko(t) {
3336
+ async function Oo(t) {
3326
3337
  }
3327
- async function $o(t) {
3338
+ async function ko(t) {
3328
3339
  }
3329
- const Do = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3340
+ const $o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3330
3341
  __proto__: null,
3331
- down: $o,
3332
- up: ko
3342
+ down: ko,
3343
+ up: Oo
3333
3344
  }, Symbol.toStringTag, { value: "Module" }));
3334
- async function Io(t) {
3345
+ async function Do(t) {
3335
3346
  }
3336
- async function Po(t) {
3347
+ async function Io(t) {
3337
3348
  }
3338
3349
  const jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3339
3350
  __proto__: null,
3340
- down: Po,
3341
- up: Io
3351
+ down: Io,
3352
+ up: Do
3342
3353
  }, Symbol.toStringTag, { value: "Module" }));
3343
- async function Mo(t) {
3354
+ async function Po(t) {
3344
3355
  await t.schema.alterTable("logins").addColumn("authParams_nonce", "varchar(255)").execute();
3345
3356
  }
3346
- async function Fo(t) {
3357
+ async function Mo(t) {
3347
3358
  await t.schema.alterTable("logins").dropColumn("nonce").execute();
3348
3359
  }
3349
- const Ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3360
+ const Fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3350
3361
  __proto__: null,
3351
- down: Fo,
3352
- up: Mo
3362
+ down: Mo,
3363
+ up: Po
3353
3364
  }, Symbol.toStringTag, { value: "Module" }));
3354
- async function Lo(t) {
3365
+ async function Ao(t) {
3355
3366
  }
3356
- async function zo(t) {
3367
+ async function Lo(t) {
3357
3368
  }
3358
- const Jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3369
+ const zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3359
3370
  __proto__: null,
3360
- down: zo,
3361
- up: Lo
3371
+ down: Lo,
3372
+ up: Ao
3362
3373
  }, Symbol.toStringTag, { value: "Module" }));
3363
- async function Eo(t) {
3374
+ async function Jo(t) {
3364
3375
  }
3365
- async function Ko(t) {
3376
+ async function Eo(t) {
3366
3377
  }
3367
- const Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3378
+ const Ko = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3368
3379
  __proto__: null,
3369
- down: Ko,
3370
- up: Eo
3380
+ down: Eo,
3381
+ up: Jo
3371
3382
  }, Symbol.toStringTag, { value: "Module" }));
3372
- async function Uo(t) {
3383
+ async function Ro(t) {
3373
3384
  await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.notNull()).addColumn(
3374
3385
  "tenant_id",
3375
3386
  "varchar(255)",
@@ -3385,7 +3396,7 @@ async function Uo(t) {
3385
3396
  "code_type"
3386
3397
  ]).execute();
3387
3398
  }
3388
- async function Bo(t) {
3399
+ async function Uo(t) {
3389
3400
  await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
3390
3401
  "tenant_id",
3391
3402
  "varchar(255)",
@@ -3398,15 +3409,15 @@ async function Bo(t) {
3398
3409
  (e) => e.onDelete("cascade")
3399
3410
  ).addColumn("code_type", "varchar(255)", (e) => e.notNull()).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute();
3400
3411
  }
3401
- const Qo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3412
+ const Bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3402
3413
  __proto__: null,
3403
- down: Bo,
3404
- up: Uo
3414
+ down: Uo,
3415
+ up: Ro
3405
3416
  }, Symbol.toStringTag, { value: "Module" }));
3406
- async function qo(t) {
3417
+ async function Qo(t) {
3407
3418
  await t.schema.dropTable("otps").execute(), await t.schema.dropTable("authentication_codes").execute();
3408
3419
  }
3409
- async function Vo(t) {
3420
+ async function qo(t) {
3410
3421
  await t.schema.alterTable("keys").addColumn("private_key", "varchar(2048)").addColumn("public_key", "varchar(2048)").execute(), await t.schema.createTable("otps").addColumn(
3411
3422
  "tenant_id",
3412
3423
  "varchar(255)",
@@ -3425,32 +3436,32 @@ async function Vo(t) {
3425
3436
  (e) => e.references("applications.id").onDelete("cascade").notNull()
3426
3437
  ).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();
3427
3438
  }
3428
- const Wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3439
+ const Vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3429
3440
  __proto__: null,
3430
- down: Vo,
3431
- up: qo
3441
+ down: qo,
3442
+ up: Qo
3432
3443
  }, Symbol.toStringTag, { value: "Module" }));
3433
- async function Go(t) {
3444
+ async function Wo(t) {
3434
3445
  await t.schema.createIndex("IDX_logs_tenant_date_type_user").on("logs").columns(["tenant_id", "date", "type", "user_id"]).execute();
3435
3446
  }
3436
- async function Ho(t) {
3447
+ async function Go(t) {
3437
3448
  await t.schema.dropIndex("IDX_logs_tenant_date_type_user").on("logs").execute();
3438
3449
  }
3439
- const Xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3450
+ const Ho = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3440
3451
  __proto__: null,
3441
- down: Ho,
3442
- up: Go
3452
+ down: Go,
3453
+ up: Wo
3443
3454
  }, Symbol.toStringTag, { value: "Module" }));
3444
- async function Yo(t) {
3455
+ async function Xo(t) {
3445
3456
  }
3446
- async function Zo(t) {
3457
+ async function Yo(t) {
3447
3458
  }
3448
- const es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3459
+ const Zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3449
3460
  __proto__: null,
3450
- down: Zo,
3451
- up: Yo
3461
+ down: Yo,
3462
+ up: Xo
3452
3463
  }, Symbol.toStringTag, { value: "Module" }));
3453
- async function ts(t) {
3464
+ async function es(t) {
3454
3465
  await t.schema.createTable("prompt_settings").addColumn("tenant_id", "varchar(64)", (e) => e.primaryKey()).addColumn(
3455
3466
  "universal_login_experience",
3456
3467
  "varchar(16)",
@@ -3469,95 +3480,95 @@ async function ts(t) {
3469
3480
  (e) => e.defaultTo(!1).notNull()
3470
3481
  ).execute();
3471
3482
  }
3472
- async function as(t) {
3483
+ async function ts(t) {
3473
3484
  await t.schema.dropTable("prompt_settings").execute();
3474
3485
  }
3475
- const rs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3486
+ const as = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3476
3487
  __proto__: null,
3477
- down: as,
3478
- up: ts
3488
+ down: ts,
3489
+ up: es
3479
3490
  }, Symbol.toStringTag, { value: "Module" }));
3480
- async function ns(t) {
3491
+ async function rs(t) {
3481
3492
  }
3482
- async function os(t) {
3493
+ async function ns(t) {
3483
3494
  }
3484
- const ss = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3495
+ const os = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3485
3496
  __proto__: null,
3486
- down: os,
3487
- up: ns
3497
+ down: ns,
3498
+ up: rs
3488
3499
  }, Symbol.toStringTag, { value: "Module" }));
3489
- async function is(t) {
3500
+ async function ss(t) {
3490
3501
  }
3491
- async function ds(t) {
3502
+ async function is(t) {
3492
3503
  }
3493
- const cs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3504
+ const ls = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3494
3505
  __proto__: null,
3495
- down: ds,
3496
- up: is
3506
+ down: is,
3507
+ up: ss
3497
3508
  }, Symbol.toStringTag, { value: "Module" }));
3498
- async function ls(t) {
3509
+ async function ds(t) {
3499
3510
  }
3500
- async function us(t) {
3511
+ async function cs(t) {
3501
3512
  }
3502
- const ms = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3513
+ const us = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3503
3514
  __proto__: null,
3504
- down: us,
3505
- up: ls
3515
+ down: cs,
3516
+ up: ds
3506
3517
  }, Symbol.toStringTag, { value: "Module" }));
3507
- async function hs(t) {
3518
+ async function ms(t) {
3508
3519
  await t.schema.alterTable("logins").addColumn("authParams_ui_locales", "varchar(32)").execute();
3509
3520
  }
3510
- async function _s(t) {
3521
+ async function hs(t) {
3511
3522
  await t.schema.alterTable("logins").dropColumn("authParams_ui_locales").execute();
3512
3523
  }
3513
- const fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3524
+ const _s = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3514
3525
  __proto__: null,
3515
- down: _s,
3516
- up: hs
3526
+ down: hs,
3527
+ up: ms
3517
3528
  }, Symbol.toStringTag, { value: "Module" }));
3518
- async function ps(t) {
3529
+ async function fs(t) {
3519
3530
  await t.schema.alterTable("logins").addColumn("authParams_prompt", "varchar(16)").execute();
3520
3531
  }
3521
- async function gs(t) {
3532
+ async function ps(t) {
3522
3533
  await t.schema.alterTable("logins").dropColumn("authParams_prompt").execute();
3523
3534
  }
3524
- const ys = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3535
+ const gs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3525
3536
  __proto__: null,
3526
- down: gs,
3527
- up: ps
3537
+ down: ps,
3538
+ up: fs
3528
3539
  }, Symbol.toStringTag, { value: "Module" }));
3529
- async function ws(t) {
3540
+ async function ys(t) {
3530
3541
  }
3531
- async function vs(t) {
3542
+ async function ws(t) {
3532
3543
  }
3533
- const Ns = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3544
+ const vs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3534
3545
  __proto__: null,
3535
- down: vs,
3536
- up: ws
3546
+ down: ws,
3547
+ up: ys
3537
3548
  }, Symbol.toStringTag, { value: "Module" }));
3538
- async function Cs(t) {
3549
+ async function Ns(t) {
3539
3550
  await t.schema.alterTable("logins").addColumn("authParams_act_as", "varchar(255)").execute();
3540
3551
  }
3541
- async function bs(t) {
3552
+ async function Cs(t) {
3542
3553
  await t.schema.alterTable("logins").dropColumn("authParam_act_as").execute();
3543
3554
  }
3544
- const xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3555
+ const bs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3545
3556
  __proto__: null,
3546
- down: bs,
3547
- up: Cs
3557
+ down: Cs,
3558
+ up: Ns
3548
3559
  }, Symbol.toStringTag, { value: "Module" }));
3549
- async function Ts(t) {
3560
+ async function xs(t) {
3550
3561
  await t.schema.alterTable("codes").addColumn("code_verifier", "varchar(128)").execute();
3551
3562
  }
3552
- async function Ss(t) {
3563
+ async function Ts(t) {
3553
3564
  await t.schema.alterTable("codes").dropColumn("code_verifier").execute();
3554
3565
  }
3555
- const Os = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3566
+ const Ss = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3556
3567
  __proto__: null,
3557
- down: Ss,
3558
- up: Ts
3568
+ down: Ts,
3569
+ up: xs
3559
3570
  }, Symbol.toStringTag, { value: "Module" }));
3560
- async function ks(t) {
3571
+ async function Os(t) {
3561
3572
  await t.schema.createTable("email_providers").addColumn("tenant_id", "varchar(255)", (e) => e.primaryKey()).addColumn("name", "varchar(255)", (e) => e.notNull()).addColumn("enabled", "boolean", (e) => e.notNull()).addColumn("default_from_address", "varchar(255)").addColumn(
3562
3573
  "credentials",
3563
3574
  "varchar(2048)",
@@ -3568,18 +3579,18 @@ async function ks(t) {
3568
3579
  (e) => e.notNull().defaultTo("{}")
3569
3580
  ).addColumn("created_at", "varchar(29)", (e) => e.notNull()).addColumn("updated_at", "varchar(29)", (e) => e.notNull()).execute();
3570
3581
  }
3571
- async function $s(t) {
3582
+ async function ks(t) {
3572
3583
  await t.schema.dropTable("email_providers").execute();
3573
3584
  }
3574
- const Ds = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3585
+ const $s = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3575
3586
  __proto__: null,
3576
- down: $s,
3577
- up: ks
3587
+ down: ks,
3588
+ up: Os
3578
3589
  }, Symbol.toStringTag, { value: "Module" }));
3579
- async function Is(t) {
3590
+ async function Ds(t) {
3580
3591
  await t.schema.dropTable("tickets").execute();
3581
3592
  }
3582
- async function Ps(t) {
3593
+ async function Is(t) {
3583
3594
  await t.schema.createTable("tickets").addColumn(
3584
3595
  "tenant_id",
3585
3596
  "varchar(255)",
@@ -3592,20 +3603,20 @@ async function Ps(t) {
3592
3603
  }
3593
3604
  const js = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3594
3605
  __proto__: null,
3595
- down: Ps,
3596
- up: Is
3606
+ down: Is,
3607
+ up: Ds
3597
3608
  }, Symbol.toStringTag, { value: "Module" }));
3598
- async function Ms(t) {
3609
+ async function Ps(t) {
3599
3610
  }
3600
- async function Fs(t) {
3611
+ async function Ms(t) {
3601
3612
  await t.schema.alterTable("logins").dropColumn("ip").dropColumn("useragent").execute();
3602
3613
  }
3603
- const As = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3614
+ const Fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3604
3615
  __proto__: null,
3605
- down: Fs,
3606
- up: Ms
3616
+ down: Ms,
3617
+ up: Ps
3607
3618
  }, Symbol.toStringTag, { value: "Module" }));
3608
- async function Ls(t) {
3619
+ async function As(t) {
3609
3620
  await t.schema.createTable("refresh_tokens").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn(
3610
3621
  "client_id",
3611
3622
  "varchar(21)",
@@ -3618,27 +3629,27 @@ async function Ls(t) {
3618
3629
  (e) => e.onDelete("cascade")
3619
3630
  ).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("expires_at", "varchar(35)").addColumn("idle_expires_at", "varchar(35)").addColumn("last_exchanged_at", "varchar(35)").addColumn("device", "varchar(2048)", (e) => e.notNull()).addColumn("resource_servers", "varchar(2048)", (e) => e.notNull()).addColumn("rotating", "boolean", (e) => e.notNull()).execute();
3620
3631
  }
3621
- async function zs(t) {
3632
+ async function Ls(t) {
3622
3633
  await t.schema.dropTable("refresh_tokens").execute();
3623
3634
  }
3624
- const Js = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3635
+ const zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3625
3636
  __proto__: null,
3626
- down: zs,
3627
- up: Ls
3637
+ down: Ls,
3638
+ up: As
3628
3639
  }, Symbol.toStringTag, { value: "Module" }));
3629
- async function Es(t) {
3640
+ async function Js(t) {
3630
3641
  }
3631
- async function Ks(t) {
3642
+ async function Es(t) {
3632
3643
  }
3633
- const Rs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3644
+ const Ks = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3634
3645
  __proto__: null,
3635
- down: Ks,
3636
- up: Es
3646
+ down: Es,
3647
+ up: Js
3637
3648
  }, Symbol.toStringTag, { value: "Module" }));
3638
- async function Us(t) {
3649
+ async function Rs(t) {
3639
3650
  await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("refresh_tokens").execute();
3640
3651
  }
3641
- async function Bs(t) {
3652
+ async function Us(t) {
3642
3653
  await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
3643
3654
  "sessions_user_id_constraint",
3644
3655
  ["user_id", "tenant_id"],
@@ -3657,12 +3668,12 @@ async function Bs(t) {
3657
3668
  (e) => e.onDelete("cascade")
3658
3669
  ).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("expires_at", "varchar(35)").addColumn("idle_expires_at", "varchar(35)").addColumn("last_exchanged_at", "varchar(35)").addColumn("device", "varchar(2048)", (e) => e.notNull()).addColumn("resource_servers", "varchar(2048)", (e) => e.notNull()).addColumn("rotating", "boolean", (e) => e.notNull()).execute();
3659
3670
  }
3660
- const Qs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3671
+ const Bs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3661
3672
  __proto__: null,
3662
- down: Bs,
3663
- up: Us
3673
+ down: Us,
3674
+ up: Rs
3664
3675
  }, Symbol.toStringTag, { value: "Module" }));
3665
- async function qs(t) {
3676
+ async function Qs(t) {
3666
3677
  await t.schema.createTable("sessions_2").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
3667
3678
  "sessions_2_user_id_constraint",
3668
3679
  ["user_id", "tenant_id"],
@@ -3681,15 +3692,15 @@ async function qs(t) {
3681
3692
  (e) => e.onDelete("cascade")
3682
3693
  ).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("expires_at", "varchar(35)").addColumn("idle_expires_at", "varchar(35)").addColumn("last_exchanged_at", "varchar(35)").addColumn("device", "varchar(2048)", (e) => e.notNull()).addColumn("resource_servers", "varchar(2048)", (e) => e.notNull()).addColumn("rotating", "boolean", (e) => e.notNull()).execute();
3683
3694
  }
3684
- async function Vs(t) {
3695
+ async function qs(t) {
3685
3696
  await t.schema.dropTable("sessions_2").execute(), await t.schema.dropTable("refresh_tokens_2").execute();
3686
3697
  }
3687
- const Ws = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3698
+ const Vs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3688
3699
  __proto__: null,
3689
- down: Vs,
3690
- up: qs
3700
+ down: qs,
3701
+ up: Qs
3691
3702
  }, Symbol.toStringTag, { value: "Module" }));
3692
- async function Gs(t) {
3703
+ async function Ws(t) {
3693
3704
  await t.schema.createTable("custom_domains").addColumn(
3694
3705
  "custom_domain_id",
3695
3706
  "varchar(21)",
@@ -3700,49 +3711,49 @@ async function Gs(t) {
3700
3711
  (e) => e.references("tenants.id").onDelete("cascade").notNull()
3701
3712
  ).addColumn("domain", "varchar(255)", (e) => e.notNull()).addColumn("primary", "boolean", (e) => e.notNull()).addColumn("status", "varchar(50)", (e) => e.notNull()).addColumn("type", "varchar(50)", (e) => e.notNull()).addColumn("origin_domain_name", "varchar(255)").addColumn("verification", "varchar(2048)").addColumn("custom_client_ip_header", "varchar(50)").addColumn("tls_policy", "varchar(50)").addColumn("domain_metadata", "varchar(2048)").addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("updated_at", "varchar(35)", (e) => e.notNull()).execute(), await t.schema.dropTable("domains").execute();
3702
3713
  }
3703
- async function Hs(t) {
3714
+ async function Gs(t) {
3704
3715
  await t.schema.dropTable("custom_domains").execute(), await t.schema.createTable("domains").addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
3705
3716
  "tenant_id",
3706
3717
  "varchar(255)",
3707
3718
  (e) => e.references("tenants.id").onDelete("cascade").notNull()
3708
3719
  ).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();
3709
3720
  }
3710
- const Xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3721
+ const Hs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3711
3722
  __proto__: null,
3712
- down: Hs,
3713
- up: Gs
3723
+ down: Gs,
3724
+ up: Ws
3714
3725
  }, Symbol.toStringTag, { value: "Module" }));
3715
- async function Ys(t) {
3726
+ async function Xs(t) {
3716
3727
  }
3717
- async function Zs(t) {
3728
+ async function Ys(t) {
3718
3729
  await t.schema.alterTable("logins").dropColumn("authParams_organization").dropColumn("authorization_url").execute();
3719
3730
  }
3720
- const ei = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3731
+ const Zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3721
3732
  __proto__: null,
3722
- down: Zs,
3723
- up: Ys
3733
+ down: Ys,
3734
+ up: Xs
3724
3735
  }, Symbol.toStringTag, { value: "Module" }));
3725
- async function ti(t) {
3736
+ async function ei(t) {
3726
3737
  await t.schema.alterTable("logins").dropColumn("authorization_url").execute(), await t.schema.alterTable("logins").addColumn("authorization_url", "varchar(2048)").execute();
3727
3738
  }
3728
- async function ai(t) {
3739
+ async function ti(t) {
3729
3740
  await t.schema.alterTable("logins").dropColumn("authorization_url").execute(), await t.schema.alterTable("logins").addColumn("authorization_url", "varchar(1024)").execute();
3730
3741
  }
3731
- const ri = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3742
+ const ai = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3732
3743
  __proto__: null,
3733
- down: ai,
3734
- up: ti
3744
+ down: ti,
3745
+ up: ei
3735
3746
  }, Symbol.toStringTag, { value: "Module" }));
3736
- async function ni(t) {
3747
+ async function ri(t) {
3737
3748
  }
3738
- async function oi(t) {
3749
+ async function ni(t) {
3739
3750
  }
3740
- const si = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3751
+ const oi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3741
3752
  __proto__: null,
3742
- down: oi,
3743
- up: ni
3753
+ down: ni,
3754
+ up: ri
3744
3755
  }, Symbol.toStringTag, { value: "Module" }));
3745
- async function ii(t) {
3756
+ async function si(t) {
3746
3757
  await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
3747
3758
  "sessions_user_id_constraint",
3748
3759
  ["user_id", "tenant_id"],
@@ -3769,25 +3780,25 @@ async function ii(t) {
3769
3780
  (e) => e.onDelete("cascade")
3770
3781
  ).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("expires_at", "varchar(35)").addColumn("idle_expires_at", "varchar(35)").addColumn("last_exchanged_at", "varchar(35)").addColumn("device", "varchar(2048)", (e) => e.notNull()).addColumn("resource_servers", "varchar(2048)", (e) => e.notNull()).addColumn("rotating", "boolean", (e) => e.notNull()).execute();
3771
3782
  }
3772
- async function di(t) {
3783
+ async function ii(t) {
3773
3784
  await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("login_sessions").execute(), await t.schema.dropTable("refresh_tokens").execute();
3774
3785
  }
3775
- const ci = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3786
+ const li = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3776
3787
  __proto__: null,
3777
- down: di,
3778
- up: ii
3788
+ down: ii,
3789
+ up: si
3779
3790
  }, Symbol.toStringTag, { value: "Module" }));
3780
- async function li(t) {
3791
+ async function di(t) {
3781
3792
  await t.schema.dropTable("logins").execute(), await t.schema.dropTable("sessions_2").execute(), await t.schema.dropTable("refresh_tokens_2").execute();
3782
3793
  }
3783
- async function ui(t) {
3794
+ async function ci(t) {
3784
3795
  }
3785
- const mi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3796
+ const ui = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3786
3797
  __proto__: null,
3787
- down: ui,
3788
- up: li
3798
+ down: ci,
3799
+ up: di
3789
3800
  }, Symbol.toStringTag, { value: "Module" }));
3790
- async function hi(t) {
3801
+ async function mi(t) {
3791
3802
  await t.schema.dropTable("custom_domains").execute(), await t.schema.createTable("custom_domains").addColumn(
3792
3803
  "custom_domain_id",
3793
3804
  "varchar(256)",
@@ -3798,117 +3809,161 @@ async function hi(t) {
3798
3809
  (e) => e.references("tenants.id").onDelete("cascade").notNull()
3799
3810
  ).addColumn("domain", "varchar(255)", (e) => e.notNull()).addColumn("primary", "boolean", (e) => e.notNull()).addColumn("status", "varchar(50)", (e) => e.notNull()).addColumn("type", "varchar(50)", (e) => e.notNull()).addColumn("origin_domain_name", "varchar(255)").addColumn("verification", "varchar(2048)").addColumn("custom_client_ip_header", "varchar(50)").addColumn("tls_policy", "varchar(50)").addColumn("domain_metadata", "varchar(2048)").addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("updated_at", "varchar(35)", (e) => e.notNull()).execute();
3800
3811
  }
3801
- async function _i(t) {
3812
+ async function hi(t) {
3802
3813
  }
3803
- const fi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3814
+ const _i = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3804
3815
  __proto__: null,
3805
- down: _i,
3806
- up: hi
3816
+ down: hi,
3817
+ up: mi
3807
3818
  }, Symbol.toStringTag, { value: "Module" }));
3808
- async function pi(t) {
3819
+ async function fi(t) {
3809
3820
  }
3810
- async function gi(t) {
3821
+ async function pi(t) {
3811
3822
  await t.schema.alterTable("users").dropColumn("phone_number").dropColumn("phone_verified").dropColumn("username").execute();
3812
3823
  }
3813
- const yi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3824
+ const gi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3814
3825
  __proto__: null,
3815
- down: gi,
3816
- up: pi
3826
+ down: pi,
3827
+ up: fi
3817
3828
  }, Symbol.toStringTag, { value: "Module" }));
3818
- async function wi(t) {
3829
+ async function yi(t) {
3819
3830
  await t.schema.createTable("forms").addColumn("id", "varchar(255)", (e) => e.primaryKey()).addColumn("name", "varchar(255)", (e) => e.notNull()).addColumn("tenant_id", "varchar(255)", (e) => e.notNull()).addColumn("messages", "varchar(255)").addColumn("languages", "varchar(255)").addColumn("translations", "varchar(4096)").addColumn("nodes", "varchar(4096)").addColumn("start", "varchar(255)").addColumn("ending", "varchar(255)").addColumn("style", "varchar(1042)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("updated_at", "varchar(255)", (e) => e.notNull()).execute(), await t.schema.createIndex("forms_tenant_id_idx").on("forms").column("tenant_id").execute();
3820
3831
  }
3821
- async function vi(t) {
3832
+ async function wi(t) {
3822
3833
  await t.schema.dropTable("forms").execute();
3823
3834
  }
3824
- const Ni = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3835
+ const vi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3836
+ __proto__: null,
3837
+ down: wi,
3838
+ up: yi
3839
+ }, Symbol.toStringTag, { value: "Module" }));
3840
+ async function Ni(t) {
3841
+ await t.schema.alterTable("hooks").addColumn("form_id", "text").execute(), await t.schema.alterTable("hooks").addColumn("url_tmp", "varchar(512)").execute(), await t.updateTable("hooks").set((e) => ({ url_tmp: e.ref("url") })).execute(), await t.schema.alterTable("hooks").dropColumn("url").execute(), await t.schema.alterTable("hooks").renameColumn("url_tmp", "url").execute();
3842
+ }
3843
+ async function Ci(t) {
3844
+ await t.schema.dropTable("hooks").ifExists().execute(), await t.schema.createTable("hooks").addColumn("hook_id", "text", (e) => e.primaryKey()).addColumn("tenant_id", "text", (e) => e.notNull()).addColumn("trigger_id", "text", (e) => e.notNull()).addColumn("enabled", "integer", (e) => e.notNull().defaultTo(0)).addColumn("url", "varchar(512)", (e) => e.notNull()).addColumn("synchronous", "integer", (e) => e.notNull().defaultTo(0)).addColumn("priority", "integer").addColumn("created_at", "text", (e) => e.notNull()).addColumn("updated_at", "text", (e) => e.notNull()).execute();
3845
+ }
3846
+ const bi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3825
3847
  __proto__: null,
3826
- down: vi,
3827
- up: wi
3848
+ down: Ci,
3849
+ up: Ni
3850
+ }, Symbol.toStringTag, { value: "Module" }));
3851
+ async function xi(t) {
3852
+ await t.schema.alterTable("login_sessions").addColumn(
3853
+ "login_completed",
3854
+ "boolean",
3855
+ (e) => e.notNull().defaultTo(0)
3856
+ ).execute();
3857
+ }
3858
+ async function Ti(t) {
3859
+ await t.schema.alterTable("login_sessions").dropColumn("login_completed").execute();
3860
+ }
3861
+ const Si = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3862
+ __proto__: null,
3863
+ down: Ti,
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
3828
3880
  }, Symbol.toStringTag, { value: "Module" })), ze = {
3829
- m1_init: Ga,
3830
- m2_magicLink: Ya,
3831
- m3_updateAt: tr,
3832
- m4_logTable: nr,
3833
- m5_userProfile: ir,
3834
- m6_sessions: lr,
3835
- m7_passwords: hr,
3836
- m8_logsTableNewFields: pr,
3837
- m9_passwordTableNewField: wr,
3838
- n01_codesTable: Cr,
3839
- n11_universalLoginSession: Tr,
3840
- n12_userFields: kr,
3841
- n13_userEmailIndex: Ir,
3842
- n14_profileDataField: Mr,
3843
- n15_userEmailIndex: Lr,
3844
- n16_userLocale: Er,
3845
- n17_signingKeys: Ur,
3846
- n18_logsFields: qr,
3847
- n19_connectionsUserinfo: Gr,
3848
- n20_missingFields: Yr,
3849
- n21_sessionDeletedAt: tn,
3850
- n22_dropLogsFields: nn,
3851
- n23_dropUsersFields: dn,
3852
- n24_logsIndexes: un,
3853
- n25_logDescMaxLength: _n,
3854
- n26_logsTableExtraFields: gn,
3855
- n27_usersTableNameIndex: vn,
3856
- n28_usersEmailConstrain: bn,
3857
- n29_increaseOtpStateLength: Sn,
3858
- n30_increaseTicketStateLength: $n,
3859
- n31_branding: Pn,
3860
- n32_indexesAndNotNull: Fn,
3861
- n33_vendorIdInUniversalLoginSession: zn,
3862
- n34_auth0ClientInUniversalLoginSession: Kn,
3863
- n35_increaseUniversalSessionStateLength: Bn,
3864
- n36_authenticationCodes: Vn,
3865
- n37_disableSignUps: Hn,
3866
- n38_otpIpAddress: Zn,
3867
- n39_increaseUserAgentLength: ao,
3868
- n40_userId: oo,
3869
- n41_hooks: co,
3870
- n42_userIdIndexes: mo,
3871
- n43_userIdIndexes: fo,
3872
- n44_codes: yo,
3873
- n45_hookProperties: No,
3874
- n46_loginAuth0Client: xo,
3875
- n47_loginAuth0Client: Oo,
3876
- n48_saml: Do,
3881
+ m1_init: Wa,
3882
+ m2_magicLink: Xa,
3883
+ m3_updateAt: er,
3884
+ m4_logTable: rr,
3885
+ m5_userProfile: sr,
3886
+ m6_sessions: dr,
3887
+ m7_passwords: mr,
3888
+ m8_logsTableNewFields: fr,
3889
+ m9_passwordTableNewField: yr,
3890
+ n01_codesTable: Nr,
3891
+ n11_universalLoginSession: xr,
3892
+ n12_userFields: Or,
3893
+ n13_userEmailIndex: Dr,
3894
+ n14_profileDataField: Pr,
3895
+ n15_userEmailIndex: Ar,
3896
+ n16_userLocale: Jr,
3897
+ n17_signingKeys: Rr,
3898
+ n18_logsFields: Qr,
3899
+ n19_connectionsUserinfo: Wr,
3900
+ n20_missingFields: Xr,
3901
+ n21_sessionDeletedAt: en,
3902
+ n22_dropLogsFields: rn,
3903
+ n23_dropUsersFields: sn,
3904
+ n24_logsIndexes: cn,
3905
+ n25_logDescMaxLength: hn,
3906
+ n26_logsTableExtraFields: pn,
3907
+ n27_usersTableNameIndex: wn,
3908
+ n28_usersEmailConstrain: Cn,
3909
+ n29_increaseOtpStateLength: Tn,
3910
+ n30_increaseTicketStateLength: kn,
3911
+ n31_branding: In,
3912
+ n32_indexesAndNotNull: Mn,
3913
+ n33_vendorIdInUniversalLoginSession: Ln,
3914
+ n34_auth0ClientInUniversalLoginSession: En,
3915
+ n35_increaseUniversalSessionStateLength: Un,
3916
+ n36_authenticationCodes: qn,
3917
+ n37_disableSignUps: Gn,
3918
+ n38_otpIpAddress: Yn,
3919
+ n39_increaseUserAgentLength: to,
3920
+ n40_userId: no,
3921
+ n41_hooks: io,
3922
+ n42_userIdIndexes: uo,
3923
+ n43_userIdIndexes: _o,
3924
+ n44_codes: go,
3925
+ n45_hookProperties: vo,
3926
+ n46_loginAuth0Client: bo,
3927
+ n47_loginAuth0Client: So,
3928
+ n48_saml: $o,
3877
3929
  n49_removeFields: jo,
3878
- n50_authParamsNonce: Ao,
3879
- n51_connectionid: Jo,
3880
- n52_cert: Ro,
3881
- n53_codes_primary_key: Qo,
3882
- n54_cleanup_tables: Wo,
3883
- n55_logs_index: Xo,
3884
- n56_application_fields: es,
3885
- n57_prompt_settings: rs,
3886
- n58_connection_client_id: ss,
3887
- n59_connection_options: cs,
3888
- n60_users_metadata: ms,
3889
- n61_userLocales: fs,
3890
- n62_prompt: ys,
3891
- n63_connection_cleanup: Ns,
3892
- n64_act_as: xs,
3893
- n65_code_verifier: Os,
3894
- n66_email_providers: Ds,
3930
+ n50_authParamsNonce: Fo,
3931
+ n51_connectionid: zo,
3932
+ n52_cert: Ko,
3933
+ n53_codes_primary_key: Bo,
3934
+ n54_cleanup_tables: Vo,
3935
+ n55_logs_index: Ho,
3936
+ n56_application_fields: Zo,
3937
+ n57_prompt_settings: as,
3938
+ n58_connection_client_id: os,
3939
+ n59_connection_options: ls,
3940
+ n60_users_metadata: us,
3941
+ n61_userLocales: _s,
3942
+ n62_prompt: gs,
3943
+ n63_connection_cleanup: vs,
3944
+ n64_act_as: bs,
3945
+ n65_code_verifier: Ss,
3946
+ n66_email_providers: $s,
3895
3947
  n67_drop_tickets: js,
3896
- n68_login_useragents: As,
3897
- n70_refresh_tokens: Js,
3898
- n71_session_new_fields: Rs,
3899
- n72_session_primary_key: Qs,
3900
- n73_drop_sessions: Ws,
3901
- n74_custom_domains: Xs,
3902
- n75_organizations: ei,
3903
- n76_authorization_url_length: ri,
3904
- n77_drop_sessions: si,
3905
- n78_login_sessions: ci,
3906
- n79_drop_sessions_2: mi,
3907
- n80_recreate_custom_domains: fi,
3908
- n81_phone: yi,
3909
- n82_forms: Ni
3948
+ n68_login_useragents: Fs,
3949
+ n70_refresh_tokens: zs,
3950
+ n71_session_new_fields: Ks,
3951
+ n72_session_primary_key: Bs,
3952
+ n73_drop_sessions: Vs,
3953
+ n74_custom_domains: Hs,
3954
+ n75_organizations: Zs,
3955
+ n76_authorization_url_length: ai,
3956
+ n77_drop_sessions: oi,
3957
+ n78_login_sessions: li,
3958
+ n79_drop_sessions_2: ui,
3959
+ n80_recreate_custom_domains: _i,
3960
+ n81_phone: gi,
3961
+ n82_forms: vi,
3962
+ n83_addFormsIdToHooks: bi,
3963
+ n84_login_completed: Si,
3964
+ n85_add_login_session_id_to_sessions: $i
3910
3965
  };
3911
- async function Si(t, e = !1) {
3966
+ async function Mi(t, e = !1) {
3912
3967
  e && console.log("migrating...");
3913
3968
  const a = new Le(ze), r = new Ce({
3914
3969
  db: t,
@@ -3921,7 +3976,7 @@ async function Si(t, e = !1) {
3921
3976
  }), n)
3922
3977
  throw console.error("failed to migrate"), console.error(n), n;
3923
3978
  }
3924
- async function Oi(t) {
3979
+ async function Fi(t) {
3925
3980
  console.log("migrating...");
3926
3981
  const e = new Le(ze), a = new Ce({
3927
3982
  db: t,
@@ -3932,32 +3987,32 @@ async function Oi(t) {
3932
3987
  }), r)
3933
3988
  throw console.error("failed to migrate"), console.error(r), r;
3934
3989
  }
3935
- function ki(t) {
3990
+ function Ai(t) {
3936
3991
  return {
3937
- applications: Pt(t),
3992
+ applications: jt(t),
3938
3993
  branding: Zt(t),
3939
- cleanup: Da(t),
3994
+ cleanup: $a(t),
3940
3995
  clients: Jt(t),
3941
3996
  codes: St(t),
3942
3997
  connections: zt(t),
3943
- emailProviders: ba(t),
3998
+ emailProviders: Ca(t),
3944
3999
  customDomains: Ht(t),
3945
- forms: Aa(t),
4000
+ forms: Fa(t),
3946
4001
  hooks: oa(t),
3947
4002
  keys: Ut(t),
3948
- loginSessions: pa(t),
3949
- logs: lt(t),
4003
+ loginSessions: fa(t),
4004
+ logs: ct(t),
3950
4005
  passwords: vt(t),
3951
- promptSettings: wa(t),
3952
- refreshTokens: $a(t),
4006
+ promptSettings: ya(t),
4007
+ refreshTokens: ka(t),
3953
4008
  sessions: pt(t),
3954
4009
  tenants: ot(t),
3955
- themes: ua(t),
4010
+ themes: ca(t),
3956
4011
  users: Ye(t)
3957
4012
  };
3958
4013
  }
3959
4014
  export {
3960
- ki as default,
3961
- Oi as migrateDown,
3962
- Si as migrateToLatest
4015
+ Ai as default,
4016
+ Fi as migrateDown,
4017
+ Mi as migrateToLatest
3963
4018
  };