@authhero/kysely-adapter 7.0.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kysely-adapter.cjs +1 -1
- package/dist/kysely-adapter.d.ts +180 -42
- package/dist/kysely-adapter.mjs +349 -297
- package/package.json +2 -2
package/dist/kysely-adapter.mjs
CHANGED
|
@@ -3,9 +3,9 @@ var de = (t) => {
|
|
|
3
3
|
throw TypeError(t);
|
|
4
4
|
};
|
|
5
5
|
var Je = (t, e, a) => e in t ? Ee(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a;
|
|
6
|
-
var j = (t, e, a) => Je(t, typeof e != "symbol" ? e + "" : e, a),
|
|
7
|
-
var
|
|
8
|
-
import { parseUserId as Y, codeSchema as ze, connectionSchema as Re, loginSchema as
|
|
6
|
+
var j = (t, e, a) => Je(t, typeof e != "symbol" ? e + "" : e, a), K = (t, e, a) => e.has(t) || de("Cannot " + a);
|
|
7
|
+
var d = (t, e, a) => (K(t, e, "read from private field"), a ? a.call(t) : e.get(t)), w = (t, e, a) => e.has(t) ? de("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, a), M = (t, e, a, r) => (K(t, e, "write to private field"), r ? r.call(t, a) : e.set(t, a), a), u = (t, e, a) => (K(t, e, "access private method"), a);
|
|
8
|
+
import { parseUserId as Y, codeSchema as ze, connectionSchema as Re, loginSchema as Ke, promptSettingSchema as Ue } from "@authhero/adapter-interfaces";
|
|
9
9
|
import "@hono/zod-openapi";
|
|
10
10
|
var V = class extends Error {
|
|
11
11
|
constructor(e = 500, a) {
|
|
@@ -50,13 +50,13 @@ function Be(t) {
|
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function _(t) {
|
|
54
54
|
const e = { ...t };
|
|
55
55
|
for (const a in e)
|
|
56
|
-
e[a] === null ? delete e[a] : typeof e[a] == "object" && (Array.isArray(e[a]) ? e[a] = e[a].map(
|
|
56
|
+
e[a] === null ? delete e[a] : typeof e[a] == "object" && (Array.isArray(e[a]) ? e[a] = e[a].map(_) : e[a] = _(e[a]));
|
|
57
57
|
return e;
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function fe(t) {
|
|
60
60
|
let e = {};
|
|
61
61
|
try {
|
|
62
62
|
e = JSON.parse(t.profileData || "{}");
|
|
@@ -83,7 +83,7 @@ function Qe(t) {
|
|
|
83
83
|
]);
|
|
84
84
|
if (!r)
|
|
85
85
|
return null;
|
|
86
|
-
const { tenant_id: n, ...s } = r,
|
|
86
|
+
const { tenant_id: n, ...s } = r, c = {
|
|
87
87
|
...s,
|
|
88
88
|
email: r.email || "",
|
|
89
89
|
email_verified: r.email_verified === 1,
|
|
@@ -97,21 +97,21 @@ function Qe(t) {
|
|
|
97
97
|
user_id: Y(r.user_id).id,
|
|
98
98
|
isSocial: !!r.is_social
|
|
99
99
|
},
|
|
100
|
-
...o.map(
|
|
100
|
+
...o.map(fe)
|
|
101
101
|
]
|
|
102
102
|
};
|
|
103
|
-
return
|
|
103
|
+
return _(c);
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
function T(t, e, a, r) {
|
|
107
107
|
return a.split(/\s+/).map((n) => n.replace(/^([^:]+)=/g, "$1:")).map((n) => {
|
|
108
|
-
let s = n.startsWith("-"),
|
|
109
|
-
return n.startsWith("-_exists_:") ? (
|
|
110
|
-
}).forEach(({ key: n, value: s, isNegation:
|
|
108
|
+
let s = n.startsWith("-"), c, l, g, m;
|
|
109
|
+
return n.startsWith("-_exists_:") ? (c = n.substring(10), g = !0, s = !0) : n.startsWith("_exists_:") ? (c = n.substring(9), g = !0, s = !1) : n.includes(":") ? (s = n.startsWith("-"), [c, l] = s ? n.substring(1).split(":") : n.split(":"), g = !1, l.startsWith(">=") ? (m = ">=", l = l.substring(2)) : l.startsWith(">") ? (m = ">", l = l.substring(1)) : l.startsWith("<=") ? (m = "<=", l = l.substring(2)) : l.startsWith("<") ? (m = "<", l = l.substring(1)) : m = "=") : (c = null, l = n, g = !1), { key: c, value: l, isNegation: s, isExistsQuery: g, operator: m };
|
|
110
|
+
}).forEach(({ key: n, value: s, isNegation: c, isExistsQuery: l, operator: g }) => {
|
|
111
111
|
if (n)
|
|
112
|
-
if (
|
|
113
|
-
|
|
114
|
-
else if (
|
|
112
|
+
if (l)
|
|
113
|
+
c ? e = e.where(n, "is", null) : e = e.where(n, "is not", null);
|
|
114
|
+
else if (c)
|
|
115
115
|
switch (g) {
|
|
116
116
|
case ">":
|
|
117
117
|
e = e.where(n, "<=", s);
|
|
@@ -154,11 +154,11 @@ function Ve(t) {
|
|
|
154
154
|
const { ref: m } = t.dynamic;
|
|
155
155
|
r = r.orderBy(m(a.sort.sort_by), a.sort.sort_order);
|
|
156
156
|
}
|
|
157
|
-
const n = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), s = n.map((m) => m.user_id),
|
|
158
|
-
const y =
|
|
157
|
+
const n = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), s = n.map((m) => m.user_id), c = s.length ? await t.selectFrom("users").selectAll().where("users.tenant_id", "=", e).where("users.linked_to", "in", s).execute() : [], l = n.map((m) => {
|
|
158
|
+
const y = c.filter(
|
|
159
159
|
(x) => x.linked_to === m.user_id
|
|
160
160
|
);
|
|
161
|
-
return
|
|
161
|
+
return _({
|
|
162
162
|
...m,
|
|
163
163
|
email_verified: m.email_verified === 1,
|
|
164
164
|
is_social: m.is_social === 1,
|
|
@@ -171,22 +171,22 @@ function Ve(t) {
|
|
|
171
171
|
user_id: Y(m.user_id).id,
|
|
172
172
|
isSocial: !!m.is_social
|
|
173
173
|
},
|
|
174
|
-
...y.map(
|
|
174
|
+
...y.map(fe)
|
|
175
175
|
]
|
|
176
176
|
});
|
|
177
177
|
}), { count: g } = await r.select((m) => m.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
178
178
|
return {
|
|
179
|
-
users:
|
|
179
|
+
users: l,
|
|
180
180
|
start: a.page * a.per_page,
|
|
181
181
|
limit: a.per_page,
|
|
182
182
|
length: b(g)
|
|
183
183
|
};
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function qe(t) {
|
|
187
187
|
return async (e, a) => (await t.deleteFrom("users").where("users.tenant_id", "=", e).where("users.linked_to", "=", a).execute(), (await t.deleteFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", a).execute()).length === 1);
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
function We(t) {
|
|
190
190
|
if (t.email_verified !== void 0)
|
|
191
191
|
return t.email_verified ? 1 : 0;
|
|
192
192
|
}
|
|
@@ -194,7 +194,7 @@ function Ge(t) {
|
|
|
194
194
|
return async (e, a, r) => {
|
|
195
195
|
const o = {
|
|
196
196
|
...r,
|
|
197
|
-
email_verified:
|
|
197
|
+
email_verified: We(r),
|
|
198
198
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
199
199
|
};
|
|
200
200
|
return r.app_metadata && (o.app_metadata = JSON.stringify(r.app_metadata)), r.user_metadata && (o.user_metadata = JSON.stringify(r.user_metadata)), (await t.updateTable("users").set(o).where("users.tenant_id", "=", e).where("users.user_id", "=", a).execute()).length === 1;
|
|
@@ -209,7 +209,7 @@ function He(t) {
|
|
|
209
209
|
function Xe(t) {
|
|
210
210
|
return {
|
|
211
211
|
create: Be(t),
|
|
212
|
-
remove:
|
|
212
|
+
remove: qe(t),
|
|
213
213
|
get: Qe(t),
|
|
214
214
|
list: Ve(t),
|
|
215
215
|
update: Ge(t),
|
|
@@ -238,7 +238,7 @@ function Ze(t) {
|
|
|
238
238
|
function et(t) {
|
|
239
239
|
return async (e) => {
|
|
240
240
|
const a = await t.selectFrom("tenants").where("tenants.id", "=", e).selectAll().executeTakeFirst();
|
|
241
|
-
return a ?
|
|
241
|
+
return a ? _(a) : null;
|
|
242
242
|
};
|
|
243
243
|
}
|
|
244
244
|
function tt(t) {
|
|
@@ -249,18 +249,18 @@ function tt(t) {
|
|
|
249
249
|
}) => {
|
|
250
250
|
let a = t.selectFrom("tenants");
|
|
251
251
|
if (e.sort && e.sort.sort_by) {
|
|
252
|
-
const { ref:
|
|
253
|
-
a = a.orderBy(
|
|
252
|
+
const { ref: c } = t.dynamic;
|
|
253
|
+
a = a.orderBy(c(e.sort.sort_by), e.sort.sort_order);
|
|
254
254
|
}
|
|
255
|
-
e.q && (a = a.where((
|
|
255
|
+
e.q && (a = a.where((c) => c.or([c("name", "like", `%${e.q}%`)])));
|
|
256
256
|
const o = await a.offset(e.page * e.per_page).limit(e.per_page).selectAll().execute();
|
|
257
257
|
if (!e.include_totals)
|
|
258
258
|
return {
|
|
259
259
|
tenants: o
|
|
260
260
|
};
|
|
261
|
-
const { count: n } = await a.select((
|
|
261
|
+
const { count: n } = await a.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), s = b(n);
|
|
262
262
|
return {
|
|
263
|
-
tenants: o.map(
|
|
263
|
+
tenants: o.map(_),
|
|
264
264
|
start: (e.page - 1) * e.per_page,
|
|
265
265
|
limit: e.per_page,
|
|
266
266
|
length: s
|
|
@@ -345,14 +345,14 @@ function it(t) {
|
|
|
345
345
|
a.q && (r = T(t, r, a.q, ["user_id", "ip"]));
|
|
346
346
|
let o = r;
|
|
347
347
|
if (a.sort && a.sort.sort_by) {
|
|
348
|
-
const { ref:
|
|
348
|
+
const { ref: c } = t.dynamic;
|
|
349
349
|
o = o.orderBy(
|
|
350
|
-
|
|
350
|
+
c(a.sort.sort_by),
|
|
351
351
|
a.sort.sort_order
|
|
352
352
|
);
|
|
353
353
|
}
|
|
354
354
|
o = o.offset(a.page * a.per_page).limit(a.per_page);
|
|
355
|
-
const n = await o.selectAll().execute(), { count: s } = await r.select((
|
|
355
|
+
const n = await o.selectAll().execute(), { count: s } = await r.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
356
356
|
return {
|
|
357
357
|
logs: n.map(pe),
|
|
358
358
|
start: a.page * a.per_page,
|
|
@@ -361,17 +361,17 @@ function it(t) {
|
|
|
361
361
|
};
|
|
362
362
|
};
|
|
363
363
|
}
|
|
364
|
-
function
|
|
364
|
+
function ct(t) {
|
|
365
365
|
return async (e, a) => {
|
|
366
366
|
const r = await t.selectFrom("logs").where("logs.tenant_id", "=", e).where("logs.id", "=", a).selectAll().executeTakeFirst();
|
|
367
367
|
return r ? pe(r) : null;
|
|
368
368
|
};
|
|
369
369
|
}
|
|
370
|
-
function
|
|
370
|
+
function lt(t) {
|
|
371
371
|
return {
|
|
372
372
|
create: st(t),
|
|
373
373
|
list: it(t),
|
|
374
|
-
get:
|
|
374
|
+
get: ct(t)
|
|
375
375
|
};
|
|
376
376
|
}
|
|
377
377
|
function dt(t) {
|
|
@@ -379,10 +379,9 @@ function dt(t) {
|
|
|
379
379
|
const r = await t.selectFrom("sessions").where("sessions.tenant_id", "=", e).where("sessions.id", "=", a).where("sessions.revoked_at", "is", null).selectAll().executeTakeFirst();
|
|
380
380
|
if (!r)
|
|
381
381
|
return null;
|
|
382
|
-
const { tenant_id: o, device: n, clients: s, ...
|
|
382
|
+
const { tenant_id: o, device: n, clients: s, ...c } = r;
|
|
383
383
|
return {
|
|
384
|
-
...
|
|
385
|
-
id: d,
|
|
384
|
+
...c,
|
|
386
385
|
device: JSON.parse(n),
|
|
387
386
|
clients: JSON.parse(s)
|
|
388
387
|
};
|
|
@@ -392,8 +391,6 @@ function ut(t) {
|
|
|
392
391
|
return async (e, a) => {
|
|
393
392
|
const r = {
|
|
394
393
|
...a,
|
|
395
|
-
// fallback untill we changed primary key
|
|
396
|
-
session_id: a.id,
|
|
397
394
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
398
395
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
399
396
|
authenticated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -421,7 +418,7 @@ function ht(t) {
|
|
|
421
418
|
return !!(await t.updateTable("sessions").set(o).where("tenant_id", "=", e).where("sessions.id", "=", a).execute()).length;
|
|
422
419
|
};
|
|
423
420
|
}
|
|
424
|
-
function
|
|
421
|
+
function _t(t) {
|
|
425
422
|
return async (e, a = {
|
|
426
423
|
page: 0,
|
|
427
424
|
per_page: 50,
|
|
@@ -431,31 +428,31 @@ function ft(t) {
|
|
|
431
428
|
a.q && (r = T(t, r, a.q, ["user_id", "session_id"]));
|
|
432
429
|
let o = r;
|
|
433
430
|
if (a.sort && a.sort.sort_by) {
|
|
434
|
-
const { ref:
|
|
431
|
+
const { ref: l } = t.dynamic;
|
|
435
432
|
o = o.orderBy(
|
|
436
|
-
|
|
433
|
+
l(a.sort.sort_by),
|
|
437
434
|
a.sort.sort_order
|
|
438
435
|
);
|
|
439
436
|
}
|
|
440
437
|
o = o.offset(a.page * a.per_page).limit(a.per_page);
|
|
441
|
-
const n = await o.selectAll().execute(), { count: s } = await r.select((
|
|
438
|
+
const n = await o.selectAll().execute(), { count: s } = await r.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow(), c = b(s);
|
|
442
439
|
return {
|
|
443
|
-
sessions: n.map((
|
|
444
|
-
...
|
|
445
|
-
device: JSON.parse(
|
|
446
|
-
clients: JSON.parse(
|
|
440
|
+
sessions: n.map((l) => ({
|
|
441
|
+
...l,
|
|
442
|
+
device: JSON.parse(l.device),
|
|
443
|
+
clients: JSON.parse(l.clients)
|
|
447
444
|
})),
|
|
448
445
|
start: a.page * a.per_page,
|
|
449
446
|
limit: a.per_page,
|
|
450
|
-
length:
|
|
447
|
+
length: c
|
|
451
448
|
};
|
|
452
449
|
};
|
|
453
450
|
}
|
|
454
|
-
function
|
|
451
|
+
function ft(t) {
|
|
455
452
|
return {
|
|
456
453
|
create: ut(t),
|
|
457
454
|
get: dt(t),
|
|
458
|
-
list:
|
|
455
|
+
list: _t(t),
|
|
459
456
|
remove: mt(t),
|
|
460
457
|
update: ht(t)
|
|
461
458
|
};
|
|
@@ -500,11 +497,11 @@ function Nt(t) {
|
|
|
500
497
|
}) => {
|
|
501
498
|
let r = t.selectFrom("codes").where("codes.tenant_id", "=", e);
|
|
502
499
|
a.q && (r = T(t, r, a.q, ["code", "login_id"]));
|
|
503
|
-
const n = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), { count: s } = await r.select((
|
|
500
|
+
const n = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), { count: s } = await r.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
504
501
|
return {
|
|
505
|
-
codes: n.map((
|
|
506
|
-
const { tenant_id: g, ...m } =
|
|
507
|
-
return ze.parse(
|
|
502
|
+
codes: n.map((l) => {
|
|
503
|
+
const { tenant_id: g, ...m } = l;
|
|
504
|
+
return ze.parse(_(m));
|
|
508
505
|
}),
|
|
509
506
|
start: a.page * a.per_page,
|
|
510
507
|
limit: a.per_page,
|
|
@@ -532,7 +529,7 @@ function bt(t) {
|
|
|
532
529
|
let o = t.selectFrom("codes").where("codes.code_id", "=", a).where("codes.code_type", "=", r);
|
|
533
530
|
e.length && (o = o.where("codes.tenant_id", "=", e));
|
|
534
531
|
const n = await o.selectAll().executeTakeFirst();
|
|
535
|
-
return n ?
|
|
532
|
+
return n ? _(n) : null;
|
|
536
533
|
};
|
|
537
534
|
}
|
|
538
535
|
function xt(t) {
|
|
@@ -553,7 +550,7 @@ function St(t) {
|
|
|
553
550
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
554
551
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
555
552
|
...a
|
|
556
|
-
}, o = JSON.stringify(a.allowed_origins), n = JSON.stringify(a.callbacks), s = JSON.stringify(a.web_origins),
|
|
553
|
+
}, o = JSON.stringify(a.allowed_origins), n = JSON.stringify(a.callbacks), s = JSON.stringify(a.web_origins), c = JSON.stringify(a.allowed_logout_urls), l = JSON.stringify(a.allowed_clients);
|
|
557
554
|
return await t.insertInto("applications").values({
|
|
558
555
|
...r,
|
|
559
556
|
tenant_id: e,
|
|
@@ -562,8 +559,8 @@ function St(t) {
|
|
|
562
559
|
callbacks: n,
|
|
563
560
|
allowed_origins: o,
|
|
564
561
|
web_origins: s,
|
|
565
|
-
allowed_logout_urls:
|
|
566
|
-
allowed_clients:
|
|
562
|
+
allowed_logout_urls: c,
|
|
563
|
+
allowed_clients: l
|
|
567
564
|
}).execute(), r;
|
|
568
565
|
};
|
|
569
566
|
}
|
|
@@ -584,7 +581,7 @@ function Ot(t) {
|
|
|
584
581
|
function kt(t) {
|
|
585
582
|
return async (e, a) => {
|
|
586
583
|
const r = await t.selectFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", a).selectAll().executeTakeFirst();
|
|
587
|
-
return r ?
|
|
584
|
+
return r ? _({
|
|
588
585
|
...r,
|
|
589
586
|
disable_sign_ups: !!r.disable_sign_ups,
|
|
590
587
|
addons: JSON.parse(r.addons),
|
|
@@ -598,7 +595,7 @@ function kt(t) {
|
|
|
598
595
|
function $t(t) {
|
|
599
596
|
return async (e, a) => (await t.deleteFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", a).executeTakeFirst()).numDeletedRows > 0;
|
|
600
597
|
}
|
|
601
|
-
function
|
|
598
|
+
function Dt(t) {
|
|
602
599
|
return async (e, a, r) => {
|
|
603
600
|
const o = {
|
|
604
601
|
...r,
|
|
@@ -614,13 +611,13 @@ function It(t) {
|
|
|
614
611
|
return await t.updateTable("applications").set(o).where("applications.id", "=", a).where("applications.tenant_id", "=", e).execute(), !0;
|
|
615
612
|
};
|
|
616
613
|
}
|
|
617
|
-
function
|
|
614
|
+
function It(t) {
|
|
618
615
|
return {
|
|
619
616
|
create: St(t),
|
|
620
617
|
list: Ot(t),
|
|
621
618
|
get: kt(t),
|
|
622
619
|
remove: $t(t),
|
|
623
|
-
update:
|
|
620
|
+
update: Dt(t)
|
|
624
621
|
};
|
|
625
622
|
}
|
|
626
623
|
function Pt(t) {
|
|
@@ -648,16 +645,16 @@ function jt(t) {
|
|
|
648
645
|
let r = t.selectFrom("connections").where("connections.tenant_id", "=", e);
|
|
649
646
|
a.q && (r = T(t, r, a.q, ["user_id", "ip"]));
|
|
650
647
|
const s = (await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute()).map(
|
|
651
|
-
(
|
|
652
|
-
...
|
|
653
|
-
options: JSON.parse(
|
|
648
|
+
(l) => _({
|
|
649
|
+
...l,
|
|
650
|
+
options: JSON.parse(l.options)
|
|
654
651
|
})
|
|
655
|
-
), { count:
|
|
652
|
+
), { count: c } = await r.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
656
653
|
return {
|
|
657
654
|
connections: s,
|
|
658
655
|
start: a.page * a.per_page,
|
|
659
656
|
limit: a.per_page,
|
|
660
|
-
length: b(
|
|
657
|
+
length: b(c)
|
|
661
658
|
};
|
|
662
659
|
};
|
|
663
660
|
}
|
|
@@ -667,7 +664,7 @@ function Mt(t) {
|
|
|
667
664
|
function At(t) {
|
|
668
665
|
return async (e, a) => {
|
|
669
666
|
const r = await t.selectFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", a).selectAll().executeTakeFirst();
|
|
670
|
-
return r ?
|
|
667
|
+
return r ? _({
|
|
671
668
|
...r,
|
|
672
669
|
options: JSON.parse(r.options)
|
|
673
670
|
}) : null;
|
|
@@ -707,10 +704,10 @@ function Et(t) {
|
|
|
707
704
|
return {
|
|
708
705
|
...a,
|
|
709
706
|
connections: o.map(
|
|
710
|
-
(
|
|
711
|
-
|
|
712
|
-
...
|
|
713
|
-
options:
|
|
707
|
+
(c) => Re.parse(
|
|
708
|
+
_({
|
|
709
|
+
...c,
|
|
710
|
+
options: c.options ? JSON.parse(c.options) : {}
|
|
714
711
|
})
|
|
715
712
|
)
|
|
716
713
|
),
|
|
@@ -721,7 +718,7 @@ function Et(t) {
|
|
|
721
718
|
web_origins: a.web_origins ? JSON.parse(a.web_origins) : [],
|
|
722
719
|
allowed_logout_urls: a.allowed_logout_urls ? JSON.parse(a.allowed_logout_urls) : [],
|
|
723
720
|
allowed_clients: a.allowed_clients ? JSON.parse(a.allowed_clients) : [],
|
|
724
|
-
tenant:
|
|
721
|
+
tenant: _(r),
|
|
725
722
|
// this is really an integer in the database
|
|
726
723
|
disable_sign_ups: !!a.disable_sign_ups
|
|
727
724
|
};
|
|
@@ -744,14 +741,14 @@ function zt(t) {
|
|
|
744
741
|
function Rt(t) {
|
|
745
742
|
return async (e, a) => !!(await t.updateTable("keys").set(a).where("kid", "=", e).execute()).length;
|
|
746
743
|
}
|
|
747
|
-
function
|
|
744
|
+
function Kt(t) {
|
|
748
745
|
return {
|
|
749
746
|
create: zt(t),
|
|
750
747
|
list: Jt(t),
|
|
751
748
|
update: Rt(t)
|
|
752
749
|
};
|
|
753
750
|
}
|
|
754
|
-
function
|
|
751
|
+
function Ut(t) {
|
|
755
752
|
return async (e, a) => {
|
|
756
753
|
const r = {
|
|
757
754
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -767,7 +764,7 @@ function Bt(t) {
|
|
|
767
764
|
return async (e, a) => {
|
|
768
765
|
let r = t.selectFrom("domains").where("domains.tenant_id", "=", e);
|
|
769
766
|
a.q && (r = T(t, r, a.q, ["user_id", "ip"]));
|
|
770
|
-
const n = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), { count: s } = await r.select((
|
|
767
|
+
const n = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), { count: s } = await r.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
771
768
|
return {
|
|
772
769
|
domains: n,
|
|
773
770
|
start: a.page * a.per_page,
|
|
@@ -778,7 +775,7 @@ function Bt(t) {
|
|
|
778
775
|
}
|
|
779
776
|
function Qt(t) {
|
|
780
777
|
return {
|
|
781
|
-
create:
|
|
778
|
+
create: Ut(t),
|
|
782
779
|
list: Bt(t)
|
|
783
780
|
};
|
|
784
781
|
}
|
|
@@ -792,36 +789,36 @@ function Vt(t) {
|
|
|
792
789
|
colors_primary: o,
|
|
793
790
|
colors_page_background_type: n,
|
|
794
791
|
colors_page_background_start: s,
|
|
795
|
-
colors_page_background_end:
|
|
796
|
-
colors_page_background_angle_dev:
|
|
792
|
+
colors_page_background_end: c,
|
|
793
|
+
colors_page_background_angle_dev: l,
|
|
797
794
|
font_url: g,
|
|
798
795
|
...m
|
|
799
796
|
} = a;
|
|
800
|
-
return
|
|
797
|
+
return _({
|
|
801
798
|
...m,
|
|
802
799
|
colors: {
|
|
803
800
|
primary: o,
|
|
804
801
|
page_background: {
|
|
805
802
|
type: n,
|
|
806
803
|
start: s,
|
|
807
|
-
end:
|
|
808
|
-
angle_deg:
|
|
804
|
+
end: c,
|
|
805
|
+
angle_deg: l
|
|
809
806
|
}
|
|
810
807
|
},
|
|
811
808
|
font: g ? { url: g } : void 0
|
|
812
809
|
});
|
|
813
810
|
};
|
|
814
811
|
}
|
|
815
|
-
function
|
|
812
|
+
function qt(t) {
|
|
816
813
|
return async (e, a) => {
|
|
817
|
-
var s,
|
|
814
|
+
var s, c, l, g, m, y, x, Z, ee, te, ae, re, ne, oe, se, ie, ce, le;
|
|
818
815
|
const { colors: r, font: o, ...n } = a;
|
|
819
816
|
try {
|
|
820
817
|
await t.insertInto("branding").values({
|
|
821
818
|
...n,
|
|
822
819
|
colors_primary: r == null ? void 0 : r.primary,
|
|
823
|
-
colors_page_background_type: (
|
|
824
|
-
colors_page_background_start: (g = (
|
|
820
|
+
colors_page_background_type: (c = (s = a.colors) == null ? void 0 : s.page_background) == null ? void 0 : c.type,
|
|
821
|
+
colors_page_background_start: (g = (l = a.colors) == null ? void 0 : l.page_background) == null ? void 0 : g.start,
|
|
825
822
|
colors_page_background_end: (y = (m = a.colors) == null ? void 0 : m.page_background) == null ? void 0 : y.end,
|
|
826
823
|
colors_page_background_angle_dev: (Z = (x = a.colors) == null ? void 0 : x.page_background) == null ? void 0 : Z.angle_deg,
|
|
827
824
|
font_url: (ee = a.font) == null ? void 0 : ee.url,
|
|
@@ -834,16 +831,16 @@ function Wt(t) {
|
|
|
834
831
|
colors_page_background_type: (ae = (te = a.colors) == null ? void 0 : te.page_background) == null ? void 0 : ae.type,
|
|
835
832
|
colors_page_background_start: (ne = (re = a.colors) == null ? void 0 : re.page_background) == null ? void 0 : ne.start,
|
|
836
833
|
colors_page_background_end: (se = (oe = a.colors) == null ? void 0 : oe.page_background) == null ? void 0 : se.end,
|
|
837
|
-
colors_page_background_angle_dev: (
|
|
838
|
-
font_url: (
|
|
834
|
+
colors_page_background_angle_dev: (ce = (ie = a.colors) == null ? void 0 : ie.page_background) == null ? void 0 : ce.angle_deg,
|
|
835
|
+
font_url: (le = a.font) == null ? void 0 : le.url
|
|
839
836
|
}).where("tenant_id", "=", e).execute();
|
|
840
837
|
}
|
|
841
838
|
};
|
|
842
839
|
}
|
|
843
|
-
function
|
|
840
|
+
function Wt(t) {
|
|
844
841
|
return {
|
|
845
842
|
get: Vt(t),
|
|
846
|
-
set:
|
|
843
|
+
set: qt(t)
|
|
847
844
|
};
|
|
848
845
|
}
|
|
849
846
|
function Gt(t) {
|
|
@@ -854,11 +851,11 @@ function Gt(t) {
|
|
|
854
851
|
}) => {
|
|
855
852
|
let r = t.selectFrom("hooks").where("hooks.tenant_id", "=", e);
|
|
856
853
|
a.q && (r = T(t, r, a.q, ["url"]));
|
|
857
|
-
const n = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), { count: s } = await r.select((
|
|
854
|
+
const n = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), { count: s } = await r.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
858
855
|
return {
|
|
859
|
-
hooks: n.map((
|
|
860
|
-
const { tenant_id: g, enabled: m, synchronous: y, ...x } =
|
|
861
|
-
return
|
|
856
|
+
hooks: n.map((l) => {
|
|
857
|
+
const { tenant_id: g, enabled: m, synchronous: y, ...x } = l;
|
|
858
|
+
return _({
|
|
862
859
|
...x,
|
|
863
860
|
enabled: !!m,
|
|
864
861
|
synchronous: !!y
|
|
@@ -873,7 +870,7 @@ function Gt(t) {
|
|
|
873
870
|
function Ht(t) {
|
|
874
871
|
return async (e, a) => {
|
|
875
872
|
const r = await t.selectFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", a).selectAll().executeTakeFirst();
|
|
876
|
-
return r ?
|
|
873
|
+
return r ? _({
|
|
877
874
|
...r,
|
|
878
875
|
enabled: !!r.enabled,
|
|
879
876
|
synchronous: !!r.synchronous
|
|
@@ -962,7 +959,7 @@ function ra(t) {
|
|
|
962
959
|
function na(t) {
|
|
963
960
|
return async (e, a) => {
|
|
964
961
|
const r = await t.selectFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", a).selectAll().executeTakeFirst();
|
|
965
|
-
return r ?
|
|
962
|
+
return r ? _(r) : null;
|
|
966
963
|
};
|
|
967
964
|
}
|
|
968
965
|
function oa(t) {
|
|
@@ -985,12 +982,12 @@ function sa(t) {
|
|
|
985
982
|
function ia(t) {
|
|
986
983
|
return async (e, a) => {
|
|
987
984
|
const r = (/* @__PURE__ */ new Date()).toISOString(), o = await t.selectFrom("logins").where("logins.expires_at", ">", r).where("logins.login_id", "=", a).selectAll().executeTakeFirst();
|
|
988
|
-
return o ?
|
|
989
|
-
ta(
|
|
985
|
+
return o ? Ke.parse(
|
|
986
|
+
ta(_(o), ["authParams"])
|
|
990
987
|
) : null;
|
|
991
988
|
};
|
|
992
989
|
}
|
|
993
|
-
function
|
|
990
|
+
function ca(t) {
|
|
994
991
|
return async (e, a) => {
|
|
995
992
|
const r = {
|
|
996
993
|
login_id: k(),
|
|
@@ -1001,7 +998,7 @@ function la(t) {
|
|
|
1001
998
|
return await t.insertInto("logins").values({ ...J(r), tenant_id: e }).execute(), r;
|
|
1002
999
|
};
|
|
1003
1000
|
}
|
|
1004
|
-
function
|
|
1001
|
+
function la(t) {
|
|
1005
1002
|
return async (e, a, r) => (await t.updateTable("logins").set(J(r)).where("logins.login_id", "=", a).where("logins.tenant_id", "=", e).execute()).length === 1;
|
|
1006
1003
|
}
|
|
1007
1004
|
function da(t) {
|
|
@@ -1009,16 +1006,16 @@ function da(t) {
|
|
|
1009
1006
|
}
|
|
1010
1007
|
function ua(t) {
|
|
1011
1008
|
return {
|
|
1012
|
-
create:
|
|
1009
|
+
create: ca(t),
|
|
1013
1010
|
get: ia(t),
|
|
1014
|
-
update:
|
|
1011
|
+
update: la(t),
|
|
1015
1012
|
remove: da(t)
|
|
1016
1013
|
};
|
|
1017
1014
|
}
|
|
1018
1015
|
function ma(t) {
|
|
1019
1016
|
return async (e) => {
|
|
1020
1017
|
const [a] = await t.selectFrom("prompt_settings").where("prompt_settings.tenant_id", "=", e).selectAll().execute();
|
|
1021
|
-
return
|
|
1018
|
+
return _({
|
|
1022
1019
|
identifier_first: !!(a != null && a.identifier_first),
|
|
1023
1020
|
password_first: !!(a != null && a.password_first),
|
|
1024
1021
|
webauthn_platform_first_factor: !!(a != null && a.webauthn_platform_first_factor),
|
|
@@ -1027,7 +1024,7 @@ function ma(t) {
|
|
|
1027
1024
|
};
|
|
1028
1025
|
}
|
|
1029
1026
|
function he(t) {
|
|
1030
|
-
return
|
|
1027
|
+
return _({
|
|
1031
1028
|
...t,
|
|
1032
1029
|
webauthn_platform_first_factor: t.webauthn_platform_first_factor ? !!t.webauthn_platform_first_factor : void 0,
|
|
1033
1030
|
identifier_first: t.identifier_first ? !!t.identifier_first : void 0,
|
|
@@ -1038,7 +1035,7 @@ function he(t) {
|
|
|
1038
1035
|
function ha(t) {
|
|
1039
1036
|
return async (e, a) => {
|
|
1040
1037
|
try {
|
|
1041
|
-
const r =
|
|
1038
|
+
const r = Ue.parse(a);
|
|
1042
1039
|
await t.insertInto("prompt_settings").values({
|
|
1043
1040
|
...he(r),
|
|
1044
1041
|
tenant_id: e
|
|
@@ -1048,13 +1045,13 @@ function ha(t) {
|
|
|
1048
1045
|
}
|
|
1049
1046
|
};
|
|
1050
1047
|
}
|
|
1051
|
-
function
|
|
1048
|
+
function _a(t) {
|
|
1052
1049
|
return {
|
|
1053
1050
|
get: ma(t),
|
|
1054
1051
|
set: ha(t)
|
|
1055
1052
|
};
|
|
1056
1053
|
}
|
|
1057
|
-
function
|
|
1054
|
+
function fa(t) {
|
|
1058
1055
|
return async (e) => {
|
|
1059
1056
|
const [a] = await t.selectFrom("email_providers").where("email_providers.tenant_id", "=", e).selectAll().execute();
|
|
1060
1057
|
if (!a)
|
|
@@ -1064,10 +1061,10 @@ function _a(t) {
|
|
|
1064
1061
|
credentials: o,
|
|
1065
1062
|
settings: n,
|
|
1066
1063
|
enabled: s,
|
|
1067
|
-
...
|
|
1064
|
+
...c
|
|
1068
1065
|
} = a;
|
|
1069
|
-
return
|
|
1070
|
-
...
|
|
1066
|
+
return _({
|
|
1067
|
+
...c,
|
|
1071
1068
|
credentials: JSON.parse(o),
|
|
1072
1069
|
settings: JSON.parse(n),
|
|
1073
1070
|
enabled: !!s
|
|
@@ -1101,13 +1098,21 @@ function ga(t) {
|
|
|
1101
1098
|
}
|
|
1102
1099
|
function wa(t) {
|
|
1103
1100
|
return {
|
|
1104
|
-
get:
|
|
1101
|
+
get: fa(t),
|
|
1105
1102
|
create: ga(t),
|
|
1106
1103
|
update: pa(t)
|
|
1107
1104
|
};
|
|
1108
1105
|
}
|
|
1109
1106
|
function ya(t) {
|
|
1110
|
-
return async (e, a) =>
|
|
1107
|
+
return async (e, a) => {
|
|
1108
|
+
const r = await t.selectFrom("refresh_tokens").where("refresh_tokens.tenant_id", "=", e).where("refresh_tokens.token", "=", a).selectAll().executeTakeFirst();
|
|
1109
|
+
return r ? {
|
|
1110
|
+
...r,
|
|
1111
|
+
rotating: !!r.rotating,
|
|
1112
|
+
device: r.device ? JSON.parse(r.device) : {},
|
|
1113
|
+
resource_servers: r.resource_servers ? JSON.parse(r.resource_servers) : []
|
|
1114
|
+
} : null;
|
|
1115
|
+
};
|
|
1111
1116
|
}
|
|
1112
1117
|
function Na(t) {
|
|
1113
1118
|
return async (e, a) => {
|
|
@@ -1115,14 +1120,28 @@ function Na(t) {
|
|
|
1115
1120
|
...a,
|
|
1116
1121
|
created_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1117
1122
|
};
|
|
1118
|
-
return await t.insertInto("refresh_tokens").values({
|
|
1123
|
+
return await t.insertInto("refresh_tokens").values({
|
|
1124
|
+
...r,
|
|
1125
|
+
tenant_id: e,
|
|
1126
|
+
rotating: a.rotating ? 1 : 0,
|
|
1127
|
+
device: JSON.stringify(a.device),
|
|
1128
|
+
resource_servers: JSON.stringify(a.resource_servers)
|
|
1129
|
+
}).execute(), { ...a, ...r };
|
|
1119
1130
|
};
|
|
1120
1131
|
}
|
|
1121
1132
|
function va(t) {
|
|
1122
1133
|
return async (e, a) => !!(await t.deleteFrom("refresh_tokens").where("tenant_id", "=", e).where("refresh_tokens.token", "=", a).execute()).length;
|
|
1123
1134
|
}
|
|
1124
1135
|
function Ca(t) {
|
|
1125
|
-
return async (e, a, r) =>
|
|
1136
|
+
return async (e, a, r) => {
|
|
1137
|
+
const o = {
|
|
1138
|
+
...r,
|
|
1139
|
+
device: r.device ? JSON.stringify(r.device) : void 0,
|
|
1140
|
+
resource_servers: r.resource_servers ? JSON.stringify(r.resource_servers) : void 0,
|
|
1141
|
+
rotating: r.rotating ? 1 : 0
|
|
1142
|
+
};
|
|
1143
|
+
return !!(await t.updateTable("refresh_tokens").set(o).where("tenant_id", "=", e).where("refresh_tokens.token", "=", a).execute()).length;
|
|
1144
|
+
};
|
|
1126
1145
|
}
|
|
1127
1146
|
function ba(t) {
|
|
1128
1147
|
return async (e, a = {
|
|
@@ -1134,19 +1153,24 @@ function ba(t) {
|
|
|
1134
1153
|
a.q && (r = T(t, r, a.q, ["token", "session_id"]));
|
|
1135
1154
|
let o = r;
|
|
1136
1155
|
if (a.sort && a.sort.sort_by) {
|
|
1137
|
-
const { ref:
|
|
1156
|
+
const { ref: l } = t.dynamic;
|
|
1138
1157
|
o = o.orderBy(
|
|
1139
|
-
|
|
1158
|
+
l(a.sort.sort_by),
|
|
1140
1159
|
a.sort.sort_order
|
|
1141
1160
|
);
|
|
1142
1161
|
}
|
|
1143
1162
|
o = o.offset(a.page * a.per_page).limit(a.per_page);
|
|
1144
|
-
const n = await o.selectAll().execute(), { count: s } = await r.select((
|
|
1163
|
+
const n = await o.selectAll().execute(), { count: s } = await r.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow(), c = b(s);
|
|
1145
1164
|
return {
|
|
1146
|
-
refresh_tokens: n
|
|
1165
|
+
refresh_tokens: n.map((l) => ({
|
|
1166
|
+
...l,
|
|
1167
|
+
rotating: !!l.rotating,
|
|
1168
|
+
device: l.device ? JSON.parse(l.device) : {},
|
|
1169
|
+
resource_servers: l.resource_servers ? JSON.parse(l.resource_servers) : []
|
|
1170
|
+
})),
|
|
1147
1171
|
start: a.page * a.per_page,
|
|
1148
1172
|
limit: a.per_page,
|
|
1149
|
-
length:
|
|
1173
|
+
length: c
|
|
1150
1174
|
};
|
|
1151
1175
|
};
|
|
1152
1176
|
}
|
|
@@ -1175,7 +1199,7 @@ const z = p({
|
|
|
1175
1199
|
name: t
|
|
1176
1200
|
});
|
|
1177
1201
|
}
|
|
1178
|
-
}),
|
|
1202
|
+
}), q = p({
|
|
1179
1203
|
is(t) {
|
|
1180
1204
|
return t.kind === "SchemableIdentifierNode";
|
|
1181
1205
|
},
|
|
@@ -1203,20 +1227,20 @@ const z = p({
|
|
|
1203
1227
|
alias: e
|
|
1204
1228
|
});
|
|
1205
1229
|
}
|
|
1206
|
-
}),
|
|
1230
|
+
}), U = p({
|
|
1207
1231
|
is(t) {
|
|
1208
1232
|
return t.kind === "TableNode";
|
|
1209
1233
|
},
|
|
1210
1234
|
create(t) {
|
|
1211
1235
|
return p({
|
|
1212
1236
|
kind: "TableNode",
|
|
1213
|
-
table:
|
|
1237
|
+
table: q.create(t)
|
|
1214
1238
|
});
|
|
1215
1239
|
},
|
|
1216
1240
|
createWithSchema(t, e) {
|
|
1217
1241
|
return p({
|
|
1218
1242
|
kind: "TableNode",
|
|
1219
|
-
table:
|
|
1243
|
+
table: q.createWithSchema(t, e)
|
|
1220
1244
|
});
|
|
1221
1245
|
}
|
|
1222
1246
|
});
|
|
@@ -1328,7 +1352,7 @@ class Oa {
|
|
|
1328
1352
|
return this.nodeStack.pop(), p(a);
|
|
1329
1353
|
}
|
|
1330
1354
|
transformNodeImpl(e) {
|
|
1331
|
-
return
|
|
1355
|
+
return d(this, R)[e.kind](e);
|
|
1332
1356
|
}
|
|
1333
1357
|
transformNodeList(e) {
|
|
1334
1358
|
return e && p(e.map((a) => this.transformNode(a)));
|
|
@@ -2074,88 +2098,88 @@ const ka = p({
|
|
|
2074
2098
|
UpdateQueryNode: !0,
|
|
2075
2099
|
MergeQueryNode: !0
|
|
2076
2100
|
});
|
|
2077
|
-
var P, S, O,
|
|
2101
|
+
var P, S, O, f, ge, we, ye, $, W, Ne;
|
|
2078
2102
|
class $a extends Oa {
|
|
2079
2103
|
constructor(a) {
|
|
2080
2104
|
super();
|
|
2081
|
-
w(this,
|
|
2105
|
+
w(this, f);
|
|
2082
2106
|
w(this, P);
|
|
2083
2107
|
w(this, S, /* @__PURE__ */ new Set());
|
|
2084
2108
|
w(this, O, /* @__PURE__ */ new Set());
|
|
2085
2109
|
M(this, P, a);
|
|
2086
2110
|
}
|
|
2087
2111
|
transformNodeImpl(a) {
|
|
2088
|
-
if (!u(this,
|
|
2112
|
+
if (!u(this, f, ge).call(this, a))
|
|
2089
2113
|
return super.transformNodeImpl(a);
|
|
2090
|
-
const r = u(this,
|
|
2114
|
+
const r = u(this, f, ye).call(this, a);
|
|
2091
2115
|
for (const s of r)
|
|
2092
|
-
|
|
2093
|
-
const o = u(this,
|
|
2116
|
+
d(this, O).add(s);
|
|
2117
|
+
const o = u(this, f, we).call(this, a);
|
|
2094
2118
|
for (const s of o)
|
|
2095
|
-
|
|
2119
|
+
d(this, S).add(s);
|
|
2096
2120
|
const n = super.transformNodeImpl(a);
|
|
2097
2121
|
for (const s of o)
|
|
2098
|
-
|
|
2122
|
+
d(this, S).delete(s);
|
|
2099
2123
|
for (const s of r)
|
|
2100
|
-
|
|
2124
|
+
d(this, O).delete(s);
|
|
2101
2125
|
return n;
|
|
2102
2126
|
}
|
|
2103
2127
|
transformSchemableIdentifier(a) {
|
|
2104
2128
|
const r = super.transformSchemableIdentifier(a);
|
|
2105
|
-
return r.schema || !
|
|
2129
|
+
return r.schema || !d(this, S).has(a.identifier.name) ? r : {
|
|
2106
2130
|
...r,
|
|
2107
|
-
schema: z.create(
|
|
2131
|
+
schema: z.create(d(this, P))
|
|
2108
2132
|
};
|
|
2109
2133
|
}
|
|
2110
2134
|
transformReferences(a) {
|
|
2111
2135
|
const r = super.transformReferences(a);
|
|
2112
2136
|
return r.table.table.schema ? r : {
|
|
2113
2137
|
...r,
|
|
2114
|
-
table:
|
|
2138
|
+
table: U.createWithSchema(d(this, P), r.table.table.identifier.name)
|
|
2115
2139
|
};
|
|
2116
2140
|
}
|
|
2117
2141
|
}
|
|
2118
|
-
P = new WeakMap(), S = new WeakMap(), O = new WeakMap(),
|
|
2142
|
+
P = new WeakMap(), S = new WeakMap(), O = new WeakMap(), f = new WeakSet(), ge = function(a) {
|
|
2119
2143
|
return a.kind in ka;
|
|
2120
2144
|
}, we = function(a) {
|
|
2121
2145
|
const r = /* @__PURE__ */ new Set();
|
|
2122
|
-
if ("name" in a && a.name &&
|
|
2146
|
+
if ("name" in a && a.name && q.is(a.name) && u(this, f, W).call(this, a.name, r), "from" in a && a.from)
|
|
2123
2147
|
for (const o of a.from.froms)
|
|
2124
|
-
u(this,
|
|
2125
|
-
if ("into" in a && a.into && u(this,
|
|
2148
|
+
u(this, f, $).call(this, o, r);
|
|
2149
|
+
if ("into" in a && a.into && u(this, f, $).call(this, a.into, r), "table" in a && a.table && u(this, f, $).call(this, a.table, r), "joins" in a && a.joins)
|
|
2126
2150
|
for (const o of a.joins)
|
|
2127
|
-
u(this,
|
|
2128
|
-
return "using" in a && a.using && u(this,
|
|
2151
|
+
u(this, f, $).call(this, o.table, r);
|
|
2152
|
+
return "using" in a && a.using && u(this, f, $).call(this, a.using, r), r;
|
|
2129
2153
|
}, ye = function(a) {
|
|
2130
2154
|
const r = /* @__PURE__ */ new Set();
|
|
2131
|
-
return "with" in a && a.with && u(this,
|
|
2155
|
+
return "with" in a && a.with && u(this, f, Ne).call(this, a.with, r), r;
|
|
2132
2156
|
}, $ = function(a, r) {
|
|
2133
|
-
const o =
|
|
2134
|
-
o && u(this,
|
|
2135
|
-
},
|
|
2157
|
+
const o = U.is(a) ? a : Sa.is(a) && U.is(a.node) ? a.node : null;
|
|
2158
|
+
o && u(this, f, W).call(this, o.table, r);
|
|
2159
|
+
}, W = function(a, r) {
|
|
2136
2160
|
const o = a.identifier.name;
|
|
2137
|
-
!
|
|
2161
|
+
!d(this, S).has(o) && !d(this, O).has(o) && r.add(o);
|
|
2138
2162
|
}, Ne = function(a, r) {
|
|
2139
2163
|
for (const o of a.expressions) {
|
|
2140
2164
|
const n = o.name.table.table.identifier.name;
|
|
2141
|
-
|
|
2165
|
+
d(this, O).has(n) || r.add(n);
|
|
2142
2166
|
}
|
|
2143
2167
|
};
|
|
2144
2168
|
var L;
|
|
2145
|
-
class
|
|
2169
|
+
class Da {
|
|
2146
2170
|
constructor(e) {
|
|
2147
2171
|
w(this, L);
|
|
2148
2172
|
M(this, L, new $a(e));
|
|
2149
2173
|
}
|
|
2150
2174
|
transformQuery(e) {
|
|
2151
|
-
return
|
|
2175
|
+
return d(this, L).transformNode(e.node);
|
|
2152
2176
|
}
|
|
2153
2177
|
async transformResult(e) {
|
|
2154
2178
|
return e.result;
|
|
2155
2179
|
}
|
|
2156
2180
|
}
|
|
2157
2181
|
L = new WeakMap();
|
|
2158
|
-
class
|
|
2182
|
+
class Ia {
|
|
2159
2183
|
transformQuery(e) {
|
|
2160
2184
|
return e.node;
|
|
2161
2185
|
}
|
|
@@ -2163,8 +2187,8 @@ class Da {
|
|
|
2163
2187
|
return e.result;
|
|
2164
2188
|
}
|
|
2165
2189
|
}
|
|
2166
|
-
const Pa = "kysely_migration",
|
|
2167
|
-
var h, i, A, N, v,
|
|
2190
|
+
const Pa = "kysely_migration", _e = "kysely_migration_lock", ja = !1, B = "migration_lock", Ma = p({ __noMigrations__: !0 });
|
|
2191
|
+
var h, i, A, N, v, D, Ce, C, be, xe, Te, Se, Oe, G, I, H, ke, $e, De, X, Ie, Pe, je, Me, Ae, F;
|
|
2168
2192
|
class ve {
|
|
2169
2193
|
constructor(e) {
|
|
2170
2194
|
w(this, i);
|
|
@@ -2177,7 +2201,7 @@ class ve {
|
|
|
2177
2201
|
* The returned array is sorted by migration name.
|
|
2178
2202
|
*/
|
|
2179
2203
|
async getMigrations() {
|
|
2180
|
-
const e = await u(this, i,
|
|
2204
|
+
const e = await u(this, i, I).call(this, d(this, i, v)) ? await d(this, h).db.withPlugin(d(this, i, C)).selectFrom(d(this, i, v)).select(["name", "timestamp"]).execute() : [];
|
|
2181
2205
|
return (await u(this, i, X).call(this)).map(({ name: r, ...o }) => {
|
|
2182
2206
|
const n = e.find((s) => s.name === r);
|
|
2183
2207
|
return {
|
|
@@ -2264,9 +2288,9 @@ class ve {
|
|
|
2264
2288
|
return u(this, i, A).call(this, ({ migrations: a, executedMigrations: r, pendingMigrations: o }) => {
|
|
2265
2289
|
if (e === Ma)
|
|
2266
2290
|
return { direction: "Down", step: 1 / 0 };
|
|
2267
|
-
if (!a.find((
|
|
2291
|
+
if (!a.find((c) => c.name === e))
|
|
2268
2292
|
throw new Error(`migration "${e}" doesn't exist`);
|
|
2269
|
-
const n = r.indexOf(e), s = o.findIndex((
|
|
2293
|
+
const n = r.indexOf(e), s = o.findIndex((c) => c.name === e);
|
|
2270
2294
|
if (n !== -1)
|
|
2271
2295
|
return {
|
|
2272
2296
|
direction: "Down",
|
|
@@ -2319,96 +2343,96 @@ h = new WeakMap(), i = new WeakSet(), A = async function(e) {
|
|
|
2319
2343
|
return a instanceof Q ? a.resultSet : { error: a };
|
|
2320
2344
|
}
|
|
2321
2345
|
}, N = function() {
|
|
2322
|
-
return
|
|
2346
|
+
return d(this, h).migrationTableSchema;
|
|
2323
2347
|
}, v = function() {
|
|
2324
|
-
return
|
|
2325
|
-
},
|
|
2326
|
-
return
|
|
2348
|
+
return d(this, h).migrationTableName ?? Pa;
|
|
2349
|
+
}, D = function() {
|
|
2350
|
+
return d(this, h).migrationLockTableName ?? _e;
|
|
2327
2351
|
}, Ce = function() {
|
|
2328
|
-
return
|
|
2352
|
+
return d(this, h).allowUnorderedMigrations ?? ja;
|
|
2329
2353
|
}, C = function() {
|
|
2330
|
-
return
|
|
2354
|
+
return d(this, i, N) ? new Da(d(this, i, N)) : new Ia();
|
|
2331
2355
|
}, be = async function() {
|
|
2332
2356
|
await u(this, i, xe).call(this), await u(this, i, Te).call(this), await u(this, i, Se).call(this), await u(this, i, Oe).call(this);
|
|
2333
2357
|
}, xe = async function() {
|
|
2334
|
-
if (
|
|
2358
|
+
if (d(this, i, N) && !await u(this, i, G).call(this))
|
|
2335
2359
|
try {
|
|
2336
|
-
await u(this, i, F).call(this,
|
|
2360
|
+
await u(this, i, F).call(this, d(this, h).db.schema.createSchema(d(this, i, N)));
|
|
2337
2361
|
} catch (e) {
|
|
2338
2362
|
if (!await u(this, i, G).call(this))
|
|
2339
2363
|
throw e;
|
|
2340
2364
|
}
|
|
2341
2365
|
}, Te = async function() {
|
|
2342
|
-
if (!await u(this, i,
|
|
2366
|
+
if (!await u(this, i, I).call(this, d(this, i, v)))
|
|
2343
2367
|
try {
|
|
2344
|
-
|
|
2368
|
+
d(this, i, N) && await u(this, i, F).call(this, d(this, h).db.schema.createSchema(d(this, i, N))), await u(this, i, F).call(this, d(this, h).db.schema.withPlugin(d(this, i, C)).createTable(d(this, i, v)).addColumn("name", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("timestamp", "varchar(255)", (e) => e.notNull()));
|
|
2345
2369
|
} catch (e) {
|
|
2346
|
-
if (!await u(this, i,
|
|
2370
|
+
if (!await u(this, i, I).call(this, d(this, i, v)))
|
|
2347
2371
|
throw e;
|
|
2348
2372
|
}
|
|
2349
2373
|
}, Se = async function() {
|
|
2350
|
-
if (!await u(this, i,
|
|
2374
|
+
if (!await u(this, i, I).call(this, d(this, i, D)))
|
|
2351
2375
|
try {
|
|
2352
|
-
await u(this, i, F).call(this,
|
|
2376
|
+
await u(this, i, F).call(this, d(this, h).db.schema.withPlugin(d(this, i, C)).createTable(d(this, i, D)).addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("is_locked", "integer", (e) => e.notNull().defaultTo(0)));
|
|
2353
2377
|
} catch (e) {
|
|
2354
|
-
if (!await u(this, i,
|
|
2378
|
+
if (!await u(this, i, I).call(this, d(this, i, D)))
|
|
2355
2379
|
throw e;
|
|
2356
2380
|
}
|
|
2357
2381
|
}, Oe = async function() {
|
|
2358
2382
|
if (!await u(this, i, H).call(this))
|
|
2359
2383
|
try {
|
|
2360
|
-
await
|
|
2384
|
+
await d(this, h).db.withPlugin(d(this, i, C)).insertInto(d(this, i, D)).values({ id: B, is_locked: 0 }).execute();
|
|
2361
2385
|
} catch (e) {
|
|
2362
2386
|
if (!await u(this, i, H).call(this))
|
|
2363
2387
|
throw e;
|
|
2364
2388
|
}
|
|
2365
2389
|
}, G = async function() {
|
|
2366
|
-
return (await
|
|
2367
|
-
},
|
|
2368
|
-
const a =
|
|
2369
|
-
return (await
|
|
2390
|
+
return (await d(this, h).db.introspection.getSchemas()).some((a) => a.name === d(this, i, N));
|
|
2391
|
+
}, I = async function(e) {
|
|
2392
|
+
const a = d(this, i, N);
|
|
2393
|
+
return (await d(this, h).db.introspection.getTables({
|
|
2370
2394
|
withInternalKyselyTables: !0
|
|
2371
2395
|
})).some((o) => o.name === e && (!a || o.schema === a));
|
|
2372
2396
|
}, H = async function() {
|
|
2373
|
-
return !!await
|
|
2397
|
+
return !!await d(this, h).db.withPlugin(d(this, i, C)).selectFrom(d(this, i, D)).where("id", "=", B).select("id").executeTakeFirst();
|
|
2374
2398
|
}, ke = async function(e) {
|
|
2375
|
-
const a =
|
|
2376
|
-
lockTable:
|
|
2399
|
+
const a = d(this, h).db.getExecutor().adapter, r = p({
|
|
2400
|
+
lockTable: d(this, h).migrationLockTableName ?? _e,
|
|
2377
2401
|
lockRowId: B,
|
|
2378
|
-
lockTableSchema:
|
|
2402
|
+
lockTableSchema: d(this, h).migrationTableSchema
|
|
2379
2403
|
}), o = async (n) => {
|
|
2380
2404
|
try {
|
|
2381
2405
|
await a.acquireMigrationLock(n, r);
|
|
2382
2406
|
const s = await u(this, i, $e).call(this, n);
|
|
2383
2407
|
if (s.migrations.length === 0)
|
|
2384
2408
|
return { results: [] };
|
|
2385
|
-
const { direction:
|
|
2386
|
-
return
|
|
2409
|
+
const { direction: c, step: l } = e(s);
|
|
2410
|
+
return l <= 0 ? { results: [] } : c === "Down" ? await u(this, i, Me).call(this, n, s, l) : c === "Up" ? await u(this, i, Ae).call(this, n, s, l) : { results: [] };
|
|
2387
2411
|
} finally {
|
|
2388
2412
|
await a.releaseMigrationLock(n, r);
|
|
2389
2413
|
}
|
|
2390
2414
|
};
|
|
2391
|
-
return a.supportsTransactionalDdl ?
|
|
2415
|
+
return a.supportsTransactionalDdl ? d(this, h).db.transaction().execute(o) : d(this, h).db.connection().execute(o);
|
|
2392
2416
|
}, $e = async function(e) {
|
|
2393
|
-
const a = await u(this, i, X).call(this), r = await u(this, i,
|
|
2394
|
-
u(this, i, Pe).call(this, a, r),
|
|
2395
|
-
const o = u(this, i,
|
|
2417
|
+
const a = await u(this, i, X).call(this), r = await u(this, i, Ie).call(this, e);
|
|
2418
|
+
u(this, i, Pe).call(this, a, r), d(this, i, Ce) || u(this, i, je).call(this, a, r);
|
|
2419
|
+
const o = u(this, i, De).call(this, a, r);
|
|
2396
2420
|
return p({
|
|
2397
2421
|
migrations: a,
|
|
2398
2422
|
executedMigrations: r,
|
|
2399
2423
|
lastMigration: Ta(r),
|
|
2400
2424
|
pendingMigrations: o
|
|
2401
2425
|
});
|
|
2402
|
-
},
|
|
2426
|
+
}, De = function(e, a) {
|
|
2403
2427
|
return e.filter((r) => !a.includes(r.name));
|
|
2404
2428
|
}, X = async function() {
|
|
2405
|
-
const e = await
|
|
2429
|
+
const e = await d(this, h).provider.getMigrations();
|
|
2406
2430
|
return Object.keys(e).sort().map((a) => ({
|
|
2407
2431
|
...e[a],
|
|
2408
2432
|
name: a
|
|
2409
2433
|
}));
|
|
2410
|
-
},
|
|
2411
|
-
return (await e.withPlugin(
|
|
2434
|
+
}, Ie = async function(e) {
|
|
2435
|
+
return (await e.withPlugin(d(this, i, C)).selectFrom(d(this, i, v)).select("name").orderBy(["timestamp", "name"]).execute()).map((r) => r.name);
|
|
2412
2436
|
}, Pe = function(e, a) {
|
|
2413
2437
|
for (const r of a)
|
|
2414
2438
|
if (!e.some((o) => o.name === r))
|
|
@@ -2418,26 +2442,26 @@ h = new WeakMap(), i = new WeakSet(), A = async function(e) {
|
|
|
2418
2442
|
if (e[r].name !== a[r])
|
|
2419
2443
|
throw new Error(`corrupted migrations: expected previously executed migration ${a[r]} to be at index ${r} but ${e[r].name} was found in its place. New migrations must always have a name that comes alphabetically after the last executed migration.`);
|
|
2420
2444
|
}, Me = async function(e, a, r) {
|
|
2421
|
-
const o = a.executedMigrations.slice().reverse().slice(0, r).map((s) => a.migrations.find((
|
|
2445
|
+
const o = a.executedMigrations.slice().reverse().slice(0, r).map((s) => a.migrations.find((c) => c.name === s)), n = o.map((s) => ({
|
|
2422
2446
|
migrationName: s.name,
|
|
2423
2447
|
direction: "Down",
|
|
2424
2448
|
status: "NotExecuted"
|
|
2425
2449
|
}));
|
|
2426
2450
|
for (let s = 0; s < n.length; ++s) {
|
|
2427
|
-
const
|
|
2451
|
+
const c = o[s];
|
|
2428
2452
|
try {
|
|
2429
|
-
|
|
2430
|
-
migrationName:
|
|
2453
|
+
c.down && (await c.down(e), await e.withPlugin(d(this, i, C)).deleteFrom(d(this, i, v)).where("name", "=", c.name).execute(), n[s] = {
|
|
2454
|
+
migrationName: c.name,
|
|
2431
2455
|
direction: "Down",
|
|
2432
2456
|
status: "Success"
|
|
2433
2457
|
});
|
|
2434
|
-
} catch (
|
|
2458
|
+
} catch (l) {
|
|
2435
2459
|
throw n[s] = {
|
|
2436
|
-
migrationName:
|
|
2460
|
+
migrationName: c.name,
|
|
2437
2461
|
direction: "Down",
|
|
2438
2462
|
status: "Error"
|
|
2439
2463
|
}, new Q({
|
|
2440
|
-
error:
|
|
2464
|
+
error: l,
|
|
2441
2465
|
results: n
|
|
2442
2466
|
});
|
|
2443
2467
|
}
|
|
@@ -2450,30 +2474,30 @@ h = new WeakMap(), i = new WeakSet(), A = async function(e) {
|
|
|
2450
2474
|
status: "NotExecuted"
|
|
2451
2475
|
}));
|
|
2452
2476
|
for (let s = 0; s < n.length; s++) {
|
|
2453
|
-
const
|
|
2477
|
+
const c = a.pendingMigrations[s];
|
|
2454
2478
|
try {
|
|
2455
|
-
await
|
|
2456
|
-
name:
|
|
2479
|
+
await c.up(e), await e.withPlugin(d(this, i, C)).insertInto(d(this, i, v)).values({
|
|
2480
|
+
name: c.name,
|
|
2457
2481
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
2458
2482
|
}).execute(), n[s] = {
|
|
2459
|
-
migrationName:
|
|
2483
|
+
migrationName: c.name,
|
|
2460
2484
|
direction: "Up",
|
|
2461
2485
|
status: "Success"
|
|
2462
2486
|
};
|
|
2463
|
-
} catch (
|
|
2487
|
+
} catch (l) {
|
|
2464
2488
|
throw n[s] = {
|
|
2465
|
-
migrationName:
|
|
2489
|
+
migrationName: c.name,
|
|
2466
2490
|
direction: "Up",
|
|
2467
2491
|
status: "Error"
|
|
2468
2492
|
}, new Q({
|
|
2469
|
-
error:
|
|
2493
|
+
error: l,
|
|
2470
2494
|
results: n
|
|
2471
2495
|
});
|
|
2472
2496
|
}
|
|
2473
2497
|
}
|
|
2474
2498
|
return { results: n };
|
|
2475
2499
|
}, F = async function(e) {
|
|
2476
|
-
|
|
2500
|
+
d(this, h).db.getExecutor().adapter.supportsCreateIfNotExists && (e = e.ifNotExists()), await e.execute();
|
|
2477
2501
|
};
|
|
2478
2502
|
var E;
|
|
2479
2503
|
class Q extends Error {
|
|
@@ -2483,7 +2507,7 @@ class Q extends Error {
|
|
|
2483
2507
|
M(this, E, a);
|
|
2484
2508
|
}
|
|
2485
2509
|
get resultSet() {
|
|
2486
|
-
return
|
|
2510
|
+
return d(this, E);
|
|
2487
2511
|
}
|
|
2488
2512
|
}
|
|
2489
2513
|
E = new WeakMap();
|
|
@@ -2585,11 +2609,11 @@ const za = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2585
2609
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2586
2610
|
async function Ra(t) {
|
|
2587
2611
|
}
|
|
2588
|
-
async function
|
|
2612
|
+
async function Ka(t) {
|
|
2589
2613
|
}
|
|
2590
|
-
const
|
|
2614
|
+
const Ua = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2591
2615
|
__proto__: null,
|
|
2592
|
-
down:
|
|
2616
|
+
down: Ka,
|
|
2593
2617
|
up: Ra
|
|
2594
2618
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2595
2619
|
async function Ba(t) {
|
|
@@ -2609,14 +2633,14 @@ const Va = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2609
2633
|
down: Qa,
|
|
2610
2634
|
up: Ba
|
|
2611
2635
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2612
|
-
async function Wa(t) {
|
|
2613
|
-
}
|
|
2614
2636
|
async function qa(t) {
|
|
2615
2637
|
}
|
|
2638
|
+
async function Wa(t) {
|
|
2639
|
+
}
|
|
2616
2640
|
const Ga = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2617
2641
|
__proto__: null,
|
|
2618
|
-
down:
|
|
2619
|
-
up:
|
|
2642
|
+
down: Wa,
|
|
2643
|
+
up: qa
|
|
2620
2644
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2621
2645
|
async function Ha(t) {
|
|
2622
2646
|
await t.schema.createTable("sessions").addColumn("session_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
@@ -2703,14 +2727,14 @@ const ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2703
2727
|
down: sr,
|
|
2704
2728
|
up: or
|
|
2705
2729
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2706
|
-
async function lr(t) {
|
|
2707
|
-
}
|
|
2708
2730
|
async function cr(t) {
|
|
2709
2731
|
}
|
|
2732
|
+
async function lr(t) {
|
|
2733
|
+
}
|
|
2710
2734
|
const dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2711
2735
|
__proto__: null,
|
|
2712
|
-
down:
|
|
2713
|
-
up:
|
|
2736
|
+
down: lr,
|
|
2737
|
+
up: cr
|
|
2714
2738
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2715
2739
|
async function ur(t) {
|
|
2716
2740
|
}
|
|
@@ -2721,14 +2745,14 @@ const hr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2721
2745
|
down: mr,
|
|
2722
2746
|
up: ur
|
|
2723
2747
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2724
|
-
async function fr(t) {
|
|
2725
|
-
}
|
|
2726
2748
|
async function _r(t) {
|
|
2727
2749
|
}
|
|
2750
|
+
async function fr(t) {
|
|
2751
|
+
}
|
|
2728
2752
|
const pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2729
2753
|
__proto__: null,
|
|
2730
|
-
down:
|
|
2731
|
-
up:
|
|
2754
|
+
down: fr,
|
|
2755
|
+
up: _r
|
|
2732
2756
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2733
2757
|
async function gr(t) {
|
|
2734
2758
|
await t.schema.createIndex("users_email_index").on("users").column("email").execute();
|
|
@@ -2781,12 +2805,12 @@ async function $r(t) {
|
|
|
2781
2805
|
(e) => e.references("tenants.id").onDelete("cascade")
|
|
2782
2806
|
).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("revoked_at", "varchar(255)").addColumn("cert", "varchar(2048)").addColumn("pkcs7", "varchar(2048)").addColumn("fingerprint", "varchar(256)").addColumn("thumbprint", "varchar(256)").addColumn("current_since", "varchar(256)").addColumn("current_until", "varchar(256)").execute();
|
|
2783
2807
|
}
|
|
2784
|
-
async function
|
|
2808
|
+
async function Dr(t) {
|
|
2785
2809
|
await t.schema.dropTable("keys").execute();
|
|
2786
2810
|
}
|
|
2787
|
-
const
|
|
2811
|
+
const Ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2788
2812
|
__proto__: null,
|
|
2789
|
-
down:
|
|
2813
|
+
down: Dr,
|
|
2790
2814
|
up: $r
|
|
2791
2815
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2792
2816
|
async function Pr(t) {
|
|
@@ -2820,11 +2844,11 @@ const zr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2820
2844
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2821
2845
|
async function Rr(t) {
|
|
2822
2846
|
}
|
|
2823
|
-
async function
|
|
2847
|
+
async function Kr(t) {
|
|
2824
2848
|
}
|
|
2825
|
-
const
|
|
2849
|
+
const Ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2826
2850
|
__proto__: null,
|
|
2827
|
-
down:
|
|
2851
|
+
down: Kr,
|
|
2828
2852
|
up: Rr
|
|
2829
2853
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2830
2854
|
async function Br(t) {
|
|
@@ -2838,16 +2862,16 @@ const Vr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2838
2862
|
down: Qr,
|
|
2839
2863
|
up: Br
|
|
2840
2864
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2841
|
-
async function
|
|
2865
|
+
async function qr(t) {
|
|
2842
2866
|
await t.schema.alterTable("users").dropColumn("tags").execute();
|
|
2843
2867
|
}
|
|
2844
|
-
async function
|
|
2868
|
+
async function Wr(t) {
|
|
2845
2869
|
await t.schema.alterTable("users").addColumn("tags", "varchar(255)").execute();
|
|
2846
2870
|
}
|
|
2847
2871
|
const Gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2848
2872
|
__proto__: null,
|
|
2849
|
-
down:
|
|
2850
|
-
up:
|
|
2873
|
+
down: Wr,
|
|
2874
|
+
up: qr
|
|
2851
2875
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2852
2876
|
async function Hr(t) {
|
|
2853
2877
|
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();
|
|
@@ -2888,12 +2912,12 @@ async function on(t) {
|
|
|
2888
2912
|
async function sn(t) {
|
|
2889
2913
|
await t.schema.dropIndex("users_name_index").execute();
|
|
2890
2914
|
}
|
|
2891
|
-
const
|
|
2915
|
+
const cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2892
2916
|
__proto__: null,
|
|
2893
2917
|
down: sn,
|
|
2894
2918
|
up: on
|
|
2895
2919
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2896
|
-
async function
|
|
2920
|
+
async function ln(t) {
|
|
2897
2921
|
}
|
|
2898
2922
|
async function dn(t) {
|
|
2899
2923
|
await t.schema.alterTable("users").dropConstraint("unique_email_provider").execute();
|
|
@@ -2901,7 +2925,7 @@ async function dn(t) {
|
|
|
2901
2925
|
const un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2902
2926
|
__proto__: null,
|
|
2903
2927
|
down: dn,
|
|
2904
|
-
up:
|
|
2928
|
+
up: ln
|
|
2905
2929
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2906
2930
|
async function mn(t) {
|
|
2907
2931
|
await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(8192)").execute();
|
|
@@ -2909,12 +2933,12 @@ async function mn(t) {
|
|
|
2909
2933
|
async function hn(t) {
|
|
2910
2934
|
await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(1024)").execute();
|
|
2911
2935
|
}
|
|
2912
|
-
const
|
|
2936
|
+
const _n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2913
2937
|
__proto__: null,
|
|
2914
2938
|
down: hn,
|
|
2915
2939
|
up: mn
|
|
2916
2940
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2917
|
-
async function
|
|
2941
|
+
async function fn(t) {
|
|
2918
2942
|
await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(8192)").execute();
|
|
2919
2943
|
}
|
|
2920
2944
|
async function pn(t) {
|
|
@@ -2923,7 +2947,7 @@ async function pn(t) {
|
|
|
2923
2947
|
const gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2924
2948
|
__proto__: null,
|
|
2925
2949
|
down: pn,
|
|
2926
|
-
up:
|
|
2950
|
+
up: fn
|
|
2927
2951
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2928
2952
|
async function wn(t) {
|
|
2929
2953
|
await t.schema.createTable("branding").addColumn(
|
|
@@ -2967,14 +2991,14 @@ const $n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2967
2991
|
down: kn,
|
|
2968
2992
|
up: On
|
|
2969
2993
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2970
|
-
async function In(t) {
|
|
2971
|
-
}
|
|
2972
2994
|
async function Dn(t) {
|
|
2973
2995
|
}
|
|
2996
|
+
async function In(t) {
|
|
2997
|
+
}
|
|
2974
2998
|
const Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2975
2999
|
__proto__: null,
|
|
2976
|
-
down:
|
|
2977
|
-
up:
|
|
3000
|
+
down: In,
|
|
3001
|
+
up: Dn
|
|
2978
3002
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2979
3003
|
async function jn(t) {
|
|
2980
3004
|
await t.schema.createTable("authentication_codes").addColumn(
|
|
@@ -3015,27 +3039,27 @@ const Rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3015
3039
|
down: zn,
|
|
3016
3040
|
up: Jn
|
|
3017
3041
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3018
|
-
async function
|
|
3042
|
+
async function Kn(t) {
|
|
3019
3043
|
await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(1024)").execute();
|
|
3020
3044
|
}
|
|
3021
|
-
async function
|
|
3045
|
+
async function Un(t) {
|
|
3022
3046
|
await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(255)").execute();
|
|
3023
3047
|
}
|
|
3024
3048
|
const Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3025
3049
|
__proto__: null,
|
|
3026
|
-
down:
|
|
3027
|
-
up:
|
|
3050
|
+
down: Un,
|
|
3051
|
+
up: Kn
|
|
3028
3052
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3029
3053
|
async function Qn(t) {
|
|
3030
3054
|
}
|
|
3031
3055
|
async function Vn(t) {
|
|
3032
3056
|
}
|
|
3033
|
-
const
|
|
3057
|
+
const qn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3034
3058
|
__proto__: null,
|
|
3035
3059
|
down: Vn,
|
|
3036
3060
|
up: Qn
|
|
3037
3061
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3038
|
-
async function
|
|
3062
|
+
async function Wn(t) {
|
|
3039
3063
|
await t.schema.createTable("hooks").addColumn("hook_id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
|
|
3040
3064
|
"tenant_id",
|
|
3041
3065
|
"varchar(255)",
|
|
@@ -3052,7 +3076,7 @@ async function Gn(t) {
|
|
|
3052
3076
|
const Hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3053
3077
|
__proto__: null,
|
|
3054
3078
|
down: Gn,
|
|
3055
|
-
up:
|
|
3079
|
+
up: Wn
|
|
3056
3080
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3057
3081
|
async function Xn(t) {
|
|
3058
3082
|
}
|
|
@@ -3107,12 +3131,12 @@ async function so(t) {
|
|
|
3107
3131
|
}
|
|
3108
3132
|
async function io(t) {
|
|
3109
3133
|
}
|
|
3110
|
-
const
|
|
3134
|
+
const co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3111
3135
|
__proto__: null,
|
|
3112
3136
|
down: io,
|
|
3113
3137
|
up: so
|
|
3114
3138
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3115
|
-
async function
|
|
3139
|
+
async function lo(t) {
|
|
3116
3140
|
await t.schema.alterTable("logins").addColumn("auth0Client", "varchar(256)").execute();
|
|
3117
3141
|
}
|
|
3118
3142
|
async function uo(t) {
|
|
@@ -3121,17 +3145,17 @@ async function uo(t) {
|
|
|
3121
3145
|
const mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3122
3146
|
__proto__: null,
|
|
3123
3147
|
down: uo,
|
|
3124
|
-
up:
|
|
3148
|
+
up: lo
|
|
3125
3149
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3126
3150
|
async function ho(t) {
|
|
3127
3151
|
await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(8192)").execute();
|
|
3128
3152
|
}
|
|
3129
|
-
async function
|
|
3153
|
+
async function _o(t) {
|
|
3130
3154
|
await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(511)").execute();
|
|
3131
3155
|
}
|
|
3132
|
-
const
|
|
3156
|
+
const fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3133
3157
|
__proto__: null,
|
|
3134
|
-
down:
|
|
3158
|
+
down: _o,
|
|
3135
3159
|
up: ho
|
|
3136
3160
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3137
3161
|
async function po(t) {
|
|
@@ -3176,12 +3200,12 @@ async function ko(t) {
|
|
|
3176
3200
|
}
|
|
3177
3201
|
async function $o(t) {
|
|
3178
3202
|
}
|
|
3179
|
-
const
|
|
3203
|
+
const Do = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3180
3204
|
__proto__: null,
|
|
3181
3205
|
down: $o,
|
|
3182
3206
|
up: ko
|
|
3183
3207
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3184
|
-
async function
|
|
3208
|
+
async function Io(t) {
|
|
3185
3209
|
await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.notNull()).addColumn(
|
|
3186
3210
|
"tenant_id",
|
|
3187
3211
|
"varchar(255)",
|
|
@@ -3213,7 +3237,7 @@ async function Po(t) {
|
|
|
3213
3237
|
const jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3214
3238
|
__proto__: null,
|
|
3215
3239
|
down: Po,
|
|
3216
|
-
up:
|
|
3240
|
+
up: Io
|
|
3217
3241
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3218
3242
|
async function Mo(t) {
|
|
3219
3243
|
await t.schema.dropTable("otps").execute(), await t.schema.dropTable("authentication_codes").execute();
|
|
@@ -3257,12 +3281,12 @@ async function zo(t) {
|
|
|
3257
3281
|
}
|
|
3258
3282
|
async function Ro(t) {
|
|
3259
3283
|
}
|
|
3260
|
-
const
|
|
3284
|
+
const Ko = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3261
3285
|
__proto__: null,
|
|
3262
3286
|
down: Ro,
|
|
3263
3287
|
up: zo
|
|
3264
3288
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3265
|
-
async function
|
|
3289
|
+
async function Uo(t) {
|
|
3266
3290
|
await t.schema.createTable("prompt_settings").addColumn("tenant_id", "varchar(64)", (e) => e.primaryKey()).addColumn(
|
|
3267
3291
|
"universal_login_experience",
|
|
3268
3292
|
"varchar(16)",
|
|
@@ -3287,15 +3311,15 @@ async function Bo(t) {
|
|
|
3287
3311
|
const Qo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3288
3312
|
__proto__: null,
|
|
3289
3313
|
down: Bo,
|
|
3290
|
-
up:
|
|
3314
|
+
up: Uo
|
|
3291
3315
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3292
3316
|
async function Vo(t) {
|
|
3293
3317
|
}
|
|
3294
|
-
async function
|
|
3318
|
+
async function qo(t) {
|
|
3295
3319
|
}
|
|
3296
|
-
const
|
|
3320
|
+
const Wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3297
3321
|
__proto__: null,
|
|
3298
|
-
down:
|
|
3322
|
+
down: qo,
|
|
3299
3323
|
up: Vo
|
|
3300
3324
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3301
3325
|
async function Go(t) {
|
|
@@ -3340,11 +3364,11 @@ const ss = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3340
3364
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3341
3365
|
async function is(t) {
|
|
3342
3366
|
}
|
|
3343
|
-
async function
|
|
3367
|
+
async function cs(t) {
|
|
3344
3368
|
}
|
|
3345
|
-
const
|
|
3369
|
+
const ls = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3346
3370
|
__proto__: null,
|
|
3347
|
-
down:
|
|
3371
|
+
down: cs,
|
|
3348
3372
|
up: is
|
|
3349
3373
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3350
3374
|
async function ds(t) {
|
|
@@ -3361,12 +3385,12 @@ const ms = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3361
3385
|
async function hs(t) {
|
|
3362
3386
|
await t.schema.alterTable("codes").addColumn("code_verifier", "varchar(128)").execute();
|
|
3363
3387
|
}
|
|
3364
|
-
async function
|
|
3388
|
+
async function _s(t) {
|
|
3365
3389
|
await t.schema.alterTable("codes").dropColumn("code_verifier").execute();
|
|
3366
3390
|
}
|
|
3367
|
-
const
|
|
3391
|
+
const fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3368
3392
|
__proto__: null,
|
|
3369
|
-
down:
|
|
3393
|
+
down: _s,
|
|
3370
3394
|
up: hs
|
|
3371
3395
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3372
3396
|
async function ps(t) {
|
|
@@ -3446,14 +3470,41 @@ async function ks(t) {
|
|
|
3446
3470
|
async function $s(t) {
|
|
3447
3471
|
await t.schema.alterTable("sessions").dropColumn("id").dropColumn("idle_expires_at").dropColumn("updated_at").dropColumn("revoked_at").dropColumn("authenticated_at").dropColumn("last_interaction_at").dropColumn("device").dropColumn("clients").execute();
|
|
3448
3472
|
}
|
|
3449
|
-
const
|
|
3473
|
+
const Ds = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3450
3474
|
__proto__: null,
|
|
3451
3475
|
down: $s,
|
|
3452
3476
|
up: ks
|
|
3477
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
3478
|
+
async function Is(t) {
|
|
3479
|
+
await t.schema.alterTable("refresh_tokens").addColumn("rotating", "boolean").execute(), await t.schema.alterTable("refresh_tokens").addColumn("device", "varchar(1024)").execute(), await t.schema.alterTable("refresh_tokens").addColumn("resource_servers", "varchar(1024)").execute(), await t.schema.alterTable("refresh_tokens").addColumn("user_id", "varchar(255)").execute(), await t.schema.alterTable("refresh_tokens").dropColumn("scope").execute(), await t.schema.alterTable("refresh_tokens").addColumn("scope", "varchar(255)").execute(), await t.schema.alterTable("refresh_tokens").dropColumn("audience").execute(), await t.schema.alterTable("refresh_tokens").addColumn("audience", "varchar(255)").execute(), await t.schema.alterTable("refresh_tokens").dropColumn("session_id").execute(), await t.schema.alterTable("refresh_tokens").addColumn("session_id", "varchar(255)").execute(), await t.schema.createTable("sessions_new").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
3480
|
+
"user_id_constraint",
|
|
3481
|
+
["user_id", "tenant_id"],
|
|
3482
|
+
"users",
|
|
3483
|
+
["user_id", "tenant_id"],
|
|
3484
|
+
(e) => e.onDelete("cascade")
|
|
3485
|
+
).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("updated_at", "varchar(35)", (e) => e.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", "varchar(2048)", (e) => e.notNull()).addColumn("clients", "varchar(1024)", (e) => e.notNull()).execute(), await t.schema.createTable("refresh_tokens_new").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn(
|
|
3486
|
+
"client_id",
|
|
3487
|
+
"varchar(21)",
|
|
3488
|
+
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
3489
|
+
).addColumn("tenant_id", "varchar(255)").addColumn("session_id", "varchar(21)", (e) => e.notNull()).addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
3490
|
+
"user_id_constraint",
|
|
3491
|
+
["user_id", "tenant_id"],
|
|
3492
|
+
"users",
|
|
3493
|
+
["user_id", "tenant_id"],
|
|
3494
|
+
(e) => e.onDelete("cascade")
|
|
3495
|
+
).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("updated_at", "varchar(35)", (e) => e.notNull()).addColumn("expires_at", "varchar(35)").addColumn("idle_expires_at", "varchar(35)").addColumn("last_exchanged_at", "varchar(35)").addColumn("device", "varchar(2048)", (e) => e.notNull()).addColumn("resource_servers", "varchar(2048)", (e) => e.notNull()).addColumn("rotating", "boolean", (e) => e.notNull()).execute();
|
|
3496
|
+
}
|
|
3497
|
+
async function Ps(t) {
|
|
3498
|
+
await t.schema.dropTable("sessions_new").execute(), await t.schema.dropTable("refresh_tokens_new").execute();
|
|
3499
|
+
}
|
|
3500
|
+
const js = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3501
|
+
__proto__: null,
|
|
3502
|
+
down: Ps,
|
|
3503
|
+
up: Is
|
|
3453
3504
|
}, Symbol.toStringTag, { value: "Module" })), Le = {
|
|
3454
3505
|
m1_init: La,
|
|
3455
3506
|
m2_magicLink: za,
|
|
3456
|
-
m3_updateAt:
|
|
3507
|
+
m3_updateAt: Ua,
|
|
3457
3508
|
m4_logTable: Va,
|
|
3458
3509
|
m5_userProfile: Ga,
|
|
3459
3510
|
m6_sessions: Ya,
|
|
@@ -3467,19 +3518,19 @@ const Is = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3467
3518
|
n14_profileDataField: Cr,
|
|
3468
3519
|
n15_userEmailIndex: Tr,
|
|
3469
3520
|
n16_userLocale: kr,
|
|
3470
|
-
n17_signingKeys:
|
|
3521
|
+
n17_signingKeys: Ir,
|
|
3471
3522
|
n18_logsFields: Mr,
|
|
3472
3523
|
n19_connectionsUserinfo: Lr,
|
|
3473
3524
|
n20_missingFields: zr,
|
|
3474
|
-
n21_sessionDeletedAt:
|
|
3525
|
+
n21_sessionDeletedAt: Ur,
|
|
3475
3526
|
n22_dropLogsFields: Vr,
|
|
3476
3527
|
n23_dropUsersFields: Gr,
|
|
3477
3528
|
n24_logsIndexes: Yr,
|
|
3478
3529
|
n25_logDescMaxLength: tn,
|
|
3479
3530
|
n26_logsTableExtraFields: nn,
|
|
3480
|
-
n27_usersTableNameIndex:
|
|
3531
|
+
n27_usersTableNameIndex: cn,
|
|
3481
3532
|
n28_usersEmailConstrain: un,
|
|
3482
|
-
n29_increaseOtpStateLength:
|
|
3533
|
+
n29_increaseOtpStateLength: _n,
|
|
3483
3534
|
n30_increaseTicketStateLength: gn,
|
|
3484
3535
|
n31_branding: Nn,
|
|
3485
3536
|
n32_indexesAndNotNull: bn,
|
|
@@ -3490,39 +3541,40 @@ const Is = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3490
3541
|
n37_disableSignUps: En,
|
|
3491
3542
|
n38_otpIpAddress: Rn,
|
|
3492
3543
|
n39_increaseUserAgentLength: Bn,
|
|
3493
|
-
n40_userId:
|
|
3544
|
+
n40_userId: qn,
|
|
3494
3545
|
n41_hooks: Hn,
|
|
3495
3546
|
n42_userIdIndexes: Zn,
|
|
3496
3547
|
n43_userIdIndexes: ao,
|
|
3497
3548
|
n44_codes: oo,
|
|
3498
|
-
n45_hookProperties:
|
|
3549
|
+
n45_hookProperties: co,
|
|
3499
3550
|
n46_loginAuth0Client: mo,
|
|
3500
|
-
n47_loginAuth0Client:
|
|
3551
|
+
n47_loginAuth0Client: fo,
|
|
3501
3552
|
n48_saml: wo,
|
|
3502
3553
|
n49_removeFields: vo,
|
|
3503
3554
|
n50_authParamsNonce: xo,
|
|
3504
3555
|
n51_connectionid: Oo,
|
|
3505
|
-
n52_cert:
|
|
3556
|
+
n52_cert: Do,
|
|
3506
3557
|
n53_codes_primary_key: jo,
|
|
3507
3558
|
n54_cleanup_tables: Fo,
|
|
3508
3559
|
n55_logs_index: Jo,
|
|
3509
|
-
n56_application_fields:
|
|
3560
|
+
n56_application_fields: Ko,
|
|
3510
3561
|
n57_prompt_settings: Qo,
|
|
3511
|
-
n58_connection_client_id:
|
|
3562
|
+
n58_connection_client_id: Wo,
|
|
3512
3563
|
n59_connection_options: Xo,
|
|
3513
3564
|
n60_users_metadata: es,
|
|
3514
3565
|
n61_userLocales: rs,
|
|
3515
3566
|
n62_prompt: ss,
|
|
3516
|
-
n63_connection_cleanup:
|
|
3567
|
+
n63_connection_cleanup: ls,
|
|
3517
3568
|
n64_act_as: ms,
|
|
3518
|
-
n65_code_verifier:
|
|
3569
|
+
n65_code_verifier: fs,
|
|
3519
3570
|
n66_email_providers: ws,
|
|
3520
3571
|
n67_drop_tickets: vs,
|
|
3521
3572
|
n68_login_useragents: xs,
|
|
3522
3573
|
n70_refresh_tokens: Os,
|
|
3523
|
-
n71_session_new_fields:
|
|
3574
|
+
n71_session_new_fields: Ds,
|
|
3575
|
+
n72_session_primary_key: js
|
|
3524
3576
|
};
|
|
3525
|
-
async function
|
|
3577
|
+
async function Es(t, e = !1) {
|
|
3526
3578
|
e && console.log("migrating...");
|
|
3527
3579
|
const a = new Fe(Le), r = new ve({
|
|
3528
3580
|
db: t,
|
|
@@ -3535,7 +3587,7 @@ async function As(t, e = !1) {
|
|
|
3535
3587
|
}), o)
|
|
3536
3588
|
throw console.error("failed to migrate"), console.error(o), o;
|
|
3537
3589
|
}
|
|
3538
|
-
async function
|
|
3590
|
+
async function Js(t) {
|
|
3539
3591
|
console.log("migrating...");
|
|
3540
3592
|
const e = new Fe(Le), a = new ve({
|
|
3541
3593
|
db: t,
|
|
@@ -3546,30 +3598,30 @@ async function Fs(t) {
|
|
|
3546
3598
|
}), r)
|
|
3547
3599
|
throw console.error("failed to migrate"), console.error(r), r;
|
|
3548
3600
|
}
|
|
3549
|
-
function
|
|
3601
|
+
function zs(t) {
|
|
3550
3602
|
return {
|
|
3551
|
-
applications:
|
|
3552
|
-
branding:
|
|
3603
|
+
applications: It(t),
|
|
3604
|
+
branding: Wt(t),
|
|
3553
3605
|
clients: Et(t),
|
|
3554
3606
|
codes: Tt(t),
|
|
3555
3607
|
connections: Lt(t),
|
|
3556
3608
|
emailProviders: wa(t),
|
|
3557
3609
|
domains: Qt(t),
|
|
3558
3610
|
hooks: ea(t),
|
|
3559
|
-
keys:
|
|
3611
|
+
keys: Kt(t),
|
|
3560
3612
|
logins: ua(t),
|
|
3561
|
-
logs:
|
|
3613
|
+
logs: lt(t),
|
|
3562
3614
|
passwords: yt(t),
|
|
3563
|
-
promptSettings:
|
|
3615
|
+
promptSettings: _a(t),
|
|
3564
3616
|
refreshTokens: xa(t),
|
|
3565
|
-
sessions:
|
|
3617
|
+
sessions: ft(t),
|
|
3566
3618
|
tenants: nt(t),
|
|
3567
3619
|
themes: sa(t),
|
|
3568
3620
|
users: Xe(t)
|
|
3569
3621
|
};
|
|
3570
3622
|
}
|
|
3571
3623
|
export {
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3624
|
+
zs as default,
|
|
3625
|
+
Js as migrateDown,
|
|
3626
|
+
Es as migrateToLatest
|
|
3575
3627
|
};
|