@authhero/kysely-adapter 0.24.3 → 0.25.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.
@@ -4014,14 +4014,18 @@ function hi(t) {
4014
4014
  };
4015
4015
  }
4016
4016
  function pi(t) {
4017
+ return async (e, n) => (await t.updateTable("codes").set({ used_at: (/* @__PURE__ */ new Date()).toISOString() }).where("codes.tenant_id", "=", e).where("codes.code_id", "=", n).executeTakeFirst()).numUpdatedRows > 0;
4018
+ }
4019
+ function mi(t) {
4017
4020
  return {
4018
4021
  create: li(t),
4019
4022
  list: ci(t),
4020
4023
  remove: ui(t),
4024
+ used: pi(t),
4021
4025
  get: hi(t)
4022
4026
  };
4023
4027
  }
4024
- function mi(t) {
4028
+ function fi(t) {
4025
4029
  return async (e, n) => {
4026
4030
  const a = {
4027
4031
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
@@ -4041,7 +4045,7 @@ function mi(t) {
4041
4045
  }).execute(), a;
4042
4046
  };
4043
4047
  }
4044
- function fi(t) {
4048
+ function _i(t) {
4045
4049
  return async (e) => ({
4046
4050
  applications: (await t.selectFrom("applications").where("applications.tenant_id", "=", e).selectAll().execute()).map((s) => ({
4047
4051
  ...s,
@@ -4055,7 +4059,7 @@ function fi(t) {
4055
4059
  }))
4056
4060
  });
4057
4061
  }
4058
- function _i(t) {
4062
+ function gi(t) {
4059
4063
  return async (e, n) => {
4060
4064
  const a = await t.selectFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", n).selectAll().executeTakeFirst();
4061
4065
  return a ? R({
@@ -4069,10 +4073,10 @@ function _i(t) {
4069
4073
  }) : null;
4070
4074
  };
4071
4075
  }
4072
- function gi(t) {
4076
+ function yi(t) {
4073
4077
  return async (e, n) => (await t.deleteFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", n).executeTakeFirst()).numDeletedRows > 0;
4074
4078
  }
4075
- function yi(t) {
4079
+ function vi(t) {
4076
4080
  return async (e, n, a) => {
4077
4081
  const r = {
4078
4082
  ...a,
@@ -4088,16 +4092,16 @@ function yi(t) {
4088
4092
  return await t.updateTable("applications").set(r).where("applications.id", "=", n).where("applications.tenant_id", "=", e).execute(), !0;
4089
4093
  };
4090
4094
  }
4091
- function vi(t) {
4095
+ function bi(t) {
4092
4096
  return {
4093
- create: mi(t),
4094
- list: fi(t),
4095
- get: _i(t),
4096
- remove: gi(t),
4097
- update: yi(t)
4097
+ create: fi(t),
4098
+ list: _i(t),
4099
+ get: gi(t),
4100
+ remove: yi(t),
4101
+ update: vi(t)
4098
4102
  };
4099
4103
  }
4100
- function bi(t) {
4104
+ function wi(t) {
4101
4105
  return async (e, n) => {
4102
4106
  const a = {
4103
4107
  id: Ke(),
@@ -4113,7 +4117,7 @@ function bi(t) {
4113
4117
  }).execute(), a;
4114
4118
  };
4115
4119
  }
4116
- function wi(t, e) {
4120
+ function xi(t, e) {
4117
4121
  var n = {};
4118
4122
  for (var a in t) Object.prototype.hasOwnProperty.call(t, a) && e.indexOf(a) < 0 && (n[a] = t[a]);
4119
4123
  if (t != null && typeof Object.getOwnPropertySymbols == "function")
@@ -4121,7 +4125,7 @@ function wi(t, e) {
4121
4125
  e.indexOf(a[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, a[r]) && (n[a[r]] = t[a[r]]);
4122
4126
  return n;
4123
4127
  }
4124
- function xi(t, e) {
4128
+ function Ni(t, e) {
4125
4129
  var n;
4126
4130
  return ((n = t == null ? void 0 : t._def) === null || n === void 0 ? void 0 : n.typeName) === e;
4127
4131
  }
@@ -4132,15 +4136,15 @@ function mt(t, e) {
4132
4136
  return r._def.openapi = this._def.openapi, r;
4133
4137
  };
4134
4138
  }
4135
- function Ni(t) {
4139
+ function ki(t) {
4136
4140
  if (typeof t.ZodType.prototype.openapi < "u")
4137
4141
  return;
4138
4142
  t.ZodType.prototype.openapi = function(r, s) {
4139
4143
  var o, d, c, l, u, Z;
4140
- const M = typeof r == "string" ? s : r, W = M ?? {}, { param: _e } = W, Je = wi(W, ["param"]), ge = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), ye = Object.assign(Object.assign(Object.assign({}, (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata), Je), !((l = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata) === null || l === void 0) && l.param || _e ? {
4144
+ const M = typeof r == "string" ? s : r, W = M ?? {}, { param: _e } = W, Je = xi(W, ["param"]), ge = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), ye = Object.assign(Object.assign(Object.assign({}, (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata), Je), !((l = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata) === null || l === void 0) && l.param || _e ? {
4141
4145
  param: Object.assign(Object.assign({}, (Z = (u = this._def.openapi) === null || u === void 0 ? void 0 : u.metadata) === null || Z === void 0 ? void 0 : Z.param), _e)
4142
4146
  } : void 0), ve = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(ge).length > 0 ? { _internal: ge } : void 0), Object.keys(ye).length > 0 ? { metadata: ye } : void 0) }));
4143
- if (xi(this, "ZodObject")) {
4147
+ if (Ni(this, "ZodObject")) {
4144
4148
  const We = this.extend;
4145
4149
  ve.extend = function(...qe) {
4146
4150
  var ee, te, ne, be, $e, Pe;
@@ -4278,7 +4282,7 @@ const y = $.arrayToEnum([
4278
4282
  "invalid_intersection_types",
4279
4283
  "not_multiple_of",
4280
4284
  "not_finite"
4281
- ]), ki = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
4285
+ ]), Ci = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
4282
4286
  class J extends Error {
4283
4287
  constructor(e) {
4284
4288
  super(), this.issues = [], this.addIssue = (a) => {
@@ -4396,7 +4400,7 @@ const dt = (t, e) => {
4396
4400
  return { message: n };
4397
4401
  };
4398
4402
  let _a = dt;
4399
- function Ci(t) {
4403
+ function Ti(t) {
4400
4404
  _a = t;
4401
4405
  }
4402
4406
  function ln() {
@@ -4422,7 +4426,7 @@ const un = (t) => {
4422
4426
  path: s,
4423
4427
  message: d
4424
4428
  };
4425
- }, Ti = [];
4429
+ }, Oi = [];
4426
4430
  function _(t, e) {
4427
4431
  const n = ln(), a = un({
4428
4432
  issueData: e,
@@ -4713,14 +4717,14 @@ class I {
4713
4717
  return this.safeParse(null).success;
4714
4718
  }
4715
4719
  }
4716
- const Oi = /^c[^\s-]{8,}$/i, Si = /^[0-9a-z]+$/, ji = /^[0-9A-HJKMNP-TV-Z]{26}$/, Ii = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Zi = /^[a-z0-9_-]{21}$/i, Ei = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, $i = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Pi = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
4720
+ const Si = /^c[^\s-]{8,}$/i, ji = /^[0-9a-z]+$/, Ii = /^[0-9A-HJKMNP-TV-Z]{26}$/, Zi = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Ei = /^[a-z0-9_-]{21}$/i, $i = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Pi = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ai = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
4717
4721
  let xn;
4718
- const Ai = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Di = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, Mi = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, ya = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Ri = new RegExp(`^${ya}$`);
4722
+ const Di = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Mi = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, Ri = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, ya = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Li = new RegExp(`^${ya}$`);
4719
4723
  function va(t) {
4720
4724
  let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
4721
4725
  return t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`), e;
4722
4726
  }
4723
- function Li(t) {
4727
+ function zi(t) {
4724
4728
  return new RegExp(`^${va(t)}$`);
4725
4729
  }
4726
4730
  function ba(t) {
@@ -4728,8 +4732,8 @@ function ba(t) {
4728
4732
  const n = [];
4729
4733
  return n.push(t.local ? "Z?" : "Z"), t.offset && n.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${n.join("|")})`, new RegExp(`^${e}$`);
4730
4734
  }
4731
- function zi(t, e) {
4732
- return !!((e === "v4" || !e) && Ai.test(t) || (e === "v6" || !e) && Di.test(t));
4735
+ function Ui(t, e) {
4736
+ return !!((e === "v4" || !e) && Di.test(t) || (e === "v6" || !e) && Mi.test(t));
4733
4737
  }
4734
4738
  class Q extends I {
4735
4739
  _parse(e) {
@@ -4780,43 +4784,43 @@ class Q extends I {
4780
4784
  message: s.message
4781
4785
  }), a.dirty());
4782
4786
  } else if (s.kind === "email")
4783
- $i.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4787
+ Pi.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4784
4788
  validation: "email",
4785
4789
  code: p.invalid_string,
4786
4790
  message: s.message
4787
4791
  }), a.dirty());
4788
4792
  else if (s.kind === "emoji")
4789
- xn || (xn = new RegExp(Pi, "u")), xn.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4793
+ xn || (xn = new RegExp(Ai, "u")), xn.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4790
4794
  validation: "emoji",
4791
4795
  code: p.invalid_string,
4792
4796
  message: s.message
4793
4797
  }), a.dirty());
4794
4798
  else if (s.kind === "uuid")
4795
- Ii.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4799
+ Zi.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4796
4800
  validation: "uuid",
4797
4801
  code: p.invalid_string,
4798
4802
  message: s.message
4799
4803
  }), a.dirty());
4800
4804
  else if (s.kind === "nanoid")
4801
- Zi.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4805
+ Ei.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4802
4806
  validation: "nanoid",
4803
4807
  code: p.invalid_string,
4804
4808
  message: s.message
4805
4809
  }), a.dirty());
4806
4810
  else if (s.kind === "cuid")
4807
- Oi.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4811
+ Si.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4808
4812
  validation: "cuid",
4809
4813
  code: p.invalid_string,
4810
4814
  message: s.message
4811
4815
  }), a.dirty());
4812
4816
  else if (s.kind === "cuid2")
4813
- Si.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4817
+ ji.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4814
4818
  validation: "cuid2",
4815
4819
  code: p.invalid_string,
4816
4820
  message: s.message
4817
4821
  }), a.dirty());
4818
4822
  else if (s.kind === "ulid")
4819
- ji.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4823
+ Ii.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4820
4824
  validation: "ulid",
4821
4825
  code: p.invalid_string,
4822
4826
  message: s.message
@@ -4851,23 +4855,23 @@ class Q extends I {
4851
4855
  code: p.invalid_string,
4852
4856
  validation: "datetime",
4853
4857
  message: s.message
4854
- }), a.dirty()) : s.kind === "date" ? Ri.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4858
+ }), a.dirty()) : s.kind === "date" ? Li.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4855
4859
  code: p.invalid_string,
4856
4860
  validation: "date",
4857
4861
  message: s.message
4858
- }), a.dirty()) : s.kind === "time" ? Li(s).test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4862
+ }), a.dirty()) : s.kind === "time" ? zi(s).test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4859
4863
  code: p.invalid_string,
4860
4864
  validation: "time",
4861
4865
  message: s.message
4862
- }), a.dirty()) : s.kind === "duration" ? Ei.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4866
+ }), a.dirty()) : s.kind === "duration" ? $i.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4863
4867
  validation: "duration",
4864
4868
  code: p.invalid_string,
4865
4869
  message: s.message
4866
- }), a.dirty()) : s.kind === "ip" ? zi(e.data, s.version) || (r = this._getOrReturnCtx(e, r), _(r, {
4870
+ }), a.dirty()) : s.kind === "ip" ? Ui(e.data, s.version) || (r = this._getOrReturnCtx(e, r), _(r, {
4867
4871
  validation: "ip",
4868
4872
  code: p.invalid_string,
4869
4873
  message: s.message
4870
- }), a.dirty()) : s.kind === "base64" ? Mi.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4874
+ }), a.dirty()) : s.kind === "base64" ? Ri.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4871
4875
  validation: "base64",
4872
4876
  code: p.invalid_string,
4873
4877
  message: s.message
@@ -5089,7 +5093,7 @@ Q.create = (t) => {
5089
5093
  ...S(t)
5090
5094
  });
5091
5095
  };
5092
- function Ui(t, e) {
5096
+ function Fi(t, e) {
5093
5097
  const n = (t.toString().split(".")[1] || "").length, a = (e.toString().split(".")[1] || "").length, r = n > a ? n : a, s = parseInt(t.toFixed(r).replace(".", "")), o = parseInt(e.toFixed(r).replace(".", ""));
5094
5098
  return s % o / Math.pow(10, r);
5095
5099
  }
@@ -5128,7 +5132,7 @@ class Se extends I {
5128
5132
  inclusive: s.inclusive,
5129
5133
  exact: !1,
5130
5134
  message: s.message
5131
- }), r.dirty()) : s.kind === "multipleOf" ? Ui(e.data, s.value) !== 0 && (a = this._getOrReturnCtx(e, a), _(a, {
5135
+ }), r.dirty()) : s.kind === "multipleOf" ? Fi(e.data, s.value) !== 0 && (a = this._getOrReturnCtx(e, a), _(a, {
5132
5136
  code: p.not_multiple_of,
5133
5137
  multipleOf: s.value,
5134
5138
  message: s.message
@@ -6829,7 +6833,7 @@ _n.create = (t) => new _n({
6829
6833
  typeName: N.ZodNaN,
6830
6834
  ...S(t)
6831
6835
  });
6832
- const Fi = Symbol("zod_brand");
6836
+ const Vi = Symbol("zod_brand");
6833
6837
  class Vn extends I {
6834
6838
  _parse(e) {
6835
6839
  const { ctx: n } = this._processInputParams(e), a = n.data;
@@ -6906,16 +6910,16 @@ function xa(t, e = {}, n) {
6906
6910
  }
6907
6911
  }) : ct.create();
6908
6912
  }
6909
- const Vi = {
6913
+ const Bi = {
6910
6914
  object: D.lazycreate
6911
6915
  };
6912
6916
  var N;
6913
6917
  (function(t) {
6914
6918
  t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
6915
6919
  })(N || (N = {}));
6916
- const Bi = (t, e = {
6920
+ const Ki = (t, e = {
6917
6921
  message: `Input not instance of ${t.name}`
6918
- }) => xa((n) => n instanceof t, e), Na = Q.create, ka = Se.create, Ki = _n.create, Ji = je.create, Ca = Mt.create, Wi = Fe.create, qi = pn.create, Qi = Rt.create, Gi = Lt.create, Hi = ct.create, Yi = Le.create, Xi = fe.create, eo = mn.create, to = H.create, no = D.create, ao = D.strictCreate, ro = zt.create, so = vn.create, io = Ut.create, oo = ce.create, co = Ft.create, lo = fn.create, uo = Ve.create, ho = at.create, po = Vt.create, mo = Bt.create, fo = Ie.create, _o = Kt.create, go = lt.create, Gn = X.create, yo = se.create, vo = Ze.create, bo = X.createWithPreprocess, wo = Yt.create, xo = () => Na().optional(), No = () => ka().optional(), ko = () => Ca().optional(), Co = {
6922
+ }) => xa((n) => n instanceof t, e), Na = Q.create, ka = Se.create, Ji = _n.create, Wi = je.create, Ca = Mt.create, qi = Fe.create, Qi = pn.create, Gi = Rt.create, Hi = Lt.create, Yi = ct.create, Xi = Le.create, eo = fe.create, to = mn.create, no = H.create, ao = D.create, ro = D.strictCreate, so = zt.create, io = vn.create, oo = Ut.create, co = ce.create, lo = Ft.create, uo = fn.create, ho = Ve.create, po = at.create, mo = Vt.create, fo = Bt.create, _o = Ie.create, go = Kt.create, yo = lt.create, Gn = X.create, vo = se.create, bo = Ze.create, wo = X.createWithPreprocess, xo = Yt.create, No = () => Na().optional(), ko = () => ka().optional(), Co = () => Ca().optional(), To = {
6919
6923
  string: (t) => Q.create({ ...t, coerce: !0 }),
6920
6924
  number: (t) => Se.create({ ...t, coerce: !0 }),
6921
6925
  boolean: (t) => Mt.create({
@@ -6924,14 +6928,14 @@ const Bi = (t, e = {
6924
6928
  }),
6925
6929
  bigint: (t) => je.create({ ...t, coerce: !0 }),
6926
6930
  date: (t) => Fe.create({ ...t, coerce: !0 })
6927
- }, To = k;
6928
- var Oo = /* @__PURE__ */ Object.freeze({
6931
+ }, Oo = k;
6932
+ var So = /* @__PURE__ */ Object.freeze({
6929
6933
  __proto__: null,
6930
6934
  defaultErrorMap: dt,
6931
- setErrorMap: Ci,
6935
+ setErrorMap: Ti,
6932
6936
  getErrorMap: ln,
6933
6937
  makeIssue: un,
6934
- EMPTY_PATH: Ti,
6938
+ EMPTY_PATH: Oi,
6935
6939
  addIssueToContext: _,
6936
6940
  ParseStatus: F,
6937
6941
  INVALID: k,
@@ -6985,63 +6989,63 @@ var Oo = /* @__PURE__ */ Object.freeze({
6985
6989
  ZodDefault: Jt,
6986
6990
  ZodCatch: Wt,
6987
6991
  ZodNaN: _n,
6988
- BRAND: Fi,
6992
+ BRAND: Vi,
6989
6993
  ZodBranded: Vn,
6990
6994
  ZodPipeline: Yt,
6991
6995
  ZodReadonly: qt,
6992
6996
  custom: xa,
6993
6997
  Schema: I,
6994
6998
  ZodSchema: I,
6995
- late: Vi,
6999
+ late: Bi,
6996
7000
  get ZodFirstPartyTypeKind() {
6997
7001
  return N;
6998
7002
  },
6999
- coerce: Co,
7000
- any: Hi,
7001
- array: to,
7002
- bigint: Ji,
7003
+ coerce: To,
7004
+ any: Yi,
7005
+ array: no,
7006
+ bigint: Wi,
7003
7007
  boolean: Ca,
7004
- date: Wi,
7005
- discriminatedUnion: so,
7008
+ date: qi,
7009
+ discriminatedUnion: io,
7006
7010
  effect: Gn,
7007
- enum: fo,
7008
- function: ho,
7009
- instanceof: Bi,
7010
- intersection: io,
7011
- lazy: po,
7012
- literal: mo,
7013
- map: lo,
7014
- nan: Ki,
7015
- nativeEnum: _o,
7016
- never: Xi,
7017
- null: Gi,
7018
- nullable: vo,
7011
+ enum: _o,
7012
+ function: po,
7013
+ instanceof: Ki,
7014
+ intersection: oo,
7015
+ lazy: mo,
7016
+ literal: fo,
7017
+ map: uo,
7018
+ nan: Ji,
7019
+ nativeEnum: go,
7020
+ never: eo,
7021
+ null: Hi,
7022
+ nullable: bo,
7019
7023
  number: ka,
7020
- object: no,
7021
- oboolean: ko,
7022
- onumber: No,
7023
- optional: yo,
7024
- ostring: xo,
7025
- pipeline: wo,
7026
- preprocess: bo,
7027
- promise: go,
7028
- record: co,
7029
- set: uo,
7030
- strictObject: ao,
7024
+ object: ao,
7025
+ oboolean: Co,
7026
+ onumber: ko,
7027
+ optional: vo,
7028
+ ostring: No,
7029
+ pipeline: xo,
7030
+ preprocess: wo,
7031
+ promise: yo,
7032
+ record: lo,
7033
+ set: ho,
7034
+ strictObject: ro,
7031
7035
  string: Na,
7032
- symbol: qi,
7036
+ symbol: Qi,
7033
7037
  transformer: Gn,
7034
- tuple: oo,
7035
- undefined: Qi,
7036
- union: ro,
7037
- unknown: Yi,
7038
- void: eo,
7039
- NEVER: To,
7038
+ tuple: co,
7039
+ undefined: Gi,
7040
+ union: so,
7041
+ unknown: Xi,
7042
+ void: to,
7043
+ NEVER: Oo,
7040
7044
  ZodIssueCode: p,
7041
- quotelessJson: ki,
7045
+ quotelessJson: Ci,
7042
7046
  ZodError: J
7043
7047
  });
7044
- Ni(Oo);
7048
+ ki(So);
7045
7049
  function Xt(t, e = "", n = {}) {
7046
7050
  for (let a in t)
7047
7051
  if (Object.prototype.hasOwnProperty.call(t, a)) {
@@ -7068,7 +7072,7 @@ function Ta(t, e) {
7068
7072
  }
7069
7073
  return n;
7070
7074
  }
7071
- function So(t) {
7075
+ function jo(t) {
7072
7076
  return async (e, n) => {
7073
7077
  let a = t.selectFrom("connections").where("connections.tenant_id", "=", e);
7074
7078
  n.q && (a = Be(t, a, n.q, ["user_id", "ip"]));
@@ -7083,10 +7087,10 @@ function So(t) {
7083
7087
  };
7084
7088
  };
7085
7089
  }
7086
- function jo(t) {
7090
+ function Io(t) {
7087
7091
  return async (e, n) => (await t.deleteFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", n).executeTakeFirst()).numDeletedRows > 0;
7088
7092
  }
7089
- function Io(t) {
7093
+ function Zo(t) {
7090
7094
  return async (e, n) => {
7091
7095
  const a = await t.selectFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", n).selectAll().executeTakeFirst();
7092
7096
  return a ? R({
@@ -7095,7 +7099,7 @@ function Io(t) {
7095
7099
  }) : null;
7096
7100
  };
7097
7101
  }
7098
- function Zo(t) {
7102
+ function Eo(t) {
7099
7103
  return async (e, n, a) => {
7100
7104
  const r = {
7101
7105
  ...a,
@@ -7107,16 +7111,16 @@ function Zo(t) {
7107
7111
  }).where("connections.id", "=", n).where("connections.tenant_id", "=", e).execute(), !0;
7108
7112
  };
7109
7113
  }
7110
- function Eo(t) {
7114
+ function $o(t) {
7111
7115
  return {
7112
- create: bi(t),
7113
- get: Io(t),
7114
- list: So(t),
7115
- remove: jo(t),
7116
- update: Zo(t)
7116
+ create: wi(t),
7117
+ get: Zo(t),
7118
+ list: jo(t),
7119
+ remove: Io(t),
7120
+ update: Eo(t)
7117
7121
  };
7118
7122
  }
7119
- function $o(t) {
7123
+ function Po(t) {
7120
7124
  return {
7121
7125
  get: async (e) => {
7122
7126
  const n = await t.selectFrom("applications").selectAll().where("id", "=", e).executeTakeFirst();
@@ -7150,7 +7154,7 @@ function $o(t) {
7150
7154
  }
7151
7155
  };
7152
7156
  }
7153
- function Po(t) {
7157
+ function Ao(t) {
7154
7158
  return async () => await t.selectFrom("keys").where(
7155
7159
  (n) => n.or([
7156
7160
  n("revoked_at", ">", (/* @__PURE__ */ new Date()).toISOString()),
@@ -7158,22 +7162,22 @@ function Po(t) {
7158
7162
  ])
7159
7163
  ).selectAll().execute();
7160
7164
  }
7161
- function Ao(t) {
7165
+ function Do(t) {
7162
7166
  return async (e) => {
7163
7167
  await t.insertInto("keys").values({ ...e, created_at: (/* @__PURE__ */ new Date()).toDateString() }).execute();
7164
7168
  };
7165
7169
  }
7166
- function Do(t) {
7170
+ function Mo(t) {
7167
7171
  return async (e, n) => !!(await t.updateTable("keys").set(n).where("kid", "=", e).execute()).length;
7168
7172
  }
7169
- function Mo(t) {
7173
+ function Ro(t) {
7170
7174
  return {
7171
- create: Ao(t),
7172
- list: Po(t),
7173
- update: Do(t)
7175
+ create: Do(t),
7176
+ list: Ao(t),
7177
+ update: Mo(t)
7174
7178
  };
7175
7179
  }
7176
- function Ro(t) {
7180
+ function Lo(t) {
7177
7181
  return async (e, n) => {
7178
7182
  const a = {
7179
7183
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
@@ -7185,7 +7189,7 @@ function Ro(t) {
7185
7189
  return await t.insertInto("domains").values(a).execute(), a;
7186
7190
  };
7187
7191
  }
7188
- function Lo(t) {
7192
+ function zo(t) {
7189
7193
  return async (e, n) => {
7190
7194
  let a = t.selectFrom("domains").where("domains.tenant_id", "=", e);
7191
7195
  n.q && (a = Be(t, a, n.q, ["user_id", "ip"]));
@@ -7198,13 +7202,13 @@ function Lo(t) {
7198
7202
  };
7199
7203
  };
7200
7204
  }
7201
- function zo(t) {
7205
+ function Uo(t) {
7202
7206
  return {
7203
- create: Ro(t),
7204
- list: Lo(t)
7207
+ create: Lo(t),
7208
+ list: zo(t)
7205
7209
  };
7206
7210
  }
7207
- function Uo(t) {
7211
+ function Fo(t) {
7208
7212
  return async (e) => {
7209
7213
  const [n] = await t.selectFrom("branding").where("branding.tenant_id", "=", e).selectAll().execute();
7210
7214
  if (!n)
@@ -7234,7 +7238,7 @@ function Uo(t) {
7234
7238
  });
7235
7239
  };
7236
7240
  }
7237
- function Fo(t) {
7241
+ function Vo(t) {
7238
7242
  return async (e, n) => {
7239
7243
  var o, d, c, l, u, Z, M, W, _e, Je, ge, ye, ve, We, qe, ee, te, ne;
7240
7244
  const { colors: a, font: r, ...s } = n;
@@ -7262,13 +7266,13 @@ function Fo(t) {
7262
7266
  }
7263
7267
  };
7264
7268
  }
7265
- function Vo(t) {
7269
+ function Bo(t) {
7266
7270
  return {
7267
- get: Uo(t),
7268
- set: Fo(t)
7271
+ get: Fo(t),
7272
+ set: Vo(t)
7269
7273
  };
7270
7274
  }
7271
- function Bo(t) {
7275
+ function Ko(t) {
7272
7276
  return async (e, n) => {
7273
7277
  let a = t.selectFrom("hooks").where("hooks.tenant_id", "=", e);
7274
7278
  n.q && (a = Be(t, a, n.q, ["url"]));
@@ -7288,7 +7292,7 @@ function Bo(t) {
7288
7292
  };
7289
7293
  };
7290
7294
  }
7291
- function Ko(t) {
7295
+ function Jo(t) {
7292
7296
  return async (e, n) => {
7293
7297
  const a = await t.selectFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", n).selectAll().executeTakeFirst();
7294
7298
  return a ? R({
@@ -7298,10 +7302,10 @@ function Ko(t) {
7298
7302
  }) : null;
7299
7303
  };
7300
7304
  }
7301
- function Jo(t) {
7305
+ function Wo(t) {
7302
7306
  return async (e, n) => (await t.deleteFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", n).executeTakeFirst()).numDeletedRows > 0;
7303
7307
  }
7304
- function Wo(t) {
7308
+ function qo(t) {
7305
7309
  return async (e, n) => {
7306
7310
  const a = {
7307
7311
  hook_id: Ke(),
@@ -7317,7 +7321,7 @@ function Wo(t) {
7317
7321
  }).execute(), a;
7318
7322
  };
7319
7323
  }
7320
- function qo(t) {
7324
+ function Qo(t) {
7321
7325
  return async (e, n, a) => {
7322
7326
  const r = {
7323
7327
  ...a,
@@ -7328,16 +7332,16 @@ function qo(t) {
7328
7332
  return await t.updateTable("hooks").set(r).where("hooks.hook_id", "=", n).where("hooks.tenant_id", "=", e).execute(), !0;
7329
7333
  };
7330
7334
  }
7331
- function Qo(t) {
7335
+ function Go(t) {
7332
7336
  return {
7333
- create: Wo(t),
7334
- get: Ko(t),
7335
- list: Bo(t),
7336
- update: qo(t),
7337
- remove: Jo(t)
7337
+ create: qo(t),
7338
+ get: Jo(t),
7339
+ list: Ko(t),
7340
+ update: Qo(t),
7341
+ remove: Wo(t)
7338
7342
  };
7339
7343
  }
7340
- function Go(t) {
7344
+ function Ho(t) {
7341
7345
  return async (e, n) => {
7342
7346
  const a = {
7343
7347
  themeId: Ke(),
@@ -7348,16 +7352,16 @@ function Go(t) {
7348
7352
  return await t.insertInto("themes").values({ ...Xt(a), tenant_id: e }).execute(), a;
7349
7353
  };
7350
7354
  }
7351
- function Ho(t) {
7355
+ function Yo(t) {
7352
7356
  return async (e, n) => (await t.deleteFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", n).executeTakeFirst()).numDeletedRows > 0;
7353
7357
  }
7354
- function Yo(t) {
7358
+ function Xo(t) {
7355
7359
  return async (e, n) => {
7356
7360
  const a = await t.selectFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", n).selectAll().executeTakeFirst();
7357
7361
  return a ? R(a) : null;
7358
7362
  };
7359
7363
  }
7360
- function Xo(t) {
7364
+ function ed(t) {
7361
7365
  return async (e, n, a) => {
7362
7366
  const r = Xt({
7363
7367
  ...a,
@@ -7366,15 +7370,15 @@ function Xo(t) {
7366
7370
  return await t.updateTable("themes").set(r).where("themes.id", "=", n).where("themes.tenant_id", "=", e).execute(), !0;
7367
7371
  };
7368
7372
  }
7369
- function ed(t) {
7373
+ function td(t) {
7370
7374
  return {
7371
- create: Go(t),
7372
- get: Yo(t),
7373
- remove: Ho(t),
7374
- update: Xo(t)
7375
+ create: Ho(t),
7376
+ get: Xo(t),
7377
+ remove: Yo(t),
7378
+ update: ed(t)
7375
7379
  };
7376
7380
  }
7377
- function td(t) {
7381
+ function nd(t) {
7378
7382
  return async (e, n) => {
7379
7383
  const a = (/* @__PURE__ */ new Date()).toISOString(), r = await t.selectFrom("logins").where("logins.expires_at", ">", a).where("logins.login_id", "=", n).selectAll().executeTakeFirst();
7380
7384
  return r ? xs.parse(
@@ -7382,7 +7386,7 @@ function td(t) {
7382
7386
  ) : null;
7383
7387
  };
7384
7388
  }
7385
- function nd(t) {
7389
+ function ad(t) {
7386
7390
  return async (e, n) => {
7387
7391
  const a = {
7388
7392
  login_id: Ke(),
@@ -7393,21 +7397,21 @@ function nd(t) {
7393
7397
  return await t.insertInto("logins").values({ ...Xt(a), tenant_id: e }).execute(), a;
7394
7398
  };
7395
7399
  }
7396
- function ad(t) {
7400
+ function rd(t) {
7397
7401
  return async (e, n, a) => (await t.updateTable("logins").set(Xt(a)).where("logins.login_id", "=", n).where("logins.tenant_id", "=", e).execute()).length === 1;
7398
7402
  }
7399
- function rd(t) {
7403
+ function sd(t) {
7400
7404
  return async (e, n) => (await t.deleteFrom("logins").where("logins.tenant_id", "=", e).where("logins.login_id", "=", n).execute()).length > 0;
7401
7405
  }
7402
- function sd(t) {
7406
+ function id(t) {
7403
7407
  return {
7404
- create: nd(t),
7405
- get: td(t),
7406
- update: ad(t),
7407
- remove: rd(t)
7408
+ create: ad(t),
7409
+ get: nd(t),
7410
+ update: rd(t),
7411
+ remove: sd(t)
7408
7412
  };
7409
7413
  }
7410
- function id(t) {
7414
+ function od(t) {
7411
7415
  return async (e) => {
7412
7416
  const [n] = await t.selectFrom("prompt_settings").where("prompt_settings.tenant_id", "=", e).selectAll().execute();
7413
7417
  return R({
@@ -7427,7 +7431,7 @@ function Hn(t) {
7427
7431
  universal_login_experience: t.universal_login_experience
7428
7432
  });
7429
7433
  }
7430
- function od(t) {
7434
+ function dd(t) {
7431
7435
  return async (e, n) => {
7432
7436
  try {
7433
7437
  const a = $s.parse(n);
@@ -7440,13 +7444,13 @@ function od(t) {
7440
7444
  }
7441
7445
  };
7442
7446
  }
7443
- function dd(t) {
7447
+ function cd(t) {
7444
7448
  return {
7445
- get: id(t),
7446
- set: od(t)
7449
+ get: od(t),
7450
+ set: dd(t)
7447
7451
  };
7448
7452
  }
7449
- function cd(t) {
7453
+ function ld(t) {
7450
7454
  return async (e) => {
7451
7455
  const [n] = await t.selectFrom("email_providers").where("email_providers.tenant_id", "=", e).selectAll().execute();
7452
7456
  if (!n)
@@ -7466,7 +7470,7 @@ function cd(t) {
7466
7470
  });
7467
7471
  };
7468
7472
  }
7469
- function ld(t) {
7473
+ function ud(t) {
7470
7474
  return async (e, n) => {
7471
7475
  const { credentials: a, settings: r, enabled: s, ...o } = n;
7472
7476
  await t.updateTable("email_providers").set({
@@ -7477,7 +7481,7 @@ function ld(t) {
7477
7481
  }).where("tenant_id", "=", e).execute();
7478
7482
  };
7479
7483
  }
7480
- function ud(t) {
7484
+ function hd(t) {
7481
7485
  return async (e, n) => {
7482
7486
  const { credentials: a, settings: r, enabled: s, ...o } = n;
7483
7487
  await t.insertInto("email_providers").values({
@@ -7491,14 +7495,14 @@ function ud(t) {
7491
7495
  }).execute();
7492
7496
  };
7493
7497
  }
7494
- function hd(t) {
7498
+ function pd(t) {
7495
7499
  return {
7496
- get: cd(t),
7497
- create: ud(t),
7498
- update: ld(t)
7500
+ get: ld(t),
7501
+ create: hd(t),
7502
+ update: ud(t)
7499
7503
  };
7500
7504
  }
7501
- function pd(t) {
7505
+ function md(t) {
7502
7506
  return t[t.length - 1];
7503
7507
  }
7504
7508
  function z(t) {
@@ -7531,7 +7535,7 @@ const en = z({
7531
7535
  identifier: en.create(e)
7532
7536
  });
7533
7537
  }
7534
- }), md = z({
7538
+ }), fd = z({
7535
7539
  is(t) {
7536
7540
  return t.kind === "AliasNode";
7537
7541
  },
@@ -7560,7 +7564,7 @@ const en = z({
7560
7564
  }
7561
7565
  });
7562
7566
  var gn;
7563
- class fd {
7567
+ class _d {
7564
7568
  constructor() {
7565
7569
  ut(this, "nodeStack", []);
7566
7570
  ae(this, gn, z({
@@ -8394,7 +8398,7 @@ class fd {
8394
8398
  }
8395
8399
  }
8396
8400
  gn = new WeakMap();
8397
- const _d = z({
8401
+ const gd = z({
8398
8402
  AlterTableNode: !0,
8399
8403
  CreateIndexNode: !0,
8400
8404
  CreateSchemaNode: !0,
@@ -8414,7 +8418,7 @@ const _d = z({
8414
8418
  MergeQueryNode: !0
8415
8419
  });
8416
8420
  var rt, De, Me, L, Oa, Sa, ja, Ye, Dn, Ia;
8417
- class gd extends fd {
8421
+ class yd extends _d {
8418
8422
  constructor(n) {
8419
8423
  super();
8420
8424
  ae(this, L);
@@ -8455,7 +8459,7 @@ class gd extends fd {
8455
8459
  }
8456
8460
  }
8457
8461
  rt = new WeakMap(), De = new WeakMap(), Me = new WeakMap(), L = new WeakSet(), Oa = function(n) {
8458
- return n.kind in _d;
8462
+ return n.kind in gd;
8459
8463
  }, Sa = function(n) {
8460
8464
  const a = /* @__PURE__ */ new Set();
8461
8465
  if ("name" in n && n.name && An.is(n.name) && T(this, L, Dn).call(this, n.name, a), "from" in n && n.from)
@@ -8469,7 +8473,7 @@ rt = new WeakMap(), De = new WeakMap(), Me = new WeakMap(), L = new WeakSet(), O
8469
8473
  const a = /* @__PURE__ */ new Set();
8470
8474
  return "with" in n && n.with && T(this, L, Ia).call(this, n.with, a), a;
8471
8475
  }, Ye = function(n, a) {
8472
- const r = Nn.is(n) ? n : md.is(n) && Nn.is(n.node) ? n.node : null;
8476
+ const r = Nn.is(n) ? n : fd.is(n) && Nn.is(n.node) ? n.node : null;
8473
8477
  r && T(this, L, Dn).call(this, r.table, a);
8474
8478
  }, Dn = function(n, a) {
8475
8479
  const r = n.identifier.name;
@@ -8481,10 +8485,10 @@ rt = new WeakMap(), De = new WeakMap(), Me = new WeakMap(), L = new WeakSet(), O
8481
8485
  }
8482
8486
  };
8483
8487
  var Qt;
8484
- class yd {
8488
+ class vd {
8485
8489
  constructor(e) {
8486
8490
  ae(this, Qt);
8487
- ht(this, Qt, new gd(e));
8491
+ ht(this, Qt, new yd(e));
8488
8492
  }
8489
8493
  transformQuery(e) {
8490
8494
  return v(this, Qt).transformNode(e.node);
@@ -8494,7 +8498,7 @@ class yd {
8494
8498
  }
8495
8499
  }
8496
8500
  Qt = new WeakMap();
8497
- class vd {
8501
+ class bd {
8498
8502
  transformQuery(e) {
8499
8503
  return e.node;
8500
8504
  }
@@ -8502,7 +8506,7 @@ class vd {
8502
8506
  return e.result;
8503
8507
  }
8504
8508
  }
8505
- const bd = "kysely_migration", Yn = "kysely_migration_lock", wd = !1, kn = "migration_lock", xd = z({ __noMigrations__: !0 });
8509
+ const wd = "kysely_migration", Yn = "kysely_migration_lock", xd = !1, kn = "migration_lock", Nd = z({ __noMigrations__: !0 });
8506
8510
  var P, m, vt, ue, he, Xe, Ea, pe, $a, Pa, Aa, Da, Ma, Mn, et, Rn, Ra, La, za, Ln, Ua, Fa, Va, Ba, Ka, bt;
8507
8511
  class Za {
8508
8512
  constructor(e) {
@@ -8601,7 +8605,7 @@ class Za {
8601
8605
  */
8602
8606
  async migrateTo(e) {
8603
8607
  return T(this, m, vt).call(this, ({ migrations: n, executedMigrations: a, pendingMigrations: r }) => {
8604
- if (e === xd)
8608
+ if (e === Nd)
8605
8609
  return { direction: "Down", step: 1 / 0 };
8606
8610
  if (!n.find((d) => d.name === e))
8607
8611
  throw new Error(`migration "${e}" doesn't exist`);
@@ -8660,13 +8664,13 @@ P = new WeakMap(), m = new WeakSet(), vt = async function(e) {
8660
8664
  }, ue = function() {
8661
8665
  return v(this, P).migrationTableSchema;
8662
8666
  }, he = function() {
8663
- return v(this, P).migrationTableName ?? bd;
8667
+ return v(this, P).migrationTableName ?? wd;
8664
8668
  }, Xe = function() {
8665
8669
  return v(this, P).migrationLockTableName ?? Yn;
8666
8670
  }, Ea = function() {
8667
- return v(this, P).allowUnorderedMigrations ?? wd;
8671
+ return v(this, P).allowUnorderedMigrations ?? xd;
8668
8672
  }, pe = function() {
8669
- return v(this, m, ue) ? new yd(v(this, m, ue)) : new vd();
8673
+ return v(this, m, ue) ? new vd(v(this, m, ue)) : new bd();
8670
8674
  }, $a = async function() {
8671
8675
  await T(this, m, Pa).call(this), await T(this, m, Aa).call(this), await T(this, m, Da).call(this), await T(this, m, Ma).call(this);
8672
8676
  }, Pa = async function() {
@@ -8735,7 +8739,7 @@ P = new WeakMap(), m = new WeakSet(), vt = async function(e) {
8735
8739
  return z({
8736
8740
  migrations: n,
8737
8741
  executedMigrations: a,
8738
- lastMigration: pd(a),
8742
+ lastMigration: md(a),
8739
8743
  pendingMigrations: r
8740
8744
  });
8741
8745
  }, za = function(e, n) {
@@ -8835,7 +8839,7 @@ class Ja {
8835
8839
  return this.migrations;
8836
8840
  }
8837
8841
  }
8838
- async function Nd(t) {
8842
+ async function kd(t) {
8839
8843
  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(
8840
8844
  "tenant_id",
8841
8845
  "varchar(255)",
@@ -8903,35 +8907,35 @@ async function Nd(t) {
8903
8907
  (e) => e.references("tenants.id").onDelete("cascade").notNull()
8904
8908
  ).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();
8905
8909
  }
8906
- async function kd(t) {
8910
+ async function Cd(t) {
8907
8911
  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();
8908
8912
  }
8909
- const Cd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8913
+ const Td = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8910
8914
  __proto__: null,
8911
- down: kd,
8912
- up: Nd
8915
+ down: Cd,
8916
+ up: kd
8913
8917
  }, Symbol.toStringTag, { value: "Module" }));
8914
- async function Td(t) {
8918
+ async function Od(t) {
8915
8919
  await t.schema.alterTable("tenants").addColumn("support_url", "varchar(255)").execute();
8916
8920
  }
8917
- async function Od(t) {
8921
+ async function Sd(t) {
8918
8922
  await t.schema.alterTable("tenants").dropColumn("support_url").execute();
8919
8923
  }
8920
- const Sd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8924
+ const jd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8921
8925
  __proto__: null,
8922
- down: Od,
8923
- up: Td
8926
+ down: Sd,
8927
+ up: Od
8924
8928
  }, Symbol.toStringTag, { value: "Module" }));
8925
- async function jd(t) {
8926
- }
8927
8929
  async function Id(t) {
8928
8930
  }
8929
- const Zd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8931
+ async function Zd(t) {
8932
+ }
8933
+ const Ed = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8930
8934
  __proto__: null,
8931
- down: Id,
8932
- up: jd
8935
+ down: Zd,
8936
+ up: Id
8933
8937
  }, Symbol.toStringTag, { value: "Module" }));
8934
- async function Ed(t) {
8938
+ async function $d(t) {
8935
8939
  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(
8936
8940
  "tenant_id_constraint",
8937
8941
  ["tenant_id"],
@@ -8940,24 +8944,24 @@ async function Ed(t) {
8940
8944
  (e) => e.onDelete("cascade")
8941
8945
  ).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();
8942
8946
  }
8943
- async function $d(t) {
8947
+ async function Pd(t) {
8944
8948
  await t.schema.dropTable("logs").execute();
8945
8949
  }
8946
- const Pd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8950
+ const Ad = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8947
8951
  __proto__: null,
8948
- down: $d,
8949
- up: Ed
8952
+ down: Pd,
8953
+ up: $d
8950
8954
  }, Symbol.toStringTag, { value: "Module" }));
8951
- async function Ad(t) {
8952
- }
8953
8955
  async function Dd(t) {
8954
8956
  }
8955
- const Md = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8957
+ async function Md(t) {
8958
+ }
8959
+ const Rd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8956
8960
  __proto__: null,
8957
- down: Dd,
8958
- up: Ad
8961
+ down: Md,
8962
+ up: Dd
8959
8963
  }, Symbol.toStringTag, { value: "Module" }));
8960
- async function Rd(t) {
8964
+ async function Ld(t) {
8961
8965
  await t.schema.createTable("sessions").addColumn("session_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
8962
8966
  "client_id",
8963
8967
  "varchar(255)",
@@ -8986,15 +8990,15 @@ async function Rd(t) {
8986
8990
  (e) => e.references("applications.id").onDelete("cascade").notNull()
8987
8991
  ).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();
8988
8992
  }
8989
- async function Ld(t) {
8993
+ async function zd(t) {
8990
8994
  await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("tickets").execute(), await t.schema.dropTable("otps").execute();
8991
8995
  }
8992
- const zd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8996
+ const Ud = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8993
8997
  __proto__: null,
8994
- down: Ld,
8995
- up: Rd
8998
+ down: zd,
8999
+ up: Ld
8996
9000
  }, Symbol.toStringTag, { value: "Module" }));
8997
- async function Ud(t) {
9001
+ async function Fd(t) {
8998
9002
  await t.schema.createTable("passwords").addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
8999
9003
  "user_id_constraint",
9000
9004
  ["user_id", "tenant_id"],
@@ -9009,24 +9013,24 @@ async function Ud(t) {
9009
9013
  (e) => e.onDelete("cascade")
9010
9014
  ).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();
9011
9015
  }
9012
- async function Fd(t) {
9016
+ async function Vd(t) {
9013
9017
  await t.schema.dropTable("passwords").execute(), await t.schema.dropTable("codes").execute();
9014
9018
  }
9015
- const Vd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9019
+ const Bd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9016
9020
  __proto__: null,
9017
- down: Fd,
9018
- up: Ud
9021
+ down: Vd,
9022
+ up: Fd
9019
9023
  }, Symbol.toStringTag, { value: "Module" }));
9020
- async function Bd(t) {
9021
- }
9022
9024
  async function Kd(t) {
9023
9025
  }
9024
- const Jd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9026
+ async function Jd(t) {
9027
+ }
9028
+ const Wd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9025
9029
  __proto__: null,
9026
- down: Kd,
9027
- up: Bd
9030
+ down: Jd,
9031
+ up: Kd
9028
9032
  }, Symbol.toStringTag, { value: "Module" }));
9029
- async function Wd(t) {
9033
+ async function qd(t) {
9030
9034
  await t.schema.alterTable("passwords").addColumn(
9031
9035
  "password",
9032
9036
  "varchar(255)",
@@ -9034,288 +9038,288 @@ async function Wd(t) {
9034
9038
  (e) => e.notNull()
9035
9039
  ).execute();
9036
9040
  }
9037
- async function qd(t) {
9041
+ async function Qd(t) {
9038
9042
  await t.schema.alterTable("passwords").dropColumn("password").execute();
9039
9043
  }
9040
- const Qd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9044
+ const Gd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9041
9045
  __proto__: null,
9042
- down: qd,
9043
- up: Wd
9046
+ down: Qd,
9047
+ up: qd
9044
9048
  }, Symbol.toStringTag, { value: "Module" }));
9045
- async function Gd(t) {
9046
- }
9047
9049
  async function Hd(t) {
9048
9050
  }
9049
- const Yd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9051
+ async function Yd(t) {
9052
+ }
9053
+ const Xd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9050
9054
  __proto__: null,
9051
- down: Hd,
9052
- up: Gd
9055
+ down: Yd,
9056
+ up: Hd
9053
9057
  }, Symbol.toStringTag, { value: "Module" }));
9054
- async function Xd(t) {
9055
- }
9056
9058
  async function ec(t) {
9057
9059
  }
9058
- const tc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9060
+ async function tc(t) {
9061
+ }
9062
+ const nc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9059
9063
  __proto__: null,
9060
- down: ec,
9061
- up: Xd
9064
+ down: tc,
9065
+ up: ec
9062
9066
  }, Symbol.toStringTag, { value: "Module" }));
9063
- async function nc(t) {
9064
- }
9065
9067
  async function ac(t) {
9066
9068
  }
9067
- const rc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9069
+ async function rc(t) {
9070
+ }
9071
+ const sc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9068
9072
  __proto__: null,
9069
- down: ac,
9070
- up: nc
9073
+ down: rc,
9074
+ up: ac
9071
9075
  }, Symbol.toStringTag, { value: "Module" }));
9072
- async function sc(t) {
9076
+ async function ic(t) {
9073
9077
  await t.schema.createIndex("users_email_index").on("users").column("email").execute();
9074
9078
  }
9075
- async function ic(t) {
9079
+ async function oc(t) {
9076
9080
  await t.schema.dropIndex("users_email_index").execute();
9077
9081
  }
9078
- const oc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9082
+ const dc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9079
9083
  __proto__: null,
9080
- down: ic,
9081
- up: sc
9084
+ down: oc,
9085
+ up: ic
9082
9086
  }, Symbol.toStringTag, { value: "Module" }));
9083
- async function dc(t) {
9087
+ async function cc(t) {
9084
9088
  await t.schema.alterTable("users").addColumn("profileData", "varchar(2048)").execute();
9085
9089
  }
9086
- async function cc(t) {
9090
+ async function lc(t) {
9087
9091
  await t.schema.alterTable("users").dropColumn("profileData").execute();
9088
9092
  }
9089
- const lc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9093
+ const uc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9090
9094
  __proto__: null,
9091
- down: cc,
9092
- up: dc
9095
+ down: lc,
9096
+ up: cc
9093
9097
  }, Symbol.toStringTag, { value: "Module" }));
9094
- async function uc(t) {
9098
+ async function hc(t) {
9095
9099
  await t.schema.createIndex("users_linked_to_index").on("users").column("linked_to").execute();
9096
9100
  }
9097
- async function hc(t) {
9101
+ async function pc(t) {
9098
9102
  await t.schema.dropIndex("users_linked_to_index");
9099
9103
  }
9100
- const pc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9104
+ const mc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9101
9105
  __proto__: null,
9102
- down: hc,
9103
- up: uc
9106
+ down: pc,
9107
+ up: hc
9104
9108
  }, Symbol.toStringTag, { value: "Module" }));
9105
- async function mc(t) {
9109
+ async function fc(t) {
9106
9110
  await t.schema.alterTable("users").addColumn("locale", "varchar(255)").execute();
9107
9111
  }
9108
- async function fc(t) {
9112
+ async function _c(t) {
9109
9113
  await t.schema.alterTable("users").dropColumn("locale").execute();
9110
9114
  }
9111
- const _c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9115
+ const gc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9112
9116
  __proto__: null,
9113
- down: fc,
9114
- up: mc
9117
+ down: _c,
9118
+ up: fc
9115
9119
  }, Symbol.toStringTag, { value: "Module" }));
9116
- async function gc(t) {
9120
+ async function yc(t) {
9117
9121
  await t.schema.createTable("keys").addColumn("kid", "varchar(255)", (e) => e.primaryKey()).addColumn(
9118
9122
  "tenant_id",
9119
9123
  "varchar(255)",
9120
9124
  (e) => e.references("tenants.id").onDelete("cascade")
9121
9125
  ).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();
9122
9126
  }
9123
- async function yc(t) {
9127
+ async function vc(t) {
9124
9128
  await t.schema.dropTable("keys").execute();
9125
9129
  }
9126
- const vc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9130
+ const bc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9127
9131
  __proto__: null,
9128
- down: yc,
9129
- up: gc
9132
+ down: vc,
9133
+ up: yc
9130
9134
  }, Symbol.toStringTag, { value: "Module" }));
9131
- async function bc(t) {
9132
- }
9133
9135
  async function wc(t) {
9134
9136
  }
9135
- const xc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9137
+ async function xc(t) {
9138
+ }
9139
+ const Nc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9136
9140
  __proto__: null,
9137
- down: wc,
9138
- up: bc
9141
+ down: xc,
9142
+ up: wc
9139
9143
  }, Symbol.toStringTag, { value: "Module" }));
9140
- async function Nc(t) {
9141
- }
9142
9144
  async function kc(t) {
9143
9145
  }
9144
- const Cc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9146
+ async function Cc(t) {
9147
+ }
9148
+ const Tc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9145
9149
  __proto__: null,
9146
- down: kc,
9147
- up: Nc
9150
+ down: Cc,
9151
+ up: kc
9148
9152
  }, Symbol.toStringTag, { value: "Module" }));
9149
- async function Tc(t) {
9153
+ async function Oc(t) {
9150
9154
  await t.schema.alterTable("otps").addColumn("audience", "varchar(255)").execute();
9151
9155
  }
9152
- async function Oc(t) {
9156
+ async function Sc(t) {
9153
9157
  await t.schema.alterTable("otps").dropColumn("audience").execute();
9154
9158
  }
9155
- const Sc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9159
+ const jc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9156
9160
  __proto__: null,
9157
- down: Oc,
9158
- up: Tc
9161
+ down: Sc,
9162
+ up: Oc
9159
9163
  }, Symbol.toStringTag, { value: "Module" }));
9160
- async function jc(t) {
9161
- }
9162
9164
  async function Ic(t) {
9163
9165
  }
9164
- const Zc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9166
+ async function Zc(t) {
9167
+ }
9168
+ const Ec = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9165
9169
  __proto__: null,
9166
- down: Ic,
9167
- up: jc
9170
+ down: Zc,
9171
+ up: Ic
9168
9172
  }, Symbol.toStringTag, { value: "Module" }));
9169
- async function Ec(t) {
9173
+ async function $c(t) {
9170
9174
  await t.schema.alterTable("logs").dropColumn("category").execute();
9171
9175
  }
9172
- async function $c(t) {
9176
+ async function Pc(t) {
9173
9177
  await t.schema.alterTable("logs").addColumn("category", "varchar(255)", (e) => e.notNull()).execute();
9174
9178
  }
9175
- const Pc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9179
+ const Ac = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9176
9180
  __proto__: null,
9177
- down: $c,
9178
- up: Ec
9181
+ down: Pc,
9182
+ up: $c
9179
9183
  }, Symbol.toStringTag, { value: "Module" }));
9180
- async function Ac(t) {
9184
+ async function Dc(t) {
9181
9185
  await t.schema.alterTable("users").dropColumn("tags").execute();
9182
9186
  }
9183
- async function Dc(t) {
9187
+ async function Mc(t) {
9184
9188
  await t.schema.alterTable("users").addColumn("tags", "varchar(255)").execute();
9185
9189
  }
9186
- const Mc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9190
+ const Rc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9187
9191
  __proto__: null,
9188
- down: Dc,
9189
- up: Ac
9192
+ down: Mc,
9193
+ up: Dc
9190
9194
  }, Symbol.toStringTag, { value: "Module" }));
9191
- async function Rc(t) {
9195
+ async function Lc(t) {
9192
9196
  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();
9193
9197
  }
9194
- async function Lc(t) {
9198
+ async function zc(t) {
9195
9199
  await t.schema.dropIndex("logs_user_id"), await t.schema.dropIndex("logs_tenant_id"), await t.schema.dropIndex("logs_date");
9196
9200
  }
9197
- const zc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9201
+ const Uc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9198
9202
  __proto__: null,
9199
- down: Lc,
9200
- up: Rc
9203
+ down: zc,
9204
+ up: Lc
9201
9205
  }, Symbol.toStringTag, { value: "Module" }));
9202
- async function Uc(t) {
9206
+ async function Fc(t) {
9203
9207
  await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(8192)").execute();
9204
9208
  }
9205
- async function Fc(t) {
9209
+ async function Vc(t) {
9206
9210
  await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(2048)").execute();
9207
9211
  }
9208
- const Vc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9212
+ const Bc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9209
9213
  __proto__: null,
9210
- down: Fc,
9211
- up: Uc
9214
+ down: Vc,
9215
+ up: Fc
9212
9216
  }, Symbol.toStringTag, { value: "Module" }));
9213
- async function Bc(t) {
9217
+ async function Kc(t) {
9214
9218
  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();
9215
9219
  }
9216
- async function Kc(t) {
9220
+ async function Jc(t) {
9217
9221
  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();
9218
9222
  }
9219
- const Jc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9223
+ const Wc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9220
9224
  __proto__: null,
9221
- down: Kc,
9222
- up: Bc
9225
+ down: Jc,
9226
+ up: Kc
9223
9227
  }, Symbol.toStringTag, { value: "Module" }));
9224
- async function Wc(t) {
9228
+ async function qc(t) {
9225
9229
  await t.schema.createIndex("users_name_index").on("users").column("name").execute();
9226
9230
  }
9227
- async function qc(t) {
9231
+ async function Qc(t) {
9228
9232
  await t.schema.dropIndex("users_name_index").execute();
9229
9233
  }
9230
- const Qc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9234
+ const Gc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9231
9235
  __proto__: null,
9232
- down: qc,
9233
- up: Wc
9236
+ down: Qc,
9237
+ up: qc
9234
9238
  }, Symbol.toStringTag, { value: "Module" }));
9235
- async function Gc(t) {
9236
- }
9237
9239
  async function Hc(t) {
9240
+ }
9241
+ async function Yc(t) {
9238
9242
  await t.schema.alterTable("users").dropConstraint("unique_email_provider").execute();
9239
9243
  }
9240
- const Yc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9244
+ const Xc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9241
9245
  __proto__: null,
9242
- down: Hc,
9243
- up: Gc
9246
+ down: Yc,
9247
+ up: Hc
9244
9248
  }, Symbol.toStringTag, { value: "Module" }));
9245
- async function Xc(t) {
9249
+ async function el(t) {
9246
9250
  await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(8192)").execute();
9247
9251
  }
9248
- async function el(t) {
9252
+ async function tl(t) {
9249
9253
  await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(1024)").execute();
9250
9254
  }
9251
- const tl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9255
+ const nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9252
9256
  __proto__: null,
9253
- down: el,
9254
- up: Xc
9257
+ down: tl,
9258
+ up: el
9255
9259
  }, Symbol.toStringTag, { value: "Module" }));
9256
- async function nl(t) {
9260
+ async function al(t) {
9257
9261
  await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(8192)").execute();
9258
9262
  }
9259
- async function al(t) {
9263
+ async function rl(t) {
9260
9264
  await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(1024)").execute();
9261
9265
  }
9262
- const rl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9266
+ const sl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9263
9267
  __proto__: null,
9264
- down: al,
9265
- up: nl
9268
+ down: rl,
9269
+ up: al
9266
9270
  }, Symbol.toStringTag, { value: "Module" }));
9267
- async function sl(t) {
9271
+ async function il(t) {
9268
9272
  await t.schema.createTable("branding").addColumn(
9269
9273
  "tenant_id",
9270
9274
  "varchar(255)",
9271
9275
  (e) => e.references("tenants.id").onDelete("cascade").notNull().primaryKey()
9272
9276
  ).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();
9273
9277
  }
9274
- async function il(t) {
9278
+ async function ol(t) {
9275
9279
  await t.schema.dropTable("branding").execute();
9276
9280
  }
9277
- const ol = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9281
+ const dl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9278
9282
  __proto__: null,
9279
- down: il,
9280
- up: sl
9283
+ down: ol,
9284
+ up: il
9281
9285
  }, Symbol.toStringTag, { value: "Module" }));
9282
- async function dl(t) {
9283
- }
9284
9286
  async function cl(t) {
9285
9287
  }
9286
- const ll = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9288
+ async function ll(t) {
9289
+ }
9290
+ const ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9287
9291
  __proto__: null,
9288
- down: cl,
9289
- up: dl
9292
+ down: ll,
9293
+ up: cl
9290
9294
  }, Symbol.toStringTag, { value: "Module" }));
9291
- async function ul(t) {
9292
- }
9293
9295
  async function hl(t) {
9294
9296
  }
9295
- const pl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9297
+ async function pl(t) {
9298
+ }
9299
+ const ml = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9296
9300
  __proto__: null,
9297
- down: hl,
9298
- up: ul
9301
+ down: pl,
9302
+ up: hl
9299
9303
  }, Symbol.toStringTag, { value: "Module" }));
9300
- async function ml(t) {
9301
- }
9302
9304
  async function fl(t) {
9303
9305
  }
9304
- const _l = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9306
+ async function _l(t) {
9307
+ }
9308
+ const gl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9305
9309
  __proto__: null,
9306
- down: fl,
9307
- up: ml
9310
+ down: _l,
9311
+ up: fl
9308
9312
  }, Symbol.toStringTag, { value: "Module" }));
9309
- async function gl(t) {
9310
- }
9311
9313
  async function yl(t) {
9312
9314
  }
9313
- const vl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9315
+ async function vl(t) {
9316
+ }
9317
+ const bl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9314
9318
  __proto__: null,
9315
- down: yl,
9316
- up: gl
9319
+ down: vl,
9320
+ up: yl
9317
9321
  }, Symbol.toStringTag, { value: "Module" }));
9318
- async function bl(t) {
9322
+ async function wl(t) {
9319
9323
  await t.schema.createTable("authentication_codes").addColumn(
9320
9324
  "tenant_id",
9321
9325
  "varchar(255)",
@@ -9326,55 +9330,55 @@ async function bl(t) {
9326
9330
  (e) => e.references("applications.id").onDelete("cascade").notNull()
9327
9331
  ).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();
9328
9332
  }
9329
- async function wl(t) {
9333
+ async function xl(t) {
9330
9334
  await t.schema.dropTable("authentication_codes").execute();
9331
9335
  }
9332
- const xl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9336
+ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9333
9337
  __proto__: null,
9334
- down: wl,
9335
- up: bl
9338
+ down: xl,
9339
+ up: wl
9336
9340
  }, Symbol.toStringTag, { value: "Module" }));
9337
- async function Nl(t) {
9338
- }
9339
9341
  async function kl(t) {
9340
9342
  }
9341
- const Cl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9343
+ async function Cl(t) {
9344
+ }
9345
+ const Tl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9342
9346
  __proto__: null,
9343
- down: kl,
9344
- up: Nl
9347
+ down: Cl,
9348
+ up: kl
9345
9349
  }, Symbol.toStringTag, { value: "Module" }));
9346
- async function Tl(t) {
9350
+ async function Ol(t) {
9347
9351
  await t.schema.alterTable("otps").addColumn("ip", "varchar(64)").execute();
9348
9352
  }
9349
- async function Ol(t) {
9353
+ async function Sl(t) {
9350
9354
  await t.schema.alterTable("otps").dropColumn("ip").execute();
9351
9355
  }
9352
- const Sl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9356
+ const jl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9353
9357
  __proto__: null,
9354
- down: Ol,
9355
- up: Tl
9358
+ down: Sl,
9359
+ up: Ol
9356
9360
  }, Symbol.toStringTag, { value: "Module" }));
9357
- async function jl(t) {
9361
+ async function Il(t) {
9358
9362
  await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(1024)").execute();
9359
9363
  }
9360
- async function Il(t) {
9364
+ async function Zl(t) {
9361
9365
  await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(255)").execute();
9362
9366
  }
9363
- const Zl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9367
+ const El = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9364
9368
  __proto__: null,
9365
- down: Il,
9366
- up: jl
9369
+ down: Zl,
9370
+ up: Il
9367
9371
  }, Symbol.toStringTag, { value: "Module" }));
9368
- async function El(t) {
9369
- }
9370
9372
  async function $l(t) {
9371
9373
  }
9372
- const Pl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9374
+ async function Pl(t) {
9375
+ }
9376
+ const Al = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9373
9377
  __proto__: null,
9374
- down: $l,
9375
- up: El
9378
+ down: Pl,
9379
+ up: $l
9376
9380
  }, Symbol.toStringTag, { value: "Module" }));
9377
- async function Al(t) {
9381
+ async function Dl(t) {
9378
9382
  await t.schema.createTable("hooks").addColumn("hook_id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
9379
9383
  "tenant_id",
9380
9384
  "varchar(255)",
@@ -9385,33 +9389,33 @@ async function Al(t) {
9385
9389
  (e) => e.defaultTo(!1).notNull()
9386
9390
  ).addColumn("priority", "integer").execute();
9387
9391
  }
9388
- async function Dl(t) {
9392
+ async function Ml(t) {
9389
9393
  await t.schema.dropTable("hooks").execute();
9390
9394
  }
9391
- const Ml = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9395
+ const Rl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9392
9396
  __proto__: null,
9393
- down: Dl,
9394
- up: Al
9397
+ down: Ml,
9398
+ up: Dl
9395
9399
  }, Symbol.toStringTag, { value: "Module" }));
9396
- async function Rl(t) {
9397
- }
9398
9400
  async function Ll(t) {
9399
9401
  }
9400
- const zl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9402
+ async function zl(t) {
9403
+ }
9404
+ const Ul = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9401
9405
  __proto__: null,
9402
- down: Ll,
9403
- up: Rl
9406
+ down: zl,
9407
+ up: Ll
9404
9408
  }, Symbol.toStringTag, { value: "Module" }));
9405
- async function Ul(t) {
9406
- }
9407
9409
  async function Fl(t) {
9408
9410
  }
9409
- const Vl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9411
+ async function Vl(t) {
9412
+ }
9413
+ const Bl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9410
9414
  __proto__: null,
9411
- down: Fl,
9412
- up: Ul
9415
+ down: Vl,
9416
+ up: Fl
9413
9417
  }, Symbol.toStringTag, { value: "Module" }));
9414
- async function Bl(t) {
9418
+ async function Kl(t) {
9415
9419
  await t.schema.createTable("logins").addColumn("login_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
9416
9420
  "tenant_id",
9417
9421
  "varchar(255)",
@@ -9428,7 +9432,7 @@ async function Bl(t) {
9428
9432
  (e) => e.onDelete("cascade")
9429
9433
  ).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();
9430
9434
  }
9431
- async function Kl(t) {
9435
+ async function Jl(t) {
9432
9436
  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(
9433
9437
  "codes_user_id_tenant_id_constraint",
9434
9438
  ["user_id", "tenant_id"],
@@ -9437,90 +9441,90 @@ async function Kl(t) {
9437
9441
  (e) => e.onDelete("cascade")
9438
9442
  ).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();
9439
9443
  }
9440
- const Jl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9444
+ const Wl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9441
9445
  __proto__: null,
9442
- down: Kl,
9443
- up: Bl
9446
+ down: Jl,
9447
+ up: Kl
9444
9448
  }, Symbol.toStringTag, { value: "Module" }));
9445
- async function Wl(t) {
9446
- }
9447
9449
  async function ql(t) {
9448
9450
  }
9449
- const Ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9451
+ async function Ql(t) {
9452
+ }
9453
+ const Gl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9450
9454
  __proto__: null,
9451
- down: ql,
9452
- up: Wl
9455
+ down: Ql,
9456
+ up: ql
9453
9457
  }, Symbol.toStringTag, { value: "Module" }));
9454
- async function Gl(t) {
9458
+ async function Hl(t) {
9455
9459
  await t.schema.alterTable("logins").addColumn("auth0Client", "varchar(256)").execute();
9456
9460
  }
9457
- async function Hl(t) {
9461
+ async function Yl(t) {
9458
9462
  await t.schema.alterTable("logins").dropColumn("auth0Client").execute();
9459
9463
  }
9460
- const Yl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9464
+ const Xl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9461
9465
  __proto__: null,
9462
- down: Hl,
9463
- up: Gl
9466
+ down: Yl,
9467
+ up: Hl
9464
9468
  }, Symbol.toStringTag, { value: "Module" }));
9465
- async function Xl(t) {
9469
+ async function eu(t) {
9466
9470
  await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(8192)").execute();
9467
9471
  }
9468
- async function eu(t) {
9472
+ async function tu(t) {
9469
9473
  await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(511)").execute();
9470
9474
  }
9471
- const tu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9475
+ const nu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9472
9476
  __proto__: null,
9473
- down: eu,
9474
- up: Xl
9477
+ down: tu,
9478
+ up: eu
9475
9479
  }, Symbol.toStringTag, { value: "Module" }));
9476
- async function nu(t) {
9477
- }
9478
9480
  async function au(t) {
9479
9481
  }
9480
- const ru = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9482
+ async function ru(t) {
9483
+ }
9484
+ const su = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9481
9485
  __proto__: null,
9482
- down: au,
9483
- up: nu
9486
+ down: ru,
9487
+ up: au
9484
9488
  }, Symbol.toStringTag, { value: "Module" }));
9485
- async function su(t) {
9486
- }
9487
9489
  async function iu(t) {
9488
9490
  }
9489
- const ou = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9491
+ async function ou(t) {
9492
+ }
9493
+ const du = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9490
9494
  __proto__: null,
9491
- down: iu,
9492
- up: su
9495
+ down: ou,
9496
+ up: iu
9493
9497
  }, Symbol.toStringTag, { value: "Module" }));
9494
- async function du(t) {
9498
+ async function cu(t) {
9495
9499
  await t.schema.alterTable("logins").addColumn("authParams_nonce", "varchar(255)").execute();
9496
9500
  }
9497
- async function cu(t) {
9501
+ async function lu(t) {
9498
9502
  await t.schema.alterTable("logins").dropColumn("nonce").execute();
9499
9503
  }
9500
- const lu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9504
+ const uu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9501
9505
  __proto__: null,
9502
- down: cu,
9503
- up: du
9506
+ down: lu,
9507
+ up: cu
9504
9508
  }, Symbol.toStringTag, { value: "Module" }));
9505
- async function uu(t) {
9506
- }
9507
9509
  async function hu(t) {
9508
9510
  }
9509
- const pu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9511
+ async function pu(t) {
9512
+ }
9513
+ const mu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9510
9514
  __proto__: null,
9511
- down: hu,
9512
- up: uu
9515
+ down: pu,
9516
+ up: hu
9513
9517
  }, Symbol.toStringTag, { value: "Module" }));
9514
- async function mu(t) {
9515
- }
9516
9518
  async function fu(t) {
9517
9519
  }
9518
- const _u = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9520
+ async function _u(t) {
9521
+ }
9522
+ const gu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9519
9523
  __proto__: null,
9520
- down: fu,
9521
- up: mu
9524
+ down: _u,
9525
+ up: fu
9522
9526
  }, Symbol.toStringTag, { value: "Module" }));
9523
- async function gu(t) {
9527
+ async function yu(t) {
9524
9528
  await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.notNull()).addColumn(
9525
9529
  "tenant_id",
9526
9530
  "varchar(255)",
@@ -9536,7 +9540,7 @@ async function gu(t) {
9536
9540
  "code_type"
9537
9541
  ]).execute();
9538
9542
  }
9539
- async function yu(t) {
9543
+ async function vu(t) {
9540
9544
  await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
9541
9545
  "tenant_id",
9542
9546
  "varchar(255)",
@@ -9549,15 +9553,15 @@ async function yu(t) {
9549
9553
  (e) => e.onDelete("cascade")
9550
9554
  ).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();
9551
9555
  }
9552
- const vu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9556
+ const bu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9553
9557
  __proto__: null,
9554
- down: yu,
9555
- up: gu
9558
+ down: vu,
9559
+ up: yu
9556
9560
  }, Symbol.toStringTag, { value: "Module" }));
9557
- async function bu(t) {
9561
+ async function wu(t) {
9558
9562
  await t.schema.dropTable("otps").execute(), await t.schema.dropTable("authentication_codes").execute();
9559
9563
  }
9560
- async function wu(t) {
9564
+ async function xu(t) {
9561
9565
  await t.schema.alterTable("keys").addColumn("private_key", "varchar(2048)").addColumn("public_key", "varchar(2048)").execute(), await t.schema.createTable("otps").addColumn(
9562
9566
  "tenant_id",
9563
9567
  "varchar(255)",
@@ -9576,32 +9580,32 @@ async function wu(t) {
9576
9580
  (e) => e.references("applications.id").onDelete("cascade").notNull()
9577
9581
  ).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();
9578
9582
  }
9579
- const xu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9583
+ const Nu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9580
9584
  __proto__: null,
9581
- down: wu,
9582
- up: bu
9585
+ down: xu,
9586
+ up: wu
9583
9587
  }, Symbol.toStringTag, { value: "Module" }));
9584
- async function Nu(t) {
9588
+ async function ku(t) {
9585
9589
  await t.schema.createIndex("IDX_logs_tenant_date_type_user").on("logs").columns(["tenant_id", "date", "type", "user_id"]).execute();
9586
9590
  }
9587
- async function ku(t) {
9591
+ async function Cu(t) {
9588
9592
  await t.schema.dropIndex("IDX_logs_tenant_date_type_user").on("logs").execute();
9589
9593
  }
9590
- const Cu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9594
+ const Tu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9591
9595
  __proto__: null,
9592
- down: ku,
9593
- up: Nu
9596
+ down: Cu,
9597
+ up: ku
9594
9598
  }, Symbol.toStringTag, { value: "Module" }));
9595
- async function Tu(t) {
9596
- }
9597
9599
  async function Ou(t) {
9598
9600
  }
9599
- const Su = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9601
+ async function Su(t) {
9602
+ }
9603
+ const ju = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9600
9604
  __proto__: null,
9601
- down: Ou,
9602
- up: Tu
9605
+ down: Su,
9606
+ up: Ou
9603
9607
  }, Symbol.toStringTag, { value: "Module" }));
9604
- async function ju(t) {
9608
+ async function Iu(t) {
9605
9609
  await t.schema.createTable("prompt_settings").addColumn("tenant_id", "varchar(64)", (e) => e.primaryKey()).addColumn(
9606
9610
  "universal_login_experience",
9607
9611
  "varchar(16)",
@@ -9620,95 +9624,95 @@ async function ju(t) {
9620
9624
  (e) => e.defaultTo(!1).notNull()
9621
9625
  ).execute();
9622
9626
  }
9623
- async function Iu(t) {
9627
+ async function Zu(t) {
9624
9628
  await t.schema.dropTable("prompt_settings").execute();
9625
9629
  }
9626
- const Zu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9630
+ const Eu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9627
9631
  __proto__: null,
9628
- down: Iu,
9629
- up: ju
9632
+ down: Zu,
9633
+ up: Iu
9630
9634
  }, Symbol.toStringTag, { value: "Module" }));
9631
- async function Eu(t) {
9632
- }
9633
9635
  async function $u(t) {
9634
9636
  }
9635
- const Pu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9637
+ async function Pu(t) {
9638
+ }
9639
+ const Au = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9636
9640
  __proto__: null,
9637
- down: $u,
9638
- up: Eu
9641
+ down: Pu,
9642
+ up: $u
9639
9643
  }, Symbol.toStringTag, { value: "Module" }));
9640
- async function Au(t) {
9641
- }
9642
9644
  async function Du(t) {
9643
9645
  }
9644
- const Mu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9646
+ async function Mu(t) {
9647
+ }
9648
+ const Ru = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9645
9649
  __proto__: null,
9646
- down: Du,
9647
- up: Au
9650
+ down: Mu,
9651
+ up: Du
9648
9652
  }, Symbol.toStringTag, { value: "Module" }));
9649
- async function Ru(t) {
9650
- }
9651
9653
  async function Lu(t) {
9652
9654
  }
9653
- const zu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9655
+ async function zu(t) {
9656
+ }
9657
+ const Uu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9654
9658
  __proto__: null,
9655
- down: Lu,
9656
- up: Ru
9659
+ down: zu,
9660
+ up: Lu
9657
9661
  }, Symbol.toStringTag, { value: "Module" }));
9658
- async function Uu(t) {
9662
+ async function Fu(t) {
9659
9663
  await t.schema.alterTable("logins").addColumn("authParams_ui_locales", "varchar(32)").execute();
9660
9664
  }
9661
- async function Fu(t) {
9665
+ async function Vu(t) {
9662
9666
  await t.schema.alterTable("logins").dropColumn("authParams_ui_locales").execute();
9663
9667
  }
9664
- const Vu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9668
+ const Bu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9665
9669
  __proto__: null,
9666
- down: Fu,
9667
- up: Uu
9670
+ down: Vu,
9671
+ up: Fu
9668
9672
  }, Symbol.toStringTag, { value: "Module" }));
9669
- async function Bu(t) {
9673
+ async function Ku(t) {
9670
9674
  await t.schema.alterTable("logins").addColumn("authParams_prompt", "varchar(16)").execute();
9671
9675
  }
9672
- async function Ku(t) {
9676
+ async function Ju(t) {
9673
9677
  await t.schema.alterTable("logins").dropColumn("authParams_prompt").execute();
9674
9678
  }
9675
- const Ju = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9679
+ const Wu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9676
9680
  __proto__: null,
9677
- down: Ku,
9678
- up: Bu
9681
+ down: Ju,
9682
+ up: Ku
9679
9683
  }, Symbol.toStringTag, { value: "Module" }));
9680
- async function Wu(t) {
9681
- }
9682
9684
  async function qu(t) {
9683
9685
  }
9684
- const Qu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9686
+ async function Qu(t) {
9687
+ }
9688
+ const Gu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9685
9689
  __proto__: null,
9686
- down: qu,
9687
- up: Wu
9690
+ down: Qu,
9691
+ up: qu
9688
9692
  }, Symbol.toStringTag, { value: "Module" }));
9689
- async function Gu(t) {
9693
+ async function Hu(t) {
9690
9694
  await t.schema.alterTable("logins").addColumn("authParams_act_as", "varchar(255)").execute();
9691
9695
  }
9692
- async function Hu(t) {
9696
+ async function Yu(t) {
9693
9697
  await t.schema.alterTable("logins").dropColumn("authParam_act_as").execute();
9694
9698
  }
9695
- const Yu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9699
+ const Xu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9696
9700
  __proto__: null,
9697
- down: Hu,
9698
- up: Gu
9701
+ down: Yu,
9702
+ up: Hu
9699
9703
  }, Symbol.toStringTag, { value: "Module" }));
9700
- async function Xu(t) {
9704
+ async function eh(t) {
9701
9705
  await t.schema.alterTable("codes").addColumn("code_verifier", "varchar(128)").execute();
9702
9706
  }
9703
- async function eh(t) {
9707
+ async function th(t) {
9704
9708
  await t.schema.alterTable("codes").dropColumn("code_verifier").execute();
9705
9709
  }
9706
- const th = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9710
+ const nh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9707
9711
  __proto__: null,
9708
- down: eh,
9709
- up: Xu
9712
+ down: th,
9713
+ up: eh
9710
9714
  }, Symbol.toStringTag, { value: "Module" }));
9711
- async function nh(t) {
9715
+ async function ah(t) {
9712
9716
  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(
9713
9717
  "credentials",
9714
9718
  "varchar(2048)",
@@ -9719,18 +9723,18 @@ async function nh(t) {
9719
9723
  (e) => e.notNull().defaultTo("{}")
9720
9724
  ).addColumn("created_at", "varchar(29)", (e) => e.notNull()).addColumn("updated_at", "varchar(29)", (e) => e.notNull()).execute();
9721
9725
  }
9722
- async function ah(t) {
9726
+ async function rh(t) {
9723
9727
  await t.schema.dropTable("email_providers").execute();
9724
9728
  }
9725
- const rh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9729
+ const sh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9726
9730
  __proto__: null,
9727
- down: ah,
9728
- up: nh
9731
+ down: rh,
9732
+ up: ah
9729
9733
  }, Symbol.toStringTag, { value: "Module" }));
9730
- async function sh(t) {
9734
+ async function ih(t) {
9731
9735
  await t.schema.dropTable("tickets").execute();
9732
9736
  }
9733
- async function ih(t) {
9737
+ async function oh(t) {
9734
9738
  await t.schema.createTable("tickets").addColumn(
9735
9739
  "tenant_id",
9736
9740
  "varchar(255)",
@@ -9741,91 +9745,91 @@ async function ih(t) {
9741
9745
  (e) => e.references("applications.id").onDelete("cascade").notNull()
9742
9746
  ).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();
9743
9747
  }
9744
- const oh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9748
+ const dh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9745
9749
  __proto__: null,
9746
- down: ih,
9747
- up: sh
9750
+ down: oh,
9751
+ up: ih
9748
9752
  }, Symbol.toStringTag, { value: "Module" }));
9749
- async function dh(t) {
9750
- }
9751
9753
  async function ch(t) {
9754
+ }
9755
+ async function lh(t) {
9752
9756
  await t.schema.alterTable("logins").dropColumn("ip").dropColumn("useragent").execute();
9753
9757
  }
9754
- const lh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9758
+ const uh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9755
9759
  __proto__: null,
9756
- down: ch,
9757
- up: dh
9760
+ down: lh,
9761
+ up: ch
9758
9762
  }, Symbol.toStringTag, { value: "Module" })), Wa = {
9759
- m1_init: Cd,
9760
- m2_magicLink: Sd,
9761
- m3_updateAt: Zd,
9762
- m4_logTable: Pd,
9763
- m5_userProfile: Md,
9764
- m6_sessions: zd,
9765
- m7_passwords: Vd,
9766
- m8_logsTableNewFields: Jd,
9767
- m9_passwordTableNewField: Qd,
9768
- n01_codesTable: Yd,
9769
- n11_universalLoginSession: tc,
9770
- n12_userFields: rc,
9771
- n13_userEmailIndex: oc,
9772
- n14_profileDataField: lc,
9773
- n15_userEmailIndex: pc,
9774
- n16_userLocale: _c,
9775
- n17_signingKeys: vc,
9776
- n18_logsFields: xc,
9777
- n19_connectionsUserinfo: Cc,
9778
- n20_missingFields: Sc,
9779
- n21_sessionDeletedAt: Zc,
9780
- n22_dropLogsFields: Pc,
9781
- n23_dropUsersFields: Mc,
9782
- n24_logsIndexes: zc,
9783
- n25_logDescMaxLength: Vc,
9784
- n26_logsTableExtraFields: Jc,
9785
- n27_usersTableNameIndex: Qc,
9786
- n28_usersEmailConstrain: Yc,
9787
- n29_increaseOtpStateLength: tl,
9788
- n30_increaseTicketStateLength: rl,
9789
- n31_branding: ol,
9790
- n32_indexesAndNotNull: ll,
9791
- n33_vendorIdInUniversalLoginSession: pl,
9792
- n34_auth0ClientInUniversalLoginSession: _l,
9793
- n35_increaseUniversalSessionStateLength: vl,
9794
- n36_authenticationCodes: xl,
9795
- n37_disableSignUps: Cl,
9796
- n38_otpIpAddress: Sl,
9797
- n39_increaseUserAgentLength: Zl,
9798
- n40_userId: Pl,
9799
- n41_hooks: Ml,
9800
- n42_userIdIndexes: zl,
9801
- n43_userIdIndexes: Vl,
9802
- n44_codes: Jl,
9803
- n45_hookProperties: Ql,
9804
- n46_loginAuth0Client: Yl,
9805
- n47_loginAuth0Client: tu,
9806
- n48_saml: ru,
9807
- n49_removeFields: ou,
9808
- n50_authParamsNonce: lu,
9809
- n51_connectionid: pu,
9810
- n52_cert: _u,
9811
- n53_codes_primary_key: vu,
9812
- n54_cleanup_tables: xu,
9813
- n55_logs_index: Cu,
9814
- n56_application_fields: Su,
9815
- n57_prompt_settings: Zu,
9816
- n58_connection_client_id: Pu,
9817
- n59_connection_options: Mu,
9818
- n60_users_metadata: zu,
9819
- n61_userLocales: Vu,
9820
- n62_prompt: Ju,
9821
- n63_connection_cleanup: Qu,
9822
- n64_act_as: Yu,
9823
- n65_code_verifier: th,
9824
- n66_email_providers: rh,
9825
- n67_drop_tickets: oh,
9826
- n68_login_useragents: lh
9763
+ m1_init: Td,
9764
+ m2_magicLink: jd,
9765
+ m3_updateAt: Ed,
9766
+ m4_logTable: Ad,
9767
+ m5_userProfile: Rd,
9768
+ m6_sessions: Ud,
9769
+ m7_passwords: Bd,
9770
+ m8_logsTableNewFields: Wd,
9771
+ m9_passwordTableNewField: Gd,
9772
+ n01_codesTable: Xd,
9773
+ n11_universalLoginSession: nc,
9774
+ n12_userFields: sc,
9775
+ n13_userEmailIndex: dc,
9776
+ n14_profileDataField: uc,
9777
+ n15_userEmailIndex: mc,
9778
+ n16_userLocale: gc,
9779
+ n17_signingKeys: bc,
9780
+ n18_logsFields: Nc,
9781
+ n19_connectionsUserinfo: Tc,
9782
+ n20_missingFields: jc,
9783
+ n21_sessionDeletedAt: Ec,
9784
+ n22_dropLogsFields: Ac,
9785
+ n23_dropUsersFields: Rc,
9786
+ n24_logsIndexes: Uc,
9787
+ n25_logDescMaxLength: Bc,
9788
+ n26_logsTableExtraFields: Wc,
9789
+ n27_usersTableNameIndex: Gc,
9790
+ n28_usersEmailConstrain: Xc,
9791
+ n29_increaseOtpStateLength: nl,
9792
+ n30_increaseTicketStateLength: sl,
9793
+ n31_branding: dl,
9794
+ n32_indexesAndNotNull: ul,
9795
+ n33_vendorIdInUniversalLoginSession: ml,
9796
+ n34_auth0ClientInUniversalLoginSession: gl,
9797
+ n35_increaseUniversalSessionStateLength: bl,
9798
+ n36_authenticationCodes: Nl,
9799
+ n37_disableSignUps: Tl,
9800
+ n38_otpIpAddress: jl,
9801
+ n39_increaseUserAgentLength: El,
9802
+ n40_userId: Al,
9803
+ n41_hooks: Rl,
9804
+ n42_userIdIndexes: Ul,
9805
+ n43_userIdIndexes: Bl,
9806
+ n44_codes: Wl,
9807
+ n45_hookProperties: Gl,
9808
+ n46_loginAuth0Client: Xl,
9809
+ n47_loginAuth0Client: nu,
9810
+ n48_saml: su,
9811
+ n49_removeFields: du,
9812
+ n50_authParamsNonce: uu,
9813
+ n51_connectionid: mu,
9814
+ n52_cert: gu,
9815
+ n53_codes_primary_key: bu,
9816
+ n54_cleanup_tables: Nu,
9817
+ n55_logs_index: Tu,
9818
+ n56_application_fields: ju,
9819
+ n57_prompt_settings: Eu,
9820
+ n58_connection_client_id: Au,
9821
+ n59_connection_options: Ru,
9822
+ n60_users_metadata: Uu,
9823
+ n61_userLocales: Bu,
9824
+ n62_prompt: Wu,
9825
+ n63_connection_cleanup: Gu,
9826
+ n64_act_as: Xu,
9827
+ n65_code_verifier: nh,
9828
+ n66_email_providers: sh,
9829
+ n67_drop_tickets: dh,
9830
+ n68_login_useragents: uh
9827
9831
  };
9828
- async function hh(t, e = !1) {
9832
+ async function ph(t, e = !1) {
9829
9833
  e && console.log("migrating...");
9830
9834
  const n = new Ja(Wa), a = new Za({
9831
9835
  db: t,
@@ -9838,7 +9842,7 @@ async function hh(t, e = !1) {
9838
9842
  }), r)
9839
9843
  throw console.error("failed to migrate"), console.error(r), r;
9840
9844
  }
9841
- async function ph(t) {
9845
+ async function mh(t) {
9842
9846
  console.log("migrating...");
9843
9847
  const e = new Ja(Wa), n = new Za({
9844
9848
  db: t,
@@ -9849,29 +9853,29 @@ async function ph(t) {
9849
9853
  }), a)
9850
9854
  throw console.error("failed to migrate"), console.error(a), a;
9851
9855
  }
9852
- function mh(t) {
9856
+ function fh(t) {
9853
9857
  return {
9854
- applications: vi(t),
9855
- branding: Vo(t),
9856
- clients: $o(t),
9857
- codes: pi(t),
9858
- connections: Eo(t),
9859
- emailProviders: hd(t),
9860
- domains: zo(t),
9861
- hooks: Qo(t),
9862
- keys: Mo(t),
9863
- logins: sd(t),
9858
+ applications: bi(t),
9859
+ branding: Bo(t),
9860
+ clients: Po(t),
9861
+ codes: mi(t),
9862
+ connections: $o(t),
9863
+ emailProviders: pd(t),
9864
+ domains: Uo(t),
9865
+ hooks: Go(t),
9866
+ keys: Ro(t),
9867
+ logins: id(t),
9864
9868
  logs: Ys(t),
9865
9869
  passwords: di(t),
9866
- promptSettings: dd(t),
9870
+ promptSettings: cd(t),
9867
9871
  users: zs(t),
9868
9872
  sessions: ri(t),
9869
9873
  tenants: Ws(t),
9870
- themes: ed(t)
9874
+ themes: td(t)
9871
9875
  };
9872
9876
  }
9873
9877
  export {
9874
- mh as default,
9875
- ph as migrateDown,
9876
- hh as migrateToLatest
9878
+ fh as default,
9879
+ mh as migrateDown,
9880
+ ph as migrateToLatest
9877
9881
  };