@authhero/kysely-adapter 10.39.0 → 10.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kysely-adapter.cjs +1 -1
- package/dist/kysely-adapter.d.ts +30 -11
- package/dist/kysely-adapter.mjs +845 -720
- package/package.json +3 -3
package/dist/kysely-adapter.mjs
CHANGED
|
@@ -4,10 +4,10 @@ var ue = (t) => {
|
|
|
4
4
|
};
|
|
5
5
|
var Re = (t, e, a) => e in t ? Le(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a;
|
|
6
6
|
var R = (t, e, a) => Re(t, typeof e != "symbol" ? e + "" : e, a), X = (t, e, a) => e.has(t) || ue("Cannot " + a);
|
|
7
|
-
var
|
|
8
|
-
import { parseUserId as ie, codeSchema as Ke, connectionSchema as Ue, loginSessionSchema as
|
|
7
|
+
var m = (t, e, a) => (X(t, e, "read from private field"), a ? a.call(t) : e.get(t)), O = (t, e, a) => e.has(t) ? ue("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, a), K = (t, e, a, r) => (X(t, e, "write to private field"), r ? r.call(t, a) : e.set(t, a), a), p = (t, e, a) => (X(t, e, "access private method"), a);
|
|
8
|
+
import { parseUserId as ie, codeSchema as Ke, connectionSchema as Ue, loginSessionSchema as qe, promptSettingSchema as Be, formSchema as Y, resourceServerSchema as Qe } from "@authhero/adapter-interfaces";
|
|
9
9
|
import "@hono/zod-openapi";
|
|
10
|
-
var
|
|
10
|
+
var B = class extends Error {
|
|
11
11
|
constructor(e = 500, a) {
|
|
12
12
|
super(a == null ? void 0 : a.message, { cause: a == null ? void 0 : a.cause });
|
|
13
13
|
R(this, "res");
|
|
@@ -39,7 +39,7 @@ function We(t) {
|
|
|
39
39
|
try {
|
|
40
40
|
await t.insertInto("users").values(o).execute();
|
|
41
41
|
} catch (s) {
|
|
42
|
-
throw s.code === "SQLITE_CONSTRAINT_UNIQUE" || s.message.includes("AlreadyExists") ? new
|
|
42
|
+
throw s.code === "SQLITE_CONSTRAINT_UNIQUE" || s.message.includes("AlreadyExists") ? new B(409, { message: "User already exists" }) : new B(500, { message: `${s.code}, ${s.message}` });
|
|
43
43
|
}
|
|
44
44
|
return {
|
|
45
45
|
...o,
|
|
@@ -118,23 +118,23 @@ function Ve(t) {
|
|
|
118
118
|
}
|
|
119
119
|
function S(t, e, a, r) {
|
|
120
120
|
return a.split(/\s+/).map((o) => o.replace(/^([^:]+)=/g, "$1:")).map((o) => {
|
|
121
|
-
let s = o.startsWith("-"), i = null, c = "",
|
|
121
|
+
let s = o.startsWith("-"), i = null, c = "", u = !1, _;
|
|
122
122
|
if (o.startsWith("-_exists_:"))
|
|
123
|
-
i = o.substring(10),
|
|
123
|
+
i = o.substring(10), u = !0, s = !0;
|
|
124
124
|
else if (o.startsWith("_exists_:"))
|
|
125
|
-
i = o.substring(9),
|
|
125
|
+
i = o.substring(9), u = !0, s = !1;
|
|
126
126
|
else if (o.includes(":")) {
|
|
127
127
|
const d = s ? o.substring(1) : o, h = d.indexOf(":");
|
|
128
|
-
i = d.substring(0, h), c = d.substring(h + 1),
|
|
128
|
+
i = d.substring(0, h), c = d.substring(h + 1), u = !1, c.startsWith(">=") ? (_ = ">=", c = c.substring(2)) : c.startsWith(">") ? (_ = ">", c = c.substring(1)) : c.startsWith("<=") ? (_ = "<=", c = c.substring(2)) : c.startsWith("<") ? (_ = "<", c = c.substring(1)) : _ = "=";
|
|
129
129
|
} else
|
|
130
|
-
i = null, c = o,
|
|
131
|
-
return { key: i, value: c, isNegation: s, isExistsQuery:
|
|
132
|
-
}).forEach(({ key: o, value: s, isNegation: i, isExistsQuery: c, operator:
|
|
130
|
+
i = null, c = o, u = !1;
|
|
131
|
+
return { key: i, value: c, isNegation: s, isExistsQuery: u, operator: _ };
|
|
132
|
+
}).forEach(({ key: o, value: s, isNegation: i, isExistsQuery: c, operator: u }) => {
|
|
133
133
|
if (o)
|
|
134
134
|
if (c)
|
|
135
135
|
i ? e = e.where(o, "is", null) : e = e.where(o, "is not", null);
|
|
136
136
|
else if (i)
|
|
137
|
-
switch (
|
|
137
|
+
switch (u) {
|
|
138
138
|
case ">":
|
|
139
139
|
e = e.where(o, "<=", s);
|
|
140
140
|
break;
|
|
@@ -151,7 +151,7 @@ function S(t, e, a, r) {
|
|
|
151
151
|
e = e.where(o, "!=", s);
|
|
152
152
|
}
|
|
153
153
|
else
|
|
154
|
-
e = e.where(o,
|
|
154
|
+
e = e.where(o, u, s);
|
|
155
155
|
else if (s) {
|
|
156
156
|
const { ref: _ } = t.dynamic;
|
|
157
157
|
e = e.where(
|
|
@@ -210,7 +210,7 @@ function Ge(t) {
|
|
|
210
210
|
};
|
|
211
211
|
};
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function Ye(t) {
|
|
214
214
|
return async (e, a) => (await t.deleteFrom("users").where("users.tenant_id", "=", e).where("users.linked_to", "=", a).execute(), (await t.deleteFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", a).execute()).length === 1);
|
|
215
215
|
}
|
|
216
216
|
function L(t, e = "", a = {}) {
|
|
@@ -239,7 +239,7 @@ function ge(t, e) {
|
|
|
239
239
|
}
|
|
240
240
|
return a;
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function He(t) {
|
|
243
243
|
return async (e, a, r) => {
|
|
244
244
|
const n = L({
|
|
245
245
|
...r,
|
|
@@ -259,10 +259,10 @@ function Xe(t) {
|
|
|
259
259
|
function Ze(t) {
|
|
260
260
|
return {
|
|
261
261
|
create: We(t),
|
|
262
|
-
remove:
|
|
262
|
+
remove: Ye(t),
|
|
263
263
|
get: Ve(t),
|
|
264
264
|
list: Ge(t),
|
|
265
|
-
update:
|
|
265
|
+
update: He(t),
|
|
266
266
|
// TODO - think about this more when other issues fixed
|
|
267
267
|
unlink: Xe(t)
|
|
268
268
|
};
|
|
@@ -387,13 +387,13 @@ function ct(t) {
|
|
|
387
387
|
const { page: r = 0, per_page: n = 50, include_totals: o = !1, sort: s, q: i } = a;
|
|
388
388
|
let c = t.selectFrom("logs").where("logs.tenant_id", "=", e);
|
|
389
389
|
i && (c = S(t, c, i, ["user_id", "ip"]));
|
|
390
|
-
let
|
|
390
|
+
let u = c;
|
|
391
391
|
if (s && s.sort_by) {
|
|
392
392
|
const { ref: f } = t.dynamic;
|
|
393
|
-
|
|
393
|
+
u = u.orderBy(f(s.sort_by), s.sort_order);
|
|
394
394
|
}
|
|
395
|
-
|
|
396
|
-
const d = (await
|
|
395
|
+
u = u.offset(r * n).limit(n);
|
|
396
|
+
const d = (await u.selectAll().execute()).map(we);
|
|
397
397
|
if (!o)
|
|
398
398
|
return {
|
|
399
399
|
logs: d,
|
|
@@ -472,13 +472,13 @@ function pt(t) {
|
|
|
472
472
|
const { page: r = 0, per_page: n = 50, include_totals: o = !1, sort: s, q: i } = a;
|
|
473
473
|
let c = t.selectFrom("sessions").where("sessions.tenant_id", "=", e);
|
|
474
474
|
i && (c = S(t, c, i, ["user_id", "session_id"]));
|
|
475
|
-
let
|
|
475
|
+
let u = c;
|
|
476
476
|
if (s && s.sort_by) {
|
|
477
477
|
const { ref: g } = t.dynamic;
|
|
478
|
-
|
|
478
|
+
u = u.orderBy(g(s.sort_by), s.sort_order);
|
|
479
479
|
}
|
|
480
|
-
|
|
481
|
-
const d = (await
|
|
480
|
+
u = u.offset(r * n).limit(n);
|
|
481
|
+
const d = (await u.selectAll().execute()).map((g) => ({
|
|
482
482
|
...g,
|
|
483
483
|
device: JSON.parse(g.device),
|
|
484
484
|
clients: JSON.parse(g.clients)
|
|
@@ -671,7 +671,7 @@ function Pt(t) {
|
|
|
671
671
|
return await t.updateTable("applications").set(n).where("applications.id", "=", a).where("applications.tenant_id", "=", e).execute(), !0;
|
|
672
672
|
};
|
|
673
673
|
}
|
|
674
|
-
function
|
|
674
|
+
function zt(t) {
|
|
675
675
|
return {
|
|
676
676
|
create: kt(t),
|
|
677
677
|
list: $t(t),
|
|
@@ -680,7 +680,7 @@ function jt(t) {
|
|
|
680
680
|
update: Pt(t)
|
|
681
681
|
};
|
|
682
682
|
}
|
|
683
|
-
function
|
|
683
|
+
function jt(t) {
|
|
684
684
|
return async (e, a) => {
|
|
685
685
|
const r = {
|
|
686
686
|
id: T(),
|
|
@@ -696,7 +696,7 @@ function Ft(t) {
|
|
|
696
696
|
}).execute(), r;
|
|
697
697
|
};
|
|
698
698
|
}
|
|
699
|
-
function
|
|
699
|
+
function Ft(t) {
|
|
700
700
|
return async (e, a = {}) => {
|
|
701
701
|
const { page: r = 0, per_page: n = 50, include_totals: o = !1, q: s } = a;
|
|
702
702
|
let i = t.selectFrom("connections").where("connections.tenant_id", "=", e);
|
|
@@ -723,10 +723,10 @@ function At(t) {
|
|
|
723
723
|
};
|
|
724
724
|
};
|
|
725
725
|
}
|
|
726
|
-
function
|
|
726
|
+
function At(t) {
|
|
727
727
|
return async (e, a) => (await t.deleteFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", a).executeTakeFirst()).numDeletedRows > 0;
|
|
728
728
|
}
|
|
729
|
-
function
|
|
729
|
+
function Mt(t) {
|
|
730
730
|
return async (e, a) => {
|
|
731
731
|
const r = await t.selectFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", a).selectAll().executeTakeFirst();
|
|
732
732
|
return r ? y({
|
|
@@ -749,10 +749,10 @@ function Jt(t) {
|
|
|
749
749
|
}
|
|
750
750
|
function Et(t) {
|
|
751
751
|
return {
|
|
752
|
-
create:
|
|
753
|
-
get:
|
|
754
|
-
list:
|
|
755
|
-
remove:
|
|
752
|
+
create: jt(t),
|
|
753
|
+
get: Mt(t),
|
|
754
|
+
list: Ft(t),
|
|
755
|
+
remove: At(t),
|
|
756
756
|
update: Jt(t)
|
|
757
757
|
};
|
|
758
758
|
}
|
|
@@ -764,7 +764,7 @@ function Lt(t) {
|
|
|
764
764
|
return null;
|
|
765
765
|
const r = await t.selectFrom("tenants").selectAll().where("id", "=", a.tenant_id).executeTakeFirst();
|
|
766
766
|
if (!r)
|
|
767
|
-
throw new
|
|
767
|
+
throw new B(404, { message: "Tenant not found" });
|
|
768
768
|
const n = await t.selectFrom("connections").where("tenant_id", "=", a.tenant_id).selectAll().execute();
|
|
769
769
|
return {
|
|
770
770
|
...a,
|
|
@@ -812,8 +812,8 @@ function Rt(t) {
|
|
|
812
812
|
"type"
|
|
813
813
|
]));
|
|
814
814
|
let c = i.select((f) => f.fn.count("kid").as("count"));
|
|
815
|
-
const
|
|
816
|
-
i = i.limit(r).offset(
|
|
815
|
+
const u = a * r;
|
|
816
|
+
i = i.limit(r).offset(u), o && (i = i.orderBy(o.sort_by, o.sort_order));
|
|
817
817
|
const _ = await i.selectAll().execute();
|
|
818
818
|
if (!n)
|
|
819
819
|
return {
|
|
@@ -825,7 +825,7 @@ function Rt(t) {
|
|
|
825
825
|
const d = await c.executeTakeFirst(), h = x((d == null ? void 0 : d.count) ?? 0);
|
|
826
826
|
return {
|
|
827
827
|
signingKeys: _,
|
|
828
|
-
start:
|
|
828
|
+
start: u,
|
|
829
829
|
limit: r,
|
|
830
830
|
length: h
|
|
831
831
|
};
|
|
@@ -839,14 +839,14 @@ function Kt(t) {
|
|
|
839
839
|
function Ut(t) {
|
|
840
840
|
return async (e, a) => !!(await t.updateTable("keys").set(a).where("kid", "=", e).execute()).length;
|
|
841
841
|
}
|
|
842
|
-
function
|
|
842
|
+
function qt(t) {
|
|
843
843
|
return {
|
|
844
844
|
create: Kt(t),
|
|
845
845
|
list: Rt(t),
|
|
846
846
|
update: Ut(t)
|
|
847
847
|
};
|
|
848
848
|
}
|
|
849
|
-
function
|
|
849
|
+
function Bt(t) {
|
|
850
850
|
return async (e, a) => {
|
|
851
851
|
const r = {
|
|
852
852
|
custom_domain_id: T(),
|
|
@@ -891,7 +891,7 @@ function Gt(t) {
|
|
|
891
891
|
return (await t.updateTable("custom_domains").set(n).where("custom_domains.tenant_id", "=", e).where("custom_domains.custom_domain_id", "=", a).execute()).length > 0;
|
|
892
892
|
};
|
|
893
893
|
}
|
|
894
|
-
function
|
|
894
|
+
function Yt(t) {
|
|
895
895
|
return async (e) => {
|
|
896
896
|
const a = await t.selectFrom("custom_domains").where("custom_domains.domain", "=", e).selectAll().executeTakeFirst();
|
|
897
897
|
return a ? {
|
|
@@ -900,11 +900,11 @@ function Ht(t) {
|
|
|
900
900
|
} : null;
|
|
901
901
|
};
|
|
902
902
|
}
|
|
903
|
-
function
|
|
903
|
+
function Ht(t) {
|
|
904
904
|
return {
|
|
905
|
-
create:
|
|
905
|
+
create: Bt(t),
|
|
906
906
|
get: Vt(t),
|
|
907
|
-
getByDomain:
|
|
907
|
+
getByDomain: Yt(t),
|
|
908
908
|
list: Qt(t),
|
|
909
909
|
remove: Wt(t),
|
|
910
910
|
update: Gt(t)
|
|
@@ -922,7 +922,7 @@ function Xt(t) {
|
|
|
922
922
|
colors_page_background_start: s,
|
|
923
923
|
colors_page_background_end: i,
|
|
924
924
|
colors_page_background_angle_dev: c,
|
|
925
|
-
font_url:
|
|
925
|
+
font_url: u,
|
|
926
926
|
..._
|
|
927
927
|
} = a;
|
|
928
928
|
return y({
|
|
@@ -936,20 +936,20 @@ function Xt(t) {
|
|
|
936
936
|
angle_deg: c
|
|
937
937
|
}
|
|
938
938
|
},
|
|
939
|
-
font:
|
|
939
|
+
font: u ? { url: u } : void 0
|
|
940
940
|
});
|
|
941
941
|
};
|
|
942
942
|
}
|
|
943
943
|
function Zt(t) {
|
|
944
944
|
return async (e, a) => {
|
|
945
|
-
var s, i, c,
|
|
945
|
+
var s, i, c, u, _, d, h, f, g, w, b, D, F, P, V, le, ce, de;
|
|
946
946
|
const { colors: r, font: n, ...o } = a;
|
|
947
947
|
try {
|
|
948
948
|
await t.insertInto("branding").values({
|
|
949
949
|
...o,
|
|
950
950
|
colors_primary: r == null ? void 0 : r.primary,
|
|
951
951
|
colors_page_background_type: (i = (s = a.colors) == null ? void 0 : s.page_background) == null ? void 0 : i.type,
|
|
952
|
-
colors_page_background_start: (
|
|
952
|
+
colors_page_background_start: (u = (c = a.colors) == null ? void 0 : c.page_background) == null ? void 0 : u.start,
|
|
953
953
|
colors_page_background_end: (d = (_ = a.colors) == null ? void 0 : _.page_background) == null ? void 0 : d.end,
|
|
954
954
|
colors_page_background_angle_dev: (f = (h = a.colors) == null ? void 0 : h.page_background) == null ? void 0 : f.angle_deg,
|
|
955
955
|
font_url: (g = a.font) == null ? void 0 : g.url,
|
|
@@ -960,7 +960,7 @@ function Zt(t) {
|
|
|
960
960
|
...o,
|
|
961
961
|
colors_primary: r == null ? void 0 : r.primary,
|
|
962
962
|
colors_page_background_type: (b = (w = a.colors) == null ? void 0 : w.page_background) == null ? void 0 : b.type,
|
|
963
|
-
colors_page_background_start: (
|
|
963
|
+
colors_page_background_start: (F = (D = a.colors) == null ? void 0 : D.page_background) == null ? void 0 : F.start,
|
|
964
964
|
colors_page_background_end: (V = (P = a.colors) == null ? void 0 : P.page_background) == null ? void 0 : V.end,
|
|
965
965
|
colors_page_background_angle_dev: (ce = (le = a.colors) == null ? void 0 : le.page_background) == null ? void 0 : ce.angle_deg,
|
|
966
966
|
font_url: (de = a.font) == null ? void 0 : de.url
|
|
@@ -1115,7 +1115,7 @@ function ua(t) {
|
|
|
1115
1115
|
function ma(t) {
|
|
1116
1116
|
return async (e, a) => {
|
|
1117
1117
|
const r = await t.selectFrom("login_sessions").where("login_sessions.id", "=", a).selectAll().executeTakeFirst();
|
|
1118
|
-
return r ?
|
|
1118
|
+
return r ? qe.parse(
|
|
1119
1119
|
ge(
|
|
1120
1120
|
y({
|
|
1121
1121
|
...r,
|
|
@@ -1184,7 +1184,7 @@ function he(t) {
|
|
|
1184
1184
|
function wa(t) {
|
|
1185
1185
|
return async (e, a) => {
|
|
1186
1186
|
try {
|
|
1187
|
-
const r =
|
|
1187
|
+
const r = Be.parse(a);
|
|
1188
1188
|
await t.insertInto("prompt_settings").values({
|
|
1189
1189
|
...he(r),
|
|
1190
1190
|
tenant_id: e
|
|
@@ -1297,13 +1297,13 @@ function ka(t) {
|
|
|
1297
1297
|
const { page: r = 0, per_page: n = 50, include_totals: o = !1, sort: s, q: i } = a;
|
|
1298
1298
|
let c = t.selectFrom("refresh_tokens").where("refresh_tokens.tenant_id", "=", e);
|
|
1299
1299
|
i && (c = S(t, c, i, ["token", "session_id"]));
|
|
1300
|
-
let
|
|
1300
|
+
let u = c;
|
|
1301
1301
|
if (s && s.sort_by) {
|
|
1302
1302
|
const { ref: g } = t.dynamic;
|
|
1303
|
-
|
|
1303
|
+
u = u.orderBy(g(s.sort_by), s.sort_order);
|
|
1304
1304
|
}
|
|
1305
|
-
|
|
1306
|
-
const d = (await
|
|
1305
|
+
u = u.offset(r * n).limit(n);
|
|
1306
|
+
const d = (await u.selectAll().execute()).map((g) => ({
|
|
1307
1307
|
...g,
|
|
1308
1308
|
rotating: !!g.rotating,
|
|
1309
1309
|
device: g.device ? JSON.parse(g.device) : {},
|
|
@@ -1366,7 +1366,7 @@ function Ia(t) {
|
|
|
1366
1366
|
}
|
|
1367
1367
|
function Da(t) {
|
|
1368
1368
|
return async (e, a) => {
|
|
1369
|
-
const r =
|
|
1369
|
+
const r = Y.parse({
|
|
1370
1370
|
id: T(),
|
|
1371
1371
|
...a,
|
|
1372
1372
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -1379,7 +1379,7 @@ function Da(t) {
|
|
|
1379
1379
|
start: JSON.stringify(r.start || {}),
|
|
1380
1380
|
ending: JSON.stringify(r.ending || {}),
|
|
1381
1381
|
tenant_id: e
|
|
1382
|
-
}).execute(),
|
|
1382
|
+
}).execute(), Y.parse(r);
|
|
1383
1383
|
};
|
|
1384
1384
|
}
|
|
1385
1385
|
function Pa(t) {
|
|
@@ -1404,7 +1404,7 @@ function Pa(t) {
|
|
|
1404
1404
|
f.ending = JSON.parse(f.ending);
|
|
1405
1405
|
} catch {
|
|
1406
1406
|
}
|
|
1407
|
-
return
|
|
1407
|
+
return Y.parse(y(f));
|
|
1408
1408
|
});
|
|
1409
1409
|
if (!o)
|
|
1410
1410
|
return {
|
|
@@ -1422,13 +1422,13 @@ function Pa(t) {
|
|
|
1422
1422
|
};
|
|
1423
1423
|
};
|
|
1424
1424
|
}
|
|
1425
|
-
function
|
|
1425
|
+
function za(t) {
|
|
1426
1426
|
return async (e, a) => {
|
|
1427
1427
|
const { numDeletedRows: r } = await t.deleteFrom("forms").where("id", "=", a).where("tenant_id", "=", e).executeTakeFirst();
|
|
1428
1428
|
return r > 0;
|
|
1429
1429
|
};
|
|
1430
1430
|
}
|
|
1431
|
-
function
|
|
1431
|
+
function ja(t) {
|
|
1432
1432
|
return async (e, a) => {
|
|
1433
1433
|
const r = await t.selectFrom("forms").selectAll().where("forms.id", "=", a).where("tenant_id", "=", e).executeTakeFirst();
|
|
1434
1434
|
if (!r) return null;
|
|
@@ -1448,10 +1448,10 @@ function Fa(t) {
|
|
|
1448
1448
|
n.ending = JSON.parse(n.ending);
|
|
1449
1449
|
} catch {
|
|
1450
1450
|
}
|
|
1451
|
-
return
|
|
1451
|
+
return Y.parse(y(n));
|
|
1452
1452
|
};
|
|
1453
1453
|
}
|
|
1454
|
-
function
|
|
1454
|
+
function Fa(t) {
|
|
1455
1455
|
return async (e, a, r) => {
|
|
1456
1456
|
const n = {
|
|
1457
1457
|
...r,
|
|
@@ -1462,16 +1462,16 @@ function Aa(t) {
|
|
|
1462
1462
|
return o > 0;
|
|
1463
1463
|
};
|
|
1464
1464
|
}
|
|
1465
|
-
function
|
|
1465
|
+
function Aa(t) {
|
|
1466
1466
|
return {
|
|
1467
1467
|
create: Da(t),
|
|
1468
|
-
get:
|
|
1468
|
+
get: ja(t),
|
|
1469
1469
|
list: Pa(t),
|
|
1470
|
-
remove:
|
|
1471
|
-
update:
|
|
1470
|
+
remove: za(t),
|
|
1471
|
+
update: Fa(t)
|
|
1472
1472
|
};
|
|
1473
1473
|
}
|
|
1474
|
-
function
|
|
1474
|
+
function Ma(t) {
|
|
1475
1475
|
return async (e, a) => {
|
|
1476
1476
|
const r = (/* @__PURE__ */ new Date()).toISOString(), n = {
|
|
1477
1477
|
id: T(),
|
|
@@ -1482,7 +1482,7 @@ function za(t) {
|
|
|
1482
1482
|
verificationKey: s,
|
|
1483
1483
|
scopes: i,
|
|
1484
1484
|
options: c,
|
|
1485
|
-
skip_consent_for_verifiable_first_party_clients:
|
|
1485
|
+
skip_consent_for_verifiable_first_party_clients: u,
|
|
1486
1486
|
allow_offline_access: _,
|
|
1487
1487
|
...d
|
|
1488
1488
|
} = o, h = {
|
|
@@ -1490,7 +1490,7 @@ function za(t) {
|
|
|
1490
1490
|
tenant_id: e,
|
|
1491
1491
|
scopes: i ? JSON.stringify(i) : "[]",
|
|
1492
1492
|
options: c ? JSON.stringify(c) : "{}",
|
|
1493
|
-
skip_consent_for_verifiable_first_party_clients:
|
|
1493
|
+
skip_consent_for_verifiable_first_party_clients: u ? 1 : 0,
|
|
1494
1494
|
allow_offline_access: _ ? 1 : 0,
|
|
1495
1495
|
verification_key: s,
|
|
1496
1496
|
created_at: r,
|
|
@@ -1508,14 +1508,14 @@ function Ja(t) {
|
|
|
1508
1508
|
scopes: s,
|
|
1509
1509
|
options: i,
|
|
1510
1510
|
skip_consent_for_verifiable_first_party_clients: c,
|
|
1511
|
-
allow_offline_access:
|
|
1511
|
+
allow_offline_access: u,
|
|
1512
1512
|
..._
|
|
1513
1513
|
} = n, d = {
|
|
1514
1514
|
..._,
|
|
1515
1515
|
scopes: s ? JSON.parse(s) : [],
|
|
1516
1516
|
options: i ? JSON.parse(i) : {},
|
|
1517
1517
|
skip_consent_for_verifiable_first_party_clients: !!c,
|
|
1518
|
-
allow_offline_access: !!
|
|
1518
|
+
allow_offline_access: !!u,
|
|
1519
1519
|
// Convert verification_key back to verificationKey for API
|
|
1520
1520
|
verificationKey: o
|
|
1521
1521
|
};
|
|
@@ -1529,8 +1529,8 @@ function Ea(t) {
|
|
|
1529
1529
|
if (s) {
|
|
1530
1530
|
const h = s.trim(), f = h.split(/\s+/), g = f.length === 1 ? f[0] : void 0, w = g ? g.match(/^(-)?(name|identifier):(.*)$/) : null, b = w ? w[3] : "", D = /^(>=|>|<=|<)/.test(b || "");
|
|
1531
1531
|
if (w && !D) {
|
|
1532
|
-
const
|
|
1533
|
-
i =
|
|
1532
|
+
const F = !!w[1], P = w[2] === "name" ? "resource_servers.name" : "resource_servers.identifier";
|
|
1533
|
+
i = F ? i.where(P, "not like", `%${b}%`) : i.where(P, "like", `%${b}%`);
|
|
1534
1534
|
} else
|
|
1535
1535
|
i = S(t, i, h, [
|
|
1536
1536
|
"resource_servers.name",
|
|
@@ -1543,14 +1543,14 @@ function Ea(t) {
|
|
|
1543
1543
|
scopes: w,
|
|
1544
1544
|
options: b,
|
|
1545
1545
|
skip_consent_for_verifiable_first_party_clients: D,
|
|
1546
|
-
allow_offline_access:
|
|
1546
|
+
allow_offline_access: F,
|
|
1547
1547
|
...P
|
|
1548
1548
|
} = f, V = {
|
|
1549
1549
|
...P,
|
|
1550
1550
|
scopes: w ? JSON.parse(w) : [],
|
|
1551
1551
|
options: b ? JSON.parse(b) : {},
|
|
1552
1552
|
skip_consent_for_verifiable_first_party_clients: !!D,
|
|
1553
|
-
allow_offline_access: !!
|
|
1553
|
+
allow_offline_access: !!F,
|
|
1554
1554
|
// Convert verification_key back to verificationKey for API
|
|
1555
1555
|
verificationKey: g
|
|
1556
1556
|
};
|
|
@@ -1586,9 +1586,9 @@ function Ra(t) {
|
|
|
1586
1586
|
options: s,
|
|
1587
1587
|
skip_consent_for_verifiable_first_party_clients: i,
|
|
1588
1588
|
allow_offline_access: c,
|
|
1589
|
-
...
|
|
1589
|
+
...u
|
|
1590
1590
|
} = r, _ = {
|
|
1591
|
-
...
|
|
1591
|
+
...u,
|
|
1592
1592
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1593
1593
|
};
|
|
1594
1594
|
n !== void 0 && (_.verification_key = n), o !== void 0 && (_.scopes = JSON.stringify(o)), s !== void 0 && (_.options = JSON.stringify(s)), i !== void 0 && (_.skip_consent_for_verifiable_first_party_clients = i ? 1 : 0), c !== void 0 && (_.allow_offline_access = c ? 1 : 0);
|
|
@@ -1598,7 +1598,7 @@ function Ra(t) {
|
|
|
1598
1598
|
}
|
|
1599
1599
|
function Ka(t) {
|
|
1600
1600
|
return {
|
|
1601
|
-
create:
|
|
1601
|
+
create: Ma(t),
|
|
1602
1602
|
get: Ja(t),
|
|
1603
1603
|
list: Ea(t),
|
|
1604
1604
|
remove: La(t),
|
|
@@ -1622,7 +1622,7 @@ function Ua(t) {
|
|
|
1622
1622
|
};
|
|
1623
1623
|
};
|
|
1624
1624
|
}
|
|
1625
|
-
function
|
|
1625
|
+
function qa(t) {
|
|
1626
1626
|
return async (e, a) => {
|
|
1627
1627
|
const r = await t.selectFrom("roles").selectAll().where("roles.tenant_id", "=", e).where("roles.id", "=", a).executeTakeFirst();
|
|
1628
1628
|
return r ? {
|
|
@@ -1630,7 +1630,7 @@ function Ba(t) {
|
|
|
1630
1630
|
} : null;
|
|
1631
1631
|
};
|
|
1632
1632
|
}
|
|
1633
|
-
function
|
|
1633
|
+
function Ba(t) {
|
|
1634
1634
|
return async (e, a) => {
|
|
1635
1635
|
let r = t.selectFrom("roles").where("roles.tenant_id", "=", e);
|
|
1636
1636
|
const { page: n = 0, per_page: o = 50, include_totals: s = !1 } = a;
|
|
@@ -1643,12 +1643,12 @@ function qa(t) {
|
|
|
1643
1643
|
limit: o,
|
|
1644
1644
|
length: c.length
|
|
1645
1645
|
};
|
|
1646
|
-
const { count:
|
|
1646
|
+
const { count: u } = await r.select((_) => _.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1647
1647
|
return {
|
|
1648
1648
|
roles: c,
|
|
1649
1649
|
start: n * o,
|
|
1650
1650
|
limit: o,
|
|
1651
|
-
length: x(
|
|
1651
|
+
length: x(u)
|
|
1652
1652
|
};
|
|
1653
1653
|
};
|
|
1654
1654
|
}
|
|
@@ -1670,8 +1670,8 @@ function Wa(t) {
|
|
|
1670
1670
|
function Va(t) {
|
|
1671
1671
|
return {
|
|
1672
1672
|
create: Ua(t),
|
|
1673
|
-
get:
|
|
1674
|
-
list:
|
|
1673
|
+
get: qa(t),
|
|
1674
|
+
list: Ba(t),
|
|
1675
1675
|
update: Qa(t),
|
|
1676
1676
|
remove: Wa(t)
|
|
1677
1677
|
};
|
|
@@ -1707,7 +1707,7 @@ function Ga(t) {
|
|
|
1707
1707
|
}
|
|
1708
1708
|
};
|
|
1709
1709
|
}
|
|
1710
|
-
function
|
|
1710
|
+
function Ya(t) {
|
|
1711
1711
|
return async (e, a, r) => {
|
|
1712
1712
|
if (r.length === 0) return !0;
|
|
1713
1713
|
try {
|
|
@@ -1725,7 +1725,7 @@ function Ha(t) {
|
|
|
1725
1725
|
}
|
|
1726
1726
|
};
|
|
1727
1727
|
}
|
|
1728
|
-
function
|
|
1728
|
+
function Ha(t) {
|
|
1729
1729
|
return async (e, a, r = {}) => {
|
|
1730
1730
|
const { page: n = 0, per_page: o = 50, include_totals: s = !1 } = r;
|
|
1731
1731
|
let i = t.selectFrom("role_permissions").leftJoin(
|
|
@@ -1762,137 +1762,152 @@ function Ya(t) {
|
|
|
1762
1762
|
function Xa(t) {
|
|
1763
1763
|
return {
|
|
1764
1764
|
assign: Ga(t),
|
|
1765
|
-
remove:
|
|
1766
|
-
list:
|
|
1765
|
+
remove: Ya(t),
|
|
1766
|
+
list: Ha(t)
|
|
1767
1767
|
};
|
|
1768
1768
|
}
|
|
1769
1769
|
function Za(t) {
|
|
1770
|
-
return async (e, a, r) => {
|
|
1771
|
-
|
|
1772
|
-
const n = (/* @__PURE__ */ new Date()).toISOString();
|
|
1770
|
+
return async (e, a, r, n) => {
|
|
1771
|
+
const o = (/* @__PURE__ */ new Date()).toISOString();
|
|
1773
1772
|
try {
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
if (i.code === "SQLITE_CONSTRAINT_PRIMARYKEY" || i.code === "SQLITE_CONSTRAINT_UNIQUE")
|
|
1786
|
-
continue;
|
|
1787
|
-
throw i;
|
|
1788
|
-
}
|
|
1789
|
-
}
|
|
1790
|
-
return !0;
|
|
1791
|
-
} catch (o) {
|
|
1792
|
-
return console.error("Error assigning user permissions:", o), !1;
|
|
1773
|
+
const s = {
|
|
1774
|
+
tenant_id: e,
|
|
1775
|
+
user_id: a,
|
|
1776
|
+
resource_server_identifier: r.resource_server_identifier,
|
|
1777
|
+
permission_name: r.permission_name,
|
|
1778
|
+
organization_id: n || r.organization_id || "",
|
|
1779
|
+
created_at: o
|
|
1780
|
+
};
|
|
1781
|
+
return await t.insertInto("user_permissions").values(s).execute(), !0;
|
|
1782
|
+
} catch (s) {
|
|
1783
|
+
return s.code === "SQLITE_CONSTRAINT_PRIMARYKEY" || s.code === "SQLITE_CONSTRAINT_UNIQUE" || s.code === "SQLITE_CONSTRAINT" || s.message && s.message.includes("UNIQUE constraint failed") || s.message && s.message.includes("PRIMARY KEY constraint failed") ? !0 : (console.error("Error creating user permission:", s), !1);
|
|
1793
1784
|
}
|
|
1794
1785
|
};
|
|
1795
1786
|
}
|
|
1796
1787
|
function er(t) {
|
|
1797
|
-
return async (e, a, r) => {
|
|
1798
|
-
if (r.length === 0) return !0;
|
|
1788
|
+
return async (e, a, r, n) => {
|
|
1799
1789
|
try {
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
return console.error("Error removing user permissions:", n), !1;
|
|
1790
|
+
let o = t.deleteFrom("user_permissions").where("tenant_id", "=", e).where("user_id", "=", a).where(
|
|
1791
|
+
"resource_server_identifier",
|
|
1792
|
+
"=",
|
|
1793
|
+
r.resource_server_identifier
|
|
1794
|
+
).where("permission_name", "=", r.permission_name);
|
|
1795
|
+
return n !== void 0 ? o = o.where("organization_id", "=", n) : o = o.where("organization_id", "=", ""), await o.execute(), !0;
|
|
1796
|
+
} catch (o) {
|
|
1797
|
+
return console.error("Error removing user permission:", o), !1;
|
|
1809
1798
|
}
|
|
1810
1799
|
};
|
|
1811
1800
|
}
|
|
1812
1801
|
function tr(t) {
|
|
1813
|
-
return async (e, a, r) =>
|
|
1814
|
-
"
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1802
|
+
return async (e, a, r, n) => {
|
|
1803
|
+
let o = t.selectFrom("user_permissions").leftJoin(
|
|
1804
|
+
"resource_servers",
|
|
1805
|
+
(i) => i.onRef(
|
|
1806
|
+
"user_permissions.tenant_id",
|
|
1807
|
+
"=",
|
|
1808
|
+
"resource_servers.tenant_id"
|
|
1809
|
+
).onRef(
|
|
1810
|
+
"user_permissions.resource_server_identifier",
|
|
1811
|
+
"=",
|
|
1812
|
+
"resource_servers.id"
|
|
1813
|
+
)
|
|
1814
|
+
).select([
|
|
1820
1815
|
"user_permissions.resource_server_identifier",
|
|
1816
|
+
"user_permissions.permission_name",
|
|
1817
|
+
"resource_servers.name as resource_server_name",
|
|
1818
|
+
"user_permissions.user_id",
|
|
1819
|
+
"user_permissions.created_at",
|
|
1820
|
+
"user_permissions.organization_id"
|
|
1821
|
+
]).where("user_permissions.tenant_id", "=", e).where("user_permissions.user_id", "=", a);
|
|
1822
|
+
return n !== void 0 && (o = o.where(
|
|
1823
|
+
"user_permissions.organization_id",
|
|
1821
1824
|
"=",
|
|
1822
|
-
|
|
1823
|
-
)
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
resource_server_name: o.resource_server_name || o.resource_server_identifier,
|
|
1836
|
-
// Fallback to identifier if name is null
|
|
1837
|
-
user_id: o.user_id,
|
|
1838
|
-
created_at: o.created_at
|
|
1839
|
-
}));
|
|
1825
|
+
n
|
|
1826
|
+
)), (await o.execute()).map((i) => ({
|
|
1827
|
+
resource_server_identifier: i.resource_server_identifier,
|
|
1828
|
+
permission_name: i.permission_name,
|
|
1829
|
+
description: null,
|
|
1830
|
+
// No description available from user_permissions directly
|
|
1831
|
+
resource_server_name: i.resource_server_name || i.resource_server_identifier,
|
|
1832
|
+
// Fallback to identifier if name is null
|
|
1833
|
+
user_id: i.user_id,
|
|
1834
|
+
created_at: i.created_at,
|
|
1835
|
+
organization_id: i.organization_id === "" ? void 0 : i.organization_id
|
|
1836
|
+
}));
|
|
1837
|
+
};
|
|
1840
1838
|
}
|
|
1841
1839
|
function ar(t) {
|
|
1842
1840
|
return {
|
|
1843
|
-
|
|
1841
|
+
create: Za(t),
|
|
1844
1842
|
remove: er(t),
|
|
1845
1843
|
list: tr(t)
|
|
1846
1844
|
};
|
|
1847
1845
|
}
|
|
1848
1846
|
function rr(t) {
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
(n) =>
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
"r.description",
|
|
1856
|
-
"r.created_at",
|
|
1857
|
-
"r.updated_at"
|
|
1858
|
-
]).where("ur.tenant_id", "=", e).where("ur.user_id", "=", a).execute();
|
|
1847
|
+
const e = ar(t);
|
|
1848
|
+
return {
|
|
1849
|
+
create: (a, r, n, o) => e.create(a, r, n, o),
|
|
1850
|
+
remove: (a, r, n, o) => e.remove(a, r, n, o),
|
|
1851
|
+
list: (a, r, n, o) => e.list(a, r, n, o)
|
|
1852
|
+
};
|
|
1859
1853
|
}
|
|
1860
1854
|
function nr(t) {
|
|
1861
|
-
return async (e, a, r) => {
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
return !0;
|
|
1874
|
-
} catch (o) {
|
|
1875
|
-
return console.error("Error assigning user roles:", o), !1;
|
|
1876
|
-
}
|
|
1855
|
+
return async (e, a, r, n) => {
|
|
1856
|
+
let o = t.selectFrom("user_roles as ur").innerJoin(
|
|
1857
|
+
"roles as r",
|
|
1858
|
+
(i) => i.onRef("ur.role_id", "=", "r.id").onRef("ur.tenant_id", "=", "r.tenant_id")
|
|
1859
|
+
).select([
|
|
1860
|
+
"r.id",
|
|
1861
|
+
"r.name",
|
|
1862
|
+
"r.description",
|
|
1863
|
+
"r.created_at",
|
|
1864
|
+
"r.updated_at"
|
|
1865
|
+
]).where("ur.tenant_id", "=", e).where("ur.user_id", "=", a);
|
|
1866
|
+
return n !== void 0 && (o = o.where("ur.organization_id", "=", n)), await o.execute();
|
|
1877
1867
|
};
|
|
1878
1868
|
}
|
|
1879
1869
|
function or(t) {
|
|
1880
|
-
return async (e, a, r) => {
|
|
1870
|
+
return async (e, a, r, n) => {
|
|
1871
|
+
const o = (/* @__PURE__ */ new Date()).toISOString();
|
|
1881
1872
|
try {
|
|
1882
|
-
return
|
|
1883
|
-
|
|
1884
|
-
|
|
1873
|
+
return await t.insertInto("user_roles").values({
|
|
1874
|
+
tenant_id: e,
|
|
1875
|
+
user_id: a,
|
|
1876
|
+
role_id: r,
|
|
1877
|
+
organization_id: n || "",
|
|
1878
|
+
created_at: o
|
|
1879
|
+
}).execute(), !0;
|
|
1880
|
+
} catch (s) {
|
|
1881
|
+
return s.code === "SQLITE_CONSTRAINT_PRIMARYKEY" || s.code === "SQLITE_CONSTRAINT_UNIQUE" || s.code === "SQLITE_CONSTRAINT" || s.message && s.message.includes("UNIQUE constraint failed") || s.message && s.message.includes("PRIMARY KEY constraint failed") ? !0 : (console.error("Error creating user role:", s), !1);
|
|
1885
1882
|
}
|
|
1886
1883
|
};
|
|
1887
1884
|
}
|
|
1888
1885
|
function sr(t) {
|
|
1889
|
-
return {
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1886
|
+
return async (e, a, r, n) => {
|
|
1887
|
+
try {
|
|
1888
|
+
let o = t.deleteFrom("user_roles").where("tenant_id", "=", e).where("user_id", "=", a).where("role_id", "=", r);
|
|
1889
|
+
return n !== void 0 ? o = o.where("organization_id", "=", n) : o = o.where("organization_id", "=", ""), await o.execute(), !0;
|
|
1890
|
+
} catch (o) {
|
|
1891
|
+
return console.error("Error removing user roles:", o), !1;
|
|
1892
|
+
}
|
|
1893
1893
|
};
|
|
1894
1894
|
}
|
|
1895
1895
|
function ir(t) {
|
|
1896
|
+
return {
|
|
1897
|
+
list: nr(t),
|
|
1898
|
+
create: or(t),
|
|
1899
|
+
remove: sr(t)
|
|
1900
|
+
};
|
|
1901
|
+
}
|
|
1902
|
+
function lr(t) {
|
|
1903
|
+
const e = ir(t);
|
|
1904
|
+
return {
|
|
1905
|
+
list: (a, r, n, o) => e.list(a, r, n, o),
|
|
1906
|
+
create: (a, r, n, o) => e.create(a, r, n, o),
|
|
1907
|
+
remove: (a, r, n, o) => e.remove(a, r, n, o)
|
|
1908
|
+
};
|
|
1909
|
+
}
|
|
1910
|
+
function cr(t) {
|
|
1896
1911
|
return async (e, a) => {
|
|
1897
1912
|
const r = {
|
|
1898
1913
|
...a,
|
|
@@ -1910,7 +1925,7 @@ function ir(t) {
|
|
|
1910
1925
|
try {
|
|
1911
1926
|
await t.insertInto("organizations").values(r).execute();
|
|
1912
1927
|
} catch (n) {
|
|
1913
|
-
throw n.code === "SQLITE_CONSTRAINT_UNIQUE" || n.message.includes("AlreadyExists") ? new
|
|
1928
|
+
throw n.code === "SQLITE_CONSTRAINT_UNIQUE" || n.message.includes("AlreadyExists") ? new B(409, {
|
|
1914
1929
|
message: "Organization already exists"
|
|
1915
1930
|
}) : n;
|
|
1916
1931
|
}
|
|
@@ -1922,7 +1937,7 @@ function ir(t) {
|
|
|
1922
1937
|
};
|
|
1923
1938
|
};
|
|
1924
1939
|
}
|
|
1925
|
-
function
|
|
1940
|
+
function dr(t) {
|
|
1926
1941
|
return async (e, a) => {
|
|
1927
1942
|
const r = await t.selectFrom("organizations").selectAll().where("tenant_id", "=", e).where("id", "=", a).executeTakeFirst();
|
|
1928
1943
|
return r ? y({
|
|
@@ -1934,7 +1949,7 @@ function lr(t) {
|
|
|
1934
1949
|
}) : null;
|
|
1935
1950
|
};
|
|
1936
1951
|
}
|
|
1937
|
-
function
|
|
1952
|
+
function ur(t) {
|
|
1938
1953
|
return async (e, a) => {
|
|
1939
1954
|
let r = t.selectFrom("organizations").selectAll().where("tenant_id", "=", e).orderBy("created_at", "desc");
|
|
1940
1955
|
if (a != null && a.per_page && (r = r.limit(a.per_page)), a != null && a.page) {
|
|
@@ -1958,28 +1973,28 @@ function cr(t) {
|
|
|
1958
1973
|
};
|
|
1959
1974
|
};
|
|
1960
1975
|
}
|
|
1961
|
-
function
|
|
1976
|
+
function mr(t) {
|
|
1962
1977
|
return async (e, a) => (await t.deleteFrom("organizations").where("tenant_id", "=", e).where("id", "=", a).execute()).length > 0;
|
|
1963
1978
|
}
|
|
1964
|
-
function
|
|
1979
|
+
function _r(t) {
|
|
1965
1980
|
return async (e, a, r) => {
|
|
1966
|
-
const { branding: n, metadata: o, enabled_connections: s, token_quota: i, ...c } = r,
|
|
1981
|
+
const { branding: n, metadata: o, enabled_connections: s, token_quota: i, ...c } = r, u = {
|
|
1967
1982
|
...c,
|
|
1968
1983
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1969
1984
|
};
|
|
1970
|
-
return n !== void 0 && (
|
|
1985
|
+
return n !== void 0 && (u.branding = JSON.stringify(n)), o !== void 0 && (u.metadata = JSON.stringify(o)), s !== void 0 && (u.enabled_connections = JSON.stringify(s)), i !== void 0 && (u.token_quota = JSON.stringify(i)), (await t.updateTable("organizations").set(u).where("tenant_id", "=", e).where("id", "=", a).execute()).length > 0;
|
|
1971
1986
|
};
|
|
1972
1987
|
}
|
|
1973
|
-
function
|
|
1988
|
+
function hr(t) {
|
|
1974
1989
|
return {
|
|
1975
|
-
create:
|
|
1976
|
-
get:
|
|
1977
|
-
list:
|
|
1978
|
-
remove:
|
|
1979
|
-
update:
|
|
1990
|
+
create: cr(t),
|
|
1991
|
+
get: dr(t),
|
|
1992
|
+
list: ur(t),
|
|
1993
|
+
remove: mr(t),
|
|
1994
|
+
update: _r(t)
|
|
1980
1995
|
};
|
|
1981
1996
|
}
|
|
1982
|
-
function
|
|
1997
|
+
function fr(t) {
|
|
1983
1998
|
return async (e, a) => {
|
|
1984
1999
|
const r = {
|
|
1985
2000
|
id: T(),
|
|
@@ -1992,7 +2007,7 @@ function _r(t) {
|
|
|
1992
2007
|
try {
|
|
1993
2008
|
await t.insertInto("user_organizations").values(r).execute();
|
|
1994
2009
|
} catch (n) {
|
|
1995
|
-
throw n.code === "SQLITE_CONSTRAINT_UNIQUE" || n.code === "ER_DUP_ENTRY" ? new
|
|
2010
|
+
throw n.code === "SQLITE_CONSTRAINT_UNIQUE" || n.code === "ER_DUP_ENTRY" ? new B(409, {
|
|
1996
2011
|
message: "User is already a member of this organization"
|
|
1997
2012
|
}) : n;
|
|
1998
2013
|
}
|
|
@@ -2001,7 +2016,7 @@ function _r(t) {
|
|
|
2001
2016
|
};
|
|
2002
2017
|
};
|
|
2003
2018
|
}
|
|
2004
|
-
function
|
|
2019
|
+
function pr(t) {
|
|
2005
2020
|
return async (e, a) => {
|
|
2006
2021
|
const r = await t.selectFrom("user_organizations").selectAll().where("id", "=", a).where("tenant_id", "=", e).executeTakeFirst();
|
|
2007
2022
|
return r ? {
|
|
@@ -2013,7 +2028,7 @@ function hr(t) {
|
|
|
2013
2028
|
} : null;
|
|
2014
2029
|
};
|
|
2015
2030
|
}
|
|
2016
|
-
function
|
|
2031
|
+
function gr(t) {
|
|
2017
2032
|
return async (e, a) => {
|
|
2018
2033
|
const r = (a == null ? void 0 : a.page) || 0, n = (a == null ? void 0 : a.per_page) || 50, o = r * n;
|
|
2019
2034
|
let s = t.selectFrom("user_organizations").selectAll().where("tenant_id", "=", e);
|
|
@@ -2038,7 +2053,7 @@ function fr(t) {
|
|
|
2038
2053
|
c = c.where("organization_id", "=", d);
|
|
2039
2054
|
}
|
|
2040
2055
|
}
|
|
2041
|
-
const
|
|
2056
|
+
const u = await c.executeTakeFirst();
|
|
2042
2057
|
return {
|
|
2043
2058
|
userOrganizations: i.map((d) => ({
|
|
2044
2059
|
id: d.id,
|
|
@@ -2049,14 +2064,59 @@ function fr(t) {
|
|
|
2049
2064
|
})),
|
|
2050
2065
|
start: o,
|
|
2051
2066
|
limit: n,
|
|
2052
|
-
length: Number((
|
|
2067
|
+
length: Number((u == null ? void 0 : u.count) || 0)
|
|
2053
2068
|
};
|
|
2054
2069
|
};
|
|
2055
2070
|
}
|
|
2056
|
-
function
|
|
2071
|
+
function wr(t) {
|
|
2072
|
+
return async (e, a, r) => {
|
|
2073
|
+
const n = (r == null ? void 0 : r.page) || 0, o = (r == null ? void 0 : r.per_page) || 50, s = n * o;
|
|
2074
|
+
let i = t.selectFrom("user_organizations").innerJoin(
|
|
2075
|
+
"organizations",
|
|
2076
|
+
"organizations.id",
|
|
2077
|
+
"user_organizations.organization_id"
|
|
2078
|
+
).select([
|
|
2079
|
+
"organizations.id",
|
|
2080
|
+
"organizations.name",
|
|
2081
|
+
"organizations.display_name",
|
|
2082
|
+
"organizations.branding",
|
|
2083
|
+
"organizations.metadata",
|
|
2084
|
+
"organizations.enabled_connections",
|
|
2085
|
+
"organizations.token_quota",
|
|
2086
|
+
"organizations.created_at",
|
|
2087
|
+
"organizations.updated_at",
|
|
2088
|
+
"user_organizations.created_at as joined_at"
|
|
2089
|
+
]).where("user_organizations.tenant_id", "=", e).where("user_organizations.user_id", "=", a);
|
|
2090
|
+
i = i.orderBy("user_organizations.created_at", "desc"), o > 0 && (i = i.limit(o).offset(s));
|
|
2091
|
+
const c = await i.execute(), u = await t.selectFrom("user_organizations").innerJoin(
|
|
2092
|
+
"organizations",
|
|
2093
|
+
"organizations.id",
|
|
2094
|
+
"user_organizations.organization_id"
|
|
2095
|
+
).select(t.fn.count("user_organizations.id").as("count")).where("user_organizations.tenant_id", "=", e).where("user_organizations.user_id", "=", a).executeTakeFirst();
|
|
2096
|
+
return {
|
|
2097
|
+
organizations: c.map((d) => ({
|
|
2098
|
+
id: d.id,
|
|
2099
|
+
name: d.name,
|
|
2100
|
+
display_name: d.display_name,
|
|
2101
|
+
branding: d.branding ? JSON.parse(d.branding) : void 0,
|
|
2102
|
+
metadata: d.metadata ? JSON.parse(d.metadata) : {},
|
|
2103
|
+
enabled_connections: d.enabled_connections ? JSON.parse(d.enabled_connections) : [],
|
|
2104
|
+
token_quota: d.token_quota ? JSON.parse(d.token_quota) : void 0,
|
|
2105
|
+
created_at: d.created_at,
|
|
2106
|
+
updated_at: d.updated_at,
|
|
2107
|
+
// Add membership info
|
|
2108
|
+
joined_at: d.joined_at
|
|
2109
|
+
})),
|
|
2110
|
+
start: s,
|
|
2111
|
+
limit: o,
|
|
2112
|
+
length: Number((u == null ? void 0 : u.count) || 0)
|
|
2113
|
+
};
|
|
2114
|
+
};
|
|
2115
|
+
}
|
|
2116
|
+
function yr(t) {
|
|
2057
2117
|
return async (e, a) => (await t.deleteFrom("user_organizations").where("id", "=", a).where("tenant_id", "=", e).execute()).length > 0;
|
|
2058
2118
|
}
|
|
2059
|
-
function
|
|
2119
|
+
function vr(t) {
|
|
2060
2120
|
return async (e, a, r) => {
|
|
2061
2121
|
const n = {
|
|
2062
2122
|
...r,
|
|
@@ -2065,17 +2125,18 @@ function gr(t) {
|
|
|
2065
2125
|
return (await t.updateTable("user_organizations").set(n).where("id", "=", a).where("tenant_id", "=", e).execute()).length > 0;
|
|
2066
2126
|
};
|
|
2067
2127
|
}
|
|
2068
|
-
function
|
|
2128
|
+
function Nr(t) {
|
|
2069
2129
|
return {
|
|
2070
2130
|
// CRUD operations
|
|
2071
|
-
create:
|
|
2072
|
-
get:
|
|
2073
|
-
list:
|
|
2074
|
-
|
|
2075
|
-
|
|
2131
|
+
create: fr(t),
|
|
2132
|
+
get: pr(t),
|
|
2133
|
+
list: gr(t),
|
|
2134
|
+
listUserOrganizations: wr(t),
|
|
2135
|
+
remove: yr(t),
|
|
2136
|
+
update: vr(t)
|
|
2076
2137
|
};
|
|
2077
2138
|
}
|
|
2078
|
-
function
|
|
2139
|
+
function Cr(t) {
|
|
2079
2140
|
return t[t.length - 1];
|
|
2080
2141
|
}
|
|
2081
2142
|
function C(t) {
|
|
@@ -2108,7 +2169,7 @@ const G = C({
|
|
|
2108
2169
|
identifier: G.create(e)
|
|
2109
2170
|
});
|
|
2110
2171
|
}
|
|
2111
|
-
}),
|
|
2172
|
+
}), br = C({
|
|
2112
2173
|
is(t) {
|
|
2113
2174
|
return t.kind === "AliasNode";
|
|
2114
2175
|
},
|
|
@@ -2136,11 +2197,11 @@ const G = C({
|
|
|
2136
2197
|
});
|
|
2137
2198
|
}
|
|
2138
2199
|
});
|
|
2139
|
-
var
|
|
2140
|
-
class
|
|
2200
|
+
var H;
|
|
2201
|
+
class xr {
|
|
2141
2202
|
constructor() {
|
|
2142
2203
|
R(this, "nodeStack", []);
|
|
2143
|
-
O(this,
|
|
2204
|
+
O(this, H, C({
|
|
2144
2205
|
AliasNode: this.transformAlias.bind(this),
|
|
2145
2206
|
ColumnNode: this.transformColumn.bind(this),
|
|
2146
2207
|
IdentifierNode: this.transformIdentifier.bind(this),
|
|
@@ -2244,7 +2305,7 @@ class Nr {
|
|
|
2244
2305
|
return this.nodeStack.pop(), C(a);
|
|
2245
2306
|
}
|
|
2246
2307
|
transformNodeImpl(e) {
|
|
2247
|
-
return
|
|
2308
|
+
return m(this, H)[e.kind](e);
|
|
2248
2309
|
}
|
|
2249
2310
|
transformNodeList(e) {
|
|
2250
2311
|
return e && C(e.map((a) => this.transformNode(a)));
|
|
@@ -2970,8 +3031,8 @@ class Nr {
|
|
|
2970
3031
|
return e;
|
|
2971
3032
|
}
|
|
2972
3033
|
}
|
|
2973
|
-
|
|
2974
|
-
const
|
|
3034
|
+
H = new WeakMap();
|
|
3035
|
+
const Tr = C({
|
|
2975
3036
|
AlterTableNode: !0,
|
|
2976
3037
|
CreateIndexNode: !0,
|
|
2977
3038
|
CreateSchemaNode: !0,
|
|
@@ -2990,14 +3051,14 @@ const Cr = C({
|
|
|
2990
3051
|
UpdateQueryNode: !0,
|
|
2991
3052
|
MergeQueryNode: !0
|
|
2992
3053
|
});
|
|
2993
|
-
var E,
|
|
2994
|
-
class
|
|
3054
|
+
var E, z, j, N, ye, ve, Ne, A, re, Ce;
|
|
3055
|
+
class Sr extends xr {
|
|
2995
3056
|
constructor(a) {
|
|
2996
3057
|
super();
|
|
2997
3058
|
O(this, N);
|
|
2998
3059
|
O(this, E);
|
|
3060
|
+
O(this, z, /* @__PURE__ */ new Set());
|
|
2999
3061
|
O(this, j, /* @__PURE__ */ new Set());
|
|
3000
|
-
O(this, F, /* @__PURE__ */ new Set());
|
|
3001
3062
|
K(this, E, a);
|
|
3002
3063
|
}
|
|
3003
3064
|
transformNodeImpl(a) {
|
|
@@ -3005,73 +3066,73 @@ class br extends Nr {
|
|
|
3005
3066
|
return super.transformNodeImpl(a);
|
|
3006
3067
|
const r = p(this, N, Ne).call(this, a);
|
|
3007
3068
|
for (const s of r)
|
|
3008
|
-
|
|
3069
|
+
m(this, j).add(s);
|
|
3009
3070
|
const n = p(this, N, ve).call(this, a);
|
|
3010
3071
|
for (const s of n)
|
|
3011
|
-
|
|
3072
|
+
m(this, z).add(s);
|
|
3012
3073
|
const o = super.transformNodeImpl(a);
|
|
3013
3074
|
for (const s of n)
|
|
3014
|
-
|
|
3075
|
+
m(this, z).delete(s);
|
|
3015
3076
|
for (const s of r)
|
|
3016
|
-
|
|
3077
|
+
m(this, j).delete(s);
|
|
3017
3078
|
return o;
|
|
3018
3079
|
}
|
|
3019
3080
|
transformSchemableIdentifier(a) {
|
|
3020
3081
|
const r = super.transformSchemableIdentifier(a);
|
|
3021
|
-
return r.schema || !
|
|
3082
|
+
return r.schema || !m(this, z).has(a.identifier.name) ? r : {
|
|
3022
3083
|
...r,
|
|
3023
|
-
schema: G.create(
|
|
3084
|
+
schema: G.create(m(this, E))
|
|
3024
3085
|
};
|
|
3025
3086
|
}
|
|
3026
3087
|
transformReferences(a) {
|
|
3027
3088
|
const r = super.transformReferences(a);
|
|
3028
3089
|
return r.table.table.schema ? r : {
|
|
3029
3090
|
...r,
|
|
3030
|
-
table: Z.createWithSchema(
|
|
3091
|
+
table: Z.createWithSchema(m(this, E), r.table.table.identifier.name)
|
|
3031
3092
|
};
|
|
3032
3093
|
}
|
|
3033
3094
|
}
|
|
3034
|
-
E = new WeakMap(),
|
|
3035
|
-
return a.kind in
|
|
3095
|
+
E = new WeakMap(), z = new WeakMap(), j = new WeakMap(), N = new WeakSet(), ye = function(a) {
|
|
3096
|
+
return a.kind in Tr;
|
|
3036
3097
|
}, ve = function(a) {
|
|
3037
3098
|
const r = /* @__PURE__ */ new Set();
|
|
3038
3099
|
if ("name" in a && a.name && ae.is(a.name) && p(this, N, re).call(this, a.name, r), "from" in a && a.from)
|
|
3039
3100
|
for (const n of a.from.froms)
|
|
3040
|
-
p(this, N,
|
|
3041
|
-
if ("into" in a && a.into && p(this, N,
|
|
3101
|
+
p(this, N, A).call(this, n, r);
|
|
3102
|
+
if ("into" in a && a.into && p(this, N, A).call(this, a.into, r), "table" in a && a.table && p(this, N, A).call(this, a.table, r), "joins" in a && a.joins)
|
|
3042
3103
|
for (const n of a.joins)
|
|
3043
|
-
p(this, N,
|
|
3044
|
-
return "using" in a && a.using && p(this, N,
|
|
3104
|
+
p(this, N, A).call(this, n.table, r);
|
|
3105
|
+
return "using" in a && a.using && p(this, N, A).call(this, a.using, r), r;
|
|
3045
3106
|
}, Ne = function(a) {
|
|
3046
3107
|
const r = /* @__PURE__ */ new Set();
|
|
3047
3108
|
return "with" in a && a.with && p(this, N, Ce).call(this, a.with, r), r;
|
|
3048
|
-
},
|
|
3049
|
-
const n = Z.is(a) ? a :
|
|
3109
|
+
}, A = function(a, r) {
|
|
3110
|
+
const n = Z.is(a) ? a : br.is(a) && Z.is(a.node) ? a.node : null;
|
|
3050
3111
|
n && p(this, N, re).call(this, n.table, r);
|
|
3051
3112
|
}, re = function(a, r) {
|
|
3052
3113
|
const n = a.identifier.name;
|
|
3053
|
-
!
|
|
3114
|
+
!m(this, z).has(n) && !m(this, j).has(n) && r.add(n);
|
|
3054
3115
|
}, Ce = function(a, r) {
|
|
3055
3116
|
for (const n of a.expressions) {
|
|
3056
3117
|
const o = n.name.table.table.identifier.name;
|
|
3057
|
-
|
|
3118
|
+
m(this, j).has(o) || r.add(o);
|
|
3058
3119
|
}
|
|
3059
3120
|
};
|
|
3060
3121
|
var Q;
|
|
3061
|
-
class
|
|
3122
|
+
class Or {
|
|
3062
3123
|
constructor(e) {
|
|
3063
3124
|
O(this, Q);
|
|
3064
|
-
K(this, Q, new
|
|
3125
|
+
K(this, Q, new Sr(e));
|
|
3065
3126
|
}
|
|
3066
3127
|
transformQuery(e) {
|
|
3067
|
-
return
|
|
3128
|
+
return m(this, Q).transformNode(e.node);
|
|
3068
3129
|
}
|
|
3069
3130
|
async transformResult(e) {
|
|
3070
3131
|
return e.result;
|
|
3071
3132
|
}
|
|
3072
3133
|
}
|
|
3073
3134
|
Q = new WeakMap();
|
|
3074
|
-
class
|
|
3135
|
+
class kr {
|
|
3075
3136
|
transformQuery(e) {
|
|
3076
3137
|
return e.node;
|
|
3077
3138
|
}
|
|
@@ -3079,8 +3140,8 @@ class Tr {
|
|
|
3079
3140
|
return e.result;
|
|
3080
3141
|
}
|
|
3081
3142
|
}
|
|
3082
|
-
const
|
|
3083
|
-
var v, l, U, k, $,
|
|
3143
|
+
const $r = "kysely_migration", fe = "kysely_migration_lock", Ir = !1, ee = "migration_lock", Dr = C({ __noMigrations__: !0 });
|
|
3144
|
+
var v, l, U, k, $, M, xe, I, Te, Se, Oe, ke, $e, ne, J, oe, Ie, De, Pe, se, ze, je, Fe, Ae, Me, q;
|
|
3084
3145
|
class be {
|
|
3085
3146
|
constructor(e) {
|
|
3086
3147
|
O(this, l);
|
|
@@ -3093,7 +3154,7 @@ class be {
|
|
|
3093
3154
|
* The returned array is sorted by migration name.
|
|
3094
3155
|
*/
|
|
3095
3156
|
async getMigrations() {
|
|
3096
|
-
const e = await p(this, l, J).call(this,
|
|
3157
|
+
const e = await p(this, l, J).call(this, m(this, l, $)) ? await m(this, v).db.withPlugin(m(this, l, I)).selectFrom(m(this, l, $)).select(["name", "timestamp"]).execute() : [];
|
|
3097
3158
|
return (await p(this, l, se).call(this)).map(({ name: r, ...n }) => {
|
|
3098
3159
|
const o = e.find((s) => s.name === r);
|
|
3099
3160
|
return {
|
|
@@ -3178,7 +3239,7 @@ class be {
|
|
|
3178
3239
|
*/
|
|
3179
3240
|
async migrateTo(e) {
|
|
3180
3241
|
return p(this, l, U).call(this, ({ migrations: a, executedMigrations: r, pendingMigrations: n }) => {
|
|
3181
|
-
if (e ===
|
|
3242
|
+
if (e === Dr)
|
|
3182
3243
|
return { direction: "Down", step: 1 / 0 };
|
|
3183
3244
|
if (!a.find((i) => i.name === e))
|
|
3184
3245
|
throw new Error(`migration "${e}" doesn't exist`);
|
|
@@ -3235,63 +3296,63 @@ v = new WeakMap(), l = new WeakSet(), U = async function(e) {
|
|
|
3235
3296
|
return a instanceof te ? a.resultSet : { error: a };
|
|
3236
3297
|
}
|
|
3237
3298
|
}, k = function() {
|
|
3238
|
-
return
|
|
3299
|
+
return m(this, v).migrationTableSchema;
|
|
3239
3300
|
}, $ = function() {
|
|
3240
|
-
return
|
|
3241
|
-
},
|
|
3242
|
-
return
|
|
3301
|
+
return m(this, v).migrationTableName ?? $r;
|
|
3302
|
+
}, M = function() {
|
|
3303
|
+
return m(this, v).migrationLockTableName ?? fe;
|
|
3243
3304
|
}, xe = function() {
|
|
3244
|
-
return
|
|
3305
|
+
return m(this, v).allowUnorderedMigrations ?? Ir;
|
|
3245
3306
|
}, I = function() {
|
|
3246
|
-
return
|
|
3307
|
+
return m(this, l, k) ? new Or(m(this, l, k)) : new kr();
|
|
3247
3308
|
}, Te = async function() {
|
|
3248
3309
|
await p(this, l, Se).call(this), await p(this, l, Oe).call(this), await p(this, l, ke).call(this), await p(this, l, $e).call(this);
|
|
3249
3310
|
}, Se = async function() {
|
|
3250
|
-
if (
|
|
3311
|
+
if (m(this, l, k) && !await p(this, l, ne).call(this))
|
|
3251
3312
|
try {
|
|
3252
|
-
await p(this, l,
|
|
3313
|
+
await p(this, l, q).call(this, m(this, v).db.schema.createSchema(m(this, l, k)));
|
|
3253
3314
|
} catch (e) {
|
|
3254
3315
|
if (!await p(this, l, ne).call(this))
|
|
3255
3316
|
throw e;
|
|
3256
3317
|
}
|
|
3257
3318
|
}, Oe = async function() {
|
|
3258
|
-
if (!await p(this, l, J).call(this,
|
|
3319
|
+
if (!await p(this, l, J).call(this, m(this, l, $)))
|
|
3259
3320
|
try {
|
|
3260
|
-
|
|
3321
|
+
m(this, l, k) && await p(this, l, q).call(this, m(this, v).db.schema.createSchema(m(this, l, k))), await p(this, l, q).call(this, m(this, v).db.schema.withPlugin(m(this, l, I)).createTable(m(this, l, $)).addColumn("name", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("timestamp", "varchar(255)", (e) => e.notNull()));
|
|
3261
3322
|
} catch (e) {
|
|
3262
|
-
if (!await p(this, l, J).call(this,
|
|
3323
|
+
if (!await p(this, l, J).call(this, m(this, l, $)))
|
|
3263
3324
|
throw e;
|
|
3264
3325
|
}
|
|
3265
3326
|
}, ke = async function() {
|
|
3266
|
-
if (!await p(this, l, J).call(this,
|
|
3327
|
+
if (!await p(this, l, J).call(this, m(this, l, M)))
|
|
3267
3328
|
try {
|
|
3268
|
-
await p(this, l,
|
|
3329
|
+
await p(this, l, q).call(this, m(this, v).db.schema.withPlugin(m(this, l, I)).createTable(m(this, l, M)).addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("is_locked", "integer", (e) => e.notNull().defaultTo(0)));
|
|
3269
3330
|
} catch (e) {
|
|
3270
|
-
if (!await p(this, l, J).call(this,
|
|
3331
|
+
if (!await p(this, l, J).call(this, m(this, l, M)))
|
|
3271
3332
|
throw e;
|
|
3272
3333
|
}
|
|
3273
3334
|
}, $e = async function() {
|
|
3274
3335
|
if (!await p(this, l, oe).call(this))
|
|
3275
3336
|
try {
|
|
3276
|
-
await
|
|
3337
|
+
await m(this, v).db.withPlugin(m(this, l, I)).insertInto(m(this, l, M)).values({ id: ee, is_locked: 0 }).execute();
|
|
3277
3338
|
} catch (e) {
|
|
3278
3339
|
if (!await p(this, l, oe).call(this))
|
|
3279
3340
|
throw e;
|
|
3280
3341
|
}
|
|
3281
3342
|
}, ne = async function() {
|
|
3282
|
-
return (await
|
|
3343
|
+
return (await m(this, v).db.introspection.getSchemas()).some((a) => a.name === m(this, l, k));
|
|
3283
3344
|
}, J = async function(e) {
|
|
3284
|
-
const a =
|
|
3285
|
-
return (await
|
|
3345
|
+
const a = m(this, l, k);
|
|
3346
|
+
return (await m(this, v).db.introspection.getTables({
|
|
3286
3347
|
withInternalKyselyTables: !0
|
|
3287
3348
|
})).some((n) => n.name === e && (!a || n.schema === a));
|
|
3288
3349
|
}, oe = async function() {
|
|
3289
|
-
return !!await
|
|
3350
|
+
return !!await m(this, v).db.withPlugin(m(this, l, I)).selectFrom(m(this, l, M)).where("id", "=", ee).select("id").executeTakeFirst();
|
|
3290
3351
|
}, Ie = async function(e) {
|
|
3291
|
-
const a =
|
|
3292
|
-
lockTable:
|
|
3352
|
+
const a = m(this, v).db.getExecutor().adapter, r = C({
|
|
3353
|
+
lockTable: m(this, v).migrationLockTableName ?? fe,
|
|
3293
3354
|
lockRowId: ee,
|
|
3294
|
-
lockTableSchema:
|
|
3355
|
+
lockTableSchema: m(this, v).migrationTableSchema
|
|
3295
3356
|
}), n = async (o) => {
|
|
3296
3357
|
try {
|
|
3297
3358
|
await a.acquireMigrationLock(o, r);
|
|
@@ -3299,41 +3360,41 @@ v = new WeakMap(), l = new WeakSet(), U = async function(e) {
|
|
|
3299
3360
|
if (s.migrations.length === 0)
|
|
3300
3361
|
return { results: [] };
|
|
3301
3362
|
const { direction: i, step: c } = e(s);
|
|
3302
|
-
return c <= 0 ? { results: [] } : i === "Down" ? await p(this, l,
|
|
3363
|
+
return c <= 0 ? { results: [] } : i === "Down" ? await p(this, l, Ae).call(this, o, s, c) : i === "Up" ? await p(this, l, Me).call(this, o, s, c) : { results: [] };
|
|
3303
3364
|
} finally {
|
|
3304
3365
|
await a.releaseMigrationLock(o, r);
|
|
3305
3366
|
}
|
|
3306
3367
|
};
|
|
3307
|
-
return a.supportsTransactionalDdl ?
|
|
3368
|
+
return a.supportsTransactionalDdl ? m(this, v).db.transaction().execute(n) : m(this, v).db.connection().execute(n);
|
|
3308
3369
|
}, De = async function(e) {
|
|
3309
|
-
const a = await p(this, l, se).call(this), r = await p(this, l,
|
|
3310
|
-
p(this, l,
|
|
3370
|
+
const a = await p(this, l, se).call(this), r = await p(this, l, ze).call(this, e);
|
|
3371
|
+
p(this, l, je).call(this, a, r), m(this, l, xe) || p(this, l, Fe).call(this, a, r);
|
|
3311
3372
|
const n = p(this, l, Pe).call(this, a, r);
|
|
3312
3373
|
return C({
|
|
3313
3374
|
migrations: a,
|
|
3314
3375
|
executedMigrations: r,
|
|
3315
|
-
lastMigration:
|
|
3376
|
+
lastMigration: Cr(r),
|
|
3316
3377
|
pendingMigrations: n
|
|
3317
3378
|
});
|
|
3318
3379
|
}, Pe = function(e, a) {
|
|
3319
3380
|
return e.filter((r) => !a.includes(r.name));
|
|
3320
3381
|
}, se = async function() {
|
|
3321
|
-
const e = await
|
|
3382
|
+
const e = await m(this, v).provider.getMigrations();
|
|
3322
3383
|
return Object.keys(e).sort().map((a) => ({
|
|
3323
3384
|
...e[a],
|
|
3324
3385
|
name: a
|
|
3325
3386
|
}));
|
|
3326
|
-
},
|
|
3327
|
-
return (await e.withPlugin(
|
|
3328
|
-
},
|
|
3387
|
+
}, ze = async function(e) {
|
|
3388
|
+
return (await e.withPlugin(m(this, l, I)).selectFrom(m(this, l, $)).select("name").orderBy(["timestamp", "name"]).execute()).map((r) => r.name);
|
|
3389
|
+
}, je = function(e, a) {
|
|
3329
3390
|
for (const r of a)
|
|
3330
3391
|
if (!e.some((n) => n.name === r))
|
|
3331
3392
|
throw new Error(`corrupted migrations: previously executed migration ${r} is missing`);
|
|
3332
|
-
},
|
|
3393
|
+
}, Fe = function(e, a) {
|
|
3333
3394
|
for (let r = 0; r < a.length; ++r)
|
|
3334
3395
|
if (e[r].name !== a[r])
|
|
3335
3396
|
throw new Error(`corrupted migrations: expected previously executed migration ${a[r]} to be at index ${r} but ${e[r].name} was found in its place. New migrations must always have a name that comes alphabetically after the last executed migration.`);
|
|
3336
|
-
},
|
|
3397
|
+
}, Ae = async function(e, a, r) {
|
|
3337
3398
|
const n = a.executedMigrations.slice().reverse().slice(0, r).map((s) => a.migrations.find((i) => i.name === s)), o = n.map((s) => ({
|
|
3338
3399
|
migrationName: s.name,
|
|
3339
3400
|
direction: "Down",
|
|
@@ -3342,7 +3403,7 @@ v = new WeakMap(), l = new WeakSet(), U = async function(e) {
|
|
|
3342
3403
|
for (let s = 0; s < o.length; ++s) {
|
|
3343
3404
|
const i = n[s];
|
|
3344
3405
|
try {
|
|
3345
|
-
i.down && (await i.down(e), await e.withPlugin(
|
|
3406
|
+
i.down && (await i.down(e), await e.withPlugin(m(this, l, I)).deleteFrom(m(this, l, $)).where("name", "=", i.name).execute(), o[s] = {
|
|
3346
3407
|
migrationName: i.name,
|
|
3347
3408
|
direction: "Down",
|
|
3348
3409
|
status: "Success"
|
|
@@ -3359,7 +3420,7 @@ v = new WeakMap(), l = new WeakSet(), U = async function(e) {
|
|
|
3359
3420
|
}
|
|
3360
3421
|
}
|
|
3361
3422
|
return { results: o };
|
|
3362
|
-
},
|
|
3423
|
+
}, Me = async function(e, a, r) {
|
|
3363
3424
|
const o = a.pendingMigrations.slice(0, r).map((s) => ({
|
|
3364
3425
|
migrationName: s.name,
|
|
3365
3426
|
direction: "Up",
|
|
@@ -3368,7 +3429,7 @@ v = new WeakMap(), l = new WeakSet(), U = async function(e) {
|
|
|
3368
3429
|
for (let s = 0; s < o.length; s++) {
|
|
3369
3430
|
const i = a.pendingMigrations[s];
|
|
3370
3431
|
try {
|
|
3371
|
-
await i.up(e), await e.withPlugin(
|
|
3432
|
+
await i.up(e), await e.withPlugin(m(this, l, I)).insertInto(m(this, l, $)).values({
|
|
3372
3433
|
name: i.name,
|
|
3373
3434
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
3374
3435
|
}).execute(), o[s] = {
|
|
@@ -3388,8 +3449,8 @@ v = new WeakMap(), l = new WeakSet(), U = async function(e) {
|
|
|
3388
3449
|
}
|
|
3389
3450
|
}
|
|
3390
3451
|
return { results: o };
|
|
3391
|
-
},
|
|
3392
|
-
|
|
3452
|
+
}, q = async function(e) {
|
|
3453
|
+
m(this, v).db.getExecutor().adapter.supportsCreateIfNotExists && (e = e.ifNotExists()), await e.execute();
|
|
3393
3454
|
};
|
|
3394
3455
|
var W;
|
|
3395
3456
|
class te extends Error {
|
|
@@ -3399,7 +3460,7 @@ class te extends Error {
|
|
|
3399
3460
|
K(this, W, a);
|
|
3400
3461
|
}
|
|
3401
3462
|
get resultSet() {
|
|
3402
|
-
return
|
|
3463
|
+
return m(this, W);
|
|
3403
3464
|
}
|
|
3404
3465
|
}
|
|
3405
3466
|
W = new WeakMap();
|
|
@@ -3412,7 +3473,7 @@ class Je {
|
|
|
3412
3473
|
return this.migrations;
|
|
3413
3474
|
}
|
|
3414
3475
|
}
|
|
3415
|
-
async function
|
|
3476
|
+
async function Pr(t) {
|
|
3416
3477
|
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(
|
|
3417
3478
|
"tenant_id",
|
|
3418
3479
|
"varchar(255)",
|
|
@@ -3484,35 +3545,35 @@ async function $r(t) {
|
|
|
3484
3545
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
3485
3546
|
).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();
|
|
3486
3547
|
}
|
|
3487
|
-
async function
|
|
3548
|
+
async function zr(t) {
|
|
3488
3549
|
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();
|
|
3489
3550
|
}
|
|
3490
|
-
const
|
|
3551
|
+
const jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3491
3552
|
__proto__: null,
|
|
3492
|
-
down:
|
|
3493
|
-
up:
|
|
3553
|
+
down: zr,
|
|
3554
|
+
up: Pr
|
|
3494
3555
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3495
|
-
async function
|
|
3556
|
+
async function Fr(t) {
|
|
3496
3557
|
await t.schema.alterTable("tenants").addColumn("support_url", "varchar(255)").execute();
|
|
3497
3558
|
}
|
|
3498
|
-
async function
|
|
3559
|
+
async function Ar(t) {
|
|
3499
3560
|
await t.schema.alterTable("tenants").dropColumn("support_url").execute();
|
|
3500
3561
|
}
|
|
3501
|
-
const
|
|
3562
|
+
const Mr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3502
3563
|
__proto__: null,
|
|
3503
|
-
down:
|
|
3504
|
-
up:
|
|
3564
|
+
down: Ar,
|
|
3565
|
+
up: Fr
|
|
3505
3566
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3506
|
-
async function
|
|
3567
|
+
async function Jr(t) {
|
|
3507
3568
|
}
|
|
3508
|
-
async function
|
|
3569
|
+
async function Er(t) {
|
|
3509
3570
|
}
|
|
3510
|
-
const
|
|
3571
|
+
const Lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3511
3572
|
__proto__: null,
|
|
3512
|
-
down:
|
|
3513
|
-
up:
|
|
3573
|
+
down: Er,
|
|
3574
|
+
up: Jr
|
|
3514
3575
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3515
|
-
async function
|
|
3576
|
+
async function Rr(t) {
|
|
3516
3577
|
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(
|
|
3517
3578
|
"tenant_id_constraint",
|
|
3518
3579
|
["tenant_id"],
|
|
@@ -3521,24 +3582,24 @@ async function Jr(t) {
|
|
|
3521
3582
|
(e) => e.onDelete("cascade")
|
|
3522
3583
|
).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();
|
|
3523
3584
|
}
|
|
3524
|
-
async function Er(t) {
|
|
3525
|
-
await t.schema.dropTable("logs").execute();
|
|
3526
|
-
}
|
|
3527
|
-
const Lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3528
|
-
__proto__: null,
|
|
3529
|
-
down: Er,
|
|
3530
|
-
up: Jr
|
|
3531
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
3532
|
-
async function Rr(t) {
|
|
3533
|
-
}
|
|
3534
3585
|
async function Kr(t) {
|
|
3586
|
+
await t.schema.dropTable("logs").execute();
|
|
3535
3587
|
}
|
|
3536
3588
|
const Ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3537
3589
|
__proto__: null,
|
|
3538
3590
|
down: Kr,
|
|
3539
3591
|
up: Rr
|
|
3540
3592
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3593
|
+
async function qr(t) {
|
|
3594
|
+
}
|
|
3541
3595
|
async function Br(t) {
|
|
3596
|
+
}
|
|
3597
|
+
const Qr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3598
|
+
__proto__: null,
|
|
3599
|
+
down: Br,
|
|
3600
|
+
up: qr
|
|
3601
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
3602
|
+
async function Wr(t) {
|
|
3542
3603
|
await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
3543
3604
|
"user_id_constraint",
|
|
3544
3605
|
["user_id", "tenant_id"],
|
|
@@ -3563,15 +3624,15 @@ async function Br(t) {
|
|
|
3563
3624
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
3564
3625
|
).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();
|
|
3565
3626
|
}
|
|
3566
|
-
async function
|
|
3627
|
+
async function Vr(t) {
|
|
3567
3628
|
await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("tickets").execute(), await t.schema.dropTable("otps").execute();
|
|
3568
3629
|
}
|
|
3569
|
-
const
|
|
3630
|
+
const Gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3570
3631
|
__proto__: null,
|
|
3571
|
-
down:
|
|
3572
|
-
up:
|
|
3632
|
+
down: Vr,
|
|
3633
|
+
up: Wr
|
|
3573
3634
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3574
|
-
async function
|
|
3635
|
+
async function Yr(t) {
|
|
3575
3636
|
await t.schema.createTable("passwords").addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addPrimaryKeyConstraint("passwords_pkey", ["user_id", "tenant_id"]).addForeignKeyConstraint(
|
|
3576
3637
|
"user_id_constraint",
|
|
3577
3638
|
["user_id", "tenant_id"],
|
|
@@ -3586,33 +3647,17 @@ async function Wr(t) {
|
|
|
3586
3647
|
(e) => e.onDelete("cascade")
|
|
3587
3648
|
).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();
|
|
3588
3649
|
}
|
|
3589
|
-
async function Vr(t) {
|
|
3590
|
-
await t.schema.dropTable("passwords").execute(), await t.schema.dropTable("codes").execute();
|
|
3591
|
-
}
|
|
3592
|
-
const Gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3593
|
-
__proto__: null,
|
|
3594
|
-
down: Vr,
|
|
3595
|
-
up: Wr
|
|
3596
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
3597
3650
|
async function Hr(t) {
|
|
3598
|
-
|
|
3599
|
-
async function Yr(t) {
|
|
3651
|
+
await t.schema.dropTable("passwords").execute(), await t.schema.dropTable("codes").execute();
|
|
3600
3652
|
}
|
|
3601
3653
|
const Xr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3602
3654
|
__proto__: null,
|
|
3603
|
-
down:
|
|
3604
|
-
up:
|
|
3655
|
+
down: Hr,
|
|
3656
|
+
up: Yr
|
|
3605
3657
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3606
3658
|
async function Zr(t) {
|
|
3607
|
-
await t.schema.alterTable("passwords").addColumn(
|
|
3608
|
-
"password",
|
|
3609
|
-
"varchar(255)",
|
|
3610
|
-
// do we want not null?
|
|
3611
|
-
(e) => e.notNull()
|
|
3612
|
-
).execute();
|
|
3613
3659
|
}
|
|
3614
3660
|
async function en(t) {
|
|
3615
|
-
await t.schema.alterTable("passwords").dropColumn("password").execute();
|
|
3616
3661
|
}
|
|
3617
3662
|
const tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3618
3663
|
__proto__: null,
|
|
@@ -3620,8 +3665,15 @@ const tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3620
3665
|
up: Zr
|
|
3621
3666
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3622
3667
|
async function an(t) {
|
|
3668
|
+
await t.schema.alterTable("passwords").addColumn(
|
|
3669
|
+
"password",
|
|
3670
|
+
"varchar(255)",
|
|
3671
|
+
// do we want not null?
|
|
3672
|
+
(e) => e.notNull()
|
|
3673
|
+
).execute();
|
|
3623
3674
|
}
|
|
3624
3675
|
async function rn(t) {
|
|
3676
|
+
await t.schema.alterTable("passwords").dropColumn("password").execute();
|
|
3625
3677
|
}
|
|
3626
3678
|
const nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3627
3679
|
__proto__: null,
|
|
@@ -3647,10 +3699,8 @@ const un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3647
3699
|
up: cn
|
|
3648
3700
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3649
3701
|
async function mn(t) {
|
|
3650
|
-
await t.schema.createIndex("users_email_index").on("users").column("email").execute();
|
|
3651
3702
|
}
|
|
3652
3703
|
async function _n(t) {
|
|
3653
|
-
await t.schema.dropIndex("users_email_index").execute();
|
|
3654
3704
|
}
|
|
3655
3705
|
const hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3656
3706
|
__proto__: null,
|
|
@@ -3658,10 +3708,10 @@ const hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3658
3708
|
up: mn
|
|
3659
3709
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3660
3710
|
async function fn(t) {
|
|
3661
|
-
await t.schema.
|
|
3711
|
+
await t.schema.createIndex("users_email_index").on("users").column("email").execute();
|
|
3662
3712
|
}
|
|
3663
3713
|
async function pn(t) {
|
|
3664
|
-
await t.schema.
|
|
3714
|
+
await t.schema.dropIndex("users_email_index").execute();
|
|
3665
3715
|
}
|
|
3666
3716
|
const gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3667
3717
|
__proto__: null,
|
|
@@ -3669,10 +3719,10 @@ const gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3669
3719
|
up: fn
|
|
3670
3720
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3671
3721
|
async function wn(t) {
|
|
3672
|
-
await t.schema.
|
|
3722
|
+
await t.schema.alterTable("users").addColumn("profileData", "varchar(2048)").execute();
|
|
3673
3723
|
}
|
|
3674
3724
|
async function yn(t) {
|
|
3675
|
-
await t.schema.
|
|
3725
|
+
await t.schema.alterTable("users").dropColumn("profileData").execute();
|
|
3676
3726
|
}
|
|
3677
3727
|
const vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3678
3728
|
__proto__: null,
|
|
@@ -3680,10 +3730,10 @@ const vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3680
3730
|
up: wn
|
|
3681
3731
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3682
3732
|
async function Nn(t) {
|
|
3683
|
-
await t.schema.
|
|
3733
|
+
await t.schema.createIndex("users_linked_to_index").on("users").column("linked_to").execute();
|
|
3684
3734
|
}
|
|
3685
3735
|
async function Cn(t) {
|
|
3686
|
-
await t.schema.
|
|
3736
|
+
await t.schema.dropIndex("users_linked_to_index");
|
|
3687
3737
|
}
|
|
3688
3738
|
const bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3689
3739
|
__proto__: null,
|
|
@@ -3691,6 +3741,17 @@ const bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3691
3741
|
up: Nn
|
|
3692
3742
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3693
3743
|
async function xn(t) {
|
|
3744
|
+
await t.schema.alterTable("users").addColumn("locale", "varchar(255)").execute();
|
|
3745
|
+
}
|
|
3746
|
+
async function Tn(t) {
|
|
3747
|
+
await t.schema.alterTable("users").dropColumn("locale").execute();
|
|
3748
|
+
}
|
|
3749
|
+
const Sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3750
|
+
__proto__: null,
|
|
3751
|
+
down: Tn,
|
|
3752
|
+
up: xn
|
|
3753
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
3754
|
+
async function On(t) {
|
|
3694
3755
|
await t.schema.createTable("keys").addColumn("kid", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
3695
3756
|
"tenant_id",
|
|
3696
3757
|
"varchar(255)",
|
|
@@ -3705,17 +3766,8 @@ async function xn(t) {
|
|
|
3705
3766
|
(e) => e.references("connections.id").onDelete("cascade")
|
|
3706
3767
|
).execute();
|
|
3707
3768
|
}
|
|
3708
|
-
async function Tn(t) {
|
|
3709
|
-
await t.schema.dropTable("keys").execute();
|
|
3710
|
-
}
|
|
3711
|
-
const Sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3712
|
-
__proto__: null,
|
|
3713
|
-
down: Tn,
|
|
3714
|
-
up: xn
|
|
3715
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
3716
|
-
async function On(t) {
|
|
3717
|
-
}
|
|
3718
3769
|
async function kn(t) {
|
|
3770
|
+
await t.schema.dropTable("keys").execute();
|
|
3719
3771
|
}
|
|
3720
3772
|
const $n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3721
3773
|
__proto__: null,
|
|
@@ -3731,31 +3783,29 @@ const Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3731
3783
|
down: Dn,
|
|
3732
3784
|
up: In
|
|
3733
3785
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3786
|
+
async function zn(t) {
|
|
3787
|
+
}
|
|
3734
3788
|
async function jn(t) {
|
|
3735
|
-
await t.schema.alterTable("otps").addColumn("audience", "varchar(255)").execute();
|
|
3736
3789
|
}
|
|
3737
|
-
|
|
3738
|
-
await t.schema.alterTable("otps").dropColumn("audience").execute();
|
|
3739
|
-
}
|
|
3740
|
-
const An = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3790
|
+
const Fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3741
3791
|
__proto__: null,
|
|
3742
|
-
down:
|
|
3743
|
-
up:
|
|
3792
|
+
down: jn,
|
|
3793
|
+
up: zn
|
|
3744
3794
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3745
|
-
async function
|
|
3795
|
+
async function An(t) {
|
|
3796
|
+
await t.schema.alterTable("otps").addColumn("audience", "varchar(255)").execute();
|
|
3746
3797
|
}
|
|
3747
|
-
async function
|
|
3798
|
+
async function Mn(t) {
|
|
3799
|
+
await t.schema.alterTable("otps").dropColumn("audience").execute();
|
|
3748
3800
|
}
|
|
3749
3801
|
const Jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3750
3802
|
__proto__: null,
|
|
3751
|
-
down:
|
|
3752
|
-
up:
|
|
3803
|
+
down: Mn,
|
|
3804
|
+
up: An
|
|
3753
3805
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3754
3806
|
async function En(t) {
|
|
3755
|
-
await t.schema.alterTable("logs").dropColumn("category").execute();
|
|
3756
3807
|
}
|
|
3757
3808
|
async function Ln(t) {
|
|
3758
|
-
await t.schema.alterTable("logs").addColumn("category", "varchar(255)", (e) => e.notNull()).execute();
|
|
3759
3809
|
}
|
|
3760
3810
|
const Rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3761
3811
|
__proto__: null,
|
|
@@ -3763,54 +3813,54 @@ const Rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3763
3813
|
up: En
|
|
3764
3814
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3765
3815
|
async function Kn(t) {
|
|
3766
|
-
await t.schema.alterTable("
|
|
3816
|
+
await t.schema.alterTable("logs").dropColumn("category").execute();
|
|
3767
3817
|
}
|
|
3768
3818
|
async function Un(t) {
|
|
3769
|
-
await t.schema.alterTable("
|
|
3819
|
+
await t.schema.alterTable("logs").addColumn("category", "varchar(255)", (e) => e.notNull()).execute();
|
|
3770
3820
|
}
|
|
3771
|
-
const
|
|
3821
|
+
const qn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3772
3822
|
__proto__: null,
|
|
3773
3823
|
down: Un,
|
|
3774
3824
|
up: Kn
|
|
3775
3825
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3776
|
-
async function
|
|
3777
|
-
await t.schema.
|
|
3826
|
+
async function Bn(t) {
|
|
3827
|
+
await t.schema.alterTable("users").dropColumn("tags").execute();
|
|
3778
3828
|
}
|
|
3779
3829
|
async function Qn(t) {
|
|
3780
|
-
await t.schema.
|
|
3830
|
+
await t.schema.alterTable("users").addColumn("tags", "varchar(255)").execute();
|
|
3781
3831
|
}
|
|
3782
3832
|
const Wn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3783
3833
|
__proto__: null,
|
|
3784
3834
|
down: Qn,
|
|
3785
|
-
up:
|
|
3835
|
+
up: Bn
|
|
3786
3836
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3787
3837
|
async function Vn(t) {
|
|
3788
|
-
await t.schema.
|
|
3838
|
+
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();
|
|
3789
3839
|
}
|
|
3790
3840
|
async function Gn(t) {
|
|
3791
|
-
await t.schema.
|
|
3841
|
+
await t.schema.dropIndex("logs_user_id"), await t.schema.dropIndex("logs_tenant_id"), await t.schema.dropIndex("logs_date");
|
|
3792
3842
|
}
|
|
3793
|
-
const
|
|
3843
|
+
const Yn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3794
3844
|
__proto__: null,
|
|
3795
3845
|
down: Gn,
|
|
3796
3846
|
up: Vn
|
|
3797
3847
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3798
|
-
async function
|
|
3799
|
-
await t.schema.alterTable("logs").
|
|
3848
|
+
async function Hn(t) {
|
|
3849
|
+
await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(8192)").execute();
|
|
3800
3850
|
}
|
|
3801
3851
|
async function Xn(t) {
|
|
3802
|
-
await t.schema.alterTable("logs").dropColumn("
|
|
3852
|
+
await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(2048)").execute();
|
|
3803
3853
|
}
|
|
3804
3854
|
const Zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3805
3855
|
__proto__: null,
|
|
3806
3856
|
down: Xn,
|
|
3807
|
-
up:
|
|
3857
|
+
up: Hn
|
|
3808
3858
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3809
3859
|
async function eo(t) {
|
|
3810
|
-
await t.schema.
|
|
3860
|
+
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();
|
|
3811
3861
|
}
|
|
3812
3862
|
async function to(t) {
|
|
3813
|
-
await t.schema.
|
|
3863
|
+
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();
|
|
3814
3864
|
}
|
|
3815
3865
|
const ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3816
3866
|
__proto__: null,
|
|
@@ -3818,9 +3868,10 @@ const ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3818
3868
|
up: eo
|
|
3819
3869
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3820
3870
|
async function ro(t) {
|
|
3871
|
+
await t.schema.createIndex("users_name_index").on("users").column("name").execute();
|
|
3821
3872
|
}
|
|
3822
3873
|
async function no(t) {
|
|
3823
|
-
await t.schema.
|
|
3874
|
+
await t.schema.dropIndex("users_name_index").execute();
|
|
3824
3875
|
}
|
|
3825
3876
|
const oo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3826
3877
|
__proto__: null,
|
|
@@ -3828,10 +3879,9 @@ const oo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3828
3879
|
up: ro
|
|
3829
3880
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3830
3881
|
async function so(t) {
|
|
3831
|
-
await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(8192)").execute();
|
|
3832
3882
|
}
|
|
3833
3883
|
async function io(t) {
|
|
3834
|
-
await t.schema.alterTable("
|
|
3884
|
+
await t.schema.alterTable("users").dropConstraint("unique_email_provider").execute();
|
|
3835
3885
|
}
|
|
3836
3886
|
const lo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3837
3887
|
__proto__: null,
|
|
@@ -3839,10 +3889,10 @@ const lo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3839
3889
|
up: so
|
|
3840
3890
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3841
3891
|
async function co(t) {
|
|
3842
|
-
await t.schema.alterTable("
|
|
3892
|
+
await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(8192)").execute();
|
|
3843
3893
|
}
|
|
3844
3894
|
async function uo(t) {
|
|
3845
|
-
await t.schema.alterTable("
|
|
3895
|
+
await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(1024)").execute();
|
|
3846
3896
|
}
|
|
3847
3897
|
const mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3848
3898
|
__proto__: null,
|
|
@@ -3850,14 +3900,10 @@ const mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3850
3900
|
up: co
|
|
3851
3901
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3852
3902
|
async function _o(t) {
|
|
3853
|
-
await t.schema.
|
|
3854
|
-
"tenant_id",
|
|
3855
|
-
"varchar(255)",
|
|
3856
|
-
(e) => e.references("tenants.id").onDelete("cascade").notNull().primaryKey()
|
|
3857
|
-
).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();
|
|
3903
|
+
await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(8192)").execute();
|
|
3858
3904
|
}
|
|
3859
3905
|
async function ho(t) {
|
|
3860
|
-
await t.schema.
|
|
3906
|
+
await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(1024)").execute();
|
|
3861
3907
|
}
|
|
3862
3908
|
const fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3863
3909
|
__proto__: null,
|
|
@@ -3865,8 +3911,14 @@ const fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3865
3911
|
up: _o
|
|
3866
3912
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3867
3913
|
async function po(t) {
|
|
3914
|
+
await t.schema.createTable("branding").addColumn(
|
|
3915
|
+
"tenant_id",
|
|
3916
|
+
"varchar(255)",
|
|
3917
|
+
(e) => e.references("tenants.id").onDelete("cascade").notNull().primaryKey()
|
|
3918
|
+
).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();
|
|
3868
3919
|
}
|
|
3869
3920
|
async function go(t) {
|
|
3921
|
+
await t.schema.dropTable("branding").execute();
|
|
3870
3922
|
}
|
|
3871
3923
|
const wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3872
3924
|
__proto__: null,
|
|
@@ -3901,18 +3953,8 @@ const Oo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3901
3953
|
up: To
|
|
3902
3954
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3903
3955
|
async function ko(t) {
|
|
3904
|
-
await t.schema.createTable("authentication_codes").addColumn(
|
|
3905
|
-
"tenant_id",
|
|
3906
|
-
"varchar(255)",
|
|
3907
|
-
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
3908
|
-
).addColumn("code", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
3909
|
-
"client_id",
|
|
3910
|
-
"varchar(255)",
|
|
3911
|
-
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
3912
|
-
).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();
|
|
3913
3956
|
}
|
|
3914
3957
|
async function $o(t) {
|
|
3915
|
-
await t.schema.dropTable("authentication_codes").execute();
|
|
3916
3958
|
}
|
|
3917
3959
|
const Io = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3918
3960
|
__proto__: null,
|
|
@@ -3920,39 +3962,49 @@ const Io = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3920
3962
|
up: ko
|
|
3921
3963
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3922
3964
|
async function Do(t) {
|
|
3965
|
+
await t.schema.createTable("authentication_codes").addColumn(
|
|
3966
|
+
"tenant_id",
|
|
3967
|
+
"varchar(255)",
|
|
3968
|
+
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
3969
|
+
).addColumn("code", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
3970
|
+
"client_id",
|
|
3971
|
+
"varchar(255)",
|
|
3972
|
+
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
3973
|
+
).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();
|
|
3923
3974
|
}
|
|
3924
3975
|
async function Po(t) {
|
|
3976
|
+
await t.schema.dropTable("authentication_codes").execute();
|
|
3925
3977
|
}
|
|
3926
|
-
const
|
|
3978
|
+
const zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3927
3979
|
__proto__: null,
|
|
3928
3980
|
down: Po,
|
|
3929
3981
|
up: Do
|
|
3930
3982
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3931
|
-
async function
|
|
3932
|
-
await t.schema.alterTable("otps").addColumn("ip", "varchar(64)").execute();
|
|
3983
|
+
async function jo(t) {
|
|
3933
3984
|
}
|
|
3934
|
-
async function
|
|
3935
|
-
await t.schema.alterTable("otps").dropColumn("ip").execute();
|
|
3985
|
+
async function Fo(t) {
|
|
3936
3986
|
}
|
|
3937
|
-
const
|
|
3987
|
+
const Ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3938
3988
|
__proto__: null,
|
|
3939
|
-
down:
|
|
3940
|
-
up:
|
|
3989
|
+
down: Fo,
|
|
3990
|
+
up: jo
|
|
3941
3991
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3942
|
-
async function
|
|
3943
|
-
await t.schema.alterTable("
|
|
3992
|
+
async function Mo(t) {
|
|
3993
|
+
await t.schema.alterTable("otps").addColumn("ip", "varchar(64)").execute();
|
|
3944
3994
|
}
|
|
3945
3995
|
async function Jo(t) {
|
|
3946
|
-
await t.schema.alterTable("
|
|
3996
|
+
await t.schema.alterTable("otps").dropColumn("ip").execute();
|
|
3947
3997
|
}
|
|
3948
3998
|
const Eo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3949
3999
|
__proto__: null,
|
|
3950
4000
|
down: Jo,
|
|
3951
|
-
up:
|
|
4001
|
+
up: Mo
|
|
3952
4002
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3953
4003
|
async function Lo(t) {
|
|
4004
|
+
await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(1024)").execute();
|
|
3954
4005
|
}
|
|
3955
4006
|
async function Ro(t) {
|
|
4007
|
+
await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(255)").execute();
|
|
3956
4008
|
}
|
|
3957
4009
|
const Ko = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3958
4010
|
__proto__: null,
|
|
@@ -3960,6 +4012,15 @@ const Ko = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3960
4012
|
up: Lo
|
|
3961
4013
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3962
4014
|
async function Uo(t) {
|
|
4015
|
+
}
|
|
4016
|
+
async function qo(t) {
|
|
4017
|
+
}
|
|
4018
|
+
const Bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4019
|
+
__proto__: null,
|
|
4020
|
+
down: qo,
|
|
4021
|
+
up: Uo
|
|
4022
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
4023
|
+
async function Qo(t) {
|
|
3963
4024
|
await t.schema.createTable("hooks").addColumn("hook_id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
|
|
3964
4025
|
"tenant_id",
|
|
3965
4026
|
"varchar(255)",
|
|
@@ -3970,17 +4031,8 @@ async function Uo(t) {
|
|
|
3970
4031
|
(e) => e.defaultTo(!1).notNull()
|
|
3971
4032
|
).addColumn("priority", "integer").execute();
|
|
3972
4033
|
}
|
|
3973
|
-
async function Bo(t) {
|
|
3974
|
-
await t.schema.dropTable("hooks").execute();
|
|
3975
|
-
}
|
|
3976
|
-
const qo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3977
|
-
__proto__: null,
|
|
3978
|
-
down: Bo,
|
|
3979
|
-
up: Uo
|
|
3980
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
3981
|
-
async function Qo(t) {
|
|
3982
|
-
}
|
|
3983
4034
|
async function Wo(t) {
|
|
4035
|
+
await t.schema.dropTable("hooks").execute();
|
|
3984
4036
|
}
|
|
3985
4037
|
const Vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3986
4038
|
__proto__: null,
|
|
@@ -3989,14 +4041,23 @@ const Vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3989
4041
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3990
4042
|
async function Go(t) {
|
|
3991
4043
|
}
|
|
3992
|
-
async function
|
|
4044
|
+
async function Yo(t) {
|
|
3993
4045
|
}
|
|
3994
|
-
const
|
|
4046
|
+
const Ho = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3995
4047
|
__proto__: null,
|
|
3996
|
-
down:
|
|
4048
|
+
down: Yo,
|
|
3997
4049
|
up: Go
|
|
3998
4050
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3999
4051
|
async function Xo(t) {
|
|
4052
|
+
}
|
|
4053
|
+
async function Zo(t) {
|
|
4054
|
+
}
|
|
4055
|
+
const es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4056
|
+
__proto__: null,
|
|
4057
|
+
down: Zo,
|
|
4058
|
+
up: Xo
|
|
4059
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
4060
|
+
async function ts(t) {
|
|
4000
4061
|
await t.schema.createTable("logins").addColumn("login_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
4001
4062
|
"tenant_id",
|
|
4002
4063
|
"varchar(255)",
|
|
@@ -4013,7 +4074,7 @@ async function Xo(t) {
|
|
|
4013
4074
|
(e) => e.onDelete("cascade")
|
|
4014
4075
|
).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();
|
|
4015
4076
|
}
|
|
4016
|
-
async function
|
|
4077
|
+
async function as(t) {
|
|
4017
4078
|
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(
|
|
4018
4079
|
"codes_user_id_tenant_id_constraint",
|
|
4019
4080
|
["user_id", "tenant_id"],
|
|
@@ -4022,25 +4083,14 @@ async function Zo(t) {
|
|
|
4022
4083
|
(e) => e.onDelete("cascade")
|
|
4023
4084
|
).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();
|
|
4024
4085
|
}
|
|
4025
|
-
const es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4026
|
-
__proto__: null,
|
|
4027
|
-
down: Zo,
|
|
4028
|
-
up: Xo
|
|
4029
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
4030
|
-
async function ts(t) {
|
|
4031
|
-
}
|
|
4032
|
-
async function as(t) {
|
|
4033
|
-
}
|
|
4034
4086
|
const rs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4035
4087
|
__proto__: null,
|
|
4036
4088
|
down: as,
|
|
4037
4089
|
up: ts
|
|
4038
4090
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4039
4091
|
async function ns(t) {
|
|
4040
|
-
await t.schema.alterTable("logins").addColumn("auth0Client", "varchar(256)").execute();
|
|
4041
4092
|
}
|
|
4042
4093
|
async function os(t) {
|
|
4043
|
-
await t.schema.alterTable("logins").dropColumn("auth0Client").execute();
|
|
4044
4094
|
}
|
|
4045
4095
|
const ss = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4046
4096
|
__proto__: null,
|
|
@@ -4048,10 +4098,10 @@ const ss = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4048
4098
|
up: ns
|
|
4049
4099
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4050
4100
|
async function is(t) {
|
|
4051
|
-
await t.schema.alterTable("logins").
|
|
4101
|
+
await t.schema.alterTable("logins").addColumn("auth0Client", "varchar(256)").execute();
|
|
4052
4102
|
}
|
|
4053
4103
|
async function ls(t) {
|
|
4054
|
-
await t.schema.alterTable("logins").dropColumn("
|
|
4104
|
+
await t.schema.alterTable("logins").dropColumn("auth0Client").execute();
|
|
4055
4105
|
}
|
|
4056
4106
|
const cs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4057
4107
|
__proto__: null,
|
|
@@ -4059,8 +4109,10 @@ const cs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4059
4109
|
up: is
|
|
4060
4110
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4061
4111
|
async function ds(t) {
|
|
4112
|
+
await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(8192)").execute();
|
|
4062
4113
|
}
|
|
4063
4114
|
async function us(t) {
|
|
4115
|
+
await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(511)").execute();
|
|
4064
4116
|
}
|
|
4065
4117
|
const ms = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4066
4118
|
__proto__: null,
|
|
@@ -4077,10 +4129,8 @@ const fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4077
4129
|
up: _s
|
|
4078
4130
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4079
4131
|
async function ps(t) {
|
|
4080
|
-
await t.schema.alterTable("logins").addColumn("authParams_nonce", "varchar(255)").execute();
|
|
4081
4132
|
}
|
|
4082
4133
|
async function gs(t) {
|
|
4083
|
-
await t.schema.alterTable("logins").dropColumn("nonce").execute();
|
|
4084
4134
|
}
|
|
4085
4135
|
const ws = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4086
4136
|
__proto__: null,
|
|
@@ -4088,8 +4138,10 @@ const ws = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4088
4138
|
up: ps
|
|
4089
4139
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4090
4140
|
async function ys(t) {
|
|
4141
|
+
await t.schema.alterTable("logins").addColumn("authParams_nonce", "varchar(255)").execute();
|
|
4091
4142
|
}
|
|
4092
4143
|
async function vs(t) {
|
|
4144
|
+
await t.schema.alterTable("logins").dropColumn("nonce").execute();
|
|
4093
4145
|
}
|
|
4094
4146
|
const Ns = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4095
4147
|
__proto__: null,
|
|
@@ -4106,6 +4158,15 @@ const xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4106
4158
|
up: Cs
|
|
4107
4159
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4108
4160
|
async function Ts(t) {
|
|
4161
|
+
}
|
|
4162
|
+
async function Ss(t) {
|
|
4163
|
+
}
|
|
4164
|
+
const Os = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4165
|
+
__proto__: null,
|
|
4166
|
+
down: Ss,
|
|
4167
|
+
up: Ts
|
|
4168
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
4169
|
+
async function ks(t) {
|
|
4109
4170
|
await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.notNull()).addColumn(
|
|
4110
4171
|
"tenant_id",
|
|
4111
4172
|
"varchar(255)",
|
|
@@ -4121,7 +4182,7 @@ async function Ts(t) {
|
|
|
4121
4182
|
"code_type"
|
|
4122
4183
|
]).execute();
|
|
4123
4184
|
}
|
|
4124
|
-
async function
|
|
4185
|
+
async function $s(t) {
|
|
4125
4186
|
await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
4126
4187
|
"tenant_id",
|
|
4127
4188
|
"varchar(255)",
|
|
@@ -4134,15 +4195,15 @@ async function Ss(t) {
|
|
|
4134
4195
|
(e) => e.onDelete("cascade")
|
|
4135
4196
|
).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();
|
|
4136
4197
|
}
|
|
4137
|
-
const
|
|
4198
|
+
const Is = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4138
4199
|
__proto__: null,
|
|
4139
|
-
down:
|
|
4140
|
-
up:
|
|
4200
|
+
down: $s,
|
|
4201
|
+
up: ks
|
|
4141
4202
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4142
|
-
async function
|
|
4203
|
+
async function Ds(t) {
|
|
4143
4204
|
await t.schema.dropTable("otps").execute(), await t.schema.dropTable("authentication_codes").execute();
|
|
4144
4205
|
}
|
|
4145
|
-
async function
|
|
4206
|
+
async function Ps(t) {
|
|
4146
4207
|
await t.schema.alterTable("keys").addColumn("private_key", "varchar(2048)").addColumn("public_key", "varchar(2048)").execute(), await t.schema.createTable("otps").addColumn(
|
|
4147
4208
|
"tenant_id",
|
|
4148
4209
|
"varchar(255)",
|
|
@@ -4161,32 +4222,32 @@ async function $s(t) {
|
|
|
4161
4222
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
4162
4223
|
).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();
|
|
4163
4224
|
}
|
|
4164
|
-
const
|
|
4225
|
+
const zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4165
4226
|
__proto__: null,
|
|
4166
|
-
down:
|
|
4167
|
-
up:
|
|
4227
|
+
down: Ps,
|
|
4228
|
+
up: Ds
|
|
4168
4229
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4169
|
-
async function
|
|
4230
|
+
async function js(t) {
|
|
4170
4231
|
await t.schema.createIndex("IDX_logs_tenant_date_type_user").on("logs").columns(["tenant_id", "date", "type", "user_id"]).execute();
|
|
4171
4232
|
}
|
|
4172
|
-
async function
|
|
4233
|
+
async function Fs(t) {
|
|
4173
4234
|
await t.schema.dropIndex("IDX_logs_tenant_date_type_user").on("logs").execute();
|
|
4174
4235
|
}
|
|
4175
|
-
const
|
|
4236
|
+
const As = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4176
4237
|
__proto__: null,
|
|
4177
|
-
down:
|
|
4178
|
-
up:
|
|
4238
|
+
down: Fs,
|
|
4239
|
+
up: js
|
|
4179
4240
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4180
|
-
async function
|
|
4241
|
+
async function Ms(t) {
|
|
4181
4242
|
}
|
|
4182
|
-
async function
|
|
4243
|
+
async function Js(t) {
|
|
4183
4244
|
}
|
|
4184
|
-
const
|
|
4245
|
+
const Es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4185
4246
|
__proto__: null,
|
|
4186
|
-
down:
|
|
4187
|
-
up:
|
|
4247
|
+
down: Js,
|
|
4248
|
+
up: Ms
|
|
4188
4249
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4189
|
-
async function
|
|
4250
|
+
async function Ls(t) {
|
|
4190
4251
|
await t.schema.createTable("prompt_settings").addColumn("tenant_id", "varchar(64)", (e) => e.primaryKey()).addColumn(
|
|
4191
4252
|
"universal_login_experience",
|
|
4192
4253
|
"varchar(16)",
|
|
@@ -4205,17 +4266,8 @@ async function zs(t) {
|
|
|
4205
4266
|
(e) => e.defaultTo(!1).notNull()
|
|
4206
4267
|
).execute();
|
|
4207
4268
|
}
|
|
4208
|
-
async function Js(t) {
|
|
4209
|
-
await t.schema.dropTable("prompt_settings").execute();
|
|
4210
|
-
}
|
|
4211
|
-
const Es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4212
|
-
__proto__: null,
|
|
4213
|
-
down: Js,
|
|
4214
|
-
up: zs
|
|
4215
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
4216
|
-
async function Ls(t) {
|
|
4217
|
-
}
|
|
4218
4269
|
async function Rs(t) {
|
|
4270
|
+
await t.schema.dropTable("prompt_settings").execute();
|
|
4219
4271
|
}
|
|
4220
4272
|
const Ks = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4221
4273
|
__proto__: null,
|
|
@@ -4224,11 +4276,11 @@ const Ks = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4224
4276
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4225
4277
|
async function Us(t) {
|
|
4226
4278
|
}
|
|
4227
|
-
async function
|
|
4279
|
+
async function qs(t) {
|
|
4228
4280
|
}
|
|
4229
|
-
const
|
|
4281
|
+
const Bs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4230
4282
|
__proto__: null,
|
|
4231
|
-
down:
|
|
4283
|
+
down: qs,
|
|
4232
4284
|
up: Us
|
|
4233
4285
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4234
4286
|
async function Qs(t) {
|
|
@@ -4241,21 +4293,19 @@ const Vs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4241
4293
|
up: Qs
|
|
4242
4294
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4243
4295
|
async function Gs(t) {
|
|
4244
|
-
await t.schema.alterTable("logins").addColumn("authParams_ui_locales", "varchar(32)").execute();
|
|
4245
4296
|
}
|
|
4246
|
-
async function
|
|
4247
|
-
await t.schema.alterTable("logins").dropColumn("authParams_ui_locales").execute();
|
|
4297
|
+
async function Ys(t) {
|
|
4248
4298
|
}
|
|
4249
|
-
const
|
|
4299
|
+
const Hs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4250
4300
|
__proto__: null,
|
|
4251
|
-
down:
|
|
4301
|
+
down: Ys,
|
|
4252
4302
|
up: Gs
|
|
4253
4303
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4254
4304
|
async function Xs(t) {
|
|
4255
|
-
await t.schema.alterTable("logins").addColumn("
|
|
4305
|
+
await t.schema.alterTable("logins").addColumn("authParams_ui_locales", "varchar(32)").execute();
|
|
4256
4306
|
}
|
|
4257
4307
|
async function Zs(t) {
|
|
4258
|
-
await t.schema.alterTable("logins").dropColumn("
|
|
4308
|
+
await t.schema.alterTable("logins").dropColumn("authParams_ui_locales").execute();
|
|
4259
4309
|
}
|
|
4260
4310
|
const ei = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4261
4311
|
__proto__: null,
|
|
@@ -4263,8 +4313,10 @@ const ei = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4263
4313
|
up: Xs
|
|
4264
4314
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4265
4315
|
async function ti(t) {
|
|
4316
|
+
await t.schema.alterTable("logins").addColumn("authParams_prompt", "varchar(16)").execute();
|
|
4266
4317
|
}
|
|
4267
4318
|
async function ai(t) {
|
|
4319
|
+
await t.schema.alterTable("logins").dropColumn("authParams_prompt").execute();
|
|
4268
4320
|
}
|
|
4269
4321
|
const ri = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4270
4322
|
__proto__: null,
|
|
@@ -4272,10 +4324,8 @@ const ri = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4272
4324
|
up: ti
|
|
4273
4325
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4274
4326
|
async function ni(t) {
|
|
4275
|
-
await t.schema.alterTable("logins").addColumn("authParams_act_as", "varchar(255)").execute();
|
|
4276
4327
|
}
|
|
4277
4328
|
async function oi(t) {
|
|
4278
|
-
await t.schema.alterTable("logins").dropColumn("authParam_act_as").execute();
|
|
4279
4329
|
}
|
|
4280
4330
|
const si = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4281
4331
|
__proto__: null,
|
|
@@ -4283,10 +4333,10 @@ const si = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4283
4333
|
up: ni
|
|
4284
4334
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4285
4335
|
async function ii(t) {
|
|
4286
|
-
await t.schema.alterTable("
|
|
4336
|
+
await t.schema.alterTable("logins").addColumn("authParams_act_as", "varchar(255)").execute();
|
|
4287
4337
|
}
|
|
4288
4338
|
async function li(t) {
|
|
4289
|
-
await t.schema.alterTable("
|
|
4339
|
+
await t.schema.alterTable("logins").dropColumn("authParam_act_as").execute();
|
|
4290
4340
|
}
|
|
4291
4341
|
const ci = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4292
4342
|
__proto__: null,
|
|
@@ -4294,6 +4344,17 @@ const ci = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4294
4344
|
up: ii
|
|
4295
4345
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4296
4346
|
async function di(t) {
|
|
4347
|
+
await t.schema.alterTable("codes").addColumn("code_verifier", "varchar(128)").execute();
|
|
4348
|
+
}
|
|
4349
|
+
async function ui(t) {
|
|
4350
|
+
await t.schema.alterTable("codes").dropColumn("code_verifier").execute();
|
|
4351
|
+
}
|
|
4352
|
+
const mi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4353
|
+
__proto__: null,
|
|
4354
|
+
down: ui,
|
|
4355
|
+
up: di
|
|
4356
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
4357
|
+
async function _i(t) {
|
|
4297
4358
|
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(
|
|
4298
4359
|
"credentials",
|
|
4299
4360
|
"varchar(2048)",
|
|
@@ -4304,18 +4365,18 @@ async function di(t) {
|
|
|
4304
4365
|
(e) => e.notNull().defaultTo("{}")
|
|
4305
4366
|
).addColumn("created_at", "varchar(29)", (e) => e.notNull()).addColumn("updated_at", "varchar(29)", (e) => e.notNull()).execute();
|
|
4306
4367
|
}
|
|
4307
|
-
async function
|
|
4368
|
+
async function hi(t) {
|
|
4308
4369
|
await t.schema.dropTable("email_providers").execute();
|
|
4309
4370
|
}
|
|
4310
|
-
const
|
|
4371
|
+
const fi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4311
4372
|
__proto__: null,
|
|
4312
|
-
down:
|
|
4313
|
-
up:
|
|
4373
|
+
down: hi,
|
|
4374
|
+
up: _i
|
|
4314
4375
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4315
|
-
async function
|
|
4376
|
+
async function pi(t) {
|
|
4316
4377
|
await t.schema.dropTable("tickets").execute();
|
|
4317
4378
|
}
|
|
4318
|
-
async function
|
|
4379
|
+
async function gi(t) {
|
|
4319
4380
|
await t.schema.createTable("tickets").addColumn(
|
|
4320
4381
|
"tenant_id",
|
|
4321
4382
|
"varchar(255)",
|
|
@@ -4326,22 +4387,22 @@ async function hi(t) {
|
|
|
4326
4387
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
4327
4388
|
).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();
|
|
4328
4389
|
}
|
|
4329
|
-
const
|
|
4390
|
+
const wi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4330
4391
|
__proto__: null,
|
|
4331
|
-
down:
|
|
4332
|
-
up:
|
|
4392
|
+
down: gi,
|
|
4393
|
+
up: pi
|
|
4333
4394
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4334
|
-
async function
|
|
4395
|
+
async function yi(t) {
|
|
4335
4396
|
}
|
|
4336
|
-
async function
|
|
4397
|
+
async function vi(t) {
|
|
4337
4398
|
await t.schema.alterTable("logins").dropColumn("ip").dropColumn("useragent").execute();
|
|
4338
4399
|
}
|
|
4339
|
-
const
|
|
4400
|
+
const Ni = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4340
4401
|
__proto__: null,
|
|
4341
|
-
down:
|
|
4342
|
-
up:
|
|
4402
|
+
down: vi,
|
|
4403
|
+
up: yi
|
|
4343
4404
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4344
|
-
async function
|
|
4405
|
+
async function Ci(t) {
|
|
4345
4406
|
await t.schema.createTable("refresh_tokens").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn(
|
|
4346
4407
|
"client_id",
|
|
4347
4408
|
"varchar(21)",
|
|
@@ -4354,17 +4415,8 @@ async function yi(t) {
|
|
|
4354
4415
|
(e) => e.onDelete("cascade")
|
|
4355
4416
|
).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("expires_at", "varchar(35)").addColumn("idle_expires_at", "varchar(35)").addColumn("last_exchanged_at", "varchar(35)").addColumn("device", "varchar(2048)", (e) => e.notNull()).addColumn("resource_servers", "varchar(2048)", (e) => e.notNull()).addColumn("rotating", "boolean", (e) => e.notNull()).execute();
|
|
4356
4417
|
}
|
|
4357
|
-
async function vi(t) {
|
|
4358
|
-
await t.schema.dropTable("refresh_tokens").execute();
|
|
4359
|
-
}
|
|
4360
|
-
const Ni = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4361
|
-
__proto__: null,
|
|
4362
|
-
down: vi,
|
|
4363
|
-
up: yi
|
|
4364
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
4365
|
-
async function Ci(t) {
|
|
4366
|
-
}
|
|
4367
4418
|
async function bi(t) {
|
|
4419
|
+
await t.schema.dropTable("refresh_tokens").execute();
|
|
4368
4420
|
}
|
|
4369
4421
|
const xi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4370
4422
|
__proto__: null,
|
|
@@ -4372,9 +4424,18 @@ const xi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4372
4424
|
up: Ci
|
|
4373
4425
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4374
4426
|
async function Ti(t) {
|
|
4375
|
-
await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("refresh_tokens").execute();
|
|
4376
4427
|
}
|
|
4377
4428
|
async function Si(t) {
|
|
4429
|
+
}
|
|
4430
|
+
const Oi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4431
|
+
__proto__: null,
|
|
4432
|
+
down: Si,
|
|
4433
|
+
up: Ti
|
|
4434
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
4435
|
+
async function ki(t) {
|
|
4436
|
+
await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("refresh_tokens").execute();
|
|
4437
|
+
}
|
|
4438
|
+
async function $i(t) {
|
|
4378
4439
|
await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
4379
4440
|
"sessions_user_id_constraint",
|
|
4380
4441
|
["user_id", "tenant_id"],
|
|
@@ -4393,12 +4454,12 @@ async function Si(t) {
|
|
|
4393
4454
|
(e) => e.onDelete("cascade")
|
|
4394
4455
|
).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("expires_at", "varchar(35)").addColumn("idle_expires_at", "varchar(35)").addColumn("last_exchanged_at", "varchar(35)").addColumn("device", "varchar(2048)", (e) => e.notNull()).addColumn("resource_servers", "varchar(2048)", (e) => e.notNull()).addColumn("rotating", "boolean", (e) => e.notNull()).execute();
|
|
4395
4456
|
}
|
|
4396
|
-
const
|
|
4457
|
+
const Ii = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4397
4458
|
__proto__: null,
|
|
4398
|
-
down:
|
|
4399
|
-
up:
|
|
4459
|
+
down: $i,
|
|
4460
|
+
up: ki
|
|
4400
4461
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4401
|
-
async function
|
|
4462
|
+
async function Di(t) {
|
|
4402
4463
|
await t.schema.createTable("sessions_2").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
4403
4464
|
"sessions_2_user_id_constraint",
|
|
4404
4465
|
["user_id", "tenant_id"],
|
|
@@ -4417,15 +4478,15 @@ async function ki(t) {
|
|
|
4417
4478
|
(e) => e.onDelete("cascade")
|
|
4418
4479
|
).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("expires_at", "varchar(35)").addColumn("idle_expires_at", "varchar(35)").addColumn("last_exchanged_at", "varchar(35)").addColumn("device", "varchar(2048)", (e) => e.notNull()).addColumn("resource_servers", "varchar(2048)", (e) => e.notNull()).addColumn("rotating", "boolean", (e) => e.notNull()).execute();
|
|
4419
4480
|
}
|
|
4420
|
-
async function
|
|
4481
|
+
async function Pi(t) {
|
|
4421
4482
|
await t.schema.dropTable("sessions_2").execute(), await t.schema.dropTable("refresh_tokens_2").execute();
|
|
4422
4483
|
}
|
|
4423
|
-
const
|
|
4484
|
+
const zi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4424
4485
|
__proto__: null,
|
|
4425
|
-
down:
|
|
4426
|
-
up:
|
|
4486
|
+
down: Pi,
|
|
4487
|
+
up: Di
|
|
4427
4488
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4428
|
-
async function
|
|
4489
|
+
async function ji(t) {
|
|
4429
4490
|
await t.schema.createTable("custom_domains").addColumn(
|
|
4430
4491
|
"custom_domain_id",
|
|
4431
4492
|
"varchar(21)",
|
|
@@ -4436,42 +4497,33 @@ async function Di(t) {
|
|
|
4436
4497
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
4437
4498
|
).addColumn("domain", "varchar(255)", (e) => e.notNull()).addColumn("primary", "boolean", (e) => e.notNull()).addColumn("status", "varchar(50)", (e) => e.notNull()).addColumn("type", "varchar(50)", (e) => e.notNull()).addColumn("origin_domain_name", "varchar(255)").addColumn("verification", "varchar(2048)").addColumn("custom_client_ip_header", "varchar(50)").addColumn("tls_policy", "varchar(50)").addColumn("domain_metadata", "varchar(2048)").addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("updated_at", "varchar(35)", (e) => e.notNull()).execute(), await t.schema.dropTable("domains").execute();
|
|
4438
4499
|
}
|
|
4439
|
-
async function
|
|
4500
|
+
async function Fi(t) {
|
|
4440
4501
|
await t.schema.dropTable("custom_domains").execute(), await t.schema.createTable("domains").addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
|
|
4441
4502
|
"tenant_id",
|
|
4442
4503
|
"varchar(255)",
|
|
4443
4504
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
4444
4505
|
).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();
|
|
4445
4506
|
}
|
|
4446
|
-
const
|
|
4507
|
+
const Ai = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4447
4508
|
__proto__: null,
|
|
4448
|
-
down:
|
|
4449
|
-
up:
|
|
4509
|
+
down: Fi,
|
|
4510
|
+
up: ji
|
|
4450
4511
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4451
|
-
async function
|
|
4452
|
-
}
|
|
4453
|
-
async function Ai(t) {
|
|
4454
|
-
await t.schema.alterTable("logins").dropColumn("authParams_organization").dropColumn("authorization_url").execute();
|
|
4455
|
-
}
|
|
4456
|
-
const Mi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4457
|
-
__proto__: null,
|
|
4458
|
-
down: Ai,
|
|
4459
|
-
up: Fi
|
|
4460
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
4461
|
-
async function zi(t) {
|
|
4462
|
-
await t.schema.alterTable("logins").dropColumn("authorization_url").execute(), await t.schema.alterTable("logins").addColumn("authorization_url", "varchar(2048)").execute();
|
|
4512
|
+
async function Mi(t) {
|
|
4463
4513
|
}
|
|
4464
4514
|
async function Ji(t) {
|
|
4465
|
-
await t.schema.alterTable("logins").dropColumn("
|
|
4515
|
+
await t.schema.alterTable("logins").dropColumn("authParams_organization").dropColumn("authorization_url").execute();
|
|
4466
4516
|
}
|
|
4467
4517
|
const Ei = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4468
4518
|
__proto__: null,
|
|
4469
4519
|
down: Ji,
|
|
4470
|
-
up:
|
|
4520
|
+
up: Mi
|
|
4471
4521
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4472
4522
|
async function Li(t) {
|
|
4523
|
+
await t.schema.alterTable("logins").dropColumn("authorization_url").execute(), await t.schema.alterTable("logins").addColumn("authorization_url", "varchar(2048)").execute();
|
|
4473
4524
|
}
|
|
4474
4525
|
async function Ri(t) {
|
|
4526
|
+
await t.schema.alterTable("logins").dropColumn("authorization_url").execute(), await t.schema.alterTable("logins").addColumn("authorization_url", "varchar(1024)").execute();
|
|
4475
4527
|
}
|
|
4476
4528
|
const Ki = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4477
4529
|
__proto__: null,
|
|
@@ -4479,6 +4531,15 @@ const Ki = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4479
4531
|
up: Li
|
|
4480
4532
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4481
4533
|
async function Ui(t) {
|
|
4534
|
+
}
|
|
4535
|
+
async function qi(t) {
|
|
4536
|
+
}
|
|
4537
|
+
const Bi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4538
|
+
__proto__: null,
|
|
4539
|
+
down: qi,
|
|
4540
|
+
up: Ui
|
|
4541
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
4542
|
+
async function Qi(t) {
|
|
4482
4543
|
await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
4483
4544
|
"sessions_user_id_constraint",
|
|
4484
4545
|
["user_id", "tenant_id"],
|
|
@@ -4505,25 +4566,25 @@ async function Ui(t) {
|
|
|
4505
4566
|
(e) => e.onDelete("cascade")
|
|
4506
4567
|
).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("expires_at", "varchar(35)").addColumn("idle_expires_at", "varchar(35)").addColumn("last_exchanged_at", "varchar(35)").addColumn("device", "varchar(2048)", (e) => e.notNull()).addColumn("resource_servers", "varchar(2048)", (e) => e.notNull()).addColumn("rotating", "boolean", (e) => e.notNull()).execute();
|
|
4507
4568
|
}
|
|
4508
|
-
async function
|
|
4569
|
+
async function Wi(t) {
|
|
4509
4570
|
await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("login_sessions").execute(), await t.schema.dropTable("refresh_tokens").execute();
|
|
4510
4571
|
}
|
|
4511
|
-
const
|
|
4572
|
+
const Vi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4512
4573
|
__proto__: null,
|
|
4513
|
-
down:
|
|
4514
|
-
up:
|
|
4574
|
+
down: Wi,
|
|
4575
|
+
up: Qi
|
|
4515
4576
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4516
|
-
async function
|
|
4577
|
+
async function Gi(t) {
|
|
4517
4578
|
await t.schema.dropTable("logins").execute(), await t.schema.dropTable("sessions_2").execute(), await t.schema.dropTable("refresh_tokens_2").execute();
|
|
4518
4579
|
}
|
|
4519
|
-
async function
|
|
4580
|
+
async function Yi(t) {
|
|
4520
4581
|
}
|
|
4521
|
-
const
|
|
4582
|
+
const Hi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4522
4583
|
__proto__: null,
|
|
4523
|
-
down:
|
|
4524
|
-
up:
|
|
4584
|
+
down: Yi,
|
|
4585
|
+
up: Gi
|
|
4525
4586
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4526
|
-
async function
|
|
4587
|
+
async function Xi(t) {
|
|
4527
4588
|
await t.schema.dropTable("custom_domains").execute(), await t.schema.createTable("custom_domains").addColumn(
|
|
4528
4589
|
"custom_domain_id",
|
|
4529
4590
|
"varchar(256)",
|
|
@@ -4534,17 +4595,7 @@ async function Gi(t) {
|
|
|
4534
4595
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
4535
4596
|
).addColumn("domain", "varchar(255)", (e) => e.notNull()).addColumn("primary", "boolean", (e) => e.notNull()).addColumn("status", "varchar(50)", (e) => e.notNull()).addColumn("type", "varchar(50)", (e) => e.notNull()).addColumn("origin_domain_name", "varchar(255)").addColumn("verification", "varchar(2048)").addColumn("custom_client_ip_header", "varchar(50)").addColumn("tls_policy", "varchar(50)").addColumn("domain_metadata", "varchar(2048)").addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("updated_at", "varchar(35)", (e) => e.notNull()).execute();
|
|
4536
4597
|
}
|
|
4537
|
-
async function Hi(t) {
|
|
4538
|
-
}
|
|
4539
|
-
const Yi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4540
|
-
__proto__: null,
|
|
4541
|
-
down: Hi,
|
|
4542
|
-
up: Gi
|
|
4543
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
4544
|
-
async function Xi(t) {
|
|
4545
|
-
}
|
|
4546
4598
|
async function Zi(t) {
|
|
4547
|
-
await t.schema.alterTable("users").dropColumn("phone_number").dropColumn("phone_verified").dropColumn("username").execute();
|
|
4548
4599
|
}
|
|
4549
4600
|
const el = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4550
4601
|
__proto__: null,
|
|
@@ -4552,10 +4603,9 @@ const el = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4552
4603
|
up: Xi
|
|
4553
4604
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4554
4605
|
async function tl(t) {
|
|
4555
|
-
await t.schema.createTable("forms").addColumn("id", "varchar(255)", (e) => e.primaryKey()).addColumn("name", "varchar(255)", (e) => e.notNull()).addColumn("tenant_id", "varchar(255)", (e) => e.notNull()).addColumn("messages", "varchar(255)").addColumn("languages", "varchar(255)").addColumn("translations", "varchar(4096)").addColumn("nodes", "varchar(4096)").addColumn("start", "varchar(255)").addColumn("ending", "varchar(255)").addColumn("style", "varchar(1042)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("updated_at", "varchar(255)", (e) => e.notNull()).execute(), await t.schema.createIndex("forms_tenant_id_idx").on("forms").column("tenant_id").execute();
|
|
4556
4606
|
}
|
|
4557
4607
|
async function al(t) {
|
|
4558
|
-
await t.schema.
|
|
4608
|
+
await t.schema.alterTable("users").dropColumn("phone_number").dropColumn("phone_verified").dropColumn("username").execute();
|
|
4559
4609
|
}
|
|
4560
4610
|
const rl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4561
4611
|
__proto__: null,
|
|
@@ -4563,10 +4613,10 @@ const rl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4563
4613
|
up: tl
|
|
4564
4614
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4565
4615
|
async function nl(t) {
|
|
4566
|
-
await t.schema.
|
|
4616
|
+
await t.schema.createTable("forms").addColumn("id", "varchar(255)", (e) => e.primaryKey()).addColumn("name", "varchar(255)", (e) => e.notNull()).addColumn("tenant_id", "varchar(255)", (e) => e.notNull()).addColumn("messages", "varchar(255)").addColumn("languages", "varchar(255)").addColumn("translations", "varchar(4096)").addColumn("nodes", "varchar(4096)").addColumn("start", "varchar(255)").addColumn("ending", "varchar(255)").addColumn("style", "varchar(1042)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("updated_at", "varchar(255)", (e) => e.notNull()).execute(), await t.schema.createIndex("forms_tenant_id_idx").on("forms").column("tenant_id").execute();
|
|
4567
4617
|
}
|
|
4568
4618
|
async function ol(t) {
|
|
4569
|
-
await t.schema.dropTable("
|
|
4619
|
+
await t.schema.dropTable("forms").execute();
|
|
4570
4620
|
}
|
|
4571
4621
|
const sl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4572
4622
|
__proto__: null,
|
|
@@ -4574,14 +4624,10 @@ const sl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4574
4624
|
up: nl
|
|
4575
4625
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4576
4626
|
async function il(t) {
|
|
4577
|
-
await t.schema.alterTable("
|
|
4578
|
-
"login_completed",
|
|
4579
|
-
"boolean",
|
|
4580
|
-
(e) => e.notNull().defaultTo(0)
|
|
4581
|
-
).execute();
|
|
4627
|
+
await t.schema.alterTable("hooks").addColumn("form_id", "text").execute(), await t.schema.alterTable("hooks").addColumn("url_tmp", "varchar(512)").execute(), await t.updateTable("hooks").set((e) => ({ url_tmp: e.ref("url") })).execute(), await t.schema.alterTable("hooks").dropColumn("url").execute(), await t.schema.alterTable("hooks").renameColumn("url_tmp", "url").execute();
|
|
4582
4628
|
}
|
|
4583
4629
|
async function ll(t) {
|
|
4584
|
-
await t.schema.
|
|
4630
|
+
await t.schema.dropTable("hooks").ifExists().execute(), await t.schema.createTable("hooks").addColumn("hook_id", "text", (e) => e.primaryKey()).addColumn("tenant_id", "text", (e) => e.notNull()).addColumn("trigger_id", "text", (e) => e.notNull()).addColumn("enabled", "integer", (e) => e.notNull().defaultTo(0)).addColumn("url", "varchar(512)", (e) => e.notNull()).addColumn("synchronous", "integer", (e) => e.notNull().defaultTo(0)).addColumn("priority", "integer").addColumn("created_at", "text", (e) => e.notNull()).addColumn("updated_at", "text", (e) => e.notNull()).execute();
|
|
4585
4631
|
}
|
|
4586
4632
|
const cl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4587
4633
|
__proto__: null,
|
|
@@ -4589,14 +4635,14 @@ const cl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4589
4635
|
up: il
|
|
4590
4636
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4591
4637
|
async function dl(t) {
|
|
4592
|
-
await t.schema.alterTable("
|
|
4593
|
-
"
|
|
4594
|
-
"
|
|
4595
|
-
(e) => e.
|
|
4638
|
+
await t.schema.alterTable("login_sessions").addColumn(
|
|
4639
|
+
"login_completed",
|
|
4640
|
+
"boolean",
|
|
4641
|
+
(e) => e.notNull().defaultTo(0)
|
|
4596
4642
|
).execute();
|
|
4597
4643
|
}
|
|
4598
4644
|
async function ul(t) {
|
|
4599
|
-
await t.schema.alterTable("
|
|
4645
|
+
await t.schema.alterTable("login_sessions").dropColumn("login_completed").execute();
|
|
4600
4646
|
}
|
|
4601
4647
|
const ml = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4602
4648
|
__proto__: null,
|
|
@@ -4604,10 +4650,14 @@ const ml = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4604
4650
|
up: dl
|
|
4605
4651
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4606
4652
|
async function _l(t) {
|
|
4607
|
-
await t.schema.
|
|
4653
|
+
await t.schema.alterTable("sessions").addColumn(
|
|
4654
|
+
"login_session_id",
|
|
4655
|
+
"varchar(21)",
|
|
4656
|
+
(e) => e.references("login_sessions.id").onDelete("set null")
|
|
4657
|
+
).execute();
|
|
4608
4658
|
}
|
|
4609
4659
|
async function hl(t) {
|
|
4610
|
-
await t.schema.
|
|
4660
|
+
await t.schema.alterTable("sessions").dropColumn("login_session_id").execute();
|
|
4611
4661
|
}
|
|
4612
4662
|
const fl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4613
4663
|
__proto__: null,
|
|
@@ -4615,10 +4665,10 @@ const fl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4615
4665
|
up: _l
|
|
4616
4666
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4617
4667
|
async function pl(t) {
|
|
4618
|
-
await t.schema.
|
|
4668
|
+
await t.schema.createIndex("IDX_sessions_login_session_id").on("sessions").column("login_session_id").execute();
|
|
4619
4669
|
}
|
|
4620
4670
|
async function gl(t) {
|
|
4621
|
-
await t.schema.
|
|
4671
|
+
await t.schema.dropIndex("IDX_sessions_login_session_id").on("sessions").execute();
|
|
4622
4672
|
}
|
|
4623
4673
|
const wl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4624
4674
|
__proto__: null,
|
|
@@ -4626,10 +4676,10 @@ const wl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4626
4676
|
up: pl
|
|
4627
4677
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4628
4678
|
async function yl(t) {
|
|
4629
|
-
await t.schema.alterTable("codes").addColumn("
|
|
4679
|
+
await t.schema.alterTable("codes").addColumn("code_challenge", "varchar(128)").execute(), await t.schema.alterTable("codes").addColumn("code_challenge_method", "varchar(5)").execute();
|
|
4630
4680
|
}
|
|
4631
4681
|
async function vl(t) {
|
|
4632
|
-
await t.schema.alterTable("codes").dropColumn("
|
|
4682
|
+
await t.schema.alterTable("codes").dropColumn("code_challenge").execute(), await t.schema.alterTable("codes").dropColumn("code_challenge_method").execute();
|
|
4633
4683
|
}
|
|
4634
4684
|
const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4635
4685
|
__proto__: null,
|
|
@@ -4637,10 +4687,10 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4637
4687
|
up: yl
|
|
4638
4688
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4639
4689
|
async function Cl(t) {
|
|
4640
|
-
await t.schema.alterTable("codes").addColumn("
|
|
4690
|
+
await t.schema.alterTable("codes").addColumn("redirect_uri", "varchar(1024)").execute();
|
|
4641
4691
|
}
|
|
4642
4692
|
async function bl(t) {
|
|
4643
|
-
await t.schema.alterTable("codes").dropColumn("
|
|
4693
|
+
await t.schema.alterTable("codes").dropColumn("redirect_uri").execute();
|
|
4644
4694
|
}
|
|
4645
4695
|
const xl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4646
4696
|
__proto__: null,
|
|
@@ -4648,6 +4698,17 @@ const xl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4648
4698
|
up: Cl
|
|
4649
4699
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4650
4700
|
async function Tl(t) {
|
|
4701
|
+
await t.schema.alterTable("codes").addColumn("nonce", "varchar(1024)").execute(), await t.schema.alterTable("codes").addColumn("state", "varchar(2048)").execute();
|
|
4702
|
+
}
|
|
4703
|
+
async function Sl(t) {
|
|
4704
|
+
await t.schema.alterTable("codes").dropColumn("nonce").execute(), await t.schema.alterTable("codes").dropColumn("state").execute();
|
|
4705
|
+
}
|
|
4706
|
+
const Ol = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4707
|
+
__proto__: null,
|
|
4708
|
+
down: Sl,
|
|
4709
|
+
up: Tl
|
|
4710
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
4711
|
+
async function kl(t) {
|
|
4651
4712
|
await t.schema.createTable("themes").addColumn(
|
|
4652
4713
|
"tenant_id",
|
|
4653
4714
|
"varchar(255)",
|
|
@@ -4722,26 +4783,26 @@ async function Tl(t) {
|
|
|
4722
4783
|
(e) => e.notNull()
|
|
4723
4784
|
).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("updated_at", "varchar(35)", (e) => e.notNull()).addPrimaryKeyConstraint("themes_pkey", ["tenant_id", "themeId"]).execute(), await t.schema.createIndex("themes_tenant_id_idx").on("themes").column("tenant_id").execute();
|
|
4724
4785
|
}
|
|
4725
|
-
async function
|
|
4786
|
+
async function $l(t) {
|
|
4726
4787
|
await t.schema.dropTable("themes").execute();
|
|
4727
4788
|
}
|
|
4728
|
-
const
|
|
4789
|
+
const Il = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4729
4790
|
__proto__: null,
|
|
4730
|
-
down:
|
|
4731
|
-
up:
|
|
4791
|
+
down: $l,
|
|
4792
|
+
up: kl
|
|
4732
4793
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4733
|
-
async function
|
|
4794
|
+
async function Dl(t) {
|
|
4734
4795
|
await t.schema.createTable("resource_servers").addColumn("id", "varchar(21)", (e) => e.notNull()).addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("identifier", "varchar(191)", (e) => e.notNull()).addColumn("name", "varchar(255)", (e) => e.notNull()).addColumn("scopes", "varchar(4096)").addColumn("signing_alg", "varchar(64)").addColumn("signing_secret", "varchar(2048)").addColumn("token_lifetime", "integer").addColumn("token_lifetime_for_web", "integer").addColumn("skip_consent_for_verifiable_first_party_clients", "integer").addColumn("allow_offline_access", "integer").addColumn("verification_key", "varchar(4096)").addColumn("options", "varchar(4096)").addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("updated_at", "varchar(35)", (e) => e.notNull()).addPrimaryKeyConstraint("resource_servers_pk", ["tenant_id", "id"]).execute(), await t.schema.createIndex("resource_servers_tenant_identifier_uq").on("resource_servers").columns(["tenant_id", "identifier"]).unique().execute(), await t.schema.createTable("roles").addColumn("id", "varchar(21)", (e) => e.notNull()).addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("name", "varchar(50)", (e) => e.notNull()).addColumn("description", "varchar(255)").addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("updated_at", "varchar(35)", (e) => e.notNull()).addPrimaryKeyConstraint("roles_pk", ["tenant_id", "id"]).execute(), await t.schema.createIndex("roles_tenant_name_uq").on("roles").columns(["tenant_id", "name"]).unique().execute();
|
|
4735
4796
|
}
|
|
4736
|
-
async function
|
|
4797
|
+
async function Pl(t) {
|
|
4737
4798
|
await t.schema.dropTable("roles").execute(), await t.schema.dropTable("resource_servers").execute();
|
|
4738
4799
|
}
|
|
4739
|
-
const
|
|
4800
|
+
const zl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4740
4801
|
__proto__: null,
|
|
4741
|
-
down:
|
|
4742
|
-
up:
|
|
4802
|
+
down: Pl,
|
|
4803
|
+
up: Dl
|
|
4743
4804
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4744
|
-
async function
|
|
4805
|
+
async function jl(t) {
|
|
4745
4806
|
await t.schema.createTable("role_permissions").addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("role_id", "varchar(21)", (e) => e.notNull()).addColumn(
|
|
4746
4807
|
"resource_server_identifier",
|
|
4747
4808
|
"varchar(191)",
|
|
@@ -4762,146 +4823,210 @@ async function Dl(t) {
|
|
|
4762
4823
|
"permission_name"
|
|
4763
4824
|
]).execute(), await t.schema.createIndex("user_permissions_user_fk").on("user_permissions").columns(["tenant_id", "user_id"]).execute(), await t.schema.createIndex("user_permissions_permission_fk").on("user_permissions").columns(["tenant_id", "resource_server_identifier", "permission_name"]).execute();
|
|
4764
4825
|
}
|
|
4765
|
-
async function
|
|
4826
|
+
async function Fl(t) {
|
|
4766
4827
|
await t.schema.dropTable("user_permissions").execute(), await t.schema.dropTable("role_permissions").execute();
|
|
4767
4828
|
}
|
|
4768
|
-
const
|
|
4829
|
+
const Al = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4769
4830
|
__proto__: null,
|
|
4770
|
-
down:
|
|
4771
|
-
up:
|
|
4831
|
+
down: Fl,
|
|
4832
|
+
up: jl
|
|
4772
4833
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4773
|
-
async function
|
|
4834
|
+
async function Ml(t) {
|
|
4774
4835
|
await t.schema.createTable("user_roles").addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("user_id", "varchar(191)", (e) => e.notNull()).addColumn("role_id", "varchar(21)", (e) => e.notNull()).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addPrimaryKeyConstraint("user_roles_pk", [
|
|
4775
4836
|
"tenant_id",
|
|
4776
4837
|
"user_id",
|
|
4777
4838
|
"role_id"
|
|
4778
4839
|
]).execute(), await t.schema.createIndex("user_roles_user_fk").on("user_roles").columns(["tenant_id", "user_id"]).execute(), await t.schema.createIndex("user_roles_role_fk").on("user_roles").columns(["tenant_id", "role_id"]).execute();
|
|
4779
4840
|
}
|
|
4780
|
-
async function Al(t) {
|
|
4781
|
-
await t.schema.dropTable("user_roles").execute();
|
|
4782
|
-
}
|
|
4783
|
-
const Ml = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4784
|
-
__proto__: null,
|
|
4785
|
-
down: Al,
|
|
4786
|
-
up: Fl
|
|
4787
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
4788
|
-
async function zl(t) {
|
|
4789
|
-
}
|
|
4790
4841
|
async function Jl(t) {
|
|
4791
|
-
await t.schema.
|
|
4842
|
+
await t.schema.dropTable("user_roles").execute();
|
|
4792
4843
|
}
|
|
4793
4844
|
const El = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4794
4845
|
__proto__: null,
|
|
4795
4846
|
down: Jl,
|
|
4796
|
-
up:
|
|
4847
|
+
up: Ml
|
|
4797
4848
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4798
4849
|
async function Ll(t) {
|
|
4799
|
-
await t.schema.createTable("organizations").addColumn("id", "varchar(256)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(256)", (e) => e.notNull()).addColumn("name", "varchar(256)", (e) => e.notNull()).addColumn("display_name", "varchar(256)").addColumn("branding", "text").addColumn("metadata", "text").addColumn("enabled_connections", "text").addColumn("token_quota", "text").addColumn("created_at", "varchar(256)", (e) => e.notNull()).addColumn("updated_at", "varchar(256)", (e) => e.notNull()).execute(), await t.schema.createIndex("idx_organizations_tenant_id").on("organizations").column("tenant_id").execute(), await t.schema.createIndex("idx_organizations_tenant_name_unique").on("organizations").columns(["tenant_id", "name"]).unique().execute();
|
|
4800
4850
|
}
|
|
4801
4851
|
async function Rl(t) {
|
|
4802
|
-
await t.schema.
|
|
4852
|
+
await t.schema.alterTable("keys").dropColumn("connection").execute(), await t.schema.alterTable("keys").modifyColumn("cert", "varchar(2048)").execute(), await t.schema.alterTable("keys").modifyColumn("pkcs7", "varchar(2048)").execute(), await t.schema.alterTable("keys").dropColumn("type").execute();
|
|
4803
4853
|
}
|
|
4804
4854
|
const Kl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4805
4855
|
__proto__: null,
|
|
4806
4856
|
down: Rl,
|
|
4807
4857
|
up: Ll
|
|
4858
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
4859
|
+
async function Ul(t) {
|
|
4860
|
+
await t.schema.createTable("organizations").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("name", "varchar(256)", (e) => e.notNull()).addColumn("display_name", "varchar(256)").addColumn("branding", "text").addColumn("metadata", "text").addColumn("enabled_connections", "text").addColumn("token_quota", "text").addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("updated_at", "varchar(35)", (e) => e.notNull()).execute(), await t.schema.createIndex("idx_organizations_tenant_id").on("organizations").column("tenant_id").execute(), await t.schema.createIndex("idx_organizations_tenant_name_unique").on("organizations").columns(["tenant_id", "name"]).unique().execute();
|
|
4861
|
+
}
|
|
4862
|
+
async function ql(t) {
|
|
4863
|
+
await t.schema.dropTable("organizations").execute();
|
|
4864
|
+
}
|
|
4865
|
+
const Bl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4866
|
+
__proto__: null,
|
|
4867
|
+
down: ql,
|
|
4868
|
+
up: Ul
|
|
4869
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
4870
|
+
async function Ql(t) {
|
|
4871
|
+
await t.schema.createTable("user_organizations").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("user_id", "varchar(191)", (e) => e.notNull()).addColumn("organization_id", "varchar(21)", (e) => e.notNull()).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("updated_at", "varchar(35)", (e) => e.notNull()).addUniqueConstraint("user_organizations_unique", [
|
|
4872
|
+
"tenant_id",
|
|
4873
|
+
"user_id",
|
|
4874
|
+
"organization_id"
|
|
4875
|
+
]).execute(), await t.schema.createIndex("idx_user_organizations_tenant_id").on("user_organizations").column("tenant_id").execute(), await t.schema.createIndex("idx_user_organizations_user_id").on("user_organizations").column("user_id").execute(), await t.schema.createIndex("idx_user_organizations_organization_id").on("user_organizations").column("organization_id").execute();
|
|
4876
|
+
}
|
|
4877
|
+
async function Wl(t) {
|
|
4878
|
+
await t.schema.dropTable("user_organizations").execute();
|
|
4879
|
+
}
|
|
4880
|
+
const Vl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4881
|
+
__proto__: null,
|
|
4882
|
+
down: Wl,
|
|
4883
|
+
up: Ql
|
|
4884
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
4885
|
+
async function Gl(t) {
|
|
4886
|
+
await t.schema.dropTable("user_permissions").execute(), await t.schema.dropTable("user_roles").execute(), await t.schema.createTable("user_permissions").addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("user_id", "varchar(191)", (e) => e.notNull()).addColumn(
|
|
4887
|
+
"resource_server_identifier",
|
|
4888
|
+
"varchar(21)",
|
|
4889
|
+
(e) => e.notNull()
|
|
4890
|
+
).addColumn("permission_name", "varchar(191)", (e) => e.notNull()).addColumn(
|
|
4891
|
+
"organization_id",
|
|
4892
|
+
"varchar(21)",
|
|
4893
|
+
(e) => e.notNull().defaultTo("")
|
|
4894
|
+
).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addPrimaryKeyConstraint("user_permissions_pk", [
|
|
4895
|
+
"tenant_id",
|
|
4896
|
+
"user_id",
|
|
4897
|
+
"resource_server_identifier",
|
|
4898
|
+
"permission_name",
|
|
4899
|
+
"organization_id"
|
|
4900
|
+
]).execute(), await t.schema.createIndex("user_permissions_user_fk").on("user_permissions").columns(["tenant_id", "user_id"]).execute(), await t.schema.createIndex("user_permissions_permission_fk").on("user_permissions").columns(["tenant_id", "resource_server_identifier", "permission_name"]).execute(), await t.schema.createIndex("user_permissions_organization_fk").on("user_permissions").column("organization_id").execute(), await t.schema.createTable("user_roles").addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("user_id", "varchar(191)", (e) => e.notNull()).addColumn("role_id", "varchar(21)", (e) => e.notNull()).addColumn(
|
|
4901
|
+
"organization_id",
|
|
4902
|
+
"varchar(191)",
|
|
4903
|
+
(e) => e.notNull().defaultTo("")
|
|
4904
|
+
).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addPrimaryKeyConstraint("user_roles_pk", [
|
|
4905
|
+
"tenant_id",
|
|
4906
|
+
"user_id",
|
|
4907
|
+
"role_id",
|
|
4908
|
+
"organization_id"
|
|
4909
|
+
]).execute(), await t.schema.createIndex("user_roles_user_fk").on("user_roles").columns(["tenant_id", "user_id"]).execute(), await t.schema.createIndex("user_roles_role_fk").on("user_roles").columns(["tenant_id", "role_id"]).execute(), await t.schema.createIndex("user_roles_organization_fk").on("user_roles").column("organization_id").execute();
|
|
4910
|
+
}
|
|
4911
|
+
async function Yl(t) {
|
|
4912
|
+
await t.schema.dropTable("user_permissions").execute(), await t.schema.dropTable("user_roles").execute(), await t.schema.createTable("user_permissions").addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("user_id", "varchar(191)", (e) => e.notNull()).addColumn(
|
|
4913
|
+
"resource_server_identifier",
|
|
4914
|
+
"varchar(191)",
|
|
4915
|
+
(e) => e.notNull()
|
|
4916
|
+
).addColumn("permission_name", "varchar(191)", (e) => e.notNull()).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addPrimaryKeyConstraint("user_permissions_pk", [
|
|
4917
|
+
"tenant_id",
|
|
4918
|
+
"user_id",
|
|
4919
|
+
"resource_server_identifier",
|
|
4920
|
+
"permission_name"
|
|
4921
|
+
]).execute(), await t.schema.createIndex("user_permissions_user_fk").on("user_permissions").columns(["tenant_id", "user_id"]).execute(), await t.schema.createIndex("user_permissions_permission_fk").on("user_permissions").columns(["tenant_id", "resource_server_identifier", "permission_name"]).execute(), await t.schema.createTable("user_roles").addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("user_id", "varchar(191)", (e) => e.notNull()).addColumn("role_id", "varchar(21)", (e) => e.notNull()).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addPrimaryKeyConstraint("user_roles_pk", [
|
|
4922
|
+
"tenant_id",
|
|
4923
|
+
"user_id",
|
|
4924
|
+
"role_id"
|
|
4925
|
+
]).execute(), await t.schema.createIndex("user_roles_user_fk").on("user_roles").columns(["tenant_id", "user_id"]).execute(), await t.schema.createIndex("user_roles_role_fk").on("user_roles").columns(["tenant_id", "role_id"]).execute();
|
|
4926
|
+
}
|
|
4927
|
+
const Hl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4928
|
+
__proto__: null,
|
|
4929
|
+
down: Yl,
|
|
4930
|
+
up: Gl
|
|
4808
4931
|
}, Symbol.toStringTag, { value: "Module" })), Ee = {
|
|
4809
|
-
m1_init:
|
|
4810
|
-
m2_magicLink:
|
|
4811
|
-
m3_updateAt:
|
|
4812
|
-
m4_logTable:
|
|
4813
|
-
m5_userProfile:
|
|
4814
|
-
m6_sessions:
|
|
4815
|
-
m7_passwords:
|
|
4816
|
-
m8_logsTableNewFields:
|
|
4817
|
-
m9_passwordTableNewField:
|
|
4818
|
-
n01_codesTable:
|
|
4819
|
-
n11_universalLoginSession:
|
|
4820
|
-
n12_userFields:
|
|
4821
|
-
n13_userEmailIndex:
|
|
4822
|
-
n14_profileDataField:
|
|
4823
|
-
n15_userEmailIndex:
|
|
4824
|
-
n16_userLocale:
|
|
4825
|
-
n17_signingKeys:
|
|
4826
|
-
n18_logsFields:
|
|
4827
|
-
n19_connectionsUserinfo:
|
|
4828
|
-
n20_missingFields:
|
|
4829
|
-
n21_sessionDeletedAt:
|
|
4830
|
-
n22_dropLogsFields:
|
|
4831
|
-
n23_dropUsersFields:
|
|
4832
|
-
n24_logsIndexes:
|
|
4833
|
-
n25_logDescMaxLength:
|
|
4834
|
-
n26_logsTableExtraFields:
|
|
4835
|
-
n27_usersTableNameIndex:
|
|
4836
|
-
n28_usersEmailConstrain:
|
|
4837
|
-
n29_increaseOtpStateLength:
|
|
4838
|
-
n30_increaseTicketStateLength:
|
|
4839
|
-
n31_branding:
|
|
4840
|
-
n32_indexesAndNotNull:
|
|
4841
|
-
n33_vendorIdInUniversalLoginSession:
|
|
4842
|
-
n34_auth0ClientInUniversalLoginSession:
|
|
4843
|
-
n35_increaseUniversalSessionStateLength:
|
|
4844
|
-
n36_authenticationCodes:
|
|
4845
|
-
n37_disableSignUps:
|
|
4846
|
-
n38_otpIpAddress:
|
|
4847
|
-
n39_increaseUserAgentLength:
|
|
4848
|
-
n40_userId:
|
|
4849
|
-
n41_hooks:
|
|
4850
|
-
n42_userIdIndexes:
|
|
4851
|
-
n43_userIdIndexes:
|
|
4852
|
-
n44_codes:
|
|
4853
|
-
n45_hookProperties:
|
|
4854
|
-
n46_loginAuth0Client:
|
|
4855
|
-
n47_loginAuth0Client:
|
|
4856
|
-
n48_saml:
|
|
4857
|
-
n49_removeFields:
|
|
4858
|
-
n50_authParamsNonce:
|
|
4859
|
-
n51_connectionid:
|
|
4860
|
-
n52_cert:
|
|
4861
|
-
n53_codes_primary_key:
|
|
4862
|
-
n54_cleanup_tables:
|
|
4863
|
-
n55_logs_index:
|
|
4864
|
-
n56_application_fields:
|
|
4865
|
-
n57_prompt_settings:
|
|
4866
|
-
n58_connection_client_id:
|
|
4867
|
-
n59_connection_options:
|
|
4868
|
-
n60_users_metadata:
|
|
4869
|
-
n61_userLocales:
|
|
4870
|
-
n62_prompt:
|
|
4871
|
-
n63_connection_cleanup:
|
|
4872
|
-
n64_act_as:
|
|
4873
|
-
n65_code_verifier:
|
|
4874
|
-
n66_email_providers:
|
|
4875
|
-
n67_drop_tickets:
|
|
4876
|
-
n68_login_useragents:
|
|
4877
|
-
n70_refresh_tokens:
|
|
4878
|
-
n71_session_new_fields:
|
|
4879
|
-
n72_session_primary_key:
|
|
4880
|
-
n73_drop_sessions:
|
|
4881
|
-
n74_custom_domains:
|
|
4882
|
-
n75_organizations:
|
|
4883
|
-
n76_authorization_url_length:
|
|
4884
|
-
n77_drop_sessions:
|
|
4885
|
-
n78_login_sessions:
|
|
4886
|
-
n79_drop_sessions_2:
|
|
4887
|
-
n80_recreate_custom_domains:
|
|
4888
|
-
n81_phone:
|
|
4889
|
-
n82_forms:
|
|
4890
|
-
n83_addFormsIdToHooks:
|
|
4891
|
-
n84_login_completed:
|
|
4892
|
-
n85_add_login_session_id_to_sessions:
|
|
4893
|
-
n86_index_sessions_login_session_id:
|
|
4894
|
-
n87_code_challenge:
|
|
4895
|
-
n88_add_redirect_uri_to_codes:
|
|
4896
|
-
n89_add_nonce_and_state_to_codes:
|
|
4897
|
-
n90_themes:
|
|
4898
|
-
n91_resource_servers_rules_permissions:
|
|
4899
|
-
n92_role_permissions:
|
|
4900
|
-
n93_add_permissions_to_roles:
|
|
4901
|
-
n94_keys_connection_and_extend_columns:
|
|
4902
|
-
n95_create_organizations_table:
|
|
4932
|
+
m1_init: jr,
|
|
4933
|
+
m2_magicLink: Mr,
|
|
4934
|
+
m3_updateAt: Lr,
|
|
4935
|
+
m4_logTable: Ur,
|
|
4936
|
+
m5_userProfile: Qr,
|
|
4937
|
+
m6_sessions: Gr,
|
|
4938
|
+
m7_passwords: Xr,
|
|
4939
|
+
m8_logsTableNewFields: tn,
|
|
4940
|
+
m9_passwordTableNewField: nn,
|
|
4941
|
+
n01_codesTable: ln,
|
|
4942
|
+
n11_universalLoginSession: un,
|
|
4943
|
+
n12_userFields: hn,
|
|
4944
|
+
n13_userEmailIndex: gn,
|
|
4945
|
+
n14_profileDataField: vn,
|
|
4946
|
+
n15_userEmailIndex: bn,
|
|
4947
|
+
n16_userLocale: Sn,
|
|
4948
|
+
n17_signingKeys: $n,
|
|
4949
|
+
n18_logsFields: Pn,
|
|
4950
|
+
n19_connectionsUserinfo: Fn,
|
|
4951
|
+
n20_missingFields: Jn,
|
|
4952
|
+
n21_sessionDeletedAt: Rn,
|
|
4953
|
+
n22_dropLogsFields: qn,
|
|
4954
|
+
n23_dropUsersFields: Wn,
|
|
4955
|
+
n24_logsIndexes: Yn,
|
|
4956
|
+
n25_logDescMaxLength: Zn,
|
|
4957
|
+
n26_logsTableExtraFields: ao,
|
|
4958
|
+
n27_usersTableNameIndex: oo,
|
|
4959
|
+
n28_usersEmailConstrain: lo,
|
|
4960
|
+
n29_increaseOtpStateLength: mo,
|
|
4961
|
+
n30_increaseTicketStateLength: fo,
|
|
4962
|
+
n31_branding: wo,
|
|
4963
|
+
n32_indexesAndNotNull: No,
|
|
4964
|
+
n33_vendorIdInUniversalLoginSession: xo,
|
|
4965
|
+
n34_auth0ClientInUniversalLoginSession: Oo,
|
|
4966
|
+
n35_increaseUniversalSessionStateLength: Io,
|
|
4967
|
+
n36_authenticationCodes: zo,
|
|
4968
|
+
n37_disableSignUps: Ao,
|
|
4969
|
+
n38_otpIpAddress: Eo,
|
|
4970
|
+
n39_increaseUserAgentLength: Ko,
|
|
4971
|
+
n40_userId: Bo,
|
|
4972
|
+
n41_hooks: Vo,
|
|
4973
|
+
n42_userIdIndexes: Ho,
|
|
4974
|
+
n43_userIdIndexes: es,
|
|
4975
|
+
n44_codes: rs,
|
|
4976
|
+
n45_hookProperties: ss,
|
|
4977
|
+
n46_loginAuth0Client: cs,
|
|
4978
|
+
n47_loginAuth0Client: ms,
|
|
4979
|
+
n48_saml: fs,
|
|
4980
|
+
n49_removeFields: ws,
|
|
4981
|
+
n50_authParamsNonce: Ns,
|
|
4982
|
+
n51_connectionid: xs,
|
|
4983
|
+
n52_cert: Os,
|
|
4984
|
+
n53_codes_primary_key: Is,
|
|
4985
|
+
n54_cleanup_tables: zs,
|
|
4986
|
+
n55_logs_index: As,
|
|
4987
|
+
n56_application_fields: Es,
|
|
4988
|
+
n57_prompt_settings: Ks,
|
|
4989
|
+
n58_connection_client_id: Bs,
|
|
4990
|
+
n59_connection_options: Vs,
|
|
4991
|
+
n60_users_metadata: Hs,
|
|
4992
|
+
n61_userLocales: ei,
|
|
4993
|
+
n62_prompt: ri,
|
|
4994
|
+
n63_connection_cleanup: si,
|
|
4995
|
+
n64_act_as: ci,
|
|
4996
|
+
n65_code_verifier: mi,
|
|
4997
|
+
n66_email_providers: fi,
|
|
4998
|
+
n67_drop_tickets: wi,
|
|
4999
|
+
n68_login_useragents: Ni,
|
|
5000
|
+
n70_refresh_tokens: xi,
|
|
5001
|
+
n71_session_new_fields: Oi,
|
|
5002
|
+
n72_session_primary_key: Ii,
|
|
5003
|
+
n73_drop_sessions: zi,
|
|
5004
|
+
n74_custom_domains: Ai,
|
|
5005
|
+
n75_organizations: Ei,
|
|
5006
|
+
n76_authorization_url_length: Ki,
|
|
5007
|
+
n77_drop_sessions: Bi,
|
|
5008
|
+
n78_login_sessions: Vi,
|
|
5009
|
+
n79_drop_sessions_2: Hi,
|
|
5010
|
+
n80_recreate_custom_domains: el,
|
|
5011
|
+
n81_phone: rl,
|
|
5012
|
+
n82_forms: sl,
|
|
5013
|
+
n83_addFormsIdToHooks: cl,
|
|
5014
|
+
n84_login_completed: ml,
|
|
5015
|
+
n85_add_login_session_id_to_sessions: fl,
|
|
5016
|
+
n86_index_sessions_login_session_id: wl,
|
|
5017
|
+
n87_code_challenge: Nl,
|
|
5018
|
+
n88_add_redirect_uri_to_codes: xl,
|
|
5019
|
+
n89_add_nonce_and_state_to_codes: Ol,
|
|
5020
|
+
n90_themes: Il,
|
|
5021
|
+
n91_resource_servers_rules_permissions: zl,
|
|
5022
|
+
n92_role_permissions: Al,
|
|
5023
|
+
n93_add_permissions_to_roles: El,
|
|
5024
|
+
n94_keys_connection_and_extend_columns: Kl,
|
|
5025
|
+
n95_create_organizations_table: Bl,
|
|
5026
|
+
n96_create_user_organizations_table: Vl,
|
|
5027
|
+
n97_add_organization_to_user_permissions_and_roles: Hl
|
|
4903
5028
|
};
|
|
4904
|
-
async function
|
|
5029
|
+
async function ac(t, e = !1) {
|
|
4905
5030
|
e && console.log("migrating...");
|
|
4906
5031
|
const a = new Je(Ee), r = new be({
|
|
4907
5032
|
db: t,
|
|
@@ -4914,7 +5039,7 @@ async function Wl(t, e = !1) {
|
|
|
4914
5039
|
}), n)
|
|
4915
5040
|
throw console.error("failed to migrate"), console.error(n), n;
|
|
4916
5041
|
}
|
|
4917
|
-
async function
|
|
5042
|
+
async function rc(t) {
|
|
4918
5043
|
console.log("migrating...");
|
|
4919
5044
|
const e = new Je(Ee), a = new be({
|
|
4920
5045
|
db: t,
|
|
@@ -4925,19 +5050,19 @@ async function Vl(t) {
|
|
|
4925
5050
|
}), r)
|
|
4926
5051
|
throw console.error("failed to migrate"), console.error(r), r;
|
|
4927
5052
|
}
|
|
4928
|
-
function
|
|
5053
|
+
function nc(t) {
|
|
4929
5054
|
return {
|
|
4930
|
-
applications:
|
|
5055
|
+
applications: zt(t),
|
|
4931
5056
|
branding: ea(t),
|
|
4932
5057
|
cleanup: Ia(t),
|
|
4933
|
-
|
|
5058
|
+
legacyClients: Lt(t),
|
|
4934
5059
|
codes: Ot(t),
|
|
4935
5060
|
connections: Et(t),
|
|
4936
5061
|
emailProviders: ba(t),
|
|
4937
|
-
customDomains:
|
|
4938
|
-
forms:
|
|
5062
|
+
customDomains: Ht(t),
|
|
5063
|
+
forms: Aa(t),
|
|
4939
5064
|
hooks: sa(t),
|
|
4940
|
-
keys:
|
|
5065
|
+
keys: qt(t),
|
|
4941
5066
|
loginSessions: pa(t),
|
|
4942
5067
|
logs: ut(t),
|
|
4943
5068
|
passwords: Nt(t),
|
|
@@ -4945,19 +5070,19 @@ function Gl(t) {
|
|
|
4945
5070
|
refreshTokens: $a(t),
|
|
4946
5071
|
resourceServers: Ka(t),
|
|
4947
5072
|
rolePermissions: Xa(t),
|
|
4948
|
-
userPermissions:
|
|
4949
|
-
userRoles:
|
|
5073
|
+
userPermissions: rr(t),
|
|
5074
|
+
userRoles: lr(t),
|
|
4950
5075
|
roles: Va(t),
|
|
4951
5076
|
sessions: gt(t),
|
|
4952
5077
|
tenants: st(t),
|
|
4953
5078
|
themes: ua(t),
|
|
4954
5079
|
users: Ze(t),
|
|
4955
|
-
organizations:
|
|
4956
|
-
userOrganizations:
|
|
5080
|
+
organizations: hr(t),
|
|
5081
|
+
userOrganizations: Nr(t)
|
|
4957
5082
|
};
|
|
4958
5083
|
}
|
|
4959
5084
|
export {
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
5085
|
+
nc as default,
|
|
5086
|
+
rc as migrateDown,
|
|
5087
|
+
ac as migrateToLatest
|
|
4963
5088
|
};
|