@authhero/kysely-adapter 0.24.4 → 0.25.1

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