@authhero/kysely-adapter 10.10.0 → 10.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
- var ze = Object.defineProperty;
2
- var le = (t) => {
1
+ var Je = Object.defineProperty;
2
+ var ue = (t) => {
3
3
  throw TypeError(t);
4
4
  };
5
- var Ee = (t, e, a) => e in t ? ze(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), R = (t, e, a) => e.has(t) || le("Cannot " + a);
7
- var c = (t, e, a) => (R(t, e, "read from private field"), a ? a.call(t) : e.get(t)), y = (t, e, a) => e.has(t) ? le("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, a), M = (t, e, a, r) => (R(t, e, "write to private field"), r ? r.call(t, a) : e.set(t, a), a), u = (t, e, a) => (R(t, e, "access private method"), a);
8
- import { parseUserId as Y, codeSchema as Je, connectionSchema as Ke, loginSessionSchema as Re, promptSettingSchema as Ue } from "@authhero/adapter-interfaces";
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 d = (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);
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) {
@@ -23,7 +23,7 @@ var V = class extends Error {
23
23
  });
24
24
  }
25
25
  };
26
- function Be(t) {
26
+ function Qe(t) {
27
27
  return async (e, a) => {
28
28
  const { identities: r, ...o } = a, n = {
29
29
  ...o,
@@ -56,7 +56,7 @@ function _(t) {
56
56
  e[a] === null ? delete e[a] : typeof e[a] == "object" && (Array.isArray(e[a]) ? e[a] = e[a].map(_) : e[a] = _(e[a]));
57
57
  return e;
58
58
  }
59
- function fe(t) {
59
+ function pe(t) {
60
60
  let e = {};
61
61
  try {
62
62
  e = JSON.parse(t.profileData || "{}");
@@ -66,7 +66,7 @@ function fe(t) {
66
66
  return {
67
67
  connection: t.connection,
68
68
  provider: t.provider,
69
- user_id: Y(t.user_id).id,
69
+ user_id: Z(t.user_id).id,
70
70
  isSocial: !!t.is_social,
71
71
  profileData: {
72
72
  email: t.email,
@@ -75,7 +75,7 @@ function fe(t) {
75
75
  }
76
76
  };
77
77
  }
78
- function Qe(t) {
78
+ function qe(t) {
79
79
  return async (e, a) => {
80
80
  const [r, o] = await Promise.all([
81
81
  t.selectFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", a).selectAll().executeTakeFirst(),
@@ -94,22 +94,22 @@ function Qe(t) {
94
94
  {
95
95
  connection: r.connection,
96
96
  provider: r.provider,
97
- user_id: Y(r.user_id).id,
97
+ user_id: Z(r.user_id).id,
98
98
  isSocial: !!r.is_social
99
99
  },
100
- ...o.map(fe)
100
+ ...o.map(pe)
101
101
  ]
102
102
  };
103
103
  return _(l);
104
104
  };
105
105
  }
106
- function O(t, e, a, r) {
106
+ function T(t, e, a, r) {
107
107
  return a.split(/\s+/).map((n) => n.replace(/^([^:]+)=/g, "$1:")).map((n) => {
108
- let s = n.startsWith("-"), l, d, g, m;
109
- return n.startsWith("-_exists_:") ? (l = n.substring(10), g = !0, s = !0) : n.startsWith("_exists_:") ? (l = n.substring(9), g = !0, s = !1) : n.includes(":") ? (s = n.startsWith("-"), [l, d] = s ? n.substring(1).split(":") : n.split(":"), g = !1, d.startsWith(">=") ? (m = ">=", d = d.substring(2)) : d.startsWith(">") ? (m = ">", d = d.substring(1)) : d.startsWith("<=") ? (m = "<=", d = d.substring(2)) : d.startsWith("<") ? (m = "<", d = d.substring(1)) : m = "=") : (l = null, d = n, g = !1), { key: l, value: d, isNegation: s, isExistsQuery: g, operator: m };
110
- }).forEach(({ key: n, value: s, isNegation: l, isExistsQuery: d, operator: g }) => {
108
+ let s = n.startsWith("-"), l, c, g, m;
109
+ return n.startsWith("-_exists_:") ? (l = n.substring(10), g = !0, s = !0) : n.startsWith("_exists_:") ? (l = n.substring(9), g = !0, s = !1) : n.includes(":") ? (s = n.startsWith("-"), [l, c] = s ? n.substring(1).split(":") : n.split(":"), g = !1, c.startsWith(">=") ? (m = ">=", c = c.substring(2)) : c.startsWith(">") ? (m = ">", c = c.substring(1)) : c.startsWith("<=") ? (m = "<=", c = c.substring(2)) : c.startsWith("<") ? (m = "<", c = c.substring(1)) : m = "=") : (l = null, c = n, g = !1), { key: l, value: c, isNegation: s, isExistsQuery: g, operator: m };
110
+ }).forEach(({ key: n, value: s, isNegation: l, isExistsQuery: c, operator: g }) => {
111
111
  if (n)
112
- if (d)
112
+ if (c)
113
113
  l ? e = e.where(n, "is", null) : e = e.where(n, "is not", null);
114
114
  else if (l)
115
115
  switch (g) {
@@ -134,13 +134,13 @@ function O(t, e, a, r) {
134
134
  const { ref: m } = t.dynamic;
135
135
  e = e.where(
136
136
  (w) => w.or(
137
- r.map((b) => w(m(b), "like", `%${s}%`))
137
+ r.map((x) => w(m(x), "like", `%${s}%`))
138
138
  )
139
139
  );
140
140
  }
141
141
  }), e;
142
142
  }
143
- function x(t) {
143
+ function b(t) {
144
144
  return typeof t == "string" ? parseInt(t, 10) : typeof t == "bigint" ? Number(t) : t;
145
145
  }
146
146
  function Ve(t) {
@@ -150,13 +150,13 @@ function Ve(t) {
150
150
  include_totals: !1
151
151
  }) => {
152
152
  let r = t.selectFrom("users").where("users.tenant_id", "=", e);
153
- if (a.q && (r = O(t, r, a.q, ["email", "name"])), a.sort && a.sort.sort_by) {
153
+ if (a.q && (r = T(t, r, a.q, ["email", "name"])), a.sort && a.sort.sort_by) {
154
154
  const { ref: m } = t.dynamic;
155
155
  r = r.orderBy(m(a.sort.sort_by), a.sort.sort_order);
156
156
  }
157
- const n = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), s = n.map((m) => m.user_id), l = s.length ? await t.selectFrom("users").selectAll().where("users.tenant_id", "=", e).where("users.linked_to", "in", s).execute() : [], d = n.map((m) => {
157
+ const n = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), s = n.map((m) => m.user_id), l = s.length ? await t.selectFrom("users").selectAll().where("users.tenant_id", "=", e).where("users.linked_to", "in", s).execute() : [], c = n.map((m) => {
158
158
  const w = l.filter(
159
- (b) => b.linked_to === m.user_id
159
+ (x) => x.linked_to === m.user_id
160
160
  );
161
161
  return _({
162
162
  ...m,
@@ -168,66 +168,66 @@ function Ve(t) {
168
168
  {
169
169
  connection: m.connection,
170
170
  provider: m.provider,
171
- user_id: Y(m.user_id).id,
171
+ user_id: Z(m.user_id).id,
172
172
  isSocial: !!m.is_social
173
173
  },
174
- ...w.map(fe)
174
+ ...w.map(pe)
175
175
  ]
176
176
  });
177
177
  }), { count: g } = await r.select((m) => m.fn.countAll().as("count")).executeTakeFirstOrThrow();
178
178
  return {
179
- users: d,
179
+ users: c,
180
180
  start: a.page * a.per_page,
181
181
  limit: a.per_page,
182
- length: x(g)
182
+ length: b(g)
183
183
  };
184
184
  };
185
185
  }
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 qe(t) {
189
+ function Ge(t) {
190
190
  if (t.email_verified !== void 0)
191
191
  return t.email_verified ? 1 : 0;
192
192
  }
193
- function Ge(t) {
193
+ function He(t) {
194
194
  return async (e, a, r) => {
195
195
  const o = {
196
196
  ...r,
197
- email_verified: qe(r),
197
+ email_verified: Ge(r),
198
198
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
199
199
  };
200
200
  return r.app_metadata && (o.app_metadata = JSON.stringify(r.app_metadata)), r.user_metadata && (o.user_metadata = JSON.stringify(r.user_metadata)), (await t.updateTable("users").set(o).where("users.tenant_id", "=", e).where("users.user_id", "=", a).execute()).length === 1;
201
201
  };
202
202
  }
203
- function He(t) {
203
+ function Xe(t) {
204
204
  return async (e, a, r, o) => {
205
205
  const n = { linked_to: null };
206
206
  return (await t.updateTable("users").set(n).where("users.tenant_id", "=", e).where("users.user_id", "=", `${r}|${o}`).where("users.linked_to", "=", `${a}`).execute()).length === 1;
207
207
  };
208
208
  }
209
- function Xe(t) {
209
+ function Ye(t) {
210
210
  return {
211
- create: Be(t),
211
+ create: Qe(t),
212
212
  remove: We(t),
213
- get: Qe(t),
213
+ get: qe(t),
214
214
  list: Ve(t),
215
- update: Ge(t),
215
+ update: He(t),
216
216
  // TODO - think about this more when other issues fixed
217
- unlink: He(t)
217
+ unlink: Xe(t)
218
218
  };
219
219
  }
220
- const Ye = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
221
- let k = (t = 21) => {
220
+ const Ze = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
221
+ let S = (t = 21) => {
222
222
  let e = "", a = crypto.getRandomValues(new Uint8Array(t));
223
223
  for (; t--; )
224
- e += Ye[a[t] & 63];
224
+ e += Ze[a[t] & 63];
225
225
  return e;
226
226
  };
227
- function Ze(t) {
227
+ function et(t) {
228
228
  return async (e) => {
229
229
  const a = {
230
- id: e.id || k(),
230
+ id: e.id || S(),
231
231
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
232
232
  updated_at: (/* @__PURE__ */ new Date()).toISOString(),
233
233
  ...e
@@ -235,13 +235,13 @@ function Ze(t) {
235
235
  return await t.insertInto("tenants").values(a).execute(), a;
236
236
  };
237
237
  }
238
- function et(t) {
238
+ function tt(t) {
239
239
  return async (e) => {
240
240
  const a = await t.selectFrom("tenants").where("tenants.id", "=", e).selectAll().executeTakeFirst();
241
241
  return a ? _(a) : null;
242
242
  };
243
243
  }
244
- function tt(t) {
244
+ function at(t) {
245
245
  return async (e = {
246
246
  page: 0,
247
247
  per_page: 50,
@@ -258,7 +258,7 @@ function tt(t) {
258
258
  return {
259
259
  tenants: o
260
260
  };
261
- const { count: n } = await a.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow(), s = x(n);
261
+ const { count: n } = await a.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow(), s = b(n);
262
262
  return {
263
263
  tenants: o.map(_),
264
264
  start: (e.page - 1) * e.per_page,
@@ -267,7 +267,7 @@ function tt(t) {
267
267
  };
268
268
  };
269
269
  }
270
- function at(t) {
270
+ function rt(t) {
271
271
  return async (e, a) => {
272
272
  const r = {
273
273
  ...a,
@@ -277,29 +277,29 @@ function at(t) {
277
277
  await t.updateTable("tenants").set(r).where("id", "=", e).execute();
278
278
  };
279
279
  }
280
- function rt(t) {
280
+ function nt(t) {
281
281
  return async (e) => (await t.deleteFrom("tenants").where("tenants.id", "=", e).execute()).length === 1;
282
282
  }
283
- function nt(t) {
283
+ function ot(t) {
284
284
  return {
285
- create: Ze(t),
286
- get: et(t),
287
- list: tt(t),
288
- update: at(t),
289
- remove: rt(t)
285
+ create: et(t),
286
+ get: tt(t),
287
+ list: at(t),
288
+ update: rt(t),
289
+ remove: nt(t)
290
290
  };
291
291
  }
292
- function ue(t) {
292
+ function me(t) {
293
293
  return t ? JSON.stringify(t) : void 0;
294
294
  }
295
- const ot = 1024;
296
- function st(t) {
295
+ const st = 1024;
296
+ function it(t) {
297
297
  return async (e, a) => {
298
298
  var o, n, s;
299
299
  const r = {
300
- id: k(),
300
+ id: S(),
301
301
  ...a,
302
- user_agent: a.user_agent.slice(0, ot)
302
+ user_agent: a.user_agent.slice(0, st)
303
303
  };
304
304
  return await t.insertInto("logs").values({
305
305
  ...r,
@@ -308,12 +308,12 @@ function st(t) {
308
308
  isMobile: a.isMobile ? 1 : 0,
309
309
  tenant_id: e,
310
310
  scope: (n = a.scope) == null ? void 0 : n.join(","),
311
- auth0_client: ue(a.auth0_client),
312
- details: (s = ue(a.details)) == null ? void 0 : s.substring(0, 8192)
311
+ auth0_client: me(a.auth0_client),
312
+ details: (s = me(a.details)) == null ? void 0 : s.substring(0, 8192)
313
313
  }).execute(), r;
314
314
  };
315
315
  }
316
- function me(t) {
316
+ function he(t) {
317
317
  if (!t)
318
318
  return "";
319
319
  try {
@@ -322,27 +322,27 @@ function me(t) {
322
322
  return t;
323
323
  }
324
324
  }
325
- function pe(t) {
325
+ function ge(t) {
326
326
  return {
327
327
  ...t,
328
328
  client_id: t.client_id,
329
329
  client_name: "",
330
- auth0_client: me(t.auth0_client),
331
- details: me(t.details),
330
+ auth0_client: he(t.auth0_client),
331
+ details: he(t.details),
332
332
  isMobile: !!t.isMobile,
333
333
  scope: t.scope ? t.scope.split(",") : void 0,
334
334
  log_id: t.id,
335
335
  _id: t.id
336
336
  };
337
337
  }
338
- function it(t) {
338
+ function ct(t) {
339
339
  return async (e, a = {
340
340
  page: 0,
341
341
  per_page: 50,
342
342
  include_totals: !1
343
343
  }) => {
344
344
  let r = t.selectFrom("logs").where("logs.tenant_id", "=", e);
345
- a.q && (r = O(t, r, a.q, ["user_id", "ip"]));
345
+ a.q && (r = T(t, r, a.q, ["user_id", "ip"]));
346
346
  let o = r;
347
347
  if (a.sort && a.sort.sort_by) {
348
348
  const { ref: l } = t.dynamic;
@@ -354,27 +354,27 @@ function it(t) {
354
354
  o = o.offset(a.page * a.per_page).limit(a.per_page);
355
355
  const n = await o.selectAll().execute(), { count: s } = await r.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow();
356
356
  return {
357
- logs: n.map(pe),
357
+ logs: n.map(ge),
358
358
  start: a.page * a.per_page,
359
359
  limit: a.per_page,
360
- length: x(s)
360
+ length: b(s)
361
361
  };
362
362
  };
363
363
  }
364
- function dt(t) {
364
+ function lt(t) {
365
365
  return async (e, a) => {
366
366
  const r = await t.selectFrom("logs").where("logs.tenant_id", "=", e).where("logs.id", "=", a).selectAll().executeTakeFirst();
367
- return r ? pe(r) : null;
367
+ return r ? ge(r) : null;
368
368
  };
369
369
  }
370
- function ct(t) {
370
+ function dt(t) {
371
371
  return {
372
- create: st(t),
373
- list: it(t),
374
- get: dt(t)
372
+ create: it(t),
373
+ list: ct(t),
374
+ get: lt(t)
375
375
  };
376
376
  }
377
- function lt(t) {
377
+ function ut(t) {
378
378
  return async (e, a) => {
379
379
  const r = await t.selectFrom("sessions").where("sessions.tenant_id", "=", e).where("sessions.id", "=", a).selectAll().executeTakeFirst();
380
380
  if (!r)
@@ -387,7 +387,7 @@ function lt(t) {
387
387
  };
388
388
  };
389
389
  }
390
- function ut(t) {
390
+ function mt(t) {
391
391
  return async (e, a) => {
392
392
  const r = {
393
393
  ...a,
@@ -404,10 +404,10 @@ function ut(t) {
404
404
  }).execute(), r;
405
405
  };
406
406
  }
407
- function mt(t) {
407
+ function ht(t) {
408
408
  return async (e, a) => !!(await t.deleteFrom("sessions").where("tenant_id", "=", e).where("sessions.id", "=", a).execute()).length;
409
409
  }
410
- function ht(t) {
410
+ function _t(t) {
411
411
  return async (e, a, r) => {
412
412
  const o = {
413
413
  ...r,
@@ -418,29 +418,29 @@ function ht(t) {
418
418
  return !!(await t.updateTable("sessions").set(o).where("tenant_id", "=", e).where("sessions.id", "=", a).execute()).length;
419
419
  };
420
420
  }
421
- function _t(t) {
421
+ function ft(t) {
422
422
  return async (e, a = {
423
423
  page: 0,
424
424
  per_page: 50,
425
425
  include_totals: !1
426
426
  }) => {
427
427
  let r = t.selectFrom("sessions").where("sessions.tenant_id", "=", e);
428
- a.q && (r = O(t, r, a.q, ["user_id", "session_id"]));
428
+ a.q && (r = T(t, r, a.q, ["user_id", "session_id"]));
429
429
  let o = r;
430
430
  if (a.sort && a.sort.sort_by) {
431
- const { ref: d } = t.dynamic;
431
+ const { ref: c } = t.dynamic;
432
432
  o = o.orderBy(
433
- d(a.sort.sort_by),
433
+ c(a.sort.sort_by),
434
434
  a.sort.sort_order
435
435
  );
436
436
  }
437
437
  o = o.offset(a.page * a.per_page).limit(a.per_page);
438
- const n = await o.selectAll().execute(), { count: s } = await r.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), l = x(s);
438
+ const n = await o.selectAll().execute(), { count: s } = await r.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), l = b(s);
439
439
  return {
440
- sessions: n.map((d) => ({
441
- ...d,
442
- device: JSON.parse(d.device),
443
- clients: JSON.parse(d.clients)
440
+ sessions: n.map((c) => ({
441
+ ...c,
442
+ device: JSON.parse(c.device),
443
+ clients: JSON.parse(c.clients)
444
444
  })),
445
445
  start: a.page * a.per_page,
446
446
  limit: a.per_page,
@@ -448,16 +448,16 @@ function _t(t) {
448
448
  };
449
449
  };
450
450
  }
451
- function ft(t) {
451
+ function pt(t) {
452
452
  return {
453
- create: ut(t),
454
- get: lt(t),
455
- list: _t(t),
456
- remove: mt(t),
457
- update: ht(t)
453
+ create: mt(t),
454
+ get: ut(t),
455
+ list: ft(t),
456
+ remove: ht(t),
457
+ update: _t(t)
458
458
  };
459
459
  }
460
- function pt(t) {
460
+ function gt(t) {
461
461
  return async (e, a) => {
462
462
  const r = await t.selectFrom("passwords").where("passwords.tenant_id", "=", e).where("passwords.user_id", "=", a).selectAll().executeTakeFirst();
463
463
  if (!r)
@@ -466,7 +466,7 @@ function pt(t) {
466
466
  return n;
467
467
  };
468
468
  }
469
- function gt(t) {
469
+ function yt(t) {
470
470
  return async (e, a) => {
471
471
  const r = {
472
472
  ...a,
@@ -479,40 +479,40 @@ function gt(t) {
479
479
  }).execute(), r;
480
480
  };
481
481
  }
482
- function yt(t) {
482
+ function wt(t) {
483
483
  return async (e, a) => (await t.updateTable("passwords").set({
484
484
  password: a.password,
485
485
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
486
486
  }).where("tenant_id", "=", e).where("user_id", "=", a.user_id).execute()).length === 1;
487
487
  }
488
- function wt(t) {
488
+ function vt(t) {
489
489
  return {
490
- create: gt(t),
491
- update: yt(t),
492
- get: pt(t)
490
+ create: yt(t),
491
+ update: wt(t),
492
+ get: gt(t)
493
493
  };
494
494
  }
495
- function vt(t) {
495
+ function Nt(t) {
496
496
  return async (e, a = {
497
497
  page: 0,
498
498
  per_page: 50,
499
499
  include_totals: !1
500
500
  }) => {
501
501
  let r = t.selectFrom("codes").where("codes.tenant_id", "=", e);
502
- a.q && (r = O(t, r, a.q, ["code", "login_id"]));
503
- const n = 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();
502
+ a.q && (r = T(t, r, a.q, ["code", "login_id"]));
503
+ const n = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), { count: s } = await r.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
504
504
  return {
505
- codes: n.map((d) => {
506
- const { tenant_id: g, ...m } = d;
507
- return Je.parse(_(m));
505
+ codes: n.map((c) => {
506
+ const { tenant_id: g, ...m } = c;
507
+ return Ke.parse(_(m));
508
508
  }),
509
509
  start: a.page * a.per_page,
510
510
  limit: a.per_page,
511
- length: x(s)
511
+ length: b(s)
512
512
  };
513
513
  };
514
514
  }
515
- function Nt(t) {
515
+ function Ct(t) {
516
516
  return async (e, a) => {
517
517
  const r = {
518
518
  ...a,
@@ -524,10 +524,10 @@ function Nt(t) {
524
524
  }).execute(), r;
525
525
  };
526
526
  }
527
- function Ct(t) {
527
+ function bt(t) {
528
528
  return async (e, a) => (await t.deleteFrom("codes").where("codes.tenant_id", "=", e).where("codes.code_id", "=", a).executeTakeFirst()).numDeletedRows > 0;
529
529
  }
530
- function bt(t) {
530
+ function xt(t) {
531
531
  return async (e, a, r) => {
532
532
  let o = t.selectFrom("codes").where("codes.code_id", "=", a).where("codes.code_type", "=", r);
533
533
  e.length && (o = o.where("codes.tenant_id", "=", e));
@@ -535,25 +535,25 @@ function bt(t) {
535
535
  return n ? _(n) : null;
536
536
  };
537
537
  }
538
- function xt(t) {
538
+ function Tt(t) {
539
539
  return async (e, a) => (await t.updateTable("codes").set({ used_at: (/* @__PURE__ */ new Date()).toISOString() }).where("codes.tenant_id", "=", e).where("codes.code_id", "=", a).executeTakeFirst()).numUpdatedRows > 0;
540
540
  }
541
- function Tt(t) {
541
+ function St(t) {
542
542
  return {
543
- create: Nt(t),
544
- list: vt(t),
545
- remove: Ct(t),
546
- used: xt(t),
547
- get: bt(t)
543
+ create: Ct(t),
544
+ list: Nt(t),
545
+ remove: bt(t),
546
+ used: Tt(t),
547
+ get: xt(t)
548
548
  };
549
549
  }
550
- function St(t) {
550
+ function Ot(t) {
551
551
  return async (e, a) => {
552
552
  const r = {
553
553
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
554
554
  updated_at: (/* @__PURE__ */ new Date()).toISOString(),
555
555
  ...a
556
- }, o = JSON.stringify(a.allowed_origins), n = JSON.stringify(a.callbacks), s = JSON.stringify(a.web_origins), l = JSON.stringify(a.allowed_logout_urls), d = JSON.stringify(a.allowed_clients);
556
+ }, o = JSON.stringify(a.allowed_origins), n = JSON.stringify(a.callbacks), s = JSON.stringify(a.web_origins), l = JSON.stringify(a.allowed_logout_urls), c = JSON.stringify(a.allowed_clients);
557
557
  return await t.insertInto("applications").values({
558
558
  ...r,
559
559
  tenant_id: e,
@@ -563,11 +563,11 @@ function St(t) {
563
563
  allowed_origins: o,
564
564
  web_origins: s,
565
565
  allowed_logout_urls: l,
566
- allowed_clients: d
566
+ allowed_clients: c
567
567
  }).execute(), r;
568
568
  };
569
569
  }
570
- function Ot(t) {
570
+ function kt(t) {
571
571
  return async (e) => ({
572
572
  applications: (await t.selectFrom("applications").where("applications.tenant_id", "=", e).selectAll().execute()).map((n) => ({
573
573
  ...n,
@@ -581,7 +581,7 @@ function Ot(t) {
581
581
  }))
582
582
  });
583
583
  }
584
- function kt(t) {
584
+ function $t(t) {
585
585
  return async (e, a) => {
586
586
  const r = await t.selectFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", a).selectAll().executeTakeFirst();
587
587
  return r ? _({
@@ -595,10 +595,10 @@ function kt(t) {
595
595
  }) : null;
596
596
  };
597
597
  }
598
- function $t(t) {
598
+ function Dt(t) {
599
599
  return async (e, a) => (await t.deleteFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", a).executeTakeFirst()).numDeletedRows > 0;
600
600
  }
601
- function Dt(t) {
601
+ function It(t) {
602
602
  return async (e, a, r) => {
603
603
  const o = {
604
604
  ...r,
@@ -614,19 +614,19 @@ function Dt(t) {
614
614
  return await t.updateTable("applications").set(o).where("applications.id", "=", a).where("applications.tenant_id", "=", e).execute(), !0;
615
615
  };
616
616
  }
617
- function It(t) {
617
+ function Pt(t) {
618
618
  return {
619
- create: St(t),
620
- list: Ot(t),
621
- get: kt(t),
622
- remove: $t(t),
623
- update: Dt(t)
619
+ create: Ot(t),
620
+ list: kt(t),
621
+ get: $t(t),
622
+ remove: Dt(t),
623
+ update: It(t)
624
624
  };
625
625
  }
626
- function Pt(t) {
626
+ function jt(t) {
627
627
  return async (e, a) => {
628
628
  const r = {
629
- id: k(),
629
+ id: S(),
630
630
  ...a,
631
631
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
632
632
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
@@ -639,32 +639,32 @@ function Pt(t) {
639
639
  }).execute(), r;
640
640
  };
641
641
  }
642
- function jt(t) {
642
+ function Mt(t) {
643
643
  return async (e, a = {
644
644
  page: 0,
645
645
  per_page: 50,
646
646
  include_totals: !1
647
647
  }) => {
648
648
  let r = t.selectFrom("connections").where("connections.tenant_id", "=", e);
649
- a.q && (r = O(t, r, a.q, ["user_id", "ip"]));
649
+ a.q && (r = T(t, r, a.q, ["user_id", "ip"]));
650
650
  const s = (await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute()).map(
651
- (d) => _({
652
- ...d,
653
- options: JSON.parse(d.options)
651
+ (c) => _({
652
+ ...c,
653
+ options: JSON.parse(c.options)
654
654
  })
655
- ), { count: l } = await r.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
655
+ ), { count: l } = await r.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
656
656
  return {
657
657
  connections: s,
658
658
  start: a.page * a.per_page,
659
659
  limit: a.per_page,
660
- length: x(l)
660
+ length: b(l)
661
661
  };
662
662
  };
663
663
  }
664
- function Mt(t) {
664
+ function Ft(t) {
665
665
  return async (e, a) => (await t.deleteFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", a).executeTakeFirst()).numDeletedRows > 0;
666
666
  }
667
- function Ft(t) {
667
+ function At(t) {
668
668
  return async (e, a) => {
669
669
  const r = await t.selectFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", a).selectAll().executeTakeFirst();
670
670
  return r ? _({
@@ -673,7 +673,7 @@ function Ft(t) {
673
673
  }) : null;
674
674
  };
675
675
  }
676
- function At(t) {
676
+ function Lt(t) {
677
677
  return async (e, a, r) => {
678
678
  const o = {
679
679
  ...r,
@@ -685,16 +685,16 @@ function At(t) {
685
685
  }).where("connections.id", "=", a).where("connections.tenant_id", "=", e).execute(), !0;
686
686
  };
687
687
  }
688
- function Lt(t) {
688
+ function zt(t) {
689
689
  return {
690
- create: Pt(t),
691
- get: Ft(t),
692
- list: jt(t),
693
- remove: Mt(t),
694
- update: At(t)
690
+ create: jt(t),
691
+ get: At(t),
692
+ list: Mt(t),
693
+ remove: Ft(t),
694
+ update: Lt(t)
695
695
  };
696
696
  }
697
- function zt(t) {
697
+ function Jt(t) {
698
698
  return {
699
699
  get: async (e) => {
700
700
  const a = await t.selectFrom("applications").selectAll().where("id", "=", e).executeTakeFirst();
@@ -707,7 +707,7 @@ function zt(t) {
707
707
  return {
708
708
  ...a,
709
709
  connections: o.map(
710
- (s) => Ke.parse(
710
+ (s) => Re.parse(
711
711
  _({
712
712
  ...s,
713
713
  options: s.options ? JSON.parse(s.options) : {}
@@ -735,25 +735,25 @@ function Et(t) {
735
735
  ])
736
736
  ).selectAll().execute();
737
737
  }
738
- function Jt(t) {
738
+ function Kt(t) {
739
739
  return async (e) => {
740
740
  await t.insertInto("keys").values({ ...e, created_at: (/* @__PURE__ */ new Date()).toDateString() }).execute();
741
741
  };
742
742
  }
743
- function Kt(t) {
743
+ function Rt(t) {
744
744
  return async (e, a) => !!(await t.updateTable("keys").set(a).where("kid", "=", e).execute()).length;
745
745
  }
746
- function Rt(t) {
746
+ function Ut(t) {
747
747
  return {
748
- create: Jt(t),
748
+ create: Kt(t),
749
749
  list: Et(t),
750
- update: Kt(t)
750
+ update: Rt(t)
751
751
  };
752
752
  }
753
- function Ut(t) {
753
+ function Bt(t) {
754
754
  return async (e, a) => {
755
755
  const r = {
756
- custom_domain_id: k(),
756
+ custom_domain_id: S(),
757
757
  status: "pending",
758
758
  primary: !1,
759
759
  ...a
@@ -767,13 +767,13 @@ function Ut(t) {
767
767
  }).execute(), r;
768
768
  };
769
769
  }
770
- function Bt(t) {
770
+ function Qt(t) {
771
771
  return async (e) => (await t.selectFrom("custom_domains").where("custom_domains.tenant_id", "=", e).selectAll().execute()).map((r) => ({
772
772
  ...r,
773
773
  primary: r.primary === 1
774
774
  }));
775
775
  }
776
- function Qt(t) {
776
+ function qt(t) {
777
777
  return async (e, a) => (await t.deleteFrom("custom_domains").where("custom_domains.tenant_id", "=", e).where("custom_domains.custom_domain_id", "=", a).execute()).length > 0;
778
778
  }
779
779
  function Vt(t) {
@@ -795,7 +795,7 @@ function Wt(t) {
795
795
  return (await t.updateTable("custom_domains").set(o).where("custom_domains.tenant_id", "=", e).where("custom_domains.custom_domain_id", "=", a).execute()).length > 0;
796
796
  };
797
797
  }
798
- function qt(t) {
798
+ function Gt(t) {
799
799
  return async (e) => {
800
800
  const a = await t.selectFrom("custom_domains").where("custom_domains.domain", "=", e).selectAll().executeTakeFirst();
801
801
  return a ? {
@@ -804,17 +804,17 @@ function qt(t) {
804
804
  } : null;
805
805
  };
806
806
  }
807
- function Gt(t) {
807
+ function Ht(t) {
808
808
  return {
809
- create: Ut(t),
809
+ create: Bt(t),
810
810
  get: Vt(t),
811
- getByDomain: qt(t),
812
- list: Bt(t),
813
- remove: Qt(t),
811
+ getByDomain: Gt(t),
812
+ list: Qt(t),
813
+ remove: qt(t),
814
814
  update: Wt(t)
815
815
  };
816
816
  }
817
- function Ht(t) {
817
+ function Xt(t) {
818
818
  return async (e) => {
819
819
  const [a] = await t.selectFrom("branding").where("branding.tenant_id", "=", e).selectAll().execute();
820
820
  if (!a)
@@ -825,7 +825,7 @@ function Ht(t) {
825
825
  colors_page_background_type: n,
826
826
  colors_page_background_start: s,
827
827
  colors_page_background_end: l,
828
- colors_page_background_angle_dev: d,
828
+ colors_page_background_angle_dev: c,
829
829
  font_url: g,
830
830
  ...m
831
831
  } = a;
@@ -837,72 +837,72 @@ function Ht(t) {
837
837
  type: n,
838
838
  start: s,
839
839
  end: l,
840
- angle_deg: d
840
+ angle_deg: c
841
841
  }
842
842
  },
843
843
  font: g ? { url: g } : void 0
844
844
  });
845
845
  };
846
846
  }
847
- function Xt(t) {
847
+ function Yt(t) {
848
848
  return async (e, a) => {
849
- var s, l, d, g, m, w, b, Z, ee, te, ae, re, ne, oe, se, ie, de, ce;
849
+ var s, l, c, g, m, w, x, ee, te, ae, re, ne, oe, se, ie, ce, le, de;
850
850
  const { colors: r, font: o, ...n } = a;
851
851
  try {
852
852
  await t.insertInto("branding").values({
853
853
  ...n,
854
854
  colors_primary: r == null ? void 0 : r.primary,
855
855
  colors_page_background_type: (l = (s = a.colors) == null ? void 0 : s.page_background) == null ? void 0 : l.type,
856
- colors_page_background_start: (g = (d = a.colors) == null ? void 0 : d.page_background) == null ? void 0 : g.start,
856
+ colors_page_background_start: (g = (c = a.colors) == null ? void 0 : c.page_background) == null ? void 0 : g.start,
857
857
  colors_page_background_end: (w = (m = a.colors) == null ? void 0 : m.page_background) == null ? void 0 : w.end,
858
- colors_page_background_angle_dev: (Z = (b = a.colors) == null ? void 0 : b.page_background) == null ? void 0 : Z.angle_deg,
859
- font_url: (ee = a.font) == null ? void 0 : ee.url,
858
+ colors_page_background_angle_dev: (ee = (x = a.colors) == null ? void 0 : x.page_background) == null ? void 0 : ee.angle_deg,
859
+ font_url: (te = a.font) == null ? void 0 : te.url,
860
860
  tenant_id: e
861
861
  }).execute();
862
862
  } catch {
863
863
  await t.updateTable("branding").set({
864
864
  ...n,
865
865
  colors_primary: r == null ? void 0 : r.primary,
866
- colors_page_background_type: (ae = (te = a.colors) == null ? void 0 : te.page_background) == null ? void 0 : ae.type,
867
- colors_page_background_start: (ne = (re = a.colors) == null ? void 0 : re.page_background) == null ? void 0 : ne.start,
868
- colors_page_background_end: (se = (oe = a.colors) == null ? void 0 : oe.page_background) == null ? void 0 : se.end,
869
- colors_page_background_angle_dev: (de = (ie = a.colors) == null ? void 0 : ie.page_background) == null ? void 0 : de.angle_deg,
870
- font_url: (ce = a.font) == null ? void 0 : ce.url
866
+ colors_page_background_type: (re = (ae = a.colors) == null ? void 0 : ae.page_background) == null ? void 0 : re.type,
867
+ colors_page_background_start: (oe = (ne = a.colors) == null ? void 0 : ne.page_background) == null ? void 0 : oe.start,
868
+ 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: (le = (ce = a.colors) == null ? void 0 : ce.page_background) == null ? void 0 : le.angle_deg,
870
+ font_url: (de = a.font) == null ? void 0 : de.url
871
871
  }).where("tenant_id", "=", e).execute();
872
872
  }
873
873
  };
874
874
  }
875
- function Yt(t) {
875
+ function Zt(t) {
876
876
  return {
877
- get: Ht(t),
878
- set: Xt(t)
877
+ get: Xt(t),
878
+ set: Yt(t)
879
879
  };
880
880
  }
881
- function Zt(t) {
881
+ function ea(t) {
882
882
  return async (e, a = {
883
883
  page: 0,
884
884
  per_page: 50,
885
885
  include_totals: !1
886
886
  }) => {
887
887
  let r = t.selectFrom("hooks").where("hooks.tenant_id", "=", e);
888
- a.q && (r = O(t, r, a.q, ["url"]));
889
- const n = 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();
888
+ a.q && (r = T(t, r, a.q, ["url"]));
889
+ const n = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), { count: s } = await r.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
890
890
  return {
891
- hooks: n.map((d) => {
892
- const { tenant_id: g, enabled: m, synchronous: w, ...b } = d;
891
+ hooks: n.map((c) => {
892
+ const { tenant_id: g, enabled: m, synchronous: w, ...x } = c;
893
893
  return _({
894
- ...b,
894
+ ...x,
895
895
  enabled: !!m,
896
896
  synchronous: !!w
897
897
  });
898
898
  }),
899
899
  start: a.page * a.per_page,
900
900
  limit: a.per_page,
901
- length: x(s)
901
+ length: b(s)
902
902
  };
903
903
  };
904
904
  }
905
- function ea(t) {
905
+ function ta(t) {
906
906
  return async (e, a) => {
907
907
  const r = await t.selectFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", a).selectAll().executeTakeFirst();
908
908
  return r ? _({
@@ -912,13 +912,13 @@ function ea(t) {
912
912
  }) : null;
913
913
  };
914
914
  }
915
- function ta(t) {
915
+ function aa(t) {
916
916
  return async (e, a) => (await t.deleteFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", a).executeTakeFirst()).numDeletedRows > 0;
917
917
  }
918
- function aa(t) {
918
+ function ra(t) {
919
919
  return async (e, a) => {
920
920
  const r = {
921
- hook_id: k(),
921
+ hook_id: S(),
922
922
  ...a,
923
923
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
924
924
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
@@ -931,7 +931,7 @@ function aa(t) {
931
931
  }).execute(), r;
932
932
  };
933
933
  }
934
- function ra(t) {
934
+ function na(t) {
935
935
  return async (e, a, r) => {
936
936
  const o = {
937
937
  ...r,
@@ -942,24 +942,24 @@ function ra(t) {
942
942
  return await t.updateTable("hooks").set(o).where("hooks.hook_id", "=", a).where("hooks.tenant_id", "=", e).execute(), !0;
943
943
  };
944
944
  }
945
- function na(t) {
945
+ function oa(t) {
946
946
  return {
947
- create: aa(t),
948
- get: ea(t),
949
- list: Zt(t),
950
- update: ra(t),
951
- remove: ta(t)
947
+ create: ra(t),
948
+ get: ta(t),
949
+ list: ea(t),
950
+ update: na(t),
951
+ remove: aa(t)
952
952
  };
953
953
  }
954
- function E(t, e = "", a = {}) {
954
+ function J(t, e = "", a = {}) {
955
955
  for (let r in t)
956
956
  if (Object.prototype.hasOwnProperty.call(t, r)) {
957
957
  const o = e ? `${e}_${r}` : r;
958
- typeof t[r] == "object" && t[r] !== null && !Array.isArray(t[r]) ? E(t[r], o, a) : a[o] = t[r];
958
+ typeof t[r] == "object" && t[r] !== null && !Array.isArray(t[r]) ? J(t[r], o, a) : a[o] = t[r];
959
959
  }
960
960
  return a;
961
961
  }
962
- function oa(t, e) {
962
+ function sa(t, e) {
963
963
  const a = {};
964
964
  for (const [r, o] of Object.entries(t)) {
965
965
  const n = e.find(
@@ -977,79 +977,79 @@ function oa(t, e) {
977
977
  }
978
978
  return a;
979
979
  }
980
- function sa(t) {
980
+ function ia(t) {
981
981
  return async (e, a) => {
982
982
  const r = {
983
- themeId: k(),
983
+ themeId: S(),
984
984
  ...a,
985
985
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
986
986
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
987
987
  };
988
- return await t.insertInto("themes").values({ ...E(r), tenant_id: e }).execute(), r;
988
+ return await t.insertInto("themes").values({ ...J(r), tenant_id: e }).execute(), r;
989
989
  };
990
990
  }
991
- function ia(t) {
991
+ function ca(t) {
992
992
  return async (e, a) => (await t.deleteFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", a).executeTakeFirst()).numDeletedRows > 0;
993
993
  }
994
- function da(t) {
994
+ function la(t) {
995
995
  return async (e, a) => {
996
996
  const r = await t.selectFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", a).selectAll().executeTakeFirst();
997
997
  return r ? _(r) : null;
998
998
  };
999
999
  }
1000
- function ca(t) {
1000
+ function da(t) {
1001
1001
  return async (e, a, r) => {
1002
- const o = E({
1002
+ const o = J({
1003
1003
  ...r,
1004
1004
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
1005
1005
  });
1006
1006
  return await t.updateTable("themes").set(o).where("themes.id", "=", a).where("themes.tenant_id", "=", e).execute(), !0;
1007
1007
  };
1008
1008
  }
1009
- function la(t) {
1009
+ function ua(t) {
1010
1010
  return {
1011
- create: sa(t),
1012
- get: da(t),
1013
- remove: ia(t),
1014
- update: ca(t)
1011
+ create: ia(t),
1012
+ get: la(t),
1013
+ remove: ca(t),
1014
+ update: da(t)
1015
1015
  };
1016
1016
  }
1017
- function ua(t) {
1017
+ function ma(t) {
1018
1018
  return async (e, a) => {
1019
1019
  const r = (/* @__PURE__ */ new Date()).toISOString(), o = await t.selectFrom("login_sessions").where("login_sessions.expires_at", ">", r).where("login_sessions.id", "=", a).selectAll().executeTakeFirst();
1020
- return o ? Re.parse(
1021
- oa(_(o), ["authParams"])
1020
+ return o ? Ue.parse(
1021
+ sa(_(o), ["authParams"])
1022
1022
  ) : null;
1023
1023
  };
1024
1024
  }
1025
- function ma(t) {
1025
+ function ha(t) {
1026
1026
  return async (e, a) => {
1027
1027
  var o;
1028
1028
  const r = {
1029
- id: k(),
1029
+ id: S(),
1030
1030
  ...a,
1031
1031
  authorization_url: (o = a.authorization_url) == null ? void 0 : o.slice(0, 1024),
1032
1032
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
1033
1033
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
1034
1034
  };
1035
- return await t.insertInto("login_sessions").values({ ...E(r), tenant_id: e }).execute(), r;
1035
+ return await t.insertInto("login_sessions").values({ ...J(r), tenant_id: e }).execute(), r;
1036
1036
  };
1037
1037
  }
1038
- function ha(t) {
1039
- return async (e, a, r) => (await t.updateTable("login_sessions").set(E(r)).where("login_sessions.id", "=", a).where("login_sessions.tenant_id", "=", e).execute()).length === 1;
1040
- }
1041
1038
  function _a(t) {
1042
- return async (e, a) => (await t.deleteFrom("login_sessions").where("login_sessions.tenant_id", "=", e).where("login_sessions.id", "=", a).execute()).length > 0;
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;
1043
1040
  }
1044
1041
  function fa(t) {
1042
+ return async (e, a) => (await t.deleteFrom("login_sessions").where("login_sessions.tenant_id", "=", e).where("login_sessions.id", "=", a).execute()).length > 0;
1043
+ }
1044
+ function pa(t) {
1045
1045
  return {
1046
- create: ma(t),
1047
- get: ua(t),
1048
- update: ha(t),
1049
- remove: _a(t)
1046
+ create: ha(t),
1047
+ get: ma(t),
1048
+ update: _a(t),
1049
+ remove: fa(t)
1050
1050
  };
1051
1051
  }
1052
- function pa(t) {
1052
+ function ga(t) {
1053
1053
  return async (e) => {
1054
1054
  const [a] = await t.selectFrom("prompt_settings").where("prompt_settings.tenant_id", "=", e).selectAll().execute();
1055
1055
  return _({
@@ -1060,7 +1060,7 @@ function pa(t) {
1060
1060
  });
1061
1061
  };
1062
1062
  }
1063
- function he(t) {
1063
+ function _e(t) {
1064
1064
  return _({
1065
1065
  ...t,
1066
1066
  webauthn_platform_first_factor: t.webauthn_platform_first_factor ? !!t.webauthn_platform_first_factor : void 0,
@@ -1069,26 +1069,26 @@ function he(t) {
1069
1069
  universal_login_experience: t.universal_login_experience
1070
1070
  });
1071
1071
  }
1072
- function ga(t) {
1072
+ function ya(t) {
1073
1073
  return async (e, a) => {
1074
1074
  try {
1075
- const r = Ue.parse(a);
1075
+ const r = Be.parse(a);
1076
1076
  await t.insertInto("prompt_settings").values({
1077
- ...he(r),
1077
+ ..._e(r),
1078
1078
  tenant_id: e
1079
1079
  }).execute();
1080
1080
  } catch {
1081
- await t.updateTable("prompt_settings").set(he(a)).where("tenant_id", "=", e).execute();
1081
+ await t.updateTable("prompt_settings").set(_e(a)).where("tenant_id", "=", e).execute();
1082
1082
  }
1083
1083
  };
1084
1084
  }
1085
- function ya(t) {
1085
+ function wa(t) {
1086
1086
  return {
1087
- get: pa(t),
1088
- set: ga(t)
1087
+ get: ga(t),
1088
+ set: ya(t)
1089
1089
  };
1090
1090
  }
1091
- function wa(t) {
1091
+ function va(t) {
1092
1092
  return async (e) => {
1093
1093
  const [a] = await t.selectFrom("email_providers").where("email_providers.tenant_id", "=", e).selectAll().execute();
1094
1094
  if (!a)
@@ -1108,7 +1108,7 @@ function wa(t) {
1108
1108
  });
1109
1109
  };
1110
1110
  }
1111
- function va(t) {
1111
+ function Na(t) {
1112
1112
  return async (e, a) => {
1113
1113
  const { credentials: r, settings: o, enabled: n, ...s } = a;
1114
1114
  await t.updateTable("email_providers").set({
@@ -1119,7 +1119,7 @@ function va(t) {
1119
1119
  }).where("tenant_id", "=", e).execute();
1120
1120
  };
1121
1121
  }
1122
- function Na(t) {
1122
+ function Ca(t) {
1123
1123
  return async (e, a) => {
1124
1124
  const { credentials: r, settings: o, enabled: n, ...s } = a;
1125
1125
  await t.insertInto("email_providers").values({
@@ -1133,14 +1133,14 @@ function Na(t) {
1133
1133
  }).execute();
1134
1134
  };
1135
1135
  }
1136
- function Ca(t) {
1136
+ function ba(t) {
1137
1137
  return {
1138
- get: wa(t),
1139
- create: Na(t),
1140
- update: va(t)
1138
+ get: va(t),
1139
+ create: Ca(t),
1140
+ update: Na(t)
1141
1141
  };
1142
1142
  }
1143
- function ba(t) {
1143
+ function xa(t) {
1144
1144
  return async (e, a) => {
1145
1145
  const r = await t.selectFrom("refresh_tokens").where("refresh_tokens.tenant_id", "=", e).where("refresh_tokens.id", "=", a).selectAll().executeTakeFirst();
1146
1146
  return r ? {
@@ -1151,7 +1151,7 @@ function ba(t) {
1151
1151
  } : null;
1152
1152
  };
1153
1153
  }
1154
- function xa(t) {
1154
+ function Ta(t) {
1155
1155
  return async (e, a) => {
1156
1156
  const r = {
1157
1157
  ...a,
@@ -1166,10 +1166,10 @@ function xa(t) {
1166
1166
  }).execute(), { ...a, ...r };
1167
1167
  };
1168
1168
  }
1169
- function Ta(t) {
1169
+ function Sa(t) {
1170
1170
  return async (e, a) => !!(await t.deleteFrom("refresh_tokens").where("tenant_id", "=", e).where("refresh_tokens.id", "=", a).execute()).length;
1171
1171
  }
1172
- function Sa(t) {
1172
+ function Oa(t) {
1173
1173
  return async (e, a, r) => {
1174
1174
  const o = {
1175
1175
  ...r,
@@ -1180,30 +1180,30 @@ function Sa(t) {
1180
1180
  return !!(await t.updateTable("refresh_tokens").set(o).where("tenant_id", "=", e).where("refresh_tokens.id", "=", a).execute()).length;
1181
1181
  };
1182
1182
  }
1183
- function Oa(t) {
1183
+ function ka(t) {
1184
1184
  return async (e, a = {
1185
1185
  page: 0,
1186
1186
  per_page: 50,
1187
1187
  include_totals: !1
1188
1188
  }) => {
1189
1189
  let r = t.selectFrom("refresh_tokens").where("refresh_tokens.tenant_id", "=", e);
1190
- a.q && (r = O(t, r, a.q, ["token", "session_id"]));
1190
+ a.q && (r = T(t, r, a.q, ["token", "session_id"]));
1191
1191
  let o = r;
1192
1192
  if (a.sort && a.sort.sort_by) {
1193
- const { ref: d } = t.dynamic;
1193
+ const { ref: c } = t.dynamic;
1194
1194
  o = o.orderBy(
1195
- d(a.sort.sort_by),
1195
+ c(a.sort.sort_by),
1196
1196
  a.sort.sort_order
1197
1197
  );
1198
1198
  }
1199
1199
  o = o.offset(a.page * a.per_page).limit(a.per_page);
1200
- const n = await o.selectAll().execute(), { count: s } = await r.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), l = x(s);
1200
+ const n = await o.selectAll().execute(), { count: s } = await r.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), l = b(s);
1201
1201
  return {
1202
- refresh_tokens: n.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) : []
1202
+ refresh_tokens: n.map((c) => ({
1203
+ ...c,
1204
+ rotating: !!c.rotating,
1205
+ device: c.device ? JSON.parse(c.device) : {},
1206
+ resource_servers: c.resource_servers ? JSON.parse(c.resource_servers) : []
1207
1207
  })),
1208
1208
  start: a.page * a.per_page,
1209
1209
  limit: a.per_page,
@@ -1211,16 +1211,16 @@ function Oa(t) {
1211
1211
  };
1212
1212
  };
1213
1213
  }
1214
- function ka(t) {
1214
+ function $a(t) {
1215
1215
  return {
1216
- create: xa(t),
1217
- get: ba(t),
1218
- list: Oa(t),
1219
- remove: Ta(t),
1220
- update: Sa(t)
1216
+ create: Ta(t),
1217
+ get: xa(t),
1218
+ list: ka(t),
1219
+ remove: Sa(t),
1220
+ update: Oa(t)
1221
1221
  };
1222
1222
  }
1223
- function $a(t) {
1223
+ function Da(t) {
1224
1224
  return async () => {
1225
1225
  const e = new Date(Date.now() - 864e5).toISOString(), a = new Date(
1226
1226
  Date.now() - 1e3 * 60 * 60 * 24 * 7
@@ -1245,13 +1245,99 @@ function $a(t) {
1245
1245
  ).execute(), console.log("cleanup complete");
1246
1246
  };
1247
1247
  }
1248
- function Da(t) {
1248
+ function Ia(t) {
1249
+ return async (e, a) => {
1250
+ const r = K.parse({
1251
+ id: S(),
1252
+ ...a,
1253
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
1254
+ updated_at: (/* @__PURE__ */ new Date()).toISOString()
1255
+ });
1256
+ return await t.insertInto("forms").values({
1257
+ ...r,
1258
+ // Store complex objects as JSON strings
1259
+ fields: JSON.stringify(r.fields || []),
1260
+ controls: JSON.stringify(r.controls || []),
1261
+ layout: JSON.stringify(r.layout || {}),
1262
+ tenant_id: e,
1263
+ active: r.active ? 1 : 0
1264
+ }).execute(), K.parse(r);
1265
+ };
1266
+ }
1267
+ function Pa(t) {
1268
+ return async (e, a = {
1269
+ page: 0,
1270
+ per_page: 50,
1271
+ include_totals: !1
1272
+ }) => {
1273
+ let r = t.selectFrom("forms").where("tenant_id", "=", e);
1274
+ a != null && a.q && (r = T(t, r, a.q, []));
1275
+ const s = (await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute()).map(
1276
+ (c) => K.parse(
1277
+ _({
1278
+ ...c,
1279
+ fields: JSON.parse(c.fields),
1280
+ controls: c.controls ? JSON.parse(c.controls) : void 0,
1281
+ layout: c.layout ? JSON.parse(c.layout) : void 0,
1282
+ active: c.active === 1
1283
+ })
1284
+ )
1285
+ ), { count: l } = await r.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
1286
+ return {
1287
+ forms: s,
1288
+ start: a.page * a.per_page,
1289
+ limit: a.per_page,
1290
+ length: b(l)
1291
+ };
1292
+ };
1293
+ }
1294
+ function ja(t) {
1295
+ return async (e, a) => {
1296
+ const { numDeletedRows: r } = await t.deleteFrom("forms").where("id", "=", a).where("tenant_id", "=", e).executeTakeFirst();
1297
+ return r > 0;
1298
+ };
1299
+ }
1300
+ function Ma(t) {
1301
+ return async (e, a) => {
1302
+ const r = await t.selectFrom("forms").selectAll().where("forms.id", "=", a).where("tenant_id", "=", e).executeTakeFirst();
1303
+ return r ? K.parse(
1304
+ _({
1305
+ ...r,
1306
+ fields: JSON.parse(r.fields),
1307
+ controls: r.controls ? JSON.parse(r.controls) : void 0,
1308
+ layout: r.layout ? JSON.parse(r.layout) : void 0,
1309
+ active: r.active === 1
1310
+ })
1311
+ ) : null;
1312
+ };
1313
+ }
1314
+ function Fa(t) {
1315
+ return async (e, a, r) => {
1316
+ const o = {
1317
+ ...r,
1318
+ updated_at: (/* @__PURE__ */ new Date()).toISOString()
1319
+ };
1320
+ r.fields && (o.fields = JSON.stringify(r.fields)), r.controls && (o.controls = JSON.stringify(r.controls)), r.layout && (o.layout = JSON.stringify(r.layout));
1321
+ const { numUpdatedRows: n } = await t.updateTable("forms").set(o).where("id", "=", a).where("tenant_id", "=", e).executeTakeFirst();
1322
+ return n > 0;
1323
+ };
1324
+ }
1325
+ function Aa(t) {
1326
+ return {
1327
+ create: Ia(t),
1328
+ get: Ma(t),
1329
+ list: Pa(t),
1330
+ remove: ja(t),
1331
+ update: Fa(t)
1332
+ };
1333
+ }
1334
+ function La(t) {
1249
1335
  return t[t.length - 1];
1250
1336
  }
1251
1337
  function p(t) {
1252
1338
  return Object.freeze(t);
1253
1339
  }
1254
- const J = p({
1340
+ const E = p({
1255
1341
  is(t) {
1256
1342
  return t.kind === "IdentifierNode";
1257
1343
  },
@@ -1268,17 +1354,17 @@ const J = p({
1268
1354
  create(t) {
1269
1355
  return p({
1270
1356
  kind: "SchemableIdentifierNode",
1271
- identifier: J.create(t)
1357
+ identifier: E.create(t)
1272
1358
  });
1273
1359
  },
1274
1360
  createWithSchema(t, e) {
1275
1361
  return p({
1276
1362
  kind: "SchemableIdentifierNode",
1277
- schema: J.create(t),
1278
- identifier: J.create(e)
1363
+ schema: E.create(t),
1364
+ identifier: E.create(e)
1279
1365
  });
1280
1366
  }
1281
- }), Ia = p({
1367
+ }), za = p({
1282
1368
  is(t) {
1283
1369
  return t.kind === "AliasNode";
1284
1370
  },
@@ -1289,7 +1375,7 @@ const J = p({
1289
1375
  alias: e
1290
1376
  });
1291
1377
  }
1292
- }), U = p({
1378
+ }), B = p({
1293
1379
  is(t) {
1294
1380
  return t.kind === "TableNode";
1295
1381
  },
@@ -1306,11 +1392,11 @@ const J = p({
1306
1392
  });
1307
1393
  }
1308
1394
  });
1309
- var K;
1310
- class Pa {
1395
+ var R;
1396
+ class Ja {
1311
1397
  constructor() {
1312
1398
  j(this, "nodeStack", []);
1313
- y(this, K, p({
1399
+ y(this, R, p({
1314
1400
  AliasNode: this.transformAlias.bind(this),
1315
1401
  ColumnNode: this.transformColumn.bind(this),
1316
1402
  IdentifierNode: this.transformIdentifier.bind(this),
@@ -1414,7 +1500,7 @@ class Pa {
1414
1500
  return this.nodeStack.pop(), p(a);
1415
1501
  }
1416
1502
  transformNodeImpl(e) {
1417
- return c(this, K)[e.kind](e);
1503
+ return d(this, R)[e.kind](e);
1418
1504
  }
1419
1505
  transformNodeList(e) {
1420
1506
  return e && p(e.map((a) => this.transformNode(a)));
@@ -2140,8 +2226,8 @@ class Pa {
2140
2226
  return e;
2141
2227
  }
2142
2228
  }
2143
- K = new WeakMap();
2144
- const ja = p({
2229
+ R = new WeakMap();
2230
+ const Ea = p({
2145
2231
  AlterTableNode: !0,
2146
2232
  CreateIndexNode: !0,
2147
2233
  CreateSchemaNode: !0,
@@ -2160,88 +2246,88 @@ const ja = p({
2160
2246
  UpdateQueryNode: !0,
2161
2247
  MergeQueryNode: !0
2162
2248
  });
2163
- var P, T, S, f, ge, ye, we, $, q, ve;
2164
- class Ma extends Pa {
2249
+ var P, O, k, f, ye, we, ve, $, G, Ne;
2250
+ class Ka extends Ja {
2165
2251
  constructor(a) {
2166
2252
  super();
2167
2253
  y(this, f);
2168
2254
  y(this, P);
2169
- y(this, T, /* @__PURE__ */ new Set());
2170
- y(this, S, /* @__PURE__ */ new Set());
2255
+ y(this, O, /* @__PURE__ */ new Set());
2256
+ y(this, k, /* @__PURE__ */ new Set());
2171
2257
  M(this, P, a);
2172
2258
  }
2173
2259
  transformNodeImpl(a) {
2174
- if (!u(this, f, ge).call(this, a))
2260
+ if (!u(this, f, ye).call(this, a))
2175
2261
  return super.transformNodeImpl(a);
2176
- const r = u(this, f, we).call(this, a);
2262
+ const r = u(this, f, ve).call(this, a);
2177
2263
  for (const s of r)
2178
- c(this, S).add(s);
2179
- const o = u(this, f, ye).call(this, a);
2264
+ d(this, k).add(s);
2265
+ const o = u(this, f, we).call(this, a);
2180
2266
  for (const s of o)
2181
- c(this, T).add(s);
2267
+ d(this, O).add(s);
2182
2268
  const n = super.transformNodeImpl(a);
2183
2269
  for (const s of o)
2184
- c(this, T).delete(s);
2270
+ d(this, O).delete(s);
2185
2271
  for (const s of r)
2186
- c(this, S).delete(s);
2272
+ d(this, k).delete(s);
2187
2273
  return n;
2188
2274
  }
2189
2275
  transformSchemableIdentifier(a) {
2190
2276
  const r = super.transformSchemableIdentifier(a);
2191
- return r.schema || !c(this, T).has(a.identifier.name) ? r : {
2277
+ return r.schema || !d(this, O).has(a.identifier.name) ? r : {
2192
2278
  ...r,
2193
- schema: J.create(c(this, P))
2279
+ schema: E.create(d(this, P))
2194
2280
  };
2195
2281
  }
2196
2282
  transformReferences(a) {
2197
2283
  const r = super.transformReferences(a);
2198
2284
  return r.table.table.schema ? r : {
2199
2285
  ...r,
2200
- table: U.createWithSchema(c(this, P), r.table.table.identifier.name)
2286
+ table: B.createWithSchema(d(this, P), r.table.table.identifier.name)
2201
2287
  };
2202
2288
  }
2203
2289
  }
2204
- P = new WeakMap(), T = new WeakMap(), S = new WeakMap(), f = new WeakSet(), ge = function(a) {
2205
- return a.kind in ja;
2206
- }, ye = function(a) {
2290
+ P = new WeakMap(), O = new WeakMap(), k = new WeakMap(), f = new WeakSet(), ye = function(a) {
2291
+ return a.kind in Ea;
2292
+ }, we = function(a) {
2207
2293
  const r = /* @__PURE__ */ new Set();
2208
- if ("name" in a && a.name && W.is(a.name) && u(this, f, q).call(this, a.name, r), "from" in a && a.from)
2294
+ if ("name" in a && a.name && W.is(a.name) && u(this, f, G).call(this, a.name, r), "from" in a && a.from)
2209
2295
  for (const o of a.from.froms)
2210
2296
  u(this, f, $).call(this, o, r);
2211
2297
  if ("into" in a && a.into && u(this, f, $).call(this, a.into, r), "table" in a && a.table && u(this, f, $).call(this, a.table, r), "joins" in a && a.joins)
2212
2298
  for (const o of a.joins)
2213
2299
  u(this, f, $).call(this, o.table, r);
2214
2300
  return "using" in a && a.using && u(this, f, $).call(this, a.using, r), r;
2215
- }, we = function(a) {
2301
+ }, ve = function(a) {
2216
2302
  const r = /* @__PURE__ */ new Set();
2217
- return "with" in a && a.with && u(this, f, ve).call(this, a.with, r), r;
2303
+ return "with" in a && a.with && u(this, f, Ne).call(this, a.with, r), r;
2218
2304
  }, $ = function(a, r) {
2219
- const o = U.is(a) ? a : Ia.is(a) && U.is(a.node) ? a.node : null;
2220
- o && u(this, f, q).call(this, o.table, r);
2221
- }, q = function(a, r) {
2305
+ const o = B.is(a) ? a : za.is(a) && B.is(a.node) ? a.node : null;
2306
+ o && u(this, f, G).call(this, o.table, r);
2307
+ }, G = function(a, r) {
2222
2308
  const o = a.identifier.name;
2223
- !c(this, T).has(o) && !c(this, S).has(o) && r.add(o);
2224
- }, ve = function(a, r) {
2309
+ !d(this, O).has(o) && !d(this, k).has(o) && r.add(o);
2310
+ }, Ne = function(a, r) {
2225
2311
  for (const o of a.expressions) {
2226
2312
  const n = o.name.table.table.identifier.name;
2227
- c(this, S).has(n) || r.add(n);
2313
+ d(this, k).has(n) || r.add(n);
2228
2314
  }
2229
2315
  };
2230
2316
  var L;
2231
- class Fa {
2317
+ class Ra {
2232
2318
  constructor(e) {
2233
2319
  y(this, L);
2234
- M(this, L, new Ma(e));
2320
+ M(this, L, new Ka(e));
2235
2321
  }
2236
2322
  transformQuery(e) {
2237
- return c(this, L).transformNode(e.node);
2323
+ return d(this, L).transformNode(e.node);
2238
2324
  }
2239
2325
  async transformResult(e) {
2240
2326
  return e.result;
2241
2327
  }
2242
2328
  }
2243
2329
  L = new WeakMap();
2244
- class Aa {
2330
+ class Ua {
2245
2331
  transformQuery(e) {
2246
2332
  return e.node;
2247
2333
  }
@@ -2249,9 +2335,9 @@ class Aa {
2249
2335
  return e.result;
2250
2336
  }
2251
2337
  }
2252
- const La = "kysely_migration", _e = "kysely_migration_lock", za = !1, B = "migration_lock", Ea = p({ __noMigrations__: !0 });
2253
- var h, i, F, v, N, D, Ce, C, be, xe, Te, Se, Oe, G, I, H, ke, $e, De, X, Ie, Pe, je, Me, Fe, A;
2254
- class Ne {
2338
+ const Ba = "kysely_migration", fe = "kysely_migration_lock", Qa = !1, Q = "migration_lock", qa = p({ __noMigrations__: !0 });
2339
+ var h, 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;
2340
+ class Ce {
2255
2341
  constructor(e) {
2256
2342
  y(this, i);
2257
2343
  y(this, h);
@@ -2263,8 +2349,8 @@ class Ne {
2263
2349
  * The returned array is sorted by migration name.
2264
2350
  */
2265
2351
  async getMigrations() {
2266
- const e = await u(this, i, I).call(this, c(this, i, N)) ? await c(this, h).db.withPlugin(c(this, i, C)).selectFrom(c(this, i, N)).select(["name", "timestamp"]).execute() : [];
2267
- return (await u(this, i, X).call(this)).map(({ name: r, ...o }) => {
2352
+ const e = await u(this, i, I).call(this, d(this, i, N)) ? await d(this, h).db.withPlugin(d(this, i, C)).selectFrom(d(this, i, N)).select(["name", "timestamp"]).execute() : [];
2353
+ return (await u(this, i, Y).call(this)).map(({ name: r, ...o }) => {
2268
2354
  const n = e.find((s) => s.name === r);
2269
2355
  return {
2270
2356
  name: r,
@@ -2348,7 +2434,7 @@ class Ne {
2348
2434
  */
2349
2435
  async migrateTo(e) {
2350
2436
  return u(this, i, F).call(this, ({ migrations: a, executedMigrations: r, pendingMigrations: o }) => {
2351
- if (e === Ea)
2437
+ if (e === qa)
2352
2438
  return { direction: "Down", step: 1 / 0 };
2353
2439
  if (!a.find((l) => l.name === e))
2354
2440
  throw new Error(`migration "${e}" doesn't exist`);
@@ -2400,110 +2486,110 @@ class Ne {
2400
2486
  }
2401
2487
  h = new WeakMap(), i = new WeakSet(), F = async function(e) {
2402
2488
  try {
2403
- return await u(this, i, be).call(this), await u(this, i, ke).call(this, e);
2489
+ return await u(this, i, xe).call(this), await u(this, i, $e).call(this, e);
2404
2490
  } catch (a) {
2405
- return a instanceof Q ? a.resultSet : { error: a };
2491
+ return a instanceof q ? a.resultSet : { error: a };
2406
2492
  }
2407
2493
  }, v = function() {
2408
- return c(this, h).migrationTableSchema;
2494
+ return d(this, h).migrationTableSchema;
2409
2495
  }, N = function() {
2410
- return c(this, h).migrationTableName ?? La;
2496
+ return d(this, h).migrationTableName ?? Ba;
2411
2497
  }, D = function() {
2412
- return c(this, h).migrationLockTableName ?? _e;
2413
- }, Ce = function() {
2414
- return c(this, h).allowUnorderedMigrations ?? za;
2498
+ return d(this, h).migrationLockTableName ?? fe;
2499
+ }, be = function() {
2500
+ return d(this, h).allowUnorderedMigrations ?? Qa;
2415
2501
  }, C = function() {
2416
- return c(this, i, v) ? new Fa(c(this, i, v)) : new Aa();
2417
- }, be = async function() {
2418
- await u(this, i, xe).call(this), await u(this, i, Te).call(this), await u(this, i, Se).call(this), await u(this, i, Oe).call(this);
2502
+ return d(this, i, v) ? new Ra(d(this, i, v)) : new Ua();
2419
2503
  }, xe = async function() {
2420
- if (c(this, i, v) && !await u(this, i, G).call(this))
2504
+ 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);
2505
+ }, Te = async function() {
2506
+ if (d(this, i, v) && !await u(this, i, H).call(this))
2421
2507
  try {
2422
- await u(this, i, A).call(this, c(this, h).db.schema.createSchema(c(this, i, v)));
2508
+ await u(this, i, A).call(this, d(this, h).db.schema.createSchema(d(this, i, v)));
2423
2509
  } catch (e) {
2424
- if (!await u(this, i, G).call(this))
2510
+ if (!await u(this, i, H).call(this))
2425
2511
  throw e;
2426
2512
  }
2427
- }, Te = async function() {
2428
- if (!await u(this, i, I).call(this, c(this, i, N)))
2513
+ }, Se = async function() {
2514
+ if (!await u(this, i, I).call(this, d(this, i, N)))
2429
2515
  try {
2430
- c(this, i, v) && await u(this, i, A).call(this, c(this, h).db.schema.createSchema(c(this, i, v))), await u(this, i, A).call(this, c(this, h).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()));
2516
+ d(this, i, v) && await u(this, i, A).call(this, d(this, h).db.schema.createSchema(d(this, i, v))), await u(this, i, A).call(this, d(this, h).db.schema.withPlugin(d(this, i, C)).createTable(d(this, i, N)).addColumn("name", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("timestamp", "varchar(255)", (e) => e.notNull()));
2431
2517
  } catch (e) {
2432
- if (!await u(this, i, I).call(this, c(this, i, N)))
2518
+ if (!await u(this, i, I).call(this, d(this, i, N)))
2433
2519
  throw e;
2434
2520
  }
2435
- }, Se = async function() {
2436
- if (!await u(this, i, I).call(this, c(this, i, D)))
2521
+ }, Oe = async function() {
2522
+ if (!await u(this, i, I).call(this, d(this, i, D)))
2437
2523
  try {
2438
- await u(this, i, A).call(this, c(this, h).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)));
2524
+ await u(this, i, A).call(this, d(this, h).db.schema.withPlugin(d(this, i, C)).createTable(d(this, i, D)).addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("is_locked", "integer", (e) => e.notNull().defaultTo(0)));
2439
2525
  } catch (e) {
2440
- if (!await u(this, i, I).call(this, c(this, i, D)))
2526
+ if (!await u(this, i, I).call(this, d(this, i, D)))
2441
2527
  throw e;
2442
2528
  }
2443
- }, Oe = async function() {
2444
- if (!await u(this, i, H).call(this))
2529
+ }, ke = async function() {
2530
+ if (!await u(this, i, X).call(this))
2445
2531
  try {
2446
- await c(this, h).db.withPlugin(c(this, i, C)).insertInto(c(this, i, D)).values({ id: B, is_locked: 0 }).execute();
2532
+ await d(this, h).db.withPlugin(d(this, i, C)).insertInto(d(this, i, D)).values({ id: Q, is_locked: 0 }).execute();
2447
2533
  } catch (e) {
2448
- if (!await u(this, i, H).call(this))
2534
+ if (!await u(this, i, X).call(this))
2449
2535
  throw e;
2450
2536
  }
2451
- }, G = async function() {
2452
- return (await c(this, h).db.introspection.getSchemas()).some((a) => a.name === c(this, i, v));
2537
+ }, H = async function() {
2538
+ return (await d(this, h).db.introspection.getSchemas()).some((a) => a.name === d(this, i, v));
2453
2539
  }, I = async function(e) {
2454
- const a = c(this, i, v);
2455
- return (await c(this, h).db.introspection.getTables({
2540
+ const a = d(this, i, v);
2541
+ return (await d(this, h).db.introspection.getTables({
2456
2542
  withInternalKyselyTables: !0
2457
2543
  })).some((o) => o.name === e && (!a || o.schema === a));
2458
- }, H = async function() {
2459
- return !!await c(this, h).db.withPlugin(c(this, i, C)).selectFrom(c(this, i, D)).where("id", "=", B).select("id").executeTakeFirst();
2460
- }, ke = async function(e) {
2461
- const a = c(this, h).db.getExecutor().adapter, r = p({
2462
- lockTable: c(this, h).migrationLockTableName ?? _e,
2463
- lockRowId: B,
2464
- lockTableSchema: c(this, h).migrationTableSchema
2544
+ }, X = async function() {
2545
+ return !!await d(this, h).db.withPlugin(d(this, i, C)).selectFrom(d(this, i, D)).where("id", "=", Q).select("id").executeTakeFirst();
2546
+ }, $e = async function(e) {
2547
+ const a = d(this, h).db.getExecutor().adapter, r = p({
2548
+ lockTable: d(this, h).migrationLockTableName ?? fe,
2549
+ lockRowId: Q,
2550
+ lockTableSchema: d(this, h).migrationTableSchema
2465
2551
  }), o = async (n) => {
2466
2552
  try {
2467
2553
  await a.acquireMigrationLock(n, r);
2468
- const s = await u(this, i, $e).call(this, n);
2554
+ const s = await u(this, i, De).call(this, n);
2469
2555
  if (s.migrations.length === 0)
2470
2556
  return { results: [] };
2471
- const { direction: l, step: d } = e(s);
2472
- return d <= 0 ? { results: [] } : l === "Down" ? await u(this, i, Me).call(this, n, s, d) : l === "Up" ? await u(this, i, Fe).call(this, n, s, d) : { results: [] };
2557
+ const { direction: l, step: c } = e(s);
2558
+ return c <= 0 ? { results: [] } : l === "Down" ? await u(this, i, Fe).call(this, n, s, c) : l === "Up" ? await u(this, i, Ae).call(this, n, s, c) : { results: [] };
2473
2559
  } finally {
2474
2560
  await a.releaseMigrationLock(n, r);
2475
2561
  }
2476
2562
  };
2477
- return a.supportsTransactionalDdl ? c(this, h).db.transaction().execute(o) : c(this, h).db.connection().execute(o);
2478
- }, $e = async function(e) {
2479
- const a = await u(this, i, X).call(this), r = await u(this, i, Ie).call(this, e);
2480
- u(this, i, Pe).call(this, a, r), c(this, i, Ce) || u(this, i, je).call(this, a, r);
2481
- const o = u(this, i, De).call(this, a, r);
2563
+ return a.supportsTransactionalDdl ? d(this, h).db.transaction().execute(o) : d(this, h).db.connection().execute(o);
2564
+ }, De = async function(e) {
2565
+ const a = await u(this, i, Y).call(this), r = await u(this, i, Pe).call(this, e);
2566
+ u(this, i, je).call(this, a, r), d(this, i, be) || u(this, i, Me).call(this, a, r);
2567
+ const o = u(this, i, Ie).call(this, a, r);
2482
2568
  return p({
2483
2569
  migrations: a,
2484
2570
  executedMigrations: r,
2485
- lastMigration: Da(r),
2571
+ lastMigration: La(r),
2486
2572
  pendingMigrations: o
2487
2573
  });
2488
- }, De = function(e, a) {
2574
+ }, Ie = function(e, a) {
2489
2575
  return e.filter((r) => !a.includes(r.name));
2490
- }, X = async function() {
2491
- const e = await c(this, h).provider.getMigrations();
2576
+ }, Y = async function() {
2577
+ const e = await d(this, h).provider.getMigrations();
2492
2578
  return Object.keys(e).sort().map((a) => ({
2493
2579
  ...e[a],
2494
2580
  name: a
2495
2581
  }));
2496
- }, Ie = async function(e) {
2497
- return (await e.withPlugin(c(this, i, C)).selectFrom(c(this, i, N)).select("name").orderBy(["timestamp", "name"]).execute()).map((r) => r.name);
2498
- }, Pe = function(e, a) {
2582
+ }, Pe = async function(e) {
2583
+ return (await e.withPlugin(d(this, i, C)).selectFrom(d(this, i, N)).select("name").orderBy(["timestamp", "name"]).execute()).map((r) => r.name);
2584
+ }, je = function(e, a) {
2499
2585
  for (const r of a)
2500
2586
  if (!e.some((o) => o.name === r))
2501
2587
  throw new Error(`corrupted migrations: previously executed migration ${r} is missing`);
2502
- }, je = function(e, a) {
2588
+ }, Me = function(e, a) {
2503
2589
  for (let r = 0; r < a.length; ++r)
2504
2590
  if (e[r].name !== a[r])
2505
2591
  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.`);
2506
- }, Me = async function(e, a, r) {
2592
+ }, Fe = async function(e, a, r) {
2507
2593
  const o = a.executedMigrations.slice().reverse().slice(0, r).map((s) => a.migrations.find((l) => l.name === s)), n = o.map((s) => ({
2508
2594
  migrationName: s.name,
2509
2595
  direction: "Down",
@@ -2512,24 +2598,24 @@ h = new WeakMap(), i = new WeakSet(), F = async function(e) {
2512
2598
  for (let s = 0; s < n.length; ++s) {
2513
2599
  const l = o[s];
2514
2600
  try {
2515
- l.down && (await l.down(e), await e.withPlugin(c(this, i, C)).deleteFrom(c(this, i, N)).where("name", "=", l.name).execute(), n[s] = {
2601
+ l.down && (await l.down(e), await e.withPlugin(d(this, i, C)).deleteFrom(d(this, i, N)).where("name", "=", l.name).execute(), n[s] = {
2516
2602
  migrationName: l.name,
2517
2603
  direction: "Down",
2518
2604
  status: "Success"
2519
2605
  });
2520
- } catch (d) {
2606
+ } catch (c) {
2521
2607
  throw n[s] = {
2522
2608
  migrationName: l.name,
2523
2609
  direction: "Down",
2524
2610
  status: "Error"
2525
- }, new Q({
2526
- error: d,
2611
+ }, new q({
2612
+ error: c,
2527
2613
  results: n
2528
2614
  });
2529
2615
  }
2530
2616
  }
2531
2617
  return { results: n };
2532
- }, Fe = async function(e, a, r) {
2618
+ }, Ae = async function(e, a, r) {
2533
2619
  const n = a.pendingMigrations.slice(0, r).map((s) => ({
2534
2620
  migrationName: s.name,
2535
2621
  direction: "Up",
@@ -2538,7 +2624,7 @@ h = new WeakMap(), i = new WeakSet(), F = async function(e) {
2538
2624
  for (let s = 0; s < n.length; s++) {
2539
2625
  const l = a.pendingMigrations[s];
2540
2626
  try {
2541
- await l.up(e), await e.withPlugin(c(this, i, C)).insertInto(c(this, i, N)).values({
2627
+ await l.up(e), await e.withPlugin(d(this, i, C)).insertInto(d(this, i, N)).values({
2542
2628
  name: l.name,
2543
2629
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
2544
2630
  }).execute(), n[s] = {
@@ -2546,34 +2632,34 @@ h = new WeakMap(), i = new WeakSet(), F = async function(e) {
2546
2632
  direction: "Up",
2547
2633
  status: "Success"
2548
2634
  };
2549
- } catch (d) {
2635
+ } catch (c) {
2550
2636
  throw n[s] = {
2551
2637
  migrationName: l.name,
2552
2638
  direction: "Up",
2553
2639
  status: "Error"
2554
- }, new Q({
2555
- error: d,
2640
+ }, new q({
2641
+ error: c,
2556
2642
  results: n
2557
2643
  });
2558
2644
  }
2559
2645
  }
2560
2646
  return { results: n };
2561
2647
  }, A = async function(e) {
2562
- c(this, h).db.getExecutor().adapter.supportsCreateIfNotExists && (e = e.ifNotExists()), await e.execute();
2648
+ d(this, h).db.getExecutor().adapter.supportsCreateIfNotExists && (e = e.ifNotExists()), await e.execute();
2563
2649
  };
2564
2650
  var z;
2565
- class Q extends Error {
2651
+ class q extends Error {
2566
2652
  constructor(a) {
2567
2653
  super();
2568
2654
  y(this, z);
2569
2655
  M(this, z, a);
2570
2656
  }
2571
2657
  get resultSet() {
2572
- return c(this, z);
2658
+ return d(this, z);
2573
2659
  }
2574
2660
  }
2575
2661
  z = new WeakMap();
2576
- class Ae {
2662
+ class Le {
2577
2663
  constructor(e) {
2578
2664
  j(this, "migrations");
2579
2665
  this.migrations = e;
@@ -2582,7 +2668,7 @@ class Ae {
2582
2668
  return this.migrations;
2583
2669
  }
2584
2670
  }
2585
- async function Ja(t) {
2671
+ async function Va(t) {
2586
2672
  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(
2587
2673
  "tenant_id",
2588
2674
  "varchar(255)",
@@ -2654,35 +2740,35 @@ async function Ja(t) {
2654
2740
  (e) => e.references("tenants.id").onDelete("cascade").notNull()
2655
2741
  ).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();
2656
2742
  }
2657
- async function Ka(t) {
2743
+ async function Wa(t) {
2658
2744
  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();
2659
2745
  }
2660
- const Ra = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2746
+ const Ga = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2661
2747
  __proto__: null,
2662
- down: Ka,
2663
- up: Ja
2748
+ down: Wa,
2749
+ up: Va
2664
2750
  }, Symbol.toStringTag, { value: "Module" }));
2665
- async function Ua(t) {
2751
+ async function Ha(t) {
2666
2752
  await t.schema.alterTable("tenants").addColumn("support_url", "varchar(255)").execute();
2667
2753
  }
2668
- async function Ba(t) {
2754
+ async function Xa(t) {
2669
2755
  await t.schema.alterTable("tenants").dropColumn("support_url").execute();
2670
2756
  }
2671
- const Qa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2757
+ const Ya = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2672
2758
  __proto__: null,
2673
- down: Ba,
2674
- up: Ua
2759
+ down: Xa,
2760
+ up: Ha
2675
2761
  }, Symbol.toStringTag, { value: "Module" }));
2676
- async function Va(t) {
2762
+ async function Za(t) {
2677
2763
  }
2678
- async function Wa(t) {
2764
+ async function er(t) {
2679
2765
  }
2680
- const qa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2766
+ const tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2681
2767
  __proto__: null,
2682
- down: Wa,
2683
- up: Va
2768
+ down: er,
2769
+ up: Za
2684
2770
  }, Symbol.toStringTag, { value: "Module" }));
2685
- async function Ga(t) {
2771
+ async function ar(t) {
2686
2772
  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(
2687
2773
  "tenant_id_constraint",
2688
2774
  ["tenant_id"],
@@ -2691,24 +2777,24 @@ async function Ga(t) {
2691
2777
  (e) => e.onDelete("cascade")
2692
2778
  ).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();
2693
2779
  }
2694
- async function Ha(t) {
2780
+ async function rr(t) {
2695
2781
  await t.schema.dropTable("logs").execute();
2696
2782
  }
2697
- const Xa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2783
+ const nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2698
2784
  __proto__: null,
2699
- down: Ha,
2700
- up: Ga
2785
+ down: rr,
2786
+ up: ar
2701
2787
  }, Symbol.toStringTag, { value: "Module" }));
2702
- async function Ya(t) {
2788
+ async function or(t) {
2703
2789
  }
2704
- async function Za(t) {
2790
+ async function sr(t) {
2705
2791
  }
2706
- const er = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2792
+ const ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2707
2793
  __proto__: null,
2708
- down: Za,
2709
- up: Ya
2794
+ down: sr,
2795
+ up: or
2710
2796
  }, Symbol.toStringTag, { value: "Module" }));
2711
- async function tr(t) {
2797
+ async function cr(t) {
2712
2798
  await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
2713
2799
  "user_id_constraint",
2714
2800
  ["user_id", "tenant_id"],
@@ -2733,15 +2819,15 @@ async function tr(t) {
2733
2819
  (e) => e.references("applications.id").onDelete("cascade").notNull()
2734
2820
  ).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();
2735
2821
  }
2736
- async function ar(t) {
2822
+ async function lr(t) {
2737
2823
  await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("tickets").execute(), await t.schema.dropTable("otps").execute();
2738
2824
  }
2739
- const rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2825
+ const dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2740
2826
  __proto__: null,
2741
- down: ar,
2742
- up: tr
2827
+ down: lr,
2828
+ up: cr
2743
2829
  }, Symbol.toStringTag, { value: "Module" }));
2744
- async function nr(t) {
2830
+ async function ur(t) {
2745
2831
  await t.schema.createTable("passwords").addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addPrimaryKeyConstraint("passwords_pkey", ["user_id", "tenant_id"]).addForeignKeyConstraint(
2746
2832
  "user_id_constraint",
2747
2833
  ["user_id", "tenant_id"],
@@ -2756,24 +2842,24 @@ async function nr(t) {
2756
2842
  (e) => e.onDelete("cascade")
2757
2843
  ).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();
2758
2844
  }
2759
- async function or(t) {
2845
+ async function mr(t) {
2760
2846
  await t.schema.dropTable("passwords").execute(), await t.schema.dropTable("codes").execute();
2761
2847
  }
2762
- const sr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2848
+ const hr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2763
2849
  __proto__: null,
2764
- down: or,
2765
- up: nr
2850
+ down: mr,
2851
+ up: ur
2766
2852
  }, Symbol.toStringTag, { value: "Module" }));
2767
- async function ir(t) {
2853
+ async function _r(t) {
2768
2854
  }
2769
- async function dr(t) {
2855
+ async function fr(t) {
2770
2856
  }
2771
- const cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2857
+ const pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2772
2858
  __proto__: null,
2773
- down: dr,
2774
- up: ir
2859
+ down: fr,
2860
+ up: _r
2775
2861
  }, Symbol.toStringTag, { value: "Module" }));
2776
- async function lr(t) {
2862
+ async function gr(t) {
2777
2863
  await t.schema.alterTable("passwords").addColumn(
2778
2864
  "password",
2779
2865
  "varchar(255)",
@@ -2781,288 +2867,288 @@ async function lr(t) {
2781
2867
  (e) => e.notNull()
2782
2868
  ).execute();
2783
2869
  }
2784
- async function ur(t) {
2870
+ async function yr(t) {
2785
2871
  await t.schema.alterTable("passwords").dropColumn("password").execute();
2786
2872
  }
2787
- const mr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2873
+ const wr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2788
2874
  __proto__: null,
2789
- down: ur,
2790
- up: lr
2875
+ down: yr,
2876
+ up: gr
2791
2877
  }, Symbol.toStringTag, { value: "Module" }));
2792
- async function hr(t) {
2878
+ async function vr(t) {
2793
2879
  }
2794
- async function _r(t) {
2880
+ async function Nr(t) {
2795
2881
  }
2796
- const fr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2882
+ const Cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2797
2883
  __proto__: null,
2798
- down: _r,
2799
- up: hr
2884
+ down: Nr,
2885
+ up: vr
2800
2886
  }, Symbol.toStringTag, { value: "Module" }));
2801
- async function pr(t) {
2887
+ async function br(t) {
2802
2888
  }
2803
- async function gr(t) {
2889
+ async function xr(t) {
2804
2890
  }
2805
- const yr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2891
+ const Tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2806
2892
  __proto__: null,
2807
- down: gr,
2808
- up: pr
2893
+ down: xr,
2894
+ up: br
2809
2895
  }, Symbol.toStringTag, { value: "Module" }));
2810
- async function wr(t) {
2896
+ async function Sr(t) {
2811
2897
  }
2812
- async function vr(t) {
2898
+ async function Or(t) {
2813
2899
  }
2814
- const Nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2900
+ const kr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2815
2901
  __proto__: null,
2816
- down: vr,
2817
- up: wr
2902
+ down: Or,
2903
+ up: Sr
2818
2904
  }, Symbol.toStringTag, { value: "Module" }));
2819
- async function Cr(t) {
2905
+ async function $r(t) {
2820
2906
  await t.schema.createIndex("users_email_index").on("users").column("email").execute();
2821
2907
  }
2822
- async function br(t) {
2908
+ async function Dr(t) {
2823
2909
  await t.schema.dropIndex("users_email_index").execute();
2824
2910
  }
2825
- const xr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2911
+ const Ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2826
2912
  __proto__: null,
2827
- down: br,
2828
- up: Cr
2913
+ down: Dr,
2914
+ up: $r
2829
2915
  }, Symbol.toStringTag, { value: "Module" }));
2830
- async function Tr(t) {
2916
+ async function Pr(t) {
2831
2917
  await t.schema.alterTable("users").addColumn("profileData", "varchar(2048)").execute();
2832
2918
  }
2833
- async function Sr(t) {
2919
+ async function jr(t) {
2834
2920
  await t.schema.alterTable("users").dropColumn("profileData").execute();
2835
2921
  }
2836
- const Or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2922
+ const Mr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2837
2923
  __proto__: null,
2838
- down: Sr,
2839
- up: Tr
2924
+ down: jr,
2925
+ up: Pr
2840
2926
  }, Symbol.toStringTag, { value: "Module" }));
2841
- async function kr(t) {
2927
+ async function Fr(t) {
2842
2928
  await t.schema.createIndex("users_linked_to_index").on("users").column("linked_to").execute();
2843
2929
  }
2844
- async function $r(t) {
2930
+ async function Ar(t) {
2845
2931
  await t.schema.dropIndex("users_linked_to_index");
2846
2932
  }
2847
- const Dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2933
+ const Lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2848
2934
  __proto__: null,
2849
- down: $r,
2850
- up: kr
2935
+ down: Ar,
2936
+ up: Fr
2851
2937
  }, Symbol.toStringTag, { value: "Module" }));
2852
- async function Ir(t) {
2938
+ async function zr(t) {
2853
2939
  await t.schema.alterTable("users").addColumn("locale", "varchar(255)").execute();
2854
2940
  }
2855
- async function Pr(t) {
2941
+ async function Jr(t) {
2856
2942
  await t.schema.alterTable("users").dropColumn("locale").execute();
2857
2943
  }
2858
- const jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2944
+ const Er = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2859
2945
  __proto__: null,
2860
- down: Pr,
2861
- up: Ir
2946
+ down: Jr,
2947
+ up: zr
2862
2948
  }, Symbol.toStringTag, { value: "Module" }));
2863
- async function Mr(t) {
2949
+ async function Kr(t) {
2864
2950
  await t.schema.createTable("keys").addColumn("kid", "varchar(255)", (e) => e.primaryKey()).addColumn(
2865
2951
  "tenant_id",
2866
2952
  "varchar(255)",
2867
2953
  (e) => e.references("tenants.id").onDelete("cascade")
2868
2954
  ).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();
2869
2955
  }
2870
- async function Fr(t) {
2956
+ async function Rr(t) {
2871
2957
  await t.schema.dropTable("keys").execute();
2872
2958
  }
2873
- const Ar = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2959
+ const Ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2874
2960
  __proto__: null,
2875
- down: Fr,
2876
- up: Mr
2961
+ down: Rr,
2962
+ up: Kr
2877
2963
  }, Symbol.toStringTag, { value: "Module" }));
2878
- async function Lr(t) {
2964
+ async function Br(t) {
2879
2965
  }
2880
- async function zr(t) {
2966
+ async function Qr(t) {
2881
2967
  }
2882
- const Er = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2968
+ const qr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2883
2969
  __proto__: null,
2884
- down: zr,
2885
- up: Lr
2970
+ down: Qr,
2971
+ up: Br
2886
2972
  }, Symbol.toStringTag, { value: "Module" }));
2887
- async function Jr(t) {
2973
+ async function Vr(t) {
2888
2974
  }
2889
- async function Kr(t) {
2975
+ async function Wr(t) {
2890
2976
  }
2891
- const Rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2977
+ const Gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2892
2978
  __proto__: null,
2893
- down: Kr,
2894
- up: Jr
2979
+ down: Wr,
2980
+ up: Vr
2895
2981
  }, Symbol.toStringTag, { value: "Module" }));
2896
- async function Ur(t) {
2982
+ async function Hr(t) {
2897
2983
  await t.schema.alterTable("otps").addColumn("audience", "varchar(255)").execute();
2898
2984
  }
2899
- async function Br(t) {
2985
+ async function Xr(t) {
2900
2986
  await t.schema.alterTable("otps").dropColumn("audience").execute();
2901
2987
  }
2902
- const Qr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2988
+ const Yr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2903
2989
  __proto__: null,
2904
- down: Br,
2905
- up: Ur
2990
+ down: Xr,
2991
+ up: Hr
2906
2992
  }, Symbol.toStringTag, { value: "Module" }));
2907
- async function Vr(t) {
2993
+ async function Zr(t) {
2908
2994
  }
2909
- async function Wr(t) {
2995
+ async function en(t) {
2910
2996
  }
2911
- const qr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2997
+ const tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2912
2998
  __proto__: null,
2913
- down: Wr,
2914
- up: Vr
2999
+ down: en,
3000
+ up: Zr
2915
3001
  }, Symbol.toStringTag, { value: "Module" }));
2916
- async function Gr(t) {
3002
+ async function an(t) {
2917
3003
  await t.schema.alterTable("logs").dropColumn("category").execute();
2918
3004
  }
2919
- async function Hr(t) {
3005
+ async function rn(t) {
2920
3006
  await t.schema.alterTable("logs").addColumn("category", "varchar(255)", (e) => e.notNull()).execute();
2921
3007
  }
2922
- const Xr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3008
+ const nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2923
3009
  __proto__: null,
2924
- down: Hr,
2925
- up: Gr
3010
+ down: rn,
3011
+ up: an
2926
3012
  }, Symbol.toStringTag, { value: "Module" }));
2927
- async function Yr(t) {
3013
+ async function on(t) {
2928
3014
  await t.schema.alterTable("users").dropColumn("tags").execute();
2929
3015
  }
2930
- async function Zr(t) {
3016
+ async function sn(t) {
2931
3017
  await t.schema.alterTable("users").addColumn("tags", "varchar(255)").execute();
2932
3018
  }
2933
- const en = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3019
+ const cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2934
3020
  __proto__: null,
2935
- down: Zr,
2936
- up: Yr
3021
+ down: sn,
3022
+ up: on
2937
3023
  }, Symbol.toStringTag, { value: "Module" }));
2938
- async function tn(t) {
3024
+ async function ln(t) {
2939
3025
  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();
2940
3026
  }
2941
- async function an(t) {
3027
+ async function dn(t) {
2942
3028
  await t.schema.dropIndex("logs_user_id"), await t.schema.dropIndex("logs_tenant_id"), await t.schema.dropIndex("logs_date");
2943
3029
  }
2944
- const rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3030
+ const un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2945
3031
  __proto__: null,
2946
- down: an,
2947
- up: tn
3032
+ down: dn,
3033
+ up: ln
2948
3034
  }, Symbol.toStringTag, { value: "Module" }));
2949
- async function nn(t) {
3035
+ async function mn(t) {
2950
3036
  await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(8192)").execute();
2951
3037
  }
2952
- async function on(t) {
3038
+ async function hn(t) {
2953
3039
  await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(2048)").execute();
2954
3040
  }
2955
- const sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3041
+ const _n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2956
3042
  __proto__: null,
2957
- down: on,
2958
- up: nn
3043
+ down: hn,
3044
+ up: mn
2959
3045
  }, Symbol.toStringTag, { value: "Module" }));
2960
- async function dn(t) {
3046
+ async function fn(t) {
2961
3047
  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();
2962
3048
  }
2963
- async function cn(t) {
3049
+ async function pn(t) {
2964
3050
  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();
2965
3051
  }
2966
- const ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3052
+ const gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2967
3053
  __proto__: null,
2968
- down: cn,
2969
- up: dn
3054
+ down: pn,
3055
+ up: fn
2970
3056
  }, Symbol.toStringTag, { value: "Module" }));
2971
- async function un(t) {
3057
+ async function yn(t) {
2972
3058
  await t.schema.createIndex("users_name_index").on("users").column("name").execute();
2973
3059
  }
2974
- async function mn(t) {
3060
+ async function wn(t) {
2975
3061
  await t.schema.dropIndex("users_name_index").execute();
2976
3062
  }
2977
- const hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3063
+ const vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2978
3064
  __proto__: null,
2979
- down: mn,
2980
- up: un
3065
+ down: wn,
3066
+ up: yn
2981
3067
  }, Symbol.toStringTag, { value: "Module" }));
2982
- async function _n(t) {
3068
+ async function Nn(t) {
2983
3069
  }
2984
- async function fn(t) {
3070
+ async function Cn(t) {
2985
3071
  await t.schema.alterTable("users").dropConstraint("unique_email_provider").execute();
2986
3072
  }
2987
- const pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3073
+ const bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2988
3074
  __proto__: null,
2989
- down: fn,
2990
- up: _n
3075
+ down: Cn,
3076
+ up: Nn
2991
3077
  }, Symbol.toStringTag, { value: "Module" }));
2992
- async function gn(t) {
3078
+ async function xn(t) {
2993
3079
  await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(8192)").execute();
2994
3080
  }
2995
- async function yn(t) {
3081
+ async function Tn(t) {
2996
3082
  await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(1024)").execute();
2997
3083
  }
2998
- const wn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3084
+ const Sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2999
3085
  __proto__: null,
3000
- down: yn,
3001
- up: gn
3086
+ down: Tn,
3087
+ up: xn
3002
3088
  }, Symbol.toStringTag, { value: "Module" }));
3003
- async function vn(t) {
3089
+ async function On(t) {
3004
3090
  await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(8192)").execute();
3005
3091
  }
3006
- async function Nn(t) {
3092
+ async function kn(t) {
3007
3093
  await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(1024)").execute();
3008
3094
  }
3009
- const Cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3095
+ const $n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3010
3096
  __proto__: null,
3011
- down: Nn,
3012
- up: vn
3097
+ down: kn,
3098
+ up: On
3013
3099
  }, Symbol.toStringTag, { value: "Module" }));
3014
- async function bn(t) {
3100
+ async function Dn(t) {
3015
3101
  await t.schema.createTable("branding").addColumn(
3016
3102
  "tenant_id",
3017
3103
  "varchar(255)",
3018
3104
  (e) => e.references("tenants.id").onDelete("cascade").notNull().primaryKey()
3019
3105
  ).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();
3020
3106
  }
3021
- async function xn(t) {
3107
+ async function In(t) {
3022
3108
  await t.schema.dropTable("branding").execute();
3023
3109
  }
3024
- const Tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3110
+ const Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3025
3111
  __proto__: null,
3026
- down: xn,
3027
- up: bn
3112
+ down: In,
3113
+ up: Dn
3028
3114
  }, Symbol.toStringTag, { value: "Module" }));
3029
- async function Sn(t) {
3115
+ async function jn(t) {
3030
3116
  }
3031
- async function On(t) {
3117
+ async function Mn(t) {
3032
3118
  }
3033
- const kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3119
+ const Fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3034
3120
  __proto__: null,
3035
- down: On,
3036
- up: Sn
3121
+ down: Mn,
3122
+ up: jn
3037
3123
  }, Symbol.toStringTag, { value: "Module" }));
3038
- async function $n(t) {
3124
+ async function An(t) {
3039
3125
  }
3040
- async function Dn(t) {
3126
+ async function Ln(t) {
3041
3127
  }
3042
- const In = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3128
+ const zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3043
3129
  __proto__: null,
3044
- down: Dn,
3045
- up: $n
3130
+ down: Ln,
3131
+ up: An
3046
3132
  }, Symbol.toStringTag, { value: "Module" }));
3047
- async function Pn(t) {
3133
+ async function Jn(t) {
3048
3134
  }
3049
- async function jn(t) {
3135
+ async function En(t) {
3050
3136
  }
3051
- const Mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3137
+ const Kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3052
3138
  __proto__: null,
3053
- down: jn,
3054
- up: Pn
3139
+ down: En,
3140
+ up: Jn
3055
3141
  }, Symbol.toStringTag, { value: "Module" }));
3056
- async function Fn(t) {
3142
+ async function Rn(t) {
3057
3143
  }
3058
- async function An(t) {
3144
+ async function Un(t) {
3059
3145
  }
3060
- const Ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3146
+ const Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3061
3147
  __proto__: null,
3062
- down: An,
3063
- up: Fn
3148
+ down: Un,
3149
+ up: Rn
3064
3150
  }, Symbol.toStringTag, { value: "Module" }));
3065
- async function zn(t) {
3151
+ async function Qn(t) {
3066
3152
  await t.schema.createTable("authentication_codes").addColumn(
3067
3153
  "tenant_id",
3068
3154
  "varchar(255)",
@@ -3073,55 +3159,55 @@ async function zn(t) {
3073
3159
  (e) => e.references("applications.id").onDelete("cascade").notNull()
3074
3160
  ).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();
3075
3161
  }
3076
- async function En(t) {
3162
+ async function qn(t) {
3077
3163
  await t.schema.dropTable("authentication_codes").execute();
3078
3164
  }
3079
- const Jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3165
+ const Vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3080
3166
  __proto__: null,
3081
- down: En,
3082
- up: zn
3167
+ down: qn,
3168
+ up: Qn
3083
3169
  }, Symbol.toStringTag, { value: "Module" }));
3084
- async function Kn(t) {
3170
+ async function Wn(t) {
3085
3171
  }
3086
- async function Rn(t) {
3172
+ async function Gn(t) {
3087
3173
  }
3088
- const Un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3174
+ const Hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3089
3175
  __proto__: null,
3090
- down: Rn,
3091
- up: Kn
3176
+ down: Gn,
3177
+ up: Wn
3092
3178
  }, Symbol.toStringTag, { value: "Module" }));
3093
- async function Bn(t) {
3179
+ async function Xn(t) {
3094
3180
  await t.schema.alterTable("otps").addColumn("ip", "varchar(64)").execute();
3095
3181
  }
3096
- async function Qn(t) {
3182
+ async function Yn(t) {
3097
3183
  await t.schema.alterTable("otps").dropColumn("ip").execute();
3098
3184
  }
3099
- const Vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3185
+ const Zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3100
3186
  __proto__: null,
3101
- down: Qn,
3102
- up: Bn
3187
+ down: Yn,
3188
+ up: Xn
3103
3189
  }, Symbol.toStringTag, { value: "Module" }));
3104
- async function Wn(t) {
3190
+ async function eo(t) {
3105
3191
  await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(1024)").execute();
3106
3192
  }
3107
- async function qn(t) {
3193
+ async function to(t) {
3108
3194
  await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(255)").execute();
3109
3195
  }
3110
- const Gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3196
+ const ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3111
3197
  __proto__: null,
3112
- down: qn,
3113
- up: Wn
3198
+ down: to,
3199
+ up: eo
3114
3200
  }, Symbol.toStringTag, { value: "Module" }));
3115
- async function Hn(t) {
3201
+ async function ro(t) {
3116
3202
  }
3117
- async function Xn(t) {
3203
+ async function no(t) {
3118
3204
  }
3119
- const Yn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3205
+ const oo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3120
3206
  __proto__: null,
3121
- down: Xn,
3122
- up: Hn
3207
+ down: no,
3208
+ up: ro
3123
3209
  }, Symbol.toStringTag, { value: "Module" }));
3124
- async function Zn(t) {
3210
+ async function so(t) {
3125
3211
  await t.schema.createTable("hooks").addColumn("hook_id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
3126
3212
  "tenant_id",
3127
3213
  "varchar(255)",
@@ -3132,33 +3218,33 @@ async function Zn(t) {
3132
3218
  (e) => e.defaultTo(!1).notNull()
3133
3219
  ).addColumn("priority", "integer").execute();
3134
3220
  }
3135
- async function eo(t) {
3221
+ async function io(t) {
3136
3222
  await t.schema.dropTable("hooks").execute();
3137
3223
  }
3138
- const to = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3224
+ const co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3139
3225
  __proto__: null,
3140
- down: eo,
3141
- up: Zn
3226
+ down: io,
3227
+ up: so
3142
3228
  }, Symbol.toStringTag, { value: "Module" }));
3143
- async function ao(t) {
3229
+ async function lo(t) {
3144
3230
  }
3145
- async function ro(t) {
3231
+ async function uo(t) {
3146
3232
  }
3147
- const no = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3233
+ const mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3148
3234
  __proto__: null,
3149
- down: ro,
3150
- up: ao
3235
+ down: uo,
3236
+ up: lo
3151
3237
  }, Symbol.toStringTag, { value: "Module" }));
3152
- async function oo(t) {
3238
+ async function ho(t) {
3153
3239
  }
3154
- async function so(t) {
3240
+ async function _o(t) {
3155
3241
  }
3156
- const io = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3242
+ const fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3157
3243
  __proto__: null,
3158
- down: so,
3159
- up: oo
3244
+ down: _o,
3245
+ up: ho
3160
3246
  }, Symbol.toStringTag, { value: "Module" }));
3161
- async function co(t) {
3247
+ async function po(t) {
3162
3248
  await t.schema.createTable("logins").addColumn("login_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
3163
3249
  "tenant_id",
3164
3250
  "varchar(255)",
@@ -3175,7 +3261,7 @@ async function co(t) {
3175
3261
  (e) => e.onDelete("cascade")
3176
3262
  ).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();
3177
3263
  }
3178
- async function lo(t) {
3264
+ async function go(t) {
3179
3265
  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(
3180
3266
  "codes_user_id_tenant_id_constraint",
3181
3267
  ["user_id", "tenant_id"],
@@ -3184,90 +3270,90 @@ async function lo(t) {
3184
3270
  (e) => e.onDelete("cascade")
3185
3271
  ).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();
3186
3272
  }
3187
- const uo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3273
+ const yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3188
3274
  __proto__: null,
3189
- down: lo,
3190
- up: co
3275
+ down: go,
3276
+ up: po
3191
3277
  }, Symbol.toStringTag, { value: "Module" }));
3192
- async function mo(t) {
3278
+ async function wo(t) {
3193
3279
  }
3194
- async function ho(t) {
3280
+ async function vo(t) {
3195
3281
  }
3196
- const _o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3282
+ const No = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3197
3283
  __proto__: null,
3198
- down: ho,
3199
- up: mo
3284
+ down: vo,
3285
+ up: wo
3200
3286
  }, Symbol.toStringTag, { value: "Module" }));
3201
- async function fo(t) {
3287
+ async function Co(t) {
3202
3288
  await t.schema.alterTable("logins").addColumn("auth0Client", "varchar(256)").execute();
3203
3289
  }
3204
- async function po(t) {
3290
+ async function bo(t) {
3205
3291
  await t.schema.alterTable("logins").dropColumn("auth0Client").execute();
3206
3292
  }
3207
- const go = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3293
+ const xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3208
3294
  __proto__: null,
3209
- down: po,
3210
- up: fo
3295
+ down: bo,
3296
+ up: Co
3211
3297
  }, Symbol.toStringTag, { value: "Module" }));
3212
- async function yo(t) {
3298
+ async function To(t) {
3213
3299
  await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(8192)").execute();
3214
3300
  }
3215
- async function wo(t) {
3301
+ async function So(t) {
3216
3302
  await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(511)").execute();
3217
3303
  }
3218
- const vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3304
+ const Oo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3219
3305
  __proto__: null,
3220
- down: wo,
3221
- up: yo
3306
+ down: So,
3307
+ up: To
3222
3308
  }, Symbol.toStringTag, { value: "Module" }));
3223
- async function No(t) {
3309
+ async function ko(t) {
3224
3310
  }
3225
- async function Co(t) {
3311
+ async function $o(t) {
3226
3312
  }
3227
- const bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3313
+ const Do = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3228
3314
  __proto__: null,
3229
- down: Co,
3230
- up: No
3315
+ down: $o,
3316
+ up: ko
3231
3317
  }, Symbol.toStringTag, { value: "Module" }));
3232
- async function xo(t) {
3318
+ async function Io(t) {
3233
3319
  }
3234
- async function To(t) {
3320
+ async function Po(t) {
3235
3321
  }
3236
- const So = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3322
+ const jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3237
3323
  __proto__: null,
3238
- down: To,
3239
- up: xo
3324
+ down: Po,
3325
+ up: Io
3240
3326
  }, Symbol.toStringTag, { value: "Module" }));
3241
- async function Oo(t) {
3327
+ async function Mo(t) {
3242
3328
  await t.schema.alterTable("logins").addColumn("authParams_nonce", "varchar(255)").execute();
3243
3329
  }
3244
- async function ko(t) {
3330
+ async function Fo(t) {
3245
3331
  await t.schema.alterTable("logins").dropColumn("nonce").execute();
3246
3332
  }
3247
- const $o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3333
+ const Ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3248
3334
  __proto__: null,
3249
- down: ko,
3250
- up: Oo
3335
+ down: Fo,
3336
+ up: Mo
3251
3337
  }, Symbol.toStringTag, { value: "Module" }));
3252
- async function Do(t) {
3338
+ async function Lo(t) {
3253
3339
  }
3254
- async function Io(t) {
3340
+ async function zo(t) {
3255
3341
  }
3256
- const Po = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3342
+ const Jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3257
3343
  __proto__: null,
3258
- down: Io,
3259
- up: Do
3344
+ down: zo,
3345
+ up: Lo
3260
3346
  }, Symbol.toStringTag, { value: "Module" }));
3261
- async function jo(t) {
3347
+ async function Eo(t) {
3262
3348
  }
3263
- async function Mo(t) {
3349
+ async function Ko(t) {
3264
3350
  }
3265
- const Fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3351
+ const Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3266
3352
  __proto__: null,
3267
- down: Mo,
3268
- up: jo
3353
+ down: Ko,
3354
+ up: Eo
3269
3355
  }, Symbol.toStringTag, { value: "Module" }));
3270
- async function Ao(t) {
3356
+ async function Uo(t) {
3271
3357
  await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.notNull()).addColumn(
3272
3358
  "tenant_id",
3273
3359
  "varchar(255)",
@@ -3283,7 +3369,7 @@ async function Ao(t) {
3283
3369
  "code_type"
3284
3370
  ]).execute();
3285
3371
  }
3286
- async function Lo(t) {
3372
+ async function Bo(t) {
3287
3373
  await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
3288
3374
  "tenant_id",
3289
3375
  "varchar(255)",
@@ -3296,15 +3382,15 @@ async function Lo(t) {
3296
3382
  (e) => e.onDelete("cascade")
3297
3383
  ).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();
3298
3384
  }
3299
- const zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3385
+ const Qo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3300
3386
  __proto__: null,
3301
- down: Lo,
3302
- up: Ao
3387
+ down: Bo,
3388
+ up: Uo
3303
3389
  }, Symbol.toStringTag, { value: "Module" }));
3304
- async function Eo(t) {
3390
+ async function qo(t) {
3305
3391
  await t.schema.dropTable("otps").execute(), await t.schema.dropTable("authentication_codes").execute();
3306
3392
  }
3307
- async function Jo(t) {
3393
+ async function Vo(t) {
3308
3394
  await t.schema.alterTable("keys").addColumn("private_key", "varchar(2048)").addColumn("public_key", "varchar(2048)").execute(), await t.schema.createTable("otps").addColumn(
3309
3395
  "tenant_id",
3310
3396
  "varchar(255)",
@@ -3323,32 +3409,32 @@ async function Jo(t) {
3323
3409
  (e) => e.references("applications.id").onDelete("cascade").notNull()
3324
3410
  ).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();
3325
3411
  }
3326
- const Ko = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3412
+ const Wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3327
3413
  __proto__: null,
3328
- down: Jo,
3329
- up: Eo
3414
+ down: Vo,
3415
+ up: qo
3330
3416
  }, Symbol.toStringTag, { value: "Module" }));
3331
- async function Ro(t) {
3417
+ async function Go(t) {
3332
3418
  await t.schema.createIndex("IDX_logs_tenant_date_type_user").on("logs").columns(["tenant_id", "date", "type", "user_id"]).execute();
3333
3419
  }
3334
- async function Uo(t) {
3420
+ async function Ho(t) {
3335
3421
  await t.schema.dropIndex("IDX_logs_tenant_date_type_user").on("logs").execute();
3336
3422
  }
3337
- const Bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3423
+ const Xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3338
3424
  __proto__: null,
3339
- down: Uo,
3340
- up: Ro
3425
+ down: Ho,
3426
+ up: Go
3341
3427
  }, Symbol.toStringTag, { value: "Module" }));
3342
- async function Qo(t) {
3428
+ async function Yo(t) {
3343
3429
  }
3344
- async function Vo(t) {
3430
+ async function Zo(t) {
3345
3431
  }
3346
- const Wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3432
+ const es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3347
3433
  __proto__: null,
3348
- down: Vo,
3349
- up: Qo
3434
+ down: Zo,
3435
+ up: Yo
3350
3436
  }, Symbol.toStringTag, { value: "Module" }));
3351
- async function qo(t) {
3437
+ async function ts(t) {
3352
3438
  await t.schema.createTable("prompt_settings").addColumn("tenant_id", "varchar(64)", (e) => e.primaryKey()).addColumn(
3353
3439
  "universal_login_experience",
3354
3440
  "varchar(16)",
@@ -3367,95 +3453,95 @@ async function qo(t) {
3367
3453
  (e) => e.defaultTo(!1).notNull()
3368
3454
  ).execute();
3369
3455
  }
3370
- async function Go(t) {
3456
+ async function as(t) {
3371
3457
  await t.schema.dropTable("prompt_settings").execute();
3372
3458
  }
3373
- const Ho = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3459
+ const rs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3374
3460
  __proto__: null,
3375
- down: Go,
3376
- up: qo
3461
+ down: as,
3462
+ up: ts
3377
3463
  }, Symbol.toStringTag, { value: "Module" }));
3378
- async function Xo(t) {
3464
+ async function ns(t) {
3379
3465
  }
3380
- async function Yo(t) {
3466
+ async function os(t) {
3381
3467
  }
3382
- const Zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3468
+ const ss = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3383
3469
  __proto__: null,
3384
- down: Yo,
3385
- up: Xo
3470
+ down: os,
3471
+ up: ns
3386
3472
  }, Symbol.toStringTag, { value: "Module" }));
3387
- async function es(t) {
3473
+ async function is(t) {
3388
3474
  }
3389
- async function ts(t) {
3475
+ async function cs(t) {
3390
3476
  }
3391
- const as = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3477
+ const ls = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3392
3478
  __proto__: null,
3393
- down: ts,
3394
- up: es
3479
+ down: cs,
3480
+ up: is
3395
3481
  }, Symbol.toStringTag, { value: "Module" }));
3396
- async function rs(t) {
3482
+ async function ds(t) {
3397
3483
  }
3398
- async function ns(t) {
3484
+ async function us(t) {
3399
3485
  }
3400
- const os = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3486
+ const ms = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3401
3487
  __proto__: null,
3402
- down: ns,
3403
- up: rs
3488
+ down: us,
3489
+ up: ds
3404
3490
  }, Symbol.toStringTag, { value: "Module" }));
3405
- async function ss(t) {
3491
+ async function hs(t) {
3406
3492
  await t.schema.alterTable("logins").addColumn("authParams_ui_locales", "varchar(32)").execute();
3407
3493
  }
3408
- async function is(t) {
3494
+ async function _s(t) {
3409
3495
  await t.schema.alterTable("logins").dropColumn("authParams_ui_locales").execute();
3410
3496
  }
3411
- const ds = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3497
+ const fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3412
3498
  __proto__: null,
3413
- down: is,
3414
- up: ss
3499
+ down: _s,
3500
+ up: hs
3415
3501
  }, Symbol.toStringTag, { value: "Module" }));
3416
- async function cs(t) {
3502
+ async function ps(t) {
3417
3503
  await t.schema.alterTable("logins").addColumn("authParams_prompt", "varchar(16)").execute();
3418
3504
  }
3419
- async function ls(t) {
3505
+ async function gs(t) {
3420
3506
  await t.schema.alterTable("logins").dropColumn("authParams_prompt").execute();
3421
3507
  }
3422
- const us = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3508
+ const ys = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3423
3509
  __proto__: null,
3424
- down: ls,
3425
- up: cs
3510
+ down: gs,
3511
+ up: ps
3426
3512
  }, Symbol.toStringTag, { value: "Module" }));
3427
- async function ms(t) {
3513
+ async function ws(t) {
3428
3514
  }
3429
- async function hs(t) {
3515
+ async function vs(t) {
3430
3516
  }
3431
- const _s = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3517
+ const Ns = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3432
3518
  __proto__: null,
3433
- down: hs,
3434
- up: ms
3519
+ down: vs,
3520
+ up: ws
3435
3521
  }, Symbol.toStringTag, { value: "Module" }));
3436
- async function fs(t) {
3522
+ async function Cs(t) {
3437
3523
  await t.schema.alterTable("logins").addColumn("authParams_act_as", "varchar(255)").execute();
3438
3524
  }
3439
- async function ps(t) {
3525
+ async function bs(t) {
3440
3526
  await t.schema.alterTable("logins").dropColumn("authParam_act_as").execute();
3441
3527
  }
3442
- const gs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3528
+ const xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3443
3529
  __proto__: null,
3444
- down: ps,
3445
- up: fs
3530
+ down: bs,
3531
+ up: Cs
3446
3532
  }, Symbol.toStringTag, { value: "Module" }));
3447
- async function ys(t) {
3533
+ async function Ts(t) {
3448
3534
  await t.schema.alterTable("codes").addColumn("code_verifier", "varchar(128)").execute();
3449
3535
  }
3450
- async function ws(t) {
3536
+ async function Ss(t) {
3451
3537
  await t.schema.alterTable("codes").dropColumn("code_verifier").execute();
3452
3538
  }
3453
- const vs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3539
+ const Os = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3454
3540
  __proto__: null,
3455
- down: ws,
3456
- up: ys
3541
+ down: Ss,
3542
+ up: Ts
3457
3543
  }, Symbol.toStringTag, { value: "Module" }));
3458
- async function Ns(t) {
3544
+ async function ks(t) {
3459
3545
  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(
3460
3546
  "credentials",
3461
3547
  "varchar(2048)",
@@ -3466,18 +3552,18 @@ async function Ns(t) {
3466
3552
  (e) => e.notNull().defaultTo("{}")
3467
3553
  ).addColumn("created_at", "varchar(29)", (e) => e.notNull()).addColumn("updated_at", "varchar(29)", (e) => e.notNull()).execute();
3468
3554
  }
3469
- async function Cs(t) {
3555
+ async function $s(t) {
3470
3556
  await t.schema.dropTable("email_providers").execute();
3471
3557
  }
3472
- const bs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3558
+ const Ds = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3473
3559
  __proto__: null,
3474
- down: Cs,
3475
- up: Ns
3560
+ down: $s,
3561
+ up: ks
3476
3562
  }, Symbol.toStringTag, { value: "Module" }));
3477
- async function xs(t) {
3563
+ async function Is(t) {
3478
3564
  await t.schema.dropTable("tickets").execute();
3479
3565
  }
3480
- async function Ts(t) {
3566
+ async function Ps(t) {
3481
3567
  await t.schema.createTable("tickets").addColumn(
3482
3568
  "tenant_id",
3483
3569
  "varchar(255)",
@@ -3488,22 +3574,22 @@ async function Ts(t) {
3488
3574
  (e) => e.references("applications.id").onDelete("cascade").notNull()
3489
3575
  ).addColumn("email", "varchar(255)", (e) => e.notNull()).addColumn("nonce", "varchar(255)").addColumn("state", "varchar(1024)").addColumn("scope", "varchar(1024)").addColumn("response_type", "varchar(256)").addColumn("response_mode", "varchar(256)").addColumn("redirect_uri", "varchar(1024)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute();
3490
3576
  }
3491
- const Ss = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3577
+ const js = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3492
3578
  __proto__: null,
3493
- down: Ts,
3494
- up: xs
3579
+ down: Ps,
3580
+ up: Is
3495
3581
  }, Symbol.toStringTag, { value: "Module" }));
3496
- async function Os(t) {
3582
+ async function Ms(t) {
3497
3583
  }
3498
- async function ks(t) {
3584
+ async function Fs(t) {
3499
3585
  await t.schema.alterTable("logins").dropColumn("ip").dropColumn("useragent").execute();
3500
3586
  }
3501
- const $s = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3587
+ const As = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3502
3588
  __proto__: null,
3503
- down: ks,
3504
- up: Os
3589
+ down: Fs,
3590
+ up: Ms
3505
3591
  }, Symbol.toStringTag, { value: "Module" }));
3506
- async function Ds(t) {
3592
+ async function Ls(t) {
3507
3593
  await t.schema.createTable("refresh_tokens").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn(
3508
3594
  "client_id",
3509
3595
  "varchar(21)",
@@ -3516,27 +3602,27 @@ async function Ds(t) {
3516
3602
  (e) => e.onDelete("cascade")
3517
3603
  ).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();
3518
3604
  }
3519
- async function Is(t) {
3605
+ async function zs(t) {
3520
3606
  await t.schema.dropTable("refresh_tokens").execute();
3521
3607
  }
3522
- const Ps = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3608
+ const Js = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3523
3609
  __proto__: null,
3524
- down: Is,
3525
- up: Ds
3610
+ down: zs,
3611
+ up: Ls
3526
3612
  }, Symbol.toStringTag, { value: "Module" }));
3527
- async function js(t) {
3613
+ async function Es(t) {
3528
3614
  }
3529
- async function Ms(t) {
3615
+ async function Ks(t) {
3530
3616
  }
3531
- const Fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3617
+ const Rs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3532
3618
  __proto__: null,
3533
- down: Ms,
3534
- up: js
3619
+ down: Ks,
3620
+ up: Es
3535
3621
  }, Symbol.toStringTag, { value: "Module" }));
3536
- async function As(t) {
3622
+ async function Us(t) {
3537
3623
  await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("refresh_tokens").execute();
3538
3624
  }
3539
- async function Ls(t) {
3625
+ async function Bs(t) {
3540
3626
  await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
3541
3627
  "sessions_user_id_constraint",
3542
3628
  ["user_id", "tenant_id"],
@@ -3555,12 +3641,12 @@ async function Ls(t) {
3555
3641
  (e) => e.onDelete("cascade")
3556
3642
  ).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();
3557
3643
  }
3558
- const zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3644
+ const Qs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3559
3645
  __proto__: null,
3560
- down: Ls,
3561
- up: As
3646
+ down: Bs,
3647
+ up: Us
3562
3648
  }, Symbol.toStringTag, { value: "Module" }));
3563
- async function Es(t) {
3649
+ async function qs(t) {
3564
3650
  await t.schema.createTable("sessions_2").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
3565
3651
  "sessions_2_user_id_constraint",
3566
3652
  ["user_id", "tenant_id"],
@@ -3579,15 +3665,15 @@ async function Es(t) {
3579
3665
  (e) => e.onDelete("cascade")
3580
3666
  ).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();
3581
3667
  }
3582
- async function Js(t) {
3668
+ async function Vs(t) {
3583
3669
  await t.schema.dropTable("sessions_2").execute(), await t.schema.dropTable("refresh_tokens_2").execute();
3584
3670
  }
3585
- const Ks = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3671
+ const Ws = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3586
3672
  __proto__: null,
3587
- down: Js,
3588
- up: Es
3673
+ down: Vs,
3674
+ up: qs
3589
3675
  }, Symbol.toStringTag, { value: "Module" }));
3590
- async function Rs(t) {
3676
+ async function Gs(t) {
3591
3677
  await t.schema.createTable("custom_domains").addColumn(
3592
3678
  "custom_domain_id",
3593
3679
  "varchar(21)",
@@ -3598,49 +3684,49 @@ async function Rs(t) {
3598
3684
  (e) => e.references("tenants.id").onDelete("cascade").notNull()
3599
3685
  ).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();
3600
3686
  }
3601
- async function Us(t) {
3687
+ async function Hs(t) {
3602
3688
  await t.schema.dropTable("custom_domains").execute(), await t.schema.createTable("domains").addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
3603
3689
  "tenant_id",
3604
3690
  "varchar(255)",
3605
3691
  (e) => e.references("tenants.id").onDelete("cascade").notNull()
3606
3692
  ).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();
3607
3693
  }
3608
- const Bs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3694
+ const Xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3609
3695
  __proto__: null,
3610
- down: Us,
3611
- up: Rs
3696
+ down: Hs,
3697
+ up: Gs
3612
3698
  }, Symbol.toStringTag, { value: "Module" }));
3613
- async function Qs(t) {
3699
+ async function Ys(t) {
3614
3700
  }
3615
- async function Vs(t) {
3701
+ async function Zs(t) {
3616
3702
  await t.schema.alterTable("logins").dropColumn("authParams_organization").dropColumn("authorization_url").execute();
3617
3703
  }
3618
- const Ws = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3704
+ const ei = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3619
3705
  __proto__: null,
3620
- down: Vs,
3621
- up: Qs
3706
+ down: Zs,
3707
+ up: Ys
3622
3708
  }, Symbol.toStringTag, { value: "Module" }));
3623
- async function qs(t) {
3709
+ async function ti(t) {
3624
3710
  await t.schema.alterTable("logins").dropColumn("authorization_url").execute(), await t.schema.alterTable("logins").addColumn("authorization_url", "varchar(2048)").execute();
3625
3711
  }
3626
- async function Gs(t) {
3712
+ async function ai(t) {
3627
3713
  await t.schema.alterTable("logins").dropColumn("authorization_url").execute(), await t.schema.alterTable("logins").addColumn("authorization_url", "varchar(1024)").execute();
3628
3714
  }
3629
- const Hs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3715
+ const ri = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3630
3716
  __proto__: null,
3631
- down: Gs,
3632
- up: qs
3717
+ down: ai,
3718
+ up: ti
3633
3719
  }, Symbol.toStringTag, { value: "Module" }));
3634
- async function Xs(t) {
3720
+ async function ni(t) {
3635
3721
  }
3636
- async function Ys(t) {
3722
+ async function oi(t) {
3637
3723
  }
3638
- const Zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3724
+ const si = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3639
3725
  __proto__: null,
3640
- down: Ys,
3641
- up: Xs
3726
+ down: oi,
3727
+ up: ni
3642
3728
  }, Symbol.toStringTag, { value: "Module" }));
3643
- async function ei(t) {
3729
+ async function ii(t) {
3644
3730
  await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
3645
3731
  "sessions_user_id_constraint",
3646
3732
  ["user_id", "tenant_id"],
@@ -3667,25 +3753,25 @@ async function ei(t) {
3667
3753
  (e) => e.onDelete("cascade")
3668
3754
  ).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();
3669
3755
  }
3670
- async function ti(t) {
3756
+ async function ci(t) {
3671
3757
  await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("login_sessions").execute(), await t.schema.dropTable("refresh_tokens").execute();
3672
3758
  }
3673
- const ai = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3759
+ const li = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3674
3760
  __proto__: null,
3675
- down: ti,
3676
- up: ei
3761
+ down: ci,
3762
+ up: ii
3677
3763
  }, Symbol.toStringTag, { value: "Module" }));
3678
- async function ri(t) {
3764
+ async function di(t) {
3679
3765
  await t.schema.dropTable("logins").execute(), await t.schema.dropTable("sessions_2").execute(), await t.schema.dropTable("refresh_tokens_2").execute();
3680
3766
  }
3681
- async function ni(t) {
3767
+ async function ui(t) {
3682
3768
  }
3683
- const oi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3769
+ const mi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3684
3770
  __proto__: null,
3685
- down: ni,
3686
- up: ri
3771
+ down: ui,
3772
+ up: di
3687
3773
  }, Symbol.toStringTag, { value: "Module" }));
3688
- async function si(t) {
3774
+ async function hi(t) {
3689
3775
  await t.schema.dropTable("custom_domains").execute(), await t.schema.createTable("custom_domains").addColumn(
3690
3776
  "custom_domain_id",
3691
3777
  "varchar(256)",
@@ -3696,107 +3782,119 @@ async function si(t) {
3696
3782
  (e) => e.references("tenants.id").onDelete("cascade").notNull()
3697
3783
  ).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();
3698
3784
  }
3699
- async function ii(t) {
3785
+ async function _i(t) {
3700
3786
  }
3701
- const di = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3787
+ const fi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3702
3788
  __proto__: null,
3703
- down: ii,
3704
- up: si
3789
+ down: _i,
3790
+ up: hi
3705
3791
  }, Symbol.toStringTag, { value: "Module" }));
3706
- async function ci(t) {
3792
+ async function pi(t) {
3707
3793
  }
3708
- async function li(t) {
3794
+ async function gi(t) {
3709
3795
  await t.schema.alterTable("users").dropColumn("phone_number").dropColumn("phone_verified").dropColumn("username").execute();
3710
3796
  }
3711
- const ui = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3712
- __proto__: null,
3713
- down: li,
3714
- up: ci
3715
- }, Symbol.toStringTag, { value: "Module" })), Le = {
3716
- m1_init: Ra,
3717
- m2_magicLink: Qa,
3718
- m3_updateAt: qa,
3719
- m4_logTable: Xa,
3720
- m5_userProfile: er,
3721
- m6_sessions: rr,
3722
- m7_passwords: sr,
3723
- m8_logsTableNewFields: cr,
3724
- m9_passwordTableNewField: mr,
3725
- n01_codesTable: fr,
3726
- n11_universalLoginSession: yr,
3727
- n12_userFields: Nr,
3728
- n13_userEmailIndex: xr,
3729
- n14_profileDataField: Or,
3730
- n15_userEmailIndex: Dr,
3731
- n16_userLocale: jr,
3732
- n17_signingKeys: Ar,
3733
- n18_logsFields: Er,
3734
- n19_connectionsUserinfo: Rr,
3735
- n20_missingFields: Qr,
3736
- n21_sessionDeletedAt: qr,
3737
- n22_dropLogsFields: Xr,
3738
- n23_dropUsersFields: en,
3739
- n24_logsIndexes: rn,
3740
- n25_logDescMaxLength: sn,
3741
- n26_logsTableExtraFields: ln,
3742
- n27_usersTableNameIndex: hn,
3743
- n28_usersEmailConstrain: pn,
3744
- n29_increaseOtpStateLength: wn,
3745
- n30_increaseTicketStateLength: Cn,
3746
- n31_branding: Tn,
3747
- n32_indexesAndNotNull: kn,
3748
- n33_vendorIdInUniversalLoginSession: In,
3749
- n34_auth0ClientInUniversalLoginSession: Mn,
3750
- n35_increaseUniversalSessionStateLength: Ln,
3751
- n36_authenticationCodes: Jn,
3752
- n37_disableSignUps: Un,
3753
- n38_otpIpAddress: Vn,
3754
- n39_increaseUserAgentLength: Gn,
3755
- n40_userId: Yn,
3756
- n41_hooks: to,
3757
- n42_userIdIndexes: no,
3758
- n43_userIdIndexes: io,
3759
- n44_codes: uo,
3760
- n45_hookProperties: _o,
3761
- n46_loginAuth0Client: go,
3762
- n47_loginAuth0Client: vo,
3763
- n48_saml: bo,
3764
- n49_removeFields: So,
3765
- n50_authParamsNonce: $o,
3766
- n51_connectionid: Po,
3767
- n52_cert: Fo,
3768
- n53_codes_primary_key: zo,
3769
- n54_cleanup_tables: Ko,
3770
- n55_logs_index: Bo,
3771
- n56_application_fields: Wo,
3772
- n57_prompt_settings: Ho,
3773
- n58_connection_client_id: Zo,
3774
- n59_connection_options: as,
3775
- n60_users_metadata: os,
3776
- n61_userLocales: ds,
3777
- n62_prompt: us,
3778
- n63_connection_cleanup: _s,
3779
- n64_act_as: gs,
3780
- n65_code_verifier: vs,
3781
- n66_email_providers: bs,
3782
- n67_drop_tickets: Ss,
3783
- n68_login_useragents: $s,
3784
- n70_refresh_tokens: Ps,
3785
- n71_session_new_fields: Fs,
3786
- n72_session_primary_key: zs,
3787
- n73_drop_sessions: Ks,
3788
- n74_custom_domains: Bs,
3789
- n75_organizations: Ws,
3790
- n76_authorization_url_length: Hs,
3791
- n77_drop_sessions: Zs,
3792
- n78_login_sessions: ai,
3793
- n79_drop_sessions_2: oi,
3794
- n80_recreate_custom_domains: di,
3795
- n81_phone: ui
3797
+ const yi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3798
+ __proto__: null,
3799
+ down: gi,
3800
+ up: pi
3801
+ }, Symbol.toStringTag, { value: "Module" }));
3802
+ async function wi(t) {
3803
+ await t.schema.createTable("forms").addColumn("id", "varchar(255)", (e) => e.primaryKey()).addColumn("name", "varchar(255)", (e) => e.notNull()).addColumn("type", "varchar(255)", (e) => e.notNull()).addColumn("tenant_id", "varchar(255)", (e) => e.notNull()).addColumn("client_id", "varchar(255)").addColumn("fields", "text", (e) => e.notNull()).addColumn("controls", "text").addColumn("redirect_uri", "varchar(2048)").addColumn("post_submit_action", "varchar(255)").addColumn("success_message", "text").addColumn("language", "varchar(10)").addColumn("active", "boolean", (e) => e.notNull().defaultTo(!0)).addColumn("layout", "text").addColumn("css", "text").addColumn("javascript", "text").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(), await t.schema.createIndex("forms_client_id_idx").on("forms").column("client_id").execute(), await t.schema.createIndex("forms_type_idx").on("forms").column("type").execute();
3804
+ }
3805
+ async function vi(t) {
3806
+ await t.schema.dropTable("forms").execute();
3807
+ }
3808
+ const Ni = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3809
+ __proto__: null,
3810
+ down: vi,
3811
+ up: wi
3812
+ }, Symbol.toStringTag, { value: "Module" })), ze = {
3813
+ m1_init: Ga,
3814
+ m2_magicLink: Ya,
3815
+ m3_updateAt: tr,
3816
+ m4_logTable: nr,
3817
+ m5_userProfile: ir,
3818
+ m6_sessions: dr,
3819
+ m7_passwords: hr,
3820
+ m8_logsTableNewFields: pr,
3821
+ m9_passwordTableNewField: wr,
3822
+ n01_codesTable: Cr,
3823
+ n11_universalLoginSession: Tr,
3824
+ n12_userFields: kr,
3825
+ n13_userEmailIndex: Ir,
3826
+ n14_profileDataField: Mr,
3827
+ n15_userEmailIndex: Lr,
3828
+ n16_userLocale: Er,
3829
+ n17_signingKeys: Ur,
3830
+ n18_logsFields: qr,
3831
+ n19_connectionsUserinfo: Gr,
3832
+ n20_missingFields: Yr,
3833
+ n21_sessionDeletedAt: tn,
3834
+ n22_dropLogsFields: nn,
3835
+ n23_dropUsersFields: cn,
3836
+ n24_logsIndexes: un,
3837
+ n25_logDescMaxLength: _n,
3838
+ n26_logsTableExtraFields: gn,
3839
+ n27_usersTableNameIndex: vn,
3840
+ n28_usersEmailConstrain: bn,
3841
+ n29_increaseOtpStateLength: Sn,
3842
+ n30_increaseTicketStateLength: $n,
3843
+ n31_branding: Pn,
3844
+ n32_indexesAndNotNull: Fn,
3845
+ n33_vendorIdInUniversalLoginSession: zn,
3846
+ n34_auth0ClientInUniversalLoginSession: Kn,
3847
+ n35_increaseUniversalSessionStateLength: Bn,
3848
+ n36_authenticationCodes: Vn,
3849
+ n37_disableSignUps: Hn,
3850
+ n38_otpIpAddress: Zn,
3851
+ n39_increaseUserAgentLength: ao,
3852
+ n40_userId: oo,
3853
+ n41_hooks: co,
3854
+ n42_userIdIndexes: mo,
3855
+ n43_userIdIndexes: fo,
3856
+ n44_codes: yo,
3857
+ n45_hookProperties: No,
3858
+ n46_loginAuth0Client: xo,
3859
+ n47_loginAuth0Client: Oo,
3860
+ n48_saml: Do,
3861
+ n49_removeFields: jo,
3862
+ n50_authParamsNonce: Ao,
3863
+ n51_connectionid: Jo,
3864
+ n52_cert: Ro,
3865
+ n53_codes_primary_key: Qo,
3866
+ n54_cleanup_tables: Wo,
3867
+ n55_logs_index: Xo,
3868
+ n56_application_fields: es,
3869
+ n57_prompt_settings: rs,
3870
+ n58_connection_client_id: ss,
3871
+ n59_connection_options: ls,
3872
+ n60_users_metadata: ms,
3873
+ n61_userLocales: fs,
3874
+ n62_prompt: ys,
3875
+ n63_connection_cleanup: Ns,
3876
+ n64_act_as: xs,
3877
+ n65_code_verifier: Os,
3878
+ n66_email_providers: Ds,
3879
+ n67_drop_tickets: js,
3880
+ n68_login_useragents: As,
3881
+ n70_refresh_tokens: Js,
3882
+ n71_session_new_fields: Rs,
3883
+ n72_session_primary_key: Qs,
3884
+ n73_drop_sessions: Ws,
3885
+ n74_custom_domains: Xs,
3886
+ n75_organizations: ei,
3887
+ n76_authorization_url_length: ri,
3888
+ n77_drop_sessions: si,
3889
+ n78_login_sessions: li,
3890
+ n79_drop_sessions_2: mi,
3891
+ n80_recreate_custom_domains: fi,
3892
+ n81_phone: yi,
3893
+ n82_forms: Ni
3796
3894
  };
3797
- async function pi(t, e = !1) {
3895
+ async function Si(t, e = !1) {
3798
3896
  e && console.log("migrating...");
3799
- const a = new Ae(Le), r = new Ne({
3897
+ const a = new Le(ze), r = new Ce({
3800
3898
  db: t,
3801
3899
  provider: a
3802
3900
  }), { error: o, results: n } = await r.migrateToLatest();
@@ -3807,9 +3905,9 @@ async function pi(t, e = !1) {
3807
3905
  }), o)
3808
3906
  throw console.error("failed to migrate"), console.error(o), o;
3809
3907
  }
3810
- async function gi(t) {
3908
+ async function Oi(t) {
3811
3909
  console.log("migrating...");
3812
- const e = new Ae(Le), a = new Ne({
3910
+ const e = new Le(ze), a = new Ce({
3813
3911
  db: t,
3814
3912
  provider: e
3815
3913
  }), { error: r, results: o } = await a.migrateDown();
@@ -3818,31 +3916,32 @@ async function gi(t) {
3818
3916
  }), r)
3819
3917
  throw console.error("failed to migrate"), console.error(r), r;
3820
3918
  }
3821
- function yi(t) {
3919
+ function ki(t) {
3822
3920
  return {
3823
- applications: It(t),
3824
- branding: Yt(t),
3825
- cleanup: $a(t),
3826
- clients: zt(t),
3827
- codes: Tt(t),
3828
- connections: Lt(t),
3829
- emailProviders: Ca(t),
3830
- customDomains: Gt(t),
3831
- hooks: na(t),
3832
- keys: Rt(t),
3833
- loginSessions: fa(t),
3834
- logs: ct(t),
3835
- passwords: wt(t),
3836
- promptSettings: ya(t),
3837
- refreshTokens: ka(t),
3838
- sessions: ft(t),
3839
- tenants: nt(t),
3840
- themes: la(t),
3841
- users: Xe(t)
3921
+ applications: Pt(t),
3922
+ branding: Zt(t),
3923
+ cleanup: Da(t),
3924
+ clients: Jt(t),
3925
+ codes: St(t),
3926
+ connections: zt(t),
3927
+ emailProviders: ba(t),
3928
+ customDomains: Ht(t),
3929
+ forms: Aa(t),
3930
+ hooks: oa(t),
3931
+ keys: Ut(t),
3932
+ loginSessions: pa(t),
3933
+ logs: dt(t),
3934
+ passwords: vt(t),
3935
+ promptSettings: wa(t),
3936
+ refreshTokens: $a(t),
3937
+ sessions: pt(t),
3938
+ tenants: ot(t),
3939
+ themes: ua(t),
3940
+ users: Ye(t)
3842
3941
  };
3843
3942
  }
3844
3943
  export {
3845
- yi as default,
3846
- gi as migrateDown,
3847
- pi as migrateToLatest
3944
+ ki as default,
3945
+ Oi as migrateDown,
3946
+ Si as migrateToLatest
3848
3947
  };