@authhero/kysely-adapter 10.60.0 → 10.62.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 +18 -18
- package/dist/kysely-adapter.d.ts +3 -2
- package/dist/kysely-adapter.mjs +177 -177
- package/package.json +1 -1
package/dist/kysely-adapter.mjs
CHANGED
|
@@ -4,7 +4,7 @@ var Tn = (t) => {
|
|
|
4
4
|
};
|
|
5
5
|
var Ba = (t, e, n) => e in t ? qa(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
6
6
|
var ie = (t, e, n) => Ba(t, typeof e != "symbol" ? e + "" : e, n), Qt = (t, e, n) => e.has(t) || Tn("Cannot " + n);
|
|
7
|
-
var i = (t, e, n) => (Qt(t, e, "read from private field"), n ? n.call(t) : e.get(t)), C = (t, e, n) => e.has(t) ? Tn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), b = (t, e, n, a) => (Qt(t, e, "write to private field"), a ? a.call(t, n) : e.set(t, n), n),
|
|
7
|
+
var i = (t, e, n) => (Qt(t, e, "read from private field"), n ? n.call(t) : e.get(t)), C = (t, e, n) => e.has(t) ? Tn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), b = (t, e, n, a) => (Qt(t, e, "write to private field"), a ? a.call(t, n) : e.set(t, n), n), w = (t, e, n) => (Qt(t, e, "access private method"), n);
|
|
8
8
|
import { parseUserId as pn, codeSchema as Wa, connectionSchema as Ka, loginSessionSchema as Ua, promptSettingSchema as Qa, formSchema as Tt, resourceServerSchema as Va } from "@authhero/adapter-interfaces";
|
|
9
9
|
import "@hono/zod-openapi";
|
|
10
10
|
var et = class extends Error {
|
|
@@ -124,23 +124,23 @@ function J(t, e, n, a) {
|
|
|
124
124
|
h === '"' ? (u = !u, o += h) : h === " " && !u ? o.trim() && (r.push(o.trim()), o = "") : o += h;
|
|
125
125
|
}
|
|
126
126
|
return o.trim() && r.push(o.trim()), r.map((c) => c.replace(/^([^:]+)=/g, "$1:")).map((c) => {
|
|
127
|
-
let h = c.startsWith("-"),
|
|
127
|
+
let h = c.startsWith("-"), g = null, l = "", y = !1, f;
|
|
128
128
|
if (c.startsWith("-_exists_:"))
|
|
129
|
-
|
|
129
|
+
g = c.substring(10), y = !0, h = !0;
|
|
130
130
|
else if (c.startsWith("_exists_:"))
|
|
131
|
-
|
|
131
|
+
g = c.substring(9), y = !0, h = !1;
|
|
132
132
|
else if (c.includes(":")) {
|
|
133
133
|
const v = h ? c.substring(1) : c, 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
|
-
|
|
137
|
-
return { key:
|
|
138
|
-
}).forEach(({ key: c, value: h, isNegation:
|
|
136
|
+
g = null, l = c, y = !1;
|
|
137
|
+
return { key: g, value: l, isNegation: h, isExistsQuery: y, operator: f };
|
|
138
|
+
}).forEach(({ key: c, value: h, isNegation: g, isExistsQuery: l, operator: y }) => {
|
|
139
139
|
if (c)
|
|
140
140
|
if (l)
|
|
141
|
-
|
|
142
|
-
else if (
|
|
143
|
-
switch (
|
|
141
|
+
g ? e = e.where(c, "is", null) : e = e.where(c, "is not", null);
|
|
142
|
+
else if (g)
|
|
143
|
+
switch (y) {
|
|
144
144
|
case ">":
|
|
145
145
|
e = e.where(c, "<=", h);
|
|
146
146
|
break;
|
|
@@ -157,7 +157,7 @@ function J(t, e, n, a) {
|
|
|
157
157
|
e = e.where(c, "!=", h);
|
|
158
158
|
}
|
|
159
159
|
else
|
|
160
|
-
e = e.where(c,
|
|
160
|
+
e = e.where(c, y, h);
|
|
161
161
|
else if (h) {
|
|
162
162
|
const { ref: f } = t.dynamic;
|
|
163
163
|
e = e.where(
|
|
@@ -179,8 +179,8 @@ function Ha(t) {
|
|
|
179
179
|
const { ref: x } = t.dynamic;
|
|
180
180
|
c = c.orderBy(x(u.sort_by), u.sort_order);
|
|
181
181
|
}
|
|
182
|
-
const
|
|
183
|
-
const E =
|
|
182
|
+
const g = await c.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
|
+
const E = y.filter(
|
|
184
184
|
(z) => z.linked_to === x.user_id
|
|
185
185
|
);
|
|
186
186
|
return T({
|
|
@@ -364,17 +364,17 @@ function dr(t) {
|
|
|
364
364
|
d && (n = n.where(
|
|
365
365
|
(f) => f.or([f("friendly_name", "like", `%${d}%`)])
|
|
366
366
|
));
|
|
367
|
-
const
|
|
367
|
+
const g = (await n.offset(a * r).limit(r).selectAll().execute()).map(Hn);
|
|
368
368
|
if (!o)
|
|
369
369
|
return {
|
|
370
|
-
tenants:
|
|
370
|
+
tenants: g
|
|
371
371
|
};
|
|
372
|
-
const { count: l } = await n.select((f) => f.fn.countAll().as("count")).executeTakeFirstOrThrow(),
|
|
372
|
+
const { count: l } = await n.select((f) => f.fn.countAll().as("count")).executeTakeFirstOrThrow(), y = j(l);
|
|
373
373
|
return {
|
|
374
|
-
tenants:
|
|
374
|
+
tenants: g,
|
|
375
375
|
start: a * r,
|
|
376
376
|
limit: r,
|
|
377
|
-
length:
|
|
377
|
+
length: y
|
|
378
378
|
};
|
|
379
379
|
};
|
|
380
380
|
}
|
|
@@ -406,25 +406,25 @@ 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 d, c, h;
|
|
410
|
+
const a = (d = n.user_agent) == null ? void 0 : d.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: (c = n.description) == null ? void 0 : c.substring(0, 256),
|
|
417
417
|
isMobile: n.isMobile ? 1 : 0,
|
|
418
418
|
scope: n.scope,
|
|
419
419
|
auth0_client: On(n.auth0_client),
|
|
420
|
-
details: (
|
|
420
|
+
details: (h = On(n.details)) == null ? void 0 : h.substring(0, 8192),
|
|
421
421
|
// Extract location_info fields for separate columns
|
|
422
|
-
country_code:
|
|
423
|
-
city_name:
|
|
424
|
-
latitude:
|
|
425
|
-
longitude:
|
|
426
|
-
time_zone:
|
|
427
|
-
continent_code:
|
|
422
|
+
country_code: o == null ? void 0 : o.country_code,
|
|
423
|
+
city_name: o == null ? void 0 : o.city_name,
|
|
424
|
+
latitude: o == null ? void 0 : o.latitude,
|
|
425
|
+
longitude: o == null ? void 0 : o.longitude,
|
|
426
|
+
time_zone: o == null ? void 0 : o.time_zone,
|
|
427
|
+
continent_code: o == null ? void 0 : o.continent_code
|
|
428
428
|
}).execute(), {
|
|
429
429
|
...n,
|
|
430
430
|
log_id: r,
|
|
@@ -481,12 +481,12 @@ function fr(t) {
|
|
|
481
481
|
limit: 0,
|
|
482
482
|
length: 0
|
|
483
483
|
};
|
|
484
|
-
const { count:
|
|
484
|
+
const { count: y } = await c.select((f) => f.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
485
485
|
return {
|
|
486
486
|
logs: l,
|
|
487
487
|
start: a * r,
|
|
488
488
|
limit: r,
|
|
489
|
-
length: j(
|
|
489
|
+
length: j(y)
|
|
490
490
|
};
|
|
491
491
|
};
|
|
492
492
|
}
|
|
@@ -570,7 +570,7 @@ function Cr(t) {
|
|
|
570
570
|
limit: 0,
|
|
571
571
|
length: 0
|
|
572
572
|
};
|
|
573
|
-
const { count:
|
|
573
|
+
const { count: y } = await c.select((v) => v.fn.countAll().as("count")).executeTakeFirstOrThrow(), f = j(y);
|
|
574
574
|
return {
|
|
575
575
|
sessions: l,
|
|
576
576
|
start: a * r,
|
|
@@ -649,20 +649,20 @@ function Ir(t) {
|
|
|
649
649
|
const { page: a = 0, per_page: r = 50, include_totals: o = !1, q: u } = n;
|
|
650
650
|
let d = t.selectFrom("codes").where("codes.tenant_id", "=", e);
|
|
651
651
|
u && (d = J(t, d, u, ["code", "login_id"]));
|
|
652
|
-
const
|
|
653
|
-
const { tenant_id: f, ...v } =
|
|
652
|
+
const g = (await d.offset(a * r).limit(r).selectAll().execute()).map((y) => {
|
|
653
|
+
const { tenant_id: f, ...v } = y;
|
|
654
654
|
return Wa.parse(T(v));
|
|
655
655
|
});
|
|
656
656
|
if (!o)
|
|
657
657
|
return {
|
|
658
|
-
codes:
|
|
658
|
+
codes: g,
|
|
659
659
|
start: 0,
|
|
660
660
|
limit: 0,
|
|
661
661
|
length: 0
|
|
662
662
|
};
|
|
663
|
-
const { count: l } = await d.select((
|
|
663
|
+
const { count: l } = await d.select((y) => y.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
664
664
|
return {
|
|
665
|
-
codes:
|
|
665
|
+
codes: g,
|
|
666
666
|
start: a * r,
|
|
667
667
|
limit: r,
|
|
668
668
|
length: j(l)
|
|
@@ -754,22 +754,22 @@ function Br(t) {
|
|
|
754
754
|
const { page: a = 0, per_page: r = 50, include_totals: o = !1, q: u } = n;
|
|
755
755
|
let d = t.selectFrom("connections").where("connections.tenant_id", "=", e);
|
|
756
756
|
u && (d = J(t, d, u, ["user_id", "ip"]));
|
|
757
|
-
const
|
|
758
|
-
(
|
|
759
|
-
...
|
|
760
|
-
options: JSON.parse(
|
|
757
|
+
const g = (await d.offset(a * r).limit(r).selectAll().execute()).map(
|
|
758
|
+
(y) => T({
|
|
759
|
+
...y,
|
|
760
|
+
options: JSON.parse(y.options)
|
|
761
761
|
})
|
|
762
762
|
);
|
|
763
763
|
if (!o)
|
|
764
764
|
return {
|
|
765
|
-
connections:
|
|
765
|
+
connections: g,
|
|
766
766
|
start: 0,
|
|
767
767
|
limit: 0,
|
|
768
768
|
length: 0
|
|
769
769
|
};
|
|
770
|
-
const { count: l } = await d.select((
|
|
770
|
+
const { count: l } = await d.select((y) => y.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
771
771
|
return {
|
|
772
|
-
connections:
|
|
772
|
+
connections: g,
|
|
773
773
|
start: a * r,
|
|
774
774
|
limit: r,
|
|
775
775
|
length: j(l)
|
|
@@ -1119,12 +1119,12 @@ function no(t) {
|
|
|
1119
1119
|
limit: 0,
|
|
1120
1120
|
length: 0
|
|
1121
1121
|
};
|
|
1122
|
-
const { count:
|
|
1122
|
+
const { count: y } = await c.select((f) => f.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1123
1123
|
return {
|
|
1124
1124
|
client_grants: l,
|
|
1125
1125
|
start: a * r,
|
|
1126
1126
|
limit: r,
|
|
1127
|
-
length: j(
|
|
1127
|
+
length: j(y)
|
|
1128
1128
|
};
|
|
1129
1129
|
};
|
|
1130
1130
|
}
|
|
@@ -1233,20 +1233,20 @@ function so(t) {
|
|
|
1233
1233
|
let c = d.select((f) => f.fn.count("kid").as("count"));
|
|
1234
1234
|
const h = n * a;
|
|
1235
1235
|
d = d.limit(a).offset(h), o && (d = d.orderBy(o.sort_by, o.sort_order));
|
|
1236
|
-
const
|
|
1236
|
+
const g = await d.selectAll().execute();
|
|
1237
1237
|
if (!r)
|
|
1238
1238
|
return {
|
|
1239
|
-
signingKeys:
|
|
1239
|
+
signingKeys: g,
|
|
1240
1240
|
start: 0,
|
|
1241
1241
|
limit: 0,
|
|
1242
1242
|
length: 0
|
|
1243
1243
|
};
|
|
1244
|
-
const l = await c.executeTakeFirst(),
|
|
1244
|
+
const l = await c.executeTakeFirst(), y = j((l == null ? void 0 : l.count) ?? 0);
|
|
1245
1245
|
return {
|
|
1246
|
-
signingKeys:
|
|
1246
|
+
signingKeys: g,
|
|
1247
1247
|
start: h,
|
|
1248
1248
|
limit: a,
|
|
1249
|
-
length:
|
|
1249
|
+
length: y
|
|
1250
1250
|
};
|
|
1251
1251
|
};
|
|
1252
1252
|
}
|
|
@@ -1268,7 +1268,7 @@ function lo(t) {
|
|
|
1268
1268
|
function _o(t) {
|
|
1269
1269
|
return async (e, n) => {
|
|
1270
1270
|
const a = {
|
|
1271
|
-
custom_domain_id: U(),
|
|
1271
|
+
custom_domain_id: n.custom_domain_id || U(),
|
|
1272
1272
|
status: "pending",
|
|
1273
1273
|
primary: !1,
|
|
1274
1274
|
...n
|
|
@@ -1342,10 +1342,10 @@ function yo(t) {
|
|
|
1342
1342
|
colors_page_background_end: d,
|
|
1343
1343
|
colors_page_background_angle_dev: c,
|
|
1344
1344
|
font_url: h,
|
|
1345
|
-
...
|
|
1345
|
+
...g
|
|
1346
1346
|
} = n;
|
|
1347
1347
|
return T({
|
|
1348
|
-
...
|
|
1348
|
+
...g,
|
|
1349
1349
|
colors: {
|
|
1350
1350
|
primary: r,
|
|
1351
1351
|
page_background: {
|
|
@@ -1361,7 +1361,7 @@ function yo(t) {
|
|
|
1361
1361
|
}
|
|
1362
1362
|
function No(t) {
|
|
1363
1363
|
return async (e, n) => {
|
|
1364
|
-
var u, d, c, h,
|
|
1364
|
+
var u, d, c, 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({
|
|
@@ -1369,8 +1369,8 @@ function No(t) {
|
|
|
1369
1369
|
colors_primary: a == null ? void 0 : a.primary,
|
|
1370
1370
|
colors_page_background_type: (d = (u = n.colors) == null ? void 0 : u.page_background) == null ? void 0 : d.type,
|
|
1371
1371
|
colors_page_background_start: (h = (c = n.colors) == null ? void 0 : c.page_background) == null ? void 0 : h.start,
|
|
1372
|
-
colors_page_background_end: (l = (
|
|
1373
|
-
colors_page_background_angle_dev: (f = (
|
|
1372
|
+
colors_page_background_end: (l = (g = n.colors) == null ? void 0 : g.page_background) == null ? void 0 : l.end,
|
|
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,
|
|
1375
1375
|
tenant_id: e
|
|
1376
1376
|
}).execute();
|
|
@@ -1398,8 +1398,8 @@ function Co(t) {
|
|
|
1398
1398
|
const { page: a = 0, per_page: r = 50, include_totals: o = !1, q: u } = n;
|
|
1399
1399
|
let d = t.selectFrom("hooks").where("hooks.tenant_id", "=", e);
|
|
1400
1400
|
u && (d = J(t, d, u, ["url", "form_id"]));
|
|
1401
|
-
const
|
|
1402
|
-
const { tenant_id: f, enabled: v, synchronous: x, ...E } =
|
|
1401
|
+
const g = (await d.offset(a * r).limit(r).selectAll().execute()).map((y) => {
|
|
1402
|
+
const { tenant_id: f, enabled: v, synchronous: x, ...E } = y;
|
|
1403
1403
|
return T({
|
|
1404
1404
|
...E,
|
|
1405
1405
|
enabled: !!v,
|
|
@@ -1408,14 +1408,14 @@ function Co(t) {
|
|
|
1408
1408
|
});
|
|
1409
1409
|
if (!o)
|
|
1410
1410
|
return {
|
|
1411
|
-
hooks:
|
|
1411
|
+
hooks: g,
|
|
1412
1412
|
start: 0,
|
|
1413
1413
|
limit: 0,
|
|
1414
1414
|
length: 0
|
|
1415
1415
|
};
|
|
1416
|
-
const { count: l } = await d.select((
|
|
1416
|
+
const { count: l } = await d.select((y) => y.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1417
1417
|
return {
|
|
1418
|
-
hooks:
|
|
1418
|
+
hooks: g,
|
|
1419
1419
|
start: a * r,
|
|
1420
1420
|
limit: r,
|
|
1421
1421
|
length: j(l)
|
|
@@ -1735,7 +1735,7 @@ function Go(t) {
|
|
|
1735
1735
|
limit: 0,
|
|
1736
1736
|
length: 0
|
|
1737
1737
|
};
|
|
1738
|
-
const { count:
|
|
1738
|
+
const { count: y } = await c.select((v) => v.fn.countAll().as("count")).executeTakeFirstOrThrow(), f = j(y);
|
|
1739
1739
|
return {
|
|
1740
1740
|
refresh_tokens: l,
|
|
1741
1741
|
start: a * r,
|
|
@@ -1806,8 +1806,8 @@ function Zo(t) {
|
|
|
1806
1806
|
const { page: a = 0, per_page: r = 50, include_totals: o = !1, q: u } = n;
|
|
1807
1807
|
let d = t.selectFrom("forms").where("tenant_id", "=", e);
|
|
1808
1808
|
u && (d = J(t, d, u, []));
|
|
1809
|
-
const
|
|
1810
|
-
const f = { ...
|
|
1809
|
+
const g = (await d.offset(a * r).limit(r).selectAll().execute()).map((y) => {
|
|
1810
|
+
const f = { ...y };
|
|
1811
1811
|
if (typeof f.nodes == "string")
|
|
1812
1812
|
try {
|
|
1813
1813
|
f.nodes = JSON.parse(f.nodes);
|
|
@@ -1827,14 +1827,14 @@ function Zo(t) {
|
|
|
1827
1827
|
});
|
|
1828
1828
|
if (!o)
|
|
1829
1829
|
return {
|
|
1830
|
-
forms:
|
|
1830
|
+
forms: g,
|
|
1831
1831
|
start: 0,
|
|
1832
1832
|
limit: 0,
|
|
1833
1833
|
length: 0
|
|
1834
1834
|
};
|
|
1835
|
-
const { count: l } = await d.select((
|
|
1835
|
+
const { count: l } = await d.select((y) => y.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1836
1836
|
return {
|
|
1837
|
-
forms:
|
|
1837
|
+
forms: g,
|
|
1838
1838
|
start: a * r,
|
|
1839
1839
|
limit: r,
|
|
1840
1840
|
length: j(l)
|
|
@@ -1902,20 +1902,20 @@ function ri(t) {
|
|
|
1902
1902
|
scopes: d,
|
|
1903
1903
|
options: c,
|
|
1904
1904
|
skip_consent_for_verifiable_first_party_clients: h,
|
|
1905
|
-
allow_offline_access:
|
|
1905
|
+
allow_offline_access: g,
|
|
1906
1906
|
...l
|
|
1907
|
-
} = o,
|
|
1907
|
+
} = o, y = {
|
|
1908
1908
|
...l,
|
|
1909
1909
|
tenant_id: e,
|
|
1910
1910
|
scopes: d ? JSON.stringify(d) : "[]",
|
|
1911
1911
|
options: c ? JSON.stringify(c) : "{}",
|
|
1912
1912
|
skip_consent_for_verifiable_first_party_clients: h ? 1 : 0,
|
|
1913
|
-
allow_offline_access:
|
|
1913
|
+
allow_offline_access: g ? 1 : 0,
|
|
1914
1914
|
verification_key: u,
|
|
1915
1915
|
created_at: a,
|
|
1916
1916
|
updated_at: a
|
|
1917
1917
|
};
|
|
1918
|
-
return await t.insertInto("resource_servers").values(
|
|
1918
|
+
return await t.insertInto("resource_servers").values(y).execute(), T(o);
|
|
1919
1919
|
};
|
|
1920
1920
|
}
|
|
1921
1921
|
function oi(t) {
|
|
@@ -1928,9 +1928,9 @@ function oi(t) {
|
|
|
1928
1928
|
options: d,
|
|
1929
1929
|
skip_consent_for_verifiable_first_party_clients: c,
|
|
1930
1930
|
allow_offline_access: h,
|
|
1931
|
-
...
|
|
1931
|
+
...g
|
|
1932
1932
|
} = r, l = {
|
|
1933
|
-
...
|
|
1933
|
+
...g,
|
|
1934
1934
|
scopes: u ? JSON.parse(u) : [],
|
|
1935
1935
|
options: d ? JSON.parse(d) : {},
|
|
1936
1936
|
skip_consent_for_verifiable_first_party_clients: !!c,
|
|
@@ -1946,18 +1946,18 @@ function ii(t) {
|
|
|
1946
1946
|
const { page: a = 0, per_page: r = 50, include_totals: o = !1, q: u } = n;
|
|
1947
1947
|
let d = t.selectFrom("resource_servers").where("resource_servers.tenant_id", "=", e);
|
|
1948
1948
|
if (u) {
|
|
1949
|
-
const
|
|
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
|
d = oe ? d.where(Q, "not like", `%${E}%`) : d.where(Q, "like", `%${E}%`);
|
|
1953
1953
|
} else
|
|
1954
|
-
d = J(t, d,
|
|
1954
|
+
d = J(t, d, y, [
|
|
1955
1955
|
"resource_servers.name",
|
|
1956
1956
|
"resource_servers.identifier"
|
|
1957
1957
|
]);
|
|
1958
1958
|
}
|
|
1959
|
-
const
|
|
1960
|
-
const f =
|
|
1959
|
+
const g = (await d.offset(a * r).limit(r).selectAll().execute()).map((y) => {
|
|
1960
|
+
const f = y, {
|
|
1961
1961
|
verification_key: v,
|
|
1962
1962
|
scopes: x,
|
|
1963
1963
|
options: E,
|
|
@@ -1977,14 +1977,14 @@ function ii(t) {
|
|
|
1977
1977
|
});
|
|
1978
1978
|
if (!o)
|
|
1979
1979
|
return {
|
|
1980
|
-
resource_servers:
|
|
1980
|
+
resource_servers: g,
|
|
1981
1981
|
start: 0,
|
|
1982
1982
|
limit: 0,
|
|
1983
1983
|
length: 0
|
|
1984
1984
|
};
|
|
1985
|
-
const { count: l } = await d.select((
|
|
1985
|
+
const { count: l } = await d.select((y) => y.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1986
1986
|
return {
|
|
1987
|
-
resource_servers:
|
|
1987
|
+
resource_servers: g,
|
|
1988
1988
|
start: a * r,
|
|
1989
1989
|
limit: r,
|
|
1990
1990
|
length: j(l)
|
|
@@ -2006,16 +2006,16 @@ function ui(t) {
|
|
|
2006
2006
|
skip_consent_for_verifiable_first_party_clients: d,
|
|
2007
2007
|
allow_offline_access: c,
|
|
2008
2008
|
...h
|
|
2009
|
-
} = a,
|
|
2009
|
+
} = a, g = {
|
|
2010
2010
|
...h,
|
|
2011
2011
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
2012
2012
|
};
|
|
2013
|
-
if (r !== void 0 && (
|
|
2014
|
-
const
|
|
2015
|
-
|
|
2013
|
+
if (r !== void 0 && (g.verification_key = r), o !== void 0 && (g.scopes = JSON.stringify(o)), u !== void 0) {
|
|
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
|
+
g.options = JSON.stringify(v);
|
|
2016
2016
|
}
|
|
2017
|
-
d !== void 0 && (
|
|
2018
|
-
const l = await t.updateTable("resource_servers").set(
|
|
2017
|
+
d !== void 0 && (g.skip_consent_for_verifiable_first_party_clients = d ? 1 : 0), c !== void 0 && (g.allow_offline_access = c ? 1 : 0);
|
|
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
|
}
|
|
@@ -2066,7 +2066,7 @@ function _i(t) {
|
|
|
2066
2066
|
limit: o,
|
|
2067
2067
|
length: c.length
|
|
2068
2068
|
};
|
|
2069
|
-
const { count: h } = await a.select((
|
|
2069
|
+
const { count: h } = await a.select((g) => g.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
2070
2070
|
return {
|
|
2071
2071
|
roles: c,
|
|
2072
2072
|
start: r * o,
|
|
@@ -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
|
|
2172
|
+
const g = (await d.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 d.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow(),
|
|
2182
|
+
return u && await d.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow(), g;
|
|
2183
2183
|
};
|
|
2184
2184
|
}
|
|
2185
2185
|
function yi(t) {
|
|
@@ -4934,12 +4934,12 @@ class Rs extends Ps {
|
|
|
4934
4934
|
b(this, qe, n);
|
|
4935
4935
|
}
|
|
4936
4936
|
transformNodeImpl(n) {
|
|
4937
|
-
if (!
|
|
4937
|
+
if (!w(this, I, ma).call(this, n))
|
|
4938
4938
|
return super.transformNodeImpl(n);
|
|
4939
|
-
const a =
|
|
4939
|
+
const a = w(this, I, fa).call(this, n);
|
|
4940
4940
|
for (const u of a)
|
|
4941
4941
|
i(this, xe).add(u);
|
|
4942
|
-
const r =
|
|
4942
|
+
const r = w(this, I, ha).call(this, n);
|
|
4943
4943
|
for (const u of r)
|
|
4944
4944
|
i(this, Ce).add(u);
|
|
4945
4945
|
const o = super.transformNodeImpl(n);
|
|
@@ -4966,13 +4966,13 @@ class Rs extends Ps {
|
|
|
4966
4966
|
transformAggregateFunction(n) {
|
|
4967
4967
|
return {
|
|
4968
4968
|
...super.transformAggregateFunction({ ...n, aggregated: [] }),
|
|
4969
|
-
aggregated:
|
|
4969
|
+
aggregated: w(this, I, an).call(this, n, "aggregated")
|
|
4970
4970
|
};
|
|
4971
4971
|
}
|
|
4972
4972
|
transformFunction(n) {
|
|
4973
4973
|
return {
|
|
4974
4974
|
...super.transformFunction({ ...n, arguments: [] }),
|
|
4975
|
-
arguments:
|
|
4975
|
+
arguments: w(this, I, an).call(this, n, "arguments")
|
|
4976
4976
|
};
|
|
4977
4977
|
}
|
|
4978
4978
|
}
|
|
@@ -4985,19 +4985,19 @@ qe = new WeakMap(), Ce = new WeakMap(), xe = new WeakMap(), I = new WeakSet(), a
|
|
|
4985
4985
|
return n.kind in Ds;
|
|
4986
4986
|
}, ha = function(n) {
|
|
4987
4987
|
const a = /* @__PURE__ */ new Set();
|
|
4988
|
-
if ("name" in n && n.name && Xt.is(n.name) &&
|
|
4988
|
+
if ("name" in n && n.name && Xt.is(n.name) && w(this, I, rn).call(this, n.name, a), "from" in n && n.from)
|
|
4989
4989
|
for (const r of n.from.froms)
|
|
4990
|
-
|
|
4991
|
-
if ("into" in n && n.into &&
|
|
4990
|
+
w(this, I, De).call(this, r, a);
|
|
4991
|
+
if ("into" in n && n.into && w(this, I, De).call(this, n.into, a), "table" in n && n.table && w(this, I, De).call(this, n.table, a), "joins" in n && n.joins)
|
|
4992
4992
|
for (const r of n.joins)
|
|
4993
|
-
|
|
4994
|
-
return "using" in n && n.using &&
|
|
4993
|
+
w(this, I, De).call(this, r.table, a);
|
|
4994
|
+
return "using" in n && n.using && w(this, I, De).call(this, n.using, a), a;
|
|
4995
4995
|
}, fa = function(n) {
|
|
4996
4996
|
const a = /* @__PURE__ */ new Set();
|
|
4997
|
-
return "with" in n && n.with &&
|
|
4997
|
+
return "with" in n && n.with && w(this, I, pa).call(this, n.with, a), a;
|
|
4998
4998
|
}, De = function(n, a) {
|
|
4999
4999
|
const r = _e.is(n) ? n : we.is(n) && _e.is(n.node) ? n.node : null;
|
|
5000
|
-
r &&
|
|
5000
|
+
r && w(this, I, rn).call(this, r.table, a);
|
|
5001
5001
|
}, rn = function(n, a) {
|
|
5002
5002
|
const r = n.identifier.name;
|
|
5003
5003
|
!i(this, Ce).has(r) && !i(this, xe).has(r) && a.add(r);
|
|
@@ -5074,7 +5074,7 @@ class Ls {
|
|
|
5074
5074
|
}
|
|
5075
5075
|
async executeQuery(e, n) {
|
|
5076
5076
|
return await this.provideConnection(async (a) => {
|
|
5077
|
-
const r = await a.executeQuery(e), o = await
|
|
5077
|
+
const r = await a.executeQuery(e), o = await w(this, gt, on).call(this, r, n);
|
|
5078
5078
|
return Ms(r, o), o;
|
|
5079
5079
|
});
|
|
5080
5080
|
}
|
|
@@ -5084,7 +5084,7 @@ class Ls {
|
|
|
5084
5084
|
const u = await r.promise;
|
|
5085
5085
|
try {
|
|
5086
5086
|
for await (const d of u.streamQuery(e, n))
|
|
5087
|
-
yield await
|
|
5087
|
+
yield await w(this, gt, on).call(this, d, a);
|
|
5088
5088
|
} finally {
|
|
5089
5089
|
o.resolve();
|
|
5090
5090
|
}
|
|
@@ -6220,7 +6220,7 @@ class dn {
|
|
|
6220
6220
|
* ```
|
|
6221
6221
|
*/
|
|
6222
6222
|
at(e) {
|
|
6223
|
-
return
|
|
6223
|
+
return w(this, wt, cn).call(this, "ArrayLocation", e);
|
|
6224
6224
|
}
|
|
6225
6225
|
/**
|
|
6226
6226
|
* Access a property of a JSON object.
|
|
@@ -6272,7 +6272,7 @@ class dn {
|
|
|
6272
6272
|
* ```
|
|
6273
6273
|
*/
|
|
6274
6274
|
key(e) {
|
|
6275
|
-
return
|
|
6275
|
+
return w(this, wt, cn).call(this, "Member", e);
|
|
6276
6276
|
}
|
|
6277
6277
|
}
|
|
6278
6278
|
G = new WeakMap(), wt = new WeakSet(), cn = function(e, n) {
|
|
@@ -6579,14 +6579,14 @@ const lt = class lt {
|
|
|
6579
6579
|
});
|
|
6580
6580
|
}
|
|
6581
6581
|
toOperationNode() {
|
|
6582
|
-
return
|
|
6582
|
+
return w(this, M, ln).call(this, w(this, M, bt).call(this));
|
|
6583
6583
|
}
|
|
6584
6584
|
compile(e) {
|
|
6585
|
-
return
|
|
6585
|
+
return w(this, M, _n).call(this, w(this, M, bt).call(this, e));
|
|
6586
6586
|
}
|
|
6587
6587
|
async execute(e) {
|
|
6588
|
-
const n =
|
|
6589
|
-
return n.executeQuery(
|
|
6588
|
+
const n = w(this, M, bt).call(this, e);
|
|
6589
|
+
return n.executeQuery(w(this, M, _n).call(this, n), i(this, P).queryId);
|
|
6590
6590
|
}
|
|
6591
6591
|
};
|
|
6592
6592
|
P = new WeakMap(), M = new WeakSet(), bt = function(e) {
|
|
@@ -6595,7 +6595,7 @@ P = new WeakMap(), M = new WeakSet(), bt = function(e) {
|
|
|
6595
6595
|
}, ln = function(e) {
|
|
6596
6596
|
return e.transformQuery(i(this, P).rawNode, i(this, P).queryId);
|
|
6597
6597
|
}, _n = function(e) {
|
|
6598
|
-
return e.compileQuery(
|
|
6598
|
+
return e.compileQuery(w(this, M, ln).call(this, e), i(this, P).queryId);
|
|
6599
6599
|
};
|
|
6600
6600
|
let Dt = lt;
|
|
6601
6601
|
function se(t) {
|
|
@@ -6624,7 +6624,7 @@ class xa {
|
|
|
6624
6624
|
}
|
|
6625
6625
|
ke = new WeakMap(), le = new WeakMap();
|
|
6626
6626
|
Ae(xa, "don't await AliasedRawBuilder instances directly. AliasedRawBuilder should never be executed directly since it's always a part of another query.");
|
|
6627
|
-
const
|
|
6627
|
+
const p = Object.assign((t, ...e) => se({
|
|
6628
6628
|
queryId: X(),
|
|
6629
6629
|
rawNode: R.create(t, (e == null ? void 0 : e.map(Un)) ?? [])
|
|
6630
6630
|
}), {
|
|
@@ -6671,7 +6671,7 @@ const g = Object.assign((t, ...e) => se({
|
|
|
6671
6671
|
rawNode: R.createWithSql(t)
|
|
6672
6672
|
});
|
|
6673
6673
|
},
|
|
6674
|
-
join(t, e =
|
|
6674
|
+
join(t, e = p`, `) {
|
|
6675
6675
|
const n = new Array(2 * t.length - 1), a = e.toOperationNode();
|
|
6676
6676
|
for (let r = 0; r < t.length; ++r)
|
|
6677
6677
|
n[2 * r] = Un(t[r]), r !== t.length - 1 && (n[2 * r + 1] = a);
|
|
@@ -6706,8 +6706,8 @@ class ba {
|
|
|
6706
6706
|
* The returned array is sorted by migration name.
|
|
6707
6707
|
*/
|
|
6708
6708
|
async getMigrations() {
|
|
6709
|
-
const e = await
|
|
6710
|
-
return (await
|
|
6709
|
+
const e = await w(this, m, Re).call(this, i(this, m, ee)) ? await i(this, k).db.withPlugin(i(this, m, te)).selectFrom(i(this, m, ee)).select(["name", "timestamp"]).$narrowType().execute() : [];
|
|
6710
|
+
return (await w(this, m, fn).call(this)).map(({ name: a, ...r }) => {
|
|
6711
6711
|
const o = e.find((u) => u.name === a);
|
|
6712
6712
|
return {
|
|
6713
6713
|
name: a,
|
|
@@ -6763,7 +6763,7 @@ class ba {
|
|
|
6763
6763
|
* ```
|
|
6764
6764
|
*/
|
|
6765
6765
|
async migrateToLatest() {
|
|
6766
|
-
return
|
|
6766
|
+
return w(this, m, ot).call(this, () => ({ direction: "Up", step: 1 / 0 }));
|
|
6767
6767
|
}
|
|
6768
6768
|
/**
|
|
6769
6769
|
* Migrate up/down to a specific migration.
|
|
@@ -6817,7 +6817,7 @@ class ba {
|
|
|
6817
6817
|
* ```
|
|
6818
6818
|
*/
|
|
6819
6819
|
async migrateTo(e) {
|
|
6820
|
-
return
|
|
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
6823
|
if (!n.find((d) => d.name === e))
|
|
@@ -6862,7 +6862,7 @@ class ba {
|
|
|
6862
6862
|
* ```
|
|
6863
6863
|
*/
|
|
6864
6864
|
async migrateUp() {
|
|
6865
|
-
return
|
|
6865
|
+
return w(this, m, ot).call(this, () => ({ direction: "Up", step: 1 }));
|
|
6866
6866
|
}
|
|
6867
6867
|
/**
|
|
6868
6868
|
* Migrate one step down.
|
|
@@ -6893,12 +6893,12 @@ class ba {
|
|
|
6893
6893
|
* ```
|
|
6894
6894
|
*/
|
|
6895
6895
|
async migrateDown() {
|
|
6896
|
-
return
|
|
6896
|
+
return w(this, m, ot).call(this, () => ({ direction: "Down", step: 1 }));
|
|
6897
6897
|
}
|
|
6898
6898
|
}
|
|
6899
6899
|
k = new WeakMap(), m = new WeakSet(), ot = async function(e) {
|
|
6900
6900
|
try {
|
|
6901
|
-
return await
|
|
6901
|
+
return await w(this, m, Oa).call(this), await w(this, m, Aa).call(this, e);
|
|
6902
6902
|
} catch (n) {
|
|
6903
6903
|
return n instanceof Ht ? n.resultSet : { error: n };
|
|
6904
6904
|
}
|
|
@@ -6913,37 +6913,37 @@ k = new WeakMap(), m = new WeakSet(), ot = async function(e) {
|
|
|
6913
6913
|
}, te = function() {
|
|
6914
6914
|
return i(this, m, Z) ? new ga(i(this, m, Z)) : new fu();
|
|
6915
6915
|
}, Oa = async function() {
|
|
6916
|
-
await
|
|
6916
|
+
await w(this, m, Sa).call(this), await w(this, m, ka).call(this), await w(this, m, Ia).call(this), await w(this, m, Ea).call(this);
|
|
6917
6917
|
}, Sa = async function() {
|
|
6918
|
-
if (i(this, m, Z) && !await
|
|
6918
|
+
if (i(this, m, Z) && !await w(this, m, mn).call(this))
|
|
6919
6919
|
try {
|
|
6920
|
-
await
|
|
6920
|
+
await w(this, m, it).call(this, i(this, k).db.schema.createSchema(i(this, m, Z)));
|
|
6921
6921
|
} catch (e) {
|
|
6922
|
-
if (!await
|
|
6922
|
+
if (!await w(this, m, mn).call(this))
|
|
6923
6923
|
throw e;
|
|
6924
6924
|
}
|
|
6925
6925
|
}, ka = async function() {
|
|
6926
|
-
if (!await
|
|
6926
|
+
if (!await w(this, m, Re).call(this, i(this, m, ee)))
|
|
6927
6927
|
try {
|
|
6928
|
-
i(this, m, Z) && await
|
|
6928
|
+
i(this, m, Z) && await w(this, m, it).call(this, i(this, k).db.schema.createSchema(i(this, m, Z))), await w(this, m, it).call(this, i(this, k).db.schema.withPlugin(i(this, m, te)).createTable(i(this, m, ee)).addColumn("name", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("timestamp", "varchar(255)", (e) => e.notNull()));
|
|
6929
6929
|
} catch (e) {
|
|
6930
|
-
if (!await
|
|
6930
|
+
if (!await w(this, m, Re).call(this, i(this, m, ee)))
|
|
6931
6931
|
throw e;
|
|
6932
6932
|
}
|
|
6933
6933
|
}, Ia = async function() {
|
|
6934
|
-
if (!await
|
|
6934
|
+
if (!await w(this, m, Re).call(this, i(this, m, ze)))
|
|
6935
6935
|
try {
|
|
6936
|
-
await
|
|
6936
|
+
await w(this, m, it).call(this, i(this, k).db.schema.withPlugin(i(this, m, te)).createTable(i(this, m, ze)).addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("is_locked", "integer", (e) => e.notNull().defaultTo(0)));
|
|
6937
6937
|
} catch (e) {
|
|
6938
|
-
if (!await
|
|
6938
|
+
if (!await w(this, m, Re).call(this, i(this, m, ze)))
|
|
6939
6939
|
throw e;
|
|
6940
6940
|
}
|
|
6941
6941
|
}, Ea = async function() {
|
|
6942
|
-
if (!await
|
|
6942
|
+
if (!await w(this, m, hn).call(this))
|
|
6943
6943
|
try {
|
|
6944
6944
|
await i(this, k).db.withPlugin(i(this, m, te)).insertInto(i(this, m, ze)).values({ id: Yt, is_locked: 0 }).execute();
|
|
6945
6945
|
} catch (e) {
|
|
6946
|
-
if (!await
|
|
6946
|
+
if (!await w(this, m, hn).call(this))
|
|
6947
6947
|
throw e;
|
|
6948
6948
|
}
|
|
6949
6949
|
}, mn = async function() {
|
|
@@ -6963,20 +6963,20 @@ k = new WeakMap(), m = new WeakSet(), ot = async function(e) {
|
|
|
6963
6963
|
}), r = async (o) => {
|
|
6964
6964
|
try {
|
|
6965
6965
|
await n.acquireMigrationLock(o, a);
|
|
6966
|
-
const u = await
|
|
6966
|
+
const u = await w(this, m, $a).call(this, o);
|
|
6967
6967
|
if (u.migrations.length === 0)
|
|
6968
6968
|
return { results: [] };
|
|
6969
6969
|
const { direction: d, step: c } = e(u);
|
|
6970
|
-
return c <= 0 ? { results: [] } : d === "Down" ? await
|
|
6970
|
+
return c <= 0 ? { results: [] } : d === "Down" ? await w(this, m, Fa).call(this, o, u, c) : d === "Up" ? await w(this, m, ja).call(this, o, u, c) : { results: [] };
|
|
6971
6971
|
} finally {
|
|
6972
6972
|
await n.releaseMigrationLock(o, a);
|
|
6973
6973
|
}
|
|
6974
6974
|
};
|
|
6975
6975
|
return n.supportsTransactionalDdl ? i(this, k).db.transaction().execute(r) : i(this, k).db.connection().execute(r);
|
|
6976
6976
|
}, $a = async function(e) {
|
|
6977
|
-
const n = await
|
|
6978
|
-
|
|
6979
|
-
const r =
|
|
6977
|
+
const n = await w(this, m, fn).call(this), a = await w(this, m, Da).call(this, e);
|
|
6978
|
+
w(this, m, za).call(this, n, a), i(this, m, Ta) || w(this, m, Ra).call(this, n, a);
|
|
6979
|
+
const r = w(this, m, Pa).call(this, n, a);
|
|
6980
6980
|
return s({
|
|
6981
6981
|
migrations: n,
|
|
6982
6982
|
executedMigrations: a,
|
|
@@ -8589,7 +8589,7 @@ const Lm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8589
8589
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
8590
8590
|
async function Ma(t) {
|
|
8591
8591
|
try {
|
|
8592
|
-
return await
|
|
8592
|
+
return await p`SELECT VERSION()`.execute(t), "mysql";
|
|
8593
8593
|
} catch {
|
|
8594
8594
|
return "sqlite";
|
|
8595
8595
|
}
|
|
@@ -8599,7 +8599,7 @@ async function Mm(t) {
|
|
|
8599
8599
|
}
|
|
8600
8600
|
async function Jm(t) {
|
|
8601
8601
|
await t.transaction().execute(async (e) => {
|
|
8602
|
-
const n = await
|
|
8602
|
+
const n = await p`
|
|
8603
8603
|
SELECT
|
|
8604
8604
|
rc.CONSTRAINT_NAME,
|
|
8605
8605
|
rc.TABLE_NAME
|
|
@@ -8610,7 +8610,7 @@ async function Jm(t) {
|
|
|
8610
8610
|
for (const r of n.rows) {
|
|
8611
8611
|
const o = r.CONSTRAINT_NAME, u = r.TABLE_NAME;
|
|
8612
8612
|
try {
|
|
8613
|
-
await
|
|
8613
|
+
await p`ALTER TABLE ${p.raw(u)} DROP FOREIGN KEY ${p.raw(o)}`.execute(
|
|
8614
8614
|
e
|
|
8615
8615
|
), console.log(
|
|
8616
8616
|
`Dropped foreign key constraint ${o} from ${u}`
|
|
@@ -8629,53 +8629,53 @@ async function Jm(t) {
|
|
|
8629
8629
|
];
|
|
8630
8630
|
for (const r of a)
|
|
8631
8631
|
try {
|
|
8632
|
-
await
|
|
8632
|
+
await p`DROP TABLE IF EXISTS ${p.raw(r)}`.execute(e);
|
|
8633
8633
|
} catch (o) {
|
|
8634
8634
|
console.warn(`Failed to drop backup table ${r}:`, o);
|
|
8635
8635
|
}
|
|
8636
|
-
await
|
|
8636
|
+
await p`CREATE TABLE sessions_backup AS SELECT * FROM sessions`.execute(
|
|
8637
8637
|
e
|
|
8638
|
-
), await
|
|
8638
|
+
), await p`CREATE TABLE login_sessions_backup AS SELECT * FROM login_sessions`.execute(
|
|
8639
8639
|
e
|
|
8640
|
-
), await
|
|
8640
|
+
), await p`CREATE TABLE refresh_tokens_backup AS SELECT * FROM refresh_tokens`.execute(
|
|
8641
8641
|
e
|
|
8642
|
-
), await
|
|
8642
|
+
), await p`DROP TABLE sessions`.execute(e), await p`DROP TABLE login_sessions`.execute(e), await p`DROP TABLE refresh_tokens`.execute(e), await e.schema.createTable("refresh_tokens").addColumn("id", "varchar(21)", (r) => r.notNull()).addColumn("tenant_id", "varchar(255)", (r) => r.notNull()).addColumn("client_id", "varchar(191)", (r) => r.notNull()).addColumn("session_id", "varchar(21)", (r) => r.notNull()).addColumn("user_id", "varchar(255)").addColumn("resource_servers", "text", (r) => r.notNull()).addColumn("device", "text", (r) => r.notNull()).addColumn("rotating", "boolean", (r) => r.notNull()).addColumn("created_at", "varchar(35)", (r) => r.notNull()).addColumn("expires_at", "varchar(35)").addColumn("idle_expires_at", "varchar(35)").addColumn("last_exchanged_at", "varchar(35)").addPrimaryKeyConstraint("refresh_tokens_pk", ["tenant_id", "id"]).execute(), await p`ALTER TABLE refresh_tokens
|
|
8643
8643
|
ADD CONSTRAINT refresh_tokens_tenant_fk
|
|
8644
8644
|
FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON DELETE CASCADE`.execute(
|
|
8645
8645
|
e
|
|
8646
|
-
), await
|
|
8646
|
+
), await p`ALTER TABLE refresh_tokens
|
|
8647
8647
|
ADD CONSTRAINT refresh_tokens_client_fk
|
|
8648
8648
|
FOREIGN KEY (tenant_id, client_id) REFERENCES clients(tenant_id, client_id) ON DELETE CASCADE`.execute(
|
|
8649
8649
|
e
|
|
8650
|
-
), await e.schema.createTable("sessions").addColumn("id", "varchar(21)", (r) => r.notNull()).addColumn("tenant_id", "varchar(191)", (r) => r.notNull()).addColumn("user_id", "varchar(255)").addColumn("created_at", "varchar(35)", (r) => r.notNull()).addColumn("updated_at", "varchar(35)", (r) => r.notNull()).addColumn("expires_at", "varchar(35)").addColumn("idle_expires_at", "varchar(35)").addColumn("authenticated_at", "varchar(35)").addColumn("last_interaction_at", "varchar(35)").addColumn("used_at", "varchar(35)").addColumn("revoked_at", "varchar(35)").addColumn("device", "text", (r) => r.notNull()).addColumn("clients", "text", (r) => r.notNull()).addColumn("login_session_id", "varchar(21)").addPrimaryKeyConstraint("sessions_pk", ["tenant_id", "id"]).execute(), await
|
|
8650
|
+
), await e.schema.createTable("sessions").addColumn("id", "varchar(21)", (r) => r.notNull()).addColumn("tenant_id", "varchar(191)", (r) => r.notNull()).addColumn("user_id", "varchar(255)").addColumn("created_at", "varchar(35)", (r) => r.notNull()).addColumn("updated_at", "varchar(35)", (r) => r.notNull()).addColumn("expires_at", "varchar(35)").addColumn("idle_expires_at", "varchar(35)").addColumn("authenticated_at", "varchar(35)").addColumn("last_interaction_at", "varchar(35)").addColumn("used_at", "varchar(35)").addColumn("revoked_at", "varchar(35)").addColumn("device", "text", (r) => r.notNull()).addColumn("clients", "text", (r) => r.notNull()).addColumn("login_session_id", "varchar(21)").addPrimaryKeyConstraint("sessions_pk", ["tenant_id", "id"]).execute(), await p`ALTER TABLE sessions
|
|
8651
8651
|
ADD CONSTRAINT sessions_user_fk
|
|
8652
8652
|
FOREIGN KEY (user_id, tenant_id) REFERENCES users(user_id, tenant_id) ON DELETE CASCADE`.execute(
|
|
8653
8653
|
e
|
|
8654
|
-
), await e.schema.createTable("login_sessions").addColumn("id", "varchar(21)", (r) => r.notNull()).addColumn("tenant_id", "varchar(255)", (r) => r.notNull()).addColumn("session_id", "varchar(21)").addColumn("csrf_token", "varchar(21)", (r) => r.notNull()).addColumn("authParams_client_id", "varchar(191)", (r) => r.notNull()).addColumn("authParams_vendor_id", "varchar(255)").addColumn("authParams_username", "varchar(255)").addColumn("authParams_response_type", "varchar(255)").addColumn("authParams_response_mode", "varchar(255)").addColumn("authParams_audience", "varchar(255)").addColumn("authParams_scope", "text").addColumn("authParams_state", "text").addColumn("authParams_nonce", "varchar(255)").addColumn("authParams_code_challenge_method", "varchar(255)").addColumn("authParams_code_challenge", "varchar(255)").addColumn("authParams_redirect_uri", "text").addColumn("authParams_organization", "varchar(255)").addColumn("authParams_prompt", "varchar(32)").addColumn("authParams_act_as", "varchar(256)").addColumn("authParams_ui_locales", "varchar(32)").addColumn("authorization_url", "text").addColumn("created_at", "varchar(35)", (r) => r.notNull()).addColumn("updated_at", "varchar(35)", (r) => r.notNull()).addColumn("expires_at", "varchar(35)", (r) => r.notNull()).addColumn("ip", "varchar(39)").addColumn("useragent", "text").addColumn("auth0Client", "varchar(255)").addColumn("login_completed", "integer", (r) => r.defaultTo(0)).addPrimaryKeyConstraint("login_sessions_pk", ["tenant_id", "id"]).execute(), await
|
|
8654
|
+
), await e.schema.createTable("login_sessions").addColumn("id", "varchar(21)", (r) => r.notNull()).addColumn("tenant_id", "varchar(255)", (r) => r.notNull()).addColumn("session_id", "varchar(21)").addColumn("csrf_token", "varchar(21)", (r) => r.notNull()).addColumn("authParams_client_id", "varchar(191)", (r) => r.notNull()).addColumn("authParams_vendor_id", "varchar(255)").addColumn("authParams_username", "varchar(255)").addColumn("authParams_response_type", "varchar(255)").addColumn("authParams_response_mode", "varchar(255)").addColumn("authParams_audience", "varchar(255)").addColumn("authParams_scope", "text").addColumn("authParams_state", "text").addColumn("authParams_nonce", "varchar(255)").addColumn("authParams_code_challenge_method", "varchar(255)").addColumn("authParams_code_challenge", "varchar(255)").addColumn("authParams_redirect_uri", "text").addColumn("authParams_organization", "varchar(255)").addColumn("authParams_prompt", "varchar(32)").addColumn("authParams_act_as", "varchar(256)").addColumn("authParams_ui_locales", "varchar(32)").addColumn("authorization_url", "text").addColumn("created_at", "varchar(35)", (r) => r.notNull()).addColumn("updated_at", "varchar(35)", (r) => r.notNull()).addColumn("expires_at", "varchar(35)", (r) => r.notNull()).addColumn("ip", "varchar(39)").addColumn("useragent", "text").addColumn("auth0Client", "varchar(255)").addColumn("login_completed", "integer", (r) => r.defaultTo(0)).addPrimaryKeyConstraint("login_sessions_pk", ["tenant_id", "id"]).execute(), await p`ALTER TABLE login_sessions
|
|
8655
8655
|
ADD CONSTRAINT login_sessions_tenant_fk
|
|
8656
8656
|
FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON DELETE CASCADE`.execute(
|
|
8657
8657
|
e
|
|
8658
|
-
), await
|
|
8658
|
+
), await p`ALTER TABLE login_sessions
|
|
8659
8659
|
ADD CONSTRAINT login_sessions_client_fk
|
|
8660
8660
|
FOREIGN KEY (tenant_id, authParams_client_id) REFERENCES clients(tenant_id, client_id) ON DELETE CASCADE`.execute(
|
|
8661
8661
|
e
|
|
8662
|
-
), await
|
|
8662
|
+
), await p`ALTER TABLE login_sessions
|
|
8663
8663
|
ADD CONSTRAINT login_sessions_session_fk
|
|
8664
8664
|
FOREIGN KEY (tenant_id, session_id) REFERENCES sessions(tenant_id, id) ON DELETE CASCADE`.execute(
|
|
8665
8665
|
e
|
|
8666
|
-
), await
|
|
8666
|
+
), await p`INSERT INTO refresh_tokens
|
|
8667
8667
|
SELECT id, tenant_id, client_id, session_id, user_id, resource_servers, device, rotating,
|
|
8668
8668
|
created_at, expires_at, idle_expires_at, last_exchanged_at
|
|
8669
|
-
FROM refresh_tokens_backup`.execute(e), await
|
|
8669
|
+
FROM refresh_tokens_backup`.execute(e), await p`INSERT INTO sessions
|
|
8670
8670
|
SELECT id, tenant_id, user_id, created_at, updated_at, expires_at, idle_expires_at,
|
|
8671
8671
|
authenticated_at, last_interaction_at, used_at, revoked_at, device, clients, login_session_id
|
|
8672
|
-
FROM sessions_backup`.execute(e), await
|
|
8672
|
+
FROM sessions_backup`.execute(e), await p`INSERT INTO login_sessions
|
|
8673
8673
|
SELECT id, tenant_id, session_id, csrf_token, authParams_client_id, authParams_vendor_id, authParams_username,
|
|
8674
8674
|
authParams_response_type, authParams_response_mode, authParams_audience, authParams_scope, authParams_state,
|
|
8675
8675
|
authParams_nonce, authParams_code_challenge_method, authParams_code_challenge, authParams_redirect_uri,
|
|
8676
8676
|
authParams_organization, authParams_prompt, authParams_act_as, authParams_ui_locales, authorization_url,
|
|
8677
8677
|
created_at, updated_at, expires_at, ip, useragent, auth0Client, login_completed
|
|
8678
|
-
FROM login_sessions_backup`.execute(e), await
|
|
8678
|
+
FROM login_sessions_backup`.execute(e), await p`DROP TABLE sessions_backup`.execute(e), await p`DROP TABLE login_sessions_backup`.execute(e), await p`DROP TABLE refresh_tokens_backup`.execute(e);
|
|
8679
8679
|
});
|
|
8680
8680
|
}
|
|
8681
8681
|
async function qm(t) {
|
|
@@ -8687,17 +8687,17 @@ async function qm(t) {
|
|
|
8687
8687
|
];
|
|
8688
8688
|
for (const a of n)
|
|
8689
8689
|
try {
|
|
8690
|
-
await
|
|
8690
|
+
await p`DROP TABLE IF EXISTS ${p.raw(a)}`.execute(e);
|
|
8691
8691
|
} catch (r) {
|
|
8692
8692
|
console.warn(`Failed to drop backup table ${a}:`, r);
|
|
8693
8693
|
}
|
|
8694
|
-
await
|
|
8694
|
+
await p`CREATE TABLE sessions_backup AS SELECT * FROM sessions`.execute(
|
|
8695
8695
|
e
|
|
8696
|
-
), await
|
|
8696
|
+
), await p`CREATE TABLE login_sessions_backup AS SELECT * FROM login_sessions`.execute(
|
|
8697
8697
|
e
|
|
8698
|
-
), await
|
|
8698
|
+
), await p`CREATE TABLE refresh_tokens_backup AS SELECT * FROM refresh_tokens`.execute(
|
|
8699
8699
|
e
|
|
8700
|
-
), await
|
|
8700
|
+
), await p`DROP TABLE sessions`.execute(e), await p`DROP TABLE login_sessions`.execute(e), await p`DROP TABLE refresh_tokens`.execute(e), await e.schema.createTable("refresh_tokens").addColumn("id", "varchar(21)", (a) => a.notNull()).addColumn(
|
|
8701
8701
|
"tenant_id",
|
|
8702
8702
|
"varchar(255)",
|
|
8703
8703
|
(a) => a.references("tenants.id").onDelete("cascade").notNull()
|
|
@@ -8729,19 +8729,19 @@ async function qm(t) {
|
|
|
8729
8729
|
"sessions",
|
|
8730
8730
|
["tenant_id", "id"],
|
|
8731
8731
|
(a) => a.onDelete("cascade")
|
|
8732
|
-
).execute(), await
|
|
8732
|
+
).execute(), await p`INSERT INTO refresh_tokens
|
|
8733
8733
|
SELECT id, tenant_id, client_id, session_id, user_id, resource_servers, device, rotating,
|
|
8734
8734
|
created_at, expires_at, idle_expires_at, last_exchanged_at
|
|
8735
|
-
FROM refresh_tokens_backup`.execute(e), await
|
|
8735
|
+
FROM refresh_tokens_backup`.execute(e), await p`INSERT INTO sessions
|
|
8736
8736
|
SELECT id, tenant_id, user_id, created_at, updated_at, expires_at, idle_expires_at,
|
|
8737
8737
|
authenticated_at, last_interaction_at, used_at, revoked_at, device, clients, login_session_id
|
|
8738
|
-
FROM sessions_backup`.execute(e), await
|
|
8738
|
+
FROM sessions_backup`.execute(e), await p`INSERT INTO login_sessions
|
|
8739
8739
|
SELECT id, tenant_id, session_id, csrf_token, authParams_client_id, authParams_vendor_id, authParams_username,
|
|
8740
8740
|
authParams_response_type, authParams_response_mode, authParams_audience, authParams_scope, authParams_state,
|
|
8741
8741
|
authParams_nonce, authParams_code_challenge_method, authParams_code_challenge, authParams_redirect_uri,
|
|
8742
8742
|
authParams_organization, authParams_prompt, authParams_act_as, authParams_ui_locales, authorization_url,
|
|
8743
8743
|
created_at, updated_at, expires_at, ip, useragent, auth0Client, login_completed
|
|
8744
|
-
FROM login_sessions_backup`.execute(e), await
|
|
8744
|
+
FROM login_sessions_backup`.execute(e), await p`DROP TABLE sessions_backup`.execute(e), await p`DROP TABLE login_sessions_backup`.execute(e), await p`DROP TABLE refresh_tokens_backup`.execute(e);
|
|
8745
8745
|
});
|
|
8746
8746
|
}
|
|
8747
8747
|
async function Bm(t) {
|
|
@@ -8749,15 +8749,15 @@ async function Bm(t) {
|
|
|
8749
8749
|
}
|
|
8750
8750
|
async function Wm(t) {
|
|
8751
8751
|
await t.transaction().execute(async (e) => {
|
|
8752
|
-
await
|
|
8752
|
+
await p`ALTER TABLE refresh_tokens DROP FOREIGN KEY refresh_tokens_client_fk`.execute(
|
|
8753
8753
|
e
|
|
8754
|
-
), await
|
|
8754
|
+
), await p`ALTER TABLE login_sessions DROP FOREIGN KEY login_sessions_client_fk`.execute(
|
|
8755
8755
|
e
|
|
8756
|
-
), await
|
|
8756
|
+
), await p`ALTER TABLE refresh_tokens DROP PRIMARY KEY`.execute(e), await p`ALTER TABLE refresh_tokens ADD PRIMARY KEY (id)`.execute(e), await p`ALTER TABLE sessions DROP PRIMARY KEY`.execute(e), await p`ALTER TABLE sessions ADD PRIMARY KEY (id)`.execute(e), await p`ALTER TABLE login_sessions DROP PRIMARY KEY`.execute(e), await p`ALTER TABLE login_sessions ADD PRIMARY KEY (id)`.execute(e), await p`ALTER TABLE refresh_tokens
|
|
8757
8757
|
ADD CONSTRAINT refresh_tokens_application_fk
|
|
8758
8758
|
FOREIGN KEY (client_id) REFERENCES applications(id) ON DELETE CASCADE`.execute(
|
|
8759
8759
|
e
|
|
8760
|
-
), await
|
|
8760
|
+
), await p`ALTER TABLE login_sessions
|
|
8761
8761
|
ADD CONSTRAINT login_sessions_application_fk
|
|
8762
8762
|
FOREIGN KEY (authParams_client_id) REFERENCES applications(id) ON DELETE CASCADE`.execute(
|
|
8763
8763
|
e
|
|
@@ -8766,9 +8766,9 @@ async function Wm(t) {
|
|
|
8766
8766
|
}
|
|
8767
8767
|
async function Km(t) {
|
|
8768
8768
|
await t.transaction().execute(async (e) => {
|
|
8769
|
-
await
|
|
8769
|
+
await p`CREATE TABLE refresh_tokens_temp AS SELECT * FROM refresh_tokens`.execute(
|
|
8770
8770
|
e
|
|
8771
|
-
), await
|
|
8771
|
+
), await p`DROP TABLE refresh_tokens`.execute(e), await e.schema.createTable("refresh_tokens").addColumn("id", "varchar(21)", (n) => n.primaryKey()).addColumn(
|
|
8772
8772
|
"tenant_id",
|
|
8773
8773
|
"varchar(255)",
|
|
8774
8774
|
(n) => n.references("tenants.id").onDelete("cascade").notNull()
|
|
@@ -8776,12 +8776,12 @@ async function Km(t) {
|
|
|
8776
8776
|
"client_id",
|
|
8777
8777
|
"varchar(21)",
|
|
8778
8778
|
(n) => n.references("applications.id").onDelete("cascade").notNull()
|
|
8779
|
-
).addColumn("session_id", "varchar(21)", (n) => n.notNull()).addColumn("user_id", "varchar(255)").addColumn("resource_servers", "varchar(255)", (n) => n.notNull()).addColumn("device", "varchar(255)", (n) => n.notNull()).addColumn("rotating", "boolean", (n) => n.notNull()).addColumn("created_at", "varchar(35)", (n) => n.notNull()).addColumn("expires_at", "varchar(35)").addColumn("idle_expires_at", "varchar(35)").addColumn("last_exchanged_at", "varchar(35)").execute(), await
|
|
8779
|
+
).addColumn("session_id", "varchar(21)", (n) => n.notNull()).addColumn("user_id", "varchar(255)").addColumn("resource_servers", "varchar(255)", (n) => n.notNull()).addColumn("device", "varchar(255)", (n) => n.notNull()).addColumn("rotating", "boolean", (n) => n.notNull()).addColumn("created_at", "varchar(35)", (n) => n.notNull()).addColumn("expires_at", "varchar(35)").addColumn("idle_expires_at", "varchar(35)").addColumn("last_exchanged_at", "varchar(35)").execute(), await p`INSERT INTO refresh_tokens
|
|
8780
8780
|
SELECT id, tenant_id, client_id, session_id, user_id, resource_servers, device, rotating,
|
|
8781
8781
|
created_at, expires_at, idle_expires_at, last_exchanged_at
|
|
8782
|
-
FROM refresh_tokens_temp`.execute(e), await
|
|
8782
|
+
FROM refresh_tokens_temp`.execute(e), await p`DROP TABLE refresh_tokens_temp`.execute(e), await p`CREATE TABLE login_sessions_temp AS SELECT * FROM login_sessions`.execute(
|
|
8783
8783
|
e
|
|
8784
|
-
), await
|
|
8784
|
+
), await p`DROP TABLE login_sessions`.execute(e), await e.schema.createTable("login_sessions").addColumn("id", "varchar(21)", (n) => n.primaryKey()).addColumn(
|
|
8785
8785
|
"tenant_id",
|
|
8786
8786
|
"varchar(255)",
|
|
8787
8787
|
(n) => n.references("tenants.id").onDelete("cascade").notNull()
|
|
@@ -8789,9 +8789,9 @@ async function Km(t) {
|
|
|
8789
8789
|
"authParams_client_id",
|
|
8790
8790
|
"varchar(191)",
|
|
8791
8791
|
(n) => n.references("applications.id").onDelete("cascade").notNull()
|
|
8792
|
-
).execute(), await
|
|
8792
|
+
).execute(), await p`INSERT INTO login_sessions (id, tenant_id, session_id, csrf_token, authParams_client_id)
|
|
8793
8793
|
SELECT id, tenant_id, session_id, csrf_token, authParams_client_id
|
|
8794
|
-
FROM login_sessions_temp`.execute(e), await
|
|
8794
|
+
FROM login_sessions_temp`.execute(e), await p`DROP TABLE login_sessions_temp`.execute(e);
|
|
8795
8795
|
});
|
|
8796
8796
|
}
|
|
8797
8797
|
const Um = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -8900,7 +8900,7 @@ const mh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8900
8900
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
8901
8901
|
async function hh(t) {
|
|
8902
8902
|
if (await t.schema.alterTable("tenants").addColumn("idle_session_lifetime", "integer").execute(), await t.schema.alterTable("tenants").addColumn("session_lifetime", "integer").execute(), await t.schema.alterTable("tenants").addColumn("session_cookie", "text").execute(), await t.schema.alterTable("tenants").addColumn("allowed_logout_urls", "text").execute(), await t.schema.alterTable("tenants").addColumn("ephemeral_session_lifetime", "integer").execute(), await t.schema.alterTable("tenants").addColumn("idle_ephemeral_session_lifetime", "integer").execute(), await t.schema.alterTable("tenants").addColumn("default_redirection_uri", "text").execute(), await t.schema.alterTable("tenants").addColumn("enabled_locales", "text").execute(), await t.schema.alterTable("tenants").addColumn("default_directory", "varchar(255)").execute(), await t.schema.alterTable("tenants").addColumn("error_page", "text").execute(), await t.schema.alterTable("tenants").addColumn("flags", "text").execute(), await t.schema.alterTable("tenants").addColumn("friendly_name", "varchar(255)").execute(), await t.schema.alterTable("tenants").addColumn("picture_url", "text").execute(), await t.schema.alterTable("tenants").addColumn("support_email", "varchar(255)").execute(), await t.schema.alterTable("tenants").addColumn("sandbox_version", "varchar(50)").execute(), await t.schema.alterTable("tenants").addColumn("sandbox_versions_available", "text").execute(), await t.schema.alterTable("tenants").addColumn("legacy_sandbox_version", "varchar(50)").execute(), await t.schema.alterTable("tenants").addColumn("change_password", "text").execute(), await t.schema.alterTable("tenants").addColumn("guardian_mfa_page", "text").execute(), await t.schema.alterTable("tenants").addColumn("device_flow", "text").execute(), await t.schema.alterTable("tenants").addColumn("default_token_quota", "text").execute(), await t.schema.alterTable("tenants").addColumn("default_audience", "varchar(255)").execute(), await t.schema.alterTable("tenants").addColumn("default_organization", "varchar(255)").execute(), await t.schema.alterTable("tenants").addColumn("sessions", "text").execute(), await t.schema.alterTable("tenants").addColumn("oidc_logout", "text").execute(), await t.schema.alterTable("tenants").addColumn("allow_organization_name_in_authentication_api", "integer").execute(), await t.schema.alterTable("tenants").addColumn("customize_mfa_in_postlogin_action", "integer").execute(), await t.schema.alterTable("tenants").addColumn("acr_values_supported", "text").execute(), await t.schema.alterTable("tenants").addColumn("mtls", "text").execute(), await t.schema.alterTable("tenants").addColumn("pushed_authorization_requests_supported", "integer").execute(), await t.schema.alterTable("tenants").addColumn("authorization_response_iss_parameter_supported", "integer").execute(), await t.updateTable("tenants").set({
|
|
8903
|
-
friendly_name:
|
|
8903
|
+
friendly_name: p`name`
|
|
8904
8904
|
}).execute(), await t.schema.alterTable("tenants").dropColumn("language").execute(), await t.schema.alterTable("tenants").dropColumn("logo").execute(), await t.schema.alterTable("tenants").dropColumn("primary_color").execute(), await t.schema.alterTable("tenants").dropColumn("secondary_color").execute(), await t.schema.alterTable("tenants").dropColumn("name").execute(), (await t.selectFrom("tenant_settings").select("tenant_id").limit(1).execute()).length > 0) {
|
|
8905
8905
|
const n = await t.selectFrom("tenant_settings").selectAll().execute();
|
|
8906
8906
|
for (const a of n)
|
|
@@ -8983,7 +8983,7 @@ async function fh(t) {
|
|
|
8983
8983
|
sessions: n.sessions
|
|
8984
8984
|
}).execute();
|
|
8985
8985
|
await t.schema.alterTable("tenants").dropColumn("idle_session_lifetime").dropColumn("session_lifetime").dropColumn("session_cookie").dropColumn("enable_client_connections").dropColumn("default_redirection_uri").dropColumn("enabled_locales").dropColumn("default_directory").dropColumn("error_page").dropColumn("flags").dropColumn("friendly_name").dropColumn("picture_url").dropColumn("support_email").dropColumn("sandbox_version").dropColumn("sandbox_versions_available").dropColumn("change_password").dropColumn("guardian_mfa_page").dropColumn("default_audience").dropColumn("default_organization").dropColumn("sessions").execute(), await t.schema.alterTable("tenants").addColumn("name", "varchar(255)").execute(), await t.updateTable("tenants").set({
|
|
8986
|
-
name:
|
|
8986
|
+
name: p`COALESCE(friendly_name, id)`
|
|
8987
8987
|
}).execute(), await t.schema.alterTable("tenants").addColumn("language", "varchar(255)").execute(), await t.schema.alterTable("tenants").addColumn("logo", "text").execute(), await t.schema.alterTable("tenants").addColumn("primary_color", "varchar(50)").execute(), await t.schema.alterTable("tenants").addColumn("secondary_color", "varchar(50)").execute();
|
|
8988
8988
|
}
|
|
8989
8989
|
const ph = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|