@authhero/kysely-adapter 10.62.0 → 10.63.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 +3 -3
- package/dist/kysely-adapter.d.ts +73 -12
- package/dist/kysely-adapter.mjs +492 -480
- package/package.json +2 -2
package/dist/kysely-adapter.mjs
CHANGED
|
@@ -96,7 +96,7 @@ function Ya(t) {
|
|
|
96
96
|
]);
|
|
97
97
|
if (!a)
|
|
98
98
|
return null;
|
|
99
|
-
const { tenant_id: o, ...u } = a,
|
|
99
|
+
const { tenant_id: o, ...u } = a, c = {
|
|
100
100
|
...u,
|
|
101
101
|
email: a.email || "",
|
|
102
102
|
email_verified: a.email_verified === 1,
|
|
@@ -113,51 +113,51 @@ function Ya(t) {
|
|
|
113
113
|
...r.map(Vn)
|
|
114
114
|
]
|
|
115
115
|
};
|
|
116
|
-
return T(
|
|
116
|
+
return T(c);
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
119
|
function J(t, e, n, a) {
|
|
120
120
|
const r = [];
|
|
121
121
|
let o = "", u = !1;
|
|
122
|
-
for (let
|
|
123
|
-
const h = n[
|
|
122
|
+
for (let d = 0; d < n.length; d++) {
|
|
123
|
+
const h = n[d];
|
|
124
124
|
h === '"' ? (u = !u, o += h) : h === " " && !u ? o.trim() && (r.push(o.trim()), o = "") : o += h;
|
|
125
125
|
}
|
|
126
|
-
return o.trim() && r.push(o.trim()), r.map((
|
|
127
|
-
let h =
|
|
128
|
-
if (
|
|
129
|
-
g =
|
|
130
|
-
else if (
|
|
131
|
-
g =
|
|
132
|
-
else if (
|
|
133
|
-
const v = h ?
|
|
126
|
+
return o.trim() && r.push(o.trim()), r.map((d) => d.replace(/^([^:]+)=/g, "$1:")).map((d) => {
|
|
127
|
+
let h = d.startsWith("-"), g = null, l = "", y = !1, f;
|
|
128
|
+
if (d.startsWith("-_exists_:"))
|
|
129
|
+
g = d.substring(10), y = !0, h = !0;
|
|
130
|
+
else if (d.startsWith("_exists_:"))
|
|
131
|
+
g = d.substring(9), y = !0, h = !1;
|
|
132
|
+
else if (d.includes(":")) {
|
|
133
|
+
const v = h ? d.substring(1) : d, x = v.indexOf(":");
|
|
134
134
|
g = v.substring(0, x), l = v.substring(x + 1), y = !1, l.startsWith(">=") ? (f = ">=", l = l.substring(2)) : l.startsWith(">") ? (f = ">", l = l.substring(1)) : l.startsWith("<=") ? (f = "<=", l = l.substring(2)) : l.startsWith("<") ? (f = "<", l = l.substring(1)) : f = "=", l.startsWith('"') && l.endsWith('"') && l.length > 1 && (l = l.slice(1, -1));
|
|
135
135
|
} else
|
|
136
|
-
g = null, l =
|
|
136
|
+
g = null, l = d, y = !1;
|
|
137
137
|
return { key: g, value: l, isNegation: h, isExistsQuery: y, operator: f };
|
|
138
|
-
}).forEach(({ key:
|
|
139
|
-
if (
|
|
138
|
+
}).forEach(({ key: d, value: h, isNegation: g, isExistsQuery: l, operator: y }) => {
|
|
139
|
+
if (d)
|
|
140
140
|
if (l)
|
|
141
|
-
g ? e = e.where(
|
|
141
|
+
g ? e = e.where(d, "is", null) : e = e.where(d, "is not", null);
|
|
142
142
|
else if (g)
|
|
143
143
|
switch (y) {
|
|
144
144
|
case ">":
|
|
145
|
-
e = e.where(
|
|
145
|
+
e = e.where(d, "<=", h);
|
|
146
146
|
break;
|
|
147
147
|
case ">=":
|
|
148
|
-
e = e.where(
|
|
148
|
+
e = e.where(d, "<", h);
|
|
149
149
|
break;
|
|
150
150
|
case "<":
|
|
151
|
-
e = e.where(
|
|
151
|
+
e = e.where(d, ">=", h);
|
|
152
152
|
break;
|
|
153
153
|
case "<=":
|
|
154
|
-
e = e.where(
|
|
154
|
+
e = e.where(d, ">", h);
|
|
155
155
|
break;
|
|
156
156
|
default:
|
|
157
|
-
e = e.where(
|
|
157
|
+
e = e.where(d, "!=", h);
|
|
158
158
|
}
|
|
159
159
|
else
|
|
160
|
-
e = e.where(
|
|
160
|
+
e = e.where(d, y, h);
|
|
161
161
|
else if (h) {
|
|
162
162
|
const { ref: f } = t.dynamic;
|
|
163
163
|
e = e.where(
|
|
@@ -173,13 +173,13 @@ function j(t) {
|
|
|
173
173
|
}
|
|
174
174
|
function Ha(t) {
|
|
175
175
|
return async (e, n = {}) => {
|
|
176
|
-
const { page: a = 0, per_page: r = 50, include_totals: o = !1, sort: u, q:
|
|
177
|
-
let
|
|
178
|
-
if (
|
|
176
|
+
const { page: a = 0, per_page: r = 50, include_totals: o = !1, sort: u, q: c } = n;
|
|
177
|
+
let d = t.selectFrom("users").where("users.tenant_id", "=", e);
|
|
178
|
+
if (c && (d = J(t, d, c, ["email", "name", "phone_number"])), u && u.sort_by) {
|
|
179
179
|
const { ref: x } = t.dynamic;
|
|
180
|
-
|
|
180
|
+
d = d.orderBy(x(u.sort_by), u.sort_order);
|
|
181
181
|
}
|
|
182
|
-
const g = await
|
|
182
|
+
const g = await d.offset(a * r).limit(r).selectAll().execute(), l = g.map((x) => x.user_id), y = l.length ? await t.selectFrom("users").selectAll().where("users.tenant_id", "=", e).where("users.linked_to", "in", l).execute() : [], f = g.map((x) => {
|
|
183
183
|
const E = y.filter(
|
|
184
184
|
(z) => z.linked_to === x.user_id
|
|
185
185
|
);
|
|
@@ -207,7 +207,7 @@ function Ha(t) {
|
|
|
207
207
|
limit: 0,
|
|
208
208
|
length: 0
|
|
209
209
|
};
|
|
210
|
-
const { count: v } = await
|
|
210
|
+
const { count: v } = await d.select((x) => x.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
211
211
|
return {
|
|
212
212
|
users: f,
|
|
213
213
|
start: a * r,
|
|
@@ -279,9 +279,9 @@ let ar = (t) => crypto.getRandomValues(new Uint8Array(t)), rr = (t, e, n) => {
|
|
|
279
279
|
return (o = e) => {
|
|
280
280
|
let u = "";
|
|
281
281
|
for (; ; ) {
|
|
282
|
-
let
|
|
283
|
-
for (;
|
|
284
|
-
if (u += t[d
|
|
282
|
+
let c = n(r), d = r | 0;
|
|
283
|
+
for (; d--; )
|
|
284
|
+
if (u += t[c[d] & a] || "", u.length >= o) return u;
|
|
285
285
|
}
|
|
286
286
|
};
|
|
287
287
|
}, or = (t, e = 21) => rr(t, e | 0, ar), U = (t = 21) => {
|
|
@@ -353,16 +353,16 @@ function ur(t) {
|
|
|
353
353
|
return n ? Hn(n) : null;
|
|
354
354
|
};
|
|
355
355
|
}
|
|
356
|
-
function
|
|
356
|
+
function cr(t) {
|
|
357
357
|
return async (e) => {
|
|
358
358
|
let n = t.selectFrom("tenants");
|
|
359
|
-
const { page: a = 0, per_page: r = 50, include_totals: o = !1, sort: u, q:
|
|
359
|
+
const { page: a = 0, per_page: r = 50, include_totals: o = !1, sort: u, q: c } = e;
|
|
360
360
|
if (u && u.sort_by) {
|
|
361
361
|
const { ref: f } = t.dynamic;
|
|
362
362
|
n = n.orderBy(f(u.sort_by), u.sort_order);
|
|
363
363
|
}
|
|
364
|
-
|
|
365
|
-
(f) => f.or([f("friendly_name", "like", `%${
|
|
364
|
+
c && (n = n.where(
|
|
365
|
+
(f) => f.or([f("friendly_name", "like", `%${c}%`)])
|
|
366
366
|
));
|
|
367
367
|
const g = (await n.offset(a * r).limit(r).selectAll().execute()).map(Hn);
|
|
368
368
|
if (!o)
|
|
@@ -378,7 +378,7 @@ function dr(t) {
|
|
|
378
378
|
};
|
|
379
379
|
};
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function dr(t) {
|
|
382
382
|
return async (e, n) => {
|
|
383
383
|
const r = {
|
|
384
384
|
...Xn(n),
|
|
@@ -395,8 +395,8 @@ function _r(t) {
|
|
|
395
395
|
return {
|
|
396
396
|
create: sr(t),
|
|
397
397
|
get: ur(t),
|
|
398
|
-
list:
|
|
399
|
-
update:
|
|
398
|
+
list: cr(t),
|
|
399
|
+
update: dr(t),
|
|
400
400
|
remove: lr(t)
|
|
401
401
|
};
|
|
402
402
|
}
|
|
@@ -406,14 +406,14 @@ function On(t) {
|
|
|
406
406
|
const mr = 1024;
|
|
407
407
|
function hr(t) {
|
|
408
408
|
return async (e, n) => {
|
|
409
|
-
var
|
|
410
|
-
const a = (
|
|
409
|
+
var c, d, h;
|
|
410
|
+
const a = (c = n.user_agent) == null ? void 0 : c.slice(0, mr), r = n.log_id || U(), { location_info: o, ...u } = n;
|
|
411
411
|
return await t.insertInto("logs").values({
|
|
412
412
|
...u,
|
|
413
413
|
log_id: r,
|
|
414
414
|
tenant_id: e,
|
|
415
415
|
user_agent: a,
|
|
416
|
-
description: (
|
|
416
|
+
description: (d = n.description) == null ? void 0 : d.substring(0, 256),
|
|
417
417
|
isMobile: n.isMobile ? 1 : 0,
|
|
418
418
|
scope: n.scope,
|
|
419
419
|
auth0_client: On(n.auth0_client),
|
|
@@ -464,10 +464,10 @@ function Zn(t) {
|
|
|
464
464
|
}
|
|
465
465
|
function fr(t) {
|
|
466
466
|
return async (e, n = {}) => {
|
|
467
|
-
const { page: a = 0, per_page: r = 50, include_totals: o = !1, sort: u, q:
|
|
468
|
-
let
|
|
469
|
-
|
|
470
|
-
let h =
|
|
467
|
+
const { page: a = 0, per_page: r = 50, include_totals: o = !1, sort: u, q: c } = n;
|
|
468
|
+
let d = t.selectFrom("logs").where("logs.tenant_id", "=", e);
|
|
469
|
+
c && (d = J(t, d, c, ["user_id", "ip"]));
|
|
470
|
+
let h = d;
|
|
471
471
|
if (u && u.sort_by) {
|
|
472
472
|
const { ref: f } = t.dynamic;
|
|
473
473
|
h = h.orderBy(f(u.sort_by), u.sort_order);
|
|
@@ -481,7 +481,7 @@ function fr(t) {
|
|
|
481
481
|
limit: 0,
|
|
482
482
|
length: 0
|
|
483
483
|
};
|
|
484
|
-
const { count: y } = await
|
|
484
|
+
const { count: y } = await d.select((f) => f.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
485
485
|
return {
|
|
486
486
|
logs: l,
|
|
487
487
|
start: a * r,
|
|
@@ -508,9 +508,9 @@ function wr(t) {
|
|
|
508
508
|
const a = await t.selectFrom("sessions").where("sessions.tenant_id", "=", e).where("sessions.id", "=", n).selectAll().executeTakeFirst();
|
|
509
509
|
if (!a)
|
|
510
510
|
return null;
|
|
511
|
-
const { tenant_id: r, device: o, clients: u, ...
|
|
511
|
+
const { tenant_id: r, device: o, clients: u, ...c } = a;
|
|
512
512
|
return {
|
|
513
|
-
...
|
|
513
|
+
...c,
|
|
514
514
|
device: JSON.parse(o),
|
|
515
515
|
clients: JSON.parse(u)
|
|
516
516
|
};
|
|
@@ -549,10 +549,10 @@ function vr(t) {
|
|
|
549
549
|
}
|
|
550
550
|
function Cr(t) {
|
|
551
551
|
return async (e, n = {}) => {
|
|
552
|
-
const { page: a = 0, per_page: r = 50, include_totals: o = !1, sort: u, q:
|
|
553
|
-
let
|
|
554
|
-
|
|
555
|
-
let h =
|
|
552
|
+
const { page: a = 0, per_page: r = 50, include_totals: o = !1, sort: u, q: c } = n;
|
|
553
|
+
let d = t.selectFrom("sessions").where("sessions.tenant_id", "=", e);
|
|
554
|
+
c && (d = J(t, d, c, ["user_id", "session_id"]));
|
|
555
|
+
let h = d;
|
|
556
556
|
if (u && u.sort_by) {
|
|
557
557
|
const { ref: v } = t.dynamic;
|
|
558
558
|
h = h.orderBy(v(u.sort_by), u.sort_order);
|
|
@@ -570,7 +570,7 @@ function Cr(t) {
|
|
|
570
570
|
limit: 0,
|
|
571
571
|
length: 0
|
|
572
572
|
};
|
|
573
|
-
const { count: y } = await
|
|
573
|
+
const { count: y } = await d.select((v) => v.fn.countAll().as("count")).executeTakeFirstOrThrow(), f = j(y);
|
|
574
574
|
return {
|
|
575
575
|
sessions: l,
|
|
576
576
|
start: a * r,
|
|
@@ -630,9 +630,9 @@ function Or(t) {
|
|
|
630
630
|
function Sr(t) {
|
|
631
631
|
return async (e, n, a) => {
|
|
632
632
|
let r = t.selectFrom("passwords").where("passwords.tenant_id", "=", e).where("passwords.user_id", "=", n).orderBy("created_at", "desc");
|
|
633
|
-
return a && (r = r.limit(a)), (await r.selectAll().execute()).map(({ tenant_id: u, ...
|
|
634
|
-
...
|
|
635
|
-
is_current: !!
|
|
633
|
+
return a && (r = r.limit(a)), (await r.selectAll().execute()).map(({ tenant_id: u, ...c }) => ({
|
|
634
|
+
...c,
|
|
635
|
+
is_current: !!c.is_current
|
|
636
636
|
}));
|
|
637
637
|
};
|
|
638
638
|
}
|
|
@@ -647,9 +647,9 @@ function kr(t) {
|
|
|
647
647
|
function Ir(t) {
|
|
648
648
|
return async (e, n = {}) => {
|
|
649
649
|
const { page: a = 0, per_page: r = 50, include_totals: o = !1, q: u } = n;
|
|
650
|
-
let
|
|
651
|
-
u && (
|
|
652
|
-
const g = (await
|
|
650
|
+
let c = t.selectFrom("codes").where("codes.tenant_id", "=", e);
|
|
651
|
+
u && (c = J(t, c, u, ["code", "login_id"]));
|
|
652
|
+
const g = (await c.offset(a * r).limit(r).selectAll().execute()).map((y) => {
|
|
653
653
|
const { tenant_id: f, ...v } = y;
|
|
654
654
|
return Wa.parse(T(v));
|
|
655
655
|
});
|
|
@@ -660,7 +660,7 @@ function Ir(t) {
|
|
|
660
660
|
limit: 0,
|
|
661
661
|
length: 0
|
|
662
662
|
};
|
|
663
|
-
const { count: l } = await
|
|
663
|
+
const { count: l } = await c.select((y) => y.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
664
664
|
return {
|
|
665
665
|
codes: g,
|
|
666
666
|
start: a * r,
|
|
@@ -752,9 +752,9 @@ function qr(t) {
|
|
|
752
752
|
function Br(t) {
|
|
753
753
|
return async (e, n = {}) => {
|
|
754
754
|
const { page: a = 0, per_page: r = 50, include_totals: o = !1, q: u } = n;
|
|
755
|
-
let
|
|
756
|
-
u && (
|
|
757
|
-
const g = (await
|
|
755
|
+
let c = t.selectFrom("connections").where("connections.tenant_id", "=", e);
|
|
756
|
+
u && (c = J(t, c, u, ["user_id", "ip"]));
|
|
757
|
+
const g = (await c.offset(a * r).limit(r).selectAll().execute()).map(
|
|
758
758
|
(y) => T({
|
|
759
759
|
...y,
|
|
760
760
|
options: JSON.parse(y.options)
|
|
@@ -767,7 +767,7 @@ function Br(t) {
|
|
|
767
767
|
limit: 0,
|
|
768
768
|
length: 0
|
|
769
769
|
};
|
|
770
|
-
const { count: l } = await
|
|
770
|
+
const { count: l } = await c.select((y) => y.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
771
771
|
return {
|
|
772
772
|
connections: g,
|
|
773
773
|
start: a * r,
|
|
@@ -1024,27 +1024,27 @@ function Zr(t) {
|
|
|
1024
1024
|
}
|
|
1025
1025
|
function eo(t) {
|
|
1026
1026
|
return async (e, n) => {
|
|
1027
|
-
const a = (/* @__PURE__ */ new Date()).toISOString(), r = U(), { scope: o, authorization_details_types: u, ...
|
|
1027
|
+
const a = (/* @__PURE__ */ new Date()).toISOString(), r = U(), { scope: o, authorization_details_types: u, ...c } = n, d = {
|
|
1028
1028
|
id: r,
|
|
1029
1029
|
tenant_id: e,
|
|
1030
|
-
...
|
|
1030
|
+
...c,
|
|
1031
1031
|
scope: o ? JSON.stringify(o) : "[]",
|
|
1032
1032
|
authorization_details_types: u ? JSON.stringify(u) : "[]",
|
|
1033
1033
|
// Convert booleans to integers for database storage
|
|
1034
|
-
allow_any_organization:
|
|
1035
|
-
is_system:
|
|
1034
|
+
allow_any_organization: c.allow_any_organization !== void 0 ? c.allow_any_organization ? 1 : 0 : void 0,
|
|
1035
|
+
is_system: c.is_system !== void 0 ? c.is_system ? 1 : 0 : void 0,
|
|
1036
1036
|
created_at: a,
|
|
1037
1037
|
updated_at: a
|
|
1038
1038
|
};
|
|
1039
|
-
return await t.insertInto("client_grants").values(
|
|
1039
|
+
return await t.insertInto("client_grants").values(d).execute(), T({
|
|
1040
1040
|
id: r,
|
|
1041
1041
|
tenant_id: e,
|
|
1042
|
-
...
|
|
1042
|
+
...c,
|
|
1043
1043
|
scope: o || [],
|
|
1044
1044
|
authorization_details_types: u || [],
|
|
1045
1045
|
// Ensure boolean fields have proper defaults
|
|
1046
|
-
allow_any_organization:
|
|
1047
|
-
is_system:
|
|
1046
|
+
allow_any_organization: c.allow_any_organization ?? !1,
|
|
1047
|
+
is_system: c.is_system ?? !1,
|
|
1048
1048
|
created_at: a,
|
|
1049
1049
|
updated_at: a
|
|
1050
1050
|
});
|
|
@@ -1074,24 +1074,24 @@ function to(t) {
|
|
|
1074
1074
|
}
|
|
1075
1075
|
function no(t) {
|
|
1076
1076
|
return async (e, n = {}) => {
|
|
1077
|
-
const { page: a = 0, per_page: r = 50, include_totals: o = !1, q: u, sort:
|
|
1078
|
-
let
|
|
1077
|
+
const { page: a = 0, per_page: r = 50, include_totals: o = !1, q: u, sort: c } = n;
|
|
1078
|
+
let d = t.selectFrom("client_grants").where("client_grants.tenant_id", "=", e);
|
|
1079
1079
|
if (u) {
|
|
1080
1080
|
const f = u.trim(), v = f.split(/\s+/), x = v.length === 1 ? v[0] : void 0, E = x ? x.match(/^(-)?([a-zA-Z_][a-zA-Z0-9_]*):"?([^"]*)"?$/) : null, z = E ? E[3] : "", oe = /^(>=|>|<=|<)/.test(z || "");
|
|
1081
1081
|
if (E && !oe && z) {
|
|
1082
1082
|
const Q = !!E[1], ye = E[2], { ref: Ct } = t.dynamic, Ne = Ct(`client_grants.${ye}`);
|
|
1083
1083
|
if (ye === "allow_any_organization") {
|
|
1084
1084
|
const rt = z === "true" ? 1 : 0;
|
|
1085
|
-
Q ?
|
|
1085
|
+
Q ? d = d.where(Ne, "!=", rt) : d = d.where(Ne, "=", rt);
|
|
1086
1086
|
} else
|
|
1087
|
-
Q ?
|
|
1087
|
+
Q ? d = d.where(Ne, "!=", z) : d = d.where(Ne, "=", z);
|
|
1088
1088
|
} else
|
|
1089
|
-
|
|
1089
|
+
d = J(t, d, f, []);
|
|
1090
1090
|
}
|
|
1091
|
-
let h =
|
|
1092
|
-
if (
|
|
1091
|
+
let h = d;
|
|
1092
|
+
if (c) {
|
|
1093
1093
|
const { ref: f } = t.dynamic;
|
|
1094
|
-
h = h.orderBy(f(
|
|
1094
|
+
h = h.orderBy(f(c.sort_by), c.sort_order);
|
|
1095
1095
|
} else
|
|
1096
1096
|
h = h.orderBy("client_grants.created_at", "desc");
|
|
1097
1097
|
h = h.limit(r).offset(a * r);
|
|
@@ -1119,7 +1119,7 @@ function no(t) {
|
|
|
1119
1119
|
limit: 0,
|
|
1120
1120
|
length: 0
|
|
1121
1121
|
};
|
|
1122
|
-
const { count: y } = await
|
|
1122
|
+
const { count: y } = await d.select((f) => f.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1123
1123
|
return {
|
|
1124
1124
|
client_grants: l,
|
|
1125
1125
|
start: a * r,
|
|
@@ -1133,13 +1133,13 @@ function ao(t) {
|
|
|
1133
1133
|
}
|
|
1134
1134
|
function ro(t) {
|
|
1135
1135
|
return async (e, n, a) => {
|
|
1136
|
-
const r = (/* @__PURE__ */ new Date()).toISOString(), { scope: o, authorization_details_types: u, ...
|
|
1137
|
-
...
|
|
1136
|
+
const r = (/* @__PURE__ */ new Date()).toISOString(), { scope: o, authorization_details_types: u, ...c } = a, d = {
|
|
1137
|
+
...c,
|
|
1138
1138
|
updated_at: r
|
|
1139
1139
|
};
|
|
1140
|
-
return o !== void 0 && (
|
|
1140
|
+
return o !== void 0 && (d.scope = JSON.stringify(o)), u !== void 0 && (d.authorization_details_types = JSON.stringify(
|
|
1141
1141
|
u
|
|
1142
|
-
)),
|
|
1142
|
+
)), c.allow_any_organization !== void 0 && (d.allow_any_organization = c.allow_any_organization ? 1 : 0), c.is_system !== void 0 && (d.is_system = c.is_system ? 1 : 0), ((await t.updateTable("client_grants").set(d).where("client_grants.tenant_id", "=", e).where("client_grants.id", "=", n).executeTakeFirst()).numUpdatedRows ?? 0n) > 0n;
|
|
1143
1143
|
};
|
|
1144
1144
|
}
|
|
1145
1145
|
function oo(t) {
|
|
@@ -1175,10 +1175,10 @@ function io(t) {
|
|
|
1175
1175
|
require_proof_of_possession: !!n.require_proof_of_possession,
|
|
1176
1176
|
// Parse JSON string fields back to objects/arrays
|
|
1177
1177
|
connections: r.map(
|
|
1178
|
-
(
|
|
1178
|
+
(c) => Ka.parse(
|
|
1179
1179
|
T({
|
|
1180
|
-
...
|
|
1181
|
-
options:
|
|
1180
|
+
...c,
|
|
1181
|
+
options: c.options ? JSON.parse(c.options) : {}
|
|
1182
1182
|
})
|
|
1183
1183
|
)
|
|
1184
1184
|
),
|
|
@@ -1217,23 +1217,23 @@ function so(t) {
|
|
|
1217
1217
|
sort: o,
|
|
1218
1218
|
q: u
|
|
1219
1219
|
} = e;
|
|
1220
|
-
let
|
|
1220
|
+
let c = t.selectFrom("keys").where(
|
|
1221
1221
|
(f) => f.or([
|
|
1222
1222
|
f("revoked_at", ">", (/* @__PURE__ */ new Date()).toISOString()),
|
|
1223
1223
|
f("revoked_at", "is", null)
|
|
1224
1224
|
])
|
|
1225
1225
|
);
|
|
1226
|
-
u && (
|
|
1226
|
+
u && (c = J(t, c, u, [
|
|
1227
1227
|
"kid",
|
|
1228
1228
|
"connection",
|
|
1229
1229
|
"fingerprint",
|
|
1230
1230
|
"thumbprint",
|
|
1231
1231
|
"type"
|
|
1232
1232
|
]));
|
|
1233
|
-
let
|
|
1233
|
+
let d = c.select((f) => f.fn.count("kid").as("count"));
|
|
1234
1234
|
const h = n * a;
|
|
1235
|
-
|
|
1236
|
-
const g = await
|
|
1235
|
+
c = c.limit(a).offset(h), o && (c = c.orderBy(o.sort_by, o.sort_order));
|
|
1236
|
+
const g = await c.selectAll().execute();
|
|
1237
1237
|
if (!r)
|
|
1238
1238
|
return {
|
|
1239
1239
|
signingKeys: g,
|
|
@@ -1241,7 +1241,7 @@ function so(t) {
|
|
|
1241
1241
|
limit: 0,
|
|
1242
1242
|
length: 0
|
|
1243
1243
|
};
|
|
1244
|
-
const l = await
|
|
1244
|
+
const l = await d.executeTakeFirst(), y = j((l == null ? void 0 : l.count) ?? 0);
|
|
1245
1245
|
return {
|
|
1246
1246
|
signingKeys: g,
|
|
1247
1247
|
start: h,
|
|
@@ -1339,8 +1339,8 @@ function yo(t) {
|
|
|
1339
1339
|
colors_primary: r,
|
|
1340
1340
|
colors_page_background_type: o,
|
|
1341
1341
|
colors_page_background_start: u,
|
|
1342
|
-
colors_page_background_end:
|
|
1343
|
-
colors_page_background_angle_dev:
|
|
1342
|
+
colors_page_background_end: c,
|
|
1343
|
+
colors_page_background_angle_dev: d,
|
|
1344
1344
|
font_url: h,
|
|
1345
1345
|
...g
|
|
1346
1346
|
} = n;
|
|
@@ -1351,8 +1351,8 @@ function yo(t) {
|
|
|
1351
1351
|
page_background: {
|
|
1352
1352
|
type: o,
|
|
1353
1353
|
start: u,
|
|
1354
|
-
end:
|
|
1355
|
-
angle_deg:
|
|
1354
|
+
end: c,
|
|
1355
|
+
angle_deg: d
|
|
1356
1356
|
}
|
|
1357
1357
|
},
|
|
1358
1358
|
font: h ? { url: h } : void 0
|
|
@@ -1361,14 +1361,14 @@ function yo(t) {
|
|
|
1361
1361
|
}
|
|
1362
1362
|
function No(t) {
|
|
1363
1363
|
return async (e, n) => {
|
|
1364
|
-
var u,
|
|
1364
|
+
var u, c, d, h, g, l, y, f, v, x, E, z, oe, Q, ye, Ct, Ne, rt;
|
|
1365
1365
|
const { colors: a, font: r, ...o } = n;
|
|
1366
1366
|
try {
|
|
1367
1367
|
await t.insertInto("branding").values({
|
|
1368
1368
|
...o,
|
|
1369
1369
|
colors_primary: a == null ? void 0 : a.primary,
|
|
1370
|
-
colors_page_background_type: (
|
|
1371
|
-
colors_page_background_start: (h = (
|
|
1370
|
+
colors_page_background_type: (c = (u = n.colors) == null ? void 0 : u.page_background) == null ? void 0 : c.type,
|
|
1371
|
+
colors_page_background_start: (h = (d = n.colors) == null ? void 0 : d.page_background) == null ? void 0 : h.start,
|
|
1372
1372
|
colors_page_background_end: (l = (g = n.colors) == null ? void 0 : g.page_background) == null ? void 0 : l.end,
|
|
1373
1373
|
colors_page_background_angle_dev: (f = (y = n.colors) == null ? void 0 : y.page_background) == null ? void 0 : f.angle_deg,
|
|
1374
1374
|
font_url: (v = n.font) == null ? void 0 : v.url,
|
|
@@ -1396,9 +1396,9 @@ function vo(t) {
|
|
|
1396
1396
|
function Co(t) {
|
|
1397
1397
|
return async (e, n = {}) => {
|
|
1398
1398
|
const { page: a = 0, per_page: r = 50, include_totals: o = !1, q: u } = n;
|
|
1399
|
-
let
|
|
1400
|
-
u && (
|
|
1401
|
-
const g = (await
|
|
1399
|
+
let c = t.selectFrom("hooks").where("hooks.tenant_id", "=", e);
|
|
1400
|
+
u && (c = J(t, c, u, ["url", "form_id"]));
|
|
1401
|
+
const g = (await c.offset(a * r).limit(r).selectAll().execute()).map((y) => {
|
|
1402
1402
|
const { tenant_id: f, enabled: v, synchronous: x, ...E } = y;
|
|
1403
1403
|
return T({
|
|
1404
1404
|
...E,
|
|
@@ -1413,7 +1413,7 @@ function Co(t) {
|
|
|
1413
1413
|
limit: 0,
|
|
1414
1414
|
length: 0
|
|
1415
1415
|
};
|
|
1416
|
-
const { count: l } = await
|
|
1416
|
+
const { count: l } = await c.select((y) => y.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1417
1417
|
return {
|
|
1418
1418
|
hooks: g,
|
|
1419
1419
|
start: a * r,
|
|
@@ -1629,10 +1629,10 @@ function Jo(t) {
|
|
|
1629
1629
|
credentials: r,
|
|
1630
1630
|
settings: o,
|
|
1631
1631
|
enabled: u,
|
|
1632
|
-
...
|
|
1632
|
+
...c
|
|
1633
1633
|
} = n;
|
|
1634
1634
|
return T({
|
|
1635
|
-
...
|
|
1635
|
+
...c,
|
|
1636
1636
|
credentials: JSON.parse(r),
|
|
1637
1637
|
settings: JSON.parse(o),
|
|
1638
1638
|
enabled: !!u
|
|
@@ -1713,10 +1713,10 @@ function Vo(t) {
|
|
|
1713
1713
|
}
|
|
1714
1714
|
function Go(t) {
|
|
1715
1715
|
return async (e, n = {}) => {
|
|
1716
|
-
const { page: a = 0, per_page: r = 50, include_totals: o = !1, sort: u, q:
|
|
1717
|
-
let
|
|
1718
|
-
|
|
1719
|
-
let h =
|
|
1716
|
+
const { page: a = 0, per_page: r = 50, include_totals: o = !1, sort: u, q: c } = n;
|
|
1717
|
+
let d = t.selectFrom("refresh_tokens").where("refresh_tokens.tenant_id", "=", e);
|
|
1718
|
+
c && (d = J(t, d, c, ["token", "session_id"]));
|
|
1719
|
+
let h = d;
|
|
1720
1720
|
if (u && u.sort_by) {
|
|
1721
1721
|
const { ref: v } = t.dynamic;
|
|
1722
1722
|
h = h.orderBy(v(u.sort_by), u.sort_order);
|
|
@@ -1735,7 +1735,7 @@ function Go(t) {
|
|
|
1735
1735
|
limit: 0,
|
|
1736
1736
|
length: 0
|
|
1737
1737
|
};
|
|
1738
|
-
const { count: y } = await
|
|
1738
|
+
const { count: y } = await d.select((v) => v.fn.countAll().as("count")).executeTakeFirstOrThrow(), f = j(y);
|
|
1739
1739
|
return {
|
|
1740
1740
|
refresh_tokens: l,
|
|
1741
1741
|
start: a * r,
|
|
@@ -1804,9 +1804,9 @@ function Xo(t) {
|
|
|
1804
1804
|
function Zo(t) {
|
|
1805
1805
|
return async (e, n = {}) => {
|
|
1806
1806
|
const { page: a = 0, per_page: r = 50, include_totals: o = !1, q: u } = n;
|
|
1807
|
-
let
|
|
1808
|
-
u && (
|
|
1809
|
-
const g = (await
|
|
1807
|
+
let c = t.selectFrom("forms").where("tenant_id", "=", e);
|
|
1808
|
+
u && (c = J(t, c, u, []));
|
|
1809
|
+
const g = (await c.offset(a * r).limit(r).selectAll().execute()).map((y) => {
|
|
1810
1810
|
const f = { ...y };
|
|
1811
1811
|
if (typeof f.nodes == "string")
|
|
1812
1812
|
try {
|
|
@@ -1832,7 +1832,7 @@ function Zo(t) {
|
|
|
1832
1832
|
limit: 0,
|
|
1833
1833
|
length: 0
|
|
1834
1834
|
};
|
|
1835
|
-
const { count: l } = await
|
|
1835
|
+
const { count: l } = await c.select((y) => y.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1836
1836
|
return {
|
|
1837
1837
|
forms: g,
|
|
1838
1838
|
start: a * r,
|
|
@@ -1899,16 +1899,16 @@ function ri(t) {
|
|
|
1899
1899
|
updated_at: a
|
|
1900
1900
|
}, o = Va.parse(r), {
|
|
1901
1901
|
verificationKey: u,
|
|
1902
|
-
scopes:
|
|
1903
|
-
options:
|
|
1902
|
+
scopes: c,
|
|
1903
|
+
options: d,
|
|
1904
1904
|
skip_consent_for_verifiable_first_party_clients: h,
|
|
1905
1905
|
allow_offline_access: g,
|
|
1906
1906
|
...l
|
|
1907
1907
|
} = o, y = {
|
|
1908
1908
|
...l,
|
|
1909
1909
|
tenant_id: e,
|
|
1910
|
-
scopes:
|
|
1911
|
-
options:
|
|
1910
|
+
scopes: c ? JSON.stringify(c) : "[]",
|
|
1911
|
+
options: d ? JSON.stringify(d) : "{}",
|
|
1912
1912
|
skip_consent_for_verifiable_first_party_clients: h ? 1 : 0,
|
|
1913
1913
|
allow_offline_access: g ? 1 : 0,
|
|
1914
1914
|
verification_key: u,
|
|
@@ -1925,15 +1925,15 @@ function oi(t) {
|
|
|
1925
1925
|
const r = a, {
|
|
1926
1926
|
verification_key: o,
|
|
1927
1927
|
scopes: u,
|
|
1928
|
-
options:
|
|
1929
|
-
skip_consent_for_verifiable_first_party_clients:
|
|
1928
|
+
options: c,
|
|
1929
|
+
skip_consent_for_verifiable_first_party_clients: d,
|
|
1930
1930
|
allow_offline_access: h,
|
|
1931
1931
|
...g
|
|
1932
1932
|
} = r, l = {
|
|
1933
1933
|
...g,
|
|
1934
1934
|
scopes: u ? JSON.parse(u) : [],
|
|
1935
|
-
options:
|
|
1936
|
-
skip_consent_for_verifiable_first_party_clients: !!
|
|
1935
|
+
options: c ? JSON.parse(c) : {},
|
|
1936
|
+
skip_consent_for_verifiable_first_party_clients: !!d,
|
|
1937
1937
|
allow_offline_access: !!h,
|
|
1938
1938
|
// Convert verification_key back to verificationKey for API
|
|
1939
1939
|
verificationKey: o
|
|
@@ -1944,19 +1944,19 @@ function oi(t) {
|
|
|
1944
1944
|
function ii(t) {
|
|
1945
1945
|
return async (e, n = {}) => {
|
|
1946
1946
|
const { page: a = 0, per_page: r = 50, include_totals: o = !1, q: u } = n;
|
|
1947
|
-
let
|
|
1947
|
+
let c = t.selectFrom("resource_servers").where("resource_servers.tenant_id", "=", e);
|
|
1948
1948
|
if (u) {
|
|
1949
1949
|
const y = u.trim(), f = y.split(/\s+/), v = f.length === 1 ? f[0] : void 0, x = v ? v.match(/^(-)?(name|identifier):(.*)$/) : null, E = x ? x[3] : "", z = /^(>=|>|<=|<)/.test(E || "");
|
|
1950
1950
|
if (x && !z) {
|
|
1951
1951
|
const oe = !!x[1], Q = x[2] === "name" ? "resource_servers.name" : "resource_servers.identifier";
|
|
1952
|
-
|
|
1952
|
+
c = oe ? c.where(Q, "not like", `%${E}%`) : c.where(Q, "like", `%${E}%`);
|
|
1953
1953
|
} else
|
|
1954
|
-
|
|
1954
|
+
c = J(t, c, y, [
|
|
1955
1955
|
"resource_servers.name",
|
|
1956
1956
|
"resource_servers.identifier"
|
|
1957
1957
|
]);
|
|
1958
1958
|
}
|
|
1959
|
-
const g = (await
|
|
1959
|
+
const g = (await c.offset(a * r).limit(r).selectAll().execute()).map((y) => {
|
|
1960
1960
|
const f = y, {
|
|
1961
1961
|
verification_key: v,
|
|
1962
1962
|
scopes: x,
|
|
@@ -1982,7 +1982,7 @@ function ii(t) {
|
|
|
1982
1982
|
limit: 0,
|
|
1983
1983
|
length: 0
|
|
1984
1984
|
};
|
|
1985
|
-
const { count: l } = await
|
|
1985
|
+
const { count: l } = await c.select((y) => y.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1986
1986
|
return {
|
|
1987
1987
|
resource_servers: g,
|
|
1988
1988
|
start: a * r,
|
|
@@ -2003,8 +2003,8 @@ function ui(t) {
|
|
|
2003
2003
|
verificationKey: r,
|
|
2004
2004
|
scopes: o,
|
|
2005
2005
|
options: u,
|
|
2006
|
-
skip_consent_for_verifiable_first_party_clients:
|
|
2007
|
-
allow_offline_access:
|
|
2006
|
+
skip_consent_for_verifiable_first_party_clients: c,
|
|
2007
|
+
allow_offline_access: d,
|
|
2008
2008
|
...h
|
|
2009
2009
|
} = a, g = {
|
|
2010
2010
|
...h,
|
|
@@ -2014,12 +2014,12 @@ function ui(t) {
|
|
|
2014
2014
|
const y = await t.selectFrom("resource_servers").select("options").where("tenant_id", "=", e).where("id", "=", n).executeTakeFirst(), v = { ...y != null && y.options ? JSON.parse(y.options) : {}, ...u };
|
|
2015
2015
|
g.options = JSON.stringify(v);
|
|
2016
2016
|
}
|
|
2017
|
-
|
|
2017
|
+
c !== void 0 && (g.skip_consent_for_verifiable_first_party_clients = c ? 1 : 0), d !== void 0 && (g.allow_offline_access = d ? 1 : 0);
|
|
2018
2018
|
const l = await t.updateTable("resource_servers").set(g).where("tenant_id", "=", e).where("id", "=", n).executeTakeFirst();
|
|
2019
2019
|
return Number(l.numUpdatedRows) > 0;
|
|
2020
2020
|
};
|
|
2021
2021
|
}
|
|
2022
|
-
function
|
|
2022
|
+
function ci(t) {
|
|
2023
2023
|
return {
|
|
2024
2024
|
create: ri(t),
|
|
2025
2025
|
get: oi(t),
|
|
@@ -2028,7 +2028,7 @@ function di(t) {
|
|
|
2028
2028
|
update: ui(t)
|
|
2029
2029
|
};
|
|
2030
2030
|
}
|
|
2031
|
-
function
|
|
2031
|
+
function di(t) {
|
|
2032
2032
|
return async (e, n) => {
|
|
2033
2033
|
const a = (/* @__PURE__ */ new Date()).toISOString(), r = U(), o = {
|
|
2034
2034
|
id: r,
|
|
@@ -2058,17 +2058,17 @@ function _i(t) {
|
|
|
2058
2058
|
let a = t.selectFrom("roles").where("roles.tenant_id", "=", e);
|
|
2059
2059
|
const { page: r = 0, per_page: o = 50, include_totals: u = !1 } = n;
|
|
2060
2060
|
n.q && (a = J(t, a, n.q, ["name"]));
|
|
2061
|
-
const
|
|
2061
|
+
const d = await a.offset(r * o).limit(o).selectAll().execute();
|
|
2062
2062
|
if (!u)
|
|
2063
2063
|
return {
|
|
2064
|
-
roles:
|
|
2064
|
+
roles: d,
|
|
2065
2065
|
start: r * o,
|
|
2066
2066
|
limit: o,
|
|
2067
|
-
length:
|
|
2067
|
+
length: d.length
|
|
2068
2068
|
};
|
|
2069
2069
|
const { count: h } = await a.select((g) => g.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
2070
2070
|
return {
|
|
2071
|
-
roles:
|
|
2071
|
+
roles: d,
|
|
2072
2072
|
start: r * o,
|
|
2073
2073
|
limit: o,
|
|
2074
2074
|
length: j(h)
|
|
@@ -2092,7 +2092,7 @@ function hi(t) {
|
|
|
2092
2092
|
}
|
|
2093
2093
|
function fi(t) {
|
|
2094
2094
|
return {
|
|
2095
|
-
create:
|
|
2095
|
+
create: di(t),
|
|
2096
2096
|
get: li(t),
|
|
2097
2097
|
list: _i(t),
|
|
2098
2098
|
update: mi(t),
|
|
@@ -2118,10 +2118,10 @@ function pi(t) {
|
|
|
2118
2118
|
};
|
|
2119
2119
|
try {
|
|
2120
2120
|
await t.insertInto("role_permissions").values(u).execute();
|
|
2121
|
-
} catch (
|
|
2122
|
-
if (
|
|
2121
|
+
} catch (c) {
|
|
2122
|
+
if (c.code === "SQLITE_CONSTRAINT_PRIMARYKEY" || c.code === "SQLITE_CONSTRAINT_UNIQUE")
|
|
2123
2123
|
continue;
|
|
2124
|
-
throw
|
|
2124
|
+
throw c;
|
|
2125
2125
|
}
|
|
2126
2126
|
}
|
|
2127
2127
|
return !0;
|
|
@@ -2151,7 +2151,7 @@ function gi(t) {
|
|
|
2151
2151
|
function wi(t) {
|
|
2152
2152
|
return async (e, n, a = {}) => {
|
|
2153
2153
|
const { page: r = 0, per_page: o = 50, include_totals: u = !1 } = a;
|
|
2154
|
-
let
|
|
2154
|
+
let c = t.selectFrom("role_permissions").leftJoin(
|
|
2155
2155
|
"resource_servers",
|
|
2156
2156
|
(l) => l.onRef(
|
|
2157
2157
|
"role_permissions.tenant_id",
|
|
@@ -2169,7 +2169,7 @@ function wi(t) {
|
|
|
2169
2169
|
"role_permissions.created_at",
|
|
2170
2170
|
"resource_servers.name as resource_server_name"
|
|
2171
2171
|
]).where("role_permissions.tenant_id", "=", e).where("role_permissions.role_id", "=", n);
|
|
2172
|
-
const g = (await
|
|
2172
|
+
const g = (await c.offset(r * o).limit(o).execute()).map((l) => ({
|
|
2173
2173
|
role_id: l.role_id,
|
|
2174
2174
|
resource_server_identifier: l.resource_server_identifier,
|
|
2175
2175
|
resource_server_name: l.resource_server_name || l.resource_server_identifier,
|
|
@@ -2179,7 +2179,7 @@ function wi(t) {
|
|
|
2179
2179
|
// No description available from role_permissions directly
|
|
2180
2180
|
created_at: l.created_at
|
|
2181
2181
|
}));
|
|
2182
|
-
return u && await
|
|
2182
|
+
return u && await c.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow(), g;
|
|
2183
2183
|
};
|
|
2184
2184
|
}
|
|
2185
2185
|
function yi(t) {
|
|
@@ -2225,7 +2225,7 @@ function Ci(t) {
|
|
|
2225
2225
|
return async (e, n, a, r) => {
|
|
2226
2226
|
let o = t.selectFrom("user_permissions").leftJoin(
|
|
2227
2227
|
"resource_servers",
|
|
2228
|
-
(
|
|
2228
|
+
(c) => c.onRef(
|
|
2229
2229
|
"user_permissions.tenant_id",
|
|
2230
2230
|
"=",
|
|
2231
2231
|
"resource_servers.tenant_id"
|
|
@@ -2246,16 +2246,16 @@ function Ci(t) {
|
|
|
2246
2246
|
"user_permissions.organization_id",
|
|
2247
2247
|
"=",
|
|
2248
2248
|
r
|
|
2249
|
-
)), (await o.execute()).map((
|
|
2250
|
-
resource_server_identifier:
|
|
2251
|
-
permission_name:
|
|
2249
|
+
)), (await o.execute()).map((c) => ({
|
|
2250
|
+
resource_server_identifier: c.resource_server_identifier,
|
|
2251
|
+
permission_name: c.permission_name,
|
|
2252
2252
|
description: null,
|
|
2253
2253
|
// No description available from user_permissions directly
|
|
2254
|
-
resource_server_name:
|
|
2254
|
+
resource_server_name: c.resource_server_name || c.resource_server_identifier,
|
|
2255
2255
|
// Fallback to identifier if name is null
|
|
2256
|
-
user_id:
|
|
2257
|
-
created_at:
|
|
2258
|
-
organization_id:
|
|
2256
|
+
user_id: c.user_id,
|
|
2257
|
+
created_at: c.created_at,
|
|
2258
|
+
organization_id: c.organization_id === "" ? void 0 : c.organization_id
|
|
2259
2259
|
}));
|
|
2260
2260
|
};
|
|
2261
2261
|
}
|
|
@@ -2278,7 +2278,7 @@ function Ti(t) {
|
|
|
2278
2278
|
return async (e, n, a, r) => {
|
|
2279
2279
|
let o = t.selectFrom("user_roles as ur").innerJoin(
|
|
2280
2280
|
"roles as r",
|
|
2281
|
-
(
|
|
2281
|
+
(c) => c.onRef("ur.role_id", "=", "r.id").onRef("ur.tenant_id", "=", "r.tenant_id")
|
|
2282
2282
|
).select([
|
|
2283
2283
|
"r.id",
|
|
2284
2284
|
"r.name",
|
|
@@ -2401,8 +2401,8 @@ function Pi(t) {
|
|
|
2401
2401
|
}
|
|
2402
2402
|
function Di(t) {
|
|
2403
2403
|
return async (e, n, a) => {
|
|
2404
|
-
const { branding: r, metadata: o, enabled_connections: u, token_quota:
|
|
2405
|
-
...
|
|
2404
|
+
const { branding: r, metadata: o, enabled_connections: u, token_quota: c, ...d } = a, h = {
|
|
2405
|
+
...d,
|
|
2406
2406
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
2407
2407
|
};
|
|
2408
2408
|
return Nt(
|
|
@@ -2469,20 +2469,20 @@ function ji(t) {
|
|
|
2469
2469
|
}
|
|
2470
2470
|
}
|
|
2471
2471
|
u = u.orderBy("created_at", "desc"), r > 0 && (u = u.limit(r).offset(o));
|
|
2472
|
-
const
|
|
2473
|
-
let
|
|
2472
|
+
const c = await u.execute();
|
|
2473
|
+
let d = t.selectFrom("user_organizations").select(t.fn.count("id").as("count")).where("tenant_id", "=", e);
|
|
2474
2474
|
if (n != null && n.q) {
|
|
2475
2475
|
if (n.q.startsWith("user_id:")) {
|
|
2476
2476
|
const l = n.q.replace("user_id:", "");
|
|
2477
|
-
|
|
2477
|
+
d = d.where("user_id", "=", l);
|
|
2478
2478
|
} else if (n.q.startsWith("organization_id:")) {
|
|
2479
2479
|
const l = n.q.replace("organization_id:", "");
|
|
2480
|
-
|
|
2480
|
+
d = d.where("organization_id", "=", l);
|
|
2481
2481
|
}
|
|
2482
2482
|
}
|
|
2483
|
-
const h = await
|
|
2483
|
+
const h = await d.executeTakeFirst();
|
|
2484
2484
|
return {
|
|
2485
|
-
userOrganizations:
|
|
2485
|
+
userOrganizations: c.map((l) => ({
|
|
2486
2486
|
id: l.id,
|
|
2487
2487
|
user_id: l.user_id,
|
|
2488
2488
|
organization_id: l.organization_id,
|
|
@@ -2498,7 +2498,7 @@ function ji(t) {
|
|
|
2498
2498
|
function Li(t) {
|
|
2499
2499
|
return async (e, n, a) => {
|
|
2500
2500
|
const r = (a == null ? void 0 : a.page) || 0, o = (a == null ? void 0 : a.per_page) || 50, u = r * o;
|
|
2501
|
-
let
|
|
2501
|
+
let c = t.selectFrom("user_organizations").innerJoin(
|
|
2502
2502
|
"organizations",
|
|
2503
2503
|
"organizations.id",
|
|
2504
2504
|
"user_organizations.organization_id"
|
|
@@ -2514,14 +2514,14 @@ function Li(t) {
|
|
|
2514
2514
|
"organizations.updated_at",
|
|
2515
2515
|
"user_organizations.created_at as joined_at"
|
|
2516
2516
|
]).where("user_organizations.tenant_id", "=", e).where("user_organizations.user_id", "=", n);
|
|
2517
|
-
|
|
2518
|
-
const
|
|
2517
|
+
c = c.orderBy("user_organizations.created_at", "desc"), o > 0 && (c = c.limit(o).offset(u));
|
|
2518
|
+
const d = await c.execute(), h = await t.selectFrom("user_organizations").innerJoin(
|
|
2519
2519
|
"organizations",
|
|
2520
2520
|
"organizations.id",
|
|
2521
2521
|
"user_organizations.organization_id"
|
|
2522
2522
|
).select(t.fn.count("user_organizations.id").as("count")).where("user_organizations.tenant_id", "=", e).where("user_organizations.user_id", "=", n).executeTakeFirst();
|
|
2523
2523
|
return {
|
|
2524
|
-
organizations:
|
|
2524
|
+
organizations: d.map((l) => ({
|
|
2525
2525
|
id: l.id,
|
|
2526
2526
|
name: l.name,
|
|
2527
2527
|
display_name: l.display_name,
|
|
@@ -2565,7 +2565,7 @@ function qi(t) {
|
|
|
2565
2565
|
}
|
|
2566
2566
|
function Bi(t) {
|
|
2567
2567
|
return async (e, n) => {
|
|
2568
|
-
const a = Jr(), r = (/* @__PURE__ */ new Date()).toISOString(), o = n.ttl_sec || 604800, u = new Date(Date.now() + o * 1e3).toISOString(),
|
|
2568
|
+
const a = Jr(), r = (/* @__PURE__ */ new Date()).toISOString(), o = n.ttl_sec || 604800, u = new Date(Date.now() + o * 1e3).toISOString(), c = Nt(
|
|
2569
2569
|
{
|
|
2570
2570
|
id: a,
|
|
2571
2571
|
tenant_id: e,
|
|
@@ -2587,15 +2587,15 @@ function Bi(t) {
|
|
|
2587
2587
|
["inviter", "invitee", "app_metadata", "user_metadata", "roles"]
|
|
2588
2588
|
);
|
|
2589
2589
|
try {
|
|
2590
|
-
await t.insertInto("invites").values(
|
|
2591
|
-
} catch (
|
|
2592
|
-
throw
|
|
2590
|
+
await t.insertInto("invites").values(c).execute();
|
|
2591
|
+
} catch (d) {
|
|
2592
|
+
throw d.code === "SQLITE_CONSTRAINT_UNIQUE" || d.message.includes("AlreadyExists") ? new et(409, {
|
|
2593
2593
|
message: "Invite already exists"
|
|
2594
|
-
}) :
|
|
2594
|
+
}) : d;
|
|
2595
2595
|
}
|
|
2596
2596
|
return {
|
|
2597
2597
|
id: a,
|
|
2598
|
-
organization_id:
|
|
2598
|
+
organization_id: c.organization_id,
|
|
2599
2599
|
inviter: n.inviter,
|
|
2600
2600
|
invitee: n.invitee,
|
|
2601
2601
|
client_id: n.client_id,
|
|
@@ -2606,7 +2606,7 @@ function Bi(t) {
|
|
|
2606
2606
|
app_metadata: n.app_metadata || {},
|
|
2607
2607
|
user_metadata: n.user_metadata || {},
|
|
2608
2608
|
roles: n.roles || [],
|
|
2609
|
-
ticket_id:
|
|
2609
|
+
ticket_id: c.ticket_id || void 0,
|
|
2610
2610
|
ttl_sec: o,
|
|
2611
2611
|
send_invitation_email: n.send_invitation_email ?? !0
|
|
2612
2612
|
};
|
|
@@ -2655,7 +2655,7 @@ function Ui(t) {
|
|
|
2655
2655
|
a = a.offset(u);
|
|
2656
2656
|
}
|
|
2657
2657
|
const o = (await a.execute()).map((u) => {
|
|
2658
|
-
const
|
|
2658
|
+
const c = ea(u, {
|
|
2659
2659
|
inviter: {},
|
|
2660
2660
|
invitee: {},
|
|
2661
2661
|
app_metadata: {},
|
|
@@ -2663,7 +2663,7 @@ function Ui(t) {
|
|
|
2663
2663
|
roles: []
|
|
2664
2664
|
});
|
|
2665
2665
|
return T({
|
|
2666
|
-
...
|
|
2666
|
+
...c,
|
|
2667
2667
|
send_invitation_email: u.send_invitation_email === 1
|
|
2668
2668
|
});
|
|
2669
2669
|
});
|
|
@@ -3149,22 +3149,22 @@ function fe(t) {
|
|
|
3149
3149
|
const e = ".";
|
|
3150
3150
|
if (!t.includes(e))
|
|
3151
3151
|
return qt.create(wn.create(t));
|
|
3152
|
-
const n = t.split(e).map(
|
|
3152
|
+
const n = t.split(e).map(ca);
|
|
3153
3153
|
if (n.length === 3)
|
|
3154
|
-
return
|
|
3154
|
+
return ds(n);
|
|
3155
3155
|
if (n.length === 2)
|
|
3156
3156
|
return ls(n);
|
|
3157
3157
|
throw new Error(`invalid column reference ${t}`);
|
|
3158
3158
|
}
|
|
3159
|
-
function
|
|
3159
|
+
function cs(t) {
|
|
3160
3160
|
const e = " as ";
|
|
3161
3161
|
if (t.includes(e)) {
|
|
3162
|
-
const [n, a] = t.split(e).map(
|
|
3162
|
+
const [n, a] = t.split(e).map(ca);
|
|
3163
3163
|
return we.create(fe(n), F.create(a));
|
|
3164
3164
|
} else
|
|
3165
3165
|
return fe(t);
|
|
3166
3166
|
}
|
|
3167
|
-
function
|
|
3167
|
+
function ds(t) {
|
|
3168
3168
|
const [e, n, a] = t;
|
|
3169
3169
|
return qt.create(wn.create(a), _e.createWithSchema(e, n));
|
|
3170
3170
|
}
|
|
@@ -3172,7 +3172,7 @@ function ls(t) {
|
|
|
3172
3172
|
const [e, n] = t;
|
|
3173
3173
|
return qt.create(wn.create(n), _e.create(e));
|
|
3174
3174
|
}
|
|
3175
|
-
function
|
|
3175
|
+
function ca(t) {
|
|
3176
3176
|
return t.trim();
|
|
3177
3177
|
}
|
|
3178
3178
|
const _s = s({
|
|
@@ -3249,13 +3249,13 @@ function K(t) {
|
|
|
3249
3249
|
throw new Error(`invalid arguments: ${JSON.stringify(t)}`);
|
|
3250
3250
|
}
|
|
3251
3251
|
function Cn(t, e, n) {
|
|
3252
|
-
return ps(e) &&
|
|
3252
|
+
return ps(e) && da(n) ? tt.create(L(t), tn(e), pe.createImmediate(n)) : tt.create(L(t), tn(e), hs(n));
|
|
3253
3253
|
}
|
|
3254
3254
|
function ht(t, e, n) {
|
|
3255
3255
|
return tt.create(L(t), tn(e), L(n));
|
|
3256
3256
|
}
|
|
3257
3257
|
function En(t, e) {
|
|
3258
|
-
return en(Object.entries(t).filter(([, n]) => !Ot(n)).map(([n, a]) => Cn(n,
|
|
3258
|
+
return en(Object.entries(t).filter(([, n]) => !Ot(n)).map(([n, a]) => Cn(n, da(a) ? "is" : "=", a)), e);
|
|
3259
3259
|
}
|
|
3260
3260
|
function en(t, e, n = !0) {
|
|
3261
3261
|
const a = e === "and" ? he.create : at.create;
|
|
@@ -3269,7 +3269,7 @@ function en(t, e, n = !0) {
|
|
|
3269
3269
|
function ps(t) {
|
|
3270
3270
|
return t === "is" || t === "is not";
|
|
3271
3271
|
}
|
|
3272
|
-
function
|
|
3272
|
+
function da(t) {
|
|
3273
3273
|
return na(t) || ta(t);
|
|
3274
3274
|
}
|
|
3275
3275
|
function tn(t) {
|
|
@@ -3502,13 +3502,13 @@ function Ae(t, e) {
|
|
|
3502
3502
|
});
|
|
3503
3503
|
}
|
|
3504
3504
|
var B;
|
|
3505
|
-
const
|
|
3505
|
+
const dt = class dt {
|
|
3506
3506
|
constructor(e) {
|
|
3507
3507
|
C(this, B);
|
|
3508
3508
|
b(this, B, s(e));
|
|
3509
3509
|
}
|
|
3510
3510
|
on(...e) {
|
|
3511
|
-
return new
|
|
3511
|
+
return new dt({
|
|
3512
3512
|
...i(this, B),
|
|
3513
3513
|
joinNode: st.cloneWithOn(i(this, B).joinNode, K(e))
|
|
3514
3514
|
});
|
|
@@ -3520,7 +3520,7 @@ const ct = class ct {
|
|
|
3520
3520
|
* See {@link WhereInterface.whereRef} for documentation and examples.
|
|
3521
3521
|
*/
|
|
3522
3522
|
onRef(e, n, a) {
|
|
3523
|
-
return new
|
|
3523
|
+
return new dt({
|
|
3524
3524
|
...i(this, B),
|
|
3525
3525
|
joinNode: st.cloneWithOn(i(this, B).joinNode, ht(e, n, a))
|
|
3526
3526
|
});
|
|
@@ -3529,7 +3529,7 @@ const ct = class ct {
|
|
|
3529
3529
|
* Adds `on true`.
|
|
3530
3530
|
*/
|
|
3531
3531
|
onTrue() {
|
|
3532
|
-
return new
|
|
3532
|
+
return new dt({
|
|
3533
3533
|
...i(this, B),
|
|
3534
3534
|
joinNode: st.cloneWithOn(i(this, B).joinNode, R.createWithSql("true"))
|
|
3535
3535
|
});
|
|
@@ -3546,7 +3546,7 @@ const ct = class ct {
|
|
|
3546
3546
|
}
|
|
3547
3547
|
};
|
|
3548
3548
|
B = new WeakMap();
|
|
3549
|
-
let It =
|
|
3549
|
+
let It = dt;
|
|
3550
3550
|
Ae(It, "don't await JoinBuilder instances. They are never executed directly and are always just a part of a query.");
|
|
3551
3551
|
const gs = s({
|
|
3552
3552
|
is(t) {
|
|
@@ -3613,7 +3613,7 @@ const zt = class zt {
|
|
|
3613
3613
|
ve = new WeakMap();
|
|
3614
3614
|
let Et = zt;
|
|
3615
3615
|
Ae(Et, "don't await OverBuilder instances. They are never executed directly and are always just a part of a query.");
|
|
3616
|
-
const
|
|
3616
|
+
const ct = s({
|
|
3617
3617
|
is(t) {
|
|
3618
3618
|
return t.kind === "SelectionNode";
|
|
3619
3619
|
},
|
|
@@ -3640,14 +3640,14 @@ function la(t) {
|
|
|
3640
3640
|
return Ee(t) ? la(t(Wt())) : me(t) ? t.map((e) => zn(e)) : [zn(t)];
|
|
3641
3641
|
}
|
|
3642
3642
|
function zn(t) {
|
|
3643
|
-
return Y(t) ?
|
|
3643
|
+
return Y(t) ? ct.create(cs(t)) : ia(t) ? ct.create(t.toOperationNode()) : ct.create(va(t));
|
|
3644
3644
|
}
|
|
3645
3645
|
function _a(t) {
|
|
3646
|
-
return t ? Array.isArray(t) ? t.map(Rn) : [Rn(t)] : [
|
|
3646
|
+
return t ? Array.isArray(t) ? t.map(Rn) : [Rn(t)] : [ct.createSelectAll()];
|
|
3647
3647
|
}
|
|
3648
3648
|
function Rn(t) {
|
|
3649
3649
|
if (Y(t))
|
|
3650
|
-
return
|
|
3650
|
+
return ct.createSelectAllFromTable(W(t));
|
|
3651
3651
|
throw new Error(`invalid value selectAll expression: ${JSON.stringify(t)}`);
|
|
3652
3652
|
}
|
|
3653
3653
|
const ys = s({
|
|
@@ -5080,11 +5080,11 @@ class Ls {
|
|
|
5080
5080
|
}
|
|
5081
5081
|
async *stream(e, n, a) {
|
|
5082
5082
|
const r = new Jn(), o = new Jn();
|
|
5083
|
-
this.provideConnection(async (
|
|
5083
|
+
this.provideConnection(async (c) => (r.resolve(c), await o.promise)).catch((c) => r.reject(c));
|
|
5084
5084
|
const u = await r.promise;
|
|
5085
5085
|
try {
|
|
5086
|
-
for await (const
|
|
5087
|
-
yield await w(this, gt, on).call(this,
|
|
5086
|
+
for await (const c of u.streamQuery(e, n))
|
|
5087
|
+
yield await w(this, gt, on).call(this, c, a);
|
|
5088
5088
|
} finally {
|
|
5089
5089
|
o.resolve();
|
|
5090
5090
|
}
|
|
@@ -5234,12 +5234,12 @@ const Ft = class Ft {
|
|
|
5234
5234
|
};
|
|
5235
5235
|
ae = new WeakMap();
|
|
5236
5236
|
let O = Ft;
|
|
5237
|
-
var Ke,
|
|
5237
|
+
var Ke, ce;
|
|
5238
5238
|
class xn {
|
|
5239
5239
|
constructor(e, n) {
|
|
5240
5240
|
C(this, Ke);
|
|
5241
|
-
C(this,
|
|
5242
|
-
b(this, Ke, e), b(this,
|
|
5241
|
+
C(this, ce);
|
|
5242
|
+
b(this, Ke, e), b(this, ce, n);
|
|
5243
5243
|
}
|
|
5244
5244
|
/** @private */
|
|
5245
5245
|
get expression() {
|
|
@@ -5247,13 +5247,13 @@ class xn {
|
|
|
5247
5247
|
}
|
|
5248
5248
|
/** @private */
|
|
5249
5249
|
get alias() {
|
|
5250
|
-
return i(this,
|
|
5250
|
+
return i(this, ce);
|
|
5251
5251
|
}
|
|
5252
5252
|
toOperationNode() {
|
|
5253
|
-
return we.create(i(this, Ke).toOperationNode(), q(i(this,
|
|
5253
|
+
return we.create(i(this, Ke).toOperationNode(), q(i(this, ce)) ? i(this, ce).toOperationNode() : F.create(i(this, ce)));
|
|
5254
5254
|
}
|
|
5255
5255
|
}
|
|
5256
|
-
Ke = new WeakMap(),
|
|
5256
|
+
Ke = new WeakMap(), ce = new WeakMap();
|
|
5257
5257
|
var Te;
|
|
5258
5258
|
const jt = class jt {
|
|
5259
5259
|
constructor(e) {
|
|
@@ -6145,8 +6145,8 @@ const Wn = s({
|
|
|
6145
6145
|
});
|
|
6146
6146
|
}
|
|
6147
6147
|
});
|
|
6148
|
-
var G, wt,
|
|
6149
|
-
class
|
|
6148
|
+
var G, wt, dn;
|
|
6149
|
+
class cn {
|
|
6150
6150
|
constructor(e) {
|
|
6151
6151
|
C(this, wt);
|
|
6152
6152
|
C(this, G);
|
|
@@ -6220,7 +6220,7 @@ class dn {
|
|
|
6220
6220
|
* ```
|
|
6221
6221
|
*/
|
|
6222
6222
|
at(e) {
|
|
6223
|
-
return w(this, wt,
|
|
6223
|
+
return w(this, wt, dn).call(this, "ArrayLocation", e);
|
|
6224
6224
|
}
|
|
6225
6225
|
/**
|
|
6226
6226
|
* Access a property of a JSON object.
|
|
@@ -6272,14 +6272,14 @@ class dn {
|
|
|
6272
6272
|
* ```
|
|
6273
6273
|
*/
|
|
6274
6274
|
key(e) {
|
|
6275
|
-
return w(this, wt,
|
|
6275
|
+
return w(this, wt, dn).call(this, "Member", e);
|
|
6276
6276
|
}
|
|
6277
6277
|
}
|
|
6278
|
-
G = new WeakMap(), wt = new WeakSet(),
|
|
6278
|
+
G = new WeakMap(), wt = new WeakSet(), dn = function(e, n) {
|
|
6279
6279
|
return St.is(i(this, G)) ? new $t(St.cloneWithTraversal(i(this, G), ut.is(i(this, G).traversal) ? ut.cloneWithLeg(i(this, G).traversal, Wn.create(e, n)) : ua.cloneWithValue(i(this, G).traversal, pe.createImmediate(n)))) : new $t(ut.cloneWithLeg(i(this, G), Wn.create(e, n)));
|
|
6280
6280
|
};
|
|
6281
6281
|
var Se;
|
|
6282
|
-
const Mt = class Mt extends
|
|
6282
|
+
const Mt = class Mt extends cn {
|
|
6283
6283
|
constructor(n) {
|
|
6284
6284
|
super(n);
|
|
6285
6285
|
C(this, Se);
|
|
@@ -6309,12 +6309,12 @@ const Mt = class Mt extends dn {
|
|
|
6309
6309
|
};
|
|
6310
6310
|
Se = new WeakMap();
|
|
6311
6311
|
let $t = Mt;
|
|
6312
|
-
var Ze,
|
|
6312
|
+
var Ze, de;
|
|
6313
6313
|
class iu {
|
|
6314
6314
|
constructor(e, n) {
|
|
6315
6315
|
C(this, Ze);
|
|
6316
|
-
C(this,
|
|
6317
|
-
b(this, Ze, e), b(this,
|
|
6316
|
+
C(this, de);
|
|
6317
|
+
b(this, Ze, e), b(this, de, n);
|
|
6318
6318
|
}
|
|
6319
6319
|
/** @private */
|
|
6320
6320
|
get expression() {
|
|
@@ -6322,13 +6322,13 @@ class iu {
|
|
|
6322
6322
|
}
|
|
6323
6323
|
/** @private */
|
|
6324
6324
|
get alias() {
|
|
6325
|
-
return i(this,
|
|
6325
|
+
return i(this, de);
|
|
6326
6326
|
}
|
|
6327
6327
|
toOperationNode() {
|
|
6328
|
-
return we.create(i(this, Ze).toOperationNode(), q(i(this,
|
|
6328
|
+
return we.create(i(this, Ze).toOperationNode(), q(i(this, de)) ? i(this, de).toOperationNode() : F.create(i(this, de)));
|
|
6329
6329
|
}
|
|
6330
6330
|
}
|
|
6331
|
-
Ze = new WeakMap(),
|
|
6331
|
+
Ze = new WeakMap(), de = new WeakMap();
|
|
6332
6332
|
const Kn = s({
|
|
6333
6333
|
is(t) {
|
|
6334
6334
|
return t.kind === "TupleNode";
|
|
@@ -6395,7 +6395,7 @@ const Kn = s({
|
|
|
6395
6395
|
/^timestamp\(\d+\)$/,
|
|
6396
6396
|
/^timestamptz\(\d+\)$/,
|
|
6397
6397
|
/^varbinary\(\d+\)$/
|
|
6398
|
-
],
|
|
6398
|
+
], cu = s({
|
|
6399
6399
|
is(t) {
|
|
6400
6400
|
return t.kind === "DataTypeNode";
|
|
6401
6401
|
},
|
|
@@ -6406,14 +6406,14 @@ const Kn = s({
|
|
|
6406
6406
|
});
|
|
6407
6407
|
}
|
|
6408
6408
|
});
|
|
6409
|
-
function
|
|
6409
|
+
function du(t) {
|
|
6410
6410
|
return !!(su.includes(t) || uu.some((e) => e.test(t)));
|
|
6411
6411
|
}
|
|
6412
6412
|
function lu(t) {
|
|
6413
6413
|
if (q(t))
|
|
6414
6414
|
return t.toOperationNode();
|
|
6415
|
-
if (
|
|
6416
|
-
return
|
|
6415
|
+
if (du(t))
|
|
6416
|
+
return cu.create(t);
|
|
6417
6417
|
throw new Error(`invalid column data type ${JSON.stringify(t)}`);
|
|
6418
6418
|
}
|
|
6419
6419
|
const _u = s({
|
|
@@ -6451,10 +6451,10 @@ function bn(t = wa) {
|
|
|
6451
6451
|
});
|
|
6452
6452
|
},
|
|
6453
6453
|
ref(r, o) {
|
|
6454
|
-
return Ot(o) ? new O(fe(r)) : new
|
|
6454
|
+
return Ot(o) ? new O(fe(r)) : new cn(us(r, o));
|
|
6455
6455
|
},
|
|
6456
6456
|
jsonPath() {
|
|
6457
|
-
return new
|
|
6457
|
+
return new cn(ut.create());
|
|
6458
6458
|
},
|
|
6459
6459
|
table(r) {
|
|
6460
6460
|
return new O(W(r));
|
|
@@ -6820,9 +6820,9 @@ class ba {
|
|
|
6820
6820
|
return w(this, m, ot).call(this, ({ migrations: n, executedMigrations: a, pendingMigrations: r }) => {
|
|
6821
6821
|
if (e === wu)
|
|
6822
6822
|
return { direction: "Down", step: 1 / 0 };
|
|
6823
|
-
if (!n.find((
|
|
6823
|
+
if (!n.find((c) => c.name === e))
|
|
6824
6824
|
throw new Error(`migration "${e}" doesn't exist`);
|
|
6825
|
-
const o = a.indexOf(e), u = r.findIndex((
|
|
6825
|
+
const o = a.indexOf(e), u = r.findIndex((c) => c.name === e);
|
|
6826
6826
|
if (o !== -1)
|
|
6827
6827
|
return {
|
|
6828
6828
|
direction: "Down",
|
|
@@ -6966,8 +6966,8 @@ k = new WeakMap(), m = new WeakSet(), ot = async function(e) {
|
|
|
6966
6966
|
const u = await w(this, m, $a).call(this, o);
|
|
6967
6967
|
if (u.migrations.length === 0)
|
|
6968
6968
|
return { results: [] };
|
|
6969
|
-
const { direction:
|
|
6970
|
-
return
|
|
6969
|
+
const { direction: c, step: d } = e(u);
|
|
6970
|
+
return d <= 0 ? { results: [] } : c === "Down" ? await w(this, m, Fa).call(this, o, u, d) : c === "Up" ? await w(this, m, ja).call(this, o, u, d) : { results: [] };
|
|
6971
6971
|
} finally {
|
|
6972
6972
|
await n.releaseMigrationLock(o, a);
|
|
6973
6973
|
}
|
|
@@ -7003,26 +7003,26 @@ k = new WeakMap(), m = new WeakSet(), ot = async function(e) {
|
|
|
7003
7003
|
if (e[a].name !== n[a])
|
|
7004
7004
|
throw new Error(`corrupted migrations: expected previously executed migration ${n[a]} to be at index ${a} but ${e[a].name} was found in its place. New migrations must always have a name that comes alphabetically after the last executed migration.`);
|
|
7005
7005
|
}, Fa = async function(e, n, a) {
|
|
7006
|
-
const r = n.executedMigrations.slice().reverse().slice(0, a).map((u) => n.migrations.find((
|
|
7006
|
+
const r = n.executedMigrations.slice().reverse().slice(0, a).map((u) => n.migrations.find((c) => c.name === u)), o = r.map((u) => ({
|
|
7007
7007
|
migrationName: u.name,
|
|
7008
7008
|
direction: "Down",
|
|
7009
7009
|
status: "NotExecuted"
|
|
7010
7010
|
}));
|
|
7011
7011
|
for (let u = 0; u < o.length; ++u) {
|
|
7012
|
-
const
|
|
7012
|
+
const c = r[u];
|
|
7013
7013
|
try {
|
|
7014
|
-
|
|
7015
|
-
migrationName:
|
|
7014
|
+
c.down && (await c.down(e), await e.withPlugin(i(this, m, te)).deleteFrom(i(this, m, ee)).where("name", "=", c.name).execute(), o[u] = {
|
|
7015
|
+
migrationName: c.name,
|
|
7016
7016
|
direction: "Down",
|
|
7017
7017
|
status: "Success"
|
|
7018
7018
|
});
|
|
7019
|
-
} catch (
|
|
7019
|
+
} catch (d) {
|
|
7020
7020
|
throw o[u] = {
|
|
7021
|
-
migrationName:
|
|
7021
|
+
migrationName: c.name,
|
|
7022
7022
|
direction: "Down",
|
|
7023
7023
|
status: "Error"
|
|
7024
7024
|
}, new Ht({
|
|
7025
|
-
error:
|
|
7025
|
+
error: d,
|
|
7026
7026
|
results: o
|
|
7027
7027
|
});
|
|
7028
7028
|
}
|
|
@@ -7035,23 +7035,23 @@ k = new WeakMap(), m = new WeakSet(), ot = async function(e) {
|
|
|
7035
7035
|
status: "NotExecuted"
|
|
7036
7036
|
}));
|
|
7037
7037
|
for (let u = 0; u < o.length; u++) {
|
|
7038
|
-
const
|
|
7038
|
+
const c = n.pendingMigrations[u];
|
|
7039
7039
|
try {
|
|
7040
|
-
await
|
|
7041
|
-
name:
|
|
7040
|
+
await c.up(e), await e.withPlugin(i(this, m, te)).insertInto(i(this, m, ee)).values({
|
|
7041
|
+
name: c.name,
|
|
7042
7042
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
7043
7043
|
}).execute(), o[u] = {
|
|
7044
|
-
migrationName:
|
|
7044
|
+
migrationName: c.name,
|
|
7045
7045
|
direction: "Up",
|
|
7046
7046
|
status: "Success"
|
|
7047
7047
|
};
|
|
7048
|
-
} catch (
|
|
7048
|
+
} catch (d) {
|
|
7049
7049
|
throw o[u] = {
|
|
7050
|
-
migrationName:
|
|
7050
|
+
migrationName: c.name,
|
|
7051
7051
|
direction: "Up",
|
|
7052
7052
|
status: "Error"
|
|
7053
7053
|
}, new Ht({
|
|
7054
|
-
error:
|
|
7054
|
+
error: d,
|
|
7055
7055
|
results: o
|
|
7056
7056
|
});
|
|
7057
7057
|
}
|
|
@@ -7310,56 +7310,56 @@ async function Xu(t) {
|
|
|
7310
7310
|
}
|
|
7311
7311
|
async function Zu(t) {
|
|
7312
7312
|
}
|
|
7313
|
-
const
|
|
7313
|
+
const ec = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7314
7314
|
__proto__: null,
|
|
7315
7315
|
down: Zu,
|
|
7316
7316
|
up: Xu
|
|
7317
7317
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7318
|
-
async function
|
|
7318
|
+
async function tc(t) {
|
|
7319
7319
|
await t.schema.createIndex("users_email_index").on("users").column("email").execute();
|
|
7320
7320
|
}
|
|
7321
|
-
async function
|
|
7321
|
+
async function nc(t) {
|
|
7322
7322
|
await t.schema.dropIndex("users_email_index").execute();
|
|
7323
7323
|
}
|
|
7324
|
-
const
|
|
7324
|
+
const ac = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7325
7325
|
__proto__: null,
|
|
7326
|
-
down:
|
|
7327
|
-
up:
|
|
7326
|
+
down: nc,
|
|
7327
|
+
up: tc
|
|
7328
7328
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7329
|
-
async function
|
|
7329
|
+
async function rc(t) {
|
|
7330
7330
|
await t.schema.alterTable("users").addColumn("profileData", "varchar(2048)").execute();
|
|
7331
7331
|
}
|
|
7332
|
-
async function
|
|
7332
|
+
async function oc(t) {
|
|
7333
7333
|
await t.schema.alterTable("users").dropColumn("profileData").execute();
|
|
7334
7334
|
}
|
|
7335
|
-
const
|
|
7335
|
+
const ic = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7336
7336
|
__proto__: null,
|
|
7337
|
-
down:
|
|
7338
|
-
up:
|
|
7337
|
+
down: oc,
|
|
7338
|
+
up: rc
|
|
7339
7339
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7340
|
-
async function
|
|
7340
|
+
async function sc(t) {
|
|
7341
7341
|
await t.schema.createIndex("users_linked_to_index").on("users").column("linked_to").execute();
|
|
7342
7342
|
}
|
|
7343
|
-
async function
|
|
7343
|
+
async function uc(t) {
|
|
7344
7344
|
await t.schema.dropIndex("users_linked_to_index");
|
|
7345
7345
|
}
|
|
7346
|
-
const
|
|
7346
|
+
const cc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7347
7347
|
__proto__: null,
|
|
7348
|
-
down:
|
|
7349
|
-
up:
|
|
7348
|
+
down: uc,
|
|
7349
|
+
up: sc
|
|
7350
7350
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7351
|
-
async function
|
|
7351
|
+
async function dc(t) {
|
|
7352
7352
|
await t.schema.alterTable("users").addColumn("locale", "varchar(255)").execute();
|
|
7353
7353
|
}
|
|
7354
|
-
async function
|
|
7354
|
+
async function lc(t) {
|
|
7355
7355
|
await t.schema.alterTable("users").dropColumn("locale").execute();
|
|
7356
7356
|
}
|
|
7357
|
-
const
|
|
7357
|
+
const _c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7358
7358
|
__proto__: null,
|
|
7359
|
-
down:
|
|
7360
|
-
up:
|
|
7359
|
+
down: lc,
|
|
7360
|
+
up: dc
|
|
7361
7361
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7362
|
-
async function
|
|
7362
|
+
async function mc(t) {
|
|
7363
7363
|
await t.schema.createTable("keys").addColumn("kid", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
7364
7364
|
"tenant_id",
|
|
7365
7365
|
"varchar(255)",
|
|
@@ -7374,202 +7374,202 @@ async function md(t) {
|
|
|
7374
7374
|
(e) => e.references("connections.id").onDelete("cascade")
|
|
7375
7375
|
).execute();
|
|
7376
7376
|
}
|
|
7377
|
-
async function
|
|
7377
|
+
async function hc(t) {
|
|
7378
7378
|
await t.schema.dropTable("keys").execute();
|
|
7379
7379
|
}
|
|
7380
|
-
const
|
|
7380
|
+
const fc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7381
7381
|
__proto__: null,
|
|
7382
|
-
down:
|
|
7383
|
-
up:
|
|
7382
|
+
down: hc,
|
|
7383
|
+
up: mc
|
|
7384
7384
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7385
|
-
async function
|
|
7385
|
+
async function pc(t) {
|
|
7386
7386
|
}
|
|
7387
|
-
async function
|
|
7387
|
+
async function gc(t) {
|
|
7388
7388
|
}
|
|
7389
|
-
const
|
|
7389
|
+
const wc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7390
7390
|
__proto__: null,
|
|
7391
|
-
down:
|
|
7392
|
-
up:
|
|
7391
|
+
down: gc,
|
|
7392
|
+
up: pc
|
|
7393
7393
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7394
|
-
async function
|
|
7394
|
+
async function yc(t) {
|
|
7395
7395
|
}
|
|
7396
|
-
async function
|
|
7396
|
+
async function Nc(t) {
|
|
7397
7397
|
}
|
|
7398
|
-
const
|
|
7398
|
+
const vc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7399
7399
|
__proto__: null,
|
|
7400
|
-
down:
|
|
7401
|
-
up:
|
|
7400
|
+
down: Nc,
|
|
7401
|
+
up: yc
|
|
7402
7402
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7403
|
-
async function
|
|
7403
|
+
async function Cc(t) {
|
|
7404
7404
|
await t.schema.alterTable("otps").addColumn("audience", "varchar(255)").execute();
|
|
7405
7405
|
}
|
|
7406
|
-
async function
|
|
7406
|
+
async function xc(t) {
|
|
7407
7407
|
await t.schema.alterTable("otps").dropColumn("audience").execute();
|
|
7408
7408
|
}
|
|
7409
|
-
const
|
|
7409
|
+
const bc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7410
7410
|
__proto__: null,
|
|
7411
|
-
down:
|
|
7412
|
-
up:
|
|
7411
|
+
down: xc,
|
|
7412
|
+
up: Cc
|
|
7413
7413
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7414
|
-
async function
|
|
7414
|
+
async function Tc(t) {
|
|
7415
7415
|
}
|
|
7416
|
-
async function
|
|
7416
|
+
async function Oc(t) {
|
|
7417
7417
|
}
|
|
7418
|
-
const
|
|
7418
|
+
const Sc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7419
7419
|
__proto__: null,
|
|
7420
|
-
down:
|
|
7421
|
-
up:
|
|
7420
|
+
down: Oc,
|
|
7421
|
+
up: Tc
|
|
7422
7422
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7423
|
-
async function
|
|
7423
|
+
async function kc(t) {
|
|
7424
7424
|
await t.schema.alterTable("logs").dropColumn("category").execute();
|
|
7425
7425
|
}
|
|
7426
|
-
async function
|
|
7426
|
+
async function Ic(t) {
|
|
7427
7427
|
await t.schema.alterTable("logs").addColumn("category", "varchar(255)", (e) => e.notNull()).execute();
|
|
7428
7428
|
}
|
|
7429
|
-
const
|
|
7429
|
+
const Ec = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7430
7430
|
__proto__: null,
|
|
7431
|
-
down:
|
|
7432
|
-
up:
|
|
7431
|
+
down: Ic,
|
|
7432
|
+
up: kc
|
|
7433
7433
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7434
|
-
async function
|
|
7434
|
+
async function Ac(t) {
|
|
7435
7435
|
await t.schema.alterTable("users").dropColumn("tags").execute();
|
|
7436
7436
|
}
|
|
7437
|
-
async function $
|
|
7437
|
+
async function $c(t) {
|
|
7438
7438
|
await t.schema.alterTable("users").addColumn("tags", "varchar(255)").execute();
|
|
7439
7439
|
}
|
|
7440
|
-
const
|
|
7440
|
+
const Pc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7441
7441
|
__proto__: null,
|
|
7442
|
-
down: $
|
|
7443
|
-
up:
|
|
7442
|
+
down: $c,
|
|
7443
|
+
up: Ac
|
|
7444
7444
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7445
|
-
async function
|
|
7445
|
+
async function Dc(t) {
|
|
7446
7446
|
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();
|
|
7447
7447
|
}
|
|
7448
|
-
async function
|
|
7448
|
+
async function zc(t) {
|
|
7449
7449
|
await t.schema.dropIndex("logs_user_id"), await t.schema.dropIndex("logs_tenant_id"), await t.schema.dropIndex("logs_date");
|
|
7450
7450
|
}
|
|
7451
|
-
const
|
|
7451
|
+
const Rc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7452
7452
|
__proto__: null,
|
|
7453
|
-
down:
|
|
7454
|
-
up:
|
|
7453
|
+
down: zc,
|
|
7454
|
+
up: Dc
|
|
7455
7455
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7456
|
-
async function
|
|
7456
|
+
async function Fc(t) {
|
|
7457
7457
|
await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(8192)").execute();
|
|
7458
7458
|
}
|
|
7459
|
-
async function
|
|
7459
|
+
async function jc(t) {
|
|
7460
7460
|
await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(2048)").execute();
|
|
7461
7461
|
}
|
|
7462
|
-
const
|
|
7462
|
+
const Lc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7463
7463
|
__proto__: null,
|
|
7464
|
-
down:
|
|
7465
|
-
up:
|
|
7464
|
+
down: jc,
|
|
7465
|
+
up: Fc
|
|
7466
7466
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7467
|
-
async function
|
|
7467
|
+
async function Mc(t) {
|
|
7468
7468
|
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();
|
|
7469
7469
|
}
|
|
7470
|
-
async function
|
|
7470
|
+
async function Jc(t) {
|
|
7471
7471
|
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();
|
|
7472
7472
|
}
|
|
7473
|
-
const
|
|
7473
|
+
const qc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7474
7474
|
__proto__: null,
|
|
7475
|
-
down:
|
|
7476
|
-
up:
|
|
7475
|
+
down: Jc,
|
|
7476
|
+
up: Mc
|
|
7477
7477
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7478
|
-
async function
|
|
7478
|
+
async function Bc(t) {
|
|
7479
7479
|
await t.schema.createIndex("users_name_index").on("users").column("name").execute();
|
|
7480
7480
|
}
|
|
7481
|
-
async function
|
|
7481
|
+
async function Wc(t) {
|
|
7482
7482
|
await t.schema.dropIndex("users_name_index").execute();
|
|
7483
7483
|
}
|
|
7484
|
-
const
|
|
7484
|
+
const Kc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7485
7485
|
__proto__: null,
|
|
7486
|
-
down:
|
|
7487
|
-
up:
|
|
7486
|
+
down: Wc,
|
|
7487
|
+
up: Bc
|
|
7488
7488
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7489
|
-
async function
|
|
7489
|
+
async function Uc(t) {
|
|
7490
7490
|
}
|
|
7491
|
-
async function
|
|
7491
|
+
async function Qc(t) {
|
|
7492
7492
|
await t.schema.alterTable("users").dropConstraint("unique_email_provider").execute();
|
|
7493
7493
|
}
|
|
7494
|
-
const
|
|
7494
|
+
const Vc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7495
7495
|
__proto__: null,
|
|
7496
|
-
down:
|
|
7497
|
-
up:
|
|
7496
|
+
down: Qc,
|
|
7497
|
+
up: Uc
|
|
7498
7498
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7499
|
-
async function
|
|
7499
|
+
async function Gc(t) {
|
|
7500
7500
|
await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(8192)").execute();
|
|
7501
7501
|
}
|
|
7502
|
-
async function
|
|
7502
|
+
async function Yc(t) {
|
|
7503
7503
|
await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(1024)").execute();
|
|
7504
7504
|
}
|
|
7505
|
-
const
|
|
7505
|
+
const Hc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7506
7506
|
__proto__: null,
|
|
7507
|
-
down:
|
|
7508
|
-
up:
|
|
7507
|
+
down: Yc,
|
|
7508
|
+
up: Gc
|
|
7509
7509
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7510
|
-
async function
|
|
7510
|
+
async function Xc(t) {
|
|
7511
7511
|
await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(8192)").execute();
|
|
7512
7512
|
}
|
|
7513
|
-
async function
|
|
7513
|
+
async function Zc(t) {
|
|
7514
7514
|
await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(1024)").execute();
|
|
7515
7515
|
}
|
|
7516
|
-
const
|
|
7516
|
+
const ed = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7517
7517
|
__proto__: null,
|
|
7518
|
-
down:
|
|
7519
|
-
up:
|
|
7518
|
+
down: Zc,
|
|
7519
|
+
up: Xc
|
|
7520
7520
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7521
|
-
async function
|
|
7521
|
+
async function td(t) {
|
|
7522
7522
|
await t.schema.createTable("branding").addColumn(
|
|
7523
7523
|
"tenant_id",
|
|
7524
7524
|
"varchar(255)",
|
|
7525
7525
|
(e) => e.references("tenants.id").onDelete("cascade").notNull().primaryKey()
|
|
7526
7526
|
).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();
|
|
7527
7527
|
}
|
|
7528
|
-
async function
|
|
7528
|
+
async function nd(t) {
|
|
7529
7529
|
await t.schema.dropTable("branding").execute();
|
|
7530
7530
|
}
|
|
7531
|
-
const
|
|
7531
|
+
const ad = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7532
7532
|
__proto__: null,
|
|
7533
|
-
down:
|
|
7534
|
-
up:
|
|
7533
|
+
down: nd,
|
|
7534
|
+
up: td
|
|
7535
7535
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7536
|
-
async function
|
|
7536
|
+
async function rd(t) {
|
|
7537
7537
|
}
|
|
7538
|
-
async function
|
|
7538
|
+
async function od(t) {
|
|
7539
7539
|
}
|
|
7540
|
-
const
|
|
7540
|
+
const id = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7541
7541
|
__proto__: null,
|
|
7542
|
-
down:
|
|
7543
|
-
up:
|
|
7542
|
+
down: od,
|
|
7543
|
+
up: rd
|
|
7544
7544
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7545
|
-
async function
|
|
7545
|
+
async function sd(t) {
|
|
7546
7546
|
}
|
|
7547
|
-
async function
|
|
7547
|
+
async function ud(t) {
|
|
7548
7548
|
}
|
|
7549
|
-
const
|
|
7549
|
+
const cd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7550
7550
|
__proto__: null,
|
|
7551
|
-
down:
|
|
7552
|
-
up:
|
|
7551
|
+
down: ud,
|
|
7552
|
+
up: sd
|
|
7553
7553
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7554
|
-
async function
|
|
7554
|
+
async function dd(t) {
|
|
7555
7555
|
}
|
|
7556
|
-
async function
|
|
7556
|
+
async function ld(t) {
|
|
7557
7557
|
}
|
|
7558
|
-
const
|
|
7558
|
+
const _d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7559
7559
|
__proto__: null,
|
|
7560
|
-
down:
|
|
7561
|
-
up:
|
|
7560
|
+
down: ld,
|
|
7561
|
+
up: dd
|
|
7562
7562
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7563
|
-
async function
|
|
7563
|
+
async function md(t) {
|
|
7564
7564
|
}
|
|
7565
|
-
async function
|
|
7565
|
+
async function hd(t) {
|
|
7566
7566
|
}
|
|
7567
|
-
const
|
|
7567
|
+
const fd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7568
7568
|
__proto__: null,
|
|
7569
|
-
down:
|
|
7570
|
-
up:
|
|
7569
|
+
down: hd,
|
|
7570
|
+
up: md
|
|
7571
7571
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7572
|
-
async function
|
|
7572
|
+
async function pd(t) {
|
|
7573
7573
|
await t.schema.createTable("authentication_codes").addColumn(
|
|
7574
7574
|
"tenant_id",
|
|
7575
7575
|
"varchar(255)",
|
|
@@ -7580,55 +7580,55 @@ async function pc(t) {
|
|
|
7580
7580
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
7581
7581
|
).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();
|
|
7582
7582
|
}
|
|
7583
|
-
async function
|
|
7583
|
+
async function gd(t) {
|
|
7584
7584
|
await t.schema.dropTable("authentication_codes").execute();
|
|
7585
7585
|
}
|
|
7586
|
-
const
|
|
7586
|
+
const wd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7587
7587
|
__proto__: null,
|
|
7588
|
-
down:
|
|
7589
|
-
up:
|
|
7588
|
+
down: gd,
|
|
7589
|
+
up: pd
|
|
7590
7590
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7591
|
-
async function
|
|
7591
|
+
async function yd(t) {
|
|
7592
7592
|
}
|
|
7593
|
-
async function
|
|
7593
|
+
async function Nd(t) {
|
|
7594
7594
|
}
|
|
7595
|
-
const
|
|
7595
|
+
const vd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7596
7596
|
__proto__: null,
|
|
7597
|
-
down:
|
|
7598
|
-
up:
|
|
7597
|
+
down: Nd,
|
|
7598
|
+
up: yd
|
|
7599
7599
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7600
|
-
async function
|
|
7600
|
+
async function Cd(t) {
|
|
7601
7601
|
await t.schema.alterTable("otps").addColumn("ip", "varchar(64)").execute();
|
|
7602
7602
|
}
|
|
7603
|
-
async function
|
|
7603
|
+
async function xd(t) {
|
|
7604
7604
|
await t.schema.alterTable("otps").dropColumn("ip").execute();
|
|
7605
7605
|
}
|
|
7606
|
-
const
|
|
7606
|
+
const bd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7607
7607
|
__proto__: null,
|
|
7608
|
-
down:
|
|
7609
|
-
up:
|
|
7608
|
+
down: xd,
|
|
7609
|
+
up: Cd
|
|
7610
7610
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7611
|
-
async function
|
|
7611
|
+
async function Td(t) {
|
|
7612
7612
|
await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(1024)").execute();
|
|
7613
7613
|
}
|
|
7614
|
-
async function
|
|
7614
|
+
async function Od(t) {
|
|
7615
7615
|
await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(255)").execute();
|
|
7616
7616
|
}
|
|
7617
|
-
const
|
|
7617
|
+
const Sd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7618
7618
|
__proto__: null,
|
|
7619
|
-
down:
|
|
7620
|
-
up:
|
|
7619
|
+
down: Od,
|
|
7620
|
+
up: Td
|
|
7621
7621
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7622
|
-
async function
|
|
7622
|
+
async function kd(t) {
|
|
7623
7623
|
}
|
|
7624
|
-
async function
|
|
7624
|
+
async function Id(t) {
|
|
7625
7625
|
}
|
|
7626
|
-
const
|
|
7626
|
+
const Ed = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7627
7627
|
__proto__: null,
|
|
7628
|
-
down:
|
|
7629
|
-
up:
|
|
7628
|
+
down: Id,
|
|
7629
|
+
up: kd
|
|
7630
7630
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7631
|
-
async function
|
|
7631
|
+
async function Ad(t) {
|
|
7632
7632
|
await t.schema.createTable("hooks").addColumn("hook_id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
|
|
7633
7633
|
"tenant_id",
|
|
7634
7634
|
"varchar(255)",
|
|
@@ -7639,33 +7639,33 @@ async function Ac(t) {
|
|
|
7639
7639
|
(e) => e.defaultTo(!1).notNull()
|
|
7640
7640
|
).addColumn("priority", "integer").execute();
|
|
7641
7641
|
}
|
|
7642
|
-
async function $
|
|
7642
|
+
async function $d(t) {
|
|
7643
7643
|
await t.schema.dropTable("hooks").execute();
|
|
7644
7644
|
}
|
|
7645
|
-
const
|
|
7645
|
+
const Pd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7646
7646
|
__proto__: null,
|
|
7647
|
-
down: $
|
|
7648
|
-
up:
|
|
7647
|
+
down: $d,
|
|
7648
|
+
up: Ad
|
|
7649
7649
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7650
|
-
async function
|
|
7650
|
+
async function Dd(t) {
|
|
7651
7651
|
}
|
|
7652
|
-
async function
|
|
7652
|
+
async function zd(t) {
|
|
7653
7653
|
}
|
|
7654
|
-
const
|
|
7654
|
+
const Rd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7655
7655
|
__proto__: null,
|
|
7656
|
-
down:
|
|
7657
|
-
up:
|
|
7656
|
+
down: zd,
|
|
7657
|
+
up: Dd
|
|
7658
7658
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7659
|
-
async function
|
|
7659
|
+
async function Fd(t) {
|
|
7660
7660
|
}
|
|
7661
|
-
async function
|
|
7661
|
+
async function jd(t) {
|
|
7662
7662
|
}
|
|
7663
|
-
const
|
|
7663
|
+
const Ld = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7664
7664
|
__proto__: null,
|
|
7665
|
-
down:
|
|
7666
|
-
up:
|
|
7665
|
+
down: jd,
|
|
7666
|
+
up: Fd
|
|
7667
7667
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7668
|
-
async function
|
|
7668
|
+
async function Md(t) {
|
|
7669
7669
|
await t.schema.createTable("logins").addColumn("login_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
7670
7670
|
"tenant_id",
|
|
7671
7671
|
"varchar(255)",
|
|
@@ -7682,7 +7682,7 @@ async function Mc(t) {
|
|
|
7682
7682
|
(e) => e.onDelete("cascade")
|
|
7683
7683
|
).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();
|
|
7684
7684
|
}
|
|
7685
|
-
async function
|
|
7685
|
+
async function Jd(t) {
|
|
7686
7686
|
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(
|
|
7687
7687
|
"codes_user_id_tenant_id_constraint",
|
|
7688
7688
|
["user_id", "tenant_id"],
|
|
@@ -7691,50 +7691,50 @@ async function Jc(t) {
|
|
|
7691
7691
|
(e) => e.onDelete("cascade")
|
|
7692
7692
|
).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();
|
|
7693
7693
|
}
|
|
7694
|
-
const
|
|
7694
|
+
const qd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7695
7695
|
__proto__: null,
|
|
7696
|
-
down:
|
|
7697
|
-
up:
|
|
7696
|
+
down: Jd,
|
|
7697
|
+
up: Md
|
|
7698
7698
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7699
|
-
async function
|
|
7699
|
+
async function Bd(t) {
|
|
7700
7700
|
}
|
|
7701
|
-
async function
|
|
7701
|
+
async function Wd(t) {
|
|
7702
7702
|
}
|
|
7703
|
-
const
|
|
7703
|
+
const Kd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7704
7704
|
__proto__: null,
|
|
7705
|
-
down:
|
|
7706
|
-
up:
|
|
7705
|
+
down: Wd,
|
|
7706
|
+
up: Bd
|
|
7707
7707
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7708
|
-
async function
|
|
7708
|
+
async function Ud(t) {
|
|
7709
7709
|
await t.schema.alterTable("logins").addColumn("auth0Client", "varchar(256)").execute();
|
|
7710
7710
|
}
|
|
7711
|
-
async function
|
|
7711
|
+
async function Qd(t) {
|
|
7712
7712
|
await t.schema.alterTable("logins").dropColumn("auth0Client").execute();
|
|
7713
7713
|
}
|
|
7714
|
-
const
|
|
7714
|
+
const Vd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7715
7715
|
__proto__: null,
|
|
7716
|
-
down:
|
|
7717
|
-
up:
|
|
7716
|
+
down: Qd,
|
|
7717
|
+
up: Ud
|
|
7718
7718
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7719
|
-
async function
|
|
7719
|
+
async function Gd(t) {
|
|
7720
7720
|
await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(8192)").execute();
|
|
7721
7721
|
}
|
|
7722
|
-
async function
|
|
7722
|
+
async function Yd(t) {
|
|
7723
7723
|
await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(511)").execute();
|
|
7724
7724
|
}
|
|
7725
|
-
const
|
|
7725
|
+
const Hd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7726
7726
|
__proto__: null,
|
|
7727
|
-
down:
|
|
7728
|
-
up:
|
|
7727
|
+
down: Yd,
|
|
7728
|
+
up: Gd
|
|
7729
7729
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7730
|
-
async function
|
|
7730
|
+
async function Xd(t) {
|
|
7731
7731
|
}
|
|
7732
|
-
async function
|
|
7732
|
+
async function Zd(t) {
|
|
7733
7733
|
}
|
|
7734
7734
|
const el = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7735
7735
|
__proto__: null,
|
|
7736
|
-
down:
|
|
7737
|
-
up:
|
|
7736
|
+
down: Zd,
|
|
7737
|
+
up: Xd
|
|
7738
7738
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7739
7739
|
async function tl(t) {
|
|
7740
7740
|
}
|
|
@@ -7760,19 +7760,19 @@ async function sl(t) {
|
|
|
7760
7760
|
}
|
|
7761
7761
|
async function ul(t) {
|
|
7762
7762
|
}
|
|
7763
|
-
const
|
|
7763
|
+
const cl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7764
7764
|
__proto__: null,
|
|
7765
7765
|
down: ul,
|
|
7766
7766
|
up: sl
|
|
7767
7767
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7768
|
-
async function
|
|
7768
|
+
async function dl(t) {
|
|
7769
7769
|
}
|
|
7770
7770
|
async function ll(t) {
|
|
7771
7771
|
}
|
|
7772
7772
|
const _l = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7773
7773
|
__proto__: null,
|
|
7774
7774
|
down: ll,
|
|
7775
|
-
up:
|
|
7775
|
+
up: dl
|
|
7776
7776
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7777
7777
|
async function ml(t) {
|
|
7778
7778
|
await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.notNull()).addColumn(
|
|
@@ -8026,19 +8026,19 @@ async function s_(t) {
|
|
|
8026
8026
|
async function u_(t) {
|
|
8027
8027
|
await t.schema.dropTable("refresh_tokens").execute();
|
|
8028
8028
|
}
|
|
8029
|
-
const
|
|
8029
|
+
const c_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8030
8030
|
__proto__: null,
|
|
8031
8031
|
down: u_,
|
|
8032
8032
|
up: s_
|
|
8033
8033
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
8034
|
-
async function
|
|
8034
|
+
async function d_(t) {
|
|
8035
8035
|
}
|
|
8036
8036
|
async function l_(t) {
|
|
8037
8037
|
}
|
|
8038
8038
|
const __ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8039
8039
|
__proto__: null,
|
|
8040
8040
|
down: l_,
|
|
8041
|
-
up:
|
|
8041
|
+
up: d_
|
|
8042
8042
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
8043
8043
|
async function m_(t) {
|
|
8044
8044
|
await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("refresh_tokens").execute();
|
|
@@ -8300,12 +8300,12 @@ async function sm(t) {
|
|
|
8300
8300
|
async function um(t) {
|
|
8301
8301
|
await t.schema.alterTable("codes").dropColumn("redirect_uri").execute();
|
|
8302
8302
|
}
|
|
8303
|
-
const
|
|
8303
|
+
const cm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8304
8304
|
__proto__: null,
|
|
8305
8305
|
down: um,
|
|
8306
8306
|
up: sm
|
|
8307
8307
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
8308
|
-
async function
|
|
8308
|
+
async function dm(t) {
|
|
8309
8309
|
await t.schema.alterTable("codes").addColumn("nonce", "varchar(1024)").execute(), await t.schema.alterTable("codes").addColumn("state", "varchar(2048)").execute();
|
|
8310
8310
|
}
|
|
8311
8311
|
async function lm(t) {
|
|
@@ -8314,7 +8314,7 @@ async function lm(t) {
|
|
|
8314
8314
|
const _m = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8315
8315
|
__proto__: null,
|
|
8316
8316
|
down: lm,
|
|
8317
|
-
up:
|
|
8317
|
+
up: dm
|
|
8318
8318
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
8319
8319
|
async function mm(t) {
|
|
8320
8320
|
await t.schema.createTable("themes").addColumn(
|
|
@@ -8615,10 +8615,10 @@ async function Jm(t) {
|
|
|
8615
8615
|
), console.log(
|
|
8616
8616
|
`Dropped foreign key constraint ${o} from ${u}`
|
|
8617
8617
|
);
|
|
8618
|
-
} catch (
|
|
8618
|
+
} catch (c) {
|
|
8619
8619
|
console.warn(
|
|
8620
8620
|
`Failed to drop constraint ${o} from ${u}:`,
|
|
8621
|
-
|
|
8621
|
+
c
|
|
8622
8622
|
);
|
|
8623
8623
|
}
|
|
8624
8624
|
}
|
|
@@ -8875,12 +8875,12 @@ const sh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8875
8875
|
async function uh(t) {
|
|
8876
8876
|
await t.schema.dropIndex("idx_user_organizations_tenant_id").execute();
|
|
8877
8877
|
}
|
|
8878
|
-
async function
|
|
8878
|
+
async function ch(t) {
|
|
8879
8879
|
await t.schema.createIndex("idx_user_organizations_tenant_id").on("user_organizations").column("tenant_id").execute();
|
|
8880
8880
|
}
|
|
8881
|
-
const
|
|
8881
|
+
const dh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8882
8882
|
__proto__: null,
|
|
8883
|
-
down:
|
|
8883
|
+
down: ch,
|
|
8884
8884
|
up: uh
|
|
8885
8885
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
8886
8886
|
async function lh(t) {
|
|
@@ -9121,6 +9121,17 @@ const kh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
9121
9121
|
__proto__: null,
|
|
9122
9122
|
down: Sh,
|
|
9123
9123
|
up: Oh
|
|
9124
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
9125
|
+
async function Ih(t) {
|
|
9126
|
+
await t.schema.alterTable("connections").addColumn("display_name", "varchar(255)").execute(), await t.schema.alterTable("connections").addColumn("is_domain_connection", "integer").execute(), await t.schema.alterTable("connections").addColumn("show_as_button", "integer").execute(), await t.schema.alterTable("connections").addColumn("metadata", "varchar(4096)").execute();
|
|
9127
|
+
}
|
|
9128
|
+
async function Eh(t) {
|
|
9129
|
+
await t.schema.alterTable("connections").dropColumn("display_name").execute(), await t.schema.alterTable("connections").dropColumn("is_domain_connection").execute(), await t.schema.alterTable("connections").dropColumn("show_as_button").execute(), await t.schema.alterTable("connections").dropColumn("metadata").execute();
|
|
9130
|
+
}
|
|
9131
|
+
const Ah = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9132
|
+
__proto__: null,
|
|
9133
|
+
down: Eh,
|
|
9134
|
+
up: Ih
|
|
9124
9135
|
}, Symbol.toStringTag, { value: "Module" })), Ja = {
|
|
9125
9136
|
m1_init: vu,
|
|
9126
9137
|
m2_magicLink: bu,
|
|
@@ -9133,46 +9144,46 @@ const kh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
9133
9144
|
m9_passwordTableNewField: Ku,
|
|
9134
9145
|
n01_codesTable: Vu,
|
|
9135
9146
|
n11_universalLoginSession: Hu,
|
|
9136
|
-
n12_userFields:
|
|
9137
|
-
n13_userEmailIndex:
|
|
9138
|
-
n14_profileDataField:
|
|
9139
|
-
n15_userEmailIndex:
|
|
9140
|
-
n16_userLocale:
|
|
9141
|
-
n17_signingKeys:
|
|
9142
|
-
n18_logsFields:
|
|
9143
|
-
n19_connectionsUserinfo:
|
|
9144
|
-
n20_missingFields:
|
|
9145
|
-
n21_sessionDeletedAt:
|
|
9146
|
-
n22_dropLogsFields:
|
|
9147
|
-
n23_dropUsersFields:
|
|
9148
|
-
n24_logsIndexes:
|
|
9149
|
-
n25_logDescMaxLength:
|
|
9150
|
-
n26_logsTableExtraFields:
|
|
9151
|
-
n27_usersTableNameIndex:
|
|
9152
|
-
n28_usersEmailConstrain:
|
|
9153
|
-
n29_increaseOtpStateLength:
|
|
9154
|
-
n30_increaseTicketStateLength:
|
|
9155
|
-
n31_branding:
|
|
9156
|
-
n32_indexesAndNotNull:
|
|
9157
|
-
n33_vendorIdInUniversalLoginSession:
|
|
9158
|
-
n34_auth0ClientInUniversalLoginSession:
|
|
9159
|
-
n35_increaseUniversalSessionStateLength:
|
|
9160
|
-
n36_authenticationCodes:
|
|
9161
|
-
n37_disableSignUps:
|
|
9162
|
-
n38_otpIpAddress:
|
|
9163
|
-
n39_increaseUserAgentLength:
|
|
9164
|
-
n40_userId:
|
|
9165
|
-
n41_hooks:
|
|
9166
|
-
n42_userIdIndexes:
|
|
9167
|
-
n43_userIdIndexes:
|
|
9168
|
-
n44_codes:
|
|
9169
|
-
n45_hookProperties:
|
|
9170
|
-
n46_loginAuth0Client:
|
|
9171
|
-
n47_loginAuth0Client:
|
|
9147
|
+
n12_userFields: ec,
|
|
9148
|
+
n13_userEmailIndex: ac,
|
|
9149
|
+
n14_profileDataField: ic,
|
|
9150
|
+
n15_userEmailIndex: cc,
|
|
9151
|
+
n16_userLocale: _c,
|
|
9152
|
+
n17_signingKeys: fc,
|
|
9153
|
+
n18_logsFields: wc,
|
|
9154
|
+
n19_connectionsUserinfo: vc,
|
|
9155
|
+
n20_missingFields: bc,
|
|
9156
|
+
n21_sessionDeletedAt: Sc,
|
|
9157
|
+
n22_dropLogsFields: Ec,
|
|
9158
|
+
n23_dropUsersFields: Pc,
|
|
9159
|
+
n24_logsIndexes: Rc,
|
|
9160
|
+
n25_logDescMaxLength: Lc,
|
|
9161
|
+
n26_logsTableExtraFields: qc,
|
|
9162
|
+
n27_usersTableNameIndex: Kc,
|
|
9163
|
+
n28_usersEmailConstrain: Vc,
|
|
9164
|
+
n29_increaseOtpStateLength: Hc,
|
|
9165
|
+
n30_increaseTicketStateLength: ed,
|
|
9166
|
+
n31_branding: ad,
|
|
9167
|
+
n32_indexesAndNotNull: id,
|
|
9168
|
+
n33_vendorIdInUniversalLoginSession: cd,
|
|
9169
|
+
n34_auth0ClientInUniversalLoginSession: _d,
|
|
9170
|
+
n35_increaseUniversalSessionStateLength: fd,
|
|
9171
|
+
n36_authenticationCodes: wd,
|
|
9172
|
+
n37_disableSignUps: vd,
|
|
9173
|
+
n38_otpIpAddress: bd,
|
|
9174
|
+
n39_increaseUserAgentLength: Sd,
|
|
9175
|
+
n40_userId: Ed,
|
|
9176
|
+
n41_hooks: Pd,
|
|
9177
|
+
n42_userIdIndexes: Rd,
|
|
9178
|
+
n43_userIdIndexes: Ld,
|
|
9179
|
+
n44_codes: qd,
|
|
9180
|
+
n45_hookProperties: Kd,
|
|
9181
|
+
n46_loginAuth0Client: Vd,
|
|
9182
|
+
n47_loginAuth0Client: Hd,
|
|
9172
9183
|
n48_saml: el,
|
|
9173
9184
|
n49_removeFields: al,
|
|
9174
9185
|
n50_authParamsNonce: il,
|
|
9175
|
-
n51_connectionid:
|
|
9186
|
+
n51_connectionid: cl,
|
|
9176
9187
|
n52_cert: _l,
|
|
9177
9188
|
n53_codes_primary_key: fl,
|
|
9178
9189
|
n54_cleanup_tables: wl,
|
|
@@ -9190,7 +9201,7 @@ const kh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
9190
9201
|
n66_email_providers: e_,
|
|
9191
9202
|
n67_drop_tickets: a_,
|
|
9192
9203
|
n68_login_useragents: i_,
|
|
9193
|
-
n70_refresh_tokens:
|
|
9204
|
+
n70_refresh_tokens: c_,
|
|
9194
9205
|
n71_session_new_fields: __,
|
|
9195
9206
|
n72_session_primary_key: f_,
|
|
9196
9207
|
n73_drop_sessions: w_,
|
|
@@ -9208,7 +9219,7 @@ const kh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
9208
9219
|
n85_add_login_session_id_to_sessions: em,
|
|
9209
9220
|
n86_index_sessions_login_session_id: am,
|
|
9210
9221
|
n87_code_challenge: im,
|
|
9211
|
-
n88_add_redirect_uri_to_codes:
|
|
9222
|
+
n88_add_redirect_uri_to_codes: cm,
|
|
9212
9223
|
n89_add_nonce_and_state_to_codes: _m,
|
|
9213
9224
|
n90_themes: fm,
|
|
9214
9225
|
n91_resource_servers_rules_permissions: wm,
|
|
@@ -9225,15 +9236,16 @@ const kh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
9225
9236
|
o003_phone_number_index: th,
|
|
9226
9237
|
o004_login_sessions_id_index: rh,
|
|
9227
9238
|
o005_connections_tenant_index: sh,
|
|
9228
|
-
o006_remove_redundant_user_organizations_tenant_index:
|
|
9239
|
+
o006_remove_redundant_user_organizations_tenant_index: dh,
|
|
9229
9240
|
o007_tenant_settings: mh,
|
|
9230
9241
|
o008_merge_tenant_settings_into_tenants: ph,
|
|
9231
9242
|
o009_create_invites_table: yh,
|
|
9232
9243
|
o010_add_log_id_to_logs: Ch,
|
|
9233
9244
|
o011_add_location_info_to_logs: Th,
|
|
9234
|
-
o012_add_password_history: kh
|
|
9245
|
+
o012_add_password_history: kh,
|
|
9246
|
+
o013_connection_display_name: Ah
|
|
9235
9247
|
};
|
|
9236
|
-
async function
|
|
9248
|
+
async function Rh(t, e = !1) {
|
|
9237
9249
|
e && console.log("migrating...");
|
|
9238
9250
|
const n = new La(Ja), a = new ba({
|
|
9239
9251
|
db: t,
|
|
@@ -9246,7 +9258,7 @@ async function Ph(t, e = !1) {
|
|
|
9246
9258
|
}), r)
|
|
9247
9259
|
throw console.error("failed to migrate"), console.error(r), r;
|
|
9248
9260
|
}
|
|
9249
|
-
async function
|
|
9261
|
+
async function Fh(t) {
|
|
9250
9262
|
console.log("migrating...");
|
|
9251
9263
|
const e = new La(Ja), n = new ba({
|
|
9252
9264
|
db: t,
|
|
@@ -9257,7 +9269,7 @@ async function Dh(t) {
|
|
|
9257
9269
|
}), a)
|
|
9258
9270
|
throw console.error("failed to migrate"), console.error(a), a;
|
|
9259
9271
|
}
|
|
9260
|
-
function
|
|
9272
|
+
function jh(t) {
|
|
9261
9273
|
return {
|
|
9262
9274
|
branding: vo(t),
|
|
9263
9275
|
cleanup: Ho(t),
|
|
@@ -9277,7 +9289,7 @@ function zh(t) {
|
|
|
9277
9289
|
passwords: kr(t),
|
|
9278
9290
|
promptSettings: Mo(t),
|
|
9279
9291
|
refreshTokens: Yo(t),
|
|
9280
|
-
resourceServers:
|
|
9292
|
+
resourceServers: ci(t),
|
|
9281
9293
|
rolePermissions: yi(t),
|
|
9282
9294
|
userPermissions: bi(t),
|
|
9283
9295
|
userRoles: Ii(t),
|
|
@@ -9291,7 +9303,7 @@ function zh(t) {
|
|
|
9291
9303
|
};
|
|
9292
9304
|
}
|
|
9293
9305
|
export {
|
|
9294
|
-
|
|
9295
|
-
|
|
9296
|
-
|
|
9306
|
+
jh as default,
|
|
9307
|
+
Fh as migrateDown,
|
|
9308
|
+
Rh as migrateToLatest
|
|
9297
9309
|
};
|