@authhero/kysely-adapter 10.9.0 → 10.11.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 +749 -71
- package/dist/kysely-adapter.mjs +986 -887
- 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 d = (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,7 +23,7 @@ var V = class extends Error {
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
function
|
|
26
|
+
function Qe(t) {
|
|
27
27
|
return async (e, a) => {
|
|
28
28
|
const { identities: r, ...o } = a, n = {
|
|
29
29
|
...o,
|
|
@@ -56,7 +56,7 @@ function _(t) {
|
|
|
56
56
|
e[a] === null ? delete e[a] : typeof e[a] == "object" && (Array.isArray(e[a]) ? e[a] = e[a].map(_) : e[a] = _(e[a]));
|
|
57
57
|
return e;
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function 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,7 +75,7 @@ function fe(t) {
|
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function qe(t) {
|
|
79
79
|
return async (e, a) => {
|
|
80
80
|
const [r, o] = await Promise.all([
|
|
81
81
|
t.selectFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", a).selectAll().executeTakeFirst(),
|
|
@@ -94,22 +94,22 @@ 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
|
-
...o.map(
|
|
100
|
+
...o.map(pe)
|
|
101
101
|
]
|
|
102
102
|
};
|
|
103
103
|
return _(l);
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function T(t, e, a, r) {
|
|
107
107
|
return a.split(/\s+/).map((n) => n.replace(/^([^:]+)=/g, "$1:")).map((n) => {
|
|
108
|
-
let s = n.startsWith("-"), l,
|
|
109
|
-
return n.startsWith("-_exists_:") ? (l = n.substring(10), g = !0, s = !0) : n.startsWith("_exists_:") ? (l = n.substring(9), g = !0, s = !1) : n.includes(":") ? (s = n.startsWith("-"), [l,
|
|
110
|
-
}).forEach(({ key: n, value: s, isNegation: l, isExistsQuery:
|
|
108
|
+
let s = n.startsWith("-"), l, c, g, m;
|
|
109
|
+
return n.startsWith("-_exists_:") ? (l = n.substring(10), g = !0, s = !0) : n.startsWith("_exists_:") ? (l = n.substring(9), g = !0, s = !1) : n.includes(":") ? (s = n.startsWith("-"), [l, c] = s ? n.substring(1).split(":") : n.split(":"), g = !1, c.startsWith(">=") ? (m = ">=", c = c.substring(2)) : c.startsWith(">") ? (m = ">", c = c.substring(1)) : c.startsWith("<=") ? (m = "<=", c = c.substring(2)) : c.startsWith("<") ? (m = "<", c = c.substring(1)) : m = "=") : (l = null, c = n, g = !1), { key: l, value: c, isNegation: s, isExistsQuery: g, operator: m };
|
|
110
|
+
}).forEach(({ key: n, value: s, isNegation: l, isExistsQuery: c, operator: g }) => {
|
|
111
111
|
if (n)
|
|
112
|
-
if (
|
|
112
|
+
if (c)
|
|
113
113
|
l ? e = e.where(n, "is", null) : e = e.where(n, "is not", null);
|
|
114
114
|
else if (l)
|
|
115
115
|
switch (g) {
|
|
@@ -134,13 +134,13 @@ function O(t, e, a, r) {
|
|
|
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,13 +150,13 @@ 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 n = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), s = n.map((m) => m.user_id), l = s.length ? await t.selectFrom("users").selectAll().where("users.tenant_id", "=", e).where("users.linked_to", "in", s).execute() : [],
|
|
157
|
+
const n = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), s = n.map((m) => m.user_id), l = s.length ? await t.selectFrom("users").selectAll().where("users.tenant_id", "=", e).where("users.linked_to", "in", s).execute() : [], c = n.map((m) => {
|
|
158
158
|
const w = l.filter(
|
|
159
|
-
(
|
|
159
|
+
(x) => x.linked_to === m.user_id
|
|
160
160
|
);
|
|
161
161
|
return _({
|
|
162
162
|
...m,
|
|
@@ -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
177
|
}), { count: g } = await r.select((m) => m.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
178
178
|
return {
|
|
179
|
-
users:
|
|
179
|
+
users: c,
|
|
180
180
|
start: a.page * a.per_page,
|
|
181
181
|
limit: a.per_page,
|
|
182
|
-
length:
|
|
182
|
+
length: b(g)
|
|
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
195
|
const o = {
|
|
196
196
|
...r,
|
|
197
|
-
email_verified:
|
|
197
|
+
email_verified: Ge(r),
|
|
198
198
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
199
199
|
};
|
|
200
200
|
return r.app_metadata && (o.app_metadata = JSON.stringify(r.app_metadata)), r.user_metadata && (o.user_metadata = JSON.stringify(r.user_metadata)), (await t.updateTable("users").set(o).where("users.tenant_id", "=", e).where("users.user_id", "=", a).execute()).length === 1;
|
|
201
201
|
};
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function Xe(t) {
|
|
204
204
|
return async (e, a, r, o) => {
|
|
205
205
|
const n = { linked_to: null };
|
|
206
206
|
return (await t.updateTable("users").set(n).where("users.tenant_id", "=", e).where("users.user_id", "=", `${r}|${o}`).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
241
|
return a ? _(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,
|
|
@@ -258,7 +258,7 @@ function tt(t) {
|
|
|
258
258
|
return {
|
|
259
259
|
tenants: o
|
|
260
260
|
};
|
|
261
|
-
const { count: n } = await a.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow(), s =
|
|
261
|
+
const { count: n } = await a.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow(), s = b(n);
|
|
262
262
|
return {
|
|
263
263
|
tenants: o.map(_),
|
|
264
264
|
start: (e.page - 1) * e.per_page,
|
|
@@ -267,7 +267,7 @@ function tt(t) {
|
|
|
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,29 +277,29 @@ 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
298
|
var o, n, 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,
|
|
@@ -308,12 +308,12 @@ function st(t) {
|
|
|
308
308
|
isMobile: a.isMobile ? 1 : 0,
|
|
309
309
|
tenant_id: e,
|
|
310
310
|
scope: (n = a.scope) == null ? void 0 : n.join(","),
|
|
311
|
-
auth0_client:
|
|
312
|
-
details: (s =
|
|
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,27 +322,27 @@ 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 ct(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 =
|
|
345
|
+
a.q && (r = T(t, r, a.q, ["user_id", "ip"]));
|
|
346
346
|
let o = r;
|
|
347
347
|
if (a.sort && a.sort.sort_by) {
|
|
348
348
|
const { ref: l } = t.dynamic;
|
|
@@ -354,27 +354,27 @@ function it(t) {
|
|
|
354
354
|
o = o.offset(a.page * a.per_page).limit(a.per_page);
|
|
355
355
|
const n = await o.selectAll().execute(), { count: s } = await r.select((l) => l.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
356
356
|
return {
|
|
357
|
-
logs: n.map(
|
|
357
|
+
logs: n.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 lt(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 dt(t) {
|
|
371
371
|
return {
|
|
372
|
-
create:
|
|
373
|
-
list:
|
|
374
|
-
get:
|
|
372
|
+
create: it(t),
|
|
373
|
+
list: ct(t),
|
|
374
|
+
get: lt(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)
|
|
@@ -387,7 +387,7 @@ function lt(t) {
|
|
|
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,10 +404,10 @@ 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
412
|
const o = {
|
|
413
413
|
...r,
|
|
@@ -418,29 +418,29 @@ function ht(t) {
|
|
|
418
418
|
return !!(await t.updateTable("sessions").set(o).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 =
|
|
428
|
+
a.q && (r = T(t, r, a.q, ["user_id", "session_id"]));
|
|
429
429
|
let o = r;
|
|
430
430
|
if (a.sort && a.sort.sort_by) {
|
|
431
|
-
const { ref:
|
|
431
|
+
const { ref: c } = t.dynamic;
|
|
432
432
|
o = o.orderBy(
|
|
433
|
-
|
|
433
|
+
c(a.sort.sort_by),
|
|
434
434
|
a.sort.sort_order
|
|
435
435
|
);
|
|
436
436
|
}
|
|
437
437
|
o = o.offset(a.page * a.per_page).limit(a.per_page);
|
|
438
|
-
const n = await o.selectAll().execute(), { count: s } = await r.select((
|
|
438
|
+
const n = await o.selectAll().execute(), { count: s } = await r.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), l = b(s);
|
|
439
439
|
return {
|
|
440
|
-
sessions: n.map((
|
|
441
|
-
...
|
|
442
|
-
device: JSON.parse(
|
|
443
|
-
clients: JSON.parse(
|
|
440
|
+
sessions: n.map((c) => ({
|
|
441
|
+
...c,
|
|
442
|
+
device: JSON.parse(c.device),
|
|
443
|
+
clients: JSON.parse(c.clients)
|
|
444
444
|
})),
|
|
445
445
|
start: a.page * a.per_page,
|
|
446
446
|
limit: a.per_page,
|
|
@@ -448,16 +448,16 @@ function _t(t) {
|
|
|
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)
|
|
@@ -466,7 +466,7 @@ function pt(t) {
|
|
|
466
466
|
return n;
|
|
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 n = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), { count: s } = await r.select((
|
|
502
|
+
a.q && (r = T(t, r, a.q, ["code", "login_id"]));
|
|
503
|
+
const n = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), { count: s } = await r.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
504
504
|
return {
|
|
505
|
-
codes: n.map((
|
|
506
|
-
const { tenant_id: g, ...m } =
|
|
507
|
-
return
|
|
505
|
+
codes: n.map((c) => {
|
|
506
|
+
const { tenant_id: g, ...m } = c;
|
|
507
|
+
return Ke.parse(_(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,10 +524,10 @@ 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
532
|
let o = t.selectFrom("codes").where("codes.code_id", "=", a).where("codes.code_type", "=", r);
|
|
533
533
|
e.length && (o = o.where("codes.tenant_id", "=", e));
|
|
@@ -535,25 +535,25 @@ function bt(t) {
|
|
|
535
535
|
return n ? _(n) : 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
|
-
}, o = JSON.stringify(a.allowed_origins), n = JSON.stringify(a.callbacks), s = JSON.stringify(a.web_origins), l = JSON.stringify(a.allowed_logout_urls),
|
|
556
|
+
}, o = JSON.stringify(a.allowed_origins), n = JSON.stringify(a.callbacks), s = JSON.stringify(a.web_origins), l = JSON.stringify(a.allowed_logout_urls), c = JSON.stringify(a.allowed_clients);
|
|
557
557
|
return await t.insertInto("applications").values({
|
|
558
558
|
...r,
|
|
559
559
|
tenant_id: e,
|
|
@@ -563,11 +563,11 @@ function St(t) {
|
|
|
563
563
|
allowed_origins: o,
|
|
564
564
|
web_origins: s,
|
|
565
565
|
allowed_logout_urls: l,
|
|
566
|
-
allowed_clients:
|
|
566
|
+
allowed_clients: c
|
|
567
567
|
}).execute(), r;
|
|
568
568
|
};
|
|
569
569
|
}
|
|
570
|
-
function
|
|
570
|
+
function kt(t) {
|
|
571
571
|
return async (e) => ({
|
|
572
572
|
applications: (await t.selectFrom("applications").where("applications.tenant_id", "=", e).selectAll().execute()).map((n) => ({
|
|
573
573
|
...n,
|
|
@@ -581,7 +581,7 @@ function Ot(t) {
|
|
|
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
587
|
return r ? _({
|
|
@@ -595,10 +595,10 @@ 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
603
|
const o = {
|
|
604
604
|
...r,
|
|
@@ -614,19 +614,19 @@ function Dt(t) {
|
|
|
614
614
|
return await t.updateTable("applications").set(o).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,32 +639,32 @@ 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
|
-
(
|
|
652
|
-
...
|
|
653
|
-
options: JSON.parse(
|
|
651
|
+
(c) => _({
|
|
652
|
+
...c,
|
|
653
|
+
options: JSON.parse(c.options)
|
|
654
654
|
})
|
|
655
|
-
), { count: l } = await r.select((
|
|
655
|
+
), { count: l } = await r.select((c) => c.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(l)
|
|
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
670
|
return r ? _({
|
|
@@ -673,7 +673,7 @@ function Ft(t) {
|
|
|
673
673
|
}) : null;
|
|
674
674
|
};
|
|
675
675
|
}
|
|
676
|
-
function
|
|
676
|
+
function Lt(t) {
|
|
677
677
|
return async (e, a, r) => {
|
|
678
678
|
const o = {
|
|
679
679
|
...r,
|
|
@@ -685,16 +685,16 @@ function At(t) {
|
|
|
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();
|
|
@@ -707,7 +707,7 @@ function zt(t) {
|
|
|
707
707
|
return {
|
|
708
708
|
...a,
|
|
709
709
|
connections: o.map(
|
|
710
|
-
(s) =>
|
|
710
|
+
(s) => Re.parse(
|
|
711
711
|
_({
|
|
712
712
|
...s,
|
|
713
713
|
options: s.options ? JSON.parse(s.options) : {}
|
|
@@ -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) {
|
|
@@ -795,7 +795,7 @@ function Wt(t) {
|
|
|
795
795
|
return (await t.updateTable("custom_domains").set(o).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,17 +804,17 @@ 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)
|
|
@@ -825,7 +825,7 @@ function Ht(t) {
|
|
|
825
825
|
colors_page_background_type: n,
|
|
826
826
|
colors_page_background_start: s,
|
|
827
827
|
colors_page_background_end: l,
|
|
828
|
-
colors_page_background_angle_dev:
|
|
828
|
+
colors_page_background_angle_dev: c,
|
|
829
829
|
font_url: g,
|
|
830
830
|
...m
|
|
831
831
|
} = a;
|
|
@@ -837,72 +837,72 @@ function Ht(t) {
|
|
|
837
837
|
type: n,
|
|
838
838
|
start: s,
|
|
839
839
|
end: l,
|
|
840
|
-
angle_deg:
|
|
840
|
+
angle_deg: c
|
|
841
841
|
}
|
|
842
842
|
},
|
|
843
843
|
font: g ? { url: g } : void 0
|
|
844
844
|
});
|
|
845
845
|
};
|
|
846
846
|
}
|
|
847
|
-
function
|
|
847
|
+
function Yt(t) {
|
|
848
848
|
return async (e, a) => {
|
|
849
|
-
var s, l,
|
|
849
|
+
var s, l, c, g, m, w, x, ee, te, ae, re, ne, oe, se, ie, ce, le, de;
|
|
850
850
|
const { colors: r, font: o, ...n } = a;
|
|
851
851
|
try {
|
|
852
852
|
await t.insertInto("branding").values({
|
|
853
853
|
...n,
|
|
854
854
|
colors_primary: r == null ? void 0 : r.primary,
|
|
855
855
|
colors_page_background_type: (l = (s = a.colors) == null ? void 0 : s.page_background) == null ? void 0 : l.type,
|
|
856
|
-
colors_page_background_start: (g = (
|
|
856
|
+
colors_page_background_start: (g = (c = a.colors) == null ? void 0 : c.page_background) == null ? void 0 : g.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
|
...n,
|
|
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: (le = (ce = a.colors) == null ? void 0 : ce.page_background) == null ? void 0 : le.angle_deg,
|
|
870
|
+
font_url: (de = a.font) == null ? void 0 : de.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 n = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), { count: s } = await r.select((
|
|
888
|
+
a.q && (r = T(t, r, a.q, ["url"]));
|
|
889
|
+
const n = await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute(), { count: s } = await r.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
890
890
|
return {
|
|
891
|
-
hooks: n.map((
|
|
892
|
-
const { tenant_id: g, enabled: m, synchronous: w, ...
|
|
891
|
+
hooks: n.map((c) => {
|
|
892
|
+
const { tenant_id: g, enabled: m, synchronous: w, ...x } = c;
|
|
893
893
|
return _({
|
|
894
|
-
...
|
|
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
908
|
return r ? _({
|
|
@@ -912,13 +912,13 @@ function ea(t) {
|
|
|
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,7 +931,7 @@ 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
936
|
const o = {
|
|
937
937
|
...r,
|
|
@@ -942,24 +942,24 @@ function ra(t) {
|
|
|
942
942
|
return await t.updateTable("hooks").set(o).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
957
|
const o = e ? `${e}_${r}` : r;
|
|
958
|
-
typeof t[r] == "object" && t[r] !== null && !Array.isArray(t[r]) ?
|
|
958
|
+
typeof t[r] == "object" && t[r] !== null && !Array.isArray(t[r]) ? J(t[r], o, a) : a[o] = t[r];
|
|
959
959
|
}
|
|
960
960
|
return a;
|
|
961
961
|
}
|
|
962
|
-
function
|
|
962
|
+
function sa(t, e) {
|
|
963
963
|
const a = {};
|
|
964
964
|
for (const [r, o] of Object.entries(t)) {
|
|
965
965
|
const n = e.find(
|
|
@@ -977,79 +977,79 @@ function oa(t, e) {
|
|
|
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 ca(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 la(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
997
|
return r ? _(r) : null;
|
|
998
998
|
};
|
|
999
999
|
}
|
|
1000
|
-
function
|
|
1000
|
+
function da(t) {
|
|
1001
1001
|
return async (e, a, r) => {
|
|
1002
|
-
const o =
|
|
1002
|
+
const o = J({
|
|
1003
1003
|
...r,
|
|
1004
1004
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1005
1005
|
});
|
|
1006
1006
|
return await t.updateTable("themes").set(o).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: la(t),
|
|
1013
|
+
remove: ca(t),
|
|
1014
|
+
update: da(t)
|
|
1015
1015
|
};
|
|
1016
1016
|
}
|
|
1017
|
-
function
|
|
1017
|
+
function ma(t) {
|
|
1018
1018
|
return async (e, a) => {
|
|
1019
1019
|
const r = (/* @__PURE__ */ new Date()).toISOString(), o = await t.selectFrom("login_sessions").where("login_sessions.expires_at", ">", r).where("login_sessions.id", "=", a).selectAll().executeTakeFirst();
|
|
1020
|
-
return o ?
|
|
1021
|
-
|
|
1020
|
+
return o ? Ue.parse(
|
|
1021
|
+
sa(_(o), ["authParams"])
|
|
1022
1022
|
) : null;
|
|
1023
1023
|
};
|
|
1024
1024
|
}
|
|
1025
|
-
function
|
|
1025
|
+
function ha(t) {
|
|
1026
1026
|
return async (e, a) => {
|
|
1027
1027
|
var o;
|
|
1028
1028
|
const r = {
|
|
1029
|
-
id:
|
|
1029
|
+
id: S(),
|
|
1030
1030
|
...a,
|
|
1031
1031
|
authorization_url: (o = a.authorization_url) == null ? void 0 : o.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
1055
|
return _({
|
|
@@ -1060,7 +1060,7 @@ function pa(t) {
|
|
|
1060
1060
|
});
|
|
1061
1061
|
};
|
|
1062
1062
|
}
|
|
1063
|
-
function
|
|
1063
|
+
function _e(t) {
|
|
1064
1064
|
return _({
|
|
1065
1065
|
...t,
|
|
1066
1066
|
webauthn_platform_first_factor: t.webauthn_platform_first_factor ? !!t.webauthn_platform_first_factor : void 0,
|
|
@@ -1069,26 +1069,26 @@ 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)
|
|
@@ -1108,7 +1108,7 @@ function wa(t) {
|
|
|
1108
1108
|
});
|
|
1109
1109
|
};
|
|
1110
1110
|
}
|
|
1111
|
-
function
|
|
1111
|
+
function Na(t) {
|
|
1112
1112
|
return async (e, a) => {
|
|
1113
1113
|
const { credentials: r, settings: o, enabled: n, ...s } = a;
|
|
1114
1114
|
await t.updateTable("email_providers").set({
|
|
@@ -1119,7 +1119,7 @@ function va(t) {
|
|
|
1119
1119
|
}).where("tenant_id", "=", e).execute();
|
|
1120
1120
|
};
|
|
1121
1121
|
}
|
|
1122
|
-
function
|
|
1122
|
+
function Ca(t) {
|
|
1123
1123
|
return async (e, a) => {
|
|
1124
1124
|
const { credentials: r, settings: o, enabled: n, ...s } = a;
|
|
1125
1125
|
await t.insertInto("email_providers").values({
|
|
@@ -1133,14 +1133,14 @@ function Na(t) {
|
|
|
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,10 +1166,10 @@ 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
1174
|
const o = {
|
|
1175
1175
|
...r,
|
|
@@ -1180,30 +1180,30 @@ function Sa(t) {
|
|
|
1180
1180
|
return !!(await t.updateTable("refresh_tokens").set(o).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 =
|
|
1190
|
+
a.q && (r = T(t, r, a.q, ["token", "session_id"]));
|
|
1191
1191
|
let o = r;
|
|
1192
1192
|
if (a.sort && a.sort.sort_by) {
|
|
1193
|
-
const { ref:
|
|
1193
|
+
const { ref: c } = t.dynamic;
|
|
1194
1194
|
o = o.orderBy(
|
|
1195
|
-
|
|
1195
|
+
c(a.sort.sort_by),
|
|
1196
1196
|
a.sort.sort_order
|
|
1197
1197
|
);
|
|
1198
1198
|
}
|
|
1199
1199
|
o = o.offset(a.page * a.per_page).limit(a.per_page);
|
|
1200
|
-
const n = await o.selectAll().execute(), { count: s } = await r.select((
|
|
1200
|
+
const n = await o.selectAll().execute(), { count: s } = await r.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow(), l = b(s);
|
|
1201
1201
|
return {
|
|
1202
|
-
refresh_tokens: n.map((
|
|
1203
|
-
...
|
|
1204
|
-
rotating: !!
|
|
1205
|
-
device:
|
|
1206
|
-
resource_servers:
|
|
1202
|
+
refresh_tokens: n.map((c) => ({
|
|
1203
|
+
...c,
|
|
1204
|
+
rotating: !!c.rotating,
|
|
1205
|
+
device: c.device ? JSON.parse(c.device) : {},
|
|
1206
|
+
resource_servers: c.resource_servers ? JSON.parse(c.resource_servers) : []
|
|
1207
1207
|
})),
|
|
1208
1208
|
start: a.page * a.per_page,
|
|
1209
1209
|
limit: a.per_page,
|
|
@@ -1211,16 +1211,16 @@ function Oa(t) {
|
|
|
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
|
|
@@ -1245,13 +1245,99 @@ function $a(t) {
|
|
|
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
|
+
fields: JSON.stringify(r.fields || []),
|
|
1260
|
+
controls: JSON.stringify(r.controls || []),
|
|
1261
|
+
layout: JSON.stringify(r.layout || {}),
|
|
1262
|
+
tenant_id: e,
|
|
1263
|
+
active: r.active ? 1 : 0
|
|
1264
|
+
}).execute(), K.parse(r);
|
|
1265
|
+
};
|
|
1266
|
+
}
|
|
1267
|
+
function Pa(t) {
|
|
1268
|
+
return async (e, a = {
|
|
1269
|
+
page: 0,
|
|
1270
|
+
per_page: 50,
|
|
1271
|
+
include_totals: !1
|
|
1272
|
+
}) => {
|
|
1273
|
+
let r = t.selectFrom("forms").where("tenant_id", "=", e);
|
|
1274
|
+
a != null && a.q && (r = T(t, r, a.q, []));
|
|
1275
|
+
const s = (await r.offset(a.page * a.per_page).limit(a.per_page).selectAll().execute()).map(
|
|
1276
|
+
(c) => K.parse(
|
|
1277
|
+
_({
|
|
1278
|
+
...c,
|
|
1279
|
+
fields: JSON.parse(c.fields),
|
|
1280
|
+
controls: c.controls ? JSON.parse(c.controls) : void 0,
|
|
1281
|
+
layout: c.layout ? JSON.parse(c.layout) : void 0,
|
|
1282
|
+
active: c.active === 1
|
|
1283
|
+
})
|
|
1284
|
+
)
|
|
1285
|
+
), { count: l } = await r.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1286
|
+
return {
|
|
1287
|
+
forms: s,
|
|
1288
|
+
start: a.page * a.per_page,
|
|
1289
|
+
limit: a.per_page,
|
|
1290
|
+
length: b(l)
|
|
1291
|
+
};
|
|
1292
|
+
};
|
|
1293
|
+
}
|
|
1294
|
+
function ja(t) {
|
|
1295
|
+
return async (e, a) => {
|
|
1296
|
+
const { numDeletedRows: r } = await t.deleteFrom("forms").where("id", "=", a).where("tenant_id", "=", e).executeTakeFirst();
|
|
1297
|
+
return r > 0;
|
|
1298
|
+
};
|
|
1299
|
+
}
|
|
1300
|
+
function Ma(t) {
|
|
1301
|
+
return async (e, a) => {
|
|
1302
|
+
const r = await t.selectFrom("forms").selectAll().where("forms.id", "=", a).where("tenant_id", "=", e).executeTakeFirst();
|
|
1303
|
+
return r ? K.parse(
|
|
1304
|
+
_({
|
|
1305
|
+
...r,
|
|
1306
|
+
fields: JSON.parse(r.fields),
|
|
1307
|
+
controls: r.controls ? JSON.parse(r.controls) : void 0,
|
|
1308
|
+
layout: r.layout ? JSON.parse(r.layout) : void 0,
|
|
1309
|
+
active: r.active === 1
|
|
1310
|
+
})
|
|
1311
|
+
) : null;
|
|
1312
|
+
};
|
|
1313
|
+
}
|
|
1314
|
+
function Fa(t) {
|
|
1315
|
+
return async (e, a, r) => {
|
|
1316
|
+
const o = {
|
|
1317
|
+
...r,
|
|
1318
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1319
|
+
};
|
|
1320
|
+
r.fields && (o.fields = JSON.stringify(r.fields)), r.controls && (o.controls = JSON.stringify(r.controls)), r.layout && (o.layout = JSON.stringify(r.layout));
|
|
1321
|
+
const { numUpdatedRows: n } = await t.updateTable("forms").set(o).where("id", "=", a).where("tenant_id", "=", e).executeTakeFirst();
|
|
1322
|
+
return n > 0;
|
|
1323
|
+
};
|
|
1324
|
+
}
|
|
1325
|
+
function Aa(t) {
|
|
1326
|
+
return {
|
|
1327
|
+
create: Ia(t),
|
|
1328
|
+
get: Ma(t),
|
|
1329
|
+
list: Pa(t),
|
|
1330
|
+
remove: ja(t),
|
|
1331
|
+
update: Fa(t)
|
|
1332
|
+
};
|
|
1333
|
+
}
|
|
1334
|
+
function La(t) {
|
|
1249
1335
|
return t[t.length - 1];
|
|
1250
1336
|
}
|
|
1251
1337
|
function p(t) {
|
|
1252
1338
|
return Object.freeze(t);
|
|
1253
1339
|
}
|
|
1254
|
-
const
|
|
1340
|
+
const E = p({
|
|
1255
1341
|
is(t) {
|
|
1256
1342
|
return t.kind === "IdentifierNode";
|
|
1257
1343
|
},
|
|
@@ -1268,17 +1354,17 @@ const J = p({
|
|
|
1268
1354
|
create(t) {
|
|
1269
1355
|
return p({
|
|
1270
1356
|
kind: "SchemableIdentifierNode",
|
|
1271
|
-
identifier:
|
|
1357
|
+
identifier: E.create(t)
|
|
1272
1358
|
});
|
|
1273
1359
|
},
|
|
1274
1360
|
createWithSchema(t, e) {
|
|
1275
1361
|
return p({
|
|
1276
1362
|
kind: "SchemableIdentifierNode",
|
|
1277
|
-
schema:
|
|
1278
|
-
identifier:
|
|
1363
|
+
schema: E.create(t),
|
|
1364
|
+
identifier: E.create(e)
|
|
1279
1365
|
});
|
|
1280
1366
|
}
|
|
1281
|
-
}),
|
|
1367
|
+
}), za = p({
|
|
1282
1368
|
is(t) {
|
|
1283
1369
|
return t.kind === "AliasNode";
|
|
1284
1370
|
},
|
|
@@ -1289,7 +1375,7 @@ const J = p({
|
|
|
1289
1375
|
alias: e
|
|
1290
1376
|
});
|
|
1291
1377
|
}
|
|
1292
|
-
}),
|
|
1378
|
+
}), B = p({
|
|
1293
1379
|
is(t) {
|
|
1294
1380
|
return t.kind === "TableNode";
|
|
1295
1381
|
},
|
|
@@ -1306,11 +1392,11 @@ const J = p({
|
|
|
1306
1392
|
});
|
|
1307
1393
|
}
|
|
1308
1394
|
});
|
|
1309
|
-
var
|
|
1310
|
-
class
|
|
1395
|
+
var R;
|
|
1396
|
+
class Ja {
|
|
1311
1397
|
constructor() {
|
|
1312
1398
|
j(this, "nodeStack", []);
|
|
1313
|
-
y(this,
|
|
1399
|
+
y(this, R, p({
|
|
1314
1400
|
AliasNode: this.transformAlias.bind(this),
|
|
1315
1401
|
ColumnNode: this.transformColumn.bind(this),
|
|
1316
1402
|
IdentifierNode: this.transformIdentifier.bind(this),
|
|
@@ -1414,7 +1500,7 @@ class Pa {
|
|
|
1414
1500
|
return this.nodeStack.pop(), p(a);
|
|
1415
1501
|
}
|
|
1416
1502
|
transformNodeImpl(e) {
|
|
1417
|
-
return
|
|
1503
|
+
return d(this, R)[e.kind](e);
|
|
1418
1504
|
}
|
|
1419
1505
|
transformNodeList(e) {
|
|
1420
1506
|
return e && p(e.map((a) => this.transformNode(a)));
|
|
@@ -2140,8 +2226,8 @@ class Pa {
|
|
|
2140
2226
|
return e;
|
|
2141
2227
|
}
|
|
2142
2228
|
}
|
|
2143
|
-
|
|
2144
|
-
const
|
|
2229
|
+
R = new WeakMap();
|
|
2230
|
+
const Ea = p({
|
|
2145
2231
|
AlterTableNode: !0,
|
|
2146
2232
|
CreateIndexNode: !0,
|
|
2147
2233
|
CreateSchemaNode: !0,
|
|
@@ -2160,88 +2246,88 @@ const ja = p({
|
|
|
2160
2246
|
UpdateQueryNode: !0,
|
|
2161
2247
|
MergeQueryNode: !0
|
|
2162
2248
|
});
|
|
2163
|
-
var P,
|
|
2164
|
-
class
|
|
2249
|
+
var P, O, k, f, ye, we, ve, $, G, Ne;
|
|
2250
|
+
class Ka extends Ja {
|
|
2165
2251
|
constructor(a) {
|
|
2166
2252
|
super();
|
|
2167
2253
|
y(this, f);
|
|
2168
2254
|
y(this, P);
|
|
2169
|
-
y(this,
|
|
2170
|
-
y(this,
|
|
2255
|
+
y(this, O, /* @__PURE__ */ new Set());
|
|
2256
|
+
y(this, k, /* @__PURE__ */ new Set());
|
|
2171
2257
|
M(this, P, a);
|
|
2172
2258
|
}
|
|
2173
2259
|
transformNodeImpl(a) {
|
|
2174
|
-
if (!u(this, f,
|
|
2260
|
+
if (!u(this, f, ye).call(this, a))
|
|
2175
2261
|
return super.transformNodeImpl(a);
|
|
2176
|
-
const r = u(this, f,
|
|
2262
|
+
const r = u(this, f, ve).call(this, a);
|
|
2177
2263
|
for (const s of r)
|
|
2178
|
-
|
|
2179
|
-
const o = u(this, f,
|
|
2264
|
+
d(this, k).add(s);
|
|
2265
|
+
const o = u(this, f, we).call(this, a);
|
|
2180
2266
|
for (const s of o)
|
|
2181
|
-
|
|
2267
|
+
d(this, O).add(s);
|
|
2182
2268
|
const n = super.transformNodeImpl(a);
|
|
2183
2269
|
for (const s of o)
|
|
2184
|
-
|
|
2270
|
+
d(this, O).delete(s);
|
|
2185
2271
|
for (const s of r)
|
|
2186
|
-
|
|
2272
|
+
d(this, k).delete(s);
|
|
2187
2273
|
return n;
|
|
2188
2274
|
}
|
|
2189
2275
|
transformSchemableIdentifier(a) {
|
|
2190
2276
|
const r = super.transformSchemableIdentifier(a);
|
|
2191
|
-
return r.schema || !
|
|
2277
|
+
return r.schema || !d(this, O).has(a.identifier.name) ? r : {
|
|
2192
2278
|
...r,
|
|
2193
|
-
schema:
|
|
2279
|
+
schema: E.create(d(this, P))
|
|
2194
2280
|
};
|
|
2195
2281
|
}
|
|
2196
2282
|
transformReferences(a) {
|
|
2197
2283
|
const r = super.transformReferences(a);
|
|
2198
2284
|
return r.table.table.schema ? r : {
|
|
2199
2285
|
...r,
|
|
2200
|
-
table:
|
|
2286
|
+
table: B.createWithSchema(d(this, P), r.table.table.identifier.name)
|
|
2201
2287
|
};
|
|
2202
2288
|
}
|
|
2203
2289
|
}
|
|
2204
|
-
P = new WeakMap(),
|
|
2205
|
-
return a.kind in
|
|
2206
|
-
},
|
|
2290
|
+
P = new WeakMap(), O = new WeakMap(), k = new WeakMap(), f = new WeakSet(), ye = function(a) {
|
|
2291
|
+
return a.kind in Ea;
|
|
2292
|
+
}, we = function(a) {
|
|
2207
2293
|
const r = /* @__PURE__ */ new Set();
|
|
2208
|
-
if ("name" in a && a.name && W.is(a.name) && u(this, f,
|
|
2294
|
+
if ("name" in a && a.name && W.is(a.name) && u(this, f, G).call(this, a.name, r), "from" in a && a.from)
|
|
2209
2295
|
for (const o of a.from.froms)
|
|
2210
2296
|
u(this, f, $).call(this, o, r);
|
|
2211
2297
|
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
2298
|
for (const o of a.joins)
|
|
2213
2299
|
u(this, f, $).call(this, o.table, r);
|
|
2214
2300
|
return "using" in a && a.using && u(this, f, $).call(this, a.using, r), r;
|
|
2215
|
-
},
|
|
2301
|
+
}, ve = function(a) {
|
|
2216
2302
|
const r = /* @__PURE__ */ new Set();
|
|
2217
|
-
return "with" in a && a.with && u(this, f,
|
|
2303
|
+
return "with" in a && a.with && u(this, f, Ne).call(this, a.with, r), r;
|
|
2218
2304
|
}, $ = function(a, r) {
|
|
2219
|
-
const o =
|
|
2220
|
-
o && u(this, f,
|
|
2221
|
-
},
|
|
2305
|
+
const o = B.is(a) ? a : za.is(a) && B.is(a.node) ? a.node : null;
|
|
2306
|
+
o && u(this, f, G).call(this, o.table, r);
|
|
2307
|
+
}, G = function(a, r) {
|
|
2222
2308
|
const o = a.identifier.name;
|
|
2223
|
-
!
|
|
2224
|
-
},
|
|
2309
|
+
!d(this, O).has(o) && !d(this, k).has(o) && r.add(o);
|
|
2310
|
+
}, Ne = function(a, r) {
|
|
2225
2311
|
for (const o of a.expressions) {
|
|
2226
2312
|
const n = o.name.table.table.identifier.name;
|
|
2227
|
-
|
|
2313
|
+
d(this, k).has(n) || r.add(n);
|
|
2228
2314
|
}
|
|
2229
2315
|
};
|
|
2230
2316
|
var L;
|
|
2231
|
-
class
|
|
2317
|
+
class Ra {
|
|
2232
2318
|
constructor(e) {
|
|
2233
2319
|
y(this, L);
|
|
2234
|
-
M(this, L, new
|
|
2320
|
+
M(this, L, new Ka(e));
|
|
2235
2321
|
}
|
|
2236
2322
|
transformQuery(e) {
|
|
2237
|
-
return
|
|
2323
|
+
return d(this, L).transformNode(e.node);
|
|
2238
2324
|
}
|
|
2239
2325
|
async transformResult(e) {
|
|
2240
2326
|
return e.result;
|
|
2241
2327
|
}
|
|
2242
2328
|
}
|
|
2243
2329
|
L = new WeakMap();
|
|
2244
|
-
class
|
|
2330
|
+
class Ua {
|
|
2245
2331
|
transformQuery(e) {
|
|
2246
2332
|
return e.node;
|
|
2247
2333
|
}
|
|
@@ -2249,9 +2335,9 @@ class Aa {
|
|
|
2249
2335
|
return e.result;
|
|
2250
2336
|
}
|
|
2251
2337
|
}
|
|
2252
|
-
const
|
|
2253
|
-
var h, i, F, v, N, D,
|
|
2254
|
-
class
|
|
2338
|
+
const Ba = "kysely_migration", fe = "kysely_migration_lock", Qa = !1, Q = "migration_lock", qa = p({ __noMigrations__: !0 });
|
|
2339
|
+
var h, 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;
|
|
2340
|
+
class Ce {
|
|
2255
2341
|
constructor(e) {
|
|
2256
2342
|
y(this, i);
|
|
2257
2343
|
y(this, h);
|
|
@@ -2263,8 +2349,8 @@ class Ne {
|
|
|
2263
2349
|
* The returned array is sorted by migration name.
|
|
2264
2350
|
*/
|
|
2265
2351
|
async getMigrations() {
|
|
2266
|
-
const e = await u(this, i, I).call(this,
|
|
2267
|
-
return (await u(this, i,
|
|
2352
|
+
const e = await u(this, i, I).call(this, d(this, i, N)) ? await d(this, h).db.withPlugin(d(this, i, C)).selectFrom(d(this, i, N)).select(["name", "timestamp"]).execute() : [];
|
|
2353
|
+
return (await u(this, i, Y).call(this)).map(({ name: r, ...o }) => {
|
|
2268
2354
|
const n = e.find((s) => s.name === r);
|
|
2269
2355
|
return {
|
|
2270
2356
|
name: r,
|
|
@@ -2348,7 +2434,7 @@ class Ne {
|
|
|
2348
2434
|
*/
|
|
2349
2435
|
async migrateTo(e) {
|
|
2350
2436
|
return u(this, i, F).call(this, ({ migrations: a, executedMigrations: r, pendingMigrations: o }) => {
|
|
2351
|
-
if (e ===
|
|
2437
|
+
if (e === qa)
|
|
2352
2438
|
return { direction: "Down", step: 1 / 0 };
|
|
2353
2439
|
if (!a.find((l) => l.name === e))
|
|
2354
2440
|
throw new Error(`migration "${e}" doesn't exist`);
|
|
@@ -2400,110 +2486,110 @@ class Ne {
|
|
|
2400
2486
|
}
|
|
2401
2487
|
h = new WeakMap(), i = new WeakSet(), F = async function(e) {
|
|
2402
2488
|
try {
|
|
2403
|
-
return await u(this, i,
|
|
2489
|
+
return await u(this, i, xe).call(this), await u(this, i, $e).call(this, e);
|
|
2404
2490
|
} catch (a) {
|
|
2405
|
-
return a instanceof
|
|
2491
|
+
return a instanceof q ? a.resultSet : { error: a };
|
|
2406
2492
|
}
|
|
2407
2493
|
}, v = function() {
|
|
2408
|
-
return
|
|
2494
|
+
return d(this, h).migrationTableSchema;
|
|
2409
2495
|
}, N = function() {
|
|
2410
|
-
return
|
|
2496
|
+
return d(this, h).migrationTableName ?? Ba;
|
|
2411
2497
|
}, D = function() {
|
|
2412
|
-
return
|
|
2413
|
-
},
|
|
2414
|
-
return
|
|
2498
|
+
return d(this, h).migrationLockTableName ?? fe;
|
|
2499
|
+
}, be = function() {
|
|
2500
|
+
return d(this, h).allowUnorderedMigrations ?? Qa;
|
|
2415
2501
|
}, 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);
|
|
2502
|
+
return d(this, i, v) ? new Ra(d(this, i, v)) : new Ua();
|
|
2419
2503
|
}, xe = async function() {
|
|
2420
|
-
|
|
2504
|
+
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);
|
|
2505
|
+
}, Te = async function() {
|
|
2506
|
+
if (d(this, i, v) && !await u(this, i, H).call(this))
|
|
2421
2507
|
try {
|
|
2422
|
-
await u(this, i, A).call(this,
|
|
2508
|
+
await u(this, i, A).call(this, d(this, h).db.schema.createSchema(d(this, i, v)));
|
|
2423
2509
|
} catch (e) {
|
|
2424
|
-
if (!await u(this, i,
|
|
2510
|
+
if (!await u(this, i, H).call(this))
|
|
2425
2511
|
throw e;
|
|
2426
2512
|
}
|
|
2427
|
-
},
|
|
2428
|
-
if (!await u(this, i, I).call(this,
|
|
2513
|
+
}, Se = async function() {
|
|
2514
|
+
if (!await u(this, i, I).call(this, d(this, i, N)))
|
|
2429
2515
|
try {
|
|
2430
|
-
|
|
2516
|
+
d(this, i, v) && await u(this, i, A).call(this, d(this, h).db.schema.createSchema(d(this, i, v))), await u(this, i, A).call(this, d(this, h).db.schema.withPlugin(d(this, i, C)).createTable(d(this, i, N)).addColumn("name", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("timestamp", "varchar(255)", (e) => e.notNull()));
|
|
2431
2517
|
} catch (e) {
|
|
2432
|
-
if (!await u(this, i, I).call(this,
|
|
2518
|
+
if (!await u(this, i, I).call(this, d(this, i, N)))
|
|
2433
2519
|
throw e;
|
|
2434
2520
|
}
|
|
2435
|
-
},
|
|
2436
|
-
if (!await u(this, i, I).call(this,
|
|
2521
|
+
}, Oe = async function() {
|
|
2522
|
+
if (!await u(this, i, I).call(this, d(this, i, D)))
|
|
2437
2523
|
try {
|
|
2438
|
-
await u(this, i, A).call(this,
|
|
2524
|
+
await u(this, i, A).call(this, d(this, h).db.schema.withPlugin(d(this, i, C)).createTable(d(this, i, D)).addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("is_locked", "integer", (e) => e.notNull().defaultTo(0)));
|
|
2439
2525
|
} catch (e) {
|
|
2440
|
-
if (!await u(this, i, I).call(this,
|
|
2526
|
+
if (!await u(this, i, I).call(this, d(this, i, D)))
|
|
2441
2527
|
throw e;
|
|
2442
2528
|
}
|
|
2443
|
-
},
|
|
2444
|
-
if (!await u(this, i,
|
|
2529
|
+
}, ke = async function() {
|
|
2530
|
+
if (!await u(this, i, X).call(this))
|
|
2445
2531
|
try {
|
|
2446
|
-
await
|
|
2532
|
+
await d(this, h).db.withPlugin(d(this, i, C)).insertInto(d(this, i, D)).values({ id: Q, is_locked: 0 }).execute();
|
|
2447
2533
|
} catch (e) {
|
|
2448
|
-
if (!await u(this, i,
|
|
2534
|
+
if (!await u(this, i, X).call(this))
|
|
2449
2535
|
throw e;
|
|
2450
2536
|
}
|
|
2451
|
-
},
|
|
2452
|
-
return (await
|
|
2537
|
+
}, H = async function() {
|
|
2538
|
+
return (await d(this, h).db.introspection.getSchemas()).some((a) => a.name === d(this, i, v));
|
|
2453
2539
|
}, I = async function(e) {
|
|
2454
|
-
const a =
|
|
2455
|
-
return (await
|
|
2540
|
+
const a = d(this, i, v);
|
|
2541
|
+
return (await d(this, h).db.introspection.getTables({
|
|
2456
2542
|
withInternalKyselyTables: !0
|
|
2457
2543
|
})).some((o) => o.name === e && (!a || o.schema === a));
|
|
2458
|
-
},
|
|
2459
|
-
return !!await
|
|
2460
|
-
},
|
|
2461
|
-
const a =
|
|
2462
|
-
lockTable:
|
|
2463
|
-
lockRowId:
|
|
2464
|
-
lockTableSchema:
|
|
2544
|
+
}, X = async function() {
|
|
2545
|
+
return !!await d(this, h).db.withPlugin(d(this, i, C)).selectFrom(d(this, i, D)).where("id", "=", Q).select("id").executeTakeFirst();
|
|
2546
|
+
}, $e = async function(e) {
|
|
2547
|
+
const a = d(this, h).db.getExecutor().adapter, r = p({
|
|
2548
|
+
lockTable: d(this, h).migrationLockTableName ?? fe,
|
|
2549
|
+
lockRowId: Q,
|
|
2550
|
+
lockTableSchema: d(this, h).migrationTableSchema
|
|
2465
2551
|
}), o = async (n) => {
|
|
2466
2552
|
try {
|
|
2467
2553
|
await a.acquireMigrationLock(n, r);
|
|
2468
|
-
const s = await u(this, i,
|
|
2554
|
+
const s = await u(this, i, De).call(this, n);
|
|
2469
2555
|
if (s.migrations.length === 0)
|
|
2470
2556
|
return { results: [] };
|
|
2471
|
-
const { direction: l, step:
|
|
2472
|
-
return
|
|
2557
|
+
const { direction: l, step: c } = e(s);
|
|
2558
|
+
return c <= 0 ? { results: [] } : l === "Down" ? await u(this, i, Fe).call(this, n, s, c) : l === "Up" ? await u(this, i, Ae).call(this, n, s, c) : { results: [] };
|
|
2473
2559
|
} finally {
|
|
2474
2560
|
await a.releaseMigrationLock(n, r);
|
|
2475
2561
|
}
|
|
2476
2562
|
};
|
|
2477
|
-
return a.supportsTransactionalDdl ?
|
|
2478
|
-
},
|
|
2479
|
-
const a = await u(this, i,
|
|
2480
|
-
u(this, i,
|
|
2481
|
-
const o = u(this, i,
|
|
2563
|
+
return a.supportsTransactionalDdl ? d(this, h).db.transaction().execute(o) : d(this, h).db.connection().execute(o);
|
|
2564
|
+
}, De = async function(e) {
|
|
2565
|
+
const a = await u(this, i, Y).call(this), r = await u(this, i, Pe).call(this, e);
|
|
2566
|
+
u(this, i, je).call(this, a, r), d(this, i, be) || u(this, i, Me).call(this, a, r);
|
|
2567
|
+
const o = u(this, i, Ie).call(this, a, r);
|
|
2482
2568
|
return p({
|
|
2483
2569
|
migrations: a,
|
|
2484
2570
|
executedMigrations: r,
|
|
2485
|
-
lastMigration:
|
|
2571
|
+
lastMigration: La(r),
|
|
2486
2572
|
pendingMigrations: o
|
|
2487
2573
|
});
|
|
2488
|
-
},
|
|
2574
|
+
}, Ie = function(e, a) {
|
|
2489
2575
|
return e.filter((r) => !a.includes(r.name));
|
|
2490
|
-
},
|
|
2491
|
-
const e = await
|
|
2576
|
+
}, Y = async function() {
|
|
2577
|
+
const e = await d(this, h).provider.getMigrations();
|
|
2492
2578
|
return Object.keys(e).sort().map((a) => ({
|
|
2493
2579
|
...e[a],
|
|
2494
2580
|
name: a
|
|
2495
2581
|
}));
|
|
2496
|
-
},
|
|
2497
|
-
return (await e.withPlugin(
|
|
2498
|
-
},
|
|
2582
|
+
}, Pe = async function(e) {
|
|
2583
|
+
return (await e.withPlugin(d(this, i, C)).selectFrom(d(this, i, N)).select("name").orderBy(["timestamp", "name"]).execute()).map((r) => r.name);
|
|
2584
|
+
}, je = function(e, a) {
|
|
2499
2585
|
for (const r of a)
|
|
2500
2586
|
if (!e.some((o) => o.name === r))
|
|
2501
2587
|
throw new Error(`corrupted migrations: previously executed migration ${r} is missing`);
|
|
2502
|
-
},
|
|
2588
|
+
}, Me = function(e, a) {
|
|
2503
2589
|
for (let r = 0; r < a.length; ++r)
|
|
2504
2590
|
if (e[r].name !== a[r])
|
|
2505
2591
|
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
|
-
},
|
|
2592
|
+
}, Fe = async function(e, a, r) {
|
|
2507
2593
|
const o = a.executedMigrations.slice().reverse().slice(0, r).map((s) => a.migrations.find((l) => l.name === s)), n = o.map((s) => ({
|
|
2508
2594
|
migrationName: s.name,
|
|
2509
2595
|
direction: "Down",
|
|
@@ -2512,24 +2598,24 @@ h = new WeakMap(), i = new WeakSet(), F = async function(e) {
|
|
|
2512
2598
|
for (let s = 0; s < n.length; ++s) {
|
|
2513
2599
|
const l = o[s];
|
|
2514
2600
|
try {
|
|
2515
|
-
l.down && (await l.down(e), await e.withPlugin(
|
|
2601
|
+
l.down && (await l.down(e), await e.withPlugin(d(this, i, C)).deleteFrom(d(this, i, N)).where("name", "=", l.name).execute(), n[s] = {
|
|
2516
2602
|
migrationName: l.name,
|
|
2517
2603
|
direction: "Down",
|
|
2518
2604
|
status: "Success"
|
|
2519
2605
|
});
|
|
2520
|
-
} catch (
|
|
2606
|
+
} catch (c) {
|
|
2521
2607
|
throw n[s] = {
|
|
2522
2608
|
migrationName: l.name,
|
|
2523
2609
|
direction: "Down",
|
|
2524
2610
|
status: "Error"
|
|
2525
|
-
}, new
|
|
2526
|
-
error:
|
|
2611
|
+
}, new q({
|
|
2612
|
+
error: c,
|
|
2527
2613
|
results: n
|
|
2528
2614
|
});
|
|
2529
2615
|
}
|
|
2530
2616
|
}
|
|
2531
2617
|
return { results: n };
|
|
2532
|
-
},
|
|
2618
|
+
}, Ae = async function(e, a, r) {
|
|
2533
2619
|
const n = a.pendingMigrations.slice(0, r).map((s) => ({
|
|
2534
2620
|
migrationName: s.name,
|
|
2535
2621
|
direction: "Up",
|
|
@@ -2538,7 +2624,7 @@ h = new WeakMap(), i = new WeakSet(), F = async function(e) {
|
|
|
2538
2624
|
for (let s = 0; s < n.length; s++) {
|
|
2539
2625
|
const l = a.pendingMigrations[s];
|
|
2540
2626
|
try {
|
|
2541
|
-
await l.up(e), await e.withPlugin(
|
|
2627
|
+
await l.up(e), await e.withPlugin(d(this, i, C)).insertInto(d(this, i, N)).values({
|
|
2542
2628
|
name: l.name,
|
|
2543
2629
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
2544
2630
|
}).execute(), n[s] = {
|
|
@@ -2546,34 +2632,34 @@ h = new WeakMap(), i = new WeakSet(), F = async function(e) {
|
|
|
2546
2632
|
direction: "Up",
|
|
2547
2633
|
status: "Success"
|
|
2548
2634
|
};
|
|
2549
|
-
} catch (
|
|
2635
|
+
} catch (c) {
|
|
2550
2636
|
throw n[s] = {
|
|
2551
2637
|
migrationName: l.name,
|
|
2552
2638
|
direction: "Up",
|
|
2553
2639
|
status: "Error"
|
|
2554
|
-
}, new
|
|
2555
|
-
error:
|
|
2640
|
+
}, new q({
|
|
2641
|
+
error: c,
|
|
2556
2642
|
results: n
|
|
2557
2643
|
});
|
|
2558
2644
|
}
|
|
2559
2645
|
}
|
|
2560
2646
|
return { results: n };
|
|
2561
2647
|
}, A = async function(e) {
|
|
2562
|
-
|
|
2648
|
+
d(this, h).db.getExecutor().adapter.supportsCreateIfNotExists && (e = e.ifNotExists()), await e.execute();
|
|
2563
2649
|
};
|
|
2564
2650
|
var z;
|
|
2565
|
-
class
|
|
2651
|
+
class q extends Error {
|
|
2566
2652
|
constructor(a) {
|
|
2567
2653
|
super();
|
|
2568
2654
|
y(this, z);
|
|
2569
2655
|
M(this, z, a);
|
|
2570
2656
|
}
|
|
2571
2657
|
get resultSet() {
|
|
2572
|
-
return
|
|
2658
|
+
return d(this, z);
|
|
2573
2659
|
}
|
|
2574
2660
|
}
|
|
2575
2661
|
z = new WeakMap();
|
|
2576
|
-
class
|
|
2662
|
+
class Le {
|
|
2577
2663
|
constructor(e) {
|
|
2578
2664
|
j(this, "migrations");
|
|
2579
2665
|
this.migrations = e;
|
|
@@ -2582,7 +2668,7 @@ class Ae {
|
|
|
2582
2668
|
return this.migrations;
|
|
2583
2669
|
}
|
|
2584
2670
|
}
|
|
2585
|
-
async function
|
|
2671
|
+
async function Va(t) {
|
|
2586
2672
|
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
2673
|
"tenant_id",
|
|
2588
2674
|
"varchar(255)",
|
|
@@ -2654,35 +2740,35 @@ async function Ja(t) {
|
|
|
2654
2740
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
2655
2741
|
).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
2742
|
}
|
|
2657
|
-
async function
|
|
2743
|
+
async function Wa(t) {
|
|
2658
2744
|
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
2745
|
}
|
|
2660
|
-
const
|
|
2746
|
+
const Ga = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2661
2747
|
__proto__: null,
|
|
2662
|
-
down:
|
|
2663
|
-
up:
|
|
2748
|
+
down: Wa,
|
|
2749
|
+
up: Va
|
|
2664
2750
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2665
|
-
async function
|
|
2751
|
+
async function Ha(t) {
|
|
2666
2752
|
await t.schema.alterTable("tenants").addColumn("support_url", "varchar(255)").execute();
|
|
2667
2753
|
}
|
|
2668
|
-
async function
|
|
2754
|
+
async function Xa(t) {
|
|
2669
2755
|
await t.schema.alterTable("tenants").dropColumn("support_url").execute();
|
|
2670
2756
|
}
|
|
2671
|
-
const
|
|
2757
|
+
const Ya = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2672
2758
|
__proto__: null,
|
|
2673
|
-
down:
|
|
2674
|
-
up:
|
|
2759
|
+
down: Xa,
|
|
2760
|
+
up: Ha
|
|
2675
2761
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2676
|
-
async function
|
|
2762
|
+
async function Za(t) {
|
|
2677
2763
|
}
|
|
2678
|
-
async function
|
|
2764
|
+
async function er(t) {
|
|
2679
2765
|
}
|
|
2680
|
-
const
|
|
2766
|
+
const tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2681
2767
|
__proto__: null,
|
|
2682
|
-
down:
|
|
2683
|
-
up:
|
|
2768
|
+
down: er,
|
|
2769
|
+
up: Za
|
|
2684
2770
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2685
|
-
async function
|
|
2771
|
+
async function ar(t) {
|
|
2686
2772
|
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
2773
|
"tenant_id_constraint",
|
|
2688
2774
|
["tenant_id"],
|
|
@@ -2691,24 +2777,24 @@ async function Ga(t) {
|
|
|
2691
2777
|
(e) => e.onDelete("cascade")
|
|
2692
2778
|
).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
2779
|
}
|
|
2694
|
-
async function
|
|
2780
|
+
async function rr(t) {
|
|
2695
2781
|
await t.schema.dropTable("logs").execute();
|
|
2696
2782
|
}
|
|
2697
|
-
const
|
|
2783
|
+
const nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2698
2784
|
__proto__: null,
|
|
2699
|
-
down:
|
|
2700
|
-
up:
|
|
2785
|
+
down: rr,
|
|
2786
|
+
up: ar
|
|
2701
2787
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2702
|
-
async function
|
|
2788
|
+
async function or(t) {
|
|
2703
2789
|
}
|
|
2704
|
-
async function
|
|
2790
|
+
async function sr(t) {
|
|
2705
2791
|
}
|
|
2706
|
-
const
|
|
2792
|
+
const ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2707
2793
|
__proto__: null,
|
|
2708
|
-
down:
|
|
2709
|
-
up:
|
|
2794
|
+
down: sr,
|
|
2795
|
+
up: or
|
|
2710
2796
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2711
|
-
async function
|
|
2797
|
+
async function cr(t) {
|
|
2712
2798
|
await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
2713
2799
|
"user_id_constraint",
|
|
2714
2800
|
["user_id", "tenant_id"],
|
|
@@ -2733,15 +2819,15 @@ async function tr(t) {
|
|
|
2733
2819
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
2734
2820
|
).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
2821
|
}
|
|
2736
|
-
async function
|
|
2822
|
+
async function lr(t) {
|
|
2737
2823
|
await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("tickets").execute(), await t.schema.dropTable("otps").execute();
|
|
2738
2824
|
}
|
|
2739
|
-
const
|
|
2825
|
+
const dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2740
2826
|
__proto__: null,
|
|
2741
|
-
down:
|
|
2742
|
-
up:
|
|
2827
|
+
down: lr,
|
|
2828
|
+
up: cr
|
|
2743
2829
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2744
|
-
async function
|
|
2830
|
+
async function ur(t) {
|
|
2745
2831
|
await t.schema.createTable("passwords").addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addPrimaryKeyConstraint("passwords_pkey", ["user_id", "tenant_id"]).addForeignKeyConstraint(
|
|
2746
2832
|
"user_id_constraint",
|
|
2747
2833
|
["user_id", "tenant_id"],
|
|
@@ -2756,24 +2842,24 @@ async function nr(t) {
|
|
|
2756
2842
|
(e) => e.onDelete("cascade")
|
|
2757
2843
|
).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
2844
|
}
|
|
2759
|
-
async function
|
|
2845
|
+
async function mr(t) {
|
|
2760
2846
|
await t.schema.dropTable("passwords").execute(), await t.schema.dropTable("codes").execute();
|
|
2761
2847
|
}
|
|
2762
|
-
const
|
|
2848
|
+
const hr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2763
2849
|
__proto__: null,
|
|
2764
|
-
down:
|
|
2765
|
-
up:
|
|
2850
|
+
down: mr,
|
|
2851
|
+
up: ur
|
|
2766
2852
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2767
|
-
async function
|
|
2853
|
+
async function _r(t) {
|
|
2768
2854
|
}
|
|
2769
|
-
async function
|
|
2855
|
+
async function fr(t) {
|
|
2770
2856
|
}
|
|
2771
|
-
const
|
|
2857
|
+
const pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2772
2858
|
__proto__: null,
|
|
2773
|
-
down:
|
|
2774
|
-
up:
|
|
2859
|
+
down: fr,
|
|
2860
|
+
up: _r
|
|
2775
2861
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2776
|
-
async function
|
|
2862
|
+
async function gr(t) {
|
|
2777
2863
|
await t.schema.alterTable("passwords").addColumn(
|
|
2778
2864
|
"password",
|
|
2779
2865
|
"varchar(255)",
|
|
@@ -2781,288 +2867,288 @@ async function lr(t) {
|
|
|
2781
2867
|
(e) => e.notNull()
|
|
2782
2868
|
).execute();
|
|
2783
2869
|
}
|
|
2784
|
-
async function
|
|
2870
|
+
async function yr(t) {
|
|
2785
2871
|
await t.schema.alterTable("passwords").dropColumn("password").execute();
|
|
2786
2872
|
}
|
|
2787
|
-
const
|
|
2873
|
+
const wr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2788
2874
|
__proto__: null,
|
|
2789
|
-
down:
|
|
2790
|
-
up:
|
|
2875
|
+
down: yr,
|
|
2876
|
+
up: gr
|
|
2791
2877
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2792
|
-
async function
|
|
2878
|
+
async function vr(t) {
|
|
2793
2879
|
}
|
|
2794
|
-
async function
|
|
2880
|
+
async function Nr(t) {
|
|
2795
2881
|
}
|
|
2796
|
-
const
|
|
2882
|
+
const Cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2797
2883
|
__proto__: null,
|
|
2798
|
-
down:
|
|
2799
|
-
up:
|
|
2884
|
+
down: Nr,
|
|
2885
|
+
up: vr
|
|
2800
2886
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2801
|
-
async function
|
|
2887
|
+
async function br(t) {
|
|
2802
2888
|
}
|
|
2803
|
-
async function
|
|
2889
|
+
async function xr(t) {
|
|
2804
2890
|
}
|
|
2805
|
-
const
|
|
2891
|
+
const Tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2806
2892
|
__proto__: null,
|
|
2807
|
-
down:
|
|
2808
|
-
up:
|
|
2893
|
+
down: xr,
|
|
2894
|
+
up: br
|
|
2809
2895
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2810
|
-
async function
|
|
2896
|
+
async function Sr(t) {
|
|
2811
2897
|
}
|
|
2812
|
-
async function
|
|
2898
|
+
async function Or(t) {
|
|
2813
2899
|
}
|
|
2814
|
-
const
|
|
2900
|
+
const kr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2815
2901
|
__proto__: null,
|
|
2816
|
-
down:
|
|
2817
|
-
up:
|
|
2902
|
+
down: Or,
|
|
2903
|
+
up: Sr
|
|
2818
2904
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2819
|
-
async function
|
|
2905
|
+
async function $r(t) {
|
|
2820
2906
|
await t.schema.createIndex("users_email_index").on("users").column("email").execute();
|
|
2821
2907
|
}
|
|
2822
|
-
async function
|
|
2908
|
+
async function Dr(t) {
|
|
2823
2909
|
await t.schema.dropIndex("users_email_index").execute();
|
|
2824
2910
|
}
|
|
2825
|
-
const
|
|
2911
|
+
const Ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2826
2912
|
__proto__: null,
|
|
2827
|
-
down:
|
|
2828
|
-
up:
|
|
2913
|
+
down: Dr,
|
|
2914
|
+
up: $r
|
|
2829
2915
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2830
|
-
async function
|
|
2916
|
+
async function Pr(t) {
|
|
2831
2917
|
await t.schema.alterTable("users").addColumn("profileData", "varchar(2048)").execute();
|
|
2832
2918
|
}
|
|
2833
|
-
async function
|
|
2919
|
+
async function jr(t) {
|
|
2834
2920
|
await t.schema.alterTable("users").dropColumn("profileData").execute();
|
|
2835
2921
|
}
|
|
2836
|
-
const
|
|
2922
|
+
const Mr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2837
2923
|
__proto__: null,
|
|
2838
|
-
down:
|
|
2839
|
-
up:
|
|
2924
|
+
down: jr,
|
|
2925
|
+
up: Pr
|
|
2840
2926
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2841
|
-
async function
|
|
2927
|
+
async function Fr(t) {
|
|
2842
2928
|
await t.schema.createIndex("users_linked_to_index").on("users").column("linked_to").execute();
|
|
2843
2929
|
}
|
|
2844
|
-
async function
|
|
2930
|
+
async function Ar(t) {
|
|
2845
2931
|
await t.schema.dropIndex("users_linked_to_index");
|
|
2846
2932
|
}
|
|
2847
|
-
const
|
|
2933
|
+
const Lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2848
2934
|
__proto__: null,
|
|
2849
|
-
down:
|
|
2850
|
-
up:
|
|
2935
|
+
down: Ar,
|
|
2936
|
+
up: Fr
|
|
2851
2937
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2852
|
-
async function
|
|
2938
|
+
async function zr(t) {
|
|
2853
2939
|
await t.schema.alterTable("users").addColumn("locale", "varchar(255)").execute();
|
|
2854
2940
|
}
|
|
2855
|
-
async function
|
|
2941
|
+
async function Jr(t) {
|
|
2856
2942
|
await t.schema.alterTable("users").dropColumn("locale").execute();
|
|
2857
2943
|
}
|
|
2858
|
-
const
|
|
2944
|
+
const Er = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2859
2945
|
__proto__: null,
|
|
2860
|
-
down:
|
|
2861
|
-
up:
|
|
2946
|
+
down: Jr,
|
|
2947
|
+
up: zr
|
|
2862
2948
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2863
|
-
async function
|
|
2949
|
+
async function Kr(t) {
|
|
2864
2950
|
await t.schema.createTable("keys").addColumn("kid", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
2865
2951
|
"tenant_id",
|
|
2866
2952
|
"varchar(255)",
|
|
2867
2953
|
(e) => e.references("tenants.id").onDelete("cascade")
|
|
2868
2954
|
).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
2955
|
}
|
|
2870
|
-
async function
|
|
2956
|
+
async function Rr(t) {
|
|
2871
2957
|
await t.schema.dropTable("keys").execute();
|
|
2872
2958
|
}
|
|
2873
|
-
const
|
|
2959
|
+
const Ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2874
2960
|
__proto__: null,
|
|
2875
|
-
down:
|
|
2876
|
-
up:
|
|
2961
|
+
down: Rr,
|
|
2962
|
+
up: Kr
|
|
2877
2963
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2878
|
-
async function
|
|
2964
|
+
async function Br(t) {
|
|
2879
2965
|
}
|
|
2880
|
-
async function
|
|
2966
|
+
async function Qr(t) {
|
|
2881
2967
|
}
|
|
2882
|
-
const
|
|
2968
|
+
const qr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2883
2969
|
__proto__: null,
|
|
2884
|
-
down:
|
|
2885
|
-
up:
|
|
2970
|
+
down: Qr,
|
|
2971
|
+
up: Br
|
|
2886
2972
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2887
|
-
async function
|
|
2973
|
+
async function Vr(t) {
|
|
2888
2974
|
}
|
|
2889
|
-
async function
|
|
2975
|
+
async function Wr(t) {
|
|
2890
2976
|
}
|
|
2891
|
-
const
|
|
2977
|
+
const Gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2892
2978
|
__proto__: null,
|
|
2893
|
-
down:
|
|
2894
|
-
up:
|
|
2979
|
+
down: Wr,
|
|
2980
|
+
up: Vr
|
|
2895
2981
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2896
|
-
async function
|
|
2982
|
+
async function Hr(t) {
|
|
2897
2983
|
await t.schema.alterTable("otps").addColumn("audience", "varchar(255)").execute();
|
|
2898
2984
|
}
|
|
2899
|
-
async function
|
|
2985
|
+
async function Xr(t) {
|
|
2900
2986
|
await t.schema.alterTable("otps").dropColumn("audience").execute();
|
|
2901
2987
|
}
|
|
2902
|
-
const
|
|
2988
|
+
const Yr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2903
2989
|
__proto__: null,
|
|
2904
|
-
down:
|
|
2905
|
-
up:
|
|
2990
|
+
down: Xr,
|
|
2991
|
+
up: Hr
|
|
2906
2992
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2907
|
-
async function
|
|
2993
|
+
async function Zr(t) {
|
|
2908
2994
|
}
|
|
2909
|
-
async function
|
|
2995
|
+
async function en(t) {
|
|
2910
2996
|
}
|
|
2911
|
-
const
|
|
2997
|
+
const tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2912
2998
|
__proto__: null,
|
|
2913
|
-
down:
|
|
2914
|
-
up:
|
|
2999
|
+
down: en,
|
|
3000
|
+
up: Zr
|
|
2915
3001
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2916
|
-
async function
|
|
3002
|
+
async function an(t) {
|
|
2917
3003
|
await t.schema.alterTable("logs").dropColumn("category").execute();
|
|
2918
3004
|
}
|
|
2919
|
-
async function
|
|
3005
|
+
async function rn(t) {
|
|
2920
3006
|
await t.schema.alterTable("logs").addColumn("category", "varchar(255)", (e) => e.notNull()).execute();
|
|
2921
3007
|
}
|
|
2922
|
-
const
|
|
3008
|
+
const nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2923
3009
|
__proto__: null,
|
|
2924
|
-
down:
|
|
2925
|
-
up:
|
|
3010
|
+
down: rn,
|
|
3011
|
+
up: an
|
|
2926
3012
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2927
|
-
async function
|
|
3013
|
+
async function on(t) {
|
|
2928
3014
|
await t.schema.alterTable("users").dropColumn("tags").execute();
|
|
2929
3015
|
}
|
|
2930
|
-
async function
|
|
3016
|
+
async function sn(t) {
|
|
2931
3017
|
await t.schema.alterTable("users").addColumn("tags", "varchar(255)").execute();
|
|
2932
3018
|
}
|
|
2933
|
-
const
|
|
3019
|
+
const cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2934
3020
|
__proto__: null,
|
|
2935
|
-
down:
|
|
2936
|
-
up:
|
|
3021
|
+
down: sn,
|
|
3022
|
+
up: on
|
|
2937
3023
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2938
|
-
async function
|
|
3024
|
+
async function ln(t) {
|
|
2939
3025
|
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
3026
|
}
|
|
2941
|
-
async function
|
|
3027
|
+
async function dn(t) {
|
|
2942
3028
|
await t.schema.dropIndex("logs_user_id"), await t.schema.dropIndex("logs_tenant_id"), await t.schema.dropIndex("logs_date");
|
|
2943
3029
|
}
|
|
2944
|
-
const
|
|
3030
|
+
const un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2945
3031
|
__proto__: null,
|
|
2946
|
-
down:
|
|
2947
|
-
up:
|
|
3032
|
+
down: dn,
|
|
3033
|
+
up: ln
|
|
2948
3034
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2949
|
-
async function
|
|
3035
|
+
async function mn(t) {
|
|
2950
3036
|
await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(8192)").execute();
|
|
2951
3037
|
}
|
|
2952
|
-
async function
|
|
3038
|
+
async function hn(t) {
|
|
2953
3039
|
await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(2048)").execute();
|
|
2954
3040
|
}
|
|
2955
|
-
const
|
|
3041
|
+
const _n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2956
3042
|
__proto__: null,
|
|
2957
|
-
down:
|
|
2958
|
-
up:
|
|
3043
|
+
down: hn,
|
|
3044
|
+
up: mn
|
|
2959
3045
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2960
|
-
async function
|
|
3046
|
+
async function fn(t) {
|
|
2961
3047
|
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
3048
|
}
|
|
2963
|
-
async function
|
|
3049
|
+
async function pn(t) {
|
|
2964
3050
|
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
3051
|
}
|
|
2966
|
-
const
|
|
3052
|
+
const gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2967
3053
|
__proto__: null,
|
|
2968
|
-
down:
|
|
2969
|
-
up:
|
|
3054
|
+
down: pn,
|
|
3055
|
+
up: fn
|
|
2970
3056
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2971
|
-
async function
|
|
3057
|
+
async function yn(t) {
|
|
2972
3058
|
await t.schema.createIndex("users_name_index").on("users").column("name").execute();
|
|
2973
3059
|
}
|
|
2974
|
-
async function
|
|
3060
|
+
async function wn(t) {
|
|
2975
3061
|
await t.schema.dropIndex("users_name_index").execute();
|
|
2976
3062
|
}
|
|
2977
|
-
const
|
|
3063
|
+
const vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2978
3064
|
__proto__: null,
|
|
2979
|
-
down:
|
|
2980
|
-
up:
|
|
3065
|
+
down: wn,
|
|
3066
|
+
up: yn
|
|
2981
3067
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2982
|
-
async function
|
|
3068
|
+
async function Nn(t) {
|
|
2983
3069
|
}
|
|
2984
|
-
async function
|
|
3070
|
+
async function Cn(t) {
|
|
2985
3071
|
await t.schema.alterTable("users").dropConstraint("unique_email_provider").execute();
|
|
2986
3072
|
}
|
|
2987
|
-
const
|
|
3073
|
+
const bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2988
3074
|
__proto__: null,
|
|
2989
|
-
down:
|
|
2990
|
-
up:
|
|
3075
|
+
down: Cn,
|
|
3076
|
+
up: Nn
|
|
2991
3077
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2992
|
-
async function
|
|
3078
|
+
async function xn(t) {
|
|
2993
3079
|
await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(8192)").execute();
|
|
2994
3080
|
}
|
|
2995
|
-
async function
|
|
3081
|
+
async function Tn(t) {
|
|
2996
3082
|
await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(1024)").execute();
|
|
2997
3083
|
}
|
|
2998
|
-
const
|
|
3084
|
+
const Sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2999
3085
|
__proto__: null,
|
|
3000
|
-
down:
|
|
3001
|
-
up:
|
|
3086
|
+
down: Tn,
|
|
3087
|
+
up: xn
|
|
3002
3088
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3003
|
-
async function
|
|
3089
|
+
async function On(t) {
|
|
3004
3090
|
await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(8192)").execute();
|
|
3005
3091
|
}
|
|
3006
|
-
async function
|
|
3092
|
+
async function kn(t) {
|
|
3007
3093
|
await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(1024)").execute();
|
|
3008
3094
|
}
|
|
3009
|
-
const
|
|
3095
|
+
const $n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3010
3096
|
__proto__: null,
|
|
3011
|
-
down:
|
|
3012
|
-
up:
|
|
3097
|
+
down: kn,
|
|
3098
|
+
up: On
|
|
3013
3099
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3014
|
-
async function
|
|
3100
|
+
async function Dn(t) {
|
|
3015
3101
|
await t.schema.createTable("branding").addColumn(
|
|
3016
3102
|
"tenant_id",
|
|
3017
3103
|
"varchar(255)",
|
|
3018
3104
|
(e) => e.references("tenants.id").onDelete("cascade").notNull().primaryKey()
|
|
3019
3105
|
).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
3106
|
}
|
|
3021
|
-
async function
|
|
3107
|
+
async function In(t) {
|
|
3022
3108
|
await t.schema.dropTable("branding").execute();
|
|
3023
3109
|
}
|
|
3024
|
-
const
|
|
3110
|
+
const Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3025
3111
|
__proto__: null,
|
|
3026
|
-
down:
|
|
3027
|
-
up:
|
|
3112
|
+
down: In,
|
|
3113
|
+
up: Dn
|
|
3028
3114
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3029
|
-
async function
|
|
3115
|
+
async function jn(t) {
|
|
3030
3116
|
}
|
|
3031
|
-
async function
|
|
3117
|
+
async function Mn(t) {
|
|
3032
3118
|
}
|
|
3033
|
-
const
|
|
3119
|
+
const Fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3034
3120
|
__proto__: null,
|
|
3035
|
-
down:
|
|
3036
|
-
up:
|
|
3121
|
+
down: Mn,
|
|
3122
|
+
up: jn
|
|
3037
3123
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3038
|
-
async function
|
|
3124
|
+
async function An(t) {
|
|
3039
3125
|
}
|
|
3040
|
-
async function
|
|
3126
|
+
async function Ln(t) {
|
|
3041
3127
|
}
|
|
3042
|
-
const
|
|
3128
|
+
const zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3043
3129
|
__proto__: null,
|
|
3044
|
-
down:
|
|
3045
|
-
up:
|
|
3130
|
+
down: Ln,
|
|
3131
|
+
up: An
|
|
3046
3132
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3047
|
-
async function
|
|
3133
|
+
async function Jn(t) {
|
|
3048
3134
|
}
|
|
3049
|
-
async function
|
|
3135
|
+
async function En(t) {
|
|
3050
3136
|
}
|
|
3051
|
-
const
|
|
3137
|
+
const Kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3052
3138
|
__proto__: null,
|
|
3053
|
-
down:
|
|
3054
|
-
up:
|
|
3139
|
+
down: En,
|
|
3140
|
+
up: Jn
|
|
3055
3141
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3056
|
-
async function
|
|
3142
|
+
async function Rn(t) {
|
|
3057
3143
|
}
|
|
3058
|
-
async function
|
|
3144
|
+
async function Un(t) {
|
|
3059
3145
|
}
|
|
3060
|
-
const
|
|
3146
|
+
const Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3061
3147
|
__proto__: null,
|
|
3062
|
-
down:
|
|
3063
|
-
up:
|
|
3148
|
+
down: Un,
|
|
3149
|
+
up: Rn
|
|
3064
3150
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3065
|
-
async function
|
|
3151
|
+
async function Qn(t) {
|
|
3066
3152
|
await t.schema.createTable("authentication_codes").addColumn(
|
|
3067
3153
|
"tenant_id",
|
|
3068
3154
|
"varchar(255)",
|
|
@@ -3073,55 +3159,55 @@ async function zn(t) {
|
|
|
3073
3159
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
3074
3160
|
).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
3161
|
}
|
|
3076
|
-
async function
|
|
3162
|
+
async function qn(t) {
|
|
3077
3163
|
await t.schema.dropTable("authentication_codes").execute();
|
|
3078
3164
|
}
|
|
3079
|
-
const
|
|
3165
|
+
const Vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3080
3166
|
__proto__: null,
|
|
3081
|
-
down:
|
|
3082
|
-
up:
|
|
3167
|
+
down: qn,
|
|
3168
|
+
up: Qn
|
|
3083
3169
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3084
|
-
async function
|
|
3170
|
+
async function Wn(t) {
|
|
3085
3171
|
}
|
|
3086
|
-
async function
|
|
3172
|
+
async function Gn(t) {
|
|
3087
3173
|
}
|
|
3088
|
-
const
|
|
3174
|
+
const Hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3089
3175
|
__proto__: null,
|
|
3090
|
-
down:
|
|
3091
|
-
up:
|
|
3176
|
+
down: Gn,
|
|
3177
|
+
up: Wn
|
|
3092
3178
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3093
|
-
async function
|
|
3179
|
+
async function Xn(t) {
|
|
3094
3180
|
await t.schema.alterTable("otps").addColumn("ip", "varchar(64)").execute();
|
|
3095
3181
|
}
|
|
3096
|
-
async function
|
|
3182
|
+
async function Yn(t) {
|
|
3097
3183
|
await t.schema.alterTable("otps").dropColumn("ip").execute();
|
|
3098
3184
|
}
|
|
3099
|
-
const
|
|
3185
|
+
const Zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3100
3186
|
__proto__: null,
|
|
3101
|
-
down:
|
|
3102
|
-
up:
|
|
3187
|
+
down: Yn,
|
|
3188
|
+
up: Xn
|
|
3103
3189
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3104
|
-
async function
|
|
3190
|
+
async function eo(t) {
|
|
3105
3191
|
await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(1024)").execute();
|
|
3106
3192
|
}
|
|
3107
|
-
async function
|
|
3193
|
+
async function to(t) {
|
|
3108
3194
|
await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(255)").execute();
|
|
3109
3195
|
}
|
|
3110
|
-
const
|
|
3196
|
+
const ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3111
3197
|
__proto__: null,
|
|
3112
|
-
down:
|
|
3113
|
-
up:
|
|
3198
|
+
down: to,
|
|
3199
|
+
up: eo
|
|
3114
3200
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3115
|
-
async function
|
|
3201
|
+
async function ro(t) {
|
|
3116
3202
|
}
|
|
3117
|
-
async function
|
|
3203
|
+
async function no(t) {
|
|
3118
3204
|
}
|
|
3119
|
-
const
|
|
3205
|
+
const oo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3120
3206
|
__proto__: null,
|
|
3121
|
-
down:
|
|
3122
|
-
up:
|
|
3207
|
+
down: no,
|
|
3208
|
+
up: ro
|
|
3123
3209
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3124
|
-
async function
|
|
3210
|
+
async function so(t) {
|
|
3125
3211
|
await t.schema.createTable("hooks").addColumn("hook_id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
|
|
3126
3212
|
"tenant_id",
|
|
3127
3213
|
"varchar(255)",
|
|
@@ -3132,33 +3218,33 @@ async function Zn(t) {
|
|
|
3132
3218
|
(e) => e.defaultTo(!1).notNull()
|
|
3133
3219
|
).addColumn("priority", "integer").execute();
|
|
3134
3220
|
}
|
|
3135
|
-
async function
|
|
3221
|
+
async function io(t) {
|
|
3136
3222
|
await t.schema.dropTable("hooks").execute();
|
|
3137
3223
|
}
|
|
3138
|
-
const
|
|
3224
|
+
const co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3139
3225
|
__proto__: null,
|
|
3140
|
-
down:
|
|
3141
|
-
up:
|
|
3226
|
+
down: io,
|
|
3227
|
+
up: so
|
|
3142
3228
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3143
|
-
async function
|
|
3229
|
+
async function lo(t) {
|
|
3144
3230
|
}
|
|
3145
|
-
async function
|
|
3231
|
+
async function uo(t) {
|
|
3146
3232
|
}
|
|
3147
|
-
const
|
|
3233
|
+
const mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3148
3234
|
__proto__: null,
|
|
3149
|
-
down:
|
|
3150
|
-
up:
|
|
3235
|
+
down: uo,
|
|
3236
|
+
up: lo
|
|
3151
3237
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3152
|
-
async function
|
|
3238
|
+
async function ho(t) {
|
|
3153
3239
|
}
|
|
3154
|
-
async function
|
|
3240
|
+
async function _o(t) {
|
|
3155
3241
|
}
|
|
3156
|
-
const
|
|
3242
|
+
const fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3157
3243
|
__proto__: null,
|
|
3158
|
-
down:
|
|
3159
|
-
up:
|
|
3244
|
+
down: _o,
|
|
3245
|
+
up: ho
|
|
3160
3246
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3161
|
-
async function
|
|
3247
|
+
async function po(t) {
|
|
3162
3248
|
await t.schema.createTable("logins").addColumn("login_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
3163
3249
|
"tenant_id",
|
|
3164
3250
|
"varchar(255)",
|
|
@@ -3175,7 +3261,7 @@ async function co(t) {
|
|
|
3175
3261
|
(e) => e.onDelete("cascade")
|
|
3176
3262
|
).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
3263
|
}
|
|
3178
|
-
async function
|
|
3264
|
+
async function go(t) {
|
|
3179
3265
|
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
3266
|
"codes_user_id_tenant_id_constraint",
|
|
3181
3267
|
["user_id", "tenant_id"],
|
|
@@ -3184,90 +3270,90 @@ async function lo(t) {
|
|
|
3184
3270
|
(e) => e.onDelete("cascade")
|
|
3185
3271
|
).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
3272
|
}
|
|
3187
|
-
const
|
|
3273
|
+
const yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3188
3274
|
__proto__: null,
|
|
3189
|
-
down:
|
|
3190
|
-
up:
|
|
3275
|
+
down: go,
|
|
3276
|
+
up: po
|
|
3191
3277
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3192
|
-
async function
|
|
3278
|
+
async function wo(t) {
|
|
3193
3279
|
}
|
|
3194
|
-
async function
|
|
3280
|
+
async function vo(t) {
|
|
3195
3281
|
}
|
|
3196
|
-
const
|
|
3282
|
+
const No = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3197
3283
|
__proto__: null,
|
|
3198
|
-
down:
|
|
3199
|
-
up:
|
|
3284
|
+
down: vo,
|
|
3285
|
+
up: wo
|
|
3200
3286
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3201
|
-
async function
|
|
3287
|
+
async function Co(t) {
|
|
3202
3288
|
await t.schema.alterTable("logins").addColumn("auth0Client", "varchar(256)").execute();
|
|
3203
3289
|
}
|
|
3204
|
-
async function
|
|
3290
|
+
async function bo(t) {
|
|
3205
3291
|
await t.schema.alterTable("logins").dropColumn("auth0Client").execute();
|
|
3206
3292
|
}
|
|
3207
|
-
const
|
|
3293
|
+
const xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3208
3294
|
__proto__: null,
|
|
3209
|
-
down:
|
|
3210
|
-
up:
|
|
3295
|
+
down: bo,
|
|
3296
|
+
up: Co
|
|
3211
3297
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3212
|
-
async function
|
|
3298
|
+
async function To(t) {
|
|
3213
3299
|
await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(8192)").execute();
|
|
3214
3300
|
}
|
|
3215
|
-
async function
|
|
3301
|
+
async function So(t) {
|
|
3216
3302
|
await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(511)").execute();
|
|
3217
3303
|
}
|
|
3218
|
-
const
|
|
3304
|
+
const Oo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3219
3305
|
__proto__: null,
|
|
3220
|
-
down:
|
|
3221
|
-
up:
|
|
3306
|
+
down: So,
|
|
3307
|
+
up: To
|
|
3222
3308
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3223
|
-
async function
|
|
3309
|
+
async function ko(t) {
|
|
3224
3310
|
}
|
|
3225
|
-
async function
|
|
3311
|
+
async function $o(t) {
|
|
3226
3312
|
}
|
|
3227
|
-
const
|
|
3313
|
+
const Do = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3228
3314
|
__proto__: null,
|
|
3229
|
-
down:
|
|
3230
|
-
up:
|
|
3315
|
+
down: $o,
|
|
3316
|
+
up: ko
|
|
3231
3317
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3232
|
-
async function
|
|
3318
|
+
async function Io(t) {
|
|
3233
3319
|
}
|
|
3234
|
-
async function
|
|
3320
|
+
async function Po(t) {
|
|
3235
3321
|
}
|
|
3236
|
-
const
|
|
3322
|
+
const jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3237
3323
|
__proto__: null,
|
|
3238
|
-
down:
|
|
3239
|
-
up:
|
|
3324
|
+
down: Po,
|
|
3325
|
+
up: Io
|
|
3240
3326
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3241
|
-
async function
|
|
3327
|
+
async function Mo(t) {
|
|
3242
3328
|
await t.schema.alterTable("logins").addColumn("authParams_nonce", "varchar(255)").execute();
|
|
3243
3329
|
}
|
|
3244
|
-
async function
|
|
3330
|
+
async function Fo(t) {
|
|
3245
3331
|
await t.schema.alterTable("logins").dropColumn("nonce").execute();
|
|
3246
3332
|
}
|
|
3247
|
-
const
|
|
3333
|
+
const Ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3248
3334
|
__proto__: null,
|
|
3249
|
-
down:
|
|
3250
|
-
up:
|
|
3335
|
+
down: Fo,
|
|
3336
|
+
up: Mo
|
|
3251
3337
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3252
|
-
async function
|
|
3338
|
+
async function Lo(t) {
|
|
3253
3339
|
}
|
|
3254
|
-
async function
|
|
3340
|
+
async function zo(t) {
|
|
3255
3341
|
}
|
|
3256
|
-
const
|
|
3342
|
+
const Jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3257
3343
|
__proto__: null,
|
|
3258
|
-
down:
|
|
3259
|
-
up:
|
|
3344
|
+
down: zo,
|
|
3345
|
+
up: Lo
|
|
3260
3346
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3261
|
-
async function
|
|
3347
|
+
async function Eo(t) {
|
|
3262
3348
|
}
|
|
3263
|
-
async function
|
|
3349
|
+
async function Ko(t) {
|
|
3264
3350
|
}
|
|
3265
|
-
const
|
|
3351
|
+
const Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3266
3352
|
__proto__: null,
|
|
3267
|
-
down:
|
|
3268
|
-
up:
|
|
3353
|
+
down: Ko,
|
|
3354
|
+
up: Eo
|
|
3269
3355
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3270
|
-
async function
|
|
3356
|
+
async function Uo(t) {
|
|
3271
3357
|
await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.notNull()).addColumn(
|
|
3272
3358
|
"tenant_id",
|
|
3273
3359
|
"varchar(255)",
|
|
@@ -3283,7 +3369,7 @@ async function Ao(t) {
|
|
|
3283
3369
|
"code_type"
|
|
3284
3370
|
]).execute();
|
|
3285
3371
|
}
|
|
3286
|
-
async function
|
|
3372
|
+
async function Bo(t) {
|
|
3287
3373
|
await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
|
|
3288
3374
|
"tenant_id",
|
|
3289
3375
|
"varchar(255)",
|
|
@@ -3296,15 +3382,15 @@ async function Lo(t) {
|
|
|
3296
3382
|
(e) => e.onDelete("cascade")
|
|
3297
3383
|
).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
3384
|
}
|
|
3299
|
-
const
|
|
3385
|
+
const Qo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3300
3386
|
__proto__: null,
|
|
3301
|
-
down:
|
|
3302
|
-
up:
|
|
3387
|
+
down: Bo,
|
|
3388
|
+
up: Uo
|
|
3303
3389
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3304
|
-
async function
|
|
3390
|
+
async function qo(t) {
|
|
3305
3391
|
await t.schema.dropTable("otps").execute(), await t.schema.dropTable("authentication_codes").execute();
|
|
3306
3392
|
}
|
|
3307
|
-
async function
|
|
3393
|
+
async function Vo(t) {
|
|
3308
3394
|
await t.schema.alterTable("keys").addColumn("private_key", "varchar(2048)").addColumn("public_key", "varchar(2048)").execute(), await t.schema.createTable("otps").addColumn(
|
|
3309
3395
|
"tenant_id",
|
|
3310
3396
|
"varchar(255)",
|
|
@@ -3323,32 +3409,32 @@ async function Jo(t) {
|
|
|
3323
3409
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
3324
3410
|
).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
3411
|
}
|
|
3326
|
-
const
|
|
3412
|
+
const Wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3327
3413
|
__proto__: null,
|
|
3328
|
-
down:
|
|
3329
|
-
up:
|
|
3414
|
+
down: Vo,
|
|
3415
|
+
up: qo
|
|
3330
3416
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3331
|
-
async function
|
|
3417
|
+
async function Go(t) {
|
|
3332
3418
|
await t.schema.createIndex("IDX_logs_tenant_date_type_user").on("logs").columns(["tenant_id", "date", "type", "user_id"]).execute();
|
|
3333
3419
|
}
|
|
3334
|
-
async function
|
|
3420
|
+
async function Ho(t) {
|
|
3335
3421
|
await t.schema.dropIndex("IDX_logs_tenant_date_type_user").on("logs").execute();
|
|
3336
3422
|
}
|
|
3337
|
-
const
|
|
3423
|
+
const Xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3338
3424
|
__proto__: null,
|
|
3339
|
-
down:
|
|
3340
|
-
up:
|
|
3425
|
+
down: Ho,
|
|
3426
|
+
up: Go
|
|
3341
3427
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3342
|
-
async function
|
|
3428
|
+
async function Yo(t) {
|
|
3343
3429
|
}
|
|
3344
|
-
async function
|
|
3430
|
+
async function Zo(t) {
|
|
3345
3431
|
}
|
|
3346
|
-
const
|
|
3432
|
+
const es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3347
3433
|
__proto__: null,
|
|
3348
|
-
down:
|
|
3349
|
-
up:
|
|
3434
|
+
down: Zo,
|
|
3435
|
+
up: Yo
|
|
3350
3436
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3351
|
-
async function
|
|
3437
|
+
async function ts(t) {
|
|
3352
3438
|
await t.schema.createTable("prompt_settings").addColumn("tenant_id", "varchar(64)", (e) => e.primaryKey()).addColumn(
|
|
3353
3439
|
"universal_login_experience",
|
|
3354
3440
|
"varchar(16)",
|
|
@@ -3367,95 +3453,95 @@ async function qo(t) {
|
|
|
3367
3453
|
(e) => e.defaultTo(!1).notNull()
|
|
3368
3454
|
).execute();
|
|
3369
3455
|
}
|
|
3370
|
-
async function
|
|
3456
|
+
async function as(t) {
|
|
3371
3457
|
await t.schema.dropTable("prompt_settings").execute();
|
|
3372
3458
|
}
|
|
3373
|
-
const
|
|
3459
|
+
const rs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3374
3460
|
__proto__: null,
|
|
3375
|
-
down:
|
|
3376
|
-
up:
|
|
3461
|
+
down: as,
|
|
3462
|
+
up: ts
|
|
3377
3463
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3378
|
-
async function
|
|
3464
|
+
async function ns(t) {
|
|
3379
3465
|
}
|
|
3380
|
-
async function
|
|
3466
|
+
async function os(t) {
|
|
3381
3467
|
}
|
|
3382
|
-
const
|
|
3468
|
+
const ss = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3383
3469
|
__proto__: null,
|
|
3384
|
-
down:
|
|
3385
|
-
up:
|
|
3470
|
+
down: os,
|
|
3471
|
+
up: ns
|
|
3386
3472
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3387
|
-
async function
|
|
3473
|
+
async function is(t) {
|
|
3388
3474
|
}
|
|
3389
|
-
async function
|
|
3475
|
+
async function cs(t) {
|
|
3390
3476
|
}
|
|
3391
|
-
const
|
|
3477
|
+
const ls = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3392
3478
|
__proto__: null,
|
|
3393
|
-
down:
|
|
3394
|
-
up:
|
|
3479
|
+
down: cs,
|
|
3480
|
+
up: is
|
|
3395
3481
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3396
|
-
async function
|
|
3482
|
+
async function ds(t) {
|
|
3397
3483
|
}
|
|
3398
|
-
async function
|
|
3484
|
+
async function us(t) {
|
|
3399
3485
|
}
|
|
3400
|
-
const
|
|
3486
|
+
const ms = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3401
3487
|
__proto__: null,
|
|
3402
|
-
down:
|
|
3403
|
-
up:
|
|
3488
|
+
down: us,
|
|
3489
|
+
up: ds
|
|
3404
3490
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3405
|
-
async function
|
|
3491
|
+
async function hs(t) {
|
|
3406
3492
|
await t.schema.alterTable("logins").addColumn("authParams_ui_locales", "varchar(32)").execute();
|
|
3407
3493
|
}
|
|
3408
|
-
async function
|
|
3494
|
+
async function _s(t) {
|
|
3409
3495
|
await t.schema.alterTable("logins").dropColumn("authParams_ui_locales").execute();
|
|
3410
3496
|
}
|
|
3411
|
-
const
|
|
3497
|
+
const fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3412
3498
|
__proto__: null,
|
|
3413
|
-
down:
|
|
3414
|
-
up:
|
|
3499
|
+
down: _s,
|
|
3500
|
+
up: hs
|
|
3415
3501
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3416
|
-
async function
|
|
3502
|
+
async function ps(t) {
|
|
3417
3503
|
await t.schema.alterTable("logins").addColumn("authParams_prompt", "varchar(16)").execute();
|
|
3418
3504
|
}
|
|
3419
|
-
async function
|
|
3505
|
+
async function gs(t) {
|
|
3420
3506
|
await t.schema.alterTable("logins").dropColumn("authParams_prompt").execute();
|
|
3421
3507
|
}
|
|
3422
|
-
const
|
|
3508
|
+
const ys = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3423
3509
|
__proto__: null,
|
|
3424
|
-
down:
|
|
3425
|
-
up:
|
|
3510
|
+
down: gs,
|
|
3511
|
+
up: ps
|
|
3426
3512
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3427
|
-
async function
|
|
3513
|
+
async function ws(t) {
|
|
3428
3514
|
}
|
|
3429
|
-
async function
|
|
3515
|
+
async function vs(t) {
|
|
3430
3516
|
}
|
|
3431
|
-
const
|
|
3517
|
+
const Ns = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3432
3518
|
__proto__: null,
|
|
3433
|
-
down:
|
|
3434
|
-
up:
|
|
3519
|
+
down: vs,
|
|
3520
|
+
up: ws
|
|
3435
3521
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3436
|
-
async function
|
|
3522
|
+
async function Cs(t) {
|
|
3437
3523
|
await t.schema.alterTable("logins").addColumn("authParams_act_as", "varchar(255)").execute();
|
|
3438
3524
|
}
|
|
3439
|
-
async function
|
|
3525
|
+
async function bs(t) {
|
|
3440
3526
|
await t.schema.alterTable("logins").dropColumn("authParam_act_as").execute();
|
|
3441
3527
|
}
|
|
3442
|
-
const
|
|
3528
|
+
const xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3443
3529
|
__proto__: null,
|
|
3444
|
-
down:
|
|
3445
|
-
up:
|
|
3530
|
+
down: bs,
|
|
3531
|
+
up: Cs
|
|
3446
3532
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3447
|
-
async function
|
|
3533
|
+
async function Ts(t) {
|
|
3448
3534
|
await t.schema.alterTable("codes").addColumn("code_verifier", "varchar(128)").execute();
|
|
3449
3535
|
}
|
|
3450
|
-
async function
|
|
3536
|
+
async function Ss(t) {
|
|
3451
3537
|
await t.schema.alterTable("codes").dropColumn("code_verifier").execute();
|
|
3452
3538
|
}
|
|
3453
|
-
const
|
|
3539
|
+
const Os = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3454
3540
|
__proto__: null,
|
|
3455
|
-
down:
|
|
3456
|
-
up:
|
|
3541
|
+
down: Ss,
|
|
3542
|
+
up: Ts
|
|
3457
3543
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3458
|
-
async function
|
|
3544
|
+
async function ks(t) {
|
|
3459
3545
|
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
3546
|
"credentials",
|
|
3461
3547
|
"varchar(2048)",
|
|
@@ -3466,18 +3552,18 @@ async function Ns(t) {
|
|
|
3466
3552
|
(e) => e.notNull().defaultTo("{}")
|
|
3467
3553
|
).addColumn("created_at", "varchar(29)", (e) => e.notNull()).addColumn("updated_at", "varchar(29)", (e) => e.notNull()).execute();
|
|
3468
3554
|
}
|
|
3469
|
-
async function
|
|
3555
|
+
async function $s(t) {
|
|
3470
3556
|
await t.schema.dropTable("email_providers").execute();
|
|
3471
3557
|
}
|
|
3472
|
-
const
|
|
3558
|
+
const Ds = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3473
3559
|
__proto__: null,
|
|
3474
|
-
down:
|
|
3475
|
-
up:
|
|
3560
|
+
down: $s,
|
|
3561
|
+
up: ks
|
|
3476
3562
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3477
|
-
async function
|
|
3563
|
+
async function Is(t) {
|
|
3478
3564
|
await t.schema.dropTable("tickets").execute();
|
|
3479
3565
|
}
|
|
3480
|
-
async function
|
|
3566
|
+
async function Ps(t) {
|
|
3481
3567
|
await t.schema.createTable("tickets").addColumn(
|
|
3482
3568
|
"tenant_id",
|
|
3483
3569
|
"varchar(255)",
|
|
@@ -3488,22 +3574,22 @@ async function Ts(t) {
|
|
|
3488
3574
|
(e) => e.references("applications.id").onDelete("cascade").notNull()
|
|
3489
3575
|
).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
3576
|
}
|
|
3491
|
-
const
|
|
3577
|
+
const js = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3492
3578
|
__proto__: null,
|
|
3493
|
-
down:
|
|
3494
|
-
up:
|
|
3579
|
+
down: Ps,
|
|
3580
|
+
up: Is
|
|
3495
3581
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3496
|
-
async function
|
|
3582
|
+
async function Ms(t) {
|
|
3497
3583
|
}
|
|
3498
|
-
async function
|
|
3584
|
+
async function Fs(t) {
|
|
3499
3585
|
await t.schema.alterTable("logins").dropColumn("ip").dropColumn("useragent").execute();
|
|
3500
3586
|
}
|
|
3501
|
-
const
|
|
3587
|
+
const As = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3502
3588
|
__proto__: null,
|
|
3503
|
-
down:
|
|
3504
|
-
up:
|
|
3589
|
+
down: Fs,
|
|
3590
|
+
up: Ms
|
|
3505
3591
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3506
|
-
async function
|
|
3592
|
+
async function Ls(t) {
|
|
3507
3593
|
await t.schema.createTable("refresh_tokens").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn(
|
|
3508
3594
|
"client_id",
|
|
3509
3595
|
"varchar(21)",
|
|
@@ -3516,27 +3602,27 @@ async function Ds(t) {
|
|
|
3516
3602
|
(e) => e.onDelete("cascade")
|
|
3517
3603
|
).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
3604
|
}
|
|
3519
|
-
async function
|
|
3605
|
+
async function zs(t) {
|
|
3520
3606
|
await t.schema.dropTable("refresh_tokens").execute();
|
|
3521
3607
|
}
|
|
3522
|
-
const
|
|
3608
|
+
const Js = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3523
3609
|
__proto__: null,
|
|
3524
|
-
down:
|
|
3525
|
-
up:
|
|
3610
|
+
down: zs,
|
|
3611
|
+
up: Ls
|
|
3526
3612
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3527
|
-
async function
|
|
3613
|
+
async function Es(t) {
|
|
3528
3614
|
}
|
|
3529
|
-
async function
|
|
3615
|
+
async function Ks(t) {
|
|
3530
3616
|
}
|
|
3531
|
-
const
|
|
3617
|
+
const Rs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3532
3618
|
__proto__: null,
|
|
3533
|
-
down:
|
|
3534
|
-
up:
|
|
3619
|
+
down: Ks,
|
|
3620
|
+
up: Es
|
|
3535
3621
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3536
|
-
async function
|
|
3622
|
+
async function Us(t) {
|
|
3537
3623
|
await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("refresh_tokens").execute();
|
|
3538
3624
|
}
|
|
3539
|
-
async function
|
|
3625
|
+
async function Bs(t) {
|
|
3540
3626
|
await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
3541
3627
|
"sessions_user_id_constraint",
|
|
3542
3628
|
["user_id", "tenant_id"],
|
|
@@ -3555,12 +3641,12 @@ async function Ls(t) {
|
|
|
3555
3641
|
(e) => e.onDelete("cascade")
|
|
3556
3642
|
).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
3643
|
}
|
|
3558
|
-
const
|
|
3644
|
+
const Qs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3559
3645
|
__proto__: null,
|
|
3560
|
-
down:
|
|
3561
|
-
up:
|
|
3646
|
+
down: Bs,
|
|
3647
|
+
up: Us
|
|
3562
3648
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3563
|
-
async function
|
|
3649
|
+
async function qs(t) {
|
|
3564
3650
|
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
3651
|
"sessions_2_user_id_constraint",
|
|
3566
3652
|
["user_id", "tenant_id"],
|
|
@@ -3579,15 +3665,15 @@ async function Es(t) {
|
|
|
3579
3665
|
(e) => e.onDelete("cascade")
|
|
3580
3666
|
).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
3667
|
}
|
|
3582
|
-
async function
|
|
3668
|
+
async function Vs(t) {
|
|
3583
3669
|
await t.schema.dropTable("sessions_2").execute(), await t.schema.dropTable("refresh_tokens_2").execute();
|
|
3584
3670
|
}
|
|
3585
|
-
const
|
|
3671
|
+
const Ws = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3586
3672
|
__proto__: null,
|
|
3587
|
-
down:
|
|
3588
|
-
up:
|
|
3673
|
+
down: Vs,
|
|
3674
|
+
up: qs
|
|
3589
3675
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3590
|
-
async function
|
|
3676
|
+
async function Gs(t) {
|
|
3591
3677
|
await t.schema.createTable("custom_domains").addColumn(
|
|
3592
3678
|
"custom_domain_id",
|
|
3593
3679
|
"varchar(21)",
|
|
@@ -3598,49 +3684,49 @@ async function Rs(t) {
|
|
|
3598
3684
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
3599
3685
|
).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
3686
|
}
|
|
3601
|
-
async function
|
|
3687
|
+
async function Hs(t) {
|
|
3602
3688
|
await t.schema.dropTable("custom_domains").execute(), await t.schema.createTable("domains").addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
|
|
3603
3689
|
"tenant_id",
|
|
3604
3690
|
"varchar(255)",
|
|
3605
3691
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
3606
3692
|
).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
3693
|
}
|
|
3608
|
-
const
|
|
3694
|
+
const Xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3609
3695
|
__proto__: null,
|
|
3610
|
-
down:
|
|
3611
|
-
up:
|
|
3696
|
+
down: Hs,
|
|
3697
|
+
up: Gs
|
|
3612
3698
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3613
|
-
async function
|
|
3699
|
+
async function Ys(t) {
|
|
3614
3700
|
}
|
|
3615
|
-
async function
|
|
3701
|
+
async function Zs(t) {
|
|
3616
3702
|
await t.schema.alterTable("logins").dropColumn("authParams_organization").dropColumn("authorization_url").execute();
|
|
3617
3703
|
}
|
|
3618
|
-
const
|
|
3704
|
+
const ei = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3619
3705
|
__proto__: null,
|
|
3620
|
-
down:
|
|
3621
|
-
up:
|
|
3706
|
+
down: Zs,
|
|
3707
|
+
up: Ys
|
|
3622
3708
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3623
|
-
async function
|
|
3709
|
+
async function ti(t) {
|
|
3624
3710
|
await t.schema.alterTable("logins").dropColumn("authorization_url").execute(), await t.schema.alterTable("logins").addColumn("authorization_url", "varchar(2048)").execute();
|
|
3625
3711
|
}
|
|
3626
|
-
async function
|
|
3712
|
+
async function ai(t) {
|
|
3627
3713
|
await t.schema.alterTable("logins").dropColumn("authorization_url").execute(), await t.schema.alterTable("logins").addColumn("authorization_url", "varchar(1024)").execute();
|
|
3628
3714
|
}
|
|
3629
|
-
const
|
|
3715
|
+
const ri = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3630
3716
|
__proto__: null,
|
|
3631
|
-
down:
|
|
3632
|
-
up:
|
|
3717
|
+
down: ai,
|
|
3718
|
+
up: ti
|
|
3633
3719
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3634
|
-
async function
|
|
3720
|
+
async function ni(t) {
|
|
3635
3721
|
}
|
|
3636
|
-
async function
|
|
3722
|
+
async function oi(t) {
|
|
3637
3723
|
}
|
|
3638
|
-
const
|
|
3724
|
+
const si = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3639
3725
|
__proto__: null,
|
|
3640
|
-
down:
|
|
3641
|
-
up:
|
|
3726
|
+
down: oi,
|
|
3727
|
+
up: ni
|
|
3642
3728
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3643
|
-
async function
|
|
3729
|
+
async function ii(t) {
|
|
3644
3730
|
await t.schema.createTable("sessions").addColumn("id", "varchar(21)", (e) => e.primaryKey()).addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
|
|
3645
3731
|
"sessions_user_id_constraint",
|
|
3646
3732
|
["user_id", "tenant_id"],
|
|
@@ -3667,25 +3753,25 @@ async function ei(t) {
|
|
|
3667
3753
|
(e) => e.onDelete("cascade")
|
|
3668
3754
|
).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
3755
|
}
|
|
3670
|
-
async function
|
|
3756
|
+
async function ci(t) {
|
|
3671
3757
|
await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("login_sessions").execute(), await t.schema.dropTable("refresh_tokens").execute();
|
|
3672
3758
|
}
|
|
3673
|
-
const
|
|
3759
|
+
const li = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3674
3760
|
__proto__: null,
|
|
3675
|
-
down:
|
|
3676
|
-
up:
|
|
3761
|
+
down: ci,
|
|
3762
|
+
up: ii
|
|
3677
3763
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3678
|
-
async function
|
|
3764
|
+
async function di(t) {
|
|
3679
3765
|
await t.schema.dropTable("logins").execute(), await t.schema.dropTable("sessions_2").execute(), await t.schema.dropTable("refresh_tokens_2").execute();
|
|
3680
3766
|
}
|
|
3681
|
-
async function
|
|
3767
|
+
async function ui(t) {
|
|
3682
3768
|
}
|
|
3683
|
-
const
|
|
3769
|
+
const mi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3684
3770
|
__proto__: null,
|
|
3685
|
-
down:
|
|
3686
|
-
up:
|
|
3771
|
+
down: ui,
|
|
3772
|
+
up: di
|
|
3687
3773
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3688
|
-
async function
|
|
3774
|
+
async function hi(t) {
|
|
3689
3775
|
await t.schema.dropTable("custom_domains").execute(), await t.schema.createTable("custom_domains").addColumn(
|
|
3690
3776
|
"custom_domain_id",
|
|
3691
3777
|
"varchar(256)",
|
|
@@ -3696,107 +3782,119 @@ async function si(t) {
|
|
|
3696
3782
|
(e) => e.references("tenants.id").onDelete("cascade").notNull()
|
|
3697
3783
|
).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
3784
|
}
|
|
3699
|
-
async function
|
|
3785
|
+
async function _i(t) {
|
|
3700
3786
|
}
|
|
3701
|
-
const
|
|
3787
|
+
const fi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3702
3788
|
__proto__: null,
|
|
3703
|
-
down:
|
|
3704
|
-
up:
|
|
3789
|
+
down: _i,
|
|
3790
|
+
up: hi
|
|
3705
3791
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3706
|
-
async function
|
|
3792
|
+
async function pi(t) {
|
|
3707
3793
|
}
|
|
3708
|
-
async function
|
|
3794
|
+
async function gi(t) {
|
|
3709
3795
|
await t.schema.alterTable("users").dropColumn("phone_number").dropColumn("phone_verified").dropColumn("username").execute();
|
|
3710
3796
|
}
|
|
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
|
-
|
|
3797
|
+
const yi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3798
|
+
__proto__: null,
|
|
3799
|
+
down: gi,
|
|
3800
|
+
up: pi
|
|
3801
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
3802
|
+
async function wi(t) {
|
|
3803
|
+
await t.schema.createTable("forms").addColumn("id", "varchar(255)", (e) => e.primaryKey()).addColumn("name", "varchar(255)", (e) => e.notNull()).addColumn("type", "varchar(255)", (e) => e.notNull()).addColumn("tenant_id", "varchar(255)", (e) => e.notNull()).addColumn("client_id", "varchar(255)").addColumn("fields", "text", (e) => e.notNull()).addColumn("controls", "text").addColumn("redirect_uri", "varchar(2048)").addColumn("post_submit_action", "varchar(255)").addColumn("success_message", "text").addColumn("language", "varchar(10)").addColumn("active", "boolean", (e) => e.notNull().defaultTo(!0)).addColumn("layout", "text").addColumn("css", "text").addColumn("javascript", "text").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(), await t.schema.createIndex("forms_client_id_idx").on("forms").column("client_id").execute(), await t.schema.createIndex("forms_type_idx").on("forms").column("type").execute();
|
|
3804
|
+
}
|
|
3805
|
+
async function vi(t) {
|
|
3806
|
+
await t.schema.dropTable("forms").execute();
|
|
3807
|
+
}
|
|
3808
|
+
const Ni = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3809
|
+
__proto__: null,
|
|
3810
|
+
down: vi,
|
|
3811
|
+
up: wi
|
|
3812
|
+
}, Symbol.toStringTag, { value: "Module" })), ze = {
|
|
3813
|
+
m1_init: Ga,
|
|
3814
|
+
m2_magicLink: Ya,
|
|
3815
|
+
m3_updateAt: tr,
|
|
3816
|
+
m4_logTable: nr,
|
|
3817
|
+
m5_userProfile: ir,
|
|
3818
|
+
m6_sessions: dr,
|
|
3819
|
+
m7_passwords: hr,
|
|
3820
|
+
m8_logsTableNewFields: pr,
|
|
3821
|
+
m9_passwordTableNewField: wr,
|
|
3822
|
+
n01_codesTable: Cr,
|
|
3823
|
+
n11_universalLoginSession: Tr,
|
|
3824
|
+
n12_userFields: kr,
|
|
3825
|
+
n13_userEmailIndex: Ir,
|
|
3826
|
+
n14_profileDataField: Mr,
|
|
3827
|
+
n15_userEmailIndex: Lr,
|
|
3828
|
+
n16_userLocale: Er,
|
|
3829
|
+
n17_signingKeys: Ur,
|
|
3830
|
+
n18_logsFields: qr,
|
|
3831
|
+
n19_connectionsUserinfo: Gr,
|
|
3832
|
+
n20_missingFields: Yr,
|
|
3833
|
+
n21_sessionDeletedAt: tn,
|
|
3834
|
+
n22_dropLogsFields: nn,
|
|
3835
|
+
n23_dropUsersFields: cn,
|
|
3836
|
+
n24_logsIndexes: un,
|
|
3837
|
+
n25_logDescMaxLength: _n,
|
|
3838
|
+
n26_logsTableExtraFields: gn,
|
|
3839
|
+
n27_usersTableNameIndex: vn,
|
|
3840
|
+
n28_usersEmailConstrain: bn,
|
|
3841
|
+
n29_increaseOtpStateLength: Sn,
|
|
3842
|
+
n30_increaseTicketStateLength: $n,
|
|
3843
|
+
n31_branding: Pn,
|
|
3844
|
+
n32_indexesAndNotNull: Fn,
|
|
3845
|
+
n33_vendorIdInUniversalLoginSession: zn,
|
|
3846
|
+
n34_auth0ClientInUniversalLoginSession: Kn,
|
|
3847
|
+
n35_increaseUniversalSessionStateLength: Bn,
|
|
3848
|
+
n36_authenticationCodes: Vn,
|
|
3849
|
+
n37_disableSignUps: Hn,
|
|
3850
|
+
n38_otpIpAddress: Zn,
|
|
3851
|
+
n39_increaseUserAgentLength: ao,
|
|
3852
|
+
n40_userId: oo,
|
|
3853
|
+
n41_hooks: co,
|
|
3854
|
+
n42_userIdIndexes: mo,
|
|
3855
|
+
n43_userIdIndexes: fo,
|
|
3856
|
+
n44_codes: yo,
|
|
3857
|
+
n45_hookProperties: No,
|
|
3858
|
+
n46_loginAuth0Client: xo,
|
|
3859
|
+
n47_loginAuth0Client: Oo,
|
|
3860
|
+
n48_saml: Do,
|
|
3861
|
+
n49_removeFields: jo,
|
|
3862
|
+
n50_authParamsNonce: Ao,
|
|
3863
|
+
n51_connectionid: Jo,
|
|
3864
|
+
n52_cert: Ro,
|
|
3865
|
+
n53_codes_primary_key: Qo,
|
|
3866
|
+
n54_cleanup_tables: Wo,
|
|
3867
|
+
n55_logs_index: Xo,
|
|
3868
|
+
n56_application_fields: es,
|
|
3869
|
+
n57_prompt_settings: rs,
|
|
3870
|
+
n58_connection_client_id: ss,
|
|
3871
|
+
n59_connection_options: ls,
|
|
3872
|
+
n60_users_metadata: ms,
|
|
3873
|
+
n61_userLocales: fs,
|
|
3874
|
+
n62_prompt: ys,
|
|
3875
|
+
n63_connection_cleanup: Ns,
|
|
3876
|
+
n64_act_as: xs,
|
|
3877
|
+
n65_code_verifier: Os,
|
|
3878
|
+
n66_email_providers: Ds,
|
|
3879
|
+
n67_drop_tickets: js,
|
|
3880
|
+
n68_login_useragents: As,
|
|
3881
|
+
n70_refresh_tokens: Js,
|
|
3882
|
+
n71_session_new_fields: Rs,
|
|
3883
|
+
n72_session_primary_key: Qs,
|
|
3884
|
+
n73_drop_sessions: Ws,
|
|
3885
|
+
n74_custom_domains: Xs,
|
|
3886
|
+
n75_organizations: ei,
|
|
3887
|
+
n76_authorization_url_length: ri,
|
|
3888
|
+
n77_drop_sessions: si,
|
|
3889
|
+
n78_login_sessions: li,
|
|
3890
|
+
n79_drop_sessions_2: mi,
|
|
3891
|
+
n80_recreate_custom_domains: fi,
|
|
3892
|
+
n81_phone: yi,
|
|
3893
|
+
n82_forms: Ni
|
|
3796
3894
|
};
|
|
3797
|
-
async function
|
|
3895
|
+
async function Si(t, e = !1) {
|
|
3798
3896
|
e && console.log("migrating...");
|
|
3799
|
-
const a = new
|
|
3897
|
+
const a = new Le(ze), r = new Ce({
|
|
3800
3898
|
db: t,
|
|
3801
3899
|
provider: a
|
|
3802
3900
|
}), { error: o, results: n } = await r.migrateToLatest();
|
|
@@ -3807,9 +3905,9 @@ async function pi(t, e = !1) {
|
|
|
3807
3905
|
}), o)
|
|
3808
3906
|
throw console.error("failed to migrate"), console.error(o), o;
|
|
3809
3907
|
}
|
|
3810
|
-
async function
|
|
3908
|
+
async function Oi(t) {
|
|
3811
3909
|
console.log("migrating...");
|
|
3812
|
-
const e = new
|
|
3910
|
+
const e = new Le(ze), a = new Ce({
|
|
3813
3911
|
db: t,
|
|
3814
3912
|
provider: e
|
|
3815
3913
|
}), { error: r, results: o } = await a.migrateDown();
|
|
@@ -3818,31 +3916,32 @@ async function gi(t) {
|
|
|
3818
3916
|
}), r)
|
|
3819
3917
|
throw console.error("failed to migrate"), console.error(r), r;
|
|
3820
3918
|
}
|
|
3821
|
-
function
|
|
3919
|
+
function ki(t) {
|
|
3822
3920
|
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
|
-
|
|
3921
|
+
applications: Pt(t),
|
|
3922
|
+
branding: Zt(t),
|
|
3923
|
+
cleanup: Da(t),
|
|
3924
|
+
clients: Jt(t),
|
|
3925
|
+
codes: St(t),
|
|
3926
|
+
connections: zt(t),
|
|
3927
|
+
emailProviders: ba(t),
|
|
3928
|
+
customDomains: Ht(t),
|
|
3929
|
+
forms: Aa(t),
|
|
3930
|
+
hooks: oa(t),
|
|
3931
|
+
keys: Ut(t),
|
|
3932
|
+
loginSessions: pa(t),
|
|
3933
|
+
logs: dt(t),
|
|
3934
|
+
passwords: vt(t),
|
|
3935
|
+
promptSettings: wa(t),
|
|
3936
|
+
refreshTokens: $a(t),
|
|
3937
|
+
sessions: pt(t),
|
|
3938
|
+
tenants: ot(t),
|
|
3939
|
+
themes: ua(t),
|
|
3940
|
+
users: Ye(t)
|
|
3842
3941
|
};
|
|
3843
3942
|
}
|
|
3844
3943
|
export {
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3944
|
+
ki as default,
|
|
3945
|
+
Oi as migrateDown,
|
|
3946
|
+
Si as migrateToLatest
|
|
3848
3947
|
};
|