@authhero/kysely-adapter 10.38.0 → 10.40.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 +96 -6
- package/dist/kysely-adapter.mjs +1130 -908
- package/package.json +3 -3
package/dist/kysely-adapter.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Le = Object.defineProperty;
|
|
2
2
|
var ue = (t) => {
|
|
3
3
|
throw TypeError(t);
|
|
4
4
|
};
|
|
5
|
-
var Re = (t, e, a) => e in t ?
|
|
5
|
+
var Re = (t, e, a) => e in t ? Le(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a;
|
|
6
6
|
var R = (t, e, a) => Re(t, typeof e != "symbol" ? e + "" : e, a), X = (t, e, a) => e.has(t) || ue("Cannot " + a);
|
|
7
|
-
var
|
|
8
|
-
import { parseUserId as ie, codeSchema as Ke, connectionSchema as Ue, loginSessionSchema as
|
|
7
|
+
var m = (t, e, a) => (X(t, e, "read from private field"), a ? a.call(t) : e.get(t)), O = (t, e, a) => e.has(t) ? ue("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, a), K = (t, e, a, r) => (X(t, e, "write to private field"), r ? r.call(t, a) : e.set(t, a), a), p = (t, e, a) => (X(t, e, "access private method"), a);
|
|
8
|
+
import { parseUserId as ie, codeSchema as Ke, connectionSchema as Ue, loginSessionSchema as qe, promptSettingSchema as Be, formSchema as Y, resourceServerSchema as Qe } from "@authhero/adapter-interfaces";
|
|
9
9
|
import "@hono/zod-openapi";
|
|
10
|
-
var
|
|
10
|
+
var B = class extends Error {
|
|
11
11
|
constructor(e = 500, a) {
|
|
12
12
|
super(a == null ? void 0 : a.message, { cause: a == null ? void 0 : a.cause });
|
|
13
13
|
R(this, "res");
|
|
@@ -23,7 +23,7 @@ var H = class extends Error {
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
function
|
|
26
|
+
function We(t) {
|
|
27
27
|
return async (e, a) => {
|
|
28
28
|
const { identities: r, ...n } = a, o = {
|
|
29
29
|
...n,
|
|
@@ -39,7 +39,7 @@ function Ve(t) {
|
|
|
39
39
|
try {
|
|
40
40
|
await t.insertInto("users").values(o).execute();
|
|
41
41
|
} catch (s) {
|
|
42
|
-
throw s.code === "SQLITE_CONSTRAINT_UNIQUE" || s.message.includes("AlreadyExists") ? new
|
|
42
|
+
throw s.code === "SQLITE_CONSTRAINT_UNIQUE" || s.message.includes("AlreadyExists") ? new B(409, { message: "User already exists" }) : new B(500, { message: `${s.code}, ${s.message}` });
|
|
43
43
|
}
|
|
44
44
|
return {
|
|
45
45
|
...o,
|
|
@@ -88,7 +88,7 @@ function pe(t) {
|
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function Ve(t) {
|
|
92
92
|
return async (e, a) => {
|
|
93
93
|
const [r, n] = await Promise.all([
|
|
94
94
|
t.selectFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", a).selectAll().executeTakeFirst(),
|
|
@@ -116,19 +116,19 @@ function We(t) {
|
|
|
116
116
|
return y(i);
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function S(t, e, a, r) {
|
|
120
120
|
return a.split(/\s+/).map((o) => o.replace(/^([^:]+)=/g, "$1:")).map((o) => {
|
|
121
|
-
let s = o.startsWith("-"), i = null, c = "", u = !1,
|
|
121
|
+
let s = o.startsWith("-"), i = null, c = "", u = !1, _;
|
|
122
122
|
if (o.startsWith("-_exists_:"))
|
|
123
123
|
i = o.substring(10), u = !0, s = !0;
|
|
124
124
|
else if (o.startsWith("_exists_:"))
|
|
125
125
|
i = o.substring(9), u = !0, s = !1;
|
|
126
126
|
else if (o.includes(":")) {
|
|
127
|
-
const
|
|
128
|
-
i =
|
|
127
|
+
const d = s ? o.substring(1) : o, h = d.indexOf(":");
|
|
128
|
+
i = d.substring(0, h), c = d.substring(h + 1), u = !1, c.startsWith(">=") ? (_ = ">=", c = c.substring(2)) : c.startsWith(">") ? (_ = ">", c = c.substring(1)) : c.startsWith("<=") ? (_ = "<=", c = c.substring(2)) : c.startsWith("<") ? (_ = "<", c = c.substring(1)) : _ = "=";
|
|
129
129
|
} else
|
|
130
130
|
i = null, c = o, u = !1;
|
|
131
|
-
return { key: i, value: c, isNegation: s, isExistsQuery: u, operator:
|
|
131
|
+
return { key: i, value: c, isNegation: s, isExistsQuery: u, operator: _ };
|
|
132
132
|
}).forEach(({ key: o, value: s, isNegation: i, isExistsQuery: c, operator: u }) => {
|
|
133
133
|
if (o)
|
|
134
134
|
if (c)
|
|
@@ -153,10 +153,10 @@ function T(t, e, a, r) {
|
|
|
153
153
|
else
|
|
154
154
|
e = e.where(o, u, s);
|
|
155
155
|
else if (s) {
|
|
156
|
-
const { ref:
|
|
156
|
+
const { ref: _ } = t.dynamic;
|
|
157
157
|
e = e.where(
|
|
158
|
-
(
|
|
159
|
-
r.map((h) => _(
|
|
158
|
+
(d) => d.or(
|
|
159
|
+
r.map((h) => d(_(h), "like", `%${s}%`))
|
|
160
160
|
)
|
|
161
161
|
);
|
|
162
162
|
}
|
|
@@ -169,11 +169,11 @@ function Ge(t) {
|
|
|
169
169
|
return async (e, a = {}) => {
|
|
170
170
|
const { page: r = 0, per_page: n = 50, include_totals: o = !1, sort: s, q: i } = a;
|
|
171
171
|
let c = t.selectFrom("users").where("users.tenant_id", "=", e);
|
|
172
|
-
if (i && (c =
|
|
172
|
+
if (i && (c = S(t, c, i, ["email", "name"])), s && s.sort_by) {
|
|
173
173
|
const { ref: w } = t.dynamic;
|
|
174
174
|
c = c.orderBy(w(s.sort_by), s.sort_order);
|
|
175
175
|
}
|
|
176
|
-
const
|
|
176
|
+
const _ = await c.offset(r * n).limit(n).selectAll().execute(), d = _.map((w) => w.user_id), h = d.length ? await t.selectFrom("users").selectAll().where("users.tenant_id", "=", e).where("users.linked_to", "in", d).execute() : [], f = _.map((w) => {
|
|
177
177
|
const b = h.filter(
|
|
178
178
|
(D) => D.linked_to === w.user_id
|
|
179
179
|
);
|
|
@@ -210,14 +210,14 @@ function Ge(t) {
|
|
|
210
210
|
};
|
|
211
211
|
};
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function Ye(t) {
|
|
214
214
|
return async (e, a) => (await t.deleteFrom("users").where("users.tenant_id", "=", e).where("users.linked_to", "=", a).execute(), (await t.deleteFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", a).execute()).length === 1);
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function L(t, e = "", a = {}) {
|
|
217
217
|
for (let r in t)
|
|
218
218
|
if (Object.prototype.hasOwnProperty.call(t, r)) {
|
|
219
219
|
const n = e ? `${e}_${r}` : r, o = t[r];
|
|
220
|
-
typeof o == "object" && o !== null && !Array.isArray(o) ?
|
|
220
|
+
typeof o == "object" && o !== null && !Array.isArray(o) ? L(o, n, a) : typeof o == "boolean" ? a[n] = o ? 1 : 0 : a[n] = o;
|
|
221
221
|
}
|
|
222
222
|
return a;
|
|
223
223
|
}
|
|
@@ -239,9 +239,9 @@ function ge(t, e) {
|
|
|
239
239
|
}
|
|
240
240
|
return a;
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function He(t) {
|
|
243
243
|
return async (e, a, r) => {
|
|
244
|
-
const n =
|
|
244
|
+
const n = L({
|
|
245
245
|
...r,
|
|
246
246
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
247
247
|
app_metadata: r.app_metadata ? JSON.stringify(r.app_metadata) : void 0,
|
|
@@ -258,17 +258,17 @@ function Xe(t) {
|
|
|
258
258
|
}
|
|
259
259
|
function Ze(t) {
|
|
260
260
|
return {
|
|
261
|
-
create:
|
|
262
|
-
remove:
|
|
263
|
-
get:
|
|
261
|
+
create: We(t),
|
|
262
|
+
remove: Ye(t),
|
|
263
|
+
get: Ve(t),
|
|
264
264
|
list: Ge(t),
|
|
265
|
-
update:
|
|
265
|
+
update: He(t),
|
|
266
266
|
// TODO - think about this more when other issues fixed
|
|
267
267
|
unlink: Xe(t)
|
|
268
268
|
};
|
|
269
269
|
}
|
|
270
270
|
const et = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
271
|
-
let
|
|
271
|
+
let T = (t = 21) => {
|
|
272
272
|
let e = "", a = crypto.getRandomValues(new Uint8Array(t));
|
|
273
273
|
for (; t--; )
|
|
274
274
|
e += et[a[t] & 63];
|
|
@@ -277,7 +277,7 @@ let S = (t = 21) => {
|
|
|
277
277
|
function tt(t) {
|
|
278
278
|
return async (e) => {
|
|
279
279
|
const a = {
|
|
280
|
-
id: e.id ||
|
|
280
|
+
id: e.id || T(),
|
|
281
281
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
282
282
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
283
283
|
...e
|
|
@@ -300,14 +300,14 @@ function rt(t) {
|
|
|
300
300
|
a = a.orderBy(f(s.sort_by), s.sort_order);
|
|
301
301
|
}
|
|
302
302
|
i && (a = a.where((f) => f.or([f("name", "like", `%${i}%`)])));
|
|
303
|
-
const
|
|
303
|
+
const _ = (await a.offset(r * n).limit(n).selectAll().execute()).map(y);
|
|
304
304
|
if (!o)
|
|
305
305
|
return {
|
|
306
|
-
tenants:
|
|
306
|
+
tenants: _
|
|
307
307
|
};
|
|
308
|
-
const { count:
|
|
308
|
+
const { count: d } = await a.select((f) => f.fn.countAll().as("count")).executeTakeFirstOrThrow(), h = x(d);
|
|
309
309
|
return {
|
|
310
|
-
tenants:
|
|
310
|
+
tenants: _,
|
|
311
311
|
start: r * n,
|
|
312
312
|
limit: n,
|
|
313
313
|
length: h
|
|
@@ -344,7 +344,7 @@ function lt(t) {
|
|
|
344
344
|
return async (e, a) => {
|
|
345
345
|
var n, o, s;
|
|
346
346
|
const r = {
|
|
347
|
-
id:
|
|
347
|
+
id: T(),
|
|
348
348
|
...a,
|
|
349
349
|
user_agent: a.user_agent.slice(0, it)
|
|
350
350
|
};
|
|
@@ -386,24 +386,24 @@ function ct(t) {
|
|
|
386
386
|
return async (e, a = {}) => {
|
|
387
387
|
const { page: r = 0, per_page: n = 50, include_totals: o = !1, sort: s, q: i } = a;
|
|
388
388
|
let c = t.selectFrom("logs").where("logs.tenant_id", "=", e);
|
|
389
|
-
i && (c =
|
|
389
|
+
i && (c = S(t, c, i, ["user_id", "ip"]));
|
|
390
390
|
let u = c;
|
|
391
391
|
if (s && s.sort_by) {
|
|
392
392
|
const { ref: f } = t.dynamic;
|
|
393
393
|
u = u.orderBy(f(s.sort_by), s.sort_order);
|
|
394
394
|
}
|
|
395
395
|
u = u.offset(r * n).limit(n);
|
|
396
|
-
const
|
|
396
|
+
const d = (await u.selectAll().execute()).map(we);
|
|
397
397
|
if (!o)
|
|
398
398
|
return {
|
|
399
|
-
logs:
|
|
399
|
+
logs: d,
|
|
400
400
|
start: 0,
|
|
401
401
|
limit: 0,
|
|
402
402
|
length: 0
|
|
403
403
|
};
|
|
404
404
|
const { count: h } = await c.select((f) => f.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
405
405
|
return {
|
|
406
|
-
logs:
|
|
406
|
+
logs: d,
|
|
407
407
|
start: r * n,
|
|
408
408
|
limit: n,
|
|
409
409
|
length: x(h)
|
|
@@ -471,28 +471,28 @@ function pt(t) {
|
|
|
471
471
|
return async (e, a = {}) => {
|
|
472
472
|
const { page: r = 0, per_page: n = 50, include_totals: o = !1, sort: s, q: i } = a;
|
|
473
473
|
let c = t.selectFrom("sessions").where("sessions.tenant_id", "=", e);
|
|
474
|
-
i && (c =
|
|
474
|
+
i && (c = S(t, c, i, ["user_id", "session_id"]));
|
|
475
475
|
let u = c;
|
|
476
476
|
if (s && s.sort_by) {
|
|
477
477
|
const { ref: g } = t.dynamic;
|
|
478
478
|
u = u.orderBy(g(s.sort_by), s.sort_order);
|
|
479
479
|
}
|
|
480
480
|
u = u.offset(r * n).limit(n);
|
|
481
|
-
const
|
|
481
|
+
const d = (await u.selectAll().execute()).map((g) => ({
|
|
482
482
|
...g,
|
|
483
483
|
device: JSON.parse(g.device),
|
|
484
484
|
clients: JSON.parse(g.clients)
|
|
485
485
|
}));
|
|
486
486
|
if (!o)
|
|
487
487
|
return {
|
|
488
|
-
sessions:
|
|
488
|
+
sessions: d,
|
|
489
489
|
start: 0,
|
|
490
490
|
limit: 0,
|
|
491
491
|
length: 0
|
|
492
492
|
};
|
|
493
493
|
const { count: h } = await c.select((g) => g.fn.countAll().as("count")).executeTakeFirstOrThrow(), f = x(h);
|
|
494
494
|
return {
|
|
495
|
-
sessions:
|
|
495
|
+
sessions: d,
|
|
496
496
|
start: r * n,
|
|
497
497
|
limit: n,
|
|
498
498
|
length: f
|
|
@@ -547,24 +547,24 @@ function Ct(t) {
|
|
|
547
547
|
return async (e, a = {}) => {
|
|
548
548
|
const { page: r = 0, per_page: n = 50, include_totals: o = !1, q: s } = a;
|
|
549
549
|
let i = t.selectFrom("codes").where("codes.tenant_id", "=", e);
|
|
550
|
-
s && (i =
|
|
551
|
-
const
|
|
550
|
+
s && (i = S(t, i, s, ["code", "login_id"]));
|
|
551
|
+
const _ = (await i.offset(r * n).limit(n).selectAll().execute()).map((h) => {
|
|
552
552
|
const { tenant_id: f, ...g } = h;
|
|
553
553
|
return Ke.parse(y(g));
|
|
554
554
|
});
|
|
555
555
|
if (!o)
|
|
556
556
|
return {
|
|
557
|
-
codes:
|
|
557
|
+
codes: _,
|
|
558
558
|
start: 0,
|
|
559
559
|
limit: 0,
|
|
560
560
|
length: 0
|
|
561
561
|
};
|
|
562
|
-
const { count:
|
|
562
|
+
const { count: d } = await i.select((h) => h.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
563
563
|
return {
|
|
564
|
-
codes:
|
|
564
|
+
codes: _,
|
|
565
565
|
start: r * n,
|
|
566
566
|
limit: n,
|
|
567
|
-
length: x(
|
|
567
|
+
length: x(d)
|
|
568
568
|
};
|
|
569
569
|
};
|
|
570
570
|
}
|
|
@@ -671,7 +671,7 @@ function Pt(t) {
|
|
|
671
671
|
return await t.updateTable("applications").set(n).where("applications.id", "=", a).where("applications.tenant_id", "=", e).execute(), !0;
|
|
672
672
|
};
|
|
673
673
|
}
|
|
674
|
-
function
|
|
674
|
+
function zt(t) {
|
|
675
675
|
return {
|
|
676
676
|
create: kt(t),
|
|
677
677
|
list: $t(t),
|
|
@@ -680,10 +680,10 @@ function jt(t) {
|
|
|
680
680
|
update: Pt(t)
|
|
681
681
|
};
|
|
682
682
|
}
|
|
683
|
-
function
|
|
683
|
+
function jt(t) {
|
|
684
684
|
return async (e, a) => {
|
|
685
685
|
const r = {
|
|
686
|
-
id:
|
|
686
|
+
id: T(),
|
|
687
687
|
...a,
|
|
688
688
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
689
689
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -696,12 +696,12 @@ function Ft(t) {
|
|
|
696
696
|
}).execute(), r;
|
|
697
697
|
};
|
|
698
698
|
}
|
|
699
|
-
function
|
|
699
|
+
function Ft(t) {
|
|
700
700
|
return async (e, a = {}) => {
|
|
701
701
|
const { page: r = 0, per_page: n = 50, include_totals: o = !1, q: s } = a;
|
|
702
702
|
let i = t.selectFrom("connections").where("connections.tenant_id", "=", e);
|
|
703
|
-
s && (i =
|
|
704
|
-
const
|
|
703
|
+
s && (i = S(t, i, s, ["user_id", "ip"]));
|
|
704
|
+
const _ = (await i.offset(r * n).limit(n).selectAll().execute()).map(
|
|
705
705
|
(h) => y({
|
|
706
706
|
...h,
|
|
707
707
|
options: JSON.parse(h.options)
|
|
@@ -709,24 +709,24 @@ function At(t) {
|
|
|
709
709
|
);
|
|
710
710
|
if (!o)
|
|
711
711
|
return {
|
|
712
|
-
connections:
|
|
712
|
+
connections: _,
|
|
713
713
|
start: 0,
|
|
714
714
|
limit: 0,
|
|
715
715
|
length: 0
|
|
716
716
|
};
|
|
717
|
-
const { count:
|
|
717
|
+
const { count: d } = await i.select((h) => h.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
718
718
|
return {
|
|
719
|
-
connections:
|
|
719
|
+
connections: _,
|
|
720
720
|
start: r * n,
|
|
721
721
|
limit: n,
|
|
722
|
-
length: x(
|
|
722
|
+
length: x(d)
|
|
723
723
|
};
|
|
724
724
|
};
|
|
725
725
|
}
|
|
726
|
-
function
|
|
726
|
+
function At(t) {
|
|
727
727
|
return async (e, a) => (await t.deleteFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", a).executeTakeFirst()).numDeletedRows > 0;
|
|
728
728
|
}
|
|
729
|
-
function
|
|
729
|
+
function Mt(t) {
|
|
730
730
|
return async (e, a) => {
|
|
731
731
|
const r = await t.selectFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", a).selectAll().executeTakeFirst();
|
|
732
732
|
return r ? y({
|
|
@@ -747,16 +747,16 @@ function Jt(t) {
|
|
|
747
747
|
}).where("connections.id", "=", a).where("connections.tenant_id", "=", e).execute(), !0;
|
|
748
748
|
};
|
|
749
749
|
}
|
|
750
|
-
function
|
|
750
|
+
function Et(t) {
|
|
751
751
|
return {
|
|
752
|
-
create:
|
|
753
|
-
get:
|
|
754
|
-
list:
|
|
755
|
-
remove:
|
|
752
|
+
create: jt(t),
|
|
753
|
+
get: Mt(t),
|
|
754
|
+
list: Ft(t),
|
|
755
|
+
remove: At(t),
|
|
756
756
|
update: Jt(t)
|
|
757
757
|
};
|
|
758
758
|
}
|
|
759
|
-
function
|
|
759
|
+
function Lt(t) {
|
|
760
760
|
return {
|
|
761
761
|
get: async (e) => {
|
|
762
762
|
const a = await t.selectFrom("applications").selectAll().where("id", "=", e).executeTakeFirst();
|
|
@@ -764,7 +764,7 @@ function Et(t) {
|
|
|
764
764
|
return null;
|
|
765
765
|
const r = await t.selectFrom("tenants").selectAll().where("id", "=", a.tenant_id).executeTakeFirst();
|
|
766
766
|
if (!r)
|
|
767
|
-
throw new
|
|
767
|
+
throw new B(404, { message: "Tenant not found" });
|
|
768
768
|
const n = await t.selectFrom("connections").where("tenant_id", "=", a.tenant_id).selectAll().execute();
|
|
769
769
|
return {
|
|
770
770
|
...a,
|
|
@@ -804,7 +804,7 @@ function Rt(t) {
|
|
|
804
804
|
f("revoked_at", "is", null)
|
|
805
805
|
])
|
|
806
806
|
);
|
|
807
|
-
s && (i =
|
|
807
|
+
s && (i = S(t, i, s, [
|
|
808
808
|
"kid",
|
|
809
809
|
"connection",
|
|
810
810
|
"fingerprint",
|
|
@@ -814,17 +814,17 @@ function Rt(t) {
|
|
|
814
814
|
let c = i.select((f) => f.fn.count("kid").as("count"));
|
|
815
815
|
const u = a * r;
|
|
816
816
|
i = i.limit(r).offset(u), o && (i = i.orderBy(o.sort_by, o.sort_order));
|
|
817
|
-
const
|
|
817
|
+
const _ = await i.selectAll().execute();
|
|
818
818
|
if (!n)
|
|
819
819
|
return {
|
|
820
|
-
signingKeys:
|
|
820
|
+
signingKeys: _,
|
|
821
821
|
start: 0,
|
|
822
822
|
limit: 0,
|
|
823
823
|
length: 0
|
|
824
824
|
};
|
|
825
|
-
const
|
|
825
|
+
const d = await c.executeTakeFirst(), h = x((d == null ? void 0 : d.count) ?? 0);
|
|
826
826
|
return {
|
|
827
|
-
signingKeys:
|
|
827
|
+
signingKeys: _,
|
|
828
828
|
start: u,
|
|
829
829
|
limit: r,
|
|
830
830
|
length: h
|
|
@@ -839,17 +839,17 @@ function Kt(t) {
|
|
|
839
839
|
function Ut(t) {
|
|
840
840
|
return async (e, a) => !!(await t.updateTable("keys").set(a).where("kid", "=", e).execute()).length;
|
|
841
841
|
}
|
|
842
|
-
function
|
|
842
|
+
function qt(t) {
|
|
843
843
|
return {
|
|
844
844
|
create: Kt(t),
|
|
845
845
|
list: Rt(t),
|
|
846
846
|
update: Ut(t)
|
|
847
847
|
};
|
|
848
848
|
}
|
|
849
|
-
function
|
|
849
|
+
function Bt(t) {
|
|
850
850
|
return async (e, a) => {
|
|
851
851
|
const r = {
|
|
852
|
-
custom_domain_id:
|
|
852
|
+
custom_domain_id: T(),
|
|
853
853
|
status: "pending",
|
|
854
854
|
primary: !1,
|
|
855
855
|
...a
|
|
@@ -863,16 +863,16 @@ function Qt(t) {
|
|
|
863
863
|
}).execute(), r;
|
|
864
864
|
};
|
|
865
865
|
}
|
|
866
|
-
function
|
|
866
|
+
function Qt(t) {
|
|
867
867
|
return async (e) => (await t.selectFrom("custom_domains").where("custom_domains.tenant_id", "=", e).selectAll().execute()).map((r) => ({
|
|
868
868
|
...r,
|
|
869
869
|
primary: r.primary === 1
|
|
870
870
|
}));
|
|
871
871
|
}
|
|
872
|
-
function
|
|
872
|
+
function Wt(t) {
|
|
873
873
|
return async (e, a) => (await t.deleteFrom("custom_domains").where("custom_domains.tenant_id", "=", e).where("custom_domains.custom_domain_id", "=", a).execute()).length > 0;
|
|
874
874
|
}
|
|
875
|
-
function
|
|
875
|
+
function Vt(t) {
|
|
876
876
|
return async (e, a) => {
|
|
877
877
|
const r = await t.selectFrom("custom_domains").where("custom_domains.tenant_id", "=", e).where("custom_domains.custom_domain_id", "=", a).selectAll().executeTakeFirst();
|
|
878
878
|
return r ? {
|
|
@@ -891,7 +891,7 @@ function Gt(t) {
|
|
|
891
891
|
return (await t.updateTable("custom_domains").set(n).where("custom_domains.tenant_id", "=", e).where("custom_domains.custom_domain_id", "=", a).execute()).length > 0;
|
|
892
892
|
};
|
|
893
893
|
}
|
|
894
|
-
function
|
|
894
|
+
function Yt(t) {
|
|
895
895
|
return async (e) => {
|
|
896
896
|
const a = await t.selectFrom("custom_domains").where("custom_domains.domain", "=", e).selectAll().executeTakeFirst();
|
|
897
897
|
return a ? {
|
|
@@ -900,13 +900,13 @@ function Ht(t) {
|
|
|
900
900
|
} : null;
|
|
901
901
|
};
|
|
902
902
|
}
|
|
903
|
-
function
|
|
903
|
+
function Ht(t) {
|
|
904
904
|
return {
|
|
905
|
-
create:
|
|
906
|
-
get:
|
|
907
|
-
getByDomain:
|
|
908
|
-
list:
|
|
909
|
-
remove:
|
|
905
|
+
create: Bt(t),
|
|
906
|
+
get: Vt(t),
|
|
907
|
+
getByDomain: Yt(t),
|
|
908
|
+
list: Qt(t),
|
|
909
|
+
remove: Wt(t),
|
|
910
910
|
update: Gt(t)
|
|
911
911
|
};
|
|
912
912
|
}
|
|
@@ -923,10 +923,10 @@ function Xt(t) {
|
|
|
923
923
|
colors_page_background_end: i,
|
|
924
924
|
colors_page_background_angle_dev: c,
|
|
925
925
|
font_url: u,
|
|
926
|
-
...
|
|
926
|
+
..._
|
|
927
927
|
} = a;
|
|
928
928
|
return y({
|
|
929
|
-
...
|
|
929
|
+
..._,
|
|
930
930
|
colors: {
|
|
931
931
|
primary: n,
|
|
932
932
|
page_background: {
|
|
@@ -942,7 +942,7 @@ function Xt(t) {
|
|
|
942
942
|
}
|
|
943
943
|
function Zt(t) {
|
|
944
944
|
return async (e, a) => {
|
|
945
|
-
var s, i, c, u,
|
|
945
|
+
var s, i, c, u, _, d, h, f, g, w, b, D, F, P, V, le, ce, de;
|
|
946
946
|
const { colors: r, font: n, ...o } = a;
|
|
947
947
|
try {
|
|
948
948
|
await t.insertInto("branding").values({
|
|
@@ -950,7 +950,7 @@ function Zt(t) {
|
|
|
950
950
|
colors_primary: r == null ? void 0 : r.primary,
|
|
951
951
|
colors_page_background_type: (i = (s = a.colors) == null ? void 0 : s.page_background) == null ? void 0 : i.type,
|
|
952
952
|
colors_page_background_start: (u = (c = a.colors) == null ? void 0 : c.page_background) == null ? void 0 : u.start,
|
|
953
|
-
colors_page_background_end: (
|
|
953
|
+
colors_page_background_end: (d = (_ = a.colors) == null ? void 0 : _.page_background) == null ? void 0 : d.end,
|
|
954
954
|
colors_page_background_angle_dev: (f = (h = a.colors) == null ? void 0 : h.page_background) == null ? void 0 : f.angle_deg,
|
|
955
955
|
font_url: (g = a.font) == null ? void 0 : g.url,
|
|
956
956
|
tenant_id: e
|
|
@@ -960,7 +960,7 @@ function Zt(t) {
|
|
|
960
960
|
...o,
|
|
961
961
|
colors_primary: r == null ? void 0 : r.primary,
|
|
962
962
|
colors_page_background_type: (b = (w = a.colors) == null ? void 0 : w.page_background) == null ? void 0 : b.type,
|
|
963
|
-
colors_page_background_start: (
|
|
963
|
+
colors_page_background_start: (F = (D = a.colors) == null ? void 0 : D.page_background) == null ? void 0 : F.start,
|
|
964
964
|
colors_page_background_end: (V = (P = a.colors) == null ? void 0 : P.page_background) == null ? void 0 : V.end,
|
|
965
965
|
colors_page_background_angle_dev: (ce = (le = a.colors) == null ? void 0 : le.page_background) == null ? void 0 : ce.angle_deg,
|
|
966
966
|
font_url: (de = a.font) == null ? void 0 : de.url
|
|
@@ -978,8 +978,8 @@ function ta(t) {
|
|
|
978
978
|
return async (e, a = {}) => {
|
|
979
979
|
const { page: r = 0, per_page: n = 50, include_totals: o = !1, q: s } = a;
|
|
980
980
|
let i = t.selectFrom("hooks").where("hooks.tenant_id", "=", e);
|
|
981
|
-
s && (i =
|
|
982
|
-
const
|
|
981
|
+
s && (i = S(t, i, s, ["url", "form_id"]));
|
|
982
|
+
const _ = (await i.offset(r * n).limit(n).selectAll().execute()).map((h) => {
|
|
983
983
|
const { tenant_id: f, enabled: g, synchronous: w, ...b } = h;
|
|
984
984
|
return y({
|
|
985
985
|
...b,
|
|
@@ -989,17 +989,17 @@ function ta(t) {
|
|
|
989
989
|
});
|
|
990
990
|
if (!o)
|
|
991
991
|
return {
|
|
992
|
-
hooks:
|
|
992
|
+
hooks: _,
|
|
993
993
|
start: 0,
|
|
994
994
|
limit: 0,
|
|
995
995
|
length: 0
|
|
996
996
|
};
|
|
997
|
-
const { count:
|
|
997
|
+
const { count: d } = await i.select((h) => h.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
998
998
|
return {
|
|
999
|
-
hooks:
|
|
999
|
+
hooks: _,
|
|
1000
1000
|
start: r * n,
|
|
1001
1001
|
limit: n,
|
|
1002
|
-
length: x(
|
|
1002
|
+
length: x(d)
|
|
1003
1003
|
};
|
|
1004
1004
|
};
|
|
1005
1005
|
}
|
|
@@ -1019,7 +1019,7 @@ function ra(t) {
|
|
|
1019
1019
|
function na(t) {
|
|
1020
1020
|
return async (e, a) => {
|
|
1021
1021
|
const r = {
|
|
1022
|
-
hook_id:
|
|
1022
|
+
hook_id: T(),
|
|
1023
1023
|
...a,
|
|
1024
1024
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1025
1025
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -1055,7 +1055,7 @@ function sa(t) {
|
|
|
1055
1055
|
function ia(t) {
|
|
1056
1056
|
return async (e, a) => {
|
|
1057
1057
|
const r = {
|
|
1058
|
-
themeId:
|
|
1058
|
+
themeId: T(),
|
|
1059
1059
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1060
1060
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1061
1061
|
...a
|
|
@@ -1063,7 +1063,7 @@ function ia(t) {
|
|
|
1063
1063
|
...r,
|
|
1064
1064
|
tenant_id: e
|
|
1065
1065
|
};
|
|
1066
|
-
return await t.insertInto("themes").values(
|
|
1066
|
+
return await t.insertInto("themes").values(L(n)).execute(), r;
|
|
1067
1067
|
};
|
|
1068
1068
|
}
|
|
1069
1069
|
function la(t) {
|
|
@@ -1097,7 +1097,7 @@ function ca(t) {
|
|
|
1097
1097
|
}
|
|
1098
1098
|
function da(t) {
|
|
1099
1099
|
return async (e, a, r) => {
|
|
1100
|
-
const n =
|
|
1100
|
+
const n = L({
|
|
1101
1101
|
...r,
|
|
1102
1102
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1103
1103
|
});
|
|
@@ -1115,7 +1115,7 @@ function ua(t) {
|
|
|
1115
1115
|
function ma(t) {
|
|
1116
1116
|
return async (e, a) => {
|
|
1117
1117
|
const r = await t.selectFrom("login_sessions").where("login_sessions.id", "=", a).selectAll().executeTakeFirst();
|
|
1118
|
-
return r ?
|
|
1118
|
+
return r ? qe.parse(
|
|
1119
1119
|
ge(
|
|
1120
1120
|
y({
|
|
1121
1121
|
...r,
|
|
@@ -1130,7 +1130,7 @@ function _a(t) {
|
|
|
1130
1130
|
return async (e, a) => {
|
|
1131
1131
|
var n;
|
|
1132
1132
|
const r = {
|
|
1133
|
-
id:
|
|
1133
|
+
id: T(),
|
|
1134
1134
|
...a,
|
|
1135
1135
|
authorization_url: (n = a.authorization_url) == null ? void 0 : n.slice(0, 1024),
|
|
1136
1136
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -1138,14 +1138,14 @@ function _a(t) {
|
|
|
1138
1138
|
login_completed: !!a.login_completed
|
|
1139
1139
|
};
|
|
1140
1140
|
return await t.insertInto("login_sessions").values({
|
|
1141
|
-
...
|
|
1141
|
+
...L(r),
|
|
1142
1142
|
tenant_id: e
|
|
1143
1143
|
}).execute(), r;
|
|
1144
1144
|
};
|
|
1145
1145
|
}
|
|
1146
1146
|
function ha(t) {
|
|
1147
1147
|
return async (e, a, r) => (await t.updateTable("login_sessions").set(
|
|
1148
|
-
|
|
1148
|
+
L({
|
|
1149
1149
|
...r
|
|
1150
1150
|
})
|
|
1151
1151
|
).where("login_sessions.id", "=", a).where("login_sessions.tenant_id", "=", e).execute()).length === 1;
|
|
@@ -1184,7 +1184,7 @@ function he(t) {
|
|
|
1184
1184
|
function wa(t) {
|
|
1185
1185
|
return async (e, a) => {
|
|
1186
1186
|
try {
|
|
1187
|
-
const r =
|
|
1187
|
+
const r = Be.parse(a);
|
|
1188
1188
|
await t.insertInto("prompt_settings").values({
|
|
1189
1189
|
...he(r),
|
|
1190
1190
|
tenant_id: e
|
|
@@ -1296,14 +1296,14 @@ function ka(t) {
|
|
|
1296
1296
|
return async (e, a = {}) => {
|
|
1297
1297
|
const { page: r = 0, per_page: n = 50, include_totals: o = !1, sort: s, q: i } = a;
|
|
1298
1298
|
let c = t.selectFrom("refresh_tokens").where("refresh_tokens.tenant_id", "=", e);
|
|
1299
|
-
i && (c =
|
|
1299
|
+
i && (c = S(t, c, i, ["token", "session_id"]));
|
|
1300
1300
|
let u = c;
|
|
1301
1301
|
if (s && s.sort_by) {
|
|
1302
1302
|
const { ref: g } = t.dynamic;
|
|
1303
1303
|
u = u.orderBy(g(s.sort_by), s.sort_order);
|
|
1304
1304
|
}
|
|
1305
1305
|
u = u.offset(r * n).limit(n);
|
|
1306
|
-
const
|
|
1306
|
+
const d = (await u.selectAll().execute()).map((g) => ({
|
|
1307
1307
|
...g,
|
|
1308
1308
|
rotating: !!g.rotating,
|
|
1309
1309
|
device: g.device ? JSON.parse(g.device) : {},
|
|
@@ -1311,14 +1311,14 @@ function ka(t) {
|
|
|
1311
1311
|
}));
|
|
1312
1312
|
if (!o)
|
|
1313
1313
|
return {
|
|
1314
|
-
refresh_tokens:
|
|
1314
|
+
refresh_tokens: d,
|
|
1315
1315
|
start: 0,
|
|
1316
1316
|
limit: 0,
|
|
1317
1317
|
length: 0
|
|
1318
1318
|
};
|
|
1319
1319
|
const { count: h } = await c.select((g) => g.fn.countAll().as("count")).executeTakeFirstOrThrow(), f = x(h);
|
|
1320
1320
|
return {
|
|
1321
|
-
refresh_tokens:
|
|
1321
|
+
refresh_tokens: d,
|
|
1322
1322
|
start: r * n,
|
|
1323
1323
|
limit: n,
|
|
1324
1324
|
length: f
|
|
@@ -1366,8 +1366,8 @@ function Ia(t) {
|
|
|
1366
1366
|
}
|
|
1367
1367
|
function Da(t) {
|
|
1368
1368
|
return async (e, a) => {
|
|
1369
|
-
const r =
|
|
1370
|
-
id:
|
|
1369
|
+
const r = Y.parse({
|
|
1370
|
+
id: T(),
|
|
1371
1371
|
...a,
|
|
1372
1372
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1373
1373
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -1379,15 +1379,15 @@ function Da(t) {
|
|
|
1379
1379
|
start: JSON.stringify(r.start || {}),
|
|
1380
1380
|
ending: JSON.stringify(r.ending || {}),
|
|
1381
1381
|
tenant_id: e
|
|
1382
|
-
}).execute(),
|
|
1382
|
+
}).execute(), Y.parse(r);
|
|
1383
1383
|
};
|
|
1384
1384
|
}
|
|
1385
1385
|
function Pa(t) {
|
|
1386
1386
|
return async (e, a = {}) => {
|
|
1387
1387
|
const { page: r = 0, per_page: n = 50, include_totals: o = !1, q: s } = a;
|
|
1388
1388
|
let i = t.selectFrom("forms").where("tenant_id", "=", e);
|
|
1389
|
-
s && (i =
|
|
1390
|
-
const
|
|
1389
|
+
s && (i = S(t, i, s, []));
|
|
1390
|
+
const _ = (await i.offset(r * n).limit(n).selectAll().execute()).map((h) => {
|
|
1391
1391
|
const f = { ...h };
|
|
1392
1392
|
if (typeof f.nodes == "string")
|
|
1393
1393
|
try {
|
|
@@ -1404,31 +1404,31 @@ function Pa(t) {
|
|
|
1404
1404
|
f.ending = JSON.parse(f.ending);
|
|
1405
1405
|
} catch {
|
|
1406
1406
|
}
|
|
1407
|
-
return
|
|
1407
|
+
return Y.parse(y(f));
|
|
1408
1408
|
});
|
|
1409
1409
|
if (!o)
|
|
1410
1410
|
return {
|
|
1411
|
-
forms:
|
|
1411
|
+
forms: _,
|
|
1412
1412
|
start: 0,
|
|
1413
1413
|
limit: 0,
|
|
1414
1414
|
length: 0
|
|
1415
1415
|
};
|
|
1416
|
-
const { count:
|
|
1416
|
+
const { count: d } = await i.select((h) => h.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1417
1417
|
return {
|
|
1418
|
-
forms:
|
|
1418
|
+
forms: _,
|
|
1419
1419
|
start: r * n,
|
|
1420
1420
|
limit: n,
|
|
1421
|
-
length: x(
|
|
1421
|
+
length: x(d)
|
|
1422
1422
|
};
|
|
1423
1423
|
};
|
|
1424
1424
|
}
|
|
1425
|
-
function
|
|
1425
|
+
function za(t) {
|
|
1426
1426
|
return async (e, a) => {
|
|
1427
1427
|
const { numDeletedRows: r } = await t.deleteFrom("forms").where("id", "=", a).where("tenant_id", "=", e).executeTakeFirst();
|
|
1428
1428
|
return r > 0;
|
|
1429
1429
|
};
|
|
1430
1430
|
}
|
|
1431
|
-
function
|
|
1431
|
+
function ja(t) {
|
|
1432
1432
|
return async (e, a) => {
|
|
1433
1433
|
const r = await t.selectFrom("forms").selectAll().where("forms.id", "=", a).where("tenant_id", "=", e).executeTakeFirst();
|
|
1434
1434
|
if (!r) return null;
|
|
@@ -1448,10 +1448,10 @@ function Fa(t) {
|
|
|
1448
1448
|
n.ending = JSON.parse(n.ending);
|
|
1449
1449
|
} catch {
|
|
1450
1450
|
}
|
|
1451
|
-
return
|
|
1451
|
+
return Y.parse(y(n));
|
|
1452
1452
|
};
|
|
1453
1453
|
}
|
|
1454
|
-
function
|
|
1454
|
+
function Fa(t) {
|
|
1455
1455
|
return async (e, a, r) => {
|
|
1456
1456
|
const n = {
|
|
1457
1457
|
...r,
|
|
@@ -1462,36 +1462,36 @@ function Aa(t) {
|
|
|
1462
1462
|
return o > 0;
|
|
1463
1463
|
};
|
|
1464
1464
|
}
|
|
1465
|
-
function
|
|
1465
|
+
function Aa(t) {
|
|
1466
1466
|
return {
|
|
1467
1467
|
create: Da(t),
|
|
1468
|
-
get:
|
|
1468
|
+
get: ja(t),
|
|
1469
1469
|
list: Pa(t),
|
|
1470
|
-
remove:
|
|
1471
|
-
update:
|
|
1470
|
+
remove: za(t),
|
|
1471
|
+
update: Fa(t)
|
|
1472
1472
|
};
|
|
1473
1473
|
}
|
|
1474
|
-
function
|
|
1474
|
+
function Ma(t) {
|
|
1475
1475
|
return async (e, a) => {
|
|
1476
1476
|
const r = (/* @__PURE__ */ new Date()).toISOString(), n = {
|
|
1477
|
-
id:
|
|
1477
|
+
id: T(),
|
|
1478
1478
|
...a,
|
|
1479
1479
|
created_at: r,
|
|
1480
1480
|
updated_at: r
|
|
1481
|
-
}, o =
|
|
1481
|
+
}, o = Qe.parse(n), {
|
|
1482
1482
|
verificationKey: s,
|
|
1483
1483
|
scopes: i,
|
|
1484
1484
|
options: c,
|
|
1485
1485
|
skip_consent_for_verifiable_first_party_clients: u,
|
|
1486
|
-
allow_offline_access:
|
|
1487
|
-
...
|
|
1486
|
+
allow_offline_access: _,
|
|
1487
|
+
...d
|
|
1488
1488
|
} = o, h = {
|
|
1489
|
-
...
|
|
1489
|
+
...d,
|
|
1490
1490
|
tenant_id: e,
|
|
1491
1491
|
scopes: i ? JSON.stringify(i) : "[]",
|
|
1492
1492
|
options: c ? JSON.stringify(c) : "{}",
|
|
1493
1493
|
skip_consent_for_verifiable_first_party_clients: u ? 1 : 0,
|
|
1494
|
-
allow_offline_access:
|
|
1494
|
+
allow_offline_access: _ ? 1 : 0,
|
|
1495
1495
|
verification_key: s,
|
|
1496
1496
|
created_at: r,
|
|
1497
1497
|
updated_at: r
|
|
@@ -1509,9 +1509,9 @@ function Ja(t) {
|
|
|
1509
1509
|
options: i,
|
|
1510
1510
|
skip_consent_for_verifiable_first_party_clients: c,
|
|
1511
1511
|
allow_offline_access: u,
|
|
1512
|
-
...
|
|
1513
|
-
} = n,
|
|
1514
|
-
...
|
|
1512
|
+
..._
|
|
1513
|
+
} = n, d = {
|
|
1514
|
+
..._,
|
|
1515
1515
|
scopes: s ? JSON.parse(s) : [],
|
|
1516
1516
|
options: i ? JSON.parse(i) : {},
|
|
1517
1517
|
skip_consent_for_verifiable_first_party_clients: !!c,
|
|
@@ -1519,38 +1519,38 @@ function Ja(t) {
|
|
|
1519
1519
|
// Convert verification_key back to verificationKey for API
|
|
1520
1520
|
verificationKey: o
|
|
1521
1521
|
};
|
|
1522
|
-
return y(
|
|
1522
|
+
return y(d);
|
|
1523
1523
|
};
|
|
1524
1524
|
}
|
|
1525
|
-
function
|
|
1525
|
+
function Ea(t) {
|
|
1526
1526
|
return async (e, a = {}) => {
|
|
1527
1527
|
const { page: r = 0, per_page: n = 50, include_totals: o = !1, q: s } = a;
|
|
1528
1528
|
let i = t.selectFrom("resource_servers").where("resource_servers.tenant_id", "=", e);
|
|
1529
1529
|
if (s) {
|
|
1530
1530
|
const h = s.trim(), f = h.split(/\s+/), g = f.length === 1 ? f[0] : void 0, w = g ? g.match(/^(-)?(name|identifier):(.*)$/) : null, b = w ? w[3] : "", D = /^(>=|>|<=|<)/.test(b || "");
|
|
1531
1531
|
if (w && !D) {
|
|
1532
|
-
const
|
|
1533
|
-
i =
|
|
1532
|
+
const F = !!w[1], P = w[2] === "name" ? "resource_servers.name" : "resource_servers.identifier";
|
|
1533
|
+
i = F ? i.where(P, "not like", `%${b}%`) : i.where(P, "like", `%${b}%`);
|
|
1534
1534
|
} else
|
|
1535
|
-
i =
|
|
1535
|
+
i = S(t, i, h, [
|
|
1536
1536
|
"resource_servers.name",
|
|
1537
1537
|
"resource_servers.identifier"
|
|
1538
1538
|
]);
|
|
1539
1539
|
}
|
|
1540
|
-
const
|
|
1540
|
+
const _ = (await i.offset(r * n).limit(n).selectAll().execute()).map((h) => {
|
|
1541
1541
|
const f = h, {
|
|
1542
1542
|
verification_key: g,
|
|
1543
1543
|
scopes: w,
|
|
1544
1544
|
options: b,
|
|
1545
1545
|
skip_consent_for_verifiable_first_party_clients: D,
|
|
1546
|
-
allow_offline_access:
|
|
1546
|
+
allow_offline_access: F,
|
|
1547
1547
|
...P
|
|
1548
1548
|
} = f, V = {
|
|
1549
1549
|
...P,
|
|
1550
1550
|
scopes: w ? JSON.parse(w) : [],
|
|
1551
1551
|
options: b ? JSON.parse(b) : {},
|
|
1552
1552
|
skip_consent_for_verifiable_first_party_clients: !!D,
|
|
1553
|
-
allow_offline_access: !!
|
|
1553
|
+
allow_offline_access: !!F,
|
|
1554
1554
|
// Convert verification_key back to verificationKey for API
|
|
1555
1555
|
verificationKey: g
|
|
1556
1556
|
};
|
|
@@ -1558,21 +1558,21 @@ function La(t) {
|
|
|
1558
1558
|
});
|
|
1559
1559
|
if (!o)
|
|
1560
1560
|
return {
|
|
1561
|
-
resource_servers:
|
|
1561
|
+
resource_servers: _,
|
|
1562
1562
|
start: 0,
|
|
1563
1563
|
limit: 0,
|
|
1564
1564
|
length: 0
|
|
1565
1565
|
};
|
|
1566
|
-
const { count:
|
|
1566
|
+
const { count: d } = await i.select((h) => h.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1567
1567
|
return {
|
|
1568
|
-
resource_servers:
|
|
1568
|
+
resource_servers: _,
|
|
1569
1569
|
start: r * n,
|
|
1570
1570
|
limit: n,
|
|
1571
|
-
length: x(
|
|
1571
|
+
length: x(d)
|
|
1572
1572
|
};
|
|
1573
1573
|
};
|
|
1574
1574
|
}
|
|
1575
|
-
function
|
|
1575
|
+
function La(t) {
|
|
1576
1576
|
return async (e, a) => {
|
|
1577
1577
|
const r = await t.deleteFrom("resource_servers").where("tenant_id", "=", e).where("id", "=", a).executeTakeFirst();
|
|
1578
1578
|
return Number(r.numDeletedRows) > 0;
|
|
@@ -1587,27 +1587,27 @@ function Ra(t) {
|
|
|
1587
1587
|
skip_consent_for_verifiable_first_party_clients: i,
|
|
1588
1588
|
allow_offline_access: c,
|
|
1589
1589
|
...u
|
|
1590
|
-
} = r,
|
|
1590
|
+
} = r, _ = {
|
|
1591
1591
|
...u,
|
|
1592
1592
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1593
1593
|
};
|
|
1594
|
-
n !== void 0 && (
|
|
1595
|
-
const
|
|
1596
|
-
return Number(
|
|
1594
|
+
n !== void 0 && (_.verification_key = n), o !== void 0 && (_.scopes = JSON.stringify(o)), s !== void 0 && (_.options = JSON.stringify(s)), i !== void 0 && (_.skip_consent_for_verifiable_first_party_clients = i ? 1 : 0), c !== void 0 && (_.allow_offline_access = c ? 1 : 0);
|
|
1595
|
+
const d = await t.updateTable("resource_servers").set(_).where("tenant_id", "=", e).where("id", "=", a).executeTakeFirst();
|
|
1596
|
+
return Number(d.numUpdatedRows) > 0;
|
|
1597
1597
|
};
|
|
1598
1598
|
}
|
|
1599
1599
|
function Ka(t) {
|
|
1600
1600
|
return {
|
|
1601
|
-
create:
|
|
1601
|
+
create: Ma(t),
|
|
1602
1602
|
get: Ja(t),
|
|
1603
|
-
list:
|
|
1604
|
-
remove:
|
|
1603
|
+
list: Ea(t),
|
|
1604
|
+
remove: La(t),
|
|
1605
1605
|
update: Ra(t)
|
|
1606
1606
|
};
|
|
1607
1607
|
}
|
|
1608
1608
|
function Ua(t) {
|
|
1609
1609
|
return async (e, a) => {
|
|
1610
|
-
const r = (/* @__PURE__ */ new Date()).toISOString(), n =
|
|
1610
|
+
const r = (/* @__PURE__ */ new Date()).toISOString(), n = T(), o = {
|
|
1611
1611
|
id: n,
|
|
1612
1612
|
...a,
|
|
1613
1613
|
tenant_id: e,
|
|
@@ -1622,7 +1622,7 @@ function Ua(t) {
|
|
|
1622
1622
|
};
|
|
1623
1623
|
};
|
|
1624
1624
|
}
|
|
1625
|
-
function
|
|
1625
|
+
function qa(t) {
|
|
1626
1626
|
return async (e, a) => {
|
|
1627
1627
|
const r = await t.selectFrom("roles").selectAll().where("roles.tenant_id", "=", e).where("roles.id", "=", a).executeTakeFirst();
|
|
1628
1628
|
return r ? {
|
|
@@ -1630,11 +1630,11 @@ function Ba(t) {
|
|
|
1630
1630
|
} : null;
|
|
1631
1631
|
};
|
|
1632
1632
|
}
|
|
1633
|
-
function
|
|
1633
|
+
function Ba(t) {
|
|
1634
1634
|
return async (e, a) => {
|
|
1635
1635
|
let r = t.selectFrom("roles").where("roles.tenant_id", "=", e);
|
|
1636
1636
|
const { page: n = 0, per_page: o = 50, include_totals: s = !1 } = a;
|
|
1637
|
-
a.q && (r =
|
|
1637
|
+
a.q && (r = S(t, r, a.q, ["name"]));
|
|
1638
1638
|
const c = await r.offset(n * o).limit(o).selectAll().execute();
|
|
1639
1639
|
if (!s)
|
|
1640
1640
|
return {
|
|
@@ -1643,7 +1643,7 @@ function Qa(t) {
|
|
|
1643
1643
|
limit: o,
|
|
1644
1644
|
length: c.length
|
|
1645
1645
|
};
|
|
1646
|
-
const { count: u } = await r.select((
|
|
1646
|
+
const { count: u } = await r.select((_) => _.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1647
1647
|
return {
|
|
1648
1648
|
roles: c,
|
|
1649
1649
|
start: n * o,
|
|
@@ -1652,7 +1652,7 @@ function Qa(t) {
|
|
|
1652
1652
|
};
|
|
1653
1653
|
};
|
|
1654
1654
|
}
|
|
1655
|
-
function
|
|
1655
|
+
function Qa(t) {
|
|
1656
1656
|
return async (e, a, r) => {
|
|
1657
1657
|
const n = {
|
|
1658
1658
|
...r,
|
|
@@ -1661,19 +1661,19 @@ function qa(t) {
|
|
|
1661
1661
|
return Number(o.numUpdatedRows) > 0;
|
|
1662
1662
|
};
|
|
1663
1663
|
}
|
|
1664
|
-
function
|
|
1664
|
+
function Wa(t) {
|
|
1665
1665
|
return async (e, a) => {
|
|
1666
1666
|
const r = await t.deleteFrom("roles").where("tenant_id", "=", e).where("id", "=", a).executeTakeFirst();
|
|
1667
1667
|
return Number(r.numDeletedRows) > 0;
|
|
1668
1668
|
};
|
|
1669
1669
|
}
|
|
1670
|
-
function
|
|
1670
|
+
function Va(t) {
|
|
1671
1671
|
return {
|
|
1672
1672
|
create: Ua(t),
|
|
1673
|
-
get:
|
|
1674
|
-
list:
|
|
1675
|
-
update:
|
|
1676
|
-
remove:
|
|
1673
|
+
get: qa(t),
|
|
1674
|
+
list: Ba(t),
|
|
1675
|
+
update: Qa(t),
|
|
1676
|
+
remove: Wa(t)
|
|
1677
1677
|
};
|
|
1678
1678
|
}
|
|
1679
1679
|
function Ga(t) {
|
|
@@ -1707,7 +1707,7 @@ function Ga(t) {
|
|
|
1707
1707
|
}
|
|
1708
1708
|
};
|
|
1709
1709
|
}
|
|
1710
|
-
function
|
|
1710
|
+
function Ya(t) {
|
|
1711
1711
|
return async (e, a, r) => {
|
|
1712
1712
|
if (r.length === 0) return !0;
|
|
1713
1713
|
try {
|
|
@@ -1725,12 +1725,12 @@ function Ha(t) {
|
|
|
1725
1725
|
}
|
|
1726
1726
|
};
|
|
1727
1727
|
}
|
|
1728
|
-
function
|
|
1728
|
+
function Ha(t) {
|
|
1729
1729
|
return async (e, a, r = {}) => {
|
|
1730
1730
|
const { page: n = 0, per_page: o = 50, include_totals: s = !1 } = r;
|
|
1731
1731
|
let i = t.selectFrom("role_permissions").leftJoin(
|
|
1732
1732
|
"resource_servers",
|
|
1733
|
-
(
|
|
1733
|
+
(d) => d.onRef(
|
|
1734
1734
|
"role_permissions.tenant_id",
|
|
1735
1735
|
"=",
|
|
1736
1736
|
"resource_servers.tenant_id"
|
|
@@ -1746,157 +1746,172 @@ function Ya(t) {
|
|
|
1746
1746
|
"role_permissions.created_at",
|
|
1747
1747
|
"resource_servers.name as resource_server_name"
|
|
1748
1748
|
]).where("role_permissions.tenant_id", "=", e).where("role_permissions.role_id", "=", a);
|
|
1749
|
-
const
|
|
1750
|
-
role_id:
|
|
1751
|
-
resource_server_identifier:
|
|
1752
|
-
resource_server_name:
|
|
1749
|
+
const _ = (await i.offset(n * o).limit(o).execute()).map((d) => ({
|
|
1750
|
+
role_id: d.role_id,
|
|
1751
|
+
resource_server_identifier: d.resource_server_identifier,
|
|
1752
|
+
resource_server_name: d.resource_server_name || d.resource_server_identifier,
|
|
1753
1753
|
// Fallback to identifier if name is null
|
|
1754
|
-
permission_name:
|
|
1754
|
+
permission_name: d.permission_name,
|
|
1755
1755
|
description: null,
|
|
1756
1756
|
// No description available from role_permissions directly
|
|
1757
|
-
created_at:
|
|
1757
|
+
created_at: d.created_at
|
|
1758
1758
|
}));
|
|
1759
|
-
return s && await i.select((
|
|
1759
|
+
return s && await i.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), _;
|
|
1760
1760
|
};
|
|
1761
1761
|
}
|
|
1762
1762
|
function Xa(t) {
|
|
1763
1763
|
return {
|
|
1764
1764
|
assign: Ga(t),
|
|
1765
|
-
remove:
|
|
1766
|
-
list:
|
|
1765
|
+
remove: Ya(t),
|
|
1766
|
+
list: Ha(t)
|
|
1767
1767
|
};
|
|
1768
1768
|
}
|
|
1769
1769
|
function Za(t) {
|
|
1770
|
-
return async (e, a, r) => {
|
|
1771
|
-
|
|
1772
|
-
const n = (/* @__PURE__ */ new Date()).toISOString();
|
|
1770
|
+
return async (e, a, r, n) => {
|
|
1771
|
+
const o = (/* @__PURE__ */ new Date()).toISOString();
|
|
1773
1772
|
try {
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
if (i.code === "SQLITE_CONSTRAINT_PRIMARYKEY" || i.code === "SQLITE_CONSTRAINT_UNIQUE")
|
|
1786
|
-
continue;
|
|
1787
|
-
throw i;
|
|
1788
|
-
}
|
|
1789
|
-
}
|
|
1790
|
-
return !0;
|
|
1791
|
-
} catch (o) {
|
|
1792
|
-
return console.error("Error assigning user permissions:", o), !1;
|
|
1773
|
+
const s = {
|
|
1774
|
+
tenant_id: e,
|
|
1775
|
+
user_id: a,
|
|
1776
|
+
resource_server_identifier: r.resource_server_identifier,
|
|
1777
|
+
permission_name: r.permission_name,
|
|
1778
|
+
organization_id: n || r.organization_id || "",
|
|
1779
|
+
created_at: o
|
|
1780
|
+
};
|
|
1781
|
+
return await t.insertInto("user_permissions").values(s).execute(), !0;
|
|
1782
|
+
} catch (s) {
|
|
1783
|
+
return s.code === "SQLITE_CONSTRAINT_PRIMARYKEY" || s.code === "SQLITE_CONSTRAINT_UNIQUE" || s.code === "SQLITE_CONSTRAINT" || s.message && s.message.includes("UNIQUE constraint failed") || s.message && s.message.includes("PRIMARY KEY constraint failed") ? !0 : (console.error("Error creating user permission:", s), !1);
|
|
1793
1784
|
}
|
|
1794
1785
|
};
|
|
1795
1786
|
}
|
|
1796
1787
|
function er(t) {
|
|
1797
|
-
return async (e, a, r) => {
|
|
1798
|
-
if (r.length === 0) return !0;
|
|
1788
|
+
return async (e, a, r, n) => {
|
|
1799
1789
|
try {
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
return console.error("Error removing user permissions:", n), !1;
|
|
1790
|
+
let o = t.deleteFrom("user_permissions").where("tenant_id", "=", e).where("user_id", "=", a).where(
|
|
1791
|
+
"resource_server_identifier",
|
|
1792
|
+
"=",
|
|
1793
|
+
r.resource_server_identifier
|
|
1794
|
+
).where("permission_name", "=", r.permission_name);
|
|
1795
|
+
return n !== void 0 ? o = o.where("organization_id", "=", n) : o = o.where("organization_id", "=", ""), await o.execute(), !0;
|
|
1796
|
+
} catch (o) {
|
|
1797
|
+
return console.error("Error removing user permission:", o), !1;
|
|
1809
1798
|
}
|
|
1810
1799
|
};
|
|
1811
1800
|
}
|
|
1812
1801
|
function tr(t) {
|
|
1813
|
-
return async (e, a, r) =>
|
|
1814
|
-
"
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1802
|
+
return async (e, a, r, n) => {
|
|
1803
|
+
let o = t.selectFrom("user_permissions").leftJoin(
|
|
1804
|
+
"resource_servers",
|
|
1805
|
+
(i) => i.onRef(
|
|
1806
|
+
"user_permissions.tenant_id",
|
|
1807
|
+
"=",
|
|
1808
|
+
"resource_servers.tenant_id"
|
|
1809
|
+
).onRef(
|
|
1810
|
+
"user_permissions.resource_server_identifier",
|
|
1811
|
+
"=",
|
|
1812
|
+
"resource_servers.id"
|
|
1813
|
+
)
|
|
1814
|
+
).select([
|
|
1820
1815
|
"user_permissions.resource_server_identifier",
|
|
1816
|
+
"user_permissions.permission_name",
|
|
1817
|
+
"resource_servers.name as resource_server_name",
|
|
1818
|
+
"user_permissions.user_id",
|
|
1819
|
+
"user_permissions.created_at",
|
|
1820
|
+
"user_permissions.organization_id"
|
|
1821
|
+
]).where("user_permissions.tenant_id", "=", e).where("user_permissions.user_id", "=", a);
|
|
1822
|
+
return n !== void 0 && (o = o.where(
|
|
1823
|
+
"user_permissions.organization_id",
|
|
1821
1824
|
"=",
|
|
1822
|
-
|
|
1823
|
-
)
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
resource_server_name: o.resource_server_name || o.resource_server_identifier,
|
|
1836
|
-
// Fallback to identifier if name is null
|
|
1837
|
-
user_id: o.user_id,
|
|
1838
|
-
created_at: o.created_at
|
|
1839
|
-
}));
|
|
1825
|
+
n
|
|
1826
|
+
)), (await o.execute()).map((i) => ({
|
|
1827
|
+
resource_server_identifier: i.resource_server_identifier,
|
|
1828
|
+
permission_name: i.permission_name,
|
|
1829
|
+
description: null,
|
|
1830
|
+
// No description available from user_permissions directly
|
|
1831
|
+
resource_server_name: i.resource_server_name || i.resource_server_identifier,
|
|
1832
|
+
// Fallback to identifier if name is null
|
|
1833
|
+
user_id: i.user_id,
|
|
1834
|
+
created_at: i.created_at,
|
|
1835
|
+
organization_id: i.organization_id === "" ? void 0 : i.organization_id
|
|
1836
|
+
}));
|
|
1837
|
+
};
|
|
1840
1838
|
}
|
|
1841
1839
|
function ar(t) {
|
|
1842
1840
|
return {
|
|
1843
|
-
|
|
1841
|
+
create: Za(t),
|
|
1844
1842
|
remove: er(t),
|
|
1845
1843
|
list: tr(t)
|
|
1846
1844
|
};
|
|
1847
1845
|
}
|
|
1848
1846
|
function rr(t) {
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
(n) =>
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
"r.description",
|
|
1856
|
-
"r.created_at",
|
|
1857
|
-
"r.updated_at"
|
|
1858
|
-
]).where("ur.tenant_id", "=", e).where("ur.user_id", "=", a).execute();
|
|
1847
|
+
const e = ar(t);
|
|
1848
|
+
return {
|
|
1849
|
+
create: (a, r, n, o) => e.create(a, r, n, o),
|
|
1850
|
+
remove: (a, r, n, o) => e.remove(a, r, n, o),
|
|
1851
|
+
list: (a, r, n, o) => e.list(a, r, n, o)
|
|
1852
|
+
};
|
|
1859
1853
|
}
|
|
1860
1854
|
function nr(t) {
|
|
1861
|
-
return async (e, a, r) => {
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
return !0;
|
|
1874
|
-
} catch (o) {
|
|
1875
|
-
return console.error("Error assigning user roles:", o), !1;
|
|
1876
|
-
}
|
|
1855
|
+
return async (e, a, r, n) => {
|
|
1856
|
+
let o = t.selectFrom("user_roles as ur").innerJoin(
|
|
1857
|
+
"roles as r",
|
|
1858
|
+
(i) => i.onRef("ur.role_id", "=", "r.id").onRef("ur.tenant_id", "=", "r.tenant_id")
|
|
1859
|
+
).select([
|
|
1860
|
+
"r.id",
|
|
1861
|
+
"r.name",
|
|
1862
|
+
"r.description",
|
|
1863
|
+
"r.created_at",
|
|
1864
|
+
"r.updated_at"
|
|
1865
|
+
]).where("ur.tenant_id", "=", e).where("ur.user_id", "=", a);
|
|
1866
|
+
return n !== void 0 && (o = o.where("ur.organization_id", "=", n)), await o.execute();
|
|
1877
1867
|
};
|
|
1878
1868
|
}
|
|
1879
1869
|
function or(t) {
|
|
1880
|
-
return async (e, a, r) => {
|
|
1870
|
+
return async (e, a, r, n) => {
|
|
1871
|
+
const o = (/* @__PURE__ */ new Date()).toISOString();
|
|
1881
1872
|
try {
|
|
1882
|
-
return
|
|
1883
|
-
|
|
1884
|
-
|
|
1873
|
+
return await t.insertInto("user_roles").values({
|
|
1874
|
+
tenant_id: e,
|
|
1875
|
+
user_id: a,
|
|
1876
|
+
role_id: r,
|
|
1877
|
+
organization_id: n || "",
|
|
1878
|
+
created_at: o
|
|
1879
|
+
}).execute(), !0;
|
|
1880
|
+
} catch (s) {
|
|
1881
|
+
return s.code === "SQLITE_CONSTRAINT_PRIMARYKEY" || s.code === "SQLITE_CONSTRAINT_UNIQUE" || s.code === "SQLITE_CONSTRAINT" || s.message && s.message.includes("UNIQUE constraint failed") || s.message && s.message.includes("PRIMARY KEY constraint failed") ? !0 : (console.error("Error creating user role:", s), !1);
|
|
1885
1882
|
}
|
|
1886
1883
|
};
|
|
1887
1884
|
}
|
|
1888
1885
|
function sr(t) {
|
|
1889
|
-
return {
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1886
|
+
return async (e, a, r, n) => {
|
|
1887
|
+
try {
|
|
1888
|
+
let o = t.deleteFrom("user_roles").where("tenant_id", "=", e).where("user_id", "=", a).where("role_id", "=", r);
|
|
1889
|
+
return n !== void 0 ? o = o.where("organization_id", "=", n) : o = o.where("organization_id", "=", ""), await o.execute(), !0;
|
|
1890
|
+
} catch (o) {
|
|
1891
|
+
return console.error("Error removing user roles:", o), !1;
|
|
1892
|
+
}
|
|
1893
1893
|
};
|
|
1894
1894
|
}
|
|
1895
1895
|
function ir(t) {
|
|
1896
|
+
return {
|
|
1897
|
+
list: nr(t),
|
|
1898
|
+
create: or(t),
|
|
1899
|
+
remove: sr(t)
|
|
1900
|
+
};
|
|
1901
|
+
}
|
|
1902
|
+
function lr(t) {
|
|
1903
|
+
const e = ir(t);
|
|
1904
|
+
return {
|
|
1905
|
+
list: (a, r, n, o) => e.list(a, r, n, o),
|
|
1906
|
+
create: (a, r, n, o) => e.create(a, r, n, o),
|
|
1907
|
+
remove: (a, r, n, o) => e.remove(a, r, n, o)
|
|
1908
|
+
};
|
|
1909
|
+
}
|
|
1910
|
+
function cr(t) {
|
|
1896
1911
|
return async (e, a) => {
|
|
1897
1912
|
const r = {
|
|
1898
1913
|
...a,
|
|
1899
|
-
id: a.id ||
|
|
1914
|
+
id: a.id || T(),
|
|
1900
1915
|
tenant_id: e,
|
|
1901
1916
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1902
1917
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -1910,7 +1925,7 @@ function ir(t) {
|
|
|
1910
1925
|
try {
|
|
1911
1926
|
await t.insertInto("organizations").values(r).execute();
|
|
1912
1927
|
} catch (n) {
|
|
1913
|
-
throw n.code === "SQLITE_CONSTRAINT_UNIQUE" || n.message.includes("AlreadyExists") ? new
|
|
1928
|
+
throw n.code === "SQLITE_CONSTRAINT_UNIQUE" || n.message.includes("AlreadyExists") ? new B(409, {
|
|
1914
1929
|
message: "Organization already exists"
|
|
1915
1930
|
}) : n;
|
|
1916
1931
|
}
|
|
@@ -1922,7 +1937,7 @@ function ir(t) {
|
|
|
1922
1937
|
};
|
|
1923
1938
|
};
|
|
1924
1939
|
}
|
|
1925
|
-
function
|
|
1940
|
+
function dr(t) {
|
|
1926
1941
|
return async (e, a) => {
|
|
1927
1942
|
const r = await t.selectFrom("organizations").selectAll().where("tenant_id", "=", e).where("id", "=", a).executeTakeFirst();
|
|
1928
1943
|
return r ? y({
|
|
@@ -1934,7 +1949,7 @@ function lr(t) {
|
|
|
1934
1949
|
}) : null;
|
|
1935
1950
|
};
|
|
1936
1951
|
}
|
|
1937
|
-
function
|
|
1952
|
+
function ur(t) {
|
|
1938
1953
|
return async (e, a) => {
|
|
1939
1954
|
let r = t.selectFrom("organizations").selectAll().where("tenant_id", "=", e).orderBy("created_at", "desc");
|
|
1940
1955
|
if (a != null && a.per_page && (r = r.limit(a.per_page)), a != null && a.page) {
|
|
@@ -1958,10 +1973,10 @@ function cr(t) {
|
|
|
1958
1973
|
};
|
|
1959
1974
|
};
|
|
1960
1975
|
}
|
|
1961
|
-
function
|
|
1976
|
+
function mr(t) {
|
|
1962
1977
|
return async (e, a) => (await t.deleteFrom("organizations").where("tenant_id", "=", e).where("id", "=", a).execute()).length > 0;
|
|
1963
1978
|
}
|
|
1964
|
-
function
|
|
1979
|
+
function _r(t) {
|
|
1965
1980
|
return async (e, a, r) => {
|
|
1966
1981
|
const { branding: n, metadata: o, enabled_connections: s, token_quota: i, ...c } = r, u = {
|
|
1967
1982
|
...c,
|
|
@@ -1970,22 +1985,164 @@ function ur(t) {
|
|
|
1970
1985
|
return n !== void 0 && (u.branding = JSON.stringify(n)), o !== void 0 && (u.metadata = JSON.stringify(o)), s !== void 0 && (u.enabled_connections = JSON.stringify(s)), i !== void 0 && (u.token_quota = JSON.stringify(i)), (await t.updateTable("organizations").set(u).where("tenant_id", "=", e).where("id", "=", a).execute()).length > 0;
|
|
1971
1986
|
};
|
|
1972
1987
|
}
|
|
1973
|
-
function
|
|
1988
|
+
function hr(t) {
|
|
1974
1989
|
return {
|
|
1975
|
-
create:
|
|
1976
|
-
get:
|
|
1977
|
-
list:
|
|
1978
|
-
remove:
|
|
1979
|
-
update:
|
|
1990
|
+
create: cr(t),
|
|
1991
|
+
get: dr(t),
|
|
1992
|
+
list: ur(t),
|
|
1993
|
+
remove: mr(t),
|
|
1994
|
+
update: _r(t)
|
|
1980
1995
|
};
|
|
1981
1996
|
}
|
|
1982
|
-
function
|
|
1997
|
+
function fr(t) {
|
|
1998
|
+
return async (e, a) => {
|
|
1999
|
+
const r = {
|
|
2000
|
+
id: T(),
|
|
2001
|
+
tenant_id: e,
|
|
2002
|
+
user_id: a.user_id,
|
|
2003
|
+
organization_id: a.organization_id,
|
|
2004
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2005
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
2006
|
+
};
|
|
2007
|
+
try {
|
|
2008
|
+
await t.insertInto("user_organizations").values(r).execute();
|
|
2009
|
+
} catch (n) {
|
|
2010
|
+
throw n.code === "SQLITE_CONSTRAINT_UNIQUE" || n.code === "ER_DUP_ENTRY" ? new B(409, {
|
|
2011
|
+
message: "User is already a member of this organization"
|
|
2012
|
+
}) : n;
|
|
2013
|
+
}
|
|
2014
|
+
return {
|
|
2015
|
+
...r
|
|
2016
|
+
};
|
|
2017
|
+
};
|
|
2018
|
+
}
|
|
2019
|
+
function pr(t) {
|
|
2020
|
+
return async (e, a) => {
|
|
2021
|
+
const r = await t.selectFrom("user_organizations").selectAll().where("id", "=", a).where("tenant_id", "=", e).executeTakeFirst();
|
|
2022
|
+
return r ? {
|
|
2023
|
+
id: r.id,
|
|
2024
|
+
user_id: r.user_id,
|
|
2025
|
+
organization_id: r.organization_id,
|
|
2026
|
+
created_at: r.created_at,
|
|
2027
|
+
updated_at: r.updated_at
|
|
2028
|
+
} : null;
|
|
2029
|
+
};
|
|
2030
|
+
}
|
|
2031
|
+
function gr(t) {
|
|
2032
|
+
return async (e, a) => {
|
|
2033
|
+
const r = (a == null ? void 0 : a.page) || 0, n = (a == null ? void 0 : a.per_page) || 50, o = r * n;
|
|
2034
|
+
let s = t.selectFrom("user_organizations").selectAll().where("tenant_id", "=", e);
|
|
2035
|
+
if (a != null && a.q) {
|
|
2036
|
+
if (a.q.startsWith("user_id:")) {
|
|
2037
|
+
const d = a.q.replace("user_id:", "");
|
|
2038
|
+
s = s.where("user_id", "=", d);
|
|
2039
|
+
} else if (a.q.startsWith("organization_id:")) {
|
|
2040
|
+
const d = a.q.replace("organization_id:", "");
|
|
2041
|
+
s = s.where("organization_id", "=", d);
|
|
2042
|
+
}
|
|
2043
|
+
}
|
|
2044
|
+
s = s.orderBy("created_at", "desc"), n > 0 && (s = s.limit(n).offset(o));
|
|
2045
|
+
const i = await s.execute();
|
|
2046
|
+
let c = t.selectFrom("user_organizations").select(t.fn.count("id").as("count")).where("tenant_id", "=", e);
|
|
2047
|
+
if (a != null && a.q) {
|
|
2048
|
+
if (a.q.startsWith("user_id:")) {
|
|
2049
|
+
const d = a.q.replace("user_id:", "");
|
|
2050
|
+
c = c.where("user_id", "=", d);
|
|
2051
|
+
} else if (a.q.startsWith("organization_id:")) {
|
|
2052
|
+
const d = a.q.replace("organization_id:", "");
|
|
2053
|
+
c = c.where("organization_id", "=", d);
|
|
2054
|
+
}
|
|
2055
|
+
}
|
|
2056
|
+
const u = await c.executeTakeFirst();
|
|
2057
|
+
return {
|
|
2058
|
+
userOrganizations: i.map((d) => ({
|
|
2059
|
+
id: d.id,
|
|
2060
|
+
user_id: d.user_id,
|
|
2061
|
+
organization_id: d.organization_id,
|
|
2062
|
+
created_at: d.created_at,
|
|
2063
|
+
updated_at: d.updated_at
|
|
2064
|
+
})),
|
|
2065
|
+
start: o,
|
|
2066
|
+
limit: n,
|
|
2067
|
+
length: Number((u == null ? void 0 : u.count) || 0)
|
|
2068
|
+
};
|
|
2069
|
+
};
|
|
2070
|
+
}
|
|
2071
|
+
function wr(t) {
|
|
2072
|
+
return async (e, a, r) => {
|
|
2073
|
+
const n = (r == null ? void 0 : r.page) || 0, o = (r == null ? void 0 : r.per_page) || 50, s = n * o;
|
|
2074
|
+
let i = t.selectFrom("user_organizations").innerJoin(
|
|
2075
|
+
"organizations",
|
|
2076
|
+
"organizations.id",
|
|
2077
|
+
"user_organizations.organization_id"
|
|
2078
|
+
).select([
|
|
2079
|
+
"organizations.id",
|
|
2080
|
+
"organizations.name",
|
|
2081
|
+
"organizations.display_name",
|
|
2082
|
+
"organizations.branding",
|
|
2083
|
+
"organizations.metadata",
|
|
2084
|
+
"organizations.enabled_connections",
|
|
2085
|
+
"organizations.token_quota",
|
|
2086
|
+
"organizations.created_at",
|
|
2087
|
+
"organizations.updated_at",
|
|
2088
|
+
"user_organizations.created_at as joined_at"
|
|
2089
|
+
]).where("user_organizations.tenant_id", "=", e).where("user_organizations.user_id", "=", a);
|
|
2090
|
+
i = i.orderBy("user_organizations.created_at", "desc"), o > 0 && (i = i.limit(o).offset(s));
|
|
2091
|
+
const c = await i.execute(), u = await t.selectFrom("user_organizations").innerJoin(
|
|
2092
|
+
"organizations",
|
|
2093
|
+
"organizations.id",
|
|
2094
|
+
"user_organizations.organization_id"
|
|
2095
|
+
).select(t.fn.count("user_organizations.id").as("count")).where("user_organizations.tenant_id", "=", e).where("user_organizations.user_id", "=", a).executeTakeFirst();
|
|
2096
|
+
return {
|
|
2097
|
+
organizations: c.map((d) => ({
|
|
2098
|
+
id: d.id,
|
|
2099
|
+
name: d.name,
|
|
2100
|
+
display_name: d.display_name,
|
|
2101
|
+
branding: d.branding ? JSON.parse(d.branding) : void 0,
|
|
2102
|
+
metadata: d.metadata ? JSON.parse(d.metadata) : {},
|
|
2103
|
+
enabled_connections: d.enabled_connections ? JSON.parse(d.enabled_connections) : [],
|
|
2104
|
+
token_quota: d.token_quota ? JSON.parse(d.token_quota) : void 0,
|
|
2105
|
+
created_at: d.created_at,
|
|
2106
|
+
updated_at: d.updated_at,
|
|
2107
|
+
// Add membership info
|
|
2108
|
+
joined_at: d.joined_at
|
|
2109
|
+
})),
|
|
2110
|
+
start: s,
|
|
2111
|
+
limit: o,
|
|
2112
|
+
length: Number((u == null ? void 0 : u.count) || 0)
|
|
2113
|
+
};
|
|
2114
|
+
};
|
|
2115
|
+
}
|
|
2116
|
+
function yr(t) {
|
|
2117
|
+
return async (e, a) => (await t.deleteFrom("user_organizations").where("id", "=", a).where("tenant_id", "=", e).execute()).length > 0;
|
|
2118
|
+
}
|
|
2119
|
+
function vr(t) {
|
|
2120
|
+
return async (e, a, r) => {
|
|
2121
|
+
const n = {
|
|
2122
|
+
...r,
|
|
2123
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
2124
|
+
};
|
|
2125
|
+
return (await t.updateTable("user_organizations").set(n).where("id", "=", a).where("tenant_id", "=", e).execute()).length > 0;
|
|
2126
|
+
};
|
|
2127
|
+
}
|
|
2128
|
+
function Nr(t) {
|
|
2129
|
+
return {
|
|
2130
|
+
// CRUD operations
|
|
2131
|
+
create: fr(t),
|
|
2132
|
+
get: pr(t),
|
|
2133
|
+
list: gr(t),
|
|
2134
|
+
listUserOrganizations: wr(t),
|
|
2135
|
+
remove: yr(t),
|
|
2136
|
+
update: vr(t)
|
|
2137
|
+
};
|
|
2138
|
+
}
|
|
2139
|
+
function Cr(t) {
|
|
1983
2140
|
return t[t.length - 1];
|
|
1984
2141
|
}
|
|
1985
2142
|
function C(t) {
|
|
1986
2143
|
return Object.freeze(t);
|
|
1987
2144
|
}
|
|
1988
|
-
const
|
|
2145
|
+
const G = C({
|
|
1989
2146
|
is(t) {
|
|
1990
2147
|
return t.kind === "IdentifierNode";
|
|
1991
2148
|
},
|
|
@@ -2002,17 +2159,17 @@ const W = C({
|
|
|
2002
2159
|
create(t) {
|
|
2003
2160
|
return C({
|
|
2004
2161
|
kind: "SchemableIdentifierNode",
|
|
2005
|
-
identifier:
|
|
2162
|
+
identifier: G.create(t)
|
|
2006
2163
|
});
|
|
2007
2164
|
},
|
|
2008
2165
|
createWithSchema(t, e) {
|
|
2009
2166
|
return C({
|
|
2010
2167
|
kind: "SchemableIdentifierNode",
|
|
2011
|
-
schema:
|
|
2012
|
-
identifier:
|
|
2168
|
+
schema: G.create(t),
|
|
2169
|
+
identifier: G.create(e)
|
|
2013
2170
|
});
|
|
2014
2171
|
}
|
|
2015
|
-
}),
|
|
2172
|
+
}), br = C({
|
|
2016
2173
|
is(t) {
|
|
2017
2174
|
return t.kind === "AliasNode";
|
|
2018
2175
|
},
|
|
@@ -2040,11 +2197,11 @@ const W = C({
|
|
|
2040
2197
|
});
|
|
2041
2198
|
}
|
|
2042
2199
|
});
|
|
2043
|
-
var
|
|
2044
|
-
class
|
|
2200
|
+
var H;
|
|
2201
|
+
class xr {
|
|
2045
2202
|
constructor() {
|
|
2046
2203
|
R(this, "nodeStack", []);
|
|
2047
|
-
O(this,
|
|
2204
|
+
O(this, H, C({
|
|
2048
2205
|
AliasNode: this.transformAlias.bind(this),
|
|
2049
2206
|
ColumnNode: this.transformColumn.bind(this),
|
|
2050
2207
|
IdentifierNode: this.transformIdentifier.bind(this),
|
|
@@ -2148,7 +2305,7 @@ class fr {
|
|
|
2148
2305
|
return this.nodeStack.pop(), C(a);
|
|
2149
2306
|
}
|
|
2150
2307
|
transformNodeImpl(e) {
|
|
2151
|
-
return
|
|
2308
|
+
return m(this, H)[e.kind](e);
|
|
2152
2309
|
}
|
|
2153
2310
|
transformNodeList(e) {
|
|
2154
2311
|
return e && C(e.map((a) => this.transformNode(a)));
|
|
@@ -2874,8 +3031,8 @@ class fr {
|
|
|
2874
3031
|
return e;
|
|
2875
3032
|
}
|
|
2876
3033
|
}
|
|
2877
|
-
|
|
2878
|
-
const
|
|
3034
|
+
H = new WeakMap();
|
|
3035
|
+
const Tr = C({
|
|
2879
3036
|
AlterTableNode: !0,
|
|
2880
3037
|
CreateIndexNode: !0,
|
|
2881
3038
|
CreateSchemaNode: !0,
|
|
@@ -2894,88 +3051,88 @@ const pr = C({
|
|
|
2894
3051
|
UpdateQueryNode: !0,
|
|
2895
3052
|
MergeQueryNode: !0
|
|
2896
3053
|
});
|
|
2897
|
-
var
|
|
2898
|
-
class
|
|
3054
|
+
var E, z, j, N, ye, ve, Ne, A, re, Ce;
|
|
3055
|
+
class Sr extends xr {
|
|
2899
3056
|
constructor(a) {
|
|
2900
3057
|
super();
|
|
2901
3058
|
O(this, N);
|
|
2902
|
-
O(this,
|
|
3059
|
+
O(this, E);
|
|
3060
|
+
O(this, z, /* @__PURE__ */ new Set());
|
|
2903
3061
|
O(this, j, /* @__PURE__ */ new Set());
|
|
2904
|
-
|
|
2905
|
-
K(this, L, a);
|
|
3062
|
+
K(this, E, a);
|
|
2906
3063
|
}
|
|
2907
3064
|
transformNodeImpl(a) {
|
|
2908
3065
|
if (!p(this, N, ye).call(this, a))
|
|
2909
3066
|
return super.transformNodeImpl(a);
|
|
2910
3067
|
const r = p(this, N, Ne).call(this, a);
|
|
2911
3068
|
for (const s of r)
|
|
2912
|
-
|
|
3069
|
+
m(this, j).add(s);
|
|
2913
3070
|
const n = p(this, N, ve).call(this, a);
|
|
2914
3071
|
for (const s of n)
|
|
2915
|
-
|
|
3072
|
+
m(this, z).add(s);
|
|
2916
3073
|
const o = super.transformNodeImpl(a);
|
|
2917
3074
|
for (const s of n)
|
|
2918
|
-
|
|
3075
|
+
m(this, z).delete(s);
|
|
2919
3076
|
for (const s of r)
|
|
2920
|
-
|
|
3077
|
+
m(this, j).delete(s);
|
|
2921
3078
|
return o;
|
|
2922
3079
|
}
|
|
2923
3080
|
transformSchemableIdentifier(a) {
|
|
2924
3081
|
const r = super.transformSchemableIdentifier(a);
|
|
2925
|
-
return r.schema || !
|
|
3082
|
+
return r.schema || !m(this, z).has(a.identifier.name) ? r : {
|
|
2926
3083
|
...r,
|
|
2927
|
-
schema:
|
|
3084
|
+
schema: G.create(m(this, E))
|
|
2928
3085
|
};
|
|
2929
3086
|
}
|
|
2930
3087
|
transformReferences(a) {
|
|
2931
3088
|
const r = super.transformReferences(a);
|
|
2932
3089
|
return r.table.table.schema ? r : {
|
|
2933
3090
|
...r,
|
|
2934
|
-
table: Z.createWithSchema(
|
|
3091
|
+
table: Z.createWithSchema(m(this, E), r.table.table.identifier.name)
|
|
2935
3092
|
};
|
|
2936
3093
|
}
|
|
2937
3094
|
}
|
|
2938
|
-
|
|
2939
|
-
return a.kind in
|
|
3095
|
+
E = new WeakMap(), z = new WeakMap(), j = new WeakMap(), N = new WeakSet(), ye = function(a) {
|
|
3096
|
+
return a.kind in Tr;
|
|
2940
3097
|
}, ve = function(a) {
|
|
2941
3098
|
const r = /* @__PURE__ */ new Set();
|
|
2942
3099
|
if ("name" in a && a.name && ae.is(a.name) && p(this, N, re).call(this, a.name, r), "from" in a && a.from)
|
|
2943
3100
|
for (const n of a.from.froms)
|
|
2944
|
-
p(this, N,
|
|
2945
|
-
if ("into" in a && a.into && p(this, N,
|
|
3101
|
+
p(this, N, A).call(this, n, r);
|
|
3102
|
+
if ("into" in a && a.into && p(this, N, A).call(this, a.into, r), "table" in a && a.table && p(this, N, A).call(this, a.table, r), "joins" in a && a.joins)
|
|
2946
3103
|
for (const n of a.joins)
|
|
2947
|
-
p(this, N,
|
|
2948
|
-
return "using" in a && a.using && p(this, N,
|
|
3104
|
+
p(this, N, A).call(this, n.table, r);
|
|
3105
|
+
return "using" in a && a.using && p(this, N, A).call(this, a.using, r), r;
|
|
2949
3106
|
}, Ne = function(a) {
|
|
2950
3107
|
const r = /* @__PURE__ */ new Set();
|
|
2951
3108
|
return "with" in a && a.with && p(this, N, Ce).call(this, a.with, r), r;
|
|
2952
|
-
},
|
|
2953
|
-
const n = Z.is(a) ? a :
|
|
3109
|
+
}, A = function(a, r) {
|
|
3110
|
+
const n = Z.is(a) ? a : br.is(a) && Z.is(a.node) ? a.node : null;
|
|
2954
3111
|
n && p(this, N, re).call(this, n.table, r);
|
|
2955
3112
|
}, re = function(a, r) {
|
|
2956
3113
|
const n = a.identifier.name;
|
|
2957
|
-
!
|
|
3114
|
+
!m(this, z).has(n) && !m(this, j).has(n) && r.add(n);
|
|
2958
3115
|
}, Ce = function(a, r) {
|
|
2959
3116
|
for (const n of a.expressions) {
|
|
2960
3117
|
const o = n.name.table.table.identifier.name;
|
|
2961
|
-
|
|
3118
|
+
m(this, j).has(o) || r.add(o);
|
|
2962
3119
|
}
|
|
2963
3120
|
};
|
|
2964
3121
|
var Q;
|
|
2965
|
-
class
|
|
3122
|
+
class Or {
|
|
2966
3123
|
constructor(e) {
|
|
2967
3124
|
O(this, Q);
|
|
2968
|
-
K(this, Q, new
|
|
3125
|
+
K(this, Q, new Sr(e));
|
|
2969
3126
|
}
|
|
2970
3127
|
transformQuery(e) {
|
|
2971
|
-
return
|
|
3128
|
+
return m(this, Q).transformNode(e.node);
|
|
2972
3129
|
}
|
|
2973
3130
|
async transformResult(e) {
|
|
2974
3131
|
return e.result;
|
|
2975
3132
|
}
|
|
2976
3133
|
}
|
|
2977
3134
|
Q = new WeakMap();
|
|
2978
|
-
class
|
|
3135
|
+
class kr {
|
|
2979
3136
|
transformQuery(e) {
|
|
2980
3137
|
return e.node;
|
|
2981
3138
|
}
|
|
@@ -2983,8 +3140,8 @@ class yr {
|
|
|
2983
3140
|
return e.result;
|
|
2984
3141
|
}
|
|
2985
3142
|
}
|
|
2986
|
-
const
|
|
2987
|
-
var v, l, U, k, $,
|
|
3143
|
+
const $r = "kysely_migration", fe = "kysely_migration_lock", Ir = !1, ee = "migration_lock", Dr = C({ __noMigrations__: !0 });
|
|
3144
|
+
var v, l, U, k, $, M, xe, I, Te, Se, Oe, ke, $e, ne, J, oe, Ie, De, Pe, se, ze, je, Fe, Ae, Me, q;
|
|
2988
3145
|
class be {
|
|
2989
3146
|
constructor(e) {
|
|
2990
3147
|
O(this, l);
|
|
@@ -2997,7 +3154,7 @@ class be {
|
|
|
2997
3154
|
* The returned array is sorted by migration name.
|
|
2998
3155
|
*/
|
|
2999
3156
|
async getMigrations() {
|
|
3000
|
-
const e = await p(this, l, J).call(this,
|
|
3157
|
+
const e = await p(this, l, J).call(this, m(this, l, $)) ? await m(this, v).db.withPlugin(m(this, l, I)).selectFrom(m(this, l, $)).select(["name", "timestamp"]).execute() : [];
|
|
3001
3158
|
return (await p(this, l, se).call(this)).map(({ name: r, ...n }) => {
|
|
3002
3159
|
const o = e.find((s) => s.name === r);
|
|
3003
3160
|
return {
|
|
@@ -3082,7 +3239,7 @@ class be {
|
|
|
3082
3239
|
*/
|
|
3083
3240
|
async migrateTo(e) {
|
|
3084
3241
|
return p(this, l, U).call(this, ({ migrations: a, executedMigrations: r, pendingMigrations: n }) => {
|
|
3085
|
-
if (e ===
|
|
3242
|
+
if (e === Dr)
|
|
3086
3243
|
return { direction: "Down", step: 1 / 0 };
|
|
3087
3244
|
if (!a.find((i) => i.name === e))
|
|
3088
3245
|
throw new Error(`migration "${e}" doesn't exist`);
|
|
@@ -3139,63 +3296,63 @@ v = new WeakMap(), l = new WeakSet(), U = async function(e) {
|
|
|
3139
3296
|
return a instanceof te ? a.resultSet : { error: a };
|
|
3140
3297
|
}
|
|
3141
3298
|
}, k = function() {
|
|
3142
|
-
return
|
|
3299
|
+
return m(this, v).migrationTableSchema;
|
|
3143
3300
|
}, $ = function() {
|
|
3144
|
-
return
|
|
3145
|
-
},
|
|
3146
|
-
return
|
|
3301
|
+
return m(this, v).migrationTableName ?? $r;
|
|
3302
|
+
}, M = function() {
|
|
3303
|
+
return m(this, v).migrationLockTableName ?? fe;
|
|
3147
3304
|
}, xe = function() {
|
|
3148
|
-
return
|
|
3305
|
+
return m(this, v).allowUnorderedMigrations ?? Ir;
|
|
3149
3306
|
}, I = function() {
|
|
3150
|
-
return
|
|
3307
|
+
return m(this, l, k) ? new Or(m(this, l, k)) : new kr();
|
|
3151
3308
|
}, Te = async function() {
|
|
3152
3309
|
await p(this, l, Se).call(this), await p(this, l, Oe).call(this), await p(this, l, ke).call(this), await p(this, l, $e).call(this);
|
|
3153
3310
|
}, Se = async function() {
|
|
3154
|
-
if (
|
|
3311
|
+
if (m(this, l, k) && !await p(this, l, ne).call(this))
|
|
3155
3312
|
try {
|
|
3156
|
-
await p(this, l,
|
|
3313
|
+
await p(this, l, q).call(this, m(this, v).db.schema.createSchema(m(this, l, k)));
|
|
3157
3314
|
} catch (e) {
|
|
3158
3315
|
if (!await p(this, l, ne).call(this))
|
|
3159
3316
|
throw e;
|
|
3160
3317
|
}
|
|
3161
3318
|
}, Oe = async function() {
|
|
3162
|
-
if (!await p(this, l, J).call(this,
|
|
3319
|
+
if (!await p(this, l, J).call(this, m(this, l, $)))
|
|
3163
3320
|
try {
|
|
3164
|
-
|
|
3321
|
+
m(this, l, k) && await p(this, l, q).call(this, m(this, v).db.schema.createSchema(m(this, l, k))), await p(this, l, q).call(this, m(this, v).db.schema.withPlugin(m(this, l, I)).createTable(m(this, l, $)).addColumn("name", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("timestamp", "varchar(255)", (e) => e.notNull()));
|
|
3165
3322
|
} catch (e) {
|
|
3166
|
-
if (!await p(this, l, J).call(this,
|
|
3323
|
+
if (!await p(this, l, J).call(this, m(this, l, $)))
|
|
3167
3324
|
throw e;
|
|
3168
3325
|
}
|
|
3169
3326
|
}, ke = async function() {
|
|
3170
|
-
if (!await p(this, l, J).call(this,
|
|
3327
|
+
if (!await p(this, l, J).call(this, m(this, l, M)))
|
|
3171
3328
|
try {
|
|
3172
|
-
await p(this, l,
|
|
3329
|
+
await p(this, l, q).call(this, m(this, v).db.schema.withPlugin(m(this, l, I)).createTable(m(this, l, M)).addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("is_locked", "integer", (e) => e.notNull().defaultTo(0)));
|
|
3173
3330
|
} catch (e) {
|
|
3174
|
-
if (!await p(this, l, J).call(this,
|
|
3331
|
+
if (!await p(this, l, J).call(this, m(this, l, M)))
|
|
3175
3332
|
throw e;
|
|
3176
3333
|
}
|
|
3177
3334
|
}, $e = async function() {
|
|
3178
3335
|
if (!await p(this, l, oe).call(this))
|
|
3179
3336
|
try {
|
|
3180
|
-
await
|
|
3337
|
+
await m(this, v).db.withPlugin(m(this, l, I)).insertInto(m(this, l, M)).values({ id: ee, is_locked: 0 }).execute();
|
|
3181
3338
|
} catch (e) {
|
|
3182
3339
|
if (!await p(this, l, oe).call(this))
|
|
3183
3340
|
throw e;
|
|
3184
3341
|
}
|
|
3185
3342
|
}, ne = async function() {
|
|
3186
|
-
return (await
|
|
3343
|
+
return (await m(this, v).db.introspection.getSchemas()).some((a) => a.name === m(this, l, k));
|
|
3187
3344
|
}, J = async function(e) {
|
|
3188
|
-
const a =
|
|
3189
|
-
return (await
|
|
3345
|
+
const a = m(this, l, k);
|
|
3346
|
+
return (await m(this, v).db.introspection.getTables({
|
|
3190
3347
|
withInternalKyselyTables: !0
|
|
3191
3348
|
})).some((n) => n.name === e && (!a || n.schema === a));
|
|
3192
3349
|
}, oe = async function() {
|
|
3193
|
-
return !!await
|
|
3350
|
+
return !!await m(this, v).db.withPlugin(m(this, l, I)).selectFrom(m(this, l, M)).where("id", "=", ee).select("id").executeTakeFirst();
|
|
3194
3351
|
}, Ie = async function(e) {
|
|
3195
|
-
const a =
|
|
3196
|
-
lockTable:
|
|
3352
|
+
const a = m(this, v).db.getExecutor().adapter, r = C({
|
|
3353
|
+
lockTable: m(this, v).migrationLockTableName ?? fe,
|
|
3197
3354
|
lockRowId: ee,
|
|
3198
|
-
lockTableSchema:
|
|
3355
|
+
lockTableSchema: m(this, v).migrationTableSchema
|
|
3199
3356
|
}), n = async (o) => {
|
|
3200
3357
|
try {
|
|
3201
3358
|
await a.acquireMigrationLock(o, r);
|
|
@@ -3203,41 +3360,41 @@ v = new WeakMap(), l = new WeakSet(), U = async function(e) {
|
|
|
3203
3360
|
if (s.migrations.length === 0)
|
|
3204
3361
|
return { results: [] };
|
|
3205
3362
|
const { direction: i, step: c } = e(s);
|
|
3206
|
-
return c <= 0 ? { results: [] } : i === "Down" ? await p(this, l,
|
|
3363
|
+
return c <= 0 ? { results: [] } : i === "Down" ? await p(this, l, Ae).call(this, o, s, c) : i === "Up" ? await p(this, l, Me).call(this, o, s, c) : { results: [] };
|
|
3207
3364
|
} finally {
|
|
3208
3365
|
await a.releaseMigrationLock(o, r);
|
|
3209
3366
|
}
|
|
3210
3367
|
};
|
|
3211
|
-
return a.supportsTransactionalDdl ?
|
|
3368
|
+
return a.supportsTransactionalDdl ? m(this, v).db.transaction().execute(n) : m(this, v).db.connection().execute(n);
|
|
3212
3369
|
}, De = async function(e) {
|
|
3213
|
-
const a = await p(this, l, se).call(this), r = await p(this, l,
|
|
3214
|
-
p(this, l,
|
|
3370
|
+
const a = await p(this, l, se).call(this), r = await p(this, l, ze).call(this, e);
|
|
3371
|
+
p(this, l, je).call(this, a, r), m(this, l, xe) || p(this, l, Fe).call(this, a, r);
|
|
3215
3372
|
const n = p(this, l, Pe).call(this, a, r);
|
|
3216
3373
|
return C({
|
|
3217
3374
|
migrations: a,
|
|
3218
3375
|
executedMigrations: r,
|
|
3219
|
-
lastMigration:
|
|
3376
|
+
lastMigration: Cr(r),
|
|
3220
3377
|
pendingMigrations: n
|
|
3221
3378
|
});
|
|
3222
3379
|
}, Pe = function(e, a) {
|
|
3223
3380
|
return e.filter((r) => !a.includes(r.name));
|
|
3224
3381
|
}, se = async function() {
|
|
3225
|
-
const e = await
|
|
3382
|
+
const e = await m(this, v).provider.getMigrations();
|
|
3226
3383
|
return Object.keys(e).sort().map((a) => ({
|
|
3227
3384
|
...e[a],
|
|
3228
3385
|
name: a
|
|
3229
3386
|
}));
|
|
3230
|
-
},
|
|
3231
|
-
return (await e.withPlugin(
|
|
3232
|
-
},
|
|
3387
|
+
}, ze = async function(e) {
|
|
3388
|
+
return (await e.withPlugin(m(this, l, I)).selectFrom(m(this, l, $)).select("name").orderBy(["timestamp", "name"]).execute()).map((r) => r.name);
|
|
3389
|
+
}, je = function(e, a) {
|
|
3233
3390
|
for (const r of a)
|
|
3234
3391
|
if (!e.some((n) => n.name === r))
|
|
3235
3392
|
throw new Error(`corrupted migrations: previously executed migration ${r} is missing`);
|
|
3236
|
-
},
|
|
3393
|
+
}, Fe = function(e, a) {
|
|
3237
3394
|
for (let r = 0; r < a.length; ++r)
|
|
3238
3395
|
if (e[r].name !== a[r])
|
|
3239
3396
|
throw new Error(`corrupted migrations: expected previously executed migration ${a[r]} to be at index ${r} but ${e[r].name} was found in its place. New migrations must always have a name that comes alphabetically after the last executed migration.`);
|
|
3240
|
-
},
|
|
3397
|
+
}, Ae = async function(e, a, r) {
|
|
3241
3398
|
const n = a.executedMigrations.slice().reverse().slice(0, r).map((s) => a.migrations.find((i) => i.name === s)), o = n.map((s) => ({
|
|
3242
3399
|
migrationName: s.name,
|
|
3243
3400
|
direction: "Down",
|
|
@@ -3246,7 +3403,7 @@ v = new WeakMap(), l = new WeakSet(), U = async function(e) {
|
|
|
3246
3403
|
for (let s = 0; s < o.length; ++s) {
|
|
3247
3404
|
const i = n[s];
|
|
3248
3405
|
try {
|
|
3249
|
-
i.down && (await i.down(e), await e.withPlugin(
|
|
3406
|
+
i.down && (await i.down(e), await e.withPlugin(m(this, l, I)).deleteFrom(m(this, l, $)).where("name", "=", i.name).execute(), o[s] = {
|
|
3250
3407
|
migrationName: i.name,
|
|
3251
3408
|
direction: "Down",
|
|
3252
3409
|
status: "Success"
|
|
@@ -3263,7 +3420,7 @@ v = new WeakMap(), l = new WeakSet(), U = async function(e) {
|
|
|
3263
3420
|
}
|
|
3264
3421
|
}
|
|
3265
3422
|
return { results: o };
|
|
3266
|
-
},
|
|
3423
|
+
}, Me = async function(e, a, r) {
|
|
3267
3424
|
const o = a.pendingMigrations.slice(0, r).map((s) => ({
|
|
3268
3425
|
migrationName: s.name,
|
|
3269
3426
|
direction: "Up",
|
|
@@ -3272,7 +3429,7 @@ v = new WeakMap(), l = new WeakSet(), U = async function(e) {
|
|
|
3272
3429
|
for (let s = 0; s < o.length; s++) {
|
|
3273
3430
|
const i = a.pendingMigrations[s];
|
|
3274
3431
|
try {
|
|
3275
|
-
await i.up(e), await e.withPlugin(
|
|
3432
|
+
await i.up(e), await e.withPlugin(m(this, l, I)).insertInto(m(this, l, $)).values({
|
|
3276
3433
|
name: i.name,
|
|
3277
3434
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
3278
3435
|
}).execute(), o[s] = {
|
|
@@ -3292,21 +3449,21 @@ v = new WeakMap(), l = new WeakSet(), U = async function(e) {
|
|
|
3292
3449
|
}
|
|
3293
3450
|
}
|
|
3294
3451
|
return { results: o };
|
|
3295
|
-
},
|
|
3296
|
-
|
|
3452
|
+
}, q = async function(e) {
|
|
3453
|
+
m(this, v).db.getExecutor().adapter.supportsCreateIfNotExists && (e = e.ifNotExists()), await e.execute();
|
|
3297
3454
|
};
|
|
3298
|
-
var
|
|
3455
|
+
var W;
|
|
3299
3456
|
class te extends Error {
|
|
3300
3457
|
constructor(a) {
|
|
3301
3458
|
super();
|
|
3302
|
-
O(this,
|
|
3303
|
-
K(this,
|
|
3459
|
+
O(this, W);
|
|
3460
|
+
K(this, W, a);
|
|
3304
3461
|
}
|
|
3305
3462
|
get resultSet() {
|
|
3306
|
-
return
|
|
3463
|
+
return m(this, W);
|
|
3307
3464
|
}
|
|
3308
3465
|
}
|
|
3309
|
-
|
|
3466
|
+
W = new WeakMap();
|
|
3310
3467
|
class Je {
|
|
3311
3468
|
constructor(e) {
|
|
3312
3469
|
R(this, "migrations");
|
|
@@ -3316,7 +3473,7 @@ class Je {
|
|
|
3316
3473
|
return this.migrations;
|
|
3317
3474
|
}
|
|
3318
3475
|
}
|
|
3319
|
-
async function
|
|
3476
|
+
async function Pr(t) {
|
|
3320
3477
|
await t.schema.createTable("tenants").addColumn("id", "varchar(255)", (e) => e.primaryKey()).addColumn("name", "varchar(255)").addColumn("audience", "varchar(255)").addColumn("sender_email", "varchar(255)").addColumn("sender_name", "varchar(255)").addColumn("language", "varchar(255)").addColumn("logo", "varchar(255)").addColumn("primary_color", "varchar(255)").addColumn("secondary_color", "varchar(255)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("updated_at", "varchar(255)", (e) => e.notNull()).execute(), await t.schema.createTable("users").addColumn("user_id", "varchar(255)", (e) => e.notNull()).addColumn(
|
|
3321
3478
|
"tenant_id",
|
|
3322
3479
|
"varchar(255)",
|
|
@@ -3388,35 +3545,35 @@ async function br(t) {
|
|
|
3388
3545
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
3389
3546
|
).addColumn("domain", "varchar(255)", (e) => e.notNull()).addColumn("email_service", "varchar(255)").addColumn("email_api_key", "varchar(255)").addColumn("dkim_private_key", "varchar(2048)").addColumn("dkim_public_key", "varchar(2048)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("updated_at", "varchar(255)", (e) => e.notNull()).execute();
|
|
3390
3547
|
}
|
|
3391
|
-
async function
|
|
3548
|
+
async function zr(t) {
|
|
3392
3549
|
await t.schema.dropTable("domains").execute(), await t.schema.dropTable("members").execute(), await t.schema.dropTable("users").execute(), await t.schema.dropTable("connections").execute(), await t.schema.dropTable("applications").execute(), await t.schema.dropTable("migrations").execute(), await t.schema.dropTable("tenants").execute();
|
|
3393
3550
|
}
|
|
3394
|
-
const
|
|
3551
|
+
const jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3395
3552
|
__proto__: null,
|
|
3396
|
-
down:
|
|
3397
|
-
up:
|
|
3553
|
+
down: zr,
|
|
3554
|
+
up: Pr
|
|
3398
3555
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3399
|
-
async function
|
|
3556
|
+
async function Fr(t) {
|
|
3400
3557
|
await t.schema.alterTable("tenants").addColumn("support_url", "varchar(255)").execute();
|
|
3401
3558
|
}
|
|
3402
|
-
async function
|
|
3559
|
+
async function Ar(t) {
|
|
3403
3560
|
await t.schema.alterTable("tenants").dropColumn("support_url").execute();
|
|
3404
3561
|
}
|
|
3405
|
-
const
|
|
3562
|
+
const Mr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3406
3563
|
__proto__: null,
|
|
3407
|
-
down:
|
|
3408
|
-
up:
|
|
3564
|
+
down: Ar,
|
|
3565
|
+
up: Fr
|
|
3409
3566
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3410
|
-
async function
|
|
3567
|
+
async function Jr(t) {
|
|
3411
3568
|
}
|
|
3412
|
-
async function
|
|
3569
|
+
async function Er(t) {
|
|
3413
3570
|
}
|
|
3414
|
-
const
|
|
3571
|
+
const Lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3415
3572
|
__proto__: null,
|
|
3416
|
-
down:
|
|
3417
|
-
up:
|
|
3573
|
+
down: Er,
|
|
3574
|
+
up: Jr
|
|
3418
3575
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3419
|
-
async function
|
|
3576
|
+
async function Rr(t) {
|
|
3420
3577
|
await t.schema.createTable("logs").addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("category", "varchar(255)", (e) => e.notNull()).addColumn("tenant_id", "varchar(64)").addColumn("user_id", "varchar(64)").addForeignKeyConstraint(
|
|
3421
3578
|
"tenant_id_constraint",
|
|
3422
3579
|
["tenant_id"],
|
|
@@ -3425,24 +3582,24 @@ async function Pr(t) {
|
|
|
3425
3582
|
(e) => e.onDelete("cascade")
|
|
3426
3583
|
).addColumn("ip", "varchar(255)").addColumn("type", "varchar(8)", (e) => e.notNull()).addColumn("date", "varchar(25)", (e) => e.notNull()).addColumn("client_id", "varchar(255)").addColumn("client_name", "varchar(255)").addColumn("user_agent", "varchar(255)").addColumn("description", "varchar(255)").addColumn("details", "varchar(2048)").execute();
|
|
3427
3584
|
}
|
|
3428
|
-
async function
|
|
3585
|
+
async function Kr(t) {
|
|
3429
3586
|
await t.schema.dropTable("logs").execute();
|
|
3430
3587
|
}
|
|
3431
|
-
const
|
|
3588
|
+
const Ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3432
3589
|
__proto__: null,
|
|
3433
|
-
down:
|
|
3434
|
-
up:
|
|
3590
|
+
down: Kr,
|
|
3591
|
+
up: Rr
|
|
3435
3592
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3436
|
-
async function
|
|
3593
|
+
async function qr(t) {
|
|
3437
3594
|
}
|
|
3438
|
-
async function
|
|
3595
|
+
async function Br(t) {
|
|
3439
3596
|
}
|
|
3440
|
-
const
|
|
3597
|
+
const Qr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3441
3598
|
__proto__: null,
|
|
3442
|
-
down:
|
|
3443
|
-
up:
|
|
3599
|
+
down: Br,
|
|
3600
|
+
up: qr
|
|
3444
3601
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3445
|
-
async function
|
|
3602
|
+
async function Wr(t) {
|
|
3446
3603
|
await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
3447
3604
|
"user_id_constraint",
|
|
3448
3605
|
["user_id", "tenant_id"],
|
|
@@ -3467,15 +3624,15 @@ async function Jr(t) {
|
|
|
3467
3624
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
3468
3625
|
).addColumn("code", "varchar(255)", (e) => e.notNull()).addColumn("email", "varchar(255)", (e) => e.notNull()).addColumn("user_id", "varchar(255)").addColumn("send", "varchar(255)").addColumn("nonce", "varchar(255)").addColumn("state", "varchar(1024)").addColumn("scope", "varchar(1024)").addColumn("response_type", "varchar(256)").addColumn("response_mode", "varchar(256)").addColumn("redirect_uri", "varchar(1024)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute(), await t.schema.createIndex("otps_email_index").on("otps").column("email").execute(), await t.schema.createIndex("otps_expires_at_index").on("otps").column("expires_at").execute();
|
|
3469
3626
|
}
|
|
3470
|
-
async function
|
|
3627
|
+
async function Vr(t) {
|
|
3471
3628
|
await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("tickets").execute(), await t.schema.dropTable("otps").execute();
|
|
3472
3629
|
}
|
|
3473
|
-
const
|
|
3630
|
+
const Gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3474
3631
|
__proto__: null,
|
|
3475
|
-
down:
|
|
3476
|
-
up:
|
|
3632
|
+
down: Vr,
|
|
3633
|
+
up: Wr
|
|
3477
3634
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3478
|
-
async function
|
|
3635
|
+
async function Yr(t) {
|
|
3479
3636
|
await t.schema.createTable("passwords").addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addPrimaryKeyConstraint("passwords_pkey", ["user_id", "tenant_id"]).addForeignKeyConstraint(
|
|
3480
3637
|
"user_id_constraint",
|
|
3481
3638
|
["user_id", "tenant_id"],
|
|
@@ -3490,24 +3647,24 @@ async function Rr(t) {
|
|
|
3490
3647
|
(e) => e.onDelete("cascade")
|
|
3491
3648
|
).addColumn("type", "varchar(255)", (e) => e.notNull()).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute(), await t.schema.createIndex("codes_expires_at_index").on("codes").column("expires_at").execute();
|
|
3492
3649
|
}
|
|
3493
|
-
async function
|
|
3650
|
+
async function Hr(t) {
|
|
3494
3651
|
await t.schema.dropTable("passwords").execute(), await t.schema.dropTable("codes").execute();
|
|
3495
3652
|
}
|
|
3496
|
-
const
|
|
3653
|
+
const Xr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3497
3654
|
__proto__: null,
|
|
3498
|
-
down:
|
|
3499
|
-
up:
|
|
3655
|
+
down: Hr,
|
|
3656
|
+
up: Yr
|
|
3500
3657
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3501
|
-
async function
|
|
3658
|
+
async function Zr(t) {
|
|
3502
3659
|
}
|
|
3503
|
-
async function
|
|
3660
|
+
async function en(t) {
|
|
3504
3661
|
}
|
|
3505
|
-
const
|
|
3662
|
+
const tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3506
3663
|
__proto__: null,
|
|
3507
|
-
down:
|
|
3508
|
-
up:
|
|
3664
|
+
down: en,
|
|
3665
|
+
up: Zr
|
|
3509
3666
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3510
|
-
async function
|
|
3667
|
+
async function an(t) {
|
|
3511
3668
|
await t.schema.alterTable("passwords").addColumn(
|
|
3512
3669
|
"password",
|
|
3513
3670
|
"varchar(255)",
|
|
@@ -3515,46 +3672,17 @@ async function Vr(t) {
|
|
|
3515
3672
|
(e) => e.notNull()
|
|
3516
3673
|
).execute();
|
|
3517
3674
|
}
|
|
3518
|
-
async function
|
|
3675
|
+
async function rn(t) {
|
|
3519
3676
|
await t.schema.alterTable("passwords").dropColumn("password").execute();
|
|
3520
3677
|
}
|
|
3521
|
-
const
|
|
3678
|
+
const nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3522
3679
|
__proto__: null,
|
|
3523
|
-
down:
|
|
3524
|
-
up:
|
|
3680
|
+
down: rn,
|
|
3681
|
+
up: an
|
|
3525
3682
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3526
|
-
async function
|
|
3683
|
+
async function on(t) {
|
|
3527
3684
|
}
|
|
3528
|
-
async function
|
|
3529
|
-
}
|
|
3530
|
-
const Xr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3531
|
-
__proto__: null,
|
|
3532
|
-
down: Yr,
|
|
3533
|
-
up: Hr
|
|
3534
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
3535
|
-
async function Zr(t) {
|
|
3536
|
-
}
|
|
3537
|
-
async function en(t) {
|
|
3538
|
-
}
|
|
3539
|
-
const tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3540
|
-
__proto__: null,
|
|
3541
|
-
down: en,
|
|
3542
|
-
up: Zr
|
|
3543
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
3544
|
-
async function an(t) {
|
|
3545
|
-
}
|
|
3546
|
-
async function rn(t) {
|
|
3547
|
-
}
|
|
3548
|
-
const nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3549
|
-
__proto__: null,
|
|
3550
|
-
down: rn,
|
|
3551
|
-
up: an
|
|
3552
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
3553
|
-
async function on(t) {
|
|
3554
|
-
await t.schema.createIndex("users_email_index").on("users").column("email").execute();
|
|
3555
|
-
}
|
|
3556
|
-
async function sn(t) {
|
|
3557
|
-
await t.schema.dropIndex("users_email_index").execute();
|
|
3685
|
+
async function sn(t) {
|
|
3558
3686
|
}
|
|
3559
3687
|
const ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3560
3688
|
__proto__: null,
|
|
@@ -3562,10 +3690,8 @@ const ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3562
3690
|
up: on
|
|
3563
3691
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3564
3692
|
async function cn(t) {
|
|
3565
|
-
await t.schema.alterTable("users").addColumn("profileData", "varchar(2048)").execute();
|
|
3566
3693
|
}
|
|
3567
3694
|
async function dn(t) {
|
|
3568
|
-
await t.schema.alterTable("users").dropColumn("profileData").execute();
|
|
3569
3695
|
}
|
|
3570
3696
|
const un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3571
3697
|
__proto__: null,
|
|
@@ -3573,10 +3699,8 @@ const un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3573
3699
|
up: cn
|
|
3574
3700
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3575
3701
|
async function mn(t) {
|
|
3576
|
-
await t.schema.createIndex("users_linked_to_index").on("users").column("linked_to").execute();
|
|
3577
3702
|
}
|
|
3578
3703
|
async function _n(t) {
|
|
3579
|
-
await t.schema.dropIndex("users_linked_to_index");
|
|
3580
3704
|
}
|
|
3581
3705
|
const hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3582
3706
|
__proto__: null,
|
|
@@ -3584,10 +3708,10 @@ const hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3584
3708
|
up: mn
|
|
3585
3709
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3586
3710
|
async function fn(t) {
|
|
3587
|
-
await t.schema.
|
|
3711
|
+
await t.schema.createIndex("users_email_index").on("users").column("email").execute();
|
|
3588
3712
|
}
|
|
3589
3713
|
async function pn(t) {
|
|
3590
|
-
await t.schema.
|
|
3714
|
+
await t.schema.dropIndex("users_email_index").execute();
|
|
3591
3715
|
}
|
|
3592
3716
|
const gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3593
3717
|
__proto__: null,
|
|
@@ -3595,22 +3719,10 @@ const gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3595
3719
|
up: fn
|
|
3596
3720
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3597
3721
|
async function wn(t) {
|
|
3598
|
-
await t.schema.
|
|
3599
|
-
"tenant_id",
|
|
3600
|
-
"varchar(255)",
|
|
3601
|
-
(e) => e.references("tenants.id").onDelete("cascade")
|
|
3602
|
-
).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("revoked_at", "varchar(255)").addColumn("cert", "varchar(4096)").addColumn("pkcs7", "varchar(4096)").addColumn("fingerprint", "varchar(256)").addColumn("thumbprint", "varchar(256)").addColumn("current_since", "varchar(256)").addColumn("current_until", "varchar(256)").addColumn(
|
|
3603
|
-
"type",
|
|
3604
|
-
"varchar(50)",
|
|
3605
|
-
(e) => e.notNull().defaultTo("jwt_signing")
|
|
3606
|
-
).addColumn(
|
|
3607
|
-
"connection",
|
|
3608
|
-
"varchar(255)",
|
|
3609
|
-
(e) => e.references("connections.id").onDelete("cascade")
|
|
3610
|
-
).execute();
|
|
3722
|
+
await t.schema.alterTable("users").addColumn("profileData", "varchar(2048)").execute();
|
|
3611
3723
|
}
|
|
3612
3724
|
async function yn(t) {
|
|
3613
|
-
await t.schema.
|
|
3725
|
+
await t.schema.alterTable("users").dropColumn("profileData").execute();
|
|
3614
3726
|
}
|
|
3615
3727
|
const vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3616
3728
|
__proto__: null,
|
|
@@ -3618,8 +3730,10 @@ const vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3618
3730
|
up: wn
|
|
3619
3731
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3620
3732
|
async function Nn(t) {
|
|
3733
|
+
await t.schema.createIndex("users_linked_to_index").on("users").column("linked_to").execute();
|
|
3621
3734
|
}
|
|
3622
3735
|
async function Cn(t) {
|
|
3736
|
+
await t.schema.dropIndex("users_linked_to_index");
|
|
3623
3737
|
}
|
|
3624
3738
|
const bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3625
3739
|
__proto__: null,
|
|
@@ -3627,8 +3741,10 @@ const bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3627
3741
|
up: Nn
|
|
3628
3742
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3629
3743
|
async function xn(t) {
|
|
3744
|
+
await t.schema.alterTable("users").addColumn("locale", "varchar(255)").execute();
|
|
3630
3745
|
}
|
|
3631
3746
|
async function Tn(t) {
|
|
3747
|
+
await t.schema.alterTable("users").dropColumn("locale").execute();
|
|
3632
3748
|
}
|
|
3633
3749
|
const Sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3634
3750
|
__proto__: null,
|
|
@@ -3636,10 +3752,22 @@ const Sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3636
3752
|
up: xn
|
|
3637
3753
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3638
3754
|
async function On(t) {
|
|
3639
|
-
await t.schema.
|
|
3755
|
+
await t.schema.createTable("keys").addColumn("kid", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
3756
|
+
"tenant_id",
|
|
3757
|
+
"varchar(255)",
|
|
3758
|
+
(e) => e.references("tenants.id").onDelete("cascade")
|
|
3759
|
+
).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("revoked_at", "varchar(255)").addColumn("cert", "varchar(4096)").addColumn("pkcs7", "varchar(4096)").addColumn("fingerprint", "varchar(256)").addColumn("thumbprint", "varchar(256)").addColumn("current_since", "varchar(256)").addColumn("current_until", "varchar(256)").addColumn(
|
|
3760
|
+
"type",
|
|
3761
|
+
"varchar(50)",
|
|
3762
|
+
(e) => e.notNull().defaultTo("jwt_signing")
|
|
3763
|
+
).addColumn(
|
|
3764
|
+
"connection",
|
|
3765
|
+
"varchar(255)",
|
|
3766
|
+
(e) => e.references("connections.id").onDelete("cascade")
|
|
3767
|
+
).execute();
|
|
3640
3768
|
}
|
|
3641
3769
|
async function kn(t) {
|
|
3642
|
-
await t.schema.
|
|
3770
|
+
await t.schema.dropTable("keys").execute();
|
|
3643
3771
|
}
|
|
3644
3772
|
const $n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3645
3773
|
__proto__: null,
|
|
@@ -3655,87 +3783,84 @@ const Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3655
3783
|
down: Dn,
|
|
3656
3784
|
up: In
|
|
3657
3785
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3658
|
-
async function
|
|
3659
|
-
await t.schema.alterTable("logs").dropColumn("category").execute();
|
|
3786
|
+
async function zn(t) {
|
|
3660
3787
|
}
|
|
3661
|
-
async function
|
|
3662
|
-
await t.schema.alterTable("logs").addColumn("category", "varchar(255)", (e) => e.notNull()).execute();
|
|
3788
|
+
async function jn(t) {
|
|
3663
3789
|
}
|
|
3664
|
-
const
|
|
3790
|
+
const Fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3665
3791
|
__proto__: null,
|
|
3666
|
-
down:
|
|
3667
|
-
up:
|
|
3792
|
+
down: jn,
|
|
3793
|
+
up: zn
|
|
3668
3794
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3669
|
-
async function
|
|
3670
|
-
await t.schema.alterTable("
|
|
3795
|
+
async function An(t) {
|
|
3796
|
+
await t.schema.alterTable("otps").addColumn("audience", "varchar(255)").execute();
|
|
3671
3797
|
}
|
|
3672
|
-
async function
|
|
3673
|
-
await t.schema.alterTable("
|
|
3798
|
+
async function Mn(t) {
|
|
3799
|
+
await t.schema.alterTable("otps").dropColumn("audience").execute();
|
|
3674
3800
|
}
|
|
3675
3801
|
const Jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3676
3802
|
__proto__: null,
|
|
3677
|
-
down:
|
|
3678
|
-
up:
|
|
3803
|
+
down: Mn,
|
|
3804
|
+
up: An
|
|
3679
3805
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3680
|
-
async function Ln(t) {
|
|
3681
|
-
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();
|
|
3682
|
-
}
|
|
3683
3806
|
async function En(t) {
|
|
3684
|
-
|
|
3807
|
+
}
|
|
3808
|
+
async function Ln(t) {
|
|
3685
3809
|
}
|
|
3686
3810
|
const Rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3687
3811
|
__proto__: null,
|
|
3688
|
-
down:
|
|
3689
|
-
up:
|
|
3812
|
+
down: Ln,
|
|
3813
|
+
up: En
|
|
3690
3814
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3691
3815
|
async function Kn(t) {
|
|
3692
|
-
await t.schema.alterTable("logs").dropColumn("
|
|
3816
|
+
await t.schema.alterTable("logs").dropColumn("category").execute();
|
|
3693
3817
|
}
|
|
3694
3818
|
async function Un(t) {
|
|
3695
|
-
await t.schema.alterTable("logs").
|
|
3819
|
+
await t.schema.alterTable("logs").addColumn("category", "varchar(255)", (e) => e.notNull()).execute();
|
|
3696
3820
|
}
|
|
3697
|
-
const
|
|
3821
|
+
const qn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3698
3822
|
__proto__: null,
|
|
3699
3823
|
down: Un,
|
|
3700
3824
|
up: Kn
|
|
3701
3825
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3702
|
-
async function
|
|
3703
|
-
await t.schema.alterTable("
|
|
3826
|
+
async function Bn(t) {
|
|
3827
|
+
await t.schema.alterTable("users").dropColumn("tags").execute();
|
|
3704
3828
|
}
|
|
3705
|
-
async function
|
|
3706
|
-
await t.schema.alterTable("
|
|
3829
|
+
async function Qn(t) {
|
|
3830
|
+
await t.schema.alterTable("users").addColumn("tags", "varchar(255)").execute();
|
|
3707
3831
|
}
|
|
3708
|
-
const
|
|
3832
|
+
const Wn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3709
3833
|
__proto__: null,
|
|
3710
|
-
down:
|
|
3711
|
-
up:
|
|
3834
|
+
down: Qn,
|
|
3835
|
+
up: Bn
|
|
3712
3836
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3713
|
-
async function
|
|
3714
|
-
await t.schema.createIndex("
|
|
3837
|
+
async function Vn(t) {
|
|
3838
|
+
await t.schema.createIndex("logs_user_id").on("logs").column("user_id").execute(), await t.schema.createIndex("logs_tenant_id").on("logs").column("tenant_id").execute(), await t.schema.createIndex("logs_date").on("logs").column("date").execute();
|
|
3715
3839
|
}
|
|
3716
3840
|
async function Gn(t) {
|
|
3717
|
-
await t.schema.dropIndex("
|
|
3841
|
+
await t.schema.dropIndex("logs_user_id"), await t.schema.dropIndex("logs_tenant_id"), await t.schema.dropIndex("logs_date");
|
|
3718
3842
|
}
|
|
3719
|
-
const
|
|
3843
|
+
const Yn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3720
3844
|
__proto__: null,
|
|
3721
3845
|
down: Gn,
|
|
3722
|
-
up:
|
|
3846
|
+
up: Vn
|
|
3723
3847
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3724
|
-
async function
|
|
3848
|
+
async function Hn(t) {
|
|
3849
|
+
await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(8192)").execute();
|
|
3725
3850
|
}
|
|
3726
3851
|
async function Xn(t) {
|
|
3727
|
-
await t.schema.alterTable("
|
|
3852
|
+
await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(2048)").execute();
|
|
3728
3853
|
}
|
|
3729
3854
|
const Zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3730
3855
|
__proto__: null,
|
|
3731
3856
|
down: Xn,
|
|
3732
|
-
up:
|
|
3857
|
+
up: Hn
|
|
3733
3858
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3734
3859
|
async function eo(t) {
|
|
3735
|
-
await t.schema.alterTable("
|
|
3860
|
+
await t.schema.alterTable("logs").addColumn("user_name", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("auth0_client", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("isMobile", "boolean").execute(), await t.schema.alterTable("logs").addColumn("connection", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("connection_id", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("audience", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("scope", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("strategy", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("strategy_type", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("hostname", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("session_connection", "varchar(255)").execute();
|
|
3736
3861
|
}
|
|
3737
3862
|
async function to(t) {
|
|
3738
|
-
await t.schema.alterTable("
|
|
3863
|
+
await t.schema.alterTable("logs").dropColumn("user_name").execute(), await t.schema.alterTable("logs").dropColumn("auth0_client").execute(), await t.schema.alterTable("logs").dropColumn("isMobile").execute(), await t.schema.alterTable("logs").dropColumn("connection").execute(), await t.schema.alterTable("logs").dropColumn("connection_id").execute(), await t.schema.alterTable("logs").dropColumn("audience").execute(), await t.schema.alterTable("logs").dropColumn("scope").execute(), await t.schema.alterTable("logs").dropColumn("strategy").execute(), await t.schema.alterTable("logs").dropColumn("strategy_type").execute(), await t.schema.alterTable("logs").dropColumn("hostname").execute(), await t.schema.alterTable("logs").dropColumn("session_connection").execute();
|
|
3739
3864
|
}
|
|
3740
3865
|
const ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3741
3866
|
__proto__: null,
|
|
@@ -3743,10 +3868,10 @@ const ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3743
3868
|
up: eo
|
|
3744
3869
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3745
3870
|
async function ro(t) {
|
|
3746
|
-
await t.schema.
|
|
3871
|
+
await t.schema.createIndex("users_name_index").on("users").column("name").execute();
|
|
3747
3872
|
}
|
|
3748
3873
|
async function no(t) {
|
|
3749
|
-
await t.schema.
|
|
3874
|
+
await t.schema.dropIndex("users_name_index").execute();
|
|
3750
3875
|
}
|
|
3751
3876
|
const oo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3752
3877
|
__proto__: null,
|
|
@@ -3754,14 +3879,9 @@ const oo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3754
3879
|
up: ro
|
|
3755
3880
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3756
3881
|
async function so(t) {
|
|
3757
|
-
await t.schema.createTable("branding").addColumn(
|
|
3758
|
-
"tenant_id",
|
|
3759
|
-
"varchar(255)",
|
|
3760
|
-
(e) => e.references("tenants.id").onDelete("cascade").notNull().primaryKey()
|
|
3761
|
-
).addColumn("logo_url", "varchar(512)").addColumn("favicon_url", "varchar(512)").addColumn("font_url", "varchar(512)").addColumn("colors_primary", "varchar(8)").addColumn("colors_page_background_type", "varchar(32)").addColumn("colors_page_background_start", "varchar(8)").addColumn("colors_page_background_end", "varchar(8)").addColumn("colors_page_background_angle_dev", "integer").execute();
|
|
3762
3882
|
}
|
|
3763
3883
|
async function io(t) {
|
|
3764
|
-
await t.schema.
|
|
3884
|
+
await t.schema.alterTable("users").dropConstraint("unique_email_provider").execute();
|
|
3765
3885
|
}
|
|
3766
3886
|
const lo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3767
3887
|
__proto__: null,
|
|
@@ -3769,8 +3889,10 @@ const lo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3769
3889
|
up: so
|
|
3770
3890
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3771
3891
|
async function co(t) {
|
|
3892
|
+
await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(8192)").execute();
|
|
3772
3893
|
}
|
|
3773
3894
|
async function uo(t) {
|
|
3895
|
+
await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(1024)").execute();
|
|
3774
3896
|
}
|
|
3775
3897
|
const mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3776
3898
|
__proto__: null,
|
|
@@ -3778,8 +3900,10 @@ const mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3778
3900
|
up: co
|
|
3779
3901
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3780
3902
|
async function _o(t) {
|
|
3903
|
+
await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(8192)").execute();
|
|
3781
3904
|
}
|
|
3782
3905
|
async function ho(t) {
|
|
3906
|
+
await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(1024)").execute();
|
|
3783
3907
|
}
|
|
3784
3908
|
const fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3785
3909
|
__proto__: null,
|
|
@@ -3787,8 +3911,14 @@ const fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3787
3911
|
up: _o
|
|
3788
3912
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3789
3913
|
async function po(t) {
|
|
3914
|
+
await t.schema.createTable("branding").addColumn(
|
|
3915
|
+
"tenant_id",
|
|
3916
|
+
"varchar(255)",
|
|
3917
|
+
(e) => e.references("tenants.id").onDelete("cascade").notNull().primaryKey()
|
|
3918
|
+
).addColumn("logo_url", "varchar(512)").addColumn("favicon_url", "varchar(512)").addColumn("font_url", "varchar(512)").addColumn("colors_primary", "varchar(8)").addColumn("colors_page_background_type", "varchar(32)").addColumn("colors_page_background_start", "varchar(8)").addColumn("colors_page_background_end", "varchar(8)").addColumn("colors_page_background_angle_dev", "integer").execute();
|
|
3790
3919
|
}
|
|
3791
3920
|
async function go(t) {
|
|
3921
|
+
await t.schema.dropTable("branding").execute();
|
|
3792
3922
|
}
|
|
3793
3923
|
const wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3794
3924
|
__proto__: null,
|
|
@@ -3805,18 +3935,8 @@ const No = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3805
3935
|
up: yo
|
|
3806
3936
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3807
3937
|
async function Co(t) {
|
|
3808
|
-
await t.schema.createTable("authentication_codes").addColumn(
|
|
3809
|
-
"tenant_id",
|
|
3810
|
-
"varchar(255)",
|
|
3811
|
-
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
3812
|
-
).addColumn("code", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
3813
|
-
"client_id",
|
|
3814
|
-
"varchar(255)",
|
|
3815
|
-
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
3816
|
-
).addColumn("user_id", "varchar(255)", (e) => e.notNull()).addColumn("nonce", "varchar(255)").addColumn("state", "varchar(8192)").addColumn("scope", "varchar(1024)").addColumn("response_type", "varchar(256)").addColumn("response_mode", "varchar(256)").addColumn("redirect_uri", "varchar(1024)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute();
|
|
3817
3938
|
}
|
|
3818
3939
|
async function bo(t) {
|
|
3819
|
-
await t.schema.dropTable("authentication_codes").execute();
|
|
3820
3940
|
}
|
|
3821
3941
|
const xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3822
3942
|
__proto__: null,
|
|
@@ -3833,10 +3953,8 @@ const Oo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3833
3953
|
up: To
|
|
3834
3954
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3835
3955
|
async function ko(t) {
|
|
3836
|
-
await t.schema.alterTable("otps").addColumn("ip", "varchar(64)").execute();
|
|
3837
3956
|
}
|
|
3838
3957
|
async function $o(t) {
|
|
3839
|
-
await t.schema.alterTable("otps").dropColumn("ip").execute();
|
|
3840
3958
|
}
|
|
3841
3959
|
const Io = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3842
3960
|
__proto__: null,
|
|
@@ -3844,26 +3962,65 @@ const Io = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3844
3962
|
up: ko
|
|
3845
3963
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3846
3964
|
async function Do(t) {
|
|
3847
|
-
await t.schema.
|
|
3965
|
+
await t.schema.createTable("authentication_codes").addColumn(
|
|
3966
|
+
"tenant_id",
|
|
3967
|
+
"varchar(255)",
|
|
3968
|
+
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
3969
|
+
).addColumn("code", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
3970
|
+
"client_id",
|
|
3971
|
+
"varchar(255)",
|
|
3972
|
+
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
3973
|
+
).addColumn("user_id", "varchar(255)", (e) => e.notNull()).addColumn("nonce", "varchar(255)").addColumn("state", "varchar(8192)").addColumn("scope", "varchar(1024)").addColumn("response_type", "varchar(256)").addColumn("response_mode", "varchar(256)").addColumn("redirect_uri", "varchar(1024)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute();
|
|
3848
3974
|
}
|
|
3849
3975
|
async function Po(t) {
|
|
3850
|
-
await t.schema.
|
|
3976
|
+
await t.schema.dropTable("authentication_codes").execute();
|
|
3851
3977
|
}
|
|
3852
|
-
const
|
|
3978
|
+
const zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3853
3979
|
__proto__: null,
|
|
3854
3980
|
down: Po,
|
|
3855
3981
|
up: Do
|
|
3856
3982
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3983
|
+
async function jo(t) {
|
|
3984
|
+
}
|
|
3857
3985
|
async function Fo(t) {
|
|
3858
3986
|
}
|
|
3859
|
-
|
|
3987
|
+
const Ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3988
|
+
__proto__: null,
|
|
3989
|
+
down: Fo,
|
|
3990
|
+
up: jo
|
|
3991
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
3992
|
+
async function Mo(t) {
|
|
3993
|
+
await t.schema.alterTable("otps").addColumn("ip", "varchar(64)").execute();
|
|
3860
3994
|
}
|
|
3861
|
-
|
|
3995
|
+
async function Jo(t) {
|
|
3996
|
+
await t.schema.alterTable("otps").dropColumn("ip").execute();
|
|
3997
|
+
}
|
|
3998
|
+
const Eo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3862
3999
|
__proto__: null,
|
|
3863
|
-
down:
|
|
3864
|
-
up:
|
|
4000
|
+
down: Jo,
|
|
4001
|
+
up: Mo
|
|
3865
4002
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3866
|
-
async function
|
|
4003
|
+
async function Lo(t) {
|
|
4004
|
+
await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(1024)").execute();
|
|
4005
|
+
}
|
|
4006
|
+
async function Ro(t) {
|
|
4007
|
+
await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(255)").execute();
|
|
4008
|
+
}
|
|
4009
|
+
const Ko = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4010
|
+
__proto__: null,
|
|
4011
|
+
down: Ro,
|
|
4012
|
+
up: Lo
|
|
4013
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
4014
|
+
async function Uo(t) {
|
|
4015
|
+
}
|
|
4016
|
+
async function qo(t) {
|
|
4017
|
+
}
|
|
4018
|
+
const Bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4019
|
+
__proto__: null,
|
|
4020
|
+
down: qo,
|
|
4021
|
+
up: Uo
|
|
4022
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
4023
|
+
async function Qo(t) {
|
|
3867
4024
|
await t.schema.createTable("hooks").addColumn("hook_id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
|
|
3868
4025
|
"tenant_id",
|
|
3869
4026
|
"varchar(255)",
|
|
@@ -3874,33 +4031,33 @@ async function zo(t) {
|
|
|
3874
4031
|
(e) => e.defaultTo(!1).notNull()
|
|
3875
4032
|
).addColumn("priority", "integer").execute();
|
|
3876
4033
|
}
|
|
3877
|
-
async function
|
|
4034
|
+
async function Wo(t) {
|
|
3878
4035
|
await t.schema.dropTable("hooks").execute();
|
|
3879
4036
|
}
|
|
3880
|
-
const
|
|
4037
|
+
const Vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3881
4038
|
__proto__: null,
|
|
3882
|
-
down:
|
|
3883
|
-
up:
|
|
4039
|
+
down: Wo,
|
|
4040
|
+
up: Qo
|
|
3884
4041
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3885
|
-
async function
|
|
4042
|
+
async function Go(t) {
|
|
3886
4043
|
}
|
|
3887
|
-
async function
|
|
4044
|
+
async function Yo(t) {
|
|
3888
4045
|
}
|
|
3889
|
-
const
|
|
4046
|
+
const Ho = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3890
4047
|
__proto__: null,
|
|
3891
|
-
down:
|
|
3892
|
-
up:
|
|
4048
|
+
down: Yo,
|
|
4049
|
+
up: Go
|
|
3893
4050
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3894
|
-
async function
|
|
4051
|
+
async function Xo(t) {
|
|
3895
4052
|
}
|
|
3896
|
-
async function
|
|
4053
|
+
async function Zo(t) {
|
|
3897
4054
|
}
|
|
3898
|
-
const
|
|
4055
|
+
const es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3899
4056
|
__proto__: null,
|
|
3900
|
-
down:
|
|
3901
|
-
up:
|
|
4057
|
+
down: Zo,
|
|
4058
|
+
up: Xo
|
|
3902
4059
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3903
|
-
async function
|
|
4060
|
+
async function ts(t) {
|
|
3904
4061
|
await t.schema.createTable("logins").addColumn("login_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
3905
4062
|
"tenant_id",
|
|
3906
4063
|
"varchar(255)",
|
|
@@ -3917,7 +4074,7 @@ async function qo(t) {
|
|
|
3917
4074
|
(e) => e.onDelete("cascade")
|
|
3918
4075
|
).addColumn("code_type", "varchar(255)", (e) => e.notNull()).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute();
|
|
3919
4076
|
}
|
|
3920
|
-
async function
|
|
4077
|
+
async function as(t) {
|
|
3921
4078
|
await t.schema.dropTable("logins").execute(), await t.schema.alterTable("passwords").dropColumn("algorithm").execute(), await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("id", "varchar(255)", (e) => e.primaryKey()).addColumn("code", "varchar(255)", (e) => e.notNull()).addColumn("user_id", "varchar(255)").addColumn("tenant_id", "varchar(255)").addForeignKeyConstraint(
|
|
3922
4079
|
"codes_user_id_tenant_id_constraint",
|
|
3923
4080
|
["user_id", "tenant_id"],
|
|
@@ -3926,37 +4083,6 @@ async function Vo(t) {
|
|
|
3926
4083
|
(e) => e.onDelete("cascade")
|
|
3927
4084
|
).addColumn("type", "varchar(255)", (e) => e.notNull()).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute();
|
|
3928
4085
|
}
|
|
3929
|
-
const Wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3930
|
-
__proto__: null,
|
|
3931
|
-
down: Vo,
|
|
3932
|
-
up: qo
|
|
3933
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
3934
|
-
async function Go(t) {
|
|
3935
|
-
}
|
|
3936
|
-
async function Ho(t) {
|
|
3937
|
-
}
|
|
3938
|
-
const Yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3939
|
-
__proto__: null,
|
|
3940
|
-
down: Ho,
|
|
3941
|
-
up: Go
|
|
3942
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
3943
|
-
async function Xo(t) {
|
|
3944
|
-
await t.schema.alterTable("logins").addColumn("auth0Client", "varchar(256)").execute();
|
|
3945
|
-
}
|
|
3946
|
-
async function Zo(t) {
|
|
3947
|
-
await t.schema.alterTable("logins").dropColumn("auth0Client").execute();
|
|
3948
|
-
}
|
|
3949
|
-
const es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3950
|
-
__proto__: null,
|
|
3951
|
-
down: Zo,
|
|
3952
|
-
up: Xo
|
|
3953
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
3954
|
-
async function ts(t) {
|
|
3955
|
-
await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(8192)").execute();
|
|
3956
|
-
}
|
|
3957
|
-
async function as(t) {
|
|
3958
|
-
await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(511)").execute();
|
|
3959
|
-
}
|
|
3960
4086
|
const rs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3961
4087
|
__proto__: null,
|
|
3962
4088
|
down: as,
|
|
@@ -3972,8 +4098,10 @@ const ss = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3972
4098
|
up: ns
|
|
3973
4099
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3974
4100
|
async function is(t) {
|
|
4101
|
+
await t.schema.alterTable("logins").addColumn("auth0Client", "varchar(256)").execute();
|
|
3975
4102
|
}
|
|
3976
4103
|
async function ls(t) {
|
|
4104
|
+
await t.schema.alterTable("logins").dropColumn("auth0Client").execute();
|
|
3977
4105
|
}
|
|
3978
4106
|
const cs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3979
4107
|
__proto__: null,
|
|
@@ -3981,10 +4109,10 @@ const cs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3981
4109
|
up: is
|
|
3982
4110
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3983
4111
|
async function ds(t) {
|
|
3984
|
-
await t.schema.alterTable("logins").addColumn("
|
|
4112
|
+
await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(8192)").execute();
|
|
3985
4113
|
}
|
|
3986
4114
|
async function us(t) {
|
|
3987
|
-
await t.schema.alterTable("logins").dropColumn("
|
|
4115
|
+
await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(511)").execute();
|
|
3988
4116
|
}
|
|
3989
4117
|
const ms = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3990
4118
|
__proto__: null,
|
|
@@ -4010,6 +4138,35 @@ const ws = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4010
4138
|
up: ps
|
|
4011
4139
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4012
4140
|
async function ys(t) {
|
|
4141
|
+
await t.schema.alterTable("logins").addColumn("authParams_nonce", "varchar(255)").execute();
|
|
4142
|
+
}
|
|
4143
|
+
async function vs(t) {
|
|
4144
|
+
await t.schema.alterTable("logins").dropColumn("nonce").execute();
|
|
4145
|
+
}
|
|
4146
|
+
const Ns = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4147
|
+
__proto__: null,
|
|
4148
|
+
down: vs,
|
|
4149
|
+
up: ys
|
|
4150
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
4151
|
+
async function Cs(t) {
|
|
4152
|
+
}
|
|
4153
|
+
async function bs(t) {
|
|
4154
|
+
}
|
|
4155
|
+
const xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4156
|
+
__proto__: null,
|
|
4157
|
+
down: bs,
|
|
4158
|
+
up: Cs
|
|
4159
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
4160
|
+
async function Ts(t) {
|
|
4161
|
+
}
|
|
4162
|
+
async function Ss(t) {
|
|
4163
|
+
}
|
|
4164
|
+
const Os = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4165
|
+
__proto__: null,
|
|
4166
|
+
down: Ss,
|
|
4167
|
+
up: Ts
|
|
4168
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
4169
|
+
async function ks(t) {
|
|
4013
4170
|
await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.notNull()).addColumn(
|
|
4014
4171
|
"tenant_id",
|
|
4015
4172
|
"varchar(255)",
|
|
@@ -4025,7 +4182,7 @@ async function ys(t) {
|
|
|
4025
4182
|
"code_type"
|
|
4026
4183
|
]).execute();
|
|
4027
4184
|
}
|
|
4028
|
-
async function
|
|
4185
|
+
async function $s(t) {
|
|
4029
4186
|
await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
4030
4187
|
"tenant_id",
|
|
4031
4188
|
"varchar(255)",
|
|
@@ -4038,15 +4195,15 @@ async function vs(t) {
|
|
|
4038
4195
|
(e) => e.onDelete("cascade")
|
|
4039
4196
|
).addColumn("code_type", "varchar(255)", (e) => e.notNull()).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute();
|
|
4040
4197
|
}
|
|
4041
|
-
const
|
|
4198
|
+
const Is = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4042
4199
|
__proto__: null,
|
|
4043
|
-
down:
|
|
4044
|
-
up:
|
|
4200
|
+
down: $s,
|
|
4201
|
+
up: ks
|
|
4045
4202
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4046
|
-
async function
|
|
4203
|
+
async function Ds(t) {
|
|
4047
4204
|
await t.schema.dropTable("otps").execute(), await t.schema.dropTable("authentication_codes").execute();
|
|
4048
4205
|
}
|
|
4049
|
-
async function
|
|
4206
|
+
async function Ps(t) {
|
|
4050
4207
|
await t.schema.alterTable("keys").addColumn("private_key", "varchar(2048)").addColumn("public_key", "varchar(2048)").execute(), await t.schema.createTable("otps").addColumn(
|
|
4051
4208
|
"tenant_id",
|
|
4052
4209
|
"varchar(255)",
|
|
@@ -4065,32 +4222,32 @@ async function bs(t) {
|
|
|
4065
4222
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
4066
4223
|
).addColumn("user_id", "varchar(255)", (e) => e.notNull()).addColumn("nonce", "varchar(255)").addColumn("state", "varchar(8192)").addColumn("scope", "varchar(1024)").addColumn("response_type", "varchar(256)").addColumn("response_mode", "varchar(256)").addColumn("redirect_uri", "varchar(1024)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute();
|
|
4067
4224
|
}
|
|
4068
|
-
const
|
|
4225
|
+
const zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4069
4226
|
__proto__: null,
|
|
4070
|
-
down:
|
|
4071
|
-
up:
|
|
4227
|
+
down: Ps,
|
|
4228
|
+
up: Ds
|
|
4072
4229
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4073
|
-
async function
|
|
4230
|
+
async function js(t) {
|
|
4074
4231
|
await t.schema.createIndex("IDX_logs_tenant_date_type_user").on("logs").columns(["tenant_id", "date", "type", "user_id"]).execute();
|
|
4075
4232
|
}
|
|
4076
|
-
async function
|
|
4233
|
+
async function Fs(t) {
|
|
4077
4234
|
await t.schema.dropIndex("IDX_logs_tenant_date_type_user").on("logs").execute();
|
|
4078
4235
|
}
|
|
4079
|
-
const
|
|
4236
|
+
const As = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4080
4237
|
__proto__: null,
|
|
4081
|
-
down:
|
|
4082
|
-
up:
|
|
4238
|
+
down: Fs,
|
|
4239
|
+
up: js
|
|
4083
4240
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4084
|
-
async function
|
|
4241
|
+
async function Ms(t) {
|
|
4085
4242
|
}
|
|
4086
|
-
async function
|
|
4243
|
+
async function Js(t) {
|
|
4087
4244
|
}
|
|
4088
|
-
const
|
|
4245
|
+
const Es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4089
4246
|
__proto__: null,
|
|
4090
|
-
down:
|
|
4091
|
-
up:
|
|
4247
|
+
down: Js,
|
|
4248
|
+
up: Ms
|
|
4092
4249
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4093
|
-
async function
|
|
4250
|
+
async function Ls(t) {
|
|
4094
4251
|
await t.schema.createTable("prompt_settings").addColumn("tenant_id", "varchar(64)", (e) => e.primaryKey()).addColumn(
|
|
4095
4252
|
"universal_login_experience",
|
|
4096
4253
|
"varchar(16)",
|
|
@@ -4109,95 +4266,95 @@ async function Ds(t) {
|
|
|
4109
4266
|
(e) => e.defaultTo(!1).notNull()
|
|
4110
4267
|
).execute();
|
|
4111
4268
|
}
|
|
4112
|
-
async function
|
|
4269
|
+
async function Rs(t) {
|
|
4113
4270
|
await t.schema.dropTable("prompt_settings").execute();
|
|
4114
4271
|
}
|
|
4115
|
-
const
|
|
4272
|
+
const Ks = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4116
4273
|
__proto__: null,
|
|
4117
|
-
down:
|
|
4118
|
-
up:
|
|
4274
|
+
down: Rs,
|
|
4275
|
+
up: Ls
|
|
4119
4276
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4120
|
-
async function
|
|
4277
|
+
async function Us(t) {
|
|
4121
4278
|
}
|
|
4122
|
-
async function
|
|
4279
|
+
async function qs(t) {
|
|
4123
4280
|
}
|
|
4124
|
-
const
|
|
4281
|
+
const Bs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4125
4282
|
__proto__: null,
|
|
4126
|
-
down:
|
|
4127
|
-
up:
|
|
4283
|
+
down: qs,
|
|
4284
|
+
up: Us
|
|
4128
4285
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4129
|
-
async function
|
|
4286
|
+
async function Qs(t) {
|
|
4130
4287
|
}
|
|
4131
|
-
async function
|
|
4288
|
+
async function Ws(t) {
|
|
4132
4289
|
}
|
|
4133
|
-
const
|
|
4290
|
+
const Vs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4134
4291
|
__proto__: null,
|
|
4135
|
-
down:
|
|
4136
|
-
up:
|
|
4292
|
+
down: Ws,
|
|
4293
|
+
up: Qs
|
|
4137
4294
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4138
|
-
async function
|
|
4295
|
+
async function Gs(t) {
|
|
4139
4296
|
}
|
|
4140
|
-
async function
|
|
4297
|
+
async function Ys(t) {
|
|
4141
4298
|
}
|
|
4142
|
-
const
|
|
4299
|
+
const Hs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4143
4300
|
__proto__: null,
|
|
4144
|
-
down:
|
|
4145
|
-
up:
|
|
4301
|
+
down: Ys,
|
|
4302
|
+
up: Gs
|
|
4146
4303
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4147
|
-
async function
|
|
4304
|
+
async function Xs(t) {
|
|
4148
4305
|
await t.schema.alterTable("logins").addColumn("authParams_ui_locales", "varchar(32)").execute();
|
|
4149
4306
|
}
|
|
4150
|
-
async function
|
|
4307
|
+
async function Zs(t) {
|
|
4151
4308
|
await t.schema.alterTable("logins").dropColumn("authParams_ui_locales").execute();
|
|
4152
4309
|
}
|
|
4153
|
-
const
|
|
4310
|
+
const ei = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4154
4311
|
__proto__: null,
|
|
4155
|
-
down:
|
|
4156
|
-
up:
|
|
4312
|
+
down: Zs,
|
|
4313
|
+
up: Xs
|
|
4157
4314
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4158
|
-
async function
|
|
4315
|
+
async function ti(t) {
|
|
4159
4316
|
await t.schema.alterTable("logins").addColumn("authParams_prompt", "varchar(16)").execute();
|
|
4160
4317
|
}
|
|
4161
|
-
async function
|
|
4318
|
+
async function ai(t) {
|
|
4162
4319
|
await t.schema.alterTable("logins").dropColumn("authParams_prompt").execute();
|
|
4163
4320
|
}
|
|
4164
|
-
const
|
|
4321
|
+
const ri = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4165
4322
|
__proto__: null,
|
|
4166
|
-
down:
|
|
4167
|
-
up:
|
|
4323
|
+
down: ai,
|
|
4324
|
+
up: ti
|
|
4168
4325
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4169
|
-
async function
|
|
4326
|
+
async function ni(t) {
|
|
4170
4327
|
}
|
|
4171
|
-
async function
|
|
4328
|
+
async function oi(t) {
|
|
4172
4329
|
}
|
|
4173
|
-
const
|
|
4330
|
+
const si = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4174
4331
|
__proto__: null,
|
|
4175
|
-
down:
|
|
4176
|
-
up:
|
|
4332
|
+
down: oi,
|
|
4333
|
+
up: ni
|
|
4177
4334
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4178
|
-
async function
|
|
4335
|
+
async function ii(t) {
|
|
4179
4336
|
await t.schema.alterTable("logins").addColumn("authParams_act_as", "varchar(255)").execute();
|
|
4180
4337
|
}
|
|
4181
|
-
async function
|
|
4338
|
+
async function li(t) {
|
|
4182
4339
|
await t.schema.alterTable("logins").dropColumn("authParam_act_as").execute();
|
|
4183
4340
|
}
|
|
4184
|
-
const
|
|
4341
|
+
const ci = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4185
4342
|
__proto__: null,
|
|
4186
|
-
down:
|
|
4187
|
-
up:
|
|
4343
|
+
down: li,
|
|
4344
|
+
up: ii
|
|
4188
4345
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4189
|
-
async function
|
|
4346
|
+
async function di(t) {
|
|
4190
4347
|
await t.schema.alterTable("codes").addColumn("code_verifier", "varchar(128)").execute();
|
|
4191
4348
|
}
|
|
4192
|
-
async function
|
|
4349
|
+
async function ui(t) {
|
|
4193
4350
|
await t.schema.alterTable("codes").dropColumn("code_verifier").execute();
|
|
4194
4351
|
}
|
|
4195
|
-
const
|
|
4352
|
+
const mi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4196
4353
|
__proto__: null,
|
|
4197
|
-
down:
|
|
4198
|
-
up:
|
|
4354
|
+
down: ui,
|
|
4355
|
+
up: di
|
|
4199
4356
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4200
|
-
async function
|
|
4357
|
+
async function _i(t) {
|
|
4201
4358
|
await t.schema.createTable("email_providers").addColumn("tenant_id", "varchar(255)", (e) => e.primaryKey()).addColumn("name", "varchar(255)", (e) => e.notNull()).addColumn("enabled", "boolean", (e) => e.notNull()).addColumn("default_from_address", "varchar(255)").addColumn(
|
|
4202
4359
|
"credentials",
|
|
4203
4360
|
"varchar(2048)",
|
|
@@ -4208,18 +4365,18 @@ async function ni(t) {
|
|
|
4208
4365
|
(e) => e.notNull().defaultTo("{}")
|
|
4209
4366
|
).addColumn("created_at", "varchar(29)", (e) => e.notNull()).addColumn("updated_at", "varchar(29)", (e) => e.notNull()).execute();
|
|
4210
4367
|
}
|
|
4211
|
-
async function
|
|
4368
|
+
async function hi(t) {
|
|
4212
4369
|
await t.schema.dropTable("email_providers").execute();
|
|
4213
4370
|
}
|
|
4214
|
-
const
|
|
4371
|
+
const fi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4215
4372
|
__proto__: null,
|
|
4216
|
-
down:
|
|
4217
|
-
up:
|
|
4373
|
+
down: hi,
|
|
4374
|
+
up: _i
|
|
4218
4375
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4219
|
-
async function
|
|
4376
|
+
async function pi(t) {
|
|
4220
4377
|
await t.schema.dropTable("tickets").execute();
|
|
4221
4378
|
}
|
|
4222
|
-
async function
|
|
4379
|
+
async function gi(t) {
|
|
4223
4380
|
await t.schema.createTable("tickets").addColumn(
|
|
4224
4381
|
"tenant_id",
|
|
4225
4382
|
"varchar(255)",
|
|
@@ -4230,22 +4387,22 @@ async function li(t) {
|
|
|
4230
4387
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
4231
4388
|
).addColumn("email", "varchar(255)", (e) => e.notNull()).addColumn("nonce", "varchar(255)").addColumn("state", "varchar(1024)").addColumn("scope", "varchar(1024)").addColumn("response_type", "varchar(256)").addColumn("response_mode", "varchar(256)").addColumn("redirect_uri", "varchar(1024)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute();
|
|
4232
4389
|
}
|
|
4233
|
-
const
|
|
4390
|
+
const wi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4234
4391
|
__proto__: null,
|
|
4235
|
-
down:
|
|
4236
|
-
up:
|
|
4392
|
+
down: gi,
|
|
4393
|
+
up: pi
|
|
4237
4394
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4238
|
-
async function
|
|
4395
|
+
async function yi(t) {
|
|
4239
4396
|
}
|
|
4240
|
-
async function
|
|
4397
|
+
async function vi(t) {
|
|
4241
4398
|
await t.schema.alterTable("logins").dropColumn("ip").dropColumn("useragent").execute();
|
|
4242
4399
|
}
|
|
4243
|
-
const
|
|
4400
|
+
const Ni = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4244
4401
|
__proto__: null,
|
|
4245
|
-
down:
|
|
4246
|
-
up:
|
|
4402
|
+
down: vi,
|
|
4403
|
+
up: yi
|
|
4247
4404
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4248
|
-
async function
|
|
4405
|
+
async function Ci(t) {
|
|
4249
4406
|
await t.schema.createTable("refresh_tokens").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn(
|
|
4250
4407
|
"client_id",
|
|
4251
4408
|
"varchar(21)",
|
|
@@ -4258,27 +4415,27 @@ async function _i(t) {
|
|
|
4258
4415
|
(e) => e.onDelete("cascade")
|
|
4259
4416
|
).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("expires_at", "varchar(35)").addColumn("idle_expires_at", "varchar(35)").addColumn("last_exchanged_at", "varchar(35)").addColumn("device", "varchar(2048)", (e) => e.notNull()).addColumn("resource_servers", "varchar(2048)", (e) => e.notNull()).addColumn("rotating", "boolean", (e) => e.notNull()).execute();
|
|
4260
4417
|
}
|
|
4261
|
-
async function
|
|
4418
|
+
async function bi(t) {
|
|
4262
4419
|
await t.schema.dropTable("refresh_tokens").execute();
|
|
4263
4420
|
}
|
|
4264
|
-
const
|
|
4421
|
+
const xi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4265
4422
|
__proto__: null,
|
|
4266
|
-
down:
|
|
4267
|
-
up:
|
|
4423
|
+
down: bi,
|
|
4424
|
+
up: Ci
|
|
4268
4425
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4269
|
-
async function
|
|
4426
|
+
async function Ti(t) {
|
|
4270
4427
|
}
|
|
4271
|
-
async function
|
|
4428
|
+
async function Si(t) {
|
|
4272
4429
|
}
|
|
4273
|
-
const
|
|
4430
|
+
const Oi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4274
4431
|
__proto__: null,
|
|
4275
|
-
down:
|
|
4276
|
-
up:
|
|
4432
|
+
down: Si,
|
|
4433
|
+
up: Ti
|
|
4277
4434
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4278
|
-
async function
|
|
4435
|
+
async function ki(t) {
|
|
4279
4436
|
await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("refresh_tokens").execute();
|
|
4280
4437
|
}
|
|
4281
|
-
async function
|
|
4438
|
+
async function $i(t) {
|
|
4282
4439
|
await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
4283
4440
|
"sessions_user_id_constraint",
|
|
4284
4441
|
["user_id", "tenant_id"],
|
|
@@ -4297,12 +4454,12 @@ async function vi(t) {
|
|
|
4297
4454
|
(e) => e.onDelete("cascade")
|
|
4298
4455
|
).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("expires_at", "varchar(35)").addColumn("idle_expires_at", "varchar(35)").addColumn("last_exchanged_at", "varchar(35)").addColumn("device", "varchar(2048)", (e) => e.notNull()).addColumn("resource_servers", "varchar(2048)", (e) => e.notNull()).addColumn("rotating", "boolean", (e) => e.notNull()).execute();
|
|
4299
4456
|
}
|
|
4300
|
-
const
|
|
4457
|
+
const Ii = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4301
4458
|
__proto__: null,
|
|
4302
|
-
down:
|
|
4303
|
-
up:
|
|
4459
|
+
down: $i,
|
|
4460
|
+
up: ki
|
|
4304
4461
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4305
|
-
async function
|
|
4462
|
+
async function Di(t) {
|
|
4306
4463
|
await t.schema.createTable("sessions_2").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
4307
4464
|
"sessions_2_user_id_constraint",
|
|
4308
4465
|
["user_id", "tenant_id"],
|
|
@@ -4321,15 +4478,15 @@ async function Ci(t) {
|
|
|
4321
4478
|
(e) => e.onDelete("cascade")
|
|
4322
4479
|
).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("expires_at", "varchar(35)").addColumn("idle_expires_at", "varchar(35)").addColumn("last_exchanged_at", "varchar(35)").addColumn("device", "varchar(2048)", (e) => e.notNull()).addColumn("resource_servers", "varchar(2048)", (e) => e.notNull()).addColumn("rotating", "boolean", (e) => e.notNull()).execute();
|
|
4323
4480
|
}
|
|
4324
|
-
async function
|
|
4481
|
+
async function Pi(t) {
|
|
4325
4482
|
await t.schema.dropTable("sessions_2").execute(), await t.schema.dropTable("refresh_tokens_2").execute();
|
|
4326
4483
|
}
|
|
4327
|
-
const
|
|
4484
|
+
const zi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4328
4485
|
__proto__: null,
|
|
4329
|
-
down:
|
|
4330
|
-
up:
|
|
4486
|
+
down: Pi,
|
|
4487
|
+
up: Di
|
|
4331
4488
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4332
|
-
async function
|
|
4489
|
+
async function ji(t) {
|
|
4333
4490
|
await t.schema.createTable("custom_domains").addColumn(
|
|
4334
4491
|
"custom_domain_id",
|
|
4335
4492
|
"varchar(21)",
|
|
@@ -4340,49 +4497,49 @@ async function Ti(t) {
|
|
|
4340
4497
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
4341
4498
|
).addColumn("domain", "varchar(255)", (e) => e.notNull()).addColumn("primary", "boolean", (e) => e.notNull()).addColumn("status", "varchar(50)", (e) => e.notNull()).addColumn("type", "varchar(50)", (e) => e.notNull()).addColumn("origin_domain_name", "varchar(255)").addColumn("verification", "varchar(2048)").addColumn("custom_client_ip_header", "varchar(50)").addColumn("tls_policy", "varchar(50)").addColumn("domain_metadata", "varchar(2048)").addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("updated_at", "varchar(35)", (e) => e.notNull()).execute(), await t.schema.dropTable("domains").execute();
|
|
4342
4499
|
}
|
|
4343
|
-
async function
|
|
4500
|
+
async function Fi(t) {
|
|
4344
4501
|
await t.schema.dropTable("custom_domains").execute(), await t.schema.createTable("domains").addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
|
|
4345
4502
|
"tenant_id",
|
|
4346
4503
|
"varchar(255)",
|
|
4347
4504
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
4348
4505
|
).addColumn("domain", "varchar(255)", (e) => e.notNull()).addColumn("email_service", "varchar(255)").addColumn("email_api_key", "varchar(255)").addColumn("dkim_private_key", "varchar(2048)").addColumn("dkim_public_key", "varchar(2048)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("updated_at", "varchar(255)", (e) => e.notNull()).execute();
|
|
4349
4506
|
}
|
|
4350
|
-
const
|
|
4507
|
+
const Ai = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4351
4508
|
__proto__: null,
|
|
4352
|
-
down:
|
|
4353
|
-
up:
|
|
4509
|
+
down: Fi,
|
|
4510
|
+
up: ji
|
|
4354
4511
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4355
|
-
async function
|
|
4512
|
+
async function Mi(t) {
|
|
4356
4513
|
}
|
|
4357
|
-
async function
|
|
4514
|
+
async function Ji(t) {
|
|
4358
4515
|
await t.schema.alterTable("logins").dropColumn("authParams_organization").dropColumn("authorization_url").execute();
|
|
4359
4516
|
}
|
|
4360
|
-
const
|
|
4517
|
+
const Ei = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4361
4518
|
__proto__: null,
|
|
4362
|
-
down:
|
|
4363
|
-
up:
|
|
4519
|
+
down: Ji,
|
|
4520
|
+
up: Mi
|
|
4364
4521
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4365
|
-
async function
|
|
4522
|
+
async function Li(t) {
|
|
4366
4523
|
await t.schema.alterTable("logins").dropColumn("authorization_url").execute(), await t.schema.alterTable("logins").addColumn("authorization_url", "varchar(2048)").execute();
|
|
4367
4524
|
}
|
|
4368
|
-
async function
|
|
4525
|
+
async function Ri(t) {
|
|
4369
4526
|
await t.schema.alterTable("logins").dropColumn("authorization_url").execute(), await t.schema.alterTable("logins").addColumn("authorization_url", "varchar(1024)").execute();
|
|
4370
4527
|
}
|
|
4371
|
-
const
|
|
4528
|
+
const Ki = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4372
4529
|
__proto__: null,
|
|
4373
|
-
down:
|
|
4374
|
-
up:
|
|
4530
|
+
down: Ri,
|
|
4531
|
+
up: Li
|
|
4375
4532
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4376
|
-
async function
|
|
4533
|
+
async function Ui(t) {
|
|
4377
4534
|
}
|
|
4378
|
-
async function
|
|
4535
|
+
async function qi(t) {
|
|
4379
4536
|
}
|
|
4380
|
-
const
|
|
4537
|
+
const Bi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4381
4538
|
__proto__: null,
|
|
4382
|
-
down:
|
|
4383
|
-
up:
|
|
4539
|
+
down: qi,
|
|
4540
|
+
up: Ui
|
|
4384
4541
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4385
|
-
async function
|
|
4542
|
+
async function Qi(t) {
|
|
4386
4543
|
await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
4387
4544
|
"sessions_user_id_constraint",
|
|
4388
4545
|
["user_id", "tenant_id"],
|
|
@@ -4409,25 +4566,25 @@ async function zi(t) {
|
|
|
4409
4566
|
(e) => e.onDelete("cascade")
|
|
4410
4567
|
).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("expires_at", "varchar(35)").addColumn("idle_expires_at", "varchar(35)").addColumn("last_exchanged_at", "varchar(35)").addColumn("device", "varchar(2048)", (e) => e.notNull()).addColumn("resource_servers", "varchar(2048)", (e) => e.notNull()).addColumn("rotating", "boolean", (e) => e.notNull()).execute();
|
|
4411
4568
|
}
|
|
4412
|
-
async function
|
|
4569
|
+
async function Wi(t) {
|
|
4413
4570
|
await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("login_sessions").execute(), await t.schema.dropTable("refresh_tokens").execute();
|
|
4414
4571
|
}
|
|
4415
|
-
const
|
|
4572
|
+
const Vi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4416
4573
|
__proto__: null,
|
|
4417
|
-
down:
|
|
4418
|
-
up:
|
|
4574
|
+
down: Wi,
|
|
4575
|
+
up: Qi
|
|
4419
4576
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4420
|
-
async function
|
|
4577
|
+
async function Gi(t) {
|
|
4421
4578
|
await t.schema.dropTable("logins").execute(), await t.schema.dropTable("sessions_2").execute(), await t.schema.dropTable("refresh_tokens_2").execute();
|
|
4422
4579
|
}
|
|
4423
|
-
async function
|
|
4580
|
+
async function Yi(t) {
|
|
4424
4581
|
}
|
|
4425
|
-
const
|
|
4582
|
+
const Hi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4426
4583
|
__proto__: null,
|
|
4427
|
-
down:
|
|
4428
|
-
up:
|
|
4584
|
+
down: Yi,
|
|
4585
|
+
up: Gi
|
|
4429
4586
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4430
|
-
async function
|
|
4587
|
+
async function Xi(t) {
|
|
4431
4588
|
await t.schema.dropTable("custom_domains").execute(), await t.schema.createTable("custom_domains").addColumn(
|
|
4432
4589
|
"custom_domain_id",
|
|
4433
4590
|
"varchar(256)",
|
|
@@ -4438,120 +4595,120 @@ async function Ui(t) {
|
|
|
4438
4595
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
4439
4596
|
).addColumn("domain", "varchar(255)", (e) => e.notNull()).addColumn("primary", "boolean", (e) => e.notNull()).addColumn("status", "varchar(50)", (e) => e.notNull()).addColumn("type", "varchar(50)", (e) => e.notNull()).addColumn("origin_domain_name", "varchar(255)").addColumn("verification", "varchar(2048)").addColumn("custom_client_ip_header", "varchar(50)").addColumn("tls_policy", "varchar(50)").addColumn("domain_metadata", "varchar(2048)").addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("updated_at", "varchar(35)", (e) => e.notNull()).execute();
|
|
4440
4597
|
}
|
|
4441
|
-
async function
|
|
4598
|
+
async function Zi(t) {
|
|
4442
4599
|
}
|
|
4443
|
-
const
|
|
4600
|
+
const el = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4444
4601
|
__proto__: null,
|
|
4445
|
-
down:
|
|
4446
|
-
up:
|
|
4602
|
+
down: Zi,
|
|
4603
|
+
up: Xi
|
|
4447
4604
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4448
|
-
async function
|
|
4605
|
+
async function tl(t) {
|
|
4449
4606
|
}
|
|
4450
|
-
async function
|
|
4607
|
+
async function al(t) {
|
|
4451
4608
|
await t.schema.alterTable("users").dropColumn("phone_number").dropColumn("phone_verified").dropColumn("username").execute();
|
|
4452
4609
|
}
|
|
4453
|
-
const
|
|
4610
|
+
const rl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4454
4611
|
__proto__: null,
|
|
4455
|
-
down:
|
|
4456
|
-
up:
|
|
4612
|
+
down: al,
|
|
4613
|
+
up: tl
|
|
4457
4614
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4458
|
-
async function
|
|
4615
|
+
async function nl(t) {
|
|
4459
4616
|
await t.schema.createTable("forms").addColumn("id", "varchar(255)", (e) => e.primaryKey()).addColumn("name", "varchar(255)", (e) => e.notNull()).addColumn("tenant_id", "varchar(255)", (e) => e.notNull()).addColumn("messages", "varchar(255)").addColumn("languages", "varchar(255)").addColumn("translations", "varchar(4096)").addColumn("nodes", "varchar(4096)").addColumn("start", "varchar(255)").addColumn("ending", "varchar(255)").addColumn("style", "varchar(1042)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("updated_at", "varchar(255)", (e) => e.notNull()).execute(), await t.schema.createIndex("forms_tenant_id_idx").on("forms").column("tenant_id").execute();
|
|
4460
4617
|
}
|
|
4461
|
-
async function
|
|
4618
|
+
async function ol(t) {
|
|
4462
4619
|
await t.schema.dropTable("forms").execute();
|
|
4463
4620
|
}
|
|
4464
|
-
const
|
|
4621
|
+
const sl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4465
4622
|
__proto__: null,
|
|
4466
|
-
down:
|
|
4467
|
-
up:
|
|
4623
|
+
down: ol,
|
|
4624
|
+
up: nl
|
|
4468
4625
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4469
|
-
async function
|
|
4626
|
+
async function il(t) {
|
|
4470
4627
|
await t.schema.alterTable("hooks").addColumn("form_id", "text").execute(), await t.schema.alterTable("hooks").addColumn("url_tmp", "varchar(512)").execute(), await t.updateTable("hooks").set((e) => ({ url_tmp: e.ref("url") })).execute(), await t.schema.alterTable("hooks").dropColumn("url").execute(), await t.schema.alterTable("hooks").renameColumn("url_tmp", "url").execute();
|
|
4471
4628
|
}
|
|
4472
|
-
async function
|
|
4629
|
+
async function ll(t) {
|
|
4473
4630
|
await t.schema.dropTable("hooks").ifExists().execute(), await t.schema.createTable("hooks").addColumn("hook_id", "text", (e) => e.primaryKey()).addColumn("tenant_id", "text", (e) => e.notNull()).addColumn("trigger_id", "text", (e) => e.notNull()).addColumn("enabled", "integer", (e) => e.notNull().defaultTo(0)).addColumn("url", "varchar(512)", (e) => e.notNull()).addColumn("synchronous", "integer", (e) => e.notNull().defaultTo(0)).addColumn("priority", "integer").addColumn("created_at", "text", (e) => e.notNull()).addColumn("updated_at", "text", (e) => e.notNull()).execute();
|
|
4474
4631
|
}
|
|
4475
|
-
const
|
|
4632
|
+
const cl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4476
4633
|
__proto__: null,
|
|
4477
|
-
down:
|
|
4478
|
-
up:
|
|
4634
|
+
down: ll,
|
|
4635
|
+
up: il
|
|
4479
4636
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4480
|
-
async function
|
|
4637
|
+
async function dl(t) {
|
|
4481
4638
|
await t.schema.alterTable("login_sessions").addColumn(
|
|
4482
4639
|
"login_completed",
|
|
4483
4640
|
"boolean",
|
|
4484
4641
|
(e) => e.notNull().defaultTo(0)
|
|
4485
4642
|
).execute();
|
|
4486
4643
|
}
|
|
4487
|
-
async function
|
|
4644
|
+
async function ul(t) {
|
|
4488
4645
|
await t.schema.alterTable("login_sessions").dropColumn("login_completed").execute();
|
|
4489
4646
|
}
|
|
4490
|
-
const
|
|
4647
|
+
const ml = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4491
4648
|
__proto__: null,
|
|
4492
|
-
down:
|
|
4493
|
-
up:
|
|
4649
|
+
down: ul,
|
|
4650
|
+
up: dl
|
|
4494
4651
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4495
|
-
async function
|
|
4652
|
+
async function _l(t) {
|
|
4496
4653
|
await t.schema.alterTable("sessions").addColumn(
|
|
4497
4654
|
"login_session_id",
|
|
4498
4655
|
"varchar(21)",
|
|
4499
4656
|
(e) => e.references("login_sessions.id").onDelete("set null")
|
|
4500
4657
|
).execute();
|
|
4501
4658
|
}
|
|
4502
|
-
async function
|
|
4659
|
+
async function hl(t) {
|
|
4503
4660
|
await t.schema.alterTable("sessions").dropColumn("login_session_id").execute();
|
|
4504
4661
|
}
|
|
4505
|
-
const
|
|
4662
|
+
const fl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4506
4663
|
__proto__: null,
|
|
4507
|
-
down:
|
|
4508
|
-
up:
|
|
4664
|
+
down: hl,
|
|
4665
|
+
up: _l
|
|
4509
4666
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4510
|
-
async function
|
|
4667
|
+
async function pl(t) {
|
|
4511
4668
|
await t.schema.createIndex("IDX_sessions_login_session_id").on("sessions").column("login_session_id").execute();
|
|
4512
4669
|
}
|
|
4513
|
-
async function
|
|
4670
|
+
async function gl(t) {
|
|
4514
4671
|
await t.schema.dropIndex("IDX_sessions_login_session_id").on("sessions").execute();
|
|
4515
4672
|
}
|
|
4516
|
-
const
|
|
4673
|
+
const wl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4517
4674
|
__proto__: null,
|
|
4518
|
-
down:
|
|
4519
|
-
up:
|
|
4675
|
+
down: gl,
|
|
4676
|
+
up: pl
|
|
4520
4677
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4521
|
-
async function
|
|
4678
|
+
async function yl(t) {
|
|
4522
4679
|
await t.schema.alterTable("codes").addColumn("code_challenge", "varchar(128)").execute(), await t.schema.alterTable("codes").addColumn("code_challenge_method", "varchar(5)").execute();
|
|
4523
4680
|
}
|
|
4524
|
-
async function
|
|
4681
|
+
async function vl(t) {
|
|
4525
4682
|
await t.schema.alterTable("codes").dropColumn("code_challenge").execute(), await t.schema.alterTable("codes").dropColumn("code_challenge_method").execute();
|
|
4526
4683
|
}
|
|
4527
|
-
const
|
|
4684
|
+
const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4528
4685
|
__proto__: null,
|
|
4529
|
-
down:
|
|
4530
|
-
up:
|
|
4686
|
+
down: vl,
|
|
4687
|
+
up: yl
|
|
4531
4688
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4532
|
-
async function
|
|
4689
|
+
async function Cl(t) {
|
|
4533
4690
|
await t.schema.alterTable("codes").addColumn("redirect_uri", "varchar(1024)").execute();
|
|
4534
4691
|
}
|
|
4535
|
-
async function
|
|
4692
|
+
async function bl(t) {
|
|
4536
4693
|
await t.schema.alterTable("codes").dropColumn("redirect_uri").execute();
|
|
4537
4694
|
}
|
|
4538
|
-
const
|
|
4695
|
+
const xl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4539
4696
|
__proto__: null,
|
|
4540
|
-
down:
|
|
4541
|
-
up:
|
|
4697
|
+
down: bl,
|
|
4698
|
+
up: Cl
|
|
4542
4699
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4543
|
-
async function
|
|
4700
|
+
async function Tl(t) {
|
|
4544
4701
|
await t.schema.alterTable("codes").addColumn("nonce", "varchar(1024)").execute(), await t.schema.alterTable("codes").addColumn("state", "varchar(2048)").execute();
|
|
4545
4702
|
}
|
|
4546
|
-
async function
|
|
4703
|
+
async function Sl(t) {
|
|
4547
4704
|
await t.schema.alterTable("codes").dropColumn("nonce").execute(), await t.schema.alterTable("codes").dropColumn("state").execute();
|
|
4548
4705
|
}
|
|
4549
|
-
const
|
|
4706
|
+
const Ol = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4550
4707
|
__proto__: null,
|
|
4551
|
-
down:
|
|
4552
|
-
up:
|
|
4708
|
+
down: Sl,
|
|
4709
|
+
up: Tl
|
|
4553
4710
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4554
|
-
async function
|
|
4711
|
+
async function kl(t) {
|
|
4555
4712
|
await t.schema.createTable("themes").addColumn(
|
|
4556
4713
|
"tenant_id",
|
|
4557
4714
|
"varchar(255)",
|
|
@@ -4626,26 +4783,26 @@ async function yl(t) {
|
|
|
4626
4783
|
(e) => e.notNull()
|
|
4627
4784
|
).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("updated_at", "varchar(35)", (e) => e.notNull()).addPrimaryKeyConstraint("themes_pkey", ["tenant_id", "themeId"]).execute(), await t.schema.createIndex("themes_tenant_id_idx").on("themes").column("tenant_id").execute();
|
|
4628
4785
|
}
|
|
4629
|
-
async function
|
|
4786
|
+
async function $l(t) {
|
|
4630
4787
|
await t.schema.dropTable("themes").execute();
|
|
4631
4788
|
}
|
|
4632
|
-
const
|
|
4789
|
+
const Il = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4633
4790
|
__proto__: null,
|
|
4634
|
-
down:
|
|
4635
|
-
up:
|
|
4791
|
+
down: $l,
|
|
4792
|
+
up: kl
|
|
4636
4793
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4637
|
-
async function
|
|
4794
|
+
async function Dl(t) {
|
|
4638
4795
|
await t.schema.createTable("resource_servers").addColumn("id", "varchar(21)", (e) => e.notNull()).addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("identifier", "varchar(191)", (e) => e.notNull()).addColumn("name", "varchar(255)", (e) => e.notNull()).addColumn("scopes", "varchar(4096)").addColumn("signing_alg", "varchar(64)").addColumn("signing_secret", "varchar(2048)").addColumn("token_lifetime", "integer").addColumn("token_lifetime_for_web", "integer").addColumn("skip_consent_for_verifiable_first_party_clients", "integer").addColumn("allow_offline_access", "integer").addColumn("verification_key", "varchar(4096)").addColumn("options", "varchar(4096)").addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("updated_at", "varchar(35)", (e) => e.notNull()).addPrimaryKeyConstraint("resource_servers_pk", ["tenant_id", "id"]).execute(), await t.schema.createIndex("resource_servers_tenant_identifier_uq").on("resource_servers").columns(["tenant_id", "identifier"]).unique().execute(), await t.schema.createTable("roles").addColumn("id", "varchar(21)", (e) => e.notNull()).addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("name", "varchar(50)", (e) => e.notNull()).addColumn("description", "varchar(255)").addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("updated_at", "varchar(35)", (e) => e.notNull()).addPrimaryKeyConstraint("roles_pk", ["tenant_id", "id"]).execute(), await t.schema.createIndex("roles_tenant_name_uq").on("roles").columns(["tenant_id", "name"]).unique().execute();
|
|
4639
4796
|
}
|
|
4640
|
-
async function
|
|
4797
|
+
async function Pl(t) {
|
|
4641
4798
|
await t.schema.dropTable("roles").execute(), await t.schema.dropTable("resource_servers").execute();
|
|
4642
4799
|
}
|
|
4643
|
-
const
|
|
4800
|
+
const zl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4644
4801
|
__proto__: null,
|
|
4645
|
-
down:
|
|
4646
|
-
up:
|
|
4802
|
+
down: Pl,
|
|
4803
|
+
up: Dl
|
|
4647
4804
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4648
|
-
async function
|
|
4805
|
+
async function jl(t) {
|
|
4649
4806
|
await t.schema.createTable("role_permissions").addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("role_id", "varchar(21)", (e) => e.notNull()).addColumn(
|
|
4650
4807
|
"resource_server_identifier",
|
|
4651
4808
|
"varchar(191)",
|
|
@@ -4666,148 +4823,212 @@ async function Tl(t) {
|
|
|
4666
4823
|
"permission_name"
|
|
4667
4824
|
]).execute(), await t.schema.createIndex("user_permissions_user_fk").on("user_permissions").columns(["tenant_id", "user_id"]).execute(), await t.schema.createIndex("user_permissions_permission_fk").on("user_permissions").columns(["tenant_id", "resource_server_identifier", "permission_name"]).execute();
|
|
4668
4825
|
}
|
|
4669
|
-
async function
|
|
4826
|
+
async function Fl(t) {
|
|
4670
4827
|
await t.schema.dropTable("user_permissions").execute(), await t.schema.dropTable("role_permissions").execute();
|
|
4671
4828
|
}
|
|
4672
|
-
const
|
|
4829
|
+
const Al = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4673
4830
|
__proto__: null,
|
|
4674
|
-
down:
|
|
4675
|
-
up:
|
|
4831
|
+
down: Fl,
|
|
4832
|
+
up: jl
|
|
4676
4833
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4677
|
-
async function
|
|
4834
|
+
async function Ml(t) {
|
|
4678
4835
|
await t.schema.createTable("user_roles").addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("user_id", "varchar(191)", (e) => e.notNull()).addColumn("role_id", "varchar(21)", (e) => e.notNull()).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addPrimaryKeyConstraint("user_roles_pk", [
|
|
4679
4836
|
"tenant_id",
|
|
4680
4837
|
"user_id",
|
|
4681
4838
|
"role_id"
|
|
4682
4839
|
]).execute(), await t.schema.createIndex("user_roles_user_fk").on("user_roles").columns(["tenant_id", "user_id"]).execute(), await t.schema.createIndex("user_roles_role_fk").on("user_roles").columns(["tenant_id", "role_id"]).execute();
|
|
4683
4840
|
}
|
|
4684
|
-
async function
|
|
4841
|
+
async function Jl(t) {
|
|
4685
4842
|
await t.schema.dropTable("user_roles").execute();
|
|
4686
4843
|
}
|
|
4687
|
-
const
|
|
4844
|
+
const El = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4688
4845
|
__proto__: null,
|
|
4689
|
-
down:
|
|
4690
|
-
up:
|
|
4846
|
+
down: Jl,
|
|
4847
|
+
up: Ml
|
|
4691
4848
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4692
|
-
async function
|
|
4849
|
+
async function Ll(t) {
|
|
4693
4850
|
}
|
|
4694
|
-
async function
|
|
4851
|
+
async function Rl(t) {
|
|
4695
4852
|
await t.schema.alterTable("keys").dropColumn("connection").execute(), await t.schema.alterTable("keys").modifyColumn("cert", "varchar(2048)").execute(), await t.schema.alterTable("keys").modifyColumn("pkcs7", "varchar(2048)").execute(), await t.schema.alterTable("keys").dropColumn("type").execute();
|
|
4696
4853
|
}
|
|
4697
|
-
const
|
|
4854
|
+
const Kl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4698
4855
|
__proto__: null,
|
|
4699
|
-
down:
|
|
4700
|
-
up:
|
|
4856
|
+
down: Rl,
|
|
4857
|
+
up: Ll
|
|
4701
4858
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4702
|
-
async function
|
|
4703
|
-
await t.schema.createTable("organizations").addColumn("id", "varchar(
|
|
4859
|
+
async function Ul(t) {
|
|
4860
|
+
await t.schema.createTable("organizations").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("name", "varchar(256)", (e) => e.notNull()).addColumn("display_name", "varchar(256)").addColumn("branding", "text").addColumn("metadata", "text").addColumn("enabled_connections", "text").addColumn("token_quota", "text").addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("updated_at", "varchar(35)", (e) => e.notNull()).execute(), await t.schema.createIndex("idx_organizations_tenant_id").on("organizations").column("tenant_id").execute(), await t.schema.createIndex("idx_organizations_tenant_name_unique").on("organizations").columns(["tenant_id", "name"]).unique().execute();
|
|
4704
4861
|
}
|
|
4705
|
-
async function
|
|
4862
|
+
async function ql(t) {
|
|
4706
4863
|
await t.schema.dropTable("organizations").execute();
|
|
4707
4864
|
}
|
|
4708
|
-
const
|
|
4865
|
+
const Bl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4866
|
+
__proto__: null,
|
|
4867
|
+
down: ql,
|
|
4868
|
+
up: Ul
|
|
4869
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
4870
|
+
async function Ql(t) {
|
|
4871
|
+
await t.schema.createTable("user_organizations").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("user_id", "varchar(191)", (e) => e.notNull()).addColumn("organization_id", "varchar(21)", (e) => e.notNull()).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("updated_at", "varchar(35)", (e) => e.notNull()).addUniqueConstraint("user_organizations_unique", [
|
|
4872
|
+
"tenant_id",
|
|
4873
|
+
"user_id",
|
|
4874
|
+
"organization_id"
|
|
4875
|
+
]).execute(), await t.schema.createIndex("idx_user_organizations_tenant_id").on("user_organizations").column("tenant_id").execute(), await t.schema.createIndex("idx_user_organizations_user_id").on("user_organizations").column("user_id").execute(), await t.schema.createIndex("idx_user_organizations_organization_id").on("user_organizations").column("organization_id").execute();
|
|
4876
|
+
}
|
|
4877
|
+
async function Wl(t) {
|
|
4878
|
+
await t.schema.dropTable("user_organizations").execute();
|
|
4879
|
+
}
|
|
4880
|
+
const Vl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4881
|
+
__proto__: null,
|
|
4882
|
+
down: Wl,
|
|
4883
|
+
up: Ql
|
|
4884
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
4885
|
+
async function Gl(t) {
|
|
4886
|
+
await t.schema.dropTable("user_permissions").execute(), await t.schema.dropTable("user_roles").execute(), await t.schema.createTable("user_permissions").addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("user_id", "varchar(191)", (e) => e.notNull()).addColumn(
|
|
4887
|
+
"resource_server_identifier",
|
|
4888
|
+
"varchar(21)",
|
|
4889
|
+
(e) => e.notNull()
|
|
4890
|
+
).addColumn("permission_name", "varchar(191)", (e) => e.notNull()).addColumn(
|
|
4891
|
+
"organization_id",
|
|
4892
|
+
"varchar(21)",
|
|
4893
|
+
(e) => e.notNull().defaultTo("")
|
|
4894
|
+
).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addPrimaryKeyConstraint("user_permissions_pk", [
|
|
4895
|
+
"tenant_id",
|
|
4896
|
+
"user_id",
|
|
4897
|
+
"resource_server_identifier",
|
|
4898
|
+
"permission_name",
|
|
4899
|
+
"organization_id"
|
|
4900
|
+
]).execute(), await t.schema.createIndex("user_permissions_user_fk").on("user_permissions").columns(["tenant_id", "user_id"]).execute(), await t.schema.createIndex("user_permissions_permission_fk").on("user_permissions").columns(["tenant_id", "resource_server_identifier", "permission_name"]).execute(), await t.schema.createIndex("user_permissions_organization_fk").on("user_permissions").column("organization_id").execute(), await t.schema.createTable("user_roles").addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("user_id", "varchar(191)", (e) => e.notNull()).addColumn("role_id", "varchar(21)", (e) => e.notNull()).addColumn(
|
|
4901
|
+
"organization_id",
|
|
4902
|
+
"varchar(191)",
|
|
4903
|
+
(e) => e.notNull().defaultTo("")
|
|
4904
|
+
).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addPrimaryKeyConstraint("user_roles_pk", [
|
|
4905
|
+
"tenant_id",
|
|
4906
|
+
"user_id",
|
|
4907
|
+
"role_id",
|
|
4908
|
+
"organization_id"
|
|
4909
|
+
]).execute(), await t.schema.createIndex("user_roles_user_fk").on("user_roles").columns(["tenant_id", "user_id"]).execute(), await t.schema.createIndex("user_roles_role_fk").on("user_roles").columns(["tenant_id", "role_id"]).execute(), await t.schema.createIndex("user_roles_organization_fk").on("user_roles").column("organization_id").execute();
|
|
4910
|
+
}
|
|
4911
|
+
async function Yl(t) {
|
|
4912
|
+
await t.schema.dropTable("user_permissions").execute(), await t.schema.dropTable("user_roles").execute(), await t.schema.createTable("user_permissions").addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("user_id", "varchar(191)", (e) => e.notNull()).addColumn(
|
|
4913
|
+
"resource_server_identifier",
|
|
4914
|
+
"varchar(191)",
|
|
4915
|
+
(e) => e.notNull()
|
|
4916
|
+
).addColumn("permission_name", "varchar(191)", (e) => e.notNull()).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addPrimaryKeyConstraint("user_permissions_pk", [
|
|
4917
|
+
"tenant_id",
|
|
4918
|
+
"user_id",
|
|
4919
|
+
"resource_server_identifier",
|
|
4920
|
+
"permission_name"
|
|
4921
|
+
]).execute(), await t.schema.createIndex("user_permissions_user_fk").on("user_permissions").columns(["tenant_id", "user_id"]).execute(), await t.schema.createIndex("user_permissions_permission_fk").on("user_permissions").columns(["tenant_id", "resource_server_identifier", "permission_name"]).execute(), await t.schema.createTable("user_roles").addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("user_id", "varchar(191)", (e) => e.notNull()).addColumn("role_id", "varchar(21)", (e) => e.notNull()).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addPrimaryKeyConstraint("user_roles_pk", [
|
|
4922
|
+
"tenant_id",
|
|
4923
|
+
"user_id",
|
|
4924
|
+
"role_id"
|
|
4925
|
+
]).execute(), await t.schema.createIndex("user_roles_user_fk").on("user_roles").columns(["tenant_id", "user_id"]).execute(), await t.schema.createIndex("user_roles_role_fk").on("user_roles").columns(["tenant_id", "role_id"]).execute();
|
|
4926
|
+
}
|
|
4927
|
+
const Hl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4709
4928
|
__proto__: null,
|
|
4710
|
-
down:
|
|
4711
|
-
up:
|
|
4712
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4713
|
-
m1_init:
|
|
4714
|
-
m2_magicLink:
|
|
4715
|
-
m3_updateAt:
|
|
4716
|
-
m4_logTable:
|
|
4717
|
-
m5_userProfile:
|
|
4718
|
-
m6_sessions:
|
|
4719
|
-
m7_passwords:
|
|
4720
|
-
m8_logsTableNewFields:
|
|
4721
|
-
m9_passwordTableNewField:
|
|
4722
|
-
n01_codesTable:
|
|
4723
|
-
n11_universalLoginSession:
|
|
4724
|
-
n12_userFields:
|
|
4725
|
-
n13_userEmailIndex:
|
|
4726
|
-
n14_profileDataField:
|
|
4727
|
-
n15_userEmailIndex:
|
|
4728
|
-
n16_userLocale:
|
|
4729
|
-
n17_signingKeys:
|
|
4730
|
-
n18_logsFields:
|
|
4731
|
-
n19_connectionsUserinfo:
|
|
4732
|
-
n20_missingFields:
|
|
4733
|
-
n21_sessionDeletedAt:
|
|
4734
|
-
n22_dropLogsFields:
|
|
4735
|
-
n23_dropUsersFields:
|
|
4736
|
-
n24_logsIndexes:
|
|
4737
|
-
n25_logDescMaxLength:
|
|
4738
|
-
n26_logsTableExtraFields:
|
|
4739
|
-
n27_usersTableNameIndex:
|
|
4740
|
-
n28_usersEmailConstrain:
|
|
4741
|
-
n29_increaseOtpStateLength:
|
|
4742
|
-
n30_increaseTicketStateLength:
|
|
4743
|
-
n31_branding:
|
|
4744
|
-
n32_indexesAndNotNull:
|
|
4745
|
-
n33_vendorIdInUniversalLoginSession:
|
|
4746
|
-
n34_auth0ClientInUniversalLoginSession:
|
|
4747
|
-
n35_increaseUniversalSessionStateLength:
|
|
4748
|
-
n36_authenticationCodes:
|
|
4749
|
-
n37_disableSignUps:
|
|
4750
|
-
n38_otpIpAddress:
|
|
4751
|
-
n39_increaseUserAgentLength:
|
|
4752
|
-
n40_userId:
|
|
4753
|
-
n41_hooks:
|
|
4754
|
-
n42_userIdIndexes:
|
|
4755
|
-
n43_userIdIndexes:
|
|
4756
|
-
n44_codes:
|
|
4757
|
-
n45_hookProperties:
|
|
4758
|
-
n46_loginAuth0Client:
|
|
4759
|
-
n47_loginAuth0Client:
|
|
4760
|
-
n48_saml:
|
|
4761
|
-
n49_removeFields:
|
|
4762
|
-
n50_authParamsNonce:
|
|
4763
|
-
n51_connectionid:
|
|
4764
|
-
n52_cert:
|
|
4765
|
-
n53_codes_primary_key:
|
|
4766
|
-
n54_cleanup_tables:
|
|
4767
|
-
n55_logs_index:
|
|
4768
|
-
n56_application_fields:
|
|
4769
|
-
n57_prompt_settings:
|
|
4770
|
-
n58_connection_client_id:
|
|
4771
|
-
n59_connection_options:
|
|
4772
|
-
n60_users_metadata:
|
|
4773
|
-
n61_userLocales:
|
|
4774
|
-
n62_prompt:
|
|
4775
|
-
n63_connection_cleanup:
|
|
4776
|
-
n64_act_as:
|
|
4777
|
-
n65_code_verifier:
|
|
4778
|
-
n66_email_providers:
|
|
4779
|
-
n67_drop_tickets:
|
|
4780
|
-
n68_login_useragents:
|
|
4781
|
-
n70_refresh_tokens:
|
|
4782
|
-
n71_session_new_fields:
|
|
4783
|
-
n72_session_primary_key:
|
|
4784
|
-
n73_drop_sessions:
|
|
4785
|
-
n74_custom_domains:
|
|
4786
|
-
n75_organizations:
|
|
4787
|
-
n76_authorization_url_length:
|
|
4788
|
-
n77_drop_sessions:
|
|
4789
|
-
n78_login_sessions:
|
|
4790
|
-
n79_drop_sessions_2:
|
|
4791
|
-
n80_recreate_custom_domains:
|
|
4792
|
-
n81_phone:
|
|
4793
|
-
n82_forms:
|
|
4794
|
-
n83_addFormsIdToHooks:
|
|
4795
|
-
n84_login_completed:
|
|
4796
|
-
n85_add_login_session_id_to_sessions:
|
|
4797
|
-
n86_index_sessions_login_session_id:
|
|
4798
|
-
n87_code_challenge:
|
|
4799
|
-
n88_add_redirect_uri_to_codes:
|
|
4800
|
-
n89_add_nonce_and_state_to_codes:
|
|
4801
|
-
n90_themes:
|
|
4802
|
-
n91_resource_servers_rules_permissions:
|
|
4803
|
-
n92_role_permissions:
|
|
4804
|
-
n93_add_permissions_to_roles:
|
|
4805
|
-
n94_keys_connection_and_extend_columns:
|
|
4806
|
-
n95_create_organizations_table:
|
|
4929
|
+
down: Yl,
|
|
4930
|
+
up: Gl
|
|
4931
|
+
}, Symbol.toStringTag, { value: "Module" })), Ee = {
|
|
4932
|
+
m1_init: jr,
|
|
4933
|
+
m2_magicLink: Mr,
|
|
4934
|
+
m3_updateAt: Lr,
|
|
4935
|
+
m4_logTable: Ur,
|
|
4936
|
+
m5_userProfile: Qr,
|
|
4937
|
+
m6_sessions: Gr,
|
|
4938
|
+
m7_passwords: Xr,
|
|
4939
|
+
m8_logsTableNewFields: tn,
|
|
4940
|
+
m9_passwordTableNewField: nn,
|
|
4941
|
+
n01_codesTable: ln,
|
|
4942
|
+
n11_universalLoginSession: un,
|
|
4943
|
+
n12_userFields: hn,
|
|
4944
|
+
n13_userEmailIndex: gn,
|
|
4945
|
+
n14_profileDataField: vn,
|
|
4946
|
+
n15_userEmailIndex: bn,
|
|
4947
|
+
n16_userLocale: Sn,
|
|
4948
|
+
n17_signingKeys: $n,
|
|
4949
|
+
n18_logsFields: Pn,
|
|
4950
|
+
n19_connectionsUserinfo: Fn,
|
|
4951
|
+
n20_missingFields: Jn,
|
|
4952
|
+
n21_sessionDeletedAt: Rn,
|
|
4953
|
+
n22_dropLogsFields: qn,
|
|
4954
|
+
n23_dropUsersFields: Wn,
|
|
4955
|
+
n24_logsIndexes: Yn,
|
|
4956
|
+
n25_logDescMaxLength: Zn,
|
|
4957
|
+
n26_logsTableExtraFields: ao,
|
|
4958
|
+
n27_usersTableNameIndex: oo,
|
|
4959
|
+
n28_usersEmailConstrain: lo,
|
|
4960
|
+
n29_increaseOtpStateLength: mo,
|
|
4961
|
+
n30_increaseTicketStateLength: fo,
|
|
4962
|
+
n31_branding: wo,
|
|
4963
|
+
n32_indexesAndNotNull: No,
|
|
4964
|
+
n33_vendorIdInUniversalLoginSession: xo,
|
|
4965
|
+
n34_auth0ClientInUniversalLoginSession: Oo,
|
|
4966
|
+
n35_increaseUniversalSessionStateLength: Io,
|
|
4967
|
+
n36_authenticationCodes: zo,
|
|
4968
|
+
n37_disableSignUps: Ao,
|
|
4969
|
+
n38_otpIpAddress: Eo,
|
|
4970
|
+
n39_increaseUserAgentLength: Ko,
|
|
4971
|
+
n40_userId: Bo,
|
|
4972
|
+
n41_hooks: Vo,
|
|
4973
|
+
n42_userIdIndexes: Ho,
|
|
4974
|
+
n43_userIdIndexes: es,
|
|
4975
|
+
n44_codes: rs,
|
|
4976
|
+
n45_hookProperties: ss,
|
|
4977
|
+
n46_loginAuth0Client: cs,
|
|
4978
|
+
n47_loginAuth0Client: ms,
|
|
4979
|
+
n48_saml: fs,
|
|
4980
|
+
n49_removeFields: ws,
|
|
4981
|
+
n50_authParamsNonce: Ns,
|
|
4982
|
+
n51_connectionid: xs,
|
|
4983
|
+
n52_cert: Os,
|
|
4984
|
+
n53_codes_primary_key: Is,
|
|
4985
|
+
n54_cleanup_tables: zs,
|
|
4986
|
+
n55_logs_index: As,
|
|
4987
|
+
n56_application_fields: Es,
|
|
4988
|
+
n57_prompt_settings: Ks,
|
|
4989
|
+
n58_connection_client_id: Bs,
|
|
4990
|
+
n59_connection_options: Vs,
|
|
4991
|
+
n60_users_metadata: Hs,
|
|
4992
|
+
n61_userLocales: ei,
|
|
4993
|
+
n62_prompt: ri,
|
|
4994
|
+
n63_connection_cleanup: si,
|
|
4995
|
+
n64_act_as: ci,
|
|
4996
|
+
n65_code_verifier: mi,
|
|
4997
|
+
n66_email_providers: fi,
|
|
4998
|
+
n67_drop_tickets: wi,
|
|
4999
|
+
n68_login_useragents: Ni,
|
|
5000
|
+
n70_refresh_tokens: xi,
|
|
5001
|
+
n71_session_new_fields: Oi,
|
|
5002
|
+
n72_session_primary_key: Ii,
|
|
5003
|
+
n73_drop_sessions: zi,
|
|
5004
|
+
n74_custom_domains: Ai,
|
|
5005
|
+
n75_organizations: Ei,
|
|
5006
|
+
n76_authorization_url_length: Ki,
|
|
5007
|
+
n77_drop_sessions: Bi,
|
|
5008
|
+
n78_login_sessions: Vi,
|
|
5009
|
+
n79_drop_sessions_2: Hi,
|
|
5010
|
+
n80_recreate_custom_domains: el,
|
|
5011
|
+
n81_phone: rl,
|
|
5012
|
+
n82_forms: sl,
|
|
5013
|
+
n83_addFormsIdToHooks: cl,
|
|
5014
|
+
n84_login_completed: ml,
|
|
5015
|
+
n85_add_login_session_id_to_sessions: fl,
|
|
5016
|
+
n86_index_sessions_login_session_id: wl,
|
|
5017
|
+
n87_code_challenge: Nl,
|
|
5018
|
+
n88_add_redirect_uri_to_codes: xl,
|
|
5019
|
+
n89_add_nonce_and_state_to_codes: Ol,
|
|
5020
|
+
n90_themes: Il,
|
|
5021
|
+
n91_resource_servers_rules_permissions: zl,
|
|
5022
|
+
n92_role_permissions: Al,
|
|
5023
|
+
n93_add_permissions_to_roles: El,
|
|
5024
|
+
n94_keys_connection_and_extend_columns: Kl,
|
|
5025
|
+
n95_create_organizations_table: Bl,
|
|
5026
|
+
n96_create_user_organizations_table: Vl,
|
|
5027
|
+
n97_add_organization_to_user_permissions_and_roles: Hl
|
|
4807
5028
|
};
|
|
4808
|
-
async function
|
|
5029
|
+
async function ac(t, e = !1) {
|
|
4809
5030
|
e && console.log("migrating...");
|
|
4810
|
-
const a = new Je(
|
|
5031
|
+
const a = new Je(Ee), r = new be({
|
|
4811
5032
|
db: t,
|
|
4812
5033
|
provider: a
|
|
4813
5034
|
}), { error: n, results: o } = await r.migrateToLatest();
|
|
@@ -4818,9 +5039,9 @@ async function Rl(t, e = !1) {
|
|
|
4818
5039
|
}), n)
|
|
4819
5040
|
throw console.error("failed to migrate"), console.error(n), n;
|
|
4820
5041
|
}
|
|
4821
|
-
async function
|
|
5042
|
+
async function rc(t) {
|
|
4822
5043
|
console.log("migrating...");
|
|
4823
|
-
const e = new Je(
|
|
5044
|
+
const e = new Je(Ee), a = new be({
|
|
4824
5045
|
db: t,
|
|
4825
5046
|
provider: e
|
|
4826
5047
|
}), { error: r, results: n } = await a.migrateDown();
|
|
@@ -4829,19 +5050,19 @@ async function Kl(t) {
|
|
|
4829
5050
|
}), r)
|
|
4830
5051
|
throw console.error("failed to migrate"), console.error(r), r;
|
|
4831
5052
|
}
|
|
4832
|
-
function
|
|
5053
|
+
function nc(t) {
|
|
4833
5054
|
return {
|
|
4834
|
-
applications:
|
|
5055
|
+
applications: zt(t),
|
|
4835
5056
|
branding: ea(t),
|
|
4836
5057
|
cleanup: Ia(t),
|
|
4837
|
-
clients:
|
|
5058
|
+
clients: Lt(t),
|
|
4838
5059
|
codes: Ot(t),
|
|
4839
|
-
connections:
|
|
5060
|
+
connections: Et(t),
|
|
4840
5061
|
emailProviders: ba(t),
|
|
4841
|
-
customDomains:
|
|
4842
|
-
forms:
|
|
5062
|
+
customDomains: Ht(t),
|
|
5063
|
+
forms: Aa(t),
|
|
4843
5064
|
hooks: sa(t),
|
|
4844
|
-
keys:
|
|
5065
|
+
keys: qt(t),
|
|
4845
5066
|
loginSessions: pa(t),
|
|
4846
5067
|
logs: ut(t),
|
|
4847
5068
|
passwords: Nt(t),
|
|
@@ -4849,18 +5070,19 @@ function Ul(t) {
|
|
|
4849
5070
|
refreshTokens: $a(t),
|
|
4850
5071
|
resourceServers: Ka(t),
|
|
4851
5072
|
rolePermissions: Xa(t),
|
|
4852
|
-
userPermissions:
|
|
4853
|
-
userRoles:
|
|
4854
|
-
roles:
|
|
5073
|
+
userPermissions: rr(t),
|
|
5074
|
+
userRoles: lr(t),
|
|
5075
|
+
roles: Va(t),
|
|
4855
5076
|
sessions: gt(t),
|
|
4856
5077
|
tenants: st(t),
|
|
4857
5078
|
themes: ua(t),
|
|
4858
5079
|
users: Ze(t),
|
|
4859
|
-
organizations:
|
|
5080
|
+
organizations: hr(t),
|
|
5081
|
+
userOrganizations: Nr(t)
|
|
4860
5082
|
};
|
|
4861
5083
|
}
|
|
4862
5084
|
export {
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
5085
|
+
nc as default,
|
|
5086
|
+
rc as migrateDown,
|
|
5087
|
+
ac as migrateToLatest
|
|
4866
5088
|
};
|