@authhero/kysely-adapter 10.10.0 → 10.12.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 +1087 -32
- package/dist/kysely-adapter.mjs +1193 -1078
- package/package.json +3 -3
package/dist/kysely-adapter.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Je = Object.defineProperty;
|
|
2
|
+
var ue = (t) => {
|
|
3
3
|
throw TypeError(t);
|
|
4
4
|
};
|
|
5
|
-
var Ee = (t, e, a) => e in t ?
|
|
6
|
-
var j = (t, e, a) => Ee(t, typeof e != "symbol" ? e + "" : e, a),
|
|
7
|
-
var
|
|
8
|
-
import { parseUserId as
|
|
5
|
+
var Ee = (t, e, a) => e in t ? Je(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a;
|
|
6
|
+
var j = (t, e, a) => Ee(t, typeof e != "symbol" ? e + "" : e, a), U = (t, e, a) => e.has(t) || ue("Cannot " + a);
|
|
7
|
+
var l = (t, e, a) => (U(t, e, "read from private field"), a ? a.call(t) : e.get(t)), y = (t, e, a) => e.has(t) ? ue("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, a), M = (t, e, a, r) => (U(t, e, "write to private field"), r ? r.call(t, a) : e.set(t, a), a), u = (t, e, a) => (U(t, e, "access private method"), a);
|
|
8
|
+
import { parseUserId as Z, codeSchema as Ke, connectionSchema as Re, loginSessionSchema as Ue, promptSettingSchema as Be, formSchema as K } from "@authhero/adapter-interfaces";
|
|
9
9
|
import "@hono/zod-openapi";
|
|
10
10
|
var V = class extends Error {
|
|
11
11
|
constructor(e = 500, a) {
|
|
@@ -23,10 +23,10 @@ var V = class extends Error {
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
function
|
|
26
|
+
function Qe(t) {
|
|
27
27
|
return async (e, a) => {
|
|
28
|
-
const { identities: r, ...
|
|
29
|
-
...
|
|
28
|
+
const { identities: r, ...n } = a, o = {
|
|
29
|
+
...n,
|
|
30
30
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
31
31
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
32
32
|
login_count: 0,
|
|
@@ -37,26 +37,26 @@ function Be(t) {
|
|
|
37
37
|
user_metadata: JSON.stringify(a.user_metadata)
|
|
38
38
|
};
|
|
39
39
|
try {
|
|
40
|
-
await t.insertInto("users").values(
|
|
40
|
+
await t.insertInto("users").values(o).execute();
|
|
41
41
|
} catch (s) {
|
|
42
42
|
throw s.code === "SQLITE_CONSTRAINT_UNIQUE" || s.message.includes("AlreadyExists") ? new V(409, { message: "User already exists" }) : new V(500, { message: `${s.code}, ${s.message}` });
|
|
43
43
|
}
|
|
44
44
|
return {
|
|
45
|
-
...
|
|
45
|
+
...o,
|
|
46
46
|
// TODO: check if this is correct. Should it be optional?
|
|
47
|
-
email:
|
|
48
|
-
email_verified:
|
|
49
|
-
is_social:
|
|
47
|
+
email: o.email || "",
|
|
48
|
+
email_verified: o.email_verified === 1,
|
|
49
|
+
is_social: o.is_social === 1
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function f(t) {
|
|
54
54
|
const e = { ...t };
|
|
55
55
|
for (const a in e)
|
|
56
|
-
e[a] === null ? delete e[a] : typeof e[a] == "object" && (Array.isArray(e[a]) ? e[a] = e[a].map(
|
|
56
|
+
e[a] === null ? delete e[a] : typeof e[a] == "object" && (Array.isArray(e[a]) ? e[a] = e[a].map(f) : e[a] = f(e[a]));
|
|
57
57
|
return e;
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function pe(t) {
|
|
60
60
|
let e = {};
|
|
61
61
|
try {
|
|
62
62
|
e = JSON.parse(t.profileData || "{}");
|
|
@@ -66,7 +66,7 @@ function fe(t) {
|
|
|
66
66
|
return {
|
|
67
67
|
connection: t.connection,
|
|
68
68
|
provider: t.provider,
|
|
69
|
-
user_id:
|
|
69
|
+
user_id: Z(t.user_id).id,
|
|
70
70
|
isSocial: !!t.is_social,
|
|
71
71
|
profileData: {
|
|
72
72
|
email: t.email,
|
|
@@ -75,15 +75,15 @@ function fe(t) {
|
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function qe(t) {
|
|
79
79
|
return async (e, a) => {
|
|
80
|
-
const [r,
|
|
80
|
+
const [r, n] = await Promise.all([
|
|
81
81
|
t.selectFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", a).selectAll().executeTakeFirst(),
|
|
82
82
|
t.selectFrom("users").where("users.tenant_id", "=", e).where("users.linked_to", "=", a).selectAll().execute()
|
|
83
83
|
]);
|
|
84
84
|
if (!r)
|
|
85
85
|
return null;
|
|
86
|
-
const { tenant_id:
|
|
86
|
+
const { tenant_id: o, ...s } = r, c = {
|
|
87
87
|
...s,
|
|
88
88
|
email: r.email || "",
|
|
89
89
|
email_verified: r.email_verified === 1,
|
|
@@ -94,53 +94,53 @@ function Qe(t) {
|
|
|
94
94
|
{
|
|
95
95
|
connection: r.connection,
|
|
96
96
|
provider: r.provider,
|
|
97
|
-
user_id:
|
|
97
|
+
user_id: Z(r.user_id).id,
|
|
98
98
|
isSocial: !!r.is_social
|
|
99
99
|
},
|
|
100
|
-
...
|
|
100
|
+
...n.map(pe)
|
|
101
101
|
]
|
|
102
102
|
};
|
|
103
|
-
return
|
|
103
|
+
return f(c);
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
return a.split(/\s+/).map((
|
|
108
|
-
let s =
|
|
109
|
-
return
|
|
110
|
-
}).forEach(({ key:
|
|
111
|
-
if (
|
|
106
|
+
function T(t, e, a, r) {
|
|
107
|
+
return a.split(/\s+/).map((o) => o.replace(/^([^:]+)=/g, "$1:")).map((o) => {
|
|
108
|
+
let s = o.startsWith("-"), c, d, h, m;
|
|
109
|
+
return o.startsWith("-_exists_:") ? (c = o.substring(10), h = !0, s = !0) : o.startsWith("_exists_:") ? (c = o.substring(9), h = !0, s = !1) : o.includes(":") ? (s = o.startsWith("-"), [c, d] = s ? o.substring(1).split(":") : o.split(":"), h = !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 = "=") : (c = null, d = o, h = !1), { key: c, value: d, isNegation: s, isExistsQuery: h, operator: m };
|
|
110
|
+
}).forEach(({ key: o, value: s, isNegation: c, isExistsQuery: d, operator: h }) => {
|
|
111
|
+
if (o)
|
|
112
112
|
if (d)
|
|
113
|
-
|
|
114
|
-
else if (
|
|
115
|
-
switch (
|
|
113
|
+
c ? e = e.where(o, "is", null) : e = e.where(o, "is not", null);
|
|
114
|
+
else if (c)
|
|
115
|
+
switch (h) {
|
|
116
116
|
case ">":
|
|
117
|
-
e = e.where(
|
|
117
|
+
e = e.where(o, "<=", s);
|
|
118
118
|
break;
|
|
119
119
|
case ">=":
|
|
120
|
-
e = e.where(
|
|
120
|
+
e = e.where(o, "<", s);
|
|
121
121
|
break;
|
|
122
122
|
case "<":
|
|
123
|
-
e = e.where(
|
|
123
|
+
e = e.where(o, ">=", s);
|
|
124
124
|
break;
|
|
125
125
|
case "<=":
|
|
126
|
-
e = e.where(
|
|
126
|
+
e = e.where(o, ">", s);
|
|
127
127
|
break;
|
|
128
128
|
default:
|
|
129
|
-
e = e.where(
|
|
129
|
+
e = e.where(o, "!=", s);
|
|
130
130
|
}
|
|
131
131
|
else
|
|
132
|
-
e = e.where(
|
|
132
|
+
e = e.where(o, h, s);
|
|
133
133
|
else {
|
|
134
134
|
const { ref: m } = t.dynamic;
|
|
135
135
|
e = e.where(
|
|
136
136
|
(w) => w.or(
|
|
137
|
-
r.map((
|
|
137
|
+
r.map((x) => w(m(x), "like", `%${s}%`))
|
|
138
138
|
)
|
|
139
139
|
);
|
|
140
140
|
}
|
|
141
141
|
}), e;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function b(t) {
|
|
144
144
|
return typeof t == "string" ? parseInt(t, 10) : typeof t == "bigint" ? Number(t) : t;
|
|
145
145
|
}
|
|
146
146
|
function Ve(t) {
|
|
@@ -150,15 +150,15 @@ function Ve(t) {
|
|
|
150
150
|
include_totals: !1
|
|
151
151
|
}) => {
|
|
152
152
|
let r = t.selectFrom("users").where("users.tenant_id", "=", e);
|
|
153
|
-
if (a.q && (r =
|
|
153
|
+
if (a.q && (r = T(t, r, a.q, ["email", "name"])), a.sort && a.sort.sort_by) {
|
|
154
154
|
const { ref: m } = t.dynamic;
|
|
155
155
|
r = r.orderBy(m(a.sort.sort_by), a.sort.sort_order);
|
|
156
156
|
}
|
|
157
|
-
const
|
|
158
|
-
const w =
|
|
159
|
-
(
|
|
157
|
+
const o = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), s = o.map((m) => m.user_id), c = s.length ? await t.selectFrom("users").selectAll().where("users.tenant_id", "=", e).where("users.linked_to", "in", s).execute() : [], d = o.map((m) => {
|
|
158
|
+
const w = c.filter(
|
|
159
|
+
(x) => x.linked_to === m.user_id
|
|
160
160
|
);
|
|
161
|
-
return
|
|
161
|
+
return f({
|
|
162
162
|
...m,
|
|
163
163
|
email_verified: m.email_verified === 1,
|
|
164
164
|
is_social: m.is_social === 1,
|
|
@@ -168,66 +168,66 @@ function Ve(t) {
|
|
|
168
168
|
{
|
|
169
169
|
connection: m.connection,
|
|
170
170
|
provider: m.provider,
|
|
171
|
-
user_id:
|
|
171
|
+
user_id: Z(m.user_id).id,
|
|
172
172
|
isSocial: !!m.is_social
|
|
173
173
|
},
|
|
174
|
-
...w.map(
|
|
174
|
+
...w.map(pe)
|
|
175
175
|
]
|
|
176
176
|
});
|
|
177
|
-
}), { count:
|
|
177
|
+
}), { count: h } = await r.select((m) => m.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
178
178
|
return {
|
|
179
179
|
users: d,
|
|
180
180
|
start: a.page * a.per_page,
|
|
181
181
|
limit: a.per_page,
|
|
182
|
-
length:
|
|
182
|
+
length: b(h)
|
|
183
183
|
};
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
186
|
function We(t) {
|
|
187
187
|
return async (e, a) => (await t.deleteFrom("users").where("users.tenant_id", "=", e).where("users.linked_to", "=", a).execute(), (await t.deleteFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", a).execute()).length === 1);
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
function Ge(t) {
|
|
190
190
|
if (t.email_verified !== void 0)
|
|
191
191
|
return t.email_verified ? 1 : 0;
|
|
192
192
|
}
|
|
193
|
-
function
|
|
193
|
+
function He(t) {
|
|
194
194
|
return async (e, a, r) => {
|
|
195
|
-
const
|
|
195
|
+
const n = {
|
|
196
196
|
...r,
|
|
197
|
-
email_verified:
|
|
197
|
+
email_verified: Ge(r),
|
|
198
198
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
199
199
|
};
|
|
200
|
-
return r.app_metadata && (
|
|
200
|
+
return r.app_metadata && (n.app_metadata = JSON.stringify(r.app_metadata)), r.user_metadata && (n.user_metadata = JSON.stringify(r.user_metadata)), (await t.updateTable("users").set(n).where("users.tenant_id", "=", e).where("users.user_id", "=", a).execute()).length === 1;
|
|
201
201
|
};
|
|
202
202
|
}
|
|
203
|
-
function
|
|
204
|
-
return async (e, a, r,
|
|
205
|
-
const
|
|
206
|
-
return (await t.updateTable("users").set(
|
|
203
|
+
function Xe(t) {
|
|
204
|
+
return async (e, a, r, n) => {
|
|
205
|
+
const o = { linked_to: null };
|
|
206
|
+
return (await t.updateTable("users").set(o).where("users.tenant_id", "=", e).where("users.user_id", "=", `${r}|${n}`).where("users.linked_to", "=", `${a}`).execute()).length === 1;
|
|
207
207
|
};
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function Ye(t) {
|
|
210
210
|
return {
|
|
211
|
-
create:
|
|
211
|
+
create: Qe(t),
|
|
212
212
|
remove: We(t),
|
|
213
|
-
get:
|
|
213
|
+
get: qe(t),
|
|
214
214
|
list: Ve(t),
|
|
215
|
-
update:
|
|
215
|
+
update: He(t),
|
|
216
216
|
// TODO - think about this more when other issues fixed
|
|
217
|
-
unlink:
|
|
217
|
+
unlink: Xe(t)
|
|
218
218
|
};
|
|
219
219
|
}
|
|
220
|
-
const
|
|
221
|
-
let
|
|
220
|
+
const Ze = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
221
|
+
let S = (t = 21) => {
|
|
222
222
|
let e = "", a = crypto.getRandomValues(new Uint8Array(t));
|
|
223
223
|
for (; t--; )
|
|
224
|
-
e +=
|
|
224
|
+
e += Ze[a[t] & 63];
|
|
225
225
|
return e;
|
|
226
226
|
};
|
|
227
|
-
function
|
|
227
|
+
function et(t) {
|
|
228
228
|
return async (e) => {
|
|
229
229
|
const a = {
|
|
230
|
-
id: e.id ||
|
|
230
|
+
id: e.id || S(),
|
|
231
231
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
232
232
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
233
233
|
...e
|
|
@@ -235,13 +235,13 @@ function Ze(t) {
|
|
|
235
235
|
return await t.insertInto("tenants").values(a).execute(), a;
|
|
236
236
|
};
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function tt(t) {
|
|
239
239
|
return async (e) => {
|
|
240
240
|
const a = await t.selectFrom("tenants").where("tenants.id", "=", e).selectAll().executeTakeFirst();
|
|
241
|
-
return a ?
|
|
241
|
+
return a ? f(a) : null;
|
|
242
242
|
};
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function at(t) {
|
|
245
245
|
return async (e = {
|
|
246
246
|
page: 0,
|
|
247
247
|
per_page: 50,
|
|
@@ -249,25 +249,25 @@ function tt(t) {
|
|
|
249
249
|
}) => {
|
|
250
250
|
let a = t.selectFrom("tenants");
|
|
251
251
|
if (e.sort && e.sort.sort_by) {
|
|
252
|
-
const { ref:
|
|
253
|
-
a = a.orderBy(
|
|
252
|
+
const { ref: c } = t.dynamic;
|
|
253
|
+
a = a.orderBy(c(e.sort.sort_by), e.sort.sort_order);
|
|
254
254
|
}
|
|
255
|
-
e.q && (a = a.where((
|
|
256
|
-
const
|
|
255
|
+
e.q && (a = a.where((c) => c.or([c("name", "like", `%${e.q}%`)])));
|
|
256
|
+
const n = await a.offset(e.page * e.per_page).limit(e.per_page).selectAll().execute();
|
|
257
257
|
if (!e.include_totals)
|
|
258
258
|
return {
|
|
259
|
-
tenants:
|
|
259
|
+
tenants: n
|
|
260
260
|
};
|
|
261
|
-
const { count:
|
|
261
|
+
const { count: o } = await a.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), s = b(o);
|
|
262
262
|
return {
|
|
263
|
-
tenants:
|
|
263
|
+
tenants: n.map(f),
|
|
264
264
|
start: (e.page - 1) * e.per_page,
|
|
265
265
|
limit: e.per_page,
|
|
266
266
|
length: s
|
|
267
267
|
};
|
|
268
268
|
};
|
|
269
269
|
}
|
|
270
|
-
function
|
|
270
|
+
function rt(t) {
|
|
271
271
|
return async (e, a) => {
|
|
272
272
|
const r = {
|
|
273
273
|
...a,
|
|
@@ -277,43 +277,43 @@ function at(t) {
|
|
|
277
277
|
await t.updateTable("tenants").set(r).where("id", "=", e).execute();
|
|
278
278
|
};
|
|
279
279
|
}
|
|
280
|
-
function
|
|
280
|
+
function nt(t) {
|
|
281
281
|
return async (e) => (await t.deleteFrom("tenants").where("tenants.id", "=", e).execute()).length === 1;
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function ot(t) {
|
|
284
284
|
return {
|
|
285
|
-
create:
|
|
286
|
-
get:
|
|
287
|
-
list:
|
|
288
|
-
update:
|
|
289
|
-
remove:
|
|
285
|
+
create: et(t),
|
|
286
|
+
get: tt(t),
|
|
287
|
+
list: at(t),
|
|
288
|
+
update: rt(t),
|
|
289
|
+
remove: nt(t)
|
|
290
290
|
};
|
|
291
291
|
}
|
|
292
|
-
function
|
|
292
|
+
function me(t) {
|
|
293
293
|
return t ? JSON.stringify(t) : void 0;
|
|
294
294
|
}
|
|
295
|
-
const
|
|
296
|
-
function
|
|
295
|
+
const st = 1024;
|
|
296
|
+
function it(t) {
|
|
297
297
|
return async (e, a) => {
|
|
298
|
-
var
|
|
298
|
+
var n, o, s;
|
|
299
299
|
const r = {
|
|
300
|
-
id:
|
|
300
|
+
id: S(),
|
|
301
301
|
...a,
|
|
302
|
-
user_agent: a.user_agent.slice(0,
|
|
302
|
+
user_agent: a.user_agent.slice(0, st)
|
|
303
303
|
};
|
|
304
304
|
return await t.insertInto("logs").values({
|
|
305
305
|
...r,
|
|
306
306
|
// Truncate long strings to avoid database errors
|
|
307
|
-
description: (
|
|
307
|
+
description: (n = r.description) == null ? void 0 : n.substring(0, 256),
|
|
308
308
|
isMobile: a.isMobile ? 1 : 0,
|
|
309
309
|
tenant_id: e,
|
|
310
|
-
scope: (
|
|
311
|
-
auth0_client:
|
|
312
|
-
details: (s =
|
|
310
|
+
scope: (o = a.scope) == null ? void 0 : o.join(","),
|
|
311
|
+
auth0_client: me(a.auth0_client),
|
|
312
|
+
details: (s = me(a.details)) == null ? void 0 : s.substring(0, 8192)
|
|
313
313
|
}).execute(), r;
|
|
314
314
|
};
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function he(t) {
|
|
317
317
|
if (!t)
|
|
318
318
|
return "";
|
|
319
319
|
try {
|
|
@@ -322,72 +322,72 @@ function me(t) {
|
|
|
322
322
|
return t;
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function ge(t) {
|
|
326
326
|
return {
|
|
327
327
|
...t,
|
|
328
328
|
client_id: t.client_id,
|
|
329
329
|
client_name: "",
|
|
330
|
-
auth0_client:
|
|
331
|
-
details:
|
|
330
|
+
auth0_client: he(t.auth0_client),
|
|
331
|
+
details: he(t.details),
|
|
332
332
|
isMobile: !!t.isMobile,
|
|
333
333
|
scope: t.scope ? t.scope.split(",") : void 0,
|
|
334
334
|
log_id: t.id,
|
|
335
335
|
_id: t.id
|
|
336
336
|
};
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function dt(t) {
|
|
339
339
|
return async (e, a = {
|
|
340
340
|
page: 0,
|
|
341
341
|
per_page: 50,
|
|
342
342
|
include_totals: !1
|
|
343
343
|
}) => {
|
|
344
344
|
let r = t.selectFrom("logs").where("logs.tenant_id", "=", e);
|
|
345
|
-
a.q && (r =
|
|
346
|
-
let
|
|
345
|
+
a.q && (r = T(t, r, a.q, ["user_id", "ip"]));
|
|
346
|
+
let n = r;
|
|
347
347
|
if (a.sort && a.sort.sort_by) {
|
|
348
|
-
const { ref:
|
|
349
|
-
|
|
350
|
-
|
|
348
|
+
const { ref: c } = t.dynamic;
|
|
349
|
+
n = n.orderBy(
|
|
350
|
+
c(a.sort.sort_by),
|
|
351
351
|
a.sort.sort_order
|
|
352
352
|
);
|
|
353
353
|
}
|
|
354
|
-
|
|
355
|
-
const
|
|
354
|
+
n = n.offset(a.page * a.per_page).limit(a.per_page);
|
|
355
|
+
const o = await n.selectAll().execute(), { count: s } = await r.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
356
356
|
return {
|
|
357
|
-
logs:
|
|
357
|
+
logs: o.map(ge),
|
|
358
358
|
start: a.page * a.per_page,
|
|
359
359
|
limit: a.per_page,
|
|
360
|
-
length:
|
|
360
|
+
length: b(s)
|
|
361
361
|
};
|
|
362
362
|
};
|
|
363
363
|
}
|
|
364
|
-
function
|
|
364
|
+
function ct(t) {
|
|
365
365
|
return async (e, a) => {
|
|
366
366
|
const r = await t.selectFrom("logs").where("logs.tenant_id", "=", e).where("logs.id", "=", a).selectAll().executeTakeFirst();
|
|
367
|
-
return r ?
|
|
367
|
+
return r ? ge(r) : null;
|
|
368
368
|
};
|
|
369
369
|
}
|
|
370
|
-
function
|
|
370
|
+
function lt(t) {
|
|
371
371
|
return {
|
|
372
|
-
create:
|
|
373
|
-
list:
|
|
374
|
-
get:
|
|
372
|
+
create: it(t),
|
|
373
|
+
list: dt(t),
|
|
374
|
+
get: ct(t)
|
|
375
375
|
};
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function ut(t) {
|
|
378
378
|
return async (e, a) => {
|
|
379
379
|
const r = await t.selectFrom("sessions").where("sessions.tenant_id", "=", e).where("sessions.id", "=", a).selectAll().executeTakeFirst();
|
|
380
380
|
if (!r)
|
|
381
381
|
return null;
|
|
382
|
-
const { tenant_id:
|
|
382
|
+
const { tenant_id: n, device: o, clients: s, ...c } = r;
|
|
383
383
|
return {
|
|
384
|
-
...
|
|
385
|
-
device: JSON.parse(
|
|
384
|
+
...c,
|
|
385
|
+
device: JSON.parse(o),
|
|
386
386
|
clients: JSON.parse(s)
|
|
387
387
|
};
|
|
388
388
|
};
|
|
389
389
|
}
|
|
390
|
-
function
|
|
390
|
+
function mt(t) {
|
|
391
391
|
return async (e, a) => {
|
|
392
392
|
const r = {
|
|
393
393
|
...a,
|
|
@@ -404,69 +404,69 @@ function ut(t) {
|
|
|
404
404
|
}).execute(), r;
|
|
405
405
|
};
|
|
406
406
|
}
|
|
407
|
-
function
|
|
407
|
+
function ht(t) {
|
|
408
408
|
return async (e, a) => !!(await t.deleteFrom("sessions").where("tenant_id", "=", e).where("sessions.id", "=", a).execute()).length;
|
|
409
409
|
}
|
|
410
|
-
function
|
|
410
|
+
function _t(t) {
|
|
411
411
|
return async (e, a, r) => {
|
|
412
|
-
const
|
|
412
|
+
const n = {
|
|
413
413
|
...r,
|
|
414
414
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
415
415
|
device: r.device ? JSON.stringify(r.device) : void 0,
|
|
416
416
|
clients: r.clients ? JSON.stringify(r.clients) : void 0
|
|
417
417
|
};
|
|
418
|
-
return !!(await t.updateTable("sessions").set(
|
|
418
|
+
return !!(await t.updateTable("sessions").set(n).where("tenant_id", "=", e).where("sessions.id", "=", a).execute()).length;
|
|
419
419
|
};
|
|
420
420
|
}
|
|
421
|
-
function
|
|
421
|
+
function ft(t) {
|
|
422
422
|
return async (e, a = {
|
|
423
423
|
page: 0,
|
|
424
424
|
per_page: 50,
|
|
425
425
|
include_totals: !1
|
|
426
426
|
}) => {
|
|
427
427
|
let r = t.selectFrom("sessions").where("sessions.tenant_id", "=", e);
|
|
428
|
-
a.q && (r =
|
|
429
|
-
let
|
|
428
|
+
a.q && (r = T(t, r, a.q, ["user_id", "session_id"]));
|
|
429
|
+
let n = r;
|
|
430
430
|
if (a.sort && a.sort.sort_by) {
|
|
431
431
|
const { ref: d } = t.dynamic;
|
|
432
|
-
|
|
432
|
+
n = n.orderBy(
|
|
433
433
|
d(a.sort.sort_by),
|
|
434
434
|
a.sort.sort_order
|
|
435
435
|
);
|
|
436
436
|
}
|
|
437
|
-
|
|
438
|
-
const
|
|
437
|
+
n = n.offset(a.page * a.per_page).limit(a.per_page);
|
|
438
|
+
const o = await n.selectAll().execute(), { count: s } = await r.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), c = b(s);
|
|
439
439
|
return {
|
|
440
|
-
sessions:
|
|
440
|
+
sessions: o.map((d) => ({
|
|
441
441
|
...d,
|
|
442
442
|
device: JSON.parse(d.device),
|
|
443
443
|
clients: JSON.parse(d.clients)
|
|
444
444
|
})),
|
|
445
445
|
start: a.page * a.per_page,
|
|
446
446
|
limit: a.per_page,
|
|
447
|
-
length:
|
|
447
|
+
length: c
|
|
448
448
|
};
|
|
449
449
|
};
|
|
450
450
|
}
|
|
451
|
-
function
|
|
451
|
+
function pt(t) {
|
|
452
452
|
return {
|
|
453
|
-
create:
|
|
454
|
-
get:
|
|
455
|
-
list:
|
|
456
|
-
remove:
|
|
457
|
-
update:
|
|
453
|
+
create: mt(t),
|
|
454
|
+
get: ut(t),
|
|
455
|
+
list: ft(t),
|
|
456
|
+
remove: ht(t),
|
|
457
|
+
update: _t(t)
|
|
458
458
|
};
|
|
459
459
|
}
|
|
460
|
-
function
|
|
460
|
+
function gt(t) {
|
|
461
461
|
return async (e, a) => {
|
|
462
462
|
const r = await t.selectFrom("passwords").where("passwords.tenant_id", "=", e).where("passwords.user_id", "=", a).selectAll().executeTakeFirst();
|
|
463
463
|
if (!r)
|
|
464
464
|
return null;
|
|
465
|
-
const { tenant_id:
|
|
466
|
-
return
|
|
465
|
+
const { tenant_id: n, ...o } = r;
|
|
466
|
+
return o;
|
|
467
467
|
};
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function yt(t) {
|
|
470
470
|
return async (e, a) => {
|
|
471
471
|
const r = {
|
|
472
472
|
...a,
|
|
@@ -479,40 +479,40 @@ function gt(t) {
|
|
|
479
479
|
}).execute(), r;
|
|
480
480
|
};
|
|
481
481
|
}
|
|
482
|
-
function
|
|
482
|
+
function wt(t) {
|
|
483
483
|
return async (e, a) => (await t.updateTable("passwords").set({
|
|
484
484
|
password: a.password,
|
|
485
485
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
486
486
|
}).where("tenant_id", "=", e).where("user_id", "=", a.user_id).execute()).length === 1;
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function vt(t) {
|
|
489
489
|
return {
|
|
490
|
-
create:
|
|
491
|
-
update:
|
|
492
|
-
get:
|
|
490
|
+
create: yt(t),
|
|
491
|
+
update: wt(t),
|
|
492
|
+
get: gt(t)
|
|
493
493
|
};
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function Nt(t) {
|
|
496
496
|
return async (e, a = {
|
|
497
497
|
page: 0,
|
|
498
498
|
per_page: 50,
|
|
499
499
|
include_totals: !1
|
|
500
500
|
}) => {
|
|
501
501
|
let r = t.selectFrom("codes").where("codes.tenant_id", "=", e);
|
|
502
|
-
a.q && (r =
|
|
503
|
-
const
|
|
502
|
+
a.q && (r = T(t, r, a.q, ["code", "login_id"]));
|
|
503
|
+
const o = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), { count: s } = await r.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
504
504
|
return {
|
|
505
|
-
codes:
|
|
506
|
-
const { tenant_id:
|
|
507
|
-
return
|
|
505
|
+
codes: o.map((d) => {
|
|
506
|
+
const { tenant_id: h, ...m } = d;
|
|
507
|
+
return Ke.parse(f(m));
|
|
508
508
|
}),
|
|
509
509
|
start: a.page * a.per_page,
|
|
510
510
|
limit: a.per_page,
|
|
511
|
-
length:
|
|
511
|
+
length: b(s)
|
|
512
512
|
};
|
|
513
513
|
};
|
|
514
514
|
}
|
|
515
|
-
function
|
|
515
|
+
function Ct(t) {
|
|
516
516
|
return async (e, a) => {
|
|
517
517
|
const r = {
|
|
518
518
|
...a,
|
|
@@ -524,67 +524,67 @@ function Nt(t) {
|
|
|
524
524
|
}).execute(), r;
|
|
525
525
|
};
|
|
526
526
|
}
|
|
527
|
-
function
|
|
527
|
+
function bt(t) {
|
|
528
528
|
return async (e, a) => (await t.deleteFrom("codes").where("codes.tenant_id", "=", e).where("codes.code_id", "=", a).executeTakeFirst()).numDeletedRows > 0;
|
|
529
529
|
}
|
|
530
|
-
function
|
|
530
|
+
function xt(t) {
|
|
531
531
|
return async (e, a, r) => {
|
|
532
|
-
let
|
|
533
|
-
e.length && (
|
|
534
|
-
const
|
|
535
|
-
return
|
|
532
|
+
let n = t.selectFrom("codes").where("codes.code_id", "=", a).where("codes.code_type", "=", r);
|
|
533
|
+
e.length && (n = n.where("codes.tenant_id", "=", e));
|
|
534
|
+
const o = await n.selectAll().executeTakeFirst();
|
|
535
|
+
return o ? f(o) : null;
|
|
536
536
|
};
|
|
537
537
|
}
|
|
538
|
-
function
|
|
538
|
+
function Tt(t) {
|
|
539
539
|
return async (e, a) => (await t.updateTable("codes").set({ used_at: (/* @__PURE__ */ new Date()).toISOString() }).where("codes.tenant_id", "=", e).where("codes.code_id", "=", a).executeTakeFirst()).numUpdatedRows > 0;
|
|
540
540
|
}
|
|
541
|
-
function
|
|
541
|
+
function St(t) {
|
|
542
542
|
return {
|
|
543
|
-
create:
|
|
544
|
-
list:
|
|
545
|
-
remove:
|
|
546
|
-
used:
|
|
547
|
-
get:
|
|
543
|
+
create: Ct(t),
|
|
544
|
+
list: Nt(t),
|
|
545
|
+
remove: bt(t),
|
|
546
|
+
used: Tt(t),
|
|
547
|
+
get: xt(t)
|
|
548
548
|
};
|
|
549
549
|
}
|
|
550
|
-
function
|
|
550
|
+
function Ot(t) {
|
|
551
551
|
return async (e, a) => {
|
|
552
552
|
const r = {
|
|
553
553
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
554
554
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
555
555
|
...a
|
|
556
|
-
},
|
|
556
|
+
}, n = JSON.stringify(a.allowed_origins), o = JSON.stringify(a.callbacks), s = JSON.stringify(a.web_origins), c = JSON.stringify(a.allowed_logout_urls), d = JSON.stringify(a.allowed_clients);
|
|
557
557
|
return await t.insertInto("applications").values({
|
|
558
558
|
...r,
|
|
559
559
|
tenant_id: e,
|
|
560
560
|
disable_sign_ups: a.disable_sign_ups ? 1 : 0,
|
|
561
561
|
addons: a.addons ? JSON.stringify(a.addons) : "{}",
|
|
562
|
-
callbacks:
|
|
563
|
-
allowed_origins:
|
|
562
|
+
callbacks: o,
|
|
563
|
+
allowed_origins: n,
|
|
564
564
|
web_origins: s,
|
|
565
|
-
allowed_logout_urls:
|
|
565
|
+
allowed_logout_urls: c,
|
|
566
566
|
allowed_clients: d
|
|
567
567
|
}).execute(), r;
|
|
568
568
|
};
|
|
569
569
|
}
|
|
570
|
-
function
|
|
570
|
+
function kt(t) {
|
|
571
571
|
return async (e) => ({
|
|
572
|
-
applications: (await t.selectFrom("applications").where("applications.tenant_id", "=", e).selectAll().execute()).map((
|
|
573
|
-
...
|
|
574
|
-
disable_sign_ups: !!
|
|
575
|
-
addons:
|
|
576
|
-
callbacks:
|
|
577
|
-
allowed_origins:
|
|
578
|
-
web_origins:
|
|
579
|
-
allowed_logout_urls:
|
|
580
|
-
allowed_clients:
|
|
572
|
+
applications: (await t.selectFrom("applications").where("applications.tenant_id", "=", e).selectAll().execute()).map((o) => ({
|
|
573
|
+
...o,
|
|
574
|
+
disable_sign_ups: !!o.disable_sign_ups,
|
|
575
|
+
addons: o.addons ? JSON.parse(o.addons) : {},
|
|
576
|
+
callbacks: o.callbacks ? JSON.parse(o.callbacks) : [],
|
|
577
|
+
allowed_origins: o.allowed_origins ? JSON.parse(o.allowed_origins) : [],
|
|
578
|
+
web_origins: o.web_origins ? JSON.parse(o.web_origins) : [],
|
|
579
|
+
allowed_logout_urls: o.allowed_logout_urls ? JSON.parse(o.allowed_logout_urls) : [],
|
|
580
|
+
allowed_clients: o.allowed_logout_urls ? JSON.parse(o.allowed_logout_urls) : []
|
|
581
581
|
}))
|
|
582
582
|
});
|
|
583
583
|
}
|
|
584
|
-
function
|
|
584
|
+
function $t(t) {
|
|
585
585
|
return async (e, a) => {
|
|
586
586
|
const r = await t.selectFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", a).selectAll().executeTakeFirst();
|
|
587
|
-
return r ?
|
|
587
|
+
return r ? f({
|
|
588
588
|
...r,
|
|
589
589
|
disable_sign_ups: !!r.disable_sign_ups,
|
|
590
590
|
addons: JSON.parse(r.addons),
|
|
@@ -595,12 +595,12 @@ function kt(t) {
|
|
|
595
595
|
}) : null;
|
|
596
596
|
};
|
|
597
597
|
}
|
|
598
|
-
function
|
|
598
|
+
function Dt(t) {
|
|
599
599
|
return async (e, a) => (await t.deleteFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", a).executeTakeFirst()).numDeletedRows > 0;
|
|
600
600
|
}
|
|
601
|
-
function
|
|
601
|
+
function It(t) {
|
|
602
602
|
return async (e, a, r) => {
|
|
603
|
-
const
|
|
603
|
+
const n = {
|
|
604
604
|
...r,
|
|
605
605
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
606
606
|
allowed_origins: r.allowed_origins ? JSON.stringify(r.allowed_origins) : void 0,
|
|
@@ -611,22 +611,22 @@ function Dt(t) {
|
|
|
611
611
|
addons: r.addons ? JSON.stringify(r.addons) : "{}",
|
|
612
612
|
disable_sign_ups: r.disable_sign_ups ? 1 : 0
|
|
613
613
|
};
|
|
614
|
-
return await t.updateTable("applications").set(
|
|
614
|
+
return await t.updateTable("applications").set(n).where("applications.id", "=", a).where("applications.tenant_id", "=", e).execute(), !0;
|
|
615
615
|
};
|
|
616
616
|
}
|
|
617
|
-
function
|
|
617
|
+
function Pt(t) {
|
|
618
618
|
return {
|
|
619
|
-
create:
|
|
620
|
-
list:
|
|
621
|
-
get:
|
|
622
|
-
remove:
|
|
623
|
-
update:
|
|
619
|
+
create: Ot(t),
|
|
620
|
+
list: kt(t),
|
|
621
|
+
get: $t(t),
|
|
622
|
+
remove: Dt(t),
|
|
623
|
+
update: It(t)
|
|
624
624
|
};
|
|
625
625
|
}
|
|
626
|
-
function
|
|
626
|
+
function jt(t) {
|
|
627
627
|
return async (e, a) => {
|
|
628
628
|
const r = {
|
|
629
|
-
id:
|
|
629
|
+
id: S(),
|
|
630
630
|
...a,
|
|
631
631
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
632
632
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -639,62 +639,62 @@ function Pt(t) {
|
|
|
639
639
|
}).execute(), r;
|
|
640
640
|
};
|
|
641
641
|
}
|
|
642
|
-
function
|
|
642
|
+
function Mt(t) {
|
|
643
643
|
return async (e, a = {
|
|
644
644
|
page: 0,
|
|
645
645
|
per_page: 50,
|
|
646
646
|
include_totals: !1
|
|
647
647
|
}) => {
|
|
648
648
|
let r = t.selectFrom("connections").where("connections.tenant_id", "=", e);
|
|
649
|
-
a.q && (r =
|
|
649
|
+
a.q && (r = T(t, r, a.q, ["user_id", "ip"]));
|
|
650
650
|
const s = (await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute()).map(
|
|
651
|
-
(d) =>
|
|
651
|
+
(d) => f({
|
|
652
652
|
...d,
|
|
653
653
|
options: JSON.parse(d.options)
|
|
654
654
|
})
|
|
655
|
-
), { count:
|
|
655
|
+
), { count: c } = await r.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
656
656
|
return {
|
|
657
657
|
connections: s,
|
|
658
658
|
start: a.page * a.per_page,
|
|
659
659
|
limit: a.per_page,
|
|
660
|
-
length:
|
|
660
|
+
length: b(c)
|
|
661
661
|
};
|
|
662
662
|
};
|
|
663
663
|
}
|
|
664
|
-
function
|
|
664
|
+
function Ft(t) {
|
|
665
665
|
return async (e, a) => (await t.deleteFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", a).executeTakeFirst()).numDeletedRows > 0;
|
|
666
666
|
}
|
|
667
|
-
function
|
|
667
|
+
function At(t) {
|
|
668
668
|
return async (e, a) => {
|
|
669
669
|
const r = await t.selectFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", a).selectAll().executeTakeFirst();
|
|
670
|
-
return r ?
|
|
670
|
+
return r ? f({
|
|
671
671
|
...r,
|
|
672
672
|
options: JSON.parse(r.options)
|
|
673
673
|
}) : null;
|
|
674
674
|
};
|
|
675
675
|
}
|
|
676
|
-
function
|
|
676
|
+
function Lt(t) {
|
|
677
677
|
return async (e, a, r) => {
|
|
678
|
-
const
|
|
678
|
+
const n = {
|
|
679
679
|
...r,
|
|
680
680
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
681
681
|
};
|
|
682
682
|
return await t.updateTable("connections").set({
|
|
683
|
-
...
|
|
684
|
-
options:
|
|
683
|
+
...n,
|
|
684
|
+
options: n.options ? JSON.stringify(n.options) : void 0
|
|
685
685
|
}).where("connections.id", "=", a).where("connections.tenant_id", "=", e).execute(), !0;
|
|
686
686
|
};
|
|
687
687
|
}
|
|
688
|
-
function
|
|
688
|
+
function zt(t) {
|
|
689
689
|
return {
|
|
690
|
-
create:
|
|
691
|
-
get:
|
|
692
|
-
list:
|
|
693
|
-
remove:
|
|
694
|
-
update:
|
|
690
|
+
create: jt(t),
|
|
691
|
+
get: At(t),
|
|
692
|
+
list: Mt(t),
|
|
693
|
+
remove: Ft(t),
|
|
694
|
+
update: Lt(t)
|
|
695
695
|
};
|
|
696
696
|
}
|
|
697
|
-
function
|
|
697
|
+
function Jt(t) {
|
|
698
698
|
return {
|
|
699
699
|
get: async (e) => {
|
|
700
700
|
const a = await t.selectFrom("applications").selectAll().where("id", "=", e).executeTakeFirst();
|
|
@@ -703,12 +703,12 @@ function zt(t) {
|
|
|
703
703
|
const r = await t.selectFrom("tenants").selectAll().where("id", "=", a.tenant_id).executeTakeFirst();
|
|
704
704
|
if (!r)
|
|
705
705
|
throw new V(404, { message: "Tenant not found" });
|
|
706
|
-
const
|
|
706
|
+
const n = await t.selectFrom("connections").where("tenant_id", "=", a.tenant_id).selectAll().execute();
|
|
707
707
|
return {
|
|
708
708
|
...a,
|
|
709
|
-
connections:
|
|
710
|
-
(s) =>
|
|
711
|
-
|
|
709
|
+
connections: n.map(
|
|
710
|
+
(s) => Re.parse(
|
|
711
|
+
f({
|
|
712
712
|
...s,
|
|
713
713
|
options: s.options ? JSON.parse(s.options) : {}
|
|
714
714
|
})
|
|
@@ -720,7 +720,7 @@ function zt(t) {
|
|
|
720
720
|
web_origins: a.web_origins ? JSON.parse(a.web_origins) : [],
|
|
721
721
|
allowed_logout_urls: a.allowed_logout_urls ? JSON.parse(a.allowed_logout_urls) : [],
|
|
722
722
|
allowed_clients: a.allowed_clients ? JSON.parse(a.allowed_clients) : [],
|
|
723
|
-
tenant:
|
|
723
|
+
tenant: f(r),
|
|
724
724
|
// this is really an integer in the database
|
|
725
725
|
disable_sign_ups: !!a.disable_sign_ups
|
|
726
726
|
};
|
|
@@ -735,25 +735,25 @@ function Et(t) {
|
|
|
735
735
|
])
|
|
736
736
|
).selectAll().execute();
|
|
737
737
|
}
|
|
738
|
-
function
|
|
738
|
+
function Kt(t) {
|
|
739
739
|
return async (e) => {
|
|
740
740
|
await t.insertInto("keys").values({ ...e, created_at: (/* @__PURE__ */ new Date()).toDateString() }).execute();
|
|
741
741
|
};
|
|
742
742
|
}
|
|
743
|
-
function
|
|
743
|
+
function Rt(t) {
|
|
744
744
|
return async (e, a) => !!(await t.updateTable("keys").set(a).where("kid", "=", e).execute()).length;
|
|
745
745
|
}
|
|
746
|
-
function
|
|
746
|
+
function Ut(t) {
|
|
747
747
|
return {
|
|
748
|
-
create:
|
|
748
|
+
create: Kt(t),
|
|
749
749
|
list: Et(t),
|
|
750
|
-
update:
|
|
750
|
+
update: Rt(t)
|
|
751
751
|
};
|
|
752
752
|
}
|
|
753
|
-
function
|
|
753
|
+
function Bt(t) {
|
|
754
754
|
return async (e, a) => {
|
|
755
755
|
const r = {
|
|
756
|
-
custom_domain_id:
|
|
756
|
+
custom_domain_id: S(),
|
|
757
757
|
status: "pending",
|
|
758
758
|
primary: !1,
|
|
759
759
|
...a
|
|
@@ -767,13 +767,13 @@ function Ut(t) {
|
|
|
767
767
|
}).execute(), r;
|
|
768
768
|
};
|
|
769
769
|
}
|
|
770
|
-
function
|
|
770
|
+
function Qt(t) {
|
|
771
771
|
return async (e) => (await t.selectFrom("custom_domains").where("custom_domains.tenant_id", "=", e).selectAll().execute()).map((r) => ({
|
|
772
772
|
...r,
|
|
773
773
|
primary: r.primary === 1
|
|
774
774
|
}));
|
|
775
775
|
}
|
|
776
|
-
function
|
|
776
|
+
function qt(t) {
|
|
777
777
|
return async (e, a) => (await t.deleteFrom("custom_domains").where("custom_domains.tenant_id", "=", e).where("custom_domains.custom_domain_id", "=", a).execute()).length > 0;
|
|
778
778
|
}
|
|
779
779
|
function Vt(t) {
|
|
@@ -787,15 +787,15 @@ function Vt(t) {
|
|
|
787
787
|
}
|
|
788
788
|
function Wt(t) {
|
|
789
789
|
return async (e, a, r) => {
|
|
790
|
-
const
|
|
790
|
+
const n = {
|
|
791
791
|
...r,
|
|
792
792
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
793
793
|
primary: r.primary ? 1 : 0
|
|
794
794
|
};
|
|
795
|
-
return (await t.updateTable("custom_domains").set(
|
|
795
|
+
return (await t.updateTable("custom_domains").set(n).where("custom_domains.tenant_id", "=", e).where("custom_domains.custom_domain_id", "=", a).execute()).length > 0;
|
|
796
796
|
};
|
|
797
797
|
}
|
|
798
|
-
function
|
|
798
|
+
function Gt(t) {
|
|
799
799
|
return async (e) => {
|
|
800
800
|
const a = await t.selectFrom("custom_domains").where("custom_domains.domain", "=", e).selectAll().executeTakeFirst();
|
|
801
801
|
return a ? {
|
|
@@ -804,121 +804,121 @@ function qt(t) {
|
|
|
804
804
|
} : null;
|
|
805
805
|
};
|
|
806
806
|
}
|
|
807
|
-
function
|
|
807
|
+
function Ht(t) {
|
|
808
808
|
return {
|
|
809
|
-
create:
|
|
809
|
+
create: Bt(t),
|
|
810
810
|
get: Vt(t),
|
|
811
|
-
getByDomain:
|
|
812
|
-
list:
|
|
813
|
-
remove:
|
|
811
|
+
getByDomain: Gt(t),
|
|
812
|
+
list: Qt(t),
|
|
813
|
+
remove: qt(t),
|
|
814
814
|
update: Wt(t)
|
|
815
815
|
};
|
|
816
816
|
}
|
|
817
|
-
function
|
|
817
|
+
function Xt(t) {
|
|
818
818
|
return async (e) => {
|
|
819
819
|
const [a] = await t.selectFrom("branding").where("branding.tenant_id", "=", e).selectAll().execute();
|
|
820
820
|
if (!a)
|
|
821
821
|
return null;
|
|
822
822
|
const {
|
|
823
823
|
tenant_id: r,
|
|
824
|
-
colors_primary:
|
|
825
|
-
colors_page_background_type:
|
|
824
|
+
colors_primary: n,
|
|
825
|
+
colors_page_background_type: o,
|
|
826
826
|
colors_page_background_start: s,
|
|
827
|
-
colors_page_background_end:
|
|
827
|
+
colors_page_background_end: c,
|
|
828
828
|
colors_page_background_angle_dev: d,
|
|
829
|
-
font_url:
|
|
829
|
+
font_url: h,
|
|
830
830
|
...m
|
|
831
831
|
} = a;
|
|
832
|
-
return
|
|
832
|
+
return f({
|
|
833
833
|
...m,
|
|
834
834
|
colors: {
|
|
835
|
-
primary:
|
|
835
|
+
primary: n,
|
|
836
836
|
page_background: {
|
|
837
|
-
type:
|
|
837
|
+
type: o,
|
|
838
838
|
start: s,
|
|
839
|
-
end:
|
|
839
|
+
end: c,
|
|
840
840
|
angle_deg: d
|
|
841
841
|
}
|
|
842
842
|
},
|
|
843
|
-
font:
|
|
843
|
+
font: h ? { url: h } : void 0
|
|
844
844
|
});
|
|
845
845
|
};
|
|
846
846
|
}
|
|
847
|
-
function
|
|
847
|
+
function Yt(t) {
|
|
848
848
|
return async (e, a) => {
|
|
849
|
-
var s,
|
|
850
|
-
const { colors: r, font:
|
|
849
|
+
var s, c, d, h, m, w, x, ee, te, ae, re, ne, oe, se, ie, de, ce, le;
|
|
850
|
+
const { colors: r, font: n, ...o } = a;
|
|
851
851
|
try {
|
|
852
852
|
await t.insertInto("branding").values({
|
|
853
|
-
...
|
|
853
|
+
...o,
|
|
854
854
|
colors_primary: r == null ? void 0 : r.primary,
|
|
855
|
-
colors_page_background_type: (
|
|
856
|
-
colors_page_background_start: (
|
|
855
|
+
colors_page_background_type: (c = (s = a.colors) == null ? void 0 : s.page_background) == null ? void 0 : c.type,
|
|
856
|
+
colors_page_background_start: (h = (d = a.colors) == null ? void 0 : d.page_background) == null ? void 0 : h.start,
|
|
857
857
|
colors_page_background_end: (w = (m = a.colors) == null ? void 0 : m.page_background) == null ? void 0 : w.end,
|
|
858
|
-
colors_page_background_angle_dev: (
|
|
859
|
-
font_url: (
|
|
858
|
+
colors_page_background_angle_dev: (ee = (x = a.colors) == null ? void 0 : x.page_background) == null ? void 0 : ee.angle_deg,
|
|
859
|
+
font_url: (te = a.font) == null ? void 0 : te.url,
|
|
860
860
|
tenant_id: e
|
|
861
861
|
}).execute();
|
|
862
862
|
} catch {
|
|
863
863
|
await t.updateTable("branding").set({
|
|
864
|
-
...
|
|
864
|
+
...o,
|
|
865
865
|
colors_primary: r == null ? void 0 : r.primary,
|
|
866
|
-
colors_page_background_type: (
|
|
867
|
-
colors_page_background_start: (
|
|
868
|
-
colors_page_background_end: (
|
|
869
|
-
colors_page_background_angle_dev: (
|
|
870
|
-
font_url: (
|
|
866
|
+
colors_page_background_type: (re = (ae = a.colors) == null ? void 0 : ae.page_background) == null ? void 0 : re.type,
|
|
867
|
+
colors_page_background_start: (oe = (ne = a.colors) == null ? void 0 : ne.page_background) == null ? void 0 : oe.start,
|
|
868
|
+
colors_page_background_end: (ie = (se = a.colors) == null ? void 0 : se.page_background) == null ? void 0 : ie.end,
|
|
869
|
+
colors_page_background_angle_dev: (ce = (de = a.colors) == null ? void 0 : de.page_background) == null ? void 0 : ce.angle_deg,
|
|
870
|
+
font_url: (le = a.font) == null ? void 0 : le.url
|
|
871
871
|
}).where("tenant_id", "=", e).execute();
|
|
872
872
|
}
|
|
873
873
|
};
|
|
874
874
|
}
|
|
875
|
-
function
|
|
875
|
+
function Zt(t) {
|
|
876
876
|
return {
|
|
877
|
-
get:
|
|
878
|
-
set:
|
|
877
|
+
get: Xt(t),
|
|
878
|
+
set: Yt(t)
|
|
879
879
|
};
|
|
880
880
|
}
|
|
881
|
-
function
|
|
881
|
+
function ea(t) {
|
|
882
882
|
return async (e, a = {
|
|
883
883
|
page: 0,
|
|
884
884
|
per_page: 50,
|
|
885
885
|
include_totals: !1
|
|
886
886
|
}) => {
|
|
887
887
|
let r = t.selectFrom("hooks").where("hooks.tenant_id", "=", e);
|
|
888
|
-
a.q && (r =
|
|
889
|
-
const
|
|
888
|
+
a.q && (r = T(t, r, a.q, ["url"]));
|
|
889
|
+
const o = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), { count: s } = await r.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
890
890
|
return {
|
|
891
|
-
hooks:
|
|
892
|
-
const { tenant_id:
|
|
893
|
-
return
|
|
894
|
-
...
|
|
891
|
+
hooks: o.map((d) => {
|
|
892
|
+
const { tenant_id: h, enabled: m, synchronous: w, ...x } = d;
|
|
893
|
+
return f({
|
|
894
|
+
...x,
|
|
895
895
|
enabled: !!m,
|
|
896
896
|
synchronous: !!w
|
|
897
897
|
});
|
|
898
898
|
}),
|
|
899
899
|
start: a.page * a.per_page,
|
|
900
900
|
limit: a.per_page,
|
|
901
|
-
length:
|
|
901
|
+
length: b(s)
|
|
902
902
|
};
|
|
903
903
|
};
|
|
904
904
|
}
|
|
905
|
-
function
|
|
905
|
+
function ta(t) {
|
|
906
906
|
return async (e, a) => {
|
|
907
907
|
const r = await t.selectFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", a).selectAll().executeTakeFirst();
|
|
908
|
-
return r ?
|
|
908
|
+
return r ? f({
|
|
909
909
|
...r,
|
|
910
910
|
enabled: !!r.enabled,
|
|
911
911
|
synchronous: !!r.synchronous
|
|
912
912
|
}) : null;
|
|
913
913
|
};
|
|
914
914
|
}
|
|
915
|
-
function
|
|
915
|
+
function aa(t) {
|
|
916
916
|
return async (e, a) => (await t.deleteFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", a).executeTakeFirst()).numDeletedRows > 0;
|
|
917
917
|
}
|
|
918
|
-
function
|
|
918
|
+
function ra(t) {
|
|
919
919
|
return async (e, a) => {
|
|
920
920
|
const r = {
|
|
921
|
-
hook_id:
|
|
921
|
+
hook_id: S(),
|
|
922
922
|
...a,
|
|
923
923
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
924
924
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -931,128 +931,128 @@ function aa(t) {
|
|
|
931
931
|
}).execute(), r;
|
|
932
932
|
};
|
|
933
933
|
}
|
|
934
|
-
function
|
|
934
|
+
function na(t) {
|
|
935
935
|
return async (e, a, r) => {
|
|
936
|
-
const
|
|
936
|
+
const n = {
|
|
937
937
|
...r,
|
|
938
938
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
939
939
|
enabled: r.enabled !== void 0 ? r.enabled ? 1 : 0 : void 0,
|
|
940
940
|
synchronous: r.enabled !== void 0 ? r.synchronous ? 1 : 0 : void 0
|
|
941
941
|
};
|
|
942
|
-
return await t.updateTable("hooks").set(
|
|
942
|
+
return await t.updateTable("hooks").set(n).where("hooks.hook_id", "=", a).where("hooks.tenant_id", "=", e).execute(), !0;
|
|
943
943
|
};
|
|
944
944
|
}
|
|
945
|
-
function
|
|
945
|
+
function oa(t) {
|
|
946
946
|
return {
|
|
947
|
-
create:
|
|
948
|
-
get:
|
|
949
|
-
list:
|
|
950
|
-
update:
|
|
951
|
-
remove:
|
|
947
|
+
create: ra(t),
|
|
948
|
+
get: ta(t),
|
|
949
|
+
list: ea(t),
|
|
950
|
+
update: na(t),
|
|
951
|
+
remove: aa(t)
|
|
952
952
|
};
|
|
953
953
|
}
|
|
954
|
-
function
|
|
954
|
+
function J(t, e = "", a = {}) {
|
|
955
955
|
for (let r in t)
|
|
956
956
|
if (Object.prototype.hasOwnProperty.call(t, r)) {
|
|
957
|
-
const
|
|
958
|
-
typeof t[r] == "object" && t[r] !== null && !Array.isArray(t[r]) ?
|
|
957
|
+
const n = e ? `${e}_${r}` : r;
|
|
958
|
+
typeof t[r] == "object" && t[r] !== null && !Array.isArray(t[r]) ? J(t[r], n, a) : a[n] = t[r];
|
|
959
959
|
}
|
|
960
960
|
return a;
|
|
961
961
|
}
|
|
962
|
-
function
|
|
962
|
+
function sa(t, e) {
|
|
963
963
|
const a = {};
|
|
964
|
-
for (const [r,
|
|
965
|
-
const
|
|
964
|
+
for (const [r, n] of Object.entries(t)) {
|
|
965
|
+
const o = e.find(
|
|
966
966
|
(s) => r.startsWith(`${s}_`)
|
|
967
967
|
);
|
|
968
|
-
if (!
|
|
969
|
-
a[r] =
|
|
968
|
+
if (!o)
|
|
969
|
+
a[r] = n;
|
|
970
970
|
else {
|
|
971
|
-
const s = r.slice(
|
|
972
|
-
a[
|
|
973
|
-
...a[
|
|
974
|
-
[s]:
|
|
971
|
+
const s = r.slice(o.length + 1);
|
|
972
|
+
a[o] = {
|
|
973
|
+
...a[o],
|
|
974
|
+
[s]: n
|
|
975
975
|
};
|
|
976
976
|
}
|
|
977
977
|
}
|
|
978
978
|
return a;
|
|
979
979
|
}
|
|
980
|
-
function
|
|
980
|
+
function ia(t) {
|
|
981
981
|
return async (e, a) => {
|
|
982
982
|
const r = {
|
|
983
|
-
themeId:
|
|
983
|
+
themeId: S(),
|
|
984
984
|
...a,
|
|
985
985
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
986
986
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
987
987
|
};
|
|
988
|
-
return await t.insertInto("themes").values({ ...
|
|
988
|
+
return await t.insertInto("themes").values({ ...J(r), tenant_id: e }).execute(), r;
|
|
989
989
|
};
|
|
990
990
|
}
|
|
991
|
-
function
|
|
991
|
+
function da(t) {
|
|
992
992
|
return async (e, a) => (await t.deleteFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", a).executeTakeFirst()).numDeletedRows > 0;
|
|
993
993
|
}
|
|
994
|
-
function
|
|
994
|
+
function ca(t) {
|
|
995
995
|
return async (e, a) => {
|
|
996
996
|
const r = await t.selectFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", a).selectAll().executeTakeFirst();
|
|
997
|
-
return r ?
|
|
997
|
+
return r ? f(r) : null;
|
|
998
998
|
};
|
|
999
999
|
}
|
|
1000
|
-
function
|
|
1000
|
+
function la(t) {
|
|
1001
1001
|
return async (e, a, r) => {
|
|
1002
|
-
const
|
|
1002
|
+
const n = J({
|
|
1003
1003
|
...r,
|
|
1004
1004
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1005
1005
|
});
|
|
1006
|
-
return await t.updateTable("themes").set(
|
|
1006
|
+
return await t.updateTable("themes").set(n).where("themes.id", "=", a).where("themes.tenant_id", "=", e).execute(), !0;
|
|
1007
1007
|
};
|
|
1008
1008
|
}
|
|
1009
|
-
function
|
|
1009
|
+
function ua(t) {
|
|
1010
1010
|
return {
|
|
1011
|
-
create:
|
|
1012
|
-
get:
|
|
1013
|
-
remove:
|
|
1014
|
-
update:
|
|
1011
|
+
create: ia(t),
|
|
1012
|
+
get: ca(t),
|
|
1013
|
+
remove: da(t),
|
|
1014
|
+
update: la(t)
|
|
1015
1015
|
};
|
|
1016
1016
|
}
|
|
1017
|
-
function
|
|
1017
|
+
function ma(t) {
|
|
1018
1018
|
return async (e, a) => {
|
|
1019
|
-
const r = (/* @__PURE__ */ new Date()).toISOString(),
|
|
1020
|
-
return
|
|
1021
|
-
|
|
1019
|
+
const r = (/* @__PURE__ */ new Date()).toISOString(), n = await t.selectFrom("login_sessions").where("login_sessions.expires_at", ">", r).where("login_sessions.id", "=", a).selectAll().executeTakeFirst();
|
|
1020
|
+
return n ? Ue.parse(
|
|
1021
|
+
sa(f(n), ["authParams"])
|
|
1022
1022
|
) : null;
|
|
1023
1023
|
};
|
|
1024
1024
|
}
|
|
1025
|
-
function
|
|
1025
|
+
function ha(t) {
|
|
1026
1026
|
return async (e, a) => {
|
|
1027
|
-
var
|
|
1027
|
+
var n;
|
|
1028
1028
|
const r = {
|
|
1029
|
-
id:
|
|
1029
|
+
id: S(),
|
|
1030
1030
|
...a,
|
|
1031
|
-
authorization_url: (
|
|
1031
|
+
authorization_url: (n = a.authorization_url) == null ? void 0 : n.slice(0, 1024),
|
|
1032
1032
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1033
1033
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1034
1034
|
};
|
|
1035
|
-
return await t.insertInto("login_sessions").values({ ...
|
|
1035
|
+
return await t.insertInto("login_sessions").values({ ...J(r), tenant_id: e }).execute(), r;
|
|
1036
1036
|
};
|
|
1037
1037
|
}
|
|
1038
|
-
function ha(t) {
|
|
1039
|
-
return async (e, a, r) => (await t.updateTable("login_sessions").set(E(r)).where("login_sessions.id", "=", a).where("login_sessions.tenant_id", "=", e).execute()).length === 1;
|
|
1040
|
-
}
|
|
1041
1038
|
function _a(t) {
|
|
1042
|
-
return async (e, a) => (await t.
|
|
1039
|
+
return async (e, a, r) => (await t.updateTable("login_sessions").set(J(r)).where("login_sessions.id", "=", a).where("login_sessions.tenant_id", "=", e).execute()).length === 1;
|
|
1043
1040
|
}
|
|
1044
1041
|
function fa(t) {
|
|
1042
|
+
return async (e, a) => (await t.deleteFrom("login_sessions").where("login_sessions.tenant_id", "=", e).where("login_sessions.id", "=", a).execute()).length > 0;
|
|
1043
|
+
}
|
|
1044
|
+
function pa(t) {
|
|
1045
1045
|
return {
|
|
1046
|
-
create:
|
|
1047
|
-
get:
|
|
1048
|
-
update:
|
|
1049
|
-
remove:
|
|
1046
|
+
create: ha(t),
|
|
1047
|
+
get: ma(t),
|
|
1048
|
+
update: _a(t),
|
|
1049
|
+
remove: fa(t)
|
|
1050
1050
|
};
|
|
1051
1051
|
}
|
|
1052
|
-
function
|
|
1052
|
+
function ga(t) {
|
|
1053
1053
|
return async (e) => {
|
|
1054
1054
|
const [a] = await t.selectFrom("prompt_settings").where("prompt_settings.tenant_id", "=", e).selectAll().execute();
|
|
1055
|
-
return
|
|
1055
|
+
return f({
|
|
1056
1056
|
identifier_first: !!(a != null && a.identifier_first),
|
|
1057
1057
|
password_first: !!(a != null && a.password_first),
|
|
1058
1058
|
webauthn_platform_first_factor: !!(a != null && a.webauthn_platform_first_factor),
|
|
@@ -1060,8 +1060,8 @@ function pa(t) {
|
|
|
1060
1060
|
});
|
|
1061
1061
|
};
|
|
1062
1062
|
}
|
|
1063
|
-
function
|
|
1064
|
-
return
|
|
1063
|
+
function _e(t) {
|
|
1064
|
+
return f({
|
|
1065
1065
|
...t,
|
|
1066
1066
|
webauthn_platform_first_factor: t.webauthn_platform_first_factor ? !!t.webauthn_platform_first_factor : void 0,
|
|
1067
1067
|
identifier_first: t.identifier_first ? !!t.identifier_first : void 0,
|
|
@@ -1069,78 +1069,78 @@ function he(t) {
|
|
|
1069
1069
|
universal_login_experience: t.universal_login_experience
|
|
1070
1070
|
});
|
|
1071
1071
|
}
|
|
1072
|
-
function
|
|
1072
|
+
function ya(t) {
|
|
1073
1073
|
return async (e, a) => {
|
|
1074
1074
|
try {
|
|
1075
|
-
const r =
|
|
1075
|
+
const r = Be.parse(a);
|
|
1076
1076
|
await t.insertInto("prompt_settings").values({
|
|
1077
|
-
...
|
|
1077
|
+
..._e(r),
|
|
1078
1078
|
tenant_id: e
|
|
1079
1079
|
}).execute();
|
|
1080
1080
|
} catch {
|
|
1081
|
-
await t.updateTable("prompt_settings").set(
|
|
1081
|
+
await t.updateTable("prompt_settings").set(_e(a)).where("tenant_id", "=", e).execute();
|
|
1082
1082
|
}
|
|
1083
1083
|
};
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1085
|
+
function wa(t) {
|
|
1086
1086
|
return {
|
|
1087
|
-
get:
|
|
1088
|
-
set:
|
|
1087
|
+
get: ga(t),
|
|
1088
|
+
set: ya(t)
|
|
1089
1089
|
};
|
|
1090
1090
|
}
|
|
1091
|
-
function
|
|
1091
|
+
function va(t) {
|
|
1092
1092
|
return async (e) => {
|
|
1093
1093
|
const [a] = await t.selectFrom("email_providers").where("email_providers.tenant_id", "=", e).selectAll().execute();
|
|
1094
1094
|
if (!a)
|
|
1095
1095
|
return null;
|
|
1096
1096
|
const {
|
|
1097
1097
|
tenant_id: r,
|
|
1098
|
-
credentials:
|
|
1099
|
-
settings:
|
|
1098
|
+
credentials: n,
|
|
1099
|
+
settings: o,
|
|
1100
1100
|
enabled: s,
|
|
1101
|
-
...
|
|
1101
|
+
...c
|
|
1102
1102
|
} = a;
|
|
1103
|
-
return
|
|
1104
|
-
...
|
|
1105
|
-
credentials: JSON.parse(
|
|
1106
|
-
settings: JSON.parse(
|
|
1103
|
+
return f({
|
|
1104
|
+
...c,
|
|
1105
|
+
credentials: JSON.parse(n),
|
|
1106
|
+
settings: JSON.parse(o),
|
|
1107
1107
|
enabled: !!s
|
|
1108
1108
|
});
|
|
1109
1109
|
};
|
|
1110
1110
|
}
|
|
1111
|
-
function
|
|
1111
|
+
function Na(t) {
|
|
1112
1112
|
return async (e, a) => {
|
|
1113
|
-
const { credentials: r, settings:
|
|
1113
|
+
const { credentials: r, settings: n, enabled: o, ...s } = a;
|
|
1114
1114
|
await t.updateTable("email_providers").set({
|
|
1115
1115
|
...s,
|
|
1116
1116
|
credentials: r ? JSON.stringify(r) : void 0,
|
|
1117
|
-
settings:
|
|
1118
|
-
enabled:
|
|
1117
|
+
settings: n ? JSON.stringify(n) : void 0,
|
|
1118
|
+
enabled: o !== void 0 ? o ? 1 : 0 : void 0
|
|
1119
1119
|
}).where("tenant_id", "=", e).execute();
|
|
1120
1120
|
};
|
|
1121
1121
|
}
|
|
1122
|
-
function
|
|
1122
|
+
function Ca(t) {
|
|
1123
1123
|
return async (e, a) => {
|
|
1124
|
-
const { credentials: r, settings:
|
|
1124
|
+
const { credentials: r, settings: n, enabled: o, ...s } = a;
|
|
1125
1125
|
await t.insertInto("email_providers").values({
|
|
1126
1126
|
...s,
|
|
1127
|
-
enabled:
|
|
1127
|
+
enabled: o ? 1 : 0,
|
|
1128
1128
|
credentials: JSON.stringify(r),
|
|
1129
|
-
settings: JSON.stringify(
|
|
1129
|
+
settings: JSON.stringify(n),
|
|
1130
1130
|
tenant_id: e,
|
|
1131
1131
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1132
1132
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1133
1133
|
}).execute();
|
|
1134
1134
|
};
|
|
1135
1135
|
}
|
|
1136
|
-
function
|
|
1136
|
+
function ba(t) {
|
|
1137
1137
|
return {
|
|
1138
|
-
get:
|
|
1139
|
-
create:
|
|
1140
|
-
update:
|
|
1138
|
+
get: va(t),
|
|
1139
|
+
create: Ca(t),
|
|
1140
|
+
update: Na(t)
|
|
1141
1141
|
};
|
|
1142
1142
|
}
|
|
1143
|
-
function
|
|
1143
|
+
function xa(t) {
|
|
1144
1144
|
return async (e, a) => {
|
|
1145
1145
|
const r = await t.selectFrom("refresh_tokens").where("refresh_tokens.tenant_id", "=", e).where("refresh_tokens.id", "=", a).selectAll().executeTakeFirst();
|
|
1146
1146
|
return r ? {
|
|
@@ -1151,7 +1151,7 @@ function ba(t) {
|
|
|
1151
1151
|
} : null;
|
|
1152
1152
|
};
|
|
1153
1153
|
}
|
|
1154
|
-
function
|
|
1154
|
+
function Ta(t) {
|
|
1155
1155
|
return async (e, a) => {
|
|
1156
1156
|
const r = {
|
|
1157
1157
|
...a,
|
|
@@ -1166,40 +1166,40 @@ function xa(t) {
|
|
|
1166
1166
|
}).execute(), { ...a, ...r };
|
|
1167
1167
|
};
|
|
1168
1168
|
}
|
|
1169
|
-
function
|
|
1169
|
+
function Sa(t) {
|
|
1170
1170
|
return async (e, a) => !!(await t.deleteFrom("refresh_tokens").where("tenant_id", "=", e).where("refresh_tokens.id", "=", a).execute()).length;
|
|
1171
1171
|
}
|
|
1172
|
-
function
|
|
1172
|
+
function Oa(t) {
|
|
1173
1173
|
return async (e, a, r) => {
|
|
1174
|
-
const
|
|
1174
|
+
const n = {
|
|
1175
1175
|
...r,
|
|
1176
1176
|
device: r.device ? JSON.stringify(r.device) : void 0,
|
|
1177
1177
|
resource_servers: r.resource_servers ? JSON.stringify(r.resource_servers) : void 0,
|
|
1178
1178
|
rotating: r.rotating ? 1 : 0
|
|
1179
1179
|
};
|
|
1180
|
-
return !!(await t.updateTable("refresh_tokens").set(
|
|
1180
|
+
return !!(await t.updateTable("refresh_tokens").set(n).where("tenant_id", "=", e).where("refresh_tokens.id", "=", a).execute()).length;
|
|
1181
1181
|
};
|
|
1182
1182
|
}
|
|
1183
|
-
function
|
|
1183
|
+
function ka(t) {
|
|
1184
1184
|
return async (e, a = {
|
|
1185
1185
|
page: 0,
|
|
1186
1186
|
per_page: 50,
|
|
1187
1187
|
include_totals: !1
|
|
1188
1188
|
}) => {
|
|
1189
1189
|
let r = t.selectFrom("refresh_tokens").where("refresh_tokens.tenant_id", "=", e);
|
|
1190
|
-
a.q && (r =
|
|
1191
|
-
let
|
|
1190
|
+
a.q && (r = T(t, r, a.q, ["token", "session_id"]));
|
|
1191
|
+
let n = r;
|
|
1192
1192
|
if (a.sort && a.sort.sort_by) {
|
|
1193
1193
|
const { ref: d } = t.dynamic;
|
|
1194
|
-
|
|
1194
|
+
n = n.orderBy(
|
|
1195
1195
|
d(a.sort.sort_by),
|
|
1196
1196
|
a.sort.sort_order
|
|
1197
1197
|
);
|
|
1198
1198
|
}
|
|
1199
|
-
|
|
1200
|
-
const
|
|
1199
|
+
n = n.offset(a.page * a.per_page).limit(a.per_page);
|
|
1200
|
+
const o = await n.selectAll().execute(), { count: s } = await r.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), c = b(s);
|
|
1201
1201
|
return {
|
|
1202
|
-
refresh_tokens:
|
|
1202
|
+
refresh_tokens: o.map((d) => ({
|
|
1203
1203
|
...d,
|
|
1204
1204
|
rotating: !!d.rotating,
|
|
1205
1205
|
device: d.device ? JSON.parse(d.device) : {},
|
|
@@ -1207,20 +1207,20 @@ function Oa(t) {
|
|
|
1207
1207
|
})),
|
|
1208
1208
|
start: a.page * a.per_page,
|
|
1209
1209
|
limit: a.per_page,
|
|
1210
|
-
length:
|
|
1210
|
+
length: c
|
|
1211
1211
|
};
|
|
1212
1212
|
};
|
|
1213
1213
|
}
|
|
1214
|
-
function
|
|
1214
|
+
function $a(t) {
|
|
1215
1215
|
return {
|
|
1216
|
-
create:
|
|
1217
|
-
get:
|
|
1218
|
-
list:
|
|
1219
|
-
remove:
|
|
1220
|
-
update:
|
|
1216
|
+
create: Ta(t),
|
|
1217
|
+
get: xa(t),
|
|
1218
|
+
list: ka(t),
|
|
1219
|
+
remove: Sa(t),
|
|
1220
|
+
update: Oa(t)
|
|
1221
1221
|
};
|
|
1222
1222
|
}
|
|
1223
|
-
function
|
|
1223
|
+
function Da(t) {
|
|
1224
1224
|
return async () => {
|
|
1225
1225
|
const e = new Date(Date.now() - 864e5).toISOString(), a = new Date(
|
|
1226
1226
|
Date.now() - 1e3 * 60 * 60 * 24 * 7
|
|
@@ -1228,89 +1228,191 @@ function $a(t) {
|
|
|
1228
1228
|
Date.now() - 1e3 * 60 * 60 * 24 * 30 * 3
|
|
1229
1229
|
).toISOString();
|
|
1230
1230
|
console.log("delete codes"), await t.deleteFrom("codes").where("created_at", "<", e).limit(1e5).execute(), console.log("delete sessions"), await t.deleteFrom("login_sessions").where("created_at", "<", a).where("session_id", "is", null).limit(1e5).execute(), console.log("delete logs"), await t.deleteFrom("logs").where("date", "<", r).limit(1e5).execute(), console.log("delete refresh tokens"), await t.deleteFrom("refresh_tokens").where("expires_at", "<", a).limit(1e5).execute(), console.log("delete sessions");
|
|
1231
|
-
const
|
|
1232
|
-
(
|
|
1233
|
-
|
|
1234
|
-
|
|
1231
|
+
const n = await t.selectFrom("sessions").select("id").where(
|
|
1232
|
+
(o) => o.or([
|
|
1233
|
+
o("expires_at", "<", a),
|
|
1234
|
+
o("idle_expires_at", "<", a)
|
|
1235
1235
|
])
|
|
1236
1236
|
).where(
|
|
1237
1237
|
"id",
|
|
1238
1238
|
"not in",
|
|
1239
1239
|
t.selectFrom("refresh_tokens").select("session_id")
|
|
1240
1240
|
).limit(1e5).execute();
|
|
1241
|
-
|
|
1241
|
+
n.length > 0 && await t.deleteFrom("sessions").where(
|
|
1242
1242
|
"id",
|
|
1243
1243
|
"in",
|
|
1244
|
-
|
|
1244
|
+
n.map((o) => o.id)
|
|
1245
1245
|
).execute(), console.log("cleanup complete");
|
|
1246
1246
|
};
|
|
1247
1247
|
}
|
|
1248
|
-
function
|
|
1248
|
+
function Ia(t) {
|
|
1249
|
+
return async (e, a) => {
|
|
1250
|
+
const r = K.parse({
|
|
1251
|
+
id: S(),
|
|
1252
|
+
...a,
|
|
1253
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1254
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1255
|
+
});
|
|
1256
|
+
return await t.insertInto("forms").values({
|
|
1257
|
+
...r,
|
|
1258
|
+
// Store complex objects as JSON strings
|
|
1259
|
+
nodes: JSON.stringify(r.nodes || []),
|
|
1260
|
+
start: JSON.stringify(r.start || {}),
|
|
1261
|
+
ending: JSON.stringify(r.ending || {}),
|
|
1262
|
+
tenant_id: e
|
|
1263
|
+
}).execute(), K.parse(r);
|
|
1264
|
+
};
|
|
1265
|
+
}
|
|
1266
|
+
function Pa(t) {
|
|
1267
|
+
return async (e, a = {
|
|
1268
|
+
page: 0,
|
|
1269
|
+
per_page: 50,
|
|
1270
|
+
include_totals: !1
|
|
1271
|
+
}) => {
|
|
1272
|
+
let r = t.selectFrom("forms").where("tenant_id", "=", e);
|
|
1273
|
+
a != null && a.q && (r = T(t, r, a.q, []));
|
|
1274
|
+
const s = (await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute()).map((d) => {
|
|
1275
|
+
const h = { ...d };
|
|
1276
|
+
if (typeof h.nodes == "string")
|
|
1277
|
+
try {
|
|
1278
|
+
h.nodes = JSON.parse(h.nodes);
|
|
1279
|
+
} catch {
|
|
1280
|
+
}
|
|
1281
|
+
if (typeof h.start == "string")
|
|
1282
|
+
try {
|
|
1283
|
+
h.start = JSON.parse(h.start);
|
|
1284
|
+
} catch {
|
|
1285
|
+
}
|
|
1286
|
+
if (typeof h.ending == "string")
|
|
1287
|
+
try {
|
|
1288
|
+
h.ending = JSON.parse(h.ending);
|
|
1289
|
+
} catch {
|
|
1290
|
+
}
|
|
1291
|
+
return K.parse(f(h));
|
|
1292
|
+
}), { count: c } = await r.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1293
|
+
return {
|
|
1294
|
+
forms: s,
|
|
1295
|
+
start: a.page * a.per_page,
|
|
1296
|
+
limit: a.per_page,
|
|
1297
|
+
length: b(c)
|
|
1298
|
+
};
|
|
1299
|
+
};
|
|
1300
|
+
}
|
|
1301
|
+
function ja(t) {
|
|
1302
|
+
return async (e, a) => {
|
|
1303
|
+
const { numDeletedRows: r } = await t.deleteFrom("forms").where("id", "=", a).where("tenant_id", "=", e).executeTakeFirst();
|
|
1304
|
+
return r > 0;
|
|
1305
|
+
};
|
|
1306
|
+
}
|
|
1307
|
+
function Ma(t) {
|
|
1308
|
+
return async (e, a) => {
|
|
1309
|
+
const r = await t.selectFrom("forms").selectAll().where("forms.id", "=", a).where("tenant_id", "=", e).executeTakeFirst();
|
|
1310
|
+
if (!r) return null;
|
|
1311
|
+
const n = { ...r };
|
|
1312
|
+
if (typeof n.nodes == "string")
|
|
1313
|
+
try {
|
|
1314
|
+
n.nodes = JSON.parse(n.nodes);
|
|
1315
|
+
} catch {
|
|
1316
|
+
}
|
|
1317
|
+
if (typeof n.start == "string")
|
|
1318
|
+
try {
|
|
1319
|
+
n.start = JSON.parse(n.start);
|
|
1320
|
+
} catch {
|
|
1321
|
+
}
|
|
1322
|
+
if (typeof n.ending == "string")
|
|
1323
|
+
try {
|
|
1324
|
+
n.ending = JSON.parse(n.ending);
|
|
1325
|
+
} catch {
|
|
1326
|
+
}
|
|
1327
|
+
return K.parse(f(n));
|
|
1328
|
+
};
|
|
1329
|
+
}
|
|
1330
|
+
function Fa(t) {
|
|
1331
|
+
return async (e, a, r) => {
|
|
1332
|
+
const n = {
|
|
1333
|
+
...r,
|
|
1334
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1335
|
+
};
|
|
1336
|
+
r.nodes && (n.fields = JSON.stringify(r.nodes)), r.start && (n.controls = JSON.stringify(r.start)), r.ending && (n.layout = JSON.stringify(r.ending));
|
|
1337
|
+
const { numUpdatedRows: o } = await t.updateTable("forms").set(n).where("id", "=", a).where("tenant_id", "=", e).executeTakeFirst();
|
|
1338
|
+
return o > 0;
|
|
1339
|
+
};
|
|
1340
|
+
}
|
|
1341
|
+
function Aa(t) {
|
|
1342
|
+
return {
|
|
1343
|
+
create: Ia(t),
|
|
1344
|
+
get: Ma(t),
|
|
1345
|
+
list: Pa(t),
|
|
1346
|
+
remove: ja(t),
|
|
1347
|
+
update: Fa(t)
|
|
1348
|
+
};
|
|
1349
|
+
}
|
|
1350
|
+
function La(t) {
|
|
1249
1351
|
return t[t.length - 1];
|
|
1250
1352
|
}
|
|
1251
|
-
function
|
|
1353
|
+
function g(t) {
|
|
1252
1354
|
return Object.freeze(t);
|
|
1253
1355
|
}
|
|
1254
|
-
const
|
|
1356
|
+
const E = g({
|
|
1255
1357
|
is(t) {
|
|
1256
1358
|
return t.kind === "IdentifierNode";
|
|
1257
1359
|
},
|
|
1258
1360
|
create(t) {
|
|
1259
|
-
return
|
|
1361
|
+
return g({
|
|
1260
1362
|
kind: "IdentifierNode",
|
|
1261
1363
|
name: t
|
|
1262
1364
|
});
|
|
1263
1365
|
}
|
|
1264
|
-
}), W =
|
|
1366
|
+
}), W = g({
|
|
1265
1367
|
is(t) {
|
|
1266
1368
|
return t.kind === "SchemableIdentifierNode";
|
|
1267
1369
|
},
|
|
1268
1370
|
create(t) {
|
|
1269
|
-
return
|
|
1371
|
+
return g({
|
|
1270
1372
|
kind: "SchemableIdentifierNode",
|
|
1271
|
-
identifier:
|
|
1373
|
+
identifier: E.create(t)
|
|
1272
1374
|
});
|
|
1273
1375
|
},
|
|
1274
1376
|
createWithSchema(t, e) {
|
|
1275
|
-
return
|
|
1377
|
+
return g({
|
|
1276
1378
|
kind: "SchemableIdentifierNode",
|
|
1277
|
-
schema:
|
|
1278
|
-
identifier:
|
|
1379
|
+
schema: E.create(t),
|
|
1380
|
+
identifier: E.create(e)
|
|
1279
1381
|
});
|
|
1280
1382
|
}
|
|
1281
|
-
}),
|
|
1383
|
+
}), za = g({
|
|
1282
1384
|
is(t) {
|
|
1283
1385
|
return t.kind === "AliasNode";
|
|
1284
1386
|
},
|
|
1285
1387
|
create(t, e) {
|
|
1286
|
-
return
|
|
1388
|
+
return g({
|
|
1287
1389
|
kind: "AliasNode",
|
|
1288
1390
|
node: t,
|
|
1289
1391
|
alias: e
|
|
1290
1392
|
});
|
|
1291
1393
|
}
|
|
1292
|
-
}),
|
|
1394
|
+
}), B = g({
|
|
1293
1395
|
is(t) {
|
|
1294
1396
|
return t.kind === "TableNode";
|
|
1295
1397
|
},
|
|
1296
1398
|
create(t) {
|
|
1297
|
-
return
|
|
1399
|
+
return g({
|
|
1298
1400
|
kind: "TableNode",
|
|
1299
1401
|
table: W.create(t)
|
|
1300
1402
|
});
|
|
1301
1403
|
},
|
|
1302
1404
|
createWithSchema(t, e) {
|
|
1303
|
-
return
|
|
1405
|
+
return g({
|
|
1304
1406
|
kind: "TableNode",
|
|
1305
1407
|
table: W.createWithSchema(t, e)
|
|
1306
1408
|
});
|
|
1307
1409
|
}
|
|
1308
1410
|
});
|
|
1309
|
-
var
|
|
1310
|
-
class
|
|
1411
|
+
var R;
|
|
1412
|
+
class Ja {
|
|
1311
1413
|
constructor() {
|
|
1312
1414
|
j(this, "nodeStack", []);
|
|
1313
|
-
y(this,
|
|
1415
|
+
y(this, R, g({
|
|
1314
1416
|
AliasNode: this.transformAlias.bind(this),
|
|
1315
1417
|
ColumnNode: this.transformColumn.bind(this),
|
|
1316
1418
|
IdentifierNode: this.transformIdentifier.bind(this),
|
|
@@ -1411,13 +1513,13 @@ class Pa {
|
|
|
1411
1513
|
return e;
|
|
1412
1514
|
this.nodeStack.push(e);
|
|
1413
1515
|
const a = this.transformNodeImpl(e);
|
|
1414
|
-
return this.nodeStack.pop(),
|
|
1516
|
+
return this.nodeStack.pop(), g(a);
|
|
1415
1517
|
}
|
|
1416
1518
|
transformNodeImpl(e) {
|
|
1417
|
-
return
|
|
1519
|
+
return l(this, R)[e.kind](e);
|
|
1418
1520
|
}
|
|
1419
1521
|
transformNodeList(e) {
|
|
1420
|
-
return e &&
|
|
1522
|
+
return e && g(e.map((a) => this.transformNode(a)));
|
|
1421
1523
|
}
|
|
1422
1524
|
transformSelectQuery(e) {
|
|
1423
1525
|
return {
|
|
@@ -1516,7 +1618,7 @@ class Pa {
|
|
|
1516
1618
|
transformRaw(e) {
|
|
1517
1619
|
return {
|
|
1518
1620
|
kind: "RawNode",
|
|
1519
|
-
sqlFragments:
|
|
1621
|
+
sqlFragments: g([...e.sqlFragments]),
|
|
1520
1622
|
parameters: this.transformNodeList(e.parameters)
|
|
1521
1623
|
};
|
|
1522
1624
|
}
|
|
@@ -2140,8 +2242,8 @@ class Pa {
|
|
|
2140
2242
|
return e;
|
|
2141
2243
|
}
|
|
2142
2244
|
}
|
|
2143
|
-
|
|
2144
|
-
const
|
|
2245
|
+
R = new WeakMap();
|
|
2246
|
+
const Ea = g({
|
|
2145
2247
|
AlterTableNode: !0,
|
|
2146
2248
|
CreateIndexNode: !0,
|
|
2147
2249
|
CreateSchemaNode: !0,
|
|
@@ -2160,88 +2262,88 @@ const ja = p({
|
|
|
2160
2262
|
UpdateQueryNode: !0,
|
|
2161
2263
|
MergeQueryNode: !0
|
|
2162
2264
|
});
|
|
2163
|
-
var P,
|
|
2164
|
-
class
|
|
2265
|
+
var P, O, k, p, ye, we, ve, $, G, Ne;
|
|
2266
|
+
class Ka extends Ja {
|
|
2165
2267
|
constructor(a) {
|
|
2166
2268
|
super();
|
|
2167
|
-
y(this,
|
|
2269
|
+
y(this, p);
|
|
2168
2270
|
y(this, P);
|
|
2169
|
-
y(this,
|
|
2170
|
-
y(this,
|
|
2271
|
+
y(this, O, /* @__PURE__ */ new Set());
|
|
2272
|
+
y(this, k, /* @__PURE__ */ new Set());
|
|
2171
2273
|
M(this, P, a);
|
|
2172
2274
|
}
|
|
2173
2275
|
transformNodeImpl(a) {
|
|
2174
|
-
if (!u(this,
|
|
2276
|
+
if (!u(this, p, ye).call(this, a))
|
|
2175
2277
|
return super.transformNodeImpl(a);
|
|
2176
|
-
const r = u(this,
|
|
2278
|
+
const r = u(this, p, ve).call(this, a);
|
|
2177
2279
|
for (const s of r)
|
|
2178
|
-
|
|
2179
|
-
const
|
|
2180
|
-
for (const s of
|
|
2181
|
-
|
|
2182
|
-
const
|
|
2183
|
-
for (const s of
|
|
2184
|
-
|
|
2280
|
+
l(this, k).add(s);
|
|
2281
|
+
const n = u(this, p, we).call(this, a);
|
|
2282
|
+
for (const s of n)
|
|
2283
|
+
l(this, O).add(s);
|
|
2284
|
+
const o = super.transformNodeImpl(a);
|
|
2285
|
+
for (const s of n)
|
|
2286
|
+
l(this, O).delete(s);
|
|
2185
2287
|
for (const s of r)
|
|
2186
|
-
|
|
2187
|
-
return
|
|
2288
|
+
l(this, k).delete(s);
|
|
2289
|
+
return o;
|
|
2188
2290
|
}
|
|
2189
2291
|
transformSchemableIdentifier(a) {
|
|
2190
2292
|
const r = super.transformSchemableIdentifier(a);
|
|
2191
|
-
return r.schema || !
|
|
2293
|
+
return r.schema || !l(this, O).has(a.identifier.name) ? r : {
|
|
2192
2294
|
...r,
|
|
2193
|
-
schema:
|
|
2295
|
+
schema: E.create(l(this, P))
|
|
2194
2296
|
};
|
|
2195
2297
|
}
|
|
2196
2298
|
transformReferences(a) {
|
|
2197
2299
|
const r = super.transformReferences(a);
|
|
2198
2300
|
return r.table.table.schema ? r : {
|
|
2199
2301
|
...r,
|
|
2200
|
-
table:
|
|
2302
|
+
table: B.createWithSchema(l(this, P), r.table.table.identifier.name)
|
|
2201
2303
|
};
|
|
2202
2304
|
}
|
|
2203
2305
|
}
|
|
2204
|
-
P = new WeakMap(),
|
|
2205
|
-
return a.kind in
|
|
2206
|
-
}, ye = function(a) {
|
|
2207
|
-
const r = /* @__PURE__ */ new Set();
|
|
2208
|
-
if ("name" in a && a.name && W.is(a.name) && u(this, f, q).call(this, a.name, r), "from" in a && a.from)
|
|
2209
|
-
for (const o of a.from.froms)
|
|
2210
|
-
u(this, f, $).call(this, o, r);
|
|
2211
|
-
if ("into" in a && a.into && u(this, f, $).call(this, a.into, r), "table" in a && a.table && u(this, f, $).call(this, a.table, r), "joins" in a && a.joins)
|
|
2212
|
-
for (const o of a.joins)
|
|
2213
|
-
u(this, f, $).call(this, o.table, r);
|
|
2214
|
-
return "using" in a && a.using && u(this, f, $).call(this, a.using, r), r;
|
|
2306
|
+
P = new WeakMap(), O = new WeakMap(), k = new WeakMap(), p = new WeakSet(), ye = function(a) {
|
|
2307
|
+
return a.kind in Ea;
|
|
2215
2308
|
}, we = function(a) {
|
|
2216
2309
|
const r = /* @__PURE__ */ new Set();
|
|
2217
|
-
|
|
2310
|
+
if ("name" in a && a.name && W.is(a.name) && u(this, p, G).call(this, a.name, r), "from" in a && a.from)
|
|
2311
|
+
for (const n of a.from.froms)
|
|
2312
|
+
u(this, p, $).call(this, n, r);
|
|
2313
|
+
if ("into" in a && a.into && u(this, p, $).call(this, a.into, r), "table" in a && a.table && u(this, p, $).call(this, a.table, r), "joins" in a && a.joins)
|
|
2314
|
+
for (const n of a.joins)
|
|
2315
|
+
u(this, p, $).call(this, n.table, r);
|
|
2316
|
+
return "using" in a && a.using && u(this, p, $).call(this, a.using, r), r;
|
|
2317
|
+
}, ve = function(a) {
|
|
2318
|
+
const r = /* @__PURE__ */ new Set();
|
|
2319
|
+
return "with" in a && a.with && u(this, p, Ne).call(this, a.with, r), r;
|
|
2218
2320
|
}, $ = function(a, r) {
|
|
2219
|
-
const
|
|
2220
|
-
|
|
2221
|
-
},
|
|
2222
|
-
const
|
|
2223
|
-
!
|
|
2224
|
-
},
|
|
2225
|
-
for (const
|
|
2226
|
-
const
|
|
2227
|
-
|
|
2321
|
+
const n = B.is(a) ? a : za.is(a) && B.is(a.node) ? a.node : null;
|
|
2322
|
+
n && u(this, p, G).call(this, n.table, r);
|
|
2323
|
+
}, G = function(a, r) {
|
|
2324
|
+
const n = a.identifier.name;
|
|
2325
|
+
!l(this, O).has(n) && !l(this, k).has(n) && r.add(n);
|
|
2326
|
+
}, Ne = function(a, r) {
|
|
2327
|
+
for (const n of a.expressions) {
|
|
2328
|
+
const o = n.name.table.table.identifier.name;
|
|
2329
|
+
l(this, k).has(o) || r.add(o);
|
|
2228
2330
|
}
|
|
2229
2331
|
};
|
|
2230
2332
|
var L;
|
|
2231
|
-
class
|
|
2333
|
+
class Ra {
|
|
2232
2334
|
constructor(e) {
|
|
2233
2335
|
y(this, L);
|
|
2234
|
-
M(this, L, new
|
|
2336
|
+
M(this, L, new Ka(e));
|
|
2235
2337
|
}
|
|
2236
2338
|
transformQuery(e) {
|
|
2237
|
-
return
|
|
2339
|
+
return l(this, L).transformNode(e.node);
|
|
2238
2340
|
}
|
|
2239
2341
|
async transformResult(e) {
|
|
2240
2342
|
return e.result;
|
|
2241
2343
|
}
|
|
2242
2344
|
}
|
|
2243
2345
|
L = new WeakMap();
|
|
2244
|
-
class
|
|
2346
|
+
class Ua {
|
|
2245
2347
|
transformQuery(e) {
|
|
2246
2348
|
return e.node;
|
|
2247
2349
|
}
|
|
@@ -2249,13 +2351,13 @@ class Aa {
|
|
|
2249
2351
|
return e.result;
|
|
2250
2352
|
}
|
|
2251
2353
|
}
|
|
2252
|
-
const
|
|
2253
|
-
var
|
|
2254
|
-
class
|
|
2354
|
+
const Ba = "kysely_migration", fe = "kysely_migration_lock", Qa = !1, Q = "migration_lock", qa = g({ __noMigrations__: !0 });
|
|
2355
|
+
var _, i, F, v, N, D, be, C, xe, Te, Se, Oe, ke, H, I, X, $e, De, Ie, Y, Pe, je, Me, Fe, Ae, A;
|
|
2356
|
+
class Ce {
|
|
2255
2357
|
constructor(e) {
|
|
2256
2358
|
y(this, i);
|
|
2257
|
-
y(this,
|
|
2258
|
-
M(this,
|
|
2359
|
+
y(this, _);
|
|
2360
|
+
M(this, _, g(e));
|
|
2259
2361
|
}
|
|
2260
2362
|
/**
|
|
2261
2363
|
* Returns a {@link MigrationInfo} object for each migration.
|
|
@@ -2263,13 +2365,13 @@ class Ne {
|
|
|
2263
2365
|
* The returned array is sorted by migration name.
|
|
2264
2366
|
*/
|
|
2265
2367
|
async getMigrations() {
|
|
2266
|
-
const e = await u(this, i, I).call(this,
|
|
2267
|
-
return (await u(this, i,
|
|
2268
|
-
const
|
|
2368
|
+
const e = await u(this, i, I).call(this, l(this, i, N)) ? await l(this, _).db.withPlugin(l(this, i, C)).selectFrom(l(this, i, N)).select(["name", "timestamp"]).execute() : [];
|
|
2369
|
+
return (await u(this, i, Y).call(this)).map(({ name: r, ...n }) => {
|
|
2370
|
+
const o = e.find((s) => s.name === r);
|
|
2269
2371
|
return {
|
|
2270
2372
|
name: r,
|
|
2271
|
-
migration:
|
|
2272
|
-
executedAt:
|
|
2373
|
+
migration: n,
|
|
2374
|
+
executedAt: o ? new Date(o.timestamp) : void 0
|
|
2273
2375
|
};
|
|
2274
2376
|
});
|
|
2275
2377
|
}
|
|
@@ -2347,16 +2449,16 @@ class Ne {
|
|
|
2347
2449
|
* ```
|
|
2348
2450
|
*/
|
|
2349
2451
|
async migrateTo(e) {
|
|
2350
|
-
return u(this, i, F).call(this, ({ migrations: a, executedMigrations: r, pendingMigrations:
|
|
2351
|
-
if (e ===
|
|
2452
|
+
return u(this, i, F).call(this, ({ migrations: a, executedMigrations: r, pendingMigrations: n }) => {
|
|
2453
|
+
if (e === qa)
|
|
2352
2454
|
return { direction: "Down", step: 1 / 0 };
|
|
2353
|
-
if (!a.find((
|
|
2455
|
+
if (!a.find((c) => c.name === e))
|
|
2354
2456
|
throw new Error(`migration "${e}" doesn't exist`);
|
|
2355
|
-
const
|
|
2356
|
-
if (
|
|
2457
|
+
const o = r.indexOf(e), s = n.findIndex((c) => c.name === e);
|
|
2458
|
+
if (o !== -1)
|
|
2357
2459
|
return {
|
|
2358
2460
|
direction: "Down",
|
|
2359
|
-
step: r.length -
|
|
2461
|
+
step: r.length - o - 1
|
|
2360
2462
|
};
|
|
2361
2463
|
if (s !== -1)
|
|
2362
2464
|
return { direction: "Up", step: s + 1 };
|
|
@@ -2398,182 +2500,182 @@ class Ne {
|
|
|
2398
2500
|
return u(this, i, F).call(this, () => ({ direction: "Down", step: 1 }));
|
|
2399
2501
|
}
|
|
2400
2502
|
}
|
|
2401
|
-
|
|
2503
|
+
_ = new WeakMap(), i = new WeakSet(), F = async function(e) {
|
|
2402
2504
|
try {
|
|
2403
|
-
return await u(this, i,
|
|
2505
|
+
return await u(this, i, xe).call(this), await u(this, i, $e).call(this, e);
|
|
2404
2506
|
} catch (a) {
|
|
2405
|
-
return a instanceof
|
|
2507
|
+
return a instanceof q ? a.resultSet : { error: a };
|
|
2406
2508
|
}
|
|
2407
2509
|
}, v = function() {
|
|
2408
|
-
return
|
|
2510
|
+
return l(this, _).migrationTableSchema;
|
|
2409
2511
|
}, N = function() {
|
|
2410
|
-
return
|
|
2512
|
+
return l(this, _).migrationTableName ?? Ba;
|
|
2411
2513
|
}, D = function() {
|
|
2412
|
-
return
|
|
2413
|
-
},
|
|
2414
|
-
return
|
|
2514
|
+
return l(this, _).migrationLockTableName ?? fe;
|
|
2515
|
+
}, be = function() {
|
|
2516
|
+
return l(this, _).allowUnorderedMigrations ?? Qa;
|
|
2415
2517
|
}, C = function() {
|
|
2416
|
-
return
|
|
2417
|
-
}, be = async function() {
|
|
2418
|
-
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);
|
|
2518
|
+
return l(this, i, v) ? new Ra(l(this, i, v)) : new Ua();
|
|
2419
2519
|
}, xe = async function() {
|
|
2420
|
-
|
|
2520
|
+
await u(this, i, Te).call(this), await u(this, i, Se).call(this), await u(this, i, Oe).call(this), await u(this, i, ke).call(this);
|
|
2521
|
+
}, Te = async function() {
|
|
2522
|
+
if (l(this, i, v) && !await u(this, i, H).call(this))
|
|
2421
2523
|
try {
|
|
2422
|
-
await u(this, i, A).call(this,
|
|
2524
|
+
await u(this, i, A).call(this, l(this, _).db.schema.createSchema(l(this, i, v)));
|
|
2423
2525
|
} catch (e) {
|
|
2424
|
-
if (!await u(this, i,
|
|
2526
|
+
if (!await u(this, i, H).call(this))
|
|
2425
2527
|
throw e;
|
|
2426
2528
|
}
|
|
2427
|
-
},
|
|
2428
|
-
if (!await u(this, i, I).call(this,
|
|
2529
|
+
}, Se = async function() {
|
|
2530
|
+
if (!await u(this, i, I).call(this, l(this, i, N)))
|
|
2429
2531
|
try {
|
|
2430
|
-
|
|
2532
|
+
l(this, i, v) && await u(this, i, A).call(this, l(this, _).db.schema.createSchema(l(this, i, v))), await u(this, i, A).call(this, l(this, _).db.schema.withPlugin(l(this, i, C)).createTable(l(this, i, N)).addColumn("name", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("timestamp", "varchar(255)", (e) => e.notNull()));
|
|
2431
2533
|
} catch (e) {
|
|
2432
|
-
if (!await u(this, i, I).call(this,
|
|
2534
|
+
if (!await u(this, i, I).call(this, l(this, i, N)))
|
|
2433
2535
|
throw e;
|
|
2434
2536
|
}
|
|
2435
|
-
},
|
|
2436
|
-
if (!await u(this, i, I).call(this,
|
|
2537
|
+
}, Oe = async function() {
|
|
2538
|
+
if (!await u(this, i, I).call(this, l(this, i, D)))
|
|
2437
2539
|
try {
|
|
2438
|
-
await u(this, i, A).call(this,
|
|
2540
|
+
await u(this, i, A).call(this, l(this, _).db.schema.withPlugin(l(this, i, C)).createTable(l(this, i, D)).addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("is_locked", "integer", (e) => e.notNull().defaultTo(0)));
|
|
2439
2541
|
} catch (e) {
|
|
2440
|
-
if (!await u(this, i, I).call(this,
|
|
2542
|
+
if (!await u(this, i, I).call(this, l(this, i, D)))
|
|
2441
2543
|
throw e;
|
|
2442
2544
|
}
|
|
2443
|
-
},
|
|
2444
|
-
if (!await u(this, i,
|
|
2545
|
+
}, ke = async function() {
|
|
2546
|
+
if (!await u(this, i, X).call(this))
|
|
2445
2547
|
try {
|
|
2446
|
-
await
|
|
2548
|
+
await l(this, _).db.withPlugin(l(this, i, C)).insertInto(l(this, i, D)).values({ id: Q, is_locked: 0 }).execute();
|
|
2447
2549
|
} catch (e) {
|
|
2448
|
-
if (!await u(this, i,
|
|
2550
|
+
if (!await u(this, i, X).call(this))
|
|
2449
2551
|
throw e;
|
|
2450
2552
|
}
|
|
2451
|
-
},
|
|
2452
|
-
return (await
|
|
2553
|
+
}, H = async function() {
|
|
2554
|
+
return (await l(this, _).db.introspection.getSchemas()).some((a) => a.name === l(this, i, v));
|
|
2453
2555
|
}, I = async function(e) {
|
|
2454
|
-
const a =
|
|
2455
|
-
return (await
|
|
2556
|
+
const a = l(this, i, v);
|
|
2557
|
+
return (await l(this, _).db.introspection.getTables({
|
|
2456
2558
|
withInternalKyselyTables: !0
|
|
2457
|
-
})).some((
|
|
2458
|
-
},
|
|
2459
|
-
return !!await
|
|
2460
|
-
},
|
|
2461
|
-
const a =
|
|
2462
|
-
lockTable:
|
|
2463
|
-
lockRowId:
|
|
2464
|
-
lockTableSchema:
|
|
2465
|
-
}),
|
|
2559
|
+
})).some((n) => n.name === e && (!a || n.schema === a));
|
|
2560
|
+
}, X = async function() {
|
|
2561
|
+
return !!await l(this, _).db.withPlugin(l(this, i, C)).selectFrom(l(this, i, D)).where("id", "=", Q).select("id").executeTakeFirst();
|
|
2562
|
+
}, $e = async function(e) {
|
|
2563
|
+
const a = l(this, _).db.getExecutor().adapter, r = g({
|
|
2564
|
+
lockTable: l(this, _).migrationLockTableName ?? fe,
|
|
2565
|
+
lockRowId: Q,
|
|
2566
|
+
lockTableSchema: l(this, _).migrationTableSchema
|
|
2567
|
+
}), n = async (o) => {
|
|
2466
2568
|
try {
|
|
2467
|
-
await a.acquireMigrationLock(
|
|
2468
|
-
const s = await u(this, i,
|
|
2569
|
+
await a.acquireMigrationLock(o, r);
|
|
2570
|
+
const s = await u(this, i, De).call(this, o);
|
|
2469
2571
|
if (s.migrations.length === 0)
|
|
2470
2572
|
return { results: [] };
|
|
2471
|
-
const { direction:
|
|
2472
|
-
return d <= 0 ? { results: [] } :
|
|
2573
|
+
const { direction: c, step: d } = e(s);
|
|
2574
|
+
return d <= 0 ? { results: [] } : c === "Down" ? await u(this, i, Fe).call(this, o, s, d) : c === "Up" ? await u(this, i, Ae).call(this, o, s, d) : { results: [] };
|
|
2473
2575
|
} finally {
|
|
2474
|
-
await a.releaseMigrationLock(
|
|
2576
|
+
await a.releaseMigrationLock(o, r);
|
|
2475
2577
|
}
|
|
2476
2578
|
};
|
|
2477
|
-
return a.supportsTransactionalDdl ?
|
|
2478
|
-
},
|
|
2479
|
-
const a = await u(this, i,
|
|
2480
|
-
u(this, i,
|
|
2481
|
-
const
|
|
2482
|
-
return
|
|
2579
|
+
return a.supportsTransactionalDdl ? l(this, _).db.transaction().execute(n) : l(this, _).db.connection().execute(n);
|
|
2580
|
+
}, De = async function(e) {
|
|
2581
|
+
const a = await u(this, i, Y).call(this), r = await u(this, i, Pe).call(this, e);
|
|
2582
|
+
u(this, i, je).call(this, a, r), l(this, i, be) || u(this, i, Me).call(this, a, r);
|
|
2583
|
+
const n = u(this, i, Ie).call(this, a, r);
|
|
2584
|
+
return g({
|
|
2483
2585
|
migrations: a,
|
|
2484
2586
|
executedMigrations: r,
|
|
2485
|
-
lastMigration:
|
|
2486
|
-
pendingMigrations:
|
|
2587
|
+
lastMigration: La(r),
|
|
2588
|
+
pendingMigrations: n
|
|
2487
2589
|
});
|
|
2488
|
-
},
|
|
2590
|
+
}, Ie = function(e, a) {
|
|
2489
2591
|
return e.filter((r) => !a.includes(r.name));
|
|
2490
|
-
},
|
|
2491
|
-
const e = await
|
|
2592
|
+
}, Y = async function() {
|
|
2593
|
+
const e = await l(this, _).provider.getMigrations();
|
|
2492
2594
|
return Object.keys(e).sort().map((a) => ({
|
|
2493
2595
|
...e[a],
|
|
2494
2596
|
name: a
|
|
2495
2597
|
}));
|
|
2496
|
-
},
|
|
2497
|
-
return (await e.withPlugin(
|
|
2498
|
-
},
|
|
2598
|
+
}, Pe = async function(e) {
|
|
2599
|
+
return (await e.withPlugin(l(this, i, C)).selectFrom(l(this, i, N)).select("name").orderBy(["timestamp", "name"]).execute()).map((r) => r.name);
|
|
2600
|
+
}, je = function(e, a) {
|
|
2499
2601
|
for (const r of a)
|
|
2500
|
-
if (!e.some((
|
|
2602
|
+
if (!e.some((n) => n.name === r))
|
|
2501
2603
|
throw new Error(`corrupted migrations: previously executed migration ${r} is missing`);
|
|
2502
|
-
},
|
|
2604
|
+
}, Me = function(e, a) {
|
|
2503
2605
|
for (let r = 0; r < a.length; ++r)
|
|
2504
2606
|
if (e[r].name !== a[r])
|
|
2505
2607
|
throw new Error(`corrupted migrations: expected previously executed migration ${a[r]} to be at index ${r} but ${e[r].name} was found in its place. New migrations must always have a name that comes alphabetically after the last executed migration.`);
|
|
2506
|
-
},
|
|
2507
|
-
const
|
|
2608
|
+
}, Fe = async function(e, a, r) {
|
|
2609
|
+
const n = a.executedMigrations.slice().reverse().slice(0, r).map((s) => a.migrations.find((c) => c.name === s)), o = n.map((s) => ({
|
|
2508
2610
|
migrationName: s.name,
|
|
2509
2611
|
direction: "Down",
|
|
2510
2612
|
status: "NotExecuted"
|
|
2511
2613
|
}));
|
|
2512
|
-
for (let s = 0; s <
|
|
2513
|
-
const
|
|
2614
|
+
for (let s = 0; s < o.length; ++s) {
|
|
2615
|
+
const c = n[s];
|
|
2514
2616
|
try {
|
|
2515
|
-
|
|
2516
|
-
migrationName:
|
|
2617
|
+
c.down && (await c.down(e), await e.withPlugin(l(this, i, C)).deleteFrom(l(this, i, N)).where("name", "=", c.name).execute(), o[s] = {
|
|
2618
|
+
migrationName: c.name,
|
|
2517
2619
|
direction: "Down",
|
|
2518
2620
|
status: "Success"
|
|
2519
2621
|
});
|
|
2520
2622
|
} catch (d) {
|
|
2521
|
-
throw
|
|
2522
|
-
migrationName:
|
|
2623
|
+
throw o[s] = {
|
|
2624
|
+
migrationName: c.name,
|
|
2523
2625
|
direction: "Down",
|
|
2524
2626
|
status: "Error"
|
|
2525
|
-
}, new
|
|
2627
|
+
}, new q({
|
|
2526
2628
|
error: d,
|
|
2527
|
-
results:
|
|
2629
|
+
results: o
|
|
2528
2630
|
});
|
|
2529
2631
|
}
|
|
2530
2632
|
}
|
|
2531
|
-
return { results:
|
|
2532
|
-
},
|
|
2533
|
-
const
|
|
2633
|
+
return { results: o };
|
|
2634
|
+
}, Ae = async function(e, a, r) {
|
|
2635
|
+
const o = a.pendingMigrations.slice(0, r).map((s) => ({
|
|
2534
2636
|
migrationName: s.name,
|
|
2535
2637
|
direction: "Up",
|
|
2536
2638
|
status: "NotExecuted"
|
|
2537
2639
|
}));
|
|
2538
|
-
for (let s = 0; s <
|
|
2539
|
-
const
|
|
2640
|
+
for (let s = 0; s < o.length; s++) {
|
|
2641
|
+
const c = a.pendingMigrations[s];
|
|
2540
2642
|
try {
|
|
2541
|
-
await
|
|
2542
|
-
name:
|
|
2643
|
+
await c.up(e), await e.withPlugin(l(this, i, C)).insertInto(l(this, i, N)).values({
|
|
2644
|
+
name: c.name,
|
|
2543
2645
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
2544
|
-
}).execute(),
|
|
2545
|
-
migrationName:
|
|
2646
|
+
}).execute(), o[s] = {
|
|
2647
|
+
migrationName: c.name,
|
|
2546
2648
|
direction: "Up",
|
|
2547
2649
|
status: "Success"
|
|
2548
2650
|
};
|
|
2549
2651
|
} catch (d) {
|
|
2550
|
-
throw
|
|
2551
|
-
migrationName:
|
|
2652
|
+
throw o[s] = {
|
|
2653
|
+
migrationName: c.name,
|
|
2552
2654
|
direction: "Up",
|
|
2553
2655
|
status: "Error"
|
|
2554
|
-
}, new
|
|
2656
|
+
}, new q({
|
|
2555
2657
|
error: d,
|
|
2556
|
-
results:
|
|
2658
|
+
results: o
|
|
2557
2659
|
});
|
|
2558
2660
|
}
|
|
2559
2661
|
}
|
|
2560
|
-
return { results:
|
|
2662
|
+
return { results: o };
|
|
2561
2663
|
}, A = async function(e) {
|
|
2562
|
-
|
|
2664
|
+
l(this, _).db.getExecutor().adapter.supportsCreateIfNotExists && (e = e.ifNotExists()), await e.execute();
|
|
2563
2665
|
};
|
|
2564
2666
|
var z;
|
|
2565
|
-
class
|
|
2667
|
+
class q extends Error {
|
|
2566
2668
|
constructor(a) {
|
|
2567
2669
|
super();
|
|
2568
2670
|
y(this, z);
|
|
2569
2671
|
M(this, z, a);
|
|
2570
2672
|
}
|
|
2571
2673
|
get resultSet() {
|
|
2572
|
-
return
|
|
2674
|
+
return l(this, z);
|
|
2573
2675
|
}
|
|
2574
2676
|
}
|
|
2575
2677
|
z = new WeakMap();
|
|
2576
|
-
class
|
|
2678
|
+
class Le {
|
|
2577
2679
|
constructor(e) {
|
|
2578
2680
|
j(this, "migrations");
|
|
2579
2681
|
this.migrations = e;
|
|
@@ -2582,7 +2684,7 @@ class Ae {
|
|
|
2582
2684
|
return this.migrations;
|
|
2583
2685
|
}
|
|
2584
2686
|
}
|
|
2585
|
-
async function
|
|
2687
|
+
async function Va(t) {
|
|
2586
2688
|
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(
|
|
2587
2689
|
"tenant_id",
|
|
2588
2690
|
"varchar(255)",
|
|
@@ -2654,35 +2756,35 @@ async function Ja(t) {
|
|
|
2654
2756
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
2655
2757
|
).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();
|
|
2656
2758
|
}
|
|
2657
|
-
async function
|
|
2759
|
+
async function Wa(t) {
|
|
2658
2760
|
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();
|
|
2659
2761
|
}
|
|
2660
|
-
const
|
|
2762
|
+
const Ga = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2661
2763
|
__proto__: null,
|
|
2662
|
-
down:
|
|
2663
|
-
up:
|
|
2764
|
+
down: Wa,
|
|
2765
|
+
up: Va
|
|
2664
2766
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2665
|
-
async function
|
|
2767
|
+
async function Ha(t) {
|
|
2666
2768
|
await t.schema.alterTable("tenants").addColumn("support_url", "varchar(255)").execute();
|
|
2667
2769
|
}
|
|
2668
|
-
async function
|
|
2770
|
+
async function Xa(t) {
|
|
2669
2771
|
await t.schema.alterTable("tenants").dropColumn("support_url").execute();
|
|
2670
2772
|
}
|
|
2671
|
-
const
|
|
2773
|
+
const Ya = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2672
2774
|
__proto__: null,
|
|
2673
|
-
down:
|
|
2674
|
-
up:
|
|
2775
|
+
down: Xa,
|
|
2776
|
+
up: Ha
|
|
2675
2777
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2676
|
-
async function
|
|
2778
|
+
async function Za(t) {
|
|
2677
2779
|
}
|
|
2678
|
-
async function
|
|
2780
|
+
async function er(t) {
|
|
2679
2781
|
}
|
|
2680
|
-
const
|
|
2782
|
+
const tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2681
2783
|
__proto__: null,
|
|
2682
|
-
down:
|
|
2683
|
-
up:
|
|
2784
|
+
down: er,
|
|
2785
|
+
up: Za
|
|
2684
2786
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2685
|
-
async function
|
|
2787
|
+
async function ar(t) {
|
|
2686
2788
|
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(
|
|
2687
2789
|
"tenant_id_constraint",
|
|
2688
2790
|
["tenant_id"],
|
|
@@ -2691,24 +2793,24 @@ async function Ga(t) {
|
|
|
2691
2793
|
(e) => e.onDelete("cascade")
|
|
2692
2794
|
).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();
|
|
2693
2795
|
}
|
|
2694
|
-
async function
|
|
2796
|
+
async function rr(t) {
|
|
2695
2797
|
await t.schema.dropTable("logs").execute();
|
|
2696
2798
|
}
|
|
2697
|
-
const
|
|
2799
|
+
const nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2698
2800
|
__proto__: null,
|
|
2699
|
-
down:
|
|
2700
|
-
up:
|
|
2801
|
+
down: rr,
|
|
2802
|
+
up: ar
|
|
2701
2803
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2702
|
-
async function
|
|
2804
|
+
async function or(t) {
|
|
2703
2805
|
}
|
|
2704
|
-
async function
|
|
2806
|
+
async function sr(t) {
|
|
2705
2807
|
}
|
|
2706
|
-
const
|
|
2808
|
+
const ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2707
2809
|
__proto__: null,
|
|
2708
|
-
down:
|
|
2709
|
-
up:
|
|
2810
|
+
down: sr,
|
|
2811
|
+
up: or
|
|
2710
2812
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2711
|
-
async function
|
|
2813
|
+
async function dr(t) {
|
|
2712
2814
|
await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
2713
2815
|
"user_id_constraint",
|
|
2714
2816
|
["user_id", "tenant_id"],
|
|
@@ -2733,15 +2835,15 @@ async function tr(t) {
|
|
|
2733
2835
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
2734
2836
|
).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();
|
|
2735
2837
|
}
|
|
2736
|
-
async function
|
|
2838
|
+
async function cr(t) {
|
|
2737
2839
|
await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("tickets").execute(), await t.schema.dropTable("otps").execute();
|
|
2738
2840
|
}
|
|
2739
|
-
const
|
|
2841
|
+
const lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2740
2842
|
__proto__: null,
|
|
2741
|
-
down:
|
|
2742
|
-
up:
|
|
2843
|
+
down: cr,
|
|
2844
|
+
up: dr
|
|
2743
2845
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2744
|
-
async function
|
|
2846
|
+
async function ur(t) {
|
|
2745
2847
|
await t.schema.createTable("passwords").addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addPrimaryKeyConstraint("passwords_pkey", ["user_id", "tenant_id"]).addForeignKeyConstraint(
|
|
2746
2848
|
"user_id_constraint",
|
|
2747
2849
|
["user_id", "tenant_id"],
|
|
@@ -2756,24 +2858,24 @@ async function nr(t) {
|
|
|
2756
2858
|
(e) => e.onDelete("cascade")
|
|
2757
2859
|
).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();
|
|
2758
2860
|
}
|
|
2759
|
-
async function
|
|
2861
|
+
async function mr(t) {
|
|
2760
2862
|
await t.schema.dropTable("passwords").execute(), await t.schema.dropTable("codes").execute();
|
|
2761
2863
|
}
|
|
2762
|
-
const
|
|
2864
|
+
const hr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2763
2865
|
__proto__: null,
|
|
2764
|
-
down:
|
|
2765
|
-
up:
|
|
2866
|
+
down: mr,
|
|
2867
|
+
up: ur
|
|
2766
2868
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2767
|
-
async function
|
|
2869
|
+
async function _r(t) {
|
|
2768
2870
|
}
|
|
2769
|
-
async function
|
|
2871
|
+
async function fr(t) {
|
|
2770
2872
|
}
|
|
2771
|
-
const
|
|
2873
|
+
const pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2772
2874
|
__proto__: null,
|
|
2773
|
-
down:
|
|
2774
|
-
up:
|
|
2875
|
+
down: fr,
|
|
2876
|
+
up: _r
|
|
2775
2877
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2776
|
-
async function
|
|
2878
|
+
async function gr(t) {
|
|
2777
2879
|
await t.schema.alterTable("passwords").addColumn(
|
|
2778
2880
|
"password",
|
|
2779
2881
|
"varchar(255)",
|
|
@@ -2781,288 +2883,288 @@ async function lr(t) {
|
|
|
2781
2883
|
(e) => e.notNull()
|
|
2782
2884
|
).execute();
|
|
2783
2885
|
}
|
|
2784
|
-
async function
|
|
2886
|
+
async function yr(t) {
|
|
2785
2887
|
await t.schema.alterTable("passwords").dropColumn("password").execute();
|
|
2786
2888
|
}
|
|
2787
|
-
const
|
|
2889
|
+
const wr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2788
2890
|
__proto__: null,
|
|
2789
|
-
down:
|
|
2790
|
-
up:
|
|
2891
|
+
down: yr,
|
|
2892
|
+
up: gr
|
|
2791
2893
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2792
|
-
async function
|
|
2894
|
+
async function vr(t) {
|
|
2793
2895
|
}
|
|
2794
|
-
async function
|
|
2896
|
+
async function Nr(t) {
|
|
2795
2897
|
}
|
|
2796
|
-
const
|
|
2898
|
+
const Cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2797
2899
|
__proto__: null,
|
|
2798
|
-
down:
|
|
2799
|
-
up:
|
|
2900
|
+
down: Nr,
|
|
2901
|
+
up: vr
|
|
2800
2902
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2801
|
-
async function
|
|
2903
|
+
async function br(t) {
|
|
2802
2904
|
}
|
|
2803
|
-
async function
|
|
2905
|
+
async function xr(t) {
|
|
2804
2906
|
}
|
|
2805
|
-
const
|
|
2907
|
+
const Tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2806
2908
|
__proto__: null,
|
|
2807
|
-
down:
|
|
2808
|
-
up:
|
|
2909
|
+
down: xr,
|
|
2910
|
+
up: br
|
|
2809
2911
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2810
|
-
async function
|
|
2912
|
+
async function Sr(t) {
|
|
2811
2913
|
}
|
|
2812
|
-
async function
|
|
2914
|
+
async function Or(t) {
|
|
2813
2915
|
}
|
|
2814
|
-
const
|
|
2916
|
+
const kr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2815
2917
|
__proto__: null,
|
|
2816
|
-
down:
|
|
2817
|
-
up:
|
|
2918
|
+
down: Or,
|
|
2919
|
+
up: Sr
|
|
2818
2920
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2819
|
-
async function
|
|
2921
|
+
async function $r(t) {
|
|
2820
2922
|
await t.schema.createIndex("users_email_index").on("users").column("email").execute();
|
|
2821
2923
|
}
|
|
2822
|
-
async function
|
|
2924
|
+
async function Dr(t) {
|
|
2823
2925
|
await t.schema.dropIndex("users_email_index").execute();
|
|
2824
2926
|
}
|
|
2825
|
-
const
|
|
2927
|
+
const Ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2826
2928
|
__proto__: null,
|
|
2827
|
-
down:
|
|
2828
|
-
up:
|
|
2929
|
+
down: Dr,
|
|
2930
|
+
up: $r
|
|
2829
2931
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2830
|
-
async function
|
|
2932
|
+
async function Pr(t) {
|
|
2831
2933
|
await t.schema.alterTable("users").addColumn("profileData", "varchar(2048)").execute();
|
|
2832
2934
|
}
|
|
2833
|
-
async function
|
|
2935
|
+
async function jr(t) {
|
|
2834
2936
|
await t.schema.alterTable("users").dropColumn("profileData").execute();
|
|
2835
2937
|
}
|
|
2836
|
-
const
|
|
2938
|
+
const Mr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2837
2939
|
__proto__: null,
|
|
2838
|
-
down:
|
|
2839
|
-
up:
|
|
2940
|
+
down: jr,
|
|
2941
|
+
up: Pr
|
|
2840
2942
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2841
|
-
async function
|
|
2943
|
+
async function Fr(t) {
|
|
2842
2944
|
await t.schema.createIndex("users_linked_to_index").on("users").column("linked_to").execute();
|
|
2843
2945
|
}
|
|
2844
|
-
async function
|
|
2946
|
+
async function Ar(t) {
|
|
2845
2947
|
await t.schema.dropIndex("users_linked_to_index");
|
|
2846
2948
|
}
|
|
2847
|
-
const
|
|
2949
|
+
const Lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2848
2950
|
__proto__: null,
|
|
2849
|
-
down:
|
|
2850
|
-
up:
|
|
2951
|
+
down: Ar,
|
|
2952
|
+
up: Fr
|
|
2851
2953
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2852
|
-
async function
|
|
2954
|
+
async function zr(t) {
|
|
2853
2955
|
await t.schema.alterTable("users").addColumn("locale", "varchar(255)").execute();
|
|
2854
2956
|
}
|
|
2855
|
-
async function
|
|
2957
|
+
async function Jr(t) {
|
|
2856
2958
|
await t.schema.alterTable("users").dropColumn("locale").execute();
|
|
2857
2959
|
}
|
|
2858
|
-
const
|
|
2960
|
+
const Er = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2859
2961
|
__proto__: null,
|
|
2860
|
-
down:
|
|
2861
|
-
up:
|
|
2962
|
+
down: Jr,
|
|
2963
|
+
up: zr
|
|
2862
2964
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2863
|
-
async function
|
|
2965
|
+
async function Kr(t) {
|
|
2864
2966
|
await t.schema.createTable("keys").addColumn("kid", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
2865
2967
|
"tenant_id",
|
|
2866
2968
|
"varchar(255)",
|
|
2867
2969
|
(e) => e.references("tenants.id").onDelete("cascade")
|
|
2868
2970
|
).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();
|
|
2869
2971
|
}
|
|
2870
|
-
async function
|
|
2972
|
+
async function Rr(t) {
|
|
2871
2973
|
await t.schema.dropTable("keys").execute();
|
|
2872
2974
|
}
|
|
2873
|
-
const
|
|
2975
|
+
const Ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2874
2976
|
__proto__: null,
|
|
2875
|
-
down:
|
|
2876
|
-
up:
|
|
2977
|
+
down: Rr,
|
|
2978
|
+
up: Kr
|
|
2877
2979
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2878
|
-
async function
|
|
2980
|
+
async function Br(t) {
|
|
2879
2981
|
}
|
|
2880
|
-
async function
|
|
2982
|
+
async function Qr(t) {
|
|
2881
2983
|
}
|
|
2882
|
-
const
|
|
2984
|
+
const qr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2883
2985
|
__proto__: null,
|
|
2884
|
-
down:
|
|
2885
|
-
up:
|
|
2986
|
+
down: Qr,
|
|
2987
|
+
up: Br
|
|
2886
2988
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2887
|
-
async function
|
|
2989
|
+
async function Vr(t) {
|
|
2888
2990
|
}
|
|
2889
|
-
async function
|
|
2991
|
+
async function Wr(t) {
|
|
2890
2992
|
}
|
|
2891
|
-
const
|
|
2993
|
+
const Gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2892
2994
|
__proto__: null,
|
|
2893
|
-
down:
|
|
2894
|
-
up:
|
|
2995
|
+
down: Wr,
|
|
2996
|
+
up: Vr
|
|
2895
2997
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2896
|
-
async function
|
|
2998
|
+
async function Hr(t) {
|
|
2897
2999
|
await t.schema.alterTable("otps").addColumn("audience", "varchar(255)").execute();
|
|
2898
3000
|
}
|
|
2899
|
-
async function
|
|
3001
|
+
async function Xr(t) {
|
|
2900
3002
|
await t.schema.alterTable("otps").dropColumn("audience").execute();
|
|
2901
3003
|
}
|
|
2902
|
-
const
|
|
3004
|
+
const Yr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2903
3005
|
__proto__: null,
|
|
2904
|
-
down:
|
|
2905
|
-
up:
|
|
3006
|
+
down: Xr,
|
|
3007
|
+
up: Hr
|
|
2906
3008
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2907
|
-
async function
|
|
3009
|
+
async function Zr(t) {
|
|
2908
3010
|
}
|
|
2909
|
-
async function
|
|
3011
|
+
async function en(t) {
|
|
2910
3012
|
}
|
|
2911
|
-
const
|
|
3013
|
+
const tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2912
3014
|
__proto__: null,
|
|
2913
|
-
down:
|
|
2914
|
-
up:
|
|
3015
|
+
down: en,
|
|
3016
|
+
up: Zr
|
|
2915
3017
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2916
|
-
async function
|
|
3018
|
+
async function an(t) {
|
|
2917
3019
|
await t.schema.alterTable("logs").dropColumn("category").execute();
|
|
2918
3020
|
}
|
|
2919
|
-
async function
|
|
3021
|
+
async function rn(t) {
|
|
2920
3022
|
await t.schema.alterTable("logs").addColumn("category", "varchar(255)", (e) => e.notNull()).execute();
|
|
2921
3023
|
}
|
|
2922
|
-
const
|
|
3024
|
+
const nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2923
3025
|
__proto__: null,
|
|
2924
|
-
down:
|
|
2925
|
-
up:
|
|
3026
|
+
down: rn,
|
|
3027
|
+
up: an
|
|
2926
3028
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2927
|
-
async function
|
|
3029
|
+
async function on(t) {
|
|
2928
3030
|
await t.schema.alterTable("users").dropColumn("tags").execute();
|
|
2929
3031
|
}
|
|
2930
|
-
async function
|
|
3032
|
+
async function sn(t) {
|
|
2931
3033
|
await t.schema.alterTable("users").addColumn("tags", "varchar(255)").execute();
|
|
2932
3034
|
}
|
|
2933
|
-
const
|
|
3035
|
+
const dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2934
3036
|
__proto__: null,
|
|
2935
|
-
down:
|
|
2936
|
-
up:
|
|
3037
|
+
down: sn,
|
|
3038
|
+
up: on
|
|
2937
3039
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2938
|
-
async function
|
|
3040
|
+
async function cn(t) {
|
|
2939
3041
|
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();
|
|
2940
3042
|
}
|
|
2941
|
-
async function
|
|
3043
|
+
async function ln(t) {
|
|
2942
3044
|
await t.schema.dropIndex("logs_user_id"), await t.schema.dropIndex("logs_tenant_id"), await t.schema.dropIndex("logs_date");
|
|
2943
3045
|
}
|
|
2944
|
-
const
|
|
3046
|
+
const un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2945
3047
|
__proto__: null,
|
|
2946
|
-
down:
|
|
2947
|
-
up:
|
|
3048
|
+
down: ln,
|
|
3049
|
+
up: cn
|
|
2948
3050
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2949
|
-
async function
|
|
3051
|
+
async function mn(t) {
|
|
2950
3052
|
await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(8192)").execute();
|
|
2951
3053
|
}
|
|
2952
|
-
async function
|
|
3054
|
+
async function hn(t) {
|
|
2953
3055
|
await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(2048)").execute();
|
|
2954
3056
|
}
|
|
2955
|
-
const
|
|
3057
|
+
const _n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2956
3058
|
__proto__: null,
|
|
2957
|
-
down:
|
|
2958
|
-
up:
|
|
3059
|
+
down: hn,
|
|
3060
|
+
up: mn
|
|
2959
3061
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2960
|
-
async function
|
|
3062
|
+
async function fn(t) {
|
|
2961
3063
|
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();
|
|
2962
3064
|
}
|
|
2963
|
-
async function
|
|
3065
|
+
async function pn(t) {
|
|
2964
3066
|
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();
|
|
2965
3067
|
}
|
|
2966
|
-
const
|
|
3068
|
+
const gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2967
3069
|
__proto__: null,
|
|
2968
|
-
down:
|
|
2969
|
-
up:
|
|
3070
|
+
down: pn,
|
|
3071
|
+
up: fn
|
|
2970
3072
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2971
|
-
async function
|
|
3073
|
+
async function yn(t) {
|
|
2972
3074
|
await t.schema.createIndex("users_name_index").on("users").column("name").execute();
|
|
2973
3075
|
}
|
|
2974
|
-
async function
|
|
3076
|
+
async function wn(t) {
|
|
2975
3077
|
await t.schema.dropIndex("users_name_index").execute();
|
|
2976
3078
|
}
|
|
2977
|
-
const
|
|
3079
|
+
const vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2978
3080
|
__proto__: null,
|
|
2979
|
-
down:
|
|
2980
|
-
up:
|
|
3081
|
+
down: wn,
|
|
3082
|
+
up: yn
|
|
2981
3083
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2982
|
-
async function
|
|
3084
|
+
async function Nn(t) {
|
|
2983
3085
|
}
|
|
2984
|
-
async function
|
|
3086
|
+
async function Cn(t) {
|
|
2985
3087
|
await t.schema.alterTable("users").dropConstraint("unique_email_provider").execute();
|
|
2986
3088
|
}
|
|
2987
|
-
const
|
|
3089
|
+
const bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2988
3090
|
__proto__: null,
|
|
2989
|
-
down:
|
|
2990
|
-
up:
|
|
3091
|
+
down: Cn,
|
|
3092
|
+
up: Nn
|
|
2991
3093
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2992
|
-
async function
|
|
3094
|
+
async function xn(t) {
|
|
2993
3095
|
await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(8192)").execute();
|
|
2994
3096
|
}
|
|
2995
|
-
async function
|
|
3097
|
+
async function Tn(t) {
|
|
2996
3098
|
await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(1024)").execute();
|
|
2997
3099
|
}
|
|
2998
|
-
const
|
|
3100
|
+
const Sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2999
3101
|
__proto__: null,
|
|
3000
|
-
down:
|
|
3001
|
-
up:
|
|
3102
|
+
down: Tn,
|
|
3103
|
+
up: xn
|
|
3002
3104
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3003
|
-
async function
|
|
3105
|
+
async function On(t) {
|
|
3004
3106
|
await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(8192)").execute();
|
|
3005
3107
|
}
|
|
3006
|
-
async function
|
|
3108
|
+
async function kn(t) {
|
|
3007
3109
|
await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(1024)").execute();
|
|
3008
3110
|
}
|
|
3009
|
-
const
|
|
3111
|
+
const $n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3010
3112
|
__proto__: null,
|
|
3011
|
-
down:
|
|
3012
|
-
up:
|
|
3113
|
+
down: kn,
|
|
3114
|
+
up: On
|
|
3013
3115
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3014
|
-
async function
|
|
3116
|
+
async function Dn(t) {
|
|
3015
3117
|
await t.schema.createTable("branding").addColumn(
|
|
3016
3118
|
"tenant_id",
|
|
3017
3119
|
"varchar(255)",
|
|
3018
3120
|
(e) => e.references("tenants.id").onDelete("cascade").notNull().primaryKey()
|
|
3019
3121
|
).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();
|
|
3020
3122
|
}
|
|
3021
|
-
async function
|
|
3123
|
+
async function In(t) {
|
|
3022
3124
|
await t.schema.dropTable("branding").execute();
|
|
3023
3125
|
}
|
|
3024
|
-
const
|
|
3126
|
+
const Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3025
3127
|
__proto__: null,
|
|
3026
|
-
down:
|
|
3027
|
-
up:
|
|
3128
|
+
down: In,
|
|
3129
|
+
up: Dn
|
|
3028
3130
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3029
|
-
async function
|
|
3131
|
+
async function jn(t) {
|
|
3030
3132
|
}
|
|
3031
|
-
async function
|
|
3133
|
+
async function Mn(t) {
|
|
3032
3134
|
}
|
|
3033
|
-
const
|
|
3135
|
+
const Fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3034
3136
|
__proto__: null,
|
|
3035
|
-
down:
|
|
3036
|
-
up:
|
|
3137
|
+
down: Mn,
|
|
3138
|
+
up: jn
|
|
3037
3139
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3038
|
-
async function
|
|
3140
|
+
async function An(t) {
|
|
3039
3141
|
}
|
|
3040
|
-
async function
|
|
3142
|
+
async function Ln(t) {
|
|
3041
3143
|
}
|
|
3042
|
-
const
|
|
3144
|
+
const zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3043
3145
|
__proto__: null,
|
|
3044
|
-
down:
|
|
3045
|
-
up:
|
|
3146
|
+
down: Ln,
|
|
3147
|
+
up: An
|
|
3046
3148
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3047
|
-
async function
|
|
3149
|
+
async function Jn(t) {
|
|
3048
3150
|
}
|
|
3049
|
-
async function
|
|
3151
|
+
async function En(t) {
|
|
3050
3152
|
}
|
|
3051
|
-
const
|
|
3153
|
+
const Kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3052
3154
|
__proto__: null,
|
|
3053
|
-
down:
|
|
3054
|
-
up:
|
|
3155
|
+
down: En,
|
|
3156
|
+
up: Jn
|
|
3055
3157
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3056
|
-
async function
|
|
3158
|
+
async function Rn(t) {
|
|
3057
3159
|
}
|
|
3058
|
-
async function
|
|
3160
|
+
async function Un(t) {
|
|
3059
3161
|
}
|
|
3060
|
-
const
|
|
3162
|
+
const Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3061
3163
|
__proto__: null,
|
|
3062
|
-
down:
|
|
3063
|
-
up:
|
|
3164
|
+
down: Un,
|
|
3165
|
+
up: Rn
|
|
3064
3166
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3065
|
-
async function
|
|
3167
|
+
async function Qn(t) {
|
|
3066
3168
|
await t.schema.createTable("authentication_codes").addColumn(
|
|
3067
3169
|
"tenant_id",
|
|
3068
3170
|
"varchar(255)",
|
|
@@ -3073,55 +3175,55 @@ async function zn(t) {
|
|
|
3073
3175
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
3074
3176
|
).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();
|
|
3075
3177
|
}
|
|
3076
|
-
async function
|
|
3178
|
+
async function qn(t) {
|
|
3077
3179
|
await t.schema.dropTable("authentication_codes").execute();
|
|
3078
3180
|
}
|
|
3079
|
-
const
|
|
3181
|
+
const Vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3080
3182
|
__proto__: null,
|
|
3081
|
-
down:
|
|
3082
|
-
up:
|
|
3183
|
+
down: qn,
|
|
3184
|
+
up: Qn
|
|
3083
3185
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3084
|
-
async function
|
|
3186
|
+
async function Wn(t) {
|
|
3085
3187
|
}
|
|
3086
|
-
async function
|
|
3188
|
+
async function Gn(t) {
|
|
3087
3189
|
}
|
|
3088
|
-
const
|
|
3190
|
+
const Hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3089
3191
|
__proto__: null,
|
|
3090
|
-
down:
|
|
3091
|
-
up:
|
|
3192
|
+
down: Gn,
|
|
3193
|
+
up: Wn
|
|
3092
3194
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3093
|
-
async function
|
|
3195
|
+
async function Xn(t) {
|
|
3094
3196
|
await t.schema.alterTable("otps").addColumn("ip", "varchar(64)").execute();
|
|
3095
3197
|
}
|
|
3096
|
-
async function
|
|
3198
|
+
async function Yn(t) {
|
|
3097
3199
|
await t.schema.alterTable("otps").dropColumn("ip").execute();
|
|
3098
3200
|
}
|
|
3099
|
-
const
|
|
3201
|
+
const Zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3100
3202
|
__proto__: null,
|
|
3101
|
-
down:
|
|
3102
|
-
up:
|
|
3203
|
+
down: Yn,
|
|
3204
|
+
up: Xn
|
|
3103
3205
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3104
|
-
async function
|
|
3206
|
+
async function eo(t) {
|
|
3105
3207
|
await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(1024)").execute();
|
|
3106
3208
|
}
|
|
3107
|
-
async function
|
|
3209
|
+
async function to(t) {
|
|
3108
3210
|
await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(255)").execute();
|
|
3109
3211
|
}
|
|
3110
|
-
const
|
|
3212
|
+
const ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3111
3213
|
__proto__: null,
|
|
3112
|
-
down:
|
|
3113
|
-
up:
|
|
3214
|
+
down: to,
|
|
3215
|
+
up: eo
|
|
3114
3216
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3115
|
-
async function
|
|
3217
|
+
async function ro(t) {
|
|
3116
3218
|
}
|
|
3117
|
-
async function
|
|
3219
|
+
async function no(t) {
|
|
3118
3220
|
}
|
|
3119
|
-
const
|
|
3221
|
+
const oo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3120
3222
|
__proto__: null,
|
|
3121
|
-
down:
|
|
3122
|
-
up:
|
|
3223
|
+
down: no,
|
|
3224
|
+
up: ro
|
|
3123
3225
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3124
|
-
async function
|
|
3226
|
+
async function so(t) {
|
|
3125
3227
|
await t.schema.createTable("hooks").addColumn("hook_id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
|
|
3126
3228
|
"tenant_id",
|
|
3127
3229
|
"varchar(255)",
|
|
@@ -3132,33 +3234,33 @@ async function Zn(t) {
|
|
|
3132
3234
|
(e) => e.defaultTo(!1).notNull()
|
|
3133
3235
|
).addColumn("priority", "integer").execute();
|
|
3134
3236
|
}
|
|
3135
|
-
async function
|
|
3237
|
+
async function io(t) {
|
|
3136
3238
|
await t.schema.dropTable("hooks").execute();
|
|
3137
3239
|
}
|
|
3138
|
-
const
|
|
3240
|
+
const co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3139
3241
|
__proto__: null,
|
|
3140
|
-
down:
|
|
3141
|
-
up:
|
|
3242
|
+
down: io,
|
|
3243
|
+
up: so
|
|
3142
3244
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3143
|
-
async function
|
|
3245
|
+
async function lo(t) {
|
|
3144
3246
|
}
|
|
3145
|
-
async function
|
|
3247
|
+
async function uo(t) {
|
|
3146
3248
|
}
|
|
3147
|
-
const
|
|
3249
|
+
const mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3148
3250
|
__proto__: null,
|
|
3149
|
-
down:
|
|
3150
|
-
up:
|
|
3251
|
+
down: uo,
|
|
3252
|
+
up: lo
|
|
3151
3253
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3152
|
-
async function
|
|
3254
|
+
async function ho(t) {
|
|
3153
3255
|
}
|
|
3154
|
-
async function
|
|
3256
|
+
async function _o(t) {
|
|
3155
3257
|
}
|
|
3156
|
-
const
|
|
3258
|
+
const fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3157
3259
|
__proto__: null,
|
|
3158
|
-
down:
|
|
3159
|
-
up:
|
|
3260
|
+
down: _o,
|
|
3261
|
+
up: ho
|
|
3160
3262
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3161
|
-
async function
|
|
3263
|
+
async function po(t) {
|
|
3162
3264
|
await t.schema.createTable("logins").addColumn("login_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
3163
3265
|
"tenant_id",
|
|
3164
3266
|
"varchar(255)",
|
|
@@ -3175,7 +3277,7 @@ async function co(t) {
|
|
|
3175
3277
|
(e) => e.onDelete("cascade")
|
|
3176
3278
|
).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();
|
|
3177
3279
|
}
|
|
3178
|
-
async function
|
|
3280
|
+
async function go(t) {
|
|
3179
3281
|
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(
|
|
3180
3282
|
"codes_user_id_tenant_id_constraint",
|
|
3181
3283
|
["user_id", "tenant_id"],
|
|
@@ -3184,90 +3286,90 @@ async function lo(t) {
|
|
|
3184
3286
|
(e) => e.onDelete("cascade")
|
|
3185
3287
|
).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();
|
|
3186
3288
|
}
|
|
3187
|
-
const
|
|
3289
|
+
const yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3188
3290
|
__proto__: null,
|
|
3189
|
-
down:
|
|
3190
|
-
up:
|
|
3291
|
+
down: go,
|
|
3292
|
+
up: po
|
|
3191
3293
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3192
|
-
async function
|
|
3294
|
+
async function wo(t) {
|
|
3193
3295
|
}
|
|
3194
|
-
async function
|
|
3296
|
+
async function vo(t) {
|
|
3195
3297
|
}
|
|
3196
|
-
const
|
|
3298
|
+
const No = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3197
3299
|
__proto__: null,
|
|
3198
|
-
down:
|
|
3199
|
-
up:
|
|
3300
|
+
down: vo,
|
|
3301
|
+
up: wo
|
|
3200
3302
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3201
|
-
async function
|
|
3303
|
+
async function Co(t) {
|
|
3202
3304
|
await t.schema.alterTable("logins").addColumn("auth0Client", "varchar(256)").execute();
|
|
3203
3305
|
}
|
|
3204
|
-
async function
|
|
3306
|
+
async function bo(t) {
|
|
3205
3307
|
await t.schema.alterTable("logins").dropColumn("auth0Client").execute();
|
|
3206
3308
|
}
|
|
3207
|
-
const
|
|
3309
|
+
const xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3208
3310
|
__proto__: null,
|
|
3209
|
-
down:
|
|
3210
|
-
up:
|
|
3311
|
+
down: bo,
|
|
3312
|
+
up: Co
|
|
3211
3313
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3212
|
-
async function
|
|
3314
|
+
async function To(t) {
|
|
3213
3315
|
await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(8192)").execute();
|
|
3214
3316
|
}
|
|
3215
|
-
async function
|
|
3317
|
+
async function So(t) {
|
|
3216
3318
|
await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(511)").execute();
|
|
3217
3319
|
}
|
|
3218
|
-
const
|
|
3320
|
+
const Oo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3219
3321
|
__proto__: null,
|
|
3220
|
-
down:
|
|
3221
|
-
up:
|
|
3322
|
+
down: So,
|
|
3323
|
+
up: To
|
|
3222
3324
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3223
|
-
async function
|
|
3325
|
+
async function ko(t) {
|
|
3224
3326
|
}
|
|
3225
|
-
async function
|
|
3327
|
+
async function $o(t) {
|
|
3226
3328
|
}
|
|
3227
|
-
const
|
|
3329
|
+
const Do = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3228
3330
|
__proto__: null,
|
|
3229
|
-
down:
|
|
3230
|
-
up:
|
|
3331
|
+
down: $o,
|
|
3332
|
+
up: ko
|
|
3231
3333
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3232
|
-
async function
|
|
3334
|
+
async function Io(t) {
|
|
3233
3335
|
}
|
|
3234
|
-
async function
|
|
3336
|
+
async function Po(t) {
|
|
3235
3337
|
}
|
|
3236
|
-
const
|
|
3338
|
+
const jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3237
3339
|
__proto__: null,
|
|
3238
|
-
down:
|
|
3239
|
-
up:
|
|
3340
|
+
down: Po,
|
|
3341
|
+
up: Io
|
|
3240
3342
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3241
|
-
async function
|
|
3343
|
+
async function Mo(t) {
|
|
3242
3344
|
await t.schema.alterTable("logins").addColumn("authParams_nonce", "varchar(255)").execute();
|
|
3243
3345
|
}
|
|
3244
|
-
async function
|
|
3346
|
+
async function Fo(t) {
|
|
3245
3347
|
await t.schema.alterTable("logins").dropColumn("nonce").execute();
|
|
3246
3348
|
}
|
|
3247
|
-
const
|
|
3349
|
+
const Ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3248
3350
|
__proto__: null,
|
|
3249
|
-
down:
|
|
3250
|
-
up:
|
|
3351
|
+
down: Fo,
|
|
3352
|
+
up: Mo
|
|
3251
3353
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3252
|
-
async function
|
|
3354
|
+
async function Lo(t) {
|
|
3253
3355
|
}
|
|
3254
|
-
async function
|
|
3356
|
+
async function zo(t) {
|
|
3255
3357
|
}
|
|
3256
|
-
const
|
|
3358
|
+
const Jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3257
3359
|
__proto__: null,
|
|
3258
|
-
down:
|
|
3259
|
-
up:
|
|
3360
|
+
down: zo,
|
|
3361
|
+
up: Lo
|
|
3260
3362
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3261
|
-
async function
|
|
3363
|
+
async function Eo(t) {
|
|
3262
3364
|
}
|
|
3263
|
-
async function
|
|
3365
|
+
async function Ko(t) {
|
|
3264
3366
|
}
|
|
3265
|
-
const
|
|
3367
|
+
const Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3266
3368
|
__proto__: null,
|
|
3267
|
-
down:
|
|
3268
|
-
up:
|
|
3369
|
+
down: Ko,
|
|
3370
|
+
up: Eo
|
|
3269
3371
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3270
|
-
async function
|
|
3372
|
+
async function Uo(t) {
|
|
3271
3373
|
await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.notNull()).addColumn(
|
|
3272
3374
|
"tenant_id",
|
|
3273
3375
|
"varchar(255)",
|
|
@@ -3283,7 +3385,7 @@ async function Ao(t) {
|
|
|
3283
3385
|
"code_type"
|
|
3284
3386
|
]).execute();
|
|
3285
3387
|
}
|
|
3286
|
-
async function
|
|
3388
|
+
async function Bo(t) {
|
|
3287
3389
|
await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
3288
3390
|
"tenant_id",
|
|
3289
3391
|
"varchar(255)",
|
|
@@ -3296,15 +3398,15 @@ async function Lo(t) {
|
|
|
3296
3398
|
(e) => e.onDelete("cascade")
|
|
3297
3399
|
).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();
|
|
3298
3400
|
}
|
|
3299
|
-
const
|
|
3401
|
+
const Qo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3300
3402
|
__proto__: null,
|
|
3301
|
-
down:
|
|
3302
|
-
up:
|
|
3403
|
+
down: Bo,
|
|
3404
|
+
up: Uo
|
|
3303
3405
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3304
|
-
async function
|
|
3406
|
+
async function qo(t) {
|
|
3305
3407
|
await t.schema.dropTable("otps").execute(), await t.schema.dropTable("authentication_codes").execute();
|
|
3306
3408
|
}
|
|
3307
|
-
async function
|
|
3409
|
+
async function Vo(t) {
|
|
3308
3410
|
await t.schema.alterTable("keys").addColumn("private_key", "varchar(2048)").addColumn("public_key", "varchar(2048)").execute(), await t.schema.createTable("otps").addColumn(
|
|
3309
3411
|
"tenant_id",
|
|
3310
3412
|
"varchar(255)",
|
|
@@ -3323,32 +3425,32 @@ async function Jo(t) {
|
|
|
3323
3425
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
3324
3426
|
).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();
|
|
3325
3427
|
}
|
|
3326
|
-
const
|
|
3428
|
+
const Wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3327
3429
|
__proto__: null,
|
|
3328
|
-
down:
|
|
3329
|
-
up:
|
|
3430
|
+
down: Vo,
|
|
3431
|
+
up: qo
|
|
3330
3432
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3331
|
-
async function
|
|
3433
|
+
async function Go(t) {
|
|
3332
3434
|
await t.schema.createIndex("IDX_logs_tenant_date_type_user").on("logs").columns(["tenant_id", "date", "type", "user_id"]).execute();
|
|
3333
3435
|
}
|
|
3334
|
-
async function
|
|
3436
|
+
async function Ho(t) {
|
|
3335
3437
|
await t.schema.dropIndex("IDX_logs_tenant_date_type_user").on("logs").execute();
|
|
3336
3438
|
}
|
|
3337
|
-
const
|
|
3439
|
+
const Xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3338
3440
|
__proto__: null,
|
|
3339
|
-
down:
|
|
3340
|
-
up:
|
|
3441
|
+
down: Ho,
|
|
3442
|
+
up: Go
|
|
3341
3443
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3342
|
-
async function
|
|
3444
|
+
async function Yo(t) {
|
|
3343
3445
|
}
|
|
3344
|
-
async function
|
|
3446
|
+
async function Zo(t) {
|
|
3345
3447
|
}
|
|
3346
|
-
const
|
|
3448
|
+
const es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3347
3449
|
__proto__: null,
|
|
3348
|
-
down:
|
|
3349
|
-
up:
|
|
3450
|
+
down: Zo,
|
|
3451
|
+
up: Yo
|
|
3350
3452
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3351
|
-
async function
|
|
3453
|
+
async function ts(t) {
|
|
3352
3454
|
await t.schema.createTable("prompt_settings").addColumn("tenant_id", "varchar(64)", (e) => e.primaryKey()).addColumn(
|
|
3353
3455
|
"universal_login_experience",
|
|
3354
3456
|
"varchar(16)",
|
|
@@ -3367,95 +3469,95 @@ async function qo(t) {
|
|
|
3367
3469
|
(e) => e.defaultTo(!1).notNull()
|
|
3368
3470
|
).execute();
|
|
3369
3471
|
}
|
|
3370
|
-
async function
|
|
3472
|
+
async function as(t) {
|
|
3371
3473
|
await t.schema.dropTable("prompt_settings").execute();
|
|
3372
3474
|
}
|
|
3373
|
-
const
|
|
3475
|
+
const rs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3374
3476
|
__proto__: null,
|
|
3375
|
-
down:
|
|
3376
|
-
up:
|
|
3477
|
+
down: as,
|
|
3478
|
+
up: ts
|
|
3377
3479
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3378
|
-
async function
|
|
3480
|
+
async function ns(t) {
|
|
3379
3481
|
}
|
|
3380
|
-
async function
|
|
3482
|
+
async function os(t) {
|
|
3381
3483
|
}
|
|
3382
|
-
const
|
|
3484
|
+
const ss = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3383
3485
|
__proto__: null,
|
|
3384
|
-
down:
|
|
3385
|
-
up:
|
|
3486
|
+
down: os,
|
|
3487
|
+
up: ns
|
|
3386
3488
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3387
|
-
async function
|
|
3489
|
+
async function is(t) {
|
|
3388
3490
|
}
|
|
3389
|
-
async function
|
|
3491
|
+
async function ds(t) {
|
|
3390
3492
|
}
|
|
3391
|
-
const
|
|
3493
|
+
const cs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3392
3494
|
__proto__: null,
|
|
3393
|
-
down:
|
|
3394
|
-
up:
|
|
3495
|
+
down: ds,
|
|
3496
|
+
up: is
|
|
3395
3497
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3396
|
-
async function
|
|
3498
|
+
async function ls(t) {
|
|
3397
3499
|
}
|
|
3398
|
-
async function
|
|
3500
|
+
async function us(t) {
|
|
3399
3501
|
}
|
|
3400
|
-
const
|
|
3502
|
+
const ms = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3401
3503
|
__proto__: null,
|
|
3402
|
-
down:
|
|
3403
|
-
up:
|
|
3504
|
+
down: us,
|
|
3505
|
+
up: ls
|
|
3404
3506
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3405
|
-
async function
|
|
3507
|
+
async function hs(t) {
|
|
3406
3508
|
await t.schema.alterTable("logins").addColumn("authParams_ui_locales", "varchar(32)").execute();
|
|
3407
3509
|
}
|
|
3408
|
-
async function
|
|
3510
|
+
async function _s(t) {
|
|
3409
3511
|
await t.schema.alterTable("logins").dropColumn("authParams_ui_locales").execute();
|
|
3410
3512
|
}
|
|
3411
|
-
const
|
|
3513
|
+
const fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3412
3514
|
__proto__: null,
|
|
3413
|
-
down:
|
|
3414
|
-
up:
|
|
3515
|
+
down: _s,
|
|
3516
|
+
up: hs
|
|
3415
3517
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3416
|
-
async function
|
|
3518
|
+
async function ps(t) {
|
|
3417
3519
|
await t.schema.alterTable("logins").addColumn("authParams_prompt", "varchar(16)").execute();
|
|
3418
3520
|
}
|
|
3419
|
-
async function
|
|
3521
|
+
async function gs(t) {
|
|
3420
3522
|
await t.schema.alterTable("logins").dropColumn("authParams_prompt").execute();
|
|
3421
3523
|
}
|
|
3422
|
-
const
|
|
3524
|
+
const ys = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3423
3525
|
__proto__: null,
|
|
3424
|
-
down:
|
|
3425
|
-
up:
|
|
3526
|
+
down: gs,
|
|
3527
|
+
up: ps
|
|
3426
3528
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3427
|
-
async function
|
|
3529
|
+
async function ws(t) {
|
|
3428
3530
|
}
|
|
3429
|
-
async function
|
|
3531
|
+
async function vs(t) {
|
|
3430
3532
|
}
|
|
3431
|
-
const
|
|
3533
|
+
const Ns = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3432
3534
|
__proto__: null,
|
|
3433
|
-
down:
|
|
3434
|
-
up:
|
|
3535
|
+
down: vs,
|
|
3536
|
+
up: ws
|
|
3435
3537
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3436
|
-
async function
|
|
3538
|
+
async function Cs(t) {
|
|
3437
3539
|
await t.schema.alterTable("logins").addColumn("authParams_act_as", "varchar(255)").execute();
|
|
3438
3540
|
}
|
|
3439
|
-
async function
|
|
3541
|
+
async function bs(t) {
|
|
3440
3542
|
await t.schema.alterTable("logins").dropColumn("authParam_act_as").execute();
|
|
3441
3543
|
}
|
|
3442
|
-
const
|
|
3544
|
+
const xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3443
3545
|
__proto__: null,
|
|
3444
|
-
down:
|
|
3445
|
-
up:
|
|
3546
|
+
down: bs,
|
|
3547
|
+
up: Cs
|
|
3446
3548
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3447
|
-
async function
|
|
3549
|
+
async function Ts(t) {
|
|
3448
3550
|
await t.schema.alterTable("codes").addColumn("code_verifier", "varchar(128)").execute();
|
|
3449
3551
|
}
|
|
3450
|
-
async function
|
|
3552
|
+
async function Ss(t) {
|
|
3451
3553
|
await t.schema.alterTable("codes").dropColumn("code_verifier").execute();
|
|
3452
3554
|
}
|
|
3453
|
-
const
|
|
3555
|
+
const Os = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3454
3556
|
__proto__: null,
|
|
3455
|
-
down:
|
|
3456
|
-
up:
|
|
3557
|
+
down: Ss,
|
|
3558
|
+
up: Ts
|
|
3457
3559
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3458
|
-
async function
|
|
3560
|
+
async function ks(t) {
|
|
3459
3561
|
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(
|
|
3460
3562
|
"credentials",
|
|
3461
3563
|
"varchar(2048)",
|
|
@@ -3466,18 +3568,18 @@ async function Ns(t) {
|
|
|
3466
3568
|
(e) => e.notNull().defaultTo("{}")
|
|
3467
3569
|
).addColumn("created_at", "varchar(29)", (e) => e.notNull()).addColumn("updated_at", "varchar(29)", (e) => e.notNull()).execute();
|
|
3468
3570
|
}
|
|
3469
|
-
async function
|
|
3571
|
+
async function $s(t) {
|
|
3470
3572
|
await t.schema.dropTable("email_providers").execute();
|
|
3471
3573
|
}
|
|
3472
|
-
const
|
|
3574
|
+
const Ds = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3473
3575
|
__proto__: null,
|
|
3474
|
-
down:
|
|
3475
|
-
up:
|
|
3576
|
+
down: $s,
|
|
3577
|
+
up: ks
|
|
3476
3578
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3477
|
-
async function
|
|
3579
|
+
async function Is(t) {
|
|
3478
3580
|
await t.schema.dropTable("tickets").execute();
|
|
3479
3581
|
}
|
|
3480
|
-
async function
|
|
3582
|
+
async function Ps(t) {
|
|
3481
3583
|
await t.schema.createTable("tickets").addColumn(
|
|
3482
3584
|
"tenant_id",
|
|
3483
3585
|
"varchar(255)",
|
|
@@ -3488,22 +3590,22 @@ async function Ts(t) {
|
|
|
3488
3590
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
3489
3591
|
).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();
|
|
3490
3592
|
}
|
|
3491
|
-
const
|
|
3593
|
+
const js = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3492
3594
|
__proto__: null,
|
|
3493
|
-
down:
|
|
3494
|
-
up:
|
|
3595
|
+
down: Ps,
|
|
3596
|
+
up: Is
|
|
3495
3597
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3496
|
-
async function
|
|
3598
|
+
async function Ms(t) {
|
|
3497
3599
|
}
|
|
3498
|
-
async function
|
|
3600
|
+
async function Fs(t) {
|
|
3499
3601
|
await t.schema.alterTable("logins").dropColumn("ip").dropColumn("useragent").execute();
|
|
3500
3602
|
}
|
|
3501
|
-
const
|
|
3603
|
+
const As = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3502
3604
|
__proto__: null,
|
|
3503
|
-
down:
|
|
3504
|
-
up:
|
|
3605
|
+
down: Fs,
|
|
3606
|
+
up: Ms
|
|
3505
3607
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3506
|
-
async function
|
|
3608
|
+
async function Ls(t) {
|
|
3507
3609
|
await t.schema.createTable("refresh_tokens").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn(
|
|
3508
3610
|
"client_id",
|
|
3509
3611
|
"varchar(21)",
|
|
@@ -3516,27 +3618,27 @@ async function Ds(t) {
|
|
|
3516
3618
|
(e) => e.onDelete("cascade")
|
|
3517
3619
|
).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("expires_at", "varchar(35)").addColumn("idle_expires_at", "varchar(35)").addColumn("last_exchanged_at", "varchar(35)").addColumn("device", "varchar(2048)", (e) => e.notNull()).addColumn("resource_servers", "varchar(2048)", (e) => e.notNull()).addColumn("rotating", "boolean", (e) => e.notNull()).execute();
|
|
3518
3620
|
}
|
|
3519
|
-
async function
|
|
3621
|
+
async function zs(t) {
|
|
3520
3622
|
await t.schema.dropTable("refresh_tokens").execute();
|
|
3521
3623
|
}
|
|
3522
|
-
const
|
|
3624
|
+
const Js = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3523
3625
|
__proto__: null,
|
|
3524
|
-
down:
|
|
3525
|
-
up:
|
|
3626
|
+
down: zs,
|
|
3627
|
+
up: Ls
|
|
3526
3628
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3527
|
-
async function
|
|
3629
|
+
async function Es(t) {
|
|
3528
3630
|
}
|
|
3529
|
-
async function
|
|
3631
|
+
async function Ks(t) {
|
|
3530
3632
|
}
|
|
3531
|
-
const
|
|
3633
|
+
const Rs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3532
3634
|
__proto__: null,
|
|
3533
|
-
down:
|
|
3534
|
-
up:
|
|
3635
|
+
down: Ks,
|
|
3636
|
+
up: Es
|
|
3535
3637
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3536
|
-
async function
|
|
3638
|
+
async function Us(t) {
|
|
3537
3639
|
await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("refresh_tokens").execute();
|
|
3538
3640
|
}
|
|
3539
|
-
async function
|
|
3641
|
+
async function Bs(t) {
|
|
3540
3642
|
await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
3541
3643
|
"sessions_user_id_constraint",
|
|
3542
3644
|
["user_id", "tenant_id"],
|
|
@@ -3555,12 +3657,12 @@ async function Ls(t) {
|
|
|
3555
3657
|
(e) => e.onDelete("cascade")
|
|
3556
3658
|
).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("expires_at", "varchar(35)").addColumn("idle_expires_at", "varchar(35)").addColumn("last_exchanged_at", "varchar(35)").addColumn("device", "varchar(2048)", (e) => e.notNull()).addColumn("resource_servers", "varchar(2048)", (e) => e.notNull()).addColumn("rotating", "boolean", (e) => e.notNull()).execute();
|
|
3557
3659
|
}
|
|
3558
|
-
const
|
|
3660
|
+
const Qs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3559
3661
|
__proto__: null,
|
|
3560
|
-
down:
|
|
3561
|
-
up:
|
|
3662
|
+
down: Bs,
|
|
3663
|
+
up: Us
|
|
3562
3664
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3563
|
-
async function
|
|
3665
|
+
async function qs(t) {
|
|
3564
3666
|
await t.schema.createTable("sessions_2").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
3565
3667
|
"sessions_2_user_id_constraint",
|
|
3566
3668
|
["user_id", "tenant_id"],
|
|
@@ -3579,15 +3681,15 @@ async function Es(t) {
|
|
|
3579
3681
|
(e) => e.onDelete("cascade")
|
|
3580
3682
|
).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("expires_at", "varchar(35)").addColumn("idle_expires_at", "varchar(35)").addColumn("last_exchanged_at", "varchar(35)").addColumn("device", "varchar(2048)", (e) => e.notNull()).addColumn("resource_servers", "varchar(2048)", (e) => e.notNull()).addColumn("rotating", "boolean", (e) => e.notNull()).execute();
|
|
3581
3683
|
}
|
|
3582
|
-
async function
|
|
3684
|
+
async function Vs(t) {
|
|
3583
3685
|
await t.schema.dropTable("sessions_2").execute(), await t.schema.dropTable("refresh_tokens_2").execute();
|
|
3584
3686
|
}
|
|
3585
|
-
const
|
|
3687
|
+
const Ws = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3586
3688
|
__proto__: null,
|
|
3587
|
-
down:
|
|
3588
|
-
up:
|
|
3689
|
+
down: Vs,
|
|
3690
|
+
up: qs
|
|
3589
3691
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3590
|
-
async function
|
|
3692
|
+
async function Gs(t) {
|
|
3591
3693
|
await t.schema.createTable("custom_domains").addColumn(
|
|
3592
3694
|
"custom_domain_id",
|
|
3593
3695
|
"varchar(21)",
|
|
@@ -3598,49 +3700,49 @@ async function Rs(t) {
|
|
|
3598
3700
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
3599
3701
|
).addColumn("domain", "varchar(255)", (e) => e.notNull()).addColumn("primary", "boolean", (e) => e.notNull()).addColumn("status", "varchar(50)", (e) => e.notNull()).addColumn("type", "varchar(50)", (e) => e.notNull()).addColumn("origin_domain_name", "varchar(255)").addColumn("verification", "varchar(2048)").addColumn("custom_client_ip_header", "varchar(50)").addColumn("tls_policy", "varchar(50)").addColumn("domain_metadata", "varchar(2048)").addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("updated_at", "varchar(35)", (e) => e.notNull()).execute(), await t.schema.dropTable("domains").execute();
|
|
3600
3702
|
}
|
|
3601
|
-
async function
|
|
3703
|
+
async function Hs(t) {
|
|
3602
3704
|
await t.schema.dropTable("custom_domains").execute(), await t.schema.createTable("domains").addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
|
|
3603
3705
|
"tenant_id",
|
|
3604
3706
|
"varchar(255)",
|
|
3605
3707
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
3606
3708
|
).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();
|
|
3607
3709
|
}
|
|
3608
|
-
const
|
|
3710
|
+
const Xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3609
3711
|
__proto__: null,
|
|
3610
|
-
down:
|
|
3611
|
-
up:
|
|
3712
|
+
down: Hs,
|
|
3713
|
+
up: Gs
|
|
3612
3714
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3613
|
-
async function
|
|
3715
|
+
async function Ys(t) {
|
|
3614
3716
|
}
|
|
3615
|
-
async function
|
|
3717
|
+
async function Zs(t) {
|
|
3616
3718
|
await t.schema.alterTable("logins").dropColumn("authParams_organization").dropColumn("authorization_url").execute();
|
|
3617
3719
|
}
|
|
3618
|
-
const
|
|
3720
|
+
const ei = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3619
3721
|
__proto__: null,
|
|
3620
|
-
down:
|
|
3621
|
-
up:
|
|
3722
|
+
down: Zs,
|
|
3723
|
+
up: Ys
|
|
3622
3724
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3623
|
-
async function
|
|
3725
|
+
async function ti(t) {
|
|
3624
3726
|
await t.schema.alterTable("logins").dropColumn("authorization_url").execute(), await t.schema.alterTable("logins").addColumn("authorization_url", "varchar(2048)").execute();
|
|
3625
3727
|
}
|
|
3626
|
-
async function
|
|
3728
|
+
async function ai(t) {
|
|
3627
3729
|
await t.schema.alterTable("logins").dropColumn("authorization_url").execute(), await t.schema.alterTable("logins").addColumn("authorization_url", "varchar(1024)").execute();
|
|
3628
3730
|
}
|
|
3629
|
-
const
|
|
3731
|
+
const ri = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3630
3732
|
__proto__: null,
|
|
3631
|
-
down:
|
|
3632
|
-
up:
|
|
3733
|
+
down: ai,
|
|
3734
|
+
up: ti
|
|
3633
3735
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3634
|
-
async function
|
|
3736
|
+
async function ni(t) {
|
|
3635
3737
|
}
|
|
3636
|
-
async function
|
|
3738
|
+
async function oi(t) {
|
|
3637
3739
|
}
|
|
3638
|
-
const
|
|
3740
|
+
const si = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3639
3741
|
__proto__: null,
|
|
3640
|
-
down:
|
|
3641
|
-
up:
|
|
3742
|
+
down: oi,
|
|
3743
|
+
up: ni
|
|
3642
3744
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3643
|
-
async function
|
|
3745
|
+
async function ii(t) {
|
|
3644
3746
|
await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
3645
3747
|
"sessions_user_id_constraint",
|
|
3646
3748
|
["user_id", "tenant_id"],
|
|
@@ -3667,25 +3769,25 @@ async function ei(t) {
|
|
|
3667
3769
|
(e) => e.onDelete("cascade")
|
|
3668
3770
|
).addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("expires_at", "varchar(35)").addColumn("idle_expires_at", "varchar(35)").addColumn("last_exchanged_at", "varchar(35)").addColumn("device", "varchar(2048)", (e) => e.notNull()).addColumn("resource_servers", "varchar(2048)", (e) => e.notNull()).addColumn("rotating", "boolean", (e) => e.notNull()).execute();
|
|
3669
3771
|
}
|
|
3670
|
-
async function
|
|
3772
|
+
async function di(t) {
|
|
3671
3773
|
await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("login_sessions").execute(), await t.schema.dropTable("refresh_tokens").execute();
|
|
3672
3774
|
}
|
|
3673
|
-
const
|
|
3775
|
+
const ci = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3674
3776
|
__proto__: null,
|
|
3675
|
-
down:
|
|
3676
|
-
up:
|
|
3777
|
+
down: di,
|
|
3778
|
+
up: ii
|
|
3677
3779
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3678
|
-
async function
|
|
3780
|
+
async function li(t) {
|
|
3679
3781
|
await t.schema.dropTable("logins").execute(), await t.schema.dropTable("sessions_2").execute(), await t.schema.dropTable("refresh_tokens_2").execute();
|
|
3680
3782
|
}
|
|
3681
|
-
async function
|
|
3783
|
+
async function ui(t) {
|
|
3682
3784
|
}
|
|
3683
|
-
const
|
|
3785
|
+
const mi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3684
3786
|
__proto__: null,
|
|
3685
|
-
down:
|
|
3686
|
-
up:
|
|
3787
|
+
down: ui,
|
|
3788
|
+
up: li
|
|
3687
3789
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3688
|
-
async function
|
|
3790
|
+
async function hi(t) {
|
|
3689
3791
|
await t.schema.dropTable("custom_domains").execute(), await t.schema.createTable("custom_domains").addColumn(
|
|
3690
3792
|
"custom_domain_id",
|
|
3691
3793
|
"varchar(256)",
|
|
@@ -3696,153 +3798,166 @@ async function si(t) {
|
|
|
3696
3798
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
3697
3799
|
).addColumn("domain", "varchar(255)", (e) => e.notNull()).addColumn("primary", "boolean", (e) => e.notNull()).addColumn("status", "varchar(50)", (e) => e.notNull()).addColumn("type", "varchar(50)", (e) => e.notNull()).addColumn("origin_domain_name", "varchar(255)").addColumn("verification", "varchar(2048)").addColumn("custom_client_ip_header", "varchar(50)").addColumn("tls_policy", "varchar(50)").addColumn("domain_metadata", "varchar(2048)").addColumn("created_at", "varchar(35)", (e) => e.notNull()).addColumn("updated_at", "varchar(35)", (e) => e.notNull()).execute();
|
|
3698
3800
|
}
|
|
3699
|
-
async function
|
|
3801
|
+
async function _i(t) {
|
|
3700
3802
|
}
|
|
3701
|
-
const
|
|
3803
|
+
const fi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3702
3804
|
__proto__: null,
|
|
3703
|
-
down:
|
|
3704
|
-
up:
|
|
3805
|
+
down: _i,
|
|
3806
|
+
up: hi
|
|
3705
3807
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3706
|
-
async function
|
|
3808
|
+
async function pi(t) {
|
|
3707
3809
|
}
|
|
3708
|
-
async function
|
|
3810
|
+
async function gi(t) {
|
|
3709
3811
|
await t.schema.alterTable("users").dropColumn("phone_number").dropColumn("phone_verified").dropColumn("username").execute();
|
|
3710
3812
|
}
|
|
3711
|
-
const
|
|
3712
|
-
__proto__: null,
|
|
3713
|
-
down:
|
|
3714
|
-
up:
|
|
3715
|
-
}, Symbol.toStringTag, { value: "Module" }))
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3813
|
+
const yi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3814
|
+
__proto__: null,
|
|
3815
|
+
down: gi,
|
|
3816
|
+
up: pi
|
|
3817
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
3818
|
+
async function wi(t) {
|
|
3819
|
+
await t.schema.createTable("forms").addColumn("id", "varchar(255)", (e) => e.primaryKey()).addColumn("name", "varchar(255)", (e) => e.notNull()).addColumn("tenant_id", "varchar(255)", (e) => e.notNull()).addColumn("messages", "jsonb").addColumn("languages", "jsonb").addColumn("translations", "jsonb").addColumn("nodes", "jsonb").addColumn("start", "jsonb").addColumn("ending", "jsonb").addColumn("style", "jsonb").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("updated_at", "varchar(255)", (e) => e.notNull()).execute(), await t.schema.createIndex("forms_tenant_id_idx").on("forms").column("tenant_id").execute();
|
|
3820
|
+
}
|
|
3821
|
+
async function vi(t) {
|
|
3822
|
+
await t.schema.dropTable("forms").execute();
|
|
3823
|
+
}
|
|
3824
|
+
const Ni = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3825
|
+
__proto__: null,
|
|
3826
|
+
down: vi,
|
|
3827
|
+
up: wi
|
|
3828
|
+
}, Symbol.toStringTag, { value: "Module" })), ze = {
|
|
3829
|
+
m1_init: Ga,
|
|
3830
|
+
m2_magicLink: Ya,
|
|
3831
|
+
m3_updateAt: tr,
|
|
3832
|
+
m4_logTable: nr,
|
|
3833
|
+
m5_userProfile: ir,
|
|
3834
|
+
m6_sessions: lr,
|
|
3835
|
+
m7_passwords: hr,
|
|
3836
|
+
m8_logsTableNewFields: pr,
|
|
3837
|
+
m9_passwordTableNewField: wr,
|
|
3838
|
+
n01_codesTable: Cr,
|
|
3839
|
+
n11_universalLoginSession: Tr,
|
|
3840
|
+
n12_userFields: kr,
|
|
3841
|
+
n13_userEmailIndex: Ir,
|
|
3842
|
+
n14_profileDataField: Mr,
|
|
3843
|
+
n15_userEmailIndex: Lr,
|
|
3844
|
+
n16_userLocale: Er,
|
|
3845
|
+
n17_signingKeys: Ur,
|
|
3846
|
+
n18_logsFields: qr,
|
|
3847
|
+
n19_connectionsUserinfo: Gr,
|
|
3848
|
+
n20_missingFields: Yr,
|
|
3849
|
+
n21_sessionDeletedAt: tn,
|
|
3850
|
+
n22_dropLogsFields: nn,
|
|
3851
|
+
n23_dropUsersFields: dn,
|
|
3852
|
+
n24_logsIndexes: un,
|
|
3853
|
+
n25_logDescMaxLength: _n,
|
|
3854
|
+
n26_logsTableExtraFields: gn,
|
|
3855
|
+
n27_usersTableNameIndex: vn,
|
|
3856
|
+
n28_usersEmailConstrain: bn,
|
|
3857
|
+
n29_increaseOtpStateLength: Sn,
|
|
3858
|
+
n30_increaseTicketStateLength: $n,
|
|
3859
|
+
n31_branding: Pn,
|
|
3860
|
+
n32_indexesAndNotNull: Fn,
|
|
3861
|
+
n33_vendorIdInUniversalLoginSession: zn,
|
|
3862
|
+
n34_auth0ClientInUniversalLoginSession: Kn,
|
|
3863
|
+
n35_increaseUniversalSessionStateLength: Bn,
|
|
3864
|
+
n36_authenticationCodes: Vn,
|
|
3865
|
+
n37_disableSignUps: Hn,
|
|
3866
|
+
n38_otpIpAddress: Zn,
|
|
3867
|
+
n39_increaseUserAgentLength: ao,
|
|
3868
|
+
n40_userId: oo,
|
|
3869
|
+
n41_hooks: co,
|
|
3870
|
+
n42_userIdIndexes: mo,
|
|
3871
|
+
n43_userIdIndexes: fo,
|
|
3872
|
+
n44_codes: yo,
|
|
3873
|
+
n45_hookProperties: No,
|
|
3874
|
+
n46_loginAuth0Client: xo,
|
|
3875
|
+
n47_loginAuth0Client: Oo,
|
|
3876
|
+
n48_saml: Do,
|
|
3877
|
+
n49_removeFields: jo,
|
|
3878
|
+
n50_authParamsNonce: Ao,
|
|
3879
|
+
n51_connectionid: Jo,
|
|
3880
|
+
n52_cert: Ro,
|
|
3881
|
+
n53_codes_primary_key: Qo,
|
|
3882
|
+
n54_cleanup_tables: Wo,
|
|
3883
|
+
n55_logs_index: Xo,
|
|
3884
|
+
n56_application_fields: es,
|
|
3885
|
+
n57_prompt_settings: rs,
|
|
3886
|
+
n58_connection_client_id: ss,
|
|
3887
|
+
n59_connection_options: cs,
|
|
3888
|
+
n60_users_metadata: ms,
|
|
3889
|
+
n61_userLocales: fs,
|
|
3890
|
+
n62_prompt: ys,
|
|
3891
|
+
n63_connection_cleanup: Ns,
|
|
3892
|
+
n64_act_as: xs,
|
|
3893
|
+
n65_code_verifier: Os,
|
|
3894
|
+
n66_email_providers: Ds,
|
|
3895
|
+
n67_drop_tickets: js,
|
|
3896
|
+
n68_login_useragents: As,
|
|
3897
|
+
n70_refresh_tokens: Js,
|
|
3898
|
+
n71_session_new_fields: Rs,
|
|
3899
|
+
n72_session_primary_key: Qs,
|
|
3900
|
+
n73_drop_sessions: Ws,
|
|
3901
|
+
n74_custom_domains: Xs,
|
|
3902
|
+
n75_organizations: ei,
|
|
3903
|
+
n76_authorization_url_length: ri,
|
|
3904
|
+
n77_drop_sessions: si,
|
|
3905
|
+
n78_login_sessions: ci,
|
|
3906
|
+
n79_drop_sessions_2: mi,
|
|
3907
|
+
n80_recreate_custom_domains: fi,
|
|
3908
|
+
n81_phone: yi,
|
|
3909
|
+
n82_forms: Ni
|
|
3796
3910
|
};
|
|
3797
|
-
async function
|
|
3911
|
+
async function Si(t, e = !1) {
|
|
3798
3912
|
e && console.log("migrating...");
|
|
3799
|
-
const a = new
|
|
3913
|
+
const a = new Le(ze), r = new Ce({
|
|
3800
3914
|
db: t,
|
|
3801
3915
|
provider: a
|
|
3802
|
-
}), { error:
|
|
3803
|
-
if (
|
|
3916
|
+
}), { error: n, results: o } = await r.migrateToLatest();
|
|
3917
|
+
if (o == null || o.forEach((s) => {
|
|
3804
3918
|
s.status === "Success" ? e && console.log(
|
|
3805
3919
|
`migration "${s.migrationName}" was executed successfully`
|
|
3806
3920
|
) : s.status === "Error" && console.error(`failed to execute migration "${s.migrationName}"`);
|
|
3807
|
-
}),
|
|
3808
|
-
throw console.error("failed to migrate"), console.error(
|
|
3921
|
+
}), n)
|
|
3922
|
+
throw console.error("failed to migrate"), console.error(n), n;
|
|
3809
3923
|
}
|
|
3810
|
-
async function
|
|
3924
|
+
async function Oi(t) {
|
|
3811
3925
|
console.log("migrating...");
|
|
3812
|
-
const e = new
|
|
3926
|
+
const e = new Le(ze), a = new Ce({
|
|
3813
3927
|
db: t,
|
|
3814
3928
|
provider: e
|
|
3815
|
-
}), { error: r, results:
|
|
3816
|
-
if (
|
|
3817
|
-
|
|
3929
|
+
}), { error: r, results: n } = await a.migrateDown();
|
|
3930
|
+
if (n == null || n.forEach((o) => {
|
|
3931
|
+
o.status === "Success" ? console.log(`migration "${o.migrationName}" was reverted successfully`) : o.status === "Error" && console.error(`failed to execute migration "${o.migrationName}"`);
|
|
3818
3932
|
}), r)
|
|
3819
3933
|
throw console.error("failed to migrate"), console.error(r), r;
|
|
3820
3934
|
}
|
|
3821
|
-
function
|
|
3935
|
+
function ki(t) {
|
|
3822
3936
|
return {
|
|
3823
|
-
applications:
|
|
3824
|
-
branding:
|
|
3825
|
-
cleanup:
|
|
3826
|
-
clients:
|
|
3827
|
-
codes:
|
|
3828
|
-
connections:
|
|
3829
|
-
emailProviders:
|
|
3830
|
-
customDomains:
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3937
|
+
applications: Pt(t),
|
|
3938
|
+
branding: Zt(t),
|
|
3939
|
+
cleanup: Da(t),
|
|
3940
|
+
clients: Jt(t),
|
|
3941
|
+
codes: St(t),
|
|
3942
|
+
connections: zt(t),
|
|
3943
|
+
emailProviders: ba(t),
|
|
3944
|
+
customDomains: Ht(t),
|
|
3945
|
+
forms: Aa(t),
|
|
3946
|
+
hooks: oa(t),
|
|
3947
|
+
keys: Ut(t),
|
|
3948
|
+
loginSessions: pa(t),
|
|
3949
|
+
logs: lt(t),
|
|
3950
|
+
passwords: vt(t),
|
|
3951
|
+
promptSettings: wa(t),
|
|
3952
|
+
refreshTokens: $a(t),
|
|
3953
|
+
sessions: pt(t),
|
|
3954
|
+
tenants: ot(t),
|
|
3955
|
+
themes: ua(t),
|
|
3956
|
+
users: Ye(t)
|
|
3842
3957
|
};
|
|
3843
3958
|
}
|
|
3844
3959
|
export {
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3960
|
+
ki as default,
|
|
3961
|
+
Oi as migrateDown,
|
|
3962
|
+
Si as migrateToLatest
|
|
3848
3963
|
};
|