@authhero/kysely-adapter 10.32.0 → 10.33.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 +83 -82
- package/dist/kysely-adapter.mjs +1181 -1168
- package/package.json +3 -3
package/dist/kysely-adapter.mjs
CHANGED
|
@@ -2,10 +2,10 @@ var Ee = Object.defineProperty;
|
|
|
2
2
|
var ue = (t) => {
|
|
3
3
|
throw TypeError(t);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var z = (t, e, a) =>
|
|
7
|
-
var d = (t, e, a) => (
|
|
8
|
-
import { parseUserId as ae, codeSchema as
|
|
5
|
+
var Ke = (t, e, a) => e in t ? Ee(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a;
|
|
6
|
+
var z = (t, e, a) => Ke(t, typeof e != "symbol" ? e + "" : e, a), Q = (t, e, a) => e.has(t) || ue("Cannot " + a);
|
|
7
|
+
var d = (t, e, a) => (Q(t, e, "read from private field"), a ? a.call(t) : e.get(t)), b = (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), L = (t, e, a, r) => (Q(t, e, "write to private field"), r ? r.call(t, a) : e.set(t, a), a), _ = (t, e, a) => (Q(t, e, "access private method"), a);
|
|
8
|
+
import { parseUserId as ae, codeSchema as Re, connectionSchema as Be, loginSessionSchema as Ue, promptSettingSchema as qe, formSchema as U, resourceServerSchema as Qe, permissionSchema as Ve } from "@authhero/adapter-interfaces";
|
|
9
9
|
import "@hono/zod-openapi";
|
|
10
10
|
var H = class extends Error {
|
|
11
11
|
constructor(e = 500, a) {
|
|
@@ -23,10 +23,10 @@ var H = class extends Error {
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
function
|
|
26
|
+
function We(t) {
|
|
27
27
|
return async (e, a) => {
|
|
28
|
-
const { identities: r, ...
|
|
29
|
-
...
|
|
28
|
+
const { identities: r, ...n } = a, o = {
|
|
29
|
+
...n,
|
|
30
30
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
31
31
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
32
32
|
login_count: 0,
|
|
@@ -37,16 +37,16 @@ function Ge(t) {
|
|
|
37
37
|
user_metadata: JSON.stringify(a.user_metadata)
|
|
38
38
|
};
|
|
39
39
|
try {
|
|
40
|
-
await t.insertInto("users").values(
|
|
40
|
+
await t.insertInto("users").values(o).execute();
|
|
41
41
|
} catch (s) {
|
|
42
42
|
throw s.code === "SQLITE_CONSTRAINT_UNIQUE" || s.message.includes("AlreadyExists") ? new H(409, { message: "User already exists" }) : new H(500, { message: `${s.code}, ${s.message}` });
|
|
43
43
|
}
|
|
44
44
|
return {
|
|
45
|
-
...
|
|
45
|
+
...o,
|
|
46
46
|
// TODO: check if this is correct. Should it be optional?
|
|
47
|
-
email:
|
|
48
|
-
email_verified:
|
|
49
|
-
is_social:
|
|
47
|
+
email: o.email || "",
|
|
48
|
+
email_verified: o.email_verified === 1,
|
|
49
|
+
is_social: o.is_social === 1
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
52
|
}
|
|
@@ -75,15 +75,15 @@ function pe(t) {
|
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function Ge(t) {
|
|
79
79
|
return async (e, a) => {
|
|
80
|
-
const [r,
|
|
80
|
+
const [r, n] = await Promise.all([
|
|
81
81
|
t.selectFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", a).selectAll().executeTakeFirst(),
|
|
82
82
|
t.selectFrom("users").where("users.tenant_id", "=", e).where("users.linked_to", "=", a).selectAll().execute()
|
|
83
83
|
]);
|
|
84
84
|
if (!r)
|
|
85
85
|
return null;
|
|
86
|
-
const { tenant_id:
|
|
86
|
+
const { tenant_id: o, ...s } = r, c = {
|
|
87
87
|
...s,
|
|
88
88
|
email: r.email || "",
|
|
89
89
|
email_verified: r.email_verified === 1,
|
|
@@ -97,53 +97,53 @@ function He(t) {
|
|
|
97
97
|
user_id: ae(r.user_id).id,
|
|
98
98
|
isSocial: !!r.is_social
|
|
99
99
|
},
|
|
100
|
-
...
|
|
100
|
+
...n.map(pe)
|
|
101
101
|
]
|
|
102
102
|
};
|
|
103
|
-
return p(
|
|
103
|
+
return p(c);
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
function N(t, e, a, r) {
|
|
107
|
-
return a.split(/\s+/).map((
|
|
108
|
-
let s =
|
|
109
|
-
if (
|
|
110
|
-
|
|
111
|
-
else if (
|
|
112
|
-
|
|
113
|
-
else if (
|
|
114
|
-
const h = s ?
|
|
115
|
-
|
|
107
|
+
return a.split(/\s+/).map((o) => o.replace(/^([^:]+)=/g, "$1:")).map((o) => {
|
|
108
|
+
let s = o.startsWith("-"), c = null, i = "", m = !1, u;
|
|
109
|
+
if (o.startsWith("-_exists_:"))
|
|
110
|
+
c = o.substring(10), m = !0, s = !0;
|
|
111
|
+
else if (o.startsWith("_exists_:"))
|
|
112
|
+
c = o.substring(9), m = !0, s = !1;
|
|
113
|
+
else if (o.includes(":")) {
|
|
114
|
+
const h = s ? o.substring(1) : o, g = h.indexOf(":");
|
|
115
|
+
c = h.substring(0, g), i = h.substring(g + 1), m = !1, i.startsWith(">=") ? (u = ">=", i = i.substring(2)) : i.startsWith(">") ? (u = ">", i = i.substring(1)) : i.startsWith("<=") ? (u = "<=", i = i.substring(2)) : i.startsWith("<") ? (u = "<", i = i.substring(1)) : u = "=";
|
|
116
116
|
} else
|
|
117
|
-
|
|
118
|
-
return { key:
|
|
119
|
-
}).forEach(({ key:
|
|
120
|
-
if (
|
|
117
|
+
c = null, i = o, m = !1;
|
|
118
|
+
return { key: c, value: i, isNegation: s, isExistsQuery: m, operator: u };
|
|
119
|
+
}).forEach(({ key: o, value: s, isNegation: c, isExistsQuery: i, operator: m }) => {
|
|
120
|
+
if (o)
|
|
121
121
|
if (i)
|
|
122
|
-
|
|
123
|
-
else if (
|
|
122
|
+
c ? e = e.where(o, "is", null) : e = e.where(o, "is not", null);
|
|
123
|
+
else if (c)
|
|
124
124
|
switch (m) {
|
|
125
125
|
case ">":
|
|
126
|
-
e = e.where(
|
|
126
|
+
e = e.where(o, "<=", s);
|
|
127
127
|
break;
|
|
128
128
|
case ">=":
|
|
129
|
-
e = e.where(
|
|
129
|
+
e = e.where(o, "<", s);
|
|
130
130
|
break;
|
|
131
131
|
case "<":
|
|
132
|
-
e = e.where(
|
|
132
|
+
e = e.where(o, ">=", s);
|
|
133
133
|
break;
|
|
134
134
|
case "<=":
|
|
135
|
-
e = e.where(
|
|
135
|
+
e = e.where(o, ">", s);
|
|
136
136
|
break;
|
|
137
137
|
default:
|
|
138
|
-
e = e.where(
|
|
138
|
+
e = e.where(o, "!=", s);
|
|
139
139
|
}
|
|
140
140
|
else
|
|
141
|
-
e = e.where(
|
|
141
|
+
e = e.where(o, m, s);
|
|
142
142
|
else if (s) {
|
|
143
143
|
const { ref: u } = t.dynamic;
|
|
144
144
|
e = e.where(
|
|
145
145
|
(h) => h.or(
|
|
146
|
-
r.map((
|
|
146
|
+
r.map((g) => h(u(g), "like", `%${s}%`))
|
|
147
147
|
)
|
|
148
148
|
);
|
|
149
149
|
}
|
|
@@ -152,7 +152,7 @@ function N(t, e, a, r) {
|
|
|
152
152
|
function v(t) {
|
|
153
153
|
return typeof t == "string" ? parseInt(t, 10) : typeof t == "bigint" ? Number(t) : t;
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function He(t) {
|
|
156
156
|
return async (e, a = {
|
|
157
157
|
page: 0,
|
|
158
158
|
per_page: 50,
|
|
@@ -163,9 +163,9 @@ function Xe(t) {
|
|
|
163
163
|
const { ref: u } = t.dynamic;
|
|
164
164
|
r = r.orderBy(u(a.sort.sort_by), a.sort.sort_order);
|
|
165
165
|
}
|
|
166
|
-
const
|
|
167
|
-
const h =
|
|
168
|
-
(
|
|
166
|
+
const o = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), s = o.map((u) => u.user_id), c = s.length ? await t.selectFrom("users").selectAll().where("users.tenant_id", "=", e).where("users.linked_to", "in", s).execute() : [], i = o.map((u) => {
|
|
167
|
+
const h = c.filter(
|
|
168
|
+
(g) => g.linked_to === u.user_id
|
|
169
169
|
);
|
|
170
170
|
return p({
|
|
171
171
|
...u,
|
|
@@ -192,71 +192,71 @@ function Xe(t) {
|
|
|
192
192
|
};
|
|
193
193
|
};
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function Xe(t) {
|
|
196
196
|
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);
|
|
197
197
|
}
|
|
198
198
|
function A(t, e = "", a = {}) {
|
|
199
199
|
for (let r in t)
|
|
200
200
|
if (Object.prototype.hasOwnProperty.call(t, r)) {
|
|
201
|
-
const
|
|
202
|
-
typeof
|
|
201
|
+
const n = e ? `${e}_${r}` : r, o = t[r];
|
|
202
|
+
typeof o == "object" && o !== null && !Array.isArray(o) ? A(o, n, a) : typeof o == "boolean" ? a[n] = o ? 1 : 0 : a[n] = o;
|
|
203
203
|
}
|
|
204
204
|
return a;
|
|
205
205
|
}
|
|
206
206
|
function ge(t, e) {
|
|
207
207
|
const a = {};
|
|
208
|
-
for (const [r,
|
|
209
|
-
const
|
|
208
|
+
for (const [r, n] of Object.entries(t)) {
|
|
209
|
+
const o = e.find(
|
|
210
210
|
(s) => r.startsWith(`${s}_`)
|
|
211
211
|
);
|
|
212
|
-
if (!
|
|
213
|
-
a[r] =
|
|
212
|
+
if (!o)
|
|
213
|
+
a[r] = n;
|
|
214
214
|
else {
|
|
215
|
-
const s = r.slice(
|
|
216
|
-
a[
|
|
217
|
-
...a[
|
|
218
|
-
[s]:
|
|
215
|
+
const s = r.slice(o.length + 1);
|
|
216
|
+
a[o] = {
|
|
217
|
+
...a[o],
|
|
218
|
+
[s]: n
|
|
219
219
|
};
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
return a;
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function Ye(t) {
|
|
225
225
|
return async (e, a, r) => {
|
|
226
|
-
const
|
|
226
|
+
const n = A({
|
|
227
227
|
...r,
|
|
228
228
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
229
229
|
app_metadata: r.app_metadata ? JSON.stringify(r.app_metadata) : void 0,
|
|
230
230
|
user_metadata: r.user_metadata ? JSON.stringify(r.user_metadata) : void 0
|
|
231
231
|
});
|
|
232
|
-
return (await t.updateTable("users").set(
|
|
232
|
+
return (await t.updateTable("users").set(n).where("users.tenant_id", "=", e).where("users.user_id", "=", a).execute()).length === 1;
|
|
233
233
|
};
|
|
234
234
|
}
|
|
235
|
-
function
|
|
236
|
-
return async (e, a, r,
|
|
237
|
-
const
|
|
238
|
-
return (await t.updateTable("users").set(
|
|
235
|
+
function Ze(t) {
|
|
236
|
+
return async (e, a, r, n) => {
|
|
237
|
+
const o = { linked_to: null };
|
|
238
|
+
return (await t.updateTable("users").set(o).where("users.tenant_id", "=", e).where("users.user_id", "=", `${r}|${n}`).where("users.linked_to", "=", `${a}`).execute()).length === 1;
|
|
239
239
|
};
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function et(t) {
|
|
242
242
|
return {
|
|
243
|
-
create:
|
|
244
|
-
remove:
|
|
245
|
-
get:
|
|
246
|
-
list:
|
|
247
|
-
update:
|
|
243
|
+
create: We(t),
|
|
244
|
+
remove: Xe(t),
|
|
245
|
+
get: Ge(t),
|
|
246
|
+
list: He(t),
|
|
247
|
+
update: Ye(t),
|
|
248
248
|
// TODO - think about this more when other issues fixed
|
|
249
|
-
unlink:
|
|
249
|
+
unlink: Ze(t)
|
|
250
250
|
};
|
|
251
251
|
}
|
|
252
|
-
const
|
|
252
|
+
const tt = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
253
253
|
let C = (t = 21) => {
|
|
254
254
|
let e = "", a = crypto.getRandomValues(new Uint8Array(t));
|
|
255
255
|
for (; t--; )
|
|
256
|
-
e +=
|
|
256
|
+
e += tt[a[t] & 63];
|
|
257
257
|
return e;
|
|
258
258
|
};
|
|
259
|
-
function
|
|
259
|
+
function at(t) {
|
|
260
260
|
return async (e) => {
|
|
261
261
|
const a = {
|
|
262
262
|
id: e.id || C(),
|
|
@@ -267,13 +267,13 @@ function rt(t) {
|
|
|
267
267
|
return await t.insertInto("tenants").values(a).execute(), a;
|
|
268
268
|
};
|
|
269
269
|
}
|
|
270
|
-
function
|
|
270
|
+
function rt(t) {
|
|
271
271
|
return async (e) => {
|
|
272
272
|
const a = await t.selectFrom("tenants").where("tenants.id", "=", e).selectAll().executeTakeFirst();
|
|
273
273
|
return a ? p(a) : null;
|
|
274
274
|
};
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function nt(t) {
|
|
277
277
|
return async (e = {
|
|
278
278
|
page: 0,
|
|
279
279
|
per_page: 50,
|
|
@@ -281,25 +281,25 @@ function ot(t) {
|
|
|
281
281
|
}) => {
|
|
282
282
|
let a = t.selectFrom("tenants");
|
|
283
283
|
if (e.sort && e.sort.sort_by) {
|
|
284
|
-
const { ref:
|
|
285
|
-
a = a.orderBy(
|
|
284
|
+
const { ref: c } = t.dynamic;
|
|
285
|
+
a = a.orderBy(c(e.sort.sort_by), e.sort.sort_order);
|
|
286
286
|
}
|
|
287
|
-
e.q && (a = a.where((
|
|
288
|
-
const
|
|
287
|
+
e.q && (a = a.where((c) => c.or([c("name", "like", `%${e.q}%`)])));
|
|
288
|
+
const n = await a.offset(e.page * e.per_page).limit(e.per_page).selectAll().execute();
|
|
289
289
|
if (!e.include_totals)
|
|
290
290
|
return {
|
|
291
|
-
tenants:
|
|
291
|
+
tenants: n
|
|
292
292
|
};
|
|
293
|
-
const { count:
|
|
293
|
+
const { count: o } = await a.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), s = v(o);
|
|
294
294
|
return {
|
|
295
|
-
tenants:
|
|
295
|
+
tenants: n.map(p),
|
|
296
296
|
start: (e.page - 1) * e.per_page,
|
|
297
297
|
limit: e.per_page,
|
|
298
298
|
length: s
|
|
299
299
|
};
|
|
300
300
|
};
|
|
301
301
|
}
|
|
302
|
-
function
|
|
302
|
+
function ot(t) {
|
|
303
303
|
return async (e, a) => {
|
|
304
304
|
const r = {
|
|
305
305
|
...a,
|
|
@@ -309,37 +309,37 @@ function st(t) {
|
|
|
309
309
|
await t.updateTable("tenants").set(r).where("id", "=", e).execute();
|
|
310
310
|
};
|
|
311
311
|
}
|
|
312
|
-
function
|
|
312
|
+
function st(t) {
|
|
313
313
|
return async (e) => (await t.deleteFrom("tenants").where("tenants.id", "=", e).execute()).length === 1;
|
|
314
314
|
}
|
|
315
|
-
function
|
|
315
|
+
function it(t) {
|
|
316
316
|
return {
|
|
317
|
-
create:
|
|
318
|
-
get:
|
|
319
|
-
list:
|
|
320
|
-
update:
|
|
321
|
-
remove:
|
|
317
|
+
create: at(t),
|
|
318
|
+
get: rt(t),
|
|
319
|
+
list: nt(t),
|
|
320
|
+
update: ot(t),
|
|
321
|
+
remove: st(t)
|
|
322
322
|
};
|
|
323
323
|
}
|
|
324
324
|
function me(t) {
|
|
325
325
|
return t ? JSON.stringify(t) : void 0;
|
|
326
326
|
}
|
|
327
|
-
const
|
|
328
|
-
function
|
|
327
|
+
const lt = 1024;
|
|
328
|
+
function ct(t) {
|
|
329
329
|
return async (e, a) => {
|
|
330
|
-
var
|
|
330
|
+
var n, o, s;
|
|
331
331
|
const r = {
|
|
332
332
|
id: C(),
|
|
333
333
|
...a,
|
|
334
|
-
user_agent: a.user_agent.slice(0,
|
|
334
|
+
user_agent: a.user_agent.slice(0, lt)
|
|
335
335
|
};
|
|
336
336
|
return await t.insertInto("logs").values({
|
|
337
337
|
...r,
|
|
338
338
|
// Truncate long strings to avoid database errors
|
|
339
|
-
description: (
|
|
339
|
+
description: (n = r.description) == null ? void 0 : n.substring(0, 256),
|
|
340
340
|
isMobile: a.isMobile ? 1 : 0,
|
|
341
341
|
tenant_id: e,
|
|
342
|
-
scope: (
|
|
342
|
+
scope: (o = a.scope) == null ? void 0 : o.join(","),
|
|
343
343
|
auth0_client: me(a.auth0_client),
|
|
344
344
|
details: (s = me(a.details)) == null ? void 0 : s.substring(0, 8192)
|
|
345
345
|
}).execute(), r;
|
|
@@ -367,7 +367,7 @@ function we(t) {
|
|
|
367
367
|
_id: t.id
|
|
368
368
|
};
|
|
369
369
|
}
|
|
370
|
-
function
|
|
370
|
+
function dt(t) {
|
|
371
371
|
return async (e, a = {
|
|
372
372
|
page: 0,
|
|
373
373
|
per_page: 50,
|
|
@@ -375,51 +375,51 @@ function ut(t) {
|
|
|
375
375
|
}) => {
|
|
376
376
|
let r = t.selectFrom("logs").where("logs.tenant_id", "=", e);
|
|
377
377
|
a.q && (r = N(t, r, a.q, ["user_id", "ip"]));
|
|
378
|
-
let
|
|
378
|
+
let n = r;
|
|
379
379
|
if (a.sort && a.sort.sort_by) {
|
|
380
|
-
const { ref:
|
|
381
|
-
|
|
382
|
-
|
|
380
|
+
const { ref: c } = t.dynamic;
|
|
381
|
+
n = n.orderBy(
|
|
382
|
+
c(a.sort.sort_by),
|
|
383
383
|
a.sort.sort_order
|
|
384
384
|
);
|
|
385
385
|
}
|
|
386
|
-
|
|
387
|
-
const
|
|
386
|
+
n = n.offset(a.page * a.per_page).limit(a.per_page);
|
|
387
|
+
const o = await n.selectAll().execute(), { count: s } = await r.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
388
388
|
return {
|
|
389
|
-
logs:
|
|
389
|
+
logs: o.map(we),
|
|
390
390
|
start: a.page * a.per_page,
|
|
391
391
|
limit: a.per_page,
|
|
392
392
|
length: v(s)
|
|
393
393
|
};
|
|
394
394
|
};
|
|
395
395
|
}
|
|
396
|
-
function
|
|
396
|
+
function ut(t) {
|
|
397
397
|
return async (e, a) => {
|
|
398
398
|
const r = await t.selectFrom("logs").where("logs.tenant_id", "=", e).where("logs.id", "=", a).selectAll().executeTakeFirst();
|
|
399
399
|
return r ? we(r) : null;
|
|
400
400
|
};
|
|
401
401
|
}
|
|
402
|
-
function
|
|
402
|
+
function mt(t) {
|
|
403
403
|
return {
|
|
404
|
-
create:
|
|
405
|
-
list:
|
|
406
|
-
get:
|
|
404
|
+
create: ct(t),
|
|
405
|
+
list: dt(t),
|
|
406
|
+
get: ut(t)
|
|
407
407
|
};
|
|
408
408
|
}
|
|
409
|
-
function
|
|
409
|
+
function _t(t) {
|
|
410
410
|
return async (e, a) => {
|
|
411
411
|
const r = await t.selectFrom("sessions").where("sessions.tenant_id", "=", e).where("sessions.id", "=", a).selectAll().executeTakeFirst();
|
|
412
412
|
if (!r)
|
|
413
413
|
return null;
|
|
414
|
-
const { tenant_id:
|
|
414
|
+
const { tenant_id: n, device: o, clients: s, ...c } = r;
|
|
415
415
|
return {
|
|
416
|
-
...
|
|
417
|
-
device: JSON.parse(
|
|
416
|
+
...c,
|
|
417
|
+
device: JSON.parse(o),
|
|
418
418
|
clients: JSON.parse(s)
|
|
419
419
|
};
|
|
420
420
|
};
|
|
421
421
|
}
|
|
422
|
-
function
|
|
422
|
+
function ht(t) {
|
|
423
423
|
return async (e, a) => {
|
|
424
424
|
const r = {
|
|
425
425
|
...a,
|
|
@@ -436,21 +436,21 @@ function ft(t) {
|
|
|
436
436
|
}).execute(), r;
|
|
437
437
|
};
|
|
438
438
|
}
|
|
439
|
-
function
|
|
439
|
+
function ft(t) {
|
|
440
440
|
return async (e, a) => !!(await t.deleteFrom("sessions").where("tenant_id", "=", e).where("sessions.id", "=", a).execute()).length;
|
|
441
441
|
}
|
|
442
|
-
function
|
|
442
|
+
function pt(t) {
|
|
443
443
|
return async (e, a, r) => {
|
|
444
|
-
const
|
|
444
|
+
const n = {
|
|
445
445
|
...r,
|
|
446
446
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
447
447
|
device: r.device ? JSON.stringify(r.device) : void 0,
|
|
448
448
|
clients: r.clients ? JSON.stringify(r.clients) : void 0
|
|
449
449
|
};
|
|
450
|
-
return !!(await t.updateTable("sessions").set(
|
|
450
|
+
return !!(await t.updateTable("sessions").set(n).where("tenant_id", "=", e).where("sessions.id", "=", a).execute()).length;
|
|
451
451
|
};
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function gt(t) {
|
|
454
454
|
return async (e, a = {
|
|
455
455
|
page: 0,
|
|
456
456
|
per_page: 50,
|
|
@@ -458,47 +458,47 @@ function wt(t) {
|
|
|
458
458
|
}) => {
|
|
459
459
|
let r = t.selectFrom("sessions").where("sessions.tenant_id", "=", e);
|
|
460
460
|
a.q && (r = N(t, r, a.q, ["user_id", "session_id"]));
|
|
461
|
-
let
|
|
461
|
+
let n = r;
|
|
462
462
|
if (a.sort && a.sort.sort_by) {
|
|
463
463
|
const { ref: i } = t.dynamic;
|
|
464
|
-
|
|
464
|
+
n = n.orderBy(
|
|
465
465
|
i(a.sort.sort_by),
|
|
466
466
|
a.sort.sort_order
|
|
467
467
|
);
|
|
468
468
|
}
|
|
469
|
-
|
|
470
|
-
const
|
|
469
|
+
n = n.offset(a.page * a.per_page).limit(a.per_page);
|
|
470
|
+
const o = await n.selectAll().execute(), { count: s } = await r.select((i) => i.fn.countAll().as("count")).executeTakeFirstOrThrow(), c = v(s);
|
|
471
471
|
return {
|
|
472
|
-
sessions:
|
|
472
|
+
sessions: o.map((i) => ({
|
|
473
473
|
...i,
|
|
474
474
|
device: JSON.parse(i.device),
|
|
475
475
|
clients: JSON.parse(i.clients)
|
|
476
476
|
})),
|
|
477
477
|
start: a.page * a.per_page,
|
|
478
478
|
limit: a.per_page,
|
|
479
|
-
length:
|
|
479
|
+
length: c
|
|
480
480
|
};
|
|
481
481
|
};
|
|
482
482
|
}
|
|
483
|
-
function
|
|
483
|
+
function wt(t) {
|
|
484
484
|
return {
|
|
485
|
-
create:
|
|
486
|
-
get:
|
|
487
|
-
list:
|
|
488
|
-
remove:
|
|
489
|
-
update:
|
|
485
|
+
create: ht(t),
|
|
486
|
+
get: _t(t),
|
|
487
|
+
list: gt(t),
|
|
488
|
+
remove: ft(t),
|
|
489
|
+
update: pt(t)
|
|
490
490
|
};
|
|
491
491
|
}
|
|
492
|
-
function
|
|
492
|
+
function yt(t) {
|
|
493
493
|
return async (e, a) => {
|
|
494
494
|
const r = await t.selectFrom("passwords").where("passwords.tenant_id", "=", e).where("passwords.user_id", "=", a).selectAll().executeTakeFirst();
|
|
495
495
|
if (!r)
|
|
496
496
|
return null;
|
|
497
|
-
const { tenant_id:
|
|
498
|
-
return
|
|
497
|
+
const { tenant_id: n, ...o } = r;
|
|
498
|
+
return o;
|
|
499
499
|
};
|
|
500
500
|
}
|
|
501
|
-
function
|
|
501
|
+
function vt(t) {
|
|
502
502
|
return async (e, a) => {
|
|
503
503
|
const r = {
|
|
504
504
|
...a,
|
|
@@ -511,20 +511,20 @@ function Nt(t) {
|
|
|
511
511
|
}).execute(), r;
|
|
512
512
|
};
|
|
513
513
|
}
|
|
514
|
-
function
|
|
514
|
+
function Nt(t) {
|
|
515
515
|
return async (e, a) => (await t.updateTable("passwords").set({
|
|
516
516
|
password: a.password,
|
|
517
517
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
518
518
|
}).where("tenant_id", "=", e).where("user_id", "=", a.user_id).execute()).length === 1;
|
|
519
519
|
}
|
|
520
|
-
function
|
|
520
|
+
function Ct(t) {
|
|
521
521
|
return {
|
|
522
|
-
create:
|
|
523
|
-
update:
|
|
524
|
-
get:
|
|
522
|
+
create: vt(t),
|
|
523
|
+
update: Nt(t),
|
|
524
|
+
get: yt(t)
|
|
525
525
|
};
|
|
526
526
|
}
|
|
527
|
-
function
|
|
527
|
+
function bt(t) {
|
|
528
528
|
return async (e, a = {
|
|
529
529
|
page: 0,
|
|
530
530
|
per_page: 50,
|
|
@@ -532,11 +532,11 @@ function xt(t) {
|
|
|
532
532
|
}) => {
|
|
533
533
|
let r = t.selectFrom("codes").where("codes.tenant_id", "=", e);
|
|
534
534
|
a.q && (r = N(t, r, a.q, ["code", "login_id"]));
|
|
535
|
-
const
|
|
535
|
+
const o = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), { count: s } = await r.select((i) => i.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
536
536
|
return {
|
|
537
|
-
codes:
|
|
537
|
+
codes: o.map((i) => {
|
|
538
538
|
const { tenant_id: m, ...u } = i;
|
|
539
|
-
return
|
|
539
|
+
return Re.parse(p(u));
|
|
540
540
|
}),
|
|
541
541
|
start: a.page * a.per_page,
|
|
542
542
|
limit: a.per_page,
|
|
@@ -544,7 +544,7 @@ function xt(t) {
|
|
|
544
544
|
};
|
|
545
545
|
};
|
|
546
546
|
}
|
|
547
|
-
function
|
|
547
|
+
function xt(t) {
|
|
548
548
|
return async (e, a) => {
|
|
549
549
|
const r = {
|
|
550
550
|
...a,
|
|
@@ -556,65 +556,65 @@ function Tt(t) {
|
|
|
556
556
|
}).execute(), r;
|
|
557
557
|
};
|
|
558
558
|
}
|
|
559
|
-
function
|
|
559
|
+
function Tt(t) {
|
|
560
560
|
return async (e, a) => (await t.deleteFrom("codes").where("codes.tenant_id", "=", e).where("codes.code_id", "=", a).executeTakeFirst()).numDeletedRows > 0;
|
|
561
561
|
}
|
|
562
|
-
function
|
|
562
|
+
function St(t) {
|
|
563
563
|
return async (e, a, r) => {
|
|
564
|
-
let
|
|
565
|
-
e.length && (
|
|
566
|
-
const
|
|
567
|
-
return
|
|
564
|
+
let n = t.selectFrom("codes").where("codes.code_id", "=", a).where("codes.code_type", "=", r);
|
|
565
|
+
e.length && (n = n.where("codes.tenant_id", "=", e));
|
|
566
|
+
const o = await n.selectAll().executeTakeFirst();
|
|
567
|
+
return o ? p(o) : null;
|
|
568
568
|
};
|
|
569
569
|
}
|
|
570
|
-
function
|
|
570
|
+
function Ot(t) {
|
|
571
571
|
return async (e, a) => (await t.updateTable("codes").set({ used_at: (/* @__PURE__ */ new Date()).toISOString() }).where("codes.tenant_id", "=", e).where("codes.code_id", "=", a).executeTakeFirst()).numUpdatedRows > 0;
|
|
572
572
|
}
|
|
573
|
-
function
|
|
573
|
+
function kt(t) {
|
|
574
574
|
return {
|
|
575
|
-
create:
|
|
576
|
-
list:
|
|
577
|
-
remove:
|
|
578
|
-
used:
|
|
579
|
-
get:
|
|
575
|
+
create: xt(t),
|
|
576
|
+
list: bt(t),
|
|
577
|
+
remove: Tt(t),
|
|
578
|
+
used: Ot(t),
|
|
579
|
+
get: St(t)
|
|
580
580
|
};
|
|
581
581
|
}
|
|
582
|
-
function
|
|
582
|
+
function $t(t) {
|
|
583
583
|
return async (e, a) => {
|
|
584
584
|
const r = {
|
|
585
585
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
586
586
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
587
587
|
...a,
|
|
588
588
|
disable_sign_ups: a.disable_sign_ups ?? !1
|
|
589
|
-
},
|
|
589
|
+
}, n = JSON.stringify(a.allowed_origins), o = JSON.stringify(a.callbacks), s = JSON.stringify(a.web_origins), c = JSON.stringify(a.allowed_logout_urls), i = JSON.stringify(a.allowed_clients);
|
|
590
590
|
return await t.insertInto("applications").values({
|
|
591
591
|
...r,
|
|
592
592
|
tenant_id: e,
|
|
593
593
|
disable_sign_ups: a.disable_sign_ups ? 1 : 0,
|
|
594
594
|
addons: a.addons ? JSON.stringify(a.addons) : "{}",
|
|
595
|
-
callbacks:
|
|
596
|
-
allowed_origins:
|
|
595
|
+
callbacks: o,
|
|
596
|
+
allowed_origins: n,
|
|
597
597
|
web_origins: s,
|
|
598
|
-
allowed_logout_urls:
|
|
598
|
+
allowed_logout_urls: c,
|
|
599
599
|
allowed_clients: i
|
|
600
600
|
}).execute(), r;
|
|
601
601
|
};
|
|
602
602
|
}
|
|
603
|
-
function
|
|
603
|
+
function Dt(t) {
|
|
604
604
|
return async (e) => ({
|
|
605
|
-
applications: (await t.selectFrom("applications").where("applications.tenant_id", "=", e).selectAll().execute()).map((
|
|
606
|
-
...
|
|
607
|
-
disable_sign_ups: !!
|
|
608
|
-
addons:
|
|
609
|
-
callbacks:
|
|
610
|
-
allowed_origins:
|
|
611
|
-
web_origins:
|
|
612
|
-
allowed_logout_urls:
|
|
613
|
-
allowed_clients:
|
|
605
|
+
applications: (await t.selectFrom("applications").where("applications.tenant_id", "=", e).selectAll().execute()).map((o) => ({
|
|
606
|
+
...o,
|
|
607
|
+
disable_sign_ups: !!o.disable_sign_ups,
|
|
608
|
+
addons: o.addons ? JSON.parse(o.addons) : {},
|
|
609
|
+
callbacks: o.callbacks ? JSON.parse(o.callbacks) : [],
|
|
610
|
+
allowed_origins: o.allowed_origins ? JSON.parse(o.allowed_origins) : [],
|
|
611
|
+
web_origins: o.web_origins ? JSON.parse(o.web_origins) : [],
|
|
612
|
+
allowed_logout_urls: o.allowed_logout_urls ? JSON.parse(o.allowed_logout_urls) : [],
|
|
613
|
+
allowed_clients: o.allowed_logout_urls ? JSON.parse(o.allowed_logout_urls) : []
|
|
614
614
|
}))
|
|
615
615
|
});
|
|
616
616
|
}
|
|
617
|
-
function
|
|
617
|
+
function It(t) {
|
|
618
618
|
return async (e, a) => {
|
|
619
619
|
const r = await t.selectFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", a).selectAll().executeTakeFirst();
|
|
620
620
|
return r ? p({
|
|
@@ -628,12 +628,12 @@ function jt(t) {
|
|
|
628
628
|
}) : null;
|
|
629
629
|
};
|
|
630
630
|
}
|
|
631
|
-
function
|
|
631
|
+
function jt(t) {
|
|
632
632
|
return async (e, a) => (await t.deleteFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", a).executeTakeFirst()).numDeletedRows > 0;
|
|
633
633
|
}
|
|
634
|
-
function
|
|
634
|
+
function Pt(t) {
|
|
635
635
|
return async (e, a, r) => {
|
|
636
|
-
const
|
|
636
|
+
const n = {
|
|
637
637
|
...r,
|
|
638
638
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
639
639
|
allowed_origins: r.allowed_origins ? JSON.stringify(r.allowed_origins) : void 0,
|
|
@@ -644,19 +644,19 @@ function Ft(t) {
|
|
|
644
644
|
addons: r.addons ? JSON.stringify(r.addons) : "{}",
|
|
645
645
|
disable_sign_ups: r.disable_sign_ups ? 1 : 0
|
|
646
646
|
};
|
|
647
|
-
return await t.updateTable("applications").set(
|
|
647
|
+
return await t.updateTable("applications").set(n).where("applications.id", "=", a).where("applications.tenant_id", "=", e).execute(), !0;
|
|
648
648
|
};
|
|
649
649
|
}
|
|
650
|
-
function
|
|
650
|
+
function Ft(t) {
|
|
651
651
|
return {
|
|
652
|
-
create:
|
|
653
|
-
list:
|
|
654
|
-
get:
|
|
655
|
-
remove:
|
|
656
|
-
update:
|
|
652
|
+
create: $t(t),
|
|
653
|
+
list: Dt(t),
|
|
654
|
+
get: It(t),
|
|
655
|
+
remove: jt(t),
|
|
656
|
+
update: Pt(t)
|
|
657
657
|
};
|
|
658
658
|
}
|
|
659
|
-
function
|
|
659
|
+
function Mt(t) {
|
|
660
660
|
return async (e, a) => {
|
|
661
661
|
const r = {
|
|
662
662
|
id: C(),
|
|
@@ -672,7 +672,7 @@ function At(t) {
|
|
|
672
672
|
}).execute(), r;
|
|
673
673
|
};
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function At(t) {
|
|
676
676
|
return async (e, a = {
|
|
677
677
|
page: 0,
|
|
678
678
|
per_page: 50,
|
|
@@ -685,19 +685,19 @@ function zt(t) {
|
|
|
685
685
|
...i,
|
|
686
686
|
options: JSON.parse(i.options)
|
|
687
687
|
})
|
|
688
|
-
), { count:
|
|
688
|
+
), { count: c } = await r.select((i) => i.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
689
689
|
return {
|
|
690
690
|
connections: s,
|
|
691
691
|
start: a.page * a.per_page,
|
|
692
692
|
limit: a.per_page,
|
|
693
|
-
length: v(
|
|
693
|
+
length: v(c)
|
|
694
694
|
};
|
|
695
695
|
};
|
|
696
696
|
}
|
|
697
|
-
function
|
|
697
|
+
function zt(t) {
|
|
698
698
|
return async (e, a) => (await t.deleteFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", a).executeTakeFirst()).numDeletedRows > 0;
|
|
699
699
|
}
|
|
700
|
-
function
|
|
700
|
+
function Lt(t) {
|
|
701
701
|
return async (e, a) => {
|
|
702
702
|
const r = await t.selectFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", a).selectAll().executeTakeFirst();
|
|
703
703
|
return r ? p({
|
|
@@ -706,25 +706,25 @@ function Jt(t) {
|
|
|
706
706
|
}) : null;
|
|
707
707
|
};
|
|
708
708
|
}
|
|
709
|
-
function
|
|
709
|
+
function Jt(t) {
|
|
710
710
|
return async (e, a, r) => {
|
|
711
|
-
const
|
|
711
|
+
const n = {
|
|
712
712
|
...r,
|
|
713
713
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
714
714
|
};
|
|
715
715
|
return await t.updateTable("connections").set({
|
|
716
|
-
...
|
|
717
|
-
options:
|
|
716
|
+
...n,
|
|
717
|
+
options: n.options ? JSON.stringify(n.options) : void 0
|
|
718
718
|
}).where("connections.id", "=", a).where("connections.tenant_id", "=", e).execute(), !0;
|
|
719
719
|
};
|
|
720
720
|
}
|
|
721
|
-
function
|
|
721
|
+
function Et(t) {
|
|
722
722
|
return {
|
|
723
|
-
create:
|
|
724
|
-
get:
|
|
725
|
-
list:
|
|
726
|
-
remove:
|
|
727
|
-
update:
|
|
723
|
+
create: Mt(t),
|
|
724
|
+
get: Lt(t),
|
|
725
|
+
list: At(t),
|
|
726
|
+
remove: zt(t),
|
|
727
|
+
update: Jt(t)
|
|
728
728
|
};
|
|
729
729
|
}
|
|
730
730
|
function Kt(t) {
|
|
@@ -736,10 +736,10 @@ function Kt(t) {
|
|
|
736
736
|
const r = await t.selectFrom("tenants").selectAll().where("id", "=", a.tenant_id).executeTakeFirst();
|
|
737
737
|
if (!r)
|
|
738
738
|
throw new H(404, { message: "Tenant not found" });
|
|
739
|
-
const
|
|
739
|
+
const n = await t.selectFrom("connections").where("tenant_id", "=", a.tenant_id).selectAll().execute();
|
|
740
740
|
return {
|
|
741
741
|
...a,
|
|
742
|
-
connections:
|
|
742
|
+
connections: n.map(
|
|
743
743
|
(s) => Be.parse(
|
|
744
744
|
p({
|
|
745
745
|
...s,
|
|
@@ -760,7 +760,7 @@ function Kt(t) {
|
|
|
760
760
|
}
|
|
761
761
|
};
|
|
762
762
|
}
|
|
763
|
-
function
|
|
763
|
+
function Rt(t) {
|
|
764
764
|
return async () => await t.selectFrom("keys").where(
|
|
765
765
|
(a) => a.or([
|
|
766
766
|
a("revoked_at", ">", (/* @__PURE__ */ new Date()).toISOString()),
|
|
@@ -768,22 +768,22 @@ function Bt(t) {
|
|
|
768
768
|
])
|
|
769
769
|
).selectAll().execute();
|
|
770
770
|
}
|
|
771
|
-
function
|
|
771
|
+
function Bt(t) {
|
|
772
772
|
return async (e) => {
|
|
773
773
|
await t.insertInto("keys").values({ ...e, created_at: (/* @__PURE__ */ new Date()).toDateString() }).execute();
|
|
774
774
|
};
|
|
775
775
|
}
|
|
776
|
-
function
|
|
776
|
+
function Ut(t) {
|
|
777
777
|
return async (e, a) => !!(await t.updateTable("keys").set(a).where("kid", "=", e).execute()).length;
|
|
778
778
|
}
|
|
779
779
|
function qt(t) {
|
|
780
780
|
return {
|
|
781
|
-
create:
|
|
782
|
-
list:
|
|
783
|
-
update:
|
|
781
|
+
create: Bt(t),
|
|
782
|
+
list: Rt(t),
|
|
783
|
+
update: Ut(t)
|
|
784
784
|
};
|
|
785
785
|
}
|
|
786
|
-
function
|
|
786
|
+
function Qt(t) {
|
|
787
787
|
return async (e, a) => {
|
|
788
788
|
const r = {
|
|
789
789
|
custom_domain_id: C(),
|
|
@@ -800,16 +800,16 @@ function Vt(t) {
|
|
|
800
800
|
}).execute(), r;
|
|
801
801
|
};
|
|
802
802
|
}
|
|
803
|
-
function
|
|
803
|
+
function Vt(t) {
|
|
804
804
|
return async (e) => (await t.selectFrom("custom_domains").where("custom_domains.tenant_id", "=", e).selectAll().execute()).map((r) => ({
|
|
805
805
|
...r,
|
|
806
806
|
primary: r.primary === 1
|
|
807
807
|
}));
|
|
808
808
|
}
|
|
809
|
-
function
|
|
809
|
+
function Wt(t) {
|
|
810
810
|
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;
|
|
811
811
|
}
|
|
812
|
-
function
|
|
812
|
+
function Gt(t) {
|
|
813
813
|
return async (e, a) => {
|
|
814
814
|
const r = await t.selectFrom("custom_domains").where("custom_domains.tenant_id", "=", e).where("custom_domains.custom_domain_id", "=", a).selectAll().executeTakeFirst();
|
|
815
815
|
return r ? {
|
|
@@ -818,17 +818,17 @@ function Ht(t) {
|
|
|
818
818
|
} : null;
|
|
819
819
|
};
|
|
820
820
|
}
|
|
821
|
-
function
|
|
821
|
+
function Ht(t) {
|
|
822
822
|
return async (e, a, r) => {
|
|
823
|
-
const
|
|
823
|
+
const n = {
|
|
824
824
|
...r,
|
|
825
825
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
826
826
|
primary: r.primary ? 1 : 0
|
|
827
827
|
};
|
|
828
|
-
return (await t.updateTable("custom_domains").set(
|
|
828
|
+
return (await t.updateTable("custom_domains").set(n).where("custom_domains.tenant_id", "=", e).where("custom_domains.custom_domain_id", "=", a).execute()).length > 0;
|
|
829
829
|
};
|
|
830
830
|
}
|
|
831
|
-
function
|
|
831
|
+
function Xt(t) {
|
|
832
832
|
return async (e) => {
|
|
833
833
|
const a = await t.selectFrom("custom_domains").where("custom_domains.domain", "=", e).selectAll().executeTakeFirst();
|
|
834
834
|
return a ? {
|
|
@@ -837,27 +837,27 @@ function Yt(t) {
|
|
|
837
837
|
} : null;
|
|
838
838
|
};
|
|
839
839
|
}
|
|
840
|
-
function
|
|
840
|
+
function Yt(t) {
|
|
841
841
|
return {
|
|
842
|
-
create:
|
|
843
|
-
get:
|
|
844
|
-
getByDomain:
|
|
845
|
-
list:
|
|
846
|
-
remove:
|
|
847
|
-
update:
|
|
842
|
+
create: Qt(t),
|
|
843
|
+
get: Gt(t),
|
|
844
|
+
getByDomain: Xt(t),
|
|
845
|
+
list: Vt(t),
|
|
846
|
+
remove: Wt(t),
|
|
847
|
+
update: Ht(t)
|
|
848
848
|
};
|
|
849
849
|
}
|
|
850
|
-
function
|
|
850
|
+
function Zt(t) {
|
|
851
851
|
return async (e) => {
|
|
852
852
|
const [a] = await t.selectFrom("branding").where("branding.tenant_id", "=", e).selectAll().execute();
|
|
853
853
|
if (!a)
|
|
854
854
|
return null;
|
|
855
855
|
const {
|
|
856
856
|
tenant_id: r,
|
|
857
|
-
colors_primary:
|
|
858
|
-
colors_page_background_type:
|
|
857
|
+
colors_primary: n,
|
|
858
|
+
colors_page_background_type: o,
|
|
859
859
|
colors_page_background_start: s,
|
|
860
|
-
colors_page_background_end:
|
|
860
|
+
colors_page_background_end: c,
|
|
861
861
|
colors_page_background_angle_dev: i,
|
|
862
862
|
font_url: m,
|
|
863
863
|
...u
|
|
@@ -865,11 +865,11 @@ function ea(t) {
|
|
|
865
865
|
return p({
|
|
866
866
|
...u,
|
|
867
867
|
colors: {
|
|
868
|
-
primary:
|
|
868
|
+
primary: n,
|
|
869
869
|
page_background: {
|
|
870
|
-
type:
|
|
870
|
+
type: o,
|
|
871
871
|
start: s,
|
|
872
|
-
end:
|
|
872
|
+
end: c,
|
|
873
873
|
angle_deg: i
|
|
874
874
|
}
|
|
875
875
|
},
|
|
@@ -877,24 +877,24 @@ function ea(t) {
|
|
|
877
877
|
});
|
|
878
878
|
};
|
|
879
879
|
}
|
|
880
|
-
function
|
|
880
|
+
function ea(t) {
|
|
881
881
|
return async (e, a) => {
|
|
882
|
-
var s,
|
|
883
|
-
const { colors: r, font:
|
|
882
|
+
var s, c, i, m, u, h, g, D, I, O, re, ne, oe, se, ie, le, ce, de;
|
|
883
|
+
const { colors: r, font: n, ...o } = a;
|
|
884
884
|
try {
|
|
885
885
|
await t.insertInto("branding").values({
|
|
886
|
-
...
|
|
886
|
+
...o,
|
|
887
887
|
colors_primary: r == null ? void 0 : r.primary,
|
|
888
|
-
colors_page_background_type: (
|
|
888
|
+
colors_page_background_type: (c = (s = a.colors) == null ? void 0 : s.page_background) == null ? void 0 : c.type,
|
|
889
889
|
colors_page_background_start: (m = (i = a.colors) == null ? void 0 : i.page_background) == null ? void 0 : m.start,
|
|
890
890
|
colors_page_background_end: (h = (u = a.colors) == null ? void 0 : u.page_background) == null ? void 0 : h.end,
|
|
891
|
-
colors_page_background_angle_dev: (D = (
|
|
891
|
+
colors_page_background_angle_dev: (D = (g = a.colors) == null ? void 0 : g.page_background) == null ? void 0 : D.angle_deg,
|
|
892
892
|
font_url: (I = a.font) == null ? void 0 : I.url,
|
|
893
893
|
tenant_id: e
|
|
894
894
|
}).execute();
|
|
895
895
|
} catch {
|
|
896
896
|
await t.updateTable("branding").set({
|
|
897
|
-
...
|
|
897
|
+
...o,
|
|
898
898
|
colors_primary: r == null ? void 0 : r.primary,
|
|
899
899
|
colors_page_background_type: (re = (O = a.colors) == null ? void 0 : O.page_background) == null ? void 0 : re.type,
|
|
900
900
|
colors_page_background_start: (oe = (ne = a.colors) == null ? void 0 : ne.page_background) == null ? void 0 : oe.start,
|
|
@@ -905,13 +905,13 @@ function ta(t) {
|
|
|
905
905
|
}
|
|
906
906
|
};
|
|
907
907
|
}
|
|
908
|
-
function
|
|
908
|
+
function ta(t) {
|
|
909
909
|
return {
|
|
910
|
-
get:
|
|
911
|
-
set:
|
|
910
|
+
get: Zt(t),
|
|
911
|
+
set: ea(t)
|
|
912
912
|
};
|
|
913
913
|
}
|
|
914
|
-
function
|
|
914
|
+
function aa(t) {
|
|
915
915
|
return async (e, a = {
|
|
916
916
|
page: 0,
|
|
917
917
|
per_page: 50,
|
|
@@ -919,12 +919,12 @@ function ra(t) {
|
|
|
919
919
|
}) => {
|
|
920
920
|
let r = t.selectFrom("hooks").where("hooks.tenant_id", "=", e);
|
|
921
921
|
a.q && (r = N(t, r, a.q, ["url", "form_id"]));
|
|
922
|
-
const
|
|
922
|
+
const o = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), { count: s } = await r.select((i) => i.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
923
923
|
return {
|
|
924
|
-
hooks:
|
|
925
|
-
const { tenant_id: m, enabled: u, synchronous: h, ...
|
|
924
|
+
hooks: o.map((i) => {
|
|
925
|
+
const { tenant_id: m, enabled: u, synchronous: h, ...g } = i;
|
|
926
926
|
return p({
|
|
927
|
-
...
|
|
927
|
+
...g,
|
|
928
928
|
enabled: !!u,
|
|
929
929
|
synchronous: !!h
|
|
930
930
|
});
|
|
@@ -935,7 +935,7 @@ function ra(t) {
|
|
|
935
935
|
};
|
|
936
936
|
};
|
|
937
937
|
}
|
|
938
|
-
function
|
|
938
|
+
function ra(t) {
|
|
939
939
|
return async (e, a) => {
|
|
940
940
|
const r = await t.selectFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", a).selectAll().executeTakeFirst();
|
|
941
941
|
return r ? p({
|
|
@@ -945,10 +945,10 @@ function na(t) {
|
|
|
945
945
|
}) : null;
|
|
946
946
|
};
|
|
947
947
|
}
|
|
948
|
-
function
|
|
948
|
+
function na(t) {
|
|
949
949
|
return async (e, a) => (await t.deleteFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", a).executeTakeFirst()).numDeletedRows > 0;
|
|
950
950
|
}
|
|
951
|
-
function
|
|
951
|
+
function oa(t) {
|
|
952
952
|
return async (e, a) => {
|
|
953
953
|
const r = {
|
|
954
954
|
hook_id: C(),
|
|
@@ -964,49 +964,49 @@ function sa(t) {
|
|
|
964
964
|
}).execute(), r;
|
|
965
965
|
};
|
|
966
966
|
}
|
|
967
|
-
function
|
|
967
|
+
function sa(t) {
|
|
968
968
|
return async (e, a, r) => {
|
|
969
|
-
const
|
|
969
|
+
const n = {
|
|
970
970
|
...r,
|
|
971
971
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
972
972
|
enabled: r.enabled !== void 0 ? r.enabled ? 1 : 0 : void 0,
|
|
973
973
|
synchronous: r.enabled !== void 0 ? r.synchronous ? 1 : 0 : void 0
|
|
974
974
|
};
|
|
975
|
-
return await t.updateTable("hooks").set(
|
|
975
|
+
return await t.updateTable("hooks").set(n).where("hooks.hook_id", "=", a).where("hooks.tenant_id", "=", e).execute(), !0;
|
|
976
976
|
};
|
|
977
977
|
}
|
|
978
|
-
function
|
|
978
|
+
function ia(t) {
|
|
979
979
|
return {
|
|
980
|
-
create:
|
|
981
|
-
get:
|
|
982
|
-
list:
|
|
983
|
-
update:
|
|
984
|
-
remove:
|
|
980
|
+
create: oa(t),
|
|
981
|
+
get: ra(t),
|
|
982
|
+
list: aa(t),
|
|
983
|
+
update: sa(t),
|
|
984
|
+
remove: na(t)
|
|
985
985
|
};
|
|
986
986
|
}
|
|
987
|
-
function
|
|
987
|
+
function la(t) {
|
|
988
988
|
return async (e, a) => {
|
|
989
989
|
const r = {
|
|
990
990
|
themeId: C(),
|
|
991
991
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
992
992
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
993
993
|
...a
|
|
994
|
-
},
|
|
994
|
+
}, n = {
|
|
995
995
|
...r,
|
|
996
996
|
tenant_id: e
|
|
997
997
|
};
|
|
998
|
-
return await t.insertInto("themes").values(A(
|
|
998
|
+
return await t.insertInto("themes").values(A(n)).execute(), r;
|
|
999
999
|
};
|
|
1000
1000
|
}
|
|
1001
|
-
function
|
|
1001
|
+
function ca(t) {
|
|
1002
1002
|
return async (e, a) => (await t.deleteFrom("themes").where("themes.tenant_id", "=", e).where("themes.themeId", "=", a).executeTakeFirst()).numDeletedRows > 0;
|
|
1003
1003
|
}
|
|
1004
|
-
function
|
|
1004
|
+
function da(t) {
|
|
1005
1005
|
return async (e, a) => {
|
|
1006
1006
|
const r = await t.selectFrom("themes").where("themes.tenant_id", "=", e).where("themes.themeId", "=", a).selectAll().executeTakeFirst();
|
|
1007
1007
|
if (!r)
|
|
1008
1008
|
return null;
|
|
1009
|
-
const
|
|
1009
|
+
const n = {
|
|
1010
1010
|
...r,
|
|
1011
1011
|
borders_show_widget_shadow: !!r.borders_show_widget_shadow,
|
|
1012
1012
|
fonts_body_text_bold: !!r.fonts_body_text_bold,
|
|
@@ -1017,7 +1017,7 @@ function ua(t) {
|
|
|
1017
1017
|
fonts_title_bold: !!r.fonts_title_bold
|
|
1018
1018
|
};
|
|
1019
1019
|
return p(
|
|
1020
|
-
ge(
|
|
1020
|
+
ge(n, [
|
|
1021
1021
|
"widget",
|
|
1022
1022
|
"colors",
|
|
1023
1023
|
"borders",
|
|
@@ -1027,24 +1027,24 @@ function ua(t) {
|
|
|
1027
1027
|
);
|
|
1028
1028
|
};
|
|
1029
1029
|
}
|
|
1030
|
-
function
|
|
1030
|
+
function ua(t) {
|
|
1031
1031
|
return async (e, a, r) => {
|
|
1032
|
-
const
|
|
1032
|
+
const n = A({
|
|
1033
1033
|
...r,
|
|
1034
1034
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1035
1035
|
});
|
|
1036
|
-
return await t.updateTable("themes").set(
|
|
1036
|
+
return await t.updateTable("themes").set(n).where("themes.themeId", "=", a).where("themes.tenant_id", "=", e).execute(), !0;
|
|
1037
1037
|
};
|
|
1038
1038
|
}
|
|
1039
|
-
function
|
|
1039
|
+
function ma(t) {
|
|
1040
1040
|
return {
|
|
1041
|
-
create:
|
|
1042
|
-
get:
|
|
1043
|
-
remove:
|
|
1044
|
-
update:
|
|
1041
|
+
create: la(t),
|
|
1042
|
+
get: da(t),
|
|
1043
|
+
remove: ca(t),
|
|
1044
|
+
update: ua(t)
|
|
1045
1045
|
};
|
|
1046
1046
|
}
|
|
1047
|
-
function
|
|
1047
|
+
function _a(t) {
|
|
1048
1048
|
return async (e, a) => {
|
|
1049
1049
|
const r = await t.selectFrom("login_sessions").where("login_sessions.id", "=", a).selectAll().executeTakeFirst();
|
|
1050
1050
|
return r ? Ue.parse(
|
|
@@ -1058,13 +1058,13 @@ function ha(t) {
|
|
|
1058
1058
|
) : null;
|
|
1059
1059
|
};
|
|
1060
1060
|
}
|
|
1061
|
-
function
|
|
1061
|
+
function ha(t) {
|
|
1062
1062
|
return async (e, a) => {
|
|
1063
|
-
var
|
|
1063
|
+
var n;
|
|
1064
1064
|
const r = {
|
|
1065
1065
|
id: C(),
|
|
1066
1066
|
...a,
|
|
1067
|
-
authorization_url: (
|
|
1067
|
+
authorization_url: (n = a.authorization_url) == null ? void 0 : n.slice(0, 1024),
|
|
1068
1068
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1069
1069
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1070
1070
|
login_completed: !!a.login_completed
|
|
@@ -1075,25 +1075,25 @@ function fa(t) {
|
|
|
1075
1075
|
}).execute(), r;
|
|
1076
1076
|
};
|
|
1077
1077
|
}
|
|
1078
|
-
function
|
|
1078
|
+
function fa(t) {
|
|
1079
1079
|
return async (e, a, r) => (await t.updateTable("login_sessions").set(
|
|
1080
1080
|
A({
|
|
1081
1081
|
...r
|
|
1082
1082
|
})
|
|
1083
1083
|
).where("login_sessions.id", "=", a).where("login_sessions.tenant_id", "=", e).execute()).length === 1;
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1085
|
+
function pa(t) {
|
|
1086
1086
|
return async (e, a) => (await t.deleteFrom("login_sessions").where("login_sessions.tenant_id", "=", e).where("login_sessions.id", "=", a).execute()).length > 0;
|
|
1087
1087
|
}
|
|
1088
|
-
function
|
|
1088
|
+
function ga(t) {
|
|
1089
1089
|
return {
|
|
1090
|
-
create:
|
|
1091
|
-
get:
|
|
1092
|
-
update:
|
|
1093
|
-
remove:
|
|
1090
|
+
create: ha(t),
|
|
1091
|
+
get: _a(t),
|
|
1092
|
+
update: fa(t),
|
|
1093
|
+
remove: pa(t)
|
|
1094
1094
|
};
|
|
1095
1095
|
}
|
|
1096
|
-
function
|
|
1096
|
+
function wa(t) {
|
|
1097
1097
|
return async (e) => {
|
|
1098
1098
|
const [a] = await t.selectFrom("prompt_settings").where("prompt_settings.tenant_id", "=", e).selectAll().execute();
|
|
1099
1099
|
return p({
|
|
@@ -1113,10 +1113,10 @@ function he(t) {
|
|
|
1113
1113
|
universal_login_experience: t.universal_login_experience
|
|
1114
1114
|
});
|
|
1115
1115
|
}
|
|
1116
|
-
function
|
|
1116
|
+
function ya(t) {
|
|
1117
1117
|
return async (e, a) => {
|
|
1118
1118
|
try {
|
|
1119
|
-
const r =
|
|
1119
|
+
const r = qe.parse(a);
|
|
1120
1120
|
await t.insertInto("prompt_settings").values({
|
|
1121
1121
|
...he(r),
|
|
1122
1122
|
tenant_id: e
|
|
@@ -1126,65 +1126,65 @@ function va(t) {
|
|
|
1126
1126
|
}
|
|
1127
1127
|
};
|
|
1128
1128
|
}
|
|
1129
|
-
function
|
|
1129
|
+
function va(t) {
|
|
1130
1130
|
return {
|
|
1131
|
-
get:
|
|
1132
|
-
set:
|
|
1131
|
+
get: wa(t),
|
|
1132
|
+
set: ya(t)
|
|
1133
1133
|
};
|
|
1134
1134
|
}
|
|
1135
|
-
function
|
|
1135
|
+
function Na(t) {
|
|
1136
1136
|
return async (e) => {
|
|
1137
1137
|
const [a] = await t.selectFrom("email_providers").where("email_providers.tenant_id", "=", e).selectAll().execute();
|
|
1138
1138
|
if (!a)
|
|
1139
1139
|
return null;
|
|
1140
1140
|
const {
|
|
1141
1141
|
tenant_id: r,
|
|
1142
|
-
credentials:
|
|
1143
|
-
settings:
|
|
1142
|
+
credentials: n,
|
|
1143
|
+
settings: o,
|
|
1144
1144
|
enabled: s,
|
|
1145
|
-
...
|
|
1145
|
+
...c
|
|
1146
1146
|
} = a;
|
|
1147
1147
|
return p({
|
|
1148
|
-
...
|
|
1149
|
-
credentials: JSON.parse(
|
|
1150
|
-
settings: JSON.parse(
|
|
1148
|
+
...c,
|
|
1149
|
+
credentials: JSON.parse(n),
|
|
1150
|
+
settings: JSON.parse(o),
|
|
1151
1151
|
enabled: !!s
|
|
1152
1152
|
});
|
|
1153
1153
|
};
|
|
1154
1154
|
}
|
|
1155
|
-
function
|
|
1155
|
+
function Ca(t) {
|
|
1156
1156
|
return async (e, a) => {
|
|
1157
|
-
const { credentials: r, settings:
|
|
1157
|
+
const { credentials: r, settings: n, enabled: o, ...s } = a;
|
|
1158
1158
|
await t.updateTable("email_providers").set({
|
|
1159
1159
|
...s,
|
|
1160
1160
|
credentials: r ? JSON.stringify(r) : void 0,
|
|
1161
|
-
settings:
|
|
1162
|
-
enabled:
|
|
1161
|
+
settings: n ? JSON.stringify(n) : void 0,
|
|
1162
|
+
enabled: o !== void 0 ? o ? 1 : 0 : void 0
|
|
1163
1163
|
}).where("tenant_id", "=", e).execute();
|
|
1164
1164
|
};
|
|
1165
1165
|
}
|
|
1166
|
-
function
|
|
1166
|
+
function ba(t) {
|
|
1167
1167
|
return async (e, a) => {
|
|
1168
|
-
const { credentials: r, settings:
|
|
1168
|
+
const { credentials: r, settings: n, enabled: o, ...s } = a;
|
|
1169
1169
|
await t.insertInto("email_providers").values({
|
|
1170
1170
|
...s,
|
|
1171
|
-
enabled:
|
|
1171
|
+
enabled: o ? 1 : 0,
|
|
1172
1172
|
credentials: JSON.stringify(r),
|
|
1173
|
-
settings: JSON.stringify(
|
|
1173
|
+
settings: JSON.stringify(n),
|
|
1174
1174
|
tenant_id: e,
|
|
1175
1175
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1176
1176
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1177
1177
|
}).execute();
|
|
1178
1178
|
};
|
|
1179
1179
|
}
|
|
1180
|
-
function
|
|
1180
|
+
function xa(t) {
|
|
1181
1181
|
return {
|
|
1182
|
-
get:
|
|
1183
|
-
create:
|
|
1184
|
-
update:
|
|
1182
|
+
get: Na(t),
|
|
1183
|
+
create: ba(t),
|
|
1184
|
+
update: Ca(t)
|
|
1185
1185
|
};
|
|
1186
1186
|
}
|
|
1187
|
-
function
|
|
1187
|
+
function Ta(t) {
|
|
1188
1188
|
return async (e, a) => {
|
|
1189
1189
|
const r = await t.selectFrom("refresh_tokens").where("refresh_tokens.tenant_id", "=", e).where("refresh_tokens.id", "=", a).selectAll().executeTakeFirst();
|
|
1190
1190
|
return r ? {
|
|
@@ -1195,7 +1195,7 @@ function Sa(t) {
|
|
|
1195
1195
|
} : null;
|
|
1196
1196
|
};
|
|
1197
1197
|
}
|
|
1198
|
-
function
|
|
1198
|
+
function Sa(t) {
|
|
1199
1199
|
return async (e, a) => {
|
|
1200
1200
|
const r = {
|
|
1201
1201
|
...a,
|
|
@@ -1210,21 +1210,21 @@ function Oa(t) {
|
|
|
1210
1210
|
}).execute(), { ...a, ...r };
|
|
1211
1211
|
};
|
|
1212
1212
|
}
|
|
1213
|
-
function
|
|
1213
|
+
function Oa(t) {
|
|
1214
1214
|
return async (e, a) => !!(await t.deleteFrom("refresh_tokens").where("tenant_id", "=", e).where("refresh_tokens.id", "=", a).execute()).length;
|
|
1215
1215
|
}
|
|
1216
|
-
function
|
|
1216
|
+
function ka(t) {
|
|
1217
1217
|
return async (e, a, r) => {
|
|
1218
|
-
const
|
|
1218
|
+
const n = {
|
|
1219
1219
|
...r,
|
|
1220
1220
|
device: r.device ? JSON.stringify(r.device) : void 0,
|
|
1221
1221
|
resource_servers: r.resource_servers ? JSON.stringify(r.resource_servers) : void 0,
|
|
1222
1222
|
rotating: r.rotating ? 1 : 0
|
|
1223
1223
|
};
|
|
1224
|
-
return !!(await t.updateTable("refresh_tokens").set(
|
|
1224
|
+
return !!(await t.updateTable("refresh_tokens").set(n).where("tenant_id", "=", e).where("refresh_tokens.id", "=", a).execute()).length;
|
|
1225
1225
|
};
|
|
1226
1226
|
}
|
|
1227
|
-
function
|
|
1227
|
+
function $a(t) {
|
|
1228
1228
|
return async (e, a = {
|
|
1229
1229
|
page: 0,
|
|
1230
1230
|
per_page: 50,
|
|
@@ -1232,18 +1232,18 @@ function Da(t) {
|
|
|
1232
1232
|
}) => {
|
|
1233
1233
|
let r = t.selectFrom("refresh_tokens").where("refresh_tokens.tenant_id", "=", e);
|
|
1234
1234
|
a.q && (r = N(t, r, a.q, ["token", "session_id"]));
|
|
1235
|
-
let
|
|
1235
|
+
let n = r;
|
|
1236
1236
|
if (a.sort && a.sort.sort_by) {
|
|
1237
1237
|
const { ref: i } = t.dynamic;
|
|
1238
|
-
|
|
1238
|
+
n = n.orderBy(
|
|
1239
1239
|
i(a.sort.sort_by),
|
|
1240
1240
|
a.sort.sort_order
|
|
1241
1241
|
);
|
|
1242
1242
|
}
|
|
1243
|
-
|
|
1244
|
-
const
|
|
1243
|
+
n = n.offset(a.page * a.per_page).limit(a.per_page);
|
|
1244
|
+
const o = await n.selectAll().execute(), { count: s } = await r.select((i) => i.fn.countAll().as("count")).executeTakeFirstOrThrow(), c = v(s);
|
|
1245
1245
|
return {
|
|
1246
|
-
refresh_tokens:
|
|
1246
|
+
refresh_tokens: o.map((i) => ({
|
|
1247
1247
|
...i,
|
|
1248
1248
|
rotating: !!i.rotating,
|
|
1249
1249
|
device: i.device ? JSON.parse(i.device) : {},
|
|
@@ -1251,20 +1251,20 @@ function Da(t) {
|
|
|
1251
1251
|
})),
|
|
1252
1252
|
start: a.page * a.per_page,
|
|
1253
1253
|
limit: a.per_page,
|
|
1254
|
-
length:
|
|
1254
|
+
length: c
|
|
1255
1255
|
};
|
|
1256
1256
|
};
|
|
1257
1257
|
}
|
|
1258
|
-
function
|
|
1258
|
+
function Da(t) {
|
|
1259
1259
|
return {
|
|
1260
|
-
create:
|
|
1261
|
-
get:
|
|
1262
|
-
list:
|
|
1263
|
-
remove:
|
|
1264
|
-
update:
|
|
1260
|
+
create: Sa(t),
|
|
1261
|
+
get: Ta(t),
|
|
1262
|
+
list: $a(t),
|
|
1263
|
+
remove: Oa(t),
|
|
1264
|
+
update: ka(t)
|
|
1265
1265
|
};
|
|
1266
1266
|
}
|
|
1267
|
-
function
|
|
1267
|
+
function Ia(t) {
|
|
1268
1268
|
return async () => {
|
|
1269
1269
|
const e = new Date(Date.now() - 864e5).toISOString(), a = new Date(
|
|
1270
1270
|
Date.now() - 1e3 * 60 * 60 * 24 * 7
|
|
@@ -1272,29 +1272,29 @@ function ja(t) {
|
|
|
1272
1272
|
Date.now() - 1e3 * 60 * 60 * 24 * 30 * 3
|
|
1273
1273
|
).toISOString();
|
|
1274
1274
|
console.log("delete codes"), await t.deleteFrom("codes").where("created_at", "<", e).limit(1e5).execute(), console.log("delete sessions"), await t.deleteFrom("login_sessions").where("created_at", "<", a).where("session_id", "is", null).limit(1e5).execute(), console.log("delete logs"), await t.deleteFrom("logs").where("date", "<", r).limit(1e5).execute(), console.log("delete refresh tokens"), await t.deleteFrom("refresh_tokens").where(
|
|
1275
|
-
(
|
|
1276
|
-
|
|
1277
|
-
|
|
1275
|
+
(o) => o.or([
|
|
1276
|
+
o("expires_at", "<", a),
|
|
1277
|
+
o("idle_expires_at", "<", a)
|
|
1278
1278
|
])
|
|
1279
1279
|
).limit(1e4).execute(), console.log("delete sessions");
|
|
1280
|
-
const
|
|
1281
|
-
(
|
|
1282
|
-
|
|
1283
|
-
|
|
1280
|
+
const n = await t.selectFrom("sessions").select("id").where(
|
|
1281
|
+
(o) => o.or([
|
|
1282
|
+
o("expires_at", "<", a),
|
|
1283
|
+
o("idle_expires_at", "<", a)
|
|
1284
1284
|
])
|
|
1285
1285
|
).where(
|
|
1286
1286
|
"id",
|
|
1287
1287
|
"not in",
|
|
1288
1288
|
t.selectFrom("refresh_tokens").select("session_id")
|
|
1289
1289
|
).limit(1e5).execute();
|
|
1290
|
-
|
|
1290
|
+
n.length > 0 && await t.deleteFrom("sessions").where(
|
|
1291
1291
|
"id",
|
|
1292
1292
|
"in",
|
|
1293
|
-
|
|
1293
|
+
n.map((o) => o.id)
|
|
1294
1294
|
).execute(), console.log("cleanup complete");
|
|
1295
1295
|
};
|
|
1296
1296
|
}
|
|
1297
|
-
function
|
|
1297
|
+
function ja(t) {
|
|
1298
1298
|
return async (e, a) => {
|
|
1299
1299
|
const r = U.parse({
|
|
1300
1300
|
id: C(),
|
|
@@ -1312,7 +1312,7 @@ function Pa(t) {
|
|
|
1312
1312
|
}).execute(), U.parse(r);
|
|
1313
1313
|
};
|
|
1314
1314
|
}
|
|
1315
|
-
function
|
|
1315
|
+
function Pa(t) {
|
|
1316
1316
|
return async (e, a = {
|
|
1317
1317
|
page: 0,
|
|
1318
1318
|
per_page: 50,
|
|
@@ -1338,119 +1338,123 @@ function Fa(t) {
|
|
|
1338
1338
|
} catch {
|
|
1339
1339
|
}
|
|
1340
1340
|
return U.parse(p(m));
|
|
1341
|
-
}), { count:
|
|
1341
|
+
}), { count: c } = await r.select((i) => i.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1342
1342
|
return {
|
|
1343
1343
|
forms: s,
|
|
1344
1344
|
start: a.page * a.per_page,
|
|
1345
1345
|
limit: a.per_page,
|
|
1346
|
-
length: v(
|
|
1346
|
+
length: v(c)
|
|
1347
1347
|
};
|
|
1348
1348
|
};
|
|
1349
1349
|
}
|
|
1350
|
-
function
|
|
1350
|
+
function Fa(t) {
|
|
1351
1351
|
return async (e, a) => {
|
|
1352
1352
|
const { numDeletedRows: r } = await t.deleteFrom("forms").where("id", "=", a).where("tenant_id", "=", e).executeTakeFirst();
|
|
1353
1353
|
return r > 0;
|
|
1354
1354
|
};
|
|
1355
1355
|
}
|
|
1356
|
-
function
|
|
1356
|
+
function Ma(t) {
|
|
1357
1357
|
return async (e, a) => {
|
|
1358
1358
|
const r = await t.selectFrom("forms").selectAll().where("forms.id", "=", a).where("tenant_id", "=", e).executeTakeFirst();
|
|
1359
1359
|
if (!r) return null;
|
|
1360
|
-
const
|
|
1361
|
-
if (typeof
|
|
1360
|
+
const n = { ...r };
|
|
1361
|
+
if (typeof n.nodes == "string")
|
|
1362
1362
|
try {
|
|
1363
|
-
|
|
1363
|
+
n.nodes = JSON.parse(n.nodes);
|
|
1364
1364
|
} catch {
|
|
1365
1365
|
}
|
|
1366
|
-
if (typeof
|
|
1366
|
+
if (typeof n.start == "string")
|
|
1367
1367
|
try {
|
|
1368
|
-
|
|
1368
|
+
n.start = JSON.parse(n.start);
|
|
1369
1369
|
} catch {
|
|
1370
1370
|
}
|
|
1371
|
-
if (typeof
|
|
1371
|
+
if (typeof n.ending == "string")
|
|
1372
1372
|
try {
|
|
1373
|
-
|
|
1373
|
+
n.ending = JSON.parse(n.ending);
|
|
1374
1374
|
} catch {
|
|
1375
1375
|
}
|
|
1376
|
-
return U.parse(p(
|
|
1376
|
+
return U.parse(p(n));
|
|
1377
1377
|
};
|
|
1378
1378
|
}
|
|
1379
|
-
function
|
|
1379
|
+
function Aa(t) {
|
|
1380
1380
|
return async (e, a, r) => {
|
|
1381
|
-
const
|
|
1381
|
+
const n = {
|
|
1382
1382
|
...r,
|
|
1383
1383
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1384
1384
|
};
|
|
1385
|
-
r.nodes && (
|
|
1386
|
-
const { numUpdatedRows:
|
|
1387
|
-
return
|
|
1385
|
+
r.nodes && (n.nodes = JSON.stringify(r.nodes)), r.start && (n.start = JSON.stringify(r.start)), r.ending && (n.ending = JSON.stringify(r.ending));
|
|
1386
|
+
const { numUpdatedRows: o } = await t.updateTable("forms").set(n).where("id", "=", a).where("tenant_id", "=", e).executeTakeFirst();
|
|
1387
|
+
return o > 0;
|
|
1388
1388
|
};
|
|
1389
1389
|
}
|
|
1390
|
-
function
|
|
1390
|
+
function za(t) {
|
|
1391
1391
|
return {
|
|
1392
|
-
create:
|
|
1393
|
-
get:
|
|
1394
|
-
list:
|
|
1395
|
-
remove:
|
|
1396
|
-
update:
|
|
1392
|
+
create: ja(t),
|
|
1393
|
+
get: Ma(t),
|
|
1394
|
+
list: Pa(t),
|
|
1395
|
+
remove: Fa(t),
|
|
1396
|
+
update: Aa(t)
|
|
1397
1397
|
};
|
|
1398
1398
|
}
|
|
1399
|
-
function
|
|
1399
|
+
function La(t) {
|
|
1400
1400
|
return async (e, a) => {
|
|
1401
|
-
const r = {
|
|
1401
|
+
const r = (/* @__PURE__ */ new Date()).toISOString(), n = {
|
|
1402
1402
|
id: C(),
|
|
1403
|
-
...a
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
...
|
|
1403
|
+
...a,
|
|
1404
|
+
created_at: r,
|
|
1405
|
+
updated_at: r
|
|
1406
|
+
}, o = Qe.parse(n), {
|
|
1407
|
+
verificationKey: s,
|
|
1408
|
+
scopes: c,
|
|
1409
|
+
options: i,
|
|
1410
|
+
skip_consent_for_verifiable_first_party_clients: m,
|
|
1411
|
+
allow_offline_access: u,
|
|
1412
|
+
...h
|
|
1413
|
+
} = o, g = {
|
|
1414
|
+
...h,
|
|
1413
1415
|
tenant_id: e,
|
|
1414
|
-
scopes:
|
|
1415
|
-
options:
|
|
1416
|
-
skip_consent_for_verifiable_first_party_clients:
|
|
1417
|
-
allow_offline_access:
|
|
1418
|
-
verification_key:
|
|
1419
|
-
|
|
1420
|
-
|
|
1416
|
+
scopes: c ? JSON.stringify(c) : "[]",
|
|
1417
|
+
options: i ? JSON.stringify(i) : "{}",
|
|
1418
|
+
skip_consent_for_verifiable_first_party_clients: m ? 1 : 0,
|
|
1419
|
+
allow_offline_access: u ? 1 : 0,
|
|
1420
|
+
verification_key: s,
|
|
1421
|
+
created_at: r,
|
|
1422
|
+
updated_at: r
|
|
1423
|
+
};
|
|
1424
|
+
return await t.insertInto("resource_servers").values(g).execute(), o;
|
|
1421
1425
|
};
|
|
1422
1426
|
}
|
|
1423
|
-
function
|
|
1427
|
+
function Ja(t) {
|
|
1424
1428
|
return async (e, a) => {
|
|
1425
1429
|
const r = await t.selectFrom("resource_servers").selectAll().where("tenant_id", "=", e).where("id", "=", a).executeTakeFirst();
|
|
1426
1430
|
if (!r) return null;
|
|
1427
|
-
const
|
|
1428
|
-
verification_key:
|
|
1431
|
+
const n = r, {
|
|
1432
|
+
verification_key: o,
|
|
1429
1433
|
scopes: s,
|
|
1430
|
-
options:
|
|
1434
|
+
options: c,
|
|
1431
1435
|
skip_consent_for_verifiable_first_party_clients: i,
|
|
1432
1436
|
allow_offline_access: m,
|
|
1433
1437
|
...u
|
|
1434
|
-
} =
|
|
1438
|
+
} = n;
|
|
1435
1439
|
return {
|
|
1436
1440
|
...u,
|
|
1437
1441
|
scopes: s ? JSON.parse(s) : [],
|
|
1438
|
-
options:
|
|
1442
|
+
options: c ? JSON.parse(c) : {},
|
|
1439
1443
|
skip_consent_for_verifiable_first_party_clients: !!i,
|
|
1440
1444
|
allow_offline_access: !!m,
|
|
1441
1445
|
// Convert verification_key back to verificationKey for API
|
|
1442
|
-
verificationKey:
|
|
1446
|
+
verificationKey: o
|
|
1443
1447
|
};
|
|
1444
1448
|
};
|
|
1445
1449
|
}
|
|
1446
|
-
function
|
|
1450
|
+
function Ea(t) {
|
|
1447
1451
|
return async (e, a = { page: 0, per_page: 50, include_totals: !1 }) => {
|
|
1448
1452
|
let r = t.selectFrom("resource_servers").where("resource_servers.tenant_id", "=", e);
|
|
1449
1453
|
if (a.q) {
|
|
1450
|
-
const i = a.q.trim(), m = i.split(/\s+/), u = m.length === 1 ? m[0] : void 0, h = u ? u.match(/^(-)?(name|identifier):(.*)$/) : null,
|
|
1454
|
+
const i = a.q.trim(), m = i.split(/\s+/), u = m.length === 1 ? m[0] : void 0, h = u ? u.match(/^(-)?(name|identifier):(.*)$/) : null, g = h ? h[3] : "", D = /^(>=|>|<=|<)/.test(g || "");
|
|
1451
1455
|
if (h && !D) {
|
|
1452
1456
|
const I = !!h[1], O = h[2] === "name" ? "resource_servers.name" : "resource_servers.identifier";
|
|
1453
|
-
r = I ? r.where(O, "not like", `%${
|
|
1457
|
+
r = I ? r.where(O, "not like", `%${g}%`) : r.where(O, "like", `%${g}%`);
|
|
1454
1458
|
} else
|
|
1455
1459
|
r = N(t, r, i, [
|
|
1456
1460
|
"resource_servers.name",
|
|
@@ -1461,7 +1465,7 @@ function Ra(t) {
|
|
|
1461
1465
|
const m = i, {
|
|
1462
1466
|
verification_key: u,
|
|
1463
1467
|
scopes: h,
|
|
1464
|
-
options:
|
|
1468
|
+
options: g,
|
|
1465
1469
|
skip_consent_for_verifiable_first_party_clients: D,
|
|
1466
1470
|
allow_offline_access: I,
|
|
1467
1471
|
...O
|
|
@@ -1469,18 +1473,18 @@ function Ra(t) {
|
|
|
1469
1473
|
return {
|
|
1470
1474
|
...O,
|
|
1471
1475
|
scopes: h ? JSON.parse(h) : [],
|
|
1472
|
-
options:
|
|
1476
|
+
options: g ? JSON.parse(g) : {},
|
|
1473
1477
|
skip_consent_for_verifiable_first_party_clients: !!D,
|
|
1474
1478
|
allow_offline_access: !!I,
|
|
1475
1479
|
// Convert verification_key back to verificationKey for API
|
|
1476
1480
|
verificationKey: u
|
|
1477
1481
|
};
|
|
1478
|
-
}), { count:
|
|
1482
|
+
}), { count: c } = await r.select((i) => i.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1479
1483
|
return {
|
|
1480
1484
|
resource_servers: s,
|
|
1481
1485
|
start: a.page * a.per_page,
|
|
1482
1486
|
limit: a.per_page,
|
|
1483
|
-
length: v(
|
|
1487
|
+
length: v(c)
|
|
1484
1488
|
};
|
|
1485
1489
|
};
|
|
1486
1490
|
}
|
|
@@ -1490,227 +1494,236 @@ function Ka(t) {
|
|
|
1490
1494
|
return Number(r.numDeletedRows) > 0;
|
|
1491
1495
|
};
|
|
1492
1496
|
}
|
|
1493
|
-
function
|
|
1497
|
+
function Ra(t) {
|
|
1494
1498
|
return async (e, a, r) => {
|
|
1495
1499
|
const {
|
|
1496
|
-
verificationKey:
|
|
1497
|
-
scopes:
|
|
1500
|
+
verificationKey: n,
|
|
1501
|
+
scopes: o,
|
|
1498
1502
|
options: s,
|
|
1499
|
-
skip_consent_for_verifiable_first_party_clients:
|
|
1503
|
+
skip_consent_for_verifiable_first_party_clients: c,
|
|
1500
1504
|
allow_offline_access: i,
|
|
1501
1505
|
...m
|
|
1502
|
-
} = r, u = {
|
|
1503
|
-
|
|
1506
|
+
} = r, u = {
|
|
1507
|
+
...m,
|
|
1508
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1509
|
+
};
|
|
1510
|
+
n !== void 0 && (u.verification_key = n), o !== void 0 && (u.scopes = JSON.stringify(o)), s !== void 0 && (u.options = JSON.stringify(s)), c !== void 0 && (u.skip_consent_for_verifiable_first_party_clients = c ? 1 : 0), i !== void 0 && (u.allow_offline_access = i ? 1 : 0);
|
|
1504
1511
|
const h = await t.updateTable("resource_servers").set(u).where("tenant_id", "=", e).where("id", "=", a).executeTakeFirst();
|
|
1505
1512
|
return Number(h.numUpdatedRows) > 0;
|
|
1506
1513
|
};
|
|
1507
1514
|
}
|
|
1508
|
-
function
|
|
1515
|
+
function Ba(t) {
|
|
1509
1516
|
return {
|
|
1510
|
-
create:
|
|
1511
|
-
get:
|
|
1512
|
-
list:
|
|
1517
|
+
create: La(t),
|
|
1518
|
+
get: Ja(t),
|
|
1519
|
+
list: Ea(t),
|
|
1513
1520
|
remove: Ka(t),
|
|
1514
|
-
update:
|
|
1521
|
+
update: Ra(t)
|
|
1515
1522
|
};
|
|
1516
1523
|
}
|
|
1517
|
-
function
|
|
1524
|
+
function Ua(t) {
|
|
1518
1525
|
return async (e, a) => {
|
|
1519
|
-
const r = { id:
|
|
1520
|
-
|
|
1526
|
+
const r = C(), n = (/* @__PURE__ */ new Date()).toISOString(), o = { id: r, ...a }, s = Ve.parse(o), { sources: c, ...i } = s, m = {
|
|
1527
|
+
id: r,
|
|
1528
|
+
...i,
|
|
1521
1529
|
tenant_id: e,
|
|
1522
|
-
|
|
1530
|
+
sources: c ? JSON.stringify(c) : "[]",
|
|
1531
|
+
created_at: n,
|
|
1532
|
+
updated_at: n
|
|
1533
|
+
};
|
|
1534
|
+
return await t.insertInto("permissions").values(m).execute(), {
|
|
1535
|
+
...s,
|
|
1536
|
+
created_at: n,
|
|
1537
|
+
updated_at: n
|
|
1523
1538
|
};
|
|
1524
|
-
return await t.insertInto("rules").values(l).execute(), o;
|
|
1525
1539
|
};
|
|
1526
1540
|
}
|
|
1527
1541
|
function qa(t) {
|
|
1528
1542
|
return async (e, a) => {
|
|
1529
|
-
const r = await t.selectFrom("
|
|
1543
|
+
const r = await t.selectFrom("permissions").selectAll().where("permissions.tenant_id", "=", e).where("permissions.id", "=", a).executeTakeFirst();
|
|
1530
1544
|
if (!r) return null;
|
|
1531
|
-
const
|
|
1545
|
+
const n = r, { sources: o, ...s } = n;
|
|
1532
1546
|
return {
|
|
1533
1547
|
...s,
|
|
1534
|
-
|
|
1548
|
+
sources: o ? JSON.parse(o) : []
|
|
1535
1549
|
};
|
|
1536
1550
|
};
|
|
1537
1551
|
}
|
|
1538
|
-
function
|
|
1552
|
+
function Qa(t) {
|
|
1539
1553
|
return async (e, a = { page: 0, per_page: 50, include_totals: !1 }) => {
|
|
1540
|
-
let r = t.selectFrom("
|
|
1541
|
-
a.q && (r = N(t, r, a.q, [
|
|
1554
|
+
let r = t.selectFrom("permissions").where("permissions.tenant_id", "=", e);
|
|
1555
|
+
a.q && (r = N(t, r, a.q, [
|
|
1556
|
+
"permission_name",
|
|
1557
|
+
"resource_server_identifier",
|
|
1558
|
+
"resource_server_name"
|
|
1559
|
+
]));
|
|
1542
1560
|
const s = (await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute()).map((i) => {
|
|
1543
|
-
const m = i, {
|
|
1561
|
+
const m = i, { sources: u, ...h } = m;
|
|
1544
1562
|
return {
|
|
1545
1563
|
...h,
|
|
1546
|
-
|
|
1564
|
+
sources: u ? JSON.parse(u) : []
|
|
1547
1565
|
};
|
|
1548
|
-
}), { count:
|
|
1566
|
+
}), { count: c } = await r.select((i) => i.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1549
1567
|
return {
|
|
1550
|
-
|
|
1568
|
+
permissions: s,
|
|
1551
1569
|
start: a.page * a.per_page,
|
|
1552
1570
|
limit: a.per_page,
|
|
1553
|
-
length: v(
|
|
1571
|
+
length: v(c)
|
|
1554
1572
|
};
|
|
1555
1573
|
};
|
|
1556
1574
|
}
|
|
1575
|
+
function Va(t) {
|
|
1576
|
+
return async (e, a, r) => {
|
|
1577
|
+
const { sources: n, ...o } = r, s = {
|
|
1578
|
+
...o,
|
|
1579
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1580
|
+
};
|
|
1581
|
+
n !== void 0 && (s.sources = JSON.stringify(n));
|
|
1582
|
+
const c = await t.updateTable("permissions").set(s).where("permissions.tenant_id", "=", e).where("permissions.id", "=", a).executeTakeFirst();
|
|
1583
|
+
return Number(c.numUpdatedRows) > 0;
|
|
1584
|
+
};
|
|
1585
|
+
}
|
|
1557
1586
|
function Wa(t) {
|
|
1558
1587
|
return async (e, a) => {
|
|
1559
|
-
const r = await t.deleteFrom("
|
|
1588
|
+
const r = await t.deleteFrom("permissions").where("permissions.tenant_id", "=", e).where("permissions.id", "=", a).executeTakeFirst();
|
|
1560
1589
|
return Number(r.numDeletedRows) > 0;
|
|
1561
1590
|
};
|
|
1562
1591
|
}
|
|
1563
1592
|
function Ga(t) {
|
|
1564
|
-
return async (e, a, r) => {
|
|
1565
|
-
const { enabled: o, ...n } = r, s = { ...n };
|
|
1566
|
-
o !== void 0 && (s.enabled = o ? 1 : 0);
|
|
1567
|
-
const l = await t.updateTable("rules").set(s).where("tenant_id", "=", e).where("id", "=", a).executeTakeFirst();
|
|
1568
|
-
return Number(l.numUpdatedRows) > 0;
|
|
1569
|
-
};
|
|
1570
|
-
}
|
|
1571
|
-
function Ha(t) {
|
|
1572
1593
|
return {
|
|
1573
|
-
create:
|
|
1594
|
+
create: Ua(t),
|
|
1574
1595
|
get: qa(t),
|
|
1575
|
-
list:
|
|
1576
|
-
|
|
1577
|
-
|
|
1596
|
+
list: Qa(t),
|
|
1597
|
+
update: Va(t),
|
|
1598
|
+
remove: Wa(t)
|
|
1578
1599
|
};
|
|
1579
1600
|
}
|
|
1580
|
-
function
|
|
1601
|
+
function Ha(t) {
|
|
1581
1602
|
return async (e, a) => {
|
|
1582
|
-
const r = C(),
|
|
1603
|
+
const r = C(), n = (/* @__PURE__ */ new Date()).toISOString(), o = {
|
|
1583
1604
|
id: r,
|
|
1584
|
-
...
|
|
1605
|
+
...a,
|
|
1585
1606
|
tenant_id: e,
|
|
1586
|
-
|
|
1607
|
+
created_at: n,
|
|
1608
|
+
updated_at: n
|
|
1609
|
+
};
|
|
1610
|
+
return await t.insertInto("roles").values(o).execute(), {
|
|
1611
|
+
id: r,
|
|
1612
|
+
...a,
|
|
1613
|
+
created_at: n,
|
|
1614
|
+
updated_at: n
|
|
1587
1615
|
};
|
|
1588
|
-
return await t.insertInto("permissions").values(i).execute(), n;
|
|
1589
1616
|
};
|
|
1590
1617
|
}
|
|
1591
|
-
function
|
|
1618
|
+
function Xa(t) {
|
|
1592
1619
|
return async (e, a) => {
|
|
1593
|
-
const r = await t.selectFrom("
|
|
1594
|
-
|
|
1595
|
-
const o = r, { sources: n, ...s } = o;
|
|
1596
|
-
return {
|
|
1597
|
-
...s,
|
|
1598
|
-
sources: n ? JSON.parse(n) : []
|
|
1599
|
-
};
|
|
1620
|
+
const r = await t.selectFrom("roles").selectAll().where("roles.tenant_id", "=", e).where("roles.id", "=", a).executeTakeFirst();
|
|
1621
|
+
return r || null;
|
|
1600
1622
|
};
|
|
1601
1623
|
}
|
|
1602
|
-
function
|
|
1624
|
+
function Ya(t) {
|
|
1603
1625
|
return async (e, a = { page: 0, per_page: 50, include_totals: !1 }) => {
|
|
1604
|
-
let r = t.selectFrom("
|
|
1605
|
-
a.q && (r = N(t, r, a.q, [
|
|
1606
|
-
|
|
1607
|
-
"resource_server_identifier",
|
|
1608
|
-
"resource_server_name"
|
|
1609
|
-
]));
|
|
1610
|
-
const s = (await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute()).map((i) => {
|
|
1611
|
-
const m = i, { sources: u, ...h } = m;
|
|
1612
|
-
return {
|
|
1613
|
-
...h,
|
|
1614
|
-
sources: u ? JSON.parse(u) : []
|
|
1615
|
-
};
|
|
1616
|
-
}), { count: l } = await r.select((i) => i.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1626
|
+
let r = t.selectFrom("roles").where("roles.tenant_id", "=", e);
|
|
1627
|
+
a.q && (r = N(t, r, a.q, ["name"]));
|
|
1628
|
+
const s = (await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute()).map((i) => i), { count: c } = await r.select((i) => i.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1617
1629
|
return {
|
|
1618
|
-
|
|
1630
|
+
roles: s,
|
|
1619
1631
|
start: a.page * a.per_page,
|
|
1620
1632
|
limit: a.per_page,
|
|
1621
|
-
length: v(
|
|
1633
|
+
length: v(c)
|
|
1622
1634
|
};
|
|
1623
1635
|
};
|
|
1624
1636
|
}
|
|
1625
|
-
function
|
|
1637
|
+
function Za(t) {
|
|
1626
1638
|
return async (e, a, r) => {
|
|
1627
|
-
const
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1639
|
+
const n = {
|
|
1640
|
+
...r,
|
|
1641
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1642
|
+
}, o = await t.updateTable("roles").set(n).where("roles.tenant_id", "=", e).where("roles.id", "=", a).executeTakeFirst();
|
|
1643
|
+
return Number(o.numUpdatedRows) > 0;
|
|
1631
1644
|
};
|
|
1632
1645
|
}
|
|
1633
|
-
function
|
|
1646
|
+
function er(t) {
|
|
1634
1647
|
return async (e, a) => {
|
|
1635
|
-
const r = await t.deleteFrom("
|
|
1648
|
+
const r = await t.deleteFrom("roles").where("tenant_id", "=", e).where("id", "=", a).executeTakeFirst();
|
|
1636
1649
|
return Number(r.numDeletedRows) > 0;
|
|
1637
1650
|
};
|
|
1638
1651
|
}
|
|
1639
|
-
function
|
|
1652
|
+
function tr(t) {
|
|
1640
1653
|
return {
|
|
1641
|
-
create:
|
|
1642
|
-
get:
|
|
1643
|
-
list:
|
|
1644
|
-
update:
|
|
1645
|
-
remove:
|
|
1654
|
+
create: Ha(t),
|
|
1655
|
+
get: Xa(t),
|
|
1656
|
+
list: Ya(t),
|
|
1657
|
+
update: Za(t),
|
|
1658
|
+
remove: er(t)
|
|
1646
1659
|
};
|
|
1647
1660
|
}
|
|
1648
|
-
function
|
|
1661
|
+
function ar(t) {
|
|
1649
1662
|
return t[t.length - 1];
|
|
1650
1663
|
}
|
|
1651
|
-
function
|
|
1664
|
+
function y(t) {
|
|
1652
1665
|
return Object.freeze(t);
|
|
1653
1666
|
}
|
|
1654
|
-
const B =
|
|
1667
|
+
const B = y({
|
|
1655
1668
|
is(t) {
|
|
1656
1669
|
return t.kind === "IdentifierNode";
|
|
1657
1670
|
},
|
|
1658
1671
|
create(t) {
|
|
1659
|
-
return
|
|
1672
|
+
return y({
|
|
1660
1673
|
kind: "IdentifierNode",
|
|
1661
1674
|
name: t
|
|
1662
1675
|
});
|
|
1663
1676
|
}
|
|
1664
|
-
}), X =
|
|
1677
|
+
}), X = y({
|
|
1665
1678
|
is(t) {
|
|
1666
1679
|
return t.kind === "SchemableIdentifierNode";
|
|
1667
1680
|
},
|
|
1668
1681
|
create(t) {
|
|
1669
|
-
return
|
|
1682
|
+
return y({
|
|
1670
1683
|
kind: "SchemableIdentifierNode",
|
|
1671
1684
|
identifier: B.create(t)
|
|
1672
1685
|
});
|
|
1673
1686
|
},
|
|
1674
1687
|
createWithSchema(t, e) {
|
|
1675
|
-
return
|
|
1688
|
+
return y({
|
|
1676
1689
|
kind: "SchemableIdentifierNode",
|
|
1677
1690
|
schema: B.create(t),
|
|
1678
1691
|
identifier: B.create(e)
|
|
1679
1692
|
});
|
|
1680
1693
|
}
|
|
1681
|
-
}),
|
|
1694
|
+
}), rr = y({
|
|
1682
1695
|
is(t) {
|
|
1683
1696
|
return t.kind === "AliasNode";
|
|
1684
1697
|
},
|
|
1685
1698
|
create(t, e) {
|
|
1686
|
-
return
|
|
1699
|
+
return y({
|
|
1687
1700
|
kind: "AliasNode",
|
|
1688
1701
|
node: t,
|
|
1689
1702
|
alias: e
|
|
1690
1703
|
});
|
|
1691
1704
|
}
|
|
1692
|
-
}), V =
|
|
1705
|
+
}), V = y({
|
|
1693
1706
|
is(t) {
|
|
1694
1707
|
return t.kind === "TableNode";
|
|
1695
1708
|
},
|
|
1696
1709
|
create(t) {
|
|
1697
|
-
return
|
|
1710
|
+
return y({
|
|
1698
1711
|
kind: "TableNode",
|
|
1699
1712
|
table: X.create(t)
|
|
1700
1713
|
});
|
|
1701
1714
|
},
|
|
1702
1715
|
createWithSchema(t, e) {
|
|
1703
|
-
return
|
|
1716
|
+
return y({
|
|
1704
1717
|
kind: "TableNode",
|
|
1705
1718
|
table: X.createWithSchema(t, e)
|
|
1706
1719
|
});
|
|
1707
1720
|
}
|
|
1708
1721
|
});
|
|
1709
|
-
var
|
|
1710
|
-
class
|
|
1722
|
+
var q;
|
|
1723
|
+
class nr {
|
|
1711
1724
|
constructor() {
|
|
1712
1725
|
z(this, "nodeStack", []);
|
|
1713
|
-
b(this,
|
|
1726
|
+
b(this, q, y({
|
|
1714
1727
|
AliasNode: this.transformAlias.bind(this),
|
|
1715
1728
|
ColumnNode: this.transformColumn.bind(this),
|
|
1716
1729
|
IdentifierNode: this.transformIdentifier.bind(this),
|
|
@@ -1811,13 +1824,13 @@ class or {
|
|
|
1811
1824
|
return e;
|
|
1812
1825
|
this.nodeStack.push(e);
|
|
1813
1826
|
const a = this.transformNodeImpl(e);
|
|
1814
|
-
return this.nodeStack.pop(),
|
|
1827
|
+
return this.nodeStack.pop(), y(a);
|
|
1815
1828
|
}
|
|
1816
1829
|
transformNodeImpl(e) {
|
|
1817
|
-
return d(this,
|
|
1830
|
+
return d(this, q)[e.kind](e);
|
|
1818
1831
|
}
|
|
1819
1832
|
transformNodeList(e) {
|
|
1820
|
-
return e &&
|
|
1833
|
+
return e && y(e.map((a) => this.transformNode(a)));
|
|
1821
1834
|
}
|
|
1822
1835
|
transformSelectQuery(e) {
|
|
1823
1836
|
return {
|
|
@@ -1916,7 +1929,7 @@ class or {
|
|
|
1916
1929
|
transformRaw(e) {
|
|
1917
1930
|
return {
|
|
1918
1931
|
kind: "RawNode",
|
|
1919
|
-
sqlFragments:
|
|
1932
|
+
sqlFragments: y([...e.sqlFragments]),
|
|
1920
1933
|
parameters: this.transformNodeList(e.parameters)
|
|
1921
1934
|
};
|
|
1922
1935
|
}
|
|
@@ -2540,8 +2553,8 @@ class or {
|
|
|
2540
2553
|
return e;
|
|
2541
2554
|
}
|
|
2542
2555
|
}
|
|
2543
|
-
|
|
2544
|
-
const
|
|
2556
|
+
q = new WeakMap();
|
|
2557
|
+
const or = y({
|
|
2545
2558
|
AlterTableNode: !0,
|
|
2546
2559
|
CreateIndexNode: !0,
|
|
2547
2560
|
CreateSchemaNode: !0,
|
|
@@ -2560,31 +2573,31 @@ const sr = w({
|
|
|
2560
2573
|
UpdateQueryNode: !0,
|
|
2561
2574
|
MergeQueryNode: !0
|
|
2562
2575
|
});
|
|
2563
|
-
var M, k, $,
|
|
2564
|
-
class
|
|
2576
|
+
var M, k, $, w, ye, ve, Ne, j, Y, Ce;
|
|
2577
|
+
class sr extends nr {
|
|
2565
2578
|
constructor(a) {
|
|
2566
2579
|
super();
|
|
2567
|
-
b(this,
|
|
2580
|
+
b(this, w);
|
|
2568
2581
|
b(this, M);
|
|
2569
2582
|
b(this, k, /* @__PURE__ */ new Set());
|
|
2570
2583
|
b(this, $, /* @__PURE__ */ new Set());
|
|
2571
2584
|
L(this, M, a);
|
|
2572
2585
|
}
|
|
2573
2586
|
transformNodeImpl(a) {
|
|
2574
|
-
if (!_(this,
|
|
2587
|
+
if (!_(this, w, ye).call(this, a))
|
|
2575
2588
|
return super.transformNodeImpl(a);
|
|
2576
|
-
const r = _(this,
|
|
2589
|
+
const r = _(this, w, Ne).call(this, a);
|
|
2577
2590
|
for (const s of r)
|
|
2578
2591
|
d(this, $).add(s);
|
|
2579
|
-
const
|
|
2580
|
-
for (const s of
|
|
2592
|
+
const n = _(this, w, ve).call(this, a);
|
|
2593
|
+
for (const s of n)
|
|
2581
2594
|
d(this, k).add(s);
|
|
2582
|
-
const
|
|
2583
|
-
for (const s of
|
|
2595
|
+
const o = super.transformNodeImpl(a);
|
|
2596
|
+
for (const s of n)
|
|
2584
2597
|
d(this, k).delete(s);
|
|
2585
2598
|
for (const s of r)
|
|
2586
2599
|
d(this, $).delete(s);
|
|
2587
|
-
return
|
|
2600
|
+
return o;
|
|
2588
2601
|
}
|
|
2589
2602
|
transformSchemableIdentifier(a) {
|
|
2590
2603
|
const r = super.transformSchemableIdentifier(a);
|
|
@@ -2601,47 +2614,47 @@ class ir extends or {
|
|
|
2601
2614
|
};
|
|
2602
2615
|
}
|
|
2603
2616
|
}
|
|
2604
|
-
M = new WeakMap(), k = new WeakMap(), $ = new WeakMap(),
|
|
2605
|
-
return a.kind in
|
|
2617
|
+
M = new WeakMap(), k = new WeakMap(), $ = new WeakMap(), w = new WeakSet(), ye = function(a) {
|
|
2618
|
+
return a.kind in or;
|
|
2606
2619
|
}, ve = function(a) {
|
|
2607
2620
|
const r = /* @__PURE__ */ new Set();
|
|
2608
|
-
if ("name" in a && a.name && X.is(a.name) && _(this,
|
|
2609
|
-
for (const
|
|
2610
|
-
_(this,
|
|
2611
|
-
if ("into" in a && a.into && _(this,
|
|
2612
|
-
for (const
|
|
2613
|
-
_(this,
|
|
2614
|
-
return "using" in a && a.using && _(this,
|
|
2621
|
+
if ("name" in a && a.name && X.is(a.name) && _(this, w, Y).call(this, a.name, r), "from" in a && a.from)
|
|
2622
|
+
for (const n of a.from.froms)
|
|
2623
|
+
_(this, w, j).call(this, n, r);
|
|
2624
|
+
if ("into" in a && a.into && _(this, w, j).call(this, a.into, r), "table" in a && a.table && _(this, w, j).call(this, a.table, r), "joins" in a && a.joins)
|
|
2625
|
+
for (const n of a.joins)
|
|
2626
|
+
_(this, w, j).call(this, n.table, r);
|
|
2627
|
+
return "using" in a && a.using && _(this, w, j).call(this, a.using, r), r;
|
|
2615
2628
|
}, Ne = function(a) {
|
|
2616
2629
|
const r = /* @__PURE__ */ new Set();
|
|
2617
|
-
return "with" in a && a.with && _(this,
|
|
2630
|
+
return "with" in a && a.with && _(this, w, Ce).call(this, a.with, r), r;
|
|
2618
2631
|
}, j = function(a, r) {
|
|
2619
|
-
const
|
|
2620
|
-
|
|
2632
|
+
const n = V.is(a) ? a : rr.is(a) && V.is(a.node) ? a.node : null;
|
|
2633
|
+
n && _(this, w, Y).call(this, n.table, r);
|
|
2621
2634
|
}, Y = function(a, r) {
|
|
2622
|
-
const
|
|
2623
|
-
!d(this, k).has(
|
|
2635
|
+
const n = a.identifier.name;
|
|
2636
|
+
!d(this, k).has(n) && !d(this, $).has(n) && r.add(n);
|
|
2624
2637
|
}, Ce = function(a, r) {
|
|
2625
|
-
for (const
|
|
2626
|
-
const
|
|
2627
|
-
d(this, $).has(
|
|
2638
|
+
for (const n of a.expressions) {
|
|
2639
|
+
const o = n.name.table.table.identifier.name;
|
|
2640
|
+
d(this, $).has(o) || r.add(o);
|
|
2628
2641
|
}
|
|
2629
2642
|
};
|
|
2630
|
-
var
|
|
2631
|
-
class
|
|
2643
|
+
var K;
|
|
2644
|
+
class ir {
|
|
2632
2645
|
constructor(e) {
|
|
2633
|
-
b(this,
|
|
2634
|
-
L(this,
|
|
2646
|
+
b(this, K);
|
|
2647
|
+
L(this, K, new sr(e));
|
|
2635
2648
|
}
|
|
2636
2649
|
transformQuery(e) {
|
|
2637
|
-
return d(this,
|
|
2650
|
+
return d(this, K).transformNode(e.node);
|
|
2638
2651
|
}
|
|
2639
2652
|
async transformResult(e) {
|
|
2640
2653
|
return e.result;
|
|
2641
2654
|
}
|
|
2642
2655
|
}
|
|
2643
|
-
|
|
2644
|
-
class
|
|
2656
|
+
K = new WeakMap();
|
|
2657
|
+
class lr {
|
|
2645
2658
|
transformQuery(e) {
|
|
2646
2659
|
return e.node;
|
|
2647
2660
|
}
|
|
@@ -2649,13 +2662,13 @@ class cr {
|
|
|
2649
2662
|
return e.result;
|
|
2650
2663
|
}
|
|
2651
2664
|
}
|
|
2652
|
-
const
|
|
2653
|
-
var f,
|
|
2665
|
+
const cr = "kysely_migration", fe = "kysely_migration_lock", dr = !1, W = "migration_lock", ur = y({ __noMigrations__: !0 });
|
|
2666
|
+
var f, l, J, x, T, P, xe, S, Te, Se, Oe, ke, $e, Z, F, ee, De, Ie, je, te, Pe, Fe, Me, Ae, ze, E;
|
|
2654
2667
|
class be {
|
|
2655
2668
|
constructor(e) {
|
|
2656
|
-
b(this,
|
|
2669
|
+
b(this, l);
|
|
2657
2670
|
b(this, f);
|
|
2658
|
-
L(this, f,
|
|
2671
|
+
L(this, f, y(e));
|
|
2659
2672
|
}
|
|
2660
2673
|
/**
|
|
2661
2674
|
* Returns a {@link MigrationInfo} object for each migration.
|
|
@@ -2663,13 +2676,13 @@ class be {
|
|
|
2663
2676
|
* The returned array is sorted by migration name.
|
|
2664
2677
|
*/
|
|
2665
2678
|
async getMigrations() {
|
|
2666
|
-
const e = await _(this,
|
|
2667
|
-
return (await _(this,
|
|
2668
|
-
const
|
|
2679
|
+
const e = await _(this, l, F).call(this, d(this, l, T)) ? await d(this, f).db.withPlugin(d(this, l, S)).selectFrom(d(this, l, T)).select(["name", "timestamp"]).execute() : [];
|
|
2680
|
+
return (await _(this, l, te).call(this)).map(({ name: r, ...n }) => {
|
|
2681
|
+
const o = e.find((s) => s.name === r);
|
|
2669
2682
|
return {
|
|
2670
2683
|
name: r,
|
|
2671
|
-
migration:
|
|
2672
|
-
executedAt:
|
|
2684
|
+
migration: n,
|
|
2685
|
+
executedAt: o ? new Date(o.timestamp) : void 0
|
|
2673
2686
|
};
|
|
2674
2687
|
});
|
|
2675
2688
|
}
|
|
@@ -2721,7 +2734,7 @@ class be {
|
|
|
2721
2734
|
* ```
|
|
2722
2735
|
*/
|
|
2723
2736
|
async migrateToLatest() {
|
|
2724
|
-
return _(this,
|
|
2737
|
+
return _(this, l, J).call(this, () => ({ direction: "Up", step: 1 / 0 }));
|
|
2725
2738
|
}
|
|
2726
2739
|
/**
|
|
2727
2740
|
* Migrate up/down to a specific migration.
|
|
@@ -2747,16 +2760,16 @@ class be {
|
|
|
2747
2760
|
* ```
|
|
2748
2761
|
*/
|
|
2749
2762
|
async migrateTo(e) {
|
|
2750
|
-
return _(this,
|
|
2751
|
-
if (e ===
|
|
2763
|
+
return _(this, l, J).call(this, ({ migrations: a, executedMigrations: r, pendingMigrations: n }) => {
|
|
2764
|
+
if (e === ur)
|
|
2752
2765
|
return { direction: "Down", step: 1 / 0 };
|
|
2753
|
-
if (!a.find((
|
|
2766
|
+
if (!a.find((c) => c.name === e))
|
|
2754
2767
|
throw new Error(`migration "${e}" doesn't exist`);
|
|
2755
|
-
const
|
|
2756
|
-
if (
|
|
2768
|
+
const o = r.indexOf(e), s = n.findIndex((c) => c.name === e);
|
|
2769
|
+
if (o !== -1)
|
|
2757
2770
|
return {
|
|
2758
2771
|
direction: "Down",
|
|
2759
|
-
step: r.length -
|
|
2772
|
+
step: r.length - o - 1
|
|
2760
2773
|
};
|
|
2761
2774
|
if (s !== -1)
|
|
2762
2775
|
return { direction: "Up", step: s + 1 };
|
|
@@ -2778,7 +2791,7 @@ class be {
|
|
|
2778
2791
|
* ```
|
|
2779
2792
|
*/
|
|
2780
2793
|
async migrateUp() {
|
|
2781
|
-
return _(this,
|
|
2794
|
+
return _(this, l, J).call(this, () => ({ direction: "Up", step: 1 }));
|
|
2782
2795
|
}
|
|
2783
2796
|
/**
|
|
2784
2797
|
* Migrate one step down.
|
|
@@ -2795,95 +2808,95 @@ class be {
|
|
|
2795
2808
|
* ```
|
|
2796
2809
|
*/
|
|
2797
2810
|
async migrateDown() {
|
|
2798
|
-
return _(this,
|
|
2811
|
+
return _(this, l, J).call(this, () => ({ direction: "Down", step: 1 }));
|
|
2799
2812
|
}
|
|
2800
2813
|
}
|
|
2801
|
-
f = new WeakMap(),
|
|
2814
|
+
f = new WeakMap(), l = new WeakSet(), J = async function(e) {
|
|
2802
2815
|
try {
|
|
2803
|
-
return await _(this,
|
|
2816
|
+
return await _(this, l, Te).call(this), await _(this, l, De).call(this, e);
|
|
2804
2817
|
} catch (a) {
|
|
2805
2818
|
return a instanceof G ? a.resultSet : { error: a };
|
|
2806
2819
|
}
|
|
2807
2820
|
}, x = function() {
|
|
2808
2821
|
return d(this, f).migrationTableSchema;
|
|
2809
2822
|
}, T = function() {
|
|
2810
|
-
return d(this, f).migrationTableName ??
|
|
2823
|
+
return d(this, f).migrationTableName ?? cr;
|
|
2811
2824
|
}, P = function() {
|
|
2812
2825
|
return d(this, f).migrationLockTableName ?? fe;
|
|
2813
2826
|
}, xe = function() {
|
|
2814
|
-
return d(this, f).allowUnorderedMigrations ??
|
|
2827
|
+
return d(this, f).allowUnorderedMigrations ?? dr;
|
|
2815
2828
|
}, S = function() {
|
|
2816
|
-
return d(this,
|
|
2829
|
+
return d(this, l, x) ? new ir(d(this, l, x)) : new lr();
|
|
2817
2830
|
}, Te = async function() {
|
|
2818
|
-
await _(this,
|
|
2831
|
+
await _(this, l, Se).call(this), await _(this, l, Oe).call(this), await _(this, l, ke).call(this), await _(this, l, $e).call(this);
|
|
2819
2832
|
}, Se = async function() {
|
|
2820
|
-
if (d(this,
|
|
2833
|
+
if (d(this, l, x) && !await _(this, l, Z).call(this))
|
|
2821
2834
|
try {
|
|
2822
|
-
await _(this,
|
|
2835
|
+
await _(this, l, E).call(this, d(this, f).db.schema.createSchema(d(this, l, x)));
|
|
2823
2836
|
} catch (e) {
|
|
2824
|
-
if (!await _(this,
|
|
2837
|
+
if (!await _(this, l, Z).call(this))
|
|
2825
2838
|
throw e;
|
|
2826
2839
|
}
|
|
2827
2840
|
}, Oe = async function() {
|
|
2828
|
-
if (!await _(this,
|
|
2841
|
+
if (!await _(this, l, F).call(this, d(this, l, T)))
|
|
2829
2842
|
try {
|
|
2830
|
-
d(this,
|
|
2843
|
+
d(this, l, x) && await _(this, l, E).call(this, d(this, f).db.schema.createSchema(d(this, l, x))), await _(this, l, E).call(this, d(this, f).db.schema.withPlugin(d(this, l, S)).createTable(d(this, l, T)).addColumn("name", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("timestamp", "varchar(255)", (e) => e.notNull()));
|
|
2831
2844
|
} catch (e) {
|
|
2832
|
-
if (!await _(this,
|
|
2845
|
+
if (!await _(this, l, F).call(this, d(this, l, T)))
|
|
2833
2846
|
throw e;
|
|
2834
2847
|
}
|
|
2835
2848
|
}, ke = async function() {
|
|
2836
|
-
if (!await _(this,
|
|
2849
|
+
if (!await _(this, l, F).call(this, d(this, l, P)))
|
|
2837
2850
|
try {
|
|
2838
|
-
await _(this,
|
|
2851
|
+
await _(this, l, E).call(this, d(this, f).db.schema.withPlugin(d(this, l, S)).createTable(d(this, l, P)).addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("is_locked", "integer", (e) => e.notNull().defaultTo(0)));
|
|
2839
2852
|
} catch (e) {
|
|
2840
|
-
if (!await _(this,
|
|
2853
|
+
if (!await _(this, l, F).call(this, d(this, l, P)))
|
|
2841
2854
|
throw e;
|
|
2842
2855
|
}
|
|
2843
2856
|
}, $e = async function() {
|
|
2844
|
-
if (!await _(this,
|
|
2857
|
+
if (!await _(this, l, ee).call(this))
|
|
2845
2858
|
try {
|
|
2846
|
-
await d(this, f).db.withPlugin(d(this,
|
|
2859
|
+
await d(this, f).db.withPlugin(d(this, l, S)).insertInto(d(this, l, P)).values({ id: W, is_locked: 0 }).execute();
|
|
2847
2860
|
} catch (e) {
|
|
2848
|
-
if (!await _(this,
|
|
2861
|
+
if (!await _(this, l, ee).call(this))
|
|
2849
2862
|
throw e;
|
|
2850
2863
|
}
|
|
2851
2864
|
}, Z = async function() {
|
|
2852
|
-
return (await d(this, f).db.introspection.getSchemas()).some((a) => a.name === d(this,
|
|
2865
|
+
return (await d(this, f).db.introspection.getSchemas()).some((a) => a.name === d(this, l, x));
|
|
2853
2866
|
}, F = async function(e) {
|
|
2854
|
-
const a = d(this,
|
|
2867
|
+
const a = d(this, l, x);
|
|
2855
2868
|
return (await d(this, f).db.introspection.getTables({
|
|
2856
2869
|
withInternalKyselyTables: !0
|
|
2857
|
-
})).some((
|
|
2870
|
+
})).some((n) => n.name === e && (!a || n.schema === a));
|
|
2858
2871
|
}, ee = async function() {
|
|
2859
|
-
return !!await d(this, f).db.withPlugin(d(this,
|
|
2872
|
+
return !!await d(this, f).db.withPlugin(d(this, l, S)).selectFrom(d(this, l, P)).where("id", "=", W).select("id").executeTakeFirst();
|
|
2860
2873
|
}, De = async function(e) {
|
|
2861
|
-
const a = d(this, f).db.getExecutor().adapter, r =
|
|
2874
|
+
const a = d(this, f).db.getExecutor().adapter, r = y({
|
|
2862
2875
|
lockTable: d(this, f).migrationLockTableName ?? fe,
|
|
2863
2876
|
lockRowId: W,
|
|
2864
2877
|
lockTableSchema: d(this, f).migrationTableSchema
|
|
2865
|
-
}),
|
|
2878
|
+
}), n = async (o) => {
|
|
2866
2879
|
try {
|
|
2867
|
-
await a.acquireMigrationLock(
|
|
2868
|
-
const s = await _(this,
|
|
2880
|
+
await a.acquireMigrationLock(o, r);
|
|
2881
|
+
const s = await _(this, l, Ie).call(this, o);
|
|
2869
2882
|
if (s.migrations.length === 0)
|
|
2870
2883
|
return { results: [] };
|
|
2871
|
-
const { direction:
|
|
2872
|
-
return i <= 0 ? { results: [] } :
|
|
2884
|
+
const { direction: c, step: i } = e(s);
|
|
2885
|
+
return i <= 0 ? { results: [] } : c === "Down" ? await _(this, l, Ae).call(this, o, s, i) : c === "Up" ? await _(this, l, ze).call(this, o, s, i) : { results: [] };
|
|
2873
2886
|
} finally {
|
|
2874
|
-
await a.releaseMigrationLock(
|
|
2887
|
+
await a.releaseMigrationLock(o, r);
|
|
2875
2888
|
}
|
|
2876
2889
|
};
|
|
2877
|
-
return a.supportsTransactionalDdl ? d(this, f).db.transaction().execute(
|
|
2890
|
+
return a.supportsTransactionalDdl ? d(this, f).db.transaction().execute(n) : d(this, f).db.connection().execute(n);
|
|
2878
2891
|
}, Ie = async function(e) {
|
|
2879
|
-
const a = await _(this,
|
|
2880
|
-
_(this,
|
|
2881
|
-
const
|
|
2882
|
-
return
|
|
2892
|
+
const a = await _(this, l, te).call(this), r = await _(this, l, Pe).call(this, e);
|
|
2893
|
+
_(this, l, Fe).call(this, a, r), d(this, l, xe) || _(this, l, Me).call(this, a, r);
|
|
2894
|
+
const n = _(this, l, je).call(this, a, r);
|
|
2895
|
+
return y({
|
|
2883
2896
|
migrations: a,
|
|
2884
2897
|
executedMigrations: r,
|
|
2885
|
-
lastMigration:
|
|
2886
|
-
pendingMigrations:
|
|
2898
|
+
lastMigration: ar(r),
|
|
2899
|
+
pendingMigrations: n
|
|
2887
2900
|
});
|
|
2888
2901
|
}, je = function(e, a) {
|
|
2889
2902
|
return e.filter((r) => !a.includes(r.name));
|
|
@@ -2894,85 +2907,85 @@ f = new WeakMap(), c = new WeakSet(), J = async function(e) {
|
|
|
2894
2907
|
name: a
|
|
2895
2908
|
}));
|
|
2896
2909
|
}, Pe = async function(e) {
|
|
2897
|
-
return (await e.withPlugin(d(this,
|
|
2910
|
+
return (await e.withPlugin(d(this, l, S)).selectFrom(d(this, l, T)).select("name").orderBy(["timestamp", "name"]).execute()).map((r) => r.name);
|
|
2898
2911
|
}, Fe = function(e, a) {
|
|
2899
2912
|
for (const r of a)
|
|
2900
|
-
if (!e.some((
|
|
2913
|
+
if (!e.some((n) => n.name === r))
|
|
2901
2914
|
throw new Error(`corrupted migrations: previously executed migration ${r} is missing`);
|
|
2902
2915
|
}, Me = function(e, a) {
|
|
2903
2916
|
for (let r = 0; r < a.length; ++r)
|
|
2904
2917
|
if (e[r].name !== a[r])
|
|
2905
2918
|
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.`);
|
|
2906
2919
|
}, Ae = async function(e, a, r) {
|
|
2907
|
-
const
|
|
2920
|
+
const n = a.executedMigrations.slice().reverse().slice(0, r).map((s) => a.migrations.find((c) => c.name === s)), o = n.map((s) => ({
|
|
2908
2921
|
migrationName: s.name,
|
|
2909
2922
|
direction: "Down",
|
|
2910
2923
|
status: "NotExecuted"
|
|
2911
2924
|
}));
|
|
2912
|
-
for (let s = 0; s <
|
|
2913
|
-
const
|
|
2925
|
+
for (let s = 0; s < o.length; ++s) {
|
|
2926
|
+
const c = n[s];
|
|
2914
2927
|
try {
|
|
2915
|
-
|
|
2916
|
-
migrationName:
|
|
2928
|
+
c.down && (await c.down(e), await e.withPlugin(d(this, l, S)).deleteFrom(d(this, l, T)).where("name", "=", c.name).execute(), o[s] = {
|
|
2929
|
+
migrationName: c.name,
|
|
2917
2930
|
direction: "Down",
|
|
2918
2931
|
status: "Success"
|
|
2919
2932
|
});
|
|
2920
2933
|
} catch (i) {
|
|
2921
|
-
throw
|
|
2922
|
-
migrationName:
|
|
2934
|
+
throw o[s] = {
|
|
2935
|
+
migrationName: c.name,
|
|
2923
2936
|
direction: "Down",
|
|
2924
2937
|
status: "Error"
|
|
2925
2938
|
}, new G({
|
|
2926
2939
|
error: i,
|
|
2927
|
-
results:
|
|
2940
|
+
results: o
|
|
2928
2941
|
});
|
|
2929
2942
|
}
|
|
2930
2943
|
}
|
|
2931
|
-
return { results:
|
|
2944
|
+
return { results: o };
|
|
2932
2945
|
}, ze = async function(e, a, r) {
|
|
2933
|
-
const
|
|
2946
|
+
const o = a.pendingMigrations.slice(0, r).map((s) => ({
|
|
2934
2947
|
migrationName: s.name,
|
|
2935
2948
|
direction: "Up",
|
|
2936
2949
|
status: "NotExecuted"
|
|
2937
2950
|
}));
|
|
2938
|
-
for (let s = 0; s <
|
|
2939
|
-
const
|
|
2951
|
+
for (let s = 0; s < o.length; s++) {
|
|
2952
|
+
const c = a.pendingMigrations[s];
|
|
2940
2953
|
try {
|
|
2941
|
-
await
|
|
2942
|
-
name:
|
|
2954
|
+
await c.up(e), await e.withPlugin(d(this, l, S)).insertInto(d(this, l, T)).values({
|
|
2955
|
+
name: c.name,
|
|
2943
2956
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
2944
|
-
}).execute(),
|
|
2945
|
-
migrationName:
|
|
2957
|
+
}).execute(), o[s] = {
|
|
2958
|
+
migrationName: c.name,
|
|
2946
2959
|
direction: "Up",
|
|
2947
2960
|
status: "Success"
|
|
2948
2961
|
};
|
|
2949
2962
|
} catch (i) {
|
|
2950
|
-
throw
|
|
2951
|
-
migrationName:
|
|
2963
|
+
throw o[s] = {
|
|
2964
|
+
migrationName: c.name,
|
|
2952
2965
|
direction: "Up",
|
|
2953
2966
|
status: "Error"
|
|
2954
2967
|
}, new G({
|
|
2955
2968
|
error: i,
|
|
2956
|
-
results:
|
|
2969
|
+
results: o
|
|
2957
2970
|
});
|
|
2958
2971
|
}
|
|
2959
2972
|
}
|
|
2960
|
-
return { results:
|
|
2973
|
+
return { results: o };
|
|
2961
2974
|
}, E = async function(e) {
|
|
2962
2975
|
d(this, f).db.getExecutor().adapter.supportsCreateIfNotExists && (e = e.ifNotExists()), await e.execute();
|
|
2963
2976
|
};
|
|
2964
|
-
var
|
|
2977
|
+
var R;
|
|
2965
2978
|
class G extends Error {
|
|
2966
2979
|
constructor(a) {
|
|
2967
2980
|
super();
|
|
2968
|
-
b(this,
|
|
2969
|
-
L(this,
|
|
2981
|
+
b(this, R);
|
|
2982
|
+
L(this, R, a);
|
|
2970
2983
|
}
|
|
2971
2984
|
get resultSet() {
|
|
2972
|
-
return d(this,
|
|
2985
|
+
return d(this, R);
|
|
2973
2986
|
}
|
|
2974
2987
|
}
|
|
2975
|
-
|
|
2988
|
+
R = new WeakMap();
|
|
2976
2989
|
class Le {
|
|
2977
2990
|
constructor(e) {
|
|
2978
2991
|
z(this, "migrations");
|
|
@@ -2982,7 +2995,7 @@ class Le {
|
|
|
2982
2995
|
return this.migrations;
|
|
2983
2996
|
}
|
|
2984
2997
|
}
|
|
2985
|
-
async function
|
|
2998
|
+
async function mr(t) {
|
|
2986
2999
|
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(
|
|
2987
3000
|
"tenant_id",
|
|
2988
3001
|
"varchar(255)",
|
|
@@ -3054,35 +3067,35 @@ async function _r(t) {
|
|
|
3054
3067
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
3055
3068
|
).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();
|
|
3056
3069
|
}
|
|
3057
|
-
async function
|
|
3070
|
+
async function _r(t) {
|
|
3058
3071
|
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();
|
|
3059
3072
|
}
|
|
3060
|
-
const
|
|
3073
|
+
const hr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3061
3074
|
__proto__: null,
|
|
3062
|
-
down:
|
|
3063
|
-
up:
|
|
3075
|
+
down: _r,
|
|
3076
|
+
up: mr
|
|
3064
3077
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3065
|
-
async function
|
|
3078
|
+
async function fr(t) {
|
|
3066
3079
|
await t.schema.alterTable("tenants").addColumn("support_url", "varchar(255)").execute();
|
|
3067
3080
|
}
|
|
3068
|
-
async function
|
|
3081
|
+
async function pr(t) {
|
|
3069
3082
|
await t.schema.alterTable("tenants").dropColumn("support_url").execute();
|
|
3070
3083
|
}
|
|
3071
|
-
const
|
|
3084
|
+
const gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3072
3085
|
__proto__: null,
|
|
3073
|
-
down:
|
|
3074
|
-
up:
|
|
3086
|
+
down: pr,
|
|
3087
|
+
up: fr
|
|
3075
3088
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3076
|
-
async function
|
|
3089
|
+
async function wr(t) {
|
|
3077
3090
|
}
|
|
3078
|
-
async function
|
|
3091
|
+
async function yr(t) {
|
|
3079
3092
|
}
|
|
3080
|
-
const
|
|
3093
|
+
const vr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3081
3094
|
__proto__: null,
|
|
3082
|
-
down:
|
|
3083
|
-
up:
|
|
3095
|
+
down: yr,
|
|
3096
|
+
up: wr
|
|
3084
3097
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3085
|
-
async function
|
|
3098
|
+
async function Nr(t) {
|
|
3086
3099
|
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(
|
|
3087
3100
|
"tenant_id_constraint",
|
|
3088
3101
|
["tenant_id"],
|
|
@@ -3091,24 +3104,24 @@ async function Cr(t) {
|
|
|
3091
3104
|
(e) => e.onDelete("cascade")
|
|
3092
3105
|
).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();
|
|
3093
3106
|
}
|
|
3094
|
-
async function
|
|
3107
|
+
async function Cr(t) {
|
|
3095
3108
|
await t.schema.dropTable("logs").execute();
|
|
3096
3109
|
}
|
|
3097
|
-
const
|
|
3110
|
+
const br = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3098
3111
|
__proto__: null,
|
|
3099
|
-
down:
|
|
3100
|
-
up:
|
|
3112
|
+
down: Cr,
|
|
3113
|
+
up: Nr
|
|
3101
3114
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3102
|
-
async function
|
|
3115
|
+
async function xr(t) {
|
|
3103
3116
|
}
|
|
3104
|
-
async function
|
|
3117
|
+
async function Tr(t) {
|
|
3105
3118
|
}
|
|
3106
|
-
const
|
|
3119
|
+
const Sr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3107
3120
|
__proto__: null,
|
|
3108
|
-
down:
|
|
3109
|
-
up:
|
|
3121
|
+
down: Tr,
|
|
3122
|
+
up: xr
|
|
3110
3123
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3111
|
-
async function
|
|
3124
|
+
async function Or(t) {
|
|
3112
3125
|
await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
3113
3126
|
"user_id_constraint",
|
|
3114
3127
|
["user_id", "tenant_id"],
|
|
@@ -3133,15 +3146,15 @@ async function kr(t) {
|
|
|
3133
3146
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
3134
3147
|
).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();
|
|
3135
3148
|
}
|
|
3136
|
-
async function
|
|
3149
|
+
async function kr(t) {
|
|
3137
3150
|
await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("tickets").execute(), await t.schema.dropTable("otps").execute();
|
|
3138
3151
|
}
|
|
3139
|
-
const
|
|
3152
|
+
const $r = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3140
3153
|
__proto__: null,
|
|
3141
|
-
down:
|
|
3142
|
-
up:
|
|
3154
|
+
down: kr,
|
|
3155
|
+
up: Or
|
|
3143
3156
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3144
|
-
async function
|
|
3157
|
+
async function Dr(t) {
|
|
3145
3158
|
await t.schema.createTable("passwords").addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addPrimaryKeyConstraint("passwords_pkey", ["user_id", "tenant_id"]).addForeignKeyConstraint(
|
|
3146
3159
|
"user_id_constraint",
|
|
3147
3160
|
["user_id", "tenant_id"],
|
|
@@ -3156,24 +3169,24 @@ async function Ir(t) {
|
|
|
3156
3169
|
(e) => e.onDelete("cascade")
|
|
3157
3170
|
).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();
|
|
3158
3171
|
}
|
|
3159
|
-
async function
|
|
3172
|
+
async function Ir(t) {
|
|
3160
3173
|
await t.schema.dropTable("passwords").execute(), await t.schema.dropTable("codes").execute();
|
|
3161
3174
|
}
|
|
3162
|
-
const
|
|
3175
|
+
const jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3163
3176
|
__proto__: null,
|
|
3164
|
-
down:
|
|
3165
|
-
up:
|
|
3177
|
+
down: Ir,
|
|
3178
|
+
up: Dr
|
|
3166
3179
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3167
|
-
async function
|
|
3180
|
+
async function Pr(t) {
|
|
3168
3181
|
}
|
|
3169
|
-
async function
|
|
3182
|
+
async function Fr(t) {
|
|
3170
3183
|
}
|
|
3171
|
-
const
|
|
3184
|
+
const Mr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3172
3185
|
__proto__: null,
|
|
3173
|
-
down:
|
|
3174
|
-
up:
|
|
3186
|
+
down: Fr,
|
|
3187
|
+
up: Pr
|
|
3175
3188
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3176
|
-
async function
|
|
3189
|
+
async function Ar(t) {
|
|
3177
3190
|
await t.schema.alterTable("passwords").addColumn(
|
|
3178
3191
|
"password",
|
|
3179
3192
|
"varchar(255)",
|
|
@@ -3181,288 +3194,288 @@ async function zr(t) {
|
|
|
3181
3194
|
(e) => e.notNull()
|
|
3182
3195
|
).execute();
|
|
3183
3196
|
}
|
|
3184
|
-
async function
|
|
3197
|
+
async function zr(t) {
|
|
3185
3198
|
await t.schema.alterTable("passwords").dropColumn("password").execute();
|
|
3186
3199
|
}
|
|
3187
|
-
const
|
|
3200
|
+
const Lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3188
3201
|
__proto__: null,
|
|
3189
|
-
down:
|
|
3190
|
-
up:
|
|
3202
|
+
down: zr,
|
|
3203
|
+
up: Ar
|
|
3191
3204
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3192
|
-
async function
|
|
3205
|
+
async function Jr(t) {
|
|
3193
3206
|
}
|
|
3194
|
-
async function
|
|
3207
|
+
async function Er(t) {
|
|
3195
3208
|
}
|
|
3196
3209
|
const Kr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3197
3210
|
__proto__: null,
|
|
3198
|
-
down:
|
|
3199
|
-
up:
|
|
3211
|
+
down: Er,
|
|
3212
|
+
up: Jr
|
|
3200
3213
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3201
|
-
async function
|
|
3214
|
+
async function Rr(t) {
|
|
3202
3215
|
}
|
|
3203
|
-
async function
|
|
3216
|
+
async function Br(t) {
|
|
3204
3217
|
}
|
|
3205
|
-
const
|
|
3218
|
+
const Ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3206
3219
|
__proto__: null,
|
|
3207
|
-
down:
|
|
3208
|
-
up:
|
|
3220
|
+
down: Br,
|
|
3221
|
+
up: Rr
|
|
3209
3222
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3210
3223
|
async function qr(t) {
|
|
3211
3224
|
}
|
|
3212
|
-
async function
|
|
3225
|
+
async function Qr(t) {
|
|
3213
3226
|
}
|
|
3214
|
-
const
|
|
3227
|
+
const Vr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3215
3228
|
__proto__: null,
|
|
3216
|
-
down:
|
|
3229
|
+
down: Qr,
|
|
3217
3230
|
up: qr
|
|
3218
3231
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3219
|
-
async function
|
|
3232
|
+
async function Wr(t) {
|
|
3220
3233
|
await t.schema.createIndex("users_email_index").on("users").column("email").execute();
|
|
3221
3234
|
}
|
|
3222
|
-
async function
|
|
3235
|
+
async function Gr(t) {
|
|
3223
3236
|
await t.schema.dropIndex("users_email_index").execute();
|
|
3224
3237
|
}
|
|
3225
|
-
const
|
|
3238
|
+
const Hr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3226
3239
|
__proto__: null,
|
|
3227
|
-
down:
|
|
3228
|
-
up:
|
|
3240
|
+
down: Gr,
|
|
3241
|
+
up: Wr
|
|
3229
3242
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3230
|
-
async function
|
|
3243
|
+
async function Xr(t) {
|
|
3231
3244
|
await t.schema.alterTable("users").addColumn("profileData", "varchar(2048)").execute();
|
|
3232
3245
|
}
|
|
3233
|
-
async function
|
|
3246
|
+
async function Yr(t) {
|
|
3234
3247
|
await t.schema.alterTable("users").dropColumn("profileData").execute();
|
|
3235
3248
|
}
|
|
3236
|
-
const
|
|
3249
|
+
const Zr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3237
3250
|
__proto__: null,
|
|
3238
|
-
down:
|
|
3239
|
-
up:
|
|
3251
|
+
down: Yr,
|
|
3252
|
+
up: Xr
|
|
3240
3253
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3241
|
-
async function
|
|
3254
|
+
async function en(t) {
|
|
3242
3255
|
await t.schema.createIndex("users_linked_to_index").on("users").column("linked_to").execute();
|
|
3243
3256
|
}
|
|
3244
|
-
async function
|
|
3257
|
+
async function tn(t) {
|
|
3245
3258
|
await t.schema.dropIndex("users_linked_to_index");
|
|
3246
3259
|
}
|
|
3247
|
-
const
|
|
3260
|
+
const an = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3248
3261
|
__proto__: null,
|
|
3249
|
-
down:
|
|
3250
|
-
up:
|
|
3262
|
+
down: tn,
|
|
3263
|
+
up: en
|
|
3251
3264
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3252
|
-
async function
|
|
3265
|
+
async function rn(t) {
|
|
3253
3266
|
await t.schema.alterTable("users").addColumn("locale", "varchar(255)").execute();
|
|
3254
3267
|
}
|
|
3255
|
-
async function
|
|
3268
|
+
async function nn(t) {
|
|
3256
3269
|
await t.schema.alterTable("users").dropColumn("locale").execute();
|
|
3257
3270
|
}
|
|
3258
|
-
const
|
|
3271
|
+
const on = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3259
3272
|
__proto__: null,
|
|
3260
|
-
down:
|
|
3261
|
-
up:
|
|
3273
|
+
down: nn,
|
|
3274
|
+
up: rn
|
|
3262
3275
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3263
|
-
async function
|
|
3276
|
+
async function sn(t) {
|
|
3264
3277
|
await t.schema.createTable("keys").addColumn("kid", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
3265
3278
|
"tenant_id",
|
|
3266
3279
|
"varchar(255)",
|
|
3267
3280
|
(e) => e.references("tenants.id").onDelete("cascade")
|
|
3268
3281
|
).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("revoked_at", "varchar(255)").addColumn("cert", "varchar(2048)").addColumn("pkcs7", "varchar(2048)").addColumn("fingerprint", "varchar(256)").addColumn("thumbprint", "varchar(256)").addColumn("current_since", "varchar(256)").addColumn("current_until", "varchar(256)").execute();
|
|
3269
3282
|
}
|
|
3270
|
-
async function
|
|
3283
|
+
async function ln(t) {
|
|
3271
3284
|
await t.schema.dropTable("keys").execute();
|
|
3272
3285
|
}
|
|
3273
|
-
const
|
|
3286
|
+
const cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3274
3287
|
__proto__: null,
|
|
3275
|
-
down:
|
|
3276
|
-
up:
|
|
3288
|
+
down: ln,
|
|
3289
|
+
up: sn
|
|
3277
3290
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3278
|
-
async function
|
|
3291
|
+
async function dn(t) {
|
|
3279
3292
|
}
|
|
3280
|
-
async function
|
|
3293
|
+
async function un(t) {
|
|
3281
3294
|
}
|
|
3282
|
-
const
|
|
3295
|
+
const mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3283
3296
|
__proto__: null,
|
|
3284
|
-
down:
|
|
3285
|
-
up:
|
|
3297
|
+
down: un,
|
|
3298
|
+
up: dn
|
|
3286
3299
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3287
|
-
async function
|
|
3300
|
+
async function _n(t) {
|
|
3288
3301
|
}
|
|
3289
|
-
async function
|
|
3302
|
+
async function hn(t) {
|
|
3290
3303
|
}
|
|
3291
|
-
const
|
|
3304
|
+
const fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3292
3305
|
__proto__: null,
|
|
3293
|
-
down:
|
|
3294
|
-
up:
|
|
3306
|
+
down: hn,
|
|
3307
|
+
up: _n
|
|
3295
3308
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3296
|
-
async function
|
|
3309
|
+
async function pn(t) {
|
|
3297
3310
|
await t.schema.alterTable("otps").addColumn("audience", "varchar(255)").execute();
|
|
3298
3311
|
}
|
|
3299
|
-
async function
|
|
3312
|
+
async function gn(t) {
|
|
3300
3313
|
await t.schema.alterTable("otps").dropColumn("audience").execute();
|
|
3301
3314
|
}
|
|
3302
|
-
const
|
|
3315
|
+
const wn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3303
3316
|
__proto__: null,
|
|
3304
|
-
down:
|
|
3305
|
-
up:
|
|
3317
|
+
down: gn,
|
|
3318
|
+
up: pn
|
|
3306
3319
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3307
|
-
async function
|
|
3320
|
+
async function yn(t) {
|
|
3308
3321
|
}
|
|
3309
|
-
async function
|
|
3322
|
+
async function vn(t) {
|
|
3310
3323
|
}
|
|
3311
|
-
const
|
|
3324
|
+
const Nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3312
3325
|
__proto__: null,
|
|
3313
|
-
down:
|
|
3314
|
-
up:
|
|
3326
|
+
down: vn,
|
|
3327
|
+
up: yn
|
|
3315
3328
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3316
|
-
async function
|
|
3329
|
+
async function Cn(t) {
|
|
3317
3330
|
await t.schema.alterTable("logs").dropColumn("category").execute();
|
|
3318
3331
|
}
|
|
3319
|
-
async function
|
|
3332
|
+
async function bn(t) {
|
|
3320
3333
|
await t.schema.alterTable("logs").addColumn("category", "varchar(255)", (e) => e.notNull()).execute();
|
|
3321
3334
|
}
|
|
3322
|
-
const
|
|
3335
|
+
const xn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3323
3336
|
__proto__: null,
|
|
3324
|
-
down:
|
|
3325
|
-
up:
|
|
3337
|
+
down: bn,
|
|
3338
|
+
up: Cn
|
|
3326
3339
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3327
|
-
async function
|
|
3340
|
+
async function Tn(t) {
|
|
3328
3341
|
await t.schema.alterTable("users").dropColumn("tags").execute();
|
|
3329
3342
|
}
|
|
3330
|
-
async function
|
|
3343
|
+
async function Sn(t) {
|
|
3331
3344
|
await t.schema.alterTable("users").addColumn("tags", "varchar(255)").execute();
|
|
3332
3345
|
}
|
|
3333
|
-
const
|
|
3346
|
+
const On = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3334
3347
|
__proto__: null,
|
|
3335
|
-
down:
|
|
3336
|
-
up:
|
|
3348
|
+
down: Sn,
|
|
3349
|
+
up: Tn
|
|
3337
3350
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3338
|
-
async function
|
|
3351
|
+
async function kn(t) {
|
|
3339
3352
|
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();
|
|
3340
3353
|
}
|
|
3341
|
-
async function
|
|
3354
|
+
async function $n(t) {
|
|
3342
3355
|
await t.schema.dropIndex("logs_user_id"), await t.schema.dropIndex("logs_tenant_id"), await t.schema.dropIndex("logs_date");
|
|
3343
3356
|
}
|
|
3344
|
-
const
|
|
3357
|
+
const Dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3345
3358
|
__proto__: null,
|
|
3346
|
-
down:
|
|
3347
|
-
up:
|
|
3359
|
+
down: $n,
|
|
3360
|
+
up: kn
|
|
3348
3361
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3349
|
-
async function
|
|
3362
|
+
async function In(t) {
|
|
3350
3363
|
await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(8192)").execute();
|
|
3351
3364
|
}
|
|
3352
|
-
async function
|
|
3365
|
+
async function jn(t) {
|
|
3353
3366
|
await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(2048)").execute();
|
|
3354
3367
|
}
|
|
3355
|
-
const
|
|
3368
|
+
const Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3356
3369
|
__proto__: null,
|
|
3357
|
-
down:
|
|
3358
|
-
up:
|
|
3370
|
+
down: jn,
|
|
3371
|
+
up: In
|
|
3359
3372
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3360
|
-
async function
|
|
3373
|
+
async function Fn(t) {
|
|
3361
3374
|
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();
|
|
3362
3375
|
}
|
|
3363
|
-
async function
|
|
3376
|
+
async function Mn(t) {
|
|
3364
3377
|
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();
|
|
3365
3378
|
}
|
|
3366
|
-
const
|
|
3379
|
+
const An = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3367
3380
|
__proto__: null,
|
|
3368
|
-
down:
|
|
3369
|
-
up:
|
|
3381
|
+
down: Mn,
|
|
3382
|
+
up: Fn
|
|
3370
3383
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3371
|
-
async function
|
|
3384
|
+
async function zn(t) {
|
|
3372
3385
|
await t.schema.createIndex("users_name_index").on("users").column("name").execute();
|
|
3373
3386
|
}
|
|
3374
|
-
async function
|
|
3387
|
+
async function Ln(t) {
|
|
3375
3388
|
await t.schema.dropIndex("users_name_index").execute();
|
|
3376
3389
|
}
|
|
3377
|
-
const
|
|
3390
|
+
const Jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3378
3391
|
__proto__: null,
|
|
3379
|
-
down:
|
|
3380
|
-
up:
|
|
3392
|
+
down: Ln,
|
|
3393
|
+
up: zn
|
|
3381
3394
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3382
|
-
async function
|
|
3395
|
+
async function En(t) {
|
|
3383
3396
|
}
|
|
3384
3397
|
async function Kn(t) {
|
|
3385
3398
|
await t.schema.alterTable("users").dropConstraint("unique_email_provider").execute();
|
|
3386
3399
|
}
|
|
3387
|
-
const
|
|
3400
|
+
const Rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3388
3401
|
__proto__: null,
|
|
3389
3402
|
down: Kn,
|
|
3390
|
-
up:
|
|
3403
|
+
up: En
|
|
3391
3404
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3392
|
-
async function
|
|
3405
|
+
async function Bn(t) {
|
|
3393
3406
|
await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(8192)").execute();
|
|
3394
3407
|
}
|
|
3395
|
-
async function
|
|
3408
|
+
async function Un(t) {
|
|
3396
3409
|
await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(1024)").execute();
|
|
3397
3410
|
}
|
|
3398
3411
|
const qn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3399
3412
|
__proto__: null,
|
|
3400
|
-
down:
|
|
3401
|
-
up:
|
|
3413
|
+
down: Un,
|
|
3414
|
+
up: Bn
|
|
3402
3415
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3403
|
-
async function
|
|
3416
|
+
async function Qn(t) {
|
|
3404
3417
|
await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(8192)").execute();
|
|
3405
3418
|
}
|
|
3406
|
-
async function
|
|
3419
|
+
async function Vn(t) {
|
|
3407
3420
|
await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(1024)").execute();
|
|
3408
3421
|
}
|
|
3409
|
-
const
|
|
3422
|
+
const Wn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3410
3423
|
__proto__: null,
|
|
3411
|
-
down:
|
|
3412
|
-
up:
|
|
3424
|
+
down: Vn,
|
|
3425
|
+
up: Qn
|
|
3413
3426
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3414
|
-
async function
|
|
3427
|
+
async function Gn(t) {
|
|
3415
3428
|
await t.schema.createTable("branding").addColumn(
|
|
3416
3429
|
"tenant_id",
|
|
3417
3430
|
"varchar(255)",
|
|
3418
3431
|
(e) => e.references("tenants.id").onDelete("cascade").notNull().primaryKey()
|
|
3419
3432
|
).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();
|
|
3420
3433
|
}
|
|
3421
|
-
async function
|
|
3434
|
+
async function Hn(t) {
|
|
3422
3435
|
await t.schema.dropTable("branding").execute();
|
|
3423
3436
|
}
|
|
3424
|
-
const
|
|
3437
|
+
const Xn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3425
3438
|
__proto__: null,
|
|
3426
|
-
down:
|
|
3427
|
-
up:
|
|
3439
|
+
down: Hn,
|
|
3440
|
+
up: Gn
|
|
3428
3441
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3429
|
-
async function
|
|
3442
|
+
async function Yn(t) {
|
|
3430
3443
|
}
|
|
3431
|
-
async function
|
|
3444
|
+
async function Zn(t) {
|
|
3432
3445
|
}
|
|
3433
|
-
const
|
|
3446
|
+
const eo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3434
3447
|
__proto__: null,
|
|
3435
|
-
down:
|
|
3436
|
-
up:
|
|
3448
|
+
down: Zn,
|
|
3449
|
+
up: Yn
|
|
3437
3450
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3438
|
-
async function
|
|
3451
|
+
async function to(t) {
|
|
3439
3452
|
}
|
|
3440
|
-
async function
|
|
3453
|
+
async function ao(t) {
|
|
3441
3454
|
}
|
|
3442
|
-
const
|
|
3455
|
+
const ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3443
3456
|
__proto__: null,
|
|
3444
|
-
down:
|
|
3445
|
-
up:
|
|
3457
|
+
down: ao,
|
|
3458
|
+
up: to
|
|
3446
3459
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3447
|
-
async function
|
|
3460
|
+
async function no(t) {
|
|
3448
3461
|
}
|
|
3449
|
-
async function
|
|
3462
|
+
async function oo(t) {
|
|
3450
3463
|
}
|
|
3451
|
-
const
|
|
3464
|
+
const so = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3452
3465
|
__proto__: null,
|
|
3453
|
-
down:
|
|
3454
|
-
up:
|
|
3466
|
+
down: oo,
|
|
3467
|
+
up: no
|
|
3455
3468
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3456
|
-
async function
|
|
3469
|
+
async function io(t) {
|
|
3457
3470
|
}
|
|
3458
|
-
async function
|
|
3471
|
+
async function lo(t) {
|
|
3459
3472
|
}
|
|
3460
|
-
const
|
|
3473
|
+
const co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3461
3474
|
__proto__: null,
|
|
3462
|
-
down:
|
|
3463
|
-
up:
|
|
3475
|
+
down: lo,
|
|
3476
|
+
up: io
|
|
3464
3477
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3465
|
-
async function
|
|
3478
|
+
async function uo(t) {
|
|
3466
3479
|
await t.schema.createTable("authentication_codes").addColumn(
|
|
3467
3480
|
"tenant_id",
|
|
3468
3481
|
"varchar(255)",
|
|
@@ -3473,55 +3486,55 @@ async function mo(t) {
|
|
|
3473
3486
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
3474
3487
|
).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();
|
|
3475
3488
|
}
|
|
3476
|
-
async function
|
|
3489
|
+
async function mo(t) {
|
|
3477
3490
|
await t.schema.dropTable("authentication_codes").execute();
|
|
3478
3491
|
}
|
|
3479
|
-
const
|
|
3492
|
+
const _o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3480
3493
|
__proto__: null,
|
|
3481
|
-
down:
|
|
3482
|
-
up:
|
|
3494
|
+
down: mo,
|
|
3495
|
+
up: uo
|
|
3483
3496
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3484
|
-
async function
|
|
3497
|
+
async function ho(t) {
|
|
3485
3498
|
}
|
|
3486
|
-
async function
|
|
3499
|
+
async function fo(t) {
|
|
3487
3500
|
}
|
|
3488
|
-
const
|
|
3501
|
+
const po = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3489
3502
|
__proto__: null,
|
|
3490
|
-
down:
|
|
3491
|
-
up:
|
|
3503
|
+
down: fo,
|
|
3504
|
+
up: ho
|
|
3492
3505
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3493
|
-
async function
|
|
3506
|
+
async function go(t) {
|
|
3494
3507
|
await t.schema.alterTable("otps").addColumn("ip", "varchar(64)").execute();
|
|
3495
3508
|
}
|
|
3496
|
-
async function
|
|
3509
|
+
async function wo(t) {
|
|
3497
3510
|
await t.schema.alterTable("otps").dropColumn("ip").execute();
|
|
3498
3511
|
}
|
|
3499
|
-
const
|
|
3512
|
+
const yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3500
3513
|
__proto__: null,
|
|
3501
|
-
down:
|
|
3502
|
-
up:
|
|
3514
|
+
down: wo,
|
|
3515
|
+
up: go
|
|
3503
3516
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3504
|
-
async function
|
|
3517
|
+
async function vo(t) {
|
|
3505
3518
|
await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(1024)").execute();
|
|
3506
3519
|
}
|
|
3507
|
-
async function
|
|
3520
|
+
async function No(t) {
|
|
3508
3521
|
await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(255)").execute();
|
|
3509
3522
|
}
|
|
3510
|
-
const
|
|
3523
|
+
const Co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3511
3524
|
__proto__: null,
|
|
3512
|
-
down:
|
|
3513
|
-
up:
|
|
3525
|
+
down: No,
|
|
3526
|
+
up: vo
|
|
3514
3527
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3515
|
-
async function
|
|
3528
|
+
async function bo(t) {
|
|
3516
3529
|
}
|
|
3517
|
-
async function
|
|
3530
|
+
async function xo(t) {
|
|
3518
3531
|
}
|
|
3519
|
-
const
|
|
3532
|
+
const To = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3520
3533
|
__proto__: null,
|
|
3521
|
-
down:
|
|
3522
|
-
up:
|
|
3534
|
+
down: xo,
|
|
3535
|
+
up: bo
|
|
3523
3536
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3524
|
-
async function
|
|
3537
|
+
async function So(t) {
|
|
3525
3538
|
await t.schema.createTable("hooks").addColumn("hook_id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
|
|
3526
3539
|
"tenant_id",
|
|
3527
3540
|
"varchar(255)",
|
|
@@ -3532,33 +3545,33 @@ async function Oo(t) {
|
|
|
3532
3545
|
(e) => e.defaultTo(!1).notNull()
|
|
3533
3546
|
).addColumn("priority", "integer").execute();
|
|
3534
3547
|
}
|
|
3535
|
-
async function
|
|
3548
|
+
async function Oo(t) {
|
|
3536
3549
|
await t.schema.dropTable("hooks").execute();
|
|
3537
3550
|
}
|
|
3538
|
-
const
|
|
3551
|
+
const ko = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3539
3552
|
__proto__: null,
|
|
3540
|
-
down:
|
|
3541
|
-
up:
|
|
3553
|
+
down: Oo,
|
|
3554
|
+
up: So
|
|
3542
3555
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3543
|
-
async function
|
|
3556
|
+
async function $o(t) {
|
|
3544
3557
|
}
|
|
3545
|
-
async function
|
|
3558
|
+
async function Do(t) {
|
|
3546
3559
|
}
|
|
3547
|
-
const
|
|
3560
|
+
const Io = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3548
3561
|
__proto__: null,
|
|
3549
|
-
down:
|
|
3550
|
-
up:
|
|
3562
|
+
down: Do,
|
|
3563
|
+
up: $o
|
|
3551
3564
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3552
|
-
async function
|
|
3565
|
+
async function jo(t) {
|
|
3553
3566
|
}
|
|
3554
|
-
async function
|
|
3567
|
+
async function Po(t) {
|
|
3555
3568
|
}
|
|
3556
|
-
const
|
|
3569
|
+
const Fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3557
3570
|
__proto__: null,
|
|
3558
|
-
down:
|
|
3559
|
-
up:
|
|
3571
|
+
down: Po,
|
|
3572
|
+
up: jo
|
|
3560
3573
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3561
|
-
async function
|
|
3574
|
+
async function Mo(t) {
|
|
3562
3575
|
await t.schema.createTable("logins").addColumn("login_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
3563
3576
|
"tenant_id",
|
|
3564
3577
|
"varchar(255)",
|
|
@@ -3575,7 +3588,7 @@ async function Ao(t) {
|
|
|
3575
3588
|
(e) => e.onDelete("cascade")
|
|
3576
3589
|
).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();
|
|
3577
3590
|
}
|
|
3578
|
-
async function
|
|
3591
|
+
async function Ao(t) {
|
|
3579
3592
|
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(
|
|
3580
3593
|
"codes_user_id_tenant_id_constraint",
|
|
3581
3594
|
["user_id", "tenant_id"],
|
|
@@ -3584,90 +3597,90 @@ async function zo(t) {
|
|
|
3584
3597
|
(e) => e.onDelete("cascade")
|
|
3585
3598
|
).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();
|
|
3586
3599
|
}
|
|
3587
|
-
const
|
|
3600
|
+
const zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3588
3601
|
__proto__: null,
|
|
3589
|
-
down:
|
|
3590
|
-
up:
|
|
3602
|
+
down: Ao,
|
|
3603
|
+
up: Mo
|
|
3591
3604
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3592
|
-
async function
|
|
3605
|
+
async function Lo(t) {
|
|
3593
3606
|
}
|
|
3594
|
-
async function
|
|
3607
|
+
async function Jo(t) {
|
|
3595
3608
|
}
|
|
3596
|
-
const
|
|
3609
|
+
const Eo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3597
3610
|
__proto__: null,
|
|
3598
|
-
down:
|
|
3599
|
-
up:
|
|
3611
|
+
down: Jo,
|
|
3612
|
+
up: Lo
|
|
3600
3613
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3601
3614
|
async function Ko(t) {
|
|
3602
3615
|
await t.schema.alterTable("logins").addColumn("auth0Client", "varchar(256)").execute();
|
|
3603
3616
|
}
|
|
3604
|
-
async function
|
|
3617
|
+
async function Ro(t) {
|
|
3605
3618
|
await t.schema.alterTable("logins").dropColumn("auth0Client").execute();
|
|
3606
3619
|
}
|
|
3607
|
-
const
|
|
3620
|
+
const Bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3608
3621
|
__proto__: null,
|
|
3609
|
-
down:
|
|
3622
|
+
down: Ro,
|
|
3610
3623
|
up: Ko
|
|
3611
3624
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3612
|
-
async function
|
|
3625
|
+
async function Uo(t) {
|
|
3613
3626
|
await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(8192)").execute();
|
|
3614
3627
|
}
|
|
3615
3628
|
async function qo(t) {
|
|
3616
3629
|
await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(511)").execute();
|
|
3617
3630
|
}
|
|
3618
|
-
const
|
|
3631
|
+
const Qo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3619
3632
|
__proto__: null,
|
|
3620
3633
|
down: qo,
|
|
3621
|
-
up:
|
|
3634
|
+
up: Uo
|
|
3622
3635
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3623
|
-
async function
|
|
3636
|
+
async function Vo(t) {
|
|
3624
3637
|
}
|
|
3625
|
-
async function
|
|
3638
|
+
async function Wo(t) {
|
|
3626
3639
|
}
|
|
3627
|
-
const
|
|
3640
|
+
const Go = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3628
3641
|
__proto__: null,
|
|
3629
|
-
down:
|
|
3630
|
-
up:
|
|
3642
|
+
down: Wo,
|
|
3643
|
+
up: Vo
|
|
3631
3644
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3632
|
-
async function
|
|
3645
|
+
async function Ho(t) {
|
|
3633
3646
|
}
|
|
3634
|
-
async function
|
|
3647
|
+
async function Xo(t) {
|
|
3635
3648
|
}
|
|
3636
|
-
const
|
|
3649
|
+
const Yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3637
3650
|
__proto__: null,
|
|
3638
|
-
down:
|
|
3639
|
-
up:
|
|
3651
|
+
down: Xo,
|
|
3652
|
+
up: Ho
|
|
3640
3653
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3641
|
-
async function
|
|
3654
|
+
async function Zo(t) {
|
|
3642
3655
|
await t.schema.alterTable("logins").addColumn("authParams_nonce", "varchar(255)").execute();
|
|
3643
3656
|
}
|
|
3644
|
-
async function
|
|
3657
|
+
async function es(t) {
|
|
3645
3658
|
await t.schema.alterTable("logins").dropColumn("nonce").execute();
|
|
3646
3659
|
}
|
|
3647
|
-
const
|
|
3660
|
+
const ts = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3648
3661
|
__proto__: null,
|
|
3649
|
-
down:
|
|
3650
|
-
up:
|
|
3662
|
+
down: es,
|
|
3663
|
+
up: Zo
|
|
3651
3664
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3652
|
-
async function
|
|
3665
|
+
async function as(t) {
|
|
3653
3666
|
}
|
|
3654
|
-
async function
|
|
3667
|
+
async function rs(t) {
|
|
3655
3668
|
}
|
|
3656
|
-
const
|
|
3669
|
+
const ns = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3657
3670
|
__proto__: null,
|
|
3658
|
-
down:
|
|
3659
|
-
up:
|
|
3671
|
+
down: rs,
|
|
3672
|
+
up: as
|
|
3660
3673
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3661
|
-
async function
|
|
3674
|
+
async function os(t) {
|
|
3662
3675
|
}
|
|
3663
|
-
async function
|
|
3676
|
+
async function ss(t) {
|
|
3664
3677
|
}
|
|
3665
|
-
const
|
|
3678
|
+
const is = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3666
3679
|
__proto__: null,
|
|
3667
|
-
down:
|
|
3668
|
-
up:
|
|
3680
|
+
down: ss,
|
|
3681
|
+
up: os
|
|
3669
3682
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3670
|
-
async function
|
|
3683
|
+
async function ls(t) {
|
|
3671
3684
|
await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.notNull()).addColumn(
|
|
3672
3685
|
"tenant_id",
|
|
3673
3686
|
"varchar(255)",
|
|
@@ -3683,7 +3696,7 @@ async function cs(t) {
|
|
|
3683
3696
|
"code_type"
|
|
3684
3697
|
]).execute();
|
|
3685
3698
|
}
|
|
3686
|
-
async function
|
|
3699
|
+
async function cs(t) {
|
|
3687
3700
|
await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
3688
3701
|
"tenant_id",
|
|
3689
3702
|
"varchar(255)",
|
|
@@ -3696,15 +3709,15 @@ async function ds(t) {
|
|
|
3696
3709
|
(e) => e.onDelete("cascade")
|
|
3697
3710
|
).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();
|
|
3698
3711
|
}
|
|
3699
|
-
const
|
|
3712
|
+
const ds = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3700
3713
|
__proto__: null,
|
|
3701
|
-
down:
|
|
3702
|
-
up:
|
|
3714
|
+
down: cs,
|
|
3715
|
+
up: ls
|
|
3703
3716
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3704
|
-
async function
|
|
3717
|
+
async function us(t) {
|
|
3705
3718
|
await t.schema.dropTable("otps").execute(), await t.schema.dropTable("authentication_codes").execute();
|
|
3706
3719
|
}
|
|
3707
|
-
async function
|
|
3720
|
+
async function ms(t) {
|
|
3708
3721
|
await t.schema.alterTable("keys").addColumn("private_key", "varchar(2048)").addColumn("public_key", "varchar(2048)").execute(), await t.schema.createTable("otps").addColumn(
|
|
3709
3722
|
"tenant_id",
|
|
3710
3723
|
"varchar(255)",
|
|
@@ -3723,32 +3736,32 @@ async function _s(t) {
|
|
|
3723
3736
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
3724
3737
|
).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();
|
|
3725
3738
|
}
|
|
3726
|
-
const
|
|
3739
|
+
const _s = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3727
3740
|
__proto__: null,
|
|
3728
|
-
down:
|
|
3729
|
-
up:
|
|
3741
|
+
down: ms,
|
|
3742
|
+
up: us
|
|
3730
3743
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3731
|
-
async function
|
|
3744
|
+
async function hs(t) {
|
|
3732
3745
|
await t.schema.createIndex("IDX_logs_tenant_date_type_user").on("logs").columns(["tenant_id", "date", "type", "user_id"]).execute();
|
|
3733
3746
|
}
|
|
3734
|
-
async function
|
|
3747
|
+
async function fs(t) {
|
|
3735
3748
|
await t.schema.dropIndex("IDX_logs_tenant_date_type_user").on("logs").execute();
|
|
3736
3749
|
}
|
|
3737
|
-
const
|
|
3750
|
+
const ps = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3738
3751
|
__proto__: null,
|
|
3739
|
-
down:
|
|
3740
|
-
up:
|
|
3752
|
+
down: fs,
|
|
3753
|
+
up: hs
|
|
3741
3754
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3742
|
-
async function
|
|
3755
|
+
async function gs(t) {
|
|
3743
3756
|
}
|
|
3744
|
-
async function
|
|
3757
|
+
async function ws(t) {
|
|
3745
3758
|
}
|
|
3746
|
-
const
|
|
3759
|
+
const ys = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3747
3760
|
__proto__: null,
|
|
3748
|
-
down:
|
|
3749
|
-
up:
|
|
3761
|
+
down: ws,
|
|
3762
|
+
up: gs
|
|
3750
3763
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3751
|
-
async function
|
|
3764
|
+
async function vs(t) {
|
|
3752
3765
|
await t.schema.createTable("prompt_settings").addColumn("tenant_id", "varchar(64)", (e) => e.primaryKey()).addColumn(
|
|
3753
3766
|
"universal_login_experience",
|
|
3754
3767
|
"varchar(16)",
|
|
@@ -3767,95 +3780,95 @@ async function Ns(t) {
|
|
|
3767
3780
|
(e) => e.defaultTo(!1).notNull()
|
|
3768
3781
|
).execute();
|
|
3769
3782
|
}
|
|
3770
|
-
async function
|
|
3783
|
+
async function Ns(t) {
|
|
3771
3784
|
await t.schema.dropTable("prompt_settings").execute();
|
|
3772
3785
|
}
|
|
3773
|
-
const
|
|
3786
|
+
const Cs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3774
3787
|
__proto__: null,
|
|
3775
|
-
down:
|
|
3776
|
-
up:
|
|
3788
|
+
down: Ns,
|
|
3789
|
+
up: vs
|
|
3777
3790
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3778
|
-
async function
|
|
3791
|
+
async function bs(t) {
|
|
3779
3792
|
}
|
|
3780
|
-
async function
|
|
3793
|
+
async function xs(t) {
|
|
3781
3794
|
}
|
|
3782
|
-
const
|
|
3795
|
+
const Ts = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3783
3796
|
__proto__: null,
|
|
3784
|
-
down:
|
|
3785
|
-
up:
|
|
3797
|
+
down: xs,
|
|
3798
|
+
up: bs
|
|
3786
3799
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3787
|
-
async function
|
|
3800
|
+
async function Ss(t) {
|
|
3788
3801
|
}
|
|
3789
|
-
async function
|
|
3802
|
+
async function Os(t) {
|
|
3790
3803
|
}
|
|
3791
|
-
const
|
|
3804
|
+
const ks = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3792
3805
|
__proto__: null,
|
|
3793
|
-
down:
|
|
3794
|
-
up:
|
|
3806
|
+
down: Os,
|
|
3807
|
+
up: Ss
|
|
3795
3808
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3796
|
-
async function
|
|
3809
|
+
async function $s(t) {
|
|
3797
3810
|
}
|
|
3798
|
-
async function
|
|
3811
|
+
async function Ds(t) {
|
|
3799
3812
|
}
|
|
3800
|
-
const
|
|
3813
|
+
const Is = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3801
3814
|
__proto__: null,
|
|
3802
|
-
down:
|
|
3803
|
-
up:
|
|
3815
|
+
down: Ds,
|
|
3816
|
+
up: $s
|
|
3804
3817
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3805
|
-
async function
|
|
3818
|
+
async function js(t) {
|
|
3806
3819
|
await t.schema.alterTable("logins").addColumn("authParams_ui_locales", "varchar(32)").execute();
|
|
3807
3820
|
}
|
|
3808
|
-
async function
|
|
3821
|
+
async function Ps(t) {
|
|
3809
3822
|
await t.schema.alterTable("logins").dropColumn("authParams_ui_locales").execute();
|
|
3810
3823
|
}
|
|
3811
|
-
const
|
|
3824
|
+
const Fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3812
3825
|
__proto__: null,
|
|
3813
|
-
down:
|
|
3814
|
-
up:
|
|
3826
|
+
down: Ps,
|
|
3827
|
+
up: js
|
|
3815
3828
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3816
|
-
async function
|
|
3829
|
+
async function Ms(t) {
|
|
3817
3830
|
await t.schema.alterTable("logins").addColumn("authParams_prompt", "varchar(16)").execute();
|
|
3818
3831
|
}
|
|
3819
|
-
async function
|
|
3832
|
+
async function As(t) {
|
|
3820
3833
|
await t.schema.alterTable("logins").dropColumn("authParams_prompt").execute();
|
|
3821
3834
|
}
|
|
3822
|
-
const
|
|
3835
|
+
const zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3823
3836
|
__proto__: null,
|
|
3824
|
-
down:
|
|
3825
|
-
up:
|
|
3837
|
+
down: As,
|
|
3838
|
+
up: Ms
|
|
3826
3839
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3827
|
-
async function
|
|
3840
|
+
async function Ls(t) {
|
|
3828
3841
|
}
|
|
3829
|
-
async function
|
|
3842
|
+
async function Js(t) {
|
|
3830
3843
|
}
|
|
3831
|
-
const
|
|
3844
|
+
const Es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3832
3845
|
__proto__: null,
|
|
3833
|
-
down:
|
|
3834
|
-
up:
|
|
3846
|
+
down: Js,
|
|
3847
|
+
up: Ls
|
|
3835
3848
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3836
3849
|
async function Ks(t) {
|
|
3837
3850
|
await t.schema.alterTable("logins").addColumn("authParams_act_as", "varchar(255)").execute();
|
|
3838
3851
|
}
|
|
3839
|
-
async function
|
|
3852
|
+
async function Rs(t) {
|
|
3840
3853
|
await t.schema.alterTable("logins").dropColumn("authParam_act_as").execute();
|
|
3841
3854
|
}
|
|
3842
|
-
const
|
|
3855
|
+
const Bs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3843
3856
|
__proto__: null,
|
|
3844
|
-
down:
|
|
3857
|
+
down: Rs,
|
|
3845
3858
|
up: Ks
|
|
3846
3859
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3847
|
-
async function
|
|
3860
|
+
async function Us(t) {
|
|
3848
3861
|
await t.schema.alterTable("codes").addColumn("code_verifier", "varchar(128)").execute();
|
|
3849
3862
|
}
|
|
3850
3863
|
async function qs(t) {
|
|
3851
3864
|
await t.schema.alterTable("codes").dropColumn("code_verifier").execute();
|
|
3852
3865
|
}
|
|
3853
|
-
const
|
|
3866
|
+
const Qs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3854
3867
|
__proto__: null,
|
|
3855
3868
|
down: qs,
|
|
3856
|
-
up:
|
|
3869
|
+
up: Us
|
|
3857
3870
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3858
|
-
async function
|
|
3871
|
+
async function Vs(t) {
|
|
3859
3872
|
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(
|
|
3860
3873
|
"credentials",
|
|
3861
3874
|
"varchar(2048)",
|
|
@@ -3866,18 +3879,18 @@ async function Ws(t) {
|
|
|
3866
3879
|
(e) => e.notNull().defaultTo("{}")
|
|
3867
3880
|
).addColumn("created_at", "varchar(29)", (e) => e.notNull()).addColumn("updated_at", "varchar(29)", (e) => e.notNull()).execute();
|
|
3868
3881
|
}
|
|
3869
|
-
async function
|
|
3882
|
+
async function Ws(t) {
|
|
3870
3883
|
await t.schema.dropTable("email_providers").execute();
|
|
3871
3884
|
}
|
|
3872
|
-
const
|
|
3885
|
+
const Gs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3873
3886
|
__proto__: null,
|
|
3874
|
-
down:
|
|
3875
|
-
up:
|
|
3887
|
+
down: Ws,
|
|
3888
|
+
up: Vs
|
|
3876
3889
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3877
|
-
async function
|
|
3890
|
+
async function Hs(t) {
|
|
3878
3891
|
await t.schema.dropTable("tickets").execute();
|
|
3879
3892
|
}
|
|
3880
|
-
async function
|
|
3893
|
+
async function Xs(t) {
|
|
3881
3894
|
await t.schema.createTable("tickets").addColumn(
|
|
3882
3895
|
"tenant_id",
|
|
3883
3896
|
"varchar(255)",
|
|
@@ -3888,22 +3901,22 @@ async function Ys(t) {
|
|
|
3888
3901
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
3889
3902
|
).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();
|
|
3890
3903
|
}
|
|
3891
|
-
const
|
|
3904
|
+
const Ys = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3892
3905
|
__proto__: null,
|
|
3893
|
-
down:
|
|
3894
|
-
up:
|
|
3906
|
+
down: Xs,
|
|
3907
|
+
up: Hs
|
|
3895
3908
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3896
|
-
async function
|
|
3909
|
+
async function Zs(t) {
|
|
3897
3910
|
}
|
|
3898
|
-
async function
|
|
3911
|
+
async function ei(t) {
|
|
3899
3912
|
await t.schema.alterTable("logins").dropColumn("ip").dropColumn("useragent").execute();
|
|
3900
3913
|
}
|
|
3901
|
-
const
|
|
3914
|
+
const ti = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3902
3915
|
__proto__: null,
|
|
3903
|
-
down:
|
|
3904
|
-
up:
|
|
3916
|
+
down: ei,
|
|
3917
|
+
up: Zs
|
|
3905
3918
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3906
|
-
async function
|
|
3919
|
+
async function ai(t) {
|
|
3907
3920
|
await t.schema.createTable("refresh_tokens").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn(
|
|
3908
3921
|
"client_id",
|
|
3909
3922
|
"varchar(21)",
|
|
@@ -3916,27 +3929,27 @@ async function ri(t) {
|
|
|
3916
3929
|
(e) => e.onDelete("cascade")
|
|
3917
3930
|
).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();
|
|
3918
3931
|
}
|
|
3919
|
-
async function
|
|
3932
|
+
async function ri(t) {
|
|
3920
3933
|
await t.schema.dropTable("refresh_tokens").execute();
|
|
3921
3934
|
}
|
|
3922
|
-
const
|
|
3935
|
+
const ni = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3923
3936
|
__proto__: null,
|
|
3924
|
-
down:
|
|
3925
|
-
up:
|
|
3937
|
+
down: ri,
|
|
3938
|
+
up: ai
|
|
3926
3939
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3927
|
-
async function
|
|
3940
|
+
async function oi(t) {
|
|
3928
3941
|
}
|
|
3929
|
-
async function
|
|
3942
|
+
async function si(t) {
|
|
3930
3943
|
}
|
|
3931
|
-
const
|
|
3944
|
+
const ii = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3932
3945
|
__proto__: null,
|
|
3933
|
-
down:
|
|
3934
|
-
up:
|
|
3946
|
+
down: si,
|
|
3947
|
+
up: oi
|
|
3935
3948
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3936
|
-
async function
|
|
3949
|
+
async function li(t) {
|
|
3937
3950
|
await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("refresh_tokens").execute();
|
|
3938
3951
|
}
|
|
3939
|
-
async function
|
|
3952
|
+
async function ci(t) {
|
|
3940
3953
|
await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
3941
3954
|
"sessions_user_id_constraint",
|
|
3942
3955
|
["user_id", "tenant_id"],
|
|
@@ -3955,12 +3968,12 @@ async function di(t) {
|
|
|
3955
3968
|
(e) => e.onDelete("cascade")
|
|
3956
3969
|
).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();
|
|
3957
3970
|
}
|
|
3958
|
-
const
|
|
3971
|
+
const di = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3959
3972
|
__proto__: null,
|
|
3960
|
-
down:
|
|
3961
|
-
up:
|
|
3973
|
+
down: ci,
|
|
3974
|
+
up: li
|
|
3962
3975
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3963
|
-
async function
|
|
3976
|
+
async function ui(t) {
|
|
3964
3977
|
await t.schema.createTable("sessions_2").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
3965
3978
|
"sessions_2_user_id_constraint",
|
|
3966
3979
|
["user_id", "tenant_id"],
|
|
@@ -3979,15 +3992,15 @@ async function mi(t) {
|
|
|
3979
3992
|
(e) => e.onDelete("cascade")
|
|
3980
3993
|
).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();
|
|
3981
3994
|
}
|
|
3982
|
-
async function
|
|
3995
|
+
async function mi(t) {
|
|
3983
3996
|
await t.schema.dropTable("sessions_2").execute(), await t.schema.dropTable("refresh_tokens_2").execute();
|
|
3984
3997
|
}
|
|
3985
|
-
const
|
|
3998
|
+
const _i = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3986
3999
|
__proto__: null,
|
|
3987
|
-
down:
|
|
3988
|
-
up:
|
|
4000
|
+
down: mi,
|
|
4001
|
+
up: ui
|
|
3989
4002
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3990
|
-
async function
|
|
4003
|
+
async function hi(t) {
|
|
3991
4004
|
await t.schema.createTable("custom_domains").addColumn(
|
|
3992
4005
|
"custom_domain_id",
|
|
3993
4006
|
"varchar(21)",
|
|
@@ -3998,49 +4011,49 @@ async function fi(t) {
|
|
|
3998
4011
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
3999
4012
|
).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();
|
|
4000
4013
|
}
|
|
4001
|
-
async function
|
|
4014
|
+
async function fi(t) {
|
|
4002
4015
|
await t.schema.dropTable("custom_domains").execute(), await t.schema.createTable("domains").addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
|
|
4003
4016
|
"tenant_id",
|
|
4004
4017
|
"varchar(255)",
|
|
4005
4018
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
4006
4019
|
).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();
|
|
4007
4020
|
}
|
|
4008
|
-
const
|
|
4021
|
+
const pi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4009
4022
|
__proto__: null,
|
|
4010
|
-
down:
|
|
4011
|
-
up:
|
|
4023
|
+
down: fi,
|
|
4024
|
+
up: hi
|
|
4012
4025
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4013
|
-
async function
|
|
4026
|
+
async function gi(t) {
|
|
4014
4027
|
}
|
|
4015
|
-
async function
|
|
4028
|
+
async function wi(t) {
|
|
4016
4029
|
await t.schema.alterTable("logins").dropColumn("authParams_organization").dropColumn("authorization_url").execute();
|
|
4017
4030
|
}
|
|
4018
|
-
const
|
|
4031
|
+
const yi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4019
4032
|
__proto__: null,
|
|
4020
|
-
down:
|
|
4021
|
-
up:
|
|
4033
|
+
down: wi,
|
|
4034
|
+
up: gi
|
|
4022
4035
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4023
|
-
async function
|
|
4036
|
+
async function vi(t) {
|
|
4024
4037
|
await t.schema.alterTable("logins").dropColumn("authorization_url").execute(), await t.schema.alterTable("logins").addColumn("authorization_url", "varchar(2048)").execute();
|
|
4025
4038
|
}
|
|
4026
|
-
async function
|
|
4039
|
+
async function Ni(t) {
|
|
4027
4040
|
await t.schema.alterTable("logins").dropColumn("authorization_url").execute(), await t.schema.alterTable("logins").addColumn("authorization_url", "varchar(1024)").execute();
|
|
4028
4041
|
}
|
|
4029
|
-
const
|
|
4042
|
+
const Ci = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4030
4043
|
__proto__: null,
|
|
4031
|
-
down:
|
|
4032
|
-
up:
|
|
4044
|
+
down: Ni,
|
|
4045
|
+
up: vi
|
|
4033
4046
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4034
|
-
async function
|
|
4047
|
+
async function bi(t) {
|
|
4035
4048
|
}
|
|
4036
|
-
async function
|
|
4049
|
+
async function xi(t) {
|
|
4037
4050
|
}
|
|
4038
|
-
const
|
|
4051
|
+
const Ti = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4039
4052
|
__proto__: null,
|
|
4040
|
-
down:
|
|
4041
|
-
up:
|
|
4053
|
+
down: xi,
|
|
4054
|
+
up: bi
|
|
4042
4055
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4043
|
-
async function
|
|
4056
|
+
async function Si(t) {
|
|
4044
4057
|
await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
4045
4058
|
"sessions_user_id_constraint",
|
|
4046
4059
|
["user_id", "tenant_id"],
|
|
@@ -4067,25 +4080,25 @@ async function Oi(t) {
|
|
|
4067
4080
|
(e) => e.onDelete("cascade")
|
|
4068
4081
|
).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();
|
|
4069
4082
|
}
|
|
4070
|
-
async function
|
|
4083
|
+
async function Oi(t) {
|
|
4071
4084
|
await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("login_sessions").execute(), await t.schema.dropTable("refresh_tokens").execute();
|
|
4072
4085
|
}
|
|
4073
|
-
const
|
|
4086
|
+
const ki = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4074
4087
|
__proto__: null,
|
|
4075
|
-
down:
|
|
4076
|
-
up:
|
|
4088
|
+
down: Oi,
|
|
4089
|
+
up: Si
|
|
4077
4090
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4078
|
-
async function
|
|
4091
|
+
async function $i(t) {
|
|
4079
4092
|
await t.schema.dropTable("logins").execute(), await t.schema.dropTable("sessions_2").execute(), await t.schema.dropTable("refresh_tokens_2").execute();
|
|
4080
4093
|
}
|
|
4081
|
-
async function
|
|
4094
|
+
async function Di(t) {
|
|
4082
4095
|
}
|
|
4083
|
-
const
|
|
4096
|
+
const Ii = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4084
4097
|
__proto__: null,
|
|
4085
|
-
down:
|
|
4086
|
-
up:
|
|
4098
|
+
down: Di,
|
|
4099
|
+
up: $i
|
|
4087
4100
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4088
|
-
async function
|
|
4101
|
+
async function ji(t) {
|
|
4089
4102
|
await t.schema.dropTable("custom_domains").execute(), await t.schema.createTable("custom_domains").addColumn(
|
|
4090
4103
|
"custom_domain_id",
|
|
4091
4104
|
"varchar(256)",
|
|
@@ -4096,46 +4109,46 @@ async function Pi(t) {
|
|
|
4096
4109
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
4097
4110
|
).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();
|
|
4098
4111
|
}
|
|
4099
|
-
async function
|
|
4112
|
+
async function Pi(t) {
|
|
4100
4113
|
}
|
|
4101
|
-
const
|
|
4114
|
+
const Fi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4102
4115
|
__proto__: null,
|
|
4103
|
-
down:
|
|
4104
|
-
up:
|
|
4116
|
+
down: Pi,
|
|
4117
|
+
up: ji
|
|
4105
4118
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4106
|
-
async function
|
|
4119
|
+
async function Mi(t) {
|
|
4107
4120
|
}
|
|
4108
|
-
async function
|
|
4121
|
+
async function Ai(t) {
|
|
4109
4122
|
await t.schema.alterTable("users").dropColumn("phone_number").dropColumn("phone_verified").dropColumn("username").execute();
|
|
4110
4123
|
}
|
|
4111
|
-
const
|
|
4124
|
+
const zi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4112
4125
|
__proto__: null,
|
|
4113
|
-
down:
|
|
4114
|
-
up:
|
|
4126
|
+
down: Ai,
|
|
4127
|
+
up: Mi
|
|
4115
4128
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4116
|
-
async function
|
|
4129
|
+
async function Li(t) {
|
|
4117
4130
|
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();
|
|
4118
4131
|
}
|
|
4119
|
-
async function
|
|
4132
|
+
async function Ji(t) {
|
|
4120
4133
|
await t.schema.dropTable("forms").execute();
|
|
4121
4134
|
}
|
|
4122
|
-
const
|
|
4135
|
+
const Ei = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4123
4136
|
__proto__: null,
|
|
4124
|
-
down:
|
|
4125
|
-
up:
|
|
4137
|
+
down: Ji,
|
|
4138
|
+
up: Li
|
|
4126
4139
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4127
4140
|
async function Ki(t) {
|
|
4128
4141
|
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();
|
|
4129
4142
|
}
|
|
4130
|
-
async function
|
|
4143
|
+
async function Ri(t) {
|
|
4131
4144
|
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();
|
|
4132
4145
|
}
|
|
4133
|
-
const
|
|
4146
|
+
const Bi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4134
4147
|
__proto__: null,
|
|
4135
|
-
down:
|
|
4148
|
+
down: Ri,
|
|
4136
4149
|
up: Ki
|
|
4137
4150
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4138
|
-
async function
|
|
4151
|
+
async function Ui(t) {
|
|
4139
4152
|
await t.schema.alterTable("login_sessions").addColumn(
|
|
4140
4153
|
"login_completed",
|
|
4141
4154
|
"boolean",
|
|
@@ -4145,71 +4158,71 @@ async function Qi(t) {
|
|
|
4145
4158
|
async function qi(t) {
|
|
4146
4159
|
await t.schema.alterTable("login_sessions").dropColumn("login_completed").execute();
|
|
4147
4160
|
}
|
|
4148
|
-
const
|
|
4161
|
+
const Qi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4149
4162
|
__proto__: null,
|
|
4150
4163
|
down: qi,
|
|
4151
|
-
up:
|
|
4164
|
+
up: Ui
|
|
4152
4165
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4153
|
-
async function
|
|
4166
|
+
async function Vi(t) {
|
|
4154
4167
|
await t.schema.alterTable("sessions").addColumn(
|
|
4155
4168
|
"login_session_id",
|
|
4156
4169
|
"varchar(21)",
|
|
4157
4170
|
(e) => e.references("login_sessions.id").onDelete("set null")
|
|
4158
4171
|
).execute();
|
|
4159
4172
|
}
|
|
4160
|
-
async function
|
|
4173
|
+
async function Wi(t) {
|
|
4161
4174
|
await t.schema.alterTable("sessions").dropColumn("login_session_id").execute();
|
|
4162
4175
|
}
|
|
4163
|
-
const
|
|
4176
|
+
const Gi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4164
4177
|
__proto__: null,
|
|
4165
|
-
down:
|
|
4166
|
-
up:
|
|
4178
|
+
down: Wi,
|
|
4179
|
+
up: Vi
|
|
4167
4180
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4168
|
-
async function
|
|
4181
|
+
async function Hi(t) {
|
|
4169
4182
|
await t.schema.createIndex("IDX_sessions_login_session_id").on("sessions").column("login_session_id").execute();
|
|
4170
4183
|
}
|
|
4171
|
-
async function
|
|
4184
|
+
async function Xi(t) {
|
|
4172
4185
|
await t.schema.dropIndex("IDX_sessions_login_session_id").on("sessions").execute();
|
|
4173
4186
|
}
|
|
4174
|
-
const
|
|
4187
|
+
const Yi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4175
4188
|
__proto__: null,
|
|
4176
|
-
down:
|
|
4177
|
-
up:
|
|
4189
|
+
down: Xi,
|
|
4190
|
+
up: Hi
|
|
4178
4191
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4179
|
-
async function
|
|
4192
|
+
async function Zi(t) {
|
|
4180
4193
|
await t.schema.alterTable("codes").addColumn("code_challenge", "varchar(128)").execute(), await t.schema.alterTable("codes").addColumn("code_challenge_method", "varchar(5)").execute();
|
|
4181
4194
|
}
|
|
4182
|
-
async function
|
|
4195
|
+
async function el(t) {
|
|
4183
4196
|
await t.schema.alterTable("codes").dropColumn("code_challenge").execute(), await t.schema.alterTable("codes").dropColumn("code_challenge_method").execute();
|
|
4184
4197
|
}
|
|
4185
|
-
const
|
|
4198
|
+
const tl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4186
4199
|
__proto__: null,
|
|
4187
|
-
down:
|
|
4188
|
-
up:
|
|
4200
|
+
down: el,
|
|
4201
|
+
up: Zi
|
|
4189
4202
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4190
|
-
async function
|
|
4203
|
+
async function al(t) {
|
|
4191
4204
|
await t.schema.alterTable("codes").addColumn("redirect_uri", "varchar(1024)").execute();
|
|
4192
4205
|
}
|
|
4193
|
-
async function
|
|
4206
|
+
async function rl(t) {
|
|
4194
4207
|
await t.schema.alterTable("codes").dropColumn("redirect_uri").execute();
|
|
4195
4208
|
}
|
|
4196
|
-
const
|
|
4209
|
+
const nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4197
4210
|
__proto__: null,
|
|
4198
|
-
down:
|
|
4199
|
-
up:
|
|
4211
|
+
down: rl,
|
|
4212
|
+
up: al
|
|
4200
4213
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4201
|
-
async function
|
|
4214
|
+
async function ol(t) {
|
|
4202
4215
|
await t.schema.alterTable("codes").addColumn("nonce", "varchar(1024)").execute(), await t.schema.alterTable("codes").addColumn("state", "varchar(2048)").execute();
|
|
4203
4216
|
}
|
|
4204
|
-
async function
|
|
4217
|
+
async function sl(t) {
|
|
4205
4218
|
await t.schema.alterTable("codes").dropColumn("nonce").execute(), await t.schema.alterTable("codes").dropColumn("state").execute();
|
|
4206
4219
|
}
|
|
4207
|
-
const
|
|
4220
|
+
const il = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4208
4221
|
__proto__: null,
|
|
4209
|
-
down:
|
|
4210
|
-
up:
|
|
4222
|
+
down: sl,
|
|
4223
|
+
up: ol
|
|
4211
4224
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4212
|
-
async function
|
|
4225
|
+
async function ll(t) {
|
|
4213
4226
|
await t.schema.createTable("themes").addColumn(
|
|
4214
4227
|
"tenant_id",
|
|
4215
4228
|
"varchar(255)",
|
|
@@ -4284,173 +4297,173 @@ async function cl(t) {
|
|
|
4284
4297
|
(e) => e.notNull()
|
|
4285
4298
|
).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();
|
|
4286
4299
|
}
|
|
4287
|
-
async function
|
|
4300
|
+
async function cl(t) {
|
|
4288
4301
|
await t.schema.dropTable("themes").execute();
|
|
4289
4302
|
}
|
|
4290
|
-
const
|
|
4303
|
+
const dl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4291
4304
|
__proto__: null,
|
|
4292
|
-
down:
|
|
4293
|
-
up:
|
|
4305
|
+
down: cl,
|
|
4306
|
+
up: ll
|
|
4294
4307
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4295
|
-
async function
|
|
4296
|
-
await t.schema.createTable("resource_servers").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("name", "varchar(255)", (e) => e.notNull()).addColumn("identifier", "varchar(191)", (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)").
|
|
4308
|
+
async function ul(t) {
|
|
4309
|
+
await t.schema.createTable("resource_servers").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("name", "varchar(255)", (e) => e.notNull()).addColumn("identifier", "varchar(191)", (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(255)", (e) => e.notNull()).addColumn("updated_at", "varchar(255)", (e) => e.notNull()).execute(), await t.schema.createIndex("resource_servers_tenant_identifier_uq").on("resource_servers").columns(["tenant_id", "identifier"]).unique().execute(), await t.schema.createTable("permissions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("permission_name", "varchar(255)", (e) => e.notNull()).addColumn("description", "varchar(1024)").addColumn(
|
|
4297
4310
|
"resource_server_identifier",
|
|
4298
4311
|
"varchar(191)",
|
|
4299
4312
|
(e) => e.notNull()
|
|
4300
|
-
).addColumn("resource_server_name", "varchar(255)", (e) => e.notNull()).addColumn("sources", "varchar(4096)").execute(), await t.schema.createIndex("permissions_tenant_identifier_name_uq").on("permissions").columns(["tenant_id", "resource_server_identifier", "permission_name"]).unique().execute();
|
|
4313
|
+
).addColumn("resource_server_name", "varchar(255)", (e) => e.notNull()).addColumn("sources", "varchar(4096)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("updated_at", "varchar(255)", (e) => e.notNull()).execute(), await t.schema.createIndex("permissions_tenant_identifier_name_uq").on("permissions").columns(["tenant_id", "resource_server_identifier", "permission_name"]).unique().execute(), await t.schema.createTable("roles").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(191)", (e) => e.notNull()).addColumn("name", "varchar(50)", (e) => e.notNull()).addColumn("description", "varchar(255)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("updated_at", "varchar(255)", (e) => e.notNull()).execute(), await t.schema.createIndex("roles_tenant_name_uq").on("roles").columns(["tenant_id", "name"]).unique().execute();
|
|
4301
4314
|
}
|
|
4302
|
-
async function
|
|
4303
|
-
await t.schema.dropTable("
|
|
4315
|
+
async function ml(t) {
|
|
4316
|
+
await t.schema.dropTable("roles").execute(), await t.schema.dropTable("permissions").execute(), await t.schema.dropTable("resource_servers").execute();
|
|
4304
4317
|
}
|
|
4305
|
-
const
|
|
4318
|
+
const _l = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4306
4319
|
__proto__: null,
|
|
4307
|
-
down:
|
|
4308
|
-
up:
|
|
4320
|
+
down: ml,
|
|
4321
|
+
up: ul
|
|
4309
4322
|
}, Symbol.toStringTag, { value: "Module" })), Je = {
|
|
4310
|
-
m1_init:
|
|
4311
|
-
m2_magicLink:
|
|
4312
|
-
m3_updateAt:
|
|
4313
|
-
m4_logTable:
|
|
4314
|
-
m5_userProfile:
|
|
4315
|
-
m6_sessions:
|
|
4316
|
-
m7_passwords:
|
|
4317
|
-
m8_logsTableNewFields:
|
|
4318
|
-
m9_passwordTableNewField:
|
|
4323
|
+
m1_init: hr,
|
|
4324
|
+
m2_magicLink: gr,
|
|
4325
|
+
m3_updateAt: vr,
|
|
4326
|
+
m4_logTable: br,
|
|
4327
|
+
m5_userProfile: Sr,
|
|
4328
|
+
m6_sessions: $r,
|
|
4329
|
+
m7_passwords: jr,
|
|
4330
|
+
m8_logsTableNewFields: Mr,
|
|
4331
|
+
m9_passwordTableNewField: Lr,
|
|
4319
4332
|
n01_codesTable: Kr,
|
|
4320
|
-
n11_universalLoginSession:
|
|
4321
|
-
n12_userFields:
|
|
4322
|
-
n13_userEmailIndex:
|
|
4323
|
-
n14_profileDataField:
|
|
4324
|
-
n15_userEmailIndex:
|
|
4325
|
-
n16_userLocale:
|
|
4326
|
-
n17_signingKeys:
|
|
4327
|
-
n18_logsFields:
|
|
4328
|
-
n19_connectionsUserinfo:
|
|
4329
|
-
n20_missingFields:
|
|
4330
|
-
n21_sessionDeletedAt:
|
|
4331
|
-
n22_dropLogsFields:
|
|
4332
|
-
n23_dropUsersFields:
|
|
4333
|
-
n24_logsIndexes:
|
|
4334
|
-
n25_logDescMaxLength:
|
|
4335
|
-
n26_logsTableExtraFields:
|
|
4336
|
-
n27_usersTableNameIndex:
|
|
4337
|
-
n28_usersEmailConstrain:
|
|
4333
|
+
n11_universalLoginSession: Ur,
|
|
4334
|
+
n12_userFields: Vr,
|
|
4335
|
+
n13_userEmailIndex: Hr,
|
|
4336
|
+
n14_profileDataField: Zr,
|
|
4337
|
+
n15_userEmailIndex: an,
|
|
4338
|
+
n16_userLocale: on,
|
|
4339
|
+
n17_signingKeys: cn,
|
|
4340
|
+
n18_logsFields: mn,
|
|
4341
|
+
n19_connectionsUserinfo: fn,
|
|
4342
|
+
n20_missingFields: wn,
|
|
4343
|
+
n21_sessionDeletedAt: Nn,
|
|
4344
|
+
n22_dropLogsFields: xn,
|
|
4345
|
+
n23_dropUsersFields: On,
|
|
4346
|
+
n24_logsIndexes: Dn,
|
|
4347
|
+
n25_logDescMaxLength: Pn,
|
|
4348
|
+
n26_logsTableExtraFields: An,
|
|
4349
|
+
n27_usersTableNameIndex: Jn,
|
|
4350
|
+
n28_usersEmailConstrain: Rn,
|
|
4338
4351
|
n29_increaseOtpStateLength: qn,
|
|
4339
|
-
n30_increaseTicketStateLength:
|
|
4340
|
-
n31_branding:
|
|
4341
|
-
n32_indexesAndNotNull:
|
|
4342
|
-
n33_vendorIdInUniversalLoginSession:
|
|
4343
|
-
n34_auth0ClientInUniversalLoginSession:
|
|
4344
|
-
n35_increaseUniversalSessionStateLength:
|
|
4345
|
-
n36_authenticationCodes:
|
|
4346
|
-
n37_disableSignUps:
|
|
4347
|
-
n38_otpIpAddress:
|
|
4348
|
-
n39_increaseUserAgentLength:
|
|
4349
|
-
n40_userId:
|
|
4350
|
-
n41_hooks:
|
|
4351
|
-
n42_userIdIndexes:
|
|
4352
|
-
n43_userIdIndexes:
|
|
4353
|
-
n44_codes:
|
|
4354
|
-
n45_hookProperties:
|
|
4355
|
-
n46_loginAuth0Client:
|
|
4356
|
-
n47_loginAuth0Client:
|
|
4357
|
-
n48_saml:
|
|
4358
|
-
n49_removeFields:
|
|
4359
|
-
n50_authParamsNonce:
|
|
4360
|
-
n51_connectionid:
|
|
4361
|
-
n52_cert:
|
|
4362
|
-
n53_codes_primary_key:
|
|
4363
|
-
n54_cleanup_tables:
|
|
4364
|
-
n55_logs_index:
|
|
4365
|
-
n56_application_fields:
|
|
4366
|
-
n57_prompt_settings:
|
|
4367
|
-
n58_connection_client_id:
|
|
4368
|
-
n59_connection_options:
|
|
4369
|
-
n60_users_metadata:
|
|
4370
|
-
n61_userLocales:
|
|
4371
|
-
n62_prompt:
|
|
4372
|
-
n63_connection_cleanup:
|
|
4373
|
-
n64_act_as:
|
|
4374
|
-
n65_code_verifier:
|
|
4375
|
-
n66_email_providers:
|
|
4376
|
-
n67_drop_tickets:
|
|
4377
|
-
n68_login_useragents:
|
|
4378
|
-
n70_refresh_tokens:
|
|
4379
|
-
n71_session_new_fields:
|
|
4380
|
-
n72_session_primary_key:
|
|
4381
|
-
n73_drop_sessions:
|
|
4382
|
-
n74_custom_domains:
|
|
4383
|
-
n75_organizations:
|
|
4384
|
-
n76_authorization_url_length:
|
|
4385
|
-
n77_drop_sessions:
|
|
4386
|
-
n78_login_sessions:
|
|
4387
|
-
n79_drop_sessions_2:
|
|
4388
|
-
n80_recreate_custom_domains:
|
|
4389
|
-
n81_phone:
|
|
4390
|
-
n82_forms:
|
|
4391
|
-
n83_addFormsIdToHooks:
|
|
4392
|
-
n84_login_completed:
|
|
4393
|
-
n85_add_login_session_id_to_sessions:
|
|
4394
|
-
n86_index_sessions_login_session_id:
|
|
4395
|
-
n87_code_challenge:
|
|
4396
|
-
n88_add_redirect_uri_to_codes:
|
|
4397
|
-
n89_add_nonce_and_state_to_codes:
|
|
4398
|
-
n90_themes:
|
|
4399
|
-
n91_resource_servers_rules_permissions:
|
|
4352
|
+
n30_increaseTicketStateLength: Wn,
|
|
4353
|
+
n31_branding: Xn,
|
|
4354
|
+
n32_indexesAndNotNull: eo,
|
|
4355
|
+
n33_vendorIdInUniversalLoginSession: ro,
|
|
4356
|
+
n34_auth0ClientInUniversalLoginSession: so,
|
|
4357
|
+
n35_increaseUniversalSessionStateLength: co,
|
|
4358
|
+
n36_authenticationCodes: _o,
|
|
4359
|
+
n37_disableSignUps: po,
|
|
4360
|
+
n38_otpIpAddress: yo,
|
|
4361
|
+
n39_increaseUserAgentLength: Co,
|
|
4362
|
+
n40_userId: To,
|
|
4363
|
+
n41_hooks: ko,
|
|
4364
|
+
n42_userIdIndexes: Io,
|
|
4365
|
+
n43_userIdIndexes: Fo,
|
|
4366
|
+
n44_codes: zo,
|
|
4367
|
+
n45_hookProperties: Eo,
|
|
4368
|
+
n46_loginAuth0Client: Bo,
|
|
4369
|
+
n47_loginAuth0Client: Qo,
|
|
4370
|
+
n48_saml: Go,
|
|
4371
|
+
n49_removeFields: Yo,
|
|
4372
|
+
n50_authParamsNonce: ts,
|
|
4373
|
+
n51_connectionid: ns,
|
|
4374
|
+
n52_cert: is,
|
|
4375
|
+
n53_codes_primary_key: ds,
|
|
4376
|
+
n54_cleanup_tables: _s,
|
|
4377
|
+
n55_logs_index: ps,
|
|
4378
|
+
n56_application_fields: ys,
|
|
4379
|
+
n57_prompt_settings: Cs,
|
|
4380
|
+
n58_connection_client_id: Ts,
|
|
4381
|
+
n59_connection_options: ks,
|
|
4382
|
+
n60_users_metadata: Is,
|
|
4383
|
+
n61_userLocales: Fs,
|
|
4384
|
+
n62_prompt: zs,
|
|
4385
|
+
n63_connection_cleanup: Es,
|
|
4386
|
+
n64_act_as: Bs,
|
|
4387
|
+
n65_code_verifier: Qs,
|
|
4388
|
+
n66_email_providers: Gs,
|
|
4389
|
+
n67_drop_tickets: Ys,
|
|
4390
|
+
n68_login_useragents: ti,
|
|
4391
|
+
n70_refresh_tokens: ni,
|
|
4392
|
+
n71_session_new_fields: ii,
|
|
4393
|
+
n72_session_primary_key: di,
|
|
4394
|
+
n73_drop_sessions: _i,
|
|
4395
|
+
n74_custom_domains: pi,
|
|
4396
|
+
n75_organizations: yi,
|
|
4397
|
+
n76_authorization_url_length: Ci,
|
|
4398
|
+
n77_drop_sessions: Ti,
|
|
4399
|
+
n78_login_sessions: ki,
|
|
4400
|
+
n79_drop_sessions_2: Ii,
|
|
4401
|
+
n80_recreate_custom_domains: Fi,
|
|
4402
|
+
n81_phone: zi,
|
|
4403
|
+
n82_forms: Ei,
|
|
4404
|
+
n83_addFormsIdToHooks: Bi,
|
|
4405
|
+
n84_login_completed: Qi,
|
|
4406
|
+
n85_add_login_session_id_to_sessions: Gi,
|
|
4407
|
+
n86_index_sessions_login_session_id: Yi,
|
|
4408
|
+
n87_code_challenge: tl,
|
|
4409
|
+
n88_add_redirect_uri_to_codes: nl,
|
|
4410
|
+
n89_add_nonce_and_state_to_codes: il,
|
|
4411
|
+
n90_themes: dl,
|
|
4412
|
+
n91_resource_servers_rules_permissions: _l
|
|
4400
4413
|
};
|
|
4401
|
-
async function
|
|
4414
|
+
async function wl(t, e = !1) {
|
|
4402
4415
|
e && console.log("migrating...");
|
|
4403
4416
|
const a = new Le(Je), r = new be({
|
|
4404
4417
|
db: t,
|
|
4405
4418
|
provider: a
|
|
4406
|
-
}), { error:
|
|
4407
|
-
if (
|
|
4419
|
+
}), { error: n, results: o } = await r.migrateToLatest();
|
|
4420
|
+
if (o == null || o.forEach((s) => {
|
|
4408
4421
|
s.status === "Success" ? e && console.log(
|
|
4409
4422
|
`migration "${s.migrationName}" was executed successfully`
|
|
4410
4423
|
) : s.status === "Error" && console.error(`failed to execute migration "${s.migrationName}"`);
|
|
4411
|
-
}),
|
|
4412
|
-
throw console.error("failed to migrate"), console.error(
|
|
4424
|
+
}), n)
|
|
4425
|
+
throw console.error("failed to migrate"), console.error(n), n;
|
|
4413
4426
|
}
|
|
4414
|
-
async function
|
|
4427
|
+
async function yl(t) {
|
|
4415
4428
|
console.log("migrating...");
|
|
4416
4429
|
const e = new Le(Je), a = new be({
|
|
4417
4430
|
db: t,
|
|
4418
4431
|
provider: e
|
|
4419
|
-
}), { error: r, results:
|
|
4420
|
-
if (
|
|
4421
|
-
|
|
4432
|
+
}), { error: r, results: n } = await a.migrateDown();
|
|
4433
|
+
if (n == null || n.forEach((o) => {
|
|
4434
|
+
o.status === "Success" ? console.log(`migration "${o.migrationName}" was reverted successfully`) : o.status === "Error" && console.error(`failed to execute migration "${o.migrationName}"`);
|
|
4422
4435
|
}), r)
|
|
4423
4436
|
throw console.error("failed to migrate"), console.error(r), r;
|
|
4424
4437
|
}
|
|
4425
|
-
function
|
|
4438
|
+
function vl(t) {
|
|
4426
4439
|
return {
|
|
4427
|
-
applications:
|
|
4428
|
-
branding:
|
|
4429
|
-
cleanup:
|
|
4440
|
+
applications: Ft(t),
|
|
4441
|
+
branding: ta(t),
|
|
4442
|
+
cleanup: Ia(t),
|
|
4430
4443
|
clients: Kt(t),
|
|
4431
|
-
codes:
|
|
4432
|
-
connections:
|
|
4433
|
-
emailProviders:
|
|
4434
|
-
customDomains:
|
|
4435
|
-
forms:
|
|
4436
|
-
hooks:
|
|
4444
|
+
codes: kt(t),
|
|
4445
|
+
connections: Et(t),
|
|
4446
|
+
emailProviders: xa(t),
|
|
4447
|
+
customDomains: Yt(t),
|
|
4448
|
+
forms: za(t),
|
|
4449
|
+
hooks: ia(t),
|
|
4437
4450
|
keys: qt(t),
|
|
4438
|
-
loginSessions:
|
|
4439
|
-
logs:
|
|
4440
|
-
passwords:
|
|
4441
|
-
promptSettings:
|
|
4442
|
-
refreshTokens:
|
|
4443
|
-
resourceServers:
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
sessions:
|
|
4447
|
-
tenants:
|
|
4448
|
-
themes:
|
|
4449
|
-
users:
|
|
4451
|
+
loginSessions: ga(t),
|
|
4452
|
+
logs: mt(t),
|
|
4453
|
+
passwords: Ct(t),
|
|
4454
|
+
promptSettings: va(t),
|
|
4455
|
+
refreshTokens: Da(t),
|
|
4456
|
+
resourceServers: Ba(t),
|
|
4457
|
+
permissions: Ga(t),
|
|
4458
|
+
roles: tr(t),
|
|
4459
|
+
sessions: wt(t),
|
|
4460
|
+
tenants: it(t),
|
|
4461
|
+
themes: ma(t),
|
|
4462
|
+
users: et(t)
|
|
4450
4463
|
};
|
|
4451
4464
|
}
|
|
4452
4465
|
export {
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4466
|
+
vl as default,
|
|
4467
|
+
yl as migrateDown,
|
|
4468
|
+
wl as migrateToLatest
|
|
4456
4469
|
};
|