@authhero/kysely-adapter 2.1.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kysely-adapter.cjs +1 -1
- package/dist/kysely-adapter.d.ts +46 -3
- package/dist/kysely-adapter.mjs +911 -859
- package/package.json +2 -2
package/dist/kysely-adapter.mjs
CHANGED
|
@@ -2,17 +2,17 @@ var Ee = Object.defineProperty;
|
|
|
2
2
|
var de = (t) => {
|
|
3
3
|
throw TypeError(t);
|
|
4
4
|
};
|
|
5
|
-
var ze = (t, e,
|
|
6
|
-
var j = (t, e,
|
|
7
|
-
var c = (t, e,
|
|
5
|
+
var ze = (t, e, r) => e in t ? Ee(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
6
|
+
var j = (t, e, r) => ze(t, typeof e != "symbol" ? e + "" : e, r), U = (t, e, r) => e.has(t) || de("Cannot " + r);
|
|
7
|
+
var c = (t, e, r) => (U(t, e, "read from private field"), r ? r.call(t) : e.get(t)), w = (t, e, r) => e.has(t) ? de("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), M = (t, e, r, a) => (U(t, e, "write to private field"), a ? a.call(t, r) : e.set(t, r), r), u = (t, e, r) => (U(t, e, "access private method"), r);
|
|
8
8
|
import { parseUserId as Y, codeSchema as Je, connectionSchema as Re, loginSchema as Ue, promptSettingSchema as Ke } from "@authhero/adapter-interfaces";
|
|
9
9
|
import "@hono/zod-openapi";
|
|
10
10
|
var V = class extends Error {
|
|
11
|
-
constructor(e = 500,
|
|
12
|
-
super(
|
|
11
|
+
constructor(e = 500, r) {
|
|
12
|
+
super(r == null ? void 0 : r.message, { cause: r == null ? void 0 : r.cause });
|
|
13
13
|
j(this, "res");
|
|
14
14
|
j(this, "status");
|
|
15
|
-
this.res =
|
|
15
|
+
this.res = r == null ? void 0 : r.res, this.status = e;
|
|
16
16
|
}
|
|
17
17
|
getResponse() {
|
|
18
18
|
return this.res ? new Response(this.res.body, {
|
|
@@ -24,17 +24,17 @@ var V = class extends Error {
|
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
function Be(t) {
|
|
27
|
-
return async (e,
|
|
28
|
-
const { identities:
|
|
27
|
+
return async (e, r) => {
|
|
28
|
+
const { identities: a, ...o } = r, n = {
|
|
29
29
|
...o,
|
|
30
30
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
31
31
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
32
32
|
login_count: 0,
|
|
33
33
|
tenant_id: e,
|
|
34
|
-
email_verified:
|
|
35
|
-
is_social:
|
|
36
|
-
app_metadata: JSON.stringify(
|
|
37
|
-
user_metadata: JSON.stringify(
|
|
34
|
+
email_verified: r.email_verified ? 1 : 0,
|
|
35
|
+
is_social: r.is_social ? 1 : 0,
|
|
36
|
+
app_metadata: JSON.stringify(r.app_metadata),
|
|
37
|
+
user_metadata: JSON.stringify(r.user_metadata)
|
|
38
38
|
};
|
|
39
39
|
try {
|
|
40
40
|
await t.insertInto("users").values(n).execute();
|
|
@@ -52,16 +52,16 @@ function Be(t) {
|
|
|
52
52
|
}
|
|
53
53
|
function f(t) {
|
|
54
54
|
const e = { ...t };
|
|
55
|
-
for (const
|
|
56
|
-
e[
|
|
55
|
+
for (const r in e)
|
|
56
|
+
e[r] === null ? delete e[r] : typeof e[r] == "object" && (Array.isArray(e[r]) ? e[r] = e[r].map(f) : e[r] = f(e[r]));
|
|
57
57
|
return e;
|
|
58
58
|
}
|
|
59
59
|
function _e(t) {
|
|
60
60
|
let e = {};
|
|
61
61
|
try {
|
|
62
62
|
e = JSON.parse(t.profileData || "{}");
|
|
63
|
-
} catch (
|
|
64
|
-
console.error("Error parsing profileData",
|
|
63
|
+
} catch (r) {
|
|
64
|
+
console.error("Error parsing profileData", r);
|
|
65
65
|
}
|
|
66
66
|
return {
|
|
67
67
|
connection: t.connection,
|
|
@@ -76,26 +76,26 @@ function _e(t) {
|
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
78
|
function Qe(t) {
|
|
79
|
-
return async (e,
|
|
80
|
-
const [
|
|
81
|
-
t.selectFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=",
|
|
82
|
-
t.selectFrom("users").where("users.tenant_id", "=", e).where("users.linked_to", "=",
|
|
79
|
+
return async (e, r) => {
|
|
80
|
+
const [a, o] = await Promise.all([
|
|
81
|
+
t.selectFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", r).selectAll().executeTakeFirst(),
|
|
82
|
+
t.selectFrom("users").where("users.tenant_id", "=", e).where("users.linked_to", "=", r).selectAll().execute()
|
|
83
83
|
]);
|
|
84
|
-
if (!
|
|
84
|
+
if (!a)
|
|
85
85
|
return null;
|
|
86
|
-
const { tenant_id: n, ...s } =
|
|
86
|
+
const { tenant_id: n, ...s } = a, l = {
|
|
87
87
|
...s,
|
|
88
|
-
email:
|
|
89
|
-
email_verified:
|
|
90
|
-
is_social:
|
|
91
|
-
app_metadata: JSON.parse(
|
|
92
|
-
user_metadata: JSON.parse(
|
|
88
|
+
email: a.email || "",
|
|
89
|
+
email_verified: a.email_verified === 1,
|
|
90
|
+
is_social: a.is_social === 1,
|
|
91
|
+
app_metadata: JSON.parse(a.app_metadata),
|
|
92
|
+
user_metadata: JSON.parse(a.user_metadata),
|
|
93
93
|
identities: [
|
|
94
94
|
{
|
|
95
|
-
connection:
|
|
96
|
-
provider:
|
|
97
|
-
user_id: Y(
|
|
98
|
-
isSocial: !!
|
|
95
|
+
connection: a.connection,
|
|
96
|
+
provider: a.provider,
|
|
97
|
+
user_id: Y(a.user_id).id,
|
|
98
|
+
isSocial: !!a.is_social
|
|
99
99
|
},
|
|
100
100
|
...o.map(_e)
|
|
101
101
|
]
|
|
@@ -103,8 +103,8 @@ function Qe(t) {
|
|
|
103
103
|
return f(l);
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
return
|
|
106
|
+
function T(t, e, r, a) {
|
|
107
|
+
return r.split(/\s+/).map((n) => n.replace(/^([^:]+)=/g, "$1:")).map((n) => {
|
|
108
108
|
let s = n.startsWith("-"), l, d, g, m;
|
|
109
109
|
return n.startsWith("-_exists_:") ? (l = n.substring(10), g = !0, s = !0) : n.startsWith("_exists_:") ? (l = n.substring(9), g = !0, s = !1) : n.includes(":") ? (s = n.startsWith("-"), [l, d] = s ? n.substring(1).split(":") : n.split(":"), g = !1, d.startsWith(">=") ? (m = ">=", d = d.substring(2)) : d.startsWith(">") ? (m = ">", d = d.substring(1)) : d.startsWith("<=") ? (m = "<=", d = d.substring(2)) : d.startsWith("<") ? (m = "<", d = d.substring(1)) : m = "=") : (l = null, d = n, g = !1), { key: l, value: d, isNegation: s, isExistsQuery: g, operator: m };
|
|
110
110
|
}).forEach(({ key: n, value: s, isNegation: l, isExistsQuery: d, operator: g }) => {
|
|
@@ -134,29 +134,29 @@ function O(t, e, a, r) {
|
|
|
134
134
|
const { ref: m } = t.dynamic;
|
|
135
135
|
e = e.where(
|
|
136
136
|
(y) => y.or(
|
|
137
|
-
|
|
137
|
+
a.map((x) => y(m(x), "like", `%${s}%`))
|
|
138
138
|
)
|
|
139
139
|
);
|
|
140
140
|
}
|
|
141
141
|
}), e;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function C(t) {
|
|
144
144
|
return typeof t == "string" ? parseInt(t, 10) : typeof t == "bigint" ? Number(t) : t;
|
|
145
145
|
}
|
|
146
146
|
function Ve(t) {
|
|
147
|
-
return async (e,
|
|
147
|
+
return async (e, r = {
|
|
148
148
|
page: 0,
|
|
149
149
|
per_page: 50,
|
|
150
150
|
include_totals: !1
|
|
151
151
|
}) => {
|
|
152
|
-
let
|
|
153
|
-
if (
|
|
152
|
+
let a = t.selectFrom("users").where("users.tenant_id", "=", e);
|
|
153
|
+
if (r.q && (a = T(t, a, r.q, ["email", "name"])), r.sort && r.sort.sort_by) {
|
|
154
154
|
const { ref: m } = t.dynamic;
|
|
155
|
-
|
|
155
|
+
a = a.orderBy(m(r.sort.sort_by), r.sort.sort_order);
|
|
156
156
|
}
|
|
157
|
-
const n = await
|
|
157
|
+
const n = await a.offset(r.page * r.per_page).limit(r.per_page).selectAll().execute(), s = n.map((m) => m.user_id), l = s.length ? await t.selectFrom("users").selectAll().where("users.tenant_id", "=", e).where("users.linked_to", "in", s).execute() : [], d = n.map((m) => {
|
|
158
158
|
const y = l.filter(
|
|
159
|
-
(
|
|
159
|
+
(x) => x.linked_to === m.user_id
|
|
160
160
|
);
|
|
161
161
|
return f({
|
|
162
162
|
...m,
|
|
@@ -174,36 +174,36 @@ function Ve(t) {
|
|
|
174
174
|
...y.map(_e)
|
|
175
175
|
]
|
|
176
176
|
});
|
|
177
|
-
}), { count: g } = await
|
|
177
|
+
}), { count: g } = await a.select((m) => m.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
178
178
|
return {
|
|
179
179
|
users: d,
|
|
180
|
-
start:
|
|
181
|
-
limit:
|
|
182
|
-
length:
|
|
180
|
+
start: r.page * r.per_page,
|
|
181
|
+
limit: r.per_page,
|
|
182
|
+
length: C(g)
|
|
183
183
|
};
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
186
|
function We(t) {
|
|
187
|
-
return async (e,
|
|
187
|
+
return async (e, r) => (await t.deleteFrom("users").where("users.tenant_id", "=", e).where("users.linked_to", "=", r).execute(), (await t.deleteFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", r).execute()).length === 1);
|
|
188
188
|
}
|
|
189
189
|
function qe(t) {
|
|
190
190
|
if (t.email_verified !== void 0)
|
|
191
191
|
return t.email_verified ? 1 : 0;
|
|
192
192
|
}
|
|
193
193
|
function Ge(t) {
|
|
194
|
-
return async (e,
|
|
194
|
+
return async (e, r, a) => {
|
|
195
195
|
const o = {
|
|
196
|
-
...
|
|
197
|
-
email_verified: qe(
|
|
196
|
+
...a,
|
|
197
|
+
email_verified: qe(a),
|
|
198
198
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
199
199
|
};
|
|
200
|
-
return
|
|
200
|
+
return a.app_metadata && (o.app_metadata = JSON.stringify(a.app_metadata)), a.user_metadata && (o.user_metadata = JSON.stringify(a.user_metadata)), (await t.updateTable("users").set(o).where("users.tenant_id", "=", e).where("users.user_id", "=", r).execute()).length === 1;
|
|
201
201
|
};
|
|
202
202
|
}
|
|
203
203
|
function He(t) {
|
|
204
|
-
return async (e,
|
|
204
|
+
return async (e, r, a, o) => {
|
|
205
205
|
const n = { linked_to: null };
|
|
206
|
-
return (await t.updateTable("users").set(n).where("users.tenant_id", "=", e).where("users.user_id", "=", `${
|
|
206
|
+
return (await t.updateTable("users").set(n).where("users.tenant_id", "=", e).where("users.user_id", "=", `${a}|${o}`).where("users.linked_to", "=", `${r}`).execute()).length === 1;
|
|
207
207
|
};
|
|
208
208
|
}
|
|
209
209
|
function Xe(t) {
|
|
@@ -219,26 +219,26 @@ function Xe(t) {
|
|
|
219
219
|
}
|
|
220
220
|
const Ye = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
221
221
|
let k = (t = 21) => {
|
|
222
|
-
let e = "",
|
|
222
|
+
let e = "", r = crypto.getRandomValues(new Uint8Array(t));
|
|
223
223
|
for (; t--; )
|
|
224
|
-
e += Ye[
|
|
224
|
+
e += Ye[r[t] & 63];
|
|
225
225
|
return e;
|
|
226
226
|
};
|
|
227
227
|
function Ze(t) {
|
|
228
228
|
return async (e) => {
|
|
229
|
-
const
|
|
229
|
+
const r = {
|
|
230
230
|
id: e.id || k(),
|
|
231
231
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
232
232
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
233
233
|
...e
|
|
234
234
|
};
|
|
235
|
-
return await t.insertInto("tenants").values(
|
|
235
|
+
return await t.insertInto("tenants").values(r).execute(), r;
|
|
236
236
|
};
|
|
237
237
|
}
|
|
238
238
|
function et(t) {
|
|
239
239
|
return async (e) => {
|
|
240
|
-
const
|
|
241
|
-
return
|
|
240
|
+
const r = await t.selectFrom("tenants").where("tenants.id", "=", e).selectAll().executeTakeFirst();
|
|
241
|
+
return r ? f(r) : null;
|
|
242
242
|
};
|
|
243
243
|
}
|
|
244
244
|
function tt(t) {
|
|
@@ -247,18 +247,18 @@ function tt(t) {
|
|
|
247
247
|
per_page: 50,
|
|
248
248
|
include_totals: !1
|
|
249
249
|
}) => {
|
|
250
|
-
let
|
|
250
|
+
let r = t.selectFrom("tenants");
|
|
251
251
|
if (e.sort && e.sort.sort_by) {
|
|
252
252
|
const { ref: l } = t.dynamic;
|
|
253
|
-
|
|
253
|
+
r = r.orderBy(l(e.sort.sort_by), e.sort.sort_order);
|
|
254
254
|
}
|
|
255
|
-
e.q && (
|
|
256
|
-
const o = await
|
|
255
|
+
e.q && (r = r.where((l) => l.or([l("name", "like", `%${e.q}%`)])));
|
|
256
|
+
const o = await r.offset(e.page * e.per_page).limit(e.per_page).selectAll().execute();
|
|
257
257
|
if (!e.include_totals)
|
|
258
258
|
return {
|
|
259
259
|
tenants: o
|
|
260
260
|
};
|
|
261
|
-
const { count: n } = await
|
|
261
|
+
const { count: n } = await r.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow(), s = C(n);
|
|
262
262
|
return {
|
|
263
263
|
tenants: o.map(f),
|
|
264
264
|
start: (e.page - 1) * e.per_page,
|
|
@@ -267,17 +267,17 @@ function tt(t) {
|
|
|
267
267
|
};
|
|
268
268
|
};
|
|
269
269
|
}
|
|
270
|
-
function
|
|
271
|
-
return async (e,
|
|
272
|
-
const
|
|
273
|
-
...
|
|
270
|
+
function rt(t) {
|
|
271
|
+
return async (e, r) => {
|
|
272
|
+
const a = {
|
|
273
|
+
...r,
|
|
274
274
|
id: e,
|
|
275
275
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
276
276
|
};
|
|
277
|
-
await t.updateTable("tenants").set(
|
|
277
|
+
await t.updateTable("tenants").set(a).where("id", "=", e).execute();
|
|
278
278
|
};
|
|
279
279
|
}
|
|
280
|
-
function
|
|
280
|
+
function at(t) {
|
|
281
281
|
return async (e) => (await t.deleteFrom("tenants").where("tenants.id", "=", e).execute()).length === 1;
|
|
282
282
|
}
|
|
283
283
|
function nt(t) {
|
|
@@ -285,8 +285,8 @@ function nt(t) {
|
|
|
285
285
|
create: Ze(t),
|
|
286
286
|
get: et(t),
|
|
287
287
|
list: tt(t),
|
|
288
|
-
update:
|
|
289
|
-
remove:
|
|
288
|
+
update: rt(t),
|
|
289
|
+
remove: at(t)
|
|
290
290
|
};
|
|
291
291
|
}
|
|
292
292
|
function ue(t) {
|
|
@@ -294,23 +294,23 @@ function ue(t) {
|
|
|
294
294
|
}
|
|
295
295
|
const ot = 1024;
|
|
296
296
|
function st(t) {
|
|
297
|
-
return async (e,
|
|
297
|
+
return async (e, r) => {
|
|
298
298
|
var o, n, s;
|
|
299
|
-
const
|
|
299
|
+
const a = {
|
|
300
300
|
id: k(),
|
|
301
|
-
...
|
|
302
|
-
user_agent:
|
|
301
|
+
...r,
|
|
302
|
+
user_agent: r.user_agent.slice(0, ot)
|
|
303
303
|
};
|
|
304
304
|
return await t.insertInto("logs").values({
|
|
305
|
-
...
|
|
305
|
+
...a,
|
|
306
306
|
// Truncate long strings to avoid database errors
|
|
307
|
-
description: (o =
|
|
308
|
-
isMobile:
|
|
307
|
+
description: (o = a.description) == null ? void 0 : o.substring(0, 256),
|
|
308
|
+
isMobile: r.isMobile ? 1 : 0,
|
|
309
309
|
tenant_id: e,
|
|
310
|
-
scope: (n =
|
|
311
|
-
auth0_client: ue(
|
|
312
|
-
details: (s = ue(
|
|
313
|
-
}).execute(),
|
|
310
|
+
scope: (n = r.scope) == null ? void 0 : n.join(","),
|
|
311
|
+
auth0_client: ue(r.auth0_client),
|
|
312
|
+
details: (s = ue(r.details)) == null ? void 0 : s.substring(0, 8192)
|
|
313
|
+
}).execute(), a;
|
|
314
314
|
};
|
|
315
315
|
}
|
|
316
316
|
function me(t) {
|
|
@@ -336,35 +336,35 @@ function pe(t) {
|
|
|
336
336
|
};
|
|
337
337
|
}
|
|
338
338
|
function it(t) {
|
|
339
|
-
return async (e,
|
|
339
|
+
return async (e, r = {
|
|
340
340
|
page: 0,
|
|
341
341
|
per_page: 50,
|
|
342
342
|
include_totals: !1
|
|
343
343
|
}) => {
|
|
344
|
-
let
|
|
345
|
-
|
|
346
|
-
let o =
|
|
347
|
-
if (
|
|
344
|
+
let a = t.selectFrom("logs").where("logs.tenant_id", "=", e);
|
|
345
|
+
r.q && (a = T(t, a, r.q, ["user_id", "ip"]));
|
|
346
|
+
let o = a;
|
|
347
|
+
if (r.sort && r.sort.sort_by) {
|
|
348
348
|
const { ref: l } = t.dynamic;
|
|
349
349
|
o = o.orderBy(
|
|
350
|
-
l(
|
|
351
|
-
|
|
350
|
+
l(r.sort.sort_by),
|
|
351
|
+
r.sort.sort_order
|
|
352
352
|
);
|
|
353
353
|
}
|
|
354
|
-
o = o.offset(
|
|
355
|
-
const n = await o.selectAll().execute(), { count: s } = await
|
|
354
|
+
o = o.offset(r.page * r.per_page).limit(r.per_page);
|
|
355
|
+
const n = await o.selectAll().execute(), { count: s } = await a.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
356
356
|
return {
|
|
357
357
|
logs: n.map(pe),
|
|
358
|
-
start:
|
|
359
|
-
limit:
|
|
360
|
-
length:
|
|
358
|
+
start: r.page * r.per_page,
|
|
359
|
+
limit: r.per_page,
|
|
360
|
+
length: C(s)
|
|
361
361
|
};
|
|
362
362
|
};
|
|
363
363
|
}
|
|
364
364
|
function lt(t) {
|
|
365
|
-
return async (e,
|
|
366
|
-
const
|
|
367
|
-
return
|
|
365
|
+
return async (e, r) => {
|
|
366
|
+
const a = await t.selectFrom("logs").where("logs.tenant_id", "=", e).where("logs.id", "=", r).selectAll().executeTakeFirst();
|
|
367
|
+
return a ? pe(a) : null;
|
|
368
368
|
};
|
|
369
369
|
}
|
|
370
370
|
function ct(t) {
|
|
@@ -375,46 +375,46 @@ function ct(t) {
|
|
|
375
375
|
};
|
|
376
376
|
}
|
|
377
377
|
function dt(t) {
|
|
378
|
-
return async (e,
|
|
378
|
+
return async (e, r) => await t.selectFrom("sessions").where("sessions.tenant_id", "=", e).where("sessions.session_id", "=", r).where("sessions.deleted_at", "is", null).selectAll().executeTakeFirst() ?? null;
|
|
379
379
|
}
|
|
380
380
|
function ut(t) {
|
|
381
|
-
return async (e,
|
|
382
|
-
const
|
|
383
|
-
...
|
|
381
|
+
return async (e, r) => {
|
|
382
|
+
const a = {
|
|
383
|
+
...r,
|
|
384
384
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
385
385
|
expires_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
386
386
|
};
|
|
387
|
-
return await t.insertInto("sessions").values({ ...
|
|
387
|
+
return await t.insertInto("sessions").values({ ...a, tenant_id: e }).execute(), { ...r, ...a };
|
|
388
388
|
};
|
|
389
389
|
}
|
|
390
390
|
function mt(t) {
|
|
391
|
-
return async (e,
|
|
391
|
+
return async (e, r) => !!(await t.updateTable("sessions").set({ deleted_at: (/* @__PURE__ */ new Date()).toISOString() }).where("tenant_id", "=", e).where("sessions.session_id", "=", r).where("sessions.deleted_at", "is", null).execute()).length;
|
|
392
392
|
}
|
|
393
393
|
function ht(t) {
|
|
394
|
-
return async (e,
|
|
394
|
+
return async (e, r, a) => !!(await t.updateTable("sessions").set(a).where("tenant_id", "=", e).where("sessions.session_id", "=", r).where("sessions.deleted_at", "is", null).execute()).length;
|
|
395
395
|
}
|
|
396
396
|
function ft(t) {
|
|
397
|
-
return async (e,
|
|
397
|
+
return async (e, r = {
|
|
398
398
|
page: 0,
|
|
399
399
|
per_page: 50,
|
|
400
400
|
include_totals: !1
|
|
401
401
|
}) => {
|
|
402
|
-
let
|
|
403
|
-
|
|
404
|
-
let o =
|
|
405
|
-
if (
|
|
402
|
+
let a = t.selectFrom("sessions").where("sessions.tenant_id", "=", e);
|
|
403
|
+
r.q && (a = T(t, a, r.q, ["user_id", "session_id"]));
|
|
404
|
+
let o = a;
|
|
405
|
+
if (r.sort && r.sort.sort_by) {
|
|
406
406
|
const { ref: d } = t.dynamic;
|
|
407
407
|
o = o.orderBy(
|
|
408
|
-
d(
|
|
409
|
-
|
|
408
|
+
d(r.sort.sort_by),
|
|
409
|
+
r.sort.sort_order
|
|
410
410
|
);
|
|
411
411
|
}
|
|
412
|
-
o = o.offset(
|
|
413
|
-
const n = await o.selectAll().execute(), { count: s } = await
|
|
412
|
+
o = o.offset(r.page * r.per_page).limit(r.per_page);
|
|
413
|
+
const n = await o.selectAll().execute(), { count: s } = await a.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), l = C(s);
|
|
414
414
|
return {
|
|
415
415
|
sessions: n,
|
|
416
|
-
start:
|
|
417
|
-
limit:
|
|
416
|
+
start: r.page * r.per_page,
|
|
417
|
+
limit: r.per_page,
|
|
418
418
|
length: l
|
|
419
419
|
};
|
|
420
420
|
};
|
|
@@ -429,29 +429,29 @@ function _t(t) {
|
|
|
429
429
|
};
|
|
430
430
|
}
|
|
431
431
|
function pt(t) {
|
|
432
|
-
return async (e,
|
|
433
|
-
const
|
|
432
|
+
return async (e, r) => {
|
|
433
|
+
const a = await t.selectFrom("passwords").where("passwords.tenant_id", "=", e).where("passwords.user_id", "=", r).selectAll().executeTakeFirstOrThrow(), { tenant_id: o, ...n } = a;
|
|
434
434
|
return n;
|
|
435
435
|
};
|
|
436
436
|
}
|
|
437
437
|
function gt(t) {
|
|
438
|
-
return async (e,
|
|
439
|
-
const
|
|
440
|
-
...
|
|
438
|
+
return async (e, r) => {
|
|
439
|
+
const a = {
|
|
440
|
+
...r,
|
|
441
441
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
442
442
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
443
443
|
};
|
|
444
444
|
return await t.insertInto("passwords").values({
|
|
445
|
-
...
|
|
445
|
+
...a,
|
|
446
446
|
tenant_id: e
|
|
447
|
-
}).execute(),
|
|
447
|
+
}).execute(), a;
|
|
448
448
|
};
|
|
449
449
|
}
|
|
450
450
|
function wt(t) {
|
|
451
|
-
return async (e,
|
|
452
|
-
password:
|
|
451
|
+
return async (e, r) => (await t.updateTable("passwords").set({
|
|
452
|
+
password: r.password,
|
|
453
453
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
454
|
-
}).where("tenant_id", "=", e).where("user_id", "=",
|
|
454
|
+
}).where("tenant_id", "=", e).where("user_id", "=", r.user_id).execute()).length === 1;
|
|
455
455
|
}
|
|
456
456
|
function yt(t) {
|
|
457
457
|
return {
|
|
@@ -461,50 +461,50 @@ function yt(t) {
|
|
|
461
461
|
};
|
|
462
462
|
}
|
|
463
463
|
function Nt(t) {
|
|
464
|
-
return async (e,
|
|
464
|
+
return async (e, r = {
|
|
465
465
|
page: 0,
|
|
466
466
|
per_page: 50,
|
|
467
467
|
include_totals: !1
|
|
468
468
|
}) => {
|
|
469
|
-
let
|
|
470
|
-
|
|
471
|
-
const n = await
|
|
469
|
+
let a = t.selectFrom("codes").where("codes.tenant_id", "=", e);
|
|
470
|
+
r.q && (a = T(t, a, r.q, ["code", "login_id"]));
|
|
471
|
+
const n = await a.offset(r.page * r.per_page).limit(r.per_page).selectAll().execute(), { count: s } = await a.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
472
472
|
return {
|
|
473
473
|
codes: n.map((d) => {
|
|
474
474
|
const { tenant_id: g, ...m } = d;
|
|
475
475
|
return Je.parse(f(m));
|
|
476
476
|
}),
|
|
477
|
-
start:
|
|
478
|
-
limit:
|
|
479
|
-
length:
|
|
477
|
+
start: r.page * r.per_page,
|
|
478
|
+
limit: r.per_page,
|
|
479
|
+
length: C(s)
|
|
480
480
|
};
|
|
481
481
|
};
|
|
482
482
|
}
|
|
483
483
|
function vt(t) {
|
|
484
|
-
return async (e,
|
|
485
|
-
const
|
|
486
|
-
...
|
|
484
|
+
return async (e, r) => {
|
|
485
|
+
const a = {
|
|
486
|
+
...r,
|
|
487
487
|
created_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
488
488
|
};
|
|
489
489
|
return await t.insertInto("codes").values({
|
|
490
|
-
...
|
|
490
|
+
...a,
|
|
491
491
|
tenant_id: e
|
|
492
|
-
}).execute(),
|
|
492
|
+
}).execute(), a;
|
|
493
493
|
};
|
|
494
494
|
}
|
|
495
495
|
function bt(t) {
|
|
496
|
-
return async (e,
|
|
496
|
+
return async (e, r) => (await t.deleteFrom("codes").where("codes.tenant_id", "=", e).where("codes.code_id", "=", r).executeTakeFirst()).numDeletedRows > 0;
|
|
497
497
|
}
|
|
498
498
|
function Ct(t) {
|
|
499
|
-
return async (e,
|
|
500
|
-
let o = t.selectFrom("codes").where("codes.code_id", "=",
|
|
499
|
+
return async (e, r, a) => {
|
|
500
|
+
let o = t.selectFrom("codes").where("codes.code_id", "=", r).where("codes.code_type", "=", a);
|
|
501
501
|
e.length && (o = o.where("codes.tenant_id", "=", e));
|
|
502
502
|
const n = await o.selectAll().executeTakeFirst();
|
|
503
503
|
return n ? f(n) : null;
|
|
504
504
|
};
|
|
505
505
|
}
|
|
506
506
|
function xt(t) {
|
|
507
|
-
return async (e,
|
|
507
|
+
return async (e, r) => (await t.updateTable("codes").set({ used_at: (/* @__PURE__ */ new Date()).toISOString() }).where("codes.tenant_id", "=", e).where("codes.code_id", "=", r).executeTakeFirst()).numUpdatedRows > 0;
|
|
508
508
|
}
|
|
509
509
|
function Tt(t) {
|
|
510
510
|
return {
|
|
@@ -516,23 +516,23 @@ function Tt(t) {
|
|
|
516
516
|
};
|
|
517
517
|
}
|
|
518
518
|
function St(t) {
|
|
519
|
-
return async (e,
|
|
520
|
-
const
|
|
519
|
+
return async (e, r) => {
|
|
520
|
+
const a = {
|
|
521
521
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
522
522
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
523
|
-
...
|
|
524
|
-
}, o = JSON.stringify(
|
|
523
|
+
...r
|
|
524
|
+
}, o = JSON.stringify(r.allowed_origins), n = JSON.stringify(r.callbacks), s = JSON.stringify(r.web_origins), l = JSON.stringify(r.allowed_logout_urls), d = JSON.stringify(r.allowed_clients);
|
|
525
525
|
return await t.insertInto("applications").values({
|
|
526
|
-
...
|
|
526
|
+
...a,
|
|
527
527
|
tenant_id: e,
|
|
528
|
-
disable_sign_ups:
|
|
529
|
-
addons:
|
|
528
|
+
disable_sign_ups: r.disable_sign_ups ? 1 : 0,
|
|
529
|
+
addons: r.addons ? JSON.stringify(r.addons) : "{}",
|
|
530
530
|
callbacks: n,
|
|
531
531
|
allowed_origins: o,
|
|
532
532
|
web_origins: s,
|
|
533
533
|
allowed_logout_urls: l,
|
|
534
534
|
allowed_clients: d
|
|
535
|
-
}).execute(),
|
|
535
|
+
}).execute(), a;
|
|
536
536
|
};
|
|
537
537
|
}
|
|
538
538
|
function Ot(t) {
|
|
@@ -550,107 +550,107 @@ function Ot(t) {
|
|
|
550
550
|
});
|
|
551
551
|
}
|
|
552
552
|
function kt(t) {
|
|
553
|
-
return async (e,
|
|
554
|
-
const
|
|
555
|
-
return
|
|
556
|
-
...
|
|
557
|
-
disable_sign_ups: !!
|
|
558
|
-
addons: JSON.parse(
|
|
559
|
-
callbacks: JSON.parse(
|
|
560
|
-
allowed_origins: JSON.parse(
|
|
561
|
-
web_origins: JSON.parse(
|
|
562
|
-
allowed_logout_urls: JSON.parse(
|
|
553
|
+
return async (e, r) => {
|
|
554
|
+
const a = await t.selectFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", r).selectAll().executeTakeFirst();
|
|
555
|
+
return a ? f({
|
|
556
|
+
...a,
|
|
557
|
+
disable_sign_ups: !!a.disable_sign_ups,
|
|
558
|
+
addons: JSON.parse(a.addons),
|
|
559
|
+
callbacks: JSON.parse(a.callbacks),
|
|
560
|
+
allowed_origins: JSON.parse(a.allowed_origins),
|
|
561
|
+
web_origins: JSON.parse(a.web_origins),
|
|
562
|
+
allowed_logout_urls: JSON.parse(a.allowed_logout_urls)
|
|
563
563
|
}) : null;
|
|
564
564
|
};
|
|
565
565
|
}
|
|
566
566
|
function $t(t) {
|
|
567
|
-
return async (e,
|
|
567
|
+
return async (e, r) => (await t.deleteFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", r).executeTakeFirst()).numDeletedRows > 0;
|
|
568
568
|
}
|
|
569
|
-
function
|
|
570
|
-
return async (e,
|
|
569
|
+
function It(t) {
|
|
570
|
+
return async (e, r, a) => {
|
|
571
571
|
const o = {
|
|
572
|
-
...
|
|
572
|
+
...a,
|
|
573
573
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
574
|
-
allowed_origins:
|
|
575
|
-
callbacks:
|
|
576
|
-
web_origins:
|
|
577
|
-
allowed_logout_urls:
|
|
578
|
-
allowed_clients:
|
|
579
|
-
addons:
|
|
580
|
-
disable_sign_ups:
|
|
574
|
+
allowed_origins: a.allowed_origins ? JSON.stringify(a.allowed_origins) : void 0,
|
|
575
|
+
callbacks: a.callbacks ? JSON.stringify(a.callbacks) : void 0,
|
|
576
|
+
web_origins: a.web_origins ? JSON.stringify(a.web_origins) : void 0,
|
|
577
|
+
allowed_logout_urls: a.allowed_logout_urls ? JSON.stringify(a.allowed_logout_urls) : void 0,
|
|
578
|
+
allowed_clients: a.allowed_clients ? JSON.stringify(a.allowed_clients) : void 0,
|
|
579
|
+
addons: a.addons ? JSON.stringify(a.addons) : "{}",
|
|
580
|
+
disable_sign_ups: a.disable_sign_ups ? 1 : 0
|
|
581
581
|
};
|
|
582
|
-
return await t.updateTable("applications").set(o).where("applications.id", "=",
|
|
582
|
+
return await t.updateTable("applications").set(o).where("applications.id", "=", r).where("applications.tenant_id", "=", e).execute(), !0;
|
|
583
583
|
};
|
|
584
584
|
}
|
|
585
|
-
function
|
|
585
|
+
function Dt(t) {
|
|
586
586
|
return {
|
|
587
587
|
create: St(t),
|
|
588
588
|
list: Ot(t),
|
|
589
589
|
get: kt(t),
|
|
590
590
|
remove: $t(t),
|
|
591
|
-
update:
|
|
591
|
+
update: It(t)
|
|
592
592
|
};
|
|
593
593
|
}
|
|
594
594
|
function Pt(t) {
|
|
595
|
-
return async (e,
|
|
596
|
-
const
|
|
595
|
+
return async (e, r) => {
|
|
596
|
+
const a = {
|
|
597
597
|
id: k(),
|
|
598
|
-
...
|
|
598
|
+
...r,
|
|
599
599
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
600
600
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
601
601
|
};
|
|
602
602
|
return await t.insertInto("connections").values({
|
|
603
|
-
...
|
|
603
|
+
...a,
|
|
604
604
|
// The connection options will have many different properties depending on the strategy
|
|
605
|
-
options: JSON.stringify(
|
|
605
|
+
options: JSON.stringify(a.options || {}),
|
|
606
606
|
tenant_id: e
|
|
607
|
-
}).execute(),
|
|
607
|
+
}).execute(), a;
|
|
608
608
|
};
|
|
609
609
|
}
|
|
610
610
|
function jt(t) {
|
|
611
|
-
return async (e,
|
|
611
|
+
return async (e, r = {
|
|
612
612
|
page: 0,
|
|
613
613
|
per_page: 50,
|
|
614
614
|
include_totals: !1
|
|
615
615
|
}) => {
|
|
616
|
-
let
|
|
617
|
-
|
|
618
|
-
const s = (await
|
|
616
|
+
let a = t.selectFrom("connections").where("connections.tenant_id", "=", e);
|
|
617
|
+
r.q && (a = T(t, a, r.q, ["user_id", "ip"]));
|
|
618
|
+
const s = (await a.offset(r.page * r.per_page).limit(r.per_page).selectAll().execute()).map(
|
|
619
619
|
(d) => f({
|
|
620
620
|
...d,
|
|
621
621
|
options: JSON.parse(d.options)
|
|
622
622
|
})
|
|
623
|
-
), { count: l } = await
|
|
623
|
+
), { count: l } = await a.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
624
624
|
return {
|
|
625
625
|
connections: s,
|
|
626
|
-
start:
|
|
627
|
-
limit:
|
|
628
|
-
length:
|
|
626
|
+
start: r.page * r.per_page,
|
|
627
|
+
limit: r.per_page,
|
|
628
|
+
length: C(l)
|
|
629
629
|
};
|
|
630
630
|
};
|
|
631
631
|
}
|
|
632
632
|
function Mt(t) {
|
|
633
|
-
return async (e,
|
|
633
|
+
return async (e, r) => (await t.deleteFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", r).executeTakeFirst()).numDeletedRows > 0;
|
|
634
634
|
}
|
|
635
635
|
function At(t) {
|
|
636
|
-
return async (e,
|
|
637
|
-
const
|
|
638
|
-
return
|
|
639
|
-
...
|
|
640
|
-
options: JSON.parse(
|
|
636
|
+
return async (e, r) => {
|
|
637
|
+
const a = await t.selectFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", r).selectAll().executeTakeFirst();
|
|
638
|
+
return a ? f({
|
|
639
|
+
...a,
|
|
640
|
+
options: JSON.parse(a.options)
|
|
641
641
|
}) : null;
|
|
642
642
|
};
|
|
643
643
|
}
|
|
644
644
|
function Ft(t) {
|
|
645
|
-
return async (e,
|
|
645
|
+
return async (e, r, a) => {
|
|
646
646
|
const o = {
|
|
647
|
-
...
|
|
647
|
+
...a,
|
|
648
648
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
649
649
|
};
|
|
650
650
|
return await t.updateTable("connections").set({
|
|
651
651
|
...o,
|
|
652
652
|
options: o.options ? JSON.stringify(o.options) : void 0
|
|
653
|
-
}).where("connections.id", "=",
|
|
653
|
+
}).where("connections.id", "=", r).where("connections.tenant_id", "=", e).execute(), !0;
|
|
654
654
|
};
|
|
655
655
|
}
|
|
656
656
|
function Lt(t) {
|
|
@@ -665,15 +665,15 @@ function Lt(t) {
|
|
|
665
665
|
function Et(t) {
|
|
666
666
|
return {
|
|
667
667
|
get: async (e) => {
|
|
668
|
-
const
|
|
669
|
-
if (!a)
|
|
670
|
-
return null;
|
|
671
|
-
const r = await t.selectFrom("tenants").selectAll().where("id", "=", a.tenant_id).executeTakeFirst();
|
|
668
|
+
const r = await t.selectFrom("applications").selectAll().where("id", "=", e).executeTakeFirst();
|
|
672
669
|
if (!r)
|
|
670
|
+
return null;
|
|
671
|
+
const a = await t.selectFrom("tenants").selectAll().where("id", "=", r.tenant_id).executeTakeFirst();
|
|
672
|
+
if (!a)
|
|
673
673
|
throw new V(404, { message: "Tenant not found" });
|
|
674
|
-
const o = await t.selectFrom("connections").where("tenant_id", "=",
|
|
674
|
+
const o = await t.selectFrom("connections").where("tenant_id", "=", r.tenant_id).selectAll().execute(), n = await t.selectFrom("domains").where("tenant_id", "=", r.tenant_id).selectAll().execute();
|
|
675
675
|
return {
|
|
676
|
-
...
|
|
676
|
+
...r,
|
|
677
677
|
connections: o.map(
|
|
678
678
|
(l) => Re.parse(
|
|
679
679
|
f({
|
|
@@ -683,24 +683,24 @@ function Et(t) {
|
|
|
683
683
|
)
|
|
684
684
|
),
|
|
685
685
|
domains: n,
|
|
686
|
-
addons:
|
|
687
|
-
callbacks:
|
|
688
|
-
allowed_origins:
|
|
689
|
-
web_origins:
|
|
690
|
-
allowed_logout_urls:
|
|
691
|
-
allowed_clients:
|
|
692
|
-
tenant: f(
|
|
686
|
+
addons: r.addons ? JSON.parse(r.addons) : {},
|
|
687
|
+
callbacks: r.callbacks ? JSON.parse(r.callbacks) : [],
|
|
688
|
+
allowed_origins: r.allowed_origins ? JSON.parse(r.allowed_origins) : [],
|
|
689
|
+
web_origins: r.web_origins ? JSON.parse(r.web_origins) : [],
|
|
690
|
+
allowed_logout_urls: r.allowed_logout_urls ? JSON.parse(r.allowed_logout_urls) : [],
|
|
691
|
+
allowed_clients: r.allowed_clients ? JSON.parse(r.allowed_clients) : [],
|
|
692
|
+
tenant: f(a),
|
|
693
693
|
// this is really an integer in the database
|
|
694
|
-
disable_sign_ups: !!
|
|
694
|
+
disable_sign_ups: !!r.disable_sign_ups
|
|
695
695
|
};
|
|
696
696
|
}
|
|
697
697
|
};
|
|
698
698
|
}
|
|
699
699
|
function zt(t) {
|
|
700
700
|
return async () => await t.selectFrom("keys").where(
|
|
701
|
-
(
|
|
702
|
-
|
|
703
|
-
|
|
701
|
+
(r) => r.or([
|
|
702
|
+
r("revoked_at", ">", (/* @__PURE__ */ new Date()).toISOString()),
|
|
703
|
+
r("revoked_at", "is", null)
|
|
704
704
|
])
|
|
705
705
|
).selectAll().execute();
|
|
706
706
|
}
|
|
@@ -710,7 +710,7 @@ function Jt(t) {
|
|
|
710
710
|
};
|
|
711
711
|
}
|
|
712
712
|
function Rt(t) {
|
|
713
|
-
return async (e,
|
|
713
|
+
return async (e, r) => !!(await t.updateTable("keys").set(r).where("kid", "=", e).execute()).length;
|
|
714
714
|
}
|
|
715
715
|
function Ut(t) {
|
|
716
716
|
return {
|
|
@@ -720,27 +720,27 @@ function Ut(t) {
|
|
|
720
720
|
};
|
|
721
721
|
}
|
|
722
722
|
function Kt(t) {
|
|
723
|
-
return async (e,
|
|
724
|
-
const
|
|
723
|
+
return async (e, r) => {
|
|
724
|
+
const a = {
|
|
725
725
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
726
726
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
727
727
|
tenant_id: e,
|
|
728
728
|
id: k(),
|
|
729
|
-
...
|
|
729
|
+
...r
|
|
730
730
|
};
|
|
731
|
-
return await t.insertInto("domains").values(
|
|
731
|
+
return await t.insertInto("domains").values(a).execute(), a;
|
|
732
732
|
};
|
|
733
733
|
}
|
|
734
734
|
function Bt(t) {
|
|
735
|
-
return async (e,
|
|
736
|
-
let
|
|
737
|
-
|
|
738
|
-
const n = await
|
|
735
|
+
return async (e, r) => {
|
|
736
|
+
let a = t.selectFrom("domains").where("domains.tenant_id", "=", e);
|
|
737
|
+
r.q && (a = T(t, a, r.q, ["user_id", "ip"]));
|
|
738
|
+
const n = await a.offset(r.page * r.per_page).limit(r.per_page).selectAll().execute(), { count: s } = await a.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
739
739
|
return {
|
|
740
740
|
domains: n,
|
|
741
|
-
start:
|
|
742
|
-
limit:
|
|
743
|
-
length:
|
|
741
|
+
start: r.page * r.per_page,
|
|
742
|
+
limit: r.per_page,
|
|
743
|
+
length: C(s)
|
|
744
744
|
};
|
|
745
745
|
};
|
|
746
746
|
}
|
|
@@ -752,11 +752,11 @@ function Qt(t) {
|
|
|
752
752
|
}
|
|
753
753
|
function Vt(t) {
|
|
754
754
|
return async (e) => {
|
|
755
|
-
const [
|
|
756
|
-
if (!
|
|
755
|
+
const [r] = await t.selectFrom("branding").where("branding.tenant_id", "=", e).selectAll().execute();
|
|
756
|
+
if (!r)
|
|
757
757
|
return null;
|
|
758
758
|
const {
|
|
759
|
-
tenant_id:
|
|
759
|
+
tenant_id: a,
|
|
760
760
|
colors_primary: o,
|
|
761
761
|
colors_page_background_type: n,
|
|
762
762
|
colors_page_background_start: s,
|
|
@@ -764,7 +764,7 @@ function Vt(t) {
|
|
|
764
764
|
colors_page_background_angle_dev: d,
|
|
765
765
|
font_url: g,
|
|
766
766
|
...m
|
|
767
|
-
} =
|
|
767
|
+
} = r;
|
|
768
768
|
return f({
|
|
769
769
|
...m,
|
|
770
770
|
colors: {
|
|
@@ -781,29 +781,29 @@ function Vt(t) {
|
|
|
781
781
|
};
|
|
782
782
|
}
|
|
783
783
|
function Wt(t) {
|
|
784
|
-
return async (e,
|
|
785
|
-
var s, l, d, g, m, y,
|
|
786
|
-
const { colors:
|
|
784
|
+
return async (e, r) => {
|
|
785
|
+
var s, l, d, g, m, y, x, Z, ee, te, re, ae, ne, oe, se, ie, le, ce;
|
|
786
|
+
const { colors: a, font: o, ...n } = r;
|
|
787
787
|
try {
|
|
788
788
|
await t.insertInto("branding").values({
|
|
789
789
|
...n,
|
|
790
|
-
colors_primary:
|
|
791
|
-
colors_page_background_type: (l = (s =
|
|
792
|
-
colors_page_background_start: (g = (d =
|
|
793
|
-
colors_page_background_end: (y = (m =
|
|
794
|
-
colors_page_background_angle_dev: (Z = (
|
|
795
|
-
font_url: (ee =
|
|
790
|
+
colors_primary: a == null ? void 0 : a.primary,
|
|
791
|
+
colors_page_background_type: (l = (s = r.colors) == null ? void 0 : s.page_background) == null ? void 0 : l.type,
|
|
792
|
+
colors_page_background_start: (g = (d = r.colors) == null ? void 0 : d.page_background) == null ? void 0 : g.start,
|
|
793
|
+
colors_page_background_end: (y = (m = r.colors) == null ? void 0 : m.page_background) == null ? void 0 : y.end,
|
|
794
|
+
colors_page_background_angle_dev: (Z = (x = r.colors) == null ? void 0 : x.page_background) == null ? void 0 : Z.angle_deg,
|
|
795
|
+
font_url: (ee = r.font) == null ? void 0 : ee.url,
|
|
796
796
|
tenant_id: e
|
|
797
797
|
}).execute();
|
|
798
798
|
} catch {
|
|
799
799
|
await t.updateTable("branding").set({
|
|
800
800
|
...n,
|
|
801
|
-
colors_primary:
|
|
802
|
-
colors_page_background_type: (
|
|
803
|
-
colors_page_background_start: (ne = (
|
|
804
|
-
colors_page_background_end: (se = (oe =
|
|
805
|
-
colors_page_background_angle_dev: (le = (ie =
|
|
806
|
-
font_url: (ce =
|
|
801
|
+
colors_primary: a == null ? void 0 : a.primary,
|
|
802
|
+
colors_page_background_type: (re = (te = r.colors) == null ? void 0 : te.page_background) == null ? void 0 : re.type,
|
|
803
|
+
colors_page_background_start: (ne = (ae = r.colors) == null ? void 0 : ae.page_background) == null ? void 0 : ne.start,
|
|
804
|
+
colors_page_background_end: (se = (oe = r.colors) == null ? void 0 : oe.page_background) == null ? void 0 : se.end,
|
|
805
|
+
colors_page_background_angle_dev: (le = (ie = r.colors) == null ? void 0 : ie.page_background) == null ? void 0 : le.angle_deg,
|
|
806
|
+
font_url: (ce = r.font) == null ? void 0 : ce.url
|
|
807
807
|
}).where("tenant_id", "=", e).execute();
|
|
808
808
|
}
|
|
809
809
|
};
|
|
@@ -815,70 +815,70 @@ function qt(t) {
|
|
|
815
815
|
};
|
|
816
816
|
}
|
|
817
817
|
function Gt(t) {
|
|
818
|
-
return async (e,
|
|
818
|
+
return async (e, r = {
|
|
819
819
|
page: 0,
|
|
820
820
|
per_page: 50,
|
|
821
821
|
include_totals: !1
|
|
822
822
|
}) => {
|
|
823
|
-
let
|
|
824
|
-
|
|
825
|
-
const n = await
|
|
823
|
+
let a = t.selectFrom("hooks").where("hooks.tenant_id", "=", e);
|
|
824
|
+
r.q && (a = T(t, a, r.q, ["url"]));
|
|
825
|
+
const n = await a.offset(r.page * r.per_page).limit(r.per_page).selectAll().execute(), { count: s } = await a.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
826
826
|
return {
|
|
827
827
|
hooks: n.map((d) => {
|
|
828
|
-
const { tenant_id: g, enabled: m, synchronous: y, ...
|
|
828
|
+
const { tenant_id: g, enabled: m, synchronous: y, ...x } = d;
|
|
829
829
|
return f({
|
|
830
|
-
...
|
|
830
|
+
...x,
|
|
831
831
|
enabled: !!m,
|
|
832
832
|
synchronous: !!y
|
|
833
833
|
});
|
|
834
834
|
}),
|
|
835
|
-
start:
|
|
836
|
-
limit:
|
|
837
|
-
length:
|
|
835
|
+
start: r.page * r.per_page,
|
|
836
|
+
limit: r.per_page,
|
|
837
|
+
length: C(s)
|
|
838
838
|
};
|
|
839
839
|
};
|
|
840
840
|
}
|
|
841
841
|
function Ht(t) {
|
|
842
|
-
return async (e,
|
|
843
|
-
const
|
|
844
|
-
return
|
|
845
|
-
...
|
|
846
|
-
enabled: !!
|
|
847
|
-
synchronous: !!
|
|
842
|
+
return async (e, r) => {
|
|
843
|
+
const a = await t.selectFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", r).selectAll().executeTakeFirst();
|
|
844
|
+
return a ? f({
|
|
845
|
+
...a,
|
|
846
|
+
enabled: !!a.enabled,
|
|
847
|
+
synchronous: !!a.synchronous
|
|
848
848
|
}) : null;
|
|
849
849
|
};
|
|
850
850
|
}
|
|
851
851
|
function Xt(t) {
|
|
852
|
-
return async (e,
|
|
852
|
+
return async (e, r) => (await t.deleteFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", r).executeTakeFirst()).numDeletedRows > 0;
|
|
853
853
|
}
|
|
854
854
|
function Yt(t) {
|
|
855
|
-
return async (e,
|
|
856
|
-
const
|
|
855
|
+
return async (e, r) => {
|
|
856
|
+
const a = {
|
|
857
857
|
hook_id: k(),
|
|
858
|
-
...
|
|
858
|
+
...r,
|
|
859
859
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
860
860
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
861
861
|
};
|
|
862
862
|
return await t.insertInto("hooks").values({
|
|
863
|
-
...
|
|
863
|
+
...a,
|
|
864
864
|
tenant_id: e,
|
|
865
|
-
enabled:
|
|
866
|
-
synchronous:
|
|
867
|
-
}).execute(),
|
|
865
|
+
enabled: r.enabled ? 1 : 0,
|
|
866
|
+
synchronous: r.synchronous ? 1 : 0
|
|
867
|
+
}).execute(), a;
|
|
868
868
|
};
|
|
869
869
|
}
|
|
870
870
|
function Zt(t) {
|
|
871
|
-
return async (e,
|
|
871
|
+
return async (e, r, a) => {
|
|
872
872
|
const o = {
|
|
873
|
-
...
|
|
873
|
+
...a,
|
|
874
874
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
875
|
-
enabled:
|
|
876
|
-
synchronous:
|
|
875
|
+
enabled: a.enabled !== void 0 ? a.enabled ? 1 : 0 : void 0,
|
|
876
|
+
synchronous: a.enabled !== void 0 ? a.synchronous ? 1 : 0 : void 0
|
|
877
877
|
};
|
|
878
|
-
return await t.updateTable("hooks").set(o).where("hooks.hook_id", "=",
|
|
878
|
+
return await t.updateTable("hooks").set(o).where("hooks.hook_id", "=", r).where("hooks.tenant_id", "=", e).execute(), !0;
|
|
879
879
|
};
|
|
880
880
|
}
|
|
881
|
-
function
|
|
881
|
+
function er(t) {
|
|
882
882
|
return {
|
|
883
883
|
create: Yt(t),
|
|
884
884
|
get: Ht(t),
|
|
@@ -887,110 +887,110 @@ function ea(t) {
|
|
|
887
887
|
remove: Xt(t)
|
|
888
888
|
};
|
|
889
889
|
}
|
|
890
|
-
function z(t, e = "",
|
|
891
|
-
for (let
|
|
892
|
-
if (Object.prototype.hasOwnProperty.call(t,
|
|
893
|
-
const o = e ? `${e}_${
|
|
894
|
-
typeof t[
|
|
890
|
+
function z(t, e = "", r = {}) {
|
|
891
|
+
for (let a in t)
|
|
892
|
+
if (Object.prototype.hasOwnProperty.call(t, a)) {
|
|
893
|
+
const o = e ? `${e}_${a}` : a;
|
|
894
|
+
typeof t[a] == "object" && t[a] !== null && !Array.isArray(t[a]) ? z(t[a], o, r) : r[o] = t[a];
|
|
895
895
|
}
|
|
896
|
-
return
|
|
896
|
+
return r;
|
|
897
897
|
}
|
|
898
|
-
function
|
|
899
|
-
const
|
|
900
|
-
for (const [
|
|
898
|
+
function tr(t, e) {
|
|
899
|
+
const r = {};
|
|
900
|
+
for (const [a, o] of Object.entries(t)) {
|
|
901
901
|
const n = e.find(
|
|
902
|
-
(s) =>
|
|
902
|
+
(s) => a.startsWith(`${s}_`)
|
|
903
903
|
);
|
|
904
904
|
if (!n)
|
|
905
|
-
a
|
|
905
|
+
r[a] = o;
|
|
906
906
|
else {
|
|
907
|
-
const s =
|
|
908
|
-
|
|
909
|
-
...
|
|
907
|
+
const s = a.slice(n.length + 1);
|
|
908
|
+
r[n] = {
|
|
909
|
+
...r[n],
|
|
910
910
|
[s]: o
|
|
911
911
|
};
|
|
912
912
|
}
|
|
913
913
|
}
|
|
914
|
-
return
|
|
914
|
+
return r;
|
|
915
915
|
}
|
|
916
|
-
function
|
|
917
|
-
return async (e,
|
|
918
|
-
const
|
|
916
|
+
function rr(t) {
|
|
917
|
+
return async (e, r) => {
|
|
918
|
+
const a = {
|
|
919
919
|
themeId: k(),
|
|
920
|
-
...
|
|
920
|
+
...r,
|
|
921
921
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
922
922
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
923
923
|
};
|
|
924
|
-
return await t.insertInto("themes").values({ ...z(
|
|
924
|
+
return await t.insertInto("themes").values({ ...z(a), tenant_id: e }).execute(), a;
|
|
925
925
|
};
|
|
926
926
|
}
|
|
927
|
-
function
|
|
928
|
-
return async (e,
|
|
927
|
+
function ar(t) {
|
|
928
|
+
return async (e, r) => (await t.deleteFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", r).executeTakeFirst()).numDeletedRows > 0;
|
|
929
929
|
}
|
|
930
|
-
function
|
|
931
|
-
return async (e,
|
|
932
|
-
const
|
|
933
|
-
return
|
|
930
|
+
function nr(t) {
|
|
931
|
+
return async (e, r) => {
|
|
932
|
+
const a = await t.selectFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", r).selectAll().executeTakeFirst();
|
|
933
|
+
return a ? f(a) : null;
|
|
934
934
|
};
|
|
935
935
|
}
|
|
936
|
-
function
|
|
937
|
-
return async (e,
|
|
936
|
+
function or(t) {
|
|
937
|
+
return async (e, r, a) => {
|
|
938
938
|
const o = z({
|
|
939
|
-
...
|
|
939
|
+
...a,
|
|
940
940
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
941
941
|
});
|
|
942
|
-
return await t.updateTable("themes").set(o).where("themes.id", "=",
|
|
942
|
+
return await t.updateTable("themes").set(o).where("themes.id", "=", r).where("themes.tenant_id", "=", e).execute(), !0;
|
|
943
943
|
};
|
|
944
944
|
}
|
|
945
|
-
function
|
|
945
|
+
function sr(t) {
|
|
946
946
|
return {
|
|
947
|
-
create:
|
|
948
|
-
get:
|
|
949
|
-
remove:
|
|
950
|
-
update:
|
|
947
|
+
create: rr(t),
|
|
948
|
+
get: nr(t),
|
|
949
|
+
remove: ar(t),
|
|
950
|
+
update: or(t)
|
|
951
951
|
};
|
|
952
952
|
}
|
|
953
|
-
function
|
|
954
|
-
return async (e,
|
|
955
|
-
const
|
|
953
|
+
function ir(t) {
|
|
954
|
+
return async (e, r) => {
|
|
955
|
+
const a = (/* @__PURE__ */ new Date()).toISOString(), o = await t.selectFrom("logins").where("logins.expires_at", ">", a).where("logins.login_id", "=", r).selectAll().executeTakeFirst();
|
|
956
956
|
return o ? Ue.parse(
|
|
957
|
-
|
|
957
|
+
tr(f(o), ["authParams"])
|
|
958
958
|
) : null;
|
|
959
959
|
};
|
|
960
960
|
}
|
|
961
|
-
function
|
|
962
|
-
return async (e,
|
|
963
|
-
const
|
|
961
|
+
function lr(t) {
|
|
962
|
+
return async (e, r) => {
|
|
963
|
+
const a = {
|
|
964
964
|
login_id: k(),
|
|
965
|
-
...
|
|
965
|
+
...r,
|
|
966
966
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
967
967
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
968
968
|
};
|
|
969
|
-
return await t.insertInto("logins").values({ ...z(
|
|
969
|
+
return await t.insertInto("logins").values({ ...z(a), tenant_id: e }).execute(), a;
|
|
970
970
|
};
|
|
971
971
|
}
|
|
972
|
-
function
|
|
973
|
-
return async (e,
|
|
972
|
+
function cr(t) {
|
|
973
|
+
return async (e, r, a) => (await t.updateTable("logins").set(z(a)).where("logins.login_id", "=", r).where("logins.tenant_id", "=", e).execute()).length === 1;
|
|
974
974
|
}
|
|
975
|
-
function
|
|
976
|
-
return async (e,
|
|
975
|
+
function dr(t) {
|
|
976
|
+
return async (e, r) => (await t.deleteFrom("logins").where("logins.tenant_id", "=", e).where("logins.login_id", "=", r).execute()).length > 0;
|
|
977
977
|
}
|
|
978
|
-
function
|
|
978
|
+
function ur(t) {
|
|
979
979
|
return {
|
|
980
|
-
create:
|
|
981
|
-
get:
|
|
982
|
-
update:
|
|
983
|
-
remove:
|
|
980
|
+
create: lr(t),
|
|
981
|
+
get: ir(t),
|
|
982
|
+
update: cr(t),
|
|
983
|
+
remove: dr(t)
|
|
984
984
|
};
|
|
985
985
|
}
|
|
986
|
-
function
|
|
986
|
+
function mr(t) {
|
|
987
987
|
return async (e) => {
|
|
988
|
-
const [
|
|
988
|
+
const [r] = await t.selectFrom("prompt_settings").where("prompt_settings.tenant_id", "=", e).selectAll().execute();
|
|
989
989
|
return f({
|
|
990
|
-
identifier_first: !!(
|
|
991
|
-
password_first: !!(
|
|
992
|
-
webauthn_platform_first_factor: !!(
|
|
993
|
-
universal_login_experience: (
|
|
990
|
+
identifier_first: !!(r != null && r.identifier_first),
|
|
991
|
+
password_first: !!(r != null && r.password_first),
|
|
992
|
+
webauthn_platform_first_factor: !!(r != null && r.webauthn_platform_first_factor),
|
|
993
|
+
universal_login_experience: (r == null ? void 0 : r.universal_login_experience) || "new"
|
|
994
994
|
});
|
|
995
995
|
};
|
|
996
996
|
}
|
|
@@ -1003,37 +1003,37 @@ function he(t) {
|
|
|
1003
1003
|
universal_login_experience: t.universal_login_experience
|
|
1004
1004
|
});
|
|
1005
1005
|
}
|
|
1006
|
-
function
|
|
1007
|
-
return async (e,
|
|
1006
|
+
function hr(t) {
|
|
1007
|
+
return async (e, r) => {
|
|
1008
1008
|
try {
|
|
1009
|
-
const
|
|
1009
|
+
const a = Ke.parse(r);
|
|
1010
1010
|
await t.insertInto("prompt_settings").values({
|
|
1011
|
-
...he(
|
|
1011
|
+
...he(a),
|
|
1012
1012
|
tenant_id: e
|
|
1013
1013
|
}).execute();
|
|
1014
1014
|
} catch {
|
|
1015
|
-
await t.updateTable("prompt_settings").set(he(
|
|
1015
|
+
await t.updateTable("prompt_settings").set(he(r)).where("tenant_id", "=", e).execute();
|
|
1016
1016
|
}
|
|
1017
1017
|
};
|
|
1018
1018
|
}
|
|
1019
|
-
function
|
|
1019
|
+
function fr(t) {
|
|
1020
1020
|
return {
|
|
1021
|
-
get:
|
|
1022
|
-
set:
|
|
1021
|
+
get: mr(t),
|
|
1022
|
+
set: hr(t)
|
|
1023
1023
|
};
|
|
1024
1024
|
}
|
|
1025
|
-
function
|
|
1025
|
+
function _r(t) {
|
|
1026
1026
|
return async (e) => {
|
|
1027
|
-
const [
|
|
1028
|
-
if (!
|
|
1027
|
+
const [r] = await t.selectFrom("email_providers").where("email_providers.tenant_id", "=", e).selectAll().execute();
|
|
1028
|
+
if (!r)
|
|
1029
1029
|
return null;
|
|
1030
1030
|
const {
|
|
1031
|
-
tenant_id:
|
|
1031
|
+
tenant_id: a,
|
|
1032
1032
|
credentials: o,
|
|
1033
1033
|
settings: n,
|
|
1034
1034
|
enabled: s,
|
|
1035
1035
|
...l
|
|
1036
|
-
} =
|
|
1036
|
+
} = r;
|
|
1037
1037
|
return f({
|
|
1038
1038
|
...l,
|
|
1039
1039
|
credentials: JSON.parse(o),
|
|
@@ -1042,24 +1042,24 @@ function _a(t) {
|
|
|
1042
1042
|
});
|
|
1043
1043
|
};
|
|
1044
1044
|
}
|
|
1045
|
-
function
|
|
1046
|
-
return async (e,
|
|
1047
|
-
const { credentials:
|
|
1045
|
+
function pr(t) {
|
|
1046
|
+
return async (e, r) => {
|
|
1047
|
+
const { credentials: a, settings: o, enabled: n, ...s } = r;
|
|
1048
1048
|
await t.updateTable("email_providers").set({
|
|
1049
1049
|
...s,
|
|
1050
|
-
credentials:
|
|
1050
|
+
credentials: a ? JSON.stringify(a) : void 0,
|
|
1051
1051
|
settings: o ? JSON.stringify(o) : void 0,
|
|
1052
1052
|
enabled: n !== void 0 ? n ? 1 : 0 : void 0
|
|
1053
1053
|
}).where("tenant_id", "=", e).execute();
|
|
1054
1054
|
};
|
|
1055
1055
|
}
|
|
1056
|
-
function
|
|
1057
|
-
return async (e,
|
|
1058
|
-
const { credentials:
|
|
1056
|
+
function gr(t) {
|
|
1057
|
+
return async (e, r) => {
|
|
1058
|
+
const { credentials: a, settings: o, enabled: n, ...s } = r;
|
|
1059
1059
|
await t.insertInto("email_providers").values({
|
|
1060
1060
|
...s,
|
|
1061
1061
|
enabled: n ? 1 : 0,
|
|
1062
|
-
credentials: JSON.stringify(
|
|
1062
|
+
credentials: JSON.stringify(a),
|
|
1063
1063
|
settings: JSON.stringify(o),
|
|
1064
1064
|
tenant_id: e,
|
|
1065
1065
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -1067,14 +1067,68 @@ function ga(t) {
|
|
|
1067
1067
|
}).execute();
|
|
1068
1068
|
};
|
|
1069
1069
|
}
|
|
1070
|
-
function
|
|
1070
|
+
function wr(t) {
|
|
1071
1071
|
return {
|
|
1072
|
-
get:
|
|
1073
|
-
create:
|
|
1074
|
-
update:
|
|
1072
|
+
get: _r(t),
|
|
1073
|
+
create: gr(t),
|
|
1074
|
+
update: pr(t)
|
|
1075
1075
|
};
|
|
1076
1076
|
}
|
|
1077
|
-
function
|
|
1077
|
+
function yr(t) {
|
|
1078
|
+
return async (e, r) => await t.selectFrom("refresh_tokens").where("refresh_tokens.tenant_id", "=", e).where("refresh_tokens.token", "=", r).where("refresh_tokens.revoked_at", "is", null).selectAll().executeTakeFirst() ?? null;
|
|
1079
|
+
}
|
|
1080
|
+
function Nr(t) {
|
|
1081
|
+
return async (e, r) => {
|
|
1082
|
+
const a = {
|
|
1083
|
+
...r,
|
|
1084
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1085
|
+
expires_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1086
|
+
};
|
|
1087
|
+
return await t.insertInto("refresh_tokens").values({ ...a, tenant_id: e }).execute(), { ...r, ...a };
|
|
1088
|
+
};
|
|
1089
|
+
}
|
|
1090
|
+
function vr(t) {
|
|
1091
|
+
return async (e, r) => !!(await t.deleteFrom("refresh_tokens").where("tenant_id", "=", e).where("refresh_tokens.token", "=", r).execute()).length;
|
|
1092
|
+
}
|
|
1093
|
+
function br(t) {
|
|
1094
|
+
return async (e, r, a) => !!(await t.updateTable("refresh_tokens").set(a).where("tenant_id", "=", e).where("refresh_tokens.token", "=", r).execute()).length;
|
|
1095
|
+
}
|
|
1096
|
+
function Cr(t) {
|
|
1097
|
+
return async (e, r = {
|
|
1098
|
+
page: 0,
|
|
1099
|
+
per_page: 50,
|
|
1100
|
+
include_totals: !1
|
|
1101
|
+
}) => {
|
|
1102
|
+
let a = t.selectFrom("refresh_tokens").where("refresh_tokens.tenant_id", "=", e);
|
|
1103
|
+
r.q && (a = T(t, a, r.q, ["token", "session_id"]));
|
|
1104
|
+
let o = a;
|
|
1105
|
+
if (r.sort && r.sort.sort_by) {
|
|
1106
|
+
const { ref: d } = t.dynamic;
|
|
1107
|
+
o = o.orderBy(
|
|
1108
|
+
d(r.sort.sort_by),
|
|
1109
|
+
r.sort.sort_order
|
|
1110
|
+
);
|
|
1111
|
+
}
|
|
1112
|
+
o = o.offset(r.page * r.per_page).limit(r.per_page);
|
|
1113
|
+
const n = await o.selectAll().execute(), { count: s } = await a.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), l = C(s);
|
|
1114
|
+
return {
|
|
1115
|
+
refresh_tokens: n,
|
|
1116
|
+
start: r.page * r.per_page,
|
|
1117
|
+
limit: r.per_page,
|
|
1118
|
+
length: l
|
|
1119
|
+
};
|
|
1120
|
+
};
|
|
1121
|
+
}
|
|
1122
|
+
function xr(t) {
|
|
1123
|
+
return {
|
|
1124
|
+
create: Nr(t),
|
|
1125
|
+
get: yr(t),
|
|
1126
|
+
list: Cr(t),
|
|
1127
|
+
remove: vr(t),
|
|
1128
|
+
update: br(t)
|
|
1129
|
+
};
|
|
1130
|
+
}
|
|
1131
|
+
function Tr(t) {
|
|
1078
1132
|
return t[t.length - 1];
|
|
1079
1133
|
}
|
|
1080
1134
|
function p(t) {
|
|
@@ -1107,7 +1161,7 @@ const J = p({
|
|
|
1107
1161
|
identifier: J.create(e)
|
|
1108
1162
|
});
|
|
1109
1163
|
}
|
|
1110
|
-
}),
|
|
1164
|
+
}), Sr = p({
|
|
1111
1165
|
is(t) {
|
|
1112
1166
|
return t.kind === "AliasNode";
|
|
1113
1167
|
},
|
|
@@ -1136,7 +1190,7 @@ const J = p({
|
|
|
1136
1190
|
}
|
|
1137
1191
|
});
|
|
1138
1192
|
var R;
|
|
1139
|
-
class
|
|
1193
|
+
class Or {
|
|
1140
1194
|
constructor() {
|
|
1141
1195
|
j(this, "nodeStack", []);
|
|
1142
1196
|
w(this, R, p({
|
|
@@ -1239,14 +1293,14 @@ class va {
|
|
|
1239
1293
|
if (!e)
|
|
1240
1294
|
return e;
|
|
1241
1295
|
this.nodeStack.push(e);
|
|
1242
|
-
const
|
|
1243
|
-
return this.nodeStack.pop(), p(
|
|
1296
|
+
const r = this.transformNodeImpl(e);
|
|
1297
|
+
return this.nodeStack.pop(), p(r);
|
|
1244
1298
|
}
|
|
1245
1299
|
transformNodeImpl(e) {
|
|
1246
1300
|
return c(this, R)[e.kind](e);
|
|
1247
1301
|
}
|
|
1248
1302
|
transformNodeList(e) {
|
|
1249
|
-
return e && p(e.map((
|
|
1303
|
+
return e && p(e.map((r) => this.transformNode(r)));
|
|
1250
1304
|
}
|
|
1251
1305
|
transformSelectQuery(e) {
|
|
1252
1306
|
return {
|
|
@@ -1970,7 +2024,7 @@ class va {
|
|
|
1970
2024
|
}
|
|
1971
2025
|
}
|
|
1972
2026
|
R = new WeakMap();
|
|
1973
|
-
const
|
|
2027
|
+
const kr = p({
|
|
1974
2028
|
AlterTableNode: !0,
|
|
1975
2029
|
CreateIndexNode: !0,
|
|
1976
2030
|
CreateSchemaNode: !0,
|
|
@@ -1989,78 +2043,78 @@ const ba = p({
|
|
|
1989
2043
|
UpdateQueryNode: !0,
|
|
1990
2044
|
MergeQueryNode: !0
|
|
1991
2045
|
});
|
|
1992
|
-
var P,
|
|
1993
|
-
class
|
|
1994
|
-
constructor(
|
|
2046
|
+
var P, S, O, _, ge, we, ye, $, q, Ne;
|
|
2047
|
+
class $r extends Or {
|
|
2048
|
+
constructor(r) {
|
|
1995
2049
|
super();
|
|
1996
2050
|
w(this, _);
|
|
1997
2051
|
w(this, P);
|
|
1998
|
-
w(this, T, /* @__PURE__ */ new Set());
|
|
1999
2052
|
w(this, S, /* @__PURE__ */ new Set());
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2053
|
+
w(this, O, /* @__PURE__ */ new Set());
|
|
2054
|
+
M(this, P, r);
|
|
2055
|
+
}
|
|
2056
|
+
transformNodeImpl(r) {
|
|
2057
|
+
if (!u(this, _, ge).call(this, r))
|
|
2058
|
+
return super.transformNodeImpl(r);
|
|
2059
|
+
const a = u(this, _, ye).call(this, r);
|
|
2060
|
+
for (const s of a)
|
|
2061
|
+
c(this, O).add(s);
|
|
2062
|
+
const o = u(this, _, we).call(this, r);
|
|
2009
2063
|
for (const s of o)
|
|
2010
|
-
c(this,
|
|
2011
|
-
const n = super.transformNodeImpl(
|
|
2064
|
+
c(this, S).add(s);
|
|
2065
|
+
const n = super.transformNodeImpl(r);
|
|
2012
2066
|
for (const s of o)
|
|
2013
|
-
c(this, T).delete(s);
|
|
2014
|
-
for (const s of r)
|
|
2015
2067
|
c(this, S).delete(s);
|
|
2068
|
+
for (const s of a)
|
|
2069
|
+
c(this, O).delete(s);
|
|
2016
2070
|
return n;
|
|
2017
2071
|
}
|
|
2018
|
-
transformSchemableIdentifier(
|
|
2019
|
-
const
|
|
2020
|
-
return
|
|
2021
|
-
...
|
|
2072
|
+
transformSchemableIdentifier(r) {
|
|
2073
|
+
const a = super.transformSchemableIdentifier(r);
|
|
2074
|
+
return a.schema || !c(this, S).has(r.identifier.name) ? a : {
|
|
2075
|
+
...a,
|
|
2022
2076
|
schema: J.create(c(this, P))
|
|
2023
2077
|
};
|
|
2024
2078
|
}
|
|
2025
|
-
transformReferences(
|
|
2026
|
-
const
|
|
2027
|
-
return
|
|
2028
|
-
...
|
|
2029
|
-
table: K.createWithSchema(c(this, P),
|
|
2030
|
-
};
|
|
2031
|
-
}
|
|
2032
|
-
}
|
|
2033
|
-
P = new WeakMap(),
|
|
2034
|
-
return
|
|
2035
|
-
}, we = function(
|
|
2036
|
-
const
|
|
2037
|
-
if ("name" in
|
|
2038
|
-
for (const o of
|
|
2039
|
-
u(this, _, $).call(this, o,
|
|
2040
|
-
if ("into" in
|
|
2041
|
-
for (const o of
|
|
2042
|
-
u(this, _, $).call(this, o.table,
|
|
2043
|
-
return "using" in
|
|
2044
|
-
}, ye = function(
|
|
2045
|
-
const
|
|
2046
|
-
return "with" in
|
|
2047
|
-
}, $ = function(
|
|
2048
|
-
const o = K.is(
|
|
2049
|
-
o && u(this, _, q).call(this, o.table,
|
|
2050
|
-
}, q = function(
|
|
2051
|
-
const o =
|
|
2052
|
-
!c(this,
|
|
2053
|
-
}, Ne = function(
|
|
2054
|
-
for (const o of
|
|
2079
|
+
transformReferences(r) {
|
|
2080
|
+
const a = super.transformReferences(r);
|
|
2081
|
+
return a.table.table.schema ? a : {
|
|
2082
|
+
...a,
|
|
2083
|
+
table: K.createWithSchema(c(this, P), a.table.table.identifier.name)
|
|
2084
|
+
};
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
P = new WeakMap(), S = new WeakMap(), O = new WeakMap(), _ = new WeakSet(), ge = function(r) {
|
|
2088
|
+
return r.kind in kr;
|
|
2089
|
+
}, we = function(r) {
|
|
2090
|
+
const a = /* @__PURE__ */ new Set();
|
|
2091
|
+
if ("name" in r && r.name && W.is(r.name) && u(this, _, q).call(this, r.name, a), "from" in r && r.from)
|
|
2092
|
+
for (const o of r.from.froms)
|
|
2093
|
+
u(this, _, $).call(this, o, a);
|
|
2094
|
+
if ("into" in r && r.into && u(this, _, $).call(this, r.into, a), "table" in r && r.table && u(this, _, $).call(this, r.table, a), "joins" in r && r.joins)
|
|
2095
|
+
for (const o of r.joins)
|
|
2096
|
+
u(this, _, $).call(this, o.table, a);
|
|
2097
|
+
return "using" in r && r.using && u(this, _, $).call(this, r.using, a), a;
|
|
2098
|
+
}, ye = function(r) {
|
|
2099
|
+
const a = /* @__PURE__ */ new Set();
|
|
2100
|
+
return "with" in r && r.with && u(this, _, Ne).call(this, r.with, a), a;
|
|
2101
|
+
}, $ = function(r, a) {
|
|
2102
|
+
const o = K.is(r) ? r : Sr.is(r) && K.is(r.node) ? r.node : null;
|
|
2103
|
+
o && u(this, _, q).call(this, o.table, a);
|
|
2104
|
+
}, q = function(r, a) {
|
|
2105
|
+
const o = r.identifier.name;
|
|
2106
|
+
!c(this, S).has(o) && !c(this, O).has(o) && a.add(o);
|
|
2107
|
+
}, Ne = function(r, a) {
|
|
2108
|
+
for (const o of r.expressions) {
|
|
2055
2109
|
const n = o.name.table.table.identifier.name;
|
|
2056
|
-
c(this,
|
|
2110
|
+
c(this, O).has(n) || a.add(n);
|
|
2057
2111
|
}
|
|
2058
2112
|
};
|
|
2059
2113
|
var L;
|
|
2060
|
-
class
|
|
2114
|
+
class Ir {
|
|
2061
2115
|
constructor(e) {
|
|
2062
2116
|
w(this, L);
|
|
2063
|
-
M(this, L, new
|
|
2117
|
+
M(this, L, new $r(e));
|
|
2064
2118
|
}
|
|
2065
2119
|
transformQuery(e) {
|
|
2066
2120
|
return c(this, L).transformNode(e.node);
|
|
@@ -2070,7 +2124,7 @@ class xa {
|
|
|
2070
2124
|
}
|
|
2071
2125
|
}
|
|
2072
2126
|
L = new WeakMap();
|
|
2073
|
-
class
|
|
2127
|
+
class Dr {
|
|
2074
2128
|
transformQuery(e) {
|
|
2075
2129
|
return e.node;
|
|
2076
2130
|
}
|
|
@@ -2078,8 +2132,8 @@ class Ta {
|
|
|
2078
2132
|
return e.result;
|
|
2079
2133
|
}
|
|
2080
2134
|
}
|
|
2081
|
-
const
|
|
2082
|
-
var h, i, A, N, v,
|
|
2135
|
+
const Pr = "kysely_migration", fe = "kysely_migration_lock", jr = !1, B = "migration_lock", Mr = p({ __noMigrations__: !0 });
|
|
2136
|
+
var h, i, A, N, v, I, be, b, Ce, xe, Te, Se, Oe, G, D, H, ke, $e, Ie, X, De, Pe, je, Me, Ae, F;
|
|
2083
2137
|
class ve {
|
|
2084
2138
|
constructor(e) {
|
|
2085
2139
|
w(this, i);
|
|
@@ -2092,11 +2146,11 @@ class ve {
|
|
|
2092
2146
|
* The returned array is sorted by migration name.
|
|
2093
2147
|
*/
|
|
2094
2148
|
async getMigrations() {
|
|
2095
|
-
const e = await u(this, i,
|
|
2096
|
-
return (await u(this, i, X).call(this)).map(({ name:
|
|
2097
|
-
const n = e.find((s) => s.name ===
|
|
2149
|
+
const e = await u(this, i, D).call(this, c(this, i, v)) ? await c(this, h).db.withPlugin(c(this, i, b)).selectFrom(c(this, i, v)).select(["name", "timestamp"]).execute() : [];
|
|
2150
|
+
return (await u(this, i, X).call(this)).map(({ name: a, ...o }) => {
|
|
2151
|
+
const n = e.find((s) => s.name === a);
|
|
2098
2152
|
return {
|
|
2099
|
-
name:
|
|
2153
|
+
name: a,
|
|
2100
2154
|
migration: o,
|
|
2101
2155
|
executedAt: n ? new Date(n.timestamp) : void 0
|
|
2102
2156
|
};
|
|
@@ -2176,16 +2230,16 @@ class ve {
|
|
|
2176
2230
|
* ```
|
|
2177
2231
|
*/
|
|
2178
2232
|
async migrateTo(e) {
|
|
2179
|
-
return u(this, i, A).call(this, ({ migrations:
|
|
2180
|
-
if (e ===
|
|
2233
|
+
return u(this, i, A).call(this, ({ migrations: r, executedMigrations: a, pendingMigrations: o }) => {
|
|
2234
|
+
if (e === Mr)
|
|
2181
2235
|
return { direction: "Down", step: 1 / 0 };
|
|
2182
|
-
if (!
|
|
2236
|
+
if (!r.find((l) => l.name === e))
|
|
2183
2237
|
throw new Error(`migration "${e}" doesn't exist`);
|
|
2184
|
-
const n =
|
|
2238
|
+
const n = a.indexOf(e), s = o.findIndex((l) => l.name === e);
|
|
2185
2239
|
if (n !== -1)
|
|
2186
2240
|
return {
|
|
2187
2241
|
direction: "Down",
|
|
2188
|
-
step:
|
|
2242
|
+
step: a.length - n - 1
|
|
2189
2243
|
};
|
|
2190
2244
|
if (s !== -1)
|
|
2191
2245
|
return { direction: "Up", step: s + 1 };
|
|
@@ -2230,19 +2284,19 @@ class ve {
|
|
|
2230
2284
|
h = new WeakMap(), i = new WeakSet(), A = async function(e) {
|
|
2231
2285
|
try {
|
|
2232
2286
|
return await u(this, i, Ce).call(this), await u(this, i, ke).call(this, e);
|
|
2233
|
-
} catch (
|
|
2234
|
-
return
|
|
2287
|
+
} catch (r) {
|
|
2288
|
+
return r instanceof Q ? r.resultSet : { error: r };
|
|
2235
2289
|
}
|
|
2236
2290
|
}, N = function() {
|
|
2237
2291
|
return c(this, h).migrationTableSchema;
|
|
2238
2292
|
}, v = function() {
|
|
2239
|
-
return c(this, h).migrationTableName ??
|
|
2240
|
-
},
|
|
2293
|
+
return c(this, h).migrationTableName ?? Pr;
|
|
2294
|
+
}, I = function() {
|
|
2241
2295
|
return c(this, h).migrationLockTableName ?? fe;
|
|
2242
2296
|
}, be = function() {
|
|
2243
|
-
return c(this, h).allowUnorderedMigrations ??
|
|
2297
|
+
return c(this, h).allowUnorderedMigrations ?? jr;
|
|
2244
2298
|
}, b = function() {
|
|
2245
|
-
return c(this, i, N) ? new
|
|
2299
|
+
return c(this, i, N) ? new Ir(c(this, i, N)) : new Dr();
|
|
2246
2300
|
}, Ce = async function() {
|
|
2247
2301
|
await u(this, i, xe).call(this), await u(this, i, Te).call(this), await u(this, i, Se).call(this), await u(this, i, Oe).call(this);
|
|
2248
2302
|
}, xe = async function() {
|
|
@@ -2254,86 +2308,86 @@ h = new WeakMap(), i = new WeakSet(), A = async function(e) {
|
|
|
2254
2308
|
throw e;
|
|
2255
2309
|
}
|
|
2256
2310
|
}, Te = async function() {
|
|
2257
|
-
if (!await u(this, i,
|
|
2311
|
+
if (!await u(this, i, D).call(this, c(this, i, v)))
|
|
2258
2312
|
try {
|
|
2259
2313
|
c(this, i, N) && await u(this, i, F).call(this, c(this, h).db.schema.createSchema(c(this, i, N))), await u(this, i, F).call(this, c(this, h).db.schema.withPlugin(c(this, i, b)).createTable(c(this, i, v)).addColumn("name", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("timestamp", "varchar(255)", (e) => e.notNull()));
|
|
2260
2314
|
} catch (e) {
|
|
2261
|
-
if (!await u(this, i,
|
|
2315
|
+
if (!await u(this, i, D).call(this, c(this, i, v)))
|
|
2262
2316
|
throw e;
|
|
2263
2317
|
}
|
|
2264
2318
|
}, Se = async function() {
|
|
2265
|
-
if (!await u(this, i,
|
|
2319
|
+
if (!await u(this, i, D).call(this, c(this, i, I)))
|
|
2266
2320
|
try {
|
|
2267
|
-
await u(this, i, F).call(this, c(this, h).db.schema.withPlugin(c(this, i, b)).createTable(c(this, i,
|
|
2321
|
+
await u(this, i, F).call(this, c(this, h).db.schema.withPlugin(c(this, i, b)).createTable(c(this, i, I)).addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("is_locked", "integer", (e) => e.notNull().defaultTo(0)));
|
|
2268
2322
|
} catch (e) {
|
|
2269
|
-
if (!await u(this, i,
|
|
2323
|
+
if (!await u(this, i, D).call(this, c(this, i, I)))
|
|
2270
2324
|
throw e;
|
|
2271
2325
|
}
|
|
2272
2326
|
}, Oe = async function() {
|
|
2273
2327
|
if (!await u(this, i, H).call(this))
|
|
2274
2328
|
try {
|
|
2275
|
-
await c(this, h).db.withPlugin(c(this, i, b)).insertInto(c(this, i,
|
|
2329
|
+
await c(this, h).db.withPlugin(c(this, i, b)).insertInto(c(this, i, I)).values({ id: B, is_locked: 0 }).execute();
|
|
2276
2330
|
} catch (e) {
|
|
2277
2331
|
if (!await u(this, i, H).call(this))
|
|
2278
2332
|
throw e;
|
|
2279
2333
|
}
|
|
2280
2334
|
}, G = async function() {
|
|
2281
|
-
return (await c(this, h).db.introspection.getSchemas()).some((
|
|
2282
|
-
},
|
|
2283
|
-
const
|
|
2335
|
+
return (await c(this, h).db.introspection.getSchemas()).some((r) => r.name === c(this, i, N));
|
|
2336
|
+
}, D = async function(e) {
|
|
2337
|
+
const r = c(this, i, N);
|
|
2284
2338
|
return (await c(this, h).db.introspection.getTables({
|
|
2285
2339
|
withInternalKyselyTables: !0
|
|
2286
|
-
})).some((o) => o.name === e && (!
|
|
2340
|
+
})).some((o) => o.name === e && (!r || o.schema === r));
|
|
2287
2341
|
}, H = async function() {
|
|
2288
|
-
return !!await c(this, h).db.withPlugin(c(this, i, b)).selectFrom(c(this, i,
|
|
2342
|
+
return !!await c(this, h).db.withPlugin(c(this, i, b)).selectFrom(c(this, i, I)).where("id", "=", B).select("id").executeTakeFirst();
|
|
2289
2343
|
}, ke = async function(e) {
|
|
2290
|
-
const
|
|
2344
|
+
const r = c(this, h).db.getExecutor().adapter, a = p({
|
|
2291
2345
|
lockTable: c(this, h).migrationLockTableName ?? fe,
|
|
2292
2346
|
lockRowId: B,
|
|
2293
2347
|
lockTableSchema: c(this, h).migrationTableSchema
|
|
2294
2348
|
}), o = async (n) => {
|
|
2295
2349
|
try {
|
|
2296
|
-
await
|
|
2350
|
+
await r.acquireMigrationLock(n, a);
|
|
2297
2351
|
const s = await u(this, i, $e).call(this, n);
|
|
2298
2352
|
if (s.migrations.length === 0)
|
|
2299
2353
|
return { results: [] };
|
|
2300
2354
|
const { direction: l, step: d } = e(s);
|
|
2301
2355
|
return d <= 0 ? { results: [] } : l === "Down" ? await u(this, i, Me).call(this, n, s, d) : l === "Up" ? await u(this, i, Ae).call(this, n, s, d) : { results: [] };
|
|
2302
2356
|
} finally {
|
|
2303
|
-
await
|
|
2357
|
+
await r.releaseMigrationLock(n, a);
|
|
2304
2358
|
}
|
|
2305
2359
|
};
|
|
2306
|
-
return
|
|
2360
|
+
return r.supportsTransactionalDdl ? c(this, h).db.transaction().execute(o) : c(this, h).db.connection().execute(o);
|
|
2307
2361
|
}, $e = async function(e) {
|
|
2308
|
-
const
|
|
2309
|
-
u(this, i, Pe).call(this,
|
|
2310
|
-
const o = u(this, i,
|
|
2362
|
+
const r = await u(this, i, X).call(this), a = await u(this, i, De).call(this, e);
|
|
2363
|
+
u(this, i, Pe).call(this, r, a), c(this, i, be) || u(this, i, je).call(this, r, a);
|
|
2364
|
+
const o = u(this, i, Ie).call(this, r, a);
|
|
2311
2365
|
return p({
|
|
2312
|
-
migrations:
|
|
2313
|
-
executedMigrations:
|
|
2314
|
-
lastMigration:
|
|
2366
|
+
migrations: r,
|
|
2367
|
+
executedMigrations: a,
|
|
2368
|
+
lastMigration: Tr(a),
|
|
2315
2369
|
pendingMigrations: o
|
|
2316
2370
|
});
|
|
2317
|
-
},
|
|
2318
|
-
return e.filter((
|
|
2371
|
+
}, Ie = function(e, r) {
|
|
2372
|
+
return e.filter((a) => !r.includes(a.name));
|
|
2319
2373
|
}, X = async function() {
|
|
2320
2374
|
const e = await c(this, h).provider.getMigrations();
|
|
2321
|
-
return Object.keys(e).sort().map((
|
|
2322
|
-
...e[
|
|
2323
|
-
name:
|
|
2375
|
+
return Object.keys(e).sort().map((r) => ({
|
|
2376
|
+
...e[r],
|
|
2377
|
+
name: r
|
|
2324
2378
|
}));
|
|
2325
|
-
},
|
|
2326
|
-
return (await e.withPlugin(c(this, i, b)).selectFrom(c(this, i, v)).select("name").orderBy(["timestamp", "name"]).execute()).map((
|
|
2327
|
-
}, Pe = function(e,
|
|
2328
|
-
for (const
|
|
2329
|
-
if (!e.some((o) => o.name ===
|
|
2330
|
-
throw new Error(`corrupted migrations: previously executed migration ${
|
|
2331
|
-
}, je = function(e,
|
|
2332
|
-
for (let
|
|
2333
|
-
if (e[
|
|
2334
|
-
throw new Error(`corrupted migrations: expected previously executed migration ${a
|
|
2335
|
-
}, Me = async function(e,
|
|
2336
|
-
const o =
|
|
2379
|
+
}, De = async function(e) {
|
|
2380
|
+
return (await e.withPlugin(c(this, i, b)).selectFrom(c(this, i, v)).select("name").orderBy(["timestamp", "name"]).execute()).map((a) => a.name);
|
|
2381
|
+
}, Pe = function(e, r) {
|
|
2382
|
+
for (const a of r)
|
|
2383
|
+
if (!e.some((o) => o.name === a))
|
|
2384
|
+
throw new Error(`corrupted migrations: previously executed migration ${a} is missing`);
|
|
2385
|
+
}, je = function(e, r) {
|
|
2386
|
+
for (let a = 0; a < r.length; ++a)
|
|
2387
|
+
if (e[a].name !== r[a])
|
|
2388
|
+
throw new Error(`corrupted migrations: expected previously executed migration ${r[a]} to be at index ${a} but ${e[a].name} was found in its place. New migrations must always have a name that comes alphabetically after the last executed migration.`);
|
|
2389
|
+
}, Me = async function(e, r, a) {
|
|
2390
|
+
const o = r.executedMigrations.slice().reverse().slice(0, a).map((s) => r.migrations.find((l) => l.name === s)), n = o.map((s) => ({
|
|
2337
2391
|
migrationName: s.name,
|
|
2338
2392
|
direction: "Down",
|
|
2339
2393
|
status: "NotExecuted"
|
|
@@ -2358,14 +2412,14 @@ h = new WeakMap(), i = new WeakSet(), A = async function(e) {
|
|
|
2358
2412
|
}
|
|
2359
2413
|
}
|
|
2360
2414
|
return { results: n };
|
|
2361
|
-
}, Ae = async function(e,
|
|
2362
|
-
const n =
|
|
2415
|
+
}, Ae = async function(e, r, a) {
|
|
2416
|
+
const n = r.pendingMigrations.slice(0, a).map((s) => ({
|
|
2363
2417
|
migrationName: s.name,
|
|
2364
2418
|
direction: "Up",
|
|
2365
2419
|
status: "NotExecuted"
|
|
2366
2420
|
}));
|
|
2367
2421
|
for (let s = 0; s < n.length; s++) {
|
|
2368
|
-
const l =
|
|
2422
|
+
const l = r.pendingMigrations[s];
|
|
2369
2423
|
try {
|
|
2370
2424
|
await l.up(e), await e.withPlugin(c(this, i, b)).insertInto(c(this, i, v)).values({
|
|
2371
2425
|
name: l.name,
|
|
@@ -2392,10 +2446,10 @@ h = new WeakMap(), i = new WeakSet(), A = async function(e) {
|
|
|
2392
2446
|
};
|
|
2393
2447
|
var E;
|
|
2394
2448
|
class Q extends Error {
|
|
2395
|
-
constructor(
|
|
2449
|
+
constructor(r) {
|
|
2396
2450
|
super();
|
|
2397
2451
|
w(this, E);
|
|
2398
|
-
M(this, E,
|
|
2452
|
+
M(this, E, r);
|
|
2399
2453
|
}
|
|
2400
2454
|
get resultSet() {
|
|
2401
2455
|
return c(this, E);
|
|
@@ -2411,7 +2465,7 @@ class Fe {
|
|
|
2411
2465
|
return this.migrations;
|
|
2412
2466
|
}
|
|
2413
2467
|
}
|
|
2414
|
-
async function
|
|
2468
|
+
async function Ar(t) {
|
|
2415
2469
|
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(
|
|
2416
2470
|
"tenant_id",
|
|
2417
2471
|
"varchar(255)",
|
|
@@ -2479,35 +2533,35 @@ async function $a(t) {
|
|
|
2479
2533
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
2480
2534
|
).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();
|
|
2481
2535
|
}
|
|
2482
|
-
async function
|
|
2536
|
+
async function Fr(t) {
|
|
2483
2537
|
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();
|
|
2484
2538
|
}
|
|
2485
|
-
const
|
|
2539
|
+
const Lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2486
2540
|
__proto__: null,
|
|
2487
|
-
down:
|
|
2488
|
-
up:
|
|
2541
|
+
down: Fr,
|
|
2542
|
+
up: Ar
|
|
2489
2543
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2490
|
-
async function
|
|
2544
|
+
async function Er(t) {
|
|
2491
2545
|
await t.schema.alterTable("tenants").addColumn("support_url", "varchar(255)").execute();
|
|
2492
2546
|
}
|
|
2493
|
-
async function
|
|
2547
|
+
async function zr(t) {
|
|
2494
2548
|
await t.schema.alterTable("tenants").dropColumn("support_url").execute();
|
|
2495
2549
|
}
|
|
2496
|
-
const
|
|
2550
|
+
const Jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2497
2551
|
__proto__: null,
|
|
2498
|
-
down:
|
|
2499
|
-
up:
|
|
2552
|
+
down: zr,
|
|
2553
|
+
up: Er
|
|
2500
2554
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2501
|
-
async function
|
|
2555
|
+
async function Rr(t) {
|
|
2502
2556
|
}
|
|
2503
|
-
async function
|
|
2557
|
+
async function Ur(t) {
|
|
2504
2558
|
}
|
|
2505
|
-
const
|
|
2559
|
+
const Kr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2506
2560
|
__proto__: null,
|
|
2507
|
-
down:
|
|
2508
|
-
up:
|
|
2561
|
+
down: Ur,
|
|
2562
|
+
up: Rr
|
|
2509
2563
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2510
|
-
async function
|
|
2564
|
+
async function Br(t) {
|
|
2511
2565
|
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(
|
|
2512
2566
|
"tenant_id_constraint",
|
|
2513
2567
|
["tenant_id"],
|
|
@@ -2516,24 +2570,24 @@ async function Ea(t) {
|
|
|
2516
2570
|
(e) => e.onDelete("cascade")
|
|
2517
2571
|
).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();
|
|
2518
2572
|
}
|
|
2519
|
-
async function
|
|
2573
|
+
async function Qr(t) {
|
|
2520
2574
|
await t.schema.dropTable("logs").execute();
|
|
2521
2575
|
}
|
|
2522
|
-
const
|
|
2576
|
+
const Vr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2523
2577
|
__proto__: null,
|
|
2524
|
-
down:
|
|
2525
|
-
up:
|
|
2578
|
+
down: Qr,
|
|
2579
|
+
up: Br
|
|
2526
2580
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2527
|
-
async function
|
|
2581
|
+
async function Wr(t) {
|
|
2528
2582
|
}
|
|
2529
|
-
async function
|
|
2583
|
+
async function qr(t) {
|
|
2530
2584
|
}
|
|
2531
|
-
const
|
|
2585
|
+
const Gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2532
2586
|
__proto__: null,
|
|
2533
|
-
down:
|
|
2534
|
-
up:
|
|
2587
|
+
down: qr,
|
|
2588
|
+
up: Wr
|
|
2535
2589
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2536
|
-
async function
|
|
2590
|
+
async function Hr(t) {
|
|
2537
2591
|
await t.schema.createTable("sessions").addColumn("session_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
2538
2592
|
"client_id",
|
|
2539
2593
|
"varchar(255)",
|
|
@@ -2562,15 +2616,15 @@ async function Ba(t) {
|
|
|
2562
2616
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
2563
2617
|
).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();
|
|
2564
2618
|
}
|
|
2565
|
-
async function
|
|
2619
|
+
async function Xr(t) {
|
|
2566
2620
|
await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("tickets").execute(), await t.schema.dropTable("otps").execute();
|
|
2567
2621
|
}
|
|
2568
|
-
const
|
|
2622
|
+
const Yr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2569
2623
|
__proto__: null,
|
|
2570
|
-
down:
|
|
2571
|
-
up:
|
|
2624
|
+
down: Xr,
|
|
2625
|
+
up: Hr
|
|
2572
2626
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2573
|
-
async function
|
|
2627
|
+
async function Zr(t) {
|
|
2574
2628
|
await t.schema.createTable("passwords").addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addPrimaryKeyConstraint("passwords_pkey", ["user_id", "tenant_id"]).addForeignKeyConstraint(
|
|
2575
2629
|
"user_id_constraint",
|
|
2576
2630
|
["user_id", "tenant_id"],
|
|
@@ -2585,24 +2639,24 @@ async function Wa(t) {
|
|
|
2585
2639
|
(e) => e.onDelete("cascade")
|
|
2586
2640
|
).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();
|
|
2587
2641
|
}
|
|
2588
|
-
async function
|
|
2642
|
+
async function ea(t) {
|
|
2589
2643
|
await t.schema.dropTable("passwords").execute(), await t.schema.dropTable("codes").execute();
|
|
2590
2644
|
}
|
|
2591
|
-
const
|
|
2645
|
+
const ta = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2592
2646
|
__proto__: null,
|
|
2593
|
-
down:
|
|
2594
|
-
up:
|
|
2647
|
+
down: ea,
|
|
2648
|
+
up: Zr
|
|
2595
2649
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2596
|
-
async function
|
|
2650
|
+
async function ra(t) {
|
|
2597
2651
|
}
|
|
2598
|
-
async function
|
|
2652
|
+
async function aa(t) {
|
|
2599
2653
|
}
|
|
2600
|
-
const
|
|
2654
|
+
const na = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2601
2655
|
__proto__: null,
|
|
2602
|
-
down:
|
|
2603
|
-
up:
|
|
2656
|
+
down: aa,
|
|
2657
|
+
up: ra
|
|
2604
2658
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2605
|
-
async function
|
|
2659
|
+
async function oa(t) {
|
|
2606
2660
|
await t.schema.alterTable("passwords").addColumn(
|
|
2607
2661
|
"password",
|
|
2608
2662
|
"varchar(255)",
|
|
@@ -2610,219 +2664,198 @@ async function Za(t) {
|
|
|
2610
2664
|
(e) => e.notNull()
|
|
2611
2665
|
).execute();
|
|
2612
2666
|
}
|
|
2613
|
-
async function
|
|
2667
|
+
async function sa(t) {
|
|
2614
2668
|
await t.schema.alterTable("passwords").dropColumn("password").execute();
|
|
2615
2669
|
}
|
|
2616
|
-
const
|
|
2670
|
+
const ia = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2617
2671
|
__proto__: null,
|
|
2618
|
-
down:
|
|
2619
|
-
up:
|
|
2672
|
+
down: sa,
|
|
2673
|
+
up: oa
|
|
2620
2674
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2621
|
-
async function
|
|
2675
|
+
async function la(t) {
|
|
2622
2676
|
}
|
|
2623
|
-
async function
|
|
2677
|
+
async function ca(t) {
|
|
2624
2678
|
}
|
|
2625
|
-
const
|
|
2679
|
+
const da = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2626
2680
|
__proto__: null,
|
|
2627
|
-
down:
|
|
2628
|
-
up:
|
|
2681
|
+
down: ca,
|
|
2682
|
+
up: la
|
|
2629
2683
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2630
|
-
async function
|
|
2684
|
+
async function ua(t) {
|
|
2631
2685
|
}
|
|
2632
|
-
async function
|
|
2686
|
+
async function ma(t) {
|
|
2633
2687
|
}
|
|
2634
|
-
const
|
|
2688
|
+
const ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2635
2689
|
__proto__: null,
|
|
2636
|
-
down:
|
|
2637
|
-
up:
|
|
2690
|
+
down: ma,
|
|
2691
|
+
up: ua
|
|
2638
2692
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2639
|
-
async function
|
|
2693
|
+
async function fa(t) {
|
|
2640
2694
|
}
|
|
2641
|
-
async function
|
|
2695
|
+
async function _a(t) {
|
|
2642
2696
|
}
|
|
2643
|
-
const
|
|
2697
|
+
const pa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2644
2698
|
__proto__: null,
|
|
2645
|
-
down:
|
|
2646
|
-
up:
|
|
2699
|
+
down: _a,
|
|
2700
|
+
up: fa
|
|
2647
2701
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2648
|
-
async function
|
|
2702
|
+
async function ga(t) {
|
|
2649
2703
|
await t.schema.createIndex("users_email_index").on("users").column("email").execute();
|
|
2650
2704
|
}
|
|
2651
|
-
async function
|
|
2705
|
+
async function wa(t) {
|
|
2652
2706
|
await t.schema.dropIndex("users_email_index").execute();
|
|
2653
2707
|
}
|
|
2654
|
-
const
|
|
2708
|
+
const ya = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2655
2709
|
__proto__: null,
|
|
2656
|
-
down:
|
|
2657
|
-
up:
|
|
2710
|
+
down: wa,
|
|
2711
|
+
up: ga
|
|
2658
2712
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2659
|
-
async function
|
|
2713
|
+
async function Na(t) {
|
|
2660
2714
|
await t.schema.alterTable("users").addColumn("profileData", "varchar(2048)").execute();
|
|
2661
2715
|
}
|
|
2662
|
-
async function
|
|
2716
|
+
async function va(t) {
|
|
2663
2717
|
await t.schema.alterTable("users").dropColumn("profileData").execute();
|
|
2664
2718
|
}
|
|
2665
|
-
const
|
|
2719
|
+
const ba = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2666
2720
|
__proto__: null,
|
|
2667
|
-
down:
|
|
2668
|
-
up:
|
|
2721
|
+
down: va,
|
|
2722
|
+
up: Na
|
|
2669
2723
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2670
|
-
async function
|
|
2724
|
+
async function Ca(t) {
|
|
2671
2725
|
await t.schema.createIndex("users_linked_to_index").on("users").column("linked_to").execute();
|
|
2672
2726
|
}
|
|
2673
|
-
async function
|
|
2727
|
+
async function xa(t) {
|
|
2674
2728
|
await t.schema.dropIndex("users_linked_to_index");
|
|
2675
2729
|
}
|
|
2676
|
-
const
|
|
2730
|
+
const Ta = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2677
2731
|
__proto__: null,
|
|
2678
|
-
down:
|
|
2679
|
-
up:
|
|
2732
|
+
down: xa,
|
|
2733
|
+
up: Ca
|
|
2680
2734
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2681
|
-
async function
|
|
2735
|
+
async function Sa(t) {
|
|
2682
2736
|
await t.schema.alterTable("users").addColumn("locale", "varchar(255)").execute();
|
|
2683
2737
|
}
|
|
2684
|
-
async function
|
|
2738
|
+
async function Oa(t) {
|
|
2685
2739
|
await t.schema.alterTable("users").dropColumn("locale").execute();
|
|
2686
2740
|
}
|
|
2687
|
-
const
|
|
2741
|
+
const ka = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2688
2742
|
__proto__: null,
|
|
2689
|
-
down:
|
|
2690
|
-
up:
|
|
2743
|
+
down: Oa,
|
|
2744
|
+
up: Sa
|
|
2691
2745
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2692
|
-
async function
|
|
2746
|
+
async function $a(t) {
|
|
2693
2747
|
await t.schema.createTable("keys").addColumn("kid", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
2694
2748
|
"tenant_id",
|
|
2695
2749
|
"varchar(255)",
|
|
2696
2750
|
(e) => e.references("tenants.id").onDelete("cascade")
|
|
2697
2751
|
).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();
|
|
2698
2752
|
}
|
|
2699
|
-
async function
|
|
2753
|
+
async function Ia(t) {
|
|
2700
2754
|
await t.schema.dropTable("keys").execute();
|
|
2701
2755
|
}
|
|
2702
|
-
const
|
|
2756
|
+
const Da = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2703
2757
|
__proto__: null,
|
|
2704
|
-
down:
|
|
2705
|
-
up:
|
|
2758
|
+
down: Ia,
|
|
2759
|
+
up: $a
|
|
2706
2760
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2707
|
-
async function
|
|
2761
|
+
async function Pa(t) {
|
|
2708
2762
|
}
|
|
2709
|
-
async function
|
|
2763
|
+
async function ja(t) {
|
|
2710
2764
|
}
|
|
2711
|
-
const
|
|
2765
|
+
const Ma = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2712
2766
|
__proto__: null,
|
|
2713
|
-
down:
|
|
2714
|
-
up:
|
|
2767
|
+
down: ja,
|
|
2768
|
+
up: Pa
|
|
2715
2769
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2716
|
-
async function
|
|
2770
|
+
async function Aa(t) {
|
|
2717
2771
|
}
|
|
2718
|
-
async function
|
|
2772
|
+
async function Fa(t) {
|
|
2719
2773
|
}
|
|
2720
|
-
const
|
|
2774
|
+
const La = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2721
2775
|
__proto__: null,
|
|
2722
|
-
down:
|
|
2723
|
-
up:
|
|
2776
|
+
down: Fa,
|
|
2777
|
+
up: Aa
|
|
2724
2778
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2725
|
-
async function
|
|
2779
|
+
async function Ea(t) {
|
|
2726
2780
|
await t.schema.alterTable("otps").addColumn("audience", "varchar(255)").execute();
|
|
2727
2781
|
}
|
|
2728
|
-
async function
|
|
2782
|
+
async function za(t) {
|
|
2729
2783
|
await t.schema.alterTable("otps").dropColumn("audience").execute();
|
|
2730
2784
|
}
|
|
2731
|
-
const
|
|
2785
|
+
const Ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2732
2786
|
__proto__: null,
|
|
2733
|
-
down:
|
|
2734
|
-
up:
|
|
2787
|
+
down: za,
|
|
2788
|
+
up: Ea
|
|
2735
2789
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2736
|
-
async function
|
|
2790
|
+
async function Ra(t) {
|
|
2737
2791
|
}
|
|
2738
|
-
async function
|
|
2792
|
+
async function Ua(t) {
|
|
2739
2793
|
}
|
|
2740
|
-
const
|
|
2794
|
+
const Ka = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2741
2795
|
__proto__: null,
|
|
2742
|
-
down:
|
|
2743
|
-
up:
|
|
2796
|
+
down: Ua,
|
|
2797
|
+
up: Ra
|
|
2744
2798
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2745
|
-
async function
|
|
2799
|
+
async function Ba(t) {
|
|
2746
2800
|
await t.schema.alterTable("logs").dropColumn("category").execute();
|
|
2747
2801
|
}
|
|
2748
|
-
async function
|
|
2802
|
+
async function Qa(t) {
|
|
2749
2803
|
await t.schema.alterTable("logs").addColumn("category", "varchar(255)", (e) => e.notNull()).execute();
|
|
2750
2804
|
}
|
|
2751
|
-
const
|
|
2805
|
+
const Va = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2752
2806
|
__proto__: null,
|
|
2753
|
-
down:
|
|
2754
|
-
up:
|
|
2807
|
+
down: Qa,
|
|
2808
|
+
up: Ba
|
|
2755
2809
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2756
|
-
async function
|
|
2810
|
+
async function Wa(t) {
|
|
2757
2811
|
await t.schema.alterTable("users").dropColumn("tags").execute();
|
|
2758
2812
|
}
|
|
2759
|
-
async function
|
|
2813
|
+
async function qa(t) {
|
|
2760
2814
|
await t.schema.alterTable("users").addColumn("tags", "varchar(255)").execute();
|
|
2761
2815
|
}
|
|
2762
|
-
const
|
|
2816
|
+
const Ga = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2763
2817
|
__proto__: null,
|
|
2764
|
-
down:
|
|
2765
|
-
up:
|
|
2818
|
+
down: qa,
|
|
2819
|
+
up: Wa
|
|
2766
2820
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2767
|
-
async function
|
|
2821
|
+
async function Ha(t) {
|
|
2768
2822
|
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();
|
|
2769
2823
|
}
|
|
2770
|
-
async function
|
|
2824
|
+
async function Xa(t) {
|
|
2771
2825
|
await t.schema.dropIndex("logs_user_id"), await t.schema.dropIndex("logs_tenant_id"), await t.schema.dropIndex("logs_date");
|
|
2772
2826
|
}
|
|
2773
|
-
const
|
|
2827
|
+
const Ya = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2774
2828
|
__proto__: null,
|
|
2775
|
-
down:
|
|
2776
|
-
up:
|
|
2777
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
2778
|
-
async function Wr(t) {
|
|
2779
|
-
await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(8192)").execute();
|
|
2780
|
-
}
|
|
2781
|
-
async function qr(t) {
|
|
2782
|
-
await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(2048)").execute();
|
|
2783
|
-
}
|
|
2784
|
-
const Gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2785
|
-
__proto__: null,
|
|
2786
|
-
down: qr,
|
|
2787
|
-
up: Wr
|
|
2788
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
2789
|
-
async function Hr(t) {
|
|
2790
|
-
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();
|
|
2791
|
-
}
|
|
2792
|
-
async function Xr(t) {
|
|
2793
|
-
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();
|
|
2794
|
-
}
|
|
2795
|
-
const Yr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2796
|
-
__proto__: null,
|
|
2797
|
-
down: Xr,
|
|
2798
|
-
up: Hr
|
|
2829
|
+
down: Xa,
|
|
2830
|
+
up: Ha
|
|
2799
2831
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2800
|
-
async function
|
|
2801
|
-
await t.schema.
|
|
2832
|
+
async function Za(t) {
|
|
2833
|
+
await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(8192)").execute();
|
|
2802
2834
|
}
|
|
2803
2835
|
async function en(t) {
|
|
2804
|
-
await t.schema.
|
|
2836
|
+
await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(2048)").execute();
|
|
2805
2837
|
}
|
|
2806
2838
|
const tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2807
2839
|
__proto__: null,
|
|
2808
2840
|
down: en,
|
|
2809
|
-
up:
|
|
2841
|
+
up: Za
|
|
2810
2842
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2811
|
-
async function an(t) {
|
|
2812
|
-
}
|
|
2813
2843
|
async function rn(t) {
|
|
2814
|
-
await t.schema.alterTable("
|
|
2844
|
+
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();
|
|
2845
|
+
}
|
|
2846
|
+
async function an(t) {
|
|
2847
|
+
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();
|
|
2815
2848
|
}
|
|
2816
2849
|
const nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2817
2850
|
__proto__: null,
|
|
2818
|
-
down:
|
|
2819
|
-
up:
|
|
2851
|
+
down: an,
|
|
2852
|
+
up: rn
|
|
2820
2853
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2821
2854
|
async function on(t) {
|
|
2822
|
-
await t.schema.
|
|
2855
|
+
await t.schema.createIndex("users_name_index").on("users").column("name").execute();
|
|
2823
2856
|
}
|
|
2824
2857
|
async function sn(t) {
|
|
2825
|
-
await t.schema.
|
|
2858
|
+
await t.schema.dropIndex("users_name_index").execute();
|
|
2826
2859
|
}
|
|
2827
2860
|
const ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2828
2861
|
__proto__: null,
|
|
@@ -2830,10 +2863,9 @@ const ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2830
2863
|
up: on
|
|
2831
2864
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2832
2865
|
async function cn(t) {
|
|
2833
|
-
await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(8192)").execute();
|
|
2834
2866
|
}
|
|
2835
2867
|
async function dn(t) {
|
|
2836
|
-
await t.schema.alterTable("
|
|
2868
|
+
await t.schema.alterTable("users").dropConstraint("unique_email_provider").execute();
|
|
2837
2869
|
}
|
|
2838
2870
|
const un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2839
2871
|
__proto__: null,
|
|
@@ -2841,14 +2873,10 @@ const un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2841
2873
|
up: cn
|
|
2842
2874
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2843
2875
|
async function mn(t) {
|
|
2844
|
-
await t.schema.
|
|
2845
|
-
"tenant_id",
|
|
2846
|
-
"varchar(255)",
|
|
2847
|
-
(e) => e.references("tenants.id").onDelete("cascade").notNull().primaryKey()
|
|
2848
|
-
).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();
|
|
2876
|
+
await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(8192)").execute();
|
|
2849
2877
|
}
|
|
2850
2878
|
async function hn(t) {
|
|
2851
|
-
await t.schema.
|
|
2879
|
+
await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(1024)").execute();
|
|
2852
2880
|
}
|
|
2853
2881
|
const fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2854
2882
|
__proto__: null,
|
|
@@ -2856,8 +2884,10 @@ const fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2856
2884
|
up: mn
|
|
2857
2885
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2858
2886
|
async function _n(t) {
|
|
2887
|
+
await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(8192)").execute();
|
|
2859
2888
|
}
|
|
2860
2889
|
async function pn(t) {
|
|
2890
|
+
await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(1024)").execute();
|
|
2861
2891
|
}
|
|
2862
2892
|
const gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2863
2893
|
__proto__: null,
|
|
@@ -2865,8 +2895,14 @@ const gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2865
2895
|
up: _n
|
|
2866
2896
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2867
2897
|
async function wn(t) {
|
|
2898
|
+
await t.schema.createTable("branding").addColumn(
|
|
2899
|
+
"tenant_id",
|
|
2900
|
+
"varchar(255)",
|
|
2901
|
+
(e) => e.references("tenants.id").onDelete("cascade").notNull().primaryKey()
|
|
2902
|
+
).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();
|
|
2868
2903
|
}
|
|
2869
2904
|
async function yn(t) {
|
|
2905
|
+
await t.schema.dropTable("branding").execute();
|
|
2870
2906
|
}
|
|
2871
2907
|
const Nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2872
2908
|
__proto__: null,
|
|
@@ -2892,38 +2928,36 @@ const Sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2892
2928
|
up: xn
|
|
2893
2929
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2894
2930
|
async function On(t) {
|
|
2895
|
-
await t.schema.createTable("authentication_codes").addColumn(
|
|
2896
|
-
"tenant_id",
|
|
2897
|
-
"varchar(255)",
|
|
2898
|
-
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
2899
|
-
).addColumn("code", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
2900
|
-
"client_id",
|
|
2901
|
-
"varchar(255)",
|
|
2902
|
-
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
2903
|
-
).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();
|
|
2904
2931
|
}
|
|
2905
2932
|
async function kn(t) {
|
|
2906
|
-
await t.schema.dropTable("authentication_codes").execute();
|
|
2907
2933
|
}
|
|
2908
2934
|
const $n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2909
2935
|
__proto__: null,
|
|
2910
2936
|
down: kn,
|
|
2911
2937
|
up: On
|
|
2912
2938
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2913
|
-
async function Dn(t) {
|
|
2914
|
-
}
|
|
2915
2939
|
async function In(t) {
|
|
2916
2940
|
}
|
|
2941
|
+
async function Dn(t) {
|
|
2942
|
+
}
|
|
2917
2943
|
const Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2918
2944
|
__proto__: null,
|
|
2919
|
-
down:
|
|
2920
|
-
up:
|
|
2945
|
+
down: Dn,
|
|
2946
|
+
up: In
|
|
2921
2947
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2922
2948
|
async function jn(t) {
|
|
2923
|
-
await t.schema.
|
|
2949
|
+
await t.schema.createTable("authentication_codes").addColumn(
|
|
2950
|
+
"tenant_id",
|
|
2951
|
+
"varchar(255)",
|
|
2952
|
+
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
2953
|
+
).addColumn("code", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
2954
|
+
"client_id",
|
|
2955
|
+
"varchar(255)",
|
|
2956
|
+
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
2957
|
+
).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();
|
|
2924
2958
|
}
|
|
2925
2959
|
async function Mn(t) {
|
|
2926
|
-
await t.schema.
|
|
2960
|
+
await t.schema.dropTable("authentication_codes").execute();
|
|
2927
2961
|
}
|
|
2928
2962
|
const An = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2929
2963
|
__proto__: null,
|
|
@@ -2931,10 +2965,8 @@ const An = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2931
2965
|
up: jn
|
|
2932
2966
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2933
2967
|
async function Fn(t) {
|
|
2934
|
-
await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(1024)").execute();
|
|
2935
2968
|
}
|
|
2936
2969
|
async function Ln(t) {
|
|
2937
|
-
await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(255)").execute();
|
|
2938
2970
|
}
|
|
2939
2971
|
const En = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2940
2972
|
__proto__: null,
|
|
@@ -2942,8 +2974,10 @@ const En = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2942
2974
|
up: Fn
|
|
2943
2975
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2944
2976
|
async function zn(t) {
|
|
2977
|
+
await t.schema.alterTable("otps").addColumn("ip", "varchar(64)").execute();
|
|
2945
2978
|
}
|
|
2946
2979
|
async function Jn(t) {
|
|
2980
|
+
await t.schema.alterTable("otps").dropColumn("ip").execute();
|
|
2947
2981
|
}
|
|
2948
2982
|
const Rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2949
2983
|
__proto__: null,
|
|
@@ -2951,18 +2985,10 @@ const Rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2951
2985
|
up: zn
|
|
2952
2986
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2953
2987
|
async function Un(t) {
|
|
2954
|
-
await t.schema.
|
|
2955
|
-
"tenant_id",
|
|
2956
|
-
"varchar(255)",
|
|
2957
|
-
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
2958
|
-
).addColumn("url", "varchar(512)", (e) => e.notNull()).addColumn("trigger_id", "varchar(255)", (e) => e.notNull()).addColumn("enabled", "boolean", (e) => e.notNull()).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("updated_at", "varchar(255)", (e) => e.notNull()).addColumn(
|
|
2959
|
-
"synchronous",
|
|
2960
|
-
"boolean",
|
|
2961
|
-
(e) => e.defaultTo(!1).notNull()
|
|
2962
|
-
).addColumn("priority", "integer").execute();
|
|
2988
|
+
await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(1024)").execute();
|
|
2963
2989
|
}
|
|
2964
2990
|
async function Kn(t) {
|
|
2965
|
-
await t.schema.
|
|
2991
|
+
await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(255)").execute();
|
|
2966
2992
|
}
|
|
2967
2993
|
const Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2968
2994
|
__proto__: null,
|
|
@@ -2979,8 +3005,18 @@ const Wn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2979
3005
|
up: Qn
|
|
2980
3006
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2981
3007
|
async function qn(t) {
|
|
3008
|
+
await t.schema.createTable("hooks").addColumn("hook_id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
|
|
3009
|
+
"tenant_id",
|
|
3010
|
+
"varchar(255)",
|
|
3011
|
+
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
3012
|
+
).addColumn("url", "varchar(512)", (e) => e.notNull()).addColumn("trigger_id", "varchar(255)", (e) => e.notNull()).addColumn("enabled", "boolean", (e) => e.notNull()).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("updated_at", "varchar(255)", (e) => e.notNull()).addColumn(
|
|
3013
|
+
"synchronous",
|
|
3014
|
+
"boolean",
|
|
3015
|
+
(e) => e.defaultTo(!1).notNull()
|
|
3016
|
+
).addColumn("priority", "integer").execute();
|
|
2982
3017
|
}
|
|
2983
3018
|
async function Gn(t) {
|
|
3019
|
+
await t.schema.dropTable("hooks").execute();
|
|
2984
3020
|
}
|
|
2985
3021
|
const Hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2986
3022
|
__proto__: null,
|
|
@@ -2988,6 +3024,24 @@ const Hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2988
3024
|
up: qn
|
|
2989
3025
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2990
3026
|
async function Xn(t) {
|
|
3027
|
+
}
|
|
3028
|
+
async function Yn(t) {
|
|
3029
|
+
}
|
|
3030
|
+
const Zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3031
|
+
__proto__: null,
|
|
3032
|
+
down: Yn,
|
|
3033
|
+
up: Xn
|
|
3034
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
3035
|
+
async function eo(t) {
|
|
3036
|
+
}
|
|
3037
|
+
async function to(t) {
|
|
3038
|
+
}
|
|
3039
|
+
const ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3040
|
+
__proto__: null,
|
|
3041
|
+
down: to,
|
|
3042
|
+
up: eo
|
|
3043
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
3044
|
+
async function ao(t) {
|
|
2991
3045
|
await t.schema.createTable("logins").addColumn("login_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
2992
3046
|
"tenant_id",
|
|
2993
3047
|
"varchar(255)",
|
|
@@ -3004,7 +3058,7 @@ async function Xn(t) {
|
|
|
3004
3058
|
(e) => e.onDelete("cascade")
|
|
3005
3059
|
).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();
|
|
3006
3060
|
}
|
|
3007
|
-
async function
|
|
3061
|
+
async function no(t) {
|
|
3008
3062
|
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(
|
|
3009
3063
|
"codes_user_id_tenant_id_constraint",
|
|
3010
3064
|
["user_id", "tenant_id"],
|
|
@@ -3013,36 +3067,14 @@ async function Yn(t) {
|
|
|
3013
3067
|
(e) => e.onDelete("cascade")
|
|
3014
3068
|
).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();
|
|
3015
3069
|
}
|
|
3016
|
-
const Zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3017
|
-
__proto__: null,
|
|
3018
|
-
down: Yn,
|
|
3019
|
-
up: Xn
|
|
3020
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
3021
|
-
async function eo(t) {
|
|
3022
|
-
}
|
|
3023
|
-
async function to(t) {
|
|
3024
|
-
}
|
|
3025
|
-
const ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3026
|
-
__proto__: null,
|
|
3027
|
-
down: to,
|
|
3028
|
-
up: eo
|
|
3029
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
3030
|
-
async function ro(t) {
|
|
3031
|
-
await t.schema.alterTable("logins").addColumn("auth0Client", "varchar(256)").execute();
|
|
3032
|
-
}
|
|
3033
|
-
async function no(t) {
|
|
3034
|
-
await t.schema.alterTable("logins").dropColumn("auth0Client").execute();
|
|
3035
|
-
}
|
|
3036
3070
|
const oo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3037
3071
|
__proto__: null,
|
|
3038
3072
|
down: no,
|
|
3039
|
-
up:
|
|
3073
|
+
up: ao
|
|
3040
3074
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3041
3075
|
async function so(t) {
|
|
3042
|
-
await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(8192)").execute();
|
|
3043
3076
|
}
|
|
3044
3077
|
async function io(t) {
|
|
3045
|
-
await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(511)").execute();
|
|
3046
3078
|
}
|
|
3047
3079
|
const lo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3048
3080
|
__proto__: null,
|
|
@@ -3050,8 +3082,10 @@ const lo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3050
3082
|
up: so
|
|
3051
3083
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3052
3084
|
async function co(t) {
|
|
3085
|
+
await t.schema.alterTable("logins").addColumn("auth0Client", "varchar(256)").execute();
|
|
3053
3086
|
}
|
|
3054
3087
|
async function uo(t) {
|
|
3088
|
+
await t.schema.alterTable("logins").dropColumn("auth0Client").execute();
|
|
3055
3089
|
}
|
|
3056
3090
|
const mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3057
3091
|
__proto__: null,
|
|
@@ -3059,8 +3093,10 @@ const mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3059
3093
|
up: co
|
|
3060
3094
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3061
3095
|
async function ho(t) {
|
|
3096
|
+
await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(8192)").execute();
|
|
3062
3097
|
}
|
|
3063
3098
|
async function fo(t) {
|
|
3099
|
+
await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(511)").execute();
|
|
3064
3100
|
}
|
|
3065
3101
|
const _o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3066
3102
|
__proto__: null,
|
|
@@ -3068,10 +3104,8 @@ const _o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3068
3104
|
up: ho
|
|
3069
3105
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3070
3106
|
async function po(t) {
|
|
3071
|
-
await t.schema.alterTable("logins").addColumn("authParams_nonce", "varchar(255)").execute();
|
|
3072
3107
|
}
|
|
3073
3108
|
async function go(t) {
|
|
3074
|
-
await t.schema.alterTable("logins").dropColumn("nonce").execute();
|
|
3075
3109
|
}
|
|
3076
3110
|
const wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3077
3111
|
__proto__: null,
|
|
@@ -3088,8 +3122,10 @@ const vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3088
3122
|
up: yo
|
|
3089
3123
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3090
3124
|
async function bo(t) {
|
|
3125
|
+
await t.schema.alterTable("logins").addColumn("authParams_nonce", "varchar(255)").execute();
|
|
3091
3126
|
}
|
|
3092
3127
|
async function Co(t) {
|
|
3128
|
+
await t.schema.alterTable("logins").dropColumn("nonce").execute();
|
|
3093
3129
|
}
|
|
3094
3130
|
const xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3095
3131
|
__proto__: null,
|
|
@@ -3097,6 +3133,24 @@ const xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3097
3133
|
up: bo
|
|
3098
3134
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3099
3135
|
async function To(t) {
|
|
3136
|
+
}
|
|
3137
|
+
async function So(t) {
|
|
3138
|
+
}
|
|
3139
|
+
const Oo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3140
|
+
__proto__: null,
|
|
3141
|
+
down: So,
|
|
3142
|
+
up: To
|
|
3143
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
3144
|
+
async function ko(t) {
|
|
3145
|
+
}
|
|
3146
|
+
async function $o(t) {
|
|
3147
|
+
}
|
|
3148
|
+
const Io = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3149
|
+
__proto__: null,
|
|
3150
|
+
down: $o,
|
|
3151
|
+
up: ko
|
|
3152
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
3153
|
+
async function Do(t) {
|
|
3100
3154
|
await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.notNull()).addColumn(
|
|
3101
3155
|
"tenant_id",
|
|
3102
3156
|
"varchar(255)",
|
|
@@ -3112,7 +3166,7 @@ async function To(t) {
|
|
|
3112
3166
|
"code_type"
|
|
3113
3167
|
]).execute();
|
|
3114
3168
|
}
|
|
3115
|
-
async function
|
|
3169
|
+
async function Po(t) {
|
|
3116
3170
|
await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
3117
3171
|
"tenant_id",
|
|
3118
3172
|
"varchar(255)",
|
|
@@ -3125,15 +3179,15 @@ async function So(t) {
|
|
|
3125
3179
|
(e) => e.onDelete("cascade")
|
|
3126
3180
|
).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();
|
|
3127
3181
|
}
|
|
3128
|
-
const
|
|
3182
|
+
const jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3129
3183
|
__proto__: null,
|
|
3130
|
-
down:
|
|
3131
|
-
up:
|
|
3184
|
+
down: Po,
|
|
3185
|
+
up: Do
|
|
3132
3186
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3133
|
-
async function
|
|
3187
|
+
async function Mo(t) {
|
|
3134
3188
|
await t.schema.dropTable("otps").execute(), await t.schema.dropTable("authentication_codes").execute();
|
|
3135
3189
|
}
|
|
3136
|
-
async function
|
|
3190
|
+
async function Ao(t) {
|
|
3137
3191
|
await t.schema.alterTable("keys").addColumn("private_key", "varchar(2048)").addColumn("public_key", "varchar(2048)").execute(), await t.schema.createTable("otps").addColumn(
|
|
3138
3192
|
"tenant_id",
|
|
3139
3193
|
"varchar(255)",
|
|
@@ -3152,32 +3206,32 @@ async function $o(t) {
|
|
|
3152
3206
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
3153
3207
|
).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();
|
|
3154
3208
|
}
|
|
3155
|
-
const
|
|
3209
|
+
const Fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3156
3210
|
__proto__: null,
|
|
3157
|
-
down:
|
|
3158
|
-
up:
|
|
3211
|
+
down: Ao,
|
|
3212
|
+
up: Mo
|
|
3159
3213
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3160
|
-
async function
|
|
3214
|
+
async function Lo(t) {
|
|
3161
3215
|
await t.schema.createIndex("IDX_logs_tenant_date_type_user").on("logs").columns(["tenant_id", "date", "type", "user_id"]).execute();
|
|
3162
3216
|
}
|
|
3163
|
-
async function
|
|
3217
|
+
async function Eo(t) {
|
|
3164
3218
|
await t.schema.dropIndex("IDX_logs_tenant_date_type_user").on("logs").execute();
|
|
3165
3219
|
}
|
|
3166
|
-
const
|
|
3220
|
+
const zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3167
3221
|
__proto__: null,
|
|
3168
|
-
down:
|
|
3169
|
-
up:
|
|
3222
|
+
down: Eo,
|
|
3223
|
+
up: Lo
|
|
3170
3224
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3171
|
-
async function
|
|
3225
|
+
async function Jo(t) {
|
|
3172
3226
|
}
|
|
3173
|
-
async function
|
|
3227
|
+
async function Ro(t) {
|
|
3174
3228
|
}
|
|
3175
|
-
const
|
|
3229
|
+
const Uo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3176
3230
|
__proto__: null,
|
|
3177
|
-
down:
|
|
3178
|
-
up:
|
|
3231
|
+
down: Ro,
|
|
3232
|
+
up: Jo
|
|
3179
3233
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3180
|
-
async function
|
|
3234
|
+
async function Ko(t) {
|
|
3181
3235
|
await t.schema.createTable("prompt_settings").addColumn("tenant_id", "varchar(64)", (e) => e.primaryKey()).addColumn(
|
|
3182
3236
|
"universal_login_experience",
|
|
3183
3237
|
"varchar(16)",
|
|
@@ -3196,26 +3250,8 @@ async function Lo(t) {
|
|
|
3196
3250
|
(e) => e.defaultTo(!1).notNull()
|
|
3197
3251
|
).execute();
|
|
3198
3252
|
}
|
|
3199
|
-
async function Eo(t) {
|
|
3200
|
-
await t.schema.dropTable("prompt_settings").execute();
|
|
3201
|
-
}
|
|
3202
|
-
const zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3203
|
-
__proto__: null,
|
|
3204
|
-
down: Eo,
|
|
3205
|
-
up: Lo
|
|
3206
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
3207
|
-
async function Jo(t) {
|
|
3208
|
-
}
|
|
3209
|
-
async function Ro(t) {
|
|
3210
|
-
}
|
|
3211
|
-
const Uo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3212
|
-
__proto__: null,
|
|
3213
|
-
down: Ro,
|
|
3214
|
-
up: Jo
|
|
3215
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
3216
|
-
async function Ko(t) {
|
|
3217
|
-
}
|
|
3218
3253
|
async function Bo(t) {
|
|
3254
|
+
await t.schema.dropTable("prompt_settings").execute();
|
|
3219
3255
|
}
|
|
3220
3256
|
const Qo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3221
3257
|
__proto__: null,
|
|
@@ -3232,10 +3268,8 @@ const qo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3232
3268
|
up: Vo
|
|
3233
3269
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3234
3270
|
async function Go(t) {
|
|
3235
|
-
await t.schema.alterTable("logins").addColumn("authParams_ui_locales", "varchar(32)").execute();
|
|
3236
3271
|
}
|
|
3237
3272
|
async function Ho(t) {
|
|
3238
|
-
await t.schema.alterTable("logins").dropColumn("authParams_ui_locales").execute();
|
|
3239
3273
|
}
|
|
3240
3274
|
const Xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3241
3275
|
__proto__: null,
|
|
@@ -3243,10 +3277,8 @@ const Xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3243
3277
|
up: Go
|
|
3244
3278
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3245
3279
|
async function Yo(t) {
|
|
3246
|
-
await t.schema.alterTable("logins").addColumn("authParams_prompt", "varchar(16)").execute();
|
|
3247
3280
|
}
|
|
3248
3281
|
async function Zo(t) {
|
|
3249
|
-
await t.schema.alterTable("logins").dropColumn("authParams_prompt").execute();
|
|
3250
3282
|
}
|
|
3251
3283
|
const es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3252
3284
|
__proto__: null,
|
|
@@ -3254,19 +3286,21 @@ const es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3254
3286
|
up: Yo
|
|
3255
3287
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3256
3288
|
async function ts(t) {
|
|
3289
|
+
await t.schema.alterTable("logins").addColumn("authParams_ui_locales", "varchar(32)").execute();
|
|
3257
3290
|
}
|
|
3258
|
-
async function
|
|
3291
|
+
async function rs(t) {
|
|
3292
|
+
await t.schema.alterTable("logins").dropColumn("authParams_ui_locales").execute();
|
|
3259
3293
|
}
|
|
3260
|
-
const
|
|
3294
|
+
const as = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3261
3295
|
__proto__: null,
|
|
3262
|
-
down:
|
|
3296
|
+
down: rs,
|
|
3263
3297
|
up: ts
|
|
3264
3298
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3265
3299
|
async function ns(t) {
|
|
3266
|
-
await t.schema.alterTable("logins").addColumn("
|
|
3300
|
+
await t.schema.alterTable("logins").addColumn("authParams_prompt", "varchar(16)").execute();
|
|
3267
3301
|
}
|
|
3268
3302
|
async function os(t) {
|
|
3269
|
-
await t.schema.alterTable("logins").dropColumn("
|
|
3303
|
+
await t.schema.alterTable("logins").dropColumn("authParams_prompt").execute();
|
|
3270
3304
|
}
|
|
3271
3305
|
const ss = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3272
3306
|
__proto__: null,
|
|
@@ -3274,10 +3308,8 @@ const ss = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3274
3308
|
up: ns
|
|
3275
3309
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3276
3310
|
async function is(t) {
|
|
3277
|
-
await t.schema.alterTable("codes").addColumn("code_verifier", "varchar(128)").execute();
|
|
3278
3311
|
}
|
|
3279
3312
|
async function ls(t) {
|
|
3280
|
-
await t.schema.alterTable("codes").dropColumn("code_verifier").execute();
|
|
3281
3313
|
}
|
|
3282
3314
|
const cs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3283
3315
|
__proto__: null,
|
|
@@ -3285,6 +3317,28 @@ const cs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3285
3317
|
up: is
|
|
3286
3318
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3287
3319
|
async function ds(t) {
|
|
3320
|
+
await t.schema.alterTable("logins").addColumn("authParams_act_as", "varchar(255)").execute();
|
|
3321
|
+
}
|
|
3322
|
+
async function us(t) {
|
|
3323
|
+
await t.schema.alterTable("logins").dropColumn("authParam_act_as").execute();
|
|
3324
|
+
}
|
|
3325
|
+
const ms = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3326
|
+
__proto__: null,
|
|
3327
|
+
down: us,
|
|
3328
|
+
up: ds
|
|
3329
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
3330
|
+
async function hs(t) {
|
|
3331
|
+
await t.schema.alterTable("codes").addColumn("code_verifier", "varchar(128)").execute();
|
|
3332
|
+
}
|
|
3333
|
+
async function fs(t) {
|
|
3334
|
+
await t.schema.alterTable("codes").dropColumn("code_verifier").execute();
|
|
3335
|
+
}
|
|
3336
|
+
const _s = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3337
|
+
__proto__: null,
|
|
3338
|
+
down: fs,
|
|
3339
|
+
up: hs
|
|
3340
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
3341
|
+
async function ps(t) {
|
|
3288
3342
|
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(
|
|
3289
3343
|
"credentials",
|
|
3290
3344
|
"varchar(2048)",
|
|
@@ -3295,18 +3349,18 @@ async function ds(t) {
|
|
|
3295
3349
|
(e) => e.notNull().defaultTo("{}")
|
|
3296
3350
|
).addColumn("created_at", "varchar(29)", (e) => e.notNull()).addColumn("updated_at", "varchar(29)", (e) => e.notNull()).execute();
|
|
3297
3351
|
}
|
|
3298
|
-
async function
|
|
3352
|
+
async function gs(t) {
|
|
3299
3353
|
await t.schema.dropTable("email_providers").execute();
|
|
3300
3354
|
}
|
|
3301
|
-
const
|
|
3355
|
+
const ws = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3302
3356
|
__proto__: null,
|
|
3303
|
-
down:
|
|
3304
|
-
up:
|
|
3357
|
+
down: gs,
|
|
3358
|
+
up: ps
|
|
3305
3359
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3306
|
-
async function
|
|
3360
|
+
async function ys(t) {
|
|
3307
3361
|
await t.schema.dropTable("tickets").execute();
|
|
3308
3362
|
}
|
|
3309
|
-
async function
|
|
3363
|
+
async function Ns(t) {
|
|
3310
3364
|
await t.schema.createTable("tickets").addColumn(
|
|
3311
3365
|
"tenant_id",
|
|
3312
3366
|
"varchar(255)",
|
|
@@ -3317,123 +3371,120 @@ async function fs(t) {
|
|
|
3317
3371
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
3318
3372
|
).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();
|
|
3319
3373
|
}
|
|
3320
|
-
const
|
|
3374
|
+
const vs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3321
3375
|
__proto__: null,
|
|
3322
|
-
down:
|
|
3323
|
-
up:
|
|
3376
|
+
down: Ns,
|
|
3377
|
+
up: ys
|
|
3324
3378
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3325
|
-
async function
|
|
3379
|
+
async function bs(t) {
|
|
3326
3380
|
}
|
|
3327
|
-
async function
|
|
3381
|
+
async function Cs(t) {
|
|
3328
3382
|
await t.schema.alterTable("logins").dropColumn("ip").dropColumn("useragent").execute();
|
|
3329
3383
|
}
|
|
3330
|
-
const
|
|
3384
|
+
const xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3331
3385
|
__proto__: null,
|
|
3332
|
-
down:
|
|
3333
|
-
up:
|
|
3386
|
+
down: Cs,
|
|
3387
|
+
up: bs
|
|
3334
3388
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3335
|
-
async function
|
|
3389
|
+
async function Ts(t) {
|
|
3336
3390
|
await t.schema.createTable("refresh_tokens").addColumn(
|
|
3337
3391
|
"tenant_id",
|
|
3338
3392
|
"varchar(255)",
|
|
3339
3393
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
3340
|
-
).addColumn("
|
|
3394
|
+
).addColumn("token", "varchar(255)", (e) => e.notNull()).addColumn(
|
|
3341
3395
|
"session_id",
|
|
3342
3396
|
"varchar(255)",
|
|
3343
|
-
(e) => e.references("
|
|
3344
|
-
).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").addColumn("revoked_at", "varchar(255)").addColumn(
|
|
3397
|
+
(e) => e.references("sessions.session_id").onDelete("cascade").notNull()
|
|
3398
|
+
).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").addColumn("scope", "varchar(512)", (e) => e.notNull()).addColumn("audience", "varchar(512)", (e) => e.notNull()).addColumn("revoked_at", "varchar(255)").addColumn(
|
|
3345
3399
|
"created_at",
|
|
3346
3400
|
"varchar(255)",
|
|
3347
3401
|
(e) => e.notNull().defaultTo((/* @__PURE__ */ new Date()).toISOString())
|
|
3348
|
-
).addPrimaryKeyConstraint("refresh_tokens_pkey", [
|
|
3349
|
-
"tenant_id",
|
|
3350
|
-
"refresh_token"
|
|
3351
|
-
]).execute();
|
|
3402
|
+
).addPrimaryKeyConstraint("refresh_tokens_pkey", ["tenant_id", "token"]).execute();
|
|
3352
3403
|
}
|
|
3353
|
-
async function
|
|
3404
|
+
async function Ss(t) {
|
|
3354
3405
|
await t.schema.dropTable("refresh_tokens").execute();
|
|
3355
3406
|
}
|
|
3356
|
-
const
|
|
3407
|
+
const Os = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3357
3408
|
__proto__: null,
|
|
3358
|
-
down:
|
|
3359
|
-
up:
|
|
3409
|
+
down: Ss,
|
|
3410
|
+
up: Ts
|
|
3360
3411
|
}, Symbol.toStringTag, { value: "Module" })), Le = {
|
|
3361
|
-
m1_init:
|
|
3362
|
-
m2_magicLink:
|
|
3363
|
-
m3_updateAt:
|
|
3364
|
-
m4_logTable:
|
|
3365
|
-
m5_userProfile:
|
|
3366
|
-
m6_sessions:
|
|
3367
|
-
m7_passwords:
|
|
3368
|
-
m8_logsTableNewFields:
|
|
3369
|
-
m9_passwordTableNewField:
|
|
3370
|
-
n01_codesTable:
|
|
3371
|
-
n11_universalLoginSession:
|
|
3372
|
-
n12_userFields:
|
|
3373
|
-
n13_userEmailIndex:
|
|
3374
|
-
n14_profileDataField:
|
|
3375
|
-
n15_userEmailIndex:
|
|
3376
|
-
n16_userLocale:
|
|
3377
|
-
n17_signingKeys:
|
|
3378
|
-
n18_logsFields:
|
|
3379
|
-
n19_connectionsUserinfo:
|
|
3380
|
-
n20_missingFields:
|
|
3381
|
-
n21_sessionDeletedAt:
|
|
3382
|
-
n22_dropLogsFields:
|
|
3383
|
-
n23_dropUsersFields:
|
|
3384
|
-
n24_logsIndexes:
|
|
3385
|
-
n25_logDescMaxLength:
|
|
3386
|
-
n26_logsTableExtraFields:
|
|
3387
|
-
n27_usersTableNameIndex:
|
|
3388
|
-
n28_usersEmailConstrain:
|
|
3389
|
-
n29_increaseOtpStateLength:
|
|
3390
|
-
n30_increaseTicketStateLength:
|
|
3391
|
-
n31_branding:
|
|
3392
|
-
n32_indexesAndNotNull:
|
|
3393
|
-
n33_vendorIdInUniversalLoginSession:
|
|
3394
|
-
n34_auth0ClientInUniversalLoginSession:
|
|
3395
|
-
n35_increaseUniversalSessionStateLength:
|
|
3396
|
-
n36_authenticationCodes:
|
|
3397
|
-
n37_disableSignUps:
|
|
3398
|
-
n38_otpIpAddress:
|
|
3399
|
-
n39_increaseUserAgentLength:
|
|
3400
|
-
n40_userId:
|
|
3401
|
-
n41_hooks:
|
|
3402
|
-
n42_userIdIndexes:
|
|
3403
|
-
n43_userIdIndexes:
|
|
3404
|
-
n44_codes:
|
|
3405
|
-
n45_hookProperties:
|
|
3406
|
-
n46_loginAuth0Client:
|
|
3407
|
-
n47_loginAuth0Client:
|
|
3408
|
-
n48_saml:
|
|
3409
|
-
n49_removeFields:
|
|
3410
|
-
n50_authParamsNonce:
|
|
3411
|
-
n51_connectionid:
|
|
3412
|
-
n52_cert:
|
|
3413
|
-
n53_codes_primary_key:
|
|
3414
|
-
n54_cleanup_tables:
|
|
3415
|
-
n55_logs_index:
|
|
3416
|
-
n56_application_fields:
|
|
3417
|
-
n57_prompt_settings:
|
|
3418
|
-
n58_connection_client_id:
|
|
3419
|
-
n59_connection_options:
|
|
3420
|
-
n60_users_metadata:
|
|
3421
|
-
n61_userLocales:
|
|
3422
|
-
n62_prompt:
|
|
3423
|
-
n63_connection_cleanup:
|
|
3424
|
-
n64_act_as:
|
|
3425
|
-
n65_code_verifier:
|
|
3426
|
-
n66_email_providers:
|
|
3427
|
-
n67_drop_tickets:
|
|
3428
|
-
n68_login_useragents:
|
|
3429
|
-
n70_refresh_tokens:
|
|
3412
|
+
m1_init: Lr,
|
|
3413
|
+
m2_magicLink: Jr,
|
|
3414
|
+
m3_updateAt: Kr,
|
|
3415
|
+
m4_logTable: Vr,
|
|
3416
|
+
m5_userProfile: Gr,
|
|
3417
|
+
m6_sessions: Yr,
|
|
3418
|
+
m7_passwords: ta,
|
|
3419
|
+
m8_logsTableNewFields: na,
|
|
3420
|
+
m9_passwordTableNewField: ia,
|
|
3421
|
+
n01_codesTable: da,
|
|
3422
|
+
n11_universalLoginSession: ha,
|
|
3423
|
+
n12_userFields: pa,
|
|
3424
|
+
n13_userEmailIndex: ya,
|
|
3425
|
+
n14_profileDataField: ba,
|
|
3426
|
+
n15_userEmailIndex: Ta,
|
|
3427
|
+
n16_userLocale: ka,
|
|
3428
|
+
n17_signingKeys: Da,
|
|
3429
|
+
n18_logsFields: Ma,
|
|
3430
|
+
n19_connectionsUserinfo: La,
|
|
3431
|
+
n20_missingFields: Ja,
|
|
3432
|
+
n21_sessionDeletedAt: Ka,
|
|
3433
|
+
n22_dropLogsFields: Va,
|
|
3434
|
+
n23_dropUsersFields: Ga,
|
|
3435
|
+
n24_logsIndexes: Ya,
|
|
3436
|
+
n25_logDescMaxLength: tn,
|
|
3437
|
+
n26_logsTableExtraFields: nn,
|
|
3438
|
+
n27_usersTableNameIndex: ln,
|
|
3439
|
+
n28_usersEmailConstrain: un,
|
|
3440
|
+
n29_increaseOtpStateLength: fn,
|
|
3441
|
+
n30_increaseTicketStateLength: gn,
|
|
3442
|
+
n31_branding: Nn,
|
|
3443
|
+
n32_indexesAndNotNull: Cn,
|
|
3444
|
+
n33_vendorIdInUniversalLoginSession: Sn,
|
|
3445
|
+
n34_auth0ClientInUniversalLoginSession: $n,
|
|
3446
|
+
n35_increaseUniversalSessionStateLength: Pn,
|
|
3447
|
+
n36_authenticationCodes: An,
|
|
3448
|
+
n37_disableSignUps: En,
|
|
3449
|
+
n38_otpIpAddress: Rn,
|
|
3450
|
+
n39_increaseUserAgentLength: Bn,
|
|
3451
|
+
n40_userId: Wn,
|
|
3452
|
+
n41_hooks: Hn,
|
|
3453
|
+
n42_userIdIndexes: Zn,
|
|
3454
|
+
n43_userIdIndexes: ro,
|
|
3455
|
+
n44_codes: oo,
|
|
3456
|
+
n45_hookProperties: lo,
|
|
3457
|
+
n46_loginAuth0Client: mo,
|
|
3458
|
+
n47_loginAuth0Client: _o,
|
|
3459
|
+
n48_saml: wo,
|
|
3460
|
+
n49_removeFields: vo,
|
|
3461
|
+
n50_authParamsNonce: xo,
|
|
3462
|
+
n51_connectionid: Oo,
|
|
3463
|
+
n52_cert: Io,
|
|
3464
|
+
n53_codes_primary_key: jo,
|
|
3465
|
+
n54_cleanup_tables: Fo,
|
|
3466
|
+
n55_logs_index: zo,
|
|
3467
|
+
n56_application_fields: Uo,
|
|
3468
|
+
n57_prompt_settings: Qo,
|
|
3469
|
+
n58_connection_client_id: qo,
|
|
3470
|
+
n59_connection_options: Xo,
|
|
3471
|
+
n60_users_metadata: es,
|
|
3472
|
+
n61_userLocales: as,
|
|
3473
|
+
n62_prompt: ss,
|
|
3474
|
+
n63_connection_cleanup: cs,
|
|
3475
|
+
n64_act_as: ms,
|
|
3476
|
+
n65_code_verifier: _s,
|
|
3477
|
+
n66_email_providers: ws,
|
|
3478
|
+
n67_drop_tickets: vs,
|
|
3479
|
+
n68_login_useragents: xs,
|
|
3480
|
+
n70_refresh_tokens: Os
|
|
3430
3481
|
};
|
|
3431
|
-
async function
|
|
3482
|
+
async function Ps(t, e = !1) {
|
|
3432
3483
|
e && console.log("migrating...");
|
|
3433
|
-
const
|
|
3484
|
+
const r = new Fe(Le), a = new ve({
|
|
3434
3485
|
db: t,
|
|
3435
|
-
provider:
|
|
3436
|
-
}), { error: o, results: n } = await
|
|
3486
|
+
provider: r
|
|
3487
|
+
}), { error: o, results: n } = await a.migrateToLatest();
|
|
3437
3488
|
if (n == null || n.forEach((s) => {
|
|
3438
3489
|
s.status === "Success" ? e && console.log(
|
|
3439
3490
|
`migration "${s.migrationName}" was executed successfully`
|
|
@@ -3441,40 +3492,41 @@ async function Ss(t, e = !1) {
|
|
|
3441
3492
|
}), o)
|
|
3442
3493
|
throw console.error("failed to migrate"), console.error(o), o;
|
|
3443
3494
|
}
|
|
3444
|
-
async function
|
|
3495
|
+
async function js(t) {
|
|
3445
3496
|
console.log("migrating...");
|
|
3446
|
-
const e = new Fe(Le),
|
|
3497
|
+
const e = new Fe(Le), r = new ve({
|
|
3447
3498
|
db: t,
|
|
3448
3499
|
provider: e
|
|
3449
|
-
}), { error:
|
|
3500
|
+
}), { error: a, results: o } = await r.migrateDown();
|
|
3450
3501
|
if (o == null || o.forEach((n) => {
|
|
3451
3502
|
n.status === "Success" ? console.log(`migration "${n.migrationName}" was reverted successfully`) : n.status === "Error" && console.error(`failed to execute migration "${n.migrationName}"`);
|
|
3452
|
-
}),
|
|
3453
|
-
throw console.error("failed to migrate"), console.error(
|
|
3503
|
+
}), a)
|
|
3504
|
+
throw console.error("failed to migrate"), console.error(a), a;
|
|
3454
3505
|
}
|
|
3455
|
-
function
|
|
3506
|
+
function Ms(t) {
|
|
3456
3507
|
return {
|
|
3457
|
-
applications:
|
|
3508
|
+
applications: Dt(t),
|
|
3458
3509
|
branding: qt(t),
|
|
3459
3510
|
clients: Et(t),
|
|
3460
3511
|
codes: Tt(t),
|
|
3461
3512
|
connections: Lt(t),
|
|
3462
|
-
emailProviders:
|
|
3513
|
+
emailProviders: wr(t),
|
|
3463
3514
|
domains: Qt(t),
|
|
3464
|
-
hooks:
|
|
3515
|
+
hooks: er(t),
|
|
3465
3516
|
keys: Ut(t),
|
|
3466
|
-
logins:
|
|
3517
|
+
logins: ur(t),
|
|
3467
3518
|
logs: ct(t),
|
|
3468
3519
|
passwords: yt(t),
|
|
3469
|
-
promptSettings:
|
|
3470
|
-
|
|
3520
|
+
promptSettings: fr(t),
|
|
3521
|
+
refreshTokens: xr(t),
|
|
3471
3522
|
sessions: _t(t),
|
|
3472
3523
|
tenants: nt(t),
|
|
3473
|
-
themes:
|
|
3524
|
+
themes: sr(t),
|
|
3525
|
+
users: Xe(t)
|
|
3474
3526
|
};
|
|
3475
3527
|
}
|
|
3476
3528
|
export {
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3529
|
+
Ms as default,
|
|
3530
|
+
js as migrateDown,
|
|
3531
|
+
Ps as migrateToLatest
|
|
3480
3532
|
};
|