@authhero/kysely-adapter 10.31.0 → 10.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,15 +3,15 @@ var ue = (t) => {
3
3
  throw TypeError(t);
4
4
  };
5
5
  var Ke = (t, e, a) => e in t ? Ee(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a;
6
- var M = (t, e, a) => Ke(t, typeof e != "symbol" ? e + "" : e, a), q = (t, e, a) => e.has(t) || ue("Cannot " + a);
7
- var d = (t, e, a) => (q(t, e, "read from private field"), a ? a.call(t) : e.get(t)), b = (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), A = (t, e, a, r) => (q(t, e, "write to private field"), r ? r.call(t, a) : e.set(t, a), a), u = (t, e, a) => (q(t, e, "access private method"), a);
8
- import { parseUserId as ae, codeSchema as Re, connectionSchema as Be, loginSessionSchema as Ue, promptSettingSchema as Qe, formSchema as U, resourceServerSchema as qe, ruleSchema as Ve, permissionSchema as We } from "@authhero/adapter-interfaces";
6
+ var z = (t, e, a) => Ke(t, typeof e != "symbol" ? e + "" : e, a), Q = (t, e, a) => e.has(t) || ue("Cannot " + a);
7
+ var d = (t, e, a) => (Q(t, e, "read from private field"), a ? a.call(t) : e.get(t)), b = (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), L = (t, e, a, r) => (Q(t, e, "write to private field"), r ? r.call(t, a) : e.set(t, a), a), _ = (t, e, a) => (Q(t, e, "access private method"), a);
8
+ import { parseUserId as ae, codeSchema as Re, connectionSchema as Be, loginSessionSchema as Ue, promptSettingSchema as qe, formSchema as U, resourceServerSchema as Qe, permissionSchema as Ve } from "@authhero/adapter-interfaces";
9
9
  import "@hono/zod-openapi";
10
10
  var H = class extends Error {
11
11
  constructor(e = 500, a) {
12
12
  super(a == null ? void 0 : a.message, { cause: a == null ? void 0 : a.cause });
13
- M(this, "res");
14
- M(this, "status");
13
+ z(this, "res");
14
+ z(this, "status");
15
15
  this.res = a == null ? void 0 : a.res, this.status = e;
16
16
  }
17
17
  getResponse() {
@@ -23,7 +23,7 @@ var H = class extends Error {
23
23
  });
24
24
  }
25
25
  };
26
- function Ge(t) {
26
+ function We(t) {
27
27
  return async (e, a) => {
28
28
  const { identities: r, ...n } = a, o = {
29
29
  ...n,
@@ -50,10 +50,10 @@ function Ge(t) {
50
50
  };
51
51
  };
52
52
  }
53
- function f(t) {
53
+ function p(t) {
54
54
  const e = { ...t };
55
55
  for (const a in e)
56
- e[a] === null ? delete e[a] : typeof e[a] == "object" && (Array.isArray(e[a]) ? e[a] = e[a].map(f) : e[a] = f(e[a]));
56
+ e[a] === null ? delete e[a] : typeof e[a] == "object" && (Array.isArray(e[a]) ? e[a] = e[a].map(p) : e[a] = p(e[a]));
57
57
  return e;
58
58
  }
59
59
  function pe(t) {
@@ -75,7 +75,7 @@ function pe(t) {
75
75
  }
76
76
  };
77
77
  }
78
- function He(t) {
78
+ function Ge(t) {
79
79
  return async (e, a) => {
80
80
  const [r, n] = await Promise.all([
81
81
  t.selectFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", a).selectAll().executeTakeFirst(),
@@ -100,28 +100,28 @@ function He(t) {
100
100
  ...n.map(pe)
101
101
  ]
102
102
  };
103
- return f(c);
103
+ return p(c);
104
104
  };
105
105
  }
106
106
  function N(t, e, a, r) {
107
107
  return a.split(/\s+/).map((o) => o.replace(/^([^:]+)=/g, "$1:")).map((o) => {
108
- let s = o.startsWith("-"), c = null, i = "", _ = !1, m;
108
+ let s = o.startsWith("-"), c = null, i = "", m = !1, u;
109
109
  if (o.startsWith("-_exists_:"))
110
- c = o.substring(10), _ = !0, s = !0;
110
+ c = o.substring(10), m = !0, s = !0;
111
111
  else if (o.startsWith("_exists_:"))
112
- c = o.substring(9), _ = !0, s = !1;
112
+ c = o.substring(9), m = !0, s = !1;
113
113
  else if (o.includes(":")) {
114
- const p = s ? o.substring(1) : o, y = p.indexOf(":");
115
- c = p.substring(0, y), i = p.substring(y + 1), _ = !1, i.startsWith(">=") ? (m = ">=", i = i.substring(2)) : i.startsWith(">") ? (m = ">", i = i.substring(1)) : i.startsWith("<=") ? (m = "<=", i = i.substring(2)) : i.startsWith("<") ? (m = "<", i = i.substring(1)) : m = "=";
114
+ const h = s ? o.substring(1) : o, g = h.indexOf(":");
115
+ c = h.substring(0, g), i = h.substring(g + 1), m = !1, i.startsWith(">=") ? (u = ">=", i = i.substring(2)) : i.startsWith(">") ? (u = ">", i = i.substring(1)) : i.startsWith("<=") ? (u = "<=", i = i.substring(2)) : i.startsWith("<") ? (u = "<", i = i.substring(1)) : u = "=";
116
116
  } else
117
- c = null, i = o, _ = !1;
118
- return { key: c, value: i, isNegation: s, isExistsQuery: _, operator: m };
119
- }).forEach(({ key: o, value: s, isNegation: c, isExistsQuery: i, operator: _ }) => {
117
+ c = null, i = o, m = !1;
118
+ return { key: c, value: i, isNegation: s, isExistsQuery: m, operator: u };
119
+ }).forEach(({ key: o, value: s, isNegation: c, isExistsQuery: i, operator: m }) => {
120
120
  if (o)
121
121
  if (i)
122
122
  c ? e = e.where(o, "is", null) : e = e.where(o, "is not", null);
123
123
  else if (c)
124
- switch (_) {
124
+ switch (m) {
125
125
  case ">":
126
126
  e = e.where(o, "<=", s);
127
127
  break;
@@ -138,12 +138,12 @@ function N(t, e, a, r) {
138
138
  e = e.where(o, "!=", s);
139
139
  }
140
140
  else
141
- e = e.where(o, _, s);
141
+ e = e.where(o, m, s);
142
142
  else if (s) {
143
- const { ref: m } = t.dynamic;
143
+ const { ref: u } = t.dynamic;
144
144
  e = e.where(
145
- (p) => p.or(
146
- r.map((y) => p(m(y), "like", `%${s}%`))
145
+ (h) => h.or(
146
+ r.map((g) => h(u(g), "like", `%${s}%`))
147
147
  )
148
148
  );
149
149
  }
@@ -152,7 +152,7 @@ function N(t, e, a, r) {
152
152
  function v(t) {
153
153
  return typeof t == "string" ? parseInt(t, 10) : typeof t == "bigint" ? Number(t) : t;
154
154
  }
155
- function Xe(t) {
155
+ function He(t) {
156
156
  return async (e, a = {
157
157
  page: 0,
158
158
  per_page: 50,
@@ -160,46 +160,46 @@ function Xe(t) {
160
160
  }) => {
161
161
  let r = t.selectFrom("users").where("users.tenant_id", "=", e);
162
162
  if (a.q && (r = N(t, r, a.q, ["email", "name"])), a.sort && a.sort.sort_by) {
163
- const { ref: m } = t.dynamic;
164
- r = r.orderBy(m(a.sort.sort_by), a.sort.sort_order);
163
+ const { ref: u } = t.dynamic;
164
+ r = r.orderBy(u(a.sort.sort_by), a.sort.sort_order);
165
165
  }
166
- const o = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), s = o.map((m) => m.user_id), c = s.length ? await t.selectFrom("users").selectAll().where("users.tenant_id", "=", e).where("users.linked_to", "in", s).execute() : [], i = o.map((m) => {
167
- const p = c.filter(
168
- (y) => y.linked_to === m.user_id
166
+ const o = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), s = o.map((u) => u.user_id), c = s.length ? await t.selectFrom("users").selectAll().where("users.tenant_id", "=", e).where("users.linked_to", "in", s).execute() : [], i = o.map((u) => {
167
+ const h = c.filter(
168
+ (g) => g.linked_to === u.user_id
169
169
  );
170
- return f({
171
- ...m,
172
- email_verified: m.email_verified === 1,
173
- is_social: m.is_social === 1,
174
- app_metadata: JSON.parse(m.app_metadata),
175
- user_metadata: JSON.parse(m.user_metadata),
170
+ return p({
171
+ ...u,
172
+ email_verified: u.email_verified === 1,
173
+ is_social: u.is_social === 1,
174
+ app_metadata: JSON.parse(u.app_metadata),
175
+ user_metadata: JSON.parse(u.user_metadata),
176
176
  identities: [
177
177
  {
178
- connection: m.connection,
179
- provider: m.provider,
180
- user_id: ae(m.user_id).id,
181
- isSocial: !!m.is_social
178
+ connection: u.connection,
179
+ provider: u.provider,
180
+ user_id: ae(u.user_id).id,
181
+ isSocial: !!u.is_social
182
182
  },
183
- ...p.map(pe)
183
+ ...h.map(pe)
184
184
  ]
185
185
  });
186
- }), { count: _ } = await r.select((m) => m.fn.countAll().as("count")).executeTakeFirstOrThrow();
186
+ }), { count: m } = await r.select((u) => u.fn.countAll().as("count")).executeTakeFirstOrThrow();
187
187
  return {
188
188
  users: i,
189
189
  start: a.page * a.per_page,
190
190
  limit: a.per_page,
191
- length: v(_)
191
+ length: v(m)
192
192
  };
193
193
  };
194
194
  }
195
- function Ye(t) {
195
+ function Xe(t) {
196
196
  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);
197
197
  }
198
- function P(t, e = "", a = {}) {
198
+ function A(t, e = "", a = {}) {
199
199
  for (let r in t)
200
200
  if (Object.prototype.hasOwnProperty.call(t, r)) {
201
201
  const n = e ? `${e}_${r}` : r, o = t[r];
202
- typeof o == "object" && o !== null && !Array.isArray(o) ? P(o, n, a) : typeof o == "boolean" ? a[n] = o ? 1 : 0 : a[n] = o;
202
+ typeof o == "object" && o !== null && !Array.isArray(o) ? A(o, n, a) : typeof o == "boolean" ? a[n] = o ? 1 : 0 : a[n] = o;
203
203
  }
204
204
  return a;
205
205
  }
@@ -221,9 +221,9 @@ function ge(t, e) {
221
221
  }
222
222
  return a;
223
223
  }
224
- function Ze(t) {
224
+ function Ye(t) {
225
225
  return async (e, a, r) => {
226
- const n = P({
226
+ const n = A({
227
227
  ...r,
228
228
  updated_at: (/* @__PURE__ */ new Date()).toISOString(),
229
229
  app_metadata: r.app_metadata ? JSON.stringify(r.app_metadata) : void 0,
@@ -232,31 +232,31 @@ function Ze(t) {
232
232
  return (await t.updateTable("users").set(n).where("users.tenant_id", "=", e).where("users.user_id", "=", a).execute()).length === 1;
233
233
  };
234
234
  }
235
- function et(t) {
235
+ function Ze(t) {
236
236
  return async (e, a, r, n) => {
237
237
  const o = { linked_to: null };
238
238
  return (await t.updateTable("users").set(o).where("users.tenant_id", "=", e).where("users.user_id", "=", `${r}|${n}`).where("users.linked_to", "=", `${a}`).execute()).length === 1;
239
239
  };
240
240
  }
241
- function tt(t) {
241
+ function et(t) {
242
242
  return {
243
- create: Ge(t),
244
- remove: Ye(t),
245
- get: He(t),
246
- list: Xe(t),
247
- update: Ze(t),
243
+ create: We(t),
244
+ remove: Xe(t),
245
+ get: Ge(t),
246
+ list: He(t),
247
+ update: Ye(t),
248
248
  // TODO - think about this more when other issues fixed
249
- unlink: et(t)
249
+ unlink: Ze(t)
250
250
  };
251
251
  }
252
- const at = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
252
+ const tt = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
253
253
  let C = (t = 21) => {
254
254
  let e = "", a = crypto.getRandomValues(new Uint8Array(t));
255
255
  for (; t--; )
256
- e += at[a[t] & 63];
256
+ e += tt[a[t] & 63];
257
257
  return e;
258
258
  };
259
- function rt(t) {
259
+ function at(t) {
260
260
  return async (e) => {
261
261
  const a = {
262
262
  id: e.id || C(),
@@ -267,13 +267,13 @@ function rt(t) {
267
267
  return await t.insertInto("tenants").values(a).execute(), a;
268
268
  };
269
269
  }
270
- function nt(t) {
270
+ function rt(t) {
271
271
  return async (e) => {
272
272
  const a = await t.selectFrom("tenants").where("tenants.id", "=", e).selectAll().executeTakeFirst();
273
- return a ? f(a) : null;
273
+ return a ? p(a) : null;
274
274
  };
275
275
  }
276
- function ot(t) {
276
+ function nt(t) {
277
277
  return async (e = {
278
278
  page: 0,
279
279
  per_page: 50,
@@ -292,14 +292,14 @@ function ot(t) {
292
292
  };
293
293
  const { count: o } = await a.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), s = v(o);
294
294
  return {
295
- tenants: n.map(f),
295
+ tenants: n.map(p),
296
296
  start: (e.page - 1) * e.per_page,
297
297
  limit: e.per_page,
298
298
  length: s
299
299
  };
300
300
  };
301
301
  }
302
- function st(t) {
302
+ function ot(t) {
303
303
  return async (e, a) => {
304
304
  const r = {
305
305
  ...a,
@@ -309,29 +309,29 @@ function st(t) {
309
309
  await t.updateTable("tenants").set(r).where("id", "=", e).execute();
310
310
  };
311
311
  }
312
- function it(t) {
312
+ function st(t) {
313
313
  return async (e) => (await t.deleteFrom("tenants").where("tenants.id", "=", e).execute()).length === 1;
314
314
  }
315
- function lt(t) {
315
+ function it(t) {
316
316
  return {
317
- create: rt(t),
318
- get: nt(t),
319
- list: ot(t),
320
- update: st(t),
321
- remove: it(t)
317
+ create: at(t),
318
+ get: rt(t),
319
+ list: nt(t),
320
+ update: ot(t),
321
+ remove: st(t)
322
322
  };
323
323
  }
324
324
  function me(t) {
325
325
  return t ? JSON.stringify(t) : void 0;
326
326
  }
327
- const ct = 1024;
328
- function dt(t) {
327
+ const lt = 1024;
328
+ function ct(t) {
329
329
  return async (e, a) => {
330
330
  var n, o, s;
331
331
  const r = {
332
332
  id: C(),
333
333
  ...a,
334
- user_agent: a.user_agent.slice(0, ct)
334
+ user_agent: a.user_agent.slice(0, lt)
335
335
  };
336
336
  return await t.insertInto("logs").values({
337
337
  ...r,
@@ -367,7 +367,7 @@ function we(t) {
367
367
  _id: t.id
368
368
  };
369
369
  }
370
- function ut(t) {
370
+ function dt(t) {
371
371
  return async (e, a = {
372
372
  page: 0,
373
373
  per_page: 50,
@@ -393,20 +393,20 @@ function ut(t) {
393
393
  };
394
394
  };
395
395
  }
396
- function mt(t) {
396
+ function ut(t) {
397
397
  return async (e, a) => {
398
398
  const r = await t.selectFrom("logs").where("logs.tenant_id", "=", e).where("logs.id", "=", a).selectAll().executeTakeFirst();
399
399
  return r ? we(r) : null;
400
400
  };
401
401
  }
402
- function _t(t) {
402
+ function mt(t) {
403
403
  return {
404
- create: dt(t),
405
- list: ut(t),
406
- get: mt(t)
404
+ create: ct(t),
405
+ list: dt(t),
406
+ get: ut(t)
407
407
  };
408
408
  }
409
- function ht(t) {
409
+ function _t(t) {
410
410
  return async (e, a) => {
411
411
  const r = await t.selectFrom("sessions").where("sessions.tenant_id", "=", e).where("sessions.id", "=", a).selectAll().executeTakeFirst();
412
412
  if (!r)
@@ -419,7 +419,7 @@ function ht(t) {
419
419
  };
420
420
  };
421
421
  }
422
- function ft(t) {
422
+ function ht(t) {
423
423
  return async (e, a) => {
424
424
  const r = {
425
425
  ...a,
@@ -436,10 +436,10 @@ function ft(t) {
436
436
  }).execute(), r;
437
437
  };
438
438
  }
439
- function pt(t) {
439
+ function ft(t) {
440
440
  return async (e, a) => !!(await t.deleteFrom("sessions").where("tenant_id", "=", e).where("sessions.id", "=", a).execute()).length;
441
441
  }
442
- function gt(t) {
442
+ function pt(t) {
443
443
  return async (e, a, r) => {
444
444
  const n = {
445
445
  ...r,
@@ -450,7 +450,7 @@ function gt(t) {
450
450
  return !!(await t.updateTable("sessions").set(n).where("tenant_id", "=", e).where("sessions.id", "=", a).execute()).length;
451
451
  };
452
452
  }
453
- function wt(t) {
453
+ function gt(t) {
454
454
  return async (e, a = {
455
455
  page: 0,
456
456
  per_page: 50,
@@ -480,16 +480,16 @@ function wt(t) {
480
480
  };
481
481
  };
482
482
  }
483
- function yt(t) {
483
+ function wt(t) {
484
484
  return {
485
- create: ft(t),
486
- get: ht(t),
487
- list: wt(t),
488
- remove: pt(t),
489
- update: gt(t)
485
+ create: ht(t),
486
+ get: _t(t),
487
+ list: gt(t),
488
+ remove: ft(t),
489
+ update: pt(t)
490
490
  };
491
491
  }
492
- function vt(t) {
492
+ function yt(t) {
493
493
  return async (e, a) => {
494
494
  const r = await t.selectFrom("passwords").where("passwords.tenant_id", "=", e).where("passwords.user_id", "=", a).selectAll().executeTakeFirst();
495
495
  if (!r)
@@ -498,7 +498,7 @@ function vt(t) {
498
498
  return o;
499
499
  };
500
500
  }
501
- function Nt(t) {
501
+ function vt(t) {
502
502
  return async (e, a) => {
503
503
  const r = {
504
504
  ...a,
@@ -511,20 +511,20 @@ function Nt(t) {
511
511
  }).execute(), r;
512
512
  };
513
513
  }
514
- function Ct(t) {
514
+ function Nt(t) {
515
515
  return async (e, a) => (await t.updateTable("passwords").set({
516
516
  password: a.password,
517
517
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
518
518
  }).where("tenant_id", "=", e).where("user_id", "=", a.user_id).execute()).length === 1;
519
519
  }
520
- function bt(t) {
520
+ function Ct(t) {
521
521
  return {
522
- create: Nt(t),
523
- update: Ct(t),
524
- get: vt(t)
522
+ create: vt(t),
523
+ update: Nt(t),
524
+ get: yt(t)
525
525
  };
526
526
  }
527
- function xt(t) {
527
+ function bt(t) {
528
528
  return async (e, a = {
529
529
  page: 0,
530
530
  per_page: 50,
@@ -535,8 +535,8 @@ function xt(t) {
535
535
  const o = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), { count: s } = await r.select((i) => i.fn.countAll().as("count")).executeTakeFirstOrThrow();
536
536
  return {
537
537
  codes: o.map((i) => {
538
- const { tenant_id: _, ...m } = i;
539
- return Re.parse(f(m));
538
+ const { tenant_id: m, ...u } = i;
539
+ return Re.parse(p(u));
540
540
  }),
541
541
  start: a.page * a.per_page,
542
542
  limit: a.per_page,
@@ -544,7 +544,7 @@ function xt(t) {
544
544
  };
545
545
  };
546
546
  }
547
- function Tt(t) {
547
+ function xt(t) {
548
548
  return async (e, a) => {
549
549
  const r = {
550
550
  ...a,
@@ -556,30 +556,30 @@ function Tt(t) {
556
556
  }).execute(), r;
557
557
  };
558
558
  }
559
- function St(t) {
559
+ function Tt(t) {
560
560
  return async (e, a) => (await t.deleteFrom("codes").where("codes.tenant_id", "=", e).where("codes.code_id", "=", a).executeTakeFirst()).numDeletedRows > 0;
561
561
  }
562
- function Ot(t) {
562
+ function St(t) {
563
563
  return async (e, a, r) => {
564
564
  let n = t.selectFrom("codes").where("codes.code_id", "=", a).where("codes.code_type", "=", r);
565
565
  e.length && (n = n.where("codes.tenant_id", "=", e));
566
566
  const o = await n.selectAll().executeTakeFirst();
567
- return o ? f(o) : null;
567
+ return o ? p(o) : null;
568
568
  };
569
569
  }
570
- function kt(t) {
570
+ function Ot(t) {
571
571
  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;
572
572
  }
573
- function $t(t) {
573
+ function kt(t) {
574
574
  return {
575
- create: Tt(t),
576
- list: xt(t),
577
- remove: St(t),
578
- used: kt(t),
579
- get: Ot(t)
575
+ create: xt(t),
576
+ list: bt(t),
577
+ remove: Tt(t),
578
+ used: Ot(t),
579
+ get: St(t)
580
580
  };
581
581
  }
582
- function Dt(t) {
582
+ function $t(t) {
583
583
  return async (e, a) => {
584
584
  const r = {
585
585
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
@@ -600,7 +600,7 @@ function Dt(t) {
600
600
  }).execute(), r;
601
601
  };
602
602
  }
603
- function It(t) {
603
+ function Dt(t) {
604
604
  return async (e) => ({
605
605
  applications: (await t.selectFrom("applications").where("applications.tenant_id", "=", e).selectAll().execute()).map((o) => ({
606
606
  ...o,
@@ -614,10 +614,10 @@ function It(t) {
614
614
  }))
615
615
  });
616
616
  }
617
- function jt(t) {
617
+ function It(t) {
618
618
  return async (e, a) => {
619
619
  const r = await t.selectFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", a).selectAll().executeTakeFirst();
620
- return r ? f({
620
+ return r ? p({
621
621
  ...r,
622
622
  disable_sign_ups: !!r.disable_sign_ups,
623
623
  addons: JSON.parse(r.addons),
@@ -628,10 +628,10 @@ function jt(t) {
628
628
  }) : null;
629
629
  };
630
630
  }
631
- function Pt(t) {
631
+ function jt(t) {
632
632
  return async (e, a) => (await t.deleteFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", a).executeTakeFirst()).numDeletedRows > 0;
633
633
  }
634
- function Ft(t) {
634
+ function Pt(t) {
635
635
  return async (e, a, r) => {
636
636
  const n = {
637
637
  ...r,
@@ -647,16 +647,16 @@ function Ft(t) {
647
647
  return await t.updateTable("applications").set(n).where("applications.id", "=", a).where("applications.tenant_id", "=", e).execute(), !0;
648
648
  };
649
649
  }
650
- function Mt(t) {
650
+ function Ft(t) {
651
651
  return {
652
- create: Dt(t),
653
- list: It(t),
654
- get: jt(t),
655
- remove: Pt(t),
656
- update: Ft(t)
652
+ create: $t(t),
653
+ list: Dt(t),
654
+ get: It(t),
655
+ remove: jt(t),
656
+ update: Pt(t)
657
657
  };
658
658
  }
659
- function At(t) {
659
+ function Mt(t) {
660
660
  return async (e, a) => {
661
661
  const r = {
662
662
  id: C(),
@@ -672,7 +672,7 @@ function At(t) {
672
672
  }).execute(), r;
673
673
  };
674
674
  }
675
- function zt(t) {
675
+ function At(t) {
676
676
  return async (e, a = {
677
677
  page: 0,
678
678
  per_page: 50,
@@ -681,7 +681,7 @@ function zt(t) {
681
681
  let r = t.selectFrom("connections").where("connections.tenant_id", "=", e);
682
682
  a.q && (r = N(t, r, a.q, ["user_id", "ip"]));
683
683
  const s = (await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute()).map(
684
- (i) => f({
684
+ (i) => p({
685
685
  ...i,
686
686
  options: JSON.parse(i.options)
687
687
  })
@@ -694,19 +694,19 @@ function zt(t) {
694
694
  };
695
695
  };
696
696
  }
697
- function Lt(t) {
697
+ function zt(t) {
698
698
  return async (e, a) => (await t.deleteFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", a).executeTakeFirst()).numDeletedRows > 0;
699
699
  }
700
- function Jt(t) {
700
+ function Lt(t) {
701
701
  return async (e, a) => {
702
702
  const r = await t.selectFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", a).selectAll().executeTakeFirst();
703
- return r ? f({
703
+ return r ? p({
704
704
  ...r,
705
705
  options: JSON.parse(r.options)
706
706
  }) : null;
707
707
  };
708
708
  }
709
- function Et(t) {
709
+ function Jt(t) {
710
710
  return async (e, a, r) => {
711
711
  const n = {
712
712
  ...r,
@@ -718,16 +718,16 @@ function Et(t) {
718
718
  }).where("connections.id", "=", a).where("connections.tenant_id", "=", e).execute(), !0;
719
719
  };
720
720
  }
721
- function Kt(t) {
721
+ function Et(t) {
722
722
  return {
723
- create: At(t),
724
- get: Jt(t),
725
- list: zt(t),
726
- remove: Lt(t),
727
- update: Et(t)
723
+ create: Mt(t),
724
+ get: Lt(t),
725
+ list: At(t),
726
+ remove: zt(t),
727
+ update: Jt(t)
728
728
  };
729
729
  }
730
- function Rt(t) {
730
+ function Kt(t) {
731
731
  return {
732
732
  get: async (e) => {
733
733
  const a = await t.selectFrom("applications").selectAll().where("id", "=", e).executeTakeFirst();
@@ -741,7 +741,7 @@ function Rt(t) {
741
741
  ...a,
742
742
  connections: n.map(
743
743
  (s) => Be.parse(
744
- f({
744
+ p({
745
745
  ...s,
746
746
  options: s.options ? JSON.parse(s.options) : {}
747
747
  })
@@ -753,14 +753,14 @@ function Rt(t) {
753
753
  web_origins: a.web_origins ? JSON.parse(a.web_origins) : [],
754
754
  allowed_logout_urls: a.allowed_logout_urls ? JSON.parse(a.allowed_logout_urls) : [],
755
755
  allowed_clients: a.allowed_clients ? JSON.parse(a.allowed_clients) : [],
756
- tenant: f(r),
756
+ tenant: p(r),
757
757
  // this is really an integer in the database
758
758
  disable_sign_ups: !!a.disable_sign_ups
759
759
  };
760
760
  }
761
761
  };
762
762
  }
763
- function Bt(t) {
763
+ function Rt(t) {
764
764
  return async () => await t.selectFrom("keys").where(
765
765
  (a) => a.or([
766
766
  a("revoked_at", ">", (/* @__PURE__ */ new Date()).toISOString()),
@@ -768,22 +768,22 @@ function Bt(t) {
768
768
  ])
769
769
  ).selectAll().execute();
770
770
  }
771
- function Ut(t) {
771
+ function Bt(t) {
772
772
  return async (e) => {
773
773
  await t.insertInto("keys").values({ ...e, created_at: (/* @__PURE__ */ new Date()).toDateString() }).execute();
774
774
  };
775
775
  }
776
- function Qt(t) {
776
+ function Ut(t) {
777
777
  return async (e, a) => !!(await t.updateTable("keys").set(a).where("kid", "=", e).execute()).length;
778
778
  }
779
779
  function qt(t) {
780
780
  return {
781
- create: Ut(t),
782
- list: Bt(t),
783
- update: Qt(t)
781
+ create: Bt(t),
782
+ list: Rt(t),
783
+ update: Ut(t)
784
784
  };
785
785
  }
786
- function Vt(t) {
786
+ function Qt(t) {
787
787
  return async (e, a) => {
788
788
  const r = {
789
789
  custom_domain_id: C(),
@@ -800,16 +800,16 @@ function Vt(t) {
800
800
  }).execute(), r;
801
801
  };
802
802
  }
803
- function Wt(t) {
803
+ function Vt(t) {
804
804
  return async (e) => (await t.selectFrom("custom_domains").where("custom_domains.tenant_id", "=", e).selectAll().execute()).map((r) => ({
805
805
  ...r,
806
806
  primary: r.primary === 1
807
807
  }));
808
808
  }
809
- function Gt(t) {
809
+ function Wt(t) {
810
810
  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;
811
811
  }
812
- function Ht(t) {
812
+ function Gt(t) {
813
813
  return async (e, a) => {
814
814
  const r = await t.selectFrom("custom_domains").where("custom_domains.tenant_id", "=", e).where("custom_domains.custom_domain_id", "=", a).selectAll().executeTakeFirst();
815
815
  return r ? {
@@ -818,7 +818,7 @@ function Ht(t) {
818
818
  } : null;
819
819
  };
820
820
  }
821
- function Xt(t) {
821
+ function Ht(t) {
822
822
  return async (e, a, r) => {
823
823
  const n = {
824
824
  ...r,
@@ -828,7 +828,7 @@ function Xt(t) {
828
828
  return (await t.updateTable("custom_domains").set(n).where("custom_domains.tenant_id", "=", e).where("custom_domains.custom_domain_id", "=", a).execute()).length > 0;
829
829
  };
830
830
  }
831
- function Yt(t) {
831
+ function Xt(t) {
832
832
  return async (e) => {
833
833
  const a = await t.selectFrom("custom_domains").where("custom_domains.domain", "=", e).selectAll().executeTakeFirst();
834
834
  return a ? {
@@ -837,17 +837,17 @@ function Yt(t) {
837
837
  } : null;
838
838
  };
839
839
  }
840
- function Zt(t) {
840
+ function Yt(t) {
841
841
  return {
842
- create: Vt(t),
843
- get: Ht(t),
844
- getByDomain: Yt(t),
845
- list: Wt(t),
846
- remove: Gt(t),
847
- update: Xt(t)
842
+ create: Qt(t),
843
+ get: Gt(t),
844
+ getByDomain: Xt(t),
845
+ list: Vt(t),
846
+ remove: Wt(t),
847
+ update: Ht(t)
848
848
  };
849
849
  }
850
- function ea(t) {
850
+ function Zt(t) {
851
851
  return async (e) => {
852
852
  const [a] = await t.selectFrom("branding").where("branding.tenant_id", "=", e).selectAll().execute();
853
853
  if (!a)
@@ -859,11 +859,11 @@ function ea(t) {
859
859
  colors_page_background_start: s,
860
860
  colors_page_background_end: c,
861
861
  colors_page_background_angle_dev: i,
862
- font_url: _,
863
- ...m
862
+ font_url: m,
863
+ ...u
864
864
  } = a;
865
- return f({
866
- ...m,
865
+ return p({
866
+ ...u,
867
867
  colors: {
868
868
  primary: n,
869
869
  page_background: {
@@ -873,30 +873,30 @@ function ea(t) {
873
873
  angle_deg: i
874
874
  }
875
875
  },
876
- font: _ ? { url: _ } : void 0
876
+ font: m ? { url: m } : void 0
877
877
  });
878
878
  };
879
879
  }
880
- function ta(t) {
880
+ function ea(t) {
881
881
  return async (e, a) => {
882
- var s, c, i, _, m, p, y, K, R, F, re, ne, oe, se, ie, le, ce, de;
882
+ var s, c, i, m, u, h, g, D, I, O, re, ne, oe, se, ie, le, ce, de;
883
883
  const { colors: r, font: n, ...o } = a;
884
884
  try {
885
885
  await t.insertInto("branding").values({
886
886
  ...o,
887
887
  colors_primary: r == null ? void 0 : r.primary,
888
888
  colors_page_background_type: (c = (s = a.colors) == null ? void 0 : s.page_background) == null ? void 0 : c.type,
889
- colors_page_background_start: (_ = (i = a.colors) == null ? void 0 : i.page_background) == null ? void 0 : _.start,
890
- colors_page_background_end: (p = (m = a.colors) == null ? void 0 : m.page_background) == null ? void 0 : p.end,
891
- colors_page_background_angle_dev: (K = (y = a.colors) == null ? void 0 : y.page_background) == null ? void 0 : K.angle_deg,
892
- font_url: (R = a.font) == null ? void 0 : R.url,
889
+ colors_page_background_start: (m = (i = a.colors) == null ? void 0 : i.page_background) == null ? void 0 : m.start,
890
+ colors_page_background_end: (h = (u = a.colors) == null ? void 0 : u.page_background) == null ? void 0 : h.end,
891
+ colors_page_background_angle_dev: (D = (g = a.colors) == null ? void 0 : g.page_background) == null ? void 0 : D.angle_deg,
892
+ font_url: (I = a.font) == null ? void 0 : I.url,
893
893
  tenant_id: e
894
894
  }).execute();
895
895
  } catch {
896
896
  await t.updateTable("branding").set({
897
897
  ...o,
898
898
  colors_primary: r == null ? void 0 : r.primary,
899
- colors_page_background_type: (re = (F = a.colors) == null ? void 0 : F.page_background) == null ? void 0 : re.type,
899
+ colors_page_background_type: (re = (O = a.colors) == null ? void 0 : O.page_background) == null ? void 0 : re.type,
900
900
  colors_page_background_start: (oe = (ne = a.colors) == null ? void 0 : ne.page_background) == null ? void 0 : oe.start,
901
901
  colors_page_background_end: (ie = (se = a.colors) == null ? void 0 : se.page_background) == null ? void 0 : ie.end,
902
902
  colors_page_background_angle_dev: (ce = (le = a.colors) == null ? void 0 : le.page_background) == null ? void 0 : ce.angle_deg,
@@ -905,13 +905,13 @@ function ta(t) {
905
905
  }
906
906
  };
907
907
  }
908
- function aa(t) {
908
+ function ta(t) {
909
909
  return {
910
- get: ea(t),
911
- set: ta(t)
910
+ get: Zt(t),
911
+ set: ea(t)
912
912
  };
913
913
  }
914
- function ra(t) {
914
+ function aa(t) {
915
915
  return async (e, a = {
916
916
  page: 0,
917
917
  per_page: 50,
@@ -922,11 +922,11 @@ function ra(t) {
922
922
  const o = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), { count: s } = await r.select((i) => i.fn.countAll().as("count")).executeTakeFirstOrThrow();
923
923
  return {
924
924
  hooks: o.map((i) => {
925
- const { tenant_id: _, enabled: m, synchronous: p, ...y } = i;
926
- return f({
927
- ...y,
928
- enabled: !!m,
929
- synchronous: !!p
925
+ const { tenant_id: m, enabled: u, synchronous: h, ...g } = i;
926
+ return p({
927
+ ...g,
928
+ enabled: !!u,
929
+ synchronous: !!h
930
930
  });
931
931
  }),
932
932
  start: a.page * a.per_page,
@@ -935,20 +935,20 @@ function ra(t) {
935
935
  };
936
936
  };
937
937
  }
938
- function na(t) {
938
+ function ra(t) {
939
939
  return async (e, a) => {
940
940
  const r = await t.selectFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", a).selectAll().executeTakeFirst();
941
- return r ? f({
941
+ return r ? p({
942
942
  ...r,
943
943
  enabled: !!r.enabled,
944
944
  synchronous: !!r.synchronous
945
945
  }) : null;
946
946
  };
947
947
  }
948
- function oa(t) {
948
+ function na(t) {
949
949
  return async (e, a) => (await t.deleteFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", a).executeTakeFirst()).numDeletedRows > 0;
950
950
  }
951
- function sa(t) {
951
+ function oa(t) {
952
952
  return async (e, a) => {
953
953
  const r = {
954
954
  hook_id: C(),
@@ -964,7 +964,7 @@ function sa(t) {
964
964
  }).execute(), r;
965
965
  };
966
966
  }
967
- function ia(t) {
967
+ function sa(t) {
968
968
  return async (e, a, r) => {
969
969
  const n = {
970
970
  ...r,
@@ -975,16 +975,16 @@ function ia(t) {
975
975
  return await t.updateTable("hooks").set(n).where("hooks.hook_id", "=", a).where("hooks.tenant_id", "=", e).execute(), !0;
976
976
  };
977
977
  }
978
- function la(t) {
978
+ function ia(t) {
979
979
  return {
980
- create: sa(t),
981
- get: na(t),
982
- list: ra(t),
983
- update: ia(t),
984
- remove: oa(t)
980
+ create: oa(t),
981
+ get: ra(t),
982
+ list: aa(t),
983
+ update: sa(t),
984
+ remove: na(t)
985
985
  };
986
986
  }
987
- function ca(t) {
987
+ function la(t) {
988
988
  return async (e, a) => {
989
989
  const r = {
990
990
  themeId: C(),
@@ -995,13 +995,13 @@ function ca(t) {
995
995
  ...r,
996
996
  tenant_id: e
997
997
  };
998
- return await t.insertInto("themes").values(P(n)).execute(), r;
998
+ return await t.insertInto("themes").values(A(n)).execute(), r;
999
999
  };
1000
1000
  }
1001
- function da(t) {
1001
+ function ca(t) {
1002
1002
  return async (e, a) => (await t.deleteFrom("themes").where("themes.tenant_id", "=", e).where("themes.themeId", "=", a).executeTakeFirst()).numDeletedRows > 0;
1003
1003
  }
1004
- function ua(t) {
1004
+ function da(t) {
1005
1005
  return async (e, a) => {
1006
1006
  const r = await t.selectFrom("themes").where("themes.tenant_id", "=", e).where("themes.themeId", "=", a).selectAll().executeTakeFirst();
1007
1007
  if (!r)
@@ -1016,7 +1016,7 @@ function ua(t) {
1016
1016
  fonts_subtitle_bold: !!r.fonts_subtitle_bold,
1017
1017
  fonts_title_bold: !!r.fonts_title_bold
1018
1018
  };
1019
- return f(
1019
+ return p(
1020
1020
  ge(n, [
1021
1021
  "widget",
1022
1022
  "colors",
@@ -1027,29 +1027,29 @@ function ua(t) {
1027
1027
  );
1028
1028
  };
1029
1029
  }
1030
- function ma(t) {
1030
+ function ua(t) {
1031
1031
  return async (e, a, r) => {
1032
- const n = P({
1032
+ const n = A({
1033
1033
  ...r,
1034
1034
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
1035
1035
  });
1036
1036
  return await t.updateTable("themes").set(n).where("themes.themeId", "=", a).where("themes.tenant_id", "=", e).execute(), !0;
1037
1037
  };
1038
1038
  }
1039
- function _a(t) {
1039
+ function ma(t) {
1040
1040
  return {
1041
- create: ca(t),
1042
- get: ua(t),
1043
- remove: da(t),
1044
- update: ma(t)
1041
+ create: la(t),
1042
+ get: da(t),
1043
+ remove: ca(t),
1044
+ update: ua(t)
1045
1045
  };
1046
1046
  }
1047
- function ha(t) {
1047
+ function _a(t) {
1048
1048
  return async (e, a) => {
1049
1049
  const r = await t.selectFrom("login_sessions").where("login_sessions.id", "=", a).selectAll().executeTakeFirst();
1050
1050
  return r ? Ue.parse(
1051
1051
  ge(
1052
- f({
1052
+ p({
1053
1053
  ...r,
1054
1054
  login_completed: !!r.login_completed
1055
1055
  }),
@@ -1058,7 +1058,7 @@ function ha(t) {
1058
1058
  ) : null;
1059
1059
  };
1060
1060
  }
1061
- function fa(t) {
1061
+ function ha(t) {
1062
1062
  return async (e, a) => {
1063
1063
  var n;
1064
1064
  const r = {
@@ -1070,33 +1070,33 @@ function fa(t) {
1070
1070
  login_completed: !!a.login_completed
1071
1071
  };
1072
1072
  return await t.insertInto("login_sessions").values({
1073
- ...P(r),
1073
+ ...A(r),
1074
1074
  tenant_id: e
1075
1075
  }).execute(), r;
1076
1076
  };
1077
1077
  }
1078
- function pa(t) {
1078
+ function fa(t) {
1079
1079
  return async (e, a, r) => (await t.updateTable("login_sessions").set(
1080
- P({
1080
+ A({
1081
1081
  ...r
1082
1082
  })
1083
1083
  ).where("login_sessions.id", "=", a).where("login_sessions.tenant_id", "=", e).execute()).length === 1;
1084
1084
  }
1085
- function ga(t) {
1085
+ function pa(t) {
1086
1086
  return async (e, a) => (await t.deleteFrom("login_sessions").where("login_sessions.tenant_id", "=", e).where("login_sessions.id", "=", a).execute()).length > 0;
1087
1087
  }
1088
- function wa(t) {
1088
+ function ga(t) {
1089
1089
  return {
1090
- create: fa(t),
1091
- get: ha(t),
1092
- update: pa(t),
1093
- remove: ga(t)
1090
+ create: ha(t),
1091
+ get: _a(t),
1092
+ update: fa(t),
1093
+ remove: pa(t)
1094
1094
  };
1095
1095
  }
1096
- function ya(t) {
1096
+ function wa(t) {
1097
1097
  return async (e) => {
1098
1098
  const [a] = await t.selectFrom("prompt_settings").where("prompt_settings.tenant_id", "=", e).selectAll().execute();
1099
- return f({
1099
+ return p({
1100
1100
  identifier_first: !!(a != null && a.identifier_first),
1101
1101
  password_first: !!(a != null && a.password_first),
1102
1102
  webauthn_platform_first_factor: !!(a != null && a.webauthn_platform_first_factor),
@@ -1105,7 +1105,7 @@ function ya(t) {
1105
1105
  };
1106
1106
  }
1107
1107
  function he(t) {
1108
- return f({
1108
+ return p({
1109
1109
  ...t,
1110
1110
  webauthn_platform_first_factor: t.webauthn_platform_first_factor ? !!t.webauthn_platform_first_factor : void 0,
1111
1111
  identifier_first: t.identifier_first ? !!t.identifier_first : void 0,
@@ -1113,10 +1113,10 @@ function he(t) {
1113
1113
  universal_login_experience: t.universal_login_experience
1114
1114
  });
1115
1115
  }
1116
- function va(t) {
1116
+ function ya(t) {
1117
1117
  return async (e, a) => {
1118
1118
  try {
1119
- const r = Qe.parse(a);
1119
+ const r = qe.parse(a);
1120
1120
  await t.insertInto("prompt_settings").values({
1121
1121
  ...he(r),
1122
1122
  tenant_id: e
@@ -1126,13 +1126,13 @@ function va(t) {
1126
1126
  }
1127
1127
  };
1128
1128
  }
1129
- function Na(t) {
1129
+ function va(t) {
1130
1130
  return {
1131
- get: ya(t),
1132
- set: va(t)
1131
+ get: wa(t),
1132
+ set: ya(t)
1133
1133
  };
1134
1134
  }
1135
- function Ca(t) {
1135
+ function Na(t) {
1136
1136
  return async (e) => {
1137
1137
  const [a] = await t.selectFrom("email_providers").where("email_providers.tenant_id", "=", e).selectAll().execute();
1138
1138
  if (!a)
@@ -1144,7 +1144,7 @@ function Ca(t) {
1144
1144
  enabled: s,
1145
1145
  ...c
1146
1146
  } = a;
1147
- return f({
1147
+ return p({
1148
1148
  ...c,
1149
1149
  credentials: JSON.parse(n),
1150
1150
  settings: JSON.parse(o),
@@ -1152,7 +1152,7 @@ function Ca(t) {
1152
1152
  });
1153
1153
  };
1154
1154
  }
1155
- function ba(t) {
1155
+ function Ca(t) {
1156
1156
  return async (e, a) => {
1157
1157
  const { credentials: r, settings: n, enabled: o, ...s } = a;
1158
1158
  await t.updateTable("email_providers").set({
@@ -1163,7 +1163,7 @@ function ba(t) {
1163
1163
  }).where("tenant_id", "=", e).execute();
1164
1164
  };
1165
1165
  }
1166
- function xa(t) {
1166
+ function ba(t) {
1167
1167
  return async (e, a) => {
1168
1168
  const { credentials: r, settings: n, enabled: o, ...s } = a;
1169
1169
  await t.insertInto("email_providers").values({
@@ -1177,14 +1177,14 @@ function xa(t) {
1177
1177
  }).execute();
1178
1178
  };
1179
1179
  }
1180
- function Ta(t) {
1180
+ function xa(t) {
1181
1181
  return {
1182
- get: Ca(t),
1183
- create: xa(t),
1184
- update: ba(t)
1182
+ get: Na(t),
1183
+ create: ba(t),
1184
+ update: Ca(t)
1185
1185
  };
1186
1186
  }
1187
- function Sa(t) {
1187
+ function Ta(t) {
1188
1188
  return async (e, a) => {
1189
1189
  const r = await t.selectFrom("refresh_tokens").where("refresh_tokens.tenant_id", "=", e).where("refresh_tokens.id", "=", a).selectAll().executeTakeFirst();
1190
1190
  return r ? {
@@ -1195,7 +1195,7 @@ function Sa(t) {
1195
1195
  } : null;
1196
1196
  };
1197
1197
  }
1198
- function Oa(t) {
1198
+ function Sa(t) {
1199
1199
  return async (e, a) => {
1200
1200
  const r = {
1201
1201
  ...a,
@@ -1210,10 +1210,10 @@ function Oa(t) {
1210
1210
  }).execute(), { ...a, ...r };
1211
1211
  };
1212
1212
  }
1213
- function ka(t) {
1213
+ function Oa(t) {
1214
1214
  return async (e, a) => !!(await t.deleteFrom("refresh_tokens").where("tenant_id", "=", e).where("refresh_tokens.id", "=", a).execute()).length;
1215
1215
  }
1216
- function $a(t) {
1216
+ function ka(t) {
1217
1217
  return async (e, a, r) => {
1218
1218
  const n = {
1219
1219
  ...r,
@@ -1224,7 +1224,7 @@ function $a(t) {
1224
1224
  return !!(await t.updateTable("refresh_tokens").set(n).where("tenant_id", "=", e).where("refresh_tokens.id", "=", a).execute()).length;
1225
1225
  };
1226
1226
  }
1227
- function Da(t) {
1227
+ function $a(t) {
1228
1228
  return async (e, a = {
1229
1229
  page: 0,
1230
1230
  per_page: 50,
@@ -1255,16 +1255,16 @@ function Da(t) {
1255
1255
  };
1256
1256
  };
1257
1257
  }
1258
- function Ia(t) {
1258
+ function Da(t) {
1259
1259
  return {
1260
- create: Oa(t),
1261
- get: Sa(t),
1262
- list: Da(t),
1263
- remove: ka(t),
1264
- update: $a(t)
1260
+ create: Sa(t),
1261
+ get: Ta(t),
1262
+ list: $a(t),
1263
+ remove: Oa(t),
1264
+ update: ka(t)
1265
1265
  };
1266
1266
  }
1267
- function ja(t) {
1267
+ function Ia(t) {
1268
1268
  return async () => {
1269
1269
  const e = new Date(Date.now() - 864e5).toISOString(), a = new Date(
1270
1270
  Date.now() - 1e3 * 60 * 60 * 24 * 7
@@ -1294,7 +1294,7 @@ function ja(t) {
1294
1294
  ).execute(), console.log("cleanup complete");
1295
1295
  };
1296
1296
  }
1297
- function Pa(t) {
1297
+ function ja(t) {
1298
1298
  return async (e, a) => {
1299
1299
  const r = U.parse({
1300
1300
  id: C(),
@@ -1312,7 +1312,7 @@ function Pa(t) {
1312
1312
  }).execute(), U.parse(r);
1313
1313
  };
1314
1314
  }
1315
- function Fa(t) {
1315
+ function Pa(t) {
1316
1316
  return async (e, a = {
1317
1317
  page: 0,
1318
1318
  per_page: 50,
@@ -1321,23 +1321,23 @@ function Fa(t) {
1321
1321
  let r = t.selectFrom("forms").where("tenant_id", "=", e);
1322
1322
  a != null && a.q && (r = N(t, r, a.q, []));
1323
1323
  const s = (await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute()).map((i) => {
1324
- const _ = { ...i };
1325
- if (typeof _.nodes == "string")
1324
+ const m = { ...i };
1325
+ if (typeof m.nodes == "string")
1326
1326
  try {
1327
- _.nodes = JSON.parse(_.nodes);
1327
+ m.nodes = JSON.parse(m.nodes);
1328
1328
  } catch {
1329
1329
  }
1330
- if (typeof _.start == "string")
1330
+ if (typeof m.start == "string")
1331
1331
  try {
1332
- _.start = JSON.parse(_.start);
1332
+ m.start = JSON.parse(m.start);
1333
1333
  } catch {
1334
1334
  }
1335
- if (typeof _.ending == "string")
1335
+ if (typeof m.ending == "string")
1336
1336
  try {
1337
- _.ending = JSON.parse(_.ending);
1337
+ m.ending = JSON.parse(m.ending);
1338
1338
  } catch {
1339
1339
  }
1340
- return U.parse(f(_));
1340
+ return U.parse(p(m));
1341
1341
  }), { count: c } = await r.select((i) => i.fn.countAll().as("count")).executeTakeFirstOrThrow();
1342
1342
  return {
1343
1343
  forms: s,
@@ -1347,13 +1347,13 @@ function Fa(t) {
1347
1347
  };
1348
1348
  };
1349
1349
  }
1350
- function Ma(t) {
1350
+ function Fa(t) {
1351
1351
  return async (e, a) => {
1352
1352
  const { numDeletedRows: r } = await t.deleteFrom("forms").where("id", "=", a).where("tenant_id", "=", e).executeTakeFirst();
1353
1353
  return r > 0;
1354
1354
  };
1355
1355
  }
1356
- function Aa(t) {
1356
+ function Ma(t) {
1357
1357
  return async (e, a) => {
1358
1358
  const r = await t.selectFrom("forms").selectAll().where("forms.id", "=", a).where("tenant_id", "=", e).executeTakeFirst();
1359
1359
  if (!r) return null;
@@ -1373,10 +1373,10 @@ function Aa(t) {
1373
1373
  n.ending = JSON.parse(n.ending);
1374
1374
  } catch {
1375
1375
  }
1376
- return U.parse(f(n));
1376
+ return U.parse(p(n));
1377
1377
  };
1378
1378
  }
1379
- function za(t) {
1379
+ function Aa(t) {
1380
1380
  return async (e, a, r) => {
1381
1381
  const n = {
1382
1382
  ...r,
@@ -1387,64 +1387,99 @@ function za(t) {
1387
1387
  return o > 0;
1388
1388
  };
1389
1389
  }
1390
- function La(t) {
1390
+ function za(t) {
1391
1391
  return {
1392
- create: Pa(t),
1393
- get: Aa(t),
1394
- list: Fa(t),
1395
- remove: Ma(t),
1396
- update: za(t)
1392
+ create: ja(t),
1393
+ get: Ma(t),
1394
+ list: Pa(t),
1395
+ remove: Fa(t),
1396
+ update: Aa(t)
1397
1397
  };
1398
1398
  }
1399
- function Ja(t) {
1399
+ function La(t) {
1400
1400
  return async (e, a) => {
1401
- const r = {
1401
+ const r = (/* @__PURE__ */ new Date()).toISOString(), n = {
1402
1402
  id: C(),
1403
- ...a
1404
- }, n = qe.parse(r);
1405
- return await t.insertInto("resource_servers").values({
1406
- ...n,
1403
+ ...a,
1404
+ created_at: r,
1405
+ updated_at: r
1406
+ }, o = Qe.parse(n), {
1407
+ verificationKey: s,
1408
+ scopes: c,
1409
+ options: i,
1410
+ skip_consent_for_verifiable_first_party_clients: m,
1411
+ allow_offline_access: u,
1412
+ ...h
1413
+ } = o, g = {
1414
+ ...h,
1407
1415
  tenant_id: e,
1408
- scopes: n.scopes ? JSON.stringify(n.scopes) : "[]",
1409
- options: n.options ? JSON.stringify(n.options) : "{}",
1410
- skip_consent_for_verifiable_first_party_clients: n.skip_consent_for_verifiable_first_party_clients ? 1 : 0,
1411
- allow_offline_access: n.allow_offline_access ? 1 : 0
1412
- }).execute(), n;
1416
+ scopes: c ? JSON.stringify(c) : "[]",
1417
+ options: i ? JSON.stringify(i) : "{}",
1418
+ skip_consent_for_verifiable_first_party_clients: m ? 1 : 0,
1419
+ allow_offline_access: u ? 1 : 0,
1420
+ verification_key: s,
1421
+ created_at: r,
1422
+ updated_at: r
1423
+ };
1424
+ return await t.insertInto("resource_servers").values(g).execute(), o;
1413
1425
  };
1414
1426
  }
1415
- function Ea(t) {
1427
+ function Ja(t) {
1416
1428
  return async (e, a) => {
1417
1429
  const r = await t.selectFrom("resource_servers").selectAll().where("tenant_id", "=", e).where("id", "=", a).executeTakeFirst();
1418
- return r ? {
1419
- ...r,
1420
- scopes: r.scopes ? JSON.parse(r.scopes) : [],
1421
- options: r.options ? JSON.parse(r.options) : {},
1422
- skip_consent_for_verifiable_first_party_clients: !!r.skip_consent_for_verifiable_first_party_clients,
1423
- allow_offline_access: !!r.allow_offline_access
1424
- } : null;
1430
+ if (!r) return null;
1431
+ const n = r, {
1432
+ verification_key: o,
1433
+ scopes: s,
1434
+ options: c,
1435
+ skip_consent_for_verifiable_first_party_clients: i,
1436
+ allow_offline_access: m,
1437
+ ...u
1438
+ } = n;
1439
+ return {
1440
+ ...u,
1441
+ scopes: s ? JSON.parse(s) : [],
1442
+ options: c ? JSON.parse(c) : {},
1443
+ skip_consent_for_verifiable_first_party_clients: !!i,
1444
+ allow_offline_access: !!m,
1445
+ // Convert verification_key back to verificationKey for API
1446
+ verificationKey: o
1447
+ };
1425
1448
  };
1426
1449
  }
1427
- function Ka(t) {
1450
+ function Ea(t) {
1428
1451
  return async (e, a = { page: 0, per_page: 50, include_totals: !1 }) => {
1429
1452
  let r = t.selectFrom("resource_servers").where("resource_servers.tenant_id", "=", e);
1430
1453
  if (a.q) {
1431
- const i = a.q.trim(), _ = i.split(/\s+/), m = _.length === 1 ? _[0] : void 0, p = m ? m.match(/^(-)?(name|identifier):(.*)$/) : null, y = p ? p[3] : "", K = /^(>=|>|<=|<)/.test(y || "");
1432
- if (p && !K) {
1433
- const R = !!p[1], F = p[2] === "name" ? "resource_servers.name" : "resource_servers.identifier";
1434
- r = R ? r.where(F, "not like", `%${y}%`) : r.where(F, "like", `%${y}%`);
1454
+ const i = a.q.trim(), m = i.split(/\s+/), u = m.length === 1 ? m[0] : void 0, h = u ? u.match(/^(-)?(name|identifier):(.*)$/) : null, g = h ? h[3] : "", D = /^(>=|>|<=|<)/.test(g || "");
1455
+ if (h && !D) {
1456
+ const I = !!h[1], O = h[2] === "name" ? "resource_servers.name" : "resource_servers.identifier";
1457
+ r = I ? r.where(O, "not like", `%${g}%`) : r.where(O, "like", `%${g}%`);
1435
1458
  } else
1436
1459
  r = N(t, r, i, [
1437
1460
  "resource_servers.name",
1438
1461
  "resource_servers.identifier"
1439
1462
  ]);
1440
1463
  }
1441
- const s = (await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute()).map((i) => ({
1442
- ...i,
1443
- scopes: i.scopes ? JSON.parse(i.scopes) : [],
1444
- options: i.options ? JSON.parse(i.options) : {},
1445
- skip_consent_for_verifiable_first_party_clients: !!i.skip_consent_for_verifiable_first_party_clients,
1446
- allow_offline_access: !!i.allow_offline_access
1447
- })), { count: c } = await r.select((i) => i.fn.countAll().as("count")).executeTakeFirstOrThrow();
1464
+ const s = (await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute()).map((i) => {
1465
+ const m = i, {
1466
+ verification_key: u,
1467
+ scopes: h,
1468
+ options: g,
1469
+ skip_consent_for_verifiable_first_party_clients: D,
1470
+ allow_offline_access: I,
1471
+ ...O
1472
+ } = m;
1473
+ return {
1474
+ ...O,
1475
+ scopes: h ? JSON.parse(h) : [],
1476
+ options: g ? JSON.parse(g) : {},
1477
+ skip_consent_for_verifiable_first_party_clients: !!D,
1478
+ allow_offline_access: !!I,
1479
+ // Convert verification_key back to verificationKey for API
1480
+ verificationKey: u
1481
+ };
1482
+ }), { count: c } = await r.select((i) => i.fn.countAll().as("count")).executeTakeFirstOrThrow();
1448
1483
  return {
1449
1484
  resource_servers: s,
1450
1485
  start: a.page * a.per_page,
@@ -1453,216 +1488,242 @@ function Ka(t) {
1453
1488
  };
1454
1489
  };
1455
1490
  }
1456
- function Ra(t) {
1491
+ function Ka(t) {
1457
1492
  return async (e, a) => {
1458
1493
  const r = await t.deleteFrom("resource_servers").where("tenant_id", "=", e).where("id", "=", a).executeTakeFirst();
1459
1494
  return Number(r.numDeletedRows) > 0;
1460
1495
  };
1461
1496
  }
1462
- function Ba(t) {
1497
+ function Ra(t) {
1463
1498
  return async (e, a, r) => {
1464
- const n = { ...r };
1465
- n.scopes && (n.scopes = JSON.stringify(n.scopes)), n.options && (n.options = JSON.stringify(n.options)), typeof n.skip_consent_for_verifiable_first_party_clients == "boolean" && (n.skip_consent_for_verifiable_first_party_clients = n.skip_consent_for_verifiable_first_party_clients ? 1 : 0), typeof n.allow_offline_access == "boolean" && (n.allow_offline_access = n.allow_offline_access ? 1 : 0);
1466
- const o = await t.updateTable("resource_servers").set(n).where("tenant_id", "=", e).where("id", "=", a).executeTakeFirst();
1467
- return Number(o.numUpdatedRows) > 0;
1499
+ const {
1500
+ verificationKey: n,
1501
+ scopes: o,
1502
+ options: s,
1503
+ skip_consent_for_verifiable_first_party_clients: c,
1504
+ allow_offline_access: i,
1505
+ ...m
1506
+ } = r, u = {
1507
+ ...m,
1508
+ updated_at: (/* @__PURE__ */ new Date()).toISOString()
1509
+ };
1510
+ n !== void 0 && (u.verification_key = n), o !== void 0 && (u.scopes = JSON.stringify(o)), s !== void 0 && (u.options = JSON.stringify(s)), c !== void 0 && (u.skip_consent_for_verifiable_first_party_clients = c ? 1 : 0), i !== void 0 && (u.allow_offline_access = i ? 1 : 0);
1511
+ const h = await t.updateTable("resource_servers").set(u).where("tenant_id", "=", e).where("id", "=", a).executeTakeFirst();
1512
+ return Number(h.numUpdatedRows) > 0;
1468
1513
  };
1469
1514
  }
1470
- function Ua(t) {
1515
+ function Ba(t) {
1471
1516
  return {
1472
- create: Ja(t),
1473
- get: Ea(t),
1474
- list: Ka(t),
1475
- remove: Ra(t),
1476
- update: Ba(t)
1517
+ create: La(t),
1518
+ get: Ja(t),
1519
+ list: Ea(t),
1520
+ remove: Ka(t),
1521
+ update: Ra(t)
1477
1522
  };
1478
1523
  }
1479
- function Qa(t) {
1524
+ function Ua(t) {
1480
1525
  return async (e, a) => {
1481
- const r = { id: C(), ...a }, n = Ve.parse(r);
1482
- return await t.insertInto("rules").values({
1483
- ...n,
1526
+ const r = C(), n = (/* @__PURE__ */ new Date()).toISOString(), o = { id: r, ...a }, s = Ve.parse(o), { sources: c, ...i } = s, m = {
1527
+ id: r,
1528
+ ...i,
1484
1529
  tenant_id: e,
1485
- enabled: n.enabled ? 1 : 0
1486
- }).execute(), n;
1530
+ sources: c ? JSON.stringify(c) : "[]",
1531
+ created_at: n,
1532
+ updated_at: n
1533
+ };
1534
+ return await t.insertInto("permissions").values(m).execute(), {
1535
+ ...s,
1536
+ created_at: n,
1537
+ updated_at: n
1538
+ };
1487
1539
  };
1488
1540
  }
1489
1541
  function qa(t) {
1490
1542
  return async (e, a) => {
1491
- const r = await t.selectFrom("rules").selectAll().where("tenant_id", "=", e).where("id", "=", a).executeTakeFirst();
1492
- return r ? { ...r, enabled: !!r.enabled } : null;
1543
+ const r = await t.selectFrom("permissions").selectAll().where("permissions.tenant_id", "=", e).where("permissions.id", "=", a).executeTakeFirst();
1544
+ if (!r) return null;
1545
+ const n = r, { sources: o, ...s } = n;
1546
+ return {
1547
+ ...s,
1548
+ sources: o ? JSON.parse(o) : []
1549
+ };
1493
1550
  };
1494
1551
  }
1495
- function Va(t) {
1552
+ function Qa(t) {
1496
1553
  return async (e, a = { page: 0, per_page: 50, include_totals: !1 }) => {
1497
- let r = t.selectFrom("rules").where("rules.tenant_id", "=", e);
1498
- a.q && (r = N(t, r, a.q, ["name", "stage"]));
1499
- const s = (await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute()).map((i) => ({
1500
- ...i,
1501
- enabled: !!i.enabled
1502
- })), { count: c } = await r.select((i) => i.fn.countAll().as("count")).executeTakeFirstOrThrow();
1554
+ let r = t.selectFrom("permissions").where("permissions.tenant_id", "=", e);
1555
+ a.q && (r = N(t, r, a.q, [
1556
+ "permission_name",
1557
+ "resource_server_identifier",
1558
+ "resource_server_name"
1559
+ ]));
1560
+ const s = (await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute()).map((i) => {
1561
+ const m = i, { sources: u, ...h } = m;
1562
+ return {
1563
+ ...h,
1564
+ sources: u ? JSON.parse(u) : []
1565
+ };
1566
+ }), { count: c } = await r.select((i) => i.fn.countAll().as("count")).executeTakeFirstOrThrow();
1503
1567
  return {
1504
- rules: s,
1568
+ permissions: s,
1505
1569
  start: a.page * a.per_page,
1506
1570
  limit: a.per_page,
1507
1571
  length: v(c)
1508
1572
  };
1509
1573
  };
1510
1574
  }
1575
+ function Va(t) {
1576
+ return async (e, a, r) => {
1577
+ const { sources: n, ...o } = r, s = {
1578
+ ...o,
1579
+ updated_at: (/* @__PURE__ */ new Date()).toISOString()
1580
+ };
1581
+ n !== void 0 && (s.sources = JSON.stringify(n));
1582
+ const c = await t.updateTable("permissions").set(s).where("permissions.tenant_id", "=", e).where("permissions.id", "=", a).executeTakeFirst();
1583
+ return Number(c.numUpdatedRows) > 0;
1584
+ };
1585
+ }
1511
1586
  function Wa(t) {
1512
1587
  return async (e, a) => {
1513
- const r = await t.deleteFrom("rules").where("tenant_id", "=", e).where("id", "=", a).executeTakeFirst();
1588
+ const r = await t.deleteFrom("permissions").where("permissions.tenant_id", "=", e).where("permissions.id", "=", a).executeTakeFirst();
1514
1589
  return Number(r.numDeletedRows) > 0;
1515
1590
  };
1516
1591
  }
1517
1592
  function Ga(t) {
1518
- return async (e, a, r) => {
1519
- const n = { ...r };
1520
- typeof n.enabled == "boolean" && (n.enabled = n.enabled ? 1 : 0);
1521
- const o = await t.updateTable("rules").set(n).where("tenant_id", "=", e).where("id", "=", a).executeTakeFirst();
1522
- return Number(o.numUpdatedRows) > 0;
1523
- };
1524
- }
1525
- function Ha(t) {
1526
1593
  return {
1527
- create: Qa(t),
1594
+ create: Ua(t),
1528
1595
  get: qa(t),
1529
- list: Va(t),
1530
- remove: Wa(t),
1531
- update: Ga(t)
1596
+ list: Qa(t),
1597
+ update: Va(t),
1598
+ remove: Wa(t)
1532
1599
  };
1533
1600
  }
1534
- function Xa(t) {
1601
+ function Ha(t) {
1535
1602
  return async (e, a) => {
1536
- const r = C(), n = { id: r, ...a }, o = We.parse(n);
1537
- return await t.insertInto("permissions").values({
1603
+ const r = C(), n = (/* @__PURE__ */ new Date()).toISOString(), o = {
1538
1604
  id: r,
1605
+ ...a,
1539
1606
  tenant_id: e,
1540
- permission_name: o.permission_name,
1541
- resource_server_identifier: o.resource_server_identifier,
1542
- resource_server_name: o.resource_server_name,
1543
- description: o.description,
1544
- sources: o.sources ? JSON.stringify(o.sources) : "[]"
1545
- }).execute(), o;
1607
+ created_at: n,
1608
+ updated_at: n
1609
+ };
1610
+ return await t.insertInto("roles").values(o).execute(), {
1611
+ id: r,
1612
+ ...a,
1613
+ created_at: n,
1614
+ updated_at: n
1615
+ };
1546
1616
  };
1547
1617
  }
1548
- function Ya(t) {
1618
+ function Xa(t) {
1549
1619
  return async (e, a) => {
1550
- const r = await t.selectFrom("permissions").selectAll().where("permissions.tenant_id", "=", e).where("permissions.id", "=", a).executeTakeFirst();
1551
- return r ? {
1552
- ...r,
1553
- sources: r.sources ? JSON.parse(r.sources) : []
1554
- } : null;
1620
+ const r = await t.selectFrom("roles").selectAll().where("roles.tenant_id", "=", e).where("roles.id", "=", a).executeTakeFirst();
1621
+ return r || null;
1555
1622
  };
1556
1623
  }
1557
- function Za(t) {
1624
+ function Ya(t) {
1558
1625
  return async (e, a = { page: 0, per_page: 50, include_totals: !1 }) => {
1559
- let r = t.selectFrom("permissions").where("permissions.tenant_id", "=", e);
1560
- a.q && (r = N(t, r, a.q, [
1561
- "permission_name",
1562
- "resource_server_identifier",
1563
- "resource_server_name"
1564
- ]));
1565
- const s = (await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute()).map((i) => ({
1566
- ...i,
1567
- sources: i.sources ? JSON.parse(i.sources) : []
1568
- })), { count: c } = await r.select((i) => i.fn.countAll().as("count")).executeTakeFirstOrThrow();
1626
+ let r = t.selectFrom("roles").where("roles.tenant_id", "=", e);
1627
+ a.q && (r = N(t, r, a.q, ["name"]));
1628
+ const s = (await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute()).map((i) => i), { count: c } = await r.select((i) => i.fn.countAll().as("count")).executeTakeFirstOrThrow();
1569
1629
  return {
1570
- permissions: s,
1630
+ roles: s,
1571
1631
  start: a.page * a.per_page,
1572
1632
  limit: a.per_page,
1573
1633
  length: v(c)
1574
1634
  };
1575
1635
  };
1576
1636
  }
1577
- function er(t) {
1637
+ function Za(t) {
1578
1638
  return async (e, a, r) => {
1579
- const n = { ...r };
1580
- n.sources && (n.sources = JSON.stringify(n.sources));
1581
- const o = await t.updateTable("permissions").set(n).where("permissions.tenant_id", "=", e).where("permissions.id", "=", a).executeTakeFirst();
1639
+ const n = {
1640
+ ...r,
1641
+ updated_at: (/* @__PURE__ */ new Date()).toISOString()
1642
+ }, o = await t.updateTable("roles").set(n).where("roles.tenant_id", "=", e).where("roles.id", "=", a).executeTakeFirst();
1582
1643
  return Number(o.numUpdatedRows) > 0;
1583
1644
  };
1584
1645
  }
1585
- function tr(t) {
1646
+ function er(t) {
1586
1647
  return async (e, a) => {
1587
- const r = await t.deleteFrom("permissions").where("permissions.tenant_id", "=", e).where("permissions.id", "=", a).executeTakeFirst();
1648
+ const r = await t.deleteFrom("roles").where("tenant_id", "=", e).where("id", "=", a).executeTakeFirst();
1588
1649
  return Number(r.numDeletedRows) > 0;
1589
1650
  };
1590
1651
  }
1591
- function ar(t) {
1652
+ function tr(t) {
1592
1653
  return {
1593
- create: Xa(t),
1594
- get: Ya(t),
1595
- list: Za(t),
1596
- update: er(t),
1597
- remove: tr(t)
1654
+ create: Ha(t),
1655
+ get: Xa(t),
1656
+ list: Ya(t),
1657
+ update: Za(t),
1658
+ remove: er(t)
1598
1659
  };
1599
1660
  }
1600
- function rr(t) {
1661
+ function ar(t) {
1601
1662
  return t[t.length - 1];
1602
1663
  }
1603
- function w(t) {
1664
+ function y(t) {
1604
1665
  return Object.freeze(t);
1605
1666
  }
1606
- const B = w({
1667
+ const B = y({
1607
1668
  is(t) {
1608
1669
  return t.kind === "IdentifierNode";
1609
1670
  },
1610
1671
  create(t) {
1611
- return w({
1672
+ return y({
1612
1673
  kind: "IdentifierNode",
1613
1674
  name: t
1614
1675
  });
1615
1676
  }
1616
- }), X = w({
1677
+ }), X = y({
1617
1678
  is(t) {
1618
1679
  return t.kind === "SchemableIdentifierNode";
1619
1680
  },
1620
1681
  create(t) {
1621
- return w({
1682
+ return y({
1622
1683
  kind: "SchemableIdentifierNode",
1623
1684
  identifier: B.create(t)
1624
1685
  });
1625
1686
  },
1626
1687
  createWithSchema(t, e) {
1627
- return w({
1688
+ return y({
1628
1689
  kind: "SchemableIdentifierNode",
1629
1690
  schema: B.create(t),
1630
1691
  identifier: B.create(e)
1631
1692
  });
1632
1693
  }
1633
- }), nr = w({
1694
+ }), rr = y({
1634
1695
  is(t) {
1635
1696
  return t.kind === "AliasNode";
1636
1697
  },
1637
1698
  create(t, e) {
1638
- return w({
1699
+ return y({
1639
1700
  kind: "AliasNode",
1640
1701
  node: t,
1641
1702
  alias: e
1642
1703
  });
1643
1704
  }
1644
- }), V = w({
1705
+ }), V = y({
1645
1706
  is(t) {
1646
1707
  return t.kind === "TableNode";
1647
1708
  },
1648
1709
  create(t) {
1649
- return w({
1710
+ return y({
1650
1711
  kind: "TableNode",
1651
1712
  table: X.create(t)
1652
1713
  });
1653
1714
  },
1654
1715
  createWithSchema(t, e) {
1655
- return w({
1716
+ return y({
1656
1717
  kind: "TableNode",
1657
1718
  table: X.createWithSchema(t, e)
1658
1719
  });
1659
1720
  }
1660
1721
  });
1661
- var Q;
1662
- class or {
1722
+ var q;
1723
+ class nr {
1663
1724
  constructor() {
1664
- M(this, "nodeStack", []);
1665
- b(this, Q, w({
1725
+ z(this, "nodeStack", []);
1726
+ b(this, q, y({
1666
1727
  AliasNode: this.transformAlias.bind(this),
1667
1728
  ColumnNode: this.transformColumn.bind(this),
1668
1729
  IdentifierNode: this.transformIdentifier.bind(this),
@@ -1763,13 +1824,13 @@ class or {
1763
1824
  return e;
1764
1825
  this.nodeStack.push(e);
1765
1826
  const a = this.transformNodeImpl(e);
1766
- return this.nodeStack.pop(), w(a);
1827
+ return this.nodeStack.pop(), y(a);
1767
1828
  }
1768
1829
  transformNodeImpl(e) {
1769
- return d(this, Q)[e.kind](e);
1830
+ return d(this, q)[e.kind](e);
1770
1831
  }
1771
1832
  transformNodeList(e) {
1772
- return e && w(e.map((a) => this.transformNode(a)));
1833
+ return e && y(e.map((a) => this.transformNode(a)));
1773
1834
  }
1774
1835
  transformSelectQuery(e) {
1775
1836
  return {
@@ -1868,7 +1929,7 @@ class or {
1868
1929
  transformRaw(e) {
1869
1930
  return {
1870
1931
  kind: "RawNode",
1871
- sqlFragments: w([...e.sqlFragments]),
1932
+ sqlFragments: y([...e.sqlFragments]),
1872
1933
  parameters: this.transformNodeList(e.parameters)
1873
1934
  };
1874
1935
  }
@@ -2492,8 +2553,8 @@ class or {
2492
2553
  return e;
2493
2554
  }
2494
2555
  }
2495
- Q = new WeakMap();
2496
- const sr = w({
2556
+ q = new WeakMap();
2557
+ const or = y({
2497
2558
  AlterTableNode: !0,
2498
2559
  CreateIndexNode: !0,
2499
2560
  CreateSchemaNode: !0,
@@ -2512,88 +2573,88 @@ const sr = w({
2512
2573
  UpdateQueryNode: !0,
2513
2574
  MergeQueryNode: !0
2514
2575
  });
2515
- var j, O, k, g, ye, ve, Ne, $, Y, Ce;
2516
- class ir extends or {
2576
+ var M, k, $, w, ye, ve, Ne, j, Y, Ce;
2577
+ class sr extends nr {
2517
2578
  constructor(a) {
2518
2579
  super();
2519
- b(this, g);
2520
- b(this, j);
2521
- b(this, O, /* @__PURE__ */ new Set());
2580
+ b(this, w);
2581
+ b(this, M);
2522
2582
  b(this, k, /* @__PURE__ */ new Set());
2523
- A(this, j, a);
2583
+ b(this, $, /* @__PURE__ */ new Set());
2584
+ L(this, M, a);
2524
2585
  }
2525
2586
  transformNodeImpl(a) {
2526
- if (!u(this, g, ye).call(this, a))
2587
+ if (!_(this, w, ye).call(this, a))
2527
2588
  return super.transformNodeImpl(a);
2528
- const r = u(this, g, Ne).call(this, a);
2589
+ const r = _(this, w, Ne).call(this, a);
2529
2590
  for (const s of r)
2530
- d(this, k).add(s);
2531
- const n = u(this, g, ve).call(this, a);
2591
+ d(this, $).add(s);
2592
+ const n = _(this, w, ve).call(this, a);
2532
2593
  for (const s of n)
2533
- d(this, O).add(s);
2594
+ d(this, k).add(s);
2534
2595
  const o = super.transformNodeImpl(a);
2535
2596
  for (const s of n)
2536
- d(this, O).delete(s);
2537
- for (const s of r)
2538
2597
  d(this, k).delete(s);
2598
+ for (const s of r)
2599
+ d(this, $).delete(s);
2539
2600
  return o;
2540
2601
  }
2541
2602
  transformSchemableIdentifier(a) {
2542
2603
  const r = super.transformSchemableIdentifier(a);
2543
- return r.schema || !d(this, O).has(a.identifier.name) ? r : {
2604
+ return r.schema || !d(this, k).has(a.identifier.name) ? r : {
2544
2605
  ...r,
2545
- schema: B.create(d(this, j))
2606
+ schema: B.create(d(this, M))
2546
2607
  };
2547
2608
  }
2548
2609
  transformReferences(a) {
2549
2610
  const r = super.transformReferences(a);
2550
2611
  return r.table.table.schema ? r : {
2551
2612
  ...r,
2552
- table: V.createWithSchema(d(this, j), r.table.table.identifier.name)
2613
+ table: V.createWithSchema(d(this, M), r.table.table.identifier.name)
2553
2614
  };
2554
2615
  }
2555
2616
  }
2556
- j = new WeakMap(), O = new WeakMap(), k = new WeakMap(), g = new WeakSet(), ye = function(a) {
2557
- return a.kind in sr;
2617
+ M = new WeakMap(), k = new WeakMap(), $ = new WeakMap(), w = new WeakSet(), ye = function(a) {
2618
+ return a.kind in or;
2558
2619
  }, ve = function(a) {
2559
2620
  const r = /* @__PURE__ */ new Set();
2560
- if ("name" in a && a.name && X.is(a.name) && u(this, g, Y).call(this, a.name, r), "from" in a && a.from)
2621
+ if ("name" in a && a.name && X.is(a.name) && _(this, w, Y).call(this, a.name, r), "from" in a && a.from)
2561
2622
  for (const n of a.from.froms)
2562
- u(this, g, $).call(this, n, r);
2563
- if ("into" in a && a.into && u(this, g, $).call(this, a.into, r), "table" in a && a.table && u(this, g, $).call(this, a.table, r), "joins" in a && a.joins)
2623
+ _(this, w, j).call(this, n, r);
2624
+ if ("into" in a && a.into && _(this, w, j).call(this, a.into, r), "table" in a && a.table && _(this, w, j).call(this, a.table, r), "joins" in a && a.joins)
2564
2625
  for (const n of a.joins)
2565
- u(this, g, $).call(this, n.table, r);
2566
- return "using" in a && a.using && u(this, g, $).call(this, a.using, r), r;
2626
+ _(this, w, j).call(this, n.table, r);
2627
+ return "using" in a && a.using && _(this, w, j).call(this, a.using, r), r;
2567
2628
  }, Ne = function(a) {
2568
2629
  const r = /* @__PURE__ */ new Set();
2569
- return "with" in a && a.with && u(this, g, Ce).call(this, a.with, r), r;
2570
- }, $ = function(a, r) {
2571
- const n = V.is(a) ? a : nr.is(a) && V.is(a.node) ? a.node : null;
2572
- n && u(this, g, Y).call(this, n.table, r);
2630
+ return "with" in a && a.with && _(this, w, Ce).call(this, a.with, r), r;
2631
+ }, j = function(a, r) {
2632
+ const n = V.is(a) ? a : rr.is(a) && V.is(a.node) ? a.node : null;
2633
+ n && _(this, w, Y).call(this, n.table, r);
2573
2634
  }, Y = function(a, r) {
2574
2635
  const n = a.identifier.name;
2575
- !d(this, O).has(n) && !d(this, k).has(n) && r.add(n);
2636
+ !d(this, k).has(n) && !d(this, $).has(n) && r.add(n);
2576
2637
  }, Ce = function(a, r) {
2577
2638
  for (const n of a.expressions) {
2578
2639
  const o = n.name.table.table.identifier.name;
2579
- d(this, k).has(o) || r.add(o);
2640
+ d(this, $).has(o) || r.add(o);
2580
2641
  }
2581
2642
  };
2582
- var J;
2583
- class lr {
2643
+ var K;
2644
+ class ir {
2584
2645
  constructor(e) {
2585
- b(this, J);
2586
- A(this, J, new ir(e));
2646
+ b(this, K);
2647
+ L(this, K, new sr(e));
2587
2648
  }
2588
2649
  transformQuery(e) {
2589
- return d(this, J).transformNode(e.node);
2650
+ return d(this, K).transformNode(e.node);
2590
2651
  }
2591
2652
  async transformResult(e) {
2592
2653
  return e.result;
2593
2654
  }
2594
2655
  }
2595
- J = new WeakMap();
2596
- class cr {
2656
+ K = new WeakMap();
2657
+ class lr {
2597
2658
  transformQuery(e) {
2598
2659
  return e.node;
2599
2660
  }
@@ -2601,13 +2662,13 @@ class cr {
2601
2662
  return e.result;
2602
2663
  }
2603
2664
  }
2604
- const dr = "kysely_migration", fe = "kysely_migration_lock", ur = !1, W = "migration_lock", mr = w({ __noMigrations__: !0 });
2605
- var h, l, z, x, T, D, xe, S, Te, Se, Oe, ke, $e, Z, I, ee, De, Ie, je, te, Pe, Fe, Me, Ae, ze, L;
2665
+ const cr = "kysely_migration", fe = "kysely_migration_lock", dr = !1, W = "migration_lock", ur = y({ __noMigrations__: !0 });
2666
+ var f, l, J, x, T, P, xe, S, Te, Se, Oe, ke, $e, Z, F, ee, De, Ie, je, te, Pe, Fe, Me, Ae, ze, E;
2606
2667
  class be {
2607
2668
  constructor(e) {
2608
2669
  b(this, l);
2609
- b(this, h);
2610
- A(this, h, w(e));
2670
+ b(this, f);
2671
+ L(this, f, y(e));
2611
2672
  }
2612
2673
  /**
2613
2674
  * Returns a {@link MigrationInfo} object for each migration.
@@ -2615,8 +2676,8 @@ class be {
2615
2676
  * The returned array is sorted by migration name.
2616
2677
  */
2617
2678
  async getMigrations() {
2618
- const e = await u(this, l, I).call(this, d(this, l, T)) ? await d(this, h).db.withPlugin(d(this, l, S)).selectFrom(d(this, l, T)).select(["name", "timestamp"]).execute() : [];
2619
- return (await u(this, l, te).call(this)).map(({ name: r, ...n }) => {
2679
+ const e = await _(this, l, F).call(this, d(this, l, T)) ? await d(this, f).db.withPlugin(d(this, l, S)).selectFrom(d(this, l, T)).select(["name", "timestamp"]).execute() : [];
2680
+ return (await _(this, l, te).call(this)).map(({ name: r, ...n }) => {
2620
2681
  const o = e.find((s) => s.name === r);
2621
2682
  return {
2622
2683
  name: r,
@@ -2673,7 +2734,7 @@ class be {
2673
2734
  * ```
2674
2735
  */
2675
2736
  async migrateToLatest() {
2676
- return u(this, l, z).call(this, () => ({ direction: "Up", step: 1 / 0 }));
2737
+ return _(this, l, J).call(this, () => ({ direction: "Up", step: 1 / 0 }));
2677
2738
  }
2678
2739
  /**
2679
2740
  * Migrate up/down to a specific migration.
@@ -2699,8 +2760,8 @@ class be {
2699
2760
  * ```
2700
2761
  */
2701
2762
  async migrateTo(e) {
2702
- return u(this, l, z).call(this, ({ migrations: a, executedMigrations: r, pendingMigrations: n }) => {
2703
- if (e === mr)
2763
+ return _(this, l, J).call(this, ({ migrations: a, executedMigrations: r, pendingMigrations: n }) => {
2764
+ if (e === ur)
2704
2765
  return { direction: "Down", step: 1 / 0 };
2705
2766
  if (!a.find((c) => c.name === e))
2706
2767
  throw new Error(`migration "${e}" doesn't exist`);
@@ -2730,7 +2791,7 @@ class be {
2730
2791
  * ```
2731
2792
  */
2732
2793
  async migrateUp() {
2733
- return u(this, l, z).call(this, () => ({ direction: "Up", step: 1 }));
2794
+ return _(this, l, J).call(this, () => ({ direction: "Up", step: 1 }));
2734
2795
  }
2735
2796
  /**
2736
2797
  * Migrate one step down.
@@ -2747,100 +2808,100 @@ class be {
2747
2808
  * ```
2748
2809
  */
2749
2810
  async migrateDown() {
2750
- return u(this, l, z).call(this, () => ({ direction: "Down", step: 1 }));
2811
+ return _(this, l, J).call(this, () => ({ direction: "Down", step: 1 }));
2751
2812
  }
2752
2813
  }
2753
- h = new WeakMap(), l = new WeakSet(), z = async function(e) {
2814
+ f = new WeakMap(), l = new WeakSet(), J = async function(e) {
2754
2815
  try {
2755
- return await u(this, l, Te).call(this), await u(this, l, De).call(this, e);
2816
+ return await _(this, l, Te).call(this), await _(this, l, De).call(this, e);
2756
2817
  } catch (a) {
2757
2818
  return a instanceof G ? a.resultSet : { error: a };
2758
2819
  }
2759
2820
  }, x = function() {
2760
- return d(this, h).migrationTableSchema;
2821
+ return d(this, f).migrationTableSchema;
2761
2822
  }, T = function() {
2762
- return d(this, h).migrationTableName ?? dr;
2763
- }, D = function() {
2764
- return d(this, h).migrationLockTableName ?? fe;
2823
+ return d(this, f).migrationTableName ?? cr;
2824
+ }, P = function() {
2825
+ return d(this, f).migrationLockTableName ?? fe;
2765
2826
  }, xe = function() {
2766
- return d(this, h).allowUnorderedMigrations ?? ur;
2827
+ return d(this, f).allowUnorderedMigrations ?? dr;
2767
2828
  }, S = function() {
2768
- return d(this, l, x) ? new lr(d(this, l, x)) : new cr();
2829
+ return d(this, l, x) ? new ir(d(this, l, x)) : new lr();
2769
2830
  }, Te = async function() {
2770
- await u(this, l, Se).call(this), await u(this, l, Oe).call(this), await u(this, l, ke).call(this), await u(this, l, $e).call(this);
2831
+ await _(this, l, Se).call(this), await _(this, l, Oe).call(this), await _(this, l, ke).call(this), await _(this, l, $e).call(this);
2771
2832
  }, Se = async function() {
2772
- if (d(this, l, x) && !await u(this, l, Z).call(this))
2833
+ if (d(this, l, x) && !await _(this, l, Z).call(this))
2773
2834
  try {
2774
- await u(this, l, L).call(this, d(this, h).db.schema.createSchema(d(this, l, x)));
2835
+ await _(this, l, E).call(this, d(this, f).db.schema.createSchema(d(this, l, x)));
2775
2836
  } catch (e) {
2776
- if (!await u(this, l, Z).call(this))
2837
+ if (!await _(this, l, Z).call(this))
2777
2838
  throw e;
2778
2839
  }
2779
2840
  }, Oe = async function() {
2780
- if (!await u(this, l, I).call(this, d(this, l, T)))
2841
+ if (!await _(this, l, F).call(this, d(this, l, T)))
2781
2842
  try {
2782
- d(this, l, x) && await u(this, l, L).call(this, d(this, h).db.schema.createSchema(d(this, l, x))), await u(this, l, L).call(this, d(this, h).db.schema.withPlugin(d(this, l, S)).createTable(d(this, l, T)).addColumn("name", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("timestamp", "varchar(255)", (e) => e.notNull()));
2843
+ d(this, l, x) && await _(this, l, E).call(this, d(this, f).db.schema.createSchema(d(this, l, x))), await _(this, l, E).call(this, d(this, f).db.schema.withPlugin(d(this, l, S)).createTable(d(this, l, T)).addColumn("name", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("timestamp", "varchar(255)", (e) => e.notNull()));
2783
2844
  } catch (e) {
2784
- if (!await u(this, l, I).call(this, d(this, l, T)))
2845
+ if (!await _(this, l, F).call(this, d(this, l, T)))
2785
2846
  throw e;
2786
2847
  }
2787
2848
  }, ke = async function() {
2788
- if (!await u(this, l, I).call(this, d(this, l, D)))
2849
+ if (!await _(this, l, F).call(this, d(this, l, P)))
2789
2850
  try {
2790
- await u(this, l, L).call(this, d(this, h).db.schema.withPlugin(d(this, l, S)).createTable(d(this, l, D)).addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("is_locked", "integer", (e) => e.notNull().defaultTo(0)));
2851
+ await _(this, l, E).call(this, d(this, f).db.schema.withPlugin(d(this, l, S)).createTable(d(this, l, P)).addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("is_locked", "integer", (e) => e.notNull().defaultTo(0)));
2791
2852
  } catch (e) {
2792
- if (!await u(this, l, I).call(this, d(this, l, D)))
2853
+ if (!await _(this, l, F).call(this, d(this, l, P)))
2793
2854
  throw e;
2794
2855
  }
2795
2856
  }, $e = async function() {
2796
- if (!await u(this, l, ee).call(this))
2857
+ if (!await _(this, l, ee).call(this))
2797
2858
  try {
2798
- await d(this, h).db.withPlugin(d(this, l, S)).insertInto(d(this, l, D)).values({ id: W, is_locked: 0 }).execute();
2859
+ await d(this, f).db.withPlugin(d(this, l, S)).insertInto(d(this, l, P)).values({ id: W, is_locked: 0 }).execute();
2799
2860
  } catch (e) {
2800
- if (!await u(this, l, ee).call(this))
2861
+ if (!await _(this, l, ee).call(this))
2801
2862
  throw e;
2802
2863
  }
2803
2864
  }, Z = async function() {
2804
- return (await d(this, h).db.introspection.getSchemas()).some((a) => a.name === d(this, l, x));
2805
- }, I = async function(e) {
2865
+ return (await d(this, f).db.introspection.getSchemas()).some((a) => a.name === d(this, l, x));
2866
+ }, F = async function(e) {
2806
2867
  const a = d(this, l, x);
2807
- return (await d(this, h).db.introspection.getTables({
2868
+ return (await d(this, f).db.introspection.getTables({
2808
2869
  withInternalKyselyTables: !0
2809
2870
  })).some((n) => n.name === e && (!a || n.schema === a));
2810
2871
  }, ee = async function() {
2811
- return !!await d(this, h).db.withPlugin(d(this, l, S)).selectFrom(d(this, l, D)).where("id", "=", W).select("id").executeTakeFirst();
2872
+ return !!await d(this, f).db.withPlugin(d(this, l, S)).selectFrom(d(this, l, P)).where("id", "=", W).select("id").executeTakeFirst();
2812
2873
  }, De = async function(e) {
2813
- const a = d(this, h).db.getExecutor().adapter, r = w({
2814
- lockTable: d(this, h).migrationLockTableName ?? fe,
2874
+ const a = d(this, f).db.getExecutor().adapter, r = y({
2875
+ lockTable: d(this, f).migrationLockTableName ?? fe,
2815
2876
  lockRowId: W,
2816
- lockTableSchema: d(this, h).migrationTableSchema
2877
+ lockTableSchema: d(this, f).migrationTableSchema
2817
2878
  }), n = async (o) => {
2818
2879
  try {
2819
2880
  await a.acquireMigrationLock(o, r);
2820
- const s = await u(this, l, Ie).call(this, o);
2881
+ const s = await _(this, l, Ie).call(this, o);
2821
2882
  if (s.migrations.length === 0)
2822
2883
  return { results: [] };
2823
2884
  const { direction: c, step: i } = e(s);
2824
- return i <= 0 ? { results: [] } : c === "Down" ? await u(this, l, Ae).call(this, o, s, i) : c === "Up" ? await u(this, l, ze).call(this, o, s, i) : { results: [] };
2885
+ return i <= 0 ? { results: [] } : c === "Down" ? await _(this, l, Ae).call(this, o, s, i) : c === "Up" ? await _(this, l, ze).call(this, o, s, i) : { results: [] };
2825
2886
  } finally {
2826
2887
  await a.releaseMigrationLock(o, r);
2827
2888
  }
2828
2889
  };
2829
- return a.supportsTransactionalDdl ? d(this, h).db.transaction().execute(n) : d(this, h).db.connection().execute(n);
2890
+ return a.supportsTransactionalDdl ? d(this, f).db.transaction().execute(n) : d(this, f).db.connection().execute(n);
2830
2891
  }, Ie = async function(e) {
2831
- const a = await u(this, l, te).call(this), r = await u(this, l, Pe).call(this, e);
2832
- u(this, l, Fe).call(this, a, r), d(this, l, xe) || u(this, l, Me).call(this, a, r);
2833
- const n = u(this, l, je).call(this, a, r);
2834
- return w({
2892
+ const a = await _(this, l, te).call(this), r = await _(this, l, Pe).call(this, e);
2893
+ _(this, l, Fe).call(this, a, r), d(this, l, xe) || _(this, l, Me).call(this, a, r);
2894
+ const n = _(this, l, je).call(this, a, r);
2895
+ return y({
2835
2896
  migrations: a,
2836
2897
  executedMigrations: r,
2837
- lastMigration: rr(r),
2898
+ lastMigration: ar(r),
2838
2899
  pendingMigrations: n
2839
2900
  });
2840
2901
  }, je = function(e, a) {
2841
2902
  return e.filter((r) => !a.includes(r.name));
2842
2903
  }, te = async function() {
2843
- const e = await d(this, h).provider.getMigrations();
2904
+ const e = await d(this, f).provider.getMigrations();
2844
2905
  return Object.keys(e).sort().map((a) => ({
2845
2906
  ...e[a],
2846
2907
  name: a
@@ -2910,31 +2971,31 @@ h = new WeakMap(), l = new WeakSet(), z = async function(e) {
2910
2971
  }
2911
2972
  }
2912
2973
  return { results: o };
2913
- }, L = async function(e) {
2914
- d(this, h).db.getExecutor().adapter.supportsCreateIfNotExists && (e = e.ifNotExists()), await e.execute();
2974
+ }, E = async function(e) {
2975
+ d(this, f).db.getExecutor().adapter.supportsCreateIfNotExists && (e = e.ifNotExists()), await e.execute();
2915
2976
  };
2916
- var E;
2977
+ var R;
2917
2978
  class G extends Error {
2918
2979
  constructor(a) {
2919
2980
  super();
2920
- b(this, E);
2921
- A(this, E, a);
2981
+ b(this, R);
2982
+ L(this, R, a);
2922
2983
  }
2923
2984
  get resultSet() {
2924
- return d(this, E);
2985
+ return d(this, R);
2925
2986
  }
2926
2987
  }
2927
- E = new WeakMap();
2988
+ R = new WeakMap();
2928
2989
  class Le {
2929
2990
  constructor(e) {
2930
- M(this, "migrations");
2991
+ z(this, "migrations");
2931
2992
  this.migrations = e;
2932
2993
  }
2933
2994
  async getMigrations() {
2934
2995
  return this.migrations;
2935
2996
  }
2936
2997
  }
2937
- async function _r(t) {
2998
+ async function mr(t) {
2938
2999
  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(
2939
3000
  "tenant_id",
2940
3001
  "varchar(255)",
@@ -3006,35 +3067,35 @@ async function _r(t) {
3006
3067
  (e) => e.references("tenants.id").onDelete("cascade").notNull()
3007
3068
  ).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();
3008
3069
  }
3009
- async function hr(t) {
3070
+ async function _r(t) {
3010
3071
  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();
3011
3072
  }
3012
- const fr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3073
+ const hr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3013
3074
  __proto__: null,
3014
- down: hr,
3015
- up: _r
3075
+ down: _r,
3076
+ up: mr
3016
3077
  }, Symbol.toStringTag, { value: "Module" }));
3017
- async function pr(t) {
3078
+ async function fr(t) {
3018
3079
  await t.schema.alterTable("tenants").addColumn("support_url", "varchar(255)").execute();
3019
3080
  }
3020
- async function gr(t) {
3081
+ async function pr(t) {
3021
3082
  await t.schema.alterTable("tenants").dropColumn("support_url").execute();
3022
3083
  }
3023
- const wr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3084
+ const gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3024
3085
  __proto__: null,
3025
- down: gr,
3026
- up: pr
3086
+ down: pr,
3087
+ up: fr
3027
3088
  }, Symbol.toStringTag, { value: "Module" }));
3028
- async function yr(t) {
3089
+ async function wr(t) {
3029
3090
  }
3030
- async function vr(t) {
3091
+ async function yr(t) {
3031
3092
  }
3032
- const Nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3093
+ const vr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3033
3094
  __proto__: null,
3034
- down: vr,
3035
- up: yr
3095
+ down: yr,
3096
+ up: wr
3036
3097
  }, Symbol.toStringTag, { value: "Module" }));
3037
- async function Cr(t) {
3098
+ async function Nr(t) {
3038
3099
  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(
3039
3100
  "tenant_id_constraint",
3040
3101
  ["tenant_id"],
@@ -3043,24 +3104,24 @@ async function Cr(t) {
3043
3104
  (e) => e.onDelete("cascade")
3044
3105
  ).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();
3045
3106
  }
3046
- async function br(t) {
3107
+ async function Cr(t) {
3047
3108
  await t.schema.dropTable("logs").execute();
3048
3109
  }
3049
- const xr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3110
+ const br = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3050
3111
  __proto__: null,
3051
- down: br,
3052
- up: Cr
3112
+ down: Cr,
3113
+ up: Nr
3053
3114
  }, Symbol.toStringTag, { value: "Module" }));
3054
- async function Tr(t) {
3115
+ async function xr(t) {
3055
3116
  }
3056
- async function Sr(t) {
3117
+ async function Tr(t) {
3057
3118
  }
3058
- const Or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3119
+ const Sr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3059
3120
  __proto__: null,
3060
- down: Sr,
3061
- up: Tr
3121
+ down: Tr,
3122
+ up: xr
3062
3123
  }, Symbol.toStringTag, { value: "Module" }));
3063
- async function kr(t) {
3124
+ async function Or(t) {
3064
3125
  await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
3065
3126
  "user_id_constraint",
3066
3127
  ["user_id", "tenant_id"],
@@ -3085,15 +3146,15 @@ async function kr(t) {
3085
3146
  (e) => e.references("applications.id").onDelete("cascade").notNull()
3086
3147
  ).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();
3087
3148
  }
3088
- async function $r(t) {
3149
+ async function kr(t) {
3089
3150
  await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("tickets").execute(), await t.schema.dropTable("otps").execute();
3090
3151
  }
3091
- const Dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3152
+ const $r = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3092
3153
  __proto__: null,
3093
- down: $r,
3094
- up: kr
3154
+ down: kr,
3155
+ up: Or
3095
3156
  }, Symbol.toStringTag, { value: "Module" }));
3096
- async function Ir(t) {
3157
+ async function Dr(t) {
3097
3158
  await t.schema.createTable("passwords").addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addPrimaryKeyConstraint("passwords_pkey", ["user_id", "tenant_id"]).addForeignKeyConstraint(
3098
3159
  "user_id_constraint",
3099
3160
  ["user_id", "tenant_id"],
@@ -3108,24 +3169,24 @@ async function Ir(t) {
3108
3169
  (e) => e.onDelete("cascade")
3109
3170
  ).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();
3110
3171
  }
3111
- async function jr(t) {
3172
+ async function Ir(t) {
3112
3173
  await t.schema.dropTable("passwords").execute(), await t.schema.dropTable("codes").execute();
3113
3174
  }
3114
- const Pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3175
+ const jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3115
3176
  __proto__: null,
3116
- down: jr,
3117
- up: Ir
3177
+ down: Ir,
3178
+ up: Dr
3118
3179
  }, Symbol.toStringTag, { value: "Module" }));
3119
- async function Fr(t) {
3180
+ async function Pr(t) {
3120
3181
  }
3121
- async function Mr(t) {
3182
+ async function Fr(t) {
3122
3183
  }
3123
- const Ar = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3184
+ const Mr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3124
3185
  __proto__: null,
3125
- down: Mr,
3126
- up: Fr
3186
+ down: Fr,
3187
+ up: Pr
3127
3188
  }, Symbol.toStringTag, { value: "Module" }));
3128
- async function zr(t) {
3189
+ async function Ar(t) {
3129
3190
  await t.schema.alterTable("passwords").addColumn(
3130
3191
  "password",
3131
3192
  "varchar(255)",
@@ -3133,288 +3194,288 @@ async function zr(t) {
3133
3194
  (e) => e.notNull()
3134
3195
  ).execute();
3135
3196
  }
3136
- async function Lr(t) {
3197
+ async function zr(t) {
3137
3198
  await t.schema.alterTable("passwords").dropColumn("password").execute();
3138
3199
  }
3139
- const Jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3200
+ const Lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3140
3201
  __proto__: null,
3141
- down: Lr,
3142
- up: zr
3202
+ down: zr,
3203
+ up: Ar
3143
3204
  }, Symbol.toStringTag, { value: "Module" }));
3144
- async function Er(t) {
3205
+ async function Jr(t) {
3145
3206
  }
3146
- async function Kr(t) {
3207
+ async function Er(t) {
3147
3208
  }
3148
- const Rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3209
+ const Kr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3149
3210
  __proto__: null,
3150
- down: Kr,
3151
- up: Er
3211
+ down: Er,
3212
+ up: Jr
3152
3213
  }, Symbol.toStringTag, { value: "Module" }));
3153
- async function Br(t) {
3214
+ async function Rr(t) {
3154
3215
  }
3155
- async function Ur(t) {
3216
+ async function Br(t) {
3156
3217
  }
3157
- const Qr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3218
+ const Ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3158
3219
  __proto__: null,
3159
- down: Ur,
3160
- up: Br
3220
+ down: Br,
3221
+ up: Rr
3161
3222
  }, Symbol.toStringTag, { value: "Module" }));
3162
3223
  async function qr(t) {
3163
3224
  }
3164
- async function Vr(t) {
3225
+ async function Qr(t) {
3165
3226
  }
3166
- const Wr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3227
+ const Vr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3167
3228
  __proto__: null,
3168
- down: Vr,
3229
+ down: Qr,
3169
3230
  up: qr
3170
3231
  }, Symbol.toStringTag, { value: "Module" }));
3171
- async function Gr(t) {
3232
+ async function Wr(t) {
3172
3233
  await t.schema.createIndex("users_email_index").on("users").column("email").execute();
3173
3234
  }
3174
- async function Hr(t) {
3235
+ async function Gr(t) {
3175
3236
  await t.schema.dropIndex("users_email_index").execute();
3176
3237
  }
3177
- const Xr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3238
+ const Hr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3178
3239
  __proto__: null,
3179
- down: Hr,
3180
- up: Gr
3240
+ down: Gr,
3241
+ up: Wr
3181
3242
  }, Symbol.toStringTag, { value: "Module" }));
3182
- async function Yr(t) {
3243
+ async function Xr(t) {
3183
3244
  await t.schema.alterTable("users").addColumn("profileData", "varchar(2048)").execute();
3184
3245
  }
3185
- async function Zr(t) {
3246
+ async function Yr(t) {
3186
3247
  await t.schema.alterTable("users").dropColumn("profileData").execute();
3187
3248
  }
3188
- const en = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3249
+ const Zr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3189
3250
  __proto__: null,
3190
- down: Zr,
3191
- up: Yr
3251
+ down: Yr,
3252
+ up: Xr
3192
3253
  }, Symbol.toStringTag, { value: "Module" }));
3193
- async function tn(t) {
3254
+ async function en(t) {
3194
3255
  await t.schema.createIndex("users_linked_to_index").on("users").column("linked_to").execute();
3195
3256
  }
3196
- async function an(t) {
3257
+ async function tn(t) {
3197
3258
  await t.schema.dropIndex("users_linked_to_index");
3198
3259
  }
3199
- const rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3260
+ const an = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3200
3261
  __proto__: null,
3201
- down: an,
3202
- up: tn
3262
+ down: tn,
3263
+ up: en
3203
3264
  }, Symbol.toStringTag, { value: "Module" }));
3204
- async function nn(t) {
3265
+ async function rn(t) {
3205
3266
  await t.schema.alterTable("users").addColumn("locale", "varchar(255)").execute();
3206
3267
  }
3207
- async function on(t) {
3268
+ async function nn(t) {
3208
3269
  await t.schema.alterTable("users").dropColumn("locale").execute();
3209
3270
  }
3210
- const sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3271
+ const on = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3211
3272
  __proto__: null,
3212
- down: on,
3213
- up: nn
3273
+ down: nn,
3274
+ up: rn
3214
3275
  }, Symbol.toStringTag, { value: "Module" }));
3215
- async function ln(t) {
3276
+ async function sn(t) {
3216
3277
  await t.schema.createTable("keys").addColumn("kid", "varchar(255)", (e) => e.primaryKey()).addColumn(
3217
3278
  "tenant_id",
3218
3279
  "varchar(255)",
3219
3280
  (e) => e.references("tenants.id").onDelete("cascade")
3220
3281
  ).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();
3221
3282
  }
3222
- async function cn(t) {
3283
+ async function ln(t) {
3223
3284
  await t.schema.dropTable("keys").execute();
3224
3285
  }
3225
- const dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3286
+ const cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3226
3287
  __proto__: null,
3227
- down: cn,
3228
- up: ln
3288
+ down: ln,
3289
+ up: sn
3229
3290
  }, Symbol.toStringTag, { value: "Module" }));
3230
- async function un(t) {
3291
+ async function dn(t) {
3231
3292
  }
3232
- async function mn(t) {
3293
+ async function un(t) {
3233
3294
  }
3234
- const _n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3295
+ const mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3235
3296
  __proto__: null,
3236
- down: mn,
3237
- up: un
3297
+ down: un,
3298
+ up: dn
3238
3299
  }, Symbol.toStringTag, { value: "Module" }));
3239
- async function hn(t) {
3300
+ async function _n(t) {
3240
3301
  }
3241
- async function fn(t) {
3302
+ async function hn(t) {
3242
3303
  }
3243
- const pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3304
+ const fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3244
3305
  __proto__: null,
3245
- down: fn,
3246
- up: hn
3306
+ down: hn,
3307
+ up: _n
3247
3308
  }, Symbol.toStringTag, { value: "Module" }));
3248
- async function gn(t) {
3309
+ async function pn(t) {
3249
3310
  await t.schema.alterTable("otps").addColumn("audience", "varchar(255)").execute();
3250
3311
  }
3251
- async function wn(t) {
3312
+ async function gn(t) {
3252
3313
  await t.schema.alterTable("otps").dropColumn("audience").execute();
3253
3314
  }
3254
- const yn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3315
+ const wn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3255
3316
  __proto__: null,
3256
- down: wn,
3257
- up: gn
3317
+ down: gn,
3318
+ up: pn
3258
3319
  }, Symbol.toStringTag, { value: "Module" }));
3259
- async function vn(t) {
3320
+ async function yn(t) {
3260
3321
  }
3261
- async function Nn(t) {
3322
+ async function vn(t) {
3262
3323
  }
3263
- const Cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3324
+ const Nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3264
3325
  __proto__: null,
3265
- down: Nn,
3266
- up: vn
3326
+ down: vn,
3327
+ up: yn
3267
3328
  }, Symbol.toStringTag, { value: "Module" }));
3268
- async function bn(t) {
3329
+ async function Cn(t) {
3269
3330
  await t.schema.alterTable("logs").dropColumn("category").execute();
3270
3331
  }
3271
- async function xn(t) {
3332
+ async function bn(t) {
3272
3333
  await t.schema.alterTable("logs").addColumn("category", "varchar(255)", (e) => e.notNull()).execute();
3273
3334
  }
3274
- const Tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3335
+ const xn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3275
3336
  __proto__: null,
3276
- down: xn,
3277
- up: bn
3337
+ down: bn,
3338
+ up: Cn
3278
3339
  }, Symbol.toStringTag, { value: "Module" }));
3279
- async function Sn(t) {
3340
+ async function Tn(t) {
3280
3341
  await t.schema.alterTable("users").dropColumn("tags").execute();
3281
3342
  }
3282
- async function On(t) {
3343
+ async function Sn(t) {
3283
3344
  await t.schema.alterTable("users").addColumn("tags", "varchar(255)").execute();
3284
3345
  }
3285
- const kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3346
+ const On = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3286
3347
  __proto__: null,
3287
- down: On,
3288
- up: Sn
3348
+ down: Sn,
3349
+ up: Tn
3289
3350
  }, Symbol.toStringTag, { value: "Module" }));
3290
- async function $n(t) {
3351
+ async function kn(t) {
3291
3352
  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();
3292
3353
  }
3293
- async function Dn(t) {
3354
+ async function $n(t) {
3294
3355
  await t.schema.dropIndex("logs_user_id"), await t.schema.dropIndex("logs_tenant_id"), await t.schema.dropIndex("logs_date");
3295
3356
  }
3296
- const In = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3357
+ const Dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3297
3358
  __proto__: null,
3298
- down: Dn,
3299
- up: $n
3359
+ down: $n,
3360
+ up: kn
3300
3361
  }, Symbol.toStringTag, { value: "Module" }));
3301
- async function jn(t) {
3362
+ async function In(t) {
3302
3363
  await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(8192)").execute();
3303
3364
  }
3304
- async function Pn(t) {
3365
+ async function jn(t) {
3305
3366
  await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(2048)").execute();
3306
3367
  }
3307
- const Fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3368
+ const Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3308
3369
  __proto__: null,
3309
- down: Pn,
3310
- up: jn
3370
+ down: jn,
3371
+ up: In
3311
3372
  }, Symbol.toStringTag, { value: "Module" }));
3312
- async function Mn(t) {
3373
+ async function Fn(t) {
3313
3374
  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();
3314
3375
  }
3315
- async function An(t) {
3376
+ async function Mn(t) {
3316
3377
  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();
3317
3378
  }
3318
- const zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3379
+ const An = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3319
3380
  __proto__: null,
3320
- down: An,
3321
- up: Mn
3381
+ down: Mn,
3382
+ up: Fn
3322
3383
  }, Symbol.toStringTag, { value: "Module" }));
3323
- async function Ln(t) {
3384
+ async function zn(t) {
3324
3385
  await t.schema.createIndex("users_name_index").on("users").column("name").execute();
3325
3386
  }
3326
- async function Jn(t) {
3387
+ async function Ln(t) {
3327
3388
  await t.schema.dropIndex("users_name_index").execute();
3328
3389
  }
3329
- const En = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3390
+ const Jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3330
3391
  __proto__: null,
3331
- down: Jn,
3332
- up: Ln
3392
+ down: Ln,
3393
+ up: zn
3333
3394
  }, Symbol.toStringTag, { value: "Module" }));
3334
- async function Kn(t) {
3395
+ async function En(t) {
3335
3396
  }
3336
- async function Rn(t) {
3397
+ async function Kn(t) {
3337
3398
  await t.schema.alterTable("users").dropConstraint("unique_email_provider").execute();
3338
3399
  }
3339
- const Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3400
+ const Rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3340
3401
  __proto__: null,
3341
- down: Rn,
3342
- up: Kn
3402
+ down: Kn,
3403
+ up: En
3343
3404
  }, Symbol.toStringTag, { value: "Module" }));
3344
- async function Un(t) {
3405
+ async function Bn(t) {
3345
3406
  await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(8192)").execute();
3346
3407
  }
3347
- async function Qn(t) {
3408
+ async function Un(t) {
3348
3409
  await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(1024)").execute();
3349
3410
  }
3350
3411
  const qn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3351
3412
  __proto__: null,
3352
- down: Qn,
3353
- up: Un
3413
+ down: Un,
3414
+ up: Bn
3354
3415
  }, Symbol.toStringTag, { value: "Module" }));
3355
- async function Vn(t) {
3416
+ async function Qn(t) {
3356
3417
  await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(8192)").execute();
3357
3418
  }
3358
- async function Wn(t) {
3419
+ async function Vn(t) {
3359
3420
  await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(1024)").execute();
3360
3421
  }
3361
- const Gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3422
+ const Wn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3362
3423
  __proto__: null,
3363
- down: Wn,
3364
- up: Vn
3424
+ down: Vn,
3425
+ up: Qn
3365
3426
  }, Symbol.toStringTag, { value: "Module" }));
3366
- async function Hn(t) {
3427
+ async function Gn(t) {
3367
3428
  await t.schema.createTable("branding").addColumn(
3368
3429
  "tenant_id",
3369
3430
  "varchar(255)",
3370
3431
  (e) => e.references("tenants.id").onDelete("cascade").notNull().primaryKey()
3371
3432
  ).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();
3372
3433
  }
3373
- async function Xn(t) {
3434
+ async function Hn(t) {
3374
3435
  await t.schema.dropTable("branding").execute();
3375
3436
  }
3376
- const Yn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3437
+ const Xn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3377
3438
  __proto__: null,
3378
- down: Xn,
3379
- up: Hn
3439
+ down: Hn,
3440
+ up: Gn
3380
3441
  }, Symbol.toStringTag, { value: "Module" }));
3381
- async function Zn(t) {
3442
+ async function Yn(t) {
3382
3443
  }
3383
- async function eo(t) {
3444
+ async function Zn(t) {
3384
3445
  }
3385
- const to = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3446
+ const eo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3386
3447
  __proto__: null,
3387
- down: eo,
3388
- up: Zn
3448
+ down: Zn,
3449
+ up: Yn
3389
3450
  }, Symbol.toStringTag, { value: "Module" }));
3390
- async function ao(t) {
3451
+ async function to(t) {
3391
3452
  }
3392
- async function ro(t) {
3453
+ async function ao(t) {
3393
3454
  }
3394
- const no = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3455
+ const ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3395
3456
  __proto__: null,
3396
- down: ro,
3397
- up: ao
3457
+ down: ao,
3458
+ up: to
3398
3459
  }, Symbol.toStringTag, { value: "Module" }));
3399
- async function oo(t) {
3460
+ async function no(t) {
3400
3461
  }
3401
- async function so(t) {
3462
+ async function oo(t) {
3402
3463
  }
3403
- const io = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3464
+ const so = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3404
3465
  __proto__: null,
3405
- down: so,
3406
- up: oo
3466
+ down: oo,
3467
+ up: no
3407
3468
  }, Symbol.toStringTag, { value: "Module" }));
3408
- async function lo(t) {
3469
+ async function io(t) {
3409
3470
  }
3410
- async function co(t) {
3471
+ async function lo(t) {
3411
3472
  }
3412
- const uo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3473
+ const co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3413
3474
  __proto__: null,
3414
- down: co,
3415
- up: lo
3475
+ down: lo,
3476
+ up: io
3416
3477
  }, Symbol.toStringTag, { value: "Module" }));
3417
- async function mo(t) {
3478
+ async function uo(t) {
3418
3479
  await t.schema.createTable("authentication_codes").addColumn(
3419
3480
  "tenant_id",
3420
3481
  "varchar(255)",
@@ -3425,55 +3486,55 @@ async function mo(t) {
3425
3486
  (e) => e.references("applications.id").onDelete("cascade").notNull()
3426
3487
  ).addColumn("user_id", "varchar(255)", (e) => e.notNull()).addColumn("nonce", "varchar(255)").addColumn("state", "varchar(8192)").addColumn("scope", "varchar(1024)").addColumn("response_type", "varchar(256)").addColumn("response_mode", "varchar(256)").addColumn("redirect_uri", "varchar(1024)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute();
3427
3488
  }
3428
- async function _o(t) {
3489
+ async function mo(t) {
3429
3490
  await t.schema.dropTable("authentication_codes").execute();
3430
3491
  }
3431
- const ho = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3492
+ const _o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3432
3493
  __proto__: null,
3433
- down: _o,
3434
- up: mo
3494
+ down: mo,
3495
+ up: uo
3435
3496
  }, Symbol.toStringTag, { value: "Module" }));
3436
- async function fo(t) {
3497
+ async function ho(t) {
3437
3498
  }
3438
- async function po(t) {
3499
+ async function fo(t) {
3439
3500
  }
3440
- const go = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3501
+ const po = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3441
3502
  __proto__: null,
3442
- down: po,
3443
- up: fo
3503
+ down: fo,
3504
+ up: ho
3444
3505
  }, Symbol.toStringTag, { value: "Module" }));
3445
- async function wo(t) {
3506
+ async function go(t) {
3446
3507
  await t.schema.alterTable("otps").addColumn("ip", "varchar(64)").execute();
3447
3508
  }
3448
- async function yo(t) {
3509
+ async function wo(t) {
3449
3510
  await t.schema.alterTable("otps").dropColumn("ip").execute();
3450
3511
  }
3451
- const vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3512
+ const yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3452
3513
  __proto__: null,
3453
- down: yo,
3454
- up: wo
3514
+ down: wo,
3515
+ up: go
3455
3516
  }, Symbol.toStringTag, { value: "Module" }));
3456
- async function No(t) {
3517
+ async function vo(t) {
3457
3518
  await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(1024)").execute();
3458
3519
  }
3459
- async function Co(t) {
3520
+ async function No(t) {
3460
3521
  await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(255)").execute();
3461
3522
  }
3462
- const bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3523
+ const Co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3463
3524
  __proto__: null,
3464
- down: Co,
3465
- up: No
3525
+ down: No,
3526
+ up: vo
3466
3527
  }, Symbol.toStringTag, { value: "Module" }));
3467
- async function xo(t) {
3528
+ async function bo(t) {
3468
3529
  }
3469
- async function To(t) {
3530
+ async function xo(t) {
3470
3531
  }
3471
- const So = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3532
+ const To = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3472
3533
  __proto__: null,
3473
- down: To,
3474
- up: xo
3534
+ down: xo,
3535
+ up: bo
3475
3536
  }, Symbol.toStringTag, { value: "Module" }));
3476
- async function Oo(t) {
3537
+ async function So(t) {
3477
3538
  await t.schema.createTable("hooks").addColumn("hook_id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
3478
3539
  "tenant_id",
3479
3540
  "varchar(255)",
@@ -3484,33 +3545,33 @@ async function Oo(t) {
3484
3545
  (e) => e.defaultTo(!1).notNull()
3485
3546
  ).addColumn("priority", "integer").execute();
3486
3547
  }
3487
- async function ko(t) {
3548
+ async function Oo(t) {
3488
3549
  await t.schema.dropTable("hooks").execute();
3489
3550
  }
3490
- const $o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3551
+ const ko = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3491
3552
  __proto__: null,
3492
- down: ko,
3493
- up: Oo
3553
+ down: Oo,
3554
+ up: So
3494
3555
  }, Symbol.toStringTag, { value: "Module" }));
3495
- async function Do(t) {
3556
+ async function $o(t) {
3496
3557
  }
3497
- async function Io(t) {
3558
+ async function Do(t) {
3498
3559
  }
3499
- const jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3560
+ const Io = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3500
3561
  __proto__: null,
3501
- down: Io,
3502
- up: Do
3562
+ down: Do,
3563
+ up: $o
3503
3564
  }, Symbol.toStringTag, { value: "Module" }));
3504
- async function Po(t) {
3565
+ async function jo(t) {
3505
3566
  }
3506
- async function Fo(t) {
3567
+ async function Po(t) {
3507
3568
  }
3508
- const Mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3569
+ const Fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3509
3570
  __proto__: null,
3510
- down: Fo,
3511
- up: Po
3571
+ down: Po,
3572
+ up: jo
3512
3573
  }, Symbol.toStringTag, { value: "Module" }));
3513
- async function Ao(t) {
3574
+ async function Mo(t) {
3514
3575
  await t.schema.createTable("logins").addColumn("login_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
3515
3576
  "tenant_id",
3516
3577
  "varchar(255)",
@@ -3527,7 +3588,7 @@ async function Ao(t) {
3527
3588
  (e) => e.onDelete("cascade")
3528
3589
  ).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();
3529
3590
  }
3530
- async function zo(t) {
3591
+ async function Ao(t) {
3531
3592
  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(
3532
3593
  "codes_user_id_tenant_id_constraint",
3533
3594
  ["user_id", "tenant_id"],
@@ -3536,90 +3597,90 @@ async function zo(t) {
3536
3597
  (e) => e.onDelete("cascade")
3537
3598
  ).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();
3538
3599
  }
3539
- const Lo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3600
+ const zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3540
3601
  __proto__: null,
3541
- down: zo,
3542
- up: Ao
3602
+ down: Ao,
3603
+ up: Mo
3543
3604
  }, Symbol.toStringTag, { value: "Module" }));
3544
- async function Jo(t) {
3605
+ async function Lo(t) {
3545
3606
  }
3546
- async function Eo(t) {
3607
+ async function Jo(t) {
3547
3608
  }
3548
- const Ko = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3609
+ const Eo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3549
3610
  __proto__: null,
3550
- down: Eo,
3551
- up: Jo
3611
+ down: Jo,
3612
+ up: Lo
3552
3613
  }, Symbol.toStringTag, { value: "Module" }));
3553
- async function Ro(t) {
3614
+ async function Ko(t) {
3554
3615
  await t.schema.alterTable("logins").addColumn("auth0Client", "varchar(256)").execute();
3555
3616
  }
3556
- async function Bo(t) {
3617
+ async function Ro(t) {
3557
3618
  await t.schema.alterTable("logins").dropColumn("auth0Client").execute();
3558
3619
  }
3559
- const Uo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3620
+ const Bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3560
3621
  __proto__: null,
3561
- down: Bo,
3562
- up: Ro
3622
+ down: Ro,
3623
+ up: Ko
3563
3624
  }, Symbol.toStringTag, { value: "Module" }));
3564
- async function Qo(t) {
3625
+ async function Uo(t) {
3565
3626
  await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(8192)").execute();
3566
3627
  }
3567
3628
  async function qo(t) {
3568
3629
  await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(511)").execute();
3569
3630
  }
3570
- const Vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3631
+ const Qo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3571
3632
  __proto__: null,
3572
3633
  down: qo,
3573
- up: Qo
3634
+ up: Uo
3574
3635
  }, Symbol.toStringTag, { value: "Module" }));
3575
- async function Wo(t) {
3636
+ async function Vo(t) {
3576
3637
  }
3577
- async function Go(t) {
3638
+ async function Wo(t) {
3578
3639
  }
3579
- const Ho = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3640
+ const Go = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3580
3641
  __proto__: null,
3581
- down: Go,
3582
- up: Wo
3642
+ down: Wo,
3643
+ up: Vo
3583
3644
  }, Symbol.toStringTag, { value: "Module" }));
3584
- async function Xo(t) {
3645
+ async function Ho(t) {
3585
3646
  }
3586
- async function Yo(t) {
3647
+ async function Xo(t) {
3587
3648
  }
3588
- const Zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3649
+ const Yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3589
3650
  __proto__: null,
3590
- down: Yo,
3591
- up: Xo
3651
+ down: Xo,
3652
+ up: Ho
3592
3653
  }, Symbol.toStringTag, { value: "Module" }));
3593
- async function es(t) {
3654
+ async function Zo(t) {
3594
3655
  await t.schema.alterTable("logins").addColumn("authParams_nonce", "varchar(255)").execute();
3595
3656
  }
3596
- async function ts(t) {
3657
+ async function es(t) {
3597
3658
  await t.schema.alterTable("logins").dropColumn("nonce").execute();
3598
3659
  }
3599
- const as = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3660
+ const ts = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3600
3661
  __proto__: null,
3601
- down: ts,
3602
- up: es
3662
+ down: es,
3663
+ up: Zo
3603
3664
  }, Symbol.toStringTag, { value: "Module" }));
3604
- async function rs(t) {
3665
+ async function as(t) {
3605
3666
  }
3606
- async function ns(t) {
3667
+ async function rs(t) {
3607
3668
  }
3608
- const os = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3669
+ const ns = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3609
3670
  __proto__: null,
3610
- down: ns,
3611
- up: rs
3671
+ down: rs,
3672
+ up: as
3612
3673
  }, Symbol.toStringTag, { value: "Module" }));
3613
- async function ss(t) {
3674
+ async function os(t) {
3614
3675
  }
3615
- async function is(t) {
3676
+ async function ss(t) {
3616
3677
  }
3617
- const ls = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3678
+ const is = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3618
3679
  __proto__: null,
3619
- down: is,
3620
- up: ss
3680
+ down: ss,
3681
+ up: os
3621
3682
  }, Symbol.toStringTag, { value: "Module" }));
3622
- async function cs(t) {
3683
+ async function ls(t) {
3623
3684
  await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.notNull()).addColumn(
3624
3685
  "tenant_id",
3625
3686
  "varchar(255)",
@@ -3635,7 +3696,7 @@ async function cs(t) {
3635
3696
  "code_type"
3636
3697
  ]).execute();
3637
3698
  }
3638
- async function ds(t) {
3699
+ async function cs(t) {
3639
3700
  await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
3640
3701
  "tenant_id",
3641
3702
  "varchar(255)",
@@ -3648,15 +3709,15 @@ async function ds(t) {
3648
3709
  (e) => e.onDelete("cascade")
3649
3710
  ).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();
3650
3711
  }
3651
- const us = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3712
+ const ds = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3652
3713
  __proto__: null,
3653
- down: ds,
3654
- up: cs
3714
+ down: cs,
3715
+ up: ls
3655
3716
  }, Symbol.toStringTag, { value: "Module" }));
3656
- async function ms(t) {
3717
+ async function us(t) {
3657
3718
  await t.schema.dropTable("otps").execute(), await t.schema.dropTable("authentication_codes").execute();
3658
3719
  }
3659
- async function _s(t) {
3720
+ async function ms(t) {
3660
3721
  await t.schema.alterTable("keys").addColumn("private_key", "varchar(2048)").addColumn("public_key", "varchar(2048)").execute(), await t.schema.createTable("otps").addColumn(
3661
3722
  "tenant_id",
3662
3723
  "varchar(255)",
@@ -3675,32 +3736,32 @@ async function _s(t) {
3675
3736
  (e) => e.references("applications.id").onDelete("cascade").notNull()
3676
3737
  ).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();
3677
3738
  }
3678
- const hs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3739
+ const _s = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3679
3740
  __proto__: null,
3680
- down: _s,
3681
- up: ms
3741
+ down: ms,
3742
+ up: us
3682
3743
  }, Symbol.toStringTag, { value: "Module" }));
3683
- async function fs(t) {
3744
+ async function hs(t) {
3684
3745
  await t.schema.createIndex("IDX_logs_tenant_date_type_user").on("logs").columns(["tenant_id", "date", "type", "user_id"]).execute();
3685
3746
  }
3686
- async function ps(t) {
3747
+ async function fs(t) {
3687
3748
  await t.schema.dropIndex("IDX_logs_tenant_date_type_user").on("logs").execute();
3688
3749
  }
3689
- const gs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3750
+ const ps = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3690
3751
  __proto__: null,
3691
- down: ps,
3692
- up: fs
3752
+ down: fs,
3753
+ up: hs
3693
3754
  }, Symbol.toStringTag, { value: "Module" }));
3694
- async function ws(t) {
3755
+ async function gs(t) {
3695
3756
  }
3696
- async function ys(t) {
3757
+ async function ws(t) {
3697
3758
  }
3698
- const vs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3759
+ const ys = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3699
3760
  __proto__: null,
3700
- down: ys,
3701
- up: ws
3761
+ down: ws,
3762
+ up: gs
3702
3763
  }, Symbol.toStringTag, { value: "Module" }));
3703
- async function Ns(t) {
3764
+ async function vs(t) {
3704
3765
  await t.schema.createTable("prompt_settings").addColumn("tenant_id", "varchar(64)", (e) => e.primaryKey()).addColumn(
3705
3766
  "universal_login_experience",
3706
3767
  "varchar(16)",
@@ -3719,95 +3780,95 @@ async function Ns(t) {
3719
3780
  (e) => e.defaultTo(!1).notNull()
3720
3781
  ).execute();
3721
3782
  }
3722
- async function Cs(t) {
3783
+ async function Ns(t) {
3723
3784
  await t.schema.dropTable("prompt_settings").execute();
3724
3785
  }
3725
- const bs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3786
+ const Cs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3726
3787
  __proto__: null,
3727
- down: Cs,
3728
- up: Ns
3788
+ down: Ns,
3789
+ up: vs
3729
3790
  }, Symbol.toStringTag, { value: "Module" }));
3730
- async function xs(t) {
3791
+ async function bs(t) {
3731
3792
  }
3732
- async function Ts(t) {
3793
+ async function xs(t) {
3733
3794
  }
3734
- const Ss = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3795
+ const Ts = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3735
3796
  __proto__: null,
3736
- down: Ts,
3737
- up: xs
3797
+ down: xs,
3798
+ up: bs
3738
3799
  }, Symbol.toStringTag, { value: "Module" }));
3739
- async function Os(t) {
3800
+ async function Ss(t) {
3740
3801
  }
3741
- async function ks(t) {
3802
+ async function Os(t) {
3742
3803
  }
3743
- const $s = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3804
+ const ks = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3744
3805
  __proto__: null,
3745
- down: ks,
3746
- up: Os
3806
+ down: Os,
3807
+ up: Ss
3747
3808
  }, Symbol.toStringTag, { value: "Module" }));
3748
- async function Ds(t) {
3809
+ async function $s(t) {
3749
3810
  }
3750
- async function Is(t) {
3811
+ async function Ds(t) {
3751
3812
  }
3752
- const js = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3813
+ const Is = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3753
3814
  __proto__: null,
3754
- down: Is,
3755
- up: Ds
3815
+ down: Ds,
3816
+ up: $s
3756
3817
  }, Symbol.toStringTag, { value: "Module" }));
3757
- async function Ps(t) {
3818
+ async function js(t) {
3758
3819
  await t.schema.alterTable("logins").addColumn("authParams_ui_locales", "varchar(32)").execute();
3759
3820
  }
3760
- async function Fs(t) {
3821
+ async function Ps(t) {
3761
3822
  await t.schema.alterTable("logins").dropColumn("authParams_ui_locales").execute();
3762
3823
  }
3763
- const Ms = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3824
+ const Fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3764
3825
  __proto__: null,
3765
- down: Fs,
3766
- up: Ps
3826
+ down: Ps,
3827
+ up: js
3767
3828
  }, Symbol.toStringTag, { value: "Module" }));
3768
- async function As(t) {
3829
+ async function Ms(t) {
3769
3830
  await t.schema.alterTable("logins").addColumn("authParams_prompt", "varchar(16)").execute();
3770
3831
  }
3771
- async function zs(t) {
3832
+ async function As(t) {
3772
3833
  await t.schema.alterTable("logins").dropColumn("authParams_prompt").execute();
3773
3834
  }
3774
- const Ls = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3835
+ const zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3775
3836
  __proto__: null,
3776
- down: zs,
3777
- up: As
3837
+ down: As,
3838
+ up: Ms
3778
3839
  }, Symbol.toStringTag, { value: "Module" }));
3779
- async function Js(t) {
3840
+ async function Ls(t) {
3780
3841
  }
3781
- async function Es(t) {
3842
+ async function Js(t) {
3782
3843
  }
3783
- const Ks = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3844
+ const Es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3784
3845
  __proto__: null,
3785
- down: Es,
3786
- up: Js
3846
+ down: Js,
3847
+ up: Ls
3787
3848
  }, Symbol.toStringTag, { value: "Module" }));
3788
- async function Rs(t) {
3849
+ async function Ks(t) {
3789
3850
  await t.schema.alterTable("logins").addColumn("authParams_act_as", "varchar(255)").execute();
3790
3851
  }
3791
- async function Bs(t) {
3852
+ async function Rs(t) {
3792
3853
  await t.schema.alterTable("logins").dropColumn("authParam_act_as").execute();
3793
3854
  }
3794
- const Us = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3855
+ const Bs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3795
3856
  __proto__: null,
3796
- down: Bs,
3797
- up: Rs
3857
+ down: Rs,
3858
+ up: Ks
3798
3859
  }, Symbol.toStringTag, { value: "Module" }));
3799
- async function Qs(t) {
3860
+ async function Us(t) {
3800
3861
  await t.schema.alterTable("codes").addColumn("code_verifier", "varchar(128)").execute();
3801
3862
  }
3802
3863
  async function qs(t) {
3803
3864
  await t.schema.alterTable("codes").dropColumn("code_verifier").execute();
3804
3865
  }
3805
- const Vs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3866
+ const Qs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3806
3867
  __proto__: null,
3807
3868
  down: qs,
3808
- up: Qs
3869
+ up: Us
3809
3870
  }, Symbol.toStringTag, { value: "Module" }));
3810
- async function Ws(t) {
3871
+ async function Vs(t) {
3811
3872
  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(
3812
3873
  "credentials",
3813
3874
  "varchar(2048)",
@@ -3818,18 +3879,18 @@ async function Ws(t) {
3818
3879
  (e) => e.notNull().defaultTo("{}")
3819
3880
  ).addColumn("created_at", "varchar(29)", (e) => e.notNull()).addColumn("updated_at", "varchar(29)", (e) => e.notNull()).execute();
3820
3881
  }
3821
- async function Gs(t) {
3882
+ async function Ws(t) {
3822
3883
  await t.schema.dropTable("email_providers").execute();
3823
3884
  }
3824
- const Hs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3885
+ const Gs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3825
3886
  __proto__: null,
3826
- down: Gs,
3827
- up: Ws
3887
+ down: Ws,
3888
+ up: Vs
3828
3889
  }, Symbol.toStringTag, { value: "Module" }));
3829
- async function Xs(t) {
3890
+ async function Hs(t) {
3830
3891
  await t.schema.dropTable("tickets").execute();
3831
3892
  }
3832
- async function Ys(t) {
3893
+ async function Xs(t) {
3833
3894
  await t.schema.createTable("tickets").addColumn(
3834
3895
  "tenant_id",
3835
3896
  "varchar(255)",
@@ -3840,22 +3901,22 @@ async function Ys(t) {
3840
3901
  (e) => e.references("applications.id").onDelete("cascade").notNull()
3841
3902
  ).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();
3842
3903
  }
3843
- const Zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3904
+ const Ys = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3844
3905
  __proto__: null,
3845
- down: Ys,
3846
- up: Xs
3906
+ down: Xs,
3907
+ up: Hs
3847
3908
  }, Symbol.toStringTag, { value: "Module" }));
3848
- async function ei(t) {
3909
+ async function Zs(t) {
3849
3910
  }
3850
- async function ti(t) {
3911
+ async function ei(t) {
3851
3912
  await t.schema.alterTable("logins").dropColumn("ip").dropColumn("useragent").execute();
3852
3913
  }
3853
- const ai = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3914
+ const ti = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3854
3915
  __proto__: null,
3855
- down: ti,
3856
- up: ei
3916
+ down: ei,
3917
+ up: Zs
3857
3918
  }, Symbol.toStringTag, { value: "Module" }));
3858
- async function ri(t) {
3919
+ async function ai(t) {
3859
3920
  await t.schema.createTable("refresh_tokens").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn(
3860
3921
  "client_id",
3861
3922
  "varchar(21)",
@@ -3868,27 +3929,27 @@ async function ri(t) {
3868
3929
  (e) => e.onDelete("cascade")
3869
3930
  ).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();
3870
3931
  }
3871
- async function ni(t) {
3932
+ async function ri(t) {
3872
3933
  await t.schema.dropTable("refresh_tokens").execute();
3873
3934
  }
3874
- const oi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3935
+ const ni = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3875
3936
  __proto__: null,
3876
- down: ni,
3877
- up: ri
3937
+ down: ri,
3938
+ up: ai
3878
3939
  }, Symbol.toStringTag, { value: "Module" }));
3879
- async function si(t) {
3940
+ async function oi(t) {
3880
3941
  }
3881
- async function ii(t) {
3942
+ async function si(t) {
3882
3943
  }
3883
- const li = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3944
+ const ii = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3884
3945
  __proto__: null,
3885
- down: ii,
3886
- up: si
3946
+ down: si,
3947
+ up: oi
3887
3948
  }, Symbol.toStringTag, { value: "Module" }));
3888
- async function ci(t) {
3949
+ async function li(t) {
3889
3950
  await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("refresh_tokens").execute();
3890
3951
  }
3891
- async function di(t) {
3952
+ async function ci(t) {
3892
3953
  await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
3893
3954
  "sessions_user_id_constraint",
3894
3955
  ["user_id", "tenant_id"],
@@ -3907,12 +3968,12 @@ async function di(t) {
3907
3968
  (e) => e.onDelete("cascade")
3908
3969
  ).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();
3909
3970
  }
3910
- const ui = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3971
+ const di = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3911
3972
  __proto__: null,
3912
- down: di,
3913
- up: ci
3973
+ down: ci,
3974
+ up: li
3914
3975
  }, Symbol.toStringTag, { value: "Module" }));
3915
- async function mi(t) {
3976
+ async function ui(t) {
3916
3977
  await t.schema.createTable("sessions_2").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
3917
3978
  "sessions_2_user_id_constraint",
3918
3979
  ["user_id", "tenant_id"],
@@ -3931,15 +3992,15 @@ async function mi(t) {
3931
3992
  (e) => e.onDelete("cascade")
3932
3993
  ).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();
3933
3994
  }
3934
- async function _i(t) {
3995
+ async function mi(t) {
3935
3996
  await t.schema.dropTable("sessions_2").execute(), await t.schema.dropTable("refresh_tokens_2").execute();
3936
3997
  }
3937
- const hi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3998
+ const _i = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3938
3999
  __proto__: null,
3939
- down: _i,
3940
- up: mi
4000
+ down: mi,
4001
+ up: ui
3941
4002
  }, Symbol.toStringTag, { value: "Module" }));
3942
- async function fi(t) {
4003
+ async function hi(t) {
3943
4004
  await t.schema.createTable("custom_domains").addColumn(
3944
4005
  "custom_domain_id",
3945
4006
  "varchar(21)",
@@ -3950,49 +4011,49 @@ async function fi(t) {
3950
4011
  (e) => e.references("tenants.id").onDelete("cascade").notNull()
3951
4012
  ).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();
3952
4013
  }
3953
- async function pi(t) {
4014
+ async function fi(t) {
3954
4015
  await t.schema.dropTable("custom_domains").execute(), await t.schema.createTable("domains").addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
3955
4016
  "tenant_id",
3956
4017
  "varchar(255)",
3957
4018
  (e) => e.references("tenants.id").onDelete("cascade").notNull()
3958
4019
  ).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();
3959
4020
  }
3960
- const gi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4021
+ const pi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3961
4022
  __proto__: null,
3962
- down: pi,
3963
- up: fi
4023
+ down: fi,
4024
+ up: hi
3964
4025
  }, Symbol.toStringTag, { value: "Module" }));
3965
- async function wi(t) {
4026
+ async function gi(t) {
3966
4027
  }
3967
- async function yi(t) {
4028
+ async function wi(t) {
3968
4029
  await t.schema.alterTable("logins").dropColumn("authParams_organization").dropColumn("authorization_url").execute();
3969
4030
  }
3970
- const vi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4031
+ const yi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3971
4032
  __proto__: null,
3972
- down: yi,
3973
- up: wi
4033
+ down: wi,
4034
+ up: gi
3974
4035
  }, Symbol.toStringTag, { value: "Module" }));
3975
- async function Ni(t) {
4036
+ async function vi(t) {
3976
4037
  await t.schema.alterTable("logins").dropColumn("authorization_url").execute(), await t.schema.alterTable("logins").addColumn("authorization_url", "varchar(2048)").execute();
3977
4038
  }
3978
- async function Ci(t) {
4039
+ async function Ni(t) {
3979
4040
  await t.schema.alterTable("logins").dropColumn("authorization_url").execute(), await t.schema.alterTable("logins").addColumn("authorization_url", "varchar(1024)").execute();
3980
4041
  }
3981
- const bi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4042
+ const Ci = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3982
4043
  __proto__: null,
3983
- down: Ci,
3984
- up: Ni
4044
+ down: Ni,
4045
+ up: vi
3985
4046
  }, Symbol.toStringTag, { value: "Module" }));
3986
- async function xi(t) {
4047
+ async function bi(t) {
3987
4048
  }
3988
- async function Ti(t) {
4049
+ async function xi(t) {
3989
4050
  }
3990
- const Si = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4051
+ const Ti = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3991
4052
  __proto__: null,
3992
- down: Ti,
3993
- up: xi
4053
+ down: xi,
4054
+ up: bi
3994
4055
  }, Symbol.toStringTag, { value: "Module" }));
3995
- async function Oi(t) {
4056
+ async function Si(t) {
3996
4057
  await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
3997
4058
  "sessions_user_id_constraint",
3998
4059
  ["user_id", "tenant_id"],
@@ -4019,25 +4080,25 @@ async function Oi(t) {
4019
4080
  (e) => e.onDelete("cascade")
4020
4081
  ).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();
4021
4082
  }
4022
- async function ki(t) {
4083
+ async function Oi(t) {
4023
4084
  await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("login_sessions").execute(), await t.schema.dropTable("refresh_tokens").execute();
4024
4085
  }
4025
- const $i = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4086
+ const ki = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4026
4087
  __proto__: null,
4027
- down: ki,
4028
- up: Oi
4088
+ down: Oi,
4089
+ up: Si
4029
4090
  }, Symbol.toStringTag, { value: "Module" }));
4030
- async function Di(t) {
4091
+ async function $i(t) {
4031
4092
  await t.schema.dropTable("logins").execute(), await t.schema.dropTable("sessions_2").execute(), await t.schema.dropTable("refresh_tokens_2").execute();
4032
4093
  }
4033
- async function Ii(t) {
4094
+ async function Di(t) {
4034
4095
  }
4035
- const ji = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4096
+ const Ii = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4036
4097
  __proto__: null,
4037
- down: Ii,
4038
- up: Di
4098
+ down: Di,
4099
+ up: $i
4039
4100
  }, Symbol.toStringTag, { value: "Module" }));
4040
- async function Pi(t) {
4101
+ async function ji(t) {
4041
4102
  await t.schema.dropTable("custom_domains").execute(), await t.schema.createTable("custom_domains").addColumn(
4042
4103
  "custom_domain_id",
4043
4104
  "varchar(256)",
@@ -4048,46 +4109,46 @@ async function Pi(t) {
4048
4109
  (e) => e.references("tenants.id").onDelete("cascade").notNull()
4049
4110
  ).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();
4050
4111
  }
4051
- async function Fi(t) {
4112
+ async function Pi(t) {
4052
4113
  }
4053
- const Mi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4114
+ const Fi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4054
4115
  __proto__: null,
4055
- down: Fi,
4056
- up: Pi
4116
+ down: Pi,
4117
+ up: ji
4057
4118
  }, Symbol.toStringTag, { value: "Module" }));
4058
- async function Ai(t) {
4119
+ async function Mi(t) {
4059
4120
  }
4060
- async function zi(t) {
4121
+ async function Ai(t) {
4061
4122
  await t.schema.alterTable("users").dropColumn("phone_number").dropColumn("phone_verified").dropColumn("username").execute();
4062
4123
  }
4063
- const Li = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4124
+ const zi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4064
4125
  __proto__: null,
4065
- down: zi,
4066
- up: Ai
4126
+ down: Ai,
4127
+ up: Mi
4067
4128
  }, Symbol.toStringTag, { value: "Module" }));
4068
- async function Ji(t) {
4129
+ async function Li(t) {
4069
4130
  await t.schema.createTable("forms").addColumn("id", "varchar(255)", (e) => e.primaryKey()).addColumn("name", "varchar(255)", (e) => e.notNull()).addColumn("tenant_id", "varchar(255)", (e) => e.notNull()).addColumn("messages", "varchar(255)").addColumn("languages", "varchar(255)").addColumn("translations", "varchar(4096)").addColumn("nodes", "varchar(4096)").addColumn("start", "varchar(255)").addColumn("ending", "varchar(255)").addColumn("style", "varchar(1042)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("updated_at", "varchar(255)", (e) => e.notNull()).execute(), await t.schema.createIndex("forms_tenant_id_idx").on("forms").column("tenant_id").execute();
4070
4131
  }
4071
- async function Ei(t) {
4132
+ async function Ji(t) {
4072
4133
  await t.schema.dropTable("forms").execute();
4073
4134
  }
4074
- const Ki = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4135
+ const Ei = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4075
4136
  __proto__: null,
4076
- down: Ei,
4077
- up: Ji
4137
+ down: Ji,
4138
+ up: Li
4078
4139
  }, Symbol.toStringTag, { value: "Module" }));
4079
- async function Ri(t) {
4140
+ async function Ki(t) {
4080
4141
  await t.schema.alterTable("hooks").addColumn("form_id", "text").execute(), await t.schema.alterTable("hooks").addColumn("url_tmp", "varchar(512)").execute(), await t.updateTable("hooks").set((e) => ({ url_tmp: e.ref("url") })).execute(), await t.schema.alterTable("hooks").dropColumn("url").execute(), await t.schema.alterTable("hooks").renameColumn("url_tmp", "url").execute();
4081
4142
  }
4082
- async function Bi(t) {
4143
+ async function Ri(t) {
4083
4144
  await t.schema.dropTable("hooks").ifExists().execute(), await t.schema.createTable("hooks").addColumn("hook_id", "text", (e) => e.primaryKey()).addColumn("tenant_id", "text", (e) => e.notNull()).addColumn("trigger_id", "text", (e) => e.notNull()).addColumn("enabled", "integer", (e) => e.notNull().defaultTo(0)).addColumn("url", "varchar(512)", (e) => e.notNull()).addColumn("synchronous", "integer", (e) => e.notNull().defaultTo(0)).addColumn("priority", "integer").addColumn("created_at", "text", (e) => e.notNull()).addColumn("updated_at", "text", (e) => e.notNull()).execute();
4084
4145
  }
4085
- const Ui = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4146
+ const Bi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4086
4147
  __proto__: null,
4087
- down: Bi,
4088
- up: Ri
4148
+ down: Ri,
4149
+ up: Ki
4089
4150
  }, Symbol.toStringTag, { value: "Module" }));
4090
- async function Qi(t) {
4151
+ async function Ui(t) {
4091
4152
  await t.schema.alterTable("login_sessions").addColumn(
4092
4153
  "login_completed",
4093
4154
  "boolean",
@@ -4097,71 +4158,71 @@ async function Qi(t) {
4097
4158
  async function qi(t) {
4098
4159
  await t.schema.alterTable("login_sessions").dropColumn("login_completed").execute();
4099
4160
  }
4100
- const Vi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4161
+ const Qi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4101
4162
  __proto__: null,
4102
4163
  down: qi,
4103
- up: Qi
4164
+ up: Ui
4104
4165
  }, Symbol.toStringTag, { value: "Module" }));
4105
- async function Wi(t) {
4166
+ async function Vi(t) {
4106
4167
  await t.schema.alterTable("sessions").addColumn(
4107
4168
  "login_session_id",
4108
4169
  "varchar(21)",
4109
4170
  (e) => e.references("login_sessions.id").onDelete("set null")
4110
4171
  ).execute();
4111
4172
  }
4112
- async function Gi(t) {
4173
+ async function Wi(t) {
4113
4174
  await t.schema.alterTable("sessions").dropColumn("login_session_id").execute();
4114
4175
  }
4115
- const Hi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4176
+ const Gi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4116
4177
  __proto__: null,
4117
- down: Gi,
4118
- up: Wi
4178
+ down: Wi,
4179
+ up: Vi
4119
4180
  }, Symbol.toStringTag, { value: "Module" }));
4120
- async function Xi(t) {
4181
+ async function Hi(t) {
4121
4182
  await t.schema.createIndex("IDX_sessions_login_session_id").on("sessions").column("login_session_id").execute();
4122
4183
  }
4123
- async function Yi(t) {
4184
+ async function Xi(t) {
4124
4185
  await t.schema.dropIndex("IDX_sessions_login_session_id").on("sessions").execute();
4125
4186
  }
4126
- const Zi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4187
+ const Yi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4127
4188
  __proto__: null,
4128
- down: Yi,
4129
- up: Xi
4189
+ down: Xi,
4190
+ up: Hi
4130
4191
  }, Symbol.toStringTag, { value: "Module" }));
4131
- async function el(t) {
4192
+ async function Zi(t) {
4132
4193
  await t.schema.alterTable("codes").addColumn("code_challenge", "varchar(128)").execute(), await t.schema.alterTable("codes").addColumn("code_challenge_method", "varchar(5)").execute();
4133
4194
  }
4134
- async function tl(t) {
4195
+ async function el(t) {
4135
4196
  await t.schema.alterTable("codes").dropColumn("code_challenge").execute(), await t.schema.alterTable("codes").dropColumn("code_challenge_method").execute();
4136
4197
  }
4137
- const al = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4198
+ const tl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4138
4199
  __proto__: null,
4139
- down: tl,
4140
- up: el
4200
+ down: el,
4201
+ up: Zi
4141
4202
  }, Symbol.toStringTag, { value: "Module" }));
4142
- async function rl(t) {
4203
+ async function al(t) {
4143
4204
  await t.schema.alterTable("codes").addColumn("redirect_uri", "varchar(1024)").execute();
4144
4205
  }
4145
- async function nl(t) {
4206
+ async function rl(t) {
4146
4207
  await t.schema.alterTable("codes").dropColumn("redirect_uri").execute();
4147
4208
  }
4148
- const ol = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4209
+ const nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4149
4210
  __proto__: null,
4150
- down: nl,
4151
- up: rl
4211
+ down: rl,
4212
+ up: al
4152
4213
  }, Symbol.toStringTag, { value: "Module" }));
4153
- async function sl(t) {
4214
+ async function ol(t) {
4154
4215
  await t.schema.alterTable("codes").addColumn("nonce", "varchar(1024)").execute(), await t.schema.alterTable("codes").addColumn("state", "varchar(2048)").execute();
4155
4216
  }
4156
- async function il(t) {
4217
+ async function sl(t) {
4157
4218
  await t.schema.alterTable("codes").dropColumn("nonce").execute(), await t.schema.alterTable("codes").dropColumn("state").execute();
4158
4219
  }
4159
- const ll = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4220
+ const il = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4160
4221
  __proto__: null,
4161
- down: il,
4162
- up: sl
4222
+ down: sl,
4223
+ up: ol
4163
4224
  }, Symbol.toStringTag, { value: "Module" }));
4164
- async function cl(t) {
4225
+ async function ll(t) {
4165
4226
  await t.schema.createTable("themes").addColumn(
4166
4227
  "tenant_id",
4167
4228
  "varchar(255)",
@@ -4236,121 +4297,121 @@ async function cl(t) {
4236
4297
  (e) => e.notNull()
4237
4298
  ).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("updated_at", "varchar(35)", (e) => e.notNull()).addPrimaryKeyConstraint("themes_pkey", ["tenant_id", "themeId"]).execute(), await t.schema.createIndex("themes_tenant_id_idx").on("themes").column("tenant_id").execute();
4238
4299
  }
4239
- async function dl(t) {
4300
+ async function cl(t) {
4240
4301
  await t.schema.dropTable("themes").execute();
4241
4302
  }
4242
- const ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4303
+ const dl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4243
4304
  __proto__: null,
4244
- down: dl,
4245
- up: cl
4305
+ down: cl,
4306
+ up: ll
4246
4307
  }, Symbol.toStringTag, { value: "Module" }));
4247
- async function ml(t) {
4248
- await t.schema.createTable("resource_servers").addColumn("id", "varchar(255)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)", (e) => e.notNull()).addColumn("name", "varchar(255)", (e) => e.notNull()).addColumn("identifier", "varchar(1024)", (e) => e.notNull()).addColumn("scopes", "varchar(4096)").addColumn("signing_alg", "varchar(64)").addColumn("signing_secret", "varchar(2048)").addColumn("token_lifetime", "integer").addColumn("token_lifetime_for_web", "integer").addColumn("skip_consent_for_verifiable_first_party_clients", "integer").addColumn("allow_offline_access", "integer").addColumn("verificationKey", "varchar(4096)").addColumn("options", "varchar(4096)").execute(), await t.schema.createIndex("resource_servers_tenant_id_idx").on("resource_servers").column("tenant_id").execute(), await t.schema.createIndex("resource_servers_identifier_idx").on("resource_servers").column("identifier").execute(), await t.schema.createTable("rules").addColumn("id", "varchar(255)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)", (e) => e.notNull()).addColumn("name", "varchar(255)", (e) => e.notNull()).addColumn("script", "varchar(8192)", (e) => e.notNull()).addColumn("order", "integer").addColumn("enabled", "integer").addColumn("stage", "varchar(64)").addColumn("created_at", "varchar(255)").addColumn("updated_at", "varchar(255)").execute(), await t.schema.createIndex("rules_tenant_id_idx").on("rules").column("tenant_id").execute(), await t.schema.createTable("permissions").addColumn("id", "varchar(255)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)", (e) => e.notNull()).addColumn("permission_name", "varchar(255)", (e) => e.notNull()).addColumn("description", "varchar(1024)").addColumn(
4308
+ async function ul(t) {
4309
+ await t.schema.createTable("resource_servers").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("name", "varchar(255)", (e) => e.notNull()).addColumn("identifier", "varchar(191)", (e) => e.notNull()).addColumn("scopes", "varchar(4096)").addColumn("signing_alg", "varchar(64)").addColumn("signing_secret", "varchar(2048)").addColumn("token_lifetime", "integer").addColumn("token_lifetime_for_web", "integer").addColumn("skip_consent_for_verifiable_first_party_clients", "integer").addColumn("allow_offline_access", "integer").addColumn("verification_key", "varchar(4096)").addColumn("options", "varchar(4096)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("updated_at", "varchar(255)", (e) => e.notNull()).execute(), await t.schema.createIndex("resource_servers_tenant_identifier_uq").on("resource_servers").columns(["tenant_id", "identifier"]).unique().execute(), await t.schema.createTable("permissions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("permission_name", "varchar(255)", (e) => e.notNull()).addColumn("description", "varchar(1024)").addColumn(
4249
4310
  "resource_server_identifier",
4250
- "varchar(1024)",
4311
+ "varchar(191)",
4251
4312
  (e) => e.notNull()
4252
- ).addColumn("resource_server_name", "varchar(255)", (e) => e.notNull()).addColumn("sources", "varchar(4096)").execute(), await t.schema.createIndex("permissions_tenant_id_idx").on("permissions").column("tenant_id").execute();
4313
+ ).addColumn("resource_server_name", "varchar(255)", (e) => e.notNull()).addColumn("sources", "varchar(4096)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("updated_at", "varchar(255)", (e) => e.notNull()).execute(), await t.schema.createIndex("permissions_tenant_identifier_name_uq").on("permissions").columns(["tenant_id", "resource_server_identifier", "permission_name"]).unique().execute(), await t.schema.createTable("roles").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("name", "varchar(50)", (e) => e.notNull()).addColumn("description", "varchar(255)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("updated_at", "varchar(255)", (e) => e.notNull()).execute(), await t.schema.createIndex("roles_tenant_name_uq").on("roles").columns(["tenant_id", "name"]).unique().execute();
4253
4314
  }
4254
- async function _l(t) {
4255
- await t.schema.dropTable("permissions").execute(), await t.schema.dropTable("rules").execute(), await t.schema.dropTable("resource_servers").execute();
4315
+ async function ml(t) {
4316
+ await t.schema.dropTable("roles").execute(), await t.schema.dropTable("permissions").execute(), await t.schema.dropTable("resource_servers").execute();
4256
4317
  }
4257
- const hl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4318
+ const _l = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4258
4319
  __proto__: null,
4259
- down: _l,
4260
- up: ml
4320
+ down: ml,
4321
+ up: ul
4261
4322
  }, Symbol.toStringTag, { value: "Module" })), Je = {
4262
- m1_init: fr,
4263
- m2_magicLink: wr,
4264
- m3_updateAt: Nr,
4265
- m4_logTable: xr,
4266
- m5_userProfile: Or,
4267
- m6_sessions: Dr,
4268
- m7_passwords: Pr,
4269
- m8_logsTableNewFields: Ar,
4270
- m9_passwordTableNewField: Jr,
4271
- n01_codesTable: Rr,
4272
- n11_universalLoginSession: Qr,
4273
- n12_userFields: Wr,
4274
- n13_userEmailIndex: Xr,
4275
- n14_profileDataField: en,
4276
- n15_userEmailIndex: rn,
4277
- n16_userLocale: sn,
4278
- n17_signingKeys: dn,
4279
- n18_logsFields: _n,
4280
- n19_connectionsUserinfo: pn,
4281
- n20_missingFields: yn,
4282
- n21_sessionDeletedAt: Cn,
4283
- n22_dropLogsFields: Tn,
4284
- n23_dropUsersFields: kn,
4285
- n24_logsIndexes: In,
4286
- n25_logDescMaxLength: Fn,
4287
- n26_logsTableExtraFields: zn,
4288
- n27_usersTableNameIndex: En,
4289
- n28_usersEmailConstrain: Bn,
4323
+ m1_init: hr,
4324
+ m2_magicLink: gr,
4325
+ m3_updateAt: vr,
4326
+ m4_logTable: br,
4327
+ m5_userProfile: Sr,
4328
+ m6_sessions: $r,
4329
+ m7_passwords: jr,
4330
+ m8_logsTableNewFields: Mr,
4331
+ m9_passwordTableNewField: Lr,
4332
+ n01_codesTable: Kr,
4333
+ n11_universalLoginSession: Ur,
4334
+ n12_userFields: Vr,
4335
+ n13_userEmailIndex: Hr,
4336
+ n14_profileDataField: Zr,
4337
+ n15_userEmailIndex: an,
4338
+ n16_userLocale: on,
4339
+ n17_signingKeys: cn,
4340
+ n18_logsFields: mn,
4341
+ n19_connectionsUserinfo: fn,
4342
+ n20_missingFields: wn,
4343
+ n21_sessionDeletedAt: Nn,
4344
+ n22_dropLogsFields: xn,
4345
+ n23_dropUsersFields: On,
4346
+ n24_logsIndexes: Dn,
4347
+ n25_logDescMaxLength: Pn,
4348
+ n26_logsTableExtraFields: An,
4349
+ n27_usersTableNameIndex: Jn,
4350
+ n28_usersEmailConstrain: Rn,
4290
4351
  n29_increaseOtpStateLength: qn,
4291
- n30_increaseTicketStateLength: Gn,
4292
- n31_branding: Yn,
4293
- n32_indexesAndNotNull: to,
4294
- n33_vendorIdInUniversalLoginSession: no,
4295
- n34_auth0ClientInUniversalLoginSession: io,
4296
- n35_increaseUniversalSessionStateLength: uo,
4297
- n36_authenticationCodes: ho,
4298
- n37_disableSignUps: go,
4299
- n38_otpIpAddress: vo,
4300
- n39_increaseUserAgentLength: bo,
4301
- n40_userId: So,
4302
- n41_hooks: $o,
4303
- n42_userIdIndexes: jo,
4304
- n43_userIdIndexes: Mo,
4305
- n44_codes: Lo,
4306
- n45_hookProperties: Ko,
4307
- n46_loginAuth0Client: Uo,
4308
- n47_loginAuth0Client: Vo,
4309
- n48_saml: Ho,
4310
- n49_removeFields: Zo,
4311
- n50_authParamsNonce: as,
4312
- n51_connectionid: os,
4313
- n52_cert: ls,
4314
- n53_codes_primary_key: us,
4315
- n54_cleanup_tables: hs,
4316
- n55_logs_index: gs,
4317
- n56_application_fields: vs,
4318
- n57_prompt_settings: bs,
4319
- n58_connection_client_id: Ss,
4320
- n59_connection_options: $s,
4321
- n60_users_metadata: js,
4322
- n61_userLocales: Ms,
4323
- n62_prompt: Ls,
4324
- n63_connection_cleanup: Ks,
4325
- n64_act_as: Us,
4326
- n65_code_verifier: Vs,
4327
- n66_email_providers: Hs,
4328
- n67_drop_tickets: Zs,
4329
- n68_login_useragents: ai,
4330
- n70_refresh_tokens: oi,
4331
- n71_session_new_fields: li,
4332
- n72_session_primary_key: ui,
4333
- n73_drop_sessions: hi,
4334
- n74_custom_domains: gi,
4335
- n75_organizations: vi,
4336
- n76_authorization_url_length: bi,
4337
- n77_drop_sessions: Si,
4338
- n78_login_sessions: $i,
4339
- n79_drop_sessions_2: ji,
4340
- n80_recreate_custom_domains: Mi,
4341
- n81_phone: Li,
4342
- n82_forms: Ki,
4343
- n83_addFormsIdToHooks: Ui,
4344
- n84_login_completed: Vi,
4345
- n85_add_login_session_id_to_sessions: Hi,
4346
- n86_index_sessions_login_session_id: Zi,
4347
- n87_code_challenge: al,
4348
- n88_add_redirect_uri_to_codes: ol,
4349
- n89_add_nonce_and_state_to_codes: ll,
4350
- n90_themes: ul,
4351
- n91_resource_servers_rules_permissions: hl
4352
+ n30_increaseTicketStateLength: Wn,
4353
+ n31_branding: Xn,
4354
+ n32_indexesAndNotNull: eo,
4355
+ n33_vendorIdInUniversalLoginSession: ro,
4356
+ n34_auth0ClientInUniversalLoginSession: so,
4357
+ n35_increaseUniversalSessionStateLength: co,
4358
+ n36_authenticationCodes: _o,
4359
+ n37_disableSignUps: po,
4360
+ n38_otpIpAddress: yo,
4361
+ n39_increaseUserAgentLength: Co,
4362
+ n40_userId: To,
4363
+ n41_hooks: ko,
4364
+ n42_userIdIndexes: Io,
4365
+ n43_userIdIndexes: Fo,
4366
+ n44_codes: zo,
4367
+ n45_hookProperties: Eo,
4368
+ n46_loginAuth0Client: Bo,
4369
+ n47_loginAuth0Client: Qo,
4370
+ n48_saml: Go,
4371
+ n49_removeFields: Yo,
4372
+ n50_authParamsNonce: ts,
4373
+ n51_connectionid: ns,
4374
+ n52_cert: is,
4375
+ n53_codes_primary_key: ds,
4376
+ n54_cleanup_tables: _s,
4377
+ n55_logs_index: ps,
4378
+ n56_application_fields: ys,
4379
+ n57_prompt_settings: Cs,
4380
+ n58_connection_client_id: Ts,
4381
+ n59_connection_options: ks,
4382
+ n60_users_metadata: Is,
4383
+ n61_userLocales: Fs,
4384
+ n62_prompt: zs,
4385
+ n63_connection_cleanup: Es,
4386
+ n64_act_as: Bs,
4387
+ n65_code_verifier: Qs,
4388
+ n66_email_providers: Gs,
4389
+ n67_drop_tickets: Ys,
4390
+ n68_login_useragents: ti,
4391
+ n70_refresh_tokens: ni,
4392
+ n71_session_new_fields: ii,
4393
+ n72_session_primary_key: di,
4394
+ n73_drop_sessions: _i,
4395
+ n74_custom_domains: pi,
4396
+ n75_organizations: yi,
4397
+ n76_authorization_url_length: Ci,
4398
+ n77_drop_sessions: Ti,
4399
+ n78_login_sessions: ki,
4400
+ n79_drop_sessions_2: Ii,
4401
+ n80_recreate_custom_domains: Fi,
4402
+ n81_phone: zi,
4403
+ n82_forms: Ei,
4404
+ n83_addFormsIdToHooks: Bi,
4405
+ n84_login_completed: Qi,
4406
+ n85_add_login_session_id_to_sessions: Gi,
4407
+ n86_index_sessions_login_session_id: Yi,
4408
+ n87_code_challenge: tl,
4409
+ n88_add_redirect_uri_to_codes: nl,
4410
+ n89_add_nonce_and_state_to_codes: il,
4411
+ n90_themes: dl,
4412
+ n91_resource_servers_rules_permissions: _l
4352
4413
  };
4353
- async function yl(t, e = !1) {
4414
+ async function wl(t, e = !1) {
4354
4415
  e && console.log("migrating...");
4355
4416
  const a = new Le(Je), r = new be({
4356
4417
  db: t,
@@ -4363,7 +4424,7 @@ async function yl(t, e = !1) {
4363
4424
  }), n)
4364
4425
  throw console.error("failed to migrate"), console.error(n), n;
4365
4426
  }
4366
- async function vl(t) {
4427
+ async function yl(t) {
4367
4428
  console.log("migrating...");
4368
4429
  const e = new Le(Je), a = new be({
4369
4430
  db: t,
@@ -4374,35 +4435,35 @@ async function vl(t) {
4374
4435
  }), r)
4375
4436
  throw console.error("failed to migrate"), console.error(r), r;
4376
4437
  }
4377
- function Nl(t) {
4438
+ function vl(t) {
4378
4439
  return {
4379
- applications: Mt(t),
4380
- branding: aa(t),
4381
- cleanup: ja(t),
4382
- clients: Rt(t),
4383
- codes: $t(t),
4384
- connections: Kt(t),
4385
- emailProviders: Ta(t),
4386
- customDomains: Zt(t),
4387
- forms: La(t),
4388
- hooks: la(t),
4440
+ applications: Ft(t),
4441
+ branding: ta(t),
4442
+ cleanup: Ia(t),
4443
+ clients: Kt(t),
4444
+ codes: kt(t),
4445
+ connections: Et(t),
4446
+ emailProviders: xa(t),
4447
+ customDomains: Yt(t),
4448
+ forms: za(t),
4449
+ hooks: ia(t),
4389
4450
  keys: qt(t),
4390
- loginSessions: wa(t),
4391
- logs: _t(t),
4392
- passwords: bt(t),
4393
- promptSettings: Na(t),
4394
- refreshTokens: Ia(t),
4395
- resourceServers: Ua(t),
4396
- rules: Ha(t),
4397
- permissions: ar(t),
4398
- sessions: yt(t),
4399
- tenants: lt(t),
4400
- themes: _a(t),
4401
- users: tt(t)
4451
+ loginSessions: ga(t),
4452
+ logs: mt(t),
4453
+ passwords: Ct(t),
4454
+ promptSettings: va(t),
4455
+ refreshTokens: Da(t),
4456
+ resourceServers: Ba(t),
4457
+ permissions: Ga(t),
4458
+ roles: tr(t),
4459
+ sessions: wt(t),
4460
+ tenants: it(t),
4461
+ themes: ma(t),
4462
+ users: et(t)
4402
4463
  };
4403
4464
  }
4404
4465
  export {
4405
- Nl as default,
4406
- vl as migrateDown,
4407
- yl as migrateToLatest
4466
+ vl as default,
4467
+ yl as migrateDown,
4468
+ wl as migrateToLatest
4408
4469
  };